- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a generic Interface for a set of functions, some of which differ only by one argument having the POINTER attribute, as opposed to having the INTENT(IN) attribute..
under What conditions should the POINTER Function be
called? From what I am seeing, it isn't.
example Code:
INTERFACE WrDbgArray
MODULE PROCEDURE WrReal1dArray
MODULE PROCEDURE WrReal1dPtrArray
MODULE PROCEDURE WrReal2dArray
END INTERFACE
SUBROUTINE WrReal1DArray(name,array, idbg)
CHARACTER(LEN=*), INTENT(IN) :: name
REAL(sdk), DIMENSION(:), INTENT(IN) :: array
INTEGER(sik), INTENT(IN) :: idbg
SUBROUTINE WrReal1DPtrArray(name,array, idbg)
CHARACTER(LEN=*), INTENT(IN) :: name
REAL(sdk), DIMENSION(:), POINTER :: array
INTEGER(sik), INTENT(IN) :: idbg
Should this be a syntax error???
The code using this compiles and runs, but ALWAYS chooses
WrReal1dArray for 1d arrays...
under What conditions should the POINTER Function be
called? From what I am seeing, it isn't.
example Code:
INTERFACE WrDbgArray
MODULE PROCEDURE WrReal1dArray
MODULE PROCEDURE WrReal1dPtrArray
MODULE PROCEDURE WrReal2dArray
END INTERFACE
SUBROUTINE WrReal1DArray(name,array, idbg)
CHARACTER(LEN=*), INTENT(IN) :: name
REAL(sdk), DIMENSION(:), INTENT(IN) :: array
INTEGER(sik), INTENT(IN) :: idbg
SUBROUTINE WrReal1DPtrArray(name,array, idbg)
CHARACTER(LEN=*), INTENT(IN) :: name
REAL(sdk), DIMENSION(:), POINTER :: array
INTEGER(sik), INTENT(IN) :: idbg
Should this be a syntax error???
The code using this compiles and runs, but ALWAYS chooses
WrReal1dArray for 1d arrays...
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What compiler and version are you using? CVF 6.6A disallows this - the generic is ambiguous. Neither POINTER nor INTENT are distinguishing characteristics of a generic procedure.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is CVF 6.6A-
no syntax Error... the files are attached - simplified to minimize dependencies. IntrTypeM.f90 defines portable
INTEGER and REAL types, DebugUtilSimplifiedM.f90 contains
the Generic interface WrDbgArray which has 2 instances each of function for 1 and 2 dimensional integers, 1 and 2 dimensional reals and 1 dimensional Character strings.
no syntax Error... the files are attached - simplified to minimize dependencies. IntrTypeM.f90 defines portable
INTEGER and REAL types, DebugUtilSimplifiedM.f90 contains
the Generic interface WrDbgArray which has 2 instances each of function for 1 and 2 dimensional integers, 1 and 2 dimensional reals and 1 dimensional Character strings.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page