\subsection{The \moc{MAC:} module}\label{sect:MACData}

In DRAGON, the macroscopic cross sections associated with each mixture are
stored in a \dds{macrolib} (as an independent data structure or as part of
a \dds{microlib}) which may be generated using one of different ways:
\begin{itemize}
\item First, one can use directly the input stream already used for the remaining
DRAGON data. In this case, a single macroscopic library is involved.
\item The second method is via a GOXS format binary sequential
file.\cite{MATXS} It should be noted that a number of GOXS files may be read
successively by DRAGON and that it is possible to combine data from GOXS files
with data taken from the input stream. One can also transfer the macroscopic cross sections to a
GOXS format binary file if required. In this case, a single macroscopic library is involved.
\item The third input method is through a file which already contains a \dds{macrolib}. In this
case, two macroscopic and microscopic libraries are to be combined
\item The fourth method consists to update an existing \dds{macrolib} using control-variable
data recovered from a {\tt L\_OPTIMIZE} object.
\end{itemize}

The general format of the data for the \moc{MAC:} module is the following:
\begin{DataStructure}{Structure \dstr{MAC:}} 
$\{$ \dusa{MACLIB} \moc{:=} \moc{MAC:} $[$ \dusa{MACLIB} $]$ \moc{::} \dstr{descmacinp} \\
\hspace*{0.2cm} $|$ \dusa{MICLIB} \moc{:=} \moc{MAC:} \dusa{MICLIB} \moc{::} \dstr{descmacinp} \\
\hspace*{0.2cm} $|$ \dusa{MACLIB} \moc{:=} \moc{MAC:} $[$ \dusa{MACLIB} $]~[$ \dusa{OLDLIB} $]$
\moc{::}
     \dstr{descmacupd} \\
\hspace*{0.2cm} $|$ \dusa{MACLIB} \moc{:=} \moc{MAC:} \dusa{MACLIB} \dusa{OPTIM} \moc{;} \\
\hspace*{0.2cm} $\}$
\end{DataStructure}

\noindent
The meaning of each of the terms above is:

\noindent

\begin{ListeDeDescription}{mmmmmmmm}

\item[\dusa{MACLIB}] {\tt character*12} name of a \dds{macrolib} that will
contain the macroscopic cross sections. If \dusa{MACLIB} appears on both LHS and
RHS, it is updated; otherwise, it is created. If \dusa{MACLIB} is created, all
macroscopic cross sections are first initialized to zero.

\item[\dusa{MICLIB}] {\tt character*12} name of a \dds{microlib}. Only the
\dds{macrolib} data substructure of this \dds{microlib} is then updated. This is
used mainly to associate fixed sources densities with various mixtures. If any
other cross section is modified for a specific mixture, the
microscopic and macroscopic cross sections are no longer compatible. One can
return to a compatible library using the library update module (see
\Sect{LIBData}).

\item[\dusa{OLDLIB}] {\tt character*12} name of a \dds{macrolib} or a \dds{microlib}
which will be used to update or create the \dusa{MACLIB} \dds{macrolib}.

\item[\dusa{OPTIM}] {\tt character*12} name of a {\tt L\_OPTIMIZE} object. The
\dds{macrolib} \dusa{MACLIB} is updated using control-variable data recovered from \dusa{OPTIM}.

\item[\dstr{descmacinp}] macroscopic input data structure for this module (see
\Sect{descmacinp}).

\item[\dstr{descmacupd}] macroscopic update data structure for this module (see
\Sect{descmacupd}).

\end{ListeDeDescription}

\subsubsection{Input structure for module {\tt MAC:}}\label{sect:descmacinp}
 
In the case where there are no \dusa{OLDLIB} specified, the \dstr{descmac} input structure takes
the form:

