source: lmdz_wrf/trunk/tools/make_geo-aquaplanet.bash @ 188

Last change on this file since 188 was 188, checked in by lfita, 10 years ago

Adding script to generate geogrid aqua-planet domain

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2if test $1 = '-h'; then
3  echo "****************************"
4  echo "*** Shell script to make ***"
5  echo "***    an aqua-planet    ***"
6  echo "****************************"
7  echo "make_aquaplanet.bash [geofile](domain file to transform)"
8else
9  rootsh=`pwd`
10  export PATH=/u/lflmd/bin/gcc_Python-2.7.5/bin:${PATH}
11
12  geofile=$1
13  ofile='zero_dom.nc'
14
15  rm ${ofile} > /dev/null
16
17  zerovars='LANDMASK:HGT_M:HGT_U:HGT_V:SLPX:SLPY:CON:VAR:OA1:OA2:OA3:OA4:OL1:OL2:OL3:OL4:'
18  keepvars='XLAT_M:XLONG_M:XLAT_U:XLONG_U:XLAT_V:XLONG_V:CLAT:CLONG:MAPFAC_M:MAPFAC_V:MAPFAC_U:MAPFAC_MX:MAPFAC_VX:MAPFAC_UX:MAPFAC_MY:MAPFAC_VY:MAPFAC_UY:E:F:SINALPHA:COSALPHA'
19  specificvars='LANDUSEF|1:LU_INDEX|1:SOILTEMP|0:SOILCTOP|0:SCT_DOM|14:SOILCBOT|0:SCB_DOM|14:ALBEDO12M|8:GREENFRAC|0:SNOALB|0:SLOPECAT|0'
20
21
22  cp ${geofile} ${ofile}
23
24  # zerovars
25  ##
26  ivar=1
27  echo "zeroing..."
28  zerov=`echo ${zerovars} | tr ':' ' '`
29  for var in ${zerov}; do
30    echo "  "${var}"..."
31    python ${HOME}/climatescripts/python/nc_var.py -f ${ofile} -v ${var} -o valmod -S mulc,0.
32    ivar=`expr ${ivar} + 1`
33##    exit
34  done # end of zeroingvars
35
36  # giving values
37  ##
38  echo "giving values..."
39  givv=`echo ${specificvars} | tr ':' ' '`
40  for var in ${givv}; do
41    varn=`echo ${var} | tr '|' ' ' | awk '{print $1}'`
42    varv=`echo ${var} | tr '|' ' ' | awk '{print $2}'`
43    echo "  "${varn}"..."
44    python ${HOME}/climatescripts/python/nc_var.py -f ${ofile} -v ${varn} -o valmod -S mulc,0.
45    python ${HOME}/climatescripts/python/nc_var.py -f ${ofile} -v ${varn} -o valmod -S sumc,${varv} 
46    ivar=`expr ${ivar} + 1`
47##    exit
48  done # end of zeroingvars
49
50
51fi
Note: See TracBrowser for help on using the repository browser.