Skip to content

Commit

Permalink
Update JEDI ATM to use .nc for obs and generalize x,y layout (NOAA-EM…
Browse files Browse the repository at this point in the history
…C#2336)

# Description
The changes in this PR are twofold
1. replace `.nc4` suffix for JEDI ATM observation related files with
`.nc`
2. use templated variables to specify `{layout_x, layout_y}` for JEDI
ATM variational and local ensemble apps

The first change conforms with the Unidata recommendation that netCDF
files end with the suffix `.nc`. The second change replaces hardwired
JEDI ATM var and ens `{layout_x, layout_y}` in `config.resources` with a
more flexible approach.

Resolves NOAA-EMC#2335
  • Loading branch information
RussTreadon-NOAA committed Feb 26, 2024
1 parent c5c8466 commit 9608852
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 19 deletions.
8 changes: 7 additions & 1 deletion ci/cases/yamls/ufs_hybatmDA_defaults.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ base:
DO_JEDIATMVAR: "YES"
DO_JEDIATMENS: "YES"
ACCOUNT: {{ 'SLURM_ACCOUNT' | getenv }}
atmanl:
LAYOUT_X_ATMANL: 1
LAYOUT_Y_ATMANL: 1
atmensanl:
LAYOUT_X_ATMENSANL: 1
LAYOUT_Y_ATMENSANL: 1
esfc:
DONST: "NO"
nsst:
NST_MODEL: "1"
sfcanl:
DONST: "NO"


3 changes: 3 additions & 0 deletions parm/config/gfs/config.atmanl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export STATICB_TYPE="gsibec"
export BERROR_YAML=${HOMEgfs}/sorc/gdas.cd/parm/atm/berror/staticb_${STATICB_TYPE}.yaml
export INTERP_METHOD='barycentric'

export layout_x_atmanl=@LAYOUT_X_ATMANL@
export layout_y_atmanl=@LAYOUT_Y_ATMANL@

export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

Expand Down
3 changes: 3 additions & 0 deletions parm/config/gfs/config.atmensanl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/atm/obs/lists/lgetkf_prototype.yaml
export ATMENSYAML=${HOMEgfs}/sorc/gdas.cd/parm/atm/lgetkf/lgetkf.yaml
export INTERP_METHOD='barycentric'

export layout_x_atmensanl=@LAYOUT_X_ATMENSANL@
export layout_y_atmensanl=@LAYOUT_Y_ATMENSANL@

export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

Expand Down
20 changes: 8 additions & 12 deletions parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ case ${step} in
;;

"atmanlinit")
# make below case dependent later
export layout_x=8
export layout_y=8
export layout_x=${layout_x_atmanl}
export layout_y=${layout_y_atmanl}

export layout_gsib_x=$(( layout_x * 3 ))
export layout_gsib_y=$(( layout_y * 2 ))
Expand All @@ -211,9 +210,8 @@ case ${step} in
;;

"atmanlrun")
# make below case dependent later
export layout_x=8
export layout_y=8
export layout_x=${layout_x_atmanl}
export layout_y=${layout_y_atmanl}

export wtime_atmanlrun="00:30:00"
export npe_atmanlrun=$(( layout_x * layout_y * 6 ))
Expand Down Expand Up @@ -829,9 +827,8 @@ case ${step} in
;;

"atmensanlinit")
# make below case dependent later
export layout_x=8
export layout_y=8
export layout_x=${layout_x_atmensanl}
export layout_y=${layout_y_atmensanl}

export wtime_atmensanlinit="00:10:00"
export npe_atmensanlinit=1
Expand All @@ -841,9 +838,8 @@ case ${step} in
;;

"atmensanlrun")
# make below case dependent later
export layout_x=8
export layout_y=8
export layout_x=${layout_x_atmensanl}
export layout_y=${layout_y_atmensanl}

export wtime_atmensanlrun="00:30:00"
export npe_atmensanlrun=$(( layout_x * layout_y * 6 ))
Expand Down
4 changes: 4 additions & 0 deletions parm/config/gfs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ base:
FHMAX_GFS: 120

atmanl:
LAYOUT_X_ATMANL: 8
LAYOUT_Y_ATMANL: 8
IO_LAYOUT_X: 1
IO_LAYOUT_Y: 1

atmensanl:
LAYOUT_X_ATMENSANL: 8
LAYOUT_Y_ATMENSANL: 8
IO_LAYOUT_X: 1
IO_LAYOUT_Y: 1