\begin{DataStructure}{Structure \dstr{descmacinp}}
$[$ \moc{EDIT} \dusa{iprint} $]$ \\
$[$ \moc{NGRO} \dusa{ngroup} $]$ \\
$[$ \moc{NMIX} \dusa{nmixt} $]$ \\
$[$ \moc{NIFI} \dusa{nifiss} $]$ \\
$[$ \moc{DELP} \dusa{ndel} $]$ \\
$[$ \moc{ANIS} \dusa{naniso} $]$ \\
$[$ \moc{CTRA} $\{$ \moc{NONE} $|$ \moc{APOL} $|$ \moc{WIMS} $|$ \moc{LEAK} $\}$ $]$ \\
$[$ \moc{NALP} \dusa{nalbp} $]$ \\
$[$ \moc{ALBP} (\dusa{albedp}(ia),ia=1,\dusa{nalbp}) $]$ \\
$[$ \moc{WRIT} \dusa{GOXSWN} $]$ \\
$[$ \moc{ENER} (\dusa{energy}(jg), jg=1,\dusa{ngroup} +1) $]$ \\
$[$ \moc{VOLUME} (\dusa{volume}(ibm), ibm=1,\dusa{nmixt}) $]$ \\
$[$ \moc{ADD} $]$ \\
$[[$ $\{$	\moc{READ} $[$ (\dusa{imat}(i), i=1,\dusa{nmixt}) $]$ \dusa{GOXSRN} $[$ \moc{DELE} $]$
$|$	 \moc{READ}  \moc{INPUT} $[[$ \dstr{descxs} $]]$ $\}$ $]]$ \\
$[[$ \moc{STEP} \dusa{istep} \moc{READ} \moc{INPUT} $[[$ \dstr{descxs} $]]~]]$ \\
$[$ \moc{NORM} $]$ \\
\moc{;}
\end{DataStructure}

\noindent
with

\begin{ListeDeDescription}{mmmmmmmm}

\item[\moc{EDIT}] keyword used to modify the print level \dusa{iprint}.

\item[\dusa{iprint}] index used to control the printing in this module.
It must be set to 0 if no printing on the output file is required. The
macroscopic cross sections can written to the output file if the
variable \dusa{iprint} is greater than or equal to 2. The transfer cross
sections will be printed if this parameter is greater than or equal to 3. The
normalization of the transfer cross sections will be checked if \dusa{iprint}
is greater than or equal to 5.

\item[\moc{NGRO}] keyword to specify the number of energy groups for which
the macroscopic cross sections will be provided. This information is required
only if \dusa{MACLIB} is created and the cross sections are taken directly from
the input data stream.

\item[\dusa{ngroup}] the number of energy groups used for the calculations in
DRAGON. The default value is \dusa{ngroup}=1. 

\item[\moc{NMIX}] keyword used to define the number of material mixtures.
This information is required only if \dusa{MACLIB} is created and the cross
sections are taken directly from the input data stream or from a GOXS file.

\item[\dusa{nmixt}] the maximum number of mixtures (a mixture is
characterized by a distinct set of macroscopic cross sections) the 
\dds{macrolib} may contain. The default value is \dusa{nmixt}=1.

\item[\moc{NIFI}] keyword used to specify the maximum number of fissile
spectrum associated with each mixture. Each fission spectrum generally
represents a fissile isotope. This information is required only if \dusa{MACLIB}
is created and the cross sections are taken directly from the input data stream.

\item[\dusa{nifiss}] the maximum number of fissile isotopes per mixture. The
default value is \dusa{nifiss}=1.

\item[\moc{DELP}] keyword used to specify the number of delayed neutron groups.

\item[\dusa{ndel}] the number of delayed neutron groups. The
default value is \dusa{ndel}=0.

\item[\moc{ANIS}] keyword used to specify the maximum level of anisotropy
permitted in the scattering cross sections. This information is required only if
\dusa{MACLIB} is created and the cross sections are taken directly from the
input data stream.

\item[\dusa{naniso}] number of Legendre orders for the representation of the
scattering cross sections. The default value is \dusa{naniso}=1 corresponding to
the use of isotropic scattering cross sections.

\item[\moc{CTRA}] keyword to specify the type of transport correction that
should be generated and stored on the \dds{macrolib}. The transport correction is to be
substracted from the total and isotropic ($P_0$) within-group scattering cross sections. A leakage correction, equal 
to the difference between current-- and flux--weighted total cross sections ($\Sigma_{1}-\Sigma_{0}$)
is also applied in the \moc{APOL} and \moc{LEAK} cases. All the modules that
will read this \dds{macrolib} will then have access to transport corrected
cross sections. The default is no transport correction when the \dds{macrolib} is created from the
input or GOXS files. 

\item[\moc{NONE}] keyword to specify that no transport correction should be
used in this calculation.

\item[\moc{APOL}] keyword to specify that an APOLLO type transport correction
based on the linearly anisotropic ($P_1$) scattering cross sections is to be set. This correction assumes that
the micro-reversibility principle is valid for all energy groups. $P_1$ scattering
information must exists in the {\sc macrolib}.

\item[\moc{WIMS}] keyword to specify that a WIMS--type transport correction is used.
The transport correction is recovered from a record named \moc{TRANC}. This
record must exists in the {\sc macrolib}.

\item[\moc{LEAK}] A leakage correction is applied to the total and
$P_0$ within-group scattering cross sections. No transport correction is 
applied in this case.

\item[\moc{NALP}] keyword to specify the maximum number of physical
albedos which will be read. These can be used by the \moc{GEO:} module (see
\Sect{GEOData}).

\item[\dusa{nalbp}] the maximum number of physical albedos. The default value
is \dusa{nalbp}=1.

\item[\moc{ALBP}] keyword used for the input of the physical albedo array.

\item[\dusa{albedp}] physical albedo array. A maximum of \dusa{nalbp} entries
can be specified.

\item[\moc{WRIT}] keyword used to write cross section data to a GOXS file. In
the case where \dusa{nifiss}$>$1, this option is invalid. 

\item[\dusa{GOXSWN}] {\tt character*7} name of the GOXS file to be created or
updated.

\item[\moc{ENER}] keyword to specify the energy group limits.

\item[\dusa{energy}] energy (eV) array which define the limits of the groups
(\dusa{ngroup}+1 elements).  Generally \dusa{energy}(1) is the highest energy.

\item[\moc{VOLUME}] keyword to specify the mixture volumes.

\item[\dusa{volume}] volume (cm$^3$) occupied by each mixture.

\item[\moc{ADD}] keyword for adding increments to existing macroscopic cross
sections. In this case, the information provided in \dstr{descxs} represents
incremental rather than standard cross sections. 

\item[\moc{READ}] keyword to specify the input file format. One can use either
the input stream (keyword \moc{INPUT}) or a GOXS format file. 

\item[\dusa{imat}] array of mixture identifiers to be read from a GOXS file.
The maximum number of identifiers permitted is  \dusa{nmixt} and the maximum
value that \dusa{imat} may take is \dusa{nmixt}. When \dusa{imat} is 0, the
corresponding mixture on the GOXS file is not included in the \dds{macrolib}. In the
cases where \dusa{imat} is absent all the mixtures on the GOXS file are
available in a DRAGON execution. They are numbered consecutively starting at 1
or from the last number reached during a previous execution of the \moc{MAC:}
module.

\item[\dusa{GOXSRN}] {\tt character*7} name of the GOXS file to be read.

\item[\moc{DELE}] keyword to specify that the GOXS file is deleted after being read
({\bf Revision 3.03 only}).

\item[\moc{INPUT}] keyword to specify that mixture cross sections will be
read on the input stream.

\item[\dstr{descxs}] structure describing the format used for reading the
mixture cross sections from the input stream (see
\Sect{descxs}).

