trun_frac.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_frac.sh (3006B)
---
1 #!/bin/bash
2
3 NN=2 # default number of processors
4 if [ $# -gt 0 ] ; then # if user says "run_frac.sh 8" then NN = 8
5 NN="$1"
6 fi
7
8 M=211 # for 5km; note M=526 for 2km, M=421 for 2.5km, M=351 for 3km
9 if [ $# -gt 1 ] ; then # if user says "run_frac.sh 8 211" then NN = 8 and M = 211
10 M="$2"
11 fi
12
13 SSAE=0.6 # ssa enhancement factor
14 if [ $# -gt 2 ] ; then # if user says "run_frac.sh 8 211 0.6" then ... and -ssa_e 0.6
15 SSAE="$3"
16 fi
17
18 YEARS=3000 # integration time
19 if [ $# -gt 3 ] ; then # if user says "run_frac.sh 8 211 0.6 500" then ... and -y 500
20 YEARS="$4"
21 fi
22 exdt=25 # for the extrafile
23
24 THRESHOLD=4.5e4 # stress threshold
25
26 FRACRATE=0.5 # fracture rate
27
28 HEALTHRESHOLD=2.0e-10 # healing threshold
29
30 HEALRATE=0.05 # healing rate
31
32 SOFTRES=0.01 # softening residual (avoid viscosity from degeneration), value 1 inhibits softening effect
33
34
35 # options ###############################
36
37 PISMPREFIX=""
38 #PISMPREFIX="../../../bin/"
39
40 NAME=frac_Mx${M}_yr-${YEARS}.nc
41
42 output="-o $NAME -o_order zyx -o_size big"
43
44 ssa="-stress_balance ssa -yield_stress constant -tauc 1e6 -ssa_dirichlet_bc -ssa_e ${SSAE} -part_grid -cfbc "
45 #-pik:-part_grid -cfbc -kill_icebergs
46
47 extra="-extra_file ex-${NAME} -extra_times 0:${exdt}:${YEARS} -extra_vars thk,mask,velsurf_mag,fracture_density,fracture_flow_enhancement,fracture_growth_rate,fracture_healing_rate,fracture_toughness"
48
49 timeseries="-ts_file ts-${NAME} -ts_times 0:1:${YEARS}"
50
51 criterion=""
52
53 boundary="-do_frac_on_grounded"
54
55 healing=""
56 #healing="-constant_healing" #independent of strain rates
57 #healing="-fracture_weighted_healing"
58
59 #softening="-fracture_softening 1.0" #no softening
60 softening="-fracture_softening ${SOFTRES}" #residual eps=0.001
61
62 fractures="-fractures -fracture_parameters ${FRACRATE},${THRESHOLD},${HEALRATE},${HEALTHRESHOLD} -write_fd_fields -scheme_fd2d ${healing} ${boundary} ${criterion} ${softening}"
63
64
65 # run commands #############################################################################
66
67 cmd_diag="mpiexec -n $NN ${PISMPREFIX}pismr -i ../Ross_combined.nc -bootstrap -Mx $M -My $M \
68 -Mz 61 -Lz 3000 -z_spacing equal -surface given ${ssa} -kill_icebergs \
69 -y 0 -ys 0.0 -o startfile_Mx${M}.nc -o_order zyx -fractures -fracture_parameters 0,0,0,0 -write_fd_fields "
70
71 # add "-verbose 4" to this command for additional internal info
72 cmd_frac="mpiexec -n $NN ${PISMPREFIX}pismr -i startfile_Mx${M}.nc -surface given \
73 ${ssa} -y ${YEARS} ${output} -front_retreat_file startfile_Mx${M}.nc \
74 ${fractures} ${extra} ${timeseries}"
75
76 # -ssafd_picard_rtol 1.0e-3 -ssa_eps 5.0e15
77
78 echo "running command:"
79 echo
80 echo "$cmd_diag"
81 echo
82 ${cmd_diag}
83
84 ncap2 -A \
85 -s 'land_ice_area_fraction_retreat=0 * thk' \
86 -s 'where(thk > 0 || topg > 0) land_ice_area_fraction_retreat=1' \
87 -s 'land_ice_area_fraction_retreat@units="1"' \
88 startfile_Mx${M}.nc startfile_Mx${M}.nc
89 ncatted -a standard_name,land_ice_area_fraction_retreat,d,, startfile_Mx${M}.nc
90
91 echo
92 echo "$cmd_frac"
93 echo
94 ${cmd_frac}
95 echo
96 echo "... done"