Skip to content

Commit

Permalink
add num_rest_files to ocean_model_restart
Browse files Browse the repository at this point in the history
  • Loading branch information
alperaltuntas committed Aug 4, 2020
1 parent 2fe90f2 commit ff27ad5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions config_src/nuopc_driver/mom_ocean_model_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -671,14 +671,15 @@ subroutine update_ocean_model(Ice_ocean_boundary, OS, Ocean_sfc, &
end subroutine update_ocean_model

!> This subroutine writes out the ocean model restart file.
subroutine ocean_model_restart(OS, timestamp, restartname)
subroutine ocean_model_restart(OS, timestamp, restartname, num_rest_files)
type(ocean_state_type), pointer :: OS !< A pointer to the structure containing the
!! internal ocean state being saved to a restart file
character(len=*), optional, intent(in) :: timestamp !< An optional timestamp string that should be
!! prepended to the file name. (Currently this is unused.)
character(len=*), optional, intent(in) :: restartname !< Name of restart file to use
!! This option distinguishes the cesm interface from the
!! non-cesm interface
integer, optional, intent(out) :: num_rest_files !< number of restart files written

if (.not.MOM_state_is_synchronized(OS%MOM_CSp)) &
call MOM_error(WARNING, "End of MOM_main reached with inconsistent "//&
Expand All @@ -689,8 +690,13 @@ subroutine ocean_model_restart(OS, timestamp, restartname)
"restart files can only be created after the buoyancy forcing is applied.")

if (present(restartname)) then
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%restart_CSp, GV=OS%GV, filename=restartname)
if (present(num_rest_files)) then
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%restart_CSp, GV=OS%GV, filename=restartname, num_rest_files=num_rest_files)
else
call save_restart(OS%dirs%restart_output_dir, OS%Time, OS%grid, &
OS%restart_CSp, GV=OS%GV, filename=restartname)
endif
call forcing_save_restart(OS%forcing_CSp, OS%grid, OS%Time, &
OS%dirs%restart_output_dir) ! Is this needed?
if (OS%use_ice_shelf) then
Expand Down

0 comments on commit ff27ad5

Please sign in to comment.