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 -Run time error

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
supramaniam



Joined: 30 Aug 2005
Posts: 11

PostPosted: Sun Sep 11, 2005 11:17 pm    Post subject: Error 94 -Run time error Reply with quote


I have created the following codes:

IMPLICIT REAL*8 (A-H,O-Z)

CHARACTER*16 docing11

common /ycz / g11(100), ng11

print *, 'Enter a length of G1'
read *, ng11
print *, 'Enter G1 file name'
read *, docing11
open (1, file=docing11)
read (1,*) (g11(i) , i=1 , ng11)
close (unit=1)

END


Apparently, it resulted in a run time error of Error 94 - Unit has neither been OPENED nor preconnected.

Please advise how to eliminate the probem

Supramaniam
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Mon Sep 12, 2005 12:48 am    Post subject: Error 94 -Run time error Reply with quote

Your program seems to be OK to me.
You should avoid using the value 1 as the unit number because this used for standard I/O.
You can step through the code using the debugger (or use print statements) to confirm each step as it is executed.

I assume that the error is occuring on the CLOSE statement.
You can check that OPEN has succeeded by using the IOSTAT argument.
In this case the file will be created if it does not exist but there will be no data to read in.
None of this explains the given run time error message.
Back to top
View user's profile Send private message AIM Address
JvO



Joined: 18 Aug 2005
Posts: 15

PostPosted: Wed Sep 14, 2005 10:12 am    Post subject: Error 94 -Run time error Reply with quote

This program works fine, as expected, with me.
Though I would prefer using unit number 11 instaed of 1.

[pre]
! Supr.f95
program Supramaniam
IMPLICIT NONE

CHARACTER(len=16) :: docing11
integer :: i, ng11
double precision :: g11(100)
common / ycz / g11, ng11

print *, 'Enter a length of G1'
read *, ng11
print *, 'Enter G1 file name'
read *, docing11
open (1, file=docing11)
read (1,*) (g11(i) , i=1 , ng11)
close (unit=1)
write(*,"(4es18.4)") g11(1:ng11)

END program Supramaniam

[/pre]

[JvO]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
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