@@ -96,6 +96,10 @@ def read_yaml(self):
9696 self .vgrid_fn = hotstart_info ['vgrid_input_file' ]
9797 variables = list (hotstart_info .keys ())
9898
99+ if 'restart_time' in hotstart_info .keys ():
100+ self .restart_time = hotstart_info ['restart_time' ]
101+ else :
102+ self .restart_time = None
99103 if 'crs' in hotstart_info .keys ():
100104 self .crs = hotstart_info ['crs' ]
101105
@@ -130,7 +134,7 @@ def read_yaml(self):
130134
131135 # remove these items from the list.
132136 rfl = ['hgrid_input_file' , 'vgrid_input_file' , 'date' , 'vgrid_version' ,
133- 'crs' , 'param_nml' , 'modules' , 'output_fn' ,'run_start' ,'time_step' ,'sediment_input_file' ]
137+ 'crs' , 'param_nml' , 'modules' , 'output_fn' ,'run_start' ,'restart_time' , ' time_step' ,'sediment_input_file' ]
134138 variables = [v for v in variables if v not in rfl ]
135139 self .variables = variables
136140 # 5.8 and below is the old version
@@ -322,7 +326,11 @@ def initialize_netcdf(self, default_turbulence=True):
322326 self .run_start = self .date
323327 run_start = pd .to_datetime (self .run_start )
324328 run_start_str = run_start .strftime ("%Y-%m-%dT%H:%M" )
325- restart_time = pd .to_datetime (self .date )
329+
330+ if self .restart_time is not None :
331+ restart_time = pd .to_datetime (self .restart_time )
332+ else :
333+ restart_time = pd .to_datetime (self .date )
326334 restart_sec = (restart_time - run_start ).total_seconds ()
327335 restart_timestr = restart_time .strftime ("%Y%m%d" )
328336 dt = self .time_step
0 commit comments