RADDEN - Program for calculating radial charge densities of molecular orbitals/electronic states.

===========================================
PURPOSE OF THE PROGRAM AND OUTPUT PRODUCED:
The purpose of this program is to read in molecular orbitals from a Molden file or read in density matrices produced by the MPOUTRD program and then
calculate radial charge densities corresponding to these orbitals/density matrices. 
The program produces a text output on the screen and if a Molden file is being processed it also generates a file containing density matrices for the
processed orbitals.
If the density matrices are read from a file and correspond to the symmetry-adapted basis, then the integrals file (the default fort.2) produced by the swmol3 program is
needed on input.
===========================================
FORMAT OF THE DENSITY MATRIX FILE:
(a) ’SA-BF’ or 'CGTO', i.e. type of the basis set corresponding to the density matrix elements on this file.
(i5) Number of density matrices on this file.
(i5) Dimension ’dim’ of the density matrices.
(a) Name of the first density matrix.
(f) The lower triangle ( dim(dim+1)/2 elements) of the first density matrix - one number per line. The offdiagonal terms are assumed to be multipled by 2!
...
(a) Name of the last density matrix.
(f) The lower triangle of the last density matrix.
...
===========================================
USAGE OF THE PROGRAM:
The program is controlled by the following namelists. Not all namelists are
required at once, but the namelist INPUT must be always present. The other two
namelists are read in depending on the value of the variable 'whichdm'.

NAMELIST /INPUT/
     rstart        :0d0                Radial interval in a.u. for which the integration will be carried out
     rfinish       :20.0d0
     whichdm       :1                  1=Molden file will be processed by default - only the namelist MOLDENIN is required.
                                       2=Density matrix generated by the MPOUTRD program or by the R-matrix SWSCF program will be read in, 
                                         along with the basis set from the fort.2 unit - only the namelist RMATIN is required.
     req_dm        :-1                 If < 0 all available orbitals/density matrices will be read in and integrated; otherwise the number of 
                                         orbitals/density matrices to be read in from the density matrix file.
     ilist         :.false.            Do we want to read in only some oribtals/density matrices from the input? If .true. then orbitals from the 
                                         array 'dm_list' will be read in.
     dm_list       :1                  Sequence numbers of density matrices/orbitals to be read in from the input file. Not used if ilist .eq. .false.
     iprint        :.false.            Switches on some detailed printout and numerical checking of normalizations. Set it to true for debugging.
NAMELIST /MOLDENIN/
     dmunit        :450                Unit number for the density matrices
     molden_file   :                   Path to the Molden file
     dmfromf=.false.                   .false.: density matrices will be calulated from the Molden file and written out on the unit 'dmunit'.
                                       .true.:  density matrices will be read in from the unit 'dmunit'.

     header_base   :"Density matrix for orbital " Default header (string) of the density matrices which will be written out to the dmunit. Not used if
                                        density matrices read from a file.
NAMELIST /RMATIN/
     basunit       :2                  Unit for basis set information 
     dmunit        :450                Unit number for the density matrices (obtained either from the swscf program or from the mpoutrd program).
===========================================
LIMITATIONS:
1) The numerical integration of the radial charge densities is usually very slow for large basis sets (~100 functions). In that case it is advantageous 
   to run several instances of the program with each calculating charge densities for different orbitals (select the orbitals using the options: req_dm,ilist,dm_list). 
2) The integration does not always give the required precision 1E-9.
3) The program has not been designed and tested for the case in which fort.2 also contains the basis for the continuum.
===========================================
COMPILATION:
The program links against: precisn.f90 (from M. Plummer), modules.f90 and dqags.f (an adaptive integrator from the SLATEC library)
===========================================
EXAMPLES:
The test runs along with banchmark outputs are located in the directory: ukrmol-in/trunk/tests/radden
The two test cases correspond to the two different choices of the source density matrices. The benchmark output for the 'rmatin' test case is not complete but should be 
sufficient to test the code.
===========================================
Any comments, suggestions or bug reports are most welcome! Please send them at z.masin@open.ac.uk.
Zdenek Masin, 18/09/2011, 07/04/2014.
