On 2011-10-26 08:51+0200 Arjen Markus wrote:

> Hi Alan,
>
> I have reworked example x01 with this [using higher-level aspects of
> Fortran 95] in mind. Some more changes are
> possible, but what do you think of it? The implied do-loops to get
> data into the arrays are perhaps a bit overdone, but that is where I
> want your opinion about.

Hi Arjen:

I have looked at what you have done, and I think it is already much
better, but I would suggest some further change.  For reference
here is what you already do in the revised plot3 routine:


    x = (/ ( 3.6_plflt * (i-1), i = 1,size(x) ) /)
    y = sin( x * PI/180.0_plflt )


One suggestion is to change that first statement to the cleaner looking

    x = 3.6_plflt * range


where you declare at the start of plot3 (subject to my shaky Fortran 95 syntax)

integer, parameter :: md = 101
real(plflt), dimension(1:md) :: range=(/(j,j=0,md-1)/), x, y

I take my inspiration from examples/python/xw01.py where we have

     x = 3.6*arange(101)
     y = sin((pi/180.)*x)

in plot3.  The numpy arange function is used lots of places in the
python examples to keep them clean looking so you _might_ want to locate
all of those instances and replace with an initialized range array as
above for the corresponding Fortran 95 examples.

However, that is a lot of declarations of range arrays of various
sizes scattered through the f95 examples so another possible idea is
to implement an actual Fortran 95 arange function that does the same
thing as the numpy arange function, and use a module (say an examples
module that is accessible to all Fortran 95 examples that need the
arange function) to avoid repetitive declarations of that function.
This assumes it is possible with Fortran 95 to implement a function
that returns an array with a dynamic size that is the value of the
argument just like numpy does with its arange function.  Is that idea
possible or is Fortran 95 fundamentally more limited than numpy in
this regard?

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
__________________________

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to