Skip to content
Snippets Groups Projects
Commit 2f44f8dd authored by lkugler's avatar lkugler
Browse files

Revert to the last point with working ipynb docs

This reverts commit 86151bf8.
parent 2850e011
Branches
No related tags found
No related merge requests found
......@@ -3,13 +3,15 @@ import os, sys, shutil, glob, warnings
import datetime as dt
from dartwrf.utils import script_to_str
from dartwrf.workflows import WorkFlows
from config.cfg import exp
from config.clusters import cluster
from dartwrf.workflows import *
if __name__ == "__main__":
"""
Run a cycled OSSE with WRF and DART.
"""
w = WorkFlows(exp_config='cfg.py', server_config='jet.py')
cluster.setup()
timedelta_integrate = dt.timedelta(minutes=15)
timedelta_btw_assim = dt.timedelta(minutes=15)
......@@ -24,20 +26,20 @@ if __name__ == "__main__":
last_assim_time = dt.datetime(2008, 7, 30, 13,30)
forecast_until = dt.datetime(2008, 7, 30, 18)
w.prepare_WRFrundir(init_time)
# id = w.run_ideal(depends_on=id)
# id = w.wrfinput_insert_wbubble(depends_on=id)
prepare_WRFrundir(init_time)
# id = run_ideal(depends_on=id)
# id = wrfinput_insert_wbubble(depends_on=id)
if True: # random
prior_path_exp = '/jetfs/home/lkugler/data/sim_archive/exp_v1.19_P2_noDA'
init_time = dt.datetime(2008, 7, 30, 12)
time = dt.datetime(2008, 7, 30, 13)
init_time = dt.datetime(2008, 7, 30, 13)
time = dt.datetime(2008, 7, 30, 14)
last_assim_time = dt.datetime(2008, 7, 30, 14)
forecast_until = dt.datetime(2008, 7, 30, 14, 18)
forecast_until = dt.datetime(2008, 7, 30, 14, 15)
w.prepare_WRFrundir(init_time)
# id = w.run_ideal(depends_on=id)
prepare_WRFrundir(init_time)
# id = run_ideal(depends_on=id)
# prior_path_exp = cluster.archivedir
# prior_path_exp = '/gpfs/data/fs71386/lkugler/sim_archive/exp_v1.19_P5+su_noDA'
......@@ -52,13 +54,13 @@ if __name__ == "__main__":
# i.e. 13z as a prior to assimilate 12z observations
prior_valid_time = time
id = w.assimilate(time, prior_init_time, prior_valid_time, prior_path_exp, depends_on=id)
id = assimilate(time, prior_init_time, prior_valid_time, prior_path_exp, depends_on=id)
# 1) Set posterior = prior
id = w.prepare_IC_from_prior(prior_path_exp, prior_init_time, prior_valid_time, depends_on=id)
id = prepare_IC_from_prior(prior_path_exp, prior_init_time, prior_valid_time, depends_on=id)
# 2) Update posterior += updates from assimilation
id = w.update_IC_from_DA(time, depends_on=id)
id = update_IC_from_DA(time, depends_on=id)
# How long shall we integrate?
timedelta_integrate = timedelta_btw_assim
......@@ -68,7 +70,7 @@ if __name__ == "__main__":
output_restart_interval = 9999 # no restart file after last assim
# 3) Run WRF ensemble
id = w.run_ENS(begin=time, # start integration from here
id = run_ENS(begin=time, # start integration from here
end=time + timedelta_integrate, # integrate until here
output_restart_interval=output_restart_interval,
depends_on=id)
......@@ -76,7 +78,7 @@ if __name__ == "__main__":
# as we have WRF output, we can use own exp path as prior
prior_path_exp = w.cluster.archivedir
id_sat = w.create_satimages(time, depends_on=id)
id_sat = create_satimages(time, depends_on=id)
# increment time
time += timedelta_btw_assim
......@@ -84,6 +86,6 @@ if __name__ == "__main__":
# update time variables
prior_init_time = time - timedelta_btw_assim
w.verify_sat(id_sat)
w.verify_wrf(id)
w.verify_fast(id)
verify_sat(id_sat)
verify_wrf(id)
verify_fast(id)
......@@ -25,7 +25,7 @@ def dict_to_py(d, outfile):
class WorkFlows(object):
def __init__(self, exp_config='cfg.py', server_config='server.py'):
"""Set up the experiment folder in `archivedir`, copy config files, backup scripts.
"""Set up the experiment folder in `archivedir`.
Args:
exp (str): Path to exp config file
......@@ -239,7 +239,7 @@ class WorkFlows(object):
def create_satimages(self, init_time, depends_on=None):
cmd = self.cluster.python_verif+' ~/RTTOV-WRF/run_init.py '+self.cluster.archivedir+init_time.strftime('/%Y-%m-%d_%H:%M/')
id = self.cluster.run_job(cmd, "RTTOV", cfg_update={"ntasks": "12", "time": "80", "mem": "180G"}, depends_on=[depends_on])
id = self.cluster.run_job(cmd, "RTTOV", cfg_update={"ntasks": "12", "time": "80", "mem": "200G"}, depends_on=[depends_on])
return id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment