tssa_testi_fd.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_testi_fd.sh (1355B) --- 1 #!/bin/bash 2 3 # SSAFD verification test I 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-fd-i.nc foo-fd-i.nc~ test-I-out-fd.txt" 21 22 rm -f $files 23 24 set -e 25 set -x 26 27 OPTS="-verbose 1 -ssa_method fd -o foo-fd-i.nc -ssafd_picard_rtol 5e-07 -ssafd_ksp_rtol 1e-12 -Mx 5" 28 29 # do stuff 30 $MPIEXEC_COMMAND $PISM_PATH/ssa_testi${EXT} -My 61 $OPTS > test-I-out-fd.txt 31 $MPIEXEC_COMMAND $PISM_PATH/ssa_testi${EXT} -My 121 $OPTS >> test-I-out-fd.txt 32 33 set +e 34 35 # Check results: 36 diff test-I-out-fd.txt - <<END-OF-OUTPUT 37 NUMERICAL ERRORS in velocity relative to exact solution: 38 velocity : maxvector prcntavvec maxu maxv avu avv 39 4.7417 0.05219 4.7417 0.1976 0.4041 0.0087 40 NUM ERRORS DONE 41 NUMERICAL ERRORS in velocity relative to exact solution: 42 velocity : maxvector prcntavvec maxu maxv avu avv 43 1.3907 0.01351 1.3907 0.0385 0.1050 0.0018 44 NUM ERRORS DONE 45 END-OF-OUTPUT 46 47 if [ $? != 0 ]; 48 then 49 exit 1 50 fi 51 52 rm -f $files; exit 0