Skip to content

Commit

Permalink
Add help message and ability to turn on verbose wget output. Wget out…
Browse files Browse the repository at this point in the history
…put devaults to -nv so that the Github Actions output won't be filled with the wget download status. This will make debugging failed testcases easier
  • Loading branch information
scrasmussen committed Oct 10, 2024
1 parent 3b7b0ec commit fff39c0
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 4 deletions.
32 changes: 31 additions & 1 deletion contrib/get_aerosol_climo.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
#!/bin/bash

# Function to display help message
print_help() {
echo "get_aerosol_climo.sh: contrib/get_aerosol_climo.sh [-v,--verbose]"
echo " Script for downloading/extracting the GOCART climatological aerosol data."
echo ""
echo "Options:"
echo " -v, --verbose Turn on wget verbose output."
echo " --help Show this help message and exit."
}

verbose="-nv"
# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--help)
print_help
exit 0
;;
-v|--verbose)
verbose="-v"
;;
*)
echo "Unknown option: $1"
print_help
exit 1
;;
esac
shift
done

#set -ex

# Directory where this script is located
Expand All @@ -20,7 +50,7 @@ data_files=("FV3_aeroclim1" "FV3_aeroclim2" "FV3_aeroclim3" "FV3_aeroclim_optics
cd $BASEDIR/scm/data/physics_input_data/
for file in "${data_files[@]}"; do
echo "Retrieving $file.tar.gz"
wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/${file}.tar.gz
wget ${verbose} https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/${file}.tar.gz
tar -xvf ${file}.tar.gz
rm -f ${file}.tar.gz
done
Expand Down
32 changes: 31 additions & 1 deletion contrib/get_all_static_data.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
#!/bin/bash

# Function to display help message
print_help() {
echo "get_all_static_data.sh: contrib/get_all_static_data.sh [-v,--verbose]"
echo " Script for downloading/extracting the processed SCM case data."
echo ""
echo "Options:"
echo " -v, --verbose Turn on wget verbose output."
echo " --help Show this help message and exit."
}

verbose="-nv"
# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--help)
print_help
exit 0
;;
-v|--verbose)
verbose="-v"
;;
*)
echo "Unknown option: $1"
print_help
exit 1
;;
esac
shift
done

#set -ex

# Directory where this script is located
Expand All @@ -21,7 +51,7 @@ for file in "${data_files[@]}"; do
mkdir -p $BASEDIR/scm/data/$file
cd $BASEDIR/scm/data/$file
echo "Retrieving $file"
wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/${file}.tar.gz
wget ${verbose} https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/${file}.tar.gz
tar -xf ${file}.tar.gz
rm -f ${file}.tar.gz
done
Expand Down
32 changes: 31 additions & 1 deletion contrib/get_mg_inccn_data.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
#!/bin/bash

# Function to display help message
print_help() {
echo "get_mg_inccn_data.sh: contrib/get_mg_inccn_data.sh [-v,--verbose]"
echo " Script for downloading/extracting the Morrison-Gettelman data."
echo ""
echo "Options:"
echo " -v, --verbose Turn on wget verbose output."
echo " --help Show this help message and exit."
}

verbose="-nv"
# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--help)
print_help
exit 0
;;
-v|--verbose)
verbose="-v"
;;
*)
echo "Unknown option: $1"
print_help
exit 1
;;
esac
shift
done

set -ex

# Directory where this script is located
Expand All @@ -16,7 +46,7 @@ BASEDIR=$MYDIR/..

# Change to directory containing the physics input data, download and extract archive
cd $BASEDIR/scm/data/physics_input_data/
wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/MG_INCCN_data.tar.gz
wget ${verbose} https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/MG_INCCN_data.tar.gz
tar -xvf MG_INCCN_data.tar.gz
rm -f MG_INCCN_data.tar.gz
cd $BASEDIR/
Expand Down
33 changes: 32 additions & 1 deletion contrib/get_thompson_tables.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
#!/bin/bash

# Function to display help message
print_help() {
echo "get_thompson_tables.sh: contrib/get_thompson_tables.sh [-v,--verbose]"
echo " Script for downloading/extracting the Thompson lookup tables."
echo ""
echo "Options:"
echo " -v, --verbose Turn on wget verbose output."
echo " --help Show this help message and exit."
}

verbose="-nv"
# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
--help)
print_help
exit 0
;;
-v|--verbose)
verbose="-v"
;;
*)
echo "Unknown option: $1"
print_help
exit 1
;;
esac
shift
done

set -ex

if [[ $(uname -s) == Darwin ]]; then
Expand All @@ -15,7 +45,8 @@ BASEDIR=$MYDIR/..

# Change to directory containing the physics input data, download and extract archive
cd $BASEDIR/scm/data/physics_input_data/
wget https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/thompson_tables.tar.gz

wget ${verbose} https://github.com/NCAR/ccpp-scm/releases/download/v7.0.0-beta/thompson_tables.tar.gz
tar -xvf thompson_tables.tar.gz
rm -f thompson_tables.tar.gz
cd $BASEDIR/
Expand Down

0 comments on commit fff39c0

Please sign in to comment.