[gradsusr] problem with batch script attempting to incorporating fprintf and gr2stn

Theo Carter thibidottwo at hotmail.com
Mon Apr 30 05:39:23 EDT 2012


Hi All,

If there are any coders out there that can help, I would greatly appreciate it!  I am running the latest grads out of the Scientific Linux 6 (same as CentOS/RHEL) repository and want to set up basic verification for a local Wrf mesoscale model and the 0.5 GFS global models against actuals. 

I create a file called stationtest which has umpteen stations with their latitude and longitude in (OMDB xxxx xxxx) and then want to cron run a batch script which pulls out 48 hours from the GFS at these particular station points. The basic script below runs fine - but I would like to use gr2stn in order to do the bilinear interpolation within the ~50kmX~50km GFS gridspace. The following is my working script and this part runs fine:

Filename: gfsprinttext

'open gfsgrads.ctl'
returnlinetext = read(stationtest)
rtncode = sublin(returnlinetext,1)
loclatlon = sublin(returnlinetext,2)
while (sublin (rtncode,1) = 0)
locationvar = subwrd (loclatlon,1)
latvariable = subwrd (loclatlon,2)
lonvariable = subwrd (loclatlon,3)

'set t 1 17'
'set lat ' latvariable
'set lon ' lonvariable
'fprintf (tmp2m) /gfs/grads2/gfsoutput/'locationvar'temp.txt'

returnlinetext = read (stationtest)
rtncode = sublin(returnlinetext,1)

loclatlon = sublin(returnlinetext,2)
endwhile

As I said, this above part works fine - but I have attempted in various ways to incorporate the gr2stn function and am not getting it right, has anybody else done something similar or have suggestions for me?
Thanks kindly,
Theo
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120430/106d1d2c/attachment-0003.html 


More information about the gradsusr mailing list