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 

fatal 52 - compilation abondoned compilation failed

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



Joined: 23 Nov 2009
Posts: 38

PostPosted: Mon Dec 21, 2009 8:21 pm    Post subject: fatal 52 - compilation abondoned compilation failed Reply with quote

Code:
PROGRAM avgvalue
IMPLICIT NONE
INTEGER:: i,n,average, status, sum1
INTEGER, DIMENSION(20) :: x

sum1 = 0
status = 0
n = 20

OPEN (UNIT=3, FILE=file01_set01.txt, STATUS='OLD', ACTION='READ', IOSTAT=status)
OPEN (UNIT=4, FILE=result_file01_set01.txt,STATUS='REPLACE', ACTION='WRITE', IOSTAT=status)

     DO i = 1, n
        READ (3,*,IOSTAT=status) x(i)
   END DO

   DO i = 1,n
         sum1 = sum1 + x(i)
   END DO
       
   average = sum1/n
              
WRITE (4,*) average



CLOSE(3)
CLOSE(4)

STOP
END PROGRAM



Could someone please explain whats wrong with this piece? Many thanks,

pban92

(why the admin did not put add attachment option???)
Back to top
View user's profile Send private message
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Mon Dec 21, 2009 9:41 pm    Post subject: Reply with quote

Code:
OPEN (UNIT=3, FILE="file01_set01.txt", STATUS='OLD', ACTION='READ', IOSTAT=status)
OPEN (UNIT=4, FILE="result_file01_set01.txt",STATUS='REPLACE', ACTION='WRITE', IOSTAT=status)
Back to top
View user's profile Send private message Visit poster's website
pban92



Joined: 23 Nov 2009
Posts: 38

PostPosted: Mon Dec 21, 2009 9:53 pm    Post subject: Reply with quote

Thanks John! I know it was wrong but well...thanks again!
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 -> General 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