Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CloseOutOpenFiles
! SUBROUTINE INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN April 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine scans potential unit numbers and closes
! any that are still open.
! METHODOLOGY EMPLOYED:
! Use INQUIRE to determine if file is open.
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxUnitNumber = 1000
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: exists, opened
INTEGER :: UnitNumber
INTEGER :: ios
DO UnitNumber = 1, MaxUnitNumber
INQUIRE (UNIT = UnitNumber, EXIST = exists, OPENED = opened, IOSTAT = ios)
IF (exists .and. opened .and. ios == 0) CLOSE(UnitNumber)
END DO
RETURN
END SUBROUTINE CloseOutOpenFiles