[AMBER-Developers] updating Fortran files to .F/.F90

From: Tyler Luchko <tluchko.rci.rutgers.edu>
Date: Mon, 10 Oct 2011 15:29:36 -0400

Hello Everyone,

At the last developers meeting I proposed changing our Fortran file
naming scheme from the generic '.f' to using '.F' for fixed format,
pre-processed files, '.F90' for free format, pre-processed files and
'.f' for fixed format files without pre-processing. As a result of this
name change explicit calls to the C pre-processor would be removed and
the compiler's built in pre-processor would automatically be called.

The motivation for this change is:

1) Easier debugging as line numbers refer to the original source file
and not an intermediate.

2) Eliminating intermediate files reduces clutter, disk space and,
possibly, compile time.

3) This is a universal convention (though not part of an official
standard) and has been in use for over a decade by many compilers. If
we choose to move to a different build system (e.g. cmake) this will
also help ease the transition.

Implementing this will modify file names of 740 source files and the
contents of another 30 files (from my last count). To handle this I have
pushed a Perl script, called 'f2F.pl', to the master branch that makes
the changes. It straightforward to run, simply type

perl f2F.pl

and accepts optional flags '-v' (verbose) to explicitly state all
changes when they are made and '-d' (dry-run) to just state the changes
that would be made. It is safe to run this script multiple times.
However, DO NOT run this on a case-insensitive Mac (the default set up)
as changing case of file names generally does not work well.

Note that the script does not change files in any external projects that
we distribute. It also does not touch PMEMD, though this is easily changed.

This update should be no more difficult than a regular commit but ugly
merges can be avoided if development branches merge in the master branch
shortly before the script is applied and then shortly after. After
this, the script can be run on each branch to catch whatever wasn't in
the master branch.

Comments, suggestions, objections?

Tyler

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Oct 10 2011 - 12:30:03 PDT
Custom Search