- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I compile this with
Intel Fortran Compiler XE for applications running on IA-32, Version 12.1.1.256 Build 20111011
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
ntel Fortran Compiler XE for applications running on IA-32, Version 12.1.1.256 Build 20111011Copyright (C) 1985-2011 Intel Corporation. All rights reserved.FOR NON-COMMERCIAL USE ONLYI receive this error:
catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for istanbul_module_003.f90 (code 1)
suspecting problem with generic type binding statement...
dundar.
----------------------------------
module ankara type afyon
real(8) , dimension (:) , private, allocatable :: sandikli_
contains
procedure , private :: get_sandikli
procedure , private :: set_sandikli
generic :: sandikli => get_sandikli , set_sandikli
end type
contains
function get_sandikli(this,i,j) result (dat)
class(afyon) :: this
integer :: i , j
real(8) :: dat
dat =0.0
! function definitions operates on private array sandikli_
end function get_sandikli
function set_sandikli(i,dat)
!similar to get function
....
! function definitions operates on array sandikli_
end function set_sandikli
end function set_sandikli
end module ankara
another file....
module istanbul
use module ankara
type kusura
real(8) :: dumy
type(afyon) :: sokak
end type
contains
function update_sandikli(this)
class(kusura) :: this
real(8) :: value
value=sokak%sandikli(i,j)
end function
end module istanbul
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I could not reproduce your error. Look at my test below:
[fortran]MODULE point_class IMPLICIT NONE ! TYPE, public :: point PRIVATE integer, dimension(:), allocatable :: xx CONTAINS procedure, private :: initialization_sub procedure, private :: get_fn generic :: every => initialization_sub, get_fn END TYPE point ! private :: initialization_sub private :: get_fn ! CONTAINS ! subroutine initialization_sub(this, x) implicit none class(point) :: this integer, dimension(:), intent(IN) :: x integer :: istat if ( .NOT. allocated(this%xx) ) then allocate( this%xx(1:size(x)), STAT=istat ) if ( istat /= 0 ) stop 'can not ALLOCATE this%xx' this%xx(1:size(x)) = x(:) end if return end subroutine initialization_sub ! ! !DEC$ ATTRIBUTES FORCEINLINE :: get_fn ELEMENTAL integer function get_fn(this, i) RESULT(res) implicit none class(point), intent(IN) :: this integer, intent(IN) :: i res = this%xx(i) return end function get_fn ! END MODULE point_class ! ! ! ! PROGRAM main USE point_class IMPLICIT NONE type :: another integer :: yy type(point), dimension(:), allocatable :: pp end type another type(point) :: p type(another) :: a integer :: i, j, istat, int_array(3) ! call p%every( (/1, 2, 4, 5, 7, 8/) ) write( *, * ) ( p%every(i), i=1,6 ) ! allocate( a%pp(1:3), STAT=istat ) if ( istat /= 0 ) stop 'can not ALLOCATE a%pp' do i = 1, 3 int_array = (/ 1, 2, 3 /) call a%pp(i)%every( int_array(:)*i ) write( *, * ) ( a%pp(i)%every(j), j=1,3 ) end do ! END PROGRAM main [/fortran]
You should be a bitattentive with a nested derived type.
I use
ifort -V
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.3.174 Build 20110309
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
Oleg.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you please attach the actual source file you are using, rather than a fragment and paraphrase? What you show here has too many syntax and other errors. Also please show us the switches you are using on the ifort line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have started a private thread and attached all my source codes.
Thanks Steve.
Dundar.

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