On 2017-12-27 09:02-0000 Arjen Markus wrote:

I am currently catching up with my e-mail (Christmas is a busy time
...), so this is the first opportunity I have found to respond to your
mails. Sure, I will have a look at this. (I even have a generic
solution for this type of programming problem, but it may not be
better than yours ;) - I respond before having seen it.)

Hi Arjen:

I have done some further investigation and it appears that even today
allocatable character arrays are problematic to a certain extent for
Fortran compilers. For example, see
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80945>. I have no clue
whether that particular modern gfortran bug would affect us.  However,
the existence of such bug reports for a modern version of a Fortran
compiler indicates we should proceed with caution with allocatable
character arrays.

Therefore, once we implement allocatable character array variants of
plget_arguments and plparseopts we should survey the modern versions
of gfortran, ifort, and nagfor to see which of those work well with
that API.  Also we will likely want to retain the the current static
assumed shape character arrays API's for those functions for a while
so that users with access only to older Fortran compilers (e.g.,
gfortran-4.9.2) that are unreliable with the allocatable character
array approach have a plget_arguments and plparseopts API that
they can use.

By the way, I am already using this new Fortran parsing feature in one of my
te_gen examples where the command-line has a mixture of PLplot options
and a file name, e.g.,

software@raven> examples/f95/test_asteroids \
-dev psc -o test.psc \
/home/software/time_ephemeris/HEAD/asteroid_ephemerides/ephcom_binary_ast343de430

where that last command-line option (although it could have been
anywhere on the command line) is obviously not relevant to PLplot.
After calling plget_arguments(nargv, argv) to get the nargv and argv
corresponding to that command-line, that example then calls plparseopts(nargv, argv, PL_PARSE_SKIP) which parses all the
command-line options that are relevant to PLplot and removes them from
argv.  The result is plparseopts returns nargv = 1 and argv(1) equal
to the asteroid ephemeris filename specified on the command line.  The
example then opens that ephemeris file and uses it to help calculate
the many asteroid results that are plotted by that example.

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
__________________________

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to