Skip to content

Commit

Permalink
[develop] Update weather model hash and correct behavior in Functiona…
Browse files Browse the repository at this point in the history
…l WorkflowTaskTests Jenkins stage (ufs-community#1068)

* The ufs-weather-model hash has been updated to 1411b90 (April 1, 2024).
* Updated build_hera_gnu.lua file to allow it to work with updates to the ufs-weather-model.
* Updated behavior of the Functional WorkflowTaskTests Jenkins stage to allow the test to properly finish, rather than waiting in queue for all jobs associated with the EPIC role account to finish first (modification to .cicd/scripts/wrapper_srw_ftest.sh).
* Corrected the hang encountered while running the Functional WorkflowTaskTests stage on Gaea.
* Applied Mike Kavulich's modification to ush/bash_utils/create_symlink_to_file.sh and converted calls to the create_symlink_to_file function from using named arguments to positional arguments (Issue ufs-community#1066).
  • Loading branch information
MichaelLueken committed Apr 15, 2024
1 parent a609196 commit c7e093d
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 138 deletions.
8 changes: 6 additions & 2 deletions .cicd/scripts/wrapper_srw_ftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ declare arg_1
if [[ "${SRW_PLATFORM}" == cheyenne ]] || [[ "${SRW_PLATFORM}" == derecho ]]; then
workflow_cmd=qsub
arg_1=""
check_job="qstat -u ${USER} -r ${job_id}"
else
workflow_cmd=sbatch
arg_1="--parsable"
check_job="squeue -u ${USER} -j ${job_id} --noheader"
fi

# Customize wrapper scripts
if [[ "${SRW_PLATFORM}" == gaea ]]; then
sed -i '15i #SBATCH --clusters=c5' ${WORKSPACE}/${SRW_PLATFORM}/.cicd/scripts/${workflow_cmd}_srw_ftest.sh
sed -i 's|qos=batch|qos=normal|g' ${WORKSPACE}/${SRW_PLATFORM}/.cicd/scripts/${workflow_cmd}_srw_ftest.sh
sed -i 's|${JOBSdir}/JREGIONAL_RUN_POST|$USHdir/load_modules_run_task.sh "run_post" ${JOBSdir}/JREGIONAL_RUN_POST|g' ${WORKSPACE}/${SRW_PLATFORM}/ush/wrappers/run_post.sh
fi

if [[ "${SRW_PLATFORM}" == hera ]]; then
Expand All @@ -52,6 +51,11 @@ sleep 10
# Check for job and exit when done
while true
do
if [[ "${SRW_PLATFORM}" == derecho ]]; then
check_job="qstat -u ${USER} -r ${job_id}"
else
check_job="squeue -u ${USER} -j ${job_id} --noheader"
fi
job_id_info=$($check_job)
if [ ! -z "$job_id_info" ]; then
echo "Job is still running. Check again in two minutes"
Expand Down
2 changes: 1 addition & 1 deletion Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protocol = git
repo_url = https://github.com/ufs-community/ufs-weather-model
# Specify either a branch name or a hash but not both.
#branch = develop
hash = 8518c2c
hash = 1411b90
local_path = sorc/ufs-weather-model
required = True

Expand Down
8 changes: 4 additions & 4 deletions modulefiles/build_hera_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ load(pathJoin("nccmp", os.getenv("nccmp_ver") or "1.9.0.1"))
load(pathJoin("nco", os.getenv("nco_ver") or "5.0.6"))
load(pathJoin("openblas", os.getenv("openblas_ver") or "0.3.19"))

setenv("CMAKE_C_COMPILER","mpicc")
setenv("CMAKE_CXX_COMPILER","mpicxx")
setenv("CMAKE_Fortran_COMPILER","mpif90")
setenv("CMAKE_Platform","hera.gnu")
setenv("CC", "mpicc")
setenv("CXX", "mpic++")
setenv("FC", "mpif90")
setenv("CMAKE_Platform", "hera.gnu")
12 changes: 4 additions & 8 deletions scripts/exregional_make_orog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,9 @@ if [[ ${suites[@]} =~ "${CCPP_PHYS_SUITE}" ]] ; then
grid_fp_gwd="${FIXlam}/${grid_fn_gwd}"
ls_fn="geo_em.d01.lat-lon.2.5m.HGT_M.nc"
ss_fn="HGT.Beljaars_filtered.lat-lon.30s_res.nc"
create_symlink_to_file target="${grid_fp_gwd}" symlink="${DATA}/${grid_fn_gwd}" \
relative="TRUE"
create_symlink_to_file target="${FIXam}/${ls_fn}" symlink="${DATA}/${ls_fn}" \
relative="TRUE"
create_symlink_to_file target="${FIXam}/${ss_fn}" symlink="${DATA}/${ss_fn}" \
relative="TRUE"
create_symlink_to_file ${grid_fp_gwd} ${DATA}/${grid_fn_gwd} TRUE
create_symlink_to_file ${FIXam}/${ls_fn} ${DATA}/${ls_fn} TRUE
create_symlink_to_file ${FIXam}/${ss_fn} ${DATA}/${ss_fn} TRUE

input_redirect_fn="grid_info.dat"
cat > "${input_redirect_fn}" <<EOF
Expand Down Expand Up @@ -405,8 +402,7 @@ cp_vrfy "${raw_orog_fp}" "${filtered_orog_fp}"
# filtering executable will run) with the same name as the grid file and
# point it to the actual grid file specified by grid_fp.
#
create_symlink_to_file target="${grid_fp}" symlink="${filter_dir}/${grid_fn}" \
relative="TRUE"
create_symlink_to_file ${grid_fp} ${filter_dir}/${grid_fn} TRUE
#
# Create the namelist file (in the filter_dir directory) that the orography
# filtering executable will read in.
Expand Down
66 changes: 23 additions & 43 deletions scripts/exregional_run_fcst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,15 @@ fi
#target="${FIXlam}/${CRES}${DOT_OR_USCORE}mosaic.halo${NH4}.nc" # Should this point to this halo4 file or a halo3 file???
target="${FIXlam}/${CRES}${DOT_OR_USCORE}mosaic.halo${NH3}.nc" # Should this point to this halo4 file or a halo3 file???
symlink="grid_spec.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

# Symlink to halo-3 grid file with "halo3" stripped from name.
mosaic_fn="grid_spec.nc"
grid_fn=$( get_charvar_from_netcdf "${mosaic_fn}" "gridfiles" )

target="${FIXlam}/${grid_fn}"
symlink="${grid_fn}"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

# Symlink to halo-4 grid file with "${CRES}_" stripped from name.
#
Expand All @@ -147,8 +145,7 @@ create_symlink_to_file target="$target" symlink="$symlink" \
#
target="${FIXlam}/${CRES}${DOT_OR_USCORE}grid.tile${TILE_RGNL}.halo${NH4}.nc"
symlink="grid.tile${TILE_RGNL}.halo${NH4}.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}


#
Expand All @@ -165,8 +162,7 @@ fi
# Symlink to halo-0 orography file with "${CRES}_" and "halo0" stripped from name.
target="${FIXlam}/${CRES}${DOT_OR_USCORE}oro_data.tile${TILE_RGNL}.halo${NH0}.nc"
symlink="oro_data.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
#
# Symlink to halo-4 orography file with "${CRES}_" stripped from name.
#
Expand All @@ -182,8 +178,7 @@ create_symlink_to_file target="$target" symlink="$symlink" \
#
target="${FIXlam}/${CRES}${DOT_OR_USCORE}oro_data.tile${TILE_RGNL}.halo${NH4}.nc"
symlink="oro_data.tile${TILE_RGNL}.halo${NH4}.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
#
# If using the FV3_HRRR physics suite, there are two files (that contain
# statistics of the orography) that are needed by the gravity wave drag
Expand All @@ -198,8 +193,7 @@ if [[ ${suites[@]} =~ "${CCPP_PHYS_SUITE}" ]] ; then
for file_id in "${file_ids[@]}"; do
target="${FIXlam}/${CRES}${DOT_OR_USCORE}oro_data_${file_id}.tile${TILE_RGNL}.halo${NH0}.nc"
symlink="oro_data_${file_id}.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
done
fi
#
Expand Down Expand Up @@ -238,53 +232,49 @@ if [ "${CPL_AQM}" = "TRUE" ]; then

target="${COMIN}/${NET}.${cycle}${dot_ensmem}.gfs_data.tile${TILE_RGNL}.halo${NH0}.nc"
symlink="gfs_data.nc"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

target="${COMIN}/${NET}.${cycle}${dot_ensmem}.sfc_data.tile${TILE_RGNL}.halo${NH0}.nc"
symlink="sfc_data.nc"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

target="${COMIN}/${NET}.${cycle}${dot_ensmem}.gfs_ctrl.nc"
symlink="gfs_ctrl.nc"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

for fhr in $(seq -f "%03g" 0 ${LBC_SPEC_INTVL_HRS} ${FCST_LEN_HRS}); do
target="${COMIN}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile${TILE_RGNL}.f${fhr}.nc"
symlink="gfs_bndy.tile${TILE_RGNL}.${fhr}.nc"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
done
target="${COMIN}/${NET}.${cycle}${dot_ensmem}.NEXUS_Expt.nc"
symlink="NEXUS_Expt.nc"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

# create symlink to PT for point source in SRW-AQM
target="${COMIN}/${NET}.${cycle}${dot_ensmem}.PT.nc"
if [ -f ${target} ]; then
symlink="PT.nc"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
fi

else
target="${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_data.tile${TILE_RGNL}.halo${NH0}.nc"
symlink="gfs_data.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

target="${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.sfc_data.tile${TILE_RGNL}.halo${NH0}.nc"
symlink="sfc_data.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

target="${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_ctrl.nc"
symlink="gfs_ctrl.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

for fhr in $(seq -f "%03g" 0 ${LBC_SPEC_INTVL_HRS} ${FCST_LEN_HRS}); do
target="${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile${TILE_RGNL}.f${fhr}.nc"
symlink="gfs_bndy.tile${TILE_RGNL}.${fhr}.nc"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
done
fi
#
Expand Down Expand Up @@ -335,8 +325,7 @@ for (( i=0; i<${num_symlinks}; i++ )); do

symlink="${DATA}/$symlink"
target="$FIXam/$target"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}

