summaryrefslogtreecommitdiff
path: root/Dragon/src/XDDCOM.f
blob: 1817db5e0c3036bd88d9ef4363a26505feac0e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
*DECK XDDCOM
      FUNCTION XDDCOM(DBLE1,DBLE2,DEPS)
*
*-----------------------------------------------------------------------
*
*Purpose:
* To compare two double precision values.
*
*Copyright:
* Copyright (C) 2002 Ecole Polytechnique de Montreal
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
*Author(s): R. Le Tellier.
*
*Parameters: input
* DBLE1   first double precision value.
* DBLE2   second double precision value.
* DEPS    comparison criterion.
*
*Parameters: output
* XDDCOM  comparison flag.
*
*-----------------------------------------------------------------------
      IMPLICIT NONE
*----
*  SUBROUTINE ARGUMENTS
*----
      DOUBLE PRECISION DBLE1,DBLE2,DEPS
      LOGICAL XDDCOM
*----
*  LOCAL VARIABLES
*----
      DOUBLE PRECISION DLIM,DIFF
*
      DLIM=DEPS*1.D-3
      IF (ABS(DBLE1).GT.DLIM) THEN
         DIFF=(DBLE2/DBLE1-1.D0)
         XDDCOM=(ABS(DIFF).LT.DEPS)
      ELSE
         XDDCOM=(ABS(DBLE2).LT.DLIM)
      ENDIF
*
      END