tbeddef_lc_restart.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
---
tbeddef_lc_restart.sh (1552B)
---
1 #!/bin/bash
2
3 # Test exact restartability of the Lingle-Clark bed deformation model.
4
5 PISM_PATH=$1
6 MPIEXEC=$2
7 PISM_SOURCE_DIR=$3
8
9 # List of files to remove when done:
10 files="out0.nc out1.nc out2.nc out3.nc ex1.nc ex2.nc ex.nc ex-restart.nc"
11
12 rm -f $files
13
14 set -e
15
16 mpi="$MPIEXEC -n 3"
17 pisms="$PISM_PATH/pisms"
18 pismr="$PISM_PATH/pismr"
19
20 # time step length
21 dt=100
22 # use a non-square grid
23 Mx=41
24 My=61
25 options="-bed_def lc -extra_times 0,100,200,300 -extra_vars dbdt,topg,thk -stress_balance none -energy none -calendar none -bed_deformation.lc.update_interval ${dt} -max_dt ${dt}"
26
27 grid="-Lz 5000 -Mz 3 -Mx ${Mx} -My ${My}"
28
29 # create the input file
30 ${mpi} ${pisms} ${grid} -y 1000 -o out0.nc -verbose 1
31
32 # Run with re-starting
33 #
34 # Note that this first run stops after 1.5 update intervals, so it runs the bed
35 # deformation model once at year 100 and saves that in the output file.
36 ${mpi} ${pismr} ${options} -i out0.nc -o out1.nc -extra_file ex1.nc -ys 0 -ye 150 -bootstrap ${grid}
37 # This run reads the last bed deformation update time from its input file and updates the
38 # bed at years 200 and 300.
39 ${mpi} ${pismr} ${options} -i out1.nc -o out2.nc -extra_file ex2.nc -ye 300
40
41 # combine output files
42 ncrcat -O ex1.nc ex2.nc ex-restart.nc
43
44 # run straight
45 #
46 # This run updates bed elevation at years 100, 200, and 300.
47 ${mpi} ${pismr} ${options} -bootstrap ${grid} -i out0.nc -o out3.nc -extra_file ex.nc -ys 0 -ye 300
48
49 set +e
50
51 # Compare results:
52 $PISM_PATH/nccmp.py -v dbdt,topg ex.nc ex-restart.nc
53 if [ $? != 0 ];
54 then
55 exit 1
56 fi
57
58 # rm -f $files; exit 0