Skip to content

Commit

Permalink
Update sorc/link_workflow.sh
Browse files Browse the repository at this point in the history
Co-authored-by: Walter Kolczynski - NOAA <[email protected]>
  • Loading branch information
aerorahul and WalterKolczynski-NOAA authored Dec 11, 2024
1 parent b5ede8b commit 4531678
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,23 @@ done
# WW3 pre/post executables
declare -a ww3_exes=("ww3_grid" "ww3_prep" "ww3_prnc" "ww3_outp" "ww3_outf" "ww3_gint" "ww3_ounf" "ww3_ounp" "ww3_grib")
# TODO: ww3_prep, ww3_outf, ww3_ounf, ww3_ounp are not used in the workflow # FIXME or remove them from the list
if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF" ]]; then # installed with PDLIB=OFF (Used in GEFS)
for ww3exe in "${ww3_exes[@]}"; do
[[ -s "gefs_${ww3exe}.x" ]] && rm -f "gefs_${ww3exe}.x"
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF/bin/${ww3exe}" "${HOMEgfs}/exec/gefs_${ww3exe}.x"
done
fi

if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON" ]]; then # installed with PDLIB=ON (Used in GFS, may be SFS later)
for ww3exe in "${ww3_exes[@]}"; do
[[ -s "gfs_${ww3exe}.x" ]] && rm -f "gfs_${ww3exe}.x"
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON/bin/${ww3exe}" "${HOMEgfs}/exec/gfs_${ww3exe}.x"
done
fi
declare -A wave_systems
wave_systems["gfs"]="pdlib_ON"
wave_systems["gefs"]="pdlib_OFF"
wave_systems["sfs"]="pdlib_OFF"

for sys in ${!wave_systems[@]}; do

Check failure

Code scanning / shellcheck

Double quote array expansions to avoid re-splitting elements. Error

Double quote array expansions to avoid re-splitting elements.
build_loc="${wave_systems[${sys}]}"
if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}" ]]; then
for ww3exe in "${ww3_exes[@]}"; do
target_ww3_exe="${sys}_${ww3exe}.x"
if [[ -s "${target_ww3_exe}" ]]; then
rm -f "${target_ww3_exe}"
fi
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}/bin/${ww3exe}.x" "${HOMEgfs}/exec/${target_ww3_exe}"
done
fi
done

[[ -s "upp.x" ]] && rm -f upp.x
${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/exec/upp.x" .
Expand Down

0 comments on commit 4531678

Please sign in to comment.