Skip to content

Commit

Permalink
Add restart_coszen namelist option
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 committed Jul 7, 2020
1 parent fcf8989 commit 27dd3b7
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 24 deletions.
8 changes: 6 additions & 2 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ subroutine input_data
restart_pond_cesm, restart_pond_lvl, restart_pond_topo, restart_aero, &
restart_fsd, restart_iso
use ice_restart_shared, only: &
restart, restart_ext, restart_dir, restart_file, pointer_file, &
restart, restart_ext, restart_coszen, restart_dir, restart_file, pointer_file, &
runid, runtype, use_restart_time, restart_format, lcdf64
use ice_history_shared, only: hist_avg, history_dir, history_file, &
incond_dir, incond_file, version_name, &
Expand Down Expand Up @@ -149,7 +149,8 @@ subroutine input_data
dt, npt, ndtd, numin, &
runtype, runid, bfbflag, numax, &
ice_ic, restart, restart_dir, restart_file, &
restart_ext, use_restart_time, restart_format, lcdf64, &
restart_ext, restart_coszen, use_restart_time, restart_format, &
lcdf64, &
pointer_file, dumpfreq, dumpfreq_n, dump_last, &
diagfreq, diag_type, diag_file, history_format,&
print_global, print_points, latpnt, lonpnt, &
Expand Down Expand Up @@ -269,6 +270,7 @@ subroutine input_data
restart_dir = './' ! write to executable dir for default
restart_file = 'iced' ! restart file name prefix
restart_ext = .false. ! if true, read/write ghost cells
restart_coszen = .false. ! if true, read/write coszen
use_restart_time = .true. ! if true, use time info written in file
pointer_file = 'ice.restart_file'
restart_format = 'default' ! restart file format
Expand Down Expand Up @@ -563,6 +565,7 @@ subroutine input_data
call broadcast_scalar(restart, master_task)
call broadcast_scalar(restart_dir, master_task)
call broadcast_scalar(restart_ext, master_task)
call broadcast_scalar(restart_coszen, master_task)
call broadcast_scalar(use_restart_time, master_task)
call broadcast_scalar(restart_format, master_task)
call broadcast_scalar(lcdf64, master_task)
Expand Down Expand Up @@ -1458,6 +1461,7 @@ subroutine input_data
write(nu_diag,*) ' restart_dir = ', &
trim(restart_dir)
write(nu_diag,*) ' restart_ext = ', restart_ext
write(nu_diag,*) ' restart_coszen = ', restart_coszen
write(nu_diag,*) ' restart_format = ', &
trim(restart_format)
write(nu_diag,*) ' lcdf64 = ', &
Expand Down
15 changes: 3 additions & 12 deletions cicecore/cicedynB/infrastructure/ice_restart_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module ice_restart_driver
field_loc_center, field_loc_NEcorner, &
field_type_scalar, field_type_vector
use ice_restart_shared, only: restart_dir, pointer_file, &
runid, use_restart_time, lenstr
runid, use_restart_time, lenstr, restart_coszen
use ice_restart
use ice_exit, only: abort_ice
use ice_fileunits, only: nu_diag, nu_rst_pointer, nu_restart, nu_dump
Expand Down Expand Up @@ -58,9 +58,7 @@ subroutine dumpfile(filename_spec)
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
#ifdef CESMCOUPLED
use ice_flux, only: coszen
#endif
use ice_state, only: aicen, vicen, vsnon, trcrn, uvel, vvel

character(len=char_len_long), intent(in), optional :: filename_spec
Expand Down Expand Up @@ -132,9 +130,7 @@ subroutine dumpfile(filename_spec)
!-----------------------------------------------------------------
! radiation fields
!-----------------------------------------------------------------
#ifdef CESMCOUPLED
call write_restart_field(nu_dump,0,coszen,'ruf8','coszen',1,diag)
#endif
if (restart_coszen) call write_restart_field(nu_dump,0,coszen,'ruf8','coszen',1,diag)
call write_restart_field(nu_dump,0,scale_factor,'ruf8','scale_factor',1,diag)

call write_restart_field(nu_dump,0,swvdr,'ruf8','swvdr',1,diag)
Expand Down Expand Up @@ -209,9 +205,7 @@ subroutine restartfile (ice_ic)
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
#ifdef CESMCOUPLED
use ice_flux, only: coszen
#endif
use ice_grid, only: tmask, grid_type
use ice_state, only: trcr_depend, aice, vice, vsno, trcr, &
aice0, aicen, vicen, vsnon, trcrn, aice_init, uvel, vvel, &
Expand Down Expand Up @@ -310,11 +304,8 @@ subroutine restartfile (ice_ic)
if (my_task == master_task) &
write(nu_diag,*) 'radiation fields'

