[gradsusr] Programming a Tab in ASCII file within Grads
Mac
mmacleod at scotiaweather.com
Mon Nov 7 13:19:28 EST 2011
Good afternoon Folks,
I am generating WRF model output for the centroid of a hydrologic
sub-basin for input to the DHI Mark 11 Hydrologic model as part of a
project.
The DHI have provided a proprietary program to convert precipitation and
evaporation values required as input to the Mark 11 model from am ASCII
file format to their proprietary binary format.
There is a requirement to place tabs in the header recorders of the
input ASCII file.
Here is the code section:
****** Write Header records for precipitation *****
valh = " final"
rc = write(filename1, valh)
valh1 = " Time"%^I%Rainfall"
rc = write(filename1, valh1)
valh2 = " Unit 100004 1002 0"
rc = write(filename1, valh2)
I need three spaces between Time and Rainfall and the DHI executable
expects a tab to provide the 3 spaces. Similarly it requires a tab for
6 spaces between Unit and 100004, a tab for 8 spaces between 100004 and
1002 and a tab for 11 spaces between 1002 and 0.
The ASCII table character for tab is hex 09 or control I. I tried ^I as
given in the ASCII table for tab but the GrADS program gave a syntax
error message .
How does one get this in a script to produce the required tab commands?
Thanks in advance for your help.
Sincerely
Mac MacLeod
--
M.A. (Mac) MacLeod,
President and General Manager,
Scotia Weather Services Inc.,
11 Thornhill Dr., Suite 240,
Dartmouth, N.S. B2B 1P9
Tele: 902-468-3866, Cell: 902-225-5747
e-mail: mmacleod at scotiaweather.com
web: www.scotiaweather.com
More information about the gradsusr
mailing list