Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EOF(5) HAS ERROR IN OLD FORTRAN 1

Status
Not open for further replies.

baharengineer

Programmer
Jul 9, 2010
42
IR
hi
i have a program from nasa that writen by fortran IV and one of this line is this instruction:

IF(EOF(5)) 320,30

that this line has error!!!

i compile this program with compaq visual fortran 6.5 that upgrade to 6.6 version...

why this line has error? whether nasa programing wrongly??!!!

how can i correct this? please help me

thanks

i change this line to comment because has error but this cause my output repeat for ever !!!
 
The line you posted has an error: there should be 3 labels in an arithmetic if statement
 
HI

i write this line like continue :

IF(EOF(5)) 320,30,30

and 320 is a label in this sample:
320 CONTINUE
! CALL CALPLT(0.0,0.0,999)
! STOP
END

and 30 is a label :

30 CONTINUE
IF(IY.EQ.3 .OR. IY.EQ.6 .OR. IY.EQ.9) IY=IY+1
.....

now my program has error when i put 3 label for this if instruction

how can i write this instruction(IF(EOF(5)) 320,30) in other way?
 
The error is not because you have 3 labels: it is because EOF is not recognized. How far away is your previous read statement?
 
hi
i read data from file
like this:

C
C READ PROGRAM OPTIONS CARD
C
10 open (unit=1, file='data1.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=100, fmt=901, iostat=rtn)
* M
100 continue
901 FORMAT(A4,6X,A4,6X,A4,6X,A4,6X,A4,6X,A4)
IF(EOF(5)) 320,30
30 CONTINUE
K=0
MODPLOT=.FALSE.
LOTS=.FALSE.
LOT = .FALSE.
POUT = .FALSE.
INPUN=.FALSE.
TRSN = .FALSE.
LTWS = .FALSE.
DO 965 I=1,6
IF(M(I).EQ.4HDECK) K=1
IF(M(I).EQ.4HNAME) K=-1
IF(M(I).EQ.4HMODE) POUT=.TRUE.
IF(M(I).EQ.4HALLM) LOTS=.TRUE.
IF(M(I).EQ.4HALLM) POUT=.TRUE.
IF(M(I).EQ.4HPLOT) LOT=.TRUE.
IF(M(I).EQ.4HPUNC) INPUN=.TRUE.
IF(M(I).EQ.4HTORS) TRSN=.TRUE.
IF(M(I).EQ.4HNLTW) LTWS=.TRUE.
IF(M(I).EQ.4HSHAP) MODPLOT=.TRUE.
965 CONTINUE
IF(K.EQ.0) GO TO 319
C
C IF K = 0 NO INPUT SELECTED
C K = 1 READ IN DECK
C K = -1 READ NAMELIST
C
NPG=0
IF(K.EQ.1) GO TO 20
C READ CHANGES TO PREVIOUS CASE BY NAMELIST INPUT
READ(5,INPUT)
N1=N+1
GO TO 55
C READ INPUT DATA DECK
20 CONTINUE
open (unit=1, file='data2.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=101, fmt=902, iostat=rtn)
* NAME
101 continue
902 FORMAT(I6,4X)
open (unit=1, file='data3.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=102, fmt=903, iostat=rtn)
* (ITLE(I),I=1,10)
102 continue
903 FORMAT(A6)
open (unit=1, file='data4.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=103, fmt=904, iostat=rtn)
* KT
103 continue
open (unit=1, file='data5.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=104, fmt=904, iostat=rtn)
* MOP
104 continue
open (unit=1, file='data6.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=105, fmt=904, iostat=rtn)
* MIP
105 continue
open (unit=1, file='data7.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=106, fmt=904, iostat=rtn)
* KOP
106 continue
open (unit=1, file='data8.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=107, fmt=904, iostat=rtn)
* KIP
107 continue
open (unit=1, file='data9.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=108, fmt=904, iostat=rtn)
* KBETA
108 continue
open (unit=1, file='data10.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=109, fmt=904, iostat=rtn)
* KPSI
109 continue
open (unit=1, file='data11.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=110, fmt=904, iostat=rtn)
* KC
110 continue
904 FORMAT(8F10.0)

open (unit=1, file='data12.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=111, fmt=905, iostat=rtn)
* N
111 continue
open (unit=1, file='data13.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=112, fmt=905, iostat=rtn)
* JHUB
112 continue
905 FORMAT(I5)
open (unit=1, file='data14.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=113, fmt=906, iostat=rtn)
* AZBAR
113 continue
open (unit=1, file='data15.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=114, fmt=906, iostat=rtn)
* TWIST
114 continue
open (unit=1, file='data16.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=115, fmt=906, iostat=rtn)
* BLADES
115 continue
open (unit=1, file='data17.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=116, fmt=906, iostat=rtn)
* CHOFF
116 continue
open (unit=1, file='data18.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=117, fmt=906, iostat=rtn)
* FHOFF
117 continue
open (unit=1, file='data19.txt',
* action='READ', status='OLD', iostat=rtn)
read (unit=1, end=118, fmt=906, iostat=rtn)
* PHOFF
118 continue AND ETC...

this is some line of my code
my complete code is in "please see my code" topic
please help me
i don't enough time ...
thanks
 
You have two inputs: unit 1 and unit 5. Is unit 5 the console? If it is, there is no need to check for EOF.
 
thanks for your answer

at first i input data in fortran prompt window and because input data was very very lot,, i convert program that now i give data to program from some text files.

unit 1 is of instructions for input data from text files.

the if (EOF(5)) is the instruction for before format of program and i think this(EOF(5)) was for that previous input data ...

now what you suggest? what must i do?

thanks
 
i delete the instruction now

i put a stop command in the end of subroutine that print output. now i have a problem

my output are in 10 window from page1 to page 10

but when output are printed , all page of output print from page 1 to 10 and at last, i can show only page 6 - 10 ,

means when printing is stop, i can scroll output to view and i see page 6 until 10 or sometimes some part of page 5

why?
how can i fix this?
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top