Programme Units, Etc.

cf. Figure 5.1 from Fortran 90/95 explained...

External Procedures/Subprogrammes
Seen these already:
Don't!


Internal Procedures/Subprogrammes
    PROGRAM my_prog                          ! -- A PROGRAM may CONTAIN
      INTEGER :: count                       !    procedures/subprograms
      REAL    :: total

      ...

    CONTAINS
      SUBROUTINE my_int_sub                  ! -- internal SUBROUTINE
        ... 
      END SUBROUTINE my_int_sub
 
      FUNCTION my_int_func                   ! -- internal FUNCTION
        ... 
      END FUNCTION my_int_func
    END PROGRAM my_prog
  
In addition, procedures/subprograms may CONTAIN other (internal) procedures/subprograms :
    SUBROUTINE my_sub                        !...or FUNCTION
      CHARACTER, INTENT(INOUT) :: C

       ... 

    CONTAINS                                  
      FUNCTION my_func                       !...internal FUNCTION (could 
        ...                                  !   be SUBROUTINE also)
      END FUNCTION my_func
    END SUBROUTINE
  


Module Procedures/Subprogrammes



...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