[R] Problem with writeBin and importing into gfortran compiled programs

Berend Hasselman bhh at xs4all.nl
Thu Jan 7 21:29:23 CET 2010



jgarcia-2 wrote:
> 
> f90 part
> ------------
> PROGRAM foo
> INTEGER, PARAMETER :: DP = KIND(1.0D0)
> INTEGER :: status
> REAL(DP), DIMENSION(10,100) :: whini
> OPEN(UNIT=5, FILE='fwhini.dat', STATUS='OLD', ACTION='READ', &
>      FORM='UNFORMATTED', IOSTAT=status)
> READ(5) whini
> CLOSE(5)
> WRITE(*,*) whini
> END PROGRAM
> 

I am browsing in the Gfortran 4.3.0 manual.
On page 13 there is a mention of a record marker in unformatted files.
It could be that the fortran read is expecting a record marker every so many
bytes.
writeBin most likely has not written  any record marker.

In Fortran 2003  there is a new specifier ACCESS='STREAM'  (similar to Lahey
Fortran ACCESS='TRANSPARENT')(see page 23 of said manual) which will allow
reading files with no record structure.

Berend
-- 
View this message in context: http://n4.nabble.com/Problem-with-writeBin-and-importing-into-gfortran-compiled-programs-tp1009121p1009211.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list