Re: Is it time to legitimise REAL*8 etc?



Brian Salter-Duke wrote:
On Sat, 19 Jul 2008 01:30:48 -0700 (PDT), fj <francois.jacq@xxxxxxx> wrote:

On 19 juil, 06:34, Brian Salter-Duke <b_d...@xxxxxxxxxxxxxxxxxxx>
wrote:

On Fri, 18 Jul 2008 20:06:21 -0700, Walter Spector <w6ws_xthiso...@xxxxxxxxxxxxx> wrote:

Brian Salter-Duke wrote:

... I think those people who look after
large scientific codes are mostly trying to add new features while
ensuring they can be compiled with all existing compilers that have been
used previously.

It is now mid-2008. Any modern compiler supports F95, and has for
some years. Some vendors phased out their F77 compilers over 10
years ago. No need to support a seperate F77 compiler as, modulo
a very few minor issues, F77 is a subset of F90.

These code writers have many other responsibilities in
most cases. My own involvement is with a relatively small computational
chemistry code that can either stand alone or interface to GAMESS(US) or
Gaussian. So I see some of the issues from outside but close and some
from a smaller piece of code. I am far too busy to work on upgrading the
code to F90 or more recent. I also think it would cause more problems
than it would solve.

Why would it cause more problems that it would solve?

First, it is highly likely that in doing the upgrade I would introduce
bugs, given that my experience with F77 is so much greater than that of
F90 and more recent.

No : this is wrong. My experience shows (and like you I had a large
experience with F77) that the F95 programming is safer than the F77
one if you apply the F95 style (routines within modules and accessible
only via a USE statement). This is simply because the F95 compilers
are able to check the programming in a much more efficient way.


You could well be right in what you say, but I was not talking about
writing code from scratch. I was talking about rewriting existing code.
Then "if it ain't broke, don't fix it". If it works, any change has the
chance of stopping it working.

Depending on what F90/95 compiler you chose, you might not notice a difference at all. You would likely be able to seemlessly merge F90 and F77 code with few or no problems at all. I do it all the time. This sounds a little like a bit of paranoia.




If you impose in addition F2003 rules (trying to allocate only
allocatable arrays and to use pointer just to point to a memory area
already allocated), then you also avoid most of the bugs connected to
dynamic allocation and, for instance, very difficult to find in C or C+
+ programming.


Second, since my code has to interface with other
codes and they are not likely to move away from f77 for a while, this
would likely introduce bugs or problems. A lot of the code is COMMON
areas in my code being the same as those in say GAMESS.

COMMONs remain available with any FORTRAN version. And the "rules" I
proposed before do not concern data management.


I also find it interesting that when people do decide to write a new
piece of code in my area, they do not choose Fortran. They choose C
and/or C++.

Given the choice of F77 or C++, I would take C++ any day.

But the choice is between F90 or F95 or whatever and C++ as Richard
points out in his comment. Authors are not chosing more recent Fortran
versions for computational chemistry code as far as I can see. They are
doing that for a reason.

The only reason I see is the school ! Young people do not learn
FORTRAN at school anymore. And the C syntax is the norm today (C, C++,
JAVA, C#).


No, the authors of at least two major comp chem codes in C/C++ were well
versed in Fortran 77 to my knowledge.

I did not learn Fortran at uni. It was my 4th language after Mercury
autocode, Elliot autocode and Algol60. I moved over to Fortran because of
the mass of existing code and that remains the situation.


Brian.


W.

--
Brian Salter-Duke Melbourne, Australia
My real address is b_duke(AT)bigpond(DOT)net(DOT)au
Use this for reply or followup
"A good programmer can write Fortran in any language"





--

Gary Scott
mailto:garylscott@sbcglobal dot net

Fortran Library: http://www.fortranlib.com

Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html

If you want to do the impossible, don't hire an expert because he knows it can't be done.

-- Henry Ford
.



Relevant Pages

  • Re: Is it time to legitimise REAL*8 etc?
    ... Some vendors phased out their F77 compilers over 10 ... No need to support a seperate F77 compiler as, ... experience with F77) that the F95 programming is safer than the F77 ... COMMONs remain available with any FORTRAN version. ...
    (comp.lang.fortran)
  • Re: string concatenation
    ... number for source line length - at least in fixed source form. ... everybody here around use f77. ... F95 compilers are available even for free these days. ... You have run into one of the many "features" of Fortran 77 - the old fixed ...
    (comp.lang.fortran)
  • Re: Is it time to legitimise REAL*8 etc?
    ... Some vendors phased out their F77 compilers over 10 ... No need to support a seperate F77 compiler as, ... If you impose in addition F2003 rules (trying to allocate only ... COMMONs remain available with any FORTRAN version. ...
    (comp.lang.fortran)
  • Re: 50th birthday of Fortran
    ... I know very many programming laguages but only Pascal and Fortran have ... Were the advances beyond F77 more academic than truly advantageous? ... about what was wanted in F90. ...
    (comp.lang.fortran)
  • Re: Are there books about C data structures?
    ... I am seriously thinking of getting a Linux machine for hobby programming. ... but most people don't have the major problems getting compilers to work that you do. ... if they are from some other discipline but they know Fortran you should give them Fortran. ... C is not a magic bullet and they have better things to do than learn aother language. ...
    (comp.lang.c)