Can a Fortran subroutine use polymorphism to do something like this:
subroutine (inarr)
class(*) :: inarr
select type(input)
type is (real, allocatable(:))
! do something for 1-D array, maybe even allocate it
type is (real, allocatable(:,:))
! do something for 1-D array, maybe even allocate it
type is etc.
The syntax in the above is, of course, not going to work. But I figure that what I am wanting to do is clear. Any way to do it?
2