[Beowulf] Fortran is Awesome
gus at ldeo.columbia.edu
Thu Nov 29 12:04:33 PST 2018
On Thu, Nov 29, 2018 at 10:52 AM mark somers <m.somers at chem.leidenuniv.nl>
> Try this:
> program test
> implicit none
> real, dimension(2,2,2,2,2,2,2,2,2,2,2,2,2) :: Array1
Hmmm ... with rank > 7?
My recollection is that 7 is the maximum (at least up to Fortran 95, maybe
2003, not sure afterwards).
But there are relatively simple workarounds using one-dimensional arrays
and index arithmetic,
to get as many dimensions as one needs.
Keeping arrays in contiguous memory is a good thing, and Fortran compilers
normally do this.
Since Fortran90, the "Matlab-like" notation for array sections, etc, the
allocatable arrays, etc, simplified and made array computations very
efficient (obviating nested loops, etc),
and (array) dynamic memory allocation very easy.
Modules made code organization much cleaner.
For the O-O afficcionados, operator and procedure overlays, structures,
The features abound, most are simple to use.
I still miss a good Fortran90-to-2008 book, where the features come to life
in clean examples.
Metcalf's book is OK to learn legal syntax, but it is terse and very poor
in practical examples.
Here we do Earth Sciences: lots of Fortran code in
Atmospheric/Ocean/Climate, Seismology, Geodynamics,
etc, many codes in public domain, many being currently developed and
code that is not going away any time soon.
I'd guess the Astrophysics, Computational Chemistry, Fluid Dynamics,
Electrical Engineering, etc, are in similar situation,
inheriting a huge mostly high quality Fortran code base.
Students unfortunately have been evangelized to put all their eggs in the
often times narrowed to Jupyter Notebooks (with religious blind faith on
it), conda/anaconda, and so on.
Nothing agains Python; all against narrow thinking that puts fashion ahead
Students used to be fluent in Matlab (/Octave) up to a few years ago, which
enabled them to pick up Fortran more
easily. That's no longer so.
However, they would benefit a lot of a basic knowledge of Fortran, along
basic elements of data structures, structured programming -
sounds old? still very useful, and sorely missed -
rudiments of O-O programming, and insights of good programming style.
That all can be bundled in a Numerical Analysis/Numerical Modeling type of
course, as it was already mentioned.
Minimally this would make them able to read, understand, modify, and verify
the codes they may use for their
> Array1 = 0.0
> print *, "hello world", Array1
> end program test
> mark somers
> tel: +31715274437
> mail: m.somers at chem.leidenuniv.nl
> web: https://www.universiteitleiden.nl/en/staffmembers/mark-somers
> Beowulf mailing list, Beowulf at beowulf.org sponsored by Penguin Computing
> To change your subscription (digest mode or unsubscribe) visit
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beowulf