#!/bin/csh -f # ..If no args print Usage message if ($#argv == 0) then goto usage endif umask 000 # ..Set defaults set wdir=/ptmp/$USER/ERA40 # ..Parse arguments set remargs = "" while ($#argv > 0) switch ("$1") case "-h": goto usage case "-d": shift set wdir=$1 breaksw case "-d*": set wdir = `echo $1 | cut -c3-` breaksw case "-t": shift set hour=$1 breaksw case "-t*": set hour = `echo $1 | cut -c3-` breaksw case "-i": shift set istrt=$1 breaksw case "-i*": set istrt = `echo $1 | cut -c3-` breaksw case "-n": shift set ndays=$1 breaksw case "-n*": set ndays = `echo $1 | cut -c3-` breaksw default: set remargs=($remargs $1) breaksw endsw shift end if ($remargs != "") then echo echo "Arguments not recognized: "${remargs} echo exit(2) endif # ..Invoke associated NCL script setenv DS117 "${istrt};${ndays};${hour};${wdir}" ( ncl /home/tempest/mai/svn/datasets/ECMWF/ds117.2.ncl >! ds117.2.out ) >&! ds117.2.err exit($status) usage: echo echo " Usage:" echo " ds117.2.csh\" echo " -i start_date1[,start_date2,...]\" echo " -n ndays1[,ndays2,...]\" echo " -t hour1[,hour2,...]\" echo " [-d working_dir]" echo echo " Dates available: 19570901-20020831" echo echo " Meaning of hour specification:" echo " 0 -> 0Z" echo " 1 -> 6Z" echo " 2 -> 12Z" echo " 3 -> 18Z" echo " 4 -> all four hours are output" echo echo " For a given time spec, all needed time slices must be contained within a single MSS file\!" echo echo " Working directory defaults to /ptmp/$USER/ERA40" echo exit(1)