#! /bin/csh # Batch file "undoit4.bat" # - Cannibalized from NADCON5 for use by VERTCON3 # 2018 05 16 - Added a new argument (see doit3.bat), so there # are now TWO thin/grid arguments, though they MUST be # the same for any od/nd/rg combo EXCEPT ngvd29/navd88/conus # # - Deletes all files created from "doit3.bat" # # Takes in 6 arguments: # Argument 1 = lower case, old datum name (character*10) # Argument 2 = lower case, new datum name (character*10) # Argument 3 = lower case, region (character*10) # Argument 4 = number, filter (integer ) # Argument 5 = Thinning/Grid Spacing, RZ, arcseconds (character*5) # Argument 6 = Thinning/Grid Spacing, CD, arcseconds (character*5) # # Special note for the filter: This batch file expects a number # from 0 through 999 for the filter. Numbers below 0 or above # 1000 will cause it to fail. Furthermore, this batch file # will pad leading zeros onto the number, so that files # with the filter in its name will always have 3 digits # for that filter. That is, a filter of "1" becomes "001" # in all subsequent file names, "99" becomes "099", etc. # Do NOT pad the filter number yourself! # # Example of how to execute this batch file: # %undoit3.bat ngvd29 navd88 conus 0 900 180 # The only allowable combinations are: # (The "*" and "@" represents any value of arcseconds. # between 1 and 99999, and the # represents any filter from 0 to 999) # For CONUS: # ngvd29 navd 88 conus # * @ # For ALASKA: # ngvd29 navd 88 alaska # * @ # For HAWAII: # No combinations exist # For PR: # lt prvd02 pr # * @ # For VI: # lt vivd09 vi # * @ # For GUAM: # lt guvd63 guam # * @ # guvd63 guvd04 guam # * @ # For CNMI: # lt nmvd03 cnmi # * @ # For AS: # lt asvd02 as # * @ date echo 'undoit4.bat -- BEGIN' echo 'undoit4.bat: Number of Arguments Received = '$#argv echo 'undoit4.bat: Old Datum = '$argv[1] echo 'undoit4.bat: New Datum = '$argv[2] echo 'undoit4.bat: Region = '$argv[3] echo 'undoit4.bat: Filter = '$argv[4] echo 'undoit4.bat: Grid Spacing #1, ArcSeconds = '$argv[5] echo 'undoit4.bat: Grid Spacing #2, ArcSeconds = '$argv[6] # # -------------------------------------- # Below is the "pad with leading zeros" code for the filter: # -------------------------------------- set var0 = "0" set var00 = "00" if ($argv[4] < 0) then echo $argv[4] 'is negative. Fail!' exit else if ($argv[4] < 10) then set argv[4] = "$var00$argv[4]" # echo "$argv[4]" else if ($argv[4] < 100) then set argv[4] = "$var0$argv[4]" # echo "$argv[4]" else if ($argv[4] < 1000) then set argv[4] = "$argv[4]" # echo "$argv[4]" else if ($argv[4] > 999) then echo $argv[4] 'is over 999. Fail!' exit endif # # -------------------------------------- # Below is the "Grid spacings must be IDENTICAL" for non 29/88/conus runs code: # -------------------------------------- if ($argv[1] != "ngvd29" && $argv[2] != "navd88" && $argv[3] != "conus") then if ($argv[5] != $argv[6]) then echo undoit4.bat FAIL 001 exit endif endif # -------------------------------------- # - DELETE the grid interpolated vector files, All # -------------------------------------- echo 'undoit4.bat: Removing Grid-Interpolated vector files with All points' rm -f vmagioht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the grid interpolated vector files, Thinned # -------------------------------------- echo 'undoit4.bat: Removing Grid-Interpolated vector files with Thinned points' rm -f vmtgioht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the grid interpolated vector files, Dropped # -------------------------------------- echo 'undoit4.bat: Removing Grid-Interpolated vector files with Dropped points' rm -f vmdgioht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the double differenced vector files, All # -------------------------------------- echo 'undoit4.bat: Removing Double Differenced vector files with All points' rm -f vmaddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the double differenced vector files, Thinned # -------------------------------------- echo 'undoit4.bat: Removing Double Differenced vector files with Thinned points' rm -f vmtddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the double differenced vector files, Dropped # -------------------------------------- echo 'undoit4.bat: Removing Double Differenced vector files with Dropped points' rm -f vmdddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the fourth GMT batch file # -------------------------------------- echo undoit4.bat: Removing fourth GMT batch file rm -f gmtbat04.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].* # # -------------------------------------- # - DELETE the temporary stat-holding file # -------------------------------------- echo undoit4.bat: Removing stats.tmp rm -f dvstats.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the grid-interpolated vector plots, All # -------------------------------------- echo 'undoit4.bat: Removing Grid-Interpolated vector plots with All points' rm -f vmagioht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the grid-interpolated vector plots, Thinned # -------------------------------------- echo 'undoit4.bat: Removing Grid-Interpolated vector plots with Thinned points' rm -f vmtgioht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the grid-interpolated vector plots, Dropped # -------------------------------------- echo 'undoit4.bat: Removing Grid-Interpolated vector plots with Dropped points' rm -f vmdgioht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the double differenced vector plots, All # -------------------------------------- echo 'undoit4.bat: Removing Double Differenced vector plots with All points' rm -f vmaddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the double differenced vector plots, Thinned # -------------------------------------- echo 'undoit4.bat: Removing Double Differenced vector plots with Thinned points' rm -f vmtddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the double differenced vector plots, Dropped # -------------------------------------- echo 'undoit4.bat: Removing Double Differenced vector plots with Dropped points' rm -f vmdddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the RMS'd differential vector files # -------------------------------------- echo 'undoit4.bat: Removing RMSd differential vector files' rm -f vmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the RMS'd differential vector plots # -------------------------------------- echo 'undoit4.bat: Removing RMSd differential vector files' rm -f vmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the RMS'd differential coverage files # -------------------------------------- echo 'undoit4.bat: Removing RMSd differential vector coverage files' rm -f cvrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the RMS'd differential vector files (for use in surface) # -------------------------------------- echo 'undoit4.bat: Removing RMSd differential vector files (for use in surface)' rm -f smrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the fifth GMT batch file # -------------------------------------- echo undoit4.bat: Removing fifth GMT batch file : gmtbat05.$argv[1].$argv[2].$argv[3].$argv[4] rm -f gmtbat05.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6] # # -------------------------------------- # - DELETE the gridded ".grd" files # -------------------------------------- echo 'undoit4.bat: Removing gridded .grd files' rm -f vmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.grd # # -------------------------------------- # - DELETE the gridded ".xyz" files # -------------------------------------- echo 'undoit4.bat: Removing gridded .xyz files' rm -f vmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.xyz # # -------------------------------------- # - DELETE the gridded RMS'd ".b" files ("data noise" grids) # -------------------------------------- echo 'undoit4.bat: Removing gridded RMS DD .b files' rm -f vmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.b # # -------------------------------------- # - DELETE the sixth GMT batch file # -------------------------------------- echo undoit4.bat: Removing sixth GMT batch file rm -f gmtbat06.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].* # -------------------------------------- # - DELETE the Total Error grids, .b format # -------------------------------------- # echo 'undoit4.bat: Removing Total Error grids, .b format' rm -f vmeteoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].b # -------------------------------------- # - DELETE the Total Error grids, .grd format # -------------------------------------- echo 'undoit4.bat: Removing Total Error grids, .grd format' rm -f vmeteoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].grd # # -------------------------------------- # - DELETE the Differential Vector COVERAGE plots # -------------------------------------- echo 'undoit4.bat: Removing RMSd differential vector COVERAGE (dcr) plots' rm -f cvrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the Differential VECTOR plots # -------------------------------------- #echo 'undoit4.bat: Removing RMSd differential vector COVERAGE (dvr) plots' #rm -f vmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the color plots of RMS'd DD grids # -------------------------------------- echo 'undoit4.bat: Removing RMSd differential vector COLOR plots' rm -f cmrddoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg # # -------------------------------------- # - DELETE the color plots of total error grids # -------------------------------------- echo 'undoit4.bat: Removing Total Error COLOR plots' rm -f cmeteoht.$argv[1].$argv[2].$argv[3].$argv[4].$argv[5].$argv[6].*.jpg echo 'undoit4.bat -- END' date