summaryrefslogtreecommitdiff
path: root/Donjon/src/DETFIL.f
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Donjon/src/DETFIL.f
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Donjon/src/DETFIL.f')
-rw-r--r--Donjon/src/DETFIL.f45
1 files changed, 45 insertions, 0 deletions
diff --git a/Donjon/src/DETFIL.f b/Donjon/src/DETFIL.f
new file mode 100644
index 0000000..cb4b16c
--- /dev/null
+++ b/Donjon/src/DETFIL.f
@@ -0,0 +1,45 @@
+*DECK DETFIL
+ SUBROUTINE DETFIL(Y,X,XL,TC,DT,N)
+*
+*----------------------------------------------------------------------
+*
+*Purpose:
+* Filters the n values of x vector for TC seconds.
+* Formulations are taken from the expression of the different
+* equation of a filter with a linear variation of x in DT time
+* step.
+*
+*Author(s):
+* xxx
+*
+*Parameters:
+* Y real variables Y(I) at previous time
+* X real variables to filtered
+* XL real variables X(I) at previous time
+* TC filter time constant
+* DT time step between two calculations
+* N dimension of the vectors X,XL,Y
+*
+*--------------------------------------------------------------------
+*
+ IMPLICIT NONE
+ INTEGER N,I
+ REAL Y(N),X(N),XL(N),TC,DT,AA,A,B,C
+*
+* COMPUTE PONDERATION FACTORS FOR Y,X ET XL
+*
+ AA = - DT / TC
+ A = EXP ( AA )
+ B = 1. - A
+ C = 1. - B * TC/DT
+*
+* COMPUTE NEW Y
+*
+ DO 10 I=1,N
+*
+ Y(I) = A * Y(I) + ( B - C ) * XL(I) + C * X(I)
+ XL(I) = X(I)
+*
+ 10 CONTINUE
+ RETURN
+ END