NARR data analysis
Eric Altshuler
ela at COLA.IGES.ORG
Mon Jul 6 21:43:26 EDT 2009
Hello Krishna,
When you are displaying data that is preprojected (i.e. the grads descriptor file includes a PDEF specification), any 'display' command will produce the following message in the command window:
Notice: Automatic Grid Interpolation Taking Place
In a script, when you display a variable, the script variable 'result' captures the messages that grads would have sent to the command window. When the data is preprojected, the message about grid interpolation appears first. So you might have the following response to the command 'd ugrd30m':
Notice: Automatic Grid Interpolation Taking Place
Result value = 5.26342
To retrieve the numerical value, you need to change the following line in your script:
dum1=sublin(result,1)
to the following:
dum1=sublin(result,2)
Note that this is not necessary when using non-preprojected data (i.e. the ctl file does not have a PDEF specification), because the message about grid interpolation won't be generated.
You should also use the following syntax for the write function:
rc=write(temp_30m.dat,variables2)
instead of:
write(temp_30m.dat,variables2)
Although the latter syntax will write to the file successfully, it will also cause an error message "Unknown command: 0". The former syntax is the correct one to use.
Best regards,
Eric L. Altshuler
Assistant Research Scientist
Center for Ocean-Land-Atmosphere Studies
4041 Powder Mill Road, Suite 302
Calverton, MD 20705-3106
USA
E-mail: ela at cola.iges.org
Phone: (301) 902-1257
Fax: (301) 595-9793
----- Original Message -----
From: "Krishna Santhanam" <ksanthanam at PRECISIONWIND.COM>
To: GRADSUSR at LIST.CINECA.IT
Sent: Sunday, July 5, 2009 3:09:30 PM GMT -05:00 US/Canada Eastern
Subject: NARR data analysis
Hi all,
I am trying to write u and v wind component from NARR data into a file. The
text file that is written is having no value but "interpolation" . Could
anyone help me how to solve this issue.
By the way here is the grads script that i used
____________________
function main()
'open narr-a_221_20010101_0000_000.ctl'
cntt=1
say "cntt ="cntt
cntx=290
while(cntx<=350)
cnty=60
while(cnty<=100)
count=1
count1=count+7
while(count<=count1)
'set t 'count
'set x 'cntx
'set y 'cnty
'set z 1'
'd ugrd30m.'cntt
dum1=sublin(result,1)
x13=subwrd(dum1,4)
'd vgrd30m.'cntt
dum1=sublin(result,1)
x23=subwrd(dum1,4)
variables2=x13' 'x23
write(temp_30m.dat,variables2)
count=count+1
endwhile
cnty=cnty+1
endwhile
cntx=cntx+1
endwhile
---------------------------------------
Thanks,
Krishna
More information about the gradsusr
mailing list