- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using intel fortran 17.1 and get this compiler error message:
test2.f90(15): error #6516: This attribute specification is not valid for a component definition statement. [TARGET]
the code I am compiling is:
program test2
implicit none
integer, parameter :: rldf = 8 ! default real floating point
! Variables
TYPE DataCurvInfo
real(kind=rldf), dimension(:), ALLOCATABLE :: x, z
real(kind=rldf), dimension(:), ALLOCATABLE, TARGET :: a, b
real(kind=rldf), dimension(:), POINTER :: y
END TYPE
character(len=6) :: rout = 'test2: ', cntr
logical :: local_debug = .true.
! Body of testp
if ( local_debug ) print *,rout,'Enter routine'
print *, 'Hello World'
if ( local_debug ) print *,rout,'Exit routine'
stop
end program test2
My hope is to have the pointer y(i) point to either a(i) or b(i) depending on the situation.
I am unclear what the error the compiler is concerned about. Is there another way to get to having y(i) switch between a(i) and b(i) in the type datacurvinfo?
thanks
scott
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TARGET is an attribute on variables, not types or components. If you make the components POINTER rather than ALLOCATABLE, they will automatically have TARGET. Or just add TARGET as an attribute of the variable declared of type DatCurvInfo.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page