Hi Alan,
I see some idiomatic problems with the current solution. For instance these
lines from x01.f90:
- x = xoff + xscale * arange(1_plint,size(x)+1) / real(size(x),plflt)
+ x = xoff + xscale * arange(1_plint,size(x,kind=plint)+1) /
real(size(x,kind=plint),plflt)
y = yoff + yscale * x ** 2_plint
The line to compute x first casts the size of x to a plint kind of integer and
then to a plflt kind of real.
The second argument in arange however uses +1 instead of +1_plint. According to
the rules of promotion that would result in either a plint or a default
integer, depending on the range of both integer types.
>From test_plf95demolib.f90:
+ do i = 1_plint,size(start,kind=plint)
Here we see a perfectly ordinary loop that has been transformed to use plint
instead of default integers.
What is troubling me, now that I see the result, is that the burden is now put
on the Fortran programmer, rather than on the interface. For the real variables
we have no choice: the programmer may have either single- or double-precision
built into the library and the plflt kind helps to distinguish them. In case of
plint however the choice is dictated by the combination of the Fortran and C
compilers.
Instead of putting the kind in the user code, we can also put it in the
interface:
call pladv( 0 ):
interface pladv
module procedure pladv
end interface
subroutine pladv_f( sub )
integer :: sub ! default integer
call c_pladv( int(sub,kind=plint) )
end subroutine
That way our examples and user code will not be affected. It is slightly more
work and less automateable though.
Regards,
Arjen
> -----Original Message-----
> From: Alan W. Irwin [mailto:[email protected]]
> Sent: Tuesday, October 14, 2014 7:03 PM
> To: Arjen Markus
> Cc: PLplot development list
> Subject: RE: [Plplot-devel] Fortran 95 changes in progress
>
> On 2014-10-14 09:32-0000 Arjen Markus wrote:
>
> > Hi Alan,
>
> > I doubt the subset who use the plplot_flt module explicitly will be
> a fraction recognisably larger than zero - we never advertised its use as
> such. A
> workaround like you propose would actually work, but let's see if there is
> any real
> need for it.
>
> OK.
>
> Thanks again for your expert advice on these Fortran changes.
>
> I have now completed all my planned work on Fortran (commit 5e25b5f). Please
> review and test everything I did.
>
> 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
> __________________________
DISCLAIMER: This message is intended exclusively for the addressee(s) and may
contain confidential and privileged information. If you are not the intended
recipient please notify the sender immediately and destroy this message.
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The
Netherlands, Commercial Registration Number 41146461, is not liable in any way
whatsoever for consequences and/or damages resulting from the improper,
incomplete and untimely dispatch, receipt and/or content of this e-mail.
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel