tssafem_test_linear.sh - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
 (HTM) git clone git://src.adamsgaard.dk/pism
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
       tssafem_test_linear.sh (1355B)
       ---
            1 #!/bin/bash
            2 
            3 # SSAFEM linear flow regression test
            4 
            5 PISM_PATH=$1
            6 MPIEXEC=$2
            7 MPIEXEC_COMMAND="$MPIEXEC -n 2"
            8 PISM_SOURCE_DIR=$3
            9 EXT=""
           10 if [ $# -ge 4 ] && [ "$4" == "-python" ]
           11 then
           12   PYTHONEXEC=$5
           13   MPIEXEC_COMMAND="$MPIEXEC_COMMAND $PYTHONEXEC"
           14   PYTHONPATH=${PISM_PATH}/site-packages:${PYTHONPATH}
           15   PISM_PATH=${PISM_SOURCE_DIR}/examples/python/ssa_tests
           16   EXT=".py"
           17 fi
           18 
           19 # List of files to remove when done:
           20 files="foo-fem-linear.nc foo-fem-linear.nc~ test-out-linear.txt"
           21 
           22 rm -f $files
           23 
           24 set -e
           25 
           26 OPTS="-verbose 1 -ssa_method fem -o foo-fem-linear.nc -ksp_type cg"
           27 
           28 # do stuff
           29 $MPIEXEC_COMMAND $PISM_PATH/ssa_test_linear${EXT} -Mx 61 -My 61 $OPTS > test-out-linear.txt
           30 $MPIEXEC_COMMAND $PISM_PATH/ssa_test_linear${EXT} -Mx 121 -My 121 $OPTS >> test-out-linear.txt
           31 
           32 set +e
           33 
           34 # Check results:
           35 diff test-out-linear.txt -  <<END-OF-OUTPUT
           36 NUMERICAL ERRORS in velocity relative to exact solution:
           37 velocity  :  maxvector   prcntavvec      maxu      maxv       avu       avv
           38                 0.4207      0.00319    0.4207    0.0444    0.1884    0.0093
           39 NUM ERRORS DONE
           40 NUMERICAL ERRORS in velocity relative to exact solution:
           41 velocity  :  maxvector   prcntavvec      maxu      maxv       avu       avv
           42                 0.1051      0.00081    0.1051    0.0111    0.0479    0.0024
           43 NUM ERRORS DONE
           44 END-OF-OUTPUT
           45 
           46 if [ $? != 0 ];
           47 then
           48     exit 1
           49 fi
           50 
           51 rm -f $files; exit 0