On 2013-11-05 21:34-0000 James Tappin wrote:

> On 30 October 2013 20:46, Andrew Ross <andrewr...@users.sourceforge.net>wrote:
>
>> On Wednesday 30 Oct 2013 13:30:59 Alan W. Irwin wrote:
>>
>>> Note I have used some explicit calculations here, e.g., z'400' ==>
>>> 4*16*16, in the sed script to continue to emphasize the typical
>>> "single-bit-set" nature of these constants and more importantly to be
>>> sure there are no mistakes in such conversions.  Also note these
>>> calculations of initializers are done at compile time rather than run
>>> time and are allowed by Fortran 95 and higher standards.
>>>
>>> I have checked the above commit using FFLAGS='-std=f95 -O1
>>> -fall-intrinsics -Wuninitialized' and the test_diff_psc target, and
>>> all seems to be well with no build warnings, run-time errors, or any
>>> differences between the calculated f95 and C results.
>>>
>>> So I am happy with how we are currently treating global numerical
>>> constants for our f95 bindings and examples.
>>
>> Alan,
>>
>> That sounds like a sensible compromise to maintain standards compliance
>> while
>> keeping the code clear.
>>
>> Andrew
>>
>
> A somewhat belated thought -- at what language standard do expressions like:
> integer, parameter :: i = ISHFTC(1, 1)
> (which we use in many enumerators in gtk-fortran) become a part of the
> standard?

Our current f95 bindings include compilation of
bindings/f95/plplot_parameters.h which contains the line

       integer, parameter :: PL_FCI_MARK = ishft(1,31)

That compiles fine with gfortran -std=f95 on Linux.  So that use of
ishft is allowed for the Fortran 95 standard and later Fortran
standards.  That use of ishft may even be allowed by the Fortran 90
standard, but I haven't checked that because I think that is probably
too old a standard to be concerned about.

Of course, the Plplot code contains no references to ishftc so I
cannot answer your question specifically, but my gut feeling is it
will be treated like ishft, i.e, accepted by the Fortran 95 standard
and later, and possibly the earlier Fortran 90 standard. But to test
that, install MinGW/MSYS and try compiling code where you are
concerned about Fortran standards compliance using gfortran.exe and
the -std=f95 option.

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
__________________________

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to