(j3.2006) Fortran 201x wish: SELECT RANK

Tobias Burnus burnus
Sun Feb 17 16:49:47 EST 2013


Dear all,

using assumed-rank arrays, I missed the possibility to pass an 
assumed-rank dummy argument to a non-assumed-rank dummy argument. I 
think using something like:

SELECT RANK(assumed_rank_dummy)
CASE (3)
call rank_3_sub(assumed_rank_dummy)
END SELECT RANK

would be a useful and simply addition. The implementation effort should 
be rather low and it makes assumed-rank arrays more useful from Fortran 
? currently one has either to use them for this purpose from C or one 
has to use rather clumsy code such as the following, which in addition 
requires the target attribute.

SELECT CASE (rank(assumed_rank_dummy))
CASE (3):
block
type(...), pointer :: fptr
call c_f_pointer (c_loc(assumed_rank_dummy), fptr, &
shape=shape(assumed_rank_dummy))
call rank_3_sub(fptr)
end block
end select case


Tobias



More information about the J3 mailing list