[J3] [EXTERNAL] Re: Limitations of SELECT RANK?
ondrej at certik.us
Tue Oct 20 15:29:25 EDT 2020
On Tue, Oct 20, 2020, at 1:23 PM, Bill Long via J3 wrote:
> Or, using the proposed template syntax:
> template subroutine add(b1, b2, b3)
> real,intent(inout) :: b1(..)
> real,intent(in) :: b2(..)
> real,intent(in) :: b3(..)
> b1 = b1 + b2 + b3
> end subroutine add
> The compiler would generate an actual routine with a mangled name and
> based on the rank and bounds of the actual arguments at the CALL site.
> (And, in this case, likely inline the result.)
I agree and as a user I would like to write code like this. And this is the ideal we should strive for in Fortran: natural, simple syntax and very efficient compiled code.
P.S. I proposed something similar here using the @ syntax (as a simplification of other proposals there):
but your proposal is even better for this particular case (no need for the @ syntax).
More information about the J3