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 /Utilib/src/ALLUS.f | |
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Utilib/src/ALLUS.f')
| -rw-r--r-- | Utilib/src/ALLUS.f | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Utilib/src/ALLUS.f b/Utilib/src/ALLUS.f new file mode 100644 index 0000000..0d4926a --- /dev/null +++ b/Utilib/src/ALLUS.f @@ -0,0 +1,62 @@ +*DECK ALLUS + SUBROUTINE ALLUS(L4,MU1,IMA,ASS,F) +* +*----------------------------------------------------------------------- +* +*Purpose: +* solution of a linear system where the coefficient matrix have been +* factorized by a preceding call to ALLUF. +* +*Copyright: +* Copyright (C) 1989 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): A. Hebert +* +*Parameters: input +* L4 order of the coefficient matrix. +* MU1 position of each diagonal element in vector ASS. +* IMA position of the first non-zero column element in vector ASS. +* ASS LU factors of the coefficient matrix in compressed diagonal +* storage mode. DIMENSION ASS(IMA(L4)) +* F right-hand side of the linear system. +* +*Parameters: output +* F solution of the linear system. +* +*----------------------------------------------------------------------- +* +*---- +* SUBROUTINE ARGUMENTS +*---- + INTEGER L4,MU1(L4),IMA(L4) + REAL ASS(*),F(L4) +* + F(1)=F(1)/ASS(MU1(1)) + DO 20 I=2,L4 + K1=IMA(I-1)+1 + K2=MU1(I) + KJ=I-K2+K1 + T=-F(I) + DO 10 K=K1,K2-1 + T=T+F(KJ)*ASS(K) + KJ=KJ+1 + 10 CONTINUE + F(I)=-T/ASS(MU1(I)) + 20 CONTINUE +* + DO 40 I=L4,2,-1 + K1=IMA(I) + K2=MU1(I) + KJ=I-K1+K2 + T=-F(I) + DO 30 K=K1,K2+1,-1 + F(KJ)=F(KJ)+ASS(K)*T + KJ=KJ+1 + 30 CONTINUE + 40 CONTINUE + RETURN + END |
