Documentation for SWINTERF                         L A Morgan  26 Jan 1998 


                   S W I N T E R F

      SWINTERF provides the interface between the UKRmol+ inner region 
      codes and the outer region package of programs.  It is intended that,
      as far as possible, changes in the outer region codes necessitated
      by changes in the inner region codes be localised in this module.

      Input files:
        Boundary amplitudes              (on unit LUAMP )
        CI eigenvalues and eigenvectors  (on unit LUCI  )
        Target data                      (on unit LUTARG)

      Output files:
        Channel and target data          (on unit LUCHAN)
        R-matrix data                    (on unit LURMT )


      The following PARAMETERs are used to define array dimensions

      MAXCH  = 100 maximum number of fixed nuclei scattering channels
      MAXTGT = 20  maximum number of target electronic states
      MAXNUC = 100 maximum number of atomic centres

      Namelist input /SWINTFIN/

        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.
        
        ALPHA0   R   1          0.    [:]
           ! Spherical part of static polarizability

        ALPHA2   R   1          0.    [:]
           ! Non spherical part of static polarizability

        ESHIFT   R   MAXTGT     0.
           ! Shifts to be applied to energies on target properties file
	   ! For more information on shifts please see end of doc.

        IAFORM   C   1         'U'   ['U'|'F']
           ! unused

        IBFORM   C   1         'U'   ['U'|'F'] 
           ! unused

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

        IDTARG   I   MAXTGT           [1:]
           ! array which specifies which NTARG target states are to
             be selected from the properties file on unit LUTARG. 
             IDTARG(I)=K is defined such that index I is given by the 
             order in which states are used in congen and K refers to 
             the state being the Kth in energy order (see target 
             property file).

        IPOSIT   I   2          0    [:]
                ! Controls the charge sign for asympotic potential interactions.
                  =0 keeps the charge sign at +1.0  (for electron calculations)
                  /=0 charge sign will be changed to -1.0 (for positron calculations).
                !Note that unlike the use of IPOSIT in the inner region (CONGEN and
                !SCATCI) one must set IPOSIT=0 for no exchange electron scattering
                !calculations. 

                  iposit defaults to 0, which keeps the charge sign at +1.0
                  (for electron calculations). If iposit is changed to be not zero
                  in the namelist, then the charge sign will be changed to -1.0
                  (for positron calculations).

        IPRNT    I   6          0    [-1,0,1]
           ! Debug print switches :
             In each case -1 gives less than the default output and +1
             more than the default
                 (1) exact copy of output to LUCHAN
                 (2) multipole coefficients of asymptotic potential
                 (3) input CI eigenvalues and first element of each
                     eigenvector
                 (4) input boundary amplitudes
                 (5) Buttle corrections
                 (6) exact copy of output to LURMT

        IRFORM   C   1         'U'   ('U'|'F')
           ! format flag for R-matrix dataset, 'F' for formatted, 'U' for
             unformatted

        ISMAX    I   1          0    [0:]        
           ! maximum multipole to be retained in expansion of
             long range potentials (note that if either ALPHA0 or ALPHA2
             is non-zero then ISMAX must be at least 3)

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

        LUAMP    I   1         22    [1:]
           ! logical unit holding boundary amplitude input

        LUBUT    I   1          0    [1:]
           ! logical unit holding Buttle correction input, if zero then
             no corrections are written to R-matrix dataset

        LUCHAN   I   1         10    [1:]        
           ! logical unit for output channel and target dataset

        LUCI     I   1         25    [1:]
           ! logical unit holding CI eigenvalues and eigenvectors

        LURMT    I   1         21    [1:]
           ! logical unit holding output R-matrix poles and amplitudes
             together with multipole expansion of asymptotic potentials,
             parameterized Buttle corrections and any CI vectors needed
             for a non-adiabatic treatment of nuclear motion

        LUTARG   I   1         24    [1:]
           ! logical unit holding input target data

        MGVN     I   1               [0:]
           ! total symmetry of system (0,1,2,3...) as in CONGEN

        NAME     C   60                          
           ! title for any output

        NASET    I   1          1    [0:]
           ! Boundary amplitude set number 

        NBSET    I   1          1    [0:]
           ! Buttle correction set number (not used in current version)
           
        NCHSET    I   1          1    [0:]        
           ! set number of channel dataset (if 0 then set is appended to
             the end of an existing file)

        NCISET    I   1          1    [0:]
           ! CI data set number
        NOLD     I    1          0    [0:]
           ! switch that allows to read:
             =0  new property files (those created after March 2003)
             =1  old property files (those created before March 2003)  

        NPOLE    I   1           0    [0:]        
           ! number of CI eigenvectors which are to be appended to the 
             R-matrix dataset

        NRMSET    I   1          1    [0:]
           ! set number of R-matrix dataset (if 0 then set is appended to
             the end of an existing file)

	NSTAT0   I   1    NSTAT in SCATCI [1:NSTAT]
   	   ! Number of states to be used in a partitioned R-matrix calculation.
           ! The default is usually best; NSTAT0 is included for testing purposes.
           ! Partitioned approach not yet implemented in the UKRmol+ suite.

        NTARG    I   1          1    [1:]
           ! number of target electronic states

        NTSET    I   1          1    [0:]
           ! Target data set number

        NVO      I   16         16*0
           ! number of virtual orbitals preceding continuum orbitals in
             CONGEN WFNGRP. Note that there is only one entry per target 
             state, in energy order.
             
        RGEOM    R   1           0.  [0.:]
           ! optional parameter which can be used in later modules to 
             identify the geometry of the molecule

        RMATR    R   1               [0.:]
           ! R-matrix radius for electronic problem

        STOT     I   1               [1:]        
           ! spin multiplicity of total system

        UKRMOLP_INTS L 1 (.true.)
        ! This switch applies to UKRmol+ calculations. It is not effective for
        ! calculations using the non-Abelian point groups. If set to .true.  it
        ! indicates that the  raw boundary amplitudes have been calculated
        ! using SCACTI_INTEGRALS.


*** Shifting energies ***
If target state energy shifts have already been applied in the inner region, 2 changes must occur in SWINTERF:
1. The "ESHIFT" array must be included. This is an array of state energy shifts (in Hartrees), ordered in the same order of states as the 'pre-shifted' fort.24.
2. The "IDTARG" array order may change. Whilst it still follows the same procedure as before (i.e. All instances of the first state in fort.24, then all instances of the next state, etc.), this procedure is now applied to the POST-shift ordering of states.

