Well, I did hear from the gfortran people... Immediately after I sent my message to the bb.

So sorry about the post (the error had never occurred on all previous compilers).

Fred.
--- Begin Message ---
On Mon, Nov 02, 2009 at 05:58:09PM +0100, Vellieux Frederic wrote:
> Dear gfortran developers,
> 
> I have a problem with writing to direct access files using gfortran (get 
> a run time error, "Fortran runtime error: Record number not allowed for 
> sequential access data transfer").
> 
> The error does not occur with code compiled using g77.
> 
> I am enclosing herewith a small program that gives this error.
> 

The code is non-conforming.  From the Fortran 2003 Standard.

9.5.1.11 REC= specifier in a data transfer statement

The REC= specifier specifies the number of the record that is to be
read or written.  This specifier may appear only in an input/output
statement that specifies a unit connected for direct access; ...

      PROGRAM TOTO
      IREC=1
      ISIZ1=1870
      OPEN(UNIT=23,ACCESS='SEQUENTIAL',STATUS='SCRATCH',
     .     FORM='UNFORMATTED',RECL=ISIZ1)
      WRITE(23,REC=IREC) IREC
      END

Your code clearly specifies SEQUENTIAL access, so gfortran
reports the error.  Change SEQUENTIAL to DIRECT.



-- 
Steve



--- End Message ---

Reply via email to