diff options
| author | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
|---|---|---|
| committer | stainer_t <thomas.stainer@oecd-nea.org> | 2025-09-08 13:48:49 +0200 |
| commit | 7dfcc480ba1e19bd3232349fc733caef94034292 (patch) | |
| tree | 03ee104eb8846d5cc1a981d267687a729185d3f3 /Dragon/src/XDDCOM.f | |
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Dragon/src/XDDCOM.f')
| -rw-r--r-- | Dragon/src/XDDCOM.f | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Dragon/src/XDDCOM.f b/Dragon/src/XDDCOM.f new file mode 100644 index 0000000..1817db5 --- /dev/null +++ b/Dragon/src/XDDCOM.f @@ -0,0 +1,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 |
