Re: reading more data than the record size (RECL)




"ssheriff" <ssheriff3@xxxxxxxxx> wrote in message news:10ce0b89-bfea-4147-b9bf-41bc37eb685c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am trying to recompile some old .for code with g95. The binary runs
fine, but I need to make the arrays larger. When I compile (g95 -o
a.exe b.for) the program runs until it gags on reading an
'unformatted' file:

here's the code:

open(unit=12, file=zbot_file, form='unformatted', status='old')
call read_write(0, 12, id, ny, nx, y0, dy, x0, dx, zbot)
***
subroutine read_write(mode, lun, id, ncol, nrow, col1, delcol,
&row1, delrow, array)
dimension array(1), work(1000)
character id*56
character pgm*8
read(unit=lun) id, pgm, ncol, nrow, nz, col1, delcol, row1,
delrow

The last line above is the one for which it says:

UNIT 12 "100USGS.grd " Fortran runtime error: Reading more data
than the record size (RECL)

The record length, in another program that transforms files, appears
to be 128, and I tried that with recl=128, but get the same messages.

Any tips on how to get around this?

TIA

I'm not familiar with g95 but as you say "old code" the statement
"dimension array(1),.." might be the problem. It was an old way to
handle assumed size arrays. A change to "array(*) ..." may be worth
to try.

Kurt

.



Relevant Pages

  • Re: How do I click on a row on a form and launch new form for that
    ... I guess I have some reading to do, ... New customers will have zero invoices, ... customers could have between 1 and 100 or more invoices. ... I know how to work with arrays, ...
    (microsoft.public.access.forms)
  • working with images as byte[] arrays
    ... I am working with some images as bytearrays and am not sure nor can ... I figure out if as I am reading the image and saving smaller sub- ... Bitmap tempbitmap; ... output of the 16x16 sub image so results can be seen ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: delimited data into nested array
    ... > Perl as a two dimensional nested array. ... Do you have a good reason for reading the file into an array ... If you'd still like to use the arrays, read up on perllol and use this: ... This whole loop was condensed above by using join, $\, and that handy ...
    (comp.lang.perl.misc)
  • Re: How to read a data file which the No. of Lines is unknown reviously?
    ... After reading it the first time you will know how many ... you can read data into the arrays. ... If reading a file twice takes too much time, ... disapproves of this use of pointers. ...
    (comp.lang.fortran)
  • Re: gfortran & adjustable array: most values remain zero
    ... Indeed I expected that adjustable arrays would work in 2D the same ... adjustable arrays of more than one dimension should be generally avoided ... the actual and dummy arrays don't ...
    (comp.lang.fortran)

Loading