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.

Since we call 'accum_hist' after initializing the forcing, any forcing
field written to the initial condition has values corresponding to
msec=dt, whereas the ice state corresponds to msec=0, leading to an
inconsistency.

Fix that by calling 'accum_hist' to write the initial condition _before_
calling 'advance_timestep'. Since we now call 'accum_hist' before
initializing the forcing, any forcing field written to the initial
condition have its default, hard-coded value, instead of its value at
time=dt. An improvement would be to read the forcing at time=dt, write
the initial condition, advance the time step, and read the forcing
again, but let's not complicate things too much for now.
  • Loading branch information
phil-blain committed Mar 13, 2023
1 parent 9f4504d commit d72cdf9
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 d72cdf9

Please sign in to comment.