\item[\moc{STEP}] keyword used to create a perturbation directory.

\item[\dusa{istep}] the index of the perturbation directory.

\item[\moc{NORM}] keyword to specify that the macroscopic scattering cross
sections and the fission spectrum have to be normalized. This option is
available even if the mixture cross sections were not read by the \moc{MAC:}
module.

\end{ListeDeDescription}

\goodbreak

\subsubsection{Macroscopic cross section definition}\label{sect:descxs}

\begin{DataStructure}{Structure \dstr{descxs}}
\moc{MIX} $[$ \dusa{matnum} $]$ \\
\hskip 1.0cm $[~\{$ \moc{NTOT0} $|$ \moc{TOTAL} $\}$ (\dusa{xssigt}(jg),    jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{NTOT1} (\dusa{xssig1}(jg),    jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{TRANC} (\dusa{xsstra}(jg),    jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{NUSIGF} ((\dusa{xssigf}(jf,jg), jg=1,\dusa{ngroup}), jf=1,\dusa{nifiss}) $]$ \\
\hskip 1.0cm $[$ \moc{CHI}    ((\dusa{xschi}(jf,jg),    jg=1,\dusa{ngroup}), jf=1,\dusa{nifiss})$]$ \\
\hskip 1.0cm $[$ \moc{FIXE}   (\dusa{xsfixe}(jg),    jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{DIFF}   (\dusa{diff}(jg),    jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{DIFFX} (\dusa{xdiffx}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{DIFFY} (\dusa{xdiffy}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{DIFFZ} (\dusa{xdiffz}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{NUSIGD} (((\dusa{xssigd}(jf,idel,jg), jg=1,\dusa{ngroup}), idel=1,\dusa{ndel}), jf=1,\dusa{nifiss}) $]$ \\
\hskip 1.0cm $[$ \moc{CHDL}   (((\dusa{xschid}(jf,idel,jg), jg=1,\dusa{ngroup}), idel=1,\dusa{ndel}), jf=1,\dusa{nifiss})$]$ \\
\hskip 1.0cm $[$ \moc{OVERV} (\dusa{overv}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{NFTOT} (\dusa{nftot}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{FLUX-INTG} (\dusa{xsint0}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{FLUX-INTG-P1} (\dusa{xsint1}(jg), jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{H-FACTOR}   (\dusa{hfact}(jg),    jg=1,\dusa{ngroup}) $]$ \\
\hskip 1.0cm $[$ \moc{SCAT} (( 
    \dusa{nbscat}(jl,jg), \dusa{ilastg}(jl,jg),(\dusa{xsscat}(jl,jg,ig), \\
\hskip 2.0cm     ig=1,\dusa{nbscat}(jl,jg) ), jg=1,\dusa{ngroup}), jl=1,\dusa{naniso}) $]$
\end{DataStructure}

\begin{ListeDeDescription}{mmmmmmmm}

\item[\moc{MIX}] keyword to specify that the macroscopic cross sections
associated with a new mixture are to be read.

\item[\dusa{matnum}] identifier for the next mixture to be read. The maximum
value permitted for this identifier is \dusa{nmixt}. When \dusa{matnum} is
absent, the mixtures are numbered consecutively starting with 1 or with the last
mixture number read either on the GOXS or the input stream.  

\item[\moc{NTOT0}] keyword to specify that the total macroscopic cross
sections for this mixture follows.

\item[\moc{TOTAL}] alias keyword for \moc{NTOT0}.

\item[\dusa{xssigt}] array representing the multigroup total macroscopic cross
section ($\Sigma^{g}$ in \xsunit) associated with this mixture.

\item[\moc{NTOT1}] keyword to specify that the $P_1$--weighted total macroscopic cross
sections for this mixture follows.

\item[\dusa{xssig1}] array representing the multigroup $P_1$--weighted total macroscopic cross
section ($\Sigma_1^{g}$ in \xsunit) associated with this mixture.

\item[\moc{TRANC}] keyword to specify that the transport correction macroscopic cross
sections for this mixture follows.

\item[\dusa{xsstra}] array representing the multigroup transport correction macroscopic cross
section ($\Sigma_{\rm tc}^{g}$ in \xsunit) associated with this mixture.

\item[\moc{NUSIGF}] keyword to specify that the macroscopic fission cross
section multiplied by the average number of neutrons per fission for this
mixture follows.

\item[\dusa{xssigf}] array representing the multigroup macroscopic fission
cross section multiplied by the average number
of neutrons per fission ($\nu\Sigma_{f}^{g}$ in \xsunit) for all the fissile
isotopes associated with this mixture. 

\item[\moc{CHI}] keyword to specify that the fission spectrum for this mixture
follows.

\item[\dusa{xschi}] array representing the multigroup fission spectrum
($\chi^{g}$) for all the fissile isotopes associated with this mixture.

\item[\moc{FIXE}] keyword to specify that the fixed neutron source density for
this mixture follows.

\item[\dusa{xsfixe}] array representing the multigroup fixed neutron source
density for this mixture ($S^{g}$ in $s^{-1}cm^{-3}$). 

\item[\moc{DIFF}] keyword to specify that the isotropic diffusion coefficient for
this mixture follows.

\item[\dusa{diff}] array representing the multigroup isotropic diffusion coefficient for
this mixture ($D^{g}$ in $cm$). 

\item[\moc{DIFFX}] keyword for input of the $X$--directed diffusion coefficient. 

\item[\dusa{xdiffx}] array representing the multigroup $X$--directed diffusion coefficient ($D^g_x$ in cm) for the mixture 
\dusa{matnum}. 

\item[\moc{DIFFY}] keyword for input of the $Y$--directed diffusion coefficient. 

\item[\dusa{xdiffy}] array representing the multigroup $Y$--directed diffusion coefficient ($D^g_y$ in cm) for the mixture 
\dusa{matnum}. 

\item[\moc{DIFFZ}] keyword for input of the $Z$--directed diffusion coefficient.

\item[\dusa{xdiffz}] array representing the multigroup $Z$--directed diffusion coefficient ($D^g_z$ in cm) for the mixture 
\dusa{matnum}. 

\item[\moc{NUSIGD}] keyword to specify that the delayed macroscopic fission cross
section multiplied by the average number of neutrons per fission for this
mixture follows.

\item[\dusa{xssigd}] array representing the delayed multigroup macroscopic fission
cross section multiplied by the average number
of neutrons per fission ($\nu\Sigma_{f}^{g,idel}$ in \xsunit) for all the fissile
isotopes associated with this mixture. 

\item[\moc{CHDL}] keyword to specify that the delayed fission spectrum for this mixture
follows.

\item[\dusa{xschid}] array representing the delayed multigroup fission spectrum
($\chi^{g,idel}$) for all the fissile isotopes associated with this mixture.

\item[\moc{OVERV}] keyword for input of the multigroup average of the inverse neutron velocity.

\item[\dusa{overv}] array representing the multigroup average of the inverse neutron velocity ($<1/v>_{m}^g$) for the mixture 
\dusa{matnum}. 

\item[\moc{NFTOT}] keyword for input of the multigroup macroscopic fission cross sections.

\item[\dusa{nftot}] array representing the multigroup macroscopic fission cross section ($\Sigma_{f}^g$) for the mixture 
\dusa{matnum}. 

\item[\moc{FLUX-INTG}] keyword for input of the multigroup $P_0$ volume-integrated fluxes.

\item[\dusa{xsint0}] array representing the multigroup $P_0$ volume-integrated fluxes ($V\phi_0^g$) for the mixture 
\dusa{matnum}. 

\item[\moc{FLUX-INTG-P1}] keyword for input of the multigroup $P_1$ volume-integrated fluxes.

\item[\dusa{xsint1}] array representing the multigroup $P_1$ volume-integrated fluxes ($V\phi_1^g$) for the mixture 
\dusa{matnum}. 

\item[\moc{H-FACTOR}] keyword to specify that the power factor for
this mixture follows.

\item[\dusa{hfact}] array representing the multigroup power factor for this
mixture ($H^{g}$ in $MeV~cm^{-1}$). 

\item[\moc{SCAT}] keyword to specify that the macroscopic scattering cross
section matrix for this mixture follows.

\item[\dusa{nbscat}] array representing the number of primary groups ig with
non vanishing macroscopic scattering cross section towards the secondary group jg
considered for each anisotropy level associated with this mixture.

\item[\dusa{ilastg}] array representing the group index of the most thermal
group with non-vanishing macroscopic scattering cross section towards the
secondary group jg considered for each anisotropy level associated with this
mixture.

\item[\dusa{xsscat}] array representing the multigroup macroscopic scattering
cross section ($\Sigma_{sl}^{ig\to jg}$ in \xsunit) from the primary group ig
towards the secondary group jg considered for each anisotropy level associated
with this mixture. The elements are ordered using decreasing primary group
number ig, from \dusa{ilastg} to (\dusa{ilastg}$-$\dusa{nbscat}$+1$), and an
increasing secondary group number jg. Examples of input structures for 
macroscopic scattering cross sections can be
found in \Sect{ExXSData}.

\end{ListeDeDescription}

\subsubsection{Update structure for operator {\tt MAC:}}\label{sect:descmacupd}
 
In the case where \dusa{OLDLIB} is specified, the \dstr{descmacupd} input structure takes
the form:

\begin{DataStructure}{Structure \dstr{descmacupd}}
$[$ \moc{EDIT} \dusa{iprint} $]$ \\
$[$ \moc{CTRA} \moc{OFF} $]$ \\
$[[$ \moc{MIX} \dusa{numnew} $[$ \dusa{numold} $\{$ \moc{UPDL} $|$ \moc{OLDL} $\}$ $]$ $]]$ \\
\moc{;}
\end{DataStructure}

\noindent
with

\begin{ListeDeDescription}{mmmmmm}

\item[\moc{EDIT}] keyword used to modify the print level \dusa{iprint}.

\item[\dusa{iprint}] index used to control the printing in this operator.
It must be set to 0 if no printing on the output file is required. The
macroscopic cross sections can written to the output file if the
variable \dusa{iprint} is greater than or equal to 2. The transfer cross
sections will be printed if this parameter is greater than or equal to 3. The
normalization of the transfer cross sections will be checked if \dusa{iprint}
is greater than or equal to 5.

\item[\moc{CTRA}] keyword to specify the type of transport correction that
should be generated and stored on the \dds{macrolib}. All the operators that
will read this \dds{macrolib} will then have access to transport corrected
cross sections. In the case where the \dds{macrolib} is updated using other
\dds{macrolib} or \dds{microlib} the default is to use a transport correction whenever one of these
older data structure requires a transport correction.

\item[\moc{OFF}] deactivates the transport correction.

\item[\moc{MIX}] keyword to specify that the macroscopic cross sections
associated with a mixture is to be created or updated.

\item[\dusa{numnew}] mixture number to be updated or created on the output
\dds{macrolib}. 

\item[\dusa{numold}] mixture number on an old \dds{macrolib} or \dds{microlib} which will be used
to update or create \dusa{numnew} on the output macrolib 

\item[\moc{OLDL}] the
macroscopic cross sections associated with mixture \dusa{numold} are taken from \dusa{OLDLIB}. This is the
default option.

\item[\moc{UPDL}] the
macroscopic cross sections associated with mixture \dusa{numold} are taken from \dusa{MACLIB}.

\end{ListeDeDescription}

\eject
