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

Last change on this file since 1412 was 677, checked in by lfita, 9 years ago

Fixing pyHOME paths

  • 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  pyHOME=${HOME}/etudes/WRF_LMDZ/svn/LMDZ_WRF/tools
12
13  geofile=$1
14  ofile='zero_dom.nc'
15
16  rm ${ofile} > /dev/null
17
18  zerovars='LANDMASK:HGT_M:HGT_U:HGT_V:SLPX:SLPY:CON:VAR:OA1:OA2:OA3:OA4:OL1:OL2:OL3:OL4:'
19  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'
20  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'
21
22
23  cp ${geofile} ${ofile}
24
25  # zerovars
26  ##
27  ivar=1
28  echo "zeroing..."
29  zerov=`echo ${zerovars} | tr ':' ' '`
30  for var in ${zerov}; do
31    echo "  "${var}"..."
32    python ${pyHOME}/nc_var.py -f ${ofile} -v ${var} -o valmod -S mulc,0.
33    ivar=`expr ${ivar} + 1`
34##    exit
35  done # end of zeroingvars
36
37  # giving values
38  ##
39  echo "giving values..."
40  givv=`echo ${specificvars} | tr ':' ' '`
41  for var in ${givv}; do
42    varn=`echo ${var} | tr '|' ' ' | awk '{print $1}'`
43    varv=`echo ${var} | tr '|' ' ' | awk '{print $2}'`
44    echo "  "${varn}"..."
45    python ${pyHOME}/nc_var.py -f ${ofile} -v ${varn} -o valmod -S mulc,0.
46    python ${pyHOME}/nc_var.py -f ${ofile} -v ${varn} -o valmod -S sumc,${varv} 
47    ivar=`expr ${ivar} + 1`
48##    exit
49  done # end of zeroingvars
50
51
52fi
Note: See TracBrowser for help on using the repository browser.