======================================================
DOCUMENTATION FOR TYPICAL PSEUDO GENERATION INPUT FILE
======================================================

As a first stage, one usually runs the all-electron (ae) case
using an input file like this.  The resulting description of
the atom is saved in a data file for use by the second stage.
(see INPUT_GEN).

    1    0    0    0    3             ifae,ifpsp,ifprt,ifplw,ilogd (5i5)
   1.80     -2.4       1.6       40   rlogd,emin,emax,nnt (3f10.5,i5)
   1.0d-10   1.0d-09   0.4            thresh,tol,damp,maxit (2e10.1,f10.5,i5)
lead                                  title (a20)
  82.   0.0       -0.                 z,xion,exfact (f5.0,2f10.5)
 150.0       13.0       40.0          rmax,aasf,bbsf (3f10.5)
   15    2                            ncspvs,irel (2i5)
 100  2.     -9000.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 200  2.     -2000.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 210  6.     -2000.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 300  2.      -300.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 310  6.      -300.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 320 10.      -300.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 400  2.       -50.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 410  6.       -50.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 420 10.       -50.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 430 14.       -50.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 500  2.       -20.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 510  6.       -20.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 520 10.       -10.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 600  2.        -0.3                  nnlz,wwnl,ee (i4,f7.3,f14.6)
 610  2.        -0.3                  nnlz,wwnl,ee (i4,f7.3,f14.6)

The items on the right are the names and formats of the input
variables (they are not actually read by the program; we are just
in the habit of keeping them there as a reminder of what's what).
Thus, in this example, ifae=1, ifpsp=0, etc.

************************************************************************
    1    0    0    0    3             ifae,ifpsp,ifprt,ifplw,ilogd (5i5)
************************************************************************

ifae:    0  read all-electron (ae) data file
         1  do ae from scratch and write ae data file

ifpsp:   0  stop after ae part
         1  read pseudo data file and compare to ae
         2  generate pseudopotential and compare to ae

ifprt:  -3  no prints or graphs
        -2  prints but no graphs
        -1  more or less standard
         1  everything

ifplw:   if generate data file for wf plots
         0  no generation of wf plots
         1  generation of wf plots
         2  generation of data for input of second ref state
         3  print out pseudopotential with current wavefunctions	

ilogd:   num l values for which log derivs calc'd and output


************************************************************************
   1.80     -2.4       1.6       40   rlogd,emin,emax,nnt (3f10.5,i5)
************************************************************************

rlogd is radius at which log derivs are calc'd
energy mesh spans (emin,emax) with nnt intervals

************************************************************************
   1.0d-10   1.0d-09   0.4            thresh,tol,damp,maxit (2e10.1,f10.5,i5)
************************************************************************

thresh specifies the threshold for deciding convergence of energy
   eigenvalues when solving the radial schroedinger (etc) equation

tol,damp,maxit control self-consistent iteration process
   tol:   the tolerance used to decide when self-consistency is achieved
   damp:  damping parameter used in mixing
   maxit: maximum number of iterations allowed

defaults are used if input values are zero:
      if ( thresh .eq. 0.0d0 ) thresh = 1.0d-06
      if ( tol    .eq. 0.0d0 )    tol = 1.0d-05
      if ( damp   .eq. 0.0d0 )   damp = 5.0d-01
      if ( maxit  .eq. 0     )  maxit = 250

I recommend smaller values for thresh and tol than the defaults, as
in the example above.  --dv

************************************************************************
lead                                  title (a20)
************************************************************************

title: name of element

************************************************************************
  82.   0.0        0.                 z,xion,exfact (f5.0,2f10.5)
************************************************************************

z:      nuclear charge on atom
xion:   net charge on the atom (ie, it is really an ion, not an atom,
          if xion .ne. 0).
exfact: specify the type of exchange-correlation
        (CA means ceperley-alder in perdew-zunger parametrization)
           0  LDA: CA
          -1  LDA: wigner
          -2  LDA: hedin-lundquist
          -3  LDA: gunnarson-lundquist
           1  GGA: CA + Becke88 + LYP
           2  GGA: CA + Becke88
           3  GGA: CA + Becke88 + Perdew86
           4  GGA: PW(91)
           5  GGA: PBE(96)

NOTE: historically, exfact was the "alpha" value of the slater
      x-alpha method, which is why it is a real variable instead
      of an integer one; probably it can still be used this way
      (if exfact is greater than 0 and less than 1) but there is
      basically no use for this any more.

************************************************************************
 150.0       13.0       40.0          rmax,aasf,bbsf (3f10.5)
************************************************************************

specify the parameters needed to set up the radial mesh:

	r(i) = (1/z) * { exp(-aasf + [i-1]/bbsf) - exp(-aasf) }

where z is the atomic number.  This equation defines aasf and bbsf;
rmax is the maximum radius value of the mesh.

default values:
      if ( rmax .eq. 0.0d0 ) rmax = 80.0d0
      if ( aasf .eq. 0.0d0 ) aasf =  6.0d0
      if ( bbsf .eq. 0.0d0 ) bbsf = 40.0d0

************************************************************************
   15    2                            ncspvs,irel (2i5)
************************************************************************

ncspvs: total number of states (ie, number of nl pairs) for this atom
        ("Number of Core States Plus Valence States")

irel:   whether to use a relativistic wave equation for the ae case
  irel = 0 is for schroedinger non-relativistic wave equation
  irel = 1 is for dirac wave equation
  irel = 2 is for koelling-harmon scalar relativistic wave equation 

NOTE: I'M NOT REALLY SURE WHETHER IREL=1 WORKS; WE VIRTUALLY ALWAYS
      USE IREL=0 OR IREL=2.  I RECOMMENT USING IREL=2 FOR ALL CASES,
      EVEN FOR LIGHT ATOMS, SINCE THE PROGRAM SEEMS A LITTLE BIT MORE
      STABLE FOR IREL=2 THAN FOR IREL=0, AND THE EXTRA EXPENSE OF
      IREL=2 IS NEGLIGIBLE.

-----------------------------------------------------
THE PROGRAM NOW LOOPS OVER THE NCSPVS STATES, READING
ONE INPUT LINE OF THE FOLLOWING TYPE FOR EACH:
-----------------------------------------------------

************************************************************************
 100  2.     -9000.0                  nnlz,wwnl,ee (i4,f7.3,f14.6)
************************************************************************

nnlz: quantum numbers nlm (note we always specify m=0; it just looks
      nicer to specify nlm instead of just nl)

wwnl: weight, ie, number of electrons populating this shell

ee:   rough guess at energy eigenvalue; usually, try to guess it
      within about a factor of 2-3 one way or the other, but the program
      may tolerate even poorer guesses.  use results from a nearby
      atomic number as a guide; or, if you want to be more systematic,
      you can use values from the hermann-skillman tables.
