tssa_testj_fem.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
       ---
       tssa_testj_fem.sh (1332B)
       ---
            1 #!/bin/bash
            2 
            3 # SSAFEM verification test J 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-j.nc foo-fem-j.nc~ test-J-out-fem.txt"
           21 
           22 rm -f $files
           23 
           24 set -e
           25 
           26 OPTS="-verbose 1 -ssa_method fem -o foo-fem-j.nc -ksp_type cg"
           27 
           28 # do stuff
           29 $MPIEXEC_COMMAND $PISM_PATH/ssa_testj${EXT} -Mx 61 -My 61 $OPTS > test-J-out-fem.txt
           30 $MPIEXEC_COMMAND $PISM_PATH/ssa_testj${EXT} -Mx 121 -My 121 $OPTS >> test-J-out-fem.txt
           31 
           32 set +e
           33 
           34 # Check results:
           35 diff test-J-out-fem.txt -  <<END-OF-OUTPUT
           36 NUMERICAL ERRORS in velocity relative to exact solution:
           37 velocity  :  maxvector   prcntavvec      maxu      maxv       avu       avv
           38                 0.1608      0.05511    0.1582    0.0512    0.0932    0.0284
           39 NUM ERRORS DONE
           40 NUMERICAL ERRORS in velocity relative to exact solution:
           41 velocity  :  maxvector   prcntavvec      maxu      maxv       avu       avv
           42                 0.0409      0.01400    0.0402    0.0130    0.0237    0.0072
           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