done
#
Expand All @@ -359,8 +348,7 @@ if [ "${USE_MERRA_CLIMO}" = "TRUE" ]; then
symlink="${DATA}/${pre_f}.dat"
fi
target="${f_nm_path}"
create_symlink_to_file target="$target" symlink="$symlink" \
relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
done
fi
#
Expand Down Expand Up @@ -403,17 +391,11 @@ else
relative_link_flag="FALSE"
fi

create_symlink_to_file target="${DATA_TABLE_FP}" \
symlink="${DATA}/${DATA_TABLE_FN}" \
relative="${relative_link_flag}"
create_symlink_to_file ${DATA_TABLE_FP} ${DATA}/${DATA_TABLE_FN} ${relative_link_flag}

create_symlink_to_file target="${FIELD_TABLE_FP}" \
symlink="${DATA}/${FIELD_TABLE_FN}" \
relative="${relative_link_flag}"
create_symlink_to_file ${FIELD_TABLE_FP} ${DATA}/${FIELD_TABLE_FN} ${relative_link_flag}

create_symlink_to_file target="${FIELD_DICT_FP}" \
symlink="${DATA}/${FIELD_DICT_FN}" \
relative="${relative_link_flag}"
create_symlink_to_file ${FIELD_DICT_FP} ${DATA}/${FIELD_DICT_FN} ${relative_link_flag}

