Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

About ifort real size:

haibuihoang
Beginner
880 Views
I am using ifort 9.1.032 on Fedora core 5.
I have a little program that write data to grads file as below:

!------------t.f90

real*4 out (201,161)

open (1, file='t.dat',form='unformatted', access='direct', &
recl=201*161*4)

! Get the data...
write(1,rec=1) out

! Get the data...
write(1,rec=2) out
!----------------------------

Now, the t.dat size should be: 201*161*4*2=258888 (B)
When I compile the file t.f90 with pgf90, it's OK. But when I compile with ifort

ifort -w90 t.f90

The result file t.dat's size is 4 times bigger: 1035552 (B)
Of course, it will not be displayed correctly in grads. Please tell me how to fix it!
Many Regards
0 Kudos
1 Reply
haibuihoang
Beginner
880 Views
Problem solved!

The RECL unit in IFORT is Longword by default (4 byte)
I need to add this to the compiler option:
-assume byterecl
0 Kudos
Reply