Skip to content
Snippets Groups Projects
Commit 1ce11e11 authored by lkugler's avatar lkugler
Browse files

.

parent 448bfcf5
No related branches found
No related tags found
No related merge requests found
...@@ -9,13 +9,13 @@ class ExperimentConfiguration(object): ...@@ -9,13 +9,13 @@ class ExperimentConfiguration(object):
exp = ExperimentConfiguration() exp = ExperimentConfiguration()
exp.expname = "exp_v1.16_P0-4_Radar" exp.expname = "exp_v1.16_P1_40mem"
exp.model_dx = 2000 exp.model_dx = 2000
exp.timestep = 10 exp.timestep = 8
exp.n_ens = 40 exp.n_ens = 40
exp.n_nodes = 10 exp.n_nodes = 10
n_obs = 1600 # so: 64:8x8 rad:10; 10km res: 1600:40x40 # radar: n_obs for each observation height level n_obs = 1600 # 50km res: 64:8x8; 10km res: 1600:40x40 # radar: n_obs for each observation height level
vis = dict(plotname='VIS 0.6µm', plotunits='[1]', vis = dict(plotname='VIS 0.6µm', plotunits='[1]',
kind='MSG_4_SEVIRI_BDRF', kind='MSG_4_SEVIRI_BDRF',
...@@ -34,17 +34,17 @@ radar = dict(plotname='Radar reflectivity', plotunits='[dBz]', ...@@ -34,17 +34,17 @@ radar = dict(plotname='Radar reflectivity', plotunits='[dBz]',
kind='RADAR_REFLECTIVITY', kind='RADAR_REFLECTIVITY',
n_obs=n_obs, err_std=5., n_obs=n_obs, err_std=5.,
heights=np.arange(1000, 15001, 1000), heights=np.arange(1000, 15001, 1000),
cov_loc_radius_km=20, cov_loc_vert_km=2) cov_loc_radius_km=30, cov_loc_vert_km=4)
t2m = dict(plotname='SYNOP Temperature', plotunits='[K]', t2m = dict(plotname='SYNOP Temperature', plotunits='[K]',
kind='SYNOP_TEMPERATURE', n_obs=n_obs, err_std=0.5, kind='SYNOP_TEMPERATURE', n_obs=n_obs, err_std=0.1,
cov_loc_radius_km=32, cov_loc_vert_km=1) cov_loc_radius_km=20, cov_loc_vert_km=3)
psfc = dict(plotname='SYNOP Pressure', plotunits='[dBz]', psfc = dict(plotname='SYNOP Pressure', plotunits='[dBz]',
kind='SYNOP_SURFACE_PRESSURE', n_obs=n_obs, err_std=50., kind='SYNOP_SURFACE_PRESSURE', n_obs=n_obs, err_std=50.,
cov_loc_radius_km=32, cov_loc_vert_km=5) cov_loc_radius_km=32, cov_loc_vert_km=5)
exp.observations = [radar, ] #ir108, vis, wv73] # ir108, wv73, vis] exp.observations = [ ] #ir108, vis, wv73] # ir108, wv73, vis]
# directory paths depend on the name of the experiment # directory paths depend on the name of the experiment
cluster.expname = exp.expname cluster.expname = exp.expname
...@@ -26,9 +26,9 @@ vsc.dart_srcdir = '/home/fs71386/lkugler/DART/DART-9.9.0/models/wrf/work' ...@@ -26,9 +26,9 @@ vsc.dart_srcdir = '/home/fs71386/lkugler/DART/DART-9.9.0/models/wrf/work'
vsc.dartrundir = '/home/fs71386/lkugler/run_DART' vsc.dartrundir = '/home/fs71386/lkugler/run_DART'
vsc.scriptsdir = '/home/fs71386/lkugler/DART-WRF/scripts' vsc.scriptsdir = '/home/fs71386/lkugler/DART-WRF/scripts'
vsc.nature_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.16_P0_nature/2008-07-30_06:00/4/wrfout_d01_%Y-%m-%d_%H:%M:%S' vsc.nature_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.16_P1_nature/2008-07-30_06:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
#vsc.input_profile = '/home/fs71386/lkugler/wrf_sounding/data/wrf/ens/from_LMU/raso.nat.<iens>.wrfprof' #vsc.input_profile = '/home/fs71386/lkugler/wrf_profiles/data/wrf/ens/from_LMU/raso.nat.<iens>.wrfprof'
vsc.input_profile = '/home/fs71386/lkugler/wrf_sounding/data/wrf/ens/from_LMU/raso.raso.<iens>.wrfprof' vsc.input_profile = '/home/fs71386/lkugler/wrf_profiles/data/wrf/ens/2021-05-04/raso.fc.<iens>.wrfprof'
vsc.ideal = vsc.userdir+'/compile/bin/ideal-v4.2.2_v1.16.exe' vsc.ideal = vsc.userdir+'/compile/bin/ideal-v4.2.2_v1.16.exe'
vsc.wrfexe = vsc.userdir+'/compile/bin/wrf-v4.2.2_v1.16.exe' vsc.wrfexe = vsc.userdir+'/compile/bin/wrf-v4.2.2_v1.16.exe'
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
high level control script high level control script
submitting jobs into SLURM queue submitting jobs into SLURM queue
""" """
import os, sys, shutil import os, sys, shutil, glob
import datetime as dt import datetime as dt
from slurmpy import Slurm from slurmpy import Slurm
from config.cfg import exp, cluster from config.cfg import exp, cluster
from scripts.utils import script_to_str, symlink from scripts.utils import script_to_str, symlink
if __name__ == "__main__":
# necessary to find modules in folder, since SLURM runs the script elsewhere # necessary to find modules in folder, since SLURM runs the script elsewhere
sys.path.append(os.getcwd()) sys.path.append(os.getcwd())
...@@ -68,7 +68,7 @@ def backup_scripts(): ...@@ -68,7 +68,7 @@ def backup_scripts():
def prepare_wrfinput(): def prepare_wrfinput():
"""Create WRF/run directories and wrfinput files """Create WRF/run directories and wrfinput files
""" """
s = my_Slurm("prep_wrfinput", cfg_update={"time": "5", "mail-type": "BEGIN"}) s = my_Slurm("prep_wrfinput", cfg_update={"time": "10", "mail-type": "BEGIN"})
id = s.run(cluster.python+' '+cluster.scriptsdir+'/prepare_wrfinput.py') id = s.run(cluster.python+' '+cluster.scriptsdir+'/prepare_wrfinput.py')
cmd = """# run ideal.exe in parallel, then add geodata cmd = """# run ideal.exe in parallel, then add geodata
...@@ -148,7 +148,7 @@ def run_ENS(begin, end, depends_on=None, first_minute=True): ...@@ -148,7 +148,7 @@ def run_ENS(begin, end, depends_on=None, first_minute=True):
depends_on=[id]) depends_on=[id])
time_in_simulation_hours = (end-begin).total_seconds()/3600 time_in_simulation_hours = (end-begin).total_seconds()/3600
runtime_wallclock_mins_expected = int(6+time_in_simulation_hours*10) # usually below 8 min/hour runtime_wallclock_mins_expected = int(6+time_in_simulation_hours*10) # usually below 9 min/hour
s = my_Slurm("runWRF2", cfg_update={"nodes": "1", "array": "1-"+str(exp.n_nodes), s = my_Slurm("runWRF2", cfg_update={"nodes": "1", "array": "1-"+str(exp.n_nodes),
"time": str(runtime_wallclock_mins_expected), "mem-per-cpu": "2G"}) "time": str(runtime_wallclock_mins_expected), "mem-per-cpu": "2G"})
cmd = script_to_str(cluster.run_WRF).replace('<expname>', exp.expname) cmd = script_to_str(cluster.run_WRF).replace('<expname>', exp.expname)
...@@ -194,7 +194,7 @@ def assimilate(assim_time, prior_init_time, ...@@ -194,7 +194,7 @@ def assimilate(assim_time, prior_init_time,
s = my_Slurm("Assim", cfg_update={"nodes": "1", "ntasks": "96", "time": "30", s = my_Slurm("Assim", cfg_update={"nodes": "1", "ntasks": "96", "time": "30",
"mem": "300G", "ntasks-per-node": "96", "ntasks-per-core": "2"}) "mem": "300G", "ntasks-per-node": "96", "ntasks-per-core": "2"})
id = s.run(cluster.python+' '+cluster.scriptsdir+'/assim_synth_obs.py ' id = s.run(cluster.python+' '+cluster.scriptsdir+'/assim_synth_obs.py '
+time.strftime('%Y-%m-%d_%H:%M'), depends_on=[id]) +assim_time.strftime('%Y-%m-%d_%H:%M'), depends_on=[id])
# # actuall assimilation step # # actuall assimilation step
# s = my_Slurm("Assim", cfg_update=dict(nodes="1", ntasks="48", time="50", mem="200G")) # s = my_Slurm("Assim", cfg_update=dict(nodes="1", ntasks="48", time="50", mem="200G"))
...@@ -224,18 +224,22 @@ def mailme(depends_on=None): ...@@ -224,18 +224,22 @@ def mailme(depends_on=None):
s = my_Slurm("AllFinished", cfg_update={"time": "1", "mail-type": "BEGIN"}) s = my_Slurm("AllFinished", cfg_update={"time": "1", "mail-type": "BEGIN"})
s.run('sleep 1', depends_on=[depends_on]) s.run('sleep 1', depends_on=[depends_on])
def gen_obsseq(depends_on=None):
s = my_Slurm("obsseq_netcdf", cfg_update={"time": "10", "mail-type": "FAIL,END"})
s.run(cluster.python+' '+cluster.scriptsdir+'/obsseq_to_netcdf.py',
depends_on=[depends_on])
################################ ################################
if __name__ == "__main__": if __name__ == "__main__":
print('starting osse') print('starting osse')
timedelta_integrate = dt.timedelta(minutes=45) timedelta_integrate = dt.timedelta(minutes=75)
timedelta_btw_assim = dt.timedelta(minutes=30) timedelta_btw_assim = dt.timedelta(minutes=60)
backup_scripts() backup_scripts()
id = None id = None
start_from_existing_state = True start_from_existing_state = False
is_new_run = not start_from_existing_state is_new_run = not start_from_existing_state
if is_new_run: if is_new_run:
...@@ -265,7 +269,7 @@ if __name__ == "__main__": ...@@ -265,7 +269,7 @@ if __name__ == "__main__":
assim_time = integration_end_time assim_time = integration_end_time
prior_init_time = init_time prior_init_time = init_time
while time <= dt.datetime(2008, 7, 30, 15): while time <= dt.datetime(2008, 7, 30, 20):
id = assimilate(assim_time, id = assimilate(assim_time,
prior_init_time, prior_init_time,
...@@ -290,4 +294,4 @@ if __name__ == "__main__": ...@@ -290,4 +294,4 @@ if __name__ == "__main__":
assim_time = time assim_time = time
prior_init_time = time - timedelta_btw_assim prior_init_time = time - timedelta_btw_assim
mailme(id) gen_obsseq(id) # mailme(id)
...@@ -83,9 +83,9 @@ def set_DART_nml(sat_channel=False, cov_loc_radius_km=32, cov_loc_vert_km=False, ...@@ -83,9 +83,9 @@ def set_DART_nml(sat_channel=False, cov_loc_radius_km=32, cov_loc_vert_km=False,
'<cov_loc_radian>': str(cov_loc_radian)} '<cov_loc_radian>': str(cov_loc_radian)}
if cov_loc_vert_km: if cov_loc_vert_km:
cov_loc_vert_rad = cov_loc_vert_km*1000/cov_loc_radian vert_norm_rad = earth_radius_km*cov_loc_vert_km/cov_loc_radius_km*1000
options['<horiz_dist_only>'] = '.false.' options['<horiz_dist_only>'] = '.false.'
options['<vert_norm_hgt>'] = str(cov_loc_vert_rad) options['<vert_norm_hgt>'] = str(vert_norm_rad)
else: else:
options['<horiz_dist_only>'] = '.true.' options['<horiz_dist_only>'] = '.true.'
options['<vert_norm_hgt>'] = '50000.0' # dummy value options['<vert_norm_hgt>'] = '50000.0' # dummy value
......
...@@ -16,8 +16,9 @@ for iens in range(1, exp.n_ens+1): ...@@ -16,8 +16,9 @@ for iens in range(1, exp.n_ens+1):
symlink(cluster.ideal, rundir+'/ideal.exe') symlink(cluster.ideal, rundir+'/ideal.exe')
symlink(cluster.wrfexe, rundir+'/wrf.exe') symlink(cluster.wrfexe, rundir+'/wrf.exe')
# time not important, but general settings
prepare_namelist.run(iens, begin=dt.datetime(2008, 7, 30, 6, 0), prepare_namelist.run(iens, begin=dt.datetime(2008, 7, 30, 6, 0),
end=dt.datetime(2008, 7, 30, 6, 30)) # not necessary end=dt.datetime(2008, 7, 30, 6, 30))
symlink(input_prof, rundir+'/input_sounding') symlink(input_prof, rundir+'/input_sounding')
print('finished.') print('finished.')
...@@ -3,7 +3,7 @@ import datetime as dt ...@@ -3,7 +3,7 @@ import datetime as dt
import netCDF4 as nc import netCDF4 as nc
from config.cfg import exp, cluster from config.cfg import exp, cluster
from utils import symlink, copy_scp_srvx8, copy, mkdir, mkdir_srvx8, clean_wrfdir from utils import symlink, copy, mkdir, clean_wrfdir
time = dt.datetime.strptime(sys.argv[1], '%Y-%m-%d_%H:%M') time = dt.datetime.strptime(sys.argv[1], '%Y-%m-%d_%H:%M')
background_init_time = dt.datetime.strptime(sys.argv[2], '%Y-%m-%d_%H:%M') background_init_time = dt.datetime.strptime(sys.argv[2], '%Y-%m-%d_%H:%M')
......
...@@ -37,10 +37,12 @@ def clean_wrfdir(dir): ...@@ -37,10 +37,12 @@ def clean_wrfdir(dir):
def symlink(src, dst): def symlink(src, dst):
try: try:
os.symlink(src, dst)
except FileExistsError:
os.remove(dst) os.remove(dst)
except Exception as e:
pass
os.symlink(src, dst) os.symlink(src, dst)
except Exception as e:
raise e
def link_contents(src, dst): def link_contents(src, dst):
for f in os.listdir(src): for f in os.listdir(src):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment