Hi Arjen,

Your simple example failed with the NAG compiler, but worked when I added the 
line (shown in boldface):

        subroutine use_transform( transform )
          import :: xyz
            interface
                subroutine transform( data, result )

I don't know what the standard says on this topic, but I think I would be 
explicit and add the additional import statement so that the user defined data 
type is in scope.

Best regards,
Wadud.

From: Arjen Markus [mailto:arjen.mar...@deltares.nl]
Sent: 09 May 2016 19:50
To: Alan W. Irwin <ir...@beluga.phys.uvic.ca>; Wadud Miah <wadud.m...@nag.co.uk>
Cc: plplot-devel@lists.sourceforge.net
Subject: RE: [Plplot-devel] PLplot Fortran bindings


Hi Wadud,



> -----Original Message-----
> From: Alan W. Irwin [mailto:ir...@beluga.phys.uvic.ca]
>
> Hi Wadud:
>
> Thanks very much for your build test of PLplot using the NAG Fortran compiler.
>
> ... >
> To investigate further why the above logic unexpectedly cannot be compiled 
> with
> the NAG compiler, I strongly suggest you make a small one-file example 
> containing
> a simplified plplot_types module that just defines private_plflt, and plcGrid 
> exactly
> like we do, and which also contains another module that includes the above
> subroutine transform.
> Then if that vastly simplified example also fails to compile you have that 
> example to
> take to the NAG developers concerning a possible bug in their compiler.  Or 
> they
> may respond to your report by saying something like this: "to get that Fortran
> standards compliant code to compile with the NAG compiler, you need xxx flag".
>

I prepared a small example (see below) that is generously accepted by the two 
compilers I have access to. I think it exhibits the characteristics of the code 
that is not accepted by the NAG compiler. The only difference that may be 
important is the fact that it does not contain the ISO_C_BINDING features. If 
this small example is accepted, then I would say it is indeed a problem in the 
NAG compiler.

The alternative is that the example is not accepted and that the NAG compiler 
doesn't like the import through the nesting of interfaces. I would not think 
that the example is non-standard, but there can be subtleties that I am 
overlooking here. That is why it is important to see what the NAG compiler 
comes up with.

Regards,

Arjen

! nested_interface.f90 --

!     Attempt to reproduce a problem discovered by Wadud Miah

!

module my_types

    implicit none



    type xyz

        integer :: x, y, z

    end type xyz

end module my_types



module my_interfaces

    use my_types



    implicit none



    interface

        subroutine use_transform( transform )

            interface

                subroutine transform( data, result )

                    import :: xyz

                    type(xyz) :: data

                    real      :: result

                end subroutine transform

            end interface

        end subroutine use_transform

    end interface

end module my_interfaces
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.
________________________________________________________________________
This e-mail has been scanned for all viruses by Star.
________________________________________________________________________
________________________________

The Numerical Algorithms Group Ltd is a company registered in England and Wales 
with company number 1249803. The registered office is:

Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.



This e-mail has been scanned for all viruses by Microsoft Office 365.

________________________________
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to