Software Archive
Read-only legacy content
17060 Discussions

Dummy arguements & host association

Deleted_U_Intel
Employee
598 Views
Problem occurs when Host is a sub-program. A variable that is a (Host) dummy argument, does not seem to be available to internat procedures. eg:

SUBROUTINE ADAPTIVE( nEin) ! external procedure called from the main

integer nEin, nEQ

nEQ = nEin

call internal()

nEin cannot be accessed in internal, but can access nEQ. Is this correct behaviour ? If so, what is the reason ?

While not a big problem in the example above, it is not so nice when nEin is a very large (multi-MB) array (ie. need two of them).

Alternate is to pass nEin as an argument; ie. call internal (nEin),

But the compiler does not seem to like this if have a derived-type in place of nEin; eg call internal (EQ)

where TYPE(eqRec) EQ(nEQ)

Compiler reports that the actual & dummy arguments are not of the same type (despite identical definitions of eqRec ).

I found after trialling several options that including

TYPE(eqRec) EQ(nEQ)

in the internal without re-declaring "eqRec" (in the internal) does work. This means that "eqRec" (but not EQ) is available to the internal procedure.

Maybe I have not studied the manual hard enough, but I found no
documentation of these features / behaviours. Is this how it supposed to be ?

David
0 Kudos
1 Reply
Steven_L_Intel1
Employee
598 Views
A real example would help - I can guess at some of what you mean, but without seeing a small but complete example, it's very difficult to know what you're seeing and what might be wrong. It's not clear to me that what I think of as an "internal" routine is what you mean by it.

Steve
0 Kudos
Reply