Re: upgrading
- From: "Beliavsky" <beliavsky@xxxxxxx>
- Date: 11 Apr 2007 07:08:55 -0700
On Apr 11, 6:33 am, "Zak" <b.zaryc...@xxxxxxxxxxxxxx> wrote:
Hello all,
I have sizeable numerical code that was originaly written to the f77
standard, It has been rewritten in parts to f90 standard. I have a
mild interest in bringing the code up to f95 standard.
I have a couple of questions
Is this actually worth the bother ?
That depends on the programmer and the code. The question of whether
to use Fortran 77 or later versions of Fortran has been discussed many
times here. Let me tackle the narrower question of whether to use
Fortran 90 or 95.
Most compilers that are actively developed and supported are Fortran
95 compilers, so a lack of compilers is not reason to avoid F95.
The FORALL construct of F95 can be convenient, but it certainly not
essential, and some messages here indicate that ir is rarely used in
production code.
I have not found the ability to declare functions and subroutines PURE
in F95 to be very helpful. It's like programming in a straitjacket,
since one cannot print error messages or terminate the program within
the procedure, if an error occurs.
I *do* find user-defined ELEMENTAL subroutines and especially
functions to be useful. To get the same effect in F90 -- the ability
of a single function to handle arguments of varying ranks -- one would
need to write an INTERFACE with MODULE PROCEDURES and write some
duplicative code within the MODULE PROCEDURES. ELEMENTAL functions are
also PURE, but they have advantages to offset their constraints.
There are some convenient enhancements to the edit descriptors in F95.
CPU_TIME is convenient.
By using strict F95 you will be forced to change DO loops with non-
integer loop variables, which is probably a good thing.
The expanded functionality of ALLOCATABLE arrays in an update to F95
(present in F2003 also) is useful.
To sum up, I'd say use F95 over F90 in new code, but if a code uses
the modern features of F90 and works, I don't think the upside to
adding F95 features is that great. An exception may be replacing
POINTERs with ALLOCATABLE arrays where allowed by extended F95.
If one were to decide to rewrite to f95 standard are there any
programing tools freely available to aid in such a task ? (I use the
emacs editor)
I don't know if a tool is necessary. Just compile with more than one
F95 compiler (gfortran and g95 are free) in strict F95
mode -- for those compilers the option is std=f95.
.
- References:
- upgrading
- From: Zak
- upgrading
- Prev by Date: Re: bindprocessor
- Next by Date: Re: upgrading
- Previous by thread: Re: upgrading
- Next by thread: Re: upgrading
- Index(es):
Relevant Pages
|
|