- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Using latest intel fortran composer for linux (12.0.1)
When I use a component 's name of derived type as a procedure name
it will give internal compiler error instead of warning this mistake example:
type my_type
real :: alfa
contains
procedure :: alfa=> set_alfa
end my_type
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12.0.1 is far from the latest. There have been 6 more updates. Current is 12.1.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The example you provide is incomplete and gets many valid syntax errors, even in 12.0. Can you show a real example that demonstrates the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using 12.1.0
I was just trying to show the error.
Here is a piece from my code.
use element_map_module
TYPE, extends(elementmap):: element_parameters
integer :: n_elements
logical :: default_pars
character(len=3),dimension(:),allocatable :: element_symbol
integer,dimension(:),allocatable,private :: pm_ !for short range
END TYPE element_parameters
TYPE ,extends(element_parameters) :: bond_parameters real(8),dimension(:),allocatable,private :: cs_ ,cl_ ! tersoff short range cutoff
real(8) :: cs
END TYPE bond_parameters
TYPE,extends(bond_parameters) :: carbon_parameters
real(8):: pacc, plamcc !additional pair-wise term
END TYPE carbon_parameters
TYPE,extends(carbon_parameters):: parameters
contains
procedure:: cs => get_cs
end type parameters
function get_cs(this) result(iostat)
class(parameters) :: this
integer :: iostat=0
end function
procedure name cs points to function get_cs
there is another real variable as a component of base type of parameters type.
Intuitively compiler supposed to give a syntax error but doesn't ...
instead it gives internal compiler error without stating any lines..
dundar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If in your code snip function get_cs is in the same body of code (IOW part of a module) then you need CONTAINS in front of the function (true, an appropriate error message should have pointed this out).
What is the scope (contex) at which point in your code the"use element_map_module" resides?
(PROGRAM, FUNCTION, SUBROUTINE, MODULE, ...)
Whae is the scope (contex) at which point in your code the"function get_cs(this) result(iostat)" resides?
Jim Dempsey
What is the scope (contex) at which point in your code the"use element_map_module" resides?
(PROGRAM, FUNCTION, SUBROUTINE, MODULE, ...)
Whae is the scope (contex) at which point in your code the"function get_cs(this) result(iostat)" resides?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dundar has provided me with a test case and I can reproduce the problem. It has to do with a reference to a generic, type-bound procedure, though there are obviously some other aspects as well.

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