what rationale?

what rationale?

One cannot use the fucntion SIZE with assumed size arrays which terribly annoying. The proper replacement for these are assumed shape arrays. That's just fine, but that an explicit interface is ALWAYS required even if the caller and callee are in the same project. If the two are in the same file, one gets a warning that says "explicit to assumed shape is a bad idea" .

What is the reationale for having the explicit interface, when the interface is right there in the subroutine?
Alt. what do we gain w. assumed shapes, if we're freed from passing the array size for redimensioning but then have the more elaborate requirment of a whole interface block?

Thanks in adv,
TimH

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The Fortran language is defined as an independent compilation model. There is no concept of "peeking" into another program unit in the same source file. If you used CONTAINed or MODULE procedures, you wouldn't have this problem, as the interfaces would be visible.

Steve

Steve - Intel Developer Support

Explicit interfaces normally aren't achieved via INTERFACE blocks, but rather through USE association. Typically a subroutine that requires an explicit interface is placed inside a MODULE and that MODULE is USEd in the calling program unit.

Assumed shape arrays aren't always the best thing in terms of performance. You may want to simply pass the shape information along with the array as subroutine arguments as done in many math packages such as LAPACK.

Leave a Comment

Please sign in to add a comment. Not a member? Join today