Writing to GrADS using Fortran

Eric DeWeaver deweaver at AOS.WISC.EDU
Wed Apr 20 14:36:17 EDT 2005


Hi Ed,

You have recl=4*109, but I think you should have recl=4.

With recl=4*109 you put

   write(14, rec=i) ie(itime)

and the Fortran code will write one single precision real number, followed
by (I think) 108 zeros to fill out the direct access record.  So in grads
you should see ie(1), followed by 108 zero values, followed by data1(1).

Good luck,

Eric DeWeaver



On Wed, 20 Apr 2005, Ed Blanchard wrote:

> Hi Mark, thanks for your reply, unfortunately I am not getting any results.
>
> I change the fortran code to
>
> open(14,file='scatter.grd',form='unformatted',status='new',access='direct',recl=4*109)
> do itime=1, 109
>   write(14,rec=1+2*(itime-1))  IE(itime)
>   write(14,rec=2+2*(itime-1))  data1(3,itime+391)
> enddo
> close(14)
>
> with the following .ctl file
>
> DSET scatter.grd
> TITLE   HGT
> UNDEF   -99
> TDEF 109 LINEAR 1aug90 1mo
> XDEF 1 LINEAR 1 1
> YDEF 1 LINEAR 1 1
> ZDEF 1 LINEAR 1 1
>
> VARS 2
> IE 1 99 HT data
> data1 1 99 HT data
> ENDVARS
>
> when plotting the data, it only shows IE(1), all others IE(2 to 109) and
> data1(1 to 109) are still 0. Any ideas?
>
> Ed
>



More information about the gradsusr mailing list