Changeset 44
- Timestamp:
- 01/31/08 07:59:54 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/netCDF_scripts/make_1mm
r43 r44 2 2 # -*- Mode: sh -*- 3 3 # 4 # Script to build 1mm and annual mean fromtime serie4 # Script to build 1mm and full record annual mean from monthly time serie 5 5 # 6 6 # Uses nco tools … … 8 8 usage() { 9 9 echo 10 echo "usage : make_1mm [-d] [-g] [-v <field1>,<field2>...] [-t <record name>] [-g <grid>] [-m] <file> <nyears>" 10 echo "usage : make_1mm [-d] [-v <field1>,<field2>...] [-t <record name>] [-m] <file> <nyears>" 11 echo " -d : toggle debug mode" 12 echo " -v : specify fields to work on" 13 echo " -t : specify time record name (should be detected automatically)" 14 echo " -m : do not make full record time mean" 15 echo " <file> : netcdf post-it format file" 16 echo " <nyears> : number of years in file" 11 17 echo 12 18 } … … 20 26 # 21 27 22 while getopts g:dhv:t:m name28 while getopts dhv:t:m name 23 29 do 24 30 case $name in 25 31 d) set -x ;; 26 g) type="$OPTARG";;27 32 v) fields="$OPTARG" ;; 28 33 t) timef="$OPTARG" ;; … … 36 41 37 42 # 38 # so that $1 is root43 # decode file name 39 44 # 40 45 shift `expr $OPTIND - 1` … … 65 70 echo "Processing: $enam $ave $year1 $year2 $ndates $type" 66 71 67 case $type in 68 t30) long="nav_lon" 69 lati="nav_lat" 70 time="time_counter" ;; 71 lmdz*) long="lon" 72 lati="lat" 73 time="time_counter" ;; 74 reg1) long="lon" 75 lati="lat" 76 time="time" ;; 77 t42) long="lon" 78 lati="lat" 79 time="time" ;; 80 t62) long="lon" 81 lati="lat" 82 time="time" ;; 83 umat) long="longitude" 84 lati="latitude" 85 time="t" ;; 86 umau) long="longitude" 87 lati="latitude" 88 time="t" ;; 89 reg1mtrop) long="longitude" 90 lati="latitude" 91 time="t" ;; 92 *) long="nav_lon" 93 lati="nav_lat" 94 time=`ncdump -h ${file} | grep UNLIMITED | awk '{print $1}'` ;; 95 esac 72 # detect time dimension 73 74 time=`ncdump -h ${file} | grep UNLIMITED | awk '{print $1}'` 96 75 time=${timef:-$time} 97 76 fields=${fields:-"-x -v $long,$lati"} … … 112 91 113 92 # 114 PATH=$PATH:/usr/local/netcdf/bin:/u/rech/eee/reee217/bin115 #116 93 out1m=${enam}_${aveoum}_01_12_${year1}-${year2}_$type.nc 117 94 outmean=${enam}_${ndates}y_${year1}_${year2}_$type.nc 118 95 # 119 96 optg="-O" 120 grid=0121 if [ $grid -eq 1 ] ; then122 # get grid123 ncks -O -v $lati,$long ${file} $out1m || echo 'no grid'124 optg="-A"125 fi126 97 127 98 m_list="00 01 02 03 04 05 06 07 08 09 10 11"
Note: See TracChangeset
for help on using the changeset viewer.