Assumed-shape Array Arguments

    PROGRAM Three_Array_Calls
  
        REAL, DIMENSION(1:10)                 :: F
        REAL, DIMENSION(1:5,51:100)           :: G
        REAL, DIMENSION(-10:10,-10:10,-10:10) :: H

        CALL Three_Arrays(F, G, H)

    ENDPROGRAM Three_Array_Calls


    ! -- flexible SUBROUTINE --- can be used with any rank 1, 2 and 3 arrays :

    SUBROUTINE Three_Arrays(A, B, C)
        REAL, INTENT(INOUT) :: A(:)
        REAL, INTENT(INOUT) :: B(:,:)
        REAL, INTENT(INOUT) :: C(:,:,:)

        !...do something with the arrays A, B and C...

        M = SIZE(B,1)
        N = SIZE(B,2)

        DO I = 1, M 
            DO J = 1, N
  
            !...do more with the arrays A, B and C...
 
            END DO
        END DO

    END SUBROUTINE


...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_course_fortran_90/_reml_grp/index.reml
On: 10/2/2003 at 10:33:52
Options: reml2 -i noindex -l long -o html -p multiple