<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi everybody,</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm trying to create binary files for GrADS with
Fortran:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2> PARAMETER
(NDY=16,NDX=116)</FONT></DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2> REAL
U(NDY,NDX)<BR> REAL V(NDY,NDX)<BR>...</FONT></DIV>
<DIV><FONT face=Arial size=2>C Reading from files:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> do 2
i=1,NDY<BR> read(3,*)
(U(i,k),k=1,NDX)<BR>
read(4,*) (V(i,k),k=1,NDX)<BR>2 continue</FONT></DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2>C Writing on standard output to
test:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> WRITE (*,*) 'U
variables:'<BR> WRITE (*,*)
((U(K,L),L=1,NDX),K=1,NDY)<BR> WRITE (*,*)
' '<BR> WRITE (*,*) 'V
variables:'<BR> WRITE (*,*)
((V(K,L),L=1,NDX),K=1,NDY)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>C Writing binary files:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> OPEN
(7,FILE='uv_uhiX1.dat' ,FORM='UNFORMATTED',<BR>
&ACCESS='DIRECT',RECL=NDY*NDX)</FONT></DIV>
<DIV><FONT face=Arial size=2>C For Linux pgf77 just change the last row
in:</FONT></DIV>
<DIV><FONT face=Arial size=2>C
&ACCESS='DIRECT',RECL=NDY*NDX*4)</FONT></DIV>
<DIV><FONT face=Arial size=2><BR> WRITE (7,REC=1)
((U(K,L),L=1,NDX),K=1,NDY)<BR> WRITE (7,REC=2)
((V(K,L),L=1,NDX),K=1,NDY)<BR>
CLOSE(7)</FONT></DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2>and ctl file songs like:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> dset
^uv_uhiX1.dat
<BR> title Prova<BR> undef
1e+20<BR> xdef 16
linear 1.206897
2.413793
<BR> ydef 116
linear 1.031250
2.062500 <BR> zdef 1 levels
0<BR> tdef 1 linear 0Z2jan1987
1dy<BR> vars 2<BR> u 1
33,100 Eastward wind [m/s]<BR> v 1 34,100 Northward wind
[m/s]<BR> endvars</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I compiled with Visual Fortran: OK</FONT></DIV>
<DIV><FONT face=Arial size=2>Built .exe: OK</FONT></DIV>
<DIV><FONT face=Arial size=2>Verified Standard output and file existence:
OK</FONT></DIV>
<DIV><FONT face=Arial size=2>Tested the same command :</FONT></DIV>
<DIV><FONT face=Arial size=2> OPEN
(7,FILE='uv_uhiX1.dat' ,FORM='UNFORMATTED',<BR>
&ACCESS='DIRECT',RECL=NDY*NDX)</FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2></FONT></DIV><FONT face=Arial
size=2> WRITE (7,REC=1)
((U(K,L),L=1,NDX),K=1,NDY)<BR> WRITE
(7,REC=2) ((V(K,L),L=1,NDX),K=1,NDY)<BR>
CLOSE(7)</FONT></DIV>
<DIV><FONT face=Arial size=2>: OK for smaller matrices and manual
initialization</FONT></DIV>
<DIV><FONT face=Arial size=2>for U and V(!!!)</FONT></DIV>
<DIV><FONT face=Arial size=2>Tested ctl structure: OK</FONT></DIV>
<DIV><FONT face=Arial size=2>But when I type "open uv_uhiX1.ctl" I
get:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Scanning description file:
uv_uhiX1.ctl</FONT></DIV>
<DIV><FONT face=Arial size=2>Open Error: Unexpected EOF reading
variables</FONT></DIV>
<DIV><FONT face=Arial size=2>Was expecting 2 records. Found 0.</FONT></DIV>
<DIV><FONT face=Arial size=2> The data file was not opened.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I don't know why I get this messsage, since I used
the same</FONT></DIV>
<DIV><FONT face=Arial size=2>fortran code (but initializing variables not from
file but in Fortran itself!!!).</FONT></DIV>
<DIV><FONT face=Arial size=2>Moreover, I can see in standard output correct
values for my variables </FONT></DIV>
<DIV><FONT face=Arial size=2>(even if some of them have exponential notation,
others fixed notation)</FONT></DIV>
<DIV><FONT face=Arial size=2>Have you ever had my problem?</FONT></DIV>
<DIV><FONT face=Arial size=2>Thank you in advance</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Andrea Storto</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT></BODY></HTML>