replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - ERROR 94 plz help me...very urgent
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ERROR 94 plz help me...very urgent
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
IanLambley



Joined: 17 Dec 2006
Posts: 506
Location: Sunderland

PostPosted: Fri Feb 10, 2012 4:49 pm    Post subject: Reply with quote

What you have to do is locate all occurances of the open and close statements and determine what each is being used for. Then if they are file usage, and they are a unit less than say 10, change them to a higher number. It is best to allocate an integaer variable and transfer it via subroutine call statements or common blocks for example. All read and write statements between these open and close statements should also be made to match the appropriate unit number. Note, read(*,*) and write(*,*) & Print * are probably intended to refer to keyboard and screen respectively.

Basically you need to determine the structure of your program's input/output and adjust the unit numbers.

Note on some very old computers, the unit numbers are assigned to the files and other devices using operating system commands rather than Fortran open and close statements. and example could be:
Code:

program io_example

!include these two lines in all subroutines/functions where reads and writes occur
!also in main program or an initialisation routine to set their values
integer*4 keyboard_unit, Screen_unit, input_file_unit,output_file_unit
common/io_units/ keyboard_unit, Screen_unit,input_file_unit,output_file_unit

!allocate units
keyboard_unit = 5
Screen_unit     = 6
input_file_unit = 10
output_file_unit = 11
.
.
.
call input_routine
call output routine
.
.
end

subroutine input_routine
integer*4 keyboard_unit, Screen_unit, input_file_unit,output_file_unit
common/io_units/ keyboard_unit, Screen_unit,input_file_unit,output_file_unit
common/data/a,b,c
character*256 input,output
!prompt or input file name
write(screen_unit,*)'Input file'
read(keyboard_unit,'(a)')input
!if not blank, then open file
if(input .ne. ' ')then
  open(unit=input_file_unit,file=input,status='unknown')
!read some input data
  read(input_file_unit,*)a,b,c
  close(unit=input_file_unit)
!prompt for output file name
  write(screen_unit,*)'Output file'
  read(keyboard_unit,'(a)')output
!open the file
  open(unit=output_file_unit,file=output,status='unknown')
else
  stop
endif
end



subroutine output_routine
integer*4 keyboard_unit, Screen_unit, input_file_unit,output_file_unit
common/io_units/ keyboard_unit,Screen_unit,input_file_unit,output_file_unit
common/data/a,b,c
write(output_file_unit,*)'Input data'
write(output_file_unit,*)a,b,c
write(output_file_unit,*)'Output data'
write(output_file_unit,*)a+b*c
close(unit=output_file_unit)
end
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group