2016-11-22 06:26:46 -06:00
|
|
|
#!/bin/bash
|
2017-02-16 09:00:42 -06:00
|
|
|
|
|
|
|
# This runs the initialization step of a simulator,
|
|
|
|
# then compares the resulting INIT file against a reference.
|
|
|
|
# This is meant to track regressions in INIT file writing.
|
|
|
|
# Useful for models that are too large to do simulation on
|
|
|
|
# as a regression test.
|
2016-11-22 06:26:46 -06:00
|
|
|
|
|
|
|
INPUT_DATA_PATH="$1"
|
|
|
|
RESULT_PATH="$2"
|
|
|
|
BINPATH="$3"
|
|
|
|
FILENAME="$4"
|
|
|
|
ABS_TOL="$5"
|
|
|
|
REL_TOL="$6"
|
2018-09-07 07:37:34 -05:00
|
|
|
COMPARE_ECL_COMMAND="$7"
|
2021-08-17 06:14:49 -05:00
|
|
|
# param 8 and 9 ignored, only used with regression tests
|
|
|
|
EXE_NAME="${10}"
|
|
|
|
shift 10
|
2016-11-22 06:26:46 -06:00
|
|
|
TEST_ARGS="$@"
|
|
|
|
|
|
|
|
rm -Rf ${RESULT_PATH}
|
|
|
|
mkdir -p ${RESULT_PATH}
|
|
|
|
cd ${RESULT_PATH}
|
2021-08-17 06:14:49 -05:00
|
|
|
${BINPATH}/${EXE_NAME} ${TEST_ARGS} --enable-dry-run=true --output-dir=${RESULT_PATH} ${INPUT_DATA_PATH}/${FILENAME}
|
2016-11-22 06:26:46 -06:00
|
|
|
cd ..
|
|
|
|
|
2017-02-16 09:00:42 -06:00
|
|
|
ecode=0
|
2017-04-07 04:40:45 -05:00
|
|
|
${COMPARE_ECL_COMMAND} -t INIT ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${EXE_NAME}/${FILENAME} ${ABS_TOL} ${REL_TOL}
|
2017-02-16 09:00:42 -06:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
ecode=1
|
2018-08-14 04:03:28 -05:00
|
|
|
${COMPARE_ECL_COMMAND} -a -t INIT ${RESULT_PATH}/${FILENAME} ${INPUT_DATA_PATH}/opm-simulation-reference/${EXE_NAME}/${FILENAME} ${ABS_TOL} ${REL_TOL}
|
2017-02-16 09:00:42 -06:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit $ecode
|