home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!rshouman
- From: rshouman@chpc.utexas.edu (Radey Shouman)
- Subject: Re: Low level routines to do logical shifts
- Message-ID: <1992Aug23.202912.26431@chpc.utexas.edu>
- Keywords: lshft,rshft etc.
- Organization: The University of Texas System - CHPC
- References: <1992Aug18.174715.25954@uceng.UC.EDU> <134179@lll-winken.LLNL.GOV>
- Date: Sun, 23 Aug 92 20:29:12 GMT
- Lines: 30
-
- In article <134179@lll-winken.LLNL.GOV> stevep@phoenix.ocf.llnl.gov (Steve J Patenaude) writes:
-
- [...]
-
- >First, to do a <while> loop in Fortran 77, you must use the
- >dreaded -gasp- GOTO!
- >
- >C FORTRAN FOR 'while (foo < finished) foo += incr;'
- >1 IF (FOO .GE. FINISHED) GOTO 2
- > FOO = FOO + INCR
- > GOTO 1
- >C END OF WHILE LOOP
- >2 ...
-
- A somewhat neater (one less statement label) way to do this is to use
- a fortran77 block if:
-
- 1 IF (FOO .LT. FINISHED) THEN
- FOO = FOO + INCR
- GOTO 1
- ENDIF
-
- Of course, for this particular example, a DO loop might well be preferable.
-
-
-
-
-
- --
- Radey Shouman rshouman@chpc.utexas.edu
-