From c086497e66a88e1eea986e23a6c7bc9513d4f99c Mon Sep 17 00:00:00 2001 From: Niki Zadeh Date: Tue, 20 Aug 2019 13:53:13 -0400 Subject: [PATCH 1/3] Fix for specified ice restart issue #107 - Variable Ice%sCS%OSS%SST_C is not an ice state and hence is not in ice_model.res.nc However for SPECIFIED_ICE=True it should be updated after restart, otherwise the model would have a restart issue (#107) In specified ice this variable is read from data_table every time step. So that is also the easiest way to update it after a restart. - This update resolves issue#107. --- src/ice_model.F90 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ice_model.F90 b/src/ice_model.F90 index c4b65be1c9..0416dfac4f 100644 --- a/src/ice_model.F90 +++ b/src/ice_model.F90 @@ -1663,7 +1663,9 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow, ! model run and the input files. real, allocatable, dimension(:,:) :: & - h_ice_input, dummy ! Temporary arrays. + h_ice_input, dummy,dummy2d ! Temporary arrays. + real, allocatable, dimension(:,:,:) :: & + dummy3d ! Temporary arrays. real, allocatable, dimension(:,:) :: & str_x, str_y, stress_mag ! Temporary stress arrays @@ -2492,6 +2494,14 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow, query_initialized(Ice%Ice_fast_restart, 'rough_moist')) endif + if (specified_ice) then + allocate(dummy2d(sG%isc:sG%iec,sG%jsc:sG%jec)) + allocate(dummy3d(isc:iec,jsc:jec,2)) + call get_sea_surface(Ice%sCS%Time, Ice%sCS%OSS%SST_C(isc:iec,jsc:jec), & + dummy3d(isc:iec,jsc:jec,:), & + dummy2d(sG%isc:sG%iec,sG%jsc:sG%jec), ice_domain=Ice%slow_domain_NH, ts_in_K=.false. ) + deallocate(dummy2d,dummy3d) + endif else ! no restart file implies initialization with no ice sIST%part_size(:,:,:) = 0.0 sIST%part_size(:,:,0) = 1.0 From 9991d35038fc445b6a79d56fa2bf5ecd47c5571b Mon Sep 17 00:00:00 2001 From: Niki Zadeh Date: Wed, 21 Aug 2019 15:07:19 -0400 Subject: [PATCH 2/3] Fix for specified ice restart issue #107 - Variable Ice%sCS%OSS%SST_C is not an ice state and hence is not in ice_model.res.nc However for SPECIFIED_ICE=True it should be updated after restart, otherwise the model would have a restart issue (#107) In specified ice this variable is read from data_table every time step. So that is also the easiest way to update it after a restart. - This update resolves issue#107. - Adding some indication that SIS2 is being restored from restart files. With input_filename being 'n' or 'r' having no effect there is no indication in stdout whether restart files are being read or not. --- src/ice_model.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ice_model.F90 b/src/ice_model.F90 index 0416dfac4f..af9e522607 100644 --- a/src/ice_model.F90 +++ b/src/ice_model.F90 @@ -2281,6 +2281,7 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow, restart_path = trim(dirs%restart_input_dir)//trim(restart_file) if (file_exist(restart_path)) then + call callTree_enter("ice_model_init():restore_from_restart_files "//trim(restart_file)) ! Set values of IG%H_to_kg_m2 that will permit its absence from the restart ! file to be detected, and its difference from the value in this run to ! be corrected for. @@ -2494,6 +2495,10 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow, query_initialized(Ice%Ice_fast_restart, 'rough_moist')) endif + !When SPECIFIED_ICE=True variable Ice%sCS%OSS%SST_C is used for the skin temperature + !and should be updated during each restart. + !However it is not an ice state variable and hence is not in ice restarts. + !Updating it from specified_ice data avoids restart issues for such models. if (specified_ice) then allocate(dummy2d(sG%isc:sG%iec,sG%jsc:sG%jec)) allocate(dummy3d(isc:iec,jsc:jec,2)) @@ -2502,6 +2507,8 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow, dummy2d(sG%isc:sG%iec,sG%jsc:sG%jec), ice_domain=Ice%slow_domain_NH, ts_in_K=.false. ) deallocate(dummy2d,dummy3d) endif + + call callTree_leave("ice_model_init():restore_from_restart_files") else ! no restart file implies initialization with no ice sIST%part_size(:,:,:) = 0.0 sIST%part_size(:,:,0) = 1.0 From 226794e891930db5e144e27e9e453a3032b597a7 Mon Sep 17 00:00:00 2001 From: Niki Zadeh Date: Wed, 27 Nov 2019 10:35:52 -0500 Subject: [PATCH 3/3] Fix for specified ice restart issue #107 - Variable Ice%sCS%OSS%SST_C is not an ice state and hence is not in ice_model.res.nc However for SPECIFIED_ICE=True it should be updated after restart, otherwise the model would have a restart issue (#107) In specified ice this variable is read from data_table every time step. So that is also the easiest way to update it after a restart. - This update resolves issue#107. - Adding some indication that SIS2 is being restored from restart files. With input_filename being 'n' or 'r' having no effect there is no indication in stdout whether restart files are being read or not. - cleanup --- src/ice_model.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ice_model.F90 b/src/ice_model.F90 index af9e522607..d408334c3c 100644 --- a/src/ice_model.F90 +++ b/src/ice_model.F90 @@ -2500,11 +2500,10 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow, !However it is not an ice state variable and hence is not in ice restarts. !Updating it from specified_ice data avoids restart issues for such models. if (specified_ice) then - allocate(dummy2d(sG%isc:sG%iec,sG%jsc:sG%jec)) + allocate(dummy2d(isc:iec,jsc:jec)) allocate(dummy3d(isc:iec,jsc:jec,2)) call get_sea_surface(Ice%sCS%Time, Ice%sCS%OSS%SST_C(isc:iec,jsc:jec), & - dummy3d(isc:iec,jsc:jec,:), & - dummy2d(sG%isc:sG%iec,sG%jsc:sG%jec), ice_domain=Ice%slow_domain_NH, ts_in_K=.false. ) + dummy3d,dummy2d, ice_domain=Ice%slow_domain_NH, ts_in_K=.false. ) deallocate(dummy2d,dummy3d) endif