Skip to content

Commit 1361983

Browse files
Get rid of set_trace and replace with set -x (NOAA-EMC#4704)
This removes the set_trace bash function and replaces all calls to that function with `set -x`
1 parent 198810e commit 1361983

14 files changed

Lines changed: 20 additions & 46 deletions

dev/jobs/JGLOBAL_ATMOS_ANALYSIS_CALC_FV3JEDI

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ set +x
7575
if [[ ${err} -ne 0 ]]; then
7676
err_exit "${DATAROOT} does not exist, ABORT!"
7777
fi
78-
set_trace
78+
set -x
7979
if [[ ${KEEPDATA} == "NO" ]]; then
8080
rm -rf "${DATA}"
8181
fi

dev/jobs/JGLOBAL_ATM_ANALYSIS_FINALIZE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ set +x
6464
if [[ ${err} -ne 0 ]]; then
6565
err_exit "${DATAROOT} does not exist, ABORT!"
6666
fi
67-
set_trace
67+
set -x
6868
if [[ "${KEEPDATA}" == "NO" ]]; then
6969
rm -rf "${DATA}"
7070
fi

dev/jobs/JGLOBAL_ATM_PREP_ANL_BIAS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fi
122122
if [[ ${err} -ne 0 ]]; then
123123
err_exit "FATAL ERROR executing ${EXSCRIPT}"
124124
fi
125-
set_trace
125+
set -x
126126

127127
##############################################
128128
# End JOB SPECIFIC work

dev/jobs/JGLOBAL_ENKF_ECEN_FV3JEDI

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ set +x
7474
if [[ ${err} -ne 0 ]]; then
7575
err_exit "${DATAROOT} does not exist, ABORT!"
7676
fi
77-
set_trace
77+
set -x
7878
if [[ "${KEEPDATA}" == "NO" ]]; then
7979
rm -rf "${DATA}"
8080
fi

dev/scripts/exgfs_atmos_awips_20km_1p0deg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ echo "#######################################"
6161
echo " Process GRIB AWIP GRIB2 PRODUCTS "
6262
echo "#######################################"
6363
echo " "
64-
set_trace
64+
set -x
6565

6666
# Set type of Interpolation for WGRIB2
6767
export opt1=' -set_grib_type same -new_grid_winds earth '

dev/ush/load_modules.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,7 @@ case "${MODULE_TYPE}" in
127127

128128
module list
129129

130-
ftype=$(type -t set_trace || echo "")
131-
if [[ "${ftype}" == "function" ]]; then
132-
set_trace
133-
elif [[ "${set_x}" == "YES" ]]; then
130+
if [[ "${set_x}" == "YES" ]]; then
134131
set -x
135132
fi
136133

@@ -221,11 +218,7 @@ case "${MODULE_TYPE}" in
221218

222219
module list
223220

224-
# If this function exists in the environment, run it; else set -x if it was set on entering this script
225-
ftype=$(type -t set_trace || echo "")
226-
if [[ "${ftype}" == "function" ]]; then
227-
set_trace
228-
elif [[ "${set_x}" == "YES" ]]; then
221+
if [[ "${set_x}" == "YES" ]]; then
229222
set -x
230223
fi
231224
;;

ush/dataroot_com_path.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dataroot_com_path() {
4242
local new_com_path="${DATAROOT}/${relative_path}"
4343

4444
echo "${new_com_path}"
45-
set_trace
45+
set -x
4646
}
4747

4848
declare -xf dataroot_com_path

ush/jjob_shell_setup.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,16 @@ source "${USHglobal}/err_exit.sh"
3838
shopt -s nullglob # Allow null globs instead of treating * as literal
3939

4040
##############################################
41-
# Shell options and tracing
41+
# Shell options
4242
##############################################
43-
source "${USHglobal}/set_trace.sh"
4443
export SHELLOPTS
4544
##############################################
4645
# Create and enter the working directory
4746
##############################################
4847
source "${USHglobal}/setup_data_dir.sh" "${DATA}"
4948

5049
# Activate tracing
51-
set_trace
50+
set -x
5251

5352
##############################################
5453
# Exit trap: run postamble on exit to report elapsed time and clean up

ush/parsing_namelists_WW3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ WW3_namelists() {
1616
if [[ -f "${DATA}/ww3_points.list" ]]; then
1717
set +x
1818
echo "ww3_points.list copied (${PARMglobal}/wave/wave_${NET}.buoys)."
19-
set_trace
19+
set -x
2020
else
2121
echo "FATAL ERROR : ww3_points.list (${PARMglobal}/wave/wave_${NET}.buoys) NOT FOUND"
2222
exit 12

ush/set_trace.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)