From e9639142dec49d88ad11b33208d1ffac98a16a1d Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Fri, 7 Jul 2023 15:46:50 -0400 Subject: [PATCH 1/3] Update snow DA cycling for the fractional grid setting. (#504) * Change the meta data override file for GFSv17 fractional grid option. * Replace variable "snwdph" with $(SNOWDEPTHVAR) for snwdph/snodl. * Remove the obselete yaml file. * Minor changes. * Minor changes. * Assign the obs error in the yaml files. * Change state variable name from snwdph to snodl. --------- Co-authored-by: Cory Martin --- parm/land/letkfoi/letkfoi.yaml | 4 ++-- parm/land/obs/config/adpsfc_snow.yaml | 6 ++++++ test/land/letkfoi_snowda.sh | 2 +- ush/land/genYAML_output_letkfoi.yaml | 9 ++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/parm/land/letkfoi/letkfoi.yaml b/parm/land/letkfoi/letkfoi.yaml index 0dc764978..11db7a94d 100644 --- a/parm/land/letkfoi/letkfoi.yaml +++ b/parm/land/letkfoi/letkfoi.yaml @@ -28,7 +28,7 @@ background: template: datetime: '{{ current_cycle | to_isotime }}' filetype: fms restart - state variables: [snwdph,vtype,slmsk] + state variables: [snodl,vtype,slmsk] datapath: $(DATA)/bkg/mem%mem%/RESTART filename_sfcd: '{{ current_cycle | to_fv3time }}.sfc_data.nc' filename_cplr: '{{ current_cycle | to_fv3time }}.coupler.res' @@ -56,5 +56,5 @@ output increment: filetype: fms restart filename_sfcd: '{{ current_cycle | to_fv3time }}.sfc_data.nc' filename_cplr: '{{ current_cycle | to_fv3time }}.coupler.res' - state variables: [snwdph,vtype,slmsk] + state variables: [snodl,vtype,slmsk] diff --git a/parm/land/obs/config/adpsfc_snow.yaml b/parm/land/obs/config/adpsfc_snow.yaml index a7c69752e..a7c08eb74 100644 --- a/parm/land/obs/config/adpsfc_snow.yaml +++ b/parm/land/obs/config/adpsfc_snow.yaml @@ -86,6 +86,12 @@ obs filters: damping_factor_1: 1.0 damping_factor_2: 1.0 background_error_group: BkgError + - filter: Perform Action + filter variables: + - name: totalSnowDepth + action: + name: assign error + error parameter: 40.0 - filter: Variable Assignment assignments: - name: GrossErrorProbability/totalSnowDepth diff --git a/test/land/letkfoi_snowda.sh b/test/land/letkfoi_snowda.sh index 8747241c0..aecf2f62c 100755 --- a/test/land/letkfoi_snowda.sh +++ b/test/land/letkfoi_snowda.sh @@ -19,7 +19,7 @@ WORKDIR=$project_binary_dir/test/land/letkfoi_snowda RSTDIR=$GDASAPP_TESTDATA/lowres/gdas.$GYMD/$GHR/model_data/atmos/restart export OBSDIR=$GDASAPP_TESTDATA/land -GFSv17=${GFSv17:-"NO"} +GFSv17=${GFSv17:-"YES"} DAtype=letkfoi_snow if [ $GFSv17 == "YES" ]; then diff --git a/ush/land/genYAML_output_letkfoi.yaml b/ush/land/genYAML_output_letkfoi.yaml index 67ade909e..b55c3618a 100644 --- a/ush/land/genYAML_output_letkfoi.yaml +++ b/ush/land/genYAML_output_letkfoi.yaml @@ -10,7 +10,7 @@ background: filename_sfcd: 20210323.180000.sfc_data.nc filetype: fms restart state variables: - - snwdph + - snodl - vtype - slmsk zero padding: '3' @@ -119,6 +119,13 @@ observations: min_latitude: '-90' min_longitude: '-180' use_legacy_buddy_collector: 'false' + # Assign obsError. + - filter: Perform Action + filter variables: + - name: totalSnowDepth + action: + name: assign error + error parameter: 40.0 - assignments: - name: GrossErrorProbability/totalSnowDepth type: float From 78d5873e24899bd321bf4485bf8c31e6f53a1e66 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Mon, 10 Jul 2023 16:55:36 -0400 Subject: [PATCH 2/3] Remove FRAC_GRID for consistency with G-W. (#527) --- parm/land/letkfoi/apply_incr_nml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parm/land/letkfoi/apply_incr_nml.j2 b/parm/land/letkfoi/apply_incr_nml.j2 index 2dac08157..39765a5d3 100644 --- a/parm/land/letkfoi/apply_incr_nml.j2 +++ b/parm/land/letkfoi/apply_incr_nml.j2 @@ -2,7 +2,7 @@ date_str = "{{ current_cycle | to_YMD }}", hour_str = "{{ current_cycle | strftime('%H') }}", res = {{ CASE[1:] }}, - frac_grid = {{ FRAC_GRID | to_f90bool }}, + frac_grid = .true., rst_path = "{{ DATA }}/anl", inc_path = "{{ DATA }}/anl", orog_path = "{{ HOMEgfs }}/fix/orog/{{ CASE }}", From c86d7362818bdeef75074f0ecdeea6866dba1eac Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 12 Jul 2023 15:20:05 -0400 Subject: [PATCH 3/3] Replace all instances of `pygw` with `wxflow` (#521) * replace all instances of pygw with wxflow * import directly from wxflow * fix CI for wxflow from pygw (#528) --------- Co-authored-by: Cory Martin --- .github/workflows/unittests.yaml | 10 +++++----- .github/workflows/unittests_g-w.yaml | 17 ++++++++++++----- scripts/exgdas_global_marine_analysis_post.py | 2 +- scripts/exgdas_global_marine_analysis_prep.py | 5 +---- test/aero/genyaml_3dvar.sh | 6 ++---- test/atm/global-workflow/jjob_ens_final.sh | 4 ++-- test/atm/global-workflow/jjob_ens_init.sh | 4 ++-- test/atm/global-workflow/jjob_ens_run.sh | 4 ++-- test/atm/global-workflow/jjob_var_final.sh | 4 ++-- test/atm/global-workflow/jjob_var_init.sh | 4 ++-- test/atm/global-workflow/jjob_var_run.sh | 4 ++-- .../atm/global-workflow/run_jedi_exe_3denvar.sh | 4 ++-- test/atm/global-workflow/run_jedi_exe_3dhofx.sh | 4 ++-- test/atm/global-workflow/run_jedi_exe_3dvar.sh | 4 ++-- test/atm/global-workflow/run_jedi_exe_letkf.sh | 4 ++-- test/check_valid_yaml.py | 2 +- test/soca/CMakeLists.txt | 2 +- test/soca/gw/CMakeLists.txt | 2 +- ush/ioda/gen_bufr2ioda_yaml.py | 3 +-- ush/run_jedi_exe.py | 4 ++-- ush/soca/run_jjobs.py | 2 +- ush/socaincr2mom6.py | 2 +- ush/ufsda/archive.py | 2 +- ush/ufsda/genYAML.py | 3 +-- ush/ufsda/stage.py | 2 +- ush/ufsda/yamltools.py | 4 ++-- 26 files changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 2c0ec4d33..2dba08de5 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -24,16 +24,16 @@ jobs: cd solo && pip install . && cd .. cd r2d2 && pip install . && cd .. - - name: Checkout workflow + - name: Checkout wxflow uses: actions/checkout@v3 with: - repository: NOAA-EMC/global-workflow + repository: NOAA-EMC/wxflow ref: develop - path: global-workflow + path: wxflow - - name: Install workflow utils + - name: Install wxflow run: | - cd global-workflow/ush/python/pygw + cd wxflow pip install . - name: Checkout diff --git a/.github/workflows/unittests_g-w.yaml b/.github/workflows/unittests_g-w.yaml index ef65844ad..b187a0de9 100644 --- a/.github/workflows/unittests_g-w.yaml +++ b/.github/workflows/unittests_g-w.yaml @@ -25,18 +25,25 @@ jobs: cd r2d2 && pip install . && cd .. sudo mkdir -p /work/noaa # to trick workflow into thinking this is RDHPCS Orion - - name: Checkout workflow + - name: Checkout wxflow uses: actions/checkout@v3 with: - repository: NOAA-EMC/global-workflow + repository: NOAA-EMC/wxflow ref: develop - path: global-workflow + path: wxflow - - name: Install workflow utils + - name: Install wxflow run: | - cd global-workflow/ush/python/pygw + cd wxflow pip install . + - name: Checkout workflow + uses: actions/checkout@v3 + with: + repository: NOAA-EMC/global-workflow + ref: develop + path: global-workflow + - name: Checkout GDASApp uses: actions/checkout@v3 with: diff --git a/scripts/exgdas_global_marine_analysis_post.py b/scripts/exgdas_global_marine_analysis_post.py index 8e375d9b2..c1a0b4e11 100755 --- a/scripts/exgdas_global_marine_analysis_post.py +++ b/scripts/exgdas_global_marine_analysis_post.py @@ -23,7 +23,7 @@ import shutil import logging from datetime import datetime, timedelta -from pygw.file_utils import FileHandler +from wxflow import FileHandler # TODO: Move this somewhere else? diff --git a/scripts/exgdas_global_marine_analysis_prep.py b/scripts/exgdas_global_marine_analysis_prep.py index e7d7af86a..3147facc6 100755 --- a/scripts/exgdas_global_marine_analysis_prep.py +++ b/scripts/exgdas_global_marine_analysis_prep.py @@ -32,10 +32,7 @@ from netCDF4 import Dataset import xarray as xr import numpy as np -from pygw.attrdict import AttrDict -from pygw.template import Template, TemplateConstants -from pygw.yaml_file import YAMLFile -from pygw.file_utils import FileHandler +from wxflow import (AttrDict, Template, TemplateConstants, YAMLFile, FileHandler) # set up logger logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S') diff --git a/test/aero/genyaml_3dvar.sh b/test/aero/genyaml_3dvar.sh index f522ba6f6..74ae035a1 100755 --- a/test/aero/genyaml_3dvar.sh +++ b/test/aero/genyaml_3dvar.sh @@ -1,6 +1,6 @@ #!/bin/bash # generate YAML from a template -# using pygw YAML tools +# using wxflow YAML tools bindir=$1 srcdir=$2 @@ -27,9 +27,7 @@ mkdir -p $DATA # run some python code to generate the YAML python3 - <