Skip to content

Commit 9118ab3

Browse files
GFS-UTILS update for build and ush scripts (NOAA-EMC#1082)
This PR updates the gfs-utils version (af933d3) and ush script symlinks/paths. This will resolve issue NOAA-EMC#1059 until `finddate.sh` can be used via the `prod_util` module. * New gfs-utils hash: af933d3 * A number of ush scripts were moved into the new gfs-utils repo but not added to `link_workflow.sh`. This PR adds them to `link_workflow.sh`. * Several workflow scripts are updated to point to the gfs-utils ush symlinks under the top level `/ush` folder instead of the prior `/util/ush` folder. Fixes NOAA-EMC#1059
1 parent a30b716 commit 9118ab3

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

Externals.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ protocol = git
88
required = True
99

1010
[gfs-utils]
11-
hash = 7bf599f
11+
hash = af933d3
1212
local_path = sorc/gfs_utils.fd
1313
repo_url = https://github.com/NOAA-EMC/gfs-utils
1414
protocol = git

gempak/ush/gempak_gfs_f00_gif.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ if [ $SENDCOM = YES ]; then
593593
export input=${COMOUT}/${hgttmp500dev}
594594
export HEADER=YES
595595
export OUTPATH=$DATA/gfs_500_hgt_tmp_nh_anl_${cyc}.tif
596-
${UTILgfs}/ush/make_tif.sh
596+
${USHgfs}/make_tif.sh
597597
fi
598598

599599
msg=" GEMPAK_GIF ${fhr} hour completed normally"

parm/config/config.gldas

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ echo "BEGIN: config.gldas"
1111
export GLDASSH=$HOMEgfs/scripts/exgdas_atmos_gldas.sh
1212
export gldas_spinup_hours=72
1313
export CPCGAUGE=$DMPDIR
14-
export FINDDATE=$HOMEgfs/util/ush/finddate.sh
14+
export FINDDATE=$USHgfs/finddate.sh
1515

1616
echo "END: config.gldas"

scripts/exgfs_atmos_fbwind.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fi
7979
if test "$SENDDBN" = 'YES'
8080
then
8181
# make_ntc_bull.pl WMOBH NONE KWNO NONE tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name
82-
${UTILgfs}/ush/make_ntc_bull.pl WMOBH NONE KWNO NONE tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name
82+
${USHgfs}/make_ntc_bull.pl WMOBH NONE KWNO NONE tran.fbwnd_pacific ${COMOUTwmo}/tran.fbwnd_pacific.$job_name
8383
fi
8484

8585
#####################################################################

sorc/build_gfs_utils.sh

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#! /usr/bin/env bash
22
set -eux
33

4-
function _usage() {
4+
function usage() {
55
cat << EOF
6-
Builds all of the global-workflow components by calling the individual build
7-
scripts in sequence.
6+
Builds the GFS utility programs.
87
98
Usage: ${BASH_SOURCE[0]} [-d][-h][-v]
109
-d:
@@ -20,22 +19,27 @@ EOF
2019
cwd=$(pwd)
2120

2221
OPTIND=1
23-
while getopts ":dv" option; do
22+
while getopts ":dvh" option; do
2423
case "${option}" in
2524
d) export BUILD_TYPE="DEBUG";;
2625
v) export BUILD_VERBOSE="YES";;
26+
h)
27+
usage
28+
;;
2729
:)
2830
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
2931
usage
3032
;;
3133
*)
3234
echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}"
3335
usage
34-
;;
36+
;;
3537
esac
3638
done
3739
shift $((OPTIND-1))
3840

39-
"${cwd}/gfs_utils.fd/sorc/build_gfs_utils.sh"
41+
BUILD_TYPE=${BUILD_TYPE:-"Release"} \
42+
BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \
43+
"${cwd}/gfs_utils.fd/ush/build.sh"
4044

41-
exit
45+
exit

sorc/checkout.sh

100755100644
+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ mkdir -p "${logdir}"
151151

