tspinup.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
       ---
       tspinup.sh (2941B)
       ---
            1 #!/bin/bash
            2 
            3 # do a basic Jakoshavn spinup by:
            4 #   ./spinup NN Mx My >> out.spin &
            5 
            6 # if user says "spinup.sh 8 620 425" then NN=8, Mx=620, My=425
            7 NN="$1"
            8 Mx="$2"
            9 My="$3"
           10 
           11 if [ $# -lt 3 ] ; then  
           12   echo "spinup.sh ERROR: needs three arguments"
           13   exit
           14 fi
           15 
           16 # set MPIDO if using different MPI execution command, for example:
           17 #  $ export PISM_MPIDO="aprun -n "
           18 if [ -n "${PISM_MPIDO:+1}" ] ; then  # check if env var is already set
           19   echo "$SCRIPTNAME      PISM_MPIDO = $PISM_MPIDO  (already set)"
           20 else
           21   PISM_MPIDO="mpiexec -n "
           22   echo "$SCRIPTNAME      PISM_MPIDO = $PISM_MPIDO"
           23 fi
           24 
           25 # check if env var PISM_DO was set (i.e. PISM_DO=echo for a 'dry' run)
           26 if [ -n "${PISM_DO:+1}" ] ; then  # check if env var DO is already set
           27   echo "$SCRIPTNAME         PISM_DO = $PISM_DO  (already set)"
           28 else
           29   PISM_DO="" 
           30 fi
           31 
           32 # prefix to pism (not to executables)
           33 if [ -n "${PISM_BIN:+1}" ] ; then  # check if env var is already set
           34   echo "$SCRIPTNAME     PISM_BIN = $PISM_BIN  (already set)"
           35 else
           36   PISM_BIN=""    # just a guess
           37   echo "$SCRIPTNAME     PISM_BIN = $PISM_BIN"
           38 fi
           39 
           40 # set PISM_EXEC if using different executables, for example:
           41 #  $ export PISM_EXEC="pismr -energy cold"
           42 if [ -n "${PISM_EXEC:+1}" ] ; then  # check if env var is already set
           43   echo "$SCRIPTNAME       PISM_EXEC = $PISM_EXEC  (already set)"
           44 else
           45   PISM_EXEC="pismr -regional"
           46   echo "$SCRIPTNAME       PISM_EXEC = $PISM_EXEC"
           47 fi
           48 
           49 PISM=$PISM_EXEC
           50 
           51 BOOT=jako.nc
           52 CLIMATEFILE=g5km_climate.nc
           53 BCFILE=g5km_bc.nc
           54 
           55 CLIMATE="-surface given,forcing -surface_given_file $CLIMATEFILE -force_to_thickness_file $BOOT"
           56 
           57 # regarding physics: '-till_effective_fraction_overburden 0.02' plus
           58 #   '-pseudo_plastic -pseudo_plastic_q 0.25' plus '-tauc_slippery_grounding_lines'
           59 #   matches default choices in spinup.sh in examples/std-greenland/
           60 # but here we do not use -sia_e 3.0 but instead -sia_e 1.0
           61 PHYS="-front_retreat_file $BOOT -pik -sia_e 1.0 -stress_balance ssa+sia -topg_to_phi 15.0,40.0,-300.0,700.0 -till_effective_fraction_overburden 0.02 -pseudo_plastic -pseudo_plastic_q 0.25 -tauc_slippery_grounding_lines"
           62 
           63 SKIP=5
           64 
           65 LENGTH=${SPINUP_LENGTH:-2000}   # model years
           66 EXDT=20    # 20 year between saves, thus 100 frames
           67 
           68 cmd="$PISM_MPIDO $NN $PISM -i $BOOT -bootstrap -no_model_strip 10 \
           69   -Mx $Mx -My $My -Lz 4000 -Lbz 1000 -Mz 201 -Mbz 51 -z_spacing equal \
           70   -no_model_strip 10 $PHYS \
           71   -regional.zero_gradient \
           72   -extra_file ex_spunjako_0.nc -extra_times -$LENGTH:$EXDT:0 \
           73   -extra_vars thk,velbase_mag,tillwat,tauc,dHdt,hardav,velsurf_mag,temppabase,diffusivity,bmelt,tempicethk_basal \
           74   -ts_file ts_spunjako_0.nc -ts_times -$LENGTH:yearly:0 \
           75   -ssa_dirichlet_bc -regrid_file $BCFILE -regrid_vars basal_melt_rate_grounded,tillwat,enthalpy,litho_temp,vel_ssa_bc \
           76   $CLIMATE -ys -$LENGTH -ye 0 -skip -skip_max $SKIP -o spunjako_0.nc"
           77 $PISM_DO $cmd
           78 
           79 # NOTES:
           80 # useful diagnostic:  -ssa_view_nuh
           81 # good postprocess:
           82 #ncap -O -s "dtau=taud_mag-tauc" spunjako_0.nc spunjako_0.nc 
           83