@@ -137,8 +137,12 @@ subroutine cism_init_dycore(model)
137137 call eismint_surftemp(model% eismint_climate,model,time)
138138
139139 ! read forcing time slice if needed - this will overwrite values from IC file if there is a conflict.
140+ ! Note: The first 'model' is passed to the argument 'data', which is filled by calling glide_read.
140141 call glide_read_forcing(model, model)
141142
143+ ! Optionally, read all the time slices at once from selected forcing files.
144+ call glide_read_forcing_once(model, model)
145+
142146 call spinup_lithot(model)
143147
144148 call t_stopf(' initialization' )
@@ -225,8 +229,10 @@ subroutine cism_init_dycore(model)
225229
226230
227231 ! --- Output the initial state -------------
232+ ! Note: For a standard restart, the initial state is not output, because this state
233+ ! should already have been written to the output file when the previous run ended.
228234
229- if (model% options% is_restart == RESTART_FALSE .or. model% options% forcewrite_restart ) then
235+ if (model% options% is_restart == NO_RESTART .or. model% options% is_restart == HYBRID_RESTART ) then
230236 call t_startf(' initial_io_writeall' )
231237 call glide_io_writeall(model, model, time= time) ! MJH The optional time argument needs to be supplied
232238 ! since we have not yet set model%numerics%time
@@ -283,16 +289,16 @@ subroutine cism_run_dycore(model)
283289 do while (time + time_eps < model% numerics% tend)
284290
285291 ! !! SFP moved block of code for applying time dependent forcing read in from netCDF here,
286- ! !! as opposed to at the end of the time step (commented it out in it's original location for now)
292+ ! !! as opposed to at the end of the time step (commented it out in its original location for now)
287293 ! !! This is a short-term fix. See additional discussion as part of issue #19 (in cism-piscees github repo).
288294
289295 ! Forcing from a 'forcing' data file - will read time slice if needed
290- ! Note: Forcing is read from the appropriate time slice after every dynamic time step.
291- ! This is not strictly necessary if there are multiple time steps per forcing time slice.
292- ! We would need additional logic if we wanted to read a new time slice only when needed
293- ! to replace the current data. TODO: Add this logic?
294296 call t_startf(' read_forcing' )
295297 call glide_read_forcing(model, model)
298+
299+ ! If any forcing data have been read once into Fortran arrays at initialization,
300+ ! simply copy the data based on the current forcing time.
301+ call glide_retrieve_forcing(model, model)
296302 call t_stopf(' read_forcing' )
297303
298304 ! Increment time step
0 commit comments