tcentury.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
       ---
       tcentury.sh (3005B)
       ---
            1 #!/bin/bash
            2 
            3 # first run spinup.sh to produce a starting file (e.g. spunjako_0.nc)
            4 # here is a basic Jakoshavn model run:
            5 #   ./century NN Mx My spunjako_0.nc >> out.century &
            6 
            7 # Mx=620, My=425 is 1 km grid
            8 # Mx=310, My=213 is (approx) 2 km grid
            9 # Mx=125, My=86 is (approx) 5 km grid
           10 
           11 # if user says "century.sh 8 620 425 foo.nc" then NN=8, Mx=620, My=425, PREFILE=foo.nc
           12 NN="$1"
           13 Mx="$2"
           14 My="$3"
           15 PREFILE="$4"
           16 
           17 if [ $# -lt 4 ] ; then  
           18   echo "century.sh ERROR: needs four arguments"
           19   exit
           20 fi
           21 
           22 # set MPIDO if using different MPI execution command, for example:
           23 #  $ export PISM_MPIDO="aprun -n "
           24 if [ -n "${PISM_MPIDO:+1}" ] ; then  # check if env var is already set
           25   echo "$SCRIPTNAME      PISM_MPIDO = $PISM_MPIDO  (already set)"
           26 else
           27   PISM_MPIDO="mpiexec -n "
           28   echo "$SCRIPTNAME      PISM_MPIDO = $PISM_MPIDO"
           29 fi
           30 
           31 # check if env var PISM_DO was set (i.e. PISM_DO=echo for a 'dry' run)
           32 if [ -n "${PISM_DO:+1}" ] ; then  # check if env var DO is already set
           33   echo "$SCRIPTNAME         PISM_DO = $PISM_DO  (already set)"
           34 else
           35   PISM_DO="" 
           36 fi
           37 
           38 # prefix to pism (not to executables)
           39 if [ -n "${PISM_BIN:+1}" ] ; then  # check if env var is already set
           40   echo "$SCRIPTNAME     PISM_BIN = $PISM_BIN  (already set)"
           41 else
           42   PISM_BIN=""    # just a guess
           43   echo "$SCRIPTNAME     PISM_BIN = $PISM_BIN"
           44 fi
           45 
           46 # set PISM_EXEC if using different executables, for example:
           47 #  $ export PISM_EXEC="pismr -energy cold"
           48 if [ -n "${PISM_EXEC:+1}" ] ; then  # check if env var is already set
           49   echo "$SCRIPTNAME       PISM_EXEC = $PISM_EXEC  (already set)"
           50 else
           51   PISM_EXEC="pismr -regional"
           52   echo "$SCRIPTNAME       PISM_EXEC = $PISM_EXEC"
           53 fi
           54 
           55 
           56 BOOT=jako.nc
           57 CLIMATEFILE=g5km_climate.nc
           58 BCFILE=g5km_bc.nc
           59 
           60 CLIMATE="-surface given,forcing -surface_given_file $CLIMATEFILE -force_to_thickness_file $BOOT"
           61 
           62 # regarding physics: match choices in spinup.sh
           63 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"
           64 
           65 SKIP=10
           66 
           67 LENGTH=${RUN_LENGTH:-100}   # model years
           68 
           69 Mz=401
           70 Mbz=101
           71 # inferior, but use if insufficient memory
           72 #Mz=201
           73 #Mbz=51
           74 
           75 echo
           76 cmd="$PISM_MPIDO $NN $PISM_EXEC -i $BOOT -bootstrap  \
           77   -Mx $Mx -My $My -Lz 4000 -Lbz 1000 -Mz $Mz -Mbz $Mbz -z_spacing equal \
           78   -no_model_strip 10 $PHYS \
           79   -ssa_dirichlet_bc -regrid_file $PREFILE -regrid_vars thk,basal_melt_rate_grounded,tillwat,enthalpy,litho_temp,vel_ssa_bc \
           80   $CLIMATE -y 0.01 -o jakofine_short.nc"
           81 $PISM_DO $cmd
           82 
           83 echo
           84 cmd="$PISM_MPIDO $NN $PISM_EXEC -i jakofine_short.nc \
           85   -no_model_strip 10 $PHYS \
           86   -extra_file ex_jakofine.nc -extra_times 0:yearly:$LENGTH \
           87   -extra_vars mask,thk,velbase_mag,tillwat,tauc,dhdt,hardav,velsurf_mag,temppabase,diffusivity,bmelt,tempicethk_basal \
           88   -ts_file ts_jakofine.nc -ts_times 0:monthly:$LENGTH \
           89   -ssa_dirichlet_bc -regrid_file $BCFILE -regrid_vars vel_ssa_bc \
           90   $CLIMATE -ys 0 -ye $LENGTH -skip -skip_max $SKIP -o jakofine.nc"
           91 $PISM_DO $cmd
           92