[comp.sys.amiga] FORTRAN Recommendations

u800552@lanl.gov (James R. White) (06/03/90)

Mark (hubey@pilot.njin.net (Hubey @ NJ InterCampus Network,
      New Brunswick, N.J.) writes

> I might have to compile some large FORTRAN programs on the AMiga.
> Some or all of it might be FORTRAN IV.  I think that FORTRAN 77
> specs support  FORTRAN IV constructs as a subset. I also think that
> there are at least two FORTRAN compilers for the AMiga.

> Am I right? And has anyone had experience with any Amiga FORTRAN
> compilers, especially compiling old FORTRAN IV code ??


I have used the Absoft Fortran 77 compiler with some
success, and I now use it for almost 90% of my own
programming. Like many "old-timers", FORTRAN was my first
computer language, but the language has changed since I
learned it back in '66. The following is a sample subroutine
which many readers familiar with FORTRAN IV or FORTRAN-66
would not even recognize as being FORTRAN:

      subroutine drawfilledbox(mem,fillcolor,plane,BytesPerRow)
      implicit none
      integer*4 mem,fillcolor,plane
      integer*2 BytesPerRow
      integer*4 i,j
      integer*1 value

        do (j=0,99)
            if ((fillcolor .and. shift(1,plane)) <> 0) then
               value = z'ff'
            else
               value = 0
            end if
            do (i=0,19)
              byte(mem+i) = value
            repeat
          mem = mem+BytesPerRow-20
        repeat
      end

I have worked with two programs using the Absoft compiler.
The first was a set of interactive steam table routines
which I got from Idaho National Engineering Laboratory.
These were originally written for a Cyber mainframe, and
given almost any two state properties like temperature and
void fraction, they output all of the other thermodynamic
and heat transport properties including pressure,
temperature, density, enthalpy, entropy, internal energy,
quality, void fraction, heat capacities, viscosity, thermal
conductivities, and critical mass fluxes of both the mixture
as well as the liquid and vapor phases. The original
FORTRAN-66 source code was about 9800 lines of code,
including a free-format input processor. Rewriting the input
routines, taking advantage of the FORTRAN-77 features
reduced the program to approximately 7800 lines of code.
With everything in RAM:, I found that it would compile and
link at a rate of 3000 lines per minute. This makes for a
faster compile-link-execute-debug cycle than C, and the
debugger, while not working properly with include files
would work if all of the files were merged together.

I have considered marketing this program, but the limited
number of people needing water properties plus the marketing
and advertising cost discouraged me. I will probably put the
program in the public domain some day. The only thing
holding me back is the problem of the run time library.

Another application I worked on is a mainframe
thermal-hydraulics code called CONTEMPT-LT. One of my
clients has a contract with the United States Nuclear
Regulatory Commission to convert this program to an IBM-PC,
and is approximately 30,000 lines of code. I took a sample
of this code and compiled it to see what possible
difficulties my client would have in the conversion. As it
was written in "Vanilla" FORTRAN-66 for an IBM mainframe,
and is mostly number-crunching, the conversion appeared to
be straight-forward. The Absoft compiler has an option of
allowing the user to compile under Fortran-66 rules.

I can highly recommend the Absoft FORTRAN-77 compiler. The
Absoft compiler appears to be a full ANSI implementation,
and while it is not without its faults, appears to be very
useful. To the weekend hacker, it allows you enough hooks
into the ROM routines to do most anything worth doing. There
is a vast amount of mainframe software available for the
engineer or scientist who is willing to spend the time to
bring it down to the micro. There are thousands of FORTRAN
programs available through the government. Some of these
programs required over 100 man-years of development effort,
and are over 100,000 lines of code. A recent government
publication list over 1700 titles. (Reference
PB87-143236/BBL, Cost $48.00 available from the U.S.
Department of Commerce, National Technical Information
Service, 5285 Port Royal Road, Springfiled, VA 22161)

My only real complaints about the Absoft compiler is the
#?%$# licence agreement.  If you distribute compiled and
linked programs, you must include a copyright notice on the
first screen.  There are also some constraints on
distributing the compiled software.  As a result, Fred Fish
will not include my compiled goodies in his library, and I
cannot post anything which is linked to the run-time
library.  If you plan to get the Absoft compiler, I
recommend that you request a licence agreement first and see
if you can live with it.

 ________________________________________________________________________
| James R. White                  |  N-6 - The Dukes of Nukes            |
| Los Alamos National Laboratory  | "Running Codes is like walking on    |
| N-6 / MS K559                   |  water - works better when frozen."  |
| Los Alamos, NM  87544           |  U800552@beta.lanl.gov               |
| Phone (505)-667-3853 (Work)     |  QVAX2::JWHITE                       |
| Phone (505)-662-7554 (Home)     |  FTS 843-3853                        |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- 
 James R. (Bob) White            ||  U800552@beta.lanl.gov
 Los Alamos National Laboratory  ||  Phone (505)-667-3853 (Work)
 N-6 / MS K559                   ||  Phone (505)-662-7554 (Home)
 Los Alamos, NM  87544  USA      ||  FTS 843-3853