trunexp.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
       ---
       trunexp.sh (1921B)
       ---
            1 #!/bin/bash
            2 
            3 # Copyright (C) 2013--2016 The PISM Authors
            4 
            5 # This is just a helper script to make running EISMINT II experiments easier.
            6 # It adds suggested diagnostics which help compare to the published experiments.
            7 
            8 SCRIPTNAME="#(runexp.sh)"
            9 
           10 set -e  # exit on error
           11 
           12 PISM_MPIDO="mpiexec -n "
           13 
           14 NN=4  # default number of processors
           15 if [ $# -gt 0 ] ; then  # if user says "runexp.sh 8" then NN=8
           16   NN="$1"
           17 fi
           18 
           19 EXP=A  # default experiment
           20 if [ $# -gt 1 ] ; then  # if user says "runexp.sh 8 F" then NN=8, EXP=F
           21   EXP="$2"
           22 fi
           23 
           24 MHOR=61  # default resolution
           25 if [ $# -gt 2 ] ; then  # if user says "runexp.sh 8 F 121" then NN=8, EXP=F, Mx=My=121
           26   MHOR="$3"
           27 fi
           28 
           29 MVER=$MHOR  # default vertical resolution
           30 if [ $# -gt 3 ] ; then  # if user says "runexp.sh 8 F 121 201" then NN=8, EXP=F, Mx=My=121, Mz=201
           31   MVER="$4"
           32 fi
           33 
           34 DUR=2e5  # default duration of 200000 a
           35 if [ $# -gt 4 ] ; then  # if user says "runexp.sh 8 F 121 201 1e4" then NN=8, EXP=F, Mx=My=121, Mz=201, -y 1e4
           36   DUR="$5"
           37 fi
           38 
           39 # choose -i or start from grid
           40 if [ $# -gt 5 ] ; then  # if user says "runexp.sh 8 F X X foo.nc" then NN=8, EXP=F, next two are ignored, -y 1e4, and '-i foo.nc' is used
           41   GRIDORINPUT="-i $6"
           42 else
           43   if [ "$EXP" = "F" ] ; then
           44     LZ="-Lz 6000"
           45   else
           46     LZ="-Lz 5000"
           47   fi
           48   GRIDORINPUT="-Mx $MHOR -My $MHOR -Mz $MVER $LZ"
           49 fi
           50 
           51 if [ -n "${PISM_DO:+1}" ] ; then  # check if env var is already set
           52   echo "$SCRIPTNAME         PISM_DO = $PISM_DO  (already set)"
           53 else
           54   PISM_DO="" 
           55 fi
           56 
           57 SKIP=5         # adjust upward for high res
           58 ROOT=eisII$EXP$MHOR
           59 echo "$SCRIPTNAME  run into steady state with constant climate forcing for $RUNTIME a"
           60 cmd="$PISM_MPIDO $NN pisms -eisII $EXP $GRIDORINPUT -ys 0 -y $DUR \
           61  -skip -skip_max $SKIP -o $ROOT.nc -extra_file ex_$ROOT.nc \
           62  -extra_vars thk,temppabase,velsurf_mag,velbar_mag,flux_mag,diffusivity,bmelt,taud_mag \
           63  -extra_times 1000:1000:$DUR -ts_file ts_$ROOT.nc \
           64  -ts_times 0:100:$DUR"
           65 $PISM_DO $cmd
           66