This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Gfortran bug?


Hello,

I try to read big_endian files with gfortran (see below the version I use)

The three different methods don't work:
-fconvert=big-endian in the command line
export GFORTRAN_CONVERT_UNIT='big_endian;native:11' convert='big_endian' in the open statement


for example ,in the file ess_bin.f90

program ess
real*4 xlon(6232)
open(11,file='lont42r_b',form='unformatted')
read(11)xlon
print*,'xlon'
print 1000,(xlon(i),i=1,10)
open(12,file='lont42r',convert='big_endian',form='unformatted')
read(12)xlon
print*,'xlon big'
print 1000,(xlon(i),i=1,10)
1000 format((10f8.2)) stop
end


=> gfortran ess_bin.f90
=> a.out
xlon
18.00 36.00 54.00 72.00 90.00 108.00 126.00 144.00 162.00 180.00
At line 8 of file ess_bin.f90
Fortran runtime error: Invalid argument


I try to read a longitude file :

-rw-r--r-- 1 tyteca udc 24936 déc 1 2005 lont42r : it is the big_endian file
-rw-r--r-- 1 tyteca udc 24936 oct 16 09:53 lont42r_b : it is the same file but swaped (little endian file)


my version of gfortran
=> gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /home/tob/projects/gcc/configure --enable-languages=c,fortran --prefix=/projects/tob/gcc-trunk
Thread model: posix
gcc version 4.2.0 20061013 (experimental)


my computer
=> uname -a
Linux lxudc2 2.6.12-24mdk #1 Mon Jul 17 12:35:38 MDT 2006 x86_64 AMD Athlon(tm) 64 Processor 3500+ unknown GNU/Linux


May-be, I make an error...

thank you for your help
Sophie


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]