Hi Moez,

 

adding “use plplot” to your program is the only requirement. The other module, plf95demolib, merely makes a number of auxiliary routines availalble.

 

One of the things that is different between F77 and F95 is the use of assumed-shape arrays wherever possible. The advantages over the F77 form are:

-        Less arguments

-        Less chance of getting the size of the array wrong

 

That said, plline and plpoin in the F95 bindings have the signature:

 

call plline( x, y )

call plpoin( x, y, code )

 

whereas with the F77 bindings you had:

 

call plline( n, x, y )

call plpoin( n, x, y, code )

 

(n the number of points to plot)

 

The F95 form requires that the arrays x and y are array whose size is known, either:

 

real x(n)

real x(:)     ! Note that an asterisk declares an assumed-size array, where the size information is not available directly

 

or in the call:

 

call plline( x(1:n), y(1:n) )  ! Just an example

 

Do you use assumed-size arrays? Then the simplest way out is probably to use the “real x(n)” form, as you need to know the size of the useable part of the array anyhow. There are other possibilities too, see below.

 

(Side note on the evolving language standard: array expressions are helpful to the compiler as it is easier to determine all manner of optimisations, such as vector instructions and parallellisations. In that respect new features in the language standard are very useful. But it is up to the programmer to use these features or not.)

 

What follows is - for the moment – thinking out loud, others will have to agree on this.

 

If you want to help out with the maintenance, we would welcome that. One thing I can imagine is a “transition module”, making it easier for people to move from the F77 to the F95 bindings. I do not think we really want to go back to maintaining two separate bindings, however. The transition module I am thinking of could implement the now deprecated F77 API as follows:

 

module plplot_f77

    use plplot

    implicit none

    interface plline

        module procedure plline_f77

    end interface

contains

subroutine plline_f77( n, x, y )

     integer :: n

     real(kind=plflt), dimension(n) :: x, y

 

     call plline( x, y )

end subroutine plline

end module

 

This way you use the module plplot_f77 instead of plplot – that being the only (!) change to your programs, and you get the old-style F77 bindings back. This module would provide an additional set of interfaces, but the main code is still based on F95, so that we have only one code base instead of two.

 

While typing this, I thought of one problem you may encounter. Code like (not uncommon in F77 code):

 

real x(10), y(10)

call plline( 9, x(2), y(2) )

 

would lead to protest from the compiler – x(2) and y(2) are scalars, whereas the routine expects arrays. Such code would have to be changed to:

 

real x(10), y(10)

call plline( 9, x(2:), y(2:) )

 

to instruct the compiler to use the proper array sections.

 

Regards,

 

Arjen

 

 

From: Moez Kilani [mailto:moez.kilani@gmail.com]
Sent: Sunday, December 29, 2013 11:54 PM
To: Arjen Markus
Subject: Re: [Plplot-general] fortran 77

 

Many thank for the answer Arjen,

Indeed I have started using plplot three years ago.
I have written some packages for my computations but
wasn't aware that you have stopped support for the language.

My focus is on the computation itself, not on the programming language.
My interest in fortran 77 is its simple syntax and constructs.
I know that modern languages have lot new and sophisticated
features, but I don't agree to the continuous changes in the standards.

I am trying to write a simple code with fortran 95 bindings, without success for
the moment. Precisely, I use this compilation command

gfortran -o file file.f `pkg-config --cflags --libs plplotd-f95`

and the compiler complains that for

"plline"  and   "plpoin"

there is no specific subroutine for the generic ... at ..

Also in the example programs the module

use plf95demolib

is used, but cannot see how to install it.

Last, I definitely thing that maintaining support for fortran 77 is worthwhile and would give some
of my time to help the development team. Is that possible ?

Regards and best wishes for 2014 !

Moez





 


 

2013/12/27 Arjen Markus <Arjen.Markus@deltares.nl>

Hello Moez,

 

support for FORTRAN 77 has been deprecated for a coupe of years now. The reason for this is twofold:

-        All Fortran compilers we know of support Fortran 90/95 and later. So we decided to put our limited resources into the newer standards. The newer standards have a large number of advantages in comparison to FORTRAN 77, such as the use of arrays and array sections and checking the argument lists against the definition. This greatly reduces the number of mistakes you can make.

-        When this was announced several years ago, we did not receive any complaints.

 

Could you explain in some detail what makes you use FORTRAN 77, instead of FORTRAN 95 or newer? There may be a relatively simple path to using the F95 bindings – you can still use most F77 constructs with an F95 compiler (with the exception of some very old features, F95 is a “superset” of F77, though most compilers will still support all of F77). You would only have to learn a few basic things regarding F95 to continue using PLplot.

 

Regards,

 

Arjen

 

 

From: Moez Kilani [mailto:moez.kilani@gmail.com]
Sent: Friday, December 27, 2013 1:04 PM
To: plplot_general
Subject: [Plplot-general] fortran 77

 

Dear developers,

I no longer find the source code for the examples in  fortran 77 !
this is my favourite language and I am wondering if will be removed from the list supported languages in plplot !

Moez

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.

 

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.