2017-01-16 01:06:26 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
OPM_DATA_ROOT=$1
|
|
|
|
|
2017-01-16 04:46:32 -06:00
|
|
|
# Copy results from a test run to refence dir
|
|
|
|
# $1 = source directory to copy data from
|
|
|
|
# $2 = destination directory to copy data to
|
|
|
|
# $3 = base file name for files to copy
|
|
|
|
# $4...$@ = file types to copy
|
2017-01-16 01:06:26 -06:00
|
|
|
copyToReferenceDir () {
|
|
|
|
SRC_DIR=$1
|
|
|
|
DST_DIR=$2;
|
|
|
|
STEM=$3;
|
|
|
|
FILETYPES=${@:4};
|
|
|
|
|
|
|
|
for filetype in $FILETYPES; do
|
2017-01-26 03:52:49 -06:00
|
|
|
cp "$WORKSPACE/$SRC_DIR$STEM.$filetype" $DST_DIR
|
2017-01-16 01:06:26 -06:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2017-01-26 03:52:49 -06:00
|
|
|
tests=${@:2}
|
2017-05-16 04:49:40 -05:00
|
|
|
test -z "$tests" && tests="spe11 spe12 spe12p spe3 spe9 norne_init msw_2d_h polymer2d"
|
2017-02-02 04:16:00 -06:00
|
|
|
if grep -q -i "norne " <<< $ghprbCommentBody
|
|
|
|
then
|
|
|
|
if test -d $WORKSPACE/deps/opm-data/norne/flow
|
|
|
|
then
|
|
|
|
tests="$tests norne_full"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo $tests
|
|
|
|
|
2017-01-26 03:52:49 -06:00
|
|
|
for test_name in ${tests}; do
|
2017-01-16 05:24:56 -06:00
|
|
|
if grep -q "spe11" <<< $test_name
|
2017-01-16 01:06:26 -06:00
|
|
|
then
|
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_sequential+spe1/ \
|
2017-04-10 06:54:49 -05:00
|
|
|
$OPM_DATA_ROOT/spe1/opm-simulation-reference/flow_sequential \
|
2017-01-16 01:06:26 -06:00
|
|
|
SPE1CASE1 \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
2017-01-16 05:24:56 -06:00
|
|
|
fi
|
2017-01-16 01:06:26 -06:00
|
|
|
|
2017-01-16 05:24:56 -06:00
|
|
|
if grep -q "spe12" <<< $test_name
|
|
|
|
then
|
2017-04-10 15:31:46 -05:00
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_ebos+spe1/ \
|
|
|
|
$OPM_DATA_ROOT/spe1/opm-simulation-reference/flow_ebos \
|
|
|
|
SPE1CASE2 \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
|
|
|
|
2017-01-16 01:06:26 -06:00
|
|
|
copyToReferenceDir \
|
2017-04-05 05:04:26 -05:00
|
|
|
$configuration/build-opm-simulators/tests/results/flow_legacy+spe1/ \
|
2017-04-07 04:40:45 -05:00
|
|
|
$OPM_DATA_ROOT/spe1/opm-simulation-reference/flow_legacy \
|
2017-01-16 01:06:26 -06:00
|
|
|
SPE1CASE2 \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
|
|
|
fi
|
|
|
|
|
2017-05-04 12:03:25 -05:00
|
|
|
if grep -q "spe12p" <<< $test_name
|
|
|
|
then
|
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_ebos+spe1_2p/ \
|
|
|
|
$OPM_DATA_ROOT/spe1/opm-simulation-reference/flow_ebos \
|
|
|
|
SPE1CASE2_2P \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
|
|
|
|
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_legacy+spe1_2p/ \
|
|
|
|
$OPM_DATA_ROOT/spe1/opm-simulation-reference/flow_legacy \
|
|
|
|
SPE1CASE2_2P \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
|
|
|
fi
|
|
|
|
|
2017-03-03 08:08:12 -06:00
|
|
|
if grep -q "msw_2d_h" <<< $test_name
|
|
|
|
then
|
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_multisegment+msw_2d_h/ \
|
2017-04-07 04:40:45 -05:00
|
|
|
$OPM_DATA_ROOT/msw_2d_h/opm-simulation-reference/flow_multisegment \
|
2017-03-03 08:08:12 -06:00
|
|
|
2D_H__ \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
|
|
|
fi
|
|
|
|
|
2017-05-16 04:49:40 -05:00
|
|
|
if grep -q "polymer2d" <<< $test_name
|
|
|
|
then
|
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_polymer+polymer_simple2D/ \
|
|
|
|
$OPM_DATA_ROOT/polymer_simple2D/opm-simulation-reference/flow_polymer \
|
|
|
|
2D_THREEPHASE_POLY_HETER \
|
|
|
|
EGRID INIT SMSPEC UNRST UNSMRY
|
|
|
|
fi
|
|
|
|
|
2017-01-17 03:48:47 -06:00
|
|
|
if grep -q "spe3" <<< $test_name
|
2017-01-16 01:06:26 -06:00
|
|
|
then
|
2017-04-10 15:31:46 -05:00
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/flow_ebos+spe3/ \
|
|
|
|
$OPM_DATA_ROOT/spe3/opm-simulation-reference/flow_ebos \
|
|
|
|
SPE3CASE1 \
|
|
|
|
EGRID INIT PRT SMSPEC UNRST UNSMRY
|
|
|
|
|
2017-01-16 01:06:26 -06:00
|
|
|
copyToReferenceDir \
|
2017-04-05 05:04:26 -05:00
|
|
|
$configuration/build-opm-simulators/tests/results/flow_legacy+spe3/ \
|
2017-04-07 04:40:45 -05:00
|
|
|
$OPM_DATA_ROOT/spe3/opm-simulation-reference/flow_legacy \
|
2017-01-16 01:06:26 -06:00
|
|
|
SPE3CASE1 \
|
|
|
|
EGRID INIT PRT SMSPEC UNRST UNSMRY
|
|
|
|
fi
|
|
|
|
|
2017-01-17 03:48:47 -06:00
|
|
|
if grep -q "spe9" <<< $test_name
|
2017-01-16 01:06:26 -06:00
|
|
|
then
|
|
|
|
copyToReferenceDir \
|
2017-04-10 15:31:46 -05:00
|
|
|
$configuration/build-opm-simulators/tests/results/flow_ebos+spe9/ \
|
|
|
|
$OPM_DATA_ROOT/spe9/opm-simulation-reference/flow_ebos \
|
|
|
|
SPE9_CP_SHORT \
|
|
|
|
EGRID INIT PRT SMSPEC UNRST UNSMRY
|
|
|
|
|
|
|
|
copyToReferenceDir \
|
2017-04-05 05:04:26 -05:00
|
|
|
$configuration/build-opm-simulators/tests/results/flow_legacy+spe9/ \
|
2017-04-07 04:40:45 -05:00
|
|
|
$OPM_DATA_ROOT/spe9/opm-simulation-reference/flow_legacy \
|
2017-01-16 01:06:26 -06:00
|
|
|
SPE9_CP_SHORT \
|
|
|
|
EGRID INIT PRT SMSPEC UNRST UNSMRY
|
|
|
|
fi
|
|
|
|
|
2017-01-26 03:52:49 -06:00
|
|
|
if grep -q "norne_init" <<< $test_name
|
|
|
|
then
|
2017-04-10 15:31:46 -05:00
|
|
|
copyToReferenceDir \
|
|
|
|
$configuration/build-opm-simulators/tests/results/init/flow_ebos+norne/ \
|
|
|
|
$OPM_DATA_ROOT/norne/opm-simulation-reference/flow_ebos \
|
|
|
|
NORNE_ATW2013 \
|
|
|
|
EGRID INIT
|
|
|
|
|
2017-01-26 03:52:49 -06:00
|
|
|
copyToReferenceDir \
|
2017-04-05 05:04:26 -05:00
|
|
|
$configuration/build-opm-simulators/tests/results/init/flow_legacy+norne/ \
|
2017-04-07 04:40:45 -05:00
|
|
|
$OPM_DATA_ROOT/norne/opm-simulation-reference/flow_legacy \
|
2017-01-26 03:52:49 -06:00
|
|
|
NORNE_ATW2013 \
|
|
|
|
EGRID INIT
|
|
|
|
fi
|
2017-02-02 04:16:00 -06:00
|
|
|
|
|
|
|
if grep -q "norne_full" <<< $test_name
|
|
|
|
then
|
2017-04-10 15:31:46 -05:00
|
|
|
copyToReferenceDir \
|
|
|
|
deps/opm-data/norne/flow_ebos/ \
|
|
|
|
$OPM_DATA_ROOT/norne/opm-simulation-reference/flow_ebos \
|
|
|
|
NORNE_ATW2013 \
|
|
|
|
UNSMRY
|
|
|
|
|
2017-02-02 04:16:00 -06:00
|
|
|
copyToReferenceDir \
|
2017-04-05 05:04:26 -05:00
|
|
|
deps/opm-data/norne/flow_legacy/ \
|
2017-04-07 04:40:45 -05:00
|
|
|
$OPM_DATA_ROOT/norne/opm-simulation-reference/flow_legacy \
|
2017-02-02 04:16:00 -06:00
|
|
|
NORNE_ATW2013 \
|
|
|
|
UNSMRY
|
|
|
|
fi
|
2017-01-26 03:52:49 -06:00
|
|
|
done
|
2017-01-16 01:06:26 -06:00
|
|
|
|
2017-01-26 03:52:49 -06:00
|
|
|
if [ -z "${@:2}" ]
|
|
|
|
then
|
|
|
|
# User did not specify tests to update, probe
|
|
|
|
pushd $OPM_DATA_ROOT > /dev/null
|
|
|
|
tests=""
|
|
|
|
git status | grep "SPE1CASE1" && tests="spe11"
|
|
|
|
git status | grep "SPE1CASE2" && tests="$tests spe12"
|
|
|
|
git status | grep "SPE3CASE1" && tests="$tests spe3"
|
2017-05-04 12:03:25 -05:00
|
|
|
git status | grep "SPE1CASE2_2P" && tests="$tests spe1-2p"
|
2017-01-26 03:52:49 -06:00
|
|
|
git status | grep "SPE9_CP" && tests="$tests spe9"
|
2017-03-03 08:08:12 -06:00
|
|
|
git status | grep "2D_H__" && tests="$tests msw_2d_h"
|
2017-05-16 04:49:40 -05:00
|
|
|
git status | grep "2D_THREEPHASE_POLY_HETER" && tests="$tests simple2d"
|
2017-02-02 04:16:00 -06:00
|
|
|
git status | grep "NORNE_ATW2013.INIT" && tests="$tests norne_init"
|
|
|
|
git status | grep "NORNE_ATW2013.UNSMRY" && tests="$tests norne_full"
|
2017-01-26 03:52:49 -06:00
|
|
|
popd > /dev/null
|
|
|
|
fi
|
2017-01-16 01:06:26 -06:00
|
|
|
|
2017-01-26 03:52:49 -06:00
|
|
|
echo -e "update reference data for $tests\n" > /tmp/cmsg
|
|
|
|
if [ -z "$REASON" ]
|
|
|
|
then
|
|
|
|
echo -e "Reason: fill in this\n" >> /tmp/cmsg
|
|
|
|
else
|
|
|
|
echo -e "Reason: $REASON\n" >> /tmp/cmsg
|
|
|
|
fi
|
2017-05-07 05:57:03 -05:00
|
|
|
for dep in libecl opm-common opm-core opm-grid opm-material opm-parser opm-output ewoms
|
2017-01-16 01:06:26 -06:00
|
|
|
do
|
|
|
|
pushd $WORKSPACE/deps/$dep > /dev/null
|
|
|
|
name=`printf "%-14s" $dep`
|
|
|
|
rev=`git rev-parse HEAD`
|
|
|
|
echo -e "$name = $rev" >> /tmp/cmsg
|
|
|
|
popd > /dev/null
|
|
|
|
done
|
|
|
|
echo -e "opm-simulators = `git rev-parse HEAD`" >> /tmp/cmsg
|
|
|
|
|
|
|
|
cd $OPM_DATA_ROOT
|
2017-01-26 03:52:49 -06:00
|
|
|
if [ -n "$BRANCH_NAME" ]
|
|
|
|
then
|
|
|
|
git checkout -b $BRANCH_NAME origin/master
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$REASON" ]
|
|
|
|
then
|
|
|
|
git commit -a -t /tmp/cmsg
|
|
|
|
else
|
|
|
|
git commit -a -F /tmp/cmsg
|
|
|
|
fi
|