Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/issue2332
Browse files Browse the repository at this point in the history
Refs NOAA-EMC#2332
* origin/develop:
  Add Hercules support for the GSI monitor (NOAA-EMC#2373)
  Reformat snowDA templates to jinja2 (NOAA-EMC#2371)
  • Loading branch information
KateFriedman-NOAA committed Mar 6, 2024
2 parents e652757 + ba6a4fd commit 0292162
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 77 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ fix/wave

# Ignore parm file symlinks
#--------------------------
parm/config/config.base
parm/gdas/bufr2ioda
parm/gdas/aero
parm/gdas/atm
parm/gdas/io
parm/gdas/ioda
parm/gdas/snow
parm/gdas/soca
parm/monitor
parm/post/AEROSOL_LUTS.dat
parm/post/nam_micro_lookup.dat
Expand Down
38 changes: 19 additions & 19 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
[submodule "sorc/ufs_model.fd"]
path = sorc/ufs_model.fd
url = https://github.com/ufs-community/ufs-weather-model
ignore = dirty
path = sorc/ufs_model.fd
url = https://github.com/ufs-community/ufs-weather-model
ignore = dirty
[submodule "sorc/wxflow"]
path = sorc/wxflow
url = https://github.com/NOAA-EMC/wxflow
path = sorc/wxflow
url = https://github.com/NOAA-EMC/wxflow
[submodule "sorc/gfs_utils.fd"]
path = sorc/gfs_utils.fd
url = https://github.com/NOAA-EMC/gfs-utils
path = sorc/gfs_utils.fd
url = https://github.com/NOAA-EMC/gfs-utils
[submodule "sorc/ufs_utils.fd"]
path = sorc/ufs_utils.fd
url = https://github.com/ufs-community/UFS_UTILS.git
path = sorc/ufs_utils.fd
url = https://github.com/ufs-community/UFS_UTILS.git
[submodule "sorc/verif-global.fd"]
path = sorc/verif-global.fd
url = https://github.com/NOAA-EMC/EMC_verif-global.git
path = sorc/verif-global.fd
url = https://github.com/NOAA-EMC/EMC_verif-global.git
[submodule "sorc/gsi_enkf.fd"]
path = sorc/gsi_enkf.fd
url = https://github.com/NOAA-EMC/GSI.git
path = sorc/gsi_enkf.fd
url = https://github.com/NOAA-EMC/GSI.git
[submodule "sorc/gdas.cd"]
path = sorc/gdas.cd
url = https://github.com/NOAA-EMC/GDASApp.git
path = sorc/gdas.cd
url = https://github.com/NOAA-EMC/GDASApp.git
[submodule "sorc/gsi_utils.fd"]
path = sorc/gsi_utils.fd
url = https://github.com/NOAA-EMC/GSI-Utils.git
path = sorc/gsi_utils.fd
url = https://github.com/NOAA-EMC/GSI-Utils.git
[submodule "sorc/gsi_monitor.fd"]
path = sorc/gsi_monitor.fd
url = https://github.com/NOAA-EMC/GSI-Monitor.git
path = sorc/gsi_monitor.fd
url = https://github.com/NOAA-EMC/GSI-Monitor.git
1 change: 1 addition & 0 deletions ci/cases/pr/C48mx500_3DVarAOWCDA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ arguments:

skip_ci_on_hosts:
- orion
- hera
- hercules
2 changes: 1 addition & 1 deletion jobs/JGLOBAL_ATM_PREP_IODA_OBS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ YMD=${PDY} HH=${cyc} generate_com -rx COM_OBS
###############################################################
# Run relevant script
EXSCRIPT=${BUFR2IODASH:-${USHgfs}/run_bufr2ioda.py}
${EXSCRIPT} "${PDY}${cyc}" "${RUN}" "${DMPDIR}" "${PARMgfs}/gdas/bufr2ioda" "${COM_OBS}/"
${EXSCRIPT} "${PDY}${cyc}" "${RUN}" "${DMPDIR}" "${PARMgfs}/gdas/ioda/bufr2ioda" "${COM_OBS}/"
status=$?
[[ ${status} -ne 0 ]] && (echo "FATAL ERROR: Error executing ${EXSCRIPT}, ABORT!"; exit "${status}")

Expand Down
1 change: 0 additions & 1 deletion modulefiles/module_base.hercules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ load(pathJoin("stack-intel", (os.getenv("stack_intel_ver") or "None")))
load(pathJoin("stack-intel-oneapi-mpi", (os.getenv("stack_impi_ver") or "None")))
load(pathJoin("intel-oneapi-mkl", (os.getenv("intel_mkl_ver") or "None")))
load(pathJoin("python", (os.getenv("python_ver") or "None")))
load(pathJoin("perl", (os.getenv("perl_ver") or "None")))

load(pathJoin("jasper", (os.getenv("jasper_ver") or "None")))
load(pathJoin("libpng", (os.getenv("libpng_ver") or "None")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export RUN="gefs" # RUN is defined in the job-card (ecf); CDUMP is used at EMC
# Get all the COM path templates
source "${EXPDIR}/config.com"

# shellcheck disable=SC2016
export ERRSCRIPT=${ERRSCRIPT:-'eval [[ $err = 0 ]]'}
export LOGSCRIPT=${LOGSCRIPT:-""}
#export ERRSCRIPT=${ERRSCRIPT:-"err_chk"}
Expand Down Expand Up @@ -209,7 +210,7 @@ export gfs_cyc=@gfs_cyc@ # 0: no GFS cycle, 1: 00Z only, 2: 00Z and 12Z only, 4:
export FHMIN_GFS=0
export FHMIN=${FHMIN_GFS}
export FHMAX_GFS=@FHMAX_GFS@
export FHOUT_GFS=6
export FHOUT_GFS=6
export FHMAX_HF_GFS=0
export FHOUT_HF_GFS=1
export FHOUT_OCNICE_GFS=6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,9 @@ export DO_NPOESS="NO" # NPOESS products
export DO_TRACKER="YES" # Hurricane track verification
export DO_GENESIS="YES" # Cyclone genesis verification
export DO_GENESIS_FSU="NO" # Cyclone genesis verification (FSU)
# The monitor is not yet supported on Hercules
if [[ "${machine}" == "HERCULES" ]]; then
export DO_VERFOZN="NO" # Ozone data assimilation monitoring
export DO_VERFRAD="NO" # Radiance data assimilation monitoring
export DO_VMINMON="NO" # GSI minimization monitoring
else
export DO_VERFOZN="YES" # Ozone data assimilation monitoring
export DO_VERFRAD="YES" # Radiance data assimilation monitoring
export DO_VMINMON="YES" # GSI minimization monitoring
fi
export DO_VERFOZN="YES" # Ozone data assimilation monitoring
export DO_VERFRAD="YES" # Radiance data assimilation monitoring
export DO_VMINMON="YES" # GSI minimization monitoring
export DO_MOS="NO" # GFS Model Output Statistics - Only supported on WCOSS2

# NO for retrospective parallel; YES for real-time parallel
Expand Down Expand Up @@ -131,6 +124,7 @@ export RUN=${RUN:-${CDUMP:-"gfs"}} # RUN is defined in the job-card (ecf); CDUM
# Get all the COM path templates
source "${EXPDIR}/config.com"

# shellcheck disable=SC2016
export ERRSCRIPT=${ERRSCRIPT:-'eval [[ $err = 0 ]]'}
export LOGSCRIPT=${LOGSCRIPT:-""}
#export ERRSCRIPT=${ERRSCRIPT:-"err_chk"}
Expand Down Expand Up @@ -246,7 +240,7 @@ export gfs_cyc=@gfs_cyc@ # 0: no GFS cycle, 1: 00Z only, 2: 00Z and 12Z only, 4:
# GFS output and frequency
export FHMIN_GFS=0
export FHMAX_GFS=@FHMAX_GFS@
export FHOUT_GFS=3
export FHOUT_GFS=3
export FHMAX_HF_GFS=0
export FHOUT_HF_GFS=1
export FHOUT_OCNICE_GFS=6
Expand Down
9 changes: 6 additions & 3 deletions parm/config/gfs/config.prepsnowobs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ echo "BEGIN: config.prepsnowobs"
# Get task specific resources
. "${EXPDIR}/config.resources" prepsnowobs

export GTS_OBS_LIST="${HOMEgfs}/sorc/gdas.cd/parm/snow/prep/prep_gts.yaml"
export GTS_OBS_LIST="${PARMgfs}/gdas/snow/prep/prep_gts.yaml.j2"
export IMS_OBS_LIST="${PARMgfs}/gdas/snow/prep/prep_ims.yaml.j2"

export BUFR2IODAX="${EXECgfs}/bufr2ioda.x"
export FIMS_NML_TMPL="${HOMEgfs}/sorc/gdas.cd/parm/snow/prep/fims.nml.j2"
export IMS_OBS_LIST="${HOMEgfs}/sorc/gdas.cd/parm/snow/prep/prep_ims.yaml"

export CALCFIMSEXE="${EXECgfs}/calcfIMS.exe"
export FIMS_NML_TMPL="${PARMgfs}/gdas/snow/prep/fims.nml.j2"

export IMS2IODACONV="${USHgfs}/imsfv3_scf2ioda.py"

echo "END: config.prepsnowobs"
14 changes: 4 additions & 10 deletions parm/config/gfs/config.snowanl
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,21 @@
echo "BEGIN: config.snowanl"

# Get task specific resources
. "${EXPDIR}/config.resources" snowanl
source "${EXPDIR}/config.resources" snowanl

obs_list_name=gdas_snow_gts_only.yaml
if [[ "${cyc}" = "18" ]]; then
obs_list_name=gdas_snow_prototype.yaml
fi

export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/snow/obs/config/
export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/snow/obs/lists/${obs_list_name}
export OBS_LIST="${PARMgfs}/gdas/snow/obs/lists/gdas_snow.yaml.j2"

# Name of the JEDI executable and its yaml template
export JEDIEXE="${EXECgfs}/fv3jedi_letkf.x"
export JEDIYAML="${HOMEgfs}/sorc/gdas.cd/parm/snow/letkfoi/letkfoi.yaml"
export JEDIYAML="${PARMgfs}/gdas/snow/letkfoi/letkfoi.yaml.j2"

# Ensemble member properties
export SNOWDEPTHVAR="snodl"
export BESTDDEV="30." # Background Error Std. Dev. for LETKFOI

# Name of the executable that applies increment to bkg and its namelist template
export APPLY_INCR_EXE="${EXECgfs}/apply_incr.exe"
export APPLY_INCR_NML_TMPL="${HOMEgfs}/sorc/gdas.cd/parm/snow/letkfoi/apply_incr_nml.j2"
export APPLY_INCR_NML_TMPL="${PARMgfs}/gdas/snow/letkfoi/apply_incr_nml.j2"

export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@
Expand Down
7 changes: 0 additions & 7 deletions parm/gdas/snow_jedi_fix.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions parm/gdas/snow_jedi_fix.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mkdir:
- '{{ DATA }}/fv3jedi'
copy:
- ['{{ HOMEgfs }}/fix/gdas/fv3jedi/fv3files/akbk{{ npz }}.nc4', '{{ DATA }}/fv3jedi/akbk.nc4']
- ['{{ HOMEgfs }}/fix/gdas/fv3jedi/fv3files/fmsmpp.nml', '{{ DATA }}/fv3jedi/fmsmpp.nml']
- ['{{ HOMEgfs }}/fix/gdas/fv3jedi/fv3files/field_table_gfdl', '{{ DATA }}/fv3jedi/field_table']
- ['{{ HOMEgfs }}/sorc/gdas.cd/parm/io/fv3jedi_fieldmetadata_restart.yaml', '{{ DATA }}/fv3jedi/fv3jedi_fieldmetadata_restart.yaml']
2 changes: 1 addition & 1 deletion sorc/gsi_monitor.fd
Submodule gsi_monitor.fd updated 40 files
+1 −1 README.md
+21 −0 modulefiles/hercules.intel-run.lua
+16 −0 modulefiles/hercules.intel.lua
+13 −1 parm/Mon_config
+2 −1 src/Conventional_Monitor/data_extract/ush/ConMon_DE.sh
+283 −0 src/Conventional_Monitor/data_extract/ush/ConMon_DE_rgn.sh
+8 −5 src/Conventional_Monitor/image_gen/ush/mk_horz_hist.sh
+9 −6 src/Conventional_Monitor/image_gen/ush/mk_time_vert.sh
+5 −5 src/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_lev.fd/conmon_read_diag.F90
+5 −5 src/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_mandlev.fd/conmon_read_diag.F90
+5 −5 src/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/conmon_read_diag.F90
+3 −3 src/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfc.fd/grads_sfc.f90
+5 −5 src/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_grads_sfctime.fd/conmon_read_diag.F90
+5 −5 src/Conventional_Monitor/nwprod/conmon_shared/sorc/conmon_time.fd/conmon_read_diag.F90
+38 −0 src/Conventional_Monitor/nwprod/conmon_shared/ush/clean_tankdir_rgn.sh
+2 −2 src/Conventional_Monitor/nwprod/conmon_shared/ush/diag2grad_ps_case.sh
+1 −1 src/Conventional_Monitor/nwprod/conmon_shared/ush/diag2grad_q_case.sh
+1 −4 src/Conventional_Monitor/nwprod/conmon_shared/ush/diag2grad_t_case.sh
+1 −1 src/Conventional_Monitor/nwprod/conmon_shared/ush/diag2grad_uv_case.sh
+28 −30 src/Conventional_Monitor/nwprod/conmon_shared/ush/horz_hist.sh
+3 −9 src/Conventional_Monitor/nwprod/conmon_shared/ush/time_vert.sh
+207 −0 src/Conventional_Monitor/nwprod/nam_conmon/fix/nam_regional_convinfo.txt
+111 −0 src/Conventional_Monitor/nwprod/nam_conmon/jobs/JNAM_CONMON
+114 −0 src/Conventional_Monitor/nwprod/nam_conmon/scripts/exnam_conmon.sh
+11 −4 src/Conventional_Monitor/parm/ConMon_config
+1 −1 src/Minimization_Monitor/README
+1 −1 src/Ozone_Monitor/README
+2 −2 src/Ozone_Monitor/data_xtrct/ush/OznMon_CP.sh
+1 −1 src/Ozone_Monitor/image_gen/ush/mk_horiz.sh
+4 −2 src/Ozone_Monitor/image_gen/ush/mk_summary.sh
+4 −2 src/Ozone_Monitor/image_gen/ush/mk_time.sh
+1 −1 src/Radiance_Monitor/README
+2 −1 src/Radiance_Monitor/data_extract/ush/RadMon_DE_glb.sh
+8 −5 src/Radiance_Monitor/image_gen/ush/mk_angle_plots.sh
+1 −1 src/Radiance_Monitor/image_gen/ush/mk_bcoef_plots.sh
+6 −4 src/Radiance_Monitor/image_gen/ush/mk_bcor_plots.sh
+7 −5 src/Radiance_Monitor/image_gen/ush/mk_time_plots.sh
+1 −1 ush/detect_machine.sh
+8 −1 ush/module-setup.sh
+47 −185 ush/rgn_find_cycle.pl
6 changes: 5 additions & 1 deletion sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ fi
#------------------------------
if [[ -d "${HOMEgfs}/sorc/gdas.cd" ]]; then
cd "${HOMEgfs}/parm/gdas" || exit 1
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/parm/ioda/bufr2ioda" .
declare -a gdasapp_comps=("aero" "atm" "io" "ioda" "snow" "soca")
for comp in "${gdasapp_comps[@]}"; do
[[ -d "${comp}" ]] && rm -rf "${comp}"
${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/parm/${comp}" .
done
fi

#------------------------------
Expand Down
6 changes: 4 additions & 2 deletions ush/python/pygfs/task/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Analysis(Task):
def __init__(self, config: Dict[str, Any]) -> None:
super().__init__(config)
self.config.ntiles = 6
# Store location of GDASApp jinja2 templates
self.gdasapp_j2tmpl_dir = os.path.join(self.config.HOMEgfs, 'parm/gdas')

def initialize(self) -> None:
super().initialize()
Expand Down Expand Up @@ -56,7 +58,7 @@ def get_obs_dict(self) -> Dict[str, Any]:
a dictionary containing the list of observation files to copy for FileHandler
"""
logger.debug(f"OBS_LIST: {self.task_config['OBS_LIST']}")
obs_list_config = parse_j2yaml(self.task_config["OBS_LIST"], self.task_config)
obs_list_config = parse_j2yaml(self.task_config["OBS_LIST"], self.task_config, searchpath=self.gdasapp_j2tmpl_dir)
logger.debug(f"obs_list_config: {obs_list_config}")
# get observers from master dictionary
observers = obs_list_config['observers']
Expand Down Expand Up @@ -88,7 +90,7 @@ def get_bias_dict(self) -> Dict[str, Any]:
a dictionary containing the list of observation bias files to copy for FileHandler
"""
logger.debug(f"OBS_LIST: {self.task_config['OBS_LIST']}")
obs_list_config = parse_j2yaml(self.task_config["OBS_LIST"], self.task_config)
obs_list_config = parse_j2yaml(self.task_config["OBS_LIST"], self.task_config, searchpath=self.gdasapp_j2tmpl_dir)
logger.debug(f"obs_list_config: {obs_list_config}")
# get observers from master dictionary
observers = obs_list_config['observers']
Expand Down
11 changes: 5 additions & 6 deletions ush/python/pygfs/task/snow_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
FileHandler,
to_fv3time, to_YMD, to_YMDH, to_timedelta, add_to_datetime,
rm_p,
parse_j2yaml, parse_yamltmpl, save_as_yaml,
parse_j2yaml, save_as_yaml,
Jinja,
logit,
Executable,
Expand Down Expand Up @@ -99,7 +99,7 @@ def prepare_GTS(self) -> None:

def _gtsbufr2iodax(exe, yaml_file):
if not os.path.isfile(yaml_file):
logger.exception(f"{yaml_file} not found")
logger.exception(f"FATAL ERROR: {yaml_file} not found")
raise FileNotFoundError(yaml_file)

logger.info(f"Executing {exe}")
Expand Down Expand Up @@ -260,9 +260,9 @@ def initialize(self) -> None:
FileHandler({'mkdir': dirlist}).sync()

# stage fix files
jedi_fix_list_path = os.path.join(self.task_config.HOMEgfs, 'parm', 'gdas', 'snow_jedi_fix.yaml')
jedi_fix_list_path = os.path.join(self.task_config.HOMEgfs, 'parm', 'gdas', 'snow_jedi_fix.yaml.j2')
logger.info(f"Staging JEDI fix files from {jedi_fix_list_path}")
jedi_fix_list = parse_yamltmpl(jedi_fix_list_path, self.task_config)
jedi_fix_list = parse_j2yaml(jedi_fix_list_path, self.task_config)
FileHandler(jedi_fix_list).sync()

# stage backgrounds
Expand All @@ -271,10 +271,9 @@ def initialize(self) -> None:

# generate letkfoi YAML file
logger.info(f"Generate JEDI LETKF YAML file: {self.task_config.jedi_yaml}")
letkfoi_yaml = parse_j2yaml(self.task_config.JEDIYAML, self.task_config)
letkfoi_yaml = parse_j2yaml(self.task_config.JEDIYAML, self.task_config, searchpath=self.gdasapp_j2tmpl_dir)
save_as_yaml(letkfoi_yaml, self.task_config.jedi_yaml)
logger.info(f"Wrote letkfoi YAML to: {self.task_config.jedi_yaml}")

# need output dir for diags and anl
logger.info("Create empty output [anl, diags] directories to receive output from executable")
newdirs = [
Expand Down
2 changes: 0 additions & 2 deletions versions/run.hercules.ver
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ export stack_impi_ver=2021.9.0
export intel_mkl_ver=2023.1.0
export spack_env=gsi-addon-env

export perl_ver=5.36.0

source "${HOMEgfs:-}/versions/run.spack.ver"
export spack_mod_path="/work/noaa/epic/role-epic/spack-stack/hercules/spack-stack-${spack_stack_ver}/envs/${spack_env}/install/modulefiles/Core"
11 changes: 3 additions & 8 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,6 @@ def fill_EXPDIR(inputs):
expdir = os.path.join(inputs.expdir, inputs.pslot)

configs = glob.glob(f'{configdir}/config.*')
exclude_configs = ['base', 'base.emc.dyn', 'base.nco.static', 'fv3.nco.static']
for exclude in exclude_configs:
try:
configs.remove(f'{configdir}/config.{exclude}')
except ValueError:
pass
if len(configs) == 0:
raise IOError(f'no config files found in {configdir}')
for config in configs:
Expand Down Expand Up @@ -295,7 +289,8 @@ def _update_defaults(dict_in: dict) -> dict:

def edit_baseconfig(host, inputs, yaml_dict):
"""
Parses and populates the templated `config.base.emc.dyn` to `config.base`
Parses and populates the templated `HOMEgfs/parm/config/<gfs|gefs>/config.base`
to `EXPDIR/pslot/config.base`
"""

tmpl_dict = {
Expand Down Expand Up @@ -347,7 +342,7 @@ def edit_baseconfig(host, inputs, yaml_dict):
except KeyError:
pass

base_input = f'{inputs.configdir}/config.base.emc.dyn'
base_input = f'{inputs.configdir}/config.base'
base_output = f'{inputs.expdir}/{inputs.pslot}/config.base'
edit_config(base_input, base_output, tmpl_dict)

Expand Down

0 comments on commit 0292162

Please sign in to comment.