tantspin-regridtofine.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
---
tantspin-regridtofine.sh (2472B)
---
1 #!/bin/bash
2
3 # Copyright (C) 2009-2015, 2017 PISM authors
4 ##################################################################################
5 # Complete spinup of Antarctic ice sheet model by regriding to a finer resolution (15 km).
6 ##################################################################################
7
8 SCRIPTNAME="#(antspin-regridtofine.sh)"
9
10 set -e # exit on error
11
12 # naming files, directories, executables
13 RESDIR=
14 BOOTDIR=
15 PISM_EXEC=pismr
16 PISM_MPIDO="mpiexec -n "
17
18 # input data:
19 export PISM_INDATANAME=${BOOTDIR}pism_Antarctica_5km.nc
20
21 source set-physics.sh
22
23 NN=4 # default number of processors
24 if [ $# -gt 0 ] ; then # if user says "antspinCC.sh 8" then NN = 8
25 NN="$1"
26 fi
27 echo "$SCRIPTNAME NN = $NN"
28 set -e # exit on error
29
30 # check if env var PISM_DO was set (i.e. PISM_DO=echo for a 'dry' run)
31 if [ -n "${PISM_DO:+1}" ] ; then # check if env var is already set
32 echo "$SCRIPTNAME PISM_DO = $PISM_DO (already set)"
33 else
34 PISM_DO=""
35 fi
36 DO=$PISM_DO
37
38 echo "$SCRIPTNAME PISM = $PISM_EXEC"
39 echo "$SCRIPTNAME FULLPHYS = $FULLPHYS"
40 echo "$SCRIPTNAME PIKPHYS = $PIKPHYS"
41 echo "$SCRIPTNAME PIKPHYS_COUPLING = $PIKPHYS_COUPLING"
42
43
44 # #######################################
45 ## do a regridding to fine grid and reset year to 0 and run for 2000 model years:
46 # #######################################
47 GRID=$FIFTEENKMGRID
48 SKIP=$SKIPFIFTEENKM
49 GRIDNAME=15km
50
51 COARSENAME=run_30km.nc
52 RESDIR=
53
54 stage=run_regrid_${GRIDNAME}
55 INNAME=$COARSENAME
56 RESNAME=${RESDIR}${stage}.nc
57 TSNAME=${RESDIR}ts_${stage}.nc
58 RUNTIME=2000
59
60 EXTRANAME=${RESDIR}extra_${stage}.nc
61 exvars="thk,usurf,velbase_mag,velbar_mag,mask,diffusivity,tauc,bmelt,tillwat,temppabase,hardav,Href,gl_mask"
62 expackage="-extra_times 0:10:$RUNTIME -extra_vars $exvars"
63
64 echo
65 echo "$SCRIPTNAME continue but regrid to $GRIDNAME and run for 2000 a"
66 cmd="$PISM_MPIDO $NN $PISM_EXEC -skip -skip_max $SKIP \
67 -i $PISM_INDATANAME -bootstrap $GRID \
68 -regrid_file $INNAME -regrid_vars litho_temp,thk,enthalpy,tillwat,basal_melt_rate_grounded \
69 $SIA_ENHANCEMENT $PIKPHYS_COUPLING $PIKPHYS $FULLPHYS \
70 -ys 0 -y $RUNTIME \
71 -ts_file $TSNAME -ts_times 0:1:$RUNTIME \
72 -extra_file $EXTRANAME $expackage \
73 -o $RESNAME -o_size big"
74
75 $DO $cmd
76
77 # one can regrid to 10km, 6.7km, 5km and so on, if the number of model years
78 # (RUNTIME) is appropriately shortened, and sufficient memory is available
79
80 echo
81 echo "$SCRIPTNAME fine-grid part of spinup done"
82