Subroutine "arguments"??



subroutine sub(A)
real(8), intent(in) :: A(10,10)
...
end subroutine

call sub(B) ! where B is a matrix B(10,10)

A is a matrix. I known that the passing actual arguments to dummy
arguments is by passing the address of actual arguments. But I want to
ask that it is passing only the address of A(1,1) or all the address
of A(1,1),A(1,2).....A(10,10)?

And if A or B is a derived type argument, is it also pass by the
address? (There is a problem is that derived type argument has
discontinus memory, I'm not sure)

.



Relevant Pages

  • Derived type name as a dummy argument - possible?
    ... but passing a derived type name as a dummy argument does not ... Objective is to have a generic subroutine that can be used for different ...
    (comp.lang.fortran)
  • Re: Subroutine "arguments"??
    ... arguments is by passing the address of actual arguments. ... implementation details at that level. ... discontinus memory, I'm not sure) ... There is nothing unusual about derived type arguments in this ...
    (comp.lang.fortran)
  • Re: Derived type name as a dummy argument - possible?
    ... Dan Nagle wrote: ... but passing a derived type name as a dummy argument does not ... data structures without having to modify the generic subroutine. ...
    (comp.lang.fortran)
  • Re: null terminated strings
    ... a call to those in a subroutine. ... The compiler will then insure that you're passing the proper data type. ... I'm having trouble thinking of the few times that I passed something to a routine, and had the routine treat it as another type of data. ... Passing the address of an AST handler routine when setting up an AST timer routine was interesting. ...
    (comp.os.vms)
  • Re: Does the order of declarations matter?
    ... >> subroutine sub ... >No, these are two different types of arguments - IIRC, one is assumed-size ... passing it as a separate argument. ... an explicit interface is always safer. ...
    (comp.lang.fortran)