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):
exp = ExperimentConfiguration()
exp.expname = "exp_v1.16_P0-4_Radar"
exp.expname = "exp_v1.16_P1_40mem"
exp.model_dx = 2000
exp.timestep = 10
exp.timestep = 8
exp.n_ens = 40
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]',
kind='MSG_4_SEVIRI_BDRF',
......@@ -34,17 +34,17 @@ radar = dict(plotname='Radar reflectivity', plotunits='[dBz]',
kind='RADAR_REFLECTIVITY',
n_obs=n_obs, err_std=5.,
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]',
kind='SYNOP_TEMPERATURE', n_obs=n_obs, err_std=0.5,
cov_loc_radius_km=32, cov_loc_vert_km=1)
kind='SYNOP_TEMPERATURE', n_obs=n_obs, err_std=0.1,
cov_loc_radius_km=20, cov_loc_vert_km=3)
psfc = dict(plotname='SYNOP Pressure', plotunits='[dBz]',
kind='SYNOP_SURFACE_PRESSURE', n_obs=n_obs, err_std=50.,
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
cluster.expname = exp.expname
......@@ -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.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.input_profile = '/home/fs71386/lkugler/wrf_sounding/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.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_profiles/data/wrf/ens/from_LMU/raso.nat.<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.wrfexe = vsc.userdir+'/compile/bin/wrf-v4.2.2_v1.16.exe'
......
......@@ -3,14 +3,14 @@
high level control script
submitting jobs into SLURM queue
"""
import os, sys, shutil
import os, sys, shutil, glob
import datetime as dt
from slurmpy import Slurm
from config.cfg import exp, cluster
from scripts.utils import script_to_str, symlink
if __name__ == "__main__":
# necessary to find modules in folder, since SLURM runs the script elsewhere
sys.path.append(os.getcwd())
......@@ -68,7 +68,7 @@ def backup_scripts():
def prepare_wrfinput():
"""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')
cmd = """# run ideal.exe in parallel, then add geodata
......@@ -148,7 +148,7 @@ def run_ENS(begin, end, depends_on=None, first_minute=True):
depends_on=[id])
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),
"time": str(runtime_wallclock_mins_expected), "mem-per-cpu": "2G"})
cmd = script_to_str(cluster.run_WRF).replace('<expname>', exp.expname)
......@@ -194,7 +194,7 @@ def assimilate(assim_time, prior_init_time,
s = my_Slurm("Assim", cfg_update={"nodes": "1", "ntasks": "96", "time": "30",
"mem": "300G", "ntasks-per-node": "96", "ntasks-per-core": "2"})
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
# s = my_Slurm("Assim", cfg_update=dict(nodes="1", ntasks="48", time="50", mem="200G"))
......@@ -224,18 +224,22 @@ def mailme(depends_on=None):
s = my_Slurm("AllFinished", cfg_update={"time": "1", "mail-type": "BEGIN"})
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__":
print('starting osse')
timedelta_integrate = dt.timedelta(minutes=45)
timedelta_btw_assim = dt.timedelta(minutes=30)
timedelta_integrate = dt.timedelta(minutes=75)
timedelta_btw_assim = dt.timedelta(minutes=60)
backup_scripts()
id = None
start_from_existing_state = True
start_from_existing_state = False
is_new_run = not start_from_existing_state
if is_new_run:
......@@ -265,7 +269,7 @@ if __name__ == "__main__":
assim_time = integration_end_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,
prior_init_time,
......@@ -290,4 +294,4 @@ if __name__ == "__main__":
assim_time = time
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,
'<cov_loc_radian>': str(cov_loc_radian)}
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['<vert_norm_hgt>'] = str(cov_loc_vert_rad)
options['<vert_norm_hgt>'] = str(vert_norm_rad)
else:
options['<horiz_dist_only>'] = '.true.'
options['<vert_norm_hgt>'] = '50000.0' # dummy value
......
......@@ -16,8 +16,9 @@ for iens in range(1, exp.n_ens+1):
symlink(cluster.ideal, rundir+'/ideal.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),
end=dt.datetime(2008, 7, 30, 6, 30)) # not necessary
end=dt.datetime(2008, 7, 30, 6, 30))
symlink(input_prof, rundir+'/input_sounding')
print('finished.')
......@@ -3,7 +3,7 @@ import datetime as dt
import netCDF4 as nc
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')
background_init_time = dt.datetime.strptime(sys.argv[2], '%Y-%m-%d_%H:%M')
......
......@@ -37,10 +37,12 @@ def clean_wrfdir(dir):
def symlink(src, dst):
try:
os.symlink(src, dst)
except FileExistsError:
os.remove(dst)
except Exception as e:
pass
os.symlink(src, dst)
except Exception as e:
raise e
def link_contents(src, dst):
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