Hi Arjen:

I just spotted something of interest in the gfortran-4.4.5 documentation
with respect to command-line parsing and the Fortran 2003 standard.

To review the current status of Fortran command-line parsing,
bindings/f95/configurable.f90 uses iargc and getarg to parse the
command line.  These two routines are gfortran extensions to be
backwards compatible with the g77 compiler and most other Fortran
compilers.  However, iargc and getarg apparently were never part of
any standard, and the implementation sometimes sucks for some
platforms.  (As can be seen by the problems on Cygwin with them, and
the fact that they only work in static libraries for the Windows
case.)

Furthermore, the gfortran documentation (from the "info
gfortran" command on Linux) says the following:

This intrinsic [iargc] routine is provided for backwards compatibility with
GNU Fortran 77.  In new code, programmers should consider the use
of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
Fortran 2003 standard.

and

This intrinsic [getarg] routine is provided for backwards compatibility with
GNU Fortran 77.  In new code, programmers should consider the use
of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
Fortran 2003 standard.

If you follow the above info note links,
gfortran-4.4.5 implements both COMMAND_ARGUMENT_COUNT and
GET_COMMAND_ARGUMENT. Since that version of gfortran is far from
cutting edge, I think we can guarantee COMMAND_ARGUMENT_COUNT and
GET_COMMAND_ARGUMENT will be available on reasonably modern Linux
distros and also available on Mac OS X (for those who have installed
gfortran there).

So here is the key question:

Are COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT also available on ifort
and also native Windows Fortran compilers?

If your tests show that is true, then I think we should update
configurable.f90 to use those routines since they are in the Fortran
2003 standard (unlike iargc and getarg).

I think that "in the Fortran 2003 standard" argument is already enough
motivation for making the switch.  However, I am also hoping the
standards-compliant COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT
routines will be properly implemented on Windows so it will no longer
be necessary to always place configurable.f90 in a static library on that
platform even when the rest of the Fortran libraries are shared.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to