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

problem between severe<36> & severe<67>

newbiubiu
Beginner
657 Views
Greeting:

i've got a file whichis 1440*720*4 bytes, and the size ofwhich is 3.95MB.
i make the codes as follows:

integer,parameter:: nx=1440,ny=720

real,dimension(nx*ny,4)::week

integer::i,j,k

open(1,file='f15_19991218v6',form='unformatted',access='direct',action='read',recl=nx*ny)

do i=1,4

read(1,rec=i)week(:,i)

enddo

then itwill make an error: sever<36>: attempt to access non-existent record

while replacing the 'recl=nx*ny/4' (or nx*ny/2), or make a recl switch to make it 'USE bytes as recl' , it will make an error as :sever<67>: input statement requires to much data

it might due to mine understanding of RECL, butthanks toanyone who can fix it!
thx very much!

0 Kudos
2 Replies
Steven_L_Intel1
Employee
657 Views
You have declared your array to be 1440 * 720 * 4 elements, which is 4,147,200 elements. If each was a REAL, that would be 16,588,800 bytes, or four times the size of the actual file. If the file were 1440*720 elements, then the RECL you have would be correct. However, the program is trying to read four times as much data as is in the file, hence the error 36.

You will have to figure out what to change here - I don't know your application.
0 Kudos
newbiubiu
Beginner
657 Views
thank u Steve!
i'vegot the detail and changed the array declared by 1440*720,and it worked.
i think i have a good grasp of the rules.
thanks agian!:)
0 Kudos
Reply