- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what theselines do:
1- DATA HPOL/6HLINEAR ,5HRIGHT ,4HLEFT/
2- DATA PNET/6H ,2H ,6HSTRAIG,2HHT,6HCROSSE,1HD/
3- WRITE(3,146)
4- READ(2,125)AIN,(COM(I,KCOM),I=1,19) ???!!!there were files opened for read and write!!!???
####################################################
what means UNIT 8 in:
OPEN (UNIT=8,FILE='PLTDAT.DAT',STATUS='UNKNOWN',ERR=14)
####################################################
howthis codecan be written using while, for and standard branch structures???
remarque that there is no THEN or END IF in the previous IF structure
and no END DO in the DO structure
2 KCOM=KCOM+1
IF (KCOM.GT.5) KCOM=5
READ(2,125)AIN,(COM(I,KCOM),I=1,19)
IF(KCOM.GT.1)GO TO 3
WRITE(3,126)
3 WRITE(3,129) (COM(I,KCOM),I=1,19)
IF (AIN.EQ.ATST(11)) GO TO 2
IF (AIN.EQ.ATST(1)) GO TO 4
WRITE(3,130)
STOP
4 CONTINUE
DO 5 I=1,LD
5 ZARRAY(I)=(0.,0.)
MPCNT=0
IMAT=0
##############################################################
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WRITE(3,146) is still standard syntax, should be explained in any Fortan summary of any era. Appends text to the file opened on unit 3, in accordance with a line 146 FORMAT (no variable content here).
For consistency with pre-1977 syntax, many compilers opened files automatically, with a default name containing the unit number, such as fort02 for unit 2. Others depended on shell facilities like assign, specifically meant for Fortran. You would want to add an OPEN.
Changing to block IF looks straightforward
Opinions vary on whether one should attemp to use DO WHILE. A literal translation of what you show:
DO
KCOM = KCOM +1
....
if(ain /= atst(11)exit
END DO
if(ain == atst(11)then
write(3,130)
stop
endif
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page