tantspin-coarse.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-coarse.sh (4566B)
       ---
            1 #!/bin/bash
            2 
            3 # Copyright (C) 2009-2018  PISM authors
            4 ##################################################################################
            5 # Coarse grid spinup of Antarctic ice sheet model using data from Anne Le Brocq
            6 # (see SeaRISE wiki).  Uses PIK physics and enthalpy model
            7 # and modified configuration parameters with constant climate.  Uses constant
            8 # and precip and a parameterization for artm as in Martin et al (2011).
            9 # WARNING: at finer resolutions (e.g. under 15 km), output is large!
           10 ##################################################################################
           11 
           12 SCRIPTNAME="#(antspin-coarse.sh)"
           13 
           14 echo "$SCRIPTNAME   run preprocess.sh before this..."
           15 # needed inputs generated by preprocess.sh: pism_Antarctica_5km.nc
           16 
           17 set -e  # exit on error
           18 
           19 echo "$SCRIPTNAME   Coarse grid, constant-climate spinup script using SeaRISE-Antarctica data"
           20 echo "$SCRIPTNAME      and -stress_balance ssa+sia and -pik"
           21 echo "$SCRIPTNAME   Run as './antspinCC.sh NN' for NN procs and 30km grid"
           22 
           23 # naming files, directories, executables
           24 RESDIR=
           25 BOOTDIR=
           26 PISM_EXEC=${PISM_EXEC:=pismr}
           27 PISM_MPIDO="mpiexec -n "
           28 
           29 # input data:
           30 export PISM_INDATANAME=${BOOTDIR}pism_Antarctica_5km.nc
           31 
           32 source set-physics.sh
           33 
           34 NN=4  # default number of processors
           35 if [ $# -gt 0 ] ; then  # if user says "antspinCC.sh 8" then NN = 8
           36   NN="$1"
           37 fi
           38 echo "$SCRIPTNAME              NN = $NN"
           39 set -e  # exit on error
           40 
           41 # check if env var PISM_DO was set (i.e. PISM_DO=echo for a 'dry' run)
           42 if [ -n "${PISM_DO:+1}" ] ; then  # check if env var is already set
           43   echo "$SCRIPTNAME         PISM_DO = $PISM_DO  (already set)"
           44 else
           45   PISM_DO=""
           46 fi
           47 DO=$PISM_DO
           48 
           49 # these coarse grid defaults are for development/regression runs, not
           50 # "production" or science
           51 GRID=$THIRTYKMGRID
           52 SKIP=$SKIPTHIRTYKM
           53 GRIDNAME=30km
           54 
           55 echo "$SCRIPTNAME             PISM = $PISM_EXEC"
           56 echo "$SCRIPTNAME         FULLPHYS = $FULLPHYS"
           57 echo "$SCRIPTNAME          PIKPHYS = $PIKPHYS"
           58 echo "$SCRIPTNAME PIKPHYS_COUPLING = $PIKPHYS_COUPLING"
           59 
           60 
           61 # #######################################
           62 # bootstrap and SHORT smoothing run to 100 years
           63 # #######################################
           64 stage=earlyone
           65 INNAME=$PISM_INDATANAME
           66 RESNAMEONE=${RESDIR}${stage}_${GRIDNAME}.nc
           67 RUNTIME=1
           68 echo
           69 echo "$SCRIPTNAME  bootstrapping on $GRIDNAME grid plus SIA run for $RUNTIME a"
           70 cmd="$PISM_MPIDO $NN $PISM_EXEC -skip -skip_max $SKIP -i ${INNAME} -bootstrap $GRID \
           71         $SIA_ENHANCEMENT $PIKPHYS_COUPLING -front_retreat_file ${INNAME} \
           72         -y $RUNTIME -o $RESNAMEONE"
           73 $DO $cmd
           74 #exit # <-- uncomment to stop here
           75 
           76 stage=smoothing
           77 RESNAME=${RESDIR}${stage}_${GRIDNAME}.nc
           78 RUNTIME=100
           79 echo
           80 echo "$SCRIPTNAME  short SIA run for $RUNTIME a"
           81 cmd="$PISM_MPIDO $NN $PISM_EXEC -skip -skip_max $SKIP -i $RESNAMEONE \
           82         $SIA_ENHANCEMENT $PIKPHYS_COUPLING -front_retreat_file ${INNAME} \
           83         -y $RUNTIME -o $RESNAME"
           84 $DO $cmd
           85 
           86 # #######################################
           87 # run with -no_mass (no surface change) on coarse grid for 200ka
           88 # #######################################
           89 stage=nomass
           90 INNAME=$RESNAME
           91 RESNAME=${RESDIR}${stage}_${GRIDNAME}.nc
           92 TSNAME=${RESDIR}ts_${stage}_${GRIDNAME}.nc
           93 RUNTIME=200000
           94 EXTRANAME=${RESDIR}extra_${stage}_${GRIDNAME}.nc
           95 expackage="-extra_times 0:1000:$RUNTIME -extra_vars bmelt,tillwat,velsurf_mag,temppabase,diffusivity,hardav"
           96 echo
           97 echo "$SCRIPTNAME  -no_mass (no surface change) SIA for $RUNTIME a"
           98 cmd="$PISM_MPIDO $NN $PISM_EXEC -i $INNAME $PIKPHYS_COUPLING  \
           99     $SIA_ENHANCEMENT -no_mass \
          100     -ys 0 -y $RUNTIME \
          101     -extra_file $EXTRANAME $expackage \
          102     -o $RESNAME"
          103 $DO $cmd
          104 #exit # <-- uncomment to stop here
          105 
          106 
          107 # #######################################
          108 # run into steady state with constant climate forcing
          109 # #######################################
          110 stage=run
          111 INNAME=$RESNAME
          112 RESNAME=${RESDIR}${stage}_${GRIDNAME}.nc
          113 TSNAME=${RESDIR}ts_${stage}_${GRIDNAME}.nc
          114 RUNTIME=100000
          115 EXTRANAME=${RESDIR}extra_${stage}_${GRIDNAME}.nc
          116 exvars="thk,usurf,velbase_mag,velbar_mag,mask,diffusivity,tauc,bmelt,tillwat,temppabase,hardav,cell_grounded_fraction,ice_area_specific_volume,amount_fluxes,basal_mass_flux_grounded,basal_mass_flux_floating"
          117 expackage="-extra_times 0:1000:$RUNTIME -extra_vars $exvars"
          118 
          119 echo
          120 echo "$SCRIPTNAME  run into steady state with constant climate forcing for $RUNTIME a"
          121 cmd="$PISM_MPIDO $NN $PISM_EXEC -bootstrap -Lz 5000 -skip -skip_max $SKIP -i $INNAME \
          122     $SIA_ENHANCEMENT $PIKPHYS_COUPLING $PIKPHYS $FULLPHYS \
          123     -ys 0 -y $RUNTIME \
          124     -ts_file $TSNAME -ts_times 0:1:$RUNTIME \
          125     -extra_file $EXTRANAME $expackage \
          126     -o $RESNAME -o_size big"
          127 $DO $cmd
          128 
          129 echo
          130 echo "$SCRIPTNAME  coarse-grid part of spinup done"