Expand Down
2 changes: 1 addition & 1 deletion sorc/gdas.cd
Submodule gdas.cd updated 34 files
+2 −1 .gitignore
+7 −4 build.sh
+20 −20 bundle/CMakeLists.txt
+2 −2 parm/atm/obs/config/aircraft.yaml
+6 −6 parm/atm/obs/config/amsua_n19.yaml
+4 −4 parm/atm/obs/config/atms_n20.yaml
+4 −4 parm/atm/obs/config/atms_npp.yaml
+6 −6 parm/atm/obs/config/cris-fsr_n20.yaml
+6 −6 parm/atm/obs/config/cris-fsr_npp.yaml
+1 −1 parm/atm/obs/config/gnssro.yaml
+4 −4 parm/atm/obs/config/iasi_metop-a.yaml
+4 −4 parm/atm/obs/config/iasi_metop-b.yaml
+6 −6 parm/atm/obs/config/lgetkf_amsua_n19.yaml
+2 −2 parm/atm/obs/config/lgetkf_sondes.yaml
+2 −2 parm/atm/obs/config/omi_aura.yaml
+2 −2 parm/atm/obs/config/ompsnp_npp.yaml
+2 −2 parm/atm/obs/config/ompstc8_npp.yaml
+2 −2 parm/atm/obs/config/satwind.yaml
+1 −1 parm/atm/obs/config/satwind_ahi_h8.yaml
+2 −2 parm/atm/obs/config/sfc.yaml
+2 −2 parm/atm/obs/config/sfcship.yaml
+2 −2 parm/atm/obs/config/sondes.yaml
+4 −4 parm/atm/obs/config/ssmis_f17.yaml
+4 −4 parm/atm/obs/config/ssmis_f18.yaml
+8 −169 scripts/exgdas_global_marine_analysis_prep.py
+4 −4 test/atm/global-workflow/config.atmanl
+10 −0 test/atm/global-workflow/config.yaml
+7 −3 test/atm/global-workflow/jjob_ens_init.sh
+8 −4 test/atm/global-workflow/jjob_var_init.sh
+1 −1 ush/ioda/bufr2ioda/bufr2ioda_acft_profiles_prepbufr.py
+1 −1 ush/ioda/bufr2ioda/bufr2ioda_adpsfc_prepbufr.py
+1 −1 ush/ioda/bufr2ioda/bufr2ioda_conventional_prepbufr_ps.py
+1 −1 ush/ioda/bufr2ioda/bufr2ioda_sfcshp_prepbufr.py
+159 −0 ush/soca/bkg_utils.py
6 changes: 3 additions & 3 deletions ush/python/pygfs/task/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_bias_dict(self) -> Dict[str, Any]:
obdir = os.path.dirname(obfile)
basename = os.path.basename(obfile)
prefix = '.'.join(basename.split('.')[:-2])
for file in ['satbias.nc4', 'satbias_cov.nc4', 'tlapse.txt']:
for file in ['satbias.nc', 'satbias_cov.nc', 'tlapse.txt']:
bfile = f"{prefix}.{file}"
copylist.append([os.path.join(self.task_config.COM_ATMOS_ANALYSIS_PREV, bfile), os.path.join(obdir, bfile)])

Expand Down Expand Up @@ -311,13 +311,13 @@ def tgz_diags(statfile: str, diagdir: str) -> None:
Parameters
----------
statfile : str | os.PathLike
Path to the output .tar.gz .tgz file that will contain the diag*.nc4 files e.g. atmstat.tgz
Path to the output .tar.gz .tgz file that will contain the diag*.nc files e.g. atmstat.tgz
diagdir : str | os.PathLike
Directory containing JEDI diag files
"""

# get list of diag files to put in tarball
diags = glob.glob(os.path.join(diagdir, 'diags', 'diag*nc4'))
diags = glob.glob(os.path.join(diagdir, 'diags', 'diag*nc'))

logger.info(f"Compressing {len(diags)} diag files to {statfile}")

Expand Down
2 changes: 1 addition & 1 deletion ush/python/pygfs/task/atm_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def finalize(self: Analysis) -> None:
atmstat = os.path.join(self.task_config.COM_ATMOS_ANALYSIS, f"{self.task_config.APREFIX}atmstat")

# get list of diag files to put in tarball
diags = glob.glob(os.path.join(self.task_config.DATA, 'diags', 'diag*nc4'))
diags = glob.glob(os.path.join(self.task_config.DATA, 'diags', 'diag*nc'))

logger.info(f"Compressing {len(diags)} diag files to {atmstat}.gz")

Expand Down
2 changes: 1 addition & 1 deletion ush/python/pygfs/task/atmens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def finalize(self: Analysis) -> None:
atmensstat = os.path.join(self.task_config.COM_ATMOS_ANALYSIS_ENS, f"{self.task_config.APREFIX}atmensstat")

# get list of diag files to put in tarball
diags = glob.glob(os.path.join(self.task_config.DATA, 'diags', 'diag*nc4'))
diags = glob.glob(os.path.join(self.task_config.DATA, 'diags', 'diag*nc'))

logger.info(f"Compressing {len(diags)} diag files to {atmensstat}.gz")

Expand Down

0 comments on commit 9608852

Please sign in to comment.