About Fortrans program and a *.ctl in Linux systems

Davide Sacchetti davide.sacchetti at ARPAL.ORG
Mon Jan 21 13:13:28 EST 2008


it looks like a problem of hidden <LF> or <CR>
i.e.: ctl file transferred from windows to linux by ftp with option
binary.
In case this was the problem try to rewrite the ctl by hand
otherwise ... no ideas ...
bye bye
Davide


On Mon, 2008-01-21 at 12:31 -0500, Jim Bao wrote:
> Hi,
>    Thanks, while use recl=4*33*17, it is working now; but while open
> *.ctl, i meet some problem.  Following is detail,
>    ga-> open /home/z3bao/dat1/dat2/test_a.ctl
>    Scanning description file:  /home/z3bao/dat1/dat2/test_a.ctl
>    Open Error:  Looking for ENDVARS statement
>               Instead, found:
>    --> The invalid description file record is:
>    --> endvars
>
>        Thanks
>
>           Zhenhao
>
>
>
>    The data file was not opened.
>
> Quoting "M.Mahakur" <mmahakur at TROPMET.RES.IN>:
>
> > Try with:
> >
> > recl=4*33*17 instead of 33*17 in your open(2,....    statement.
> >
> > Jim Bao wrote:
> >
> >> Dear GrADS Users,
> >>     I have a data, and want to use GrADS to make a figure. I know
> >> the output has   problem.  But I don't know where is this problem.
> >> Please you help me check it. Thanks a lot!
> >>   Here, attached two files, one is Fortran program in Linux system by
> >> f77,
> >>   the other is *.ctl
> >>
> >>      Best regards
> >>
> >>        Zhenhao
> >>
> >>  File-1
> >>         program rw
> >> cccc
> >>        parameter (m=1, n1=33,n2=17)
> >>        real a(n1,n2,m)
> >>       open(2,file='/home/z3bao/dat1/dat2/read_test',
> >>     1 form='unformatted',
> >>     +      access='direct',recl=33*17)
> >>       open(1, file='/home/z3bao/dat1/dat2/olr_result',
> >>     1  form='formatted')
> >>       do ii=1,m
> >>         do it=1,n2
> >>          do ib=1,n1
> >>           read(1,*) a(ib,it,ii)
> >>           write(6,*) a(ib,it,ii)
> >>          end do
> >>         end do
> >>        end do
> >> cccc   from January 1950 to Sep. 1995 totally 549
> >>        ii=1
> >> cccc    do ii=1,m
> >> cccc        do it=1,n2
> >> ccccc         do ib=1,n1
> >>               write(2,rec=1) ((a(ib,it,ii),ib=1,n1),it=1,n2)
> >> cccccccc      enddo
> >> cccc        enddo
> >> cccc   enddo
> >>        stop
> >>        end
> >>
> >>  file-2
> >> DSET ^/home/z3dat/dat1/dat2/read_test
> >> TITLE Gridded Data
> >> UNDEF -999.0
> >> XDEF 33 linear 80 2.5
> >> YDEF 17 linear 20 2.5
> >> ZDEF  1 levels 700
> >> TDEF  1 linear 00z01apr85 6hr
> >> VARS  1
> >> hgt 1 99 U component
> >> endvars
> >>
>
--
Sacchetti Davide
ARPAL UO3 Centro Meteo Idrologico Regione Liguria - Dir. Scientifica
V.le Brigare Partigiane 2 16121 Genova (I)
tel: +39 010 6437535
mail: davide.sacchetti at arpal.org   web: www.meteoliguria.it



More information about the gradsusr mailing list