#
      MODULE commons
#

----------PARAMETERS.

        PARAMETER (pi=3.141593)
        PARAMETER (q=2.531)          !(mass(neutron)-mass(proton))/m(electron)
        PARAMETER (const1=0.09615) !Relation between time and temperature.
        PARAMETER (const2=6.6700e-8) !Gravitational constant.

        PARAMETER (ir=1)             !Input unit number.
        PARAMETER (iw=1)             !Output unit number.
        PARAMETER (itmax=40)         !Maximum # of line to be printed.
        PARAMETER (min_time_step=1.e-16)        !Lower limit on size of time step.
        PARAMETER (iter=50)          !Number of gaussian quads.
        PARAMETER (eps=2.e-4)        !Tolerance for convergence (.ge. 1.e-7).
        PARAMETER (mord=1)           !Higher order in correction.

        PARAMETER (nrec=88)          !Number of nuclear reactions.
        PARAMETER (nnuc=26)          !Number of nuclides in calculation.

        PARAMETER (nvar=29)          !Number of variables to be evolved.

        PARAMETER (lrec=64)          !Total # of nuclear reactions for irun = 2.
        PARAMETER (krec=34)          !Total # of nuclear reactions for irun = 3.
        PARAMETER (lnuc=18)          !Total # of nuclides for irun = 2.
        PARAMETER (knuc=9)           !Total # of nuclides for irun = 3.

        CHARACTER(255) :: output_file
#
      END

      MODULE sterile
        !Parameters from steriles prog
#

------VARIABLES FOR STERILES

        PARAMETER (n_big=1e7)
        DOUBLE PRECISION ts(n_big)             !Time array (in seconds)
#
	DOUBLE PRECISION aTs(n_big)
        DOUBLE PRECISION t9s(n_big)            !Photon temperature array (in 10**9 K)
        DOUBLE PRECISION dt9s(n_big)           !Temperature variation (in 10**9 K / s)
        DOUBLE PRECISION rho_tot(n_big)        !Total energy density array (in g cm**-3)
        DOUBLE PRECISION ratef(n_big)          !Array for the total rate n -> p
        DOUBLE PRECISION rater(n_big)          !Array for the total rate p -> n
	DOUBLE PRECISION hvs(n_big)
        INTEGER nlines            !An integer telling the number of lines
     |                            ! of data coming from the other program
      END



      PROGRAM nuc123
#

C----------LINKAGES.

#

CALLED BY - none

#

CALLS - [subroutine] help, setcom, setmod, run, output

#

C----------REMARKS.

#

Control program -

#

Offers user the main menu and channels through to various options.

#

Implementation -

#

To run this program, NUC123.FOR must be linked with NUCCOM

#

(containing the computation subroutines), NUCRAT (with the

#

reaction rates), and NUCINT (with an interface subroutine).

#

This program has been written to be compatible with

#

ANSI FORTRAN-77 with the exception of the END DO statement

#

used to limit the number of statement labels.

#

The code was developed on the VAX/VMS system.

#

Notes -

#

The program utilizes Wagoner's code as the core of the computational

#

routines.

#

Documentation -

#

Kawano, L., 1992, Fermilab preprint FERMILAB-PUB-92/04-A,

#

Kellogg Radiation Lab preprint OAP-714.

#

Copy -

#

Version 4.1 (December 1991)

      USE commons
#

C----------COMMON AREAS.

      COMMON /recpr0/ reacpr                        !Reaction parameter values.
      COMMON /recpr/  iform,ii,jj,kk,ll,rev,q9       !Reaction parameter names.
      COMMON /rates/  f,r                            !Reaction rates.
      COMMON /compr0/ cy0,ct0,t9i0,t9f0,ytmin0,inc0  !Default comp parameters.
      COMMON /compr/  cy,ct,t9i,t9f,ytmin,inc        !Computation parameters.
      COMMON /modpr0/ c0,cosmo0,xi0                  !Default model parameters.
      COMMON /modpr/  g,tau,xnu,c,cosmo,xi           !Model parameters.
      COMMON /varpr0/ dt0,eta0                      !Default variationl params.
      COMMON /varpr/  dt1,eta1                       !Variational parameters.
      COMMON /check1/  itime                          !Computation location.
      COMMON /runopt/ irun,isize,jsize               !Run options.
      COMMON /outopt/ nout,outfile                   !Output option.
#

C==========================DECLARATION DIVISION============================

#

C----------REACTION PARAMETERS FROM BLOCK DATA.

      DOUBLE PRECISION    reacpr(nrec,8)       !Reaction parameters.
#

C----------REACTION PARAMETERS.

      INTEGER iform(nrec)          !Reaction type code (1-11).
      INTEGER ii(nrec)             !Incoming nuclide type (1-26).
      INTEGER jj(nrec)             !Incoming light nuclide type (1-6).
      INTEGER kk(nrec)             !Outgoing light nuclide type (1-6).
      INTEGER ll(nrec)             !Outgoing nuclide type (1-26).
      DOUBLE PRECISION    rev(nrec)            !Reverse reaction coefficient.
      DOUBLE PRECISION    q9(nrec)             !Energy released in reaction.
#

C----------REACTION RATES.

      DOUBLE PRECISION    f(nrec)              !Forward reaction rate coefficients.
      DOUBLE PRECISION    r(nrec)              !Reverse reaction rate coefficients.
#

C----------DEFAULT COMPUTATION PARAMETERS.

      DOUBLE PRECISION    cy0                  !Default cy.
      DOUBLE PRECISION    ct0                  !Default ct.
      DOUBLE PRECISION    t9i0                 !Default t9i.
      DOUBLE PRECISION    t9f0                 !Default t9f.
      DOUBLE PRECISION    ytmin0               !Default ytmin.
      INTEGER inc0                 !Default accumulation increment.
#

C----------COMPUTATIONAL PARAMETERS.

      DOUBLE PRECISION    cy                   !Time step limiting constant on abundances.
      DOUBLE PRECISION    ct                   !Time step limiting constant on temperature.
      DOUBLE PRECISION    t9i                  !Initial temperature (in 10**9 K).
      DOUBLE PRECISION    t9f                  !Final temperature (in 10**9 k).
      DOUBLE PRECISION    ytmin                !Smallest abundances allowed.
      INTEGER inc                  !Accumulation increment.
#

C----------DEFAULT MODEL PARAMETERS.

      DOUBLE PRECISION    c0(3)                !Default c.
      DOUBLE PRECISION    cosmo0               !Default cosmological constant.
      DOUBLE PRECISION    xi0(3)               !Default neutrino degeneracy parameters.
#

C----------EARLY UNIVERSE MODEL PARAMETERS.

      DOUBLE PRECISION    c(3)                !c(1) is variation of gravitational constant.
#
     |                             !c(2) is neutron lifetime (sec).
     |                             !c(3) is number of neutrino species.
      DOUBLE PRECISION    cosmo                !Cosmological constant.
      DOUBLE PRECISION    xi(3)                !Neutrino degeneracy parameters.
#

C----------DEFAULT VARIATIONAL PARAMETERS.

      DOUBLE PRECISION    dt0                  !Default initial time step.
      DOUBLE PRECISION    eta0                 !Default baryon-to-photon ratio.
#

C----------VARIATIONAL PARAMETERS.

      DOUBLE PRECISION    dt1                  !Initial time step.
      DOUBLE PRECISION    eta1                 !Baryon-to-photon ratio.
#

C----------COMPUTATION LOCATION.

      INTEGER itime                !Time check.
#

C----------RUN OPTION.

      INTEGER irun                 !Run network size.
      INTEGER isize                !Number of nuclides in computation.
      INTEGER jsize                !Number of reactions in computation.
#

C----------OUTPUT FILE STATUS.

      INTEGER nout                 !Number of output requests.
      LOGICAL outfile              !Indicates if output file used.
#

C----------USER RESPONSE VARIABLES.

      INTEGER inum                 !Selection number.
#

C===========================PROCEDURE DIVISION=====================

#

C--------OPEN FILES AND PRINT GREETING-----------------------------

      CALL GETENV("OUTPUT", output_file)
      output_file = TRIM(output_file)
      IF (output_file == '') THEN
        output_file = 'nuc123.dat'
      END IF

      OPEN (unit=2, file=output_file, status='unknown')  !Output file.
      itime = 1                    !Time = beginning of program.
      CALL check                   !Check interface subroutine.
      PRINT 1000
#
 1000 FORMAT (6(/),
     |        2(' ',4x,'NN',6x,'NN  UU',6x,'UU',4x,8('C'),6x,'11',8x,
     |        6('2'),6x,6('3'),/),
     |        2(' ',4x,'NN',6x,'NN  UU',6x,'UU  CC',12x,'1111',6x,
     |        '22',6x,'22  33',6x,'33',/),
     |        2(' ',4x,'NNNN    NN  UU',6x,'UU  CC',14x,'11',14x,
     |        '22',10x,'33',/),
     |        2(' ',4x,'NN  NN  NN  UU',6x,'UU  CC',14x,'11',12x,
     |        '22',10x,'33',/),
     |        2(' ',4x,'NN    NNNN  UU',6x,'UU  CC',14x,'11',10x,
     |        '22',14x,'33',/),
     |        2(' ',4x,'NN',6x,'NN  UU',6x,'UU  CC',14x,'11',8x,
     |        '22',8x,'33',6x,'33',/),
     |        2(' ',4x,'NN',6x,'NN  ',10('U'),4x,8('C'),4x,6('1'),4x,
     |        10('2'),4x,6('3'),/),/,
     |        ' ',26x,'WRITTEN BY LAWRENCE KAWANO',///,
     |        ' ','(Press <RETURN> to continue): ',$)
