summaryrefslogtreecommitdiff
path: root/Dragon/src/DUO005.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 /Dragon/src/DUO005.f
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Dragon/src/DUO005.f')
-rw-r--r--Dragon/src/DUO005.f88
1 files changed, 88 insertions, 0 deletions
diff --git a/Dragon/src/DUO005.f b/Dragon/src/DUO005.f
new file mode 100644
index 0000000..62dcac4
--- /dev/null
+++ b/Dragon/src/DUO005.f
@@ -0,0 +1,88 @@
+*DECK DUO005
+ SUBROUTINE DUO005(NGRP,DLK,ALK,FLUX,AFLUX,V,W)
+*
+*-----------------------------------------------------------------------
+*
+*Purpose:
+* Compute a consistent direct-adjoint leakage multigroup term using
+* the Villarino-Stamm'ler normalization method.
+*
+*Copyright:
+* Copyright (C) 2013 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
+* NGRP number of energy groups.
+* DLK leakage rates for the direct balance equation.
+* ALK leakage rates for the adjoint balance equation.
+* FLUX integrated direct flux.
+* AFLUX integrated adjoint flux.
+*
+*Parameters: output
+* V first Villarino-Stamm'ler normalization vector.
+* W second Villarino-Stamm'ler normalization vector.
+*
+*-----------------------------------------------------------------------
+*
+*----
+* SUBROUTINE ARGUMENTS
+*----
+ INTEGER NGRP
+ REAL DLK(NGRP),ALK(NGRP),FLUX(NGRP),AFLUX(NGRP),V(NGRP),W(NGRP)
+*----
+* LOCAL VARIABLES
+*----
+ DOUBLE PRECISION ZNUMD,ZNUMA,GAR
+ DOUBLE PRECISION, ALLOCATABLE, DIMENSION(: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