Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(polyhedron) | :: | Poly | ||||
real(kind=r64), | intent(out) | :: | Volume |
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 CalcPolyhedronVolume(Poly,Volume)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN June 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine provides the volume calculation for a polyhedron
! (i.e. Zone).
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! Conversations with Bill Carroll, LBNL.
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
TYPE (polyhedron) :: Poly
real(r64), INTENT(OUT) :: Volume
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
TYPE (vector) :: p0=vector(0.0d0,0.0d0,0.0d0)
TYPE (vector) :: p3FaceOrigin
INTEGER :: NFace
real(r64) PyramidVolume
Volume=0.0d0
DO NFace=1,Poly%NumSurfaceFaces
p3FaceOrigin=Poly%SurfaceFace(NFace)%FacePoints(2)
PyramidVolume=Poly%SurfaceFace(NFace)%NewellAreaVector .dot. (p3FaceOrigin - p0)
Volume=Volume+PyramidVolume/3.d0
ENDDO
RETURN
END SUBROUTINE CalcPolyhedronVolume