Skip to content

Commit

Permalink
drivers/{nemo_concepts,standalone}: write initial condition at initia…
Browse files Browse the repository at this point in the history
…l time

In CICE_InitMod::cice_init, we call ice_calendar::advance_timestep
before writing the initial condition, such that the 'time' variable in
the initial condition is not zero; it has a value of 1*dt (the model
time step). The initial condition filename also reflects this, since
'msec' (model seconds) also has a value of 1*dt and is used in
ice_history_shared::construct_filename. This leads to the initial
condition filename not corresponding to the model initialization
date/time but rather 1*dt later.

Fix that by calling 'accum_hist' to write the initial condition _before_
calling 'advance_timestep'.
  • Loading branch information
phil-blain committed Mar 8, 2023
1 parent 610c8a9 commit 25b7c2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cicecore/drivers/direct/nemo_concepts/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ subroutine cice_init
if (trim(runtype) == 'continue' .or. restart) &
call init_shortwave ! initialize radiative transfer

if (write_ic) call accum_hist(dt) ! write initial conditions

! determine the time and date at the end of the first timestep
call advance_timestep()

Expand Down Expand Up @@ -215,8 +217,6 @@ subroutine cice_init
call init_flux_atm ! initialize atmosphere fluxes sent to coupler
call init_flux_ocn ! initialize ocean fluxes sent to coupler

if (write_ic) call accum_hist(dt) ! write initial conditions

end subroutine cice_init

!=======================================================================
Expand Down
4 changes: 2 additions & 2 deletions cicecore/drivers/standalone/cice/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ subroutine cice_init
if (trim(runtype) == 'continue' .or. restart) &
call init_shortwave ! initialize radiative transfer

if (write_ic) call accum_hist(dt) ! write initial conditions

! tcraig, use advance_timestep here
! istep = istep + 1 ! update time step counters
! istep1 = istep1 + 1
Expand Down Expand Up @@ -243,8 +245,6 @@ subroutine cice_init
call init_flux_atm ! initialize atmosphere fluxes sent to coupler
call init_flux_ocn ! initialize ocean fluxes sent to coupler

if (write_ic) call accum_hist(dt) ! write initial conditions

if (my_task == master_task) then
call ice_memusage_print(nu_diag,subname//':end')
endif
Expand Down

0 comments on commit 25b7c2b

Please sign in to comment.