Skip to content

Commit

Permalink
Merge branch 'develop' into feature/snow-sogr
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaruidong2017 committed Jan 13, 2025
2 parents 32e9ffb + fea98f9 commit 4debb0e
Show file tree
Hide file tree
Showing 91 changed files with 250 additions and 478 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ jobs:
./.github/scripts/build_docs.sh
- name: Upload documentation (on success)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: documentation
path: artifact/documentation

- name: Upload warnings (on failure)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: documentation_warnings.log
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- if: ${{ always() }}
name: Upload artifact with ShellCheck defects in SARIF format
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Differential ShellCheck SARIF
path: ${{ steps.ShellCheck.outputs.sarif }}
Expand Down
45 changes: 36 additions & 9 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,14 @@ pipeline {
}
}
try {
sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_BUILD_${env.CHANGE_ID}")
gist_url=sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}", returnStdout: true).trim()
sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_BUILD_${env.CHANGE_ID}
""")
gist_url=sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}
""", returnStdout: true).trim()
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """)
} catch (Exception error_comment) {
echo "Failed to comment on PR: ${error_comment.getMessage()}"
Expand All @@ -158,7 +164,10 @@ pipeline {
}
}
// Get a list of CI cases to run
CI_CASES = sh(script: "${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}", returnStdout: true).trim().split()
CI_CASES = sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}
""", returnStdout: true).trim().split()
echo "Cases to run: ${CI_CASES}"
}
}
Expand All @@ -179,7 +188,10 @@ pipeline {
script {
env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS"
try {
error_output = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml", returnStdout: true).trim()
error_output = sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml
""", returnStdout: true).trim()
} catch (Exception error_create) {
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experiment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """)
error("Case ${caseName} failed to create experiment directory")
Expand All @@ -194,10 +206,19 @@ pipeline {
def error_file = "${CUSTOM_WORKSPACE}/RUNTESTS/${pslot}_error.logs"
sh(script: " rm -f ${error_file}")
try {
sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} 'global-workflow'")
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cleanup_experiment ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}")
sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} 'global-workflow'
""")
sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cleanup_experiment ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}
""")
} catch (Exception error_experment) {
sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_batch_jobs ${pslot}")
sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_batch_jobs ${pslot}
""")
ws(CUSTOM_WORKSPACE) {
def error_logs = ""
def error_logs_message = ""
Expand All @@ -217,9 +238,15 @@ pipeline {
}
}
try {
gist_url = sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_${env.CHANGE_ID}", returnStdout: true).trim()
gist_url = sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_${env.CHANGE_ID}
""", returnStdout: true).trim()
sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Experiment ${caseName} **FAILED** on ${Machine} in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """)
sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_${env.CHANGE_ID}")
sh(script: """
source ${HOMEgfs}/workflow/gw_setup.sh
${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_${env.CHANGE_ID}
""")
} catch (Exception error_comment) {
echo "Failed to comment on PR: ${error_comment.getMessage()}"
}
Expand Down
1 change: 0 additions & 1 deletion ci/cases/yamls/gefs_defaults_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ base:
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
SFS_POST: "NO"
FHOUT_GFS: 6
stage_ic:
USE_OCN_ENS_PERTURB_FILES: "NO"
USE_ATM_ENS_PERTURB_FILES: "NO"
ocn:
Expand Down
7 changes: 3 additions & 4 deletions ci/cases/yamls/sfs_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ base:
DO_BUFRSND: "NO"
DO_GEMPAK: "NO"
DO_AWIPS: "NO"
KEEPDATA: "YES"
KEEPDATA: "NO"
DO_EXTRACTVARS: "NO"
FHMAX_GFS: 2976
FHMAX_HF_GFS: 0
Expand All @@ -17,6 +17,8 @@ base:
FHOUT_ICE_GFS: 24
FCST_BREAKPOINTS: ""
REPLAY_ICS: "NO"
USE_OCN_ENS_PERTURB_FILES: "YES"
USE_ATM_ENS_PERTURB_FILES: "YES"
HPSSARCH: "NO"
LOCALARCH: "NO"
SFS_POST: "YES"
Expand All @@ -26,8 +28,5 @@ fcst:
MONO: "mono"
reforecast: "YES"
FHZER: 24
stage_ic:
USE_OCN_ENS_PERTURB_FILES: "YES"
USE_ATM_ENS_PERTURB_FILES: "YES"
ocn:
MOM6_INTERP_ICS: "YES"
15 changes: 8 additions & 7 deletions ci/scripts/utils/launch_java_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ controller_url="https://jenkins.epic.oarcloud.noaa.gov"
controller_user=${controller_user:-"terry.mcguinness"}
controller_user_auth_token="jenkins_token"

HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null 2>&1 && pwd )"
HOMEGFS_="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null 2>&1 && pwd )"
host=$(hostname)

#########################################################################
# Set up runtime environment varibles for accounts on supproted machines
#########################################################################

source "${HOMEgfs}/ush/detect_machine.sh"
source "${HOMEGFS_}/ush/detect_machine.sh"
case ${MACHINE_ID} in
hera | orion | hercules | wcoss2 | gaea)
echo "Launch Jenkins Java Controler on ${MACHINE_ID}";;
Expand All @@ -84,10 +84,10 @@ esac
LOG=lanuched_agent-$(date +%Y%m%d%M).log
rm -f "${LOG}"

source "${HOMEgfs}/ush/module-setup.sh"
module use "${HOMEgfs}/modulefiles"
source "${HOMEGFS_}/ush/module-setup.sh"
module use "${HOMEGFS_}/modulefiles"
module load "module_gwsetup.${MACHINE_ID}"
source "${HOMEgfs}/ci/platforms/config.${MACHINE_ID}"
source "${HOMEGFS_}/ci/platforms/config.${MACHINE_ID}"

JAVA_HOME="${JENKINS_AGENT_LANUCH_DIR}/JAVA/jdk-17.0.10"
if [[ ! -d "${JAVA_HOME}" ]]; then
Expand All @@ -102,9 +102,10 @@ JAVA="${JAVA_HOME}/bin/java"
echo "JAVA VERSION: "
${JAVA} -version

export GH="${HOME}/bin/gh"
[[ -f "${GH}" ]] || echo "gh is not installed in ${HOME}/bin"
GH=$(command -v gh || echo "${HOME}/bin/gh")
[[ -f "${GH}" ]] || ( echo "ERROR: GitHub CLI (gh) not found. (exiting with error)"; exit 1 )
${GH} --version
export GH

check_mark=$("${GH}" auth status -t 2>&1 | grep "Token:" | awk '{print $1}') || true
if [[ "${check_mark}" != "" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ elif [[ "${step}" = "marineanlchkpt" ]]; then
elif [[ "${step}" = "ocnanalecen" ]]; then

export NTHREADS_OCNANALECEN=${NTHREADSmax}
export APRUN_OCNANALECEN="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANALECEN}"
export APRUN_OCNANALECEN="${APRUN_default}"

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

Expand Down
4 changes: 4 additions & 0 deletions parm/archive/enkf.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ enkf:
target: "{{ ATARDIR }}/{{ cycle_YMDH }}/{{ RUN }}.tar"
required:
# Logs
{% if RUN == 'enkfgdas' %}
{% for mem in range(1, nmem_ens + 1) %}
- "logs/{{ cycle_YMDH }}/{{ RUN }}_fcst_mem{{ '%03d' % mem }}.log"
{% endfor %}
{% for fhr in range(fhmin, fhmax + 1, fhout) %}
- "logs/{{ cycle_YMDH }}/{{ RUN }}_epos{{ '%03d' % (fhr - fhmin) }}.log"
{% endfor %}
- "logs/{{ cycle_YMDH }}/{{ RUN }}_echgres.log"
{% endif %}
- "logs/{{ cycle_YMDH }}/{{ RUN }}_esfc.log"
{% for grp in range(IAUFHRS | length) %}
- "logs/{{ cycle_YMDH }}/{{ RUN }}_ecen{{ '%03d' % grp }}.log"
Expand Down Expand Up @@ -37,13 +39,15 @@ enkf:
{% endfor %}

# Ensemble mean and spread
{% if RUN == 'enkfgdas' %}
{% for fhr in range(3, fhmax + 1, 3) %}
- "{{ COMIN_ATMOS_HISTORY_ENSSTAT | relpath(ROTDIR) }}/{{ head }}atmf{{ '%03d' % fhr }}.ensmean.nc"
- "{{ COMIN_ATMOS_HISTORY_ENSSTAT | relpath(ROTDIR) }}/{{ head }}sfcf{{ '%03d' % fhr }}.ensmean.nc"
{% if ENKF_SPREAD %}
- "{{ COMIN_ATMOS_HISTORY_ENSSTAT | relpath(ROTDIR) }}/{{ head }}atmf{{ '%03d' % fhr }}.ensspread.nc"
{% endif %}
{% endfor %}
{% endif %}

# Ensemble mean state
{% if not DO_JEDIATMENS %}
Expand Down
2 changes: 2 additions & 0 deletions parm/archive/enkf_grp.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ enkf_grp:
{% set COMIN_ATMOS_RESTART_MEM = COMIN_ATMOS_RESTART_MEM_list[imem] %}

# Forecast data
{% if RUN == 'enkfgdas' %}
{% for fhr in range(3, 10, 3) %}
- "{{ COMIN_ATMOS_HISTORY_MEM | relpath(ROTDIR) }}/{{ head }}atmf{{ "%03d" % fhr }}.nc"
{% endfor %}

# Only store the 6-hour surface forecast
- "{{ COMIN_ATMOS_HISTORY_MEM | relpath(ROTDIR) }}/{{ head }}sfcf006.nc"
{% endif %}

# Store the individual member analysis data
{% if not lobsdiag_forenkf %}
Expand Down
2 changes: 2 additions & 0 deletions parm/archive/enkf_restartb_grp.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enkf_restartb_grp:
{% endfor %}

# Now get the restart files.
{% if RUN == 'enkfgdas' %}
{% for r_time in range(restart_interval, fhmax + 1, restart_interval) %}
{% set r_timedelta = (r_time | string + "H") | to_timedelta %}
{% set r_dt = current_cycle | add_to_datetime(r_timedelta) %}
Expand All @@ -37,4 +38,5 @@ enkf_restartb_grp:
- "{{ COMIN_ATMOS_RESTART_MEM | relpath(ROTDIR) }}/{{ r_prefix }}.coupler.res"
- "{{ COMIN_ATMOS_RESTART_MEM | relpath(ROTDIR) }}/{{ r_prefix }}.fv_core.res.nc"
{% endfor %}
{% endif %}
{% endfor %}
5 changes: 5 additions & 0 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,13 @@ export SDATE_GFS=@SDATE_GFS@
export REPLAY_ICS=@REPLAY_ICS@
if [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
export OFFSET_START_HOUR=$(( assim_freq / 2 ))
echo "WARNING: Replay ICs require perturbation files, ignoring any previous settings"
export USE_OCN_ENS_PERTURB_FILES="YES"
export USE_ATM_ENS_PERTURB_FILES="YES"
else
export OFFSET_START_HOUR=0
export USE_OCN_ENS_PERTURB_FILES=@USE_OCN_ENS_PERTURB_FILES@
export USE_ATM_ENS_PERTURB_FILES=@USE_ATM_ENS_PERTURB_FILES@
fi

# GFS output and frequency
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gefs/config.efcs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if (( OCNRES <= 100 )); then
export EPBL_LSCALE="500.E3,1000.E3,2000.E3,2000.E3,2000.E3"
fi

if [[ "${REPLAY_ICS:-NO}" == "YES" ]]; then
if [[ "${USE_OCN_ENS_PERTURB_FILES:-NO}" == "YES" ]]; then
export ODA_INCUPD="True"
export ODA_TEMPINC_VAR='t_pert'
export ODA_SALTINC_VAR='s_pert'
Expand Down
3 changes: 2 additions & 1 deletion parm/config/gefs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ case ${imp_physics} in

export hord_mt_nh_nonmono=5
export hord_xx_nh_nonmono=5
export hord_dp_nh_nonmono=-5
export vtdm4_nh_nonmono=0.02
export nord=2
if [[ "${TYPE}" == "nh"* ]]; then
export dddmp=0.1
else
export dddmp=0.
fi
export dddmp=0.1
export d4_bg=0.12
;;
11) # GFDL
Expand All @@ -216,6 +216,7 @@ case ${imp_physics} in

export hord_mt_nh_nonmono=5
export hord_xx_nh_nonmono=5
export hord_dp_nh_nonmono=-5
export vtdm4_nh_nonmono=0.02
export nord=2
export d4_bg=0.12
Expand Down
4 changes: 0 additions & 4 deletions parm/config/gefs/config.nsst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export NST_MODEL=2

# nstf_name(2) : NST_SPINUP : 0 = OFF, 1 = ON,
export NST_SPINUP=0
cdate="${PDY}${cyc}"
if (( cdate < 2017072000 )); then
export NST_SPINUP=1
fi

# nstf_name(3) : NST_RESV (Reserved, NSST Analysis) : 0 = OFF, 1 = ON
export NST_RESV=0
Expand Down
2 changes: 1 addition & 1 deletion parm/config/gefs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ case ${step} in

case "${CASE}" in
"C48" | "C96" | "C192")
declare -x "walltime"="03:00:00"
declare -x "walltime"="04:00:00"
;;
"C384" | "C768" | "C1152")
declare -x "walltime"="06:00:00"
Expand Down
4 changes: 0 additions & 4 deletions parm/config/gefs/config.stage_ic
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,4 @@ if [[ -z "${ICSDIR}" ]] ; then

fi

#use of perturbations files for ensembles
export USE_OCN_ENS_PERTURB_FILES=@USE_OCN_ENS_PERTURB_FILES@
export USE_ATM_ENS_PERTURB_FILES=@USE_ATM_ENS_PERTURB_FILES@

echo "END: config.stage_ic"
4 changes: 2 additions & 2 deletions parm/config/gefs/config.ufs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ case "${fv3_res}" in
export DELTIM=600
export layout_x=2
export layout_y=2
export layout_x_gfs=4
export layout_y_gfs=4
export layout_x_gfs=6
export layout_y_gfs=8
export nthreads_fv3=1
export nthreads_fv3_gfs=1
export nthreads_ufs=1
Expand Down
20 changes: 1 addition & 19 deletions parm/config/gefs/config.wave
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,10 @@ export RUNwave="${RUN}wave"
export RUNRSTwave="gdas"

#grid dependent variable defaults
export waveGRDN='1' # grid number for ww3_multi
export waveGRDG='10' # grid group for ww3_multi
export USE_WAV_RMP='NO' # YES/NO rmp grid remapping pre-processed coefficients
export waveMULTIGRID='.false.' # .true./.false. for multi or shel
export MESH_WAV="mesh.${waveGRD}.nc" # Mesh grid for wave model for CMEPS
export waveesmfGRD=' ' # input grid for multigrid

#Grid dependent variables for various grids
case "${waveGRD}" in
"gnh_10m;aoc_9km;gsh_15m")
#GFSv16 settings:
export waveGRDN='1 2 3'
export waveGRDG='10 20 30'
export USE_WAV_RMP='YES'
export waveMULTIGRID='.true.'
export IOSRV='3'
export MESH_WAV=' '
export waveesmfGRD='glox_10m'
export waveuoutpGRD='points'
export waveinterpGRD='glo_15mxt at_10m ep_10m wc_10m glo_30m'
export wavepostGRD='gnh_10m aoc_9km gsh_15m'
;;
"gwes_30m")
#Grid used for P8
export waveinterpGRD=''
Expand Down Expand Up @@ -157,7 +139,7 @@ export WW3CURIENS='F'
export GOFILETYPE=1 # GOFILETYPE=1 one gridded file per output step
export POFILETYPE=1 # POFILETYPE=1 one point file per output step

# Parameters for ww3_multi/shel.inp
# Parameters for ww3_shel.inp
# Unified output T or F
export FUNIPNT='T'
# Output server type (see ww3_shel/multi.inp in WW3 repo)
Expand Down
Loading

0 comments on commit 4debb0e

Please sign in to comment.