station data

sh zhou sh.maeam at GMAIL.COM
Sat May 30 23:30:58 EDT 2009


Dear All,

I got a error  when used station data , the error message is as following:
###
ga-> d r
Low Level I/O Error:  Read error on data file
  Data file name = stid.dat
  Error reading 542200117 bytes at location 0
Data Request Error:  Variable is 'r'
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = r
ga->
###
why in "location 0 " read a so huge data ?

Station data is :
###
Year Month Stid Lat    Lon    Rainfall
1980   1   QQQ  34.3    -85.5   123.3
1980   1   RRR  44.2    -84.5   87.1
1980   1   SSS  22.4    -83.5   412.8
1980   1   TTT  33.4    -82.5   23.3
1980   2   QQQ  34.3    -85.5   145.1
1980   2   RRR  44.2    -84.5   871.4
1980   2   SSS  22.4    -83.5   223.1
1980   2   TTT  33.4    -82.5   45.5
###
The fortran code I used is :
###
    PROGRAM for_read_stinfo

    integer    ::    i,j,k, year, month, nflag
    integer, parameter    :: ms = 4, ml = 1, mt = 2
    integer, parameter    ::     nlev =  ml+1
    character(8)    ::     stid(ms)
    real, dimension(ms)    ::    rain, lat, lon
    real    ::    dtime

    nflag = 1
    open(1000, file = 'stid.txt')
    open(2000, file = 'stid.dat', form = 'binary')
    read(1000,*)
    do j = 1, mt
        do i = 1, ms

            read(1000,*) year , month, stid(i), lat(i), lon(i), rain(i)
            write(*,*) year , month, stid(i), lat(i), lon(i), rain(i)

        enddo

        do i =1, ms
            write(2000) stid(i), lat(i), lon(i), dtime, nlev, nflag
        enddo

        write(2000) stid(i), 0.0, 0.0, 0.0, 0, 0

    enddo
    write(2000) stid(i), 0.0, 0.0, 0.0, 0, 0
!    ----------------------------------------------------------------
    END
###
My ".ctl" file is:
###
DSET   stid.dat
*DSET   rain.dat
options sequential
DTYPE  station
STNMAP rain.map
UNDEF  -999.0
TITLE  Station Data Sample
TDEF   2 linear jan1980 1mon
VARS  1
r     0  99  rainfall
ENDVARS
###
Please tell me what mistake I'v made.
Thank you.


Sincerely.
--
Shenghui                Student

HuNan University .  China
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090531/f86ca289/attachment.html 


More information about the gradsusr mailing list