#!/bin/csh # Batch file "doit.bat" # - Cannibalized from NADCON5 for use in VERTCON3 # - First of many which are used to process, # - analyze, and ultimately create, all of # - the files for VERTCON 3.0 # - What this batch file does: # 1) Creates a "work" file from "in" files # and our "edit" file # # Takes in 4 arguments: # Argument 1 = lower case, old datum name # Argument 2 = lower case, new datum name # Argument 3 = lower case, region # Argument 4 = filter on which heights to allow # 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: # %doit.bat ngvd29 navd88 conus 0 # The only allowable combinations are (note # the filter is an integer, and can be use # in any case, so is represented below simply by "#"): # 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 'doit.bat -- BEGIN' echo 'doit.bat: Number of Arguments Received = '$#argv echo 'doit.bat: Old Datum = '$argv[1] echo 'doit.bat: New Datum = '$argv[2] echo 'doit.bat: Region = '$argv[3] echo 'doit.bat: Filter = '$argv[4] # 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 # -------------------------------------- # - RUN "makework.f" # - Creates a file called "work.(olddtm).(newdtm).(region).(filter)" # - which contains all of the data needed # - to plot and analyze the transformation # - between two datums in one region. # -------------------------------------- ./makework << ! $argv[1] $argv[2] $argv[3] $argv[4] ! # # -------------------------------------- # echo 'doit.bat -- END' date