#

C20--------INPUT INITIALIZATION INFORMATION AND PAUSE------------------------

      DO i  = 1,nrec
#

..........READ IN REACTION PARAMETERS.

        iform(i) = int(reacpr(i,2))!Reaction type.
        ii(i)    = int(reacpr(i,3))!Incoming nuclide type.
        jj(i)    = int(reacpr(i,4))!Incoming nuclide type.
        kk(i)    = int(reacpr(i,5))!Outgoing nuclide type.
        ll(i)    = int(reacpr(i,6))!Outgoing nuclide type.
        rev(i)   = reacpr(i,7)     !Reverse reaction coefficient.
        q9(i)    = reacpr(i,8)     !Energy released.
#

..........INITIALIZE REACTION RATES.

        f(i)  = 0.                 !Forward rate coeff.
        r(i)  = 0.                 !Reverse rate coeff.
#

..........SET RUN OPTIONS TO DEFAULT.

      END DO
      irun       = 1               !Do full run.
      isize      = nnuc            !Use all 26 nuclides.
      jsize      = nrec            !Use all 88 reactions.
#

..........SET OUTPUT OPTION TO DEFAULT.

      nout    = 0                  !No output requests.
      outfile = .false.            !Output file not used.
#

..........SET VALUES TO DEFAULT.

      cy    = cy0                  !Time step limiting constant on abundances.
      ct    = ct0                  !Time step limiting constant on temperature.
      t9i   = t9i0                 !Initial temperature.
      t9f   = t9f0                 !Final temperature.
      ytmin = ytmin0               !Smallest abundances allowed.
      inc   = inc0                 !Accumulation increment.
      c(1)  = c0(1)                !Variation of gravitational constant.
      c(2)  = c0(2)                !Neutron lifetime.
      c(3)  = c0(3)                !Number of neutrino species.
      cosmo = cosmo0               !Cosmological constant.
      xi(1) = xi0(1)               !Electron degeneracy parameter.
      xi(2) = xi0(2)               !Muon degeneray parameter.
      xi(3) = xi0(3)               !Tauon degeneracy parameter.
#

To force the integration, SHH

#

xi(1) = 1.E-20

#

xi(2) = 1.E-20

#

xi(3) = 1.E-20

      dt1   = dt0                  !Initial time step.
      eta1  = eta0                 !Baryon-to-photon ratio.
#

..........ACCEPT RETURN TO CONTINUE.

      READ (5,*)                  !Pause.
#

C30--------PRINT MENU AND AWAIT RESPONSE---------------------------------

#

C..........RETURN FROM LOOPING.

 300  CONTINUE
#

..........DISPLAY MENU.

      PRINT 3000
#
 3000 FORMAT (8(/),
     |        ' ',32x,'MENU SELECTION',/,
     |        ' ',32x,'---- ---------',//,
     |        ' ',24x,'1. HELP',/,
     |        ' ',24x,'2. SET COMPUTATION PARAMETERS',/,
     |        ' ',24x,'3. SET MODEL PARAMETERS',/,
     |        ' ',24x,'4. RUN',/,
     |        ' ',24x,'5. OUTPUT',/,
     |        ' ',24x,'6. EXIT',8(/),
     |        ' ',24x,'Enter selection (1-6): ',$)
#

..........READ IN SELECTION NUMBER.

      READ (5,3001) inum
#
 3001 FORMAT(i1)
#

C40--------BRANCH TO APPROPRIATE SECTION--------------------------------

      GO TO (410,420,430,440,450,460),inum
      GO TO 460                    !Improper input or <RETURN>.
#
 410  CONTINUE                     !Help section.
        CALL help
        GO TO 500
 420  CONTINUE                     !Set computation parameters section.
        CALL setcom
        GO TO 500
 430  CONTINUE                     !Set model parameters section.
        CALL setmod
        GO TO 500
 440  CONTINUE                     !Run section.
        itime = 2                  !Time = beginning of run section.
        CALL check                 !Check interface subroutine.
        CALL run
        itime = 9                  !Time = end of run section.
        CALL check                 !Check interface subroutine.
        GO TO 500
 450  CONTINUE                     !Output section.
        CALL output
        GO TO 500
 460  CONTINUE                     !Exit section.
#

cccccccccc CLOSE (unit=1) !End terminal session.

        itime = 10                 !Time = end of program.
        CALL check                 !Check interface subroutine.
        IF (outfile) THEN
          close (unit=2,status='keep')   !Close output file.
        ELSE
          CLOSE (unit=2,status='delete') !File not used - dispose.
        END IF
        STOP
#

C50---------GO BACK TO MENU-----------------------------------------

 500  CONTINUE
      GO TO 300

      END
#

C========================IDENTIFICATION DIVISION============================

      SUBROUTINE help
#

C----------LINKAGES.

#

CALLED BY - [program] nuc123

#

CALLS - none

#

C----------REMARKS.

#

Displays description and workings of the program.

      USE commons
#

C==========================DECLARATION DIVISION===========================

#

C----------USER RESPONSE VARIABLES.

      INTEGER inum                 !Selection number.
#

C===========================PROCEDURE DIVISION=============================

#

C10--------PRINT HELP SELECTION-------------------------------------------

#

C..........RETURN FROM LOOPING.

 100  CONTINUE
#

..........DISPLAY MENU.

      PRINT 1000
#
 1000 FORMAT (8(/),
     |        ' ',32x,'HELP SELECTION',/,
     |        ' ',32x,'---- ---------',//,
     |        ' ',24x,'1. INTRODUCTION',/,
     |        ' ',24x,'2. SETTING UP A RUN',/,
     |        ' ',24x,'3. RUNNING THE PROGRAM',/,
     |        ' ',24x,'4. OUTPUT OPTIONS',/,
     |        ' ',24x,'5. GENERAL METHOD OF COMPUTATION',/,
     |        ' ',24x,'6. USING THE INTERFACE SUBROUTINE',/,
     |        ' ',24x,'7. EXIT',7(/),
     |        ' ',24x,'Enter selection (1-7): ',$)
#

..........READ IN SELECTION NUMBER.

      READ (5,1001) inum
#
 1001 FORMAT (i1)
#

C20--------BRANCH TO APPROPRIATE SECTION---------------------------------

      GO TO (210,220,230,240,250,260,270),inum
      GO TO 270                    !Improper input or <RETURN>.
#

C21--------INTRODUCTION SECTION------------------------------------------

 210  CONTINUE                     !Setting up a run section.
        PRINT 2100
 2100   FORMAT (/,
     |          ' ',31x,'INTRODUCTION',/,
     |          ' ',31x,'------------',2(/),
     |          ' ','Welcome to the wonderful world of primor',
     |              'dial nucleosynthesis.  NUC123 is a      ',/,
     |          ' ','FORTRAN program designed to provide the ',
     |              'early universe researcher with the tools',/,
     |          ' ','necessary for the investigation of primo',
     |              'rdial nucleosynthesis.  Its menu-driven ',/,
     |          ' ','interface allows the user to first set c',
     |              'omputation parameters (such as the time ',/,
     |          ' ','step) and model parameters (such as the ',
     |              'neutron lifetime and number of neutri-  ',/,
     |          ' ','nos) before doing single runs or multipl',
     |              'e runs (in which desired model parame-  ',/,
     |          ' ','ters are varied over a desired range.)  ',
     |              'After the run, the user can utilize the ',/,
     |          ' ','menu to either produce an output file or',
     |              ' to view the most recent run on the     ',/,
     |          ' ','screen.  The program comes with an empty',
     |              ' subroutine CHECK into which the user   ',/,
     |          ' ','may wish to put additional code to add t',
     |              'o the computation in an original manner.',10(/),
     |          ' ','(Enter <RETURN> to go back to help menu): ',$)
        READ (5,*)
        GO TO 300
#

C22--------SET UP RUN SECTION------------------------------------------

 220  CONTINUE                     !Setting up a run section.
        PRINT 2200
 2200   FORMAT (/,
     |          ' ',29x,'SETTING UP A RUN',/,
     |          ' ',29x,'------- -- - ---',2(/),
     |          ' ','I. Setting computation parameters.      ',/,
     |          ' ','   The accuracy of the computation and t',
     |              'he relevant temperature region can be   ',/,
     |          ' ','   set by the following parameters:     ',/,
     |          ' ','    A. Time step limiting constant 1  (d',
     |              'efault value of 0.3)                    ',/,
     |          ' ','    B. Time step limiting constant 2  (d',
     |              'efault value of 0.03)                   ',/,
     |          ' ','    C. Initial time step  (default value',
     |              ' of 10**-4)                             ',/,
     |          ' ','    D. Initial temperature  (default val',
     |              'ue of 10**2)                            ',/,
     |          ' ','       This is the temperature at the be',
     |              'ginning of the run in units of 10**9 K  ',/,
     |          ' ','    E. Final temperature  (default value',
     |              ' of 10**-2)                             ',/,
     |          ' ','       This is the termination temperatu',
     |              're of the run in units of 10**9 K       ',/,
     |          ' ','    F. Smallest abundances allowed  (def',
     |              'ault value of 10**-25)                  ',/,
     |          ' ','       Elemental abundances are not allo',
     |              'wed to drop below this value            ',/,
     |          ' ','    G. # of iterations for each accumula',
     |              'tion  (default value of 30)             ',/,
     |          ' ','       This is the number of iterations ',
     |              'before values are put in an output array',6(/),
     |          ' ','(Enter 1 to continue, <RETURN> to end): ',$)
        READ (5,1001) inum
        IF (inum.eq.1) THEN
          PRINT 2202
 2202     FORMAT (/,
     |            ' ','II. Setting model parameters.           ',/,
     |            ' ','   Default values here give what is know',
     |                'n as the standard model with best guess ',/,
     |            ' ','   figure on the neutron lifetime of 889',
     |                '.541 seconds.  Nonstandard scenarios can',/,
     |            ' ','   be investigated by varying the follow',
     |                'ing parameters:                         ',/,
     |            ' ','    A. The gravitational constant       ',/,
     |            ' ','       (The default value of one here gi',
     |                'ves the usual 6.6720e-8 dyne*cm**2/g**2)',/,
     |            ' ','    B. Neutron life-time  (default value',
     |                ' of 889. seconds)                    ',/,
     |            ' ','    C. Number of neutrino species  (defa',
     |                'ult value of 3 light neutrinos)         ',/,
     |            ' ','    D. Final baryon-to-photon ratio  (se',
     |                't to log(eta) = -9.5)                   ',/,
     |            ' ','    E. Cosmological constant  (default v',
     |                'alue of 0)                              ',/,
     |            ' ','    F. Neutrino degeneracy parameters  (',
     |                'default values all 0)                   ',/,
     |            ' ','       There are 3 separate parameters f',
     |                'or the electron, muon, and tau neutrinos',11(/),
     |            ' ','(Enter <RETURN> to go back to help menu): ',$)
          READ (5,*)
          GO TO 300
        ELSE
          GO TO 300
        END IF !(inum.eq.1)
