Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector), | intent(in) | :: | vec_1 | |||
type(vector), | intent(in) | :: | vec_2 |
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 distance(vec_1, vec_2) RESULT(rdistance)
! PURPOSE OF THIS SUBROUTINE:
! This subroutine calculates the distance between two vectors (points in 3D space).
! METHODOLOGY EMPLOYED:
! Standard Function operation
! Dist_Calc=Distance(Vector1,Vector2)
IMPLICIT NONE
! SUBROUTINE ARGUMENT DEFINITIONS:
TYPE (vector), INTENT(IN) :: vec_1, vec_2
REAL(r64) :: rdistance
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: dx, dy, dz
dx=vec_1%x-vec_2%x
dy=vec_1%y-vec_2%y
dz=vec_1%z-vec_2%z
rdistance=sqrt((dx*dx)+(dy*dy)+(dz*dz))
RETURN
END FUNCTION distance