Hello there!
Is there any smart and elegant way to allocate a variable to have the same dimensions as polymorphic class?
Example:
SUBROUTINE Allocate_Thing(icls,ocls) CLASS(*), DIMENSION(:,:), INTENT(IN) :: icls INTEGER, DIMENSION(:,:), POINTER :: ocls ALLOCATE(ocls, MOLD=icls) (...) END SUBROUTINE
The above snippet doesn't work, obviously, because MOLD does not take polymorphic classes as argument. In this particular case I could use ALLOCATE(ocls(SIZE(icls,1), SIZE(icls,2))), but I would like to have a generic expression, if there is any trick to do so. The reason is that I'm using preprocessor tricks to get this done for many ranks.
Also, when is it planned for Intel Fortran to support assumed rank polymorphic classes?
Thanks in advance!