low level I/O error

Douglas Clark dbcl at CEH.AC.UK
Fri Apr 3 04:25:15 EDT 2009


Roop,

It looks as if you are writing 264 values from FORTRAN (i.e.
gpcp_ave(1:264)), but the ctl file has nx=13, ny=11,nt=264, instead of
nx=ny=1.

Some other points:

* form='unformatted' creates a sequential access file by default (I
think - check your file size and if it appears to be 8B larger than
expected you've probably got a sequuential file with start and end of
record values), in which case you need
an "options sequential" record in your ctl file
(see under control file at
http://grads.iges.org/grads/gadoc/gadocindex.html ).
Personally I'd specify access='direct' in the FORTRAN to create a
direct access file, which makes the file structure marginally simpler
and avoids the need for the ctl file "options" stuff. Indeed I have just
seen under the documentation for "options sequential" that
"If your gridded data is written in sequential format, then each record
must be an X-Y varying grid"

whereas you currently write all times to a single record. Looks as if
it would be easier to go for direct access FORTRAN output!

Doug




>>> roop_saini at STUDENT.UML.EDU 02/04/2009 19:58 >>>
Hi,

I am getting the following error beyond t=169:

Low Level I/O Error: Read  error on data file
Data File name = boxave_gpcp.r4
Error reading 13 bytes at location 24180
Data Request Error: Error for variable 'gpcp'
Error occurred at column 1
Display error: Invalid expression
Expression = gpcp

I am using GrADS 1.9.0-rc1 on a PC.

My control file looks like:

dset ^boxave_gpcp.r4
undef -99999.0
title GPCP data
xdef 13 linear 71.25 2.5
ydef 11 linear 6.25 2.5
tdef 264 linear Jan1960 1mo
zdef 01 levels 1
vars 1
gpcp 0 99 monsoon onset GPCP
endvars

I am trying to average "precipitation" over a certain area.

In case, you would like to know what my Fortran program looks like:

       Program Box Average

       parameter(nx=144)
       parameter(ny=72)
       parameter(nt=264)
!       parameter(nlon=13)
!       parameter(nlat=11)
       parameter(lon1=30)
       parameter(lon2=42)
       parameter(lat1=39)
       parameter(lat2=49)
       parameter(undef=-99999.0)

       integer ix
       integer iy
       integer it

       real gpcp(nx,ny,nt)
       real gpcp_ave(nt)
       real count(nt)

       open(13,file="anomaly_gpcp.r4",form="unformatted",
     & recl=nx*ny*nt*4)
       read(13,rec=1)gpcp

       do it=1,nt

             count(it)=0.0
             gpcp_ave(it)=0.0

       enddo

       do ix=lon1,lon2
         do iy=lat1,lat2
           do it=1,nt

             if(gpcp(ix,iy,it).ne.undef) then

             gpcp_ave(it)=gpcp_ave(it)+gpcp(ix,iy,it)
             count(it)=count(it)+1.0

             endif

           enddo
         enddo
       enddo

       do it=1,nt

           gpcp_ave(it)=gpcp_ave(it)/count(it)

       enddo

       open(24,file="boxave_gpcp.r4",form="unformatted",
     &  recl=nt*4)
       write(24,rec=1)gpcp_ave

       write(*,*)"Completed GPCP Box Average"

       stop
       end

Can anyone help me as to what is the problem?

Thanks,
Roop.

--
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.



More information about the gradsusr mailing list