Skip to content

Commit

Permalink
Linter fixes for fix dir reorg
Browse files Browse the repository at this point in the history
Second wave of linter fixes for removing gfs-utils code/fix reorg.

Refs: NOAA-EMC#966
  • Loading branch information
WalterKolczynski-NOAA committed Oct 4, 2022
1 parent 797dd70 commit 0babfaa
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
13 changes: 7 additions & 6 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ EOF
exit 1
}

script_dir=$(cd $(dirname "${BASH_SOURCE[0]}") &> /dev/null && pwd)
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd "${script_dir}" || exit 1

_build_ufs_opt=""
Expand All @@ -45,14 +45,14 @@ while getopts ":a:c:hov" option; do
o) _ops_opt+="-o";;
# s) _build_ufs_opt+="-s ${OPTARG} ";;
v) _verbose_opt="-v";;
\?)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
usage
;;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
;;
*)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
usage
;;
esac
done

Expand All @@ -76,7 +76,7 @@ fi
target=""
# shellcheck disable=SC1091
source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1
# shellcheck disable=
# shellcheck enable=SC1091
if [[ -z "${target}" ]]; then
echo "FATAL: Unable to determine target machine"
exit 1
Expand All @@ -85,6 +85,7 @@ fi
#------------------------------------
# INCLUDE PARTIAL BUILD
#------------------------------------
# shellcheck source-path=sorc/
source ./partial_build.sh $_verbose_opt $_partial_opt

if [[ ${target} == "jet" ]]; then
Expand Down
10 changes: 5 additions & 5 deletions sorc/build_gfs_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ while getopts ":dv" option; do
case "${option}" in
d) export BUILD_TYPE="DEBUG";;
v) export BUILD_VERBOSE="YES";;
\?)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
usage
;;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
;;
*)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
usage
;;
esac
done
shift $((OPTIND-1))

${cwd}/gfs_utils.fd/sorc/build_gfs_utils.sh
"${cwd}/gfs_utils.fd/sorc/build_gfs_utils.sh"

exit
12 changes: 6 additions & 6 deletions sorc/build_ww3prepost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ set -x
script_dir=$(dirname "${BASH_SOURCE[0]}")
cd "${script_dir}" || exit 1

# shellcheck disable=SC1091
source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1
# shellcheck enable=SC1091

# Default settings
APP="S2SWA"
Expand All @@ -13,14 +15,14 @@ while getopts "a:v" option; do
case "${option}" in
a) APP="${OPTARG}" ;;
v) BUILD_VERBOSE="YES";;
\?)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
usage
;;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
usage
;;
*)
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
usage
;;
esac
done

Expand All @@ -43,9 +45,7 @@ finalexecdir=$( pwd -P )/../exec
#Determine machine and load modules
set +x
module use ../modulefiles
# shellcheck disable=SC1091
module load modulefile.ww3.${target}
# shellcheck disable=
set -x

#Set WW3 directory, switch, prep and post exes
Expand Down
2 changes: 1 addition & 1 deletion sorc/checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ while getopts ":chgum:o" option; do
done
shift $((OPTIND-1))

export topdir=$(cd $(dirname "${BASH_SOURCE[0]}") &> /dev/null && pwd)
export topdir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
export logdir="${topdir}/logs"
mkdir -p "${logdir}
"
Expand Down
2 changes: 1 addition & 1 deletion ush/gfs_bufr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ while (( hh <= FEND )); do
break
fi

if (( $ic >= 360 )); then
if (( ic >= 360 )); then
echo "FATAL: COULD NOT LOCATE logf${hh3} file AFTER 1 HOUR"
exit 2
fi
Expand Down
2 changes: 1 addition & 1 deletion ush/gfs_bufr_netcdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ln -sf $PARMbufrsnd/bufr_gfs_${CLASS}.tbl fort.1
ln -sf ${STNLIST:-$PARMbufrsnd/bufr_stalist.meteo.gfs} fort.8
ln -sf $PARMbufrsnd/bufr_ij13km.txt fort.7

${APRUN_POSTSND} ${EXECbufrsnd}/${pgm} < gfsparm > out_gfs_bufr_$FEND
${APRUN_POSTSND} "${EXECbufrsnd}/${pgm}" < gfsparm > "out_gfs_bufr_${FEND}"
export err=$?

exit ${err}
3 changes: 1 addition & 2 deletions ush/gfs_sndp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ cd $DATA/$m
EOF
# JY export err=$?; err_chk
export err=$?; #err_chk
if [ $err -ne 0 ]
then
if (( err != 0 )); then
echo "ERROR in $pgm"
err_chk
fi
Expand Down
2 changes: 1 addition & 1 deletion ush/syndat_getjtbul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@ fi

echo "Leaving sub-shell syndat_getjtbul.sh to recover JTWC Bulletins" \
>> $pgmout
echo " " >> $pgmout
echo " " >> "${pgmout}"

exit
2 changes: 1 addition & 1 deletion ush/syndat_qctropcy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,6 @@ then
fi

# Write JTWC/FNOC Tcvitals to /com path since not saved anywhere else
[ $SENDCOM = YES ] && cp fnoc ${COMSP}jtwc-fnoc.tcvitals.$tmmark
[ $SENDCOM = YES ] && cp fnoc "${COMSP}jtwc-fnoc.tcvitals.${tmmark}"

exit

0 comments on commit 0babfaa

Please sign in to comment.