<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><br></span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Use this:</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">INTEGER IREC</span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><br></span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IREC=1<br></span></font></p>
<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO 110
I=1,191</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
write(16,rec=IREC) (Ux(I,J),J=1,360)&nbsp; ! writes the u component to file</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IREC=IREC+1<br></span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; 110&nbsp;&nbsp;&nbsp; CONTINUE</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO 115 I=1,191</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
write(16,rec=I) (Vy(I,J),J=1,360) ! writes the v component to file.</span></font></p><p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IREC=IREC+1<br></span></font></p>

<p style="margin-left: 33.75pt; text-indent: -27.75pt;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><span>115<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">CONTINUE</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"></span></font><br>since rec is a pointer to record file, when you use &quot;I&quot; as a pointer (rec=I) in the write, actually you rewind your file to rec=1 and start over until rec=191, overwritting the old field (U).<br>
<br><div class="gmail_quote">On Wed, Mar 19, 2008 at 10:31 AM, Brad Navarro &lt;<a href="mailto:brad.navarro@wni.com">brad.navarro@wni.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">









<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Greetings,</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Despite my persistent efforts, I cannot seem to solve this
particular problem. Perhaps someone out there will know how. I have generated a
binary file with U and V wind components for only one level and timestamp, and
I have provided the piece of code that writes this data to file:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO 110
I=1,191</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
write(16,rec=I) (Ux(I,J),J=1,360)&nbsp; ! writes the u component to file</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; 110&nbsp;&nbsp;&nbsp; CONTINUE</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DO 115 I=1,191</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
write(16,rec=I) (Vy(I,J),J=1,360) ! writes the v component to file.</span></font></p>

<p style="margin-left: 33.75pt; text-indent: -27.75pt;"><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"><span>115<font face="Times New Roman" size="1"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></span></span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">CONTINUE</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">So, in essence, each component is written for each latitude,
I, and for each longitude, J, at 1 degree intervals. So my control file then
looks like this:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">DSET&nbsp; /home/bradn/WINDVERIF/TEST/windcompgridded.dat</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">TITLE&nbsp; Qscat 10m wind</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">UNDEF&nbsp; -0.9999E4</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">XDEF 360 LINEAR 0 1</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">YDEF 181 LINEAR -90 1</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">ZDEF 1 LEVELS 1 1</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">TDEF 1 LINEAR 15Z17JUN07 3hr</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">VARS 2</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;u 0 99 u component</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;v 0 99 v component</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">ENDVARS</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">However, when trying to plot the U component, it looks as if
GrADS uses the V data in the binary file as the U data, and then gives me this
error message when trying to plot the V component:</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Low Level I/O Error:&nbsp; Read error on data file</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; Data file name =
/home/bradn/WINDVERIF/TEST/DIR/windcompgridded.dat</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; Error reading 360 bytes at location 68760</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Data Request Error:&nbsp; Error for variable &#39;v&#39;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; Error ocurred at column 1</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">DISPLAY error:&nbsp; Invalid expression</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp; Expression = v</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">Anyone have any ideas what I might be doing wrong? Any help
would be much appreciated.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">&nbsp;</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Thanks,</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Brad</span></font></p>

</div>

</div>


</blockquote></div><br><br clear="all"><br>-- <br>============================================================<br>Ricardo Marcelo da Silva<br>LAMMA - Laboratório de Modelagem de Processos Marinhos e Atmosféricos<br>Depto de Meteorologia - Instituto de Geociências <br>
Centro de Ciências Matemáticas e da Natureza<br>Universidade Federal do Rio de Janeiro<br>e-mail: <a href="mailto:ricardom@acd.ufrj.br">ricardom@acd.ufrj.br</a> <br>phone: 55 21 2598-9470 r 24<br>============================================================