From efcd201cea958b0d78db46e3b007d7501a9a590f Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Thu, 27 Oct 2022 18:27:02 +0000 Subject: [PATCH 1/7] Add gsibec as a staticb option for fv3jedi_var.x (#166) --- build.sh | 2 +- parm/atm/berror/staticb_gsibec.yaml | 38 +++++++++++++++++++++++ ush/examples/run_jedi_exe/3dvar_hera.yaml | 1 + ush/run_jedi_exe.py | 1 + ush/ufsda/stage.py | 12 +++++-- 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 parm/atm/berror/staticb_gsibec.yaml diff --git a/build.sh b/build.sh index c9db290c3..b41789567 100755 --- a/build.sh +++ b/build.sh @@ -60,7 +60,7 @@ case ${BUILD_TARGET} in module purge module use $dir_root/modulefiles module load GDAS/$BUILD_TARGET - CMAKE_OPTS+=" -DMPIEXEC_EXECUTABLE=$MPIEXEC_EXEC -DMPIEXEC_NUMPROC_FLAG=$MPIEXEC_NPROC" + CMAKE_OPTS+=" -DMPIEXEC_EXECUTABLE=$MPIEXEC_EXEC -DMPIEXEC_NUMPROC_FLAG=$MPIEXEC_NPROC -DBUILD_GSIBEC=ON" module list set -e ;; diff --git a/parm/atm/berror/staticb_gsibec.yaml b/parm/atm/berror/staticb_gsibec.yaml new file mode 100644 index 000000000..fcfcab366 --- /dev/null +++ b/parm/atm/berror/staticb_gsibec.yaml @@ -0,0 +1,38 @@ +background error: + covariance model: hybrid + components: + - covariance: + covariance model: SABER + saber blocks: + - saber block name: gsi covariance + saber central block: true + input variables: &control_vars [eastward_wind,northward_wind,air_temperature,surface_pressure, + specific_humidity,mole_fraction_of_ozone_in_air] + output variables: *control_vars + gsi akbk: &akbk $(fv3jedi_fix_dir)/akbk.nc4 + gsi error covariance file: &gsiberr $(fv3jedi_staticb_dir)/gsi-coeffs-gfs-global-l127x192y96.nc4 + gsi berror namelist file: &gsibnml $(fv3jedi_staticb_dir)/gfs_gsi_global.nml + processor layout x direction: 3 + processor layout y direction: 2 + debugging mode: false + - saber block name: gsi interpolation to model grid + input variables: *control_vars + output variables: *control_vars + gsi akbk: *akbk + gsi error covariance file: *gsiberr + gsi berror namelist file: *gsibnml + processor layout x direction: 3 + processor layout y direction: 2 + debugging mode: false + linear variable change: + linear variable change name: Control2Analysis + input variables: *control_vars + output variables: &3dvars_anal [ua,va,t,ps,sphum,o3mr] + weight: + value: 1.00 + - covariance: + covariance model: FV3JEDI-ID + date: $(window_begin) + weight: + value: 0.0 + diff --git a/ush/examples/run_jedi_exe/3dvar_hera.yaml b/ush/examples/run_jedi_exe/3dvar_hera.yaml index 1d9278668..b9a4c654f 100644 --- a/ush/examples/run_jedi_exe/3dvar_hera.yaml +++ b/ush/examples/run_jedi_exe/3dvar_hera.yaml @@ -16,6 +16,7 @@ executable options: dump: gdas case: C96 case_anl: C48 + staticb_type: bump dohybvar: false levs: 128 interp_method: barycentric diff --git a/ush/run_jedi_exe.py b/ush/run_jedi_exe.py index b9c18fb88..3d2968a28 100755 --- a/ush/run_jedi_exe.py +++ b/ush/run_jedi_exe.py @@ -73,6 +73,7 @@ def run_jedi_exe(yamlconfig): single_exec = True var_config = { 'BERROR_YAML': executable_subconfig.get('berror_yaml', './'), + 'STATICB_TYPE': executable_subconfig.get('staticb_type','gsibec'), 'OBS_YAML_DIR': executable_subconfig['obs_yaml_dir'], 'OBS_LIST': executable_subconfig['obs_list'], 'atm': executable_subconfig.get('atm', False), diff --git a/ush/ufsda/stage.py b/ush/ufsda/stage.py index e2db6c810..5a2f8dcd6 100644 --- a/ush/ufsda/stage.py +++ b/ush/ufsda/stage.py @@ -32,9 +32,17 @@ def gdas_fix(input_fix_dir, working_dir, config): else: case_anl = config['CASE_ANL'] layers = int(config['LEVS'])-1 - # link static B files - ufsda.disk_utils.symlink(os.path.join(input_fix_dir, 'bump', case_anl), + + # figure out staticb source + if config['STATICB_TYPE'] == 'bump': + staticb_source = 'bump' + else: + staticb_source = 'gsibec' + + # link staticb + ufsda.disk_utils.symlink(os.path.join(input_fix_dir, staticb_source, case_anl), config['fv3jedi_staticb_dir']) + # link akbk file ufsda.disk_utils.symlink(os.path.join(input_fix_dir, 'fv3jedi', 'fv3files', f"akbk{layers}.nc4"), From 569b53be257402d1f8f260f4e812e1ef0b59bf9a Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Thu, 27 Oct 2022 18:34:35 +0000 Subject: [PATCH 2/7] Add missing whitespace (python coding norm) (#166) --- ush/run_jedi_exe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/run_jedi_exe.py b/ush/run_jedi_exe.py index 3d2968a28..9ada67945 100755 --- a/ush/run_jedi_exe.py +++ b/ush/run_jedi_exe.py @@ -73,7 +73,7 @@ def run_jedi_exe(yamlconfig): single_exec = True var_config = { 'BERROR_YAML': executable_subconfig.get('berror_yaml', './'), - 'STATICB_TYPE': executable_subconfig.get('staticb_type','gsibec'), + 'STATICB_TYPE': executable_subconfig.get('staticb_type', 'gsibec'), 'OBS_YAML_DIR': executable_subconfig['obs_yaml_dir'], 'OBS_LIST': executable_subconfig['obs_list'], 'atm': executable_subconfig.get('atm', False), From 1c0d1f2c8adc54276a44f1b3a462365893835d19 Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Fri, 28 Oct 2022 15:25:27 +0000 Subject: [PATCH 3/7] Add cloud liquid water and ice to gsibec control vector (#166) --- parm/atm/berror/staticb_gsibec.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parm/atm/berror/staticb_gsibec.yaml b/parm/atm/berror/staticb_gsibec.yaml index fcfcab366..cca5e8bf9 100644 --- a/parm/atm/berror/staticb_gsibec.yaml +++ b/parm/atm/berror/staticb_gsibec.yaml @@ -7,7 +7,8 @@ background error: - saber block name: gsi covariance saber central block: true input variables: &control_vars [eastward_wind,northward_wind,air_temperature,surface_pressure, - specific_humidity,mole_fraction_of_ozone_in_air] + specific_humidity,cloud_liquid_ice,cloud_liquid_water, + mole_fraction_of_ozone_in_air] output variables: *control_vars gsi akbk: &akbk $(fv3jedi_fix_dir)/akbk.nc4 gsi error covariance file: &gsiberr $(fv3jedi_staticb_dir)/gsi-coeffs-gfs-global-l127x192y96.nc4 @@ -27,7 +28,7 @@ background error: linear variable change: linear variable change name: Control2Analysis input variables: *control_vars - output variables: &3dvars_anal [ua,va,t,ps,sphum,o3mr] + output variables: &3dvars_anal [ua,va,t,ps,sphum,ice_wat,liq_wat,o3mr] weight: value: 1.00 - covariance: From 096435f3a7cf4293dc2746f1d922fb9e28e5f297 Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Fri, 28 Oct 2022 16:32:22 +0000 Subject: [PATCH 4/7] add staticb_type to 3dvar_orion.yaml (#166) --- ush/examples/run_jedi_exe/3dvar_orion.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/ush/examples/run_jedi_exe/3dvar_orion.yaml b/ush/examples/run_jedi_exe/3dvar_orion.yaml index 54fed3196..f29e1e408 100644 --- a/ush/examples/run_jedi_exe/3dvar_orion.yaml +++ b/ush/examples/run_jedi_exe/3dvar_orion.yaml @@ -16,6 +16,7 @@ executable options: dump: gdas case: C96 case_anl: C48 + staticb_type: bump dohybvar: false levs: 128 interp_method: barycentric From 71a685d377b4443984642ea79f733c5c1bd68137 Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Fri, 28 Oct 2022 18:11:03 +0000 Subject: [PATCH 5/7] configure hera and orion 3dvar yaml to use gsibec, add identity staticb to stage.py (#166) --- ush/examples/run_jedi_exe/3dvar_hera.yaml | 6 +++--- ush/examples/run_jedi_exe/3dvar_orion.yaml | 6 +++--- ush/ufsda/stage.py | 7 +++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ush/examples/run_jedi_exe/3dvar_hera.yaml b/ush/examples/run_jedi_exe/3dvar_hera.yaml index b9a4c654f..753855b8d 100644 --- a/ush/examples/run_jedi_exe/3dvar_hera.yaml +++ b/ush/examples/run_jedi_exe/3dvar_hera.yaml @@ -2,7 +2,7 @@ working directory: /scratch2/NCEPDEV/stmp1/Cory.R.Martin/gdas_single_test_3dvar GDASApp home: /scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/work/GDASApp GDASApp mode: variational executable options: - berror_yaml: /scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/work/GDASApp/parm/atm/berror/staticb_bump.yaml + berror_yaml: /scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/work/GDASApp/parm/atm/berror/staticb_gsibec.yaml obs_yaml_dir: /scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/work/GDASApp/parm/atm/obs/config yaml_template: /scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/work/GDASApp/parm/atm/variational/3dvar_dripcg.yaml executable: /scratch1/NCEPDEV/da/Cory.R.Martin/GDASApp/work/GDASApp/build/bin/fv3jedi_var.x @@ -15,8 +15,8 @@ executable options: valid_time: 2021-12-21T06:00:00Z dump: gdas case: C96 - case_anl: C48 - staticb_type: bump + case_anl: C96 + staticb_type: gsibec dohybvar: false levs: 128 interp_method: barycentric diff --git a/ush/examples/run_jedi_exe/3dvar_orion.yaml b/ush/examples/run_jedi_exe/3dvar_orion.yaml index f29e1e408..92b5b425d 100644 --- a/ush/examples/run_jedi_exe/3dvar_orion.yaml +++ b/ush/examples/run_jedi_exe/3dvar_orion.yaml @@ -2,7 +2,7 @@ working directory: /work2/noaa/stmp/cmartin/gdas_single_test_3dvar GDASApp home: /work2/noaa/da/cmartin/GDASApp/work/GDASApp GDASApp mode: variational executable options: - berror_yaml: /work2/noaa/da/cmartin/GDASApp/work/GDASApp/parm/atm/berror/staticb_bump.yaml + berror_yaml: /work2/noaa/da/cmartin/GDASApp/work/GDASApp/parm/atm/berror/staticb_gsibec.yaml obs_yaml_dir: /work2/noaa/da/cmartin/GDASApp/work/GDASApp/parm/atm/obs/config yaml_template: /work2/noaa/da/cmartin/GDASApp/work/GDASApp/parm/atm/variational/3dvar_dripcg.yaml executable: /work2/noaa/da/cmartin/GDASApp/work/GDASApp/build/bin/fv3jedi_var.x @@ -15,8 +15,8 @@ executable options: valid_time: 2021-12-21T06:00:00Z dump: gdas case: C96 - case_anl: C48 - staticb_type: bump + case_anl: C96 + staticb_type: gsibec dohybvar: false levs: 128 interp_method: barycentric diff --git a/ush/ufsda/stage.py b/ush/ufsda/stage.py index 5a2f8dcd6..cbdd02c4d 100644 --- a/ush/ufsda/stage.py +++ b/ush/ufsda/stage.py @@ -36,12 +36,15 @@ def gdas_fix(input_fix_dir, working_dir, config): # figure out staticb source if config['STATICB_TYPE'] == 'bump': staticb_source = 'bump' + elif config['STATICB_TYPE'] == 'identity': + staticb_source = 'identity' else: staticb_source = 'gsibec' # link staticb - ufsda.disk_utils.symlink(os.path.join(input_fix_dir, staticb_source, case_anl), - config['fv3jedi_staticb_dir']) + if staticb_source in ['bump', 'gsibec']: + ufsda.disk_utils.symlink(os.path.join(input_fix_dir, staticb_source, case_anl), + config['fv3jedi_staticb_dir']) # link akbk file ufsda.disk_utils.symlink(os.path.join(input_fix_dir, 'fv3jedi', From 866dd52224013e7be34cbd979d9adb4333fd4b6a Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Tue, 1 Nov 2022 19:06:34 +0000 Subject: [PATCH 6/7] Streamline coding in stage.py (#166) --- ush/ufsda/stage.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ush/ufsda/stage.py b/ush/ufsda/stage.py index cbdd02c4d..becec4bab 100644 --- a/ush/ufsda/stage.py +++ b/ush/ufsda/stage.py @@ -34,12 +34,7 @@ def gdas_fix(input_fix_dir, working_dir, config): layers = int(config['LEVS'])-1 # figure out staticb source - if config['STATICB_TYPE'] == 'bump': - staticb_source = 'bump' - elif config['STATICB_TYPE'] == 'identity': - staticb_source = 'identity' - else: - staticb_source = 'gsibec' + staticb_source = config.get('STATICB_TYPE', 'gsibec') # link staticb if staticb_source in ['bump', 'gsibec']: From 5b0bda95d8cc7c948204cc5a436d26847c3703bd Mon Sep 17 00:00:00 2001 From: "russ.treadon" Date: Thu, 3 Nov 2022 16:06:01 +0000 Subject: [PATCH 7/7] Clean up gsibec staticb yaml (#166) --- parm/atm/berror/staticb_gsibec.yaml | 68 ++++++++++++----------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/parm/atm/berror/staticb_gsibec.yaml b/parm/atm/berror/staticb_gsibec.yaml index cca5e8bf9..7d90f1522 100644 --- a/parm/atm/berror/staticb_gsibec.yaml +++ b/parm/atm/berror/staticb_gsibec.yaml @@ -1,39 +1,29 @@ -background error: - covariance model: hybrid - components: - - covariance: - covariance model: SABER - saber blocks: - - saber block name: gsi covariance - saber central block: true - input variables: &control_vars [eastward_wind,northward_wind,air_temperature,surface_pressure, - specific_humidity,cloud_liquid_ice,cloud_liquid_water, - mole_fraction_of_ozone_in_air] - output variables: *control_vars - gsi akbk: &akbk $(fv3jedi_fix_dir)/akbk.nc4 - gsi error covariance file: &gsiberr $(fv3jedi_staticb_dir)/gsi-coeffs-gfs-global-l127x192y96.nc4 - gsi berror namelist file: &gsibnml $(fv3jedi_staticb_dir)/gfs_gsi_global.nml - processor layout x direction: 3 - processor layout y direction: 2 - debugging mode: false - - saber block name: gsi interpolation to model grid - input variables: *control_vars - output variables: *control_vars - gsi akbk: *akbk - gsi error covariance file: *gsiberr - gsi berror namelist file: *gsibnml - processor layout x direction: 3 - processor layout y direction: 2 - debugging mode: false - linear variable change: - linear variable change name: Control2Analysis - input variables: *control_vars - output variables: &3dvars_anal [ua,va,t,ps,sphum,ice_wat,liq_wat,o3mr] - weight: - value: 1.00 - - covariance: - covariance model: FV3JEDI-ID - date: $(window_begin) - weight: - value: 0.0 - +covariance model: SABER +full inverse: true +saber blocks: +- saber block name: gsi covariance + saber central block: true + input variables: &control_vars [eastward_wind,northward_wind,air_temperature,surface_pressure, + specific_humidity,cloud_liquid_ice,cloud_liquid_water, + mole_fraction_of_ozone_in_air] + output variables: *control_vars + gsi akbk: &akbk $(fv3jedi_fix_dir)/akbk.nc4 + gsi error covariance file: &gsiberr $(fv3jedi_staticb_dir)/gsi-coeffs-gfs-global.nc4 +# gsi error covariance file: &gsiberr $(fv3jedi_staticb_dir)/global_berror.f77 + gsi berror namelist file: &gsibnml $(fv3jedi_staticb_dir)/gfs_gsi_global.nml + processor layout x direction: &layout_gsib_x 3 + processor layout y direction: &layout_gsib_y 2 + debugging mode: false +- saber block name: gsi interpolation to model grid + input variables: *control_vars + output variables: *control_vars + gsi akbk: *akbk + gsi error covariance file: *gsiberr + gsi berror namelist file: *gsibnml + processor layout x direction: *layout_gsib_x + processor layout y direction: *layout_gsib_y + debugging mode: false +linear variable change: + linear variable change name: Control2Analysis + input variables: *control_vars + output variables: &3dvars_anal [ua,va,t,ps,sphum,ice_wat,liq_wat,o3mr]