Re: Fortran assumed-shape array problems with MPI



Jane Smith wrote:

Hi, I am using fortran 90 (PGI) with MPI (mpif90) and I faced a
situation that a scalar argument is passed to the subroutine that
declares the dummy argument as 4-dimensional assumed-shape array.

(snip)

Does anybody know a practical solution to this problem other than
just not using the assumed-shape array (making it all explicit-shaped
by passing the bounds together) ?

Passing a scalar variable (or constant) to an array dummy is
not standard in any version of Fortran, though it is
likely to work except in the assumed shape case.
(Assumed shape arrays are normally passed by descriptor.)

Passing an array element to an assumed size or explicit shape
dummy is legal, where the called routine can reference any array
element from the one specified to the end of the array.

I would say assign to a one element 4-D array and pass that instead.
(and copy back on return).

-- glen

.



Relevant Pages

  • Re: Caveat: Can One Dim Local Arrays Using Argument List Integers ??
    ... much time at all to find at least one example of an array that was not ... k is passed and used (as the dummy named n) ... make the actual and dummy declarations done the same way, ...
    (comp.lang.fortran)
  • Re: Display Array
    ... 'noentry', ... Informix will try to go to that field and provided its the last field ... > Subject: Re: Display Array ... > The normal way in Old 4GL was to have a dummy 'noenty' column at the ...
    (comp.databases.informix)
  • Re: declaring array arguments in subroutines
    ... from passing the array section actual argument) if not an outright plus. ... array to the calling routine, whilst F90 behaviour would be caused by Y ... dummy, and passing Xalso gives me a Ydummy. ...
    (comp.lang.fortran)
  • Re: Assumed-size arrays and intent(out)
    ... Our coding style standard says that an intent ... attribute must be provided for every dummy argument in new code. ... "undefining" parts of the Residuals array other than ... size dummy and passing an array element, you get sequence association, ...
    (comp.lang.fortran)
  • Re: Pointers and Modules
    ... > confused about target dummy arguments. ... TARGET attribute but is not an array section with a vector subscript ...
    (comp.lang.fortran)