Skip to content
Snippets Groups Projects
Commit 52d27178 authored by lkugler's avatar lkugler
Browse files

change from nature_wrfout to nature_expname

parent 01afdeb5
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,7 @@ exp.superob_km = False # False or int (spatial averaging of observations, unit: ...@@ -9,8 +9,7 @@ exp.superob_km = False # False or int (spatial averaging of observations, unit:
exp.use_existing_obsseq = False # False or pathname (use precomputed obs_seq.out files) exp.use_existing_obsseq = False # False or pathname (use precomputed obs_seq.out files)
#exp.use_existing_obsseq = '/users/students/lehre/advDA_s2023/dartwrf_tutorial/very_cold_observation.out' #exp.use_existing_obsseq = '/users/students/lehre/advDA_s2023/dartwrf_tutorial/very_cold_observation.out'
# path to the nature run, where we take observations from exp.nature_expname = 'exp_v1.18_P1_nature+1'
exp.nature_wrfout = '/mnt/jetfs/scratch/lkugler/data/sim_archive/exp_v1.18_P1_nature/2008-07-30_06:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
exp.input_profile = '/mnt/jetfs/home/lkugler/data/initial_profiles/wrf/ens/2022-03-31/raso.fc.<iens>.wrfprof' exp.input_profile = '/mnt/jetfs/home/lkugler/data/initial_profiles/wrf/ens/2022-03-31/raso.fc.<iens>.wrfprof'
......
import os, sys, shutil, warnings import os, sys, shutil, warnings, glob
import time as time_module import time as time_module
import datetime as dt import datetime as dt
import numpy as np import numpy as np
...@@ -21,16 +21,16 @@ def link_nature_to_dart_truth(time): ...@@ -21,16 +21,16 @@ def link_nature_to_dart_truth(time):
Args: Args:
time (dt.datetime): Time at which observations will be made time (dt.datetime): Time at which observations will be made
""" """
# get wrfout_d01 from nature run # get wrfout_d01 from nature run
shutil.copy(time.strftime(exp.nature_wrfout), # find the file in any init directory
cluster.dart_rundir + "/wrfout_d01") fformat = 'wrfout_d01_%Y-%m-%d_%H:%M:%S'
f_nat = glob.glob(cluster.archive_base + '/' + exp.nature_expname + '/*/1/'+time.strftime(fformat))[0]
shutil.copy(f_nat, cluster.dart_rundir + "/wrfout_d01")
# DART may need a wrfinput file as well, which serves as a template for dimension sizes # DART may need a wrfinput file as well ?!
symlink(cluster.dart_rundir + "/wrfout_d01", symlink(cluster.dart_rundir + "/wrfout_d01",
cluster.dart_rundir + "/wrfinput_d01") cluster.dart_rundir + "/wrfinput_d01")
print("linked", time.strftime(exp.nature_wrfout), print("linked", f_nat, "to", cluster.dart_rundir + "/wrfout_d01")
"to", cluster.dart_rundir + "/wrfout_d01")
def prepare_nature_dart(time): def prepare_nature_dart(time):
......
...@@ -281,9 +281,6 @@ def write_namelist(just_prior_values=False): ...@@ -281,9 +281,6 @@ def write_namelist(just_prior_values=False):
nml = read_namelist(cluster.dart_srcdir + "/input.nml") nml = read_namelist(cluster.dart_srcdir + "/input.nml")
# make sure that observations defined in `exp.observations` are assimilated
nml['&obs_kind_nml']['assimilate_these_obs_types'] = [list_obstypes]
# dont compute posterior, just evaluate prior # dont compute posterior, just evaluate prior
if just_prior_values: if just_prior_values:
nml['&filter_nml']['compute_posterior'] = [['.false.']] nml['&filter_nml']['compute_posterior'] = [['.false.']]
...@@ -293,6 +290,9 @@ def write_namelist(just_prior_values=False): ...@@ -293,6 +290,9 @@ def write_namelist(just_prior_values=False):
nml['&obs_kind_nml']['assimilate_these_obs_types'] = [[]] nml['&obs_kind_nml']['assimilate_these_obs_types'] = [[]]
nml['&obs_kind_nml']['evaluate_these_obs_types'] = [list_obstypes] nml['&obs_kind_nml']['evaluate_these_obs_types'] = [list_obstypes]
if len(list_obstypes) > 0:
# make sure that observations defined in `exp.observations` are assimilated
nml['&obs_kind_nml']['assimilate_these_obs_types'] = [list_obstypes]
# write localization variables # write localization variables
nml['&assim_tools_nml']['special_localization_obs_types'] = [list_obstypes] nml['&assim_tools_nml']['special_localization_obs_types'] = [list_obstypes]
......
...@@ -49,6 +49,7 @@ if True: # to continue a nature ...@@ -49,6 +49,7 @@ if True: # to continue a nature
depends_on=id) depends_on=id)
# integration time # integration time
start = time
end = next_restart end = next_restart
id = w.run_ENS(begin=start, end=end, id = w.run_ENS(begin=start, end=end,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment