Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector) | :: | vec |
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.
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.
FUNCTION VecNormalize(vec)
! PURPOSE OF THIS SUBROUTINE:
! This subroutine normalizes the input vector and returns the normalized
! vector
! REFERENCE:
! Graphic Gems.
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
type (vector) VecNormalize
type (vector) vec
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
real(r64) :: veclen
veclen=VecLength(vec)
if (veclen /= 0.0d0) then
VecNormalize%x=vec%x/veclen
VecNormalize%y=vec%y/veclen
VecNormalize%z=vec%z/veclen
else
VecNormalize%x=0.0d0
VecNormalize%y=0.0d0
VecNormalize%z=0.0d0
endif
return
END FUNCTION VecNormalize