- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Greeting:
i've got a file whichis 1440*720*4 bytes, and the size ofwhich is 3.95MB.
i make the codes as follows:
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!
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
You will have to figure out what to change here - I don't know your application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!:)
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!:)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page