Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jderrico-noaa authored May 16, 2024
2 parents f7e9f44 + bb93005 commit 09333c0
Show file tree
Hide file tree
Showing 141 changed files with 2,192 additions and 582 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ parm/gdas/io
parm/gdas/ioda
parm/gdas/snow
parm/gdas/soca
parm/gdas/jcb-gdas
parm/gdas/jcb-algorithms
parm/monitor
parm/post/AEROSOL_LUTS.dat
parm/post/nam_micro_lookup.dat
Expand Down Expand Up @@ -106,6 +108,7 @@ parm/post/ice.csv
parm/post/ocnicepost.nml.jinja2
parm/ufs/noahmptable.tbl
parm/ufs/model_configure.IN
parm/ufs/model_configure_nest.IN
parm/ufs/MOM_input_*.IN
parm/ufs/MOM6_data_table.IN
parm/ufs/ice_in.IN
Expand Down Expand Up @@ -194,3 +197,8 @@ versions/run.ver
ush/python/wxflow
workflow/wxflow
ci/scripts/wxflow

# jcb checkout and symlinks
ush/python/jcb
workflow/jcb
ci/scripts/jcb
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@
path = sorc/upp.fd
url = https://github.com/NOAA-EMC/UPP.git
ignore = dirty
[submodule "sorc/jcb"]
path = sorc/jcb
url = https://github.com/noaa-emc/jcb
fetchRecurseSubmodules = false
4 changes: 2 additions & 2 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pipeline {
ws("${custom_workspace[machine]}/${env.CHANGE_ID}") {
properties([parameters([[$class: 'NodeParameterDefinition', allowedSlaves: ['built-in', 'Hera-EMC', 'Orion-EMC'], defaultSlaves: ['built-in'], name: '', nodeEligibility: [$class: 'AllNodeEligibility'], triggerIfResult: 'allCases']])])
HOME = "${WORKSPACE}"
sh(script: "mkdir -p ${HOME}/RUNTESTS;rm -Rf ${HOME}/RUNTESTS/error.logs")
sh(script: "mkdir -p ${HOME}/RUNTESTS;rm -Rf ${HOME}/RUNTESTS/*")
sh(script: """${GH} pr edit ${env.CHANGE_ID} --repo ${repo_url} --add-label "CI-${Machine}-Building" --remove-label "CI-${Machine}-Ready" """)
}
echo "Building and running on ${Machine} in directory ${HOME}"
Expand Down Expand Up @@ -149,7 +149,7 @@ pipeline {
}
}
sh(script: './link_workflow.sh')
sh(script: "echo ${HOMEgfs} > BUILT_semaphor")
//sh(script: "echo ${HOMEgfs} > BUILT_semaphor")
}
}
if (env.CHANGE_ID && system == 'gfs') {
Expand Down
3 changes: 3 additions & 0 deletions ci/cases/pr/C96_atm3DVar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ arguments:
gfs_cyc: 1
start: cold
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml

skip_ci_on_hosts:
- wcoss2
22 changes: 22 additions & 0 deletions ci/cases/pr/C96_atm3DVar_extended.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
experiment:
system: gfs
mode: cycled

arguments:
pslot: {{ 'pslot' | getenv }}
app: ATM
resdetatmos: 96
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96C48
idate: 2021122018
edate: 2021122118
nens: 0
gfs_cyc: 4
start: cold
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_extended_ci.yaml

skip_ci_on_hosts:
- hera
- orion
- hercules
12 changes: 12 additions & 0 deletions ci/cases/yamls/gfs_extended_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml

base:
ACCOUNT: {{ 'SLURM_ACCOUNT' | getenv }}
DO_GOES: "YES"
DO_BUFRSND: "YES"
DO_GEMPAK: "YES"
DO_AWIPS: "NO"
DO_NPOESS: "YES"
DO_GENESIS_FSU: "NO"
FHMAX_GFS: 384
1 change: 1 addition & 0 deletions ci/platforms/config.hera
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export GFS_CI_ROOT=/scratch1/NCEPDEV/global/Terry.McGuinness/GFS_CI_ROOT
export ICSDIR_ROOT=/scratch1/NCEPDEV/global/glopara/data/ICSDIR
export STMP="/scratch1/NCEPDEV/stmp2/${USER}"
export PTMP="/scratch1/NCEPDEV/stmp2/${USER}"
export SLURM_ACCOUNT=nems
export max_concurrent_cases=5
export max_concurrent_pr=4
3 changes: 2 additions & 1 deletion ci/platforms/config.hercules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

export GFS_CI_ROOT=/work2/noaa/stmp/GFS_CI_ROOT/HERCULES
export ICSDIR_ROOT=/work/noaa/global/glopara/data/ICSDIR
export STMP="/work2/noaa/stmp/${USER}"
export STMP="/work2/noaa/stmp/${USER}/HERCULES"
export PTMP="/work2/noaa/stmp/${USER}/HERCULES"
export SLURM_ACCOUNT=nems
export max_concurrent_cases=5
export max_concurrent_pr=4
3 changes: 2 additions & 1 deletion ci/platforms/config.orion
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

export GFS_CI_ROOT=/work2/noaa/stmp/GFS_CI_ROOT/ORION
export ICSDIR_ROOT=/work/noaa/global/glopara/data/ICSDIR
export STMP="/work2/noaa/stmp/${USER}"
export STMP="/work2/noaa/stmp/${USER}/ORION"
export PTMP="/work2/noaa/stmp/${USER}/ORION"
export SLURM_ACCOUNT=nems
export max_concurrent_cases=5
export max_concurrent_pr=4
1 change: 1 addition & 0 deletions ci/platforms/config.wcoss2
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export GFS_CI_ROOT=/lfs/h2/emc/global/noscrub/globalworkflow.ci/GFS_CI_ROOT
export ICSDIR_ROOT=/lfs/h2/emc/global/noscrub/emc.global/data/ICSDIR
export STMP="/lfs/h2/emc/stmp/${USER}"
export PTMP="/lfs/h2/emc/ptmp/${USER}"
export SLURM_ACCOUNT=GFS-DEV
export max_concurrent_cases=5
export max_concurrent_pr=4
16 changes: 9 additions & 7 deletions ci/scripts/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,20 @@ for pr in ${pr_list}; do
set +e
export LOGFILE_PATH="${HOMEgfs}/ci/scripts/create_experiment.log"
rm -f "${LOGFILE_PATH}"
yaml_case_file="${HOMEgfs}/ci/cases/pr/${case}.yaml"
skip_hosts=$("${HOMEgfs}/ci/scripts/utils/parse_yaml.py" --yaml "${yaml_case_file}" --key skip_ci_on_hosts --string)
if [[ "${skip_hosts}" == *"${MACHINE_ID}"* ]]; then
{
echo "Case setup: Skipped for experiment ${pslot}" || true
} >> "${output_ci}"
continue
fi
"${HOMEgfs}/workflow/create_experiment.py" --yaml "${HOMEgfs}/ci/cases/pr/${case}.yaml" > "${LOGFILE_PATH}" 2>&1
ci_status=$?
set -e
if [[ ${ci_status} -eq 0 ]]; then
last_line=$(tail -1 "${LOGFILE_PATH}")
if [[ "${last_line}" == *"Skipping creation"* ]]; then
action="Skipped"
else
action="Completed"
fi
{
echo "Case setup: ${action} for experiment ${pslot}" || true
echo "Case setup: Completed for experiment ${pslot}" || true
} >> "${output_ci}"
else
{
Expand Down
70 changes: 70 additions & 0 deletions ci/scripts/utils/parse_yaml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env python3

"""
This script parses a yaml file and returns the value of a specified key.
"""

import os
import sys
from wxflow import AttrDict, parse_j2yaml
from argparse import ArgumentParser
from pathlib import Path

_here = os.path.dirname(__file__)
_top = os.path.abspath(os.path.join(os.path.abspath(_here), '../../..'))

description = """parse yaml file and return value of key"""


def parse_args():
"""
Parse command-line arguments.
Returns:
argparse.Namespace: The parsed command-line arguments.
"""

parser = ArgumentParser(description=description)
parser.add_argument('-y', '--yaml', help='full path to yaml file to parse', type=Path, required=True)
parser.add_argument('-k', '--key', help='key to return value of', type=str, required=True)
parser.add_argument('-s', '--string', help='output results as strings', action="store_true", required=False)
return parser.parse_args()


def yq(yamlfile, key):
"""
Parse a yaml file and return the value of a specified key.
Args:
yamlfile (Path): The path to the yaml file.
key (str): The key to return the value of.
Returns:
The value of the specified key in the yaml file.
"""

data = AttrDict(HOMEgfs=_top)
data.update({'HOMEgfs': _top})
ydict = parse_j2yaml(path=yamlfile, data=data)
if key == 'all':
return ydict
list_keys = key.split('.')
for k in list_keys:
ydict = ydict.get(k, None)
if ydict is None:
break
return ydict


if __name__ == '__main__':
"""
Main function. Parses command-line arguments and prints the value of the specified key in the specified yaml file.
"""

args = parse_args()
values = yq(args.yaml, args.key)
if args.string and isinstance(values, list):
for value in values:
print(value)
else:
print(values)
14 changes: 12 additions & 2 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export CFP_MP="YES"
Expand Down Expand Up @@ -126,6 +130,14 @@ elif [[ "${step}" = "ocnanalecen" ]]; then
[[ ${NTHREADS_OCNANALECEN} -gt ${nth_max} ]] && export NTHREADS_OCNANALECEN=${nth_max}
export APRUN_OCNANALECEN="${launcher} -n ${npe_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "ocnanalletkf" ]]; then

nth_max=$((npe_node_max / npe_node_ocnanalletkf))

export NTHREADS_OCNANALLETKF=${nth_ocnanalletkf:-${nth_max}}
[[ ${NTHREADS_OCNANALLETKF} -gt ${nth_max} ]] && export NTHREADS_OCNANALLETKF=${nth_max}
export APRUN_OCNANALLETKF="${launcher} -n ${npe_ocnanalletkf} --cpus-per-task=${NTHREADS_OCNANALLETKF}"

elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then

export MKL_NUM_THREADS=4
Expand Down Expand Up @@ -288,15 +300,13 @@ elif [[ "${step}" = "gempak" ]]; then
export CFP_MP="YES"

if [[ ${CDUMP} == "gfs" ]]; then
npe_gempak=${npe_gempak_gfs}
npe_node_gempak=${npe_node_gempak_gfs}
fi

nth_max=$((npe_node_max / npe_node_gempak))

export NTHREADS_GEMPAK=${nth_gempak:-1}
[[ ${NTHREADS_GEMPAK} -gt ${nth_max} ]] && export NTHREADS_GEMPAK=${nth_max}
export APRUN="${launcher} -n ${npe_gempak} ${mpmd_opt}"


elif [[ "${step}" = "fit2obs" ]]; then
Expand Down
4 changes: 4 additions & 0 deletions env/HERCULES.env
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ case ${step} in

export APRUN_CALCFIMS="${launcher} -n 1"
;;
"prep_emissions")

export APRUN="${launcher} -n 1"
;;
"waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll")