#ifdef CESMCOUPLED
call read_restart_field(nu_restart,0,coszen,'ruf8', &
! 'coszen',1,diag, field_loc_center, field_type_scalar)
if (restart_coszen) call read_restart_field(nu_restart,0,coszen,'ruf8', &
'coszen',1,diag)
#endif
call read_restart_field(nu_restart,0,scale_factor,'ruf8', &
'scale_factor',1,diag, field_loc_center, field_type_scalar)
call read_restart_field(nu_restart,0,swvdr,'ruf8', &
Expand Down
7 changes: 2 additions & 5 deletions cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module ice_restart
use netcdf
use ice_restart_shared, only: &
restart_ext, restart_dir, restart_file, pointer_file, &
runid, use_restart_time, lcdf64, lenstr
runid, use_restart_time, lcdf64, lenstr, restart_coszen
use ice_fileunits, only: nu_diag, nu_rst_pointer
use ice_exit, only: abort_ice
use icepack_intfc, only: icepack_query_parameters
Expand Down Expand Up @@ -227,10 +227,7 @@ subroutine init_restart_write(filename_spec)

call define_rest_field(ncid,'uvel',dims)
call define_rest_field(ncid,'vvel',dims)

#ifdef CESMCOUPLED
call define_rest_field(ncid,'coszen',dims)
#endif
if (restart_coszen) call define_rest_field(ncid,'coszen',dims)
call define_rest_field(ncid,'scale_factor',dims)
call define_rest_field(ncid,'swvdr',dims)
call define_rest_field(ncid,'swvdf',dims)
Expand Down
8 changes: 3 additions & 5 deletions cicecore/cicedynB/infrastructure/io/io_pio2/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ module ice_restart
use ice_kinds_mod
use ice_restart_shared, only: &
restart, restart_ext, restart_dir, restart_file, pointer_file, &
runid, runtype, use_restart_time, restart_format, lcdf64, lenstr
runid, runtype, use_restart_time, restart_format, lcdf64, lenstr, &
restart_coszen
use ice_pio
use pio
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
Expand Down Expand Up @@ -245,10 +246,7 @@ subroutine init_restart_write(filename_spec)

call define_rest_field(File,'uvel',dims)
call define_rest_field(File,'vvel',dims)

#ifdef CESMCOUPLED
call define_rest_field(File,'coszen',dims)
#endif
if (restart_coszen) call define_rest_field(File,'coszen',dims)
call define_rest_field(File,'scale_factor',dims)
call define_rest_field(File,'swvdr',dims)
call define_rest_field(File,'swvdf',dims)
Expand Down
1 change: 1 addition & 0 deletions cicecore/shared/ice_restart_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module ice_restart_shared
logical (kind=log_kind), public :: &
restart , & ! if true, initialize using restart file instead of defaults
restart_ext, & ! if true, read/write extended grid (with ghost cells)
restart_coszen, & ! if true, read/write coszen
use_restart_time ! if true, use time written in core restart file

character (len=char_len), public :: &
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/ice_in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ice_ic = './restart/iced_gx3_v5.nc'
restart = .true.
restart_ext = .false.
restart_coszen = .false.
use_restart_time = .true.
restart_format = 'default'
lcdf64 = .false.
Expand Down
1 change: 1 addition & 0 deletions doc/source/cice_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ either Celsius or Kelvin units).
"restart_format", ":math:`\bullet` restart file format", ""
"restart_[tracer]", ":math:`\bullet` if true, read tracer restart file", ""
"restart_ext", ":math:`\bullet` if true, read/write halo cells in restart file", ""
"restart_coszen", ":math:`\bullet` if true, read/write coszen in restart file", ""
"restore_bgc", ":math:`\bullet` if true, restore nitrate/silicate to data", ""
"restore_ice", ":math:`\bullet` if true, restore ice state along lateral boundaries", ""
"restore_ocn", ":math:`\bullet` restore sst to data", ""
Expand Down
1 change: 1 addition & 0 deletions doc/source/user_guide/ug_case_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ setup_nml
"``restart``", "logical", "initialize using restart file", "``.false.``"
"``restart_dir``", "string", "path to restart directory", "'./'"
"``restart_ext``", "logical", "read/write halo cells in restart files", "``.false.``"
"``restart_coszen``", "logical", "read/write coszen in restart files", "``.false.``"
"``restart_file``", "string", "output file prefix for restart dump", "'iced'"
"``restart_format``", "``default``", "read/write restart file with default format", "``default``"
"", "``pio_pnetcdf``", "read/write restart files with pnetcdf in pio", ""
Expand Down
4 changes: 4 additions & 0 deletions doc/source/user_guide/ug_implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,10 @@ An additional namelist option, ``restart_ext`` specifies whether halo cells
are included in the restart files. This option is useful for tripole and
regional grids, but can not be used with PIO.

An additional namelist option, ``restart_coszen`` specifies whether the
cosine of the zenith angle is included in the restart files. This is mainly
used in coupled models.

MPI is initialized in *init\_communicate* for both coupled and
stand-alone MPI runs. The ice component communicates with a flux coupler
or other climate components via external routines that handle the
Expand Down

0 comments on commit 27dd3b7

Please sign in to comment.