From 95119a251312c4168a601d8682cb552a891e78eb Mon Sep 17 00:00:00 2001 From: Robert Hallberg Date: Mon, 16 May 2022 04:44:43 -0400 Subject: [PATCH] (*)Fix ice shelf dimensional rescaling bugs Fixed two minor bugs in the ice-shelf code that impede its performance when dimensional scaling is used. - Report rescaling factors of 1 in the ice shelf restart files, now that the variables are rescaled before being written to the restart files. Without this change, certain runs with enabled ice shelf capabilities will not reproduce across restarts when dimensional rescaling is enabled. - Pass the unit scaling type to the EOS_init call. Without this change, cases with an active ice shelf will not pass dimensional rescaling tests if there is a nonlinear equation of state. All answers are bitwise identical without dimensional rescaling or an active ice shelf, but in some cases answers will be changed so that now the code will pass some reproducibility tests. --- src/ice_shelf/MOM_ice_shelf.F90 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90 index a1766e7805..c9e83336b7 100644 --- a/src/ice_shelf/MOM_ice_shelf.F90 +++ b/src/ice_shelf/MOM_ice_shelf.F90 @@ -1556,7 +1556,7 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, CS%utide(:,:) = utide endif - call EOS_init(param_file, CS%eqn_of_state) + call EOS_init(param_file, CS%eqn_of_state, US) !! new parameters that need to be in MOM_input @@ -1768,11 +1768,8 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, call hchksum(ISS%area_shelf_h, "IS init: area_shelf_h", G%HI, haloshift=0, scale=US%L_to_m*US%L_to_m) endif - - CS%Time = Time - if (CS%active_shelf_dynamics .and. .not.CS%isthermo) then ISS%water_flux(:,:) = 0.0 endif @@ -1780,7 +1777,7 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, if (shelf_mass_is_dynamic) & call initialize_ice_shelf_dyn(param_file, Time, ISS, CS%dCS, G, US, CS%diag, new_sim, solo_ice_sheet_in) - call fix_restart_unit_scaling(US) + call fix_restart_unit_scaling(US, unscaled=.true.) call get_param(param_file, mdl, "SAVE_INITIAL_CONDS", save_IC, & "If true, save the ice shelf initial conditions.", default=.false.) @@ -1794,7 +1791,6 @@ subroutine initialize_ice_shelf(param_file, ocn_grid, Time, CS, diag, forces_in, filename=IC_file, write_ic=.true.) endif - CS%id_area_shelf_h = register_diag_field('ice_shelf_model', 'area_shelf_h', CS%diag%axesT1, CS%Time, & 'Ice Shelf Area in cell', 'meter-2', conversion=US%L_to_m**2) CS%id_shelf_mass = register_diag_field('ice_shelf_model', 'shelf_mass', CS%diag%axesT1, CS%Time, &