[J3] [EXTERNAL] Re: Limitations of SELECT RANK?

Clune, Thomas L. (GSFC-6101) thomas.l.clune at nasa.gov
Tue Oct 20 18:36:44 EDT 2020




On Oct 20, 2020, at 5:02 PM, Van Snyder via J3 <j3 at mailman.j3-fortran.org<mailto:j3 at mailman.j3-fortran.org>> wrote:

On Tue, 2020-10-20 at 19:23 +0000, 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

If parameterized (or template) modules are done, there's no point to doing parameterized (or template) subroutines.

I found Magne’s arguments to the contrary in Tokyo rather compelling.       But it may well be that we end up only supporting parameters at the module level as a concession to simplicity.   I.e., I agree that module parameters are sufficient (or at least I know of no use case to the contrary), but there are good reasons to consider extended parameters for procedures within such a module.   Unfortunately, I think that the use cases have to be reasonably complicated before this distinction comes into play.


Without parameterized (or template) modules, it's not possible to complete integration of parameterized derived types with type-bound procedures. Parameterized (or template) subroutines do not include definitions of related (parameterized) types.

Yes, parameters on procedures would not be in lieu of parameters on types/modules.


If we had done parameterized modules in 2003, we wouldn't have done parameterized types, or at least not parameterized by kind type parameters, and there wouldn't be a problem with integration of types and type-bound procedures.

Yes.   And this is probably the thing that is going to keep me up at night for the next several years.    Even the vocabulary of “parameters” is horribly polluted and somewhat easy to misconstrue if one had such inclinations.      But I don’t suppose we’ll be given the luxury of deleting the legacy feature in favor of the new generics no matter how easy it would be to update existing applications to the new syntax (whatever it ends up being).


- Tom




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20201020/74bfcef1/attachment.htm>


More information about the J3 mailing list