if [ ${WRITE_DOPOST} = "TRUE" ]; then
cp_vrfy ${PARMdir}/upp/nam_micro_lookup.dat ./eta_micro_lookup.dat
Expand Down Expand Up @@ -581,7 +563,7 @@ for the current cycle's (cdate) run directory (DATA) failed:
rm_vrfy "${file_id}"
target="${DATA}/RESTART/${rst_yyyymmdd}.${rst_hh}0000.${file_id}"
symlink="${file_id}"
create_symlink_to_file target="$target" symlink="$symlink" relative="${relative_link_flag}"
create_symlink_to_file $target $symlink ${relative_link_flag}
done
cd_vrfy ${DATA}
fi
Expand Down Expand Up @@ -818,9 +800,7 @@ if [ ${WRITE_DOPOST} = "TRUE" ]; then
if [ $RUN_ENVIR != "nco" ]; then
basetime=$( $DATE_UTIL --date "$yyyymmdd $hh" +%y%j%H%M )
symlink_suffix="_${basetime}f${fhr}${post_mn}"
create_symlink_to_file target="${post_renamed_fn}" \
symlink="${FID}${symlink_suffix}" \
relative="TRUE"
create_symlink_to_file ${post_renamed_fn} ${FID}${symlink_suffix} TRUE
fi
# DBN alert
if [ $SENDDBN = "TRUE" ]; then
Expand Down
4 changes: 1 addition & 3 deletions scripts/exregional_run_post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,7 @@ for fid in "${fids[@]}"; do
post_renamed_fn="${NET}.${cycle}${dot_ensmem}.${fid}.${post_renamed_fn_suffix}"
mv_vrfy ${DATA_FHR}/${post_orig_fn} ${post_renamed_fn}
if [ $RUN_ENVIR != "nco" ]; then
create_symlink_to_file target="${post_renamed_fn}" \
symlink="${FID}${symlink_suffix}" \
relative="TRUE"
create_symlink_to_file ${post_renamed_fn} ${FID}${symlink_suffix} TRUE
fi
# DBN alert
if [ $SENDDBN = "TRUE" ]; then
Expand Down
85 changes: 8 additions & 77 deletions ush/bash_utils/create_symlink_to_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,78 +16,20 @@ function create_symlink_to_file() {
#
#-----------------------------------------------------------------------
#
# Save current shell options (in a global array). Then set new options
# for this script/function.
#
#-----------------------------------------------------------------------
#
{ save_shell_opts; . ${USHdir}/preamble.sh; } > /dev/null 2>&1
#
#-----------------------------------------------------------------------
#
# Get the full path to the file in which this script/function is located
# (scrfunc_fp), the name of that file (scrfunc_fn), and the directory in
# which the file is located (scrfunc_dir).
#
#-----------------------------------------------------------------------
#
local scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" )
local scrfunc_fn=$( basename "${scrfunc_fp}" )
local scrfunc_dir=$( dirname "${scrfunc_fp}" )
#
#-----------------------------------------------------------------------
#
# Get the name of this function.
#
#-----------------------------------------------------------------------
#
local func_name="${FUNCNAME[0]}"
#
#-----------------------------------------------------------------------
#
# Specify the set of valid argument names for this script/function. Then
# process the arguments provided to this script/function (which should
# consist of a set of name-value pairs of the form arg1="value1", etc).
#
#-----------------------------------------------------------------------
#
local valid_args=( \
"target" \
"symlink" \
"relative" \
)
process_args valid_args "$@"
#
#-----------------------------------------------------------------------
#
# For debugging purposes, print out values of arguments passed to this
# script. Note that these will be printed out only if VERBOSE is set to
# TRUE.
#
#-----------------------------------------------------------------------
#
print_input_args valid_args
#
#-----------------------------------------------------------------------
#
# Verify that the required arguments to this function have been specified.
# If not, print out an error message and exit.
#
#-----------------------------------------------------------------------
#
if [ -z "${target}" ]; then
print_err_msg_exit "\
The argument \"target\" specifying the target of the symbolic link that
this function will create was not specified in the call to this function:
target = \"$target\""
fi
if [[ $# -lt 2 ]]; then
usage
print_err_msg_exit "Function create_symlink_to_file() requires at least two arguments"
fi

if [ -z "${symlink}" ]; then
print_err_msg_exit "\
The argument \"symlink\" specifying the symbolic link that this function
will create was not specified in the call to this function:
symlink = \"$symlink\""
fi
target=$1
symlink=$2
relative=${3:-TRUE}
#
#-----------------------------------------------------------------------
#
Expand All @@ -106,8 +48,6 @@ will create was not specified in the call to this function:
#
#-----------------------------------------------------------------------
#
relative=${relative:-"TRUE"}

valid_vals_relative=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
check_var_valid_value "relative" "valid_vals_relative"
#
Expand Down Expand Up @@ -148,16 +88,7 @@ not exist or is not a file:
#
#-----------------------------------------------------------------------
#
ln_vrfy -sf ${relative_flag} "$target" "$symlink"
#
#-----------------------------------------------------------------------
#
# Restore the shell options saved at the beginning of this script/func-
# tion.
#
#-----------------------------------------------------------------------
#
{ restore_shell_opts; } > /dev/null 2>&1
ln -sf ${relative_flag} "$target" "$symlink"

}

0 comments on commit c7e093d

Please sign in to comment.