Skip to content

Commit

Permalink
Move root fixdir setting higher in link script
Browse files Browse the repository at this point in the history
Moved the setting of FIXDIR higher so it errors on an unknown machine
sooner. Also removed redundant version file load.

Refs: NOAA-EMC#966
  • Loading branch information
WalterKolczynski-NOAA committed Sep 27, 2022
1 parent 77b9582 commit 578c3bc
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,10 @@ cd ${script_dir}
source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1
# shellcheck disable=
machine="${target:?}"
# Source fix version file
source "${top_dir}/versions/fix.ver"

LINK="ln -fs"
SLINK="ln -fs"
if [[ "${RUN_ENVIR}" == "nco" ]]; then
LINK="cp -rp"
fi

# Link post
[[ -d upp.fd ]] && rm -rf upp.fd
${LINK} ufs_model.fd/FV3/upp upp.fd

#------------------------------
#--model fix fields
#------------------------------

# Source fix version file
source "${top_dir}/versions/fix.ver"

case "${machine}" in
"wcoss2") FIX_DIR="/lfs/h2/emc/global/noscrub/emc.global/FIX/fix" ;;
"hera") FIX_DIR="/scratch1/NCEPDEV/global/glopara/fix" ;;
Expand All @@ -78,6 +62,19 @@ case "${machine}" in
;;
esac

# Source fix version file
source "${top_dir}/versions/fix.ver"

LINK="ln -fs"
SLINK="ln -fs"
if [[ "${RUN_ENVIR}" == "nco" ]]; then
LINK="cp -rp"
fi

# Link post
[[ -d upp.fd ]] && rm -rf upp.fd
${LINK} ufs_model.fd/FV3/upp upp.fd

if [ ! -z "${FIX_DIR}" ]; then
if [ ! -d "${top_dir}/fix" ]; then mkdir "${top_dir}/fix" || exit 1; fi
fi
Expand Down

0 comments on commit 578c3bc

Please sign in to comment.