                 T M A T R X

      TMATRX calculates T-matrices from K-matrices.  If required it will
      also calculate adiabatically averaged T-matrices for vibrational
      excitation.

      Input files:
        Channel and target data          (on unit LUCHAN)
        K-matrices                       (on unit LUKMT )

      Output files:
        T-matrices                       (on unit LUTMT )
        Vibrational channel data         (on unit LUVCHN)


      The following PARAMETERs are used to define array dimensions

      MAXERN = 10  maximum number of energy subranges (defined in RSOLVE)
      MAXPTS = 30  maximum number of geometries which may be used in
                   adiabatic averaging
                   

      The main data describing the run is input via namelist /TMATIN/.
      If adiabatic averaging is selected then additional input will be 
      required by routine VIBINI, to describe the vibrational states of 
      the target. For further details see below.

      Namelist input /TMATIN/

        The format of the following is 
       (Name, Type, Dimension, Default, Limits, ! description)
        Unless specified otherwise, the default value applies to all elements
        of array variables.
        

        EMIN     R   1         0.    [0.:MAXE]
           ! minimum required scattering energy (in units as specified by 
             IEUNIT).  MAXE is the maximum energy on the T-matrix file

        EMAX     R   1         MAXE  [0.:MAXE]
           ! maximum required scattering energy (MAXE is the maximum energy
             on the T-matrix file)

        ICFORM   C   1         'U'   ['U'|'F']
           ! format flag for channel dataset, 'F' for formatted, 'U' for
             unformatted

        IEUNIT   I   1          1    [1,2]  
           ! units in which input scattering energies are input
                 1= Ryd, 2= eV

        IKFORM   C   1         'U'   ['U'|'F']
           ! Formatted/unformatted switch for unit LUKMT

        IPRNT    I   6          0    [0|1]
           ! Debug print switches :
             In each case -1 gives less than the default output and +1
             more than the default
                 (1) =1 Print all input data
                 (2) =1 Print any vibrational wavefuction data
                 (3) =1 Check orthonormality of vibrational wavefunctions
                        on current range of R
                 (4)  not used
                 (5)  not used
                 (6) =1 Print all output data

        ITFORM   C   1         'U'   ['U'|'F']
           ! Formatted/unformatted switch for unit LUTMT

        IWRITE   I   1          6    [1:]        
           ! logical unit for printed output

        LUCHAN   I   1         10    [1:]        
           ! logical unit for input channel and target datasets

        LUKMT    I   1         11    [1:]
           ! logical unit holding input K-matrices

        LUTMT    I   1         12    [1:]
           ! logical unit holding output T-matrices

        LUVCHN   I   1         10    [1:]        
           ! logical unit for output vibrational channel and target datasets
             (only for use with adiabatic averaging option)

        MAXI     I   1          1    [1:NTARG]
           ! label of highest initial state for which cross-
             sections will be required.  In order to save space, only a
             subset of the entire T-matrix will in general be saved at
             each scattreing energy.  NTARG in this context counts both 
             electronic and vibrational states.

        MAXF      I   1         NTARG [1:NTARG]
           ! label of highest final state for which cross-sections
             will be required (here NTARG counts both electronic and
             vibrational states)

        NAME      C   60                          
           ! title for any output

        NAVGE     I   1          0    [0:1]
           ! = 0 no averaging of T-matrices
             = 1 T-matrices are to be adiabatically averaged 

        NCHSET    I   1          1    [1:]        
           ! set number of required channel dataset.  If adiabatic
             averaging is required, this should be the set number
             corresponding to the equilibrium geometry

        NGEOM     I   1          1    [1:]
           ! number of target geometries to be used in the adiabatic
             averaging

        NKSET     I   MAXPTS          1    [1:]
           ! Set numbers for input K-matrices 

        NQUAD     I   1         201   [1:]
           ! Number of quadrature points to be used in adiabatic averaging

        NTSET     I   1          1    [0:]
           ! Set number for output T-matrices 

        NVCSET   I   1         10    [1:]        
           ! set number for output vibrational channel and target datasets
             (only for use with adiabatic averaging option)

        R         R   NGEOM           [0.:]        
           ! internuclear separations
