Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cmcl2!lanl!jlg
From: jlg@lanl.gov (Jim Giles)
Newsgroups: comp.lang.fortran
Subject: Re: Fortran versus C for numerical anal
Message-ID: <3963@lanl.gov>
Date: 21 Sep 88 20:03:52 GMT
References: <1475@valhalla.ee.rochester.edu>
Organization: Los Alamos National Laboratory
Lines: 22

From article <1475@valhalla.ee.rochester.edu>, by davis@galaxy.ee.rochester.edu (Al Davis):
> Here is a challenge: write a portable program that does LU decomposition of
> a matrix of arbitrary size, in Fortran.  I believe it can't be done, in a
> straightforward way.  (Read the input, do it, write the result)
> Someone please prove me wrong.

We have a Monte-Carlo particle code that uses dynamic memory.  It is entirely
written in standard Fortran except for the two routines that actually
allocate and free the dynamic memory.  The code has been ported to IBM,
DEC, CDC, and Cray mainframes as well as several other machines.  The
portability problems are limited to differences in file naming conventions
on the various systems and to numerical differences in the hardware.  These
problems would effect porting a code written in _any_ language.

Please note that the C dynamic memory routines _also_ can't be written 
entirely in C.  At some point a call to the system to change the program's
field length (or other memory mapping strategy) must be used.  On any
given system, brk() is usually written in assembly or at least has some
in-line assembly code.

J. Giles
Los Alamos