I am trying to use parameterized derived types in a subroutine using an unlimited polymorphic pointer.
Is is possible to use a 'select type' clause for parameterized types?
I've tried something along the following lines but am getting a compilation error. (Syntax error at or near TYPE)
module mod_real
implicit none
type :: type1(k)
integer, kind :: k = 4
real(kind=k) :: val
end type type1
contains
subroutine out(in)
class(*) :: in
select type(in)
type is (type1(4))
print *, 'real(4):', in%val
type is (type1(8))
print *, 'real(8):', in%val
end select
end subroutine out
end module mod_real
program real_test
use mod_real
type(type1(4)) :: p
type(type1(8)) :: p2
p%val = 3.14
p2%val = 3.1456d0
call out(p)
call out(p2)
end program real_test
the lines with "type is (type1(4))" and "type is (type1(8))" are indicated as having incorrect syntax. I am using the Portland Group Fortran compiler (version 13.5-0).