trun.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
---
trun.sh (3244B)
---
1 #!/bin/bash
2
3 # run preprocess.sh first
4
5 GRIDLIST="{500, 250, 125, 62}"
6 TYPELIST="{dist, event, routing, disttill}"
7
8 if [ $# -lt 4 ] ; then
9 echo "run.sh ERROR: needs five arguments ... ENDING NOW"
10 echo " format:"
11 echo " run.sh PROCS GRID DURATION TYPE REPORTING"
12 echo " where"
13 echo " PROCS = 1,2,3,... is number of MPI processes"
14 echo " GRID is in $GRIDLIST, the grid spacing in meters"
15 echo " DURATION is run duration in years"
16 echo " TYPE is in $TYPELIST"
17 echo " REPORTING is either a Delta t in years or in {hourly, daily, monthly, yearly}"
18 echo " example usage:"
19 echo " run.sh 4 500 0.25 dist daily"
20 echo " is a run with 4 processors, 500 m grid, 3 model month run,"
21 echo " using '-hydrology distributed', and with daily reporting"
22 exit
23 fi
24
25 NN="$1"
26
27 if [ "$2" -eq "500" ]; then
28 dx=500
29 dtmax=0.1
30 myMx=67
31 myMy=52
32 elif [ "$2" -eq "250" ]; then
33 dx=250
34 dtmax=0.1
35 myMx=133
36 myMy=104
37 elif [ "$2" -eq "125" ]; then
38 dx=125
39 dtmax=0.01 # more frequent just because so many hydrology substeps occur
40 myMx=264
41 myMy=207
42 elif [ "$2" -eq "62" ]; then
43 echo ""
44 echo "WARNING: 62 m run is computationally intensive"
45 echo ""
46 dx=62
47 dtmax=0.01 # more frequent just because so many hydrology substeps occur
48 myMx=528
49 myMy=414
50 else
51 echo "invalid second argument: must be in $GRIDLIST"
52 exit
53 fi
54
55 YY="$3"
56
57 DT="$5"
58
59 etimes="0:$DT:$YY"
60
61 # these extra_ diagnostics apply to "dist" and "event":
62 evarlist="thk,velbase_mag,bmelt,hydroinput,bwat,bwp,bwatvel,bwprel,effbwp,wallmelt,tillwat"
63
64 if [ "$4" = "dist" ]; then
65
66 # distributed run
67 oname=nbreen_y${YY}_${dx}m_dist.nc
68 hydro="-hydrology distributed -hydrology_null_strip 1.0 -report_mass_accounting -hydrology_tillwat_max 0.0 -stress_balance ssa+sia -ssa_dirichlet_bc -yield_stress constant"
69
70 elif [ "$4" = "event" ]; then
71
72 # distributed run with summer event
73 oname=nbreen_y${YY}_${dx}m_event.nc
74 hydro="-hydrology distributed -hydrology_null_strip 1.0 -report_mass_accounting -hydrology_tillwat_max 0.0 -stress_balance ssa+sia -ssa_dirichlet_bc -input_to_bed_file fakesummerevent.nc -input_to_bed_period 1.0 -input_to_bed_reference_year 0.0"
75
76 elif [ "$4" = "routing" ]; then
77
78 # routing run: very fast
79 oname=nbreen_y${YY}_${dx}m_routing.nc
80 hydro="-hydrology routing -hydrology_null_strip 1.0 -report_mass_accounting -hydrology_tillwat_max 0.0"
81 evarlist="thk,bmelt,hydroinput,bwat,bwp,bwatvel,wallmelt,tillwat" # revised
82
83 elif [ "$4" = "disttill" ]; then
84
85 # distributed run with till on (tillwat_max = 2.0)
86 oname=nbreen_y${YY}_${dx}m_disttill.nc
87 hydro="-hydrology distributed -hydrology_null_strip 1.0 -report_mass_accounting -stress_balance ssa+sia -ssa_dirichlet_bc -hydrology_tillwat_max 2.0"
88
89 else
90 echo "invalid fourth argument; must be in $TYPELIST"
91 exit
92 fi
93
94 pismexec="pismr"
95
96 data=pismnbreen.nc
97
98 grid="-Mx $myMx -My $myMy -Mz 11 -z_spacing equal -Lz 600"
99
100 climate="-surface given -surface_given_file $data"
101
102 physics="-no_mass -energy none"
103
104 diagnostics="-extra_file extras_$oname -extra_times $etimes -extra_vars $evarlist"
105
106 set -x
107
108 mpiexec -n $NN $pismexec -i $data -bootstrap $climate $physics $hydro \
109 $grid -max_dt $dtmax -ys 0.0 -y $YY $diagnostics -o $oname
110
111 set +x
112