#

C23--------RUN PROGRAM SECTION------------------------------------------

 230  CONTINUE                     !Running the program section.
        PRINT 2300
 2300   FORMAT (/,
     |          ' ',28x,'RUNNING THE PROGRAM',/,
     |          ' ',28x,'------- --- -------',2(/),
     |          ' ','I. Setting run speed.                   ',/,
     |          ' ','   The code can be run at 3 different se',
     |              'ttings of speed.  The running of the    ',/,
     |          ' ','   code can be speeded up by reducing th',
     |              'e number of nuclides and reactions.  The',/,
     |          ' ','   complete computation takes into accou',
     |              'nt the following nuclides: n, p, d, t,  ',/,
     |          ' ','   He3, He4, Li6, Li7, Be7, Li8, B8, Be9',
     |              ',B10, B11, C11, B12, C12, N12, C13, N13,',/,
     |          ' ','   C14, N14, O14, N15, O15, and O16.    ',/,
     |          ' ','   The given CPU percentages and abundan',
     |              'ce variations are with regard to a      ',/,
     |          ' ','   single run with all default parameter',
     |              ' values.                                ',/,
     |          ' ','    A. 26 nuclides, 88 reactions (defaul',
     |              't)                                      ',/,
     |          ' ','       nuclides from n to O16           ',/,
     |          ' ','    B. 18 nuclides, 60 reactions        ',/,
     |          ' ','       nuclides from n to N12           ',/,
     |          ' ','       (63% CPU time, variation = .1%)  ',/,
     |          ' ','    C.  9 nuclides, 25 reactions        ',/,
     |          ' ','       nuclides from n to Be7           ',/,
     |          ' ','       (20% CPU time, variation = .5%)  ',4(/),
     |          ' ','(Enter 1 to continue, <RETURN> to end): ',$)
        READ (5,1001) inum
        IF (inum.eq.1) THEN
          PRINT 2302
 2302     FORMAT (/,
     |            ' ','II. Do single run.                      ',/,
     |            ' ','    A. Interactive.                     ',/,
     |            ' ','       In an interactive session, the us',
     |                'er can readily input the computational  ',/,
     |            ' ','       and model parameters and begin th',
     |                'e computation process.  The run itself  ',/,
     |            ' ','       is commenced when option 2, "GO",',
     |                ' in the "RUN" section is requested.     ',//,
     |            ' ','    B. Batch.                           ',/,
     |            ' ','       To run the program in a batch mod',
     |                'e, it must be altered slightly so that  ',/,
     |            ' ','       the I/O takes place with files in',
     |                'stead of a terminal.  This is done by   ',/,
     |            ' ','       setting different values for the ',
     |                'input and output unit number parameters ',/,
     |            ' ','       "ir" and "iw" and assigning them ',
     |                'to different files in NUC123.  In the   ',/,
     |            ' ','       file assigned the "ir" unit numbe',
     |                'r, one must place the responses to the  ',/,
     |            ' ','       queries of the program.          ',10(/),
     |            ' ','(Enter 1 to continue, <RETURN> to end): ',$)
          READ (5,1001) inum
          IF (inum.eq.1) THEN
            PRINT 2304
 2304       FORMAT (/,
     |              ' ','III. Do multiple runs.                 ',/,
     |              ' ','   A wide range of early universe model',
     |                  's can be covered by doing many runs    ',/,
     |              ' ','   while one or more parameters are var',
     |                  'ied over a range of interest.  The     ',/,
     |              ' ','   parameters that can be varied are th',
     |                  'e following:                           ',/,
     |              ' ','    A. Eta                             ',
     |                  '       - Logrithmic variation          ',/,
     |              ' ','    B. Gravitational constant          ',
     |                  '       - Linear variation              ',/,
     |              ' ','    C. Neutron lifetime                ',
     |                  '       - Linear variation              ',/,
     |              ' ','    D. Number of neutrino species      ',
     |                  '       - Linear variation              ',/,
     |              ' ','    E. Cosmological constant           ',
     |                  '       - Linear variation              ',/,
     |              ' ','    F. Neutrino degeneracy parameters  ',
     |                  '       - Linear variation              ',/,
     |              ' ','        1. Electron neutrino           ',/,
     |              ' ','        2. Muon neutrino               ',/,
     |              ' ','        3. Tauon neutrino              ',/,
     |              ' ','   At most 3 parameters can be varied. ',
     |                  ' The first parameter inputted will be  ',/,
     |              ' ','   will be varied in the outermost loop',
     |                  ' and the third parameter inputted will ',/,
     |              ' ','   be varied in the innermost loop.    ',7(/),
     |              ' ','(Enter <RETURN> to go back to help menu): ',$)
            READ (5,*)
            GO TO 300
          ELSE
            GO TO 300
          END IF !(inum.eq.1)
        ELSE
          GO TO 300
        END IF !(inum.eq.1)
#

C24--------OUTPUT OPTIONS SECTION----------------------------------

 240  CONTINUE                     !Output options section.
        PRINT 2400
 2400   FORMAT (/,
     |          ' ',30x,'OUTPUT OPTIONS',/,
     |          ' ',30x,'------ -------',2(/),
     |          ' ','I.  Request output file.                ',/,
     |          ' ','   After a run, the user can request the',
     |              ' program to put the resulting numbers   ',/,
     |          ' ','   into an output file.  This can be don',
     |              'e as many times as desired and all the  ',/,
     |          ' ','   information will be put in one new fi',
     |              'le under the name of "NUC123.DAT."  If  ',/,
     |          ' ','   there is no request during the entire',
     |              ' running of the program, this file is   ',/,
     |          ' ','   not created.  If an output file is re',
     |              'quested after a multiple run, only the  ',/,
     |          ' ','   information from the very last run wi',
     |              'll be given.  The output file will give ',/,
     |          ' ','   the computational and model parameter',
     |              's for each run and will contain the     ',/,
     |          ' ','   following information:               ',/,
     |          ' ','    A. Temperatures in decreasing order ',/,
     |          ' ','    B. Abundances for n, p, d, t, He3, H',
     |              'e4, Li6, Li7, Be7, and Li8 & up         ',/,
     |          ' ','       (p and He4 are in mass fraction, ',
     |              'the rest in ratios to the p abundance)  ',/,
     |          ' ','    C. Time, time interval, chemical pot',
     |              'ential of the electron                  ',/,
     |          ' ','    D. Energy densities for photons, ele',
     |              'ctrons, electron neutrinos, and baryons ',/,
     |          ' ','    E. Baryon-to-photon ratio, expansion',
     |              ' rate of the universe                   ',5(/),
     |          ' ','(Enter 1 to continue, <RETURN> to end): ',$)
        READ (5,1001) inum
        IF (inum.eq.1) THEN
          PRINT 2402
 2402     FORMAT (/,
     |            ' ','II.  Request output on screen.         ',/,
     |            ' ','   Instead of waiting to print out an o',
     |                'utput file, the user can immediately   ',/,
     |            ' ','   access the results of the latest run',
     |                ' by requesting the output on the       ',/,
     |            ' ','   screen.  There are four screens on e',
     |                'ach of which are displayed the         ',/,
     |            ' ','   computational and model parameters a',
     |                'nd the temperature:                    ',/,
     |            ' ','    A. Abundances for d, t, He3, He4, a',
     |                'nd Li7                                 ',/,
     |            ' ','       (He4 in mass fraction, rest as a',
     |                ' ratio with the p abundance)           ',/,
     |            ' ','    B. Abundances for n, p, Li6, Be7, a',
     |                'nd Li8 & up                            ',/,
     |            ' ','       (p in mass fraction, rest as a r',
     |                'atio with the p abundance)             ',/,
     |            ' ','    C. Energy densities for photons, el',
     |                'ectrons, electron neutrinos, & baryons ',/,
     |            ' ','    D. Time, time interval, chemical po',
     |                'tential of the electron,               ',/,
     |            ' ','       baryon-to-photon ratio, and expa',
     |                'nsion rate of the universe             ',11(/),
     |            ' ','(Enter <RETURN> to go back to help menu): ',$)
          READ (5,*)
          GO TO 300
        ELSE
          GO TO 300
        END IF !(inum.eq.1)
