#!/bin/csh -bf # # gp.StoreDataOnly # # Script to retrieve remote data and store on archive. # Adapted from gp.data. # W. Prescott # 22 January 1996 # # Modifications: # Added GetCVOData kjw 10/20/99 # Check for list of desired campaigns # ----------------------------------- if (! -e CampaignsToInclude) then echo "gp.StoreDataOnly: File CampaignsToInclude not found" echo "gp.StoreDataOnly: Terminating" exit 2 endif # Check number of arguments. # Store Dates to be run. # ---------------------- echo " " if ($#argv == 0) then if( -e DatesToRun) then set Dates = `sed -n '/.*/p' DatesToRun` # (Note: sed ignores blank lines in file) else echo Usage: gp.StoreDataOnly yyyymmdd1 yyyymmdd2 yyyymmdd3 etc echo Usage: or put dates in file DatesToRun exit 1 endif else @ i = 1 set Dates while ($i <= $#argv) set Dates = "$Dates $argv[$i]" @ i = $i + 1 end endif # LOOP ON DATES # ------------- foreach Date ($Dates) echo " " echo gp.StoreDataOnly: Running $Date # Create working directory and change to it # ----------------------------------------- set Dir = StoreOnlyDir if (! -e $Dir ) then mkdir $Dir else rm -f $Dir/* endif cp CampaignsToInclude $Dir cd $Dir CreateObsDateFile $Date # Create Checklist file of stations for retrieving data # Then retrieve data: first from local archive # then from remote archives. # ---------------------------------------- set CampaignList = `sed -n '/.*/p' CampaignsToInclude` # (Note: sed ignores blank lines in file) CreateGetLog $CampaignList GetRegionalData GetRemoteData GetDixieData GetCorsData GetCVOData cp * ../storeall # cp *x ../storeall # cp *.0?o* ../storeall # cp *pltc* ../storeall echo gp.StoreDataOnly: finished # Change out of working directory and delete it # (Everything should have been moved to archive) # ---------------------------------------------- cd .. rm -f $Dir/* end rmdir $Dir exit