Skip to content
Snippets Groups Projects
Commit 199ffd6b authored by lkugler's avatar lkugler
Browse files

hist_interval, radt as arguments to run_ENS

parent f726bc1a
No related branches found
No related tags found
No related merge requests found
......@@ -207,7 +207,7 @@ class WorkFlows(object):
return id
def run_ENS(self, begin, end, depends_on=None, first_minute=False,
input_is_restart=True, output_restart_interval=720):
input_is_restart=True, output_restart_interval=720, hist_interval=5, radt=5):
"""Run the forecast ensemble
Args:
......@@ -217,6 +217,8 @@ class WorkFlows(object):
first_minute (bool, optional): if True, run the first minute of the forecast
input_is_restart (bool, optional): if True, start WRF from WRFrst file (restart mode)
output_restart_interval (int, optional): interval in minutes between output of WRFrst files
hist_interval (int, optional): interval in minutes between output of WRF history files
radt (int, optional): time step of radiation scheme
Returns:
str: job ID of the submitted job
......@@ -227,12 +229,13 @@ class WorkFlows(object):
args = [self.cluster.python, self.cluster.scripts_rundir+'/prepare_namelist.py',
begin.strftime('%Y-%m-%d_%H:%M'), end.strftime('%Y-%m-%d_%H:%M'),
str(hist_interval), '--radt='+str(radt), '--restart='+restart_flag,]
if output_restart_interval:
args.append('--restart_interval='+str(int(float(output_restart_interval))))
return self.cluster.run_job(' '.join(args), "preWRF", cfg_update=dict(time="2"), depends_on=[depends_on])
return self.cluster.run_job(' '.join(args), "preWRF",
cfg_update=dict(time="2"), depends_on=[depends_on])
id = depends_on
restart_flag = '.false.' if not input_is_restart else '.true.'
wrf_cmd = script_to_str(self.cluster.run_WRF
......@@ -240,13 +243,13 @@ class WorkFlows(object):
).replace('<cluster.wrf_rundir_base>', self.cluster.wrf_rundir_base
).replace('<cluster.wrf_modules>', self.cluster.wrf_modules)
# first minute forecast (needed for validating a radiance assimilation)
if first_minute:
id = prepare_WRF_inputfiles(begin, begin+dt.timedelta(minutes=1),
hist_interval=1, # to get an output after 1 minute
radt=1, # to get a cloud fraction CFRAC after 1 minute
output_restart_interval=output_restart_interval, depends_on=id)
radt = 1, # to get a cloud fraction CFRAC after 1 minute
output_restart_interval=output_restart_interval,
depends_on=id)
id = self.cluster.run_job(wrf_cmd, "WRF-"+self.exp.expname,
cfg_update={"array": "1-"+str(self.cluster.size_jobarray), "ntasks": "10", "nodes": "1",
......@@ -254,7 +257,12 @@ class WorkFlows(object):
depends_on=[id])
# forecast for the whole forecast duration
id = prepare_WRF_inputfiles(begin, end, output_restart_interval=output_restart_interval, depends_on=id)
id = prepare_WRF_inputfiles(begin, end,
hist_interval=hist_interval,
radt=radt,
output_restart_interval=output_restart_interval,
depends_on=id)
time_in_simulation_hours = (end-begin).total_seconds()/3600
runtime_wallclock_mins_expected = int(8+time_in_simulation_hours*9) # usually below 9 min/hour
id = self.cluster.run_job(wrf_cmd, "WRF-"+self.exp.expname,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment