From 3e681508042d2cd42050e87667538c9034357e1d Mon Sep 17 00:00:00 2001
From: lkugler <lukas.kugler@gmail.com>
Date: Fri, 15 Jul 2022 13:36:38 +0200
Subject: [PATCH] options

---
 config/cfg.py              | 14 ++++++++------
 dartwrf/assim_synth_obs.py | 21 ++++++++++-----------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/config/cfg.py b/config/cfg.py
index c20f66e..75314c9 100755
--- a/config/cfg.py
+++ b/config/cfg.py
@@ -7,17 +7,21 @@ class ExperimentConfiguration(object):
         pass
 
 exp = ExperimentConfiguration()
-exp.expname = "exp_v1.21_P2_rr_WV-qc_obs10_loc20"
+exp.expname = "exp_v1.21_P3_wbub7_VIS_obs10_loc20"
 exp.model_dx = 2000
 exp.n_ens = 40
 exp.n_nodes = 10
 exp.inflation = True
 exp.sec = True
+exp.reject_smallFGD = False
+exp.cov_loc_vert_km_horiz_km = (3, 20)
+exp.superob_km = False
+
 
 #exp.nature_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.19_P5+su_nat2/2008-07-30_07:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
-#exp.nature_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.19_P3_wbub7_nat/2008-07-30_12:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
+exp.nature_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.19_P3_wbub7_nat/2008-07-30_12:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
 #exp.nature_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.19_Pwbub5_nat/2008-07-30_12:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
-exp.nature_wrfout = '/home/fs71386/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_wrfout = '/home/fs71386/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_wrfout = '/home/fs71386/lkugler/data/sim_archive/exp_v1.19_P4_nat/2008-07-30_07:00/1/wrfout_d01_%Y-%m-%d_%H:%M:%S'
 
 #exp.input_profile = '/home/fs71386/lkugler/wrf_profiles/data/wrf/ens/2021-05-04/raso.nat.001.wrfprof'
@@ -33,8 +37,6 @@ exp.input_profile = '/gpfs/data/fs71386/lkugler/initial_profiles/wrf/ens/2022-03
 # localize vertically, if it has a vertical position
 # needs a horizontal scale too, to calculate the vertical normalization
 # since you can not specify different vertical localizations for diff. variables
-exp.cov_loc_vert_km_horiz_km = (3, 20)  
-#exp.superob_km = 10
 
 n_obs = 961  # 22500: 2km, 5776: 4km, 121: 30km, 256:16x16 (20km); 961: 10km resoltn # radar: n_obs for each observation height level
 
@@ -82,7 +84,7 @@ psfc = dict(plotname='SYNOP Pressure', plotunits='[dBz]',
             cov_loc_radius_km=32)
 
 
-exp.observations = [wv73]
+exp.observations = [vis]
 exp.update_vars = ['U', 'V', 'W', 'THM', 'PH', 'MU', 'QVAPOR', 'QCLOUD', 'QICE', 'PSFC']
 #exp.update_vars = ['U', 'V', 'W', 'T', 'PH', 'MU', 'QVAPOR', 'PSFC']
 
diff --git a/dartwrf/assim_synth_obs.py b/dartwrf/assim_synth_obs.py
index e7a7e16..5c841e5 100755
--- a/dartwrf/assim_synth_obs.py
+++ b/dartwrf/assim_synth_obs.py
@@ -577,35 +577,34 @@ if __name__ == "__main__":
 
     run_perfect_model_obs()  # create observations
 
-    print(" 2) obs preprocessing")
+    print(" 2.1) obs preprocessing")
 
     oso = obsseq.ObsSeq(cluster.dartrundir + "/obs_seq.out")
 
-    if False:  # only refl < 6 dBz
-        # oso = obsseq.ObsSeq(cluster.dartrundir + "/obs_seq.out")
-        oso.df = oso.df[oso.df['truth'].values < 6]
-        oso.to_dart(f=cluster.dartrundir + "/obs_seq.out")
-
     if True:  # set reflectance < surface albedo to surface albedo
+        print(" 2.2) removing obs below surface albedo ")
         if_vis_obs = oso.df['kind'].values == 262
         if_obs_below_surface_albedo = oso.df['observations'].values < 0.2928
 
         oso.df.loc[if_vis_obs & if_obs_below_surface_albedo, ('observations')] = 0.2928
         oso.to_dart(f=cluster.dartrundir + "/obs_seq.out")
 
-    if hasattr(exp, "superob_km"):
-        print("superobbing to", exp.superob_km, "km")
+    if getattr(exp, "superob_km", False):
+        print(" 2.3) superobbing to", exp.superob_km, "km")
         oso.df = oso.df.superob(window_km=exp.superob_km)
         copy(cluster.dartrundir + "/obs_seq.out", cluster.dartrundir + "/obs_seq.out-orig")
         oso.to_dart(f=cluster.dartrundir + "/obs_seq.out")
 
-    #qc_obs(oso, outfile=cluster.dartrundir + "/obs_seq.out")
 
     ################################################
-    print(" 3) assign observation-errors for assimilation ")
+    print(" 2.4) assign observation-errors for assimilation ")
     set_obserr_assimilate_in_obsseqout(oso, outfile=cluster.dartrundir + "/obs_seq.out")
 
-    print(" 4) assimilate ")
+    if getattr(exp, "reject_smallFGD", False):
+        print(" 2.5) QC of observations ")
+        qc_obs(oso, outfile=cluster.dartrundir + "/obs_seq.out")
+
+    print(" 3) assimilate ")
     archive_osq_out(time)
     
     set_DART_nml()
-- 
GitLab