Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 6/7/83; site hao.UUCP
Path: utzoo!linus!decvax!harpo!seismo!hao!woods
From: woods@hao.UUCP (Greg Woods)
Newsgroups: net.lang.f77
Subject: Re: strange statements
Message-ID: <845@hao.UUCP>
Date: Sun, 12-Feb-84 17:16:20 EST
Article-I.D.: hao.845
Posted: Sun Feb 12 17:16:20 1984
Date-Received: Wed, 15-Feb-84 06:08:54 EST
References: <1947@mcnc.UUCP>
Organization: High Altitude Obs./NCAR, Boulder CO
Lines: 36


  I have converted many FORTRAN programs from a hacked-to-run-on-UNIX version
of DEC FORTRAN running on our 11/70 to our VAX 750's running 4.2 and f77.

"ACCEPT" should be changed to "READ(5," , and "TYPE" should be changed to
"WRITE(6," to have the same effect as the original program. ENCODE and
DECODE should be changed to internal file WRITE's or READ's respectively.
This is a tiny bit more complicated than changing ACCEPTs to READs, though,
since only CHARACTER variables are allowed to be internal files in f77.
Examples follow. I am assuming 4 bytes/integer word, but the conversion
is trivial for other word sizes.

    OLD                                |  NEW
    ---                                |  ---
                                       |
    dimension label(4)                 |   character*16 label
                                       |
    .....                              |   ......
                                       |
    encode(16,100,label) var1,var2,..  |   write(label,100) var1,var2,..
                                       |
    .....                              |   ......
                                       |
    decode(16,label,100) var1,var2,..  |   read(label,100) var1,var2,..
                                       |

  Hope someone finds this useful. BTW, I am writing a document on porting
FORTRAN programs from DEC FORTRAN to f77 for our users here. I'd be glad to
post a copy of it to the net when I finish it if there is interest, but I
don't know how long that would be. I'm pretty busy these days and haven't
had much time to work on it.

	       Greg "FORTRAN hacker" Woods
-- 
{ucbvax!hplabs | allegra!nbires | decvax!stcvax | harpo!seismo | ihnp4!stcvax}
       		        !hao!woods