export CFP_MP="YES"
Expand Down
4 changes: 4 additions & 0 deletions env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export CFP_MP="YES"
Expand Down
12 changes: 12 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || \
[[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostpnt" ]] || [[ "${step}" == "wavepostbndpntbll" ]]; then

Expand Down Expand Up @@ -134,6 +138,14 @@ elif [[ "${step}" = "ocnanalecen" ]]; then
[[ ${NTHREADS_OCNANALECEN} -gt ${nth_max} ]] && export NTHREADS_OCNANALECEN=${nth_max}
export APRUN_OCNANALECEN="${launcher} -n ${npe_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "ocnanalletkf" ]]; then

nth_max=$((npe_node_max / npe_node_ocnanalletkf))

export NTHREADS_OCNANALLETKF=${nth_ocnanalletkf:-${nth_max}}
[[ ${NTHREADS_OCNANALLETKF} -gt ${nth_max} ]] && export NTHREADS_OCNANALLETKF=${nth_max}
export APRUN_OCNANALLETKF="${launcher} -n ${npe_ocnanalletkf} --cpus-per-task=${NTHREADS_OCNANALLETKF}"

elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then

export MKL_NUM_THREADS=4
Expand Down
4 changes: 4 additions & 0 deletions env/S4.env
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export CFP_MP="YES"
Expand Down
4 changes: 4 additions & 0 deletions env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ elif [[ "${step}" = "prepsnowobs" ]]; then

export APRUN_CALCFIMS="${launcher} -n 1"

elif [[ "${step}" = "prep_emissions" ]]; then

export APRUN="${launcher} -n 1"

elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then

export USE_CFP="YES"
Expand Down
4 changes: 2 additions & 2 deletions gempak/ush/gdas_ecmwf_meta_ver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi

export COMIN="gdas.${PDY}${cyc}"
if [[ ! -L ${COMIN} ]]; then
ln -sf "${COM_ATMOS_GEMPAK_1p00}" "${COMIN}"
${NLN} "${COM_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi
vergrid="F-GDAS | ${PDY:2}/0600"
fcsthr="0600f006"
Expand All @@ -49,7 +49,7 @@ for area in ${areas}; do
sdatenum=$(date --utc +%y%m%d -d "${PDY} ${cyc2} - ${fhr} hours")

if [[ ! -L "ecmwf.20${sdatenum}" ]]; then
ln -sf "${COMINecmwf}/ecmwf.20${sdatenum}/gempak" "ecmwf.20${sdatenum}"
${NLN} "${COMINecmwf}/ecmwf.20${sdatenum}/gempak" "ecmwf.20${sdatenum}"
fi
gdfile="ecmwf.20${sdatenum}/ecmwf_glob_20${sdatenum}12"

Expand Down
4 changes: 2 additions & 2 deletions gempak/ush/gdas_meta_loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ device="nc | gdasloop.meta"
#
export COMIN="${RUN}.${PDY}${cyc}"
if [[ ! -L "${COMIN}" ]]; then
ln -sf "${COM_ATMOS_GEMPAK_1p00}" "${COMIN}"
${NLN} "${COM_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi

if [[ "${envir}" == "para" ]] ; then
Expand Down Expand Up @@ -41,7 +41,7 @@ for (( fhr=24; fhr<=144; fhr+=24 )); do
YMD=${day} HH=${cyc} GRID=1p00 declare_from_tmpl "COM_ATMOS_GEMPAK_1p00_past:COM_ATMOS_GEMPAK_TMPL"
export COMIN="${RUN}.${day}${cycle}"
if [[ ! -L "${COMIN}" ]]; then
ln -sf "${COM_ATMOS_GEMPAK_1p00_past}" "${COMIN}"
${NLN} "${COM_ATMOS_GEMPAK_1p00_past}" "${COMIN}"
fi
gdfile="${COMIN}/gdas_1p00_${day}${cycle}f000"

Expand Down
2 changes: 1 addition & 1 deletion gempak/ush/gdas_meta_na.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ device="nc | gdas.meta"
#
export COMIN="${RUN}.${PDY}${cyc}"
if [[ ! -L "${COMIN}" ]]; then
ln -sf "${COM_ATMOS_GEMPAK_1p00}" "${COMIN}"
${NLN} "${COM_ATMOS_GEMPAK_1p00}" "${COMIN}"
fi

if [[ "${envir}" == "para" ]] ; then
Expand Down
Loading

0 comments on commit 09333c0

Please sign in to comment.