152152
# The checkout version should always be a speciifc commit (hash or tag), not a branch
153153
errs=0
154-
checkout "gfs_utils.fd" "https://github.com/NOAA-EMC/gfs-utils" "7bf599f" ; errs=$((errs + $?))
154+
checkout "gfs_utils.fd" "https://github.com/NOAA-EMC/gfs-utils" "af933d3" ; errs=$((errs + $?))
155155
checkout "ufs_model.fd" "https://github.com/ufs-community/ufs-weather-model" "${ufs_model_hash:-6b73f5d}" ; errs=$((errs + $?))
156156
checkout "ufs_utils.fd" "https://github.com/ufs-community/UFS_UTILS.git" "8b990c0" ; errs=$((errs + $?))
157157
checkout "verif-global.fd" "https://github.com/NOAA-EMC/EMC_verif-global.git" "c267780" ; errs=$((errs + $?))

sorc/link_workflow.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ shift $((OPTIND-1))
4444

4545
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
4646
top_dir=$(cd "$(dirname "${script_dir}")" &> /dev/null && pwd)
47-
cd ${script_dir}
47+
cd "${script_dir}"
4848

4949
# shellcheck disable=SC1091
50-
source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1
50+
source gfs_utils.fd/ush/detect_machine.sh # (sets MACHINE_ID)
5151
# shellcheck disable=
52-
machine="${target:?}"
52+
machine=$(echo "${MACHINE_ID}" | cut -d. -f1)
5353

5454
#------------------------------
5555
#--model fix fields
@@ -133,12 +133,15 @@ cd "${top_dir}/parm/post" || exit 1
133133
done
134134

135135
cd "${top_dir}/scripts" || exit 8
136-
$LINK "${script_dir}/ufs_utils.fd/scripts/exemcsfc_global_sfc_prep.sh" .
136+
${LINK} "${script_dir}/ufs_utils.fd/scripts/exemcsfc_global_sfc_prep.sh" .
137137
cd "${top_dir}/ush" || exit 8
138138
for file in emcsfc_ice_blend.sh fv3gfs_driver_grid.sh fv3gfs_make_orog.sh global_cycle_driver.sh \
139139
emcsfc_snow.sh fv3gfs_filter_topo.sh global_cycle.sh fv3gfs_make_grid.sh ; do
140140
${LINK} "${script_dir}/ufs_utils.fd/ush/${file}" .
141141
done
142+
for file in finddate.sh make_ntc_bull.pl make_NTC_file.pl make_tif.sh month_name.sh ; do
143+
${LINK} "${script_dir}/gfs_utils.fd/ush/${file}" .
144+
done
142145

143146
#-----------------------------------
144147
#--add gfs_wafs link if checked out
@@ -227,7 +230,7 @@ for utilexe in fbwndgfs.x gaussian_sfcanl.x gfs_bufr.x regrid_nemsio.x supvit.x
227230
syndat_maksynrc.x syndat_qctropcy.x tocsbufr.x enkf_chgres_recenter.x \
228231
enkf_chgres_recenter_nc.x fv3nc2nemsio.x tave.x vint.x reg2grb2.x ; do
229232
[[ -s "${utilexe}" ]] && rm -f "${utilexe}"
230-
${LINK} "${script_dir}/gfs_utils.fd/sorc/install/bin/${utilexe}" .
233+
${LINK} "${script_dir}/gfs_utils.fd/install/bin/${utilexe}" .
231234
done
232235

233236
[[ -s "ufs_model.x" ]] && rm -f ufs_model.x
@@ -241,7 +244,7 @@ if [ -d "${script_dir}/gfs_wafs.fd" ]; then
241244
wafs_awc_wafavn.x wafs_blending.x wafs_blending_0p25.x \
242245
wafs_cnvgrib2.x wafs_gcip.x wafs_grib2_0p25.x \
243246
wafs_makewafs.x wafs_setmissing.x; do
244-
[[ -s $wafsexe ]] && rm -f $wafsexe
247+
[[ -s ${wafsexe} ]] && rm -f ${wafsexe}
245248
${LINK} "${script_dir}/gfs_wafs.fd/exec/${wafsexe}" .
246249
done
247250
fi

0 commit comments

Comments
 (0)