Skip to content

Commit

Permalink
+Pass US to SIS_C_dyn_read_alt_restarts
Browse files Browse the repository at this point in the history
  Pass a unit_scaling_type argument to SIS_C_dyn_read_alt_restarts and to its
caller, SIS_dyn_trans_read_alt_restarts.  Also call fix_restart_unit_scaling in
ice_model_init.  Answers in the Baltic test case are bitwise identical, but
there are new arguments.
  • Loading branch information
Hallberg-NOAA committed Oct 18, 2019
1 parent bedeace commit ce9d757
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/SIS_dyn_cgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1609,9 +1609,10 @@ end subroutine SIS_C_dyn_register_restarts
!! SIS C-grid dynamics module that might have been in the restart file,
!! specifically dealing with changing between symmetric and non-symmetric
!! memory restart files.
subroutine SIS_C_dyn_read_alt_restarts(CS, G, Ice_restart, restart_file, restart_dir)
subroutine SIS_C_dyn_read_alt_restarts(CS, G, US, Ice_restart, restart_file, restart_dir)
type(SIS_C_dyn_CS), pointer :: CS !< The control structure for this module
type(SIS_hor_grid_type), intent(in) :: G !< The horizontal grid type
type(unit_scale_type), intent(in) :: US !< A structure with unit conversion factors
type(restart_file_type), pointer :: Ice_restart !< The sea ice restart control structure
character(len=*), intent(in) :: restart_file !< The ice restart file name
character(len=*), intent(in) :: restart_dir !< The directory in which to find the restart files
Expand Down
5 changes: 3 additions & 2 deletions src/SIS_dyn_trans.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2098,16 +2098,17 @@ end subroutine SIS_dyn_trans_register_restarts
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!
!> SIS_dyn_trans_register_restarts allocates and registers any variables associated
!! slow ice dynamics and transport that need to be included in the restart files.
subroutine SIS_dyn_trans_read_alt_restarts(CS, G, Ice_restart, &
subroutine SIS_dyn_trans_read_alt_restarts(CS, G, US, Ice_restart, &
restart_file, restart_dir)
type(dyn_trans_CS), pointer :: CS !< The control structure for the SIS_dyn_trans module
type(unit_scale_type), intent(in) :: US !< A structure with unit conversion factors
type(SIS_hor_grid_type), intent(in) :: G !< The horizontal grid type
type(restart_file_type), pointer :: Ice_restart !< The sea ice restart control structure
character(len=*), intent(in) :: restart_file !< The ice restart file name
character(len=*), intent(in) :: restart_dir !< The directory in which to find the restart files

if (CS%Cgrid_dyn) then
call SIS_C_dyn_read_alt_restarts(CS%SIS_C_dyn_CSp, G, Ice_restart, &
call SIS_C_dyn_read_alt_restarts(CS%SIS_C_dyn_CSp, G, US, Ice_restart, &
restart_file, restart_dir)
endif

Expand Down
4 changes: 3 additions & 1 deletion src/ice_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow,
call ice_state_read_alt_restarts(sIST, sG, sIG, Ice%Ice_restart, &
restart_file, dirs%restart_input_dir)
if (.not.specified_ice) &
call SIS_dyn_trans_read_alt_restarts(Ice%sCS%dyn_trans_CSp, sG, Ice%Ice_restart, &
call SIS_dyn_trans_read_alt_restarts(Ice%sCS%dyn_trans_CSp, sG, US, Ice%Ice_restart, &
restart_file, dirs%restart_input_dir)

! Approximately initialize state fields that are not present
Expand Down Expand Up @@ -2714,6 +2714,8 @@ subroutine ice_model_init(Ice, Time_Init, Time, Time_step_fast, Time_step_slow,
endif
endif ! fast_ice_PE

call fix_restart_unit_scaling(US)

!nullify_domain perhaps could be called somewhere closer to set_domain
!but it should be called after restore_state() otherwise it causes a restart mismatch
call nullify_domain()
Expand Down

0 comments on commit ce9d757

Please sign in to comment.