#

C25--------METHOD OF COMPUTATION SECTION--------------------------------

 250  CONTINUE                     !General method of computation section.
        PRINT 2500
 2500   FORMAT (/,
     |          ' ',22x,'GENERAL METHOD OF COMPUTATION',/,
     |          ' ',22x,'------- ------ -- -----------',2(/),
     |          ' ','I. Time evolution algorithm.            ',/,
     |          ' ','   The program utilizes a 2-point Runge-',
     |              'Kutta scheme (located in subroutine     ',/,
     |          ' ','   DRIVER) to time-evolve the temperatur',
     |              'e, the quantity hv (the ratio of the    ',/,
     |          ' ','   baryon density to T**3), the chemical',
     |              ' potential of the electron, and the     ',/,
     |          ' ','   nuclide abundances.  In the 2-point R',
     |              'unge-Kutta routine, a variable v at time',/,
     |          ' ','   t0 (= v0) is evolved to a time t1 by ',
     |              'adding to v0 the average of the         ',/,
     |          ' ','   derivatives evaluated at t0 and at t1',
     |              ' multiplied by dt:                      ',/,
     |          ' ','       v1 = v0 + 0.5(dvdt(t0)+dvdt(t1)) ',/,
     |          ' ','   where dvdt(t1) is gotten by first fin',
     |              'ding v1'' = v0 + dvdt(t0).  The         ',/,
     |          ' ','   derivatives of the nuclide abundances',
     |              ' are first computed and these are used  ',/,
     |          ' ','   to find the derivatives of t9, hv, an',
     |              'd phie (this is done in subroutine      ',/,
     |          ' ','   DERIVS).  To compute the time derivat',
     |              'ives of the nuclide abundances, a matrix',/,
     |          ' ','   equation is set up (in subroutine SOL',
     |              ') and is solved (in subroutine EQSLIN)  ',/,
     |          ' ','   by gaussian elimination utilizing imp',
     |              'licit differentiation.                  ',6(/),
     |          ' ','(Enter 1 to continue, <RETURN> to end): ',$)
        READ (5,1001) inum
        IF (inum.eq.1) THEN
          PRINT 2502
 2502     FORMAT (/
     |            ' ','II. Hierarchy of Subroutines.   ',/,
     |            ' ','    NUC123                       ',
     |                '     Main program (main menu)    ',/,
     |            ' ','        HELP                     ',
     |                '     Help option                 ',/,
     |            ' ','        SETCOM                   ',
     |                '     Set computational parameters',/,
     |            ' ','        SETMOD                   ',
     |                '     Set model parameters        ',/,
     |            ' ','        RUN                      ',
     |                '     Run computation code        ',/,
     |            ' ','            DRIVER               ',
     |                '     Main routine (Runge-Kutta loop)    ',/,
     |            ' ','                START            ',
     |                '     Initialization routine      ',/,
     |            ' ','                    RATE0        ',
     |                '     Computes weak decay rates   ',/,
     |            ' ','                DERIVS           ',
     |                '     Computes time derivatives   ',/,
     |            ' ','                    THERM        ',
     |                '     Computes energy densities   ',/,
     |            ' ','                        BESSEL   ',
     |                '     Gives functions of Kn       ',/,
     |            ' ','                            KNUX ',
     |                '     Computes modified Bessel fcn Kn    ',/,
     |            ' ','                        NUDENS   ',
     |                '     Computes neutrino energy density   ',/,
     |            ' ','                    RATE1-4      ',
     |                '     Computes rates for reactions',/,
     |            ' ','                    SOL          ',
     |                '     Builds A matrix for eqn dy/dt = Ay ',/,
     |            ' ','                        EQSLIN   ',
     |                '     Solves dy/dt=Ay by gaussian elim   ',/,
     |            ' ','                ACCUM            ',
     |                '     Output accumulator          ',/,
     |            ' ','        OUTPUT                   ',
     |                '     Allows user to output result',4(/),
     |            ' ','(Enter <RETURN> to go back to help menu): ',$)
          READ (5,*)
          GO TO 300
        ELSE
          GO TO 300
        END IF !(inum.eq.1)
#

C26--------USING INTERFACE SUBROUTINE SECTION.

 260  CONTINUE                     !Using the interface subroutine section.
        PRINT 2600
 2600   FORMAT (/,
     |          ' ',22x,'USING THE INTERFACE SUBROUTINE',/,
     |          ' ',22x,'----- --- --------- ----------',2(/),
     |          ' ','I. Purpose.                             ',/,
     |          ' ','   The interface subroutine CHECK is des',
     |              'igned to be an outlet of the program    ',/,
     |          ' ','   into which alterations can be easily ',
     |              'plugged.  Programs are normally modified',/,
     |          ' ','   by searching through the program, ide',
     |              'ntifying the appropriate areas for      ',/,
     |          ' ','   alterations, and interspersing new co',
     |              'mmands while deleting some old ones.    ',/,
     |          ' ','   This process can get tricky unless on',
     |              'e actively documents the alterations:   ',/,
     |          ' ','   one might lose track of all of the mo',
     |              'difications and deletions.  Thus, it is ',/,
     |          ' ','   worthwhile to put most if not all of ',
     |              'the necessary changes into one          ',/,
     |          ' ','   subroutine which is to be called from',
     |              ' strategic locations in the main        ',/,
     |          ' ','   program.  Furthermore, by putting cha',
     |              'nges into one small subroutine, one need',/,
     |          ' ','   only to compile the subroutine CHECK ',
     |              'each time instead of the entire nucleo- ',/,
     |          ' ','   synthesis code.                      ',8(/),
     |          ' ','(Enter 1 to continue, <RETURN> to end): ',$)
        READ (5,1001) inum
        IF (inum.eq.1) THEN
          PRINT 2602
 2602     FORMAT (/,
     |            ' ','II. Description.                        ',/,
     |            ' ','   Subroutine CHECK is an empty subrouti',
     |                'ne with a large COMMON area, giving the ',/,
     |            ' ','   user ready access to all of the impor',
     |                'tant variables in the computations.  The',/,
     |            ' ','   routine is called from various locati',
     |                'ons in the main program and the location',/,
     |            ' ','   spot in the program is labeled by the',
     |                ' flag "itime".  The set call locations  ',/,
     |            ' ','   are given below:                     ',/,
     |            ' ','    A. itime = 1 (NUC123, very beginning',
     |                ' of program run)                        ',/,
     |            ' ','       (appropriate for opening files, i',
     |                'nitializing variables)                  ',/,
     |            ' ','    B. itime = 2 (NUC123, right before g',
     |                'oing into the RUN section)              ',/,
     |            ' ','    C. itime = 3 (RUN, right before goin',
     |                'g into DRIVER to do the computations)   ',/,
     |            ' ','    D. itime = 4 (DRIVER, in 1st R-K loo',
     |                'p after computing derivatives in DERIVS)',/,
     |            ' ','    E. itime = 7 (DRIVER, in 2nd R-K loo',
     |                'p after computing derivatives in DERIVS)',/,
     |            ' ','    F. itime = 8 (RUN, right after comin',
     |                'g back from DRIVER)                     ',/,
     |            ' ','    G. itime = 9 (NUC123, right after co',
     |                'ming back from the RUN section)         ',/,
     |            ' ','    H. itime =10 (NUC123, very end of pr',
     |                'ogram run)                              ',/,
     |            ' ','       (appropriate for closing files)  ',/,
     |            ' ','   The difference between the (2,9) pair',
     |                'ing and the (3,8) pairing is that for a ',/,
     |            ' ','   multiple run, the (3,8) pairing would',
     |                ' be called before and after every run   ',/,
     |            ' ','   but the (2,9) pairing would be called',
     |                ' before and after the entire sequence.  ',4(/),
     |            ' ','(Enter 1 to continue, <RETURN> to end): ',$)
          READ (5,1001) inum
          IF (inum.eq.1) THEN
            PRINT 2604
 2604       FORMAT (/,
     |              ' ','III. Implementation.                   ',/,
     |              ' ','   The additional program statements ar',
     |                  'e needed in the subroutine CHECK.  If a',/,
     |              ' ','   particular command is to be executed',
     |                  ' when the computer is at a certain     ',/,
     |              ' ','   location in the program -- say label',
     |                  'ed by itime = 8 -- then in CHECK, one  ',/,
     |              ' ','   must place the command under the sta',
     |                  'tement, IF (itime.eq.8)....  The user  ',/,
     |              ' ','   is at leisure to place his own locat',
     |                  'ion indicators (5,6) and CALL CHECK    ',/,
     |              ' ','   statements anywhere in the program a',
     |                  's long as there is a COMMON /check/    ',/,
     |              ' ','   statement in the particular subrouti',
     |                  'ne to carry the value of itime along.  ',15(/),
     |              ' ','(Enter <RETURN> to go back to help menu): ',$)
            READ (5,*)
            GO TO 300
          ELSE
            GO TO 300
          END IF !(inum.eq.1)
        ELSE
          GO TO 300
        END IF !(inum.eq.1)
#

C27--------EXIT SECTION----------------------------------------------

 270  CONTINUE                     !Exit section.
        RETURN
#

C30--------GO BACK TO MAIN MENU-------------------------------------------

 300  CONTINUE
      GO TO 100

      END
#

C========================IDENTIFICATION DIVISION==========================

      SUBROUTINE setcom
#

C----------LINKAGES.

#

CALLED BY - [program] nuc123

#

CALLS - none

#

C----------REMARKS.

#

Allows resetting of computation parameters.

      USE commons
#

