|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
pban92
Joined: 23 Nov 2009 Posts: 38
|
Posted: Mon Dec 21, 2009 8:21 pm Post subject: fatal 52 - compilation abondoned compilation failed |
|
|
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 |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Mon Dec 21, 2009 9:41 pm Post subject: |
|
|
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 |
|
|
pban92
Joined: 23 Nov 2009 Posts: 38
|
Posted: Mon Dec 21, 2009 9:53 pm Post subject: |
|
|
Thanks John! I know it was wrong but well...thanks again! |
|
Back to top |
|
|
|
|
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
|