Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(vector), | intent(in) | :: | vector1 | |||
type(vector), | intent(in) | :: | vector2 | |||
logical, | intent(inout) | :: | areSame | |||
real(kind=r64), | intent(in) | :: | tolerance |
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 CompareTwoVectors(vector1,vector2,areSame,tolerance)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN February 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine will provide the ability to compare two vectors (e.g. surface normals)
! to be the same within a specified tolerance.
! METHODOLOGY EMPLOYED:
! compare each element (x,y,z)
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
TYPE(vector), INTENT(IN) :: vector1 ! standard vector
TYPE(vector), INTENT(IN) :: vector2 ! standard vector
LOGICAL, INTENT(INOUT) :: areSame ! true if the two vectors are the same within specified tolerance
REAL(r64), INTENT(IN) :: tolerance ! specified tolerance
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! na
areSame=.true.
IF (ABS(vector1%x-vector2%x) > tolerance) areSame=.false.
IF (ABS(vector1%y-vector2%y) > tolerance) areSame=.false.
IF (ABS(vector1%z-vector2%z) > tolerance) areSame=.false.
RETURN
END SUBROUTINE CompareTwoVectors