Skip to content

Commit

Permalink
Move debug to util/debug_options.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusff committed Apr 21, 2020
1 parent 8e82879 commit 9299853
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
10 changes: 5 additions & 5 deletions prep.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash -x
#!/bin/bash
#
# prep.sh
#
# Sample script to retrieve ~1 month of data

set -uo pipefail
test -n "${BCTOOL_DEBUG}" && set -x
source ./util/debug_options.sh

./util/check_requirements.sh || exit 1

Expand Down Expand Up @@ -44,10 +44,10 @@ function updatenml(){
done
}

./preprocessor.ESGF 2033-12-30_00:00:00 2034-01-04_00:00:00 ${BCTABLE}
#./preprocessor.ESGF 2033-12-30_00:00:00 2034-01-04_00:00:00 ${BCTABLE}

WRFDIR=${WRFDIR:-WRF}
./util/deploy_WRF_CMake_binaries.sh ${WRFDIR}
#./util/deploy_WRF_CMake_binaries.sh ${WRFDIR}

cd $WRFDIR
#
Expand Down
3 changes: 1 addition & 2 deletions util/check_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#
# Check availability of command dependencies

set -euo pipefail
test -n "${BCTOOL_DEBUG}" && set -x
source util/debug_options.sh

commands="wget tar xz wget sed grep cdo ncdump ncks"
failed=false
Expand Down
4 changes: 1 addition & 3 deletions util/clean_WRF_dir.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash
#
#

set -euo pipefail
test -n "${BCTOOL_DEBUG}" && set -x
source util/debug_options.sh

tag=$1
target="WRF.${tag}"
Expand Down
11 changes: 11 additions & 0 deletions util/debug_options.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# Shell settings
#
# set
# -e : abort execution on error
# -u : abort execution on undefined variable
# -x : show shell-expanded commands
# -o pipefail : abort execution on error in pipe command
set -uo pipefail
BCTOOL_DEBUG=${BCTOOL_DEBUG:-0}
test "${BCTOOL_DEBUG}" -ne 0 && set -x
5 changes: 1 addition & 4 deletions util/deploy_WRF_CMake_binaries.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/bin/bash
#
#

# Shell settings
set -euo pipefail
test -n "${BCTOOL_DEBUG}" && set -x
source util/debug_options.sh

WRFDIR=${1:-WRF}

Expand Down
6 changes: 1 addition & 5 deletions util/link_grib.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash
#
#

set -euo pipefail
test -n "${BCTOOL_DEBUG}" && set -x

# Bash reimplementation of the standard WPS link_grib.csh
if test -z "$1"; then
echo " "
echo " "
Expand Down

0 comments on commit 9299853

Please sign in to comment.