C----------COMMON AREAS.

      COMMON /compr0/ cy0,ct0,t9i0,t9f0,ytmin0,inc0  !Default comp parameters.
      COMMON /compr/  cy,ct,t9i,t9f,ytmin,inc        !Computation parameters.
      COMMON /varpr0/ dt0,eta0                      !Default variationl params.
      COMMON /varpr/  dt1,eta1                       !Variational parameters.
#

C==========================DECLARATION DIVISION=============================

#

C----------DEFAULT COMPUTATION PARAMETERS.

      DOUBLE PRECISION    cy0                  !Default cy.
      DOUBLE PRECISION    ct0                  !Default ct.
      DOUBLE PRECISION    t9i0                 !Default t9i.
      DOUBLE PRECISION    t9f0                 !Default t9f.
      DOUBLE PRECISION    ytmin0               !Default ytmin.
      INTEGER inc0                 !Default accumulation increment.
#

C----------COMPUTATION PARAMETERS.

      DOUBLE PRECISION    cy                   !Time step limiting constant on abundances.
      DOUBLE PRECISION    ct                   !Time step limiting constant on temperature.
      DOUBLE PRECISION    t9i                  !Initial temperature (in 10**9 K).
      DOUBLE PRECISION    t9f                  !Final temperature (in 10**9 K).
      DOUBLE PRECISION    ytmin                !Smallest abundances allowed.
      INTEGER inc                  !Accumulation increment.
#

C----------DEFAULT VARIATIONAL PARAMETERS.

      DOUBLE PRECISION    dt0                  !Default initial dt.
#

C----------VARIATIONAL PARAMETERS.

      DOUBLE PRECISION    dt1                  !Initial time step.
#

C----------LOCAL VARIABLES.

      INTEGER inum                 !Selection number.
#

C===========================PROCEDURE DIVISION===========================

#

C10--------PRINT RESET SELECTION AND AWAIT RESPONSE------------------------

#

C..........RETURN FROM LOOPING.

 100  CONTINUE
#

..........DISPLAY RESET SELECTIONS.

      PRINT 1000, cy,ct,dt1,t9i,t9f,ytmin,float(inc)
#
 1000 FORMAT (8(/),
     |        ' ',21x,'SET COMPUTATION PARAMETERS SELECTION',/,
     |        ' ',21x,'--- ----------- ---------- ---------',//,
     |        ' ',10x,' 1. CHANGE TIME-STEP LIMITING CONSTANT 1  FROM ',
     |            f5.3,/,
     |        ' ',10x,' 2. CHANGE TIME-STEP LIMITING CONSTANT 2  FROM ',
     |            f5.3,/,
     |        ' ',10x,' 3. CHANGE INITIAL TIME-STEP              FROM ',
     |            1pe8.2,' SECONDS',/,
     |        ' ',10x,' 4. CHANGE INITIAL TEMPERATURE            FROM ',
     |            1pe8.2,' (10**9 K)',/,
     |        ' ',10x,' 5. CHANGE FINAL TEMPERATURE              FROM ',
     |            1pe8.2,' (10**9 K)',/,
     |        ' ',10x,' 6. CHANGE SMALLEST ABUNDANCES ALLOWED    FROM ',
     |            1pe8.2,/,
     |        ' ',10x,' 7. CHANGE ACCUMULATION INCREMENT         FROM ',
     |            1pe8.2,' ITERATIONS',/,
     |        ' ',10x,' 8. RESET ALL TO DEFAULT VALUES',/,
     |        ' ',10x,' 9. EXIT',5(/),
     |        ' ',10x,'Enter selection (1-9): ',$)
#

..........READ IN SELECTION NUMBER.

      READ (5,1001) inum
#
1001  FORMAT (i1)
#

C20--------BRANCH TO APPROPRIATE SECTION--------------------------------

      GO TO (210,220,230,240,250,260,270,280,300),inum
      GO TO 300                    !Improper input or <RETURN>.
#
 210  CONTINUE                     !Change time step limiting const 1 section.
        PRINT 2100
 2100   FORMAT (' ','Enter value for time step limiting constant 1: ',$)
        READ (5,*) cy
 2101   FORMAT (f5.3)
        GO TO 400
 220  CONTINUE                     !Change time step limiting const 2 section.
        PRINT 2200
 2200   FORMAT (' ','Enter value for time step limiting constant 2: ',$)
        READ (5,*) ct
        GO TO 400
 230  CONTINUE                     !Change initial time step section.
        PRINT 2300
 2300   FORMAT (' ','Enter value for initial time step: ',$)
        READ (5,*) dt1
        GO TO 400
 240  CONTINUE                     !Change initial temperature section.
        PRINT 2400
 2400   FORMAT (' ','Enter value for initial temperature: ',$)
        READ (5,*) t9i
        GO TO 400
 250  CONTINUE                     !Change final temperature section.
        PRINT 2500
 2500   FORMAT (' ','Enter value for final temperature: ',$)
        READ (5,*) t9f
        GO TO 400
 260  CONTINUE                     !Change smallest abundances allowed section.
        PRINT 2600
 2600   FORMAT (' ','Enter value for smallest abundances allowed: ',$)
        READ (5,*) ytmin
        GO TO 400
 270  CONTINUE                     !Change accumulation increment section.
        PRINT 2700
 2700   FORMAT (' ','Enter value for accumulation increment: ',$)
        READ (5,*) inc
        GO TO 400
 280  CONTINUE                     !Reset all to default values section.
        cy    = cy0                !Time step limiting constant on abundances.
        ct    = ct0                !Time step limiting constant on temperature.
        dt1   = dt0                !Time step.
        t9i   = t9i0               !Initial temperature.
        t9f   = t9f0               !Final temperature.
        ytmin = ytmin0             !Smallest abundances allowed.
        inc   = inc0               !Accumulation increment.
        PRINT 2800
 2800   FORMAT (' ','All values reset to default - Press <RETURN> ',
     |              'to continue: ',$)
        READ (5,*)
        GO TO 400
 300  CONTINUE                     !Exit section.
        RETURN
#

C40--------GO BACK TO MENU----------------------------------------

 400  CONTINUE
      GO TO 100

      END
#

C========================IDENTIFICATION DIVISION========================

      SUBROUTINE setmod
#

C----------LINKAGES.

#

CALLED BY - [program] nuc123

#

CALLS - none

#

C----------REMARKS.

#

Allows resetting of model parameters.

      USE commons
#

C----------COMMON AREAS.

      COMMON /modpr0/ c0,cosmo0,xi0                  !Default model parameters.
      COMMON /modpr/  g,tau,xnu,c,cosmo,xi           !Model parameters.
      COMMON /varpr0/ dt0,eta0                      !Default variationl params.
      COMMON /varpr/  dt1,eta1                       !Variational parameters.
#

C==========================DECLARATION DIVISION==========================

#

C----------DEFAULT MODEL PARAMETERS.

      DOUBLE PRECISION    c0(3)                !Default c.
      DOUBLE PRECISION    cosmo0               !Default cosmological constant.
      DOUBLE PRECISION    xi0(3)               !Default neutrino degeneracy parameters.
#

C----------EARLY UNIVERSE MODEL PARAMETERS.

      DOUBLE PRECISION    c(3)                 !c(1) is variation of gravitational constant.
#
     |                             !c(2) is neutron lifetime (sec).
     |                             !c(3) is number of neutrino species.
      DOUBLE PRECISION    cosmo                !Cosmological constant.
      DOUBLE PRECISION    xi(3)                !Neutrino degeneracy parameters.
#

C----------DEFAULT VARIATIONAL PARAMETERS.

      DOUBLE PRECISION    eta0                 !Default eta.
#

C----------VARIATIONAL PARAMETERS.

      DOUBLE PRECISION    eta1                 !Intial baryon-to-photon ratio.
#

C----------USER RESPONSE VARIABLES.

      INTEGER inum                 !Selection number.
#

C===========================PROCEDURE DIVISION============================

#

C10--------PRINT RESET SELECTION AND AWAIT RESPONSE------------------------

#

C..........RETURN FROM LOOPING.

 100  CONTINUE
#

..........DISPLAY RESET SELECTIONS.

      PRINT 1000, c(1),c(2),c(3),eta1,cosmo,xi(1),xi(2),xi(3)
#
 1000 FORMAT (8(/),
     |        ' ',24x,'SET MODEL PARAMETERS SELECTION',/,
     |        ' ',24x,'--- ----- ---------- ---------',//,
     |        ' ',10x,' 1. CHANGE GRAVITATIONAL CONSTANT         FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 2. CHANGE NEUTRON LIFETIME               FROM ',
     |            1pe10.3,' SECONDS',/,
     |        ' ',10x,' 3. CHANGE NUMBER OF NEUTRINO SPECIES     FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 4. CHANGE FINAL BARYON-TO-PHOTON RATIO   FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 5. CHANGE COSMOLOGICAL CONSTANT          FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 6. CHANGE XI-ELECTRON                    FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 7. CHANGE XI-MUON                        FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 8. CHANGE XI-TAUON                       FROM ',
     |            1pe10.3,/,
     |        ' ',10x,' 9. RESET ALL TO DEFAULT VALUES',/,
     |        ' ',10x,'10. EXIT',4(/),
     |        ' ',10x,' Enter selection (1-10): ',$)
#

..........READ IN SELECTION NUMBER.

      READ (5,1001) inum
#
 1001 FORMAT (i2)
#

C20--------BRANCH TO APPROPRIATE SECTION---------------------------------

      GO TO (210,220,230,240,250,260,270,280,290,300),inum
      GO TO 300                    !Improper input or <RETURN>.
