summaryrefslogtreecommitdiff
path: root/Dragon/src/MCGFFAL.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/MCGFFAL.f
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Dragon/src/MCGFFAL.f')
-rw-r--r--Dragon/src/MCGFFAL.f138
1 files changed, 138 insertions, 0 deletions
diff --git a/Dragon/src/MCGFFAL.f b/Dragon/src/MCGFFAL.f
new file mode 100644
index 0000000..bda8917
--- /dev/null
+++ b/Dragon/src/MCGFFAL.f
@@ -0,0 +1,138 @@
+*DECK MCGFFAL
+ SUBROUTINE MCGFFAL(SUBSCH,K,KPN,M,N,H,NOM,NZON,WEIGHT,XST,SP,SM,
+ 1 DSP,DSM,NREG,NMU,NANI,NFUNLX,TRHAR,KEYCUR,IMU,B,F,
+ 2 PHIV,DPHIV)
+*
+*-----------------------------------------------------------------------
+*
+*Purpose:
+* Solution of transport equation on a finite track.
+* Linear-discontinuous-characteristics approximation.
+* Ray-tracing (anisotropic scattering case,'source term isolation' off).
+*
+*Copyright:
+* Copyright (C) 2015 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
+* SUBSCH track coefficients calculation subroutine.
+* K total number of volumes for which specific values
+* of the neutron flux and reactions rates are required.
+* KPN total number of unknowns in vectors F.
+* M number of material mixtures.
+* N number of elements in the current track.
+* H vector containing the lenght of the different segments of this
+* track.
+* NOM vector containing the region number of the different segments
+* of this track.
+* NZON index-number of the mixture type assigned to each volume.
+* WEIGHT track weight.
+* XST macroscopic total cross section.
+* SP total source vector for + direction.
+* SM total source vector for - direction.
+* DSP linear component of the total source vector for + direction.
+* DSM linear component of the total source vector for - direction.
+* NREG number of volumes.
+* NMU order of the polar quadrature set.
+* NANI scattering anisotropy (=1 for isotropic scattering).
+* NFUNLX number of moments of the spherical harmonics.
+* NMOD third dimension of TRHAR.
+* TRHAR spherical harmonics components for this angle in the plane.
+* KEYCUR position of current elements in PHI vector.
+* IMU azimuthal angle corresponding to this track.
+*
+*Parameters: input/output
+* F vector containing the zonal scalar flux (surface components).
+* PHIV vector containing the zonal scalar flux (component 1).
+* DPHIV vector containing the zonal scalar flux (components 2 and 3).
+*
+*Parameters: scratch
+* B undefined.
+*
+*-----------------------------------------------------------------------
+*
+ IMPLICIT NONE
+*----
+* SUBROUTINE ARGUMENTS
+*----
+ INTEGER K,KPN,M,N,NOM(N),NZON(K),NMU,NFUNLX,NREG,
+ 1 KEYCUR(K-NREG),IMU,NANI
+ REAL XST(0:M),TRHAR(NMU,NFUNLX,2)
+ DOUBLE PRECISION WEIGHT,H(N),SP(N),SM(N),DSP(N),DSM(N),B(0:5,N),
+ 1 F(KPN),PHIV(NFUNLX,NREG),DPHIV(2*NFUNLX,NREG)
+ EXTERNAL SUBSCH
+*----
+* LOCAL VARIABLES
+*---
+ REAL ETA,XI
+ DOUBLE PRECISION F0,DF0,SI,SJ,DSI,DSJ,RM,RP,DSIG,DH
+ INTEGER I,NOMI,IND1,INDN,JF,J,NOMJ
+*----
+* Calculation of the coefficients for this track.
+*----
+* MCGSCAL: Linear discontinuous-Characteristics Scheme with
+* Tabulated Exponentials
+* MCGDDFL: Diamond-Differencing DD1 Scheme
+* MCGSCEL: Linear discontinuous-Characteristics Scheme with
+* Exact Exponentials
+ IF(NANI.LE.0) CALL XABORT('MCGFFAL: INVALID VALUE OF NANI.')
+ CALL SUBSCH(N,K,M,NOM,NZON,H,XST,B)
+*----
+* Summation along the track in both directions
+*----
+* incoming flux in + direction
+ IND1=KEYCUR(-NOM(1))
+ RP=SP(1)
+* incoming flux in - direction
+ IND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