mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: use getopts in test drivers
the number of options were getting unmanagable as a flat list. also add help/usage to the scripts
This commit is contained in:
@@ -6,16 +6,38 @@
|
||||
# but in situations where it is difficult to get the restart files to agree this
|
||||
# script can be used as second-best alternative.
|
||||
|
||||
INPUT_DATA_PATH="$1"
|
||||
RESULT_PATH="$2"
|
||||
BINPATH="$3"
|
||||
FILENAME="$4"
|
||||
ABS_TOL="$5"
|
||||
REL_TOL="$6"
|
||||
COMPARE_ECL_COMMAND="$7"
|
||||
OPM_PACK_COMMAND="$8"
|
||||
EXE_NAME="${9}"
|
||||
shift 9
|
||||
if test $# -eq 0
|
||||
then
|
||||
echo -e "Usage:\t$0 <options> -- [additional simulator options]"
|
||||
echo -e "\tMandatory options:"
|
||||
echo -e "\t\t -i <path> Path to read deck from"
|
||||
echo -e "\t\t -r <path> Path to store results in"
|
||||
echo -e "\t\t -b <path> Path to simulator binary"
|
||||
echo -e "\t\t -f <filename> Deck file name"
|
||||
echo -e "\t\t -a <tol> Absolute tolerance in comparison"
|
||||
echo -e "\t\t -t <tol> Relative tolerance in comparison"
|
||||
echo -e "\t\t -c <path> Path to comparison tool"
|
||||
echo -e "\t\t -p <path> Path to deck packing tool"
|
||||
echo -e "\t\t -e <filename> Simulator binary to use"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OPTIND=1
|
||||
while getopts "i:r:b:f:a:t:c:p:e:" OPT
|
||||
do
|
||||
case "${OPT}" in
|
||||
i) INPUT_DATA_PATH=${OPTARG} ;;
|
||||
r) RESULT_PATH=${OPTARG} ;;
|
||||
b) BINPATH=${OPTARG} ;;
|
||||
f) FILENAME=${OPTARG} ;;
|
||||
a) ABS_TOL=${OPTARG} ;;
|
||||
t) REL_TOL=${OPTARG} ;;
|
||||
c) COMPARE_ECL_COMMAND=${OPTARG} ;;
|
||||
p) OPM_PACK_COMMAND=${OPTARG} ;;
|
||||
e) EXE_NAME=${OPTARG} ;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND-1))
|
||||
TEST_ARGS="$@"
|
||||
|
||||
BASE_NAME=${FILENAME}_RESTART.DATA
|
||||
|
||||
Reference in New Issue
Block a user