@@ -93,7 +93,6 @@ def __init__(
9393 self .add_yaml_file ('polaris.ocean.config' , 'output.yaml' )
9494
9595 self .add_input_file (filename = 'init.nc' , target = '../init/init.nc' )
96- self .add_input_file (filename = 'forcing.nc' , target = '../init/forcing.nc' )
9796
9897 self .add_output_file (
9998 filename = 'output.nc' ,
@@ -195,32 +194,58 @@ def dynamic_model_config(self, at_setup):
195194 f'maximum value is { nu_max } or decrease the time step'
196195 )
197196
197+ model = config .get ('ocean' , 'model' )
198198 options = {'config_dt' : dt_str , 'config_density0' : rho_0 }
199199 self .add_model_config_options (
200200 options = options , config_model = 'mpas-ocean'
201201 )
202202
203203 if self .run_time_steps is not None :
204+ output_interval_units = 'Seconds'
204205 run_duration = ceil (self .run_time_steps * dt )
205206 stop_time_str = time .strftime (
206207 '0001-01-01_%H:%M:%S' , time .gmtime (run_duration )
207208 )
208- output_interval_str = time .strftime (
209- '0000_%H:%M:%S' , time .gmtime (run_duration )
210- )
209+ if model == 'omega' :
210+ output_interval_str = str (run_duration )
211+ else :
212+ output_interval_str = get_time_interval_string (
213+ seconds = run_duration
214+ )
211215 else :
216+ output_interval = 1
217+ output_interval_units = 'Months'
212218 run_duration = config .getfloat ('barotropic_gyre' , 'run_duration' )
213219 stop_time_str = time .strftime (
214220 f'{ run_duration + 1.0 :04g} -01-01_00:00:00'
215221 )
216- output_interval_str = time .strftime ('0000-01-00_00:00:00' )
222+ if model == 'omega' :
223+ output_interval_str = str (output_interval )
224+ else :
225+ output_interval_str = get_time_interval_string (
226+ days = output_interval * 30.0
227+ )
217228
218229 slip_factor_dict = {'no-slip' : 0.0 , 'free-slip' : 1.0 }
230+ time_integrator = config .get ('barotropic_gyre' , 'time_integrator' )
231+ time_integrator_map = dict ([('RK4' , 'RungeKutta4' )])
232+ if model == 'omega' :
233+ if time_integrator in time_integrator_map .keys ():
234+ time_integrator = time_integrator_map [time_integrator ]
235+ else :
236+ print (
237+ 'Warning: mapping from time integrator '
238+ f'{ time_integrator } to omega not found, '
239+ 'retaining name given in config'
240+ )
241+
219242 replacements = dict (
220243 dt = dt_str ,
221244 dt_btr = dt_btr_str ,
222245 stop_time = stop_time_str ,
223246 output_interval = output_interval_str ,
247+ output_interval_units = output_interval_units ,
248+ time_integrator = time_integrator ,
224249 nu = f'{ nu :02g} ' ,
225250 slip_factor = f'{ slip_factor_dict [self .boundary_condition ]:02g} ' ,
226251 )
@@ -232,6 +257,16 @@ def dynamic_model_config(self, at_setup):
232257 template_replacements = replacements ,
233258 )
234259
260+ def setup (self ):
261+ """
262+ TEMP: symlink initial condition to name hard-coded in Omega
263+ """
264+ super ().setup ()
265+ model = self .config .get ('ocean' , 'model' )
266+ # TODO: remove as soon as Omega no longer hard-codes this file
267+ if model == 'omega' :
268+ self .add_input_file (filename = 'OmegaMesh.nc' , target = 'init.nc' )
269+
235270 def compute_max_time_step (self , config ):
236271 """
237272 Compute the approximate maximum time step for stability
0 commit comments