diff --git a/config/exp_template.py b/config/exp_template.py index 71650ab19d8e918307fc483298918d3159ae5a63..37b4a1534a7d2a4430c95f64b1dafe5ab91eaf63 100755 --- a/config/exp_template.py +++ b/config/exp_template.py @@ -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 = '/users/students/lehre/advDA_s2023/dartwrf_tutorial/very_cold_observation.out' -# path to the nature run, where we take observations from -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.nature_expname = 'exp_v1.18_P1_nature+1' exp.input_profile = '/mnt/jetfs/home/lkugler/data/initial_profiles/wrf/ens/2022-03-31/raso.fc.<iens>.wrfprof' diff --git a/dartwrf/assim_synth_obs.py b/dartwrf/assim_synth_obs.py index f3cdace497ef03675a3a41dd83e09a20ee85e86d..a23f804e773979f543176f5ba17bc17105711163 100755 --- a/dartwrf/assim_synth_obs.py +++ b/dartwrf/assim_synth_obs.py @@ -1,4 +1,4 @@ -import os, sys, shutil, warnings +import os, sys, shutil, warnings, glob import time as time_module import datetime as dt import numpy as np @@ -21,16 +21,16 @@ def link_nature_to_dart_truth(time): Args: time (dt.datetime): Time at which observations will be made """ - # get wrfout_d01 from nature run - shutil.copy(time.strftime(exp.nature_wrfout), - cluster.dart_rundir + "/wrfout_d01") + # find the file in any init directory + 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", cluster.dart_rundir + "/wrfinput_d01") - print("linked", time.strftime(exp.nature_wrfout), - "to", cluster.dart_rundir + "/wrfout_d01") + print("linked", f_nat, "to", cluster.dart_rundir + "/wrfout_d01") def prepare_nature_dart(time): diff --git a/dartwrf/dart_nml.py b/dartwrf/dart_nml.py index 0792353e8602c891e0f5dbc1fc88143a092534ad..84a2412ea0f70675fe4fac77edc522152fc67c84 100644 --- a/dartwrf/dart_nml.py +++ b/dartwrf/dart_nml.py @@ -280,9 +280,6 @@ def write_namelist(just_prior_values=False): list_obstypes, list_loc_horiz_rad, list_loc_vert_km, list_loc_vert_scaleheight = _get_list_of_localizations() 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 if just_prior_values: @@ -293,17 +290,20 @@ def write_namelist(just_prior_values=False): nml['&obs_kind_nml']['assimilate_these_obs_types'] = [[]] 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 - nml['&assim_tools_nml']['special_localization_obs_types'] = [list_obstypes] - nml['&assim_tools_nml']['special_localization_cutoffs'] = [list_loc_horiz_rad] + # write localization variables + nml['&assim_tools_nml']['special_localization_obs_types'] = [list_obstypes] + nml['&assim_tools_nml']['special_localization_cutoffs'] = [list_loc_horiz_rad] - nml['&location_nml']['special_vert_normalization_obs_types'] = [list_obstypes] - nml['&location_nml']['special_vert_normalization_heights'] = [list_loc_vert_km] - nml['&location_nml']['special_vert_normalization_scale_heights'] = [list_loc_vert_scaleheight] + nml['&location_nml']['special_vert_normalization_obs_types'] = [list_obstypes] + nml['&location_nml']['special_vert_normalization_heights'] = [list_loc_vert_km] + nml['&location_nml']['special_vert_normalization_scale_heights'] = [list_loc_vert_scaleheight] - nml['&location_nml']['special_vert_normalization_levels'] = [[-1,]] - nml['&location_nml']['special_vert_normalization_pressures'] = [[-1,]] + nml['&location_nml']['special_vert_normalization_levels'] = [[-1,]] + nml['&location_nml']['special_vert_normalization_pressures'] = [[-1,]] # overwrite namelist parameters as defined in the experiment configuration for section, sdata in exp.dart_nml.items(): diff --git a/free_forecast.py b/free_forecast.py index 810619243f14d3d2411a68b1de3b199577009fcf..1485c29538ecf546043005aa40dabd8a168842c1 100755 --- a/free_forecast.py +++ b/free_forecast.py @@ -49,6 +49,7 @@ if True: # to continue a nature depends_on=id) # integration time + start = time end = next_restart id = w.run_ENS(begin=start, end=end,