problem plotting u,v winds from binary file
Ricardo Marcelo
ricardom at ACD.UFRJ.BR
Wed Mar 19 09:49:23 EDT 2008
Use this:
INTEGER IREC
IREC=1
DO 110 I=1,191
write(16,rec=IREC) (Ux(I,J),J=1,360) ! writes the u component
to file
IREC=IREC+1
110 CONTINUE
DO 115 I=1,191
write(16,rec=I) (Vy(I,J),J=1,360) ! writes the v component to
file.
IREC=IREC+1
115 CONTINUE
since rec is a pointer to record file, when you use "I" 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).
On Wed, Mar 19, 2008 at 10:31 AM, Brad Navarro <brad.navarro at wni.com> wrote:
> Greetings,
>
>
>
> 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:
>
>
>
> DO 110 I=1,191
>
> write(16,rec=I) (Ux(I,J),J=1,360) ! writes the u component
> to file
>
> 110 CONTINUE
>
>
>
> DO 115 I=1,191
>
> write(16,rec=I) (Vy(I,J),J=1,360) ! writes the v component to
> file.
>
> 115 CONTINUE
>
>
>
> 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:
>
>
>
> DSET /home/bradn/WINDVERIF/TEST/windcompgridded.dat
>
> TITLE Qscat 10m wind
>
> UNDEF -0.9999E4
>
> XDEF 360 LINEAR 0 1
>
> YDEF 181 LINEAR -90 1
>
> ZDEF 1 LEVELS 1 1
>
> TDEF 1 LINEAR 15Z17JUN07 3hr
>
> VARS 2
>
> u 0 99 u component
>
> v 0 99 v component
>
> ENDVARS
>
>
>
>
>
> 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:
>
>
>
> Low Level I/O Error: Read error on data file
>
> Data file name = /home/bradn/WINDVERIF/TEST/DIR/windcompgridded.dat
>
> Error reading 360 bytes at location 68760
>
> Data Request Error: Error for variable 'v'
>
> Error ocurred at column 1
>
> DISPLAY error: Invalid expression
>
> Expression = v
>
>
>
> Anyone have any ideas what I might be doing wrong? Any help would be much
> appreciated.
>
>
>
> Thanks,
>
> Brad
>
--
============================================================
Ricardo Marcelo da Silva
LAMMA - Laboratório de Modelagem de Processos Marinhos e Atmosféricos
Depto de Meteorologia - Instituto de Geociências
Centro de Ciências Matemáticas e da Natureza
Universidade Federal do Rio de Janeiro
e-mail: ricardom at acd.ufrj.br
phone: 55 21 2598-9470 r 24
============================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080319/a7a527e1/attachment.html
More information about the gradsusr
mailing list