User Input for NJOY 97

Search down for the desired module in caps:
NJOY, RECONR, BROADR, UNRESR, HEATR, THERMR, GROUPR, GAMINR, MODER,
DTFR, MATXSR, ACER, WIMSR, PLOTR, VIEWR, MIXR, PURR, LEAPR, GASPR

NJOY
      program njoy
c
c     ******************************************************************
c     *                                                                *
c     *    njoy nuclear data processing system                         *
c     *    version 99.0                                                *
c     *    31 Dec 99                                                   *
c     *                                                                *
c     ******************************************************************
c     *                                                                *
c     * njoy is a system of processing modules intended to convert     *
c     * evaluated nuclear data in the endf format into forms useful    *
c     * for practical applications.                                    *
c     *                                                                *
c     * reconr...reconstruct pointwise cross sections from endf/b      *
c     *     resonance parameters and interpolation schemes.            *
c     *                                                                *
c     * broadr...doppler broaden and thin pointwise cross sections.    *
c     *                                                                *
c     * unresr...compute effective pointwise self-shielded cross       *
c     *     sections in the unresolved energy range.                   *
c     *                                                                *
c     * heatr...compute heat production cross sections (kerma)         *
c     *     and damage energy production.                              *
c     *                                                                *
c     * thermr...generate neutron scattering cross sections and        *
c     *     point-to-point scattering kernels in the thermal range     *
c     *     for free or bound atoms.                                   *
c     *                                                                *
c     * groupr...generate self-shielded multigroup cross sections and  *
c     *     group-to-group scattering and photon production matrices.  *
c     *                                                                *
c     * gaminr...compute multigroup photon interaction cross sections, *
c     *     scattering matrices, and heat production.                  *
c     *                                                                *
c     * errorr...construct multigroup covariance matrices.             *
c     *                                                                *
c     * covr...process covariance data from errorr                     *
c     *                                                                *
c     * moder...convert between endf/b standard coded mode and the     *
c     *     njoy blocked binary mode.                                  *
c     *                                                                *
c     * dtfr...output and plot multigroup data for discrete ordinates  *
c     *     transport codes.                                           *
c     *                                                                *
c     * ccccr...format multigroup data into the cccc standard          *
c     *     interface files isotxs, brkoxs, and dlayxs.                *
c     *                                                                *
c     * matxsr...convert multigroup data into the comprehensive matxs  *
c     *     cross section interface format.                            *
c     *                                                                *
c     * resxsr...prepare a cccc-like file of pointwise resonance       *
c     *     cross sections for thermal flux calculations               *
c     *                                                                *
c     * acer...prepare library for the los alamos continuous energy    *
c     *     monte-carlo code mcnp.                                     *
c     *                                                                *
c     * powr...convert multigroup data into libraries for the thermal  *
c     *     powr reactor codes epri-cell and epri-cpm.                 *
c     *                                                                *
c     * wimsr...convert multigroup data into libraries for the         *
c     *     reactor assembly codes wims-d or wims-e.                   *
c     *                                                                *
c     * plotr...plot endf, pendf, gendf, or exp. cross sections,       *
c     *     distributions, or matrices.                                *
c     *                                                                *
c     * viewr...view plots from plotr, dtfr, covr, etc. in postscript  *
c     *                                                                *
c     * mixr...mix file 3 cross sections (for example, to make         *
c     *     elemental cross sections) for plotting, etc.               *
c     *                                                                *
c     * purr...generate unresolved-resonance probability tables        *
c     *     for the mcnp monte carlo code                              *
c     *                                                                *
c     * leapr...generate s(alpha,beta) for thermal moderators          *
c     *                                                                *
c     * gaspr...add gas production (mt203-207) to pendf                *
c     *                                                                *
c     * each module is an essentially independent code segment.  the   *
c     * main program controls the order in which modules are used      *
c     * and contains the utility subroutines used by all modules.      *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1       module option                                     *
c     *                                                                *
c     *    module    six character module name, e.g., reconr.          *
c     *              it is not necessary to use quotes.                *
c     *                                                                *
c     *          repeat card 1 for each module desired, and            *
c     *          use the name "stop" to terminate program.             *
c     *                                                                *
c     * see the comments at the start of each module for               *
c     * its specific input instructions.                               *
c     *                                                                *
c     *--- code conversion --------------------------------------------*
c     *                                                                *
c     * code conversion is handled using the "*if" constructs of       *
c     * the upd code (which is a code for maintaining fortran codes    *
c     * similar to update).  the logical variables that can be         *
c     * set are the following:                                         *
c     *                                                                *
c     *   sw  -- set for short-word machines (32 bit).  leave          *
c     *             unset for 64 bit machines.                         *
c     *                                                                *
c     ******************************************************************
c
RECONR
c
c     ******************************************************************
c     *                                                                *
c     * reconstruct pointwise cross sections                           *
c     *                                                                *
c     * resonance cross sections are calculated using the methods of   *
c     * resend, with modifications to the method of generating the     *
c     * energy grid and the method of combining resonance and          *
c     * background cross sections.                                     *
c     *                                                                *
c     * this program generates an energy grid which is the union of    *
c     * an input grid (if any), the resonance energies (if any), and   *
c     * the energies of cross sections in mf3 and mf13 (or mf23).      *
c     * the pointwise cross sections are then computed on this grid    *
c     * and points are added so that the resonance cross sections and  *
c     * any cross sections represented by non-linear interpolation     *
c     * are reproduced within a specified tolerance by linear inter-   *
c     * polation.  psi-chi reconstruction can be used if desired.      *
c     * sections which are not cross sections (mu,nu) and photon       *
c     * multiplicities (mf12) are not processed.  redundant reactions  *
c     * are reconstructed to be the sum of their parts.  the pendf     *
c     * tape contains point cross sections in mf3 and mf13 (or mf23)   *
c     * and a description of the processing in mf1.  the mf1 diction-  *
c     * ary is updated.  the c1 and c2 fields of the second card in    *
c     * mf1 contain the temperature and reconstruction tolerance       *
c     * respectively.  an mf2 appropriate to no resonance parameters   *
c     * is constructed with the potential scattering length added.     *
c     *                                                                *
c     * if unresolved parameters are present, the infinitely dilute    *
c     * cross sections are computed on a special energy grid chosen    *
c     * to preserve the required interpolation properties.  this       *
c     * table is added to the pendf tape using a special format in     *
c     * mf2/mt152, and the table is also used to compute the           *
c     * uresolved contributions in mf3.  this allows resolved          *
c     * resonance cross sections which overlap the resolved range      *
c     * to be recovered by subtraction.                                *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    nendf    unit for endf/b tape                               *
c     *    npend    unit for pendf tape                                *
c     * card 2                                                         *
c     *    tlabel   66 character label for new pendf tape              *
c     *             delimited with quotes, ended with /.               *
c     * card 3                                                         *
c     *    mat      material to be reconstructed                       *
c     *    ncards   number of cards of descriptive data for new mf1    *
c     *             (default=0)                                        *
c     *    ngrid    number of user energy grid points to be added.     *
c     *             (default=0)                                        *
c     * card 4                                                         *
c     *    err      fractional reconstruction tolerance used when      *
c     *             resonance-integral error criterion (see errint)    *
c     *             is not satisfied.                                  *
c     *    tempr    reconstruction temperature (deg kelvin)            *
c     *             (default=0)                                        *
c     *    errmax   fractional reconstruction tolerance used when      *
c     *             resonance-integral error criterion is satisfied    *
c     *             (errmax.ge.err, default=10*err)                    *
c     *    errint   maximum resonance-integral error (in barns)        *
c     *             per grid point (default=err/20000)                 *
c     *             (note: the max cross section difference for        *
c     *             linearization, errlim, and for reconstruction,     *
c     *             errmin, are also tied to errint.  to get maximum   *
c     *             accuracy, set errint to a very small number.       *
c     *             for economical production, use the defaults.)      *
c     * card 5                                                         *
c     *    cards    ncards of descriptive comments for mt451           *
c     *             each card delimited with quotes, ended with /.     *
c     * card 6                                                         *
c     *    enode    users energy grid points                           *
c     *                                                                *
c     *     cards 3, 4, 5, 6 must be input for each material desired   *
c     *     mat=0/ terminates execution of reconr.                     *
c     *                                                                *
c     ******************************************************************
c
BROADR
c
c     ******************************************************************
c     *                                                                *
c     * doppler broaden and thin neutron point cross sections          *
c     *                                                                *
c     * a modified version of the kernel broadening method developed   *
c     * for sigma1 (d.e.cullen, llnl) is used.  cross sections         *
c     * for low threshold reactions are unionized on the grid of the   *
c     * total cross section, then broadened and thinned in parallel.   *
c     * high threshold reactions are not broadened.  the total and     *
c     * and nonelastic are reconstructed to equal the sum of parts.    *
c     *                                                                *
c     * the output energy grid for broadened cross sections is         *
c     * constructed adaptively (as in reconr) so that the results      *
c     * represent the true function within the given tolerance.        *
c     * energy values are either removed from the original grid, or    *
c     * new values are added between the original points.  thus, a     *
c     * given energy range can have more or fewer points than the      *
c     * original energy grid.                                          *
c     *                                                                *
c     * for high temperatures and low energies where the original      *
c     * sigma1 breaks down, a new direct expansion of the doppler      *
c     * integral is used.                                              *
c     *                                                                *
c     * if the temperature is close to 293.6 K (.0253 ev), broadr      *
c     * computes and displays thermal cross sections, maxwellian       *
c     * integrals (one-group thermal cross sections), g-factors,       *
c     * integral ratios (eta, alpha), the k1 integral and the          *
c     * corresponding 1/v-equivalent, and resonance integrals.         *
c     *                                                                *
c     * the results are written out in pendf format with each          *
c     * temperature represented as a different mat.  dictionaries      *
c     * are corrected to reflect the effects of thinning.              *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    nendf    input endf tape (for thermal nubar only)           *
c     *    nin      input pendf tape                                   *
c     *    nout     output pendf tape                                  *
c     * card 2                                                         *
c     *    mat1     material to be processed                           *
c     *    ntemp2   number of final temperatures (maximum=10)          *
c     *    istart   restart (0 no, 1 yes, default 0)                   *
c     *    istrap   bootstrap (0 no, 1 yes, default 0)                 *
c     *    temp1    starting temperature from nin (default=0.k)        *
c     * card 3                                                         *
c     *    errthn   fractional tolerance for thinning                  *
c     *    thnmax   max. energy for broadening and thinning            *
c     *             (default=1 mev)                                    *
c     *    errmax   fractional tolerance used when integral criterion  *
c     *             is satisfied (same usage as in reconr)             *
c     *             (errmax.ge.errthn, default=10*errthn)              *
c     *    errint   parameter to control integral thinning             *
c     *             (usage as in reconr) (default=errthn/20000)        *
c     *             set very small to turn off integral thinning.      *
c     *      (a good choice for the convergence parameters             *
c     *       errthn, errmax, and errint is the same set of            *
c     *       values used in reconr)                                   *
c     * card 4                                                         *
c     *    temp2    final temperatures (deg kelvin)                    *
c     * card 5                                                         *
c     *    mat1     next mat number to be processed with these         *
c     *             parameters.  terminate with mat1=0.                *
c     *                                                                *
c     *---input options------------------------------------------------*
c     *                                                                *
c     * the output tape will contain the ntemp2 final temperatures     *
c     * specified.  it is necessary to have temp1.le.temp2(1).         *
c     * if temp2.eq.temp1, the data will be thinned only.              *
c     *                                                                *
c     * restart    continue broadening an existing pendf tape.  all    *
c     *            temperatures are copied through temp1.  additional  *
c     *            final temperatures are added by starting with the   *
c     *            data at temp1.                                      *
c     *                                                                *
c     * bootstrap  if bootstrap is not requested, each final tempera-  *
c     *            ture is generated by broadening directly from       *
c     *            temp1 to temp2.  if bootstrap is requested, each    *
c     *            final temperature is broadened from the preceding   *
c     *            temperature.  this option is faster due to the      *
c     *            thinning in the previous step.  however, errors     *
c     *            accumulate.                                         *
c     *                                                                *
c     * thnmax     the upper limit for broadening and thinning is the  *
c     *            lowest of the input value of thnmax, the lowest     *
c     *            reaction threshold, or the start of the unresolved  *
c     *            range.  if there is resolved-unresolved overlap,    *
c     *            the overlap region is included in the broadening.   *
c     *            a negative value of thnmax will override the        *
c     *            resolved and threshold limits.  This allows the     *
c     *            first few threshold reactions to be broadened if    *
c     *            desired.  the magnitude of thnmax must be chosen    *
c     *            to keep the number of broadenable reactions less    *
c     *            than or equal to the maximum of ntt (10).           *
c     *                                                                *
c     ******************************************************************
c
UNRESR
c
c     ******************************************************************
c     *                                                                *
c     * compute unresolved resonance cross-sections                    *
c     *                                                                *
c     * the method of etox is used to compute self-shielded            *
c     * unresolved resonance cross-sections on the energy grid of      *
c     * the unresolved parameters.  subsequent interpolation is        *
c     * to be on the cross-sections and not on the parameters.         *
c     * additional energy grid points are added at quarter lethargy    *
c     * intervals if only three or fewer grid points are found.        *
c     * the accurate hwang quadrature set is used for the integrals.   *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *   nendf   unit for endf/b tape                                 *
c     *   nin     unit for input pendf tape                            *
c     *   nout    unit for output pendf tape                           *
c     * card 2                                                         *
c     *   matd    material to be processed                             *
c     *   ntemp   no. of temperatures (10 max)                         *
c     *   nsigz   no. of sigma zeroes (10 max)                         *
c     *   iprint  print option (0=min, 1=max) (default=0)              *
c     * card 3                                                         *
c     *   temp    temperatures in kelvin (including zero)              *
c     * card 4                                                         *
c     *   sigz    sigma zero values (including infinity)               *
c     *       cards 2, 3, 4 must be input for each material desired    *
c     *       matd=0/ terminates execution of unresr.                  *
c     *                                                                *
c     ******************************************************************
c
HEATR
c
c     ******************************************************************
c     *                                                                *
c     * compute heating kerma (kinetic energy release in material)     *
c     * and radiation damage energy production                         *
c     *                                                                *
c     * the prompt kerma is computed pointwise on the grid of the      *
c     * total cross section from the input pendf tape and written      *
c     * onto the output pendf tape at infinite dilution using the      *
c     * 300 series of mt numbers.  all temperatures on the input pendf *
c     * tape for the desired material are processed.  the dictionary   *
c     * is revised.  reaction q values are obtained from the endf/b    *
c     * tape unless the user enters his own value.  partial kermas     *
c     * can be requested for self-shielding calculations or other      *
c     * purposes.  the code uses the energy balance method where       *
c     * photon files are available and deposits all photon energy      *
c     * locally when files are not available.  this assures            *
c     * consistency between neutron heating and energy deposition by   *
c     * subsequent photon interactions.  an exception is made for      *
c     * capture where recoil is computed by momentum conservation.     *
c     * photon files are used to estimate the average photon momentum  *
c     * when available.  a diagnostic message is printed if the        *
c     * momentum calculation leads to a significant error in           *
c     * energy conservation.                                           *
c     *                                                                *
c     * if desired, the energy-balance kerma factors can be compared   *
c     * with conservative kinematic limits (set iprint=2).             *
c     * a plot file for viewr can be automatically prepared.           *
c     *                                                                *
c     * damage energy is computed using the lindhard electronic        *
c     * screening damage function with a displacement threshold        *
c     * from a table of default values for important elements          *
c     * or a value provided by the user.                               *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    nendf    unit for endf/b tape                               *
c     *    nin      unit for input pendf tape                          *
c     *    nout     unit for output pendf tape                         *
c     *    nplot     unit for graphical check output                   *
c     * card 2                                                         *
c     *    matd     material to be processed                           *
c     *    npk      number of partial kermas desired (default=0)       *
c     *    nqa      number of user q values (default=0)                *
c     *    ntemp    number of temperatures to process                  *
c     *             (default=0, meaning all on pendf)                  *
c     *    local    0/1=gamma rays transported/deposited locally       *
c     *             (default=0)                                        *
c     *    iprint   print (0 min, 1 max, 2 check) (default=0)          *
c     *    ed       displacement energy for damage                     *
c     *             (default from built-in table)                      *
c     * card 3      for npk gt 0 only                                  *
c     *    mtk      mt numbers for partial kermas desired              *
c     *             total (mt301) will be provided automatically.      *
c     *             partial kerma for reaction mt is mt+300            *
c     *             and may not be properly defined unless             *
c     *             a gamma file for mt is on endf tape.               *
c     *             special values allowed--                           *
c     *               303   non-elastic (all but mt2)                  *
c     *               304   inelastic (mt51 thru 91)                   *
c     *               318   fission (mt18 or mt19, 20, 21, 38)         *
c     *               401   disappearance (mt102 thru 120)             *
c     *               443   total kinematic kerma (high limit)         *
c     *             damage energy production values--                  *
c     *               444   total                                      *
c     *               445   elastic (mt2)                              *
c     *               446   inelastic (mt51 thru 91)                   *
c     *               447   disappearance (mt102 thru 120)             *
c     *          cards 4 and 5 for nqa gt 0 only                       *
c     * card 4                                                         *
c     *    mta      mt numbers for users q values                      *
c     * card 5                                                         *
c     *    qa       user specified q values (ev)                       *
c     *               (if qa.ge.99.e6, read in variable qbar           *
c     *                  for this reaction)                            *
c     * card 5a     variable qbar (for reactions with qa flag only)    *
c     *    qbar      tab1 record giving qbar versus e (1000 words max) *
c     *                                                                *
c     ******************************************************************
c
THERMR
c
c     ******************************************************************
c     *                                                                *
c     *  generate neutron scattering cross sections and point-to-point *
c     *  scattering kernels in the thermal range                       *
c     *                                                                *
c     *  add pointwise scattering cross sections and scattering        *
c     *  matrices to an existing pendf tape.  cross sections are       *
c     *  added to mf3 and matrices are written in mf6 (using a         *
c     *  modified format).  both using mtref for inelastic and         *
c     *  mtref+1 for elastic (if any).                                 *
c     *                                                                *
c     *  multiple scattering types (ie, h free and h in h2o) can be    *
c     *  written on one pendf tape by using different values of mtref  *
c     *  for each thermr run.  if data for one mtref is already on     *
c     *  the tape, it will be replaced with the new cross sections.    *
c     *  the energy grid for coherent scattering is determined         *
c     *  adaptively so as to represent the sharp bragg edges to        *
c     *  a specified tolerance using linear interpolation.  the        *
c     *  secondary energy grid for inelastic scattering is also deter- *
c     *  mined adaptively.  angular dependence is represented as       *
c     *  equally probable cosines.  the initial energy grid is wired in*
c     *  (see egrid in calcem).  a special projection interpolation    *
c     *  scheme is used in groupr to integrate this relatively         *
c     *  coarse grid.                                                  *
c     *                                                                *
c     *  current capabilities...                                       *
c     *     1.)  compute free-gas scattering matrices and normalize    *
c     *          to the elastic cross section on the old pendf tape.   *
c     *     2.)  compute incoherent matrices from read-in              *
c     *          s(alpha,beta) data.                                   *
c     *     3.)  compute coherent scattering from hexagonal lattices.  *
c     *     4.)  compute incoherent elastic scattering.                *
c     *                                                                *
c     *  for endf 3 to 5 formats, the constants used for coherent      *
c     *  elastic, incoherent elastic, and short-collision-time calcu-  *
c     *  lations are obtained from internal data statements based on   *
c     *  the original general atomic report on the evaluations         *
c     *  (ga-8774 revised, endf-269, july 1978).                       *
c     *                                                                *
c     *  for endf6 format libraries, these constants are included      *
c     *  in the format.                                                *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     *  card 1                                                        *
c     *     nendf      endf/b tape for mf7 data                        *
c     *     nin        old pendf tape                                  *
c     *     nout       new pendf tape                                  *
c     *  card 2                                                        *
c     *     matde      material desired on endf tape                   *
c     *     matdp      material desired on pendf tape                  *
c     *     nbin       number of equi-probable angles                  *
c     *     ntemp      number of temperatures                          *
c     *     iinc       inelastic options                               *
c     *                   0     none                                   *
c     *                   1     compute as free gas                    *
c     *                   2     reserved                               *
c     *                   3     reserved                               *
c     *                   4     read s(a,b) and compute matrix         *
c     *     icoh       elastic options                                 *
c     *                   0     none                                   *
c     *                   1     graphite                               *
c     *                   2     beryllium                              *
c     *                   3     beryllium oxide                        *
c     *                  11     polyethylene                           *
c     *                  12     h(zrh)                                 *
c     *                  13     zr(zrh)                                *
c     *     natom      number of principal atoms                       *
c     *     mtref      mt for inelastic reaction (201-250 only)        *
c     *     iprint     print option (0=minimum, 1=maximum,             *
c     *                2=max. normal + intermediate results)           *
c     *                (default=0)                                     *
c     *  card 3                                                        *
c     *     tempr      temperatures (kelvin)                           *
c     *  card 4                                                        *
c     *     tol        tolerance                                       *
c     *     emax       maximum energy for thermal treatment            *
c     *                (for temperatures greater than 3000,            *
c     *                emax and the energy grid are scaled by          *
c     *                temp/300.  free gas only.)                      *
c     *                                                                *
c     *       nendf can be endf-6 format (e.g., from leapr) while      *
c     *       nin and nout are endf-4 or 5 format, if desired.         *
c     *                                                                *
c     ******************************************************************
c
GROUPR
c
c     ******************************************************************
c     *                                                                *
c     * compute self-shielded group-averaged cross sections            *
c     *                                                                *
c     * produces self-shielded cross sections, neutron scattering      *
c     * matrices, and photon production matrices.  scattering and      *
c     * photon matrices may be self-shielded if desired (see init).    *
c     * bondarenko weighting is normally used.   optionally, the flux  *
c     * can be computed for an infinite mixture of heavy absorber      *
c     * and light moderator.  delayed neutron data and thermal         *
c     * scattering matrices are handled specially.                     *
c     *                                                                *
c     * the integration over initial energy is handled in the same     *
c     * way for all reaction types by using the integrand              *
c     *                   feed*xsec*flux                   .           *
c     * feed is the source into final energy group gprime and          *
c     * legendre order l from initial energy e (see getff).  for       *
c     * vectors, the feed is 1. or a yield (nubar, mubar).  for two    *
c     * body scattering, a center-of-mass gaussian integration is used *
c     * to obtain accurate results even for small legendre components  *
c     * of the group-to-group scattering.  additional initial energy   *
c     * quadrature points are added to integrate the known polynomial  *
c     * order of this feed function.  feed for tabulated continuum     *
c     * reactions is computed exactly on the endf/b grid points and    *
c     * then interpolated at e.  a special projection interpolation    *
c     * scheme is used for thermal matrices (see getaed).  the feed    *
c     * for analytic continuum reactions is exact.                     *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card1                                                          *
c     *    nendf   unit for endf/b tape                                *
c     *    npend   unit for pendf tape                                 *
c     *    ngout1  unit for input gout tape (default=0)                *
c     *    ngout2  unit for output gout tape (default=0)               *
c     * card2                                                          *
c     *    matb    material to be processed                            *
c     *             if ngout=0, matb<0 is an option to automatically   *
c     *              process all the mats on the endf input tape.      *
c     *             otherwise, matb<0 is a flag to add mts to and/or   *
c     *              replace individual mts on gout1.                  *
c     *    ign     neutron group structure option                      *
c     *    igg     gamma group structure option                        *
c     *    iwt     weight function option                              *
c     *    lord    legendre order                                      *
c     *    ntemp   number of temperatures                              *
c     *    nsigz   number of sigma zeroes                              *
c     *    iprint  long print option (0/1=minimum/maximum)             *
c     *            (default=1)                                         *
c     * card3                                                          *
c     *    title   run label (up to 80 characters delimited by *,      *
c     *            ended with /)  (default=blank)                      *
c     * card4                                                          *
c     *    temp    temperatures in kelvin                              *
c     * card5                                                          *
c     *    sigz    sigma zero values (including infinity)              *
c     *                                                                *
c     *          if ign=1, read neutron group structure (6a and 6b)    *
c     * card6a                                                         *
c     *    ngn     number of groups                                    *
c     * card6b                                                         *
c     *    egn     ngn+1 group breaks (ev)                             *
c     *                                                                *
c     *          if igg=1, read gamma group structure (7a and 7b)      *
c     * card7a                                                         *
c     *    ngg     number of groups                                    *
c     * card7b                                                         *
c     *    egg     ngg+1 group breaks (ev)                             *
c     *                                                                *
c     *          weight function options (8a,8b,8c,8d)                 *
c     * card8a     flux calculator parameters (iwt.lt.0 only)          *
c     *    ehi     break between computed flux and bondarenko flux     *
c     *                (must be in resolved range)                     *
c     *    sigpot  estimate of potential scattering cross section      *
c     *    nflmax  maximum number of computed flux points              *
c     *    ninwt   tape unit for new flux parameters (default=0)       *
c     *    jsigz   index of reference sigma zero in sigz array         *
c     *            (default=0)                                         *
c     *    alpha2   alpha for admixed moderator (def=o=none)           *
c     *    sam      admixed moderator xsec in barns per absorber       *
c     *             atom (def=0=none)                                  *
c     *    beta     heterogeniety parameter (def=0=none)               *
c     *    alpha3   alpha for external moderator (def=0=none)          *
c     *    gamma    fraction of admixed moderator cross section in     *
c     *              external moderator cross section (def=0)          *
c     * card8b     tabulated (iwt=1 or -1 only)                        *
c     *    wght    read weight function as tab1 record.                *
c     *            end with a /.                                       *
c     * card8c     analytic flux parameters (iwt=4 or -4 only)         *
c     *    eb      thermal break (ev)                                  *
c     *    tb      thermal temperature (ev)                            *
c     *    ec      fission break (ev)                                  *
c     *    tc      fission temperature (ev)                            *
c     * card8d     input resonance flux (iwt=0 only)                   *
c     *    ninwt   tape unit for flux parameters                       *
c     *                                                                *
c     * card9                                                          *
c     *    mfd     file to be processed                                *
c     *    mtd     section to be processed                             *
c     *    mtname  description of section to be processed              *
c     *          repeat for all reactions desired                      *
c     *          mfd=0/ terminates this temperature/material.          *
c     * card10                                                         *
c     *    matd    next mat number to be processed                     *
c     *            matd=0/ terminates groupr run.                      *
c     *                                                                *
c     *---options for input variables----------------------------------*
c     *                                                                *
c     *     ign          meaning                                       *
c     *     ---          -------                                       *
c     *      1           arbitrary structure (read in)                 *
c     *      2           csewg 239-group structure                     *
c     *      3           lanl 30-group structure                       *
c     *      4           anl 27-group structure                        *
c     *      5           rrd 50-group structure                        *
c     *      6           gam-i 68-group structure                      *
c     *      7           gam-ii 100-group structure                    *
c     *      8           laser-thermos 35-group structure              *
c     *      9           epri-cpm 69-group structure                   *
c     *     10           lanl 187-group structure                      *
c     *     11           lanl 70-group structure                       *
c     *     12           sand-ii 620-group structure                   *
c     *     13           lanl 80-group structure                       *
c     *     14           eurlib 100-group structure                    *
c     *     15           sand-iia 640-group structure                  *
c     *     16           vitamin-e 174-group structure                 *
c     *     17           vitamin-j 175-group structure                 *
c     *                                                                *
c     *     igg          meaning                                       *
c     *     ---          -------                                       *
c     *      0           none                                          *
c     *      1           arbitrary structure (read in)                 *
c     *      2           csewg 94-group structure                      *
c     *      3           lanl 12-group structure                       *
c     *      4           steiner 21-group gamma-ray structure          *
c     *      5           straker 22-group structure                    *
c     *      6           lanl 48-group structure                       *
c     *      7           lanl 24-group structure                       *
c     *      8           vitamin-c 36-group structure                  *
c     *      9           vitamin-e 38-group structure                  *
c     *     10           vitamin-j 42-group structure                  *
c     *                                                                *
c     *     iwt          meaning                                       *
c     *     ---          -------                                       *
c     *      1           read in smooth weight function                *
c     *      2           constant                                      *
c     *      3           1/e                                           *
c     *      4           1/e + fission spectrum + thermal maxwellian   *
c     *      5           epri-cell lwr                                 *
c     *      6           (thermal) -- (1/e) -- (fission + fusion)      *
c     *      7           same with t-dep thermal part                  *
c     *      8           thermal--1/e--fast reactor--fission + fusion  *
c     *      9           claw weight function                          *
c     *     10           claw with t-dependent thermal part            *
c     *     11           vitamin-e weight function (ornl-5505)         *
c     *     12           vit-e with t-dep thermal part                 *
c     *     -n           compute flux with weight n                    *
c     *      0           read in resonance flux from ninwt             *
c     *                                                                *
c     *     mfd          meaning                                       *
c     *     ---          -------                                       *
c     *      3           cross section or yield vector                 *
c     *      5           fission chi by short-cut method               *
c     *      6           neutron-neutron matrix (mf4/5)                *
c     *      8           neutron-neutron matrix (mf6)                  *
c     *     12           photon prod. xsec (photon yields given, mf12) *
c     *     13           photon prod. xsec (photon xsecs given, mf13)  *
c     *     16           neutron-gamma matrix (photon yields given)    *
c     *     17           neutron-gamma matrix (photon xsecs given)     *
c     *     18           neutron-gamma matrix (mf6)                    *
c     *         note: if necessary, mfd=13 will automatically change   *
c     *         to 12 and mfd=16 will automatically change to 17 or 18.*
c     *     21           proton production matrix (mf6)                *
c     *     22           deuteron production (mf6)                     *
c     *     23           triton production (mf6)                       *
c     *     24           he-3 production (mf6)                         *
c     *     25           alpha production (mf6)                        *
c     *     26           residual nucleus (a>4) production (mf6)       *
c     *     31           proton production matrix (mf4)                *
c     *     32           deuteron production (mf4)                     *
c     *     33           triton production (mf4)                       *
c     *     34           he-3 production (mf4)                         *
c     *     35           alpha production (mf4)                        *
c     *     36           residual nucleus (a>4) production (mf4)       *
c     *          note: if necessary, mfd=21-26 will                    *
c     *          automatically change to 31-36.                        *
c     *    1zzzaaam       nuclide production for zzzaaam               *
c     *                     subsection from file 3                     *
c     *    2zzzaaam       nuclide production for zzzaaam               *
c     *                     subsection from file 6                     *
c     *    3zzzaaam       nuclide production for zzzaaam               *
c     *                     subsection from file 9                     *
c     *    4zzzaaam       nuclide production for zzzaaam               *
c     *                     subsection from file 10                    *
c     *                                                                *
c     *     mtd          meaning                                       *
c     *     ---          -------                                       *
c     *     -n           process all mt numbers from the previous      *
c     *                          entry to n inclusive                  *
c     *     221-250      reserved for thermal scattering               *
c     *     258          average lethargy                              *
c     *     259          average inverse velocity (m/sec)              *
c     *                                                                *
c     *     automatic reaction processing options                      *
c     *     -------------------------------------                      *
c     *        3/        do all reactions in file3 on input pendf      *
c     *        6/        do all matrix reactions in endf dictionary    *
c     *       10/        do all isotope productions using mf8          *
c     *       13/        do all photon production cross sections       *
c     *       16/        do all photon production matrices             *
c     *       21/        do all proton production matrices             *
c     *       22/        do all deuteron production matrices           *
c     *       23/        do all triton production matrices             *
c     *       24/        do all he-3 production matrices               *
c     *       25/        do all alpha production matrices              *
c     *       26/        do all a>4 production matrices                *
c     *                                                                *
c     ******************************************************************
c
GAMINR
c
c     ******************************************************************
c     *                                                                *
c     * compute multigroup photon cross sections                       *
c     *                                                                *
c     * produce multigroup photon interaction cross sections           *
c     * and heating kerma factors using endf/b cross sections          *
c     * and coherent and incoherent form factors.  initial energy      *
c     * quadrature techiques are identical to those used in groupr.    *
c     * secondary energy-angle quadrature is performed using gaussian  *
c     * integration.                                                   *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card1                                                          *
c     *    nendf   unit for endf/b tape                                *
c     *    npend   unit for pendf tape                                 *
c     *    ngam1   unit for input ngam tape (default=0)                *
c     *    ngam2   unit for output ngam tape (default=0)               *
c     * card2                                                          *
c     *    matb    material to be processed                            *
c     *            input materials in ascending order                  *
c     *    igg     gamma group structure option                        *
c     *    iwt     weight function option                              *
c     *    lord    legendre order                                      *
c     *    iprint  print option (0/1=minimum/maximum) (default=1)      *
c     * card3                                                          *
c     *    title   run label up to 80 characters (delimited by *,      *
c     *            ended with /)                                       *
c     * card4      (igg=1 only)                                        *
c     *    ngg     number of groups                                    *
c     *    egg     ngg+1 group bounds (ev)                             *
c     * card5      (iwt=1 only)                                        *
c     *    wght    weight function as tab1 record                      *
c     * card6                                                          *
c     *    mfd     file to be processed                                *
c     *    mtd     section to be processed                             *
c     *    mtname  description of section to be processed              *
c     *            repeat for all reactions desired                    *
c     *            mfd=0/ terminates this material                     *
c     *            mfd=-1/ is a flag to process all sections present   *
c     *            for this material  (termination is automatic)       *
c     * card7                                                          *
c     *    matd    next mat number to be processed                     *
c     *            terminate gaminr run with matd=0.                   *
c     *                                                                *
c     *---options for input variables----------------------------------*
c     *                                                                *
c     *        igg     meaning                                         *
c     *        ---     -------                                         *
c     *         0      none                                            *
c     *         1      arbitrary structure (read in)                   *
c     *         2      csewg 94-group structure                        *
c     *         3      lanl 12-group structure                         *
c     *         4      steiner 21-group gamma-ray structure            *
c     *         5      straker 22-group structure                      *
c     *         6      lanl 48-group structure                         *
c     *         7      lanl 24-group structure                         *
c     *         8      vitamin-c 36-group structure                    *
c     *         9      vitamin-e 38-group structure                    *
c     *         10      vitamin-j 42-group structure                   *
c     *                                                                *
c     *        iwt     meaning                                         *
c     *        ---     -------                                         *
c     *         1      read in                                         *
c     *         2      constant                                        *
c     *         3      1/e + rolloffs                                  *
c     *                                                                *
c     ******************************************************************
c
ERRORR
c
c     ******************************************************************
c     *                                                                *
c     * produce cross section covariances from error files in endf/b   *
c     * format                                                         *
c     *                                                                *
c     * first, the union energy grid of the users group structure      *
c     * and the endf covariance energies is determined.  the array     *
c     * of coefficients for derived cross sections is also constructed.*
c     * then multigroup cross sections are computed on the union       *
c     * grid (see grpav), or they are read from a multigroup cross     *
c     * section library and then collapsed to the union grid.  the     *
c     * methods of groupr are used for cross section averaging.  endf  *
c     * covariances and the group cross sections are then combined     *
c     * to get the basic covariance matrices (see covcal).  finally,   *
c     * the basic matrices are combined to get covariances for         *
c     * derived reactions, the matrices are collapsed to the user-s    *
c     * group structure, and the results are printed and/or written    *
c     * onto an output gendf tape for later use (see covout).          *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     *  card 1                                                        *
c     *    nendf   unit for endf/b tape                                *
c     *    npend   unit for pendf tape                                 *
c     *    ngout   unit for input group xsec (gendf) tape              *
c     *            (if zero, group xsecs will be calculated)           *
c     *            (if iread eq 2 or if mfcov eq 31 (see card 7),      *
c     *            ngout cannot be zero)                               *
c     *            (default=0)                                         *
c     *    nout    unit for output covariance tape (default=0)         *
c     *    nin     unit for input covariance tape (default=0)          *
c     *            (nin and nout must be both coded or both binary)    *
c     *    nstan   unit for ratio-to-standard tape (default=0)         *
c     *  card 2                                                        *
c     *    matd    material to be processed                            *
c     *    ign     neutron group option                                *
c     *            (ign definition same as groupr, except ign=19,      *
c     *            which means read in an energy grid, as in ign=1,    *
c     *            and supplement this with the endf covariance grid   *
c     *            within the range of the user-specified energies)    *
c     *            (default=1)                                         *
c     *    iprint  print option (0/1=minimum/maximum) (default=1)      *
c     *    irelco  covariance form (0/1=absolute/relative) (default=1) *
c     *  card 3    (omit if ngout.ne.0)                                *
c     *    iwt     weight function option                              *
c     *    mprint  print option for group averaging (0=min., 1=max.)   *
c     *    tempin  temperature (default=300)                           *
c     *                                                                *
c     *---for endf/b version 4 (iverf=4) only--------------------------*
c     *                                                                *
c     *  card 4                                                        *
c     *    nek     number of derived xsec energy ranges                *
c     *            (if zero, all xsecs are independent)                *
c     *  card 5    (omit if nek=0)                                     *
c     *    ek      nek+1 derived xsec energy bounds                    *
c     *  card 6    (omit if nek=0)                                     *
c     *    akxy    derived cross section coefficients, one row/line    *
c     *                                                                *
c     *---for endf/b version 5 (iverf=5) only--------------------------*
c     *                                                                *
c     *  card 7                                                        *
c     *    iread   0/1/2=program calculated mts/input mts and eks/     *
c     *            calculated mts plus extra mat1-mt1 pairs from input *
c     *            (default=0)                                         *
c     *    mfcov   endf covariance file (31, 32, or 33) to be          *
c     *            processed (default=33).                             *
c     *            note--contribution to group cross section           *
c     *            covariances from resonance-parameter uncertainties  *
c     *            (mf=32) is included when mfcov=33 is specified.     *
c     *                                                                *
c     *  following cards only if iread eq 1                            *
c     *  card 8                                                        *
c     *    nmt     no. mts to be processed                             *
c     *    nek     no. derived cross section energy ranges             *
c     *            (if zero, all xsecs are independent)                *
c     *  card 8a                                                       *
c     *    mts     nmt mts                                             *
c     *  card 8b   (omit if nek=0)                                     *
c     *    ek      nek+1 derived cross section energy bounds           *
c     *  card 9    (omit if nek=0)                                     *
c     *    akxy    derived cross section coefficients, one row/line    *
c     *                                                                *
c     *  following card only if iread eq 2                             *
c     *  card 10                                                       *
c     *    mat1    cross-material reaction to be added to              *
c     *    mt1         covariance reaction list.                       *
c     *            repeat for all mat1-mt1 pairs desired               *
c     *            terminate with mat1=0.                              *
c     *                                                                *
c     *  following card only if nstan ne 0                             *
c     *  card 11                                                       *
c     *    matb    standards reaction referenced                       *
c     *    mtb         in matd.                                        *
c     *    matc    standards reaction to be                            *
c     *    mtc         used instead.                                   *
c     *            repeat for all standard reactions to be redefined.  *
c     *            terminate with matb=0.                              *
c     *  note.  if matb(1) and mtb(1) are negative, then matc(1) and   *
c     *    mtc(1) identify a third reaction, correlated with matd thru *
c     *    the use of the same standard.  covariances of all reactions *
c     *    in matd (which reference the standard) with the reaction    *
c     *    matc(1)-mtc(1) will be produced.  the standard reaction     *
c     *    must be identified on card 10 and repeated as the negative  *
c     *    entries on card 11.  the group xsec tape ngout must include *
c     *    all covariance reactions in matd, plus matc(1)-mtc(1).      *
c     *----------------------------------------------------------------*
c     *                                                                *
c     *  card 12a (for ign eq 1 or ign eq 19)                          *
c     *    ngn     number of groups                                    *
c     *  card 12b                                                      *
c     *    egn     ngn+1 group bounds (ev)                             *
c     *  card 13 (for iwt eq 1 only)                                   *
c     *    wght    weight function as a tab1 record                    *
c     *                                                                *
c     ******************************************************************
c
COVR
c
c     ******************************************************************
c     *                                                                *
c     * plot covariance data from errorr or make a condensed library.  *
c     *                                                                *
c     * in the plot option, covr plots a matrix of correlation         *
c     * coefficients and an associated pair of standard deviation      *
c     * vectors,i.e.,a covariance matrix.  the correlation             *
c     * matrix is plotted as a shaded contour plot and the vectors     *
c     * are plotted as semi-log plots,one rotated by 90 degrees.       *
c     * the log energy grids for the vector plots are identical        *
c     * to the grids for the matrix plot.  this version plots          *
c     * through viewr.                                                 *
c     *                                                                *
c     * in the library option, covr produces a condensed bcd           *
c     * covariance library in the boxer format.  this format is        *
c     * efficient for matrices of simple blocks.                       *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     *  card 1                                                        *
c     *     nin            input tape unit                             *
c     *     nout           output tape unit                            *
c     *                    (default=0=none)                            *
c     *     nplot          viewr output unit                           *
c     *                    (default=0=none)                            *
c     *                                                                *
c     *   ---cards 2, 2a, and 3a for nout.ne.0 only (plot option)      *
c     *                                                                *
c     *  card 2                                                        *
c     *     icolor          select color or monochrome style           *
c     *                       0=monochrome (uses cross hatching)       *
c     *                       1=color background and contours          *
c     *                       (default=0)                              *
c     *  card 2a                                                       *
c     *     epmin          lowest energy of interest (default=0.)      *
c     *  card 3a                                                       *
c     *     irelco         type of covariances present on nin          *
c     *                    0/1=absolute/relative covariances           *
c     *                    (default=1)                                 *
c     *     ncase          no. cases to be run (maximum=40)            *
c     *                    (default=1)                                 *
c     *     noleg          plot legend option                          *
c     *                    -1/0/1=legend for first subcase only/       *
c     *                    legend for all plots/no legends             *
c     *                    (default=0)                                 *
c     *     nstart         sequential figure number                    *
c     *                    0/n=not needed/first figure is figure n.    *
c     *                    (default=1)                                 *
c     *     ndiv           no. of subdivisions of each of the          *
c     *                    gray shades (default=1)                     *
c     *                                                                *
c     *   ---cards 2b, 3b, and 3c for nout gt 0 (library option) only--*
c     *                                                                *
c     *  card 2b                                                       *
c     *     matype         output library matrix option                *
c     *                    3/4=covariances/correlations                *
c     *                    (default=3)                                 *
c     *     ncase          no. cases to be run (maximum=40)            *
c     *                    (default=1)                                 *
c     *  card 3b                                                       *
c     *     hlibid         up to 6 characters for identification       *
c     *  card 3c                                                       *
c     *     hdescr         up to 21 characters of descriptive          *
c     *                    information                                 *
c     *                                                                *
c     *   ---cards 4 for both options---                               *
c     *                                                                *
c     *  card 4                                                        *
c     *     mat            desired mat number                          *
c     *     mt             desired mt number                           *
c     *     mat1           desired mat1 number                         *
c     *     mt1            desired mt1 number                          *
c     *                    (default for mt, mat1 and mt1 are 0,0,0     *
c     *                    meaning process all mts for this mat        *
c     *                    with mat1=mat)                              *
c     *                    (neg. values for mt, mat1, and mt1 mean     *
c     *                    process all mts for this mat, except for    *
c     *                    the mt-numbers -mt, -mat1, and -mt1.  in    *
c     *                    general, -n will strip both mt=1 and mt=n.  *
c     *                    -4 will strip mt=1, mt=3, and mt=4, and     *
c     *                    -62, for example, will strip mt=1, mt=62,   *
c     *                    mt=63, ... up to and incl. mt=90.)          *
c     *          repeat card 4 ncase times                             *
c     *                                                                *
c     * note---if more than one material appears on the input tape,    *
c     * the mat numbers must be in ascending order.                    *
c     *                                                                *
c     ******************************************************************
c
MODER
c
c     ******************************************************************
c     *                                                                *
c     *  change the mode of an endf/b tape.                            *
c     *                                                                *
c     *  also works for pendf, gendf and covariance tapes.             *
c     *  moder can also be used to select materials from an endf-type  *
c     *  tape, or to merge several materials into a new tape.          *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1       unit numbers                                      *
c     *      nin     input unit                                        *
c     *      nout    output unit                                       *
c     *                                                                *
c     *  a positive unit is coded (mode 3).                            *
c     *  a negative unit is blocked binary (njoy mode).                *
c     *                                                                *
c     *  note: abs(nin) ge 1 and le 19 is a flag to select various     *
c     *        materials from one or more input tapes, with or         *
c     *        without mode conversion.  the kind of data to be        *
c     *        processed is keyed to nin as follows:                   *
c     *             nin=1, for endf or pendf input and output,         *
c     *                 2, for gendf input and output,                 *
c     *                 3, for errorr-format input and output.         *
c     *                                                                *
c     *      cards 2 and 3 for abs (nin) ge 1 and le 19 only.          *
c     *                                                                *
c     * card 2                                                         *
c     *      tpid    tapeid for nout.  66 characters allowed           *
c     *              (delimited with *, ended with /)                  *
c     * card 3                                                         *
c     *      nin     input unit                                        *
c     *              terminate moder by setting nin=0                  *
c     *      matd    material on this tape to add to nout              *
c     ******************************************************************
c
DTFR
c
c     ******************************************************************
c     *                                                                *
c     * convert output of groupr to dtf format.                        *
c     *                                                                *
c     * processes neutron and gamma production cross sections and      *
c     * matrices.  the neutron tables can have reduced table length.   *
c     * up-scatter is allowed.  the absorption reaction is computed    *
c     * from the total cross section and total scattering.  any edits  *
c     * can be produced which are either given in the endf/b file      *
c     * or are linear combinations of endf/b cross sections.  the      *
c     * fission nu*sigf and chi are computed from the fission matrices *
c     * for all partial fission reactions.  chi includes source        *
c     * weighting.  the pl tables for l.gt.0 contain the pl weighted   *
c     * total in the total position and the pl transport cross section *
c     * in the absorption position.  the gamma tables have gamma group *
c     * 1 in position 1, 2 in position 2, etc, with a table length     *
c     * equal to the number of gamma groups.                           *
c     *                                                                *
c     * plots can be prepared in viewr format.                         *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1       units                                             *
c     *    nin       input unit with data from groupr (binary).        *
c     *    nout      output unit containing dtf tables (coded).        *
c     *              (default=0=none)                                  *
c     *    npend     input unit with pendf tape for point plots.       *
c     *              (default=0=none)                                  *
c     *    nplot     output plot info for plotr module                 *
c     *              (default=0=none)                                  *
c     * card 2       options                                           *
c     *    iprint    print control (0 minimum, 1 maximum)              *
c     *    ifilm     film control (0/1/2=no/yes with 1 plot per frame/ *
c     *              yes with 4 plots per frame (default=0)            *
c     *    iedit     edit control (0/1=in table/separate) (default=0)  *
c     *                                                                *
c     *       cards 3 through 5 only for iedit=0                       *
c     *                                                                *
c     * card 3       neutron tables                                    *
c     *    nlmax     number of neutron tables desired.                 *
c     *    ng        number of neutron groups                          *
c     *    iptotl    position of total cross section                   *
c     *    ipingp    position of in-group scattering cross section.    *
c     *    itabl     neutron table length desired.                     *
c     *    ned       number of entries in edit table (default=0).      *
c     *    ntherm    number of thermal groups (default=0).             *
c     *  card 3a only for ntherm ne 0                                  *
c     * card 3a      thermal incoherent and coherent mts               *
c     *    mti       mt for thermal incoherent data                    *
c     *    mtc       mt for thermal coherent data (default=0)          *
c     *    nlc       no. coherent legendre orders (default=0)          *
c     * card 4       edit names                                        *
c     *       six character hollerith names for edits for as many      *
c     *       cards as needed.  there will be iptotl-3 names read.     *
c     *       each name is delimited with *.                           *
c     * card 5       edit specifications                               *
c     *       ned triplets of numbers on as many cards as needed.      *
c     *       positions can appear more than once.                     *
c     *       reaction types can appear more than once.                *
c     *    jpos      position of edit quantity.                        *
c     *    mt        endf/b reaction number.                           *
c     *    mult      multiplicity to be used when adding this mt.      *
c     *                                                                *
c     *       card 6 for iedit=1                                       *
c     *                                                                *
c     * card 6       claw-format tables                                *
c     *    nlmax     number of neutron tables (def=5)                  *
c     *    ng        number of neutron groups (def=30)                 *
c     *              (number of thermal groups is zero)                *
c     *                                                                *
c     * card 7       gamma ray tables                                  *
c     *    nptabl    number of gamma tables desired (default=0)        *
c     *    ngp       number of gamma groups (default=0)                *
c     * card 8       material description                              *
c     *       one card for each table set desired.                     *
c     *       empty card (/) terminates execution of dtfr.             *
c     *    hisnam    6-character isotope name                          *
c     *    mat       material number as in endf/b (default=0)          *
c     *    jsigz     index number of sigma-zero desired (default=1)    *
c     *    dtemp     temperature desired (default=300)                 *
c     *                                                                *
c     ******************************************************************
c
CCCCR
c
c     ******************************************************************
c     *                                                                *
c     *  produce cccc-iv files from njoy intermediate cross section    *
c     *  library                                                       *
c     *                                                                *
c     *  working from a groupr output tape, this module produces       *
c     *  the following three standard interface files,                 *
c     *                                                                *
c     *           isotxs       brkoxs       dlayxs,                    *
c     *                                                                *
c     *  as specified by the committee for computer code coordination  *
c     *  (cccc), to facilitate the exchange of nuclear data for reactor*
c     *  calculations (reference 1).                                   *
c     *      in a given run, all three files can be produced using the *
c     *  same user-specified list of isotopes.  the code will ignore   *
c     *  isotopes which are not present on the groupr tape (and in the *
c     *  case of dlayxs, isotopes without delayed neutron data).       *
c     *      the isotxs coding allows for nsblk equal to one or ngroup.*
c     *  in addition, files with higher order matrices can be produced *
c     *  with a separate block for each l-order (ifopt=2) or with all  *
c     *  orders in one block (ifopt=1).  this flexibility accommodates *
c     *  large group structures.  fission vectors or fission           *
c     *  matrices can be produced.                                     *
c     *      in brkoxs, the potential scattering cross section for all *
c     *  energy groups is equal to the user-input value (xspo).        *
c     * the elastic removal f-factor is supplied as the sixth reaction.*
c     *                                                                *
c     *  1. r.d.odell. standard interface files and procedures         *
c     *     for reactor physics codes, version iv,                     *
c     *     lanl report la-6941-ms (sept.77)                           *
c     *                                                                *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     *-ccccr-                                                         *
c     * card 1 units                                                   *
c     *    nin      input unit for data from groupr                    *
c     *    nisot    output unit for isotxs (0 if isotxs not wanted)    *
c     *    nbrks    output unit for brkoxs (0 if brkoxs not wanted)    *
c     *    ndlay    output unit for dlayxs (0 if dlayxs not wanted)    *
c     * card 2 identification                                          *
c     *    lprint    print flag (0/1=not print/printed)                *
c     *    ivers     file version number (default=0)                   *
c     *    huse      user identification (12 characters)               *
c     *              delimited by *, ended by /.                       *
c     *              (default=blank)                                   *
c     * card 3                                                         *
c     *    hsetid    hollerith identification of set (12 characters)   *
c     *              delimited by *, ended by /.                       *
c     *              (default=blank)                                   *
c     * card 4 file control                                            *
c     *    ngroup    number of neutron energy groups                   *
c     *    nggrup    number of gamma energy groups                     *
c     *    niso      number of isotopes desire                         *
c     *    maxord    maximum legendre order                            *
c     *    ifopt     matrix blocking option (1/2=blocking by           *
c     *                               reaction/legendre order)         *
c     * card 5 isotope parameters (one card per isotope)               *
c     *       (first four words are hollerith, up to six characters    *
c     *       each, delimited by *)                                    *
c     *    hisnm     hollerith isotope label                           *
c     *    habsid    hollerith absolute isotope label                  *
c     *    hident    identifier of data source library (endf/b)        *
c     *    hmat      isotope identification                            *
c     *    imat      numerical isotope identifier (endf/b mat number)  *
c     *    xspo      average potential scattering cross sect. (brkoxs) *
c     *                                                                *
c     *-cisotx- (only if nisot.gt.0)                                   *
c     * card 1 file control                                            *
c     *    nsblok    subblocking option for scattering matrix          *
c     *              (1 or ngrup sub-blocks allowed)                   *
c     *    maxup     maximum number of upscatter groups (always zero)  *
c     *    maxdn     maximum number of downscatter groups              *
c     *    ichix     fission chi representation                        *
c     *                   -1   vector (using groupr flux)              *
c     *                    0   none                                    *
c     *                   +1   vector (using input flux)               *
c     *                .gt.1   matrix                                  *
c     * card 2 chi vector control (ichix=1 only)                       *
c     *    spec      ngroup flux values used to collapse the groupr    *
c     *              fission matrix into a chi vector                  *
c     * card 3 chi matrix control (ichix.gt.1 only)                    *
c     *    spec      ngroup values of spec(i)=k define the range of    *
c     *              groups i to be averaged to obtain spectrum k.     *
c     *              index k ranges from 1 to ichi.                    *
c     *              the model flux is used to weight each group i.    *
c     * card 4 isotope control (one card per isotope)                  *
c     *    kbr       isotope classification                            *
c     *    amass     gram atomic weight                                *
c     *    efiss     total thermal energy/fission                      *
c     *    ecapt     total thermal energy/capture                      *
c     *    temp      isotope temperature                               *
c     *    sigpot     average effective potential scattering           *
c     *    adens     density of isotope in mixture                     *
c     *                                                                *
c     *-cbrkxs- (only if nbrks.gt.0)                                   *
c     * card 1 (2i6) file data                                         *
c     *    nti       number of temperatures desired                    *
c     *              (-n means accept first n temperatures)            *
c     *    nzi       number of sigpo values desire                     *
c     *              (-n means accept first n dilution factors)        *
c     * card 2 (not needed if nti.lt.0)                                *
c     *    atem(nti) values of desired temperatures                    *
c     * card 3 (not needed if nzi.lt.0)                                *
c     *    asig(nzi) values of desired sigpo                           *
c     *                                                                *
c     *-cdlayx-- no input required                                     *
c     *                                                                *
c     ******************************************************************
c
MATXSR
c
c     ******************************************************************
c     *                                                                *
c     *  produce matxs interface file from njoy intermediate cross     *
c     *  section data from group or gaminr                             *
c     *                                                                *
c     *  the matxs file uses a generalized, flexible format based on   *
c     *  the cccc interface conventions.  working from groupr and/or   *
c     *  gaminr output tapes, this module can process neutron,         *
c     *  thermal, photon, and charged-particle data into a             *
c     *  single output file.  this file can then be used by the        *
c     *  transx code to prepare data libraries for transport codes.    *
c     *
c     *  a matxs file specification may be found following the         *
c     *  input instructions.                                           *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1 units                                                   *
c     *   ngen1     input unit for data from groupr                    *
c     *   ngen2     input unit for data from gaminr                    *
c     *   nmatx     output unit for matxs                              *
c     *   ngen3     incident proton data from groupr (default=0)       *
c     *   ngen4     incident deuteron data from groupr (default=0)     *
c     *   ngen5     incident triton data from groupr (default=0)       *
c     *   ngen6     incident he3 data from groupr (default=0)          *
c     *   ngen7     incident alpha data from groupr (default=0)        *
c     * card 2 user identification                                     *
c     *   ivers     file version number (default=0)                    *
c     *   huse      user id (up to 16 characters, delimited by *,      *
c     *             ended by /) (default=blank)                        *
c     * card 3 file control                                            *
c     *   npart     number of particles for which group                *
c     *                structures are given                            *
c     *   ntype     number of data types in set                        *
c     *   nholl     number of cards to be read for hollerith           *
c     *             identification record.                             *
c     *   nmat      number of materials desired                        *
c     * card 4 set hollerith identification                            *
c     *   hsetid    hollerith identification of set                    *
c     *             (each line can be up to 72 characters,             *
c     *             delimited with *, ended by /)                      *
c     * card 5 particle identifiers                                    *
c     *   hpart     hollerith identifiers for particles                *
c     *             (up to 8 characters each)                          *
c     * card 6 energy groups                                           *
c     *   ngrp      number of groups for each particle                 *
c     * card 7 data type identifiers                                   *
c     *   htype     hollerith identifiers for data types               *
c     *             (up to 8 characters each)                          *
c     * card 8 input particle ids                                      *
c     *   jinp     input particle id for each data type                *
c     * card 9 output particle ids                                     *
c     *   joutp    output particle id for each data type               *
c     * card 10 material data (one card per material)                  *
c     *   hmat      hollerith material identifier                      *
c     *             (up to 8 characters each)                          *
c     *   matno     integer material identifier                        *
c     *             (endf/b mat number)                                *
c     *   matgg     mat number for photoatomic data                    *
c     *             (default=100*(matno/100) as in endf-6)             *
c     *                                                                *
c     ******************************************************************
c
c
c***********************************************************************
c               proposed 09/09/77                                      -
c                       (modified 09/80)                               -
c                       (nomenclature changed 06/88)                   -
c                       (modified for const sub-blocks 06/90)          -
c                       (ordering changed 10/90)                       -
c     c                       (bcd format changed 12/21/91)
c                                                                      -
cf           matxs                                                     -
ce           material cross section file                               -
c                                                                      -
cn                       this file contains cross section              -
cn                       vectors and matrices for all                  -
cn                       particles, materials, and reactions;          -
cn                       delayed neutron spectra by time group;        -
cn                       and decay heat and photon spectra.            -
c                                                                      -
cn           formats given are for file exchange only                  -
c                                                                      -
c***********************************************************************
c
c
c-----------------------------------------------------------------------
cs          file structure                                             -
cs                                                                     -
cs              record type                       present if           -
cs              ==============================    ===============      -
cs              file identification                 always             -
cs              file control                        always             -
cs              set hollerith identification        always             -
cs              file data                           always             -
cs                                                                     -
cs   *************(repeat for all particles)                           -
cs   *          group structures                    always             -
cs   *************                                                     -
cs                                                                     -
cs   *************(repeat for all materials)                           -
cs   *          material control                    always             -
cs   *                                                                 -
cs   * ***********(repeat for all submaterials)                        -
cs   * *        vector control                      n1db.gt.0          -
cs   * *                                                               -
cs   * * *********(repeat for all vector blocks)                       -
cs   * * *      vector block                        n1db.gt.0          -
cs   * * *********                                                     -
cs   * *                                                               -
cs   * * *********(repeat for all matrix blocks)                       -
cs   * * *      matrix control                      n2d.gt.0           -
cs   * * *                                                             -
cs   * * * *******(repeat for all sub-blocks)                          -
cs   * * * *    matrix sub-block                    n2d.gt.0           -
cs   * * * *******                                                     -
cs   * * *                                                             -
cs   * * *      constant sub-block                  jconst.gt.0        -
cs   * * *                                                             -
cs   *************                                                     -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr           file identification                                       -
c                                                                      -
cl    hname,(huse(i),i=1,2),ivers                                      -
c                                                                      -
cw    1+3*mult                                                         -
c                                                                      -
cb    format(4h 0v ,a8,1h*,2a8,1h*,i6)
c                                                                      -
cd    hname         hollerith file name  - matxs -  (a8)               -
cd    huse          hollerith user identifiation    (a8)               -
cd    ivers         file version number                                -
cd    mult          double precision parameter                         -
cd                       1- a8 word is single word                     -
cd                       2- a8 word is double precision word           -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr           file control                                              -
c                                                                      -
cl    npart,ntype,nholl,nmat,maxw,length                               -
c                                                                      -
cw    6                                                                -
c                                                                      -
cb    format(6h 1d   ,6i6)
c                                                                      -
cd    npart       number of particles for which group                  -
cd                   structures are given                              -
cd    ntype       number of data types present in set                  -
cd    nholl       number of words in set hollerith                     -
cd                    identification record                            -
cd    nmat        number of materials on file                          -
cd    maxw        maximum record size for sub-blocking                 -
cd    length      length of file                                       -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr           set hollerith identification                              -
c                                                                      -
cl    (hsetid(i),i=1,nholl)                                            -
c                                                                      -
cw    nholl*mult                                                       -
c                                                                      -
cb    format(4h 2d /(9a8))
c                                                                      -
cd    hsetid      hollerith identification of set (a8)                 -
cd                 (to be edited out 72 characters per line)           -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          file data                                                  -
c                                                                      -
cl    (hprt(j),j=1,npart),(htype(k),k=1,ntype),(hmatn(i),i=1,nmat),    -
cl   1(ngrp(j),j=1,npart),(jinp(k),k=1,ntype,(joutp(k),k=1,ntype),     -
cl   2(nsubm(i)i=1,nmat),(locm(i),i=1,nmat)                            -
c                                                                      -
cw    (npart+ntype+nmat)*mult+2*ntype+npart+2*nmat                     -
c                                                                      -
cb    format(4h 3d ,4x,8a8/(9a8))    hprt,htype,hmatn
cb    format(12i6)                  ngrp,jinp,joutp,nsubm,locm         -
c                                                                      -
cd    hprt(j)     hollerith identification for particle j              -
cd                     n         neutron                               -
cd                     g         gamma                                 -
cd                     p         proton                                -
cd                     d         deuteron                              -
cd                     t         triton                                -
cd                     h         he-3 nucleus                          -
cd                     a         alpha (he-4 nucleus)                  -
cd                     b         beta                                  -
cd                     r         residual or recoil                    -
cd                               (heavier than alpha)                  -
cd    htype(k)     hollerith identification for data type k            -
cd                     nscat     neutron scattering                    -
cd                     ng        neutron induced gamma production      -
cd                     gscat     gamma scattering                      -
cd                     pn        proton induced neutron production     -
cd                       .          .                                  -
cd                       .          .                                  -
cd                       .          .                                  -
cd                     dkn       delayed neutron data                  -
cd                     dkhg      decay heat and gamma data             -
cd                     dkb       decay beta data                       -
cd    hmatn(i)    hollerith identification for material i              -
cd    ngrp(j)      number of energy groups for particle j              -
cd    jinp(k)     type of incident particle associated with            -
cd                   data type k.  for dk data types, jinp is 0.       -
cd    joutp(k)    type of outgoing particle associated with            -
cd                   data type k                                       -
cd    nsubm(i)    number of submaterials for material i                -
cd    locm(i)     location of material i                               -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          group structure                                            -
c                                                                      -
cl    (gpb(i),i=1,ngr),emin                                            -
c                                                                      -
cc    ngr=ngrp(j)                                                      -
c                                                                      -
cw    ngrp(j)+1                                                        -
c                                                                      -
cb    format(4h 4d ,8x,1p,5e12.5/(6e12.5))
c                                                                      -
cd    gpb(i)      maximum energy bound for group i for particle j      -
cd    emin        minimum energy bound for particle j                  -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          material control                                           -
c                                                                      -
cl    hmat,amass,(temp(i),sigz(i),itype(i),n1d(i),n2d(i),              -
cl   1locs(i),i=1,nsubm)                                               -
c                                                                      -
cw    mult+1+6*nsubm                                                   -
c                                                                      -
cb    format(4h 5d ,a8,1p,2e12.5/(2e12.5,5i6))
c                                                                      -
cd    hmat        hollerith material identifier                        -
cd    amass       atomic weight ratio                                  -
cd    temp        ambient temperature or other parameters for          -
cd                    submaterial i                                    -
cd    sigz        dilution factor or other parameters for              -
cd                    submaterial i                                    -
cd    itype       data type for submaterial i                          -
cd    n1d         number of vectors for submaterial i                  -
cd    n2d         number of matrix blocks for submaterial i            -
cd    locs        location of submaterial i                            -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          vector control                                             -
c                                                                      -
cl    (hvps(i),i=1,n1d),(nfg(i),i=1,n1d),(nlg(i),i=1,n1d)              -
c                                                                      -
cw    (mult+2)*n1d                                                     -
c                                                                      -
cb    format(4h 6d ,4x,8a8/(9a8))      hvps
cb    format(12i6)                    iblk,nfg,nlg                     -
c                                                                      -
cd    hvps(i)     hollerith identifier of vector                       -
cd                      nelas     neutron elastic scattering           -
cd                      n2n       (n,2n)                               -
cd                      nnf       second chance fission                -
cd                      gabs      gamma absorption                     -
cd                      p2n       protons in, 2 neutrons out           -
cd                         .          .                                -
cd                         .          .                                -
cd                         .          .                                -
cd    nfg(i)      number of first group in band for vector i           -
cd    nlg(i)      number of last group in band for vector i            -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          vector block                                               -
c                                                                      -
cl    (vps(i),i=1,kmax)                                                -
c                                                                      -
cc    kmax=sum over group band for each vector in block j              -
c                                                                      -
cw    kmax                                                             -
c                                                                      -
cb    format(4h 7d ,8x,1p,5e12.5/(6e12.5))
c                                                                      -
cd    vps(i)      data for group bands for vectors in block j.         -
cd                block size is determined by taking all the group     -
cd                bands that have a total length less than or equal    -
cd                to maxw.                                             -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr        scattering matrix control                                    -
c                                                                      -
cl    hmtx,lord,jconst,
cl   1(jband(l),l=1,noutg(k)),(ijj(l),l=1,noutg(k))                    -
c                                                                      -
cw    mult+2+2*noutg(k)                                                -
c                                                                      -
cb    format(4h 8d ,4x,a8/(12i6))      hmtx,lord,jconst,
cb                                     jband,ijj                       -
c                                                                      -
cd    hmtx        hollerith identification of block                    -
cd    lord        number of orders present                             -
cd    jconst      number of groups with constant spectrum              -
cd    jband(l)    bandwidth for group l                                -
cd    ijj(l)      lowest group in band for group l                     -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          scattering sub-block                                       -
c                                                                      -
cl    (scat(k),k=1,kmax)                                               -
c                                                                      -
cc    kmax=lord times the sum over all jband in the group range of     -
cc            this sub-block                                           -
c                                                                      -
cb    format(4h 9d ,8x,1p,5e12.5/(6e12.5))
c                                                                      -
cw    kmax                                                             -
c                                                                      -
cd    scat(k)     matrix data given as bands of elements for initial   -
cd                groups that lead to each final group.  the order     -
cd                of the elements is as follows:  band for p0 of       -
cd                group i, band for p1 of group i, ... , band for p0   -
cd                of group i+1, band for p1 of group i+1, etc.  the    -
cd                groups in each band are given in descending order.   -
cd                the size of each sub-block is determined by the      -
cd                total length of a group of bands that is less than   -
cd                or equal to maxw.                                    -
cd                                                                     -
cd                if jconst.gt.0, the contributions from the jconst    -
cd                low-energy groups are given separately.              -
c                                                                      -
c-----------------------------------------------------------------------
c                                                                      -
c                                                                      -
c-----------------------------------------------------------------------
cr          constant sub-block                                         -
c                                                                      -
cl    (spec(l),l=1,noutg(k)),(prod(l),l=l1,ning(k))                    -
c                                                                      -
cc    l1=ning(k)-jconst+1                                              -
c                                                                      -
cw    noutg(k)+jconst                                                  -
c                                                                      -
cb    format(4h10d ,8x,1p,5e12.5/(6e12.5))
c                                                                      -
cd    spec        normalized spectrum of final particles for initial   -
cd                particles in groups l1 to ning(k)                    -
cd    prod        production cross section (e.g., nu*sigf) for         -
cd                initial groups l1 through ning(k)                    -
cd                                                                     -
cd         this option is normally used for the energy-independent     -
cd         neutron and photon spectra from fission and radiative       -
cd         capture usually seen at low energies.                       -
c                                                                      -
c-----------------------------------------------------------------------
c
c     ******************************************************************
c
RESXSR
c
c     ******************************************************************
c     *                                                                *
c     *  construct an resxs resonance cross section                    *
c     *  file from njoy pendf cross sections.                          *
c     *                                                                *
c     *  user input                                                    *
c     *                                                                *
c     *   card 1   units                                               *
c     *      nout     output unit                                      *
c     *                                                                *
c     *   card 2   control                                             *
c     *      nmat     number of materials                              *
c     *      maxt     max. number of temperatures                      *
c     *      nholl    number of lines of descriptive comments          *
c     *      efirst   lower energy limit (ev)                          *
c     *      elast    upper energy limit                               *
c     *      eps      thinning tolerance                               *
c     *                                                                *
c     *   card 3   user id                                             *
c     *      huse     hollerith user identification (up to 16 chars)   *
c     *      ivers    file version number                              *
c     *                                                                *
c     *   card 4   descriptive data (repeat nholl times)               *
c     *      holl     line of hollerith data (72 chars max)            *
c     *                                                                *
c     *   card 5   material specifications (repeat nmat times)         *
c     *      hmat     hollerith name for material (up to 8 chars)      *
c     *      mat      endf mat number for material                     *
c     *      unit     njoy unit number for pendf data                  *
c     *                                                                *
c     *       the resxs format specification follows:                  *
c     *                                                                *
c***********************************************************************
c               proposed 09/24/90                                      -
c                                                                      -
cf           resxs                                                     -
ce           resonance cross section file                              -
c                                                                      -
cn                       this file contains pointwise cross            -
cn                       sections for the epithermal resonance         -
cn                       range to be used for hyper-fine flux          -
cn                       calculations.  elastic, fission, and          -
cn                       capture cross sections are given vs           -
cn                       temperature.  linear interpolation is         -
cn                       assumed.                                      -
c                                                                      -
cn           formats given are for file exchange only                  -
c                                                                      -
c***********************************************************************
c
c
c-----------------------------------------------------------------------
cs          file structure                                             -
cs                                                                     -
cs              record type                       present if           -
cs              ==============================    ===============      -
cs              file identification                 always             -
cs              file control                        always             -
cs              set hollerith identification        always             -
cs              file data                           always             -
cs                                                                     -
cs   *************(repeat for all materials)                           -
cs   *          material control                    always             -
cs   *                                                                 -
cs   * ***********(repeat for all cross section blocks)                -
cs   * *        cross section block                 always             -
cs   * ***********                                                     -
cs   *************                                                     -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr           file identification                                       -
c                                                                      -
cl    hname,(huse(i),i=1,2),ivers                                      -
c                                                                      -
cw    1+3*mult                                                         -
c                                                                      -
cb    format(4h ov ,a8,1h*,2a8,1h*,i6)                                 -
c                                                                      -
cd    hname         hollerith file name  - resxs -  (a8)               -
cd    huse          hollerith user identifiation    (a8)               -
cd    ivers         file version number                                -
cd    mult          double precision parameter                         -
cd                       1- a8 word is single word                     -
cd                       2- a8 word is double precision word           -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr           file control                                              -
c                                                                      -
cl    efirst,elast,nholl,nmat,nblok
c                                                                      -
cw    5                                                                -
c                                                                      -
cb    format(4h 1d ,2i6)                                               -
c                                                                      -
cd    efirst      lowest energy on file (ev)                           -
cd    elast       highest enery on file (ev)                           -
cd    nholl       number of words in set hollerith                     -
cd                    identification record                            -
cd    nmat        number of materials on file                          -
cd    nblok       energy blocking factor                               -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr           set hollerith identification                              -
c                                                                      -
cl    (hsetid(i),i=1,nholl)                                            -
c                                                                      -
cw    nholl*mult                                                       -
c                                                                      -
cb    format(4h 2d ,8a8/(9a8))                                         -
c                                                                      -
cd    hsetid      hollerith identification of set (a8)                 -
cd                 (to be edited out 72 characters per line)           -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          file data                                                  -
c                                                                      -
cl    (hmatn(i),i=1,nmat),(ntemp(i),i=1,nmat),(locm(i),i=1,nmat)       -
c                                                                      -
cw    (mult+2)*nmat                                                    -
c                                                                      -
cb    format(4h 3d ,8a8/(9a8))      hmatn                              -
cb    format(12i6)                  ntemp,locm                         -
c                                                                      -
cd    hmatn(i)    hollerith identification for material i              -
cd    ntemp(i)    number of temperatures for material i                -
cd    locm(i)     location of material i                               -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          material control                                           -
c                                                                      -
cl    hmat,amass,(temp(i),i=1,ntemp),nreac,nener                       -
c                                                                      -
cw    mult+3+ntemp                                                     -
c                                                                      -
cb    format(4h 6d ,a8,1h*,1p1e12.5/(6e12.5))     hmat,temp            -
cb    format(2i6)                                 nener,blok           -
c                                                                      -
cd    hmat        hollerith material identifier                        -
cd    amass       atomic weight ratio                                  -
cd    temp        temperature values for this material                 -
cd    nreac       number of reactions for this material                -
cd                  (3 for fissionable, 2 for nonfissionable)          -
cd    nener       number of energies for this material                 -
c                                                                      -
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
cr          cross section block                                        -
c                                                                      -
cl    (xsb(i),i=1,imax)                                                -
c                                                                      -
cc    imax=3*ntemp*(number of energies in the block)                   -
c                                                                      -
cw    imax                                                             -
c                                                                      -
cb    format(4h 8d ,1p5e12.5/(6e12.5))                                 -
c                                                                      -
cd    xsb(i)      data for a block of nblok or fewer point energy      -
cd                values.  the data values given for each energy       -
cd                are nelas, nfis, and ng at temp(1), followed by      -
cd                nelas, nfis, and ng at temp(2), and so on.           -
c                                                                      -
c-----------------------------------------------------------------------
c
c
ACER
c
c     ******************************************************************
c     *                                                                *
c     * prepare a data library for mcnp,                               *
c     * the los alamos continuous energy monte carlo code              *
c     *                                                                *
c     *    --- continuous (fast) data ---                              *
c     *                                                                *
c     * reaction cross sections are reconstructed on the grid of the   *
c     * total cross section from the input pendf tape (assumed to be   *
c     * linearized and unionized).  redundant reactions (except for    *
c     * mt1, mt452, and reactions needed for photon yields) are        *
c     * removed.  mt18 is considered redundant if mt19 is present.     *
c     * angular distributions are converted into either 32 equally     *
c     * probable bins, or into cummulative probability distributions.  *
c     * tabulated energy distributions are converted into "law 4"      *
c     * probability distributions.  analytic secondary-energy          *
c     * distributions are converted into their ace formats.            *
c     * coupled energy-angle distributions (file 6) are converted      *
c     * into ace laws.  the old format supports law44 for tabulated    *
c     * data with kalbach systematics, law67 for angle-energy data,    *
c     * and law66 for phase space.  the newer format adds law61 with   *
c     * with cummulative angle distributions for legendre or tabulated *
c     * distributions (see newfor).  all photon production cross       *
c     * sections are combined on the cross section energy grid.        *
c     * if provided, multigroup photon production data is summed       *
c     * and converted into a set of equally probable emission          *
c     * energies for each input group.  detailed photon production     *
c     * data can be generated directly from files 12, 13, 14, 15,      *
c     * and 16 from the input endf tapes and written out using the     *
c     * "law 4" cummulative energy distribution format.                *
c     *                                                                *
c     *    --- thermal data ---                                        *
c     *                                                                *
c     * the data from the pendf tape as prepared by the thermr         *
c     * module is read in.  inelastic and incoherent elastic cross     *
c     * sections are stored directly.  coherent elastic cross          *
c     * sections are converted to a cummulative "stair step" form      *
c     * and stored.  the angular representation for incoherent         *
c     * elastic is stored directly.  none is needed for coherent       *
c     * elastic.  the incoherent inelastic energy distributions        *
c     * are converted into probability bins with the equally           *
c     * probable angles left unchanged.  the bins can have equal       *
c     * probabilities or variable probabilities.  in the latter        *
c     * case, outlying bins with smaller probabilities are provided    *
c     * to extend the sampling to rare events.                         *
c     *                                                                *
c     *    --- dosimetry data ---                                      *
c     *                                                                *
c     * endf cross sections for dosimetry reactions are simply         *
c     * stored in ace format without changing the energy grid.         *
c     * the endf interpolation law is also provided.                   *
c     *                                                                *
c     *    --- photoatomic data ---                                    *
c     *                                                                *
c     * photon interaction cross sections are stored on the grid of    *
c     * the total cross section.  the coherent form factor is          *
c     * stored together with an integral over the form factor that     *
c     * is used in sampling for coherent scattering.  the              *
c     * incoherent scattering function is simply stored.  photon       *
c     * heating is calculated from the incoherent scattering data,     *
c     * the pair production data, and the photoelectric absorption     *
c     * data.  the input photoatomic data is mounted on nendf.         *
c     * fluorescence data can be generated from atomic relaxation      *
c     * data in endf format mounted on npend.                          *
c     *                                                                *
c     *    --- photonuclear data ---                                   *
c     *                                                                *
c     * photonuclear data are processed from new evaluations now       *
c     * available in endf format using a new ace format developed      *
c     * for mcnp and mcnpx.                                            *
c     *                                                                *
c     *    --- particle production ---                                 *
c     *                                                                *
c     * with the new format (see newfor), for charged particles, and   *
c     * for photonuclear data, new sections are written describing the *
c     * distributions of light particles produced that are different   *
c     * from the incident particle.                                    *
c     *                                                                *
c     *    --- incident charged particles ---                          *
c     *                                                                *
c     * incident charged particles are automatically recognized from   *
c     * the input tape.                                                *
c     *                                                                *
c     *    --- mcnpx format ---                                        *
c     *                                                                *
c     * mcnpx format is given to support a proposed extension of       *
c     * the zaid indentifier that uses three digits and two letters    *
c     * to the right of the decimal.  this will increase flexibility   *
c     * for handling exotic particles and provide more space for       *
c     * different data versions.  to request mcnpx format, set the     *
c     * value of iopt negative.                                        *
c     *                                                                *
c     *    --- output ---                                              *
c     *                                                                *
c     * the ace output file can be type 1 (formatted) or type 2        *
c     * (f77 binary).  type 3 is no longer used.  a line of file       *
c     * directory information is also written.  it must normally       *
c     * be edited to tell the system the path to the file.  acer       *
c     * can also be used to print, edit, or convert the mode of        *
c     * existing ace-format files.                                     *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    nendf    unit for input endf/b tape                         *
c     *    npend    unit for input pendf tape                          *
c     *    ngend    unit for input multigroup photon data              *
c     *    nace     unit for output ace tape                           *
c     *    ndir     unit for output mcnp directory                     *
c     * card 2                                                         *
c     *    iopt     type of acer run option                            *
c     *               1   fast data                                    *
c     *               2   thermal data                                 *
c     *               3   dosimetry data                               *
c     *               4   photo-atomic data                            *
c     *               5   photo-nuclear data                           *
c     *               7   read type 1 ace files to print or edit       *
c     *               8   read type 2 ace files to print or edit       *
c     *                set iopt negative for mcnpx format              *
c     *    iprint   print control (0 min, 1 max, default=1)            *
c     *    ntype    ace output type (1, 2, or 3, default=1)            *
c     *    suff     id suffix for zaid (default=.00)                   *
c     *    nxtra    number of iz,aw pairs to read in (default=0)       *
c     * card 3                                                         *
c     *    hk       descriptive character string (70 char max)         *
c     *             delimited by quotes                                *
c     * card 4 (nxtra.gt.0 only)                                       *
c     *    iz,aw    nxtra pairs of iz and aw                           *
c     *                                                                *
c     *    --- fast data (iopt=1 only) ---                             *
c     *                                                                *
c     * card 5                                                         *
c     *    matd     material to be processed                           *
c     *    tempd    temperature desired (kelvin) (default=300)         *
c     * card 6                                                         *
c     *    newfor   use new cummulative angle distributions,           *
c     *               law 61, and outgoing particle distributions.     *
c     *               (0=no, 1=yes, default=1)                         *
c     *    iopp     detailed photons (0=no, 1=yes, default=1)          *
c     * card 7                                                         *
c     *  type of thinning is determined by sign of thin(1)             *
c     *  (pos. or zero/neg.=energy skip/integral fraction)             *
c     *  (all entries defaulted=no thinning)                           *
c     *    thin(1)  e1 energy below which to use all energies (ev)     *
c     *             or iwtt weighting option (1=flat,2=1/e)            *
c     *             (1/e actually has weight=10 when e lt .1)          *
c     *    thin(2)  e2 energy above which to use all energies          *
c     *             or target number of points                         *
c     *    thin(3)  iskf skip factor--use every iskf-th energy         *
c     *             between e1 and e2, or rsigz reference sigma zero   *
c     *                                                                *
c     *   --- thermal data (iopt=2 only) ---                           *
c     *                                                                *
c     * card 8                                                         *
c     *    matd     material to be processed                           *
c     *    tempd    temperature desired (kelvin) (default=300)         *
c     *    tname    thermal zaid name ( 6 char max, def=za)            *
c     * card 8a                                                        *
c     *    iza01    moderator component za value                       *
c     *    iza02    moderator component za value (def=0)               *
c     *    iza03    moderator component za value (def=0)               *
c     * card 9                                                         *
c     *    mti      mt for thermal incoherent data                     *
c     *    nbint    number of bins for incoherent scattering           *
c     *    mte      mt for thermal elastic data                        *
c     *    ielas    0/1=coherent/incoherent elastic                    *
c     *    nmix     number of atom types in mixed moderator            *
c     *             (default=1, not mixed)                             *
c     *             (example, 2 for beo or c6h6)                       *
c     *    emax     maximum energy for thermal treatment (ev)          *
c     *             (default=1000.=determined from mf3, mti)           *
c     *    iwt      weighting option                                   *
c     *             0/1=variable/constant (default=variable)           *
c     *                                                                *
c     *   --- dosimetry data (iopt=3 only) ---                         *
c     *                                                                *
c     * card 10                                                        *
c     *    matd     material to be processed                           *
c     *    tempd    temperature desired (kelvin) (default=300)         *
c     *                                                                *
c     *   --- photo-atomic data (iopt=4 only) ---                      *
c     *                                                                *
c     * card 11                                                        *
c     *    matd     material to be processed                           *
c     *                                                                *
c     *   --- photo-nuclear data (iopt=5 only) ---                     *
c     *                                                                *
c     * card 11                                                        *
c     *    matd     material to be processed                           *
c     *                                                                *
c     *   --- print or edit existing files (iopt=7-9) ---              *
c     *                                                                *
c     *    no additional input cards are required.  mount the old      *
c     *    ace tape on "npend".  the code can modify zaid, hk,         *
c     *    the (iz,aw) list, and the type of the file.  use suff<0     *
c     *    to leave the old zaid unchanged.  use just "/" on           *
c     *    card 3 to leave the comment field hk unchanged.  use        *
c     *    nxtra=0 to leave the old iz,aw list unchanged.              *
c     *    the code can modify zaid, hk, and type of file.             *
c     *                                                                *
c     *   exhaustive consistency checks are automatically made on      *
c     *   the input file.  if ngend.ne.0, a set of standard ace plots  *
c     *   are prepared on unit ngend as plotr input instructions.      *
c     *                                                                *
c     ******************************************************************
c
POWR
c
c     ******************************************************************
c     *                                                                *
c     *  produce input for the epri-cell codes gamtap (fast) and       *
c     *  librar (thermal), and the epri-cpm code clib.                 *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    ngendf  unit for input gout tape                            *
c     *    nout    unit for output tape                                *
c     * card 2                                                         *
c     *    lib     library option (1=fast, 2=thermal, 3=cpm)           *
c     *    iprint  print option (0=minimum, 1=maximum)                 *
c     *            (default=0)                                         *
c     *    iclaps  group collapsing option (0=collapse from 185 group  *
c     *            to desired group structure, 1=no collapse)          *
c     *            (default=0)                                         *
c     *                                                                *
c     *---for lib=1----------------------------------------------------*
c     *                                                                *
c     * card 3                                                         *
c     *    matd    material to be processed                            *
c     *            if matd lt 0, read-in absorption data only for      *
c     *            this material with mat=abs(matd) directly from      *
c     *            input deck (see card 6)                             *
c     *   following three parameters irrelevant for matd lt 0          *
c     *    rtemp   reference temperature (degrees kelvin)              *
c     *            (default=300  k)                                    *
c     *    iff     f-factor option                                     *
c     *            (0/1=do not calculate f-factors/calculate if found) *
c     *            (default=1)                                         *
c     *    nsgz    no. of sigma zeroes to process for this material    *
c     *            (default=0=all found on input tape)                 *
c     *    izref   ref. sigzero for elastic matrix (default=1)         *
c     * cards 4 and 5 for normal run only (matd gt 0)                  *
c     * card 4                                                         *
c     *    word    description of nuclide (up to 16 characters,        *
c     *            delimited with *, ended with /)  (default=blank)    *
c     * card 5                                                         *
c     *    fsn     title of fission spectrum (up to 40 characters,     *
c     *            delimited with *, ended with /0  (default=blank)    *
c     *             delimited with *, ended with /)  (default=blank)   *
c     * card 6 for reading in absorption data only                     *
c     *    abs     ngnd absorption values (default values=0)           *
c     * repeat cards 3 through 6 for each material desired.            *
c     * terminate with matd=0/ (i.e., a 0/ card).                      *
c     *                                                                *
c     *---for lib=2----------------------------------------------------*
c     *                                                                *
c     * card 3                                                         *
c     *    matd    material to be processed                            *
c     *    idtemp  temperature id (default=300  k)                     *
c     *    name    hollerith name of isotope (up to 10 characters,     *
c     *            delimited with *, ended with /)  (default=blank)    *
c     * card 4     default for all values=0.                           *
c     *    itrc    transport correction option (0 no, 1 yes)           *
c     *    mti     thermal inelastic mt                                *
c     *    mtc     thermal elastic mt                                  *
c     * card 5     default for all values=0.                           *
c     *    xi                                                          *
c     *    alpha                                                       *
c     *    mubar                                                       *
c     *    nu                                                          *
c     *    kappa fission                                               *
c     *    kappa capture                                               *
c     *    lambda                                                      *
c     *    sigma s   if 0, set to scattering cross section at group 35 *
c     * repeat cards 3 thru 5 for each material and temperature desired*
c     * (maximum number of temperatures allowed is 7.)                 *
c     * terminate with matd=0/ (i.e., a 0/ card).                      *
c     *                                                                *
c     *---for lib=3----------------------------------------------------*
c     *                                                                *
c     * card 3                                                         *
c     *    nlib    number of library.                                  *
c     *    idat    date library is written (i format).                 *
c     *    newmat  number of materials to be added.                    *
c     *    iopt    add option (0=mats will be read in,                 *
c     *                        1=use all mats found on ngendf).        *
c     *    mode    0/1/2=replace isotope(2) in cpmlib/                 *
c     *                   add/create a new library (default=0)         *
c     *    if5     file5 (burnup data) option                          *
c     *            0/1/2=do not process file5 burnup data/             *
c                        process burnup data along with rest of data/  *
c     *                   process burnup data only (default=0)         *
c     *            (default=0)                                         *
c     *    if4     file4 (cross section data) option                   *
c     *            0/1=do not process/process                          *
c     *            (default=1)                                         *
c     * card 4 for iopt=0 only                                         *
c     *    mat     endf mat number of all desired materials.           *
c     *            for materials not on gendf tape, use ident for mat. *
c     *            if mat lt 0, add 100 to output ident                *
c     *            (for second isomer of an isotope)                   *
c     * card 5                                                         *
c     *    nina    nina indicator.                                     *
c     *            0/1/2/3=normal/                                     *
c     *                  no file2 data, calculate absorption in file4/ *
c     *                  no file2 data, read in absorption in file4/   *
c     *                  read in all file2 and file4 data.             *
c     *    ntemp   no. of temperatures to process for this material    *
c     *            (default=0=all found on input tape)                 *
c     *    nsigz   no. of sigma zeroes to process for this material    *
c     *            (default=0=all found on input tape)                 *
c     *    sgref   reference sigma zero                                *
c     *    following 2 parameters are for nina=0 or nina=3.            *
c     *    ires    resonance absorber indicator (0/1=no/yes)           *
c     *    sigp    potential cross section from endf/b.                *
c     *    following 5 parameters are for ntapea=0 only                *
c     *    mti     thermal inelastic mt                                *
c     *    mtc     thermal elastic mt                                  *
c     *    ip1opt  0/1=calculate p1 matrices/                          *
c     *                correct p0 scattering matrix ingroups.          *
c     *  ******if a p1 matrix is calculated for one of the isotopes    *
c     *        having a p1 matrix on the old library, file 6 on the    *
c     *        new library will be completely replaced.******          *
c     *    inorf   0/1=include resonance fission if found/             *
c     *                do not include                                  *
c     *    following two parameters for mode=0 only                    *
c     *    pos     position of this isotope in cpmlib                  *
c     *    posr    (for ires=1) position of this isotope in resonance  *
c     *            tabulation in cpmlib                                *
c     *  repeat card 5 for each nuclide.                               *
c     * following three cards are for if5 gt 0 only                    *
c     * card 6                                                         *
c     *    ntis    no. time-dependent isotopes                         *
c     *    nfis    no. fissionable burnup isotopes                     *
c     * card 7                                                         *
c     *    identb  ident of each of the nfis isotopes                  *
c     * card 8                                                         *
c     *    identa  ident of time-dependent isotope                     *
c     *    decay   decay constant (default=0.)                         *
c     *    yield   nfis yields (default=0.)                            *
c     *  repeat card 8 for each of the ntis isotopes.                  *
c     * card 9 for if5=2 only                                          *
c     *    aw      atomic weight                                       *
c     *    indfis  fission indicator                                   *
c     *    ntemp   no. temperatures on old library                     *
c     *  repeat card 9 for each of the ntis isotopes.                  *
c     * card 10                                                        *
c     *    lambda  resonance group goldstein lambdas                   *
c     *  ******remember that the 69-group structure has 13 resonance   *
c     *        groups while the collapsed 185-group structure has 15.  *
c     *        use a slash at end of each line of card 10 input.****** *
c     *  repeat card 10 for each nuclide having nina=0, nina=3, or     *
c     *                     ires=1.                                    *
c     * cards 11 and 11a for nuclides having nina=3 only.              *
c     * card 11                                                        *
c     *    resnu    nrg nus values to go with the lambda values        *
c     * card 11a                                                       *
c     *    tot      nrg total xsec values to go with the lambda values *
c     *  read cards 11 and 11a for each nuclide having nina=3.         *
c     * cards 12 for nina gt 2 only                                    *
c     *    aw      atomic weight                                       *
c     *    temp    temperature                                         *
c     *    fpa     ngnd absorption values (default=0.)                 *
c     * cards 12a, 12b, 12c for nuclides having nina=3 only.           *
c     * card 12a                                                       *
c     *    nus      ngnd nus values                                    *
c     *    fis      ngnd fission values                                *
c     *    xtr      ngnd transport values                              *
c     * card 12b                                                       *
c     *    ia       group.  0 means no scattering from this group      *
c     *    l1       lowest group to which scattering occurs            *
c     *    l2       highest group to which scattering occurs           *
c     * card 12c  for ia gt 0 only                                     *
c     *    scat     l2-l1+1 scattering values                          *
c     *  repeat card 12b and 12c for each group                        *
c     * repeat cards 12 for each of the nina gt 2 nuclides             *
c     *                                                                *
c     ******************************************************************
c
WIMSR
c
c     ******************************************************************
c     *                                                                *
c     * format multigroup cross sections from groupr for wims          *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    ngendf  unit for input gendf tape                           *
c     *    nout    unit for output wims tape                           *
c     *                                                                *
c     * card 2                                                         *
c     *    iprint  print option                                        *
c     *               0=minimum (default)                              *
c     *               1=regular                                        *
c     *               2=1+intermediate results                         *
c     *    iverw   wims version                                        *
c     *               4=wims-d (default)                               *
c     *               5=wims-e                                         *
c     *    igroup  group option                                        *
c     *               0=69 groups (default)                            *
c     *               9=user's choice                                  *
c     *                                                                *
c     * card 2a  (igroup.eq.9 only)                                    *
c     *    ngnd    number of groups                                    *
c     *    nfg     number of fast groups                               *
c     *    nrg     number of resonance groups                          *
c     *    igref   reference group (default is last fast group)        *
c     *                                                                *
c     * card 3                                                         *
c     *    mat     endf mat number of the material to be processed     *
c     *    nfid    not used                                            *
c     *    rdfid   identification of material for the wims library     *
c     *    iburn   burnup data option                                  *
c     *              -1=suppress printout of burnup data               *
c     *               0=no burnup data is provided (default)           *
c     *               1=burnup data is provided in cards 5 and 6       *
c     *                                                                *
c     * card  4                                                        *
c     *    ntemp   no. of temperatures to process for this material    *
c     *            in the thermal energy range
c     *               (0=all found on input tape)                      *
c     *    nsigz   no. of sigma zeroes to process for this material    *
c     *               (0=all found on input tape)                      *
c     *    sgref   reference sigma zero                                *
c     *               (.ge. 1.e10 to select all cross sect. at inf.dil.*
c     *                           but fully shielded elastic x-sect,   *
c     *                .lt. 1.e10 to select all x-sect at inf.dil.     *
c     *                =sig0      from the list on groupr input to     *
c     *                           select all x-sect. at that sig0)     *
c     *    ires    resonance absorber indicator                        *
c     *               0=no resonance tables                            *
c     *              >0=ires temperatures processed                    *
c     *    sigp    potential cross section from endf/b.                *
c     *               (if zero, replace by the elastic cross section)  *
c     *    mti     thermal inelastic mt (default=0=none)               *
c     *    mtc     thermal elastic mt (default=0=none)                 *
c     *    ip1opt  include p1 matrices                                 *
c     *               0=yes                                            *
c     *               1=no, correct p0 ingroups (default)              *
c     *    inorf   resonance fission (if found)                        *
c     *               0=include resonance fission (default)            *
c     *               1=do not include                                 *
c     *    isof    fission spectrum                                    *
c     *               0=do not include fission spectrum (default)      *
c     *               1=include fission spectrum                       *
c     *    ifprod  fission product flag                                *
c     *               0=not a fission product (default)                *
c     *               1=fission product, no resonance tables           *
c     *               2=fission product, resonance tables              *
c     *    jp1     transport correction neutron current spectrum flag  *
c     *               0=use p1-flux for transport correction (default) *
c     *              >0=read in jp1 values of the neutron current      *
c                       spectrum from input                            *
c     *                                                                *
c     *   the following cards 5 and 6 are for iburn gt 0 only          *
c     * card  5                                                        *
c     *    ntis    no. of time-dependent isotopes                      *
c     *            for burnable materials ntis=2                       *
c     *            for fissile materials ntis>2 when fission product   *
c     *            yields are given.
c     *    efiss   energy released per fission                         *
c     *                                                                *
c     * card  6a                                                       *
c     *    identa  ident of capture product isotope                    *
c     *    yield   yield of product identa from capture                *
c     *                                                                *
c     * card  6b                                                       *
c     *    identa  ident of decay product isotope (zero if stable)     *
c     *    lambda  decay constant (s-1)                                *
c     *                                                                *
c     * card  6c  (repeated ntis-2 times, if necessary)
c     *    identa  ident of fission product isotope                    *
c     *    yield   fission yield of identa from burnup of mat          *
c     *                                                                *
c     * card  7                                                        *
c     *    lambda  resonance-group goldstein lambdas (13 for           *
c     *            default 69-group structure, nrg otherwise).         *
c     *                                                                *
c     * card  8    (only when jp1>0)
c     *    p1flx   current spectrum (jp1 entries read, the rest are    *
c     *            set with the default p1-flux calculated by njoy).   *
c     ******************************************************************
c
PLOTR
c
c     ******************************************************************
c     *                                                                *
c     * plot cross sections                                            *
c     *                                                                *
c     * handles endf/b data, pendf or gendf data at specified temper-  *
c     * atures, or experimental input data.  several plots can be      *
c     * given on each set of axes, with both left and right scales.    *
c     * also, several graphs can be given on each page or display.     *
c     * error bars may be included for input data.  flexible titles    *
c     * and legend blocks are allowed.  all standard combinations of   *
c     * log and linear axes are supported, either grids or tick marks  *
c     * can be requested, and scales can be chosen automatically       *
c     * or set by the user.  in some cases, the x axis is thinned.     *
c     * in other cases, extra points are added so that, for example,   *
c     * linear-linear data plots correctly on a log-log graph.         *
c     * a limited capability for 3-d plots of angle and energy         *
c     * is included, and the endf-vi file 6 format is supported.       *
c     *                                                                *
c     * plotr writes plot commands on an output file for later use     *
c     * by the viewr module or an external graphics program.           *
c     *                                                                *
c     *---input--------------------------------------------------------*
c     *                                                                *
c     *  card 0                                                        *
c     *     nplt          unit for output plot commands                *
c     *     nplt0         unit for input plot commands                 *
c     *                     default=0=none                             *
c     *                     output plot commands are appended          *
c     *                     to the input plot commands, if any.        *
c     *  card 1                                                        *
c     *     lori          page orientation (def=1)                     *
c     *                    0  portrait (7.5x10in)                      *
c     *                    1  landscape (10x7.5in)                     *
c     *     istyle        character style (def=2)                      *
c     *                     1 = roman                                  *
c     *                     2 = swiss                                  *
c     *     size          character size option                        *
c     *                     pos = height in page units                 *
c     *                     neg = height as fraction of subplot size   *
c     *                     (default=0.30)                             *
c     *     ipcol         page color (def=white)                       *
c     *                    0=white                                     *
c     *                    1=navajo white                              *
c     *                    2=blanched almond                           *
c     *                    3=antique white                             *
c     *                    4=very pale yellow                          *
c     *                    5=very pale rose                            *
c     *                    6=very pale green                           *
c     *                    7=very pale blue                            *
c     *                                                                *
c     * -----repeat cards 2 through 13 for each curve-----             *
c     *                                                                *
c     *  card 2                                                        *
c     *     iplot         plot index                                   *
c     *                     99 = terminate plotting job                *
c     *                      1 = new axes, new page                    *
c     *                     -1 = new axes, existing page               *
c     *                      n = nth additional plot on existing axes  *
c     *                     -n = start a new set of curves using       *
c     *                          the alternate y axis                  *
c     *                     default = 1                                *
c     *     iwcol         window color (def=white)                     *
c     *                    color list same as for ipcol above          *
c     *     factx         factor for energies (default=1.)             *
c     *     facty         factor for cross-sections (default=1.)       *
c     *     xll,yll       lower-left corner of plot area               *
c     *     ww,wh,wr      window width, height, and rotation angle     *
c     *                   (plot area defaults to one plot per page)    *
c     *                                                                *
c     * -----cards 3 thru 7 for iplot = 1 or -1 only-----              *
c     *                                                                *
c     *  card 3                                                        *
c     *     t1            first line of title                          *
c     *                   60 characters allowed.                       *
c     *                   default=none                                 *
c     *                                                                *
c     *  card 3a                                                       *
c     *     t2            second line of title                         *
c     *                   60 characters allowed.                       *
c     *                   default=none                                 *
c     *                                                                *
c     *  card 4                                                        *
c     *     itype         type for primary axes                        *
c     *                     1 = linear x - linear y                    *
c     *                     2 = linear x - log y                       *
c     *                     3 = log x - linear y                       *
c     *                     4 = log x - log y                          *
c     *                     set negative for 3d axes                   *
c     *                     default=4                                  *
c     *     jtype         type for alternate y axis or z axis          *
c     *                     0 = none                                   *
c     *                     1 = linear                                 *
c     *                     2 = log                                    *
c     *                     default=0                                  *
c     *     igrid         grid and tic mark control                    *
c     *                     0 = no grid lines or tic marks             *
c     *                     1 = grid lines                             *
c     *                     2 = tic marks on outside                   *
c     *                     3 = tic marks on inside                    *
c     *                     default=2                                  *
c     *     ileg          option to write a legend.                    *
c     *                     0 = none                                   *
c     *                     1 = write a legend block with upper left   *
c     *                         corner at xtag,ytag (see below)        *
c     *                     2 = use tag labels on each curve with      *
c     *                         a vector from the tag to the curve     *
c     *                     default=0                                  *
c     *     xtag          x coordinate of upper left corner            *
c     *                   of legend block                              *
c     *     ytag          y coord of upper left corner                 *
c     *                   default=upper left corner of plot            *
c     *                                                                *
c     *  card 5                                                        *
c     *     el            lowest energy to be plotted                  *
c     *     eh            highest energy to be plotted                 *
c     *     xstep         x axis step                                  *
c     *                   default = automatic scales                   *
c     *                   (default all 3, or none)                     *
c     *                   (the actual value of xstep is                *
c     *                       ignored for log scales)                  *
c     *                                                                *
c     *  card 5a                                                       *
c     *     xlabl         label for x axis                             *
c     *                   60 characters allowed.                       *
c     *                    default="energy (ev)"                       *
c     *                                                                *
c     *  card 6                                                        *
c     *     yl            lowest value of y axis.                      *
c     *     yh            highest value of y axis.                     *
c     *     ystep         step for y ayis (linear scales only)         *
c     *                   default = automatic scales                   *
c     *                   (default all 3, or none)                     *
c     *                   (the actual value of ystep is                *
c     *                       ignored for log scales)                  *
c     *                                                                *
c     *  card 6a                                                       *
c     *     ylabl         label for y axis                             *
c     *                   60 characters allowed.                       *
c     *                    default="cross section (barns)"             *
c     *                                                                *
c     *  card 7   (jtype.gt.0 only)                                    *
c     *     rbot          lowest value of secondary y axis or z axis   *
c     *     rtop          highest value of secondary y axis or z axis  *
c     *     rstep         step for secondary y axis or z axis          *
c     *                   default for last three = automatic           *
c     *                                                                *
c     *  card 7a  (jtype.gt.0 only)                                    *
c     *     rl            label for alternate y axis or z axis         *
c     *                   60 characters allowed.                       *
c     *                   default=blank                                *
c     *                                                                *
c     *  -----cards 8 thru 9 are always given-----                     *
c     *                                                                *
c     *  card 8                                                        *
c     *     iverf         version of endf tape                         *
c     *                     set to zero for data on input file         *
c     *                       and ignore rest of parameters on card    *
c     *                     set to 1 for gendf data                    *
c     *     nin           input tape                                   *
c     *                   can change for every curve if desired.       *
c     *     matd          desired material                             *
c     *     mfd           desired file                                 *
c     *     mtd           desired section                              *
c     *                    mtd=0 means loop over all reactions in mfd  *
c     *                    (usually one page per mt, but for mf=3,     *
c     *                    resonance reactions may have several pages) *
c     *     temper        temperature for endf/b data (k)              *
c     *                   default=0.                                   *
c     *     nth,ntp,nkh   see below (defaults=1)                       *
c     *                                                                *
c     *       special meanings for nth,ntp,nkh for file 3 or 5 data    *
c     *            nth   number of subsection to plot                  *
c     *              (works for isomer prod, delayed n, etc.)          *
c     *            ntp   not used                                      *
c     *            nkh   not used                                      *
c     *                                                                *
c     *       special meanings for nth,ntp,nkh for file 6 data         *
c     *            nth   index for  incident energy                    *
c     *            ntp   number of dep. variable in cyle to plot       *
c     *                  (or angle number for law 7)                   *
c     *            nkh   number of outgoing particle to plot           *
c     *                                                                *
c     *       special meanings for nth,ntp,nkh for gendf mf=3 data     *
c     *            nth=0 for flux per unit lethargy                    *
c     *            nth=1 for cross section (default)                   *
c     *            ntp=1 for infinite dilution (default)               *
c     *            ntp=2 for next lowest sigma-zero values, etc.       *
c     *            nkh=1 for p0 weighting (default)                    *
c     *            nkh=2 for p1 weighting (total only)                 *
c
c     *       special meaning for nth for gendf mf=6 data              *
c     *            nth=1 plot 2-d spectrum for group 1                 *
c     *            nth=2 plot 2-d spectrum for group 2                 *
c     *              etc.                                              *
c     *        no special flags are needed for mf=6 3d plots           *
c     *                                                                *
c     *      special meanings for nth and ntp for mf7 plots            *
c     *           nth is index for indep. variable (alpha or beta)     *
c     *           ntp=1 selects alpha as indep. variable (default)     *
c     *           ntp=2 selects beta as indep. variable                *
c     *           nkh=1 selects normal s(alpha,beta)                   *
c     *           nkh=2 selects script s(alpha,-beta)                  *
c     *           nkh=3 selects script s(alpha,beta)                   *
c     *                                                                *
c     * -----cards 9 and 10 for 2d plots only-----                     *
c     *                                                                *
c     *  card 9                                                        *
c     *     icon          symbol and connection option                 *
c     *                     0 = points connected, no symbols           *
c     *                    -i = points not connected, symbol at every  *
c     *                         ith point                              *
c     *                     i = points connected, symbol at every ith  *
c     *                         points                                 *
c     *                     default=0                                  *
c     *     isym          no. of symbol to be used                     *
c     *                     0 = square                                 *
c     *                     1 = octagon                                *
c     *                     2 = triangle                               *
c     *                     3 = cross                                  *
c     *                     4 = ex                                     *
c     *                     5 = diamond                                *
c     *                     6 = inverted triangle                      *
c     *                     7 = exed square                            *
c     *                     8 = crossed ex                             *
c     *                     9 = crossed diamond                        *
c     *                     10 = crossed octagon                       *
c     *                     11 = double triangle                       *
c     *                     12 = crossed square                        *
c     *                     13 = exed octagon                          *
c     *                     14 = triangle and square                   *
c     *                     15 = filled circle                         *
c     *                     16 = open circle                           *
c     *                     17 = open square                           *
c     *                     18 = filled square                         *
c     *                     default=0                                  *
c     *     idash         type of line to plot                         *
c     *                     0 = solid                                  *
c     *                     1 = dashed                                 *
c     *                     2 = chain dash                             *
c     *                     3 = chain dot                              *
c     *                     4 = dot                                    *
c     *                     default=0                                  *
c     *     iccol         curve color (def=black)                      *
c     *                     0=black                                    *
c     *                     1=red                                      *
c     *                     2=green                                    *
c     *                     3=blue                                     *
c     *                     4=magenta                                  *
c     *                     5=cyan                                     *
c     *                     6=brown                                    *
c     *                     7=purple                                   *
c     *     ithick        thickness of curve (def=1)                   *
c     *                     0 = invisible (for shaded areas)           *
c     *     ishade        shade pattern                                *
c     *                     0 = none                                   *
c     *                     1 to 10 = 10% to 100% gray                 *
c     *                     11 to 20 = 45 deg right hatching           *
c     *                     21 to 30 = 45 deg left hatching            *
c     *                     31 to 40 = 45 deg cross hatching           *
c     *                     41 to 50 = shades of green                 *
c     *                     51 to 60 = shades of red                   *
c     *                     61 to 70 = shades of brown                 *
c     *                     71 to 80 = shades of blue                  *
c     *                     default=0                                  *
c     *                                                                *
c     *  card 10  ---ileg.ne.0 only---                                 *
c     *     aleg          title for curve tag or legend block          *
c     *                   60 characters allowed.                       *
c     *                   default=blank                                *
c     *                                                                *
c     *  card 10a  ---ileg.eq.2 only---                                *
c     *     xtag          x position of tag title                      *
c     *     ytag          y position of tag title                      *
c     *     xpoint        x coordinate of vector point                 *
c     *                    (.le.0 to omit vector)                      *
c     *                                                                *
c     * -----card 11 for 3d plots only-----                            *
c     *                                                                *
c     *  card 11                                                       *
c     *     xv,yv,zv      abs. coords of view point                    *
c     *                   defaults=15.,-15.,15.                        *
c     *     x3,y3,z3      abs. sides of work box volume                *
c     *                   defaults=2.5,6.5,2.5                         *
c     *                                                                *
c     *         set x3 or y3 negative to flip the order of the         *
c     *         axis on that side of the work box.                     *
c     *                                                                *
c     *  -----cards 12 thru 13 for iverf = 0 only-----                 *
c     *                                                                *
c     *  card 12                                                       *
c     *     nform          format code for input data                  *
c     *                    0 = free format input with                  *
c     *                    optional x and y error bars                 *
c     *                                                                *
c     *  card 13   ---nform = 0 only---                                *
c     *     xdata          dependent value                             *
c     *                    terminate with empty card (/)               *
c     *     ydata          independent value                           *
c     *     yerr1          lower y error limit                         *
c     *                    no y error bar if zero                      *
c     *     yerr2          upper y error limit                         *
c     *                    if zero, equals yerr1                       *
c     *     xerr1          x left error limit                          *
c     *                    no x error bar if zero                      *
c     *     xerr2          x right error limit                         *
c     *                    if zero, equals xerr1                       *
c     *                                                                *
c     *                                                                *
c     * all curves contain at least 10 points per decade (see delta).  *
c     * code can plot curves containing fewer than 2000 points (see    *
c     * max) without thinning.  curves with more points are thinned    *
c     * based on a minimum spacing determined from max and the         *
c     * length of the x axis.                                          *
c     *                                                                *
c     ******************************************************************
c
VIEWR
c
c     ******************************************************************
c     *                                                                *
c     * view plots generated by plotr, covr, or dtfr.                  *
c     * postscript version                                             *
c     *                                                                *
c     * character specifications are similar to disspla, except that   *
c     * the default case is lower instead of upper.  this allows       *
c     * mixed-case strings to be used in postscript mode.  the         *
c     * following shift characters are used:                           *
c     *     < = upper-case standard                                    *
c     *     > = lower-case or mixed-case standard                      *
c     *     [ = upper-case greek                                       *
c     *     ] = lower-case or mixed-case greek                         *
c     *     # = instructions                                           *
c     * give one of the shift characters twice to get it instead of    *
c     * its action.  the following instructions are supported:         *
c     *     Ev = elevate by v as a fraction of the height              *
c     *           if v is missing or D is given, use .5                *
c     *     Lv = lower by v as a fraction of the height                *
c     *           if v is missing or D is given, use .5                *
c     *     Hv = change height by v as a fraction of the height        *
c     *           if v is missing or D is given, use .5                *
c     *     Fi = change to font number i                               *
c     *     Mi = change mode number, where mode 0 is the lower 128     *
c     *           postscript characters and mode 1 is the upper 128    *
c     *     X  = reset E, L, or H.  Font and Mode must be              *
c     *           reset explicitly.                                    *
c     *     c is a real number, i is an integer.                       *
c     *                                                                *
c     *---input--------------------------------------------------------*
c     *                                                                *
c     *  card 1                                                        *
c     *     infile        input file                                   *
c     *     nps           postscript output file                       *
c     *                                                                *
c     *---data file format---------------------------------------------*
c     *                                                                *
c     *  card 1                                                        *
c     *     lori          page orientation (def=1)                     *
c     *                    0  portrait (7.5x10in)                      *
c     *                    1  landscape (10x7.5in)                     *
c     *     istyle        character style (def=2)                      *
c     *                     1  roman                                   *
c     *                     2  swiss                                   *
c     *     size          character size option                        *
c     *                     pos = height in page units                 *
c     *                     neg = height as fraction of subplot size   *
c     *                       (default=.30)                            *
c     *     ipcol         page color (def=white)                       *
c     *                    0=white                                     *
c     *                    1=navajo white                              *
c     *                    2=blanched almond                           *
c     *                    3=antique white                             *
c     *                    4=very pale yellow                          *
c     *                    5=very pale rose                            *
c     *                    6=very pale green                           *
c     *                    7=very pale blue                            *
c     *                                                                *
c     * -----repeat cards 2 through 13 for each curve-----             *
c     *                                                                *
c     *  card 2                                                        *
c     *     iplot         plot index                                   *
c     *                     99 = terminate plotting job                *
c     *                      1 = new axes, new page                    *
c     *                     -1 = new axes, existing page               *
c     *                      n = nth additional plot on existing axes  *
c     *                     -n = start a new set of curves using       *
c     *                          the alternate y axis                  *
c     *                     default = 1                                *
c     *     iwcol         window color (def=white)                     *
c     *                    color list same as for ipcol above          *
c     *     factx         factor for energies (default=1.)             *
c     *     facty         factor for cross-sections (default=1.)       *
c     *     xll,yll       lower-left corner of plot area               *
c     *     ww,wh,wr      window width, height, and rotation angle     *
c     *                   (plot area defaults to one plot per page)    *
c     *                                                                *
c     * -----cards 3 thru 7 for iplot = 1 or -1 only-----              *
c     *                                                                *
c     *  card 3                                                        *
c     *     t1            first line of title                          *
c     *                   60 characters allowed.                       *
c     *                   default=none                                 *
c     *                                                                *
c     *  card 3a                                                       *
c     *     t2            second line of title                         *
c     *                   60 characters allowed.                       *
c     *                   default=none                                 *
c     *                                                                *
c     *  card 4                                                        *
c     *     itype         type for primary axes                        *
c     *                     1 = linear x - linear y                    *
c     *                     2 = linear x - log y                       *
c     *                     3 = log x - linear y                       *
c     *                     4 = log x - log y                          *
c     *                     set negative for 3d axes                   *
c     *                     0 = no plot, titles only                   *
c     *                     default=4                                  *
c     *     jtype         type for alternate y axis or z axis          *
c     *                     0 = none                                   *
c     *                     1 = linear                                 *
c     *                     2 = log                                    *
c     *                     default=0                                  *
c     *     igrid         grid and tic mark control                    *
c     *                     0 = no grid lines or tic marks             *
c     *                     1 = grid lines                             *
c     *                     2 = tic marks on outside                   *
c     *                     3 = tic marks on inside                    *
c     *                     default=2                                  *
c     *     ileg          option to write a legend.                    *
c     *                     0 = none                                   *
c     *                     1 = write a legend block with upper left   *
c     *                         corner at xtag,ytag (see below)        *
c     *                     2 = use tag labels on each curve with      *
c     *                         a vector from the tag to the curve     *
c     *                     default=0                                  *
c     *     xtag          x coordinate of upper left corner            *
c     *                   of legend block                              *
c     *     ytag          y coord of upper left corner                 *
c     *                   default=upper left corner of plot            *
c     *                                                                *
c     *  card 5                                                        *
c     *     xmin          lowest energy to be plotted                  *
c     *     xmax          highest energy to be plotted                 *
c     *     xstep         x axis step                                  *
c     *                   default = automatic scales                   *
c     *                   (for linear, give all 3, or none)            *
c     *                   (for log, give first 2, or none)             *
c     *                                                                *
c     *  card 5a                                                       *
c     *     xlabl         label for x axis                             *
c     *                   60 characters allowed.                       *
c     *                   (default = no label, no numbering)           *
c     *                                                                *
c     *  card 6                                                        *
c     *     ymin          lowest value of y axis.                      *
c     *     ymax          highest value of y axis.                     *
c     *     ystep         step for y ayis (linear scales only)         *
c     *                   default = automatic scales                   *
c     *                   (for linear, give all 3, or none)            *
c     *                   (for log, give first 2, or none)             *
c     *                                                                *
c     *  card 6a                                                       *
c     *     ylabl         label for y axis                             *
c     *                   60 characters allowed.                       *
c     *                   (default = no label, no numbering)           *
c     *                                                                *
c     *  card 7   (jtype.gt.0 only)                                    *
c     *     rmin          lowest value of secondary y axis or z axis   *
c     *     rmax          highest value of secondary y axis or z axis  *
c     *     rstep         step for secondary y axis or z axis          *
c     *                   (default = automatic scale)                  *
c     *                   (for linear, give all 3, or none)            *
c     *                   (for log, give first 2, or none)             *
c     *                                                                *
c     *  card 7a  (jtype.gt.0 only)                                    *
c     *     rl            label for alternate y axis or z axis         *
c     *                   60 characters allowed.                       *
c     *                   (default = no label, no numbering)           *
c     *                                                                *
c     *   card 8  -- dummy input card for consistency with plotr       *
c     *               it always should be 0/                           *
c     *                                                                *
c     * -----cards 9 and 10 for 2d plots only-----                     *
c     *                                                                *
c     *   card 9                                                       *
c     *     icon          symbol and connection option                 *
c     *                     0 = points connected, no symbols           *
c     *                    -i = points not connected, symbol at every  *
c     *                         ith point                              *
c     *                     i = points connected, symbol at every ith  *
c     *                         points                                 *
c     *                     default=0                                  *
c     *     isym          no. of symbol to be used                     *
c     *                     0 = square                                 *
c     *                     1 = octagon                                *
c     *                     2 = triangle                               *
c     *                     3 = cross                                  *
c     *                     4 = ex                                     *
c     *                     5 = diamond                                *
c     *                     6 = inverted triangle                      *
c     *                     7 = exed square                            *
c     *                     8 = crossed ex                             *
c     *                     9 = crossed diamond                        *
c     *                     10 = crossed octagon                       *
c     *                     11 = double triangle                       *
c     *                     12 = crossed square                        *
c     *                     13 = exed octagon                          *
c     *                     14 = triangle and square                   *
c     *                     15 = filled circle                         *
c     *                     16 = open circle                           *
c     *                     17 = open square                           *
c     *                     18 = filled square                         *
c     *                     19 = filled diamond                        *
c     *                     20 = filled triangle                       *
c     *                     21 = filled inverted triangle              *
c     *                     22 = crossed circle                        *
c     *                     23 = exed circle                           *
c     *                     24 = exed diamond                          *
c     *                     default=0                                  *
c     *     idash         type of line to plot                         *
c     *                     0 = solid                                  *
c     *                     1 = dashed                                 *
c     *                     2 = chain dash                             *
c     *                     3 = chain dot                              *
c     *                     4 = dot                                    *
c     *                     5 = invisible                              *
c     *                     default=0                                  *
c     *     iccol         curve color (def=black)                      *
c     *                     0=black                                    *
c     *                     1=red                                      *
c     *                     2=green                                    *
c     *                     3=blue                                     *
c     *                     4=magenta                                  *
c     *                     5=cyan                                     *
c     *                     6=brown                                    *
c     *                     7=purple
c     *     ithick        controls thickness of curve                  *
c     *                     0 = invisible (for shaded areas)           *
c     *                     (default=1)                                *
c     *     ishade        shade pattern                                *
c     *                     0 = none                                   *
c     *                     1 to 10 = 10% to 100% gray                 *
c     *                     11 to 20 = 45 deg right hatching           *
c     *                     21 to 30 = 45 deg left hatching            *
c     *                     31 to 40 = 45 deg cross hatching           *
c     *                     41 to 50 = shades of green                 *
c     *                     51 to 60 = shades of red                   *
c     *                     61 to 70 = shades of brown                 *
c     *                     71 to 80 = shades of blue                  *
c     *                     default=0                                  *
c     *                                                                *
c     *   card 10   ---ileg.ne.0 only---                               *
c     *     aleg          title for curve tag or legend block          *
c     *                   60 characters allowed.                       *
c     *                   default=blank                                *
c     *                                                                *
c     *   card 10a  ---ileg.eq.2 only---                               *
c     *     xtag          x position of tag title                      *
c     *     ytag          y position of tag title                      *
c     *     xpoint        x coordinate of vector point                 *
c     *                    (.le.0 to omit vector)                      *
c     *                                                                *
c     * -----card 11 for 3d plots only-----                            *
c     *                                                                *
c     *   card 11                                                      *
c     *     xv,yv,zv      abs. coords of view point                    *
c     *                   defaults= 15.,-15.,15.                       *
c     *     x3,y3,z3      abs. sides of work box volume                *
c     *                   defaults=2.5,6.5,2.5                         *
c     *                                                                *
c     *          set x3 negative to flip the order of the axis on      *
c     *          that side of the box (secondary energy, cosine).      *
c     *                                                                *
c     *   card 12                                                      *
c     *     nform          format code for input data                  *
c     *                    0 = free format input with                  *
c     *                        optional x and y error bars             *
c     *                    1 = free format input for a                 *
c     *                        3d family of curves z(x) vs y           *
c     *                                                                *
c     *   card 13   ---nform = 0 only---   2-d data                    *
c     *     xdata          independent value                           *
c     *                    terminate with empty card (/)               *
c     *     ydata          dependent value                             *
c     *     yerr1          lower y error limit                         *
c     *                    no y error bar if zero                      *
c     *     yerr2          upper y error limit                         *
c     *                    if zero, equals yerr1                       *
c     *     xerr1          x left error limit                          *
c     *                    no x error bar if zero                      *
c     *     xerr2          x right error limit                         *
c     *                    if zero, equals xerr1                       *
c     *                                                                *
c     *   card 14   ---nform = 1 only---   3-d data                    *
c     *     y              y value for curve                           *
c     *                    repeat cards 13 and 13a for each curve      *
c     *                    terminate with empty card (/)               *
c     *                                                                *
c     *   card14a   ---nform = 1 only---                               *
c     *     x              x value                                     *
c     *     z              z value                                     *
c     *                    repeat card 13a for each point in curve     *
c     *                    terminate with empty card (/)               *
c     *                    disspla version requires same x grid        *
c     *                    for each value of y.                        *
c     *                                                                *
c     ******************************************************************
c
MIXR
c
c     ******************************************************************
c     *                                                                *
c     *  mixr                                                          *
c     *                                                                *
c     *  construct a new pendf tape with a specified set of            *
c     *  reactions that are specified linear combinations of the       *
c     *  cross sections from the input tapes.  mixr can also be        *
c     *  used for endf tapes, but the input interpolation laws         *
c     *  are ignored.  this module can be used to construct mixed      *
c     *  reactions for plotting (for example, elemental cross          *
c     *  sections).  the output file contains files 1 and 3 only.      *
c     *  linear-linear interpolation is assumed.                       *
c     *                                                                *
c     *  user input --                                                 *
c     *                                                                *
c     *  card 1  --  units                                             *
c     *     nout      output unit for mixed cross sections             *
c     *     nin1      first input unit (endf or pendf)                 *
c     *     nin2      second input unit                                *
c     *      ...       continue for nnin<=10 input units               *
c     *                                                                *
c     *  card 2  --  reaction list                                     *
c     *      mtn       list of nmt<=20 mt numbers for                  *
c     *                   the output reactions                         *
c     *                                                                *
c     *  card 3  --  material list                                     *
c     *     matn,     list of nmat<=10 pairs (matn,wtn) of mat         *
c     *      wtn       numbers and associated weight factors           *
c     *                                                                *
c     *  card 4  --  temperature                                       *
c     *     temp      temperature (use zero except for pendf tapes)    *
c     *                                                                *
c     *  card 5  --  output material                                   *
c     *     matd      material number                                  *
c     *     za        za value                                         *
c     *     awr       awr value                                        *
c     *                                                                *
c     *  card 6  --  file 1 comment card                               *
c     *     des      description (60 char max)                         *
c     *                                                                *
c     ******************************************************************
c
PURR
c
c     ******************************************************************
c     *                                                                *
c     * probabalistic unresolved calculation                           *
c     * bondarenko moments and probability tables                      *
c     *                                                                *
c     ******************************************************************
c     *                                                                *
c     *  purr constructs a series of resonance ladders that obey the   *
c     *  distributions given in mt151 of the endf tape.  each ladder   *
c     *  is sampled randomly to produce contributions to a probability *
c     *  table and a set of bondarenko moments.  when the table is     *
c     *  complete, bondarenko moments are computed from the table to   *
c     *  provide a convergence check.  all temperatures are computed   *
c     *  simultaneously to preserve temperature correlations.  the     *
c     *  bondarenko tables are written on the pendf tape using mt152,  *
c     *  and the probability tables are written using mt153.           *
c     *  a conditional probability for heating is added to the table.  *
c     *  if partial heating cross sections for elastic (302), fission  *
c     *  (318), and capture (402) are available from heatr, full       *
c     *  fluctuations will be provided for the total heating.          *
c     *  otherwise, the same value will be provided for each bin.      *
c     *                                                                *
c     *---input data cards---------------------------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *   nendf   unit for endf/b tape                                 *
c     *   nin     unit for input pendf tape                            *
c     *   nout    unit for output pendf tape                           *
c     * card 2                                                         *
c     *   matd    material to be processed                             *
c     *           matd=0 terminates purr                               *
c     *   ntemp   no. of temperatures (10 max)                         *
c     *   nsigz   no of sigma zeros (10 max)                           *
c     *   nbin    no. of probability bins                              *
c     *   nladr   no. of resonance ladders                             *
c     *   iprint  print option (0=min, 1=max, def=1)                   *
c     *   nunx    no. of energy points desired (def=0=all)             *
c     * card 3                                                         *
c     *   temp    temperatures in kelvin (including zero)              *
c     * card 4                                                         *
c     *   sigz    sigma zero values (including infinity)               *
c     *                                                                *
c     ******************************************************************
c
LEAPR
c
c     ******************************************************************
c     *                                                                *
c     * calculate s(alpha,beta)                                        *
c     *                                                                *
c     * calculates the thermal scattering law, s(alpha,beta), in the   *
c     * incoherent and gaussian approximations.  the scattering law    *
c     * for solid-type frequency distributions is calculated using     *
c     * the phonon expansion method without recourse to the usual      *
c     * edgewood and sct approximations.  if desired, an analytic      *
c     * representation of diffusion or free-gas scattering can be      *
c     * convolved with the solid-type scattering law.  in addition,    *
c     * up to 50 discrete oscillators can be convolved with the        *
c     * continuous scattering law.  the results of the calculation     *
c     * are written out in endf6 file 7 format, ready to be            *
c     * processed by the thermr module of njoy.                        *
c     *                                                                *
c     * it is possible to generate s(alpha,beta) for composite         *
c     * moderators like beo, where be in beo is combined with o in     *
c     * beo and normalized to be used with the be cross section.       *
c     *                                                                *
c     * incoherent elastic or coherent elastic scattering functions    *
c     * can also be included using the endf6 format.  the incoherent   *
c     * result depends on the debye-waller factor computed during the  *
c     * s(alpha,beta) calculation.  the coherent result is computed    *
c     * using the methods developed for the thermr module of njoy      *
c     * (which were based on the hexscat code).  this scattering       *
c     * law depends on the debye-waller factor from the s(alpha,beta)  *
c     * calculation, on lattice parameters that are built in to data   *
c     * statements in the code, and on the coherent scattering cross   *
c     * section (which is also built in).                              *
c     *                                                                *
c     * a special option exists for liquid hydrogen and deuterium.     *
c     * a solid-type spectrum and a diffusive spectrum can be given    *
c     * in the normal way.  the resulting s(alpha,beta) is then        *
c     * convolved with rotational modes calculated using the method    *
c     * of young and koppel.  because of the inclusion of spin         *
c     * correlations, the resulting s(alpha,beta) is not symmetric in  *
c     * beta, and the lasym option is used in mf7.                     *
c     *                                                                *
c     * this module is loosly based on the british code 'leap+addelt', *
c     * originally written by r.c.f.mclatchie at harwell (1962,        *
c     * unpublished), then implemented by a.t.d.butland at winfrith    *
c     * (aeew 1200, 1973), and finally modified to work better for     *
c     * cold moderators as part of the thesis of d.j.picton, now       *
c     * at the university of birmingham.  the first endf and njoy      *
c     * compatible version was prepared by r.e.macfarlane at           *
c     * los alamos in 1987.  the main changes to the original code     *
c     * were: 1) the change to njoy style, 2) the addition of endf6    *
c     * output, 3) the addition of incoherent elastic output, 4) the   *
c     * addition of a coherent elastic calculation, 5) a major         *
c     * speed up of the diffusion calculation by using interpolation   *
c     * instead of direct recalculation of s-solid(alpha,beta),        *
c     * and 6) the liquid hydrogen and deuterium treatments.           *
c     * a second version was prepared by r.e.macfarlane in 1989 by     *
c     * removing the edgewood and sct approximations in favor of       *
c     * direct use of the phonon expansion for all phonon orders.      *
c     * in addition, free gas scattering was added, the code was       *
c     * simplified and scratch tapes were eliminated.  thus, the       *
c     * code takes advantage of the capabilities of large, fast        *
c     * computers that weren't available to the designers of the       *
c     * original leap code.  this 1992 version changed to using        *
c     * the asymmetric s(alpha,beta) for better numerics on            *
c     * short-word machines, added the mixed moderator capability,     *
c     * rebuilt the discrete-oscillator calculation for better         *
c     * accuracy, and made many other smaller improvements.            *
c     *                                                                *
c     *----- user input (free format) ---------------------------------*
c     *                                                                *
c     * card 1 - units                                                 *
c     *    nout     endf output unit for thermal file                  *
c     *                                                                *
c     * card 2 - title                                                 *
c     *                                                                *
c     * card 3 - run control                                           *
c     *    ntempr  number of temperatures                              *
c     *    iprint  print control (0=min, 1=more, 2=most, def=1)        *
c     *    nphon   phonon-expansion order (def=100)                    *
c     *                                                                *
c     * card 4 - endf output control                                   *
c     *    mat     endf mat number                                     *
c     *    za      1000*z+a for principal scatterer                    *
c     *    isabt   sab type (0=s, 1=ss, def=0)                         *
c     *    ilog    log flag (0=s, 1=log10(s), def=0)                   *
c     *                                                                *
c     * card 5 - principal scatterer control                           *
c     *    awr     weight ratio to neutron for principal scatterer     *
c     *    spr     free atom cross section for principal scatterer     *
c     *    npr     number of principal scattering atoms in compound    *
c     *    iel     coherent elastic option                             *
c     *                   0  none (default)                            *
c     *                   1  graphite                                  *
c     *                   2  beryllium                                 *
c     *                   3  beryllium oxide                           *
c     *    ncold   cold hydrogen option                                *
c     *                   0   none (default)                           *
c     *                   1   ortho hydrogen                           *
c     *                   2   para hydrogen                            *
c     *                   3   otho deuterium                           *
c     *                   4   para deuterium                           *
c     *                                                                *
c     * card 6 - secondary scatterer control                           *
c     *    nss     number of secondary scatterers (0 or 1)             *
c     *    b7      secondary scatterer type                            *
c     *             (0=sct only, 1=free, 2=diffusion)                  *
c     *    aws     weight ratio to neutron for secondary scatterer     *
c     *    sps     free atoms cross section for secondary scatterer    *
c     *    mss     number of atoms of this type in the compound        *
c     *                                                                *
c     * card 7 - alpha, beta control                                   *
c     *    nalpha   number of alpha values                             *
c     *    nbeta    number of beta values                              *
c     *    lat      if lat.eq.1, alpha and beta values are scaled      *
c     *               by .0253/tev, where tev is temp in ev.  (def=0)  *
c     *                                                                *
c     * card 8 - alpha values (increasing order)                       *
c     * card 9 - beta values (increasing order)                        *
c     *                                                                *
c     * scatterer loop, do temperature loop for principal scatterer.   *
c     *         repeat for secondary scatterer (if any) if b7=0.       *
c     *                                                                *
c     * temperature loop, repeat cards 10 to 18 for each temperature   *
c     *                                                                *
c     *    card 10 - temperature (k)                                   *
c     *       a negative value means skip cards 11 to 18,              *
c     *          thereby using previous parameters for this temp.      *
c     *                                                                *
c     *    card 11 -- continuous distribution control                  *
c     *       delta    interval in ev                                  *
c     *       ni       number of points                                *
c     *                                                                *
c     *    card 12 -- rho(energy) (order of increasing ev)             *
c     *                                                                *
c     *    card 13 - continuous distribution parameters                *
c     *       twt       translational weight                           *
c     *       c         diffusion constant (zero for free gas)         *
c     *       tbeta     normalization for continuous part              *
c     *                                                                *
c     *    card 14 - discrete oscillator control                       *
c     *       nd     number of discrete oscillators                    *
c     *                                                                *
c     *    card 15 - oscillator energies (ev)                          *
c     *    card 16 - oscillator weights (sum to 1.-tbeta-twt)          *
c     *                                                                *
c     *    card 17 - pair correlation control (ncold.ne.0 only)        *
c     *       nka     number of kappa values                           *
c     *       dka     kappa increment (inv. angstroms)                 *
c     *                                                                *
c     *    card 18  skappa values in increasing order (inv. ang.)      *
c     *                                                                *
c     * card 19 - file 1 comments, repeat until blank line is read.    *
c     *                                                                *
c     ******************************************************************
c
GASPR
c     ******************************************************************
c     *                                                                *
c     * add gas production reactions (mt203-207) to the pendf tape.    *
c     * any old gas sections on the input pendf tape are deleted.      *
c     * the directory is updated to show the new reactions.            *
c     * this module can be run anywhere in the pendf preparation       *
c     * sequence as long as it is somewhere after broadr.              *
c     *                                                                *
c     *---input specifications (free format)---------------------------*
c     *                                                                *
c     * card 1                                                         *
c     *    nendf    unit for endf/b tape                               *
c     *    nin      unit for input pendf tape                          *
c     *    nout     unit for output pendf tape                         *
c     *                                                                *
c     ******************************************************************
END
