Skip to content
Snippets Groups Projects

Forward to most current stage

Closed Lukas Kugler requested to merge master into consistent_config
9 files
+ 423
65
Compare changes
  • Side-by-side
  • Inline

Files

+ 21
19
@@ -78,29 +78,29 @@ def set_DART_nml(just_prior_values=False):
append_file(cluster.dartrundir + "/input.nml", rttov_nml)
def link_nature_to_dart_truth(time):
"""Set a symlink from the WRFout file to be used as nature to the run_DART folder
Args:
time (dt.datetime): Time at which observations will be made
"""
# get wrfout_d01 from nature run
shutil.copy(time.strftime(exp.nature+'/'+wrfout_format),
cluster.dartrundir + "/wrfout_d01")
# DART may need a wrfinput file as well, which serves as a template for dimension sizes
symlink(cluster.dartrundir + "/wrfout_d01",
def _prepare_DART_grid_template():
# DART needs a wrfinput file as a template for the grid
# No data will be read from this file, but the grid information must match exactly.
symlink(cluster.dartrundir + "/prior_ens1/wrfout_d01",
cluster.dartrundir + "/wrfinput_d01")
print("linked", time.strftime(exp.nature+'/'+wrfout_format),
"to", cluster.dartrundir + "/wrfout_d01")
def prepare_nature_dart(time):
print("linking nature to DART & georeferencing")
link_nature_to_dart_truth(time)
wrfout_add_geo.run(cluster.geo_em, cluster.dartrundir + "/wrfout_d01")
"""Prepares DART nature (wrfout_d01) if available
Args:
time (dt.datetime): Time at which observations will be made
"""
f_wrfout_nature = time.strftime(exp.nature+'/'+wrfout_format)
if os.path.exists(f_wrfout_nature):
print("linking nature to DART & georeferencing")
shutil.copy(f_wrfout_nature, cluster.dartrundir + "/wrfout_d01")
print("linked", f_wrfout_nature, "to", cluster.dartrundir + "/wrfout_d01")
wrfout_add_geo.run(cluster.geo_em, cluster.dartrundir + "/wrfout_d01")
else: # if nature is not available due to any reason
print('-> has no nature, not copying nature')
def prepare_prior_ensemble(assim_time, prior_init_time, prior_valid_time, prior_path_exp):
"""Prepares DART files for running filter
@@ -183,6 +183,8 @@ def run_perfect_model_obs(nproc=12, verbose=True):
"\n look for " + cluster.dartrundir + "/log.perfect_model_obs")
def filter(nproc=12):
_prepare_DART_grid_template()
print("time now", dt.datetime.now())
print("running filter")
os.chdir(cluster.dartrundir)
@@ -438,7 +440,7 @@ def get_obsseq_out(time):
if exp.use_existing_obsseq != False:
f_obsseq = time.strftime(exp.use_existing_obsseq)
copy(f_obsseq, cluster.dartrundir+'/obs_seq.out')
print(f_obsseq, 'copied to', cluster.dartrundir+'/obs_seq.out')
# print(f_obsseq, 'copied to', cluster.dartrundir+'/obs_seq.out')
oso = obsseq.ObsSeq(cluster.dartrundir + "/obs_seq.out")
else:
# decision to NOT use existing obs_seq.out file
Loading