On Thu, Mar 8, 2018 at 11:32 AM, Bill Long <[log in to unmask]> wrote:
> Interface bodies are separate scoping units. This allows names of dummy arguments (for example) to not conflict with names in the surrounding host. Insert an IMPORT statement to bring iarr into the interface.
> ..
Bill,
Ordinarily with INTERFACEs, yes. But given it's a MODULE FUNCTION
here, iarr should become accessible via host association and IMPORT
statement should not apply.
Regards,
Vipul Parekh<div class="gmail_extra"><br><div class="gmail_quote">On
Thu, Mar 8, 2018 at 11:32 AM, Bill Long <span dir="ltr"><<a
href="mailto:[log in to unmask]"
target="_blank">[log in to unmask]</a>></span> wrote:<br><blockquote
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">Interface bodies are separate scoping
units. This allows names of dummy arguments (for example) to not
conflict with names in the surrounding host. Insert an IMPORT
statement to bring iarr into the interface.<br>
<br>
> On Mar 8, 2018, at 10:06 AM, Anton Shterenlikht <<a
href="mailto:[log in to unmask]">[log in to unmask]</a>>
wrote:<br>
><br>
> module m<br>
> implicit none<br>
> integer, parameter :: iarr = selected_int_kind( 8 )<br>
> interface<br>
> integer( kind=iarr ) module function f( space )<br>
<br>
import iarr ! Add this statement and
the compilers should accept the code.<br>
<br>
> ! module function f( space )<br>
> integer( kind=iarr ), intent(in), allocatable ::
space(:,:,:) [:,:,:]<br>
> ! integer( kind=iarr ) :: f<br>
> end function f<br>
> end interface<br>
> end module m<br>
<br>
Cheers,<br>
Bill<br>
<br>
Bill Long
<a
href="mailto:[log in to unmask]">[log in to unmask]</a><br>
Principal Engineer, Fortran Technical Support &
voice: <a href="tel:651-605-9024"
value="+16516059024">651-605-9024</a><br>
Bioinformatics Software Development
fax: <a
href="tel:651-605-9143" value="+16516059143">651-605-9143</a><br>
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington,
MN 55425<br>
</blockquote></div><br></div>
|