From 7dfcc480ba1e19bd3232349fc733caef94034292 Mon Sep 17 00:00:00 2001 From: stainer_t Date: Mon, 8 Sep 2025 13:48:49 +0200 Subject: Initial commit from Polytechnique Montreal --- Donjon/src/DETFIL.f | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Donjon/src/DETFIL.f (limited to 'Donjon/src/DETFIL.f') 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 -- cgit v1.2.3