Hi Eric,<br>Great! it did work.<br>Thanks,<br>Krishna<br><br><div class="gmail_quote">On Mon, Jul 6, 2009 at 10:42 PM, Eric Altshuler <span dir="ltr">&lt;<a href="mailto:ela@cola.iges.org">ela@cola.iges.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Krishna,<br>
<br>
I made a slight mistake in my reply, the script line for writing the values to the file should have single quotes around the file name:<br>
<div class="im"><br>
rc=write(&#39;temp_30m.dat&#39;,variables2)<br>
<br>
</div>I would be very surprised if this doesn&#39;t work for you, because I tested it myself and it worked fine.<br>
<font color="#888888"><br>
Eric<br>
</font><div class="im"><br>
----- Original Message -----<br>
From: &quot;Krishna Santhanam&quot; &lt;<a href="mailto:ksanthanam@PRECISIONWIND.COM">ksanthanam@PRECISIONWIND.COM</a>&gt;<br>
To: <a href="mailto:GRADSUSR@LIST.CINECA.IT">GRADSUSR@LIST.CINECA.IT</a><br>
</div><div><div></div><div class="h5">Sent: Tuesday, July 7, 2009 12:12:16 AM GMT -05:00 US/Canada Eastern<br>
Subject: Re: NARR data analysis<br>
<br>
Hi Eric,<br>
It works. Thanks for the technical description, some how the &quot;rc=write(temp.dat,variables2)&quot; command doesn&#39;t work but &quot;write(temp.dat,variables2) produces values.<br>
Thanks again,<br>
Krishna<br>
<br>
<br>
On Mon, Jul 6, 2009 at 7:43 PM, Eric Altshuler &lt; <a href="mailto:ela@cola.iges.org">ela@cola.iges.org</a> &gt; wrote:<br>
<br>
<br>
Hello Krishna,<br>
<br>
When you are displaying data that is preprojected (i.e. the grads descriptor file includes a PDEF specification), any &#39;display&#39; command will produce the following message in the command window:<br>
<br>
Notice: Automatic Grid Interpolation Taking Place<br>
<br>
In a script, when you display a variable, the script variable &#39;result&#39; 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 &#39;d ugrd30m&#39;:<br>

<br>
Notice: Automatic Grid Interpolation Taking Place<br>
Result value = 5.26342<br>
<br>
To retrieve the numerical value, you need to change the following line in your script:<br>
<br>
dum1=sublin(result,1)<br>
<br>
to the following:<br>
<br>
dum1=sublin(result,2)<br>
<br>
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&#39;t be generated.<br>
<br>
You should also use the following syntax for the write function:<br>
<br>
rc=write(temp_30m.dat,variables2)<br>
<br>
instead of:<br>
<br>
<br>
write(temp_30m.dat,variables2)<br>
<br>
Although the latter syntax will write to the file successfully, it will also cause an error message &quot;Unknown command: 0&quot;. The former syntax is the correct one to use.<br>
<br>
Best regards,<br>
<br>
Eric L. Altshuler<br>
Assistant Research Scientist<br>
Center for Ocean-Land-Atmosphere Studies<br>
4041 Powder Mill Road, Suite 302<br>
Calverton, MD 20705-3106<br>
USA<br>
<br>
E-mail: <a href="mailto:ela@cola.iges.org">ela@cola.iges.org</a><br>
Phone: (301) 902-1257<br>
Fax: (301) 595-9793<br>
<br>
<br>
<br>
<br>
----- Original Message -----<br>
From: &quot;Krishna Santhanam&quot; &lt; <a href="mailto:ksanthanam@PRECISIONWIND.COM">ksanthanam@PRECISIONWIND.COM</a> &gt;<br>
To: <a href="mailto:GRADSUSR@LIST.CINECA.IT">GRADSUSR@LIST.CINECA.IT</a><br>
Sent: Sunday, July 5, 2009 3:09:30 PM GMT -05:00 US/Canada Eastern<br>
Subject: NARR data analysis<br>
<br>
Hi all,<br>
I am trying to write u and v wind component from NARR data into a file. The<br>
text file that is written is having no value but &quot;interpolation&quot; . Could<br>
anyone help me how to solve this issue.<br>
By the way here is the grads script that i used<br>
____________________<br>
<br>
function main()<br>
&#39;open narr-a_221_20010101_0000_000.ctl&#39;<br>
cntt=1<br>
say &quot;cntt =&quot;cntt<br>
cntx=290<br>
while(cntx&lt;=350)<br>
cnty=60<br>
while(cnty&lt;=100)<br>
count=1<br>
count1=count+7<br>
while(count&lt;=count1)<br>
&#39;set t &#39;count<br>
&#39;set x &#39;cntx<br>
&#39;set y &#39;cnty<br>
&#39;set z 1&#39;<br>
&#39;d ugrd30m.&#39;cntt<br>
dum1=sublin(result,1)<br>
x13=subwrd(dum1,4)<br>
&#39;d vgrd30m.&#39;cntt<br>
dum1=sublin(result,1)<br>
x23=subwrd(dum1,4)<br>
variables2=x13&#39; &#39;x23<br>
write(temp_30m.dat,variables2)<br>
count=count+1<br>
endwhile<br>
cnty=cnty+1<br>
endwhile<br>
cntx=cntx+1<br>
endwhile<br>
---------------------------------------<br>
<br>
Thanks,<br>
Krishna<br>
<br>
<br>
<br>
--<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>------------------------------------------<br>Krishnaraj Santhanam PhD<br>Project Manager,<br>Precision Wind LLC<br>Anderson Hall PSL<br>Las Cruces, NM 88003<br>
Ph: (510)3256574<br>-------------------------------------------<br>