tpreprocess.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 --- tpreprocess.sh (2584B) --- 1 #!/bin/bash 2 3 # depends on NCO (http://nco.sourceforge.net/) 4 5 set -e # exit on error 6 7 DATA=nbreen_input.nc 8 PISMDATA=pismnbreen.nc 9 10 echo "making PISM-readable file $PISMDATA by copying $DATA and adjusting metadata ..." 11 rm -f $PISMDATA 12 # copy but skip "outline" which is (thk>0) and thus redundant 13 ncks -O -v outline -x $DATA $PISMDATA 14 15 # surface climate for "-surface given" just has placeholders 16 ncap2 -O -s "climatic_mass_balance=0.0*topg" $PISMDATA $PISMDATA 17 ncatted -O -a units,climatic_mass_balance,o,c,"kg m-2 year-1" $PISMDATA 18 ncatted -O -a standard_name,climatic_mass_balance,o,c,"land_ice_surface_specific_mass_balance_flux" $PISMDATA 19 ncap2 -O -s "ice_surface_temp=0.0*topg+260.0" $PISMDATA $PISMDATA 20 ncatted -O -a units,ice_surface_temp,o,c,"K" $PISMDATA 21 ncatted -O -a standard_name,ice_surface_temp,d,c, $PISMDATA 22 23 # edit mask name 24 ncatted -O -a standard_name,nbreen,d,c, $PISMDATA 25 ncatted -O -a long_name,nbreen,o,c,"mask for Nordenskioldbreen glacier on Svalbard" $PISMDATA 26 27 # input into subglacial aquifer is linear in surface elevation where nbreen==1, otherwise zero 28 ncap2 -O -s "basal_melt_rate_grounded=(3.0/900.0)*(900.0-usurf)" $PISMDATA $PISMDATA 29 ncap2 -O -s "where(usurf>900.0) basal_melt_rate_grounded=0.0" $PISMDATA $PISMDATA 30 ncap2 -O -s "where(nbreen<=0.5) basal_melt_rate_grounded=0.0" $PISMDATA $PISMDATA 31 ncatted -O -a units,basal_melt_rate_grounded,m,c,"m year-1" $PISMDATA 32 ncatted -O -a standard_name,basal_melt_rate_grounded,d,c, $PISMDATA 33 ncatted -O -a long_name,basal_melt_rate_grounded,o,c,"basal melt rate as input to subglacial hydrology" $PISMDATA 34 35 # 50 m/a basal speed; only the magnitude affects "-hydrology distributed" 36 ncap2 -O -s "u_ssa_bc=0.0*topg+50.0" $PISMDATA $PISMDATA 37 ncatted -O -a units,u_ssa_bc,o,c,"m year-1" $PISMDATA 38 ncatted -O -a long_name,u_ssa_bc,o,c,"x-component of prescribed sliding velocity" $PISMDATA 39 ncatted -O -a standard_name,u_ssa_bc,d,c, $PISMDATA 40 ncap2 -O -s "v_ssa_bc=0.0*topg" $PISMDATA $PISMDATA 41 ncatted -O -a units,v_ssa_bc,o,c,"m year-1" $PISMDATA 42 ncatted -O -a long_name,v_ssa_bc,o,c,"y-component of prescribed sliding velocity" $PISMDATA 43 ncatted -O -a standard_name,v_ssa_bc,d,c, $PISMDATA 44 ncap2 -O -s "bc_mask=0.0*topg+1.0" $PISMDATA $PISMDATA 45 ncatted -O -a units,bc_mask,d,c, $PISMDATA 46 ncatted -O -a long_name,bc_mask,o,c,"equals one where (u_ssa_bc,v_ssa_bc) should be applied as sliding seen by hydrology" $PISMDATA 47 ncatted -O -a standard_name,bc_mask,d,c, $PISMDATA 48 49 INTOBED=fakesummerevent.nc 50 echo "calling fake-inputtobed.py to create PISM-readable -input_to_bed file $INTOBED ..." 51 ./fake-inputtobed.py 52