#
 210  CONTINUE                     !Change gravitational constant section.
        PRINT 2100
 2100   FORMAT (' ','Enter value for variation of gravitational ',
     |              'constant: ',$)
        READ (5,*) c(1)
        GO TO 400
 220  CONTINUE                     !Change neutron lifetime section.
        print 2200
 2200   FORMAT (' ','Enter value for neutron lifetime (sec): ',$)
        READ (5,*) c(2)
        GO TO 400
 230  CONTINUE                     !Change number of neutrino species section.
        print 2300
 2300   FORMAT (' ','Enter value for number of neutrino species: ',$)
        READ (5,*) c(3)
        GO TO 400
 240  CONTINUE                     !Change baryon-to-photon ratio section.
        print 2400
 2400   FORMAT (' ','Enter value for baryon-to-photon ratio: ',$)
        READ (5,*) eta1
        GO TO 400
 250  CONTINUE                     !Change cosmological constant section.
        print 2500
 2500   FORMAT (' ','Enter value for cosmological constant: ',$)
        READ (5,*) cosmo
        GO TO 400
 260  CONTINUE                     !Change neutrino degeneracy section.
        print 2600
 2600   FORMAT (' ','Enter value for xi electron: ',$)
        READ (5,*) xi(1)
        GO TO 400
 270  CONTINUE                     !Change neutrino degeneracy section.
        print 2700
 2700   FORMAT (' ','Enter value for xi muon: ',$)
        READ (5,*) xi(2)
        GO TO 400
 280  CONTINUE                     !Change neutrino degeneracy section.
        print 2800
 2800   FORMAT (' ','Enter value for xi tauon: ',$)
        READ (5,*) xi(3)
        IF ((xi(3).ne.0.).and.(c(3).lt.3.)) THEN
          c(3) = 3.
          print 2802
 2802     FORMAT (' ','Number of neutrinos set to 3')
          print 2804
 2804     FORMAT (' ','Press <RETURN> to continue: ',$)
          READ (5,*)
        END IF
        GO TO 400
 290  CONTINUE                     !Reset all to default values section.
        c(1)   = c0(1)
        c(2)   = c0(2)
        c(3)   = c0(3)
        cosmo  = cosmo0
        xi(1)  = xi0(1)
        xi(2)  = xi0(2)
        xi(3)  = xi0(3)
        eta1   = eta0
        print 2900
 2900   FORMAT (' ','All values reset to default - Press <RETURN> ',
     |              'to continue: ',$)
        READ (5,*)
        GO TO 400
 300  CONTINUE                     !Exit section.
        RETURN
#

C40--------GO BACK TO MENU---------------------------------------------

 400  CONTINUE
      GO TO 100

      END
#

C========================IDENTIFICATION DIVISION=========================

      SUBROUTINE run
#

C----------LINKAGES.

#

CALLED BY - [program] nuc123

#

CALLS - [subroutine] driver

#

C----------REMARKS.

#

Activates computation routine.

      USE commons
#

C----------COMMON AREAS.

      COMMON /modpr/  g,tau,xnu,c,cosmo,xi           !Model parameters.
      COMMON /varpr/  dt1,eta1                       !Variational parameters.
      COMMON /check1/  itime                          !Computation location.
      COMMON /runopt/ irun,isize,jsize               !Run options.
#

C==========================DECLARATION DIVISION===========================

#

C----------MODEL PARAMETERS.

      DOUBLE PRECISION    eta1                 !Baryon-to-photon ratio.
      DOUBLE PRECISION    c(3)                !c(1) is variation of gravitational constant.
#
     |                             !c(2) is neutron lifetime (sec).
     |                             !c(3) is number of neutrino species.
      DOUBLE PRECISION    cosmo                !Cosmological constant.
      DOUBLE PRECISION    xi(3)                !Neutrino degeneracy parameters.
#

C----------RUN OPTION.

      INTEGER irun                 !Run network size.
      INTEGER isize                !Number of nuclides in computation.
      INTEGER jsize                !Number of reactions in computation.
#

C----------USER INTERACTION VARIABLES.

      DOUBLE PRECISION    rnumb1               !Run parameter for outer loop.
      DOUBLE PRECISION    rnumb2               !Run parameter for middle loop.
      DOUBLE PRECISION    rnumb3               !Run parameter for inner loop.
      DOUBLE PRECISION    rnum1(3)             !Run parameter starting value.
      DOUBLE PRECISION    rnum2(3)             !Run parameter end value.
      DOUBLE PRECISION    rnum3(3)             !Run parameter increment.
      INTEGER inumb                !Selection number.
      INTEGER inum(3)              !Selection number.
      INTEGER jnum                 !Number of loopings to be done.
      INTEGER knum                 !Number of loopings rejected.
      INTEGER lnumb1               !Run parameter for outer loop.
      INTEGER lnumb2               !Run parameter for middle loop.
      INTEGER lnumb3               !Run parameter for inner loop.
      INTEGER lnum(3)              !Run parameter end value.
      INTEGER lchose               !User response (alphanumeric).
#

C----------FLAG AND LABELS.

      INTEGER itime                !Computation location.
      CHARACTER*22 vtype(8)        !Label for quantities being varied.
#

C----------EQUIVALENCE VARIABLE.

      DOUBLE PRECISION    qvary(7)             !Array set equal to c, cosmo, and xi.
#

C----------EQUIVALENCE STATEMENTS.

      EQUIVALENCE (qvary(1),c(1)), (qvary(4),cosmo), (qvary(5),xi(1))
#

C==============================DATA DIVISION=========================

#

C----------LABELS FOR QUANTITIES BEING VARIED.

      DATA vtype /'baryon/photon ratio   ',
#
     |            'gravitational constant',
     |            'neutron lifetime      ',
     |            '# of neutrino species ',
     |            'cosmological constant ',
     |            'xi-electron           ',
     |            'xi-muon               ',
     |            'xi-tauon              '/
#

C===========================PROCEDURE DIVISION============================

#

C10--------PRINT RUN SELECTION AND AWAIT RESPONSE------------------------

#

C..........RETURN FROM LOOPING.

 100  CONTINUE
#

..........DISPLAY RUN SELECTIONS.

      print 1000
#
 1000 FORMAT (8(/),
     |        ' ',32x,'RUN SELECTION',/,
     |        ' ',32x,'--- ---------',//,
     |        ' ',27x,' 1. SET RUN NETWORK',/,
     |        ' ',27x,' 2. GO',/,
     |        ' ',27x,' 3. DO MULTIPLE RUNS',/,
     |        ' ',27x,' 4. EXIT',10(/),
     |        ' ',27x,' Enter selection (1-4): ',$)
#

..........READ IN SELECTION NUMBER.

      READ (5,1001) inumb
#
 1001 FORMAT (i1)
#

C20--------BRANCH TO APPROPRIATE SECTION------------------------------------

      GO TO (210,220,230,240),inumb
      GO TO 240                    !Improper input or <RETURN>.
#

C21--------SET RUN NETWORK SECTION--------------------------------------

 210  CONTINUE
        print 2100
 2100   FORMAT (' ','Enter network size (1-26 nuclides (default); ',
     |              '2-18; 3-9): ',$)
        READ (5,*) inumb          !Read in selection number.
        IF ((inumb.ne.1).and.(inumb.ne.2).and.(inumb.ne.3)) inumb = 1 !Default.
        IF (inumb.ne.irun) THEN    !Run network changed from previously.
          irun = inumb             !Run network size selection.
        END IF
        IF (irun.eq.1) THEN        !Maximal network size.
          isize = nnuc
          jsize = nrec
        ELSE
          IF (irun.eq.2) THEN      !Abridged network size.
            isize = lnuc
            jsize = lrec
          ELSE
            IF (irun.eq.3) THEN    !Minimal network size.
              isize = knuc
              jsize = krec
            END IF
          END IF
        END IF !(irun.eq.1)
        print 2104, irun
 2104   FORMAT (' ','Run network set to ',i1,' - Press <RETURN> ',
     |              'to continue: ',$)
        READ (5,*)
        GO TO 300
#

C22--------GO SECTION--------------------------------------

 220  CONTINUE
        print 2200
 2200   FORMAT (' ','Begin computation run....')
        itime = 3
        CALL check                 !Call interface subr before computation.
        CALL driver                !Do nucleosynthesis computation.
        itime = 8
        CALL check                 !Call interface subr after computation.
        print 2202
 2202   FORMAT (' ','Computation completed - Press <RETURN> to ',
     |              'continue: ',$)
        READ (5,*)
        GO TO 300
#

C23--------DO MULTIPLE RUNS SECTION----------------------------------------

#

C..........GET NUMBER OF LOOPINGS.

 230  CONTINUE
        print 2300
 2300   FORMAT (' ','Enter the number of loopings to be done (1 ',
     |              '(default); 2; 3): ',$)
        READ (5,*) jnum           !Read in number of loopings to be done.
        IF ((jnum.ne.1).and.(jnum.ne.2).and.(jnum.ne.3)) THEN
          jnum = 1                 !Default number of loopings.
        END IF
        knum = 0.                  !No loopings rejected for now.
        DO i = 1,3
          IF (i.gt.jnum) THEN
            rnum1(i) = 0.          !Initialize initial parameter.
            rnum2(i) = 0.          !Initialize terminal parameter.
            rnum3(i) = 1.          !Initialize incremental parameter.
            inum(i)  = 0           !Initialize selection number.
          ELSE
#

..........OBTAIN QUANTITY TO VARY.

            print 2302
#
 2302       FORMAT (8(/),
     |              ' ',30x,'QUANTITY TO VARY',/,
     |              ' ',30x,'-------- -- ----',//,
     |              ' ',25x,' 1.  ETA     (LOGRITHMIC VARIATION)',/,
     |              ' ',25x,' 2.  G           (LINEAR VARIATION)',/,
     |              ' ',25x,' 3.  TAU         (LINEAR VARIATION)',/,
     |              ' ',25x,' 4.  # NEUTRINOS (LINEAR VARIATION)',/,
     |              ' ',25x,' 5.  LAMBDA      (LINEAR VARIATION)',/,
     |              ' ',25x,' 6.  XI-ELECTRON (LINEAR VARIATION)',/,
     |              ' ',25x,' 7.  XI-MUON     (LINEAR VARIATION)',/,
     |              ' ',25x,' 8.  XI-TAUON    (LINEAR VARIATION)',/,
     |              ' ',25x,' 9.  NO SELECTION',5(/),
     |              ' ',25x,' Enter selection (1-9): ',$)
            READ (5,1001) inum(i)
            IF ((inum(i).lt.1).or.(inum(i).gt.8)) THEN  !No selection made.
              print 2304
 2304         FORMAT (' ','No selection made - Reduce number of ',
     |                    'loopings by one',/,
     |                ' ','Press <RETURN> to continue: ',$)
              READ (5,*)
              knum = knum + 1   !Step up number of loopings rejected.
              rnum1(i) = 0.     !Initialize initial parameter.
              rnum2(i) = 0.     !Initialize terminal parameter.
              rnum3(i) = 1.     !Initialize incremental parameter.
              inum(i)  = 0      !Initialize selection number.
            ELSE !((inum(i).ge.1).and.(inum(i).le.8))
#

..........INPUT RUN SPECIFICATIONS.

 231          CONTINUE
              print 2306
 2306         FORMAT (' ','Enter minimum value: ',$)
              READ (5,*) rnum1(i)  !Read in starting value.
              print 2308
 2308         FORMAT (' ','Enter maximum value: ',$)
              READ (5,*) rnum2(i)  !Read in terminating value.
 232          CONTINUE
              print 2310
 2310         FORMAT (' ','Enter increment: ',$)
              READ (5,*) rnum3(i)  !Read in incremental value.
              IF (rnum3(i).eq.0.) THEN !Trouble with 0 division later on.
                print 2312
 2312           FORMAT (' ','Zero increment not allowed: trouble with ',
     |                      'dividing by zero')
                GO TO 232
              END IF
              print 2314, rnum1(i), rnum2(i), rnum3(i) !Display input info.
 2314         FORMAT (' ','Run from ',1pe12.5,' to ',1pe12.5,
     |                    ' in increments of ',1pe12.5)
              print 2316
 2316         FORMAT (' ','Confirm these values (1=Y or 0=N): ',$)
              READ (5,*) lchose                       !Get confirmation.
 2301         FORMAT (a1)
              IF (lchose.eq.0) GO TO 231
            END IF !((inum(i).lt.1).or.(inum(i).gt.8))
          END IF !(i.gt.jnum)
        END DO !i = 1,3
        jnum = jnum-knum           !Number of valid loopings.
        IF (jnum.ne.0) THEN        !Run requested.
#

..........PRINTOUT QUANTITY TO VARY, RUN SPECIFICATIONS.

          DO l = 1,jnum+knum       !Check all loopings.
            IF (inum(l).ne.0) THEN !Proper selection was made.
              print 2318, vtype(inum(l)),rnum1(l),     !Display run params.
#
     |                        rnum2(l), rnum3(l)
#
 2318         FORMAT (' ','Run ',a22,/,
     |                    '    from ',1pe12.5,' to ',1pe12.5,
     |                    ' in increments of ',1pe12.5)
#

..........GET LOGS OF eta VALUES FOR LOGRITHMIC INCREMENTATION.

              IF (inum(l).eq.1) THEN  !Work with exponents for eta increments.
                rnum1(l) = log10(rnum1(l))
                rnum2(l) = log10(rnum2(l))
              END IF
#
            END IF
#
          END DO
#

..........COMPUTE NUMBER OF RUNS FOR EACH LOOPING.

          DO l = 1,3
            lnum(l) = nint((rnum2(l)-rnum1(l)+rnum3(l))/rnum3(l))
          END DO
#

..........DO MULTIPLE RUNS.

          print 2200          !Inform user of beginning of computation.
          DO lnumb1 = 0,lnum(1)-1  !Outer loop.
            rnumb1 = rnum1(1)+float(lnumb1)*rnum3(1)  !Value of param for run.
            IF ((inum(1).ge.1).and.(inum(1).le.8)) THEN
              IF (inum(1).eq.1) THEN
                eta1 = 10**rnumb1    !Vary baryon-to-photon ratio.
              ELSE
                qvary(inum(1)-1) = rnumb1  !Vary other quantities.
              END IF
            END IF
            DO lnumb2 = 0,lnum(2)-1  !Middle loop.
              rnumb2 = rnum1(2)+float(lnumb2)*rnum3(2) !Value of param for run.
              IF ((inum(2).ge.1).and.(inum(2).le.8)) THEN
                IF (inum(2).eq.1) THEN
                  eta1 = 10**rnumb2  !Vary baryon-to-photon ratio.
                ELSE
                  qvary(inum(2)-1) = rnumb2  !Vary other quantities.
                END IF
              END IF
              DO lnumb3 = 0,lnum(3)-1  !Inner loop.
                rnumb3 = rnum1(3)+float(lnumb3)*rnum3(3)  !Value of parameter.
                IF ((inum(3).ge.1).and.(inum(3).le.8)) THEN
                  IF (inum(3).eq.1) THEN
                    eta1 = 10**rnumb3  !Vary baryon-to-photon ratio.
                  ELSE
                    qvary(inum(3)-1) = rnumb3  !Vary other quantities.
                  END IF
                END IF
                itime = 3
                CALL check         !Check interface subr before computation.
                CALL driver        !Do nucleosynthesis computation.
                itime = 8
                CALL check       !Check interface subroutine after computation.
              END DO !lnumb3 = 0,lnum(3)-1
            END DO !lnumb2 = 0,lnum(2)-1
          END DO !lnumb1 = 0,lnum(1)-1
          print 2202          !Inform user of completion of computation.
#
        ELSE !(jnum.eq.0)
          print 2320
#
 2320     FORMAT (' ','No selection made - ',
     |                'Press <RETURN> to continue: ',$)
        END IF !(jnum.ne.0)
        READ (5,*)
        GO TO 300
#

C24--------EXIT SECTION--------------------------------------------------

 240  CONTINUE
        RETURN
#

C30--------GO BACK TO MENU-----------------------------------------------

 300  CONTINUE
      GO TO 100

       END
#

C========================IDENTIFICATION DIVISION==========================

      SUBROUTINE output
#

C----------LINKAGES.

#

CALLED BY - [program] nuc123

#

CALLS - none

#

C----------REMARKS.

#

Outputs computational results either into an output file or onto

#

the screen

      USE commons
#

C----------COMMON AREAS.

      COMMON /compr/  cy,ct,t9i,t9f,ytmin,inc        !Computation parameters.
      COMMON /modpr/  g,tau,xnu,c,cosmo,xi           !Model parameters.
      COMMON /flags/  ltime,is,ip,it,mbad            !Flags, counters.
      COMMON /outdat/ xout,thmout,t9out,tout,dtout,  !Output data.
#
     |                etaout,hubout
      COMMON /outopt/ nout,outfile                   !Output option.
#

C==========================DECLARATION DIVISION=============================

#

C----------COMPUTATION SETTINGS.

      DOUBLE PRECISION    cy                   !Time step limiting constant on abundances.
      DOUBLE PRECISION    ct                   !Time step limiting constant on temperature.
      DOUBLE PRECISION    t9i                  !Initial temperature (in 10**9 K).
      DOUBLE PRECISION    t9f                  !Final temperature (in 10**9 K).
      DOUBLE PRECISION    ytmin                !Smallest abundances allowed.
#

C----------EARLY UNIVERSE MODEL PARAMETERS.

      DOUBLE PRECISION    c(3)                !c(1) is variation of gravitational constant.
#
     |                             !c(2) is neutron lifetime (sec).
     |                             !c(3) is number of neutrino species.
      DOUBLE PRECISION    cosmo                !Cosmological constant.
      DOUBLE PRECISION    xi(3)                !Neutrino degeneracy parameters.
#

C----------COUNTER.

      INTEGER it                   !# times accumulated in output buffer.
#

C----------OUTPUT ARRAYS.

      DOUBLE PRECISION    xout(itmax,nnuc)     !Nuclide mass fractions.
      DOUBLE PRECISION    thmout(itmax,6)      !Thermodynamic variables.
      DOUBLE PRECISION    t9out(itmax)         !Temperature (in units of 10**9 K).
      DOUBLE PRECISION    tout(itmax)          !Time.
      DOUBLE PRECISION    dtout(itmax)         !Time step.
      DOUBLE PRECISION    etaout(itmax)        !Baryon-to-photon ratio.
      DOUBLE PRECISION    hubout(itmax)        !Expansion rate.
#

C----------OUTPUT FILE STATUS.

      INTEGER nout                 !Number of output requests.
      LOGICAL outfile              !Indicates if output file used.
#

C----------USER INTERACTION VARIABLES.

      INTEGER inum                 !Selection number.
#

C===========================PROCEDURE DIVISION=============================

#

C10--------PRINT OUTPUT SELECTION AND AWAIT RESPONSE----------------------

#

C..........RETURN FROM LOOPING.

 100  CONTINUE
#

..........DISPLAY OUTPUT SELECTIONS.

      print 1000
#
 1000 FORMAT (8(/),
     |        ' ',30x,'OUTPUT SELECTION',/,
     |        ' ',30x,'------ ---------',//,
     |        ' ',25x,' 1. REQUEST OUTPUT FILE',/,
     |        ' ',25x,' 2. REQUEST OUTPUT ON SCREEN',/,
     |        ' ',25x,' 3. EXIT',11(/),
     |        ' ',25x,' Enter selection (1-3): ',$)
#

..........READ IN SELECTION NUMBER.

      READ (5,1001) inum
#
 1001 FORMAT (i1)
#

..........BRANCH TO APPROPRIATE SECTION.

      GO TO (200,300,400),inum
      GO TO 400                    !Improper input or <RETURN>.
#

C20--------REQUEST OUTPUT SECTION--------------------------------------

 200  CONTINUE
        PRINT *, 'Saving output to: ', output_file
#

c DO j = 1,it !Temperature in MeV.

#

t9out(j) = t9out(j)*.08617

#

END DO

#

DO j = 1,it !Energy density as fraction of total.

#

thmout(j,1) = thmout(j,1)/thmout(j,6) !Rhog.

#

thmout(j,2) = thmout(j,2)/thmout(j,6) !Rhoe.

#

thmout(j,3) = thmout(j,3)/thmout(j,6) !Rhone.

#

thmout(j,4) = thmout(j,4)/thmout(j,6) !Rhob.

#

END DO

#

..........PRINT CAPTION.

        nout = nout + 1            !Keep track of number of output requests.
        IF (nout.eq.1) THEN
          write(2,2000)
#
 2000     FORMAT (54x,'NUCLIDE ABUNDANCE YIELDS',/,
     |            54x,'------- --------- ------',//)
        END IF
        write(2,2002) cy,ct,t9i,t9f,ytmin
 2002   FORMAT (' Computational parameters:',/,
     |          '   cy = ',f5.3,'/  ct = ',f5.3,
     |          '/  initial temp = ',1pe8.2,
     |          '/  final temp = ',1pe8.2,
     |          '/  smallest abundances allowed = ',1pe8.2)
        write(2,2004) c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)
 2004   FORMAT (' Model parameters:',/,
     |          '   g = ',f5.2,'/  tau = ',f6.2,
     |          '/  # nu = ',f5.2,'/  lambda = ',1pe10.3,
     |          '/  xi-e = ',e10.3,'/  xi-m = ',e10.3,
     |          '/  xi-t = ',e10.3,/)
#

..........PRINT HEADINGS, ABUNDANCES FOR NEUTRON TO LI8.

        write(2,2006)
#
 2006   FORMAT (4x,'Temp',8x,'N/H',10x,'P',10x,'D/H',9x,'T/H',8x,
     |          'He3/H',8x,'He4',8x,'Li6/H',7x,'Li7/H',7x,
     |          'Be7/H',6x,'Li8/H&up',/,132('-'))
        DO j = 1,it
          write(2,2008) t9out(j),(xout(j,i),i=1,10)
 2008     FORMAT (1pe10.3,1p10e12.3)
        END DO
#

..........PRINT THERMODYNAMIC QUANTITIES.

        write(2,2010)
#
 2010   FORMAT (' ',/,4x,'Temp',9x,'T',10x,'rhog',8x,'rhoe',7x,
     |              'rhone',8x,'rhob',8x,'phie',9x,'dt',9x,
     |              'eta',10x,'H',/,132('-'))
        DO j = 1,it
          write(2,2012) t9out(j),tout(j),(thmout(j,i),i=1,5),dtout(j),
     |                   etaout(j),hubout(j)
 2012     FORMAT (1pe10.3,9e12.3)
        END DO
        write(2,2014)
 2014   FORMAT (///)
        outfile = .true.           !Output file requested.
        print 2016
 2016   FORMAT (' ','Output file requested - Press <RETURN> to ',
     |              'continue: ',$)
        READ (5,*)
        GO TO 500
#

C30--------REQUEST OUTPUT ON SCREEN SECTION------------------------------

#

C..........RETURN FROM LOOPING.

 300  CONTINUE
#

DO j = 1,it !Temperature in MeV.

#

t9out(j) = t9out(j)*.08617

#

END DO

#

DO j = 1,it !Energy density as fraction of total.

#

thmout(j,1) = thmout(j,1)/thmout(j,6) !Rhog.

#

thmout(j,2) = thmout(j,2)/thmout(j,6) !Rhoe.

#

thmout(j,3) = thmout(j,3)/thmout(j,6) !Rhone.

#

thmout(j,4) = thmout(j,4)/thmout(j,6) !Rhob.

#

END DO

#

..........DISPLAY SCREEN OUTPUT SELECTIONS.

        print 3000
#
 3000   FORMAT (8(/),
     |          ' ',26x,'SCREEN OUTPUT SELECTION',/,
     |          ' ',26x,'------ ------ ---------',//,
     |          ' ',25x,' 1. DISPLAY D,T,HE3,HE4,LI7',/,
     |          ' ',25x,' 2. DISPLAY N,P,LI6,BE7,LI8&UP',/,
     |          ' ',25x,' 3. DISPLAY RHOG,RHOE,RHONE,RHOB',/,
     |          ' ',25x,' 4. DISPLAY T,DT,PHIE,ETA,H',/,
     |          ' ',25x,' 5. EXIT',9(/),
     |          ' ',25x,' Enter selection (1-5): ',$)
#

..........READ IN SELECTION NUMBER.

        READ (5,1001) inum
        GO TO (310,320,330,340,350),inum
        GO TO 350                  !Improper input or <RETURN>.
#
 310    CONTINUE                   !Display d,t,he3,he4,li7.
#

..........PRINT CAPTION.

          print 2014
          print 3100, cy,ct,t9i,t9f,ytmin
#
 3100     FORMAT (' ','Computational parameters:',/,
     |            ' ','   cy = ',f5.3,'/ ct = ',f5.3,
     |                '/ initial temp = ',1pe8.2,
     |                '/ final temp = ',1pe8.2,/,
     |            ' ','   smallest abundances allowed = ',1pe8.2)
          print 3102, c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)
 3102     FORMAT (' ','Model parameters:',/,
     |            ' ','   g = ',f5.2,'/ tau = ',f6.2,
     |                '/ # nu = ',f5.2,'/ lambda = ',1pe10.3,/,
     |            ' ','   xi-e = ',e10.3,'/ xi-m = ',e10.3,
     |                '/ xi-t = ',e10.3,/)
#

..........PRINT HEADINGS, ABUNDANCES FOR D,T,HE3,HE4,LI7.

          print 3104
#
 3104     FORMAT (4x,'Temp',8x,'D/H',9x,'T/H',8x,'He3/H',8x,
     |            'He4',8x,'Li7/H',/,' ',80('-'))
          DO j = 1,it
            print 3106, t9out(j),(xout(j,i),i=3,6),xout(j,8)
 3106       FORMAT (1pe10.3,1p5e12.3)
          END DO
          print 2014
          print 3108
 3108     FORMAT (' ','Press <RETURN> to continue: ',$)
          READ (5,*)
          GO TO 360
 320    CONTINUE                   !Display n,p,li6,be7,li8&up.
#

..........PRINT CAPTION.

          print 2014
          print 3100, cy,ct,t9i,t9f,ytmin
          print 3102, c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)
#

..........PRINT HEADINGS, ABUNDANCES FOR N,P,LI6,BE7,LI8&UP.

          print 3204
#
 3204     FORMAT (4x,'Temp',8x,'N/H',10x,'P',9x,
     |            'Li6/H',7x,'Be7/H',6x,'Li8/H&up',/,' ',80('-'))
          DO j = 1,it
            print 3106, t9out(j),(xout(j,i),i=1,2),xout(j,7),
     |                      (xout(j,i),i=9,10)
          END DO
          print 2014
          print 3108
          READ (5,*)
          GO TO 360
 330    CONTINUE                   !Display rhog,rhoe,rhone,rhob.
#

..........PRINT CAPTION.

          print 2014
          print 3100, cy,ct,t9i,t9f,ytmin
          print 3102, c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)
#

..........PRINT ENERGY DENSITIES.

          print 3304
#
 3304     FORMAT (4x,'Temp',8x,'rhog',8x,'rhoe',7x,'rhone',8x,'rhob',
     |            /,' ',80('-'))
          DO j = 1,it
            print 3306, t9out(j),(thmout(j,i),i=1,4)
 3306       FORMAT (1pe10.3,4e12.3)
          END DO
          print 2014
          print 3108
          READ (5,*)
          GO TO 360
 340    CONTINUE                   !Display t,dt,phie,eta,hubcst.
#

..........PRINT CAPTION.

          print 2014
          print 3100, cy,ct,t9i,t9f,ytmin
          print 3102, c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)
#

..........PRINT THERMODYNAMIC QUANTITIES.

          print 3404
#
 3404     FORMAT (4x,'Temp',8x,'time',8x,'phie',9x,'dt',9x,'eta',10x,
     |            'H',/,' ',80('-'))
          DO j = 1,it
            print 3406, t9out(j),tout(j),thmout(j,5),dtout(j),
     |                      etaout(j),hubout(j)
 3406       FORMAT (1pe10.3,5e12.3)
          END DO
          print 2014
          print 3108
          READ (5,*)
          GO TO 360
 350    CONTINUE                   !Exit.
          GO TO 500
 360    CONTINUE
        GO TO 300
#

C40--------EXIT SECTION----------------------------------------------

 400  CONTINUE
        RETURN
#

C50--------GO BACK TO MENU-------------------------------------------------

 500  CONTINUE
      GO TO 100

      END