#!/bin/csh -f # #doc Run AG solutions #doc # # Last modified 2008/3/19 by S. McClusky ######################### INSTRUCTIONS ############################# # See if arguments passed if( $#argv == 0 ) then echo "===========================================================================================" echo " Run AG " echo " " echo " sh_ag -input echo "===========================================================================================" exit endif ##################### SET UP DEFAULTS ############################# set yr = '' set doy = '' set file = '' set archives = ( sopac cddis unavco geoaus gaswpc bkgi ) ##################### DECIPHER COMMAND LINE ####################### while ($#argv > 0 ) set input = ( $argv ) switch($input[1]) case -i*: set file = $input[2] breaksw case -to*: set topts = (`echo $argv | cut -d- -f2`); shift topts breaksw endsw if ( $#argv > 0 ) shift argv end alldone: ##################### GET THE JOB DONE ############################ foreach i (`cat $file | awk '{print $2}'`) set site = `echo $i | awk '{print substr($1,1,4)}` set doy = `echo $i | awk '{print substr($1,5,3)}` set year = `echo $i | awk '{print substr($1,10,2)}` set ag_file = `echo $i | awk '{print substr($1,10,11)o.gz}` set yr = `sh_year -yearr $year` foreach j ($archives) sh_get_rinex -archive $j -yr $yr[2] -doy $doy -sites $site end gzip ${site}${doy}?.${yr[2]}o if (-e $ag_file ) then echo ftp://everest.mit.edu/pub/ag/$ag_file >! tmp.mail mail -s Static ag@cobra.jpl.nasa.gov < tmp.mail endif end