[Q-e-commits] r8100 - in trunk/espresso: . atomic atomic/Doc atomic/examples atomic/examples/all-electron atomic/examples/paw_examples atomic/examples/pseudo-LDA-0.5 atomic/examples/pseudo-gen atomic/examples/pseudo-test atomic/examples/vdw-in-tfvw atomic/pseudo_library/LDA/REL atomic/pseudo_library/LDA/SR atomic/pseudo_library/PBE/REL atomic/pseudo_library/PBE/SR atomic/src doc-def install

marsamos at democritos.it marsamos at democritos.it
Tue Aug 23 11:39:17 CEST 2011


Author: marsamos
Date: 2011-08-23 11:39:15 +0200 (Tue, 23 Aug 2011)
New Revision: 8100

Added:
   trunk/espresso/atomic/Doc/
   trunk/espresso/atomic/Doc/ChangeLog
   trunk/espresso/atomic/Doc/INPUT_LD1.def
   trunk/espresso/atomic/Doc/Makefile
   trunk/espresso/atomic/Doc/pseudo-gen-fig1.pdf
   trunk/espresso/atomic/Doc/pseudo-gen-fig2.pdf
   trunk/espresso/atomic/Doc/pseudo-gen-fig3.pdf
   trunk/espresso/atomic/Doc/pseudo-gen-fig4.pdf
   trunk/espresso/atomic/Doc/pseudo-gen.tex
   trunk/espresso/atomic/Makefile
   trunk/espresso/atomic/README
   trunk/espresso/atomic/examples/
   trunk/espresso/atomic/examples/all-electron/
   trunk/espresso/atomic/examples/make_clean
   trunk/espresso/atomic/examples/paw_examples/
   trunk/espresso/atomic/examples/pseudo-LDA-0.5/
   trunk/espresso/atomic/examples/pseudo-gen/
   trunk/espresso/atomic/examples/pseudo-test/
   trunk/espresso/atomic/examples/vdw-in-tfvw/
   trunk/espresso/atomic/pseudo_library/
   trunk/espresso/atomic/src/
   trunk/espresso/atomic/src/Makefile
   trunk/espresso/atomic/src/add_exchange.f90
   trunk/espresso/atomic/src/all_electron.f90
   trunk/espresso/atomic/src/ascheq.f90
   trunk/espresso/atomic/src/ascheqps.f90
   trunk/espresso/atomic/src/ascheqps_drv.f90
   trunk/espresso/atomic/src/atomic_paw.f90
   trunk/espresso/atomic/src/c6_dft.f90
   trunk/espresso/atomic/src/c6_tfvw.f90
   trunk/espresso/atomic/src/calculate_gipaw_orbitals.f90
   trunk/espresso/atomic/src/cfdsol.f90
   trunk/espresso/atomic/src/chargeps.f90
   trunk/espresso/atomic/src/compute_chi.f90
   trunk/espresso/atomic/src/compute_chi_tm.f90
   trunk/espresso/atomic/src/compute_phi.f90
   trunk/espresso/atomic/src/compute_phi_tm.f90
   trunk/espresso/atomic/src/compute_phius.f90
   trunk/espresso/atomic/src/compute_potps.f90
   trunk/espresso/atomic/src/compute_potps_new.f90
   trunk/espresso/atomic/src/compute_q_3bess.f90
   trunk/espresso/atomic/src/compute_relpert.f90
   trunk/espresso/atomic/src/compute_solution.f90
   trunk/espresso/atomic/src/descreening.f90
   trunk/espresso/atomic/src/dfx_new.f90
   trunk/espresso/atomic/src/dir_outward.f90
   trunk/espresso/atomic/src/dirsol.f90
   trunk/espresso/atomic/src/dmixp.f90
   trunk/espresso/atomic/src/drho0ofvx.f90
   trunk/espresso/atomic/src/drhoofv.f90
   trunk/espresso/atomic/src/dvex.f90
   trunk/espresso/atomic/src/el_config.f90
   trunk/espresso/atomic/src/elsd.f90
   trunk/espresso/atomic/src/elsd_highv.f90
   trunk/espresso/atomic/src/elsdps.f90
   trunk/espresso/atomic/src/elsdps_paw.f90
   trunk/espresso/atomic/src/esic.f90
   trunk/espresso/atomic/src/export_upf.f90
   trunk/espresso/atomic/src/find_qi.f90
   trunk/espresso/atomic/src/gener_pseudo.f90
   trunk/espresso/atomic/src/grad_log.f90
   trunk/espresso/atomic/src/green.f90
   trunk/espresso/atomic/src/import_upf.f90
   trunk/espresso/atomic/src/int_0_inf_dr.f90
   trunk/espresso/atomic/src/integrate_inward.f90
   trunk/espresso/atomic/src/integrate_outward.f90
   trunk/espresso/atomic/src/intref.f90
   trunk/espresso/atomic/src/inward.f90
   trunk/espresso/atomic/src/kin_e_density.f90
   trunk/espresso/atomic/src/ld1.f90
   trunk/espresso/atomic/src/ld1_readin.f90
   trunk/espresso/atomic/src/ld1_setup.f90
   trunk/espresso/atomic/src/ld1_writeout.f90
   trunk/espresso/atomic/src/ld1inc.f90
   trunk/espresso/atomic/src/lderiv.f90
   trunk/espresso/atomic/src/lderivps.f90
   trunk/espresso/atomic/src/lschps.f90
   trunk/espresso/atomic/src/make.depend
   trunk/espresso/atomic/src/new_potential.f90
   trunk/espresso/atomic/src/newd_at.f90
   trunk/espresso/atomic/src/nodenum.f90
   trunk/espresso/atomic/src/normalize.f90
   trunk/espresso/atomic/src/occ_spin.f90
   trunk/espresso/atomic/src/outward.f90
   trunk/espresso/atomic/src/parameters.f90
   trunk/espresso/atomic/src/partial_wave_expansion.f90
   trunk/espresso/atomic/src/paw_type.f90
   trunk/espresso/atomic/src/pseudo_q.f90
   trunk/espresso/atomic/src/pseudovloc.f90
   trunk/espresso/atomic/src/read_pseudo_ncpp.f90
   trunk/espresso/atomic/src/read_pseudo_rrkj3.f90
   trunk/espresso/atomic/src/run_lda_half.f90
   trunk/espresso/atomic/src/run_pseudo.f90
   trunk/espresso/atomic/src/run_test.f90
   trunk/espresso/atomic/src/scf.f90
   trunk/espresso/atomic/src/seriebes.f90
   trunk/espresso/atomic/src/set_psi_in.f90
   trunk/espresso/atomic/src/set_rc_rv.f90
   trunk/espresso/atomic/src/set_rho_core.f90
   trunk/espresso/atomic/src/set_sl3.f90
   trunk/espresso/atomic/src/sic_correction.f90
   trunk/espresso/atomic/src/start_potps.f90
   trunk/espresso/atomic/src/start_scheq.f90
   trunk/espresso/atomic/src/starting_potential.f90
   trunk/espresso/atomic/src/test_bessel.f90
   trunk/espresso/atomic/src/trou.f90
   trunk/espresso/atomic/src/v_of_rho_at.f90
   trunk/espresso/atomic/src/vdpack.f90
   trunk/espresso/atomic/src/vext.f90
   trunk/espresso/atomic/src/vpack.f90
   trunk/espresso/atomic/src/vxcgc.f90
   trunk/espresso/atomic/src/write_ae_pseudo.f90
   trunk/espresso/atomic/src/write_cpmd.f90
   trunk/espresso/atomic/src/write_files.f90
   trunk/espresso/atomic/src/write_paw_recon.f90
   trunk/espresso/atomic/src/write_pseudo.f90
   trunk/espresso/atomic/src/write_results.f90
   trunk/espresso/atomic/src/write_resultsps.f90
   trunk/espresso/atomic/src/write_upf.f90
Removed:
   trunk/espresso/atomic/Makefile
   trunk/espresso/atomic/add_exchange.f90
   trunk/espresso/atomic/all_electron.f90
   trunk/espresso/atomic/ascheq.f90
   trunk/espresso/atomic/ascheqps.f90
   trunk/espresso/atomic/ascheqps_drv.f90
   trunk/espresso/atomic/atomic_paw.f90
   trunk/espresso/atomic/c6_dft.f90
   trunk/espresso/atomic/c6_tfvw.f90
   trunk/espresso/atomic/calculate_gipaw_orbitals.f90
   trunk/espresso/atomic/cfdsol.f90
   trunk/espresso/atomic/chargeps.f90
   trunk/espresso/atomic/compute_chi.f90
   trunk/espresso/atomic/compute_chi_tm.f90
   trunk/espresso/atomic/compute_phi.f90
   trunk/espresso/atomic/compute_phi_tm.f90
   trunk/espresso/atomic/compute_phius.f90
   trunk/espresso/atomic/compute_potps.f90
   trunk/espresso/atomic/compute_potps_new.f90
   trunk/espresso/atomic/compute_q_3bess.f90
   trunk/espresso/atomic/compute_relpert.f90
   trunk/espresso/atomic/compute_solution.f90
   trunk/espresso/atomic/descreening.f90
   trunk/espresso/atomic/dfx_new.f90
   trunk/espresso/atomic/dir_outward.f90
   trunk/espresso/atomic/dirsol.f90
   trunk/espresso/atomic/dmixp.f90
   trunk/espresso/atomic/drho0ofvx.f90
   trunk/espresso/atomic/drhoofv.f90
   trunk/espresso/atomic/dvex.f90
   trunk/espresso/atomic/el_config.f90
   trunk/espresso/atomic/elsd.f90
   trunk/espresso/atomic/elsd_highv.f90
   trunk/espresso/atomic/elsdps.f90
   trunk/espresso/atomic/elsdps_paw.f90
   trunk/espresso/atomic/esic.f90
   trunk/espresso/atomic/export_upf.f90
   trunk/espresso/atomic/find_qi.f90
   trunk/espresso/atomic/gener_pseudo.f90
   trunk/espresso/atomic/grad_log.f90
   trunk/espresso/atomic/green.f90
   trunk/espresso/atomic/import_upf.f90
   trunk/espresso/atomic/int_0_inf_dr.f90
   trunk/espresso/atomic/integrate_inward.f90
   trunk/espresso/atomic/integrate_outward.f90
   trunk/espresso/atomic/intref.f90
   trunk/espresso/atomic/inward.f90
   trunk/espresso/atomic/kin_e_density.f90
   trunk/espresso/atomic/ld1.f90
   trunk/espresso/atomic/ld1_readin.f90
   trunk/espresso/atomic/ld1_setup.f90
   trunk/espresso/atomic/ld1_writeout.f90
   trunk/espresso/atomic/ld1inc.f90
   trunk/espresso/atomic/lderiv.f90
   trunk/espresso/atomic/lderivps.f90
   trunk/espresso/atomic/lschps.f90
   trunk/espresso/atomic/make.depend
   trunk/espresso/atomic/new_potential.f90
   trunk/espresso/atomic/newd_at.f90
   trunk/espresso/atomic/nodenum.f90
   trunk/espresso/atomic/normalize.f90
   trunk/espresso/atomic/occ_spin.f90
   trunk/espresso/atomic/outward.f90
   trunk/espresso/atomic/parameters.f90
   trunk/espresso/atomic/partial_wave_expansion.f90
   trunk/espresso/atomic/paw_type.f90
   trunk/espresso/atomic/pseudo_q.f90
   trunk/espresso/atomic/pseudovloc.f90
   trunk/espresso/atomic/read_pseudo_ncpp.f90
   trunk/espresso/atomic/read_pseudo_rrkj3.f90
   trunk/espresso/atomic/run_lda_half.f90
   trunk/espresso/atomic/run_pseudo.f90
   trunk/espresso/atomic/run_test.f90
   trunk/espresso/atomic/scf.f90
   trunk/espresso/atomic/seriebes.f90
   trunk/espresso/atomic/set_psi_in.f90
   trunk/espresso/atomic/set_rc_rv.f90
   trunk/espresso/atomic/set_rho_core.f90
   trunk/espresso/atomic/set_sl3.f90
   trunk/espresso/atomic/sic_correction.f90
   trunk/espresso/atomic/start_potps.f90
   trunk/espresso/atomic/start_scheq.f90
   trunk/espresso/atomic/starting_potential.f90
   trunk/espresso/atomic/test_bessel.f90
   trunk/espresso/atomic/trou.f90
   trunk/espresso/atomic/v_of_rho_at.f90
   trunk/espresso/atomic/vdpack.f90
   trunk/espresso/atomic/vext.f90
   trunk/espresso/atomic/vpack.f90
   trunk/espresso/atomic/vxcgc.f90
   trunk/espresso/atomic/write_ae_pseudo.f90
   trunk/espresso/atomic/write_cpmd.f90
   trunk/espresso/atomic/write_files.f90
   trunk/espresso/atomic/write_paw_recon.f90
   trunk/espresso/atomic/write_pseudo.f90
   trunk/espresso/atomic/write_results.f90
   trunk/espresso/atomic/write_resultsps.f90
   trunk/espresso/atomic/write_upf.f90
   trunk/espresso/atomic_doc/
   trunk/espresso/doc-def/INPUT_LD1.def
Modified:
   trunk/espresso/atomic/examples/all-electron/test.job
   trunk/espresso/atomic/examples/paw_examples/clean
   trunk/espresso/atomic/examples/paw_examples/test
   trunk/espresso/atomic/examples/pseudo-LDA-0.5/Si.pz-vbc.UPF
   trunk/espresso/atomic/examples/pseudo-LDA-0.5/clean.sh
   trunk/espresso/atomic/examples/pseudo-LDA-0.5/test.job
   trunk/espresso/atomic/examples/pseudo-gen/test.job
   trunk/espresso/atomic/examples/pseudo-test/clean.sh
   trunk/espresso/atomic/examples/pseudo-test/test.job
   trunk/espresso/atomic/examples/vdw-in-tfvw/test.job
   trunk/espresso/atomic/pseudo_library/LDA/REL/make_ps
   trunk/espresso/atomic/pseudo_library/LDA/SR/make_ps
   trunk/espresso/atomic/pseudo_library/PBE/REL/make_ps
   trunk/espresso/atomic/pseudo_library/PBE/SR/make_ps
   trunk/espresso/doc-def/Makefile
   trunk/espresso/install/makedeps.sh
Log:
atomic re-structured. Some fix on atomic/Doc Makefiles


Copied: trunk/espresso/atomic/Doc/ChangeLog (from rev 8077, trunk/espresso/atomic_doc/ChangeLog)
===================================================================
--- trunk/espresso/atomic/Doc/ChangeLog	                        (rev 0)
+++ trunk/espresso/atomic/Doc/ChangeLog	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,62 @@
+---------------------------------------------------------------------------
+      Please use the "cvs2cl.pl" script in the root directory
+       of the distribution to produce a detailed ChangeLog
+---------------------------------------------------------------------------
+
+08/02/2005  Added the generation of PAW datasets. Experimental. (GF)
+
+01/11/2004  p wavefunctions added to the Pt pseudopotential. (ACC)
+
+29/10/2004  clean-up. Some routines are in flib. (ADC)
+
+26/10/2004  Bug fix: the length of dft in readpseudo was 50. Problem 
+            introduced by merging ld1 with PWscf.  (ADC)
+
+25/10/2004  Added few additional checks for pseudopotential generation. (ADC)
+
+13/07/2004  Various cleanup, documentation (PG)
+
+09/07/2004  Troullier-Martins sort of working, more cleaning (PG)
+            Pt pseudopotential updated (ADC)
+
+06/07/2004  indentation, spelling,Troullier-Martins implementation added
+            (incomplete and untested), examples updated (PG)
+
+19/06/2004  Update of the output files. Added the possibility to write on file
+            the beta functions (file_beta), the qvan functions (file_qvan),
+            the chi functions (file_chi). (ADC)
+
+20/05/2004  Tests, examples, documentation added in directory atomic_doc
+
+19/05/2004  Atomic number can be replaced by atom name in input, as in
+            the other version of the code (PG)
+
+14/05/2004  Atomic code added to the main CVS tree in directory atomic/
+            Installation follows the same logic of all other codes.
+            Routines: sph_bes erf random bachel funct which_dft capital 
+            matches functionals lsda_functionals, merged with or replaced
+            by corresponding routines in flib/, Modules/, PW/  (PG)
+
+----------------------------------------------------------------------
+13/04/2004  Write_upf now write the correct core charge. Small bug fix
+            and other small improvements. Added an example for the generation
+            of a spin-orbit US pseudopotential. (ADC)
+
+05/04/2004  Bug fix. s local potential was not calculated correctly in
+            relativistic case. (ADC)
+
+01/04/2004  A US spin-orbit splitted pseudopotential reproduces the
+            all-electron eigenvalues  (ADC)
+
+26/03/2004  Relativistic exchange introduced among the functionals (AMC)
+
+07/03/2004  Initial work for rationalize the output files (ADC)
+
+27/02/2004  Extra flag file_recon in test namelist to produce the appropriate
+            file for paw reconstruction (MP)
+
+25/02/2004  Small changes to makefile. Now the code compiles on sp4, pc_pgi
+            and pc_ifc. (ADC)
+
+24/02/2004  Initial release. (ADC)
+            Simplified installation. Now test.job does not require the path.

Copied: trunk/espresso/atomic/Doc/INPUT_LD1.def (from rev 8099, trunk/espresso/doc-def/INPUT_LD1.def)
===================================================================
--- trunk/espresso/atomic/Doc/INPUT_LD1.def	                        (rev 0)
+++ trunk/espresso/atomic/Doc/INPUT_LD1.def	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,974 @@
+input_description -distribution {Quantum Espresso} -program ld1.x {
+
+    toc {}
+
+    intro {
+	Input data cards for ld1.x program:
+
+	Always present:
+	  1   namelist &input
+	  1.1 optional cards for all-electron calculations
+
+	Needed for PP generation:
+	  2   namelist &inputp
+	  2.1 additional cards for PP generation
+
+	Needed for pseudo-potential (PP) test. optional for PP generation:
+	  3   namelist &test
+	  3.1 optional cards for PP test	  
+    }
+
+    namelist INPUT {
+
+	label { This namelist is always needed ! }
+
+	var title  -type CHARACTER {
+	    info { A string describing the job. }
+	    status { OPTIONAL }
+	}
+
+	group {
+	    label { Either: }
+
+	    var zed  -type REAL {
+		see { atom }
+		info { 
+		    The nuclear charge (1 < zed < 100). 
+		    
+		    IMPORTANT:
+		    Specify either zed OR atom, not both!
+		}
+	    }
+
+	    label { Or: }
+
+	    var atom  -type CHARACTER { 
+		see { zed }
+		info {
+		    Atomic symbol: atom='H', 'He', 'Be', etc.
+		    
+		    IMPORTANT:
+		    Specify either atom OR zed, not both!
+		}
+	    }
+	}
+
+	group {
+	    label { Radial grid parameters: }
+	    
+	    var xmin  -type REAL { 
+		see { dx }
+		default {
+		    -7.0 if iswitch>1 or rel=0,
+		    -8.0 otherwise
+		}
+		info { Radial grid parameter. }
+	    }
+	    
+	    var dx -type REAL {
+		info { 
+		    Radial grid parameter.
+		    
+		    The radial grid is: r(i+1) = exp(xmin+i*dx)/zed  a.u.
+		}
+		default { 
+		    0.0125 if iswitch>1,
+		    0.008 otherwise
+		}
+	    }
+
+	    var rmax -type REAL { 
+		info { Outermost grid point. }
+		default { 100.0 a.u. }
+	    }
+	}
+
+	var beta  -type REAL { 
+	    info { parameter for potential mixing }
+	    default { 0.2 }
+	}
+	var tr2  -type REAL {
+	    info { convergence threshold for scf }
+	    default { 1e-14 }
+	}
+	
+	var iswitch  -type INTEGER {
+	    info { 
+		1    all-electron calculation
+                2    PP test calculation
+                3    PP generation
+                4    LDA-1/2 correction, needs a previously generated PP file 
+	    } 
+	    default { 1 }
+	}
+
+	group {
+	    label { Parameters for logarithmic derivatives: }
+
+	    var nld  -type INTEGER {
+		info { the number of logarithmic derivatives to be calculated }
+	    }
+	    
+	    var rlderiv -type REAL { 
+		info { radius (a.u.) at which logarithmic derivatives are calculated }
+	    }
+	    
+	    vargroup -type REAL {
+		var eminld
+		var emaxld 
+		info { 
+		    Energy range (min, max energy, in Ry) at which
+		    logarithmic derivatives are calculated.
+		}
+	    }
+	    
+	    var deld  -type REAL {  
+		info { 
+		    Delta e (Ry) of energy for logarithmic derivatives.
+		}
+	    }
+
+	    var rpwe -type REAL { 
+		info { radius (a.u.) at which partial wave expansions are calculated }
+		default { rlderiv }
+	    }
+
+	    message {
+		If the above parameters are not specified, logarithmic
+		derivatives and partial wave expansions are not calculated.
+	    }
+	}
+
+	var rel  -type INTEGER {
+	    info {  
+		0 ... non relativistic calculation     
+		1 ... scalar relativistic calculation  
+		2 ... full relativistic calculation with spin-orbit
+	    }
+	    default {
+		0 for Z <= 18;
+		1 for Z >  18
+	    }
+	}
+
+	var lsmall  -type LOGICAL {
+	    default { .false. }
+	    info {
+		if .true. writes on files the small component
+	    }
+	}
+
+	var max_out_wfc  -type INTEGER  {
+	    default { 7 }
+	    info {
+		Maximum number of atomic wavefunctions written in the output
+                file.
+	    }
+	}
+
+	var noscf  -type LOGICAL {
+	    default { .false. }
+	    info {
+		if .true. the charge is not computed. The occupations are
+                not used and the eigenvalues and eigenfunctions are those 
+                of a hydrogen-like atom.
+	    }
+	}
+
+	var lsd  -type INTEGER { 
+	    info { 
+		0 ... non spin polarized calculation
+		1 ... spin-polarized calculation   
+
+		BEWARE:
+		not allowed if iswitch=3 (PP generation) or with full
+		relativistic calculation
+	    }
+	    default { 0 }
+	}
+	
+	var dft  -type CHARACTER {
+	    info { 
+		Exchange-correlation functional. 
+
+		Examples:
+		'PZ'    Perdew and Zunger formula for LDA
+		'PW91'  Perdew and Wang GGA
+		'BP'    Becke and Perdew GGA
+		'PBE'   Perdew, Becke and Ernzerhof GGA
+		'BLYP'  ...
+
+		For the complete list, see module "functionals" in ../flib/
+		The default is 'PZ' for all-electron calculations,
+		it is read from the PP file in a PP calculation.
+	    }
+
+	}
+	var latt -type INTEGER { 
+	    info { 
+		0 ... no Latter correction 
+		1 ... apply Latter correction 
+	    }
+	    default { 0 }		
+	}
+	
+	var isic -type INTEGER {
+	    info { 
+		0 ... no Self-interaction correction
+		1 ... apply Self-interaction correction
+	    }
+	    default { 0 }
+	    status {
+		only for all-electron calculation
+	    }
+	}
+	
+	var rytoev_fact  -type REAL {
+	    default { as specified in file Modules/constants.f90 }
+	    info {
+		Factor used to convert Ry into eV. 
+	    }
+	}
+
+	var cau_fact  -type REAL {
+	    default { as specified in file Modules/constants.f90 }
+	    info {
+		Speed of light in a.u..
+ 
+		(Be careful the default value is always used in the 
+                 relativistic exchange.)
+	    }
+	}
+
+
+	var vdw  -type LOGICAL {
+	    default { .false. } 
+	    info { 
+		If .true., the frequency dependent polarizability and van der
+		Waals coefficient C6 will be computed in Thomas-Fermi and 
+		von Weizsaecker approximation(only for closed-shell ions).
+	    }
+	    status {
+		Gradient-corrected DFT not yet implemented. 
+	    }
+	}
+
+
+	var prefix  -type CHARACTER {
+	    default { 'ld1' }
+	    info {
+		Prefix for file names - only for output file names
+		containing the orbitals, logarithmic derivatives, tests
+		See below for file names and the content of the file.
+	    }
+	}
+
+	var verbosity  -type CHARACTER {
+	    default { 'low' }
+	    info {
+		'low' or 'high'
+
+		if 'high' with iswitch=2,3 prints separately core and
+		valence contributions to the energies. Print the
+		frozen-core energy.
+	    }
+	}
+
+	var file_charge  -type CHARACTER {
+	    default { ' ' }
+	    info {
+	        Name of the file where the code writes the all-electron 
+		total charge. No charge is written if file_charge=' '.
+	    }
+	}
+
+	var config  -type CHARACTER {
+	    default { ' ' }
+	    info { 
+		A string with the electronic configuration. 
+
+		Example:
+                  '[Ar] 3d10 4s2 4p2.5'              
+               
+		* If lsd=1, spin-up and spin-down state may appear twice
+		  with the respective occupancy: 3p4 3p2 = 4 up, 
+		  2 down. Otherwise, the Hund's rule is assumed.
+               
+		* If rel=2, states with jj=l-1/2 are filled first.		
+		  If a state appears twice, the first one has jj=l-1/2, 
+		  the second one jj=l+1/2 (except S states)                 
+		  (Use rel_dist if you want to average the electrons
+		  over all available states.)
+
+		Negative occupancies are used to flag unbound states;
+		they are not actually used.
+	    }
+	}
+	
+	var rel_dist  -type CHARACTER {
+	    default { 'energy' }
+	    info {
+		'energy' or 'average'
+
+		* if 'energy' the relativistic l-1/2 states are filled first.
+
+		* if 'average' the electrons are uniformly distributed 
+		  among all the states with the given l.  
+	    }
+	}
+	
+	var write_coulomb  -type LOGICAL {
+	    default { .false. }
+	    info {
+		If .true., a fake pseudo-potential file with name X.UPF,
+		where X is the atomic symbol, is written. It contains
+		the radial grid and the wavefunctions as specified in input,
+		plus the info needed to build the Coulomb potential
+		for an all-electron calculation - for testing only.
+	    }
+	}
+    }
+
+    card AllElectronCards -nameless 1 {
+	label {
+	    If config is empty the electronic configuration is read from
+	    the following cards:
+	}
+
+	choose {
+	    when -test "rel < 2" {
+		syntax {
+		    line {
+			var nwf -type INTEGER {
+			    info {
+				number of wavefunctions
+			    }
+			}
+		    }	    
+		    table AE_wfs {
+			rows -start 1 -end nwf {
+			    col nl -type CHARACTER {
+				info { wavefunction label (e.g. 1s, 2s, etc.) }
+			    }
+			    col n -type INTEGER { info { principal quantum number } }
+			    col l -type INTEGER { info { angular quantum number } }
+			    col oc -type REAL { info { occupation number } }
+			    col isw -type INTEGER { 
+				info { the spin index (1-2) used only in the lsda case } 
+			    }
+			}
+		    }
+		}
+	    }
+	    elsewhen -test "rel = 2" {
+		syntax {
+		    line {
+			var nwf
+		    }	    
+		    table AE_wfs {
+			rows -start 1 -end nwf {
+			    col nl
+			    col n
+			    col l
+			    col oc
+			    col jj -type REAL { 
+				info { 
+				    The total angular momentum (0.0 is allowed for complete 
+				    shells: the codes fills 2l states with jj=l-1/2, 
+                                    2l+2 with jj=l+1/2).
+				}
+			    }
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+    namelist INPUTP {
+	var zval  -type REAL {
+	    default { (calculated) }
+	    info { 
+		Valence charge.                                  
+
+		zval is automatically calculated from available data.
+		If the value of zval is provided in input, it will be
+		checked versus the calculated value. The only case in
+		which you need to explicitly provide the value of zval
+		for noninteger zval (i.e. half core-hole pseudo-potentials).
+	    }
+	}
+	
+	var pseudotype  -type INTEGER {
+	    info {
+		1 ... norm-conserving, single-projector PP (old format)
+                      IMPORTANT: if pseudotype=1 all calculations are done using
+                      the SEMILOCAL form, not the separable nonlocal form
+		
+		2 ... norm-conserving, multiple-projector PP in separable form
+
+		3 ... ultrasoft PP
+	    }
+	}
+
+	var upf_v1_format -type LOGICAL {
+            default { .false. }
+	    info {
+		.true. generates pseudo-potential file in UPF version 1 format,
+                       compatible with QE version 3
+	    }
+	}
+
+	var file_pseudopw -type CHARACTER {
+	    status { REQUIRED }
+	    info { 
+		File where the generated PP is written.
+		
+		* if the file name ends with "upf" or "UPF",
+		or in any case for spin-orbit PP (rel=2),
+		the file is written in UPF format;
+
+		* if the file name ends with 'psp' it is
+		written in native CPMD format (this is currently
+		an experimental feature); otherwise it is written
+		in the old "NC" format if pseudotype=1, or
+		in the old RRKJ format if pseudotype=2 or 3
+		(no default, must be specified).
+	    }
+	}
+
+	var file_recon  -type CHARACTER { 
+	    info {  
+		File containing data needed for GIPAW reconstruction 
+		of all-electron wavefunctions from PP results.
+		If you want to use additional states to perform the
+		reconstruction, add them at the end of the list
+		of all-electron states.
+	    } 
+	    default { ' ' }
+	}
+
+	var lloc  -type INTEGER { 
+	    default { -1 }
+	    info { 
+		Angular momentum of the local channel.
+
+		* lloc=-1 or lloc=-2 pseudizes the all-electron potential
+                  if lloc=-2 the original recipe of Troullier-Martins
+		  is used (izero first and second derivatives at r=0)
+		* lloc>-1 uses the corresponding channel as local PP
+
+		NB: if lloc>-1, the corresponding channel must be the last in the
+		list of wavefunctions appearing after the namelist &inputp
+		In the relativistic case, if lloc > 0 both the j=lloc-1/2 and
+		the j=lloc+1/2 wavefunctions must be at the end of the list.
+	    }
+	}
+
+	var rcloc  -type REAL { 
+	    status {
+		Must be specified only if lloc=-1, otherwise the
+		corresponding value of rcut is used. 
+	    }
+	    info { 
+		Matching radius (a.u.) for local pseudo-potential (no default).
+	    }
+	}
+
+	var nlcc  -type LOGICAL { 
+	    default { .false. }
+	    info {
+		If .true. produce a PP with the nonlinear core
+		correction of Froyen, Cohen, and Louie.
+	    }
+	}
+
+	var new_core_ps  -type LOGICAL {
+	    default { .false. }
+	    status { requires nlcc=.true. }
+	    info {
+		If .true. pseudizes the core charge with bessel functions. 
+	    }
+	}
+		
+	var rcore -type REAL {
+	    info { 
+		Matching radius (a.u.) for the smoothing of the core charge.
+		If not specified, the matching radius is determined 
+		by the condition:  rho_core(rcore) = 2*rho_valence(rcore)
+	    }
+	}
+	
+	var tm  -type LOGICAL {
+	    default {  .false. }
+	    info { 
+		* .true. for Troullier-Martins pseudization [PRB 43, 1993 (1991)]
+
+		* .false. for Rabe-Rappe-Kaxiras-Joannopoulos pseudization 
+		  [PRB 41, 1227 (1990), erratum PRB 44, 13175 (1991)]
+	    }
+	}
+
+	var rho0  -type REAL { 
+	    info { 
+		Charge at the origin: when the Rabe-Rappe-Kaxiras-Joannopoulos
+		method with 3 Bessel functions fails, specifying rho0 > 0
+		may allow to override the problem (using 4 Bessel functions).
+		Typical values are in the order of 0.01-0.02
+	    }
+	    default { 0.0 }
+	}
+
+	var lpaw  -type LOGICAL { 
+	    info {
+		If .true. produce a PAW dataset, experimental feature
+		only for pseudotype=3
+	    }
+	    default { .false. }
+	}
+
+	group {
+	    var which_augfun  -type CHARACTER { 
+		default { 
+		    'AE' for Vanderbilt-Ultrasoft pseudo-potentials and 'BESSEL' for PAW datasets.
+		}
+		info {                 
+		    If different from 'AE' the augmentation functions are pseudized
+		    before rmatch_augfun. The pseudization options are:
+		    
+		    * 'PSQ'        Use Bessel functions to pseudize Q 
+                                   from the origin to rmatch_augfun.
+		    
+		    These features are available only for PAW: 
+		    
+		    * 'BESSEL'     Use Bessel functions to pseudize the Q.
+		    * 'GAUSS'      Use 2 Gaussian functions to pseudize the Q.
+		    * 'BG'         Use original Bloechl's recipy with a single gaussian.
+
+		    Note: if lpaw is true and which_augfun is set to AE real all-
+		    electron charge will be used, which will produce extremely
+		    hard augmentation.
+		}
+	    }
+	    
+	    var rmatch_augfun  -type REAL {
+		default { 0.5 a.u. }
+		status { Used only if which_augfun is different from 'AE'. }		
+		info {
+		    Pseudization radius for the augmentation functions. Presently
+		    it has the same value for all L.    
+		}
+	    }
+	    var rmatch_augfun_nc  -type REAL {
+		default { .false. }
+		status { Used only if which_augfun is 'PSQ'. }		
+		info {
+                  If .true. the augmetation functions are pseudized
+                  from the origin to min(rcut(ns),rcut(ns1)) where ns 
+                  and ns1 are the two channels for that Q. In this case
+                  rmatch_augfun is not used.
+		}
+	    }
+	}
+
+	var lsave_wfc -type LOGICAL {
+	    default { .false. if .not. lpaw, otherwise .true. }
+	    info {
+		Set it to .true. to save all-electron and pseudo wavefunctions
+		used in the pseudo-potential generation in the UPF file. Only
+		works for UPFv2 format.
+	    }
+	}
+
+	var lgipaw_reconstruction -type LOGICAL {
+	    default { .false. }
+	    info {
+		Set it to .true. to generate pseudo-potentials containing the
+                additional info required for reconstruction of all-electron 
+                orbitals, used by GIPAW. You will typically need to specify 
+		additional projectors beyond those used in the generation of 
+		pseudo-potentials. You should also specify 'file_recon'.
+
+		All projectors used in the reconstruction must be listed BOTH 
+		in the test configuration after namelist &test AND in the 
+		all-electron configuration (variable 'config', namelist &inputp,
+		Use negative occupancies for projectors on unbound states). The 
+		core radii in the test configuration should be the same as in
+		the pseudo-potential generation section and will be used as the
+		radius of reconstruction. Projectors not used to generate the 
+		pseudo-potential should have zero occupation number.
+	    }
+	}
+
+	var author  -type CHARACTER {
+	    info { Name of the author. }
+            default { 'anonymous' }
+	}
+
+	var file_chi  -type CHARACTER {   
+	    info {   file containing output PP chi functions }
+	    default { ' ' }
+	}
+	var file_beta  -type CHARACTER {  
+	    info {   file containing output PP beta functions }
+	    default { ' ' }
+	}
+	var file_qvan  -type CHARACTER {  
+	    info {   file containing output PP qvan functions }
+	    default { ' ' }
+	}
+
+	var file_screen    -type CHARACTER { 
+	    info {   file containing output screening potential }
+	    default { ' ' }
+	}
+
+	var file_core      -type CHARACTER { 
+	    info {   file containing output total and core charge }
+	    default { ' ' }
+	}
+
+	var file_wfcaegen  -type CHARACTER { 
+	    info { file with the all-electron wfc for generation } 
+	    default { ' ' }
+	}
+	var file_wfcncgen  -type CHARACTER { 
+	    info { file with the norm-conserving wfc for generation } 
+	    default { ' ' }
+	}
+	var file_wfcusgen  -type CHARACTER { 
+	    info { file with the ultra-soft wfc for generation }
+	    default { ' ' }
+	}
+    }
+
+    card PseudoPotentialGenerationCards -nameless 1 {
+	choose {
+	    when -test "rel=0  OR  rel=2" {
+		syntax {
+		    line {
+			var nwfs -type INTEGER {
+			    info { number of wavefunctions to be pseudized }
+			}
+		    }
+		    table PP_wfs {
+			rows -start 1 -end nwfs {
+			    col nls -type CHARACTER { 
+				info { 
+				    Wavefunction label (same as in the all-electron configuration). 
+				} 
+			    }
+			    col nns -type INTEGER { 
+				info { 
+				    Principal quantum number (referred to the PSEUDOPOTENTIAL case;
+				    nns=1 for lowest s, nns=2 for lowest p, and so on).
+				}
+			    }
+			    col lls -type INTEGER { info { Angular momentum quantum number. } }
+			    col ocs -type REAL { info { Occupation number  (same as in the all-electron configuration). } }
+			    col ener -type REAL {
+				info {
+				    Energy (Ry) used to pseudize the corresponding state.
+				    If 0.d0, use the one-electron energy of the all-electron state.
+				    Do not use 0.d0 for unbound states!
+				}
+			    }
+			    col rcut -type REAL { info { Matching radius (a.u.) for norm conserving PP. } }
+			    col rcutus -type REAL { 
+				info { Matching radius (a.u.) for ultrasoft PP - only for pseudotype=3. } 
+			    } 
+			    col jjs -type REAL { info { The total angular momentum (0.0 is allowed for complete shells). } }
+			}
+		    }
+		}
+		message {
+		    * if lloc>-1 the state with lls=lloc must be the last
+		    
+		    * if lloc>0 in the relativistic case, both states with jjs=lloc-1/2
+		      and jjs=lloc+1/2 must be the last two
+		}
+	    }	
+	    otherwise {
+		syntax {
+		    line {
+			var nwfs 
+		    }
+		    table PP_wfs {
+			rows -start 1 -end nwfs {
+			    col nls
+			    col nns
+			    col lls
+			    col ocs
+			    col ener
+			    col rcut
+			    col rcutus
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+    namelist TEST {
+	label { needed only if iswitch=2 or iswitch=4, optional if iswitch=3 }
+
+	var nconf  -type INTEGER { 
+	    info {   the number of configurations to be tested. For iswitch = 4 nconf=2 }
+	    default { 1 }
+	}
+	
+	var file_pseudo  -type CHARACTER { 
+	    status { ignored if iswitch=3 }
+	    info { 
+		File containing the PP.
+
+		* If the file name contains  ".upf" or ".UPF",
+		the file is assumed to be in UPF format; 
+
+		* else if the file name contains ".rrkj3" or ".RRKJ3",
+		the old RRKJ format is first tried;
+
+		* otherwise, the old NC format is read.
+		
+		IMPORTANT: in the latter case, all calculations are done
+		using the SEMILOCAL form, not the separable nonlocal form.
+		Use the UPF format if you want to test the separable form!
+	    }
+	    default { ' ' }
+	}       
+         
+	vargroup -type REAL {
+	    var ecutmin
+	    var ecutmax
+	    var decut
+	    info {
+		Parameters (Ry) used for test with a basis set of spherical		    
+		Bessel functions j_l(qr) . The hamiltonian at fixed scf
+		potential is diagonalized for various values of ecut:
+		ecutmin, ecutmin+decut, ecutmin+2*decut ... up to ecutmax.
+		This yields an indication of convergence with the
+		corresponding plane-wave cutoff in solids, and shows 
+		in an unambiguous way if there are "ghost" states
+	    }
+	    default { 
+		decut=5.0 Ry; ecutmin=ecutmax=0Ry
+	    }
+	    status { specify ecutmin and ecutmax if you want to perform this test }	    	    
+	}
+
+	var rm  -type REAL {
+	    info { Radius of the box used with spherical Bessel functions. }
+	    default { 30 a.u. }
+	}
+
+	dimension configts -start 1 -end nconf -type CHARACTER {
+	    info {
+		A string containing the test valence electronic
+		configuration nc, nc=1,nconf. Same syntax as for "config".
+		If configts(i) is not set, the electron configuration 
+		is read from the cards following the namelist.
+	    }
+	}
+	
+	dimension lsdts -start 1 -end nconf -type INTEGER {
+	    default { 1 }
+	    see { lsd }
+	    info {
+		0 or 1. It is the value of lsd used in the i-th test.
+		Allows to make simultaneously spin-polarized and 
+		spin-unpolarized tests. 
+	    }
+	}
+ 
+	var frozen_core  -type LOGICAL {
+	    default { .false. }
+	    info {
+		If .true. only the core wavefunctions of the first 
+		configuration are calculated. The eigenvalues, orbitals
+		and energies of the other configurations are calculated
+		with the core of the first configuration.
+		The first configuration must be spin-unpolarized.
+	    }
+	}
+
+	var rcutv  -type REAL {
+	    info {   Cutoff distance (CUT) for the inclusion of LDA-1/2 potential. 
+                     Needed (mandatory) only if iswitch = 4 }
+	    default { -1.0 }
+	}
+
+    }
+    
+    card PseudoPotentialTestCards -nameless 1 {
+	label { IMPORTANT: this card has to be specified for each missing configts(i) }
+
+	choose {
+	    when -test "lsd=1" {
+		syntax {
+		    line {
+			var nwfts -type INTEGER { info { number of wavefunctions } }
+		    }
+		    table test_wfs {
+			rows -start 1 -end nwfts {
+			    col elts -type CRATACTER { see { nls } }
+			    col nnts -type INTEGER { see { nns } }
+			    col llts -type INTEGER { see { lls } }
+			    col octs -type REAL    { see { ocs } }
+			    col enerts -type REAL  { status { not used } }
+			    col rcutts -type REAL  { status { not used } }
+			    col rcutusts -type REAL { status { not used } }
+			    col iswts -type INTEGER { info { spin index (1 or 2, used in lsda case) } }
+			}
+		    }
+		}
+	    }
+	    elsewhen -test "rel=2" {
+		syntax {
+		    line { var nwfts }
+		    table test_wfs {
+			rows -start 1 -end nwfts {
+			    col elts
+			    col nnts
+			    col llts
+			    col octs
+			    col enerts
+			    col rcutts
+			    col rcutusts
+			    col jjts -type REAL { info {  total angular momentum of the state } }
+			}
+		    }
+		}
+	    }
+	    otherwise {
+		syntax {
+		    line { var nwfts }
+		    table test_wfs {
+			rows -start 1 -end nwfts {
+			    col elts
+			    col nnts
+			    col llts
+			    col octs
+			    col enerts
+			    col rcutts
+			    col rcutusts
+			}
+		    }
+		}
+	    }
+	}	
+    }
+
+    section -title {Notes} {
+	
+	text {
+	    For PP generation you do not need to specify namelist &test, UNLESS:
+	    
+	    1. you want to use a different configuration for unscreening wrt the
+	    one used to generate the PP. This is useful for PP with semicore
+	    states: use semicore states ONLY to produce the PP, use semicore 
+	    AND valence states (if occupied) to make the unscreening
+	    
+	    2. you want to specify some more states for PAW style reconstruction of 
+	    all-electron orbitals from pseudo-orbitals
+	}
+
+	subsection -title {Output files written} {
+
+	    text {
+		* file_tests            "prefix".test    results of transferability test
+
+		for each testing configuration N:
+
+		* file_wavefunctions    "prefix"N.wfc     all-electron KS orbitals
+		* file_wavefunctionsps  "prefix"Nps.wfc   pseudo KS orbitals
+		
+		if lsd=1:
+
+		* file_wavefunctions    "prefix"N.wfc.up  all-electron KS up orbitals
+		* file_wavefunctions    "prefix"N.wfc.dw  all-electron KS down orbitals
+
+		if rel=2 and lsmall=.true.:
+
+		* file_wavefunctions    "prefix".wfc.small  all-electron KS small component
+
+		if parameters for logarithmic derivatives are specified:
+
+		* file_logder           "prefix"Nps.dlog  all-electron logarithmic derivatives
+		* file_logderps         "prefix"Nps.dlog  pseudo logarithmic derivatives
+
+		"N" is not present if there is just one testing configuration.
+	    }
+
+	}
+	 
+	subsection -title {Recipes to reproduce old all-electron atomic results with the ld1 program} {
+
+	    text {	    
+                * The Hartree results in Phys. Rev. 59, 299 (1940) or in
+                  Phys. Rev. 59, 306 (1940) can be reproduced with
+        
+		    rel=0,
+		    isic=1,
+		    dft='NOX-NOC'
+
+		* The Herman-Skillman tables can be reproduced with:
+
+		    rel=0,
+		    isic=0,
+		    latt=1,
+		    dft='SL1-NOC'
+
+		* Data on the paper Liberman, Waber, Cromer Phys. Rev. 137, A27 (1965) can be 
+		reproduced with:
+
+		    rel=2,
+		    isic=0,
+		    latt=1,
+		    dft='SL1-NOC'
+
+		* Data on the paper S. Cohen Phys. Rev. 118, 489 (1960) can be reproduced with:
+
+		    rel=2,
+		    isic=1,
+		    latt=0,
+		    dft='NOX-NOC'
+
+		* The revised PBE described in PRL 80, 890 (1998) can be obtained with:
+
+		    isic=0
+		    latt=0
+		    dft='SLA-PW-RPB-PBC' or 'dft='revPBE'
+		
+		* The relativistic energies of closed shell atoms reported in PRB 64 235126 (2001)
+		can be reproduced with: 
+   
+		    isic=0
+		    latt=0
+		    cau_fact=137.0359895
+		    dft='sla-vwn' for the LDA case
+		    dft='PBE'     for the PBE case  
+		    
+		* The NIST results in PRA 55, 191 (1997): 
+		    
+		    LDA:
+		        rel=0
+		        dft='sla-vwn'
+		    
+		    LSD: 
+		        rel=0
+		        lsd=1
+		        dft='sla-vwn'
+		    
+		    RLDA
+		        rel=2
+		        rel_dist='average'
+		        dft='rxc-vwn'
+		    
+		    ScRLDA: 
+		        rel=1
+		        dft='rxc-vwn'
+	    }
+	}
+    }
+}
+

Added: trunk/espresso/atomic/Doc/Makefile
===================================================================
--- trunk/espresso/atomic/Doc/Makefile	                        (rev 0)
+++ trunk/espresso/atomic/Doc/Makefile	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,42 @@
+LATEX   = pdflatex
+LATEX2HTML = latex2html
+
+PDFS = pseudo-gen.pdf
+AUXS = $(PDFS:.pdf=.aux)
+LOGS = $(PDFS:.pdf=.log)
+OUTS = $(PDFS:.pdf=.out)
+TOCS = $(PDFS:.pdf=.toc)
+
+all:  pdf html
+pdf:  $(PDFS)
+html: pseudo-gen
+
+$(PDFS): %.pdf: %.tex
+	$(LATEX)  $<
+	$(LATEX)  $<
+
+clean:
+	- rm -f $(PDFS) $(AUXS) $(LOGS) $(OUTS) $(TOCS) *~
+	- rm -rf pseudo-gen/
+	- rm -f INPUT_*.html INPUT_*.txt
+
+pseudo-gen: pseudo-gen.pdf
+	 rm -rf pseudo-gen/
+	 latex2html \
+                -t "User's Guide for LD1" \
+                -html_version 3.2,math \
+                -toc_depth 5 -split 5 -toc_stars -show_section_numbers \
+                -local_icons -image_type png \
+                pseudo-gen.tex
+	cd pseudo-gen; \
+        for file in *.html; do \
+                cp $$file /tmp/$$file; \
+                cat /tmp/$$file | sed 's/HREF="http/NAME="http/g' | sed 's/mathend000#//g' - > $$file; \
+                rm -f /tmp/$$file; \
+        done
+	@echo ""
+	@echo "***"
+	@echo "*** User's Guide created in pseudo-gen/pseudo-gen.html"
+	@echo "***"
+	@echo ""
+

Copied: trunk/espresso/atomic/Doc/pseudo-gen-fig1.pdf (from rev 8077, trunk/espresso/atomic_doc/pseudo-gen-fig1.pdf)
===================================================================
--- trunk/espresso/atomic/Doc/pseudo-gen-fig1.pdf	                        (rev 0)
+++ trunk/espresso/atomic/Doc/pseudo-gen-fig1.pdf	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,259 @@
+%PDF-1.2
+%Ç쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xœ¬ýÍ®-±®5†õÏS¬ž†wªJ?%¥iÀH;¾·g¤å/1Ü…Ä¿~DŽAr̹Oìï8Áö*JƒK³J¥*‘ÿãÏõçþ¹ìÿþ÷¿ÿ¸¯Ÿÿù÷Ïÿí^þóßþÿ1Ú¼~Ö=~~yø®ŸÿÀá;úÅo_ý”ÿÿ§ÿáÿ£³üóßÿþü×ÿþÿýûþìŸÿ¿Üýó_Y»£íŸÙþ\{´ŸÿýÇù_=×ÿîßÿïÿøoþýÿ§ôwN6ŽCoÜÙ8Ž£ñÿÜ6û»ÿÌÏVïQ­Þï­ú!ZµÃhՏÿåVŸëÏóÕjk§´ŠCoÕÙ*ŽÿÕVϯógýÌuZÝZ­S}ö±†Fqèú!Åñ¿ÜèuÿéÖèØýöFêLŸ¶ã’Â!µÃhԏÿÕFŸþ|6Yçy¿;.$z“~È&qü¯6y¯ÒØ:÷G~Òû¹âBÂ!ZµÃhՏÿåVŸ†IZ­sW\G~ämÚ›ôõÅÓÖúlPîR"žýúá¨ïͲÿüG?^¾ú>¿
+F…Ïæî9ÞhÏÑ ‹­E–þkMÞãý³O7áæü3>}ú^Ѩ£Q[£,ý×}ú8½‹&?l­_Ñ £A[ƒ,ý×lÏüóÄY^ßgÙïuG£~ŒFYl²ô_k´ßýOc£?_ϸžMú1šd±5ÉÒ±ÉÝÿ¼»³ÉïókölÔŽÙ(Š½Q”þkâ<¿~Ïù^3šôc4Ébk’¥ÿZ“ÓŸ)<Ï¿®ÚxL[£~ü9œFYú/ޝãÊ[åçùkôéï8CÔÛžŸÿéÿò/X~»§ãù3n‰ÿâ?þÓýç?ýÇÿãø/~þß?÷ÿA†Ÿ©p–òÞgð¾§Ý~ØϤâ<RÖȧÛãgoþƒ‡€ó,˜#gÛ;÷=q¸~vky8.îŸ=8íïÕâð¾. 挮û­ãÖqüœãq×ñ$¦ãÕóø(㸟ã{ÕqƒãÇÿûðüxrßsÕñ"æ“ö¬Éã§w çi2ëxÐÿ}Ž'0¯=qÖÌãvcƒl{®:nðÿ̍Žk½Ž_bι´EÌñ¿_½Žœã{Î¥·UÇþ¿ç\úKÌñ¿¯•Çã"ÆÆïç©c^ï9—1àÿºlŒêx³ìqÍ:~pŽç‚¸g‡ÿç§åC…Ç/1Çÿ¹‰9>¿×[ÇÎñtßývøºà~ÃŽ¿ÄŸß}çñºpŽÇÅ3ÏÀ9n›sô§Ž0Gí¶óãã³ýÇûÂ9îãó~pŽg´¸wou<ˆ9>ï—˜ãóÞ-ŽŸëÆ9ÚÓïzàÿyÜ=Wïu<‰ÙçøuÌ>·ÁcÓŸg么ëøÁ„ó\šÏù±qÜÎñ¼ë˜“Òs¹œË–˜ñóå:~6ŽŸOŸ8>~>“˜ãÛóî:ÞÄ?Ûíç¸Ïé=­]8>¾µþÖñ$æøÙ1Ç·¶‰9¾'\7øŸ§wø†‘ã16ƒXwobŽoãÆ9ž[ôÜŽðÿÜfÏ s«<ƒŽ1Ç·akŸË÷™·ö¹Ÿ‰kŸËè™}×ñ$æø61ÇŸc×>?ÏóbìÚ§‹Ÿc×>Ýô¼qŒ±kŸÓ~ÞEÌñgaì²qóY»ö1ñ,Œ]ûü9C(1LJ5‰9>¬5òxcìÚghðŽñããÏÆصÏ-úlŒ6ý??/0çV9o0Ä´ó^‚±kŸK¶]»ö¹ìΐÿÏ¥Ó®AÌ™t]/1gÖt-böO»1vÙC Ý»pŒ±kŸSj÷ æ9Ç/1LJ{s|x0ví3̵c×>CU{0ví3L´gsÚ}0vm›>»ö´i Æ®}.÷Ö0vísÉrzxŽO[msÚj/1§­¶‰9muŒ]ûü­cì²®lvNw´Ž±kÛô³cìÚÇ\ë»ö)jc×>CR»lX9bN[csÚ/1§­±kŸÛãÌ_pŽçoc—=bÛìÄœ¶æ æØŸ/1ÇþÄصOw·c×>]Ö^Œ]û¸Û^ŒöjÜ^Œ]6äµ—c׶Ú˱ëmqì²	ùâØunݶ|löÈoËÇ®s|ìó-Þ.»¶|ì:ÇÇæö±ëŸþÙ>vãcswbŽÍ=9®·ýsšoÛÇ®sÜ~úåc×9îçØÇ®s<Ïq'æÌá¯IÌ>ǘsé÷ËÇ®süœÉù
+ÿÏ¥ÓïÿÏÏv†4bì]`³â
+ Y“ýÞ8Çs¿ŸÇ8ü?÷{hçÜãçR"æØy&1ÇγpŽÝ葍s<?í>áÿéÖÞ1ç¼Z'æØi“˜s^máÏ}w.Uœã¹×z¿áÿ¹…zoÄÝ>ˆ9º}3MwáO—ü?îöqÃÿí£stÇ
+eþŸ!òœ{÷1°ÛëÓì>váÉÊ}ìò¡dv»†¥³ûØ5ÌÝ9|ì™2ü:tÅ¡çÕÿ›ÛïR›;Îí7émǹý&½m€šÛoÒÛnº÷ò›ÝßcßËoÒ3\ÜçØoÒÛæ7ïå7é™ÎÆoÒ{:ÆoR'<óǼƬÜ~“ž1fœc¿Iϳ@Pœãu.€3§~ýø5]¿IoûÞÇoöÛæïã7ém®¿^²lòð>x9²këÌe|bµsù$ê:ÒÛ0Q±ÿm˜¨ÜÇÜ™¿;ÆØÓ]>‰²kèmx9ºÏoö6¼~Î;«cÎËÖ9ÆKÖsð·ã%ëÆ_ãåÈœ·ãåÈžëoÇË‘¹õ¼d5gžð’Õ¡žrÁé?—)Zí™)jÉýw?övpýüŸÖrÞк’3òÃàŒÎEœÑSœÑùIƒ3zŠ3:=œÑSœÑéîàŒNgd‡äŒÎùgÔŠ3jwqFM8£ögÔ„3j­8£Sœ‘gÔFqF~LΨÍ⌚pFç§MΨ	gÔVqFmgäÇäŒúUœQΨßÅuáŒúSœQΨ·âŒÎUŸœQΨâŒºpF}gÔ…3êÂuጺpF}gÔ…3Â
+ጆpFC8£!œ‘“ëÂ
+áŒì88£!œ‘“3³8#?&g4Þ⌆pF~LÎhìâŒü˜œ‘q”Áù19#ã(ƒ3òcrFÆQgd¼dpF~LÎÈxÉàŒÎqrFç~IÎhÎâŒü˜œÑ|“3Âñ&f%g„ã‡þï䌌—ÎÇ/ùÁ;9#?&gd¼dpFÆKg„ãILOÎÇ›˜‘œ‘ñ’Áḓß|“3Âñ"f%gd¼dpF8näþ®äŒp<ÉÞÉÙ œ‘“32^28#ã%ƒ3Â1­s{g„c[k&gd¼dpF8æØwn¡àŒŒ—ÎȏÉ/œ‘ñ’Áá˜#à¹Ô‚32^28#?&gd¼dpFö꜎9î⌜—$gäÇ䌜—$gä¼$9#“32Ž28#ã%ƒ3²wøàŒŽ¹äŒì}>8#?&gdïöÁÙ»}pFvœÑ2’3²wþàŒì?8#?&gtí⌌ÎȏÉ/œÑ¹Ä“3:—irF~LÎèîÅÝ£8£{gäÇäŒî·8£{gtïâŒü˜œÑsgôÜÅw“3òcrF§ù䌞^œÑ3Š3zfqF~LÎèy‹3:CCrFçöNÎȏɵ«8£vgÔžâŒZ+ΨõâŒü˜œÑ¹“3:—TrFç²HΨ­âŒÎÏ“œ‘c4î’œ‘s—->Â8î’3w¹Éww¹Éww¹É›w¹Éwû1ùnã17ùn[½Èwor‘ïWpFÎ]’3òÛƒœ‘s—䌜»$gäÜ%9#ç.É9wIÎè±™89#ç1Éáø!ßmkÏíóïžOpFÎi’3rN“œ‘sšäŒœÓ$gäœ&9#ç4Éù­NÎÈ9MrFQ䌜Ó$gäœ&9#ç4É9§IÎÈ9MrFÎi’3rN“œÑV®àŒœß$gäü&9#ç7ɝ㜑I䌜ß$gäü&9#ç7ɝžIÎȹNrFÎo’3r~“œÑ9Á9×IÎÈùMrF½ægdSÕàŒŒëÎȆËàŒìu%8#ã:ƒ32Ê'8#{Îè:·npF6uÎ躟äŒìò
+ÎÈ^í‚32Þ38#›:gtÝ+9#¾ƒ3ºžâŒÌDpF—ñ2䌮3|gdÓ—àŒ®§8#»…‚3²W²àŒŒ
+ÎÈÞ«ƒ3ºŒ!gdhpFæzpF—ñäŒ.ãÅÈÙ´)8#»]ƒ32>48#£‚3²W…àŒìœÑ5zrFÖMÁ]ÇÅàŒlZœ‘q£ÁÙÐœ‘q£ÁÙ«HpFƍgtÙ—äŒìgÎè2Žœ‘Mû‚3ºŒ"gt­;9#ã#‚32ž48#{Ägt­œÑeœ9#{SÎÈ8ÓàŒ.ã•Èõœ‘q¦ÁÙ+tpFv¹gdoüÁÝçô‚3²a18£Û®CrF÷]œ‘ñ§ÁÝçr	ÎÈ^у3º÷!gtÞ™’3r.†œ‘M‚3ºÏ5œ‘±Áݽ8£û˜ÎÈ^ÿ‚3:ï:ɝ÷›äŒÎ;MrFç=&9#{]$gäÓrFΫ’3j6'gÔlè'gÔìõ’œÑ9ÞÁ9ÇJÎÈ9VrFα’3:Ç=8£f·9£fÓzrFçxgt¦GWpFηž!£Æ®3?Ç»ŒÚ8¯kà@ís±Ë¾–šc—óPcàc|ÜÄØe¬Ìœ»Îùcì²éל»ž7?ü9S±Óî‹1ðÌ[íc`Îí7_Œ]ÍÎýÅØeÓµs[¸ÿÍÎwÁŽuñ\»lȘcש8Ç»š]'c—1 at saìjÆßmŒÎ©mŒ]Í~_0igÚ—TZ³G&©´3|‚Jköø$•vŽwPií<óƒJ;#ØTZëF!J;ÓÄ7¨4Ÿ&’Jkç9TÚ™2î Ò|ÊH*íLŸ Òš½‘Jk6T‘Jóé#©´f?3©´f\$©4çmI¥5{"•Ö¦Ù•vÞæž Òš½‘J;3ŠTÚ鶤Қ½Ò“J;ÓÇTÚéΤҚ½Æ“J;Z;!
 ¨´f¯î¤ÒÚ
I¥5†H¥ùtTšOÿ·Siûù_¦ÒºPi6±/*ÍL•¶‹JÛJ¥]E¥ÝE¥ÝÅŸ=ÅŸ=ÅŸµâÏZñg=ù3;äKèé¨àÏÎaògç²Iþ̏ùz.ƒäÏü˜ï ç÷IþÌŽƒ?;?Sòg~üÙ%üÙ%üÙ-üÙ-œÙ#œÙSœ™qxÁ™oœ™gf¼]pf~LÎÌx»àÌü˜œ™ñvÁ™ÙqpfÆágæÇäÌŒÃÎ̏ƒ3»„3»„3»…3»…3{Š3ócrfÆçgf^pf~LÎÌ8¼àÌü˜\—qxÁ™ù193ãð‚33/83?&gf^pf~œÙ%œÙ%œÙ-œÙ#œÙSœ™qxÁ™ù193ãð‚33Þ.83?&gf¼]pfÆÛgæÇ;?,LÎlìâÌü88³K8³[8³[8³G8³&œY+ÎÌø¹àÌŒŸÎ̏ə?œ™qrÁ™ùqÏï“33N.9³K8³K8³[8³G8³&œYάg6„3›Å™Çœ™qlÁ™ù193çØ‚3»„3»…3{„3k™õÿÿsfΓgvgögÖ…3™MáÌ^áÌ–pf»¾³2~+¾³2~+¾³²ïëâ;+û¾.¾³²oêâ;+û¦.¾³²oç’3Ûřݙÿœ™qNÁ™ÝòÕ-ßYŸœ™?^øÞi¼QpfÆgfœPpfÆýgögfOpfÆëgfüMpfÆÓgf|LpfÆÁgf\KpfÆ©gf߀g6îâ̆|g5„3óùã;«.ßY½Å™ù÷TñÕï¬vqfK¾³²ïš‚3³ï—‚3³ï‘ß;›|ï4¾pð½Óúð½Óúvò½Óù0¾//5ã½sgæï…äÌü»rfþNFÎÌߥșù;93ÿöƒœY³ù9³óS%gÖl©‘œY³a…œÙ™ÎöüÎÊæ¡ñU·ïÊø•½fÆwV¦Fά?O~gu^Ûó;+l²Ø=>ÄoƇüþc×WV·Ý¸Á˜9›AÆÌÞP‚1kþeF®nÌ3{!	Æ̾$Æl8†‘kKCÆlÞŘÙWÁ˜MÇcäšÆ>‘1³—Š`Ì^ûʇŒÙk_ƒ‘1³c0f¯•…‘ë­¯¬|€	Æ̘Á˜Ù‹t0f¯0f¯3`¹ì;³wåWV½¨cf?l0f¶ŒÙ2ŸÉ˜ÙËL0f˘2f˾F"c¶ìk$2fËú“Œ™Íƒ1³x0fvcf³´`ÌlÖŒ™
+Á˜Ù¬(3›ñcf`ÌìÆÌf$Á˜ÙÌ#3›Ucf³2f>K cæ³2fþÔ'cæOz2fþD'cæOn2fþä&cæOh2f>¨“1ó'13â’1ó'.3²’1ó'+3š’1ó'(3‚’1ó§&3j’1ó§&3°1ó'%3:’1ó'"3"’1ó'"3_"cæOD2fþD$cæOD2fþD$cæOA2fþ$cæOA2fþÐ#cæOD2fþ$cæOA2f¾jCÆÌŸˆdÌü‰HÆÌWgȘùÓ‘Œ™?ɘù*3:’1ó§#3_y!cæOJ2fþp&cæOM2f¾ªBÆÌŸšdÌ|U…Œ™?AɘùJ
+3š’1ó§)3_=!cæOV2fþd%cæ+&dÌü)KÆÌWIȘù$‚Œ™?}ɘù*	3“1ó•2fþT&cæ«!dÌü	MÆÌWCȘùÓšŒ™¯€1ó2fþ'cæ+ dÌü‰NÆÌW=ȘùӝŒ™¯z1óU2fþÔ'cæ«dÌ|¥ƒŒ™ÏȘùê3_Ý cæ³2f¾ºAÆÌW7Șù쁌™OÄȘùŠ3ŸU1óÕ
+2f¾ºAÆÌW7ȘùŠ3_Ñ cæ+dÌ|FBÆÌW4Șù*3Ÿ©1ó¯´É˜ùŠ3_Å cæ³2f¾ŠAÆÌW1Șù,‡Œ™¯b1óU2f¾rAÆÌ¿Ò&cæ³"2f¾ŠŒ™­\cv]O2f6s
+ÆÌV.‚1³a43ûb;3[¹ÆÌfZÁ˜ÙÊE0f6ÆÌV.‚1³ÙX0fFZcf_lcv=ùñ™¯\cfCy0f¶rŒ™­\cf/‘Á˜ÙÊE0f6•	Æ“qÕ µdÌlå"3[¹ÆÌV.‚1³™b0f¶rŒ™­\cf/¯Á˜Ù´)³Ë¶’1»œU#Ûï,W
+FKÆÌV.‚1³ÇU0f¶rŒÙå	v~ÕŒ™MÑ‚1³•‹ÿíŒÙ}ÝF™õöÇH£ ÌþŸÿ¯ºSñ¿#]–»íaøG¾2ķÞeE±k±uëýƒOÒ\¯ÿ‰ïÓþ
+Šu]¡gߨµ/½¾EχÉл_Ñ[Wé-ƒÎøŽõÞÓxúi_¿Í/½õˆÞzDo\¥wžˆ¥·
+ºéç¤@½uO?m/æõ©gÍԁz«‹^So›	{t¹ÞKzûçLBÏvyö/½q‰Þ¸Dï^¢·îÒ³CÂ]oQ@ímá§	[ü|þ€çt½ý'HÏÃ$ñ<°BÏ¿쟊Ί¦&9ÒPKU›øÚ|{@†åMJÕUŸãÂUû*±¯oÕÖUµõR=><ª;GévGºwHÔµoﺾSöù֝¯êÎWuÛPÝ->G/úü„D]û¾r¤Ï¾w|ég\º`SwnÕmâóüÃo4]·ýÉ/6]×½˜¡ku}붡ºmˆî9a՝u‹úÕå¶ëö¨kß„>q—b'qݦÞmÎy»î‰ºö
+iKŸMÚû[w
+Õ]CuGÝçŸýúµoR]w†D]ãíßôÙw6·oÝ{«î½Uw½ª;rxÙ>¬:ïºoHÔµo`¯¼s}çôû­;šêŽ¦ºÏ­º«—®_Á¶>àº+$èú¾ì>cgöõ­»¦ê®©º£«î->ûlë®»C¢®­k¼á3v~‹Ï~Úz…Õö+$êÚÚÇŠ!;ÅïoÝöªn{E÷<çUw®Òõ+ØÖC\÷‰ºöMñ÷/v¢oÝ÷RÝ÷RݶD·_â³_Á¶ÞâºOHÔµuœ‘>ÛÌ÷úÒµõ™ÒÅjM꾏ê6ñÙ¯`[ÏqÝuÝ‹s°“þ)]¿
+mýÇu{HԵ羚¸]šû[wÕCuŸ¦ºk–®_…¶¾äº#$êÚZUKŸý+íç[w-Õ]KuÇTÝ[|ö+ØÖ¯\w†D][{ÓgP>ß~Úz—ë¾!Q×ÖËvŒ9ˆ4оuÛVݶEw\¯ê¾uÿÞ~Úzšë®8á±õ¸'î_D2x¿ußGußGuû%ºóŸý*´õ:×Ý!Q×ÖûFøŒH	â³_…ó‚Ï>€rµÏu}M0}¶/ãÛû­û4Õ}šêî[uG9>áñõC×½C¢®}wÅý‹È
+÷·îxUw¼ªûÕ]uÿúÀ×']÷	‰º¶¾ÙÓgÿÊ_|ö«ÐÖ3]·…D]÷"}ö]÷—®­–.VCS÷ªÛÄg¿
+vÝu}5ƏZ1jÌñ¡Ë×WñnR¼d˜qÿ"²Åó­ý<BÝêg“´Ÿý*´õ[¼£„/æEúì» Æ·î¾Uwߪ;¶ê>å³_Ú¾>Œw•â¥Ã¼ˆ1Ç£t´süçòõd¼w„/æEŒ9ˆä1¿uû£ºýÝu_ªûÖýëîûz5Þ?BŠó"|vi‰Ï~%Ùãï !Å»„y‘>{d‘ù­»ÕݏêÎKuñÙ¯B£Oñ"R¼M˜1æx“^cŽ_4¾ÞŽ·‰âÀ¼ˆ1‘NÞoÝÞT·7ÑÅPšºoÝ¿Þ‰¾ž·‰âÀ¼HŸMÚâ³_IFµá ¤˜Õ›é³í¹ÞoÝÝTw7՝·ê>â³]Iþ}ÞBŠ7ó"ƏòÒkÌñwGÿorGfõæEÜ¿	f¬oÝÞU·÷Ò=^<ªûÖýëoþ½ÞBŠY½y‘>›´Ëgôï#0«)fææ}vé¾Ö·î»êÎGuñÙ*üûÌêCŠ™¹y±C×v(õsü•Å¿×ÀÌ<¤˜™›3tí+±¿uûPÝ>D÷¾›ê¾uÿúÞ¿Á¬>¤˜™›é³I[|ö+ɾÁÌüO~M‚Ùµy‘>ÛNªK|ö«Á¾7ÁìúO~}‚²y‘>{¤Ÿù¥kߧ”.¾VIÝu©n¯1ǧþ=f×!ÅìÚ¼xC×¾‚™uÿúãÔ¿Áì:¤˜!›=tMzßoÝù¨î|T·]ª»Åg¿’ìûÌ®CŠ²y‘>ÛN³»|ö!Ó¿ÇÁ9¤˜!›é³EEzÊgüû̐CŠYîÑ]sE©÷oÝv©n»Tw/՝uÿúmáßa†RÌrÍ‹¸]zëþõŸÚ¿'Â,7¤˜åšé³I»ë®Ku×¥º}‰n¿Åg¿’ì{%̐CŠY®y‘>7Z*>ûÕ`ß7a–RÌTÍ‹s<ÊT¯1Ço0ÿ
+3Րb¦j^ÄýëQ©æó­Û—êö%ºýžªûÖýëœo…YnH1S5/Òg“¶øìWC_ôy„3Uó"}~í‹-ñÙ¯„Þ$¡žÑ7G«ÏôÙ¢j=峿]ø÷_˜m†3Fó"ƏÂU|è’ƒ§nð@©hxдþ}f›!ÅlÓ¼Ÿ]’~ö·ÿ
+³ÍbÆh^„Ï.mñÙÑA>~_!ÅŒñHÁÈ»4oñÙÑAN~ß!Ŭϼˆ1Ç£Ž-OÝI^º3ˆyè3ݢ淿!ø÷t˜1†3Æ#;©èùíSiÿþ3ƐbÖg^¤Ï&-ñÙÑIŽ~÷bÖg^¤Ï&mñÙÑIž~bæv¤‘>[”µ»é¾dê¡ûSÝ ê¡[Týö)€?ˆY_H1ë3/bÌñˆnÅÕo¬ù÷†˜õ…37ó"î_—Š«ÇDÓ?ÂÌ-¤˜¹™á³Kµ²}øñï1s)f_æEøìÒŸý}ÁÕƒaåא˜}™á³G¡»Ç—îWOÝ\=tƒ«‡nqõXòï+1s)f_æEÜ¿ñ®¸úÙöj1û
+)f_æEÜ¿.W¿1c^ƒ>·böe^¤Ï&-ñÙÑ5és)fP?$ÃCÚâ³ÿ¢kÅ*¤˜Aý|ø¥´oñÙÑ
+®/Šüº³ NP)íâê7f®\=G~ŠYÐÞ_J[¸zê‚«Ýàꁮ’põ˜õîAŸWH1ƒú!%ðÒŸýÝ“>ïbôÃ)ç/$Û>Yºþ‹npõ`
+ù5-fA?J!ÙG¥kþ¹fA!ÅL懧õûF@®ÞgŸþif2!ÅLƼˆû×#&
+Wï³Oÿž3™?ùu/f2æEÜ¿.	Wï³O_ÖÇL&¤˜˜é³I²&âS<ÿ^³‘b6b^¤Ïöu°põþ8õï‹1ù“;ô11/ÒgûšX¸zDø÷ȘüÉý˜˜1æx„Háê}Øóï—1	)fæEÜ¿ER¸z¿•ý{gÌ(þä×ϘQ˜qÿº$\½_žþ}4f!Ō¼Ÿ]’5ïrÿž3ŠbFa^¤ÏY@¸z7ãß_cFRÌ
+Ì‹ôÙ¾°®ÞPÿ^³‚bV`^ĘãQ3…«÷AÁ¿ïƬ ¤˜ÝàêeS¸z¿Ðý{pÌ
+BŠYy÷¯KÂÕûçߏcVR<ÙÍ‹ôÙ$Yq‡ü{s<ÙCŠ'û‘zúl_Wï3*ÿ>OöâÉn^„Ïþºpõ>£òïÙñd)žìæEŒ9aT¸zŸQù÷ïx²‡Oö£\="’
+Wï3*F°'Ë’Aì³4¸zHÂÕû¬È¿¯ÇÓ9¤x:›é³I²&â³"ÿOçâél^¤Ïöõ½põ>+òï÷ñt)žÎæEú<í‹~ñÙ•®L	¿þÇÓÙ¼ˆ1ÇwWïb߀§sHñt6/âþõˆ­ÉÕóñâû	ðt)žÎæEúì;îÒõ_¥ú¼BŠ'¬y>»”\}Ǿ_Oؐâ	k^„Ï&K|öžíàêÁp·ž’æEŒ9&äêù°ñýxJ†OIó"ƏP›\½}Ó÷‡qjñ”)ž’æEÜ¿Ñ6¹újÖ÷[à)R<%Í‹ôÙ£–ˆÏÞ³cÐçR<%Í‹ôÙ¤%>{ÏŽ7ž’!ÅSÒ¼HŸ=*Jùì3ßÿ§dHñ”<Rpõ.ÍäêˆZß/‚']Hñ¤3/bÌñ¾ÉÕÛ÷ŽWIw›àIg^Äýë“«oø¨É÷£àIR<éŽk"^ñÙ{v‚«Ç›4w³àIg^¤Ï&mñÙ{g¾ô¹‡O+ó"}¶(0—øì¿ïW7Zî–ÁÓêHÁÕ»ô&Wßð‘“ï§ÁÓ*¤xZ™qÿz„ã^÷/žô/¸z¼Ñr7žVæEÜ¿yÔý‹§õÛéó)ž8æEøìÒ[>ãiý‚«Ç›%wûà‰c^„Ï.mñÙ{öW7KîÂǼŸMZ—øì=û‚«Ç›%wá‰c^ĘcÒzjÌÁw«Çwá©a^Äýë {Ý¿xâ.põxÃãn%<5Ì‹¸=bô¨ûOÍÕéóRŒüæEúlÒ[>㩹&}^!ÅÈo^ÀgJ»|ÆSs½ôy‡#¿y1C×öA]â3zgÇèu}OV]‹XôÔ˜ƒ'ßW·%îÎÂÈtÉÕ3Bv¯ûO>ùäÛwsaä7/ÞеºY÷/ž^»ÇèRŒÞæEúlÒ+>{ïìIŸgH1z©¥Ï¾}¬|ÆÓk¿ôy…#°y>Û~§ë.ŸñôÚàêùÖ²ÉÕ38¹z—úõԘパïXÃRŒÀG—\=#ˆ÷ºýónCŠؼX¡k{áfÝ¿~2¾#£hHÔõ]té³I¯ø¼=éó)F`ó"}6i—ÏþñwECŠQÔ¼HŸ}^ù<Ð;›‰ÎVH1Ššƒº&ÝO9þêà;úü½BŠQÔ¼xB×"¬÷ºýIà;
+)®vó‚÷/²¦Œº1÷^
+>ã	³Ú›W»y>»4ËgÜ9kt^±!Q×¢<á³K«|Ɲ³Þ›WlHÔµˆ-}¶¸
+w6|6é®~~üJòþ+<!Q×âÑ^á³KÅÕãSJ¸áº3$êZï<á³KÅÕ?þüõ¿1Š0^~}ó"Æ“žâêŸ}å\}ÃÉ0¾~}ó"Æ“žâêqè@~c$`<ÿ,²È÷¯Ç)®ŸzÄÿZHÔu/ÂçíQwËgŸ†{„‘߸›oäß"—¹úÈìT>û#Â#’üÆÝÌø$ÿ†¸¤ã!WO©¸z,ày×}CŠ_мh¡ëQ€gé¢ÝýðW‰¿‚µD®>2M嘃EâºoHÔµvÉÕGfª«t½Ýö°'Ÿø+x–ð™¬Êç‰v;|Æ]Õzøì¹®îð™¯ÊgŸâyÄïRü
+æEøìRqõØ”è^\w…¿‚yÁ1Ç¥^\=:Â# 'C¢®E—!W©WÿøÔÒ#Èø]!±'ó‚÷¯K½¸z\&qæ7¯îþ„Ï6ºµ>{tæZyüýÈ#Ôxo<!±'-Æó>»T\}ÃxÕ'|ÆxÕgøl#TÂg—Š«Ç­GÀùÍ+´“«÷·£“«‡4Š«Ç»1½{ÃãRóþuiWß|¨ö;荐Øæå÷¯I£¸úæ”’GäùÍ«l<áóö(>á³I£ÖDZºÃg¿XÏÇ{ý ÏŠ«ÇçüŒîØ
+(¸zHÅÕƒ€ðA®»BâùrÌA6¶âêFÕ±yF3$êÚWìmÅÕƒ¼ðD8£Øö‹WïÒ,®¾á>š¾&b1ÛBbox.¹ðÙ¤Yk" ><‘{õ„Ä3²\rÁÕC*®¾á^˜>ã^˜ÁÕ7»úgpõŠ«ÇR¿GPr¯îxF³<¸z—Þâê;ÏйúøÅfpõF(\½KoqõXD÷MîÕÏȼ®Þ¥·¸úŽkò}6½
+‰gä^Ðg—ÞZé~2ʽê!ñŒ,"TpõŠ«ï¸ëÞ	ŸÑëopõÝ#HW©¸z|bà¦Ü«½²<€ÁÕ»´Š«ÇÙ‘Ê-_!ѫǼàý‹ŒÅÕw\ý˹úÓs-$ÔN÷‚÷/2W?ü§öˆW¿Ùs+ÖDºç+Œ5—V­‰`èòYnù	‰^Y”¬àê!W
+ºQË-¿!¡öò\‡ôRqõø<Á#p¹åRxe^pÌqiWÏ<b,‡D¯,¯bpõ.íâê‡?Š=—[~C¢Wæeô³K»út="˜[!Ñ+»>¿U?}žtÁÕƒŒc<1÷ÊÐÁÕC*®~vè‚«vpõÓã÷W©¸úùâ|ÁÕÏë
+	µÉ,¸zd},®ÏG4óÚ+$ÔڛɮޤyWJÉ# Y­Ï½Ítm¶½cMĤyÕšÈëCµGLóÚ+$Z¶–‚«‡T\ýû
+®:0ÞšÕâé3¤âêšÈ#²yít-zÙ\=¤âêÉÅ#¸yíú“`ùHÁÕ»tW]ŽñÍkŸhÙ¢ÇWïÒ]\=¾ðöq^»þdVNÓ}=w'}vé®5QÎkߐhÙ"ÏW©¸z¬¼z:«õ÷nÆ£³ZN\=¤äê;ØyXgµ<ûàê="Ú\=¤äê;Ø.p÷{¤{„„Z‹¢w“«‡ô$WÏ…CˆgµN¸0>žÕZ”µ›\=¤'¹úŽ· gµÏ	µÓÏpPפ'×D:fqÏj}dü=«µ|¹zJÉÕ÷FŸ«?sîjÝKrõ”’«çrGô³Z¿üßÏt-úÝC®žRrõŸ¼yÀS‹ÏáÐ,[4¾‡\=¤–\}ÇÏ#žZLÿ?Ð,[”¾‡\=¤–\}ÇÔÃ#žZLKoÐ,[伇k"Z®‰ôE´sõ$jŸÐj›çŠ¥Ï’«Xåò†§ß1žáÑõü³\=¥äêÞâ<âáï?ÑÿðÔZ »ÙÈÕCêÉÕc·‰üý6¢0Jੳp/	(É?áã2"øûìÒbDÁSg	E^’O.¬äžnYqð÷7†3Æ´Z‹Üø’{‚´’{ºñ°G(<µ·OÖ¯ðÔzn”—¤•ßÍëx9÷tó:^äžn¿r_rOVrOwÇݶœ{ºñ£1¢é"j"}†”ÜӍ¥:˜xj±ŒÇø‰fÙ¢>.rO”’{ºñšãOí äžn{Aš‹Ü¤ÜÓ='t{º±ÆøŒV‹¼'¸o!íäžnüæÁÑj}²ÆxŽ¦»=ê#}vi'Çwó‚ÚÎ=ݼ¢6¹§Û¯¢Eî	ÒNîéFt.iµx’nrO·EBž›Ü¥äžîÅv{ºÛ%÷t/o‰Ü¥äžn|Éî(­=·ß°l‘37¹'—Þ+¹§›OíÜӍEƯ´Z{ZnrO.½WÅtÀ×áÒkwHе¨¤›ŸKïU±3 at _{DL¯í!ѲEàŒïqMz¯Š
+Ú#hzí-[DÍøNRÅθ/èâ;Ñð"¾µœVï߉Bª˜Xcó^;B‚îö¨žüNÔ¥»b:Üh|'zí'$Z¶žïDoÄøÌoÓ±ÁÝ#€Z­O¿Ôj»Ÿ!}vé®ØZæC½ö	ºgÈ{¯ø×¥»bg€©ò£Vë“DÆ5]Kù|Çw¢*v6©3aÌ9ƒj-ê߉Bª˜ø€Å#˜þÖÄw¢”í½ã;Q—žŠé€‡›G<µÚ§ýÉŒAVëéºã;Q—žŠéÐÐÒƒïqôÕßã>Þ;ñ=®KOÅÎ
+	ºÛ£°†Ï&=;7Àê–{HôÊÎ0¾…T±3šO"<b+,‡D¯,âkÄt€T1Ày„W·<B
+¯Ì~ÛêR«˜ؤîa=:~HôÊò1EL—ZÅt
+‰gäQŽé³K£bg`{‹G8þÍ_,â?¶1æ;RrO7^â_|Gˆ-o|Fh{ÞøŠÐ…úˆð_£|®åÿ•0Ê-Ã(›Ã'cn‘A’½ï5L2ž¾Yïp­GAK†¾„KFAÖ.õ(ȠɀKØdd=àRïw[Oö[QÃ'£ ë—zde‡keèg½ÃµÞŸeLÙ4œ²T½ÃµúTúVúY}©÷{±‚+û…­á•Qõ€K=
+2È2àfY¸ÔûW‚-Û­¢á–Qõ€K=
+*è²YÓ°Ë0
+
+EÐFE¦†ö~ÛHml%Bµß•£š%…€†"XR‘ªa㽿l‚‚@D[‰Xíw”ĬŽ’DPC,©ÈÕ®!±«ÃF" ¡DÇ•Ö~GIk–Š Šd
+m}ÛHmÑr+¢µßÓš%…€†"X’‘­i£b[GI"¨!ˆ}˜½î—Æ¸Ž’ú]Ö7‚%éë:l$Š@˜Šxü0óš%…€†"h##_ÓFñ÷a#´!ä„‘Ø~GIl–Š`IE†âó£$ÔrÄHDl¿£$&v”$‚‚`IEÆv
+‰6
+E gŒDÈö;Jbd³¤ÐPmT¤lØ(¾?l$‚621Ûï(‰™Í’B at C,©ÈÙ°Qü”$‚‚@>‰ íw”ÄÐŽ’DPCçŸçbwƒÆÒf.šB Ž±"h£"jÃÆÓ¿m$‚6Ñxþ1Ò!Ö¡ÄÖfnšB ®±"h£"lÃÆXß6A‚@Ä㌴Í؇k›%‹›…ˆ’ŒâA
+‰¹Í’ŒÉM-ç‚>¬ÈÛVõ{%‰ † ÂFEà†
+‰ÁMóù´ñȹ +÷ã‰Å’DPCaC"r;BbrÓÆžŸ6
+<7™»¹,±¹YˆÐ(D”H„n—%F7K…@Þ›HÝ&k¬n”$‚‚±6$f7mÌöiã‘sAJänGHìn”$‚‚ÀPûÁÛÃ%‰ † ¢¤"yÆÄòfI B£ȏóÑÛe‰éÍ’–çÒ¿QR‘½]Cc{ÓF?l´j„o¿4Æ7JA
+A„ŒôMë›66
+^"~#N¦ÆüFI"¨!äÑÑÈß~%kìo–"4
+%œ%íþ´±å\xþq.þ8ûˆŽ’DPCa£"‚Æħ9>m<r.èÊîwƒÆGI"¨!ˆ°QÂaCb„ÓÆÞŸ6
+õîwƒÆ
+gI B£È¿£ÃýJÖ˜á,	Dh"J*r¸khìpÚ5M½Aܯd!Ž’DPCa£"‰Ã†Ä§Êöù|!#wWDq¿4¦8K*ógûBDIý.ÐÐße~ BCôaFwÖé#Æ8K*#hÿB çDw¶ç#Ö8JFe_ˆ°‘ÇiCbŽÓFe
+_¼BHäq§h>b£dTÖÐù…ˆ’Œ@Nƒœ%•At~!#W$r¿49K*;ëû…XŒ8^ÉýJÖ˜ä,ÉÅ,jÈjK*2¹khlrÚÈõ,Æ*—õ¬Áó±Ð_?b”£$ÔDبHå°!±Êi#×´hCÖ´ͼ"–û•¬1ËYRùG¯/ÄbTóŒ\îSùØå,©Èû%ÁœÃœ%•ôþB,FHÏHæ>uýˆeŽ’·ò’>_ˆÅHéÑܧY1ÍQòV~Òö…Ùœ6$¶9mTžÒö…XŒœžÎ}Zñãœ%•¯´!¢$#SCb³¤òÃö/ÄŠ(ìy.~%kÌs–TþÒñ…X=ÏůB}Ž’UyLç"ldtڐè´QùL点$º_É%«òš¾_æ5’ˆè~jLt–T~Óõ…ˆ’ŒŒN
+‰Î’Ê'»¾Ì‘TÒ¥Pc¤#§R" ¡æ;ªHéˆñ«±Ò‘iKÞÓ/DØȈé´!1Ói£V½®/s'UätDMÔØéȵ´kÕëþB`¥Y"¨#z¢ÆPg‰äCýBDIFR§†ÄRgI­F>_PeQ‘5¦:J.ɏú…XŒPŸ‘Õ‹Xc«£ä’<©_ˆ°‘ÖiCb¬Ó†äKýB,F»ÏHëˆ©±ÖQrIÞÔ/Vg%â:"DjÌu–HþÔ/D”däujHìu–ÔjäüB€Â“ìþ6ÿƒ%·äSýB`eU"±#b¥ÆbGÉ]yU×"ldDvڐ˜ì´!ùU¿XY•Èìˆ~©±ÙQrKžÕ/VE%B;b8kŒv–Ôª×õ…ˆ’ŒÔN
+‰ÕÎ’Z¼¾XÑ”ˆíˆ­1ÛQòÔª×ý…ÀãJ"·#.´ÆnGÉS«^Ï+‰Áñ¡5†;JžZõj_ˆ°‘‘ÜiCb¹ÓF­zµ/V%¢;bMkLw–ÔªWÿB`P"»ûtï#¶;K>W#%áã6jÕk|!°
+(‘ÞûZc½£¤Õª×üBàQ,ß[c¾£¤Õª×û…Àê›D~G,ì.yZQÒ*ëúBDIþ.´!¿KêwY_,H$xÄÕî’·•%µ¹¿X9“ˆð~KKLø(éµêu}!°ê%‘á£{HW”ôZõº¿a##ÄÓ†äs¥Zõº¿Xõ’Hñˆ÷=$¯+Jz­z=_¬XIÄxÄý’G—%µÙ¾Xš‘Èñˆÿ=$Ï+K>W½•"‰ Џ’Q«^ã62’<mHÞWÚø\õRVŠ$¢<â‘OÉÿŠ’Q«^ó•"‰,¸äSòÀ¢dÔª×û…À*D˜G|ò)ywYR«‘ë%iž’–%µêµ¾x
+‘ˆóŒu.ùaQ2kÕk#¢"ÏûۚЏ’B at CÏ?ÆÄM%_,J
+
+E SDE¢GüôWòÆ¢¤ÐPK2"=mHž^–$‚‚¸xþy.~½²¦Å’Zõj߈‹çŸçâWÐ’5-”Š@‹ŠTϸ…’B at CÈdQëß]Ö´PRh(-*r=Þp–¬i¡¤ÐPKr­‘6d­‘%µù~#.žxñæËS–Ôª×úF\<ÿ<ÿõ·¬i¡¤ÐP²e¬\ÓŠøó5¢¤ÐPòr­\ÓÂÛÉ–5-”Š@捕kZŒe/kZ()4;×Ó^ÖY’j™8v®iáÍbËšKA
+A°$×´ú’5-ÚH"C+âæùÇXˆX—¬i1ê~"3VȶsM¥/YÓbôýÊo;¿7Ï?Fÿ	%6~ä+Äý~#‘öʵFÆ헵ƈäŸç²¾7|Ï5-Æï—5­ˆèÿÁZ ÝöÊ5-Dº¾eM%…€†"xškZˆezËš³$Š@\ì+×´5û–5-f	H4h»W®iùl\béGI! ¡Äؾs­±UoYkdI"¨!Dî½sMynYÓbI"¨!Äë¾sMѼYÓBI! ¡ˆžæšb½>²¦Å,‰€†"IøÎ5-DdM%…€†"xš½Žüô:3"ÔﲿˆJüäšbÏ>²¦Å’DPC
+¾çš–ß‹?KA
+A &ù“kZˆXÞdM%…€†"%ùÉ5-ÄÂm²¦…’B at Cˆoþ䚢Ÿ7YÓBI! ¡ˆßs­yš¬5²$Ô¢6·\ÓBlÞ&kZ,I5Ñà{FîG΍ÝÏ’\õ¢†¬z!tEðGTvá’–«^Ðè²êÕàiFòG¬`å’–«^Ðè²êÕáiFôG	é’–«^Ðè²ê…ˆÔÙQâ5¶?Kr5’²Ùá{FøGìbñÏ’\õ¢†¬z!¦|EúGÄyõÏ’\õ¢†¬z!BvEüG~ù’ž«^вê…øôùÑë5ö?Jz®zAcȪW‡§™
+`¦$9X2sÕ¯¬z!ÒzeÀLIr°dæª4^YõBŸÊ0€YŽä`ÉÌU/h¼²êÅœ™i€
+¦œËPDjÈj$²UÆÌr$ç@”äª5dÕkÂ÷–çâ½.¹Xòæª4–¬z!;Pf ¸0C‘,ysÕKV½˜K!207Šä"`É›«^ÐX²ê…ˆô™‘
+
+E ƒGfb@°^ÍÅ%‰ Æû5®Œ ã4'C”$‚ûk\™.fS<Ê«}"˜aAˆŸeOs4°¤ÐPăß225`¨Õ\
+,)4ü
+™±ábvÉc½ö'‚hÖ™¹Cžænˆ’DPCˆ'›Is8DI"¨!ˆÈ'c!b½K.‡+òOäÌñùF ‡Nft@„TÍéÀ’B at C
+ˆÈì€(šÛ%‰ † 0ÛªÈû¤9X’jÑÊô€Ç¨æzˆ’@„†dnö¡¥2>à31Íù%™¿™’Ás§Ìü€Ç™æ~`I"¨!Î{2è{ÍÁ’DPCœåd&lOÓ\,I5p<•4ºæ„`I"¨!|6X™!ð٠憈’ÌóL
+ÉôŒÙEfˆ@XÍ%™ï™’ñyòìÞ°ág/¹"X’j‚3ƒÌq3CDåŒ`I"¨!>Õ3s–U4wKA
+Að©ž$˜GKrH°$Ô¦»•IÙ
+
+E<è¡XÓE3{­i±¤ÐP®äkZø$ã¼XÔøÁß!ÐP2ô´XkD×Í^k,I5³Çš¨’ÙkM+J…àUØcMŸFÌ^kZQˆÐ(ă¥Çš¶BÌQkZ,I5Á¼!=Ö´˜UdÔšKA
+Að
+걦ÊjŽZÓbI"¨!ˆÇ‡§Ùc­á樵F–$‚‚x6Ï?Îe •ZÓŠ’@„† ðëXÓbn”QkZQ’jâFÆš¶uÌYkZ,)4ì9#Ö´ð©Èœµ¦Õâü
+Eð·Œ5-DÙŸ³Ö´XRh(¢óìè)Â6ÎYk,I5[zÎXÓÂ-=g­iEI B£…1g¬iÂš³Ö´¢$¡Qd©œ3Ö´:®Ê·Ö´X’j¡/çŒ5-æ¿ykM‹%‰ †"0ÒÏXÓBùùÖšK
+
+E`æ<c­4Ø|k­‘%…€†"0Û|cMóç[kZQ’j¹¨"©·¨H^¥,	Dh,9[œ]¬i”KQ’j"ÏŸ£h@ɵ%‰ † i 3.Y¶BGT¯³$ÔPfŸ‘y©!À¾ä^Š’BD>¥B4žœfø•ƒ)KA
+A`Æ™˜†ÉÅ”%BöP¬iMô`ådŠ’DPC#3SÃç6’›)J
+
+EDž¨8d‘ªMQRh(‚g+V/ξr5EI"¨!%™±©½˜VΦ,	Dh#]dnj/fÁ•»)KA
+A`„‰N
+”äpbI! ¡|’™œÚ"¢V¬[	4>
+žÆJ"v¥IN'–Â5>~+ef§¶#ÿRzŠ’B,f†ÄßcÅ
+«÷’ã)KA
+A WFdzêsWåŠU–ÄšVh(­pŪ#T½ä|Š’B at CxõÍÌO¯¾’û)J
+
+E¼<žÞÞ$T”$‚Š@.œÈՙͨrAEI"¨¡d"ŠŒPO É	•%
+ALžFºŽÐÂ’*K‚ðGMfˆâgƒ’#*JA
+A¼ü¥¸bÕAµJ®¨()4Ý=™1ŠŸ¬HΨ()4
+1îÈ_OÞ€%wT”…À׊™æõç±d‚‰Ö\2Å {Q|™~ãò•”0Q’jüÿ”4fÿ¯%é’4Æô<iŒ¿,Ï™û ¬îbÊ\´-ébŽ Éb
+Öfv>’ÁòÈžnÿp_×¥õ×%g7o¼Ý_W”7XÒ(oSa\/ÜyQßCbãSrA3\Õ´$áá¼$aü`©{µžÙ¤Ù^FŽs©ör:ëiK"˱$¡¡ˆå%ž‘úԏØþ«™”\ª} ÎzÚ’èg,	Dhü˜¯ÖÏWÛψu.íõÝ~ÖÓ–D´cIŸí+bÃ#öÿ‰í/Íàd’äo
+tÖÖfx¢õ‘ý?ÿ9â¾n­¿nm?#åyûíùn?ëiK"é±ý¹?Û×X{<Z¨Cbû[3G™$y£ˆ®zÚÒ(|×"ìÿ…¸ÛG}Ò~er©ö̺"øÁ–Fð»>¡ñ7b<Z?m?£È¹´Úwûe¶4ÊÜõ
+EÜðˆý¿BBm»4Û•K[úèŠ[9ðþ@„Æ߈õQ¿†¶ŸQM’<Y®¨ƒnK3iÑúhí /¹Øÿ;$¶k–-“$ÇÑUO[±ðù@„ý¿ϽµþÞÚ~F3ôöÇõÝ~E;„-vø| ¾"<ò§=&×.±ýG³{¹$q‰®H‰°¥‘Û'‚#FÓúÑ´ýŒÖç’Äê#:ëiK,I5ÑáÑFýÛošUÌ$Í)FtEht[Š õD@㟠ÖÔö×Ôö3z£·/±‰Îz¶/ZOÛWÄ€Gìÿ'$¶ß5›™IšË誧-A ¤´ÿ¢=—Ö?—¶ŸQ#½}‰Éö³ž¶ÁöAûŠ˜ðèE}‰íÍ¢æ’Ä›$:ëiK,I5þFŒ®õ£kûÑ%‰‰HtÖÓ– X’j(Ÿíeÿ÷ØþÔìm&iî6¢³¶A뉀ÆbÁ#öÿ‰í¿šùÍ$ÍûFtÖÖ"h=Ðøѯ®õW×ö3¦·/ñ5Ù~ÖÓ– Ø~"h_>"÷çFý‰í/Í8g’æ›»ø{G=m	%… ý¿½-­oKÚ¯lu.I\O¢³ž¶Á’DPCcƒ^ðˆõoHlk¦;—$ö$ÑYO[‚`I"¨ñ7â½µþ½µýŒ(j’æÈ#º"Žº-EÐz" ñ¸áû…„Ú~i†=“4¿Ñ­Ôm)‚֍¿ãú¨¿†¶Ÿ‘L½}‰cÊö+Ò)li¤ÓûAûŠðy<êwHlÿÖÌ~&i^? «ž¶’BÐþ_ˆÑ¶Ö·-íWV@—$~*ÑYO[‚`I"¨¡ˆðüGNZ“Øþ£]’ŸDg=m	‚%‰ Æ߈÷Ñú÷Ñö3r«Iš‹è¬‡-EÐz" ñèðý\¸&±ý¦™MÒ<†Dg=l)‚֍¿óšZMm?#Æzû/–íg=m	‚í'‚ö1àæ_ÈÁkÛïšAÑ$ÍŸtÕÓ– PRÚW„È³ãùÜ»&±ý¡Ù]’x¨Dg=m	‚%‰ Æ߈ñjýxµýŒ¦ê’ÄR%:ëiK,I5ñÂ#ö‰íOÍúh’æ|$:ëaK´žhüľ´ý}iû]×ۗغDg=Û­'‚í+bÁ#öÿ‰í¿šmÒ$Í5	tÕÓ– PRÚÿñ>]럮ígT_o_bú²ý¬§-A°ýDо"|D~;žÿÈqlÛ_šåÒ%‰;KtÖÓ– X’jٍ߸þߐØþÖ™.éõÏß;êiKsŸ^Ÿjüx»Ö¿]ÛÏHÄ&inM¢³¶A뉀ÆÂGÄw³ÿWH¨—fæ4Iórõ°¥ZO4þFœ‰‰Ö_KÛÏÈÞ¾Ä?fûYO[‚`û‰ }E<ðˆõ;$¶kFP“4(ÐUO[‚@I!h_>"Ú£Ýê‘Ù$¶ÿh6Q—$¾/ÑYO[‚`I"¨ñ7b,­KÛϨÍ.IÌf¢³ž¶Á’DPC±þ‰í7Íbj’æ0%:ëaK´žhüÄ~´ýýhû-ÚÛ—XÑDg=Û­'‚í+bÀ#Ì¿oÚ$¶ß5{ªIš;誧-A ¤´¯ˆ	0ÿBži“ØþÐÌ«&iÞU «ž¶’BÐþ_ˆÝ›Ö÷&íWÖV—$g+ÑYO[‚`I"¨¡ˆ±ÿ{HljÆW—$66ÑYO[‚`I"¨¡ˆØÿ#$¶ÿj¶Ø#}äŠ%:ëÝւցüMÿ±›¶¿›¶Ÿ™f½}É3KtÖ³}AÐz"ؾ"¶—ܘ!¯“Ili–Ú#}ä¨}ø{G=m	ùºAû߈ãÑ«õÏ«íg†[o_òÛ²ý¬§-A°ýDоfѽàžÿÈ'eÛßš×%ɍKtÖÓ– X’j(âö’Éþ_!¡öHf]—$¯.ÑYO[‚`I"¨ñ7â}µþ}µýÌÊk’æä%:ëaK´žh| xÄþß!±ý[3úš¤ù|‰ÎzØR­'ˆæ%7æ_ÈŸeÛ4°I¹€ù{G=m	%’OøúçˆûYZÿ,m?3	{û’G˜íg=m	‚íW.âë/D‡G¬¿CbûM³»$9ˆ‰ÎzÚKA
+EøˆtOöÿÛïšÁØ%É_LtÖÓ– X’j(bÂ#ö‰íÍ~l’æ>&:ëaK´žhüÄÖz“¤ýÌœìíKÞd¢³ží‚ÖÁöá#Òé"Ô÷ØþÔ¬Ë&iÎe «ž¶’Bо"<Âó¹ÔMbû¯fl6Ió57þÞQO[‚@I!hÿ/ÄÓ§Ö÷)íW¶g—$×3ÑYO[‚`I"¨¡ˆ
+Øÿ3$¶¿4S´K’'šè¬§-A°$ÔÐlÔ<bÿ¿!±ý­Y¦MÒÓDWžj·õ‘§úú@PãqÃ#öÿ
+	-¼—f¨6IóS]9®ÝÖGŽëûA¿ínZ7m?³[{û’ÛšíW~lØÒüØ÷"ì+ÂG¤ÖðüG®x“Øþ­™±MҼ؍¿÷ŠöaKsk?ˆ°¯ˆðüGŽx“Øþ£Yµ]ÒœÚü½G´[	Ÿ%•—ûúÑáú¹áMbûM3r»¤ù¸Îì´%Ù
+XR9½ïÿ/ˆuiýº´ýÌæmÒG.oþÞë£}ÍNë•üþ1àûÿ	‰íwÍnÒGpþÞÙÿnKs‰ÓzåþBLx„ùòÙ›Äö‡f7é#‡8~ÝÌÈ@[’‘%’‡¼ý…ð¡7<ÿ‘ÇÞ$¶?5¹IšœYï3k
+‰í?ÖÅoIöŽÙFhK²°$-PC~G¼Øe…ïÅ]bûÍz#ûß$Ù(Etf¡-É Ã’´@
+ELx„þŸ-$¶ï½‘ýo’ì!:³ÏЖdŸaIZ †"pE.ö‰íOëìÿ#-Ù;Btf®-A„õ´
+‰ó×뇋ƿ!ÉÞ)¢³ž¶$SKr‡5ñÀ#öÿ‰íß?$m~CÒ½#@g=mI––Ô•ýWä
+†!¤xÿáCû—Ò–½#Dg=l	"¬çh| üŠÜØ‚ï]Š÷ç~DúKiËÞ «ž¶$»Jö1áÑæ~HñþüÃEÄ_J[öŽ
+AûŠ@`ÿ	óÛ?±ÿä<¸­7r~e’äÔ":ëiK,¹j÷@Vúg°þ
+)æ/ÖÙÿ&Iž4¢+“l	‚%‰ †"Ð#/û‡ó‡¡ý¥Ô$ÇÑY[Š õD@ãÑáú9èŸØbžÞÈùÕ‘šäg#:ëaK´žh| ^x4QßCŠç·õFίŽÔ$·ÐUO[‚@I!h_óÃ]ð¨¡þ
+)žŸG;3™Ô$ÿÐUO[š9îúDо"ð›aÿ	ø:—âùi½Ïw—$wÑYO[‚`I"¨¡ˆÐÿÏR<¿~Hø7$ÉGGte¬ƒ-A°$ÔPÄ‚GO¸Øþk½½gR—\vDg=l)‚֍þ¯5ì?_âǏËz#zϤ.yðˆþÌ”÷ õD@ãAÞzƒw‰í[g=“ºäÐkü½£ž¶4ËÞøDо"èQ¯7h—ؾõìq©×Þ¢«ž¶±×'‚ö5W<âõïj—xÿÞÖÑ{.ɵKtæÿ£-ÉÿÇ’´@
+ELxôÊTý'ûõÞˆÞsIòþ¹iKr²$-PC¾By<êòÑcÿÉ~·õFôžI£öŽ:óÂ֐¬‚´ž ñð±cÿ	çë=öŸXü©Ó1¿2i<2»:3Â֐Œ„´ž ñØðhÉvÄþ“sÿZoÄüʤѾg·=³Ò–d3¼·"Ò¾ üÑlA†y‡‡Äë÷±Þˆ§·IcÈÜ	½›÷hK2,о"à3ö_!g°Kqÿü0ˆòoH¯Ì]Ù[Ñÿ´%YY’¨!ˆ†ßûO@¸Äë×ñè_—jïH ³ž¶$#KbÿIhœÉxY¿BŠë×z#úפyÉÜ	謇­B¤õž3´õwöŸ ¬KlÿÌ8Fev<Ò¬½#ÎzØš’ù‘Öcÿ	57ĉý'|^Lî?±ëÇzãÍëëÔÕÞ¢«ž¶$k$J‘öáŸÂðüwbØ%þ~·õFß÷H³öŽ]õ´%™
+Qˆ´/ˆ—=¸ÂVHì?ûÅ3¥K’‹’謧-A°$ÔøÎxy<Úø…ߐØþ¶ÞˆþuIòX]¹0aKsa^Ÿj‚¿ˆï?a^G—ØvƙӤWs`²·¢¶¿w  !„æ:5öpHì¿3âÍÌ iÒ+ù3‰ŽzÚDXOÐP„/œ	é…+¸…ÄþóÞˆç»I¯äÞ:ëÃV!XRh_
+}æûOHºDÿ­ÿ+‡¤õ¿ä‡ºêiKrL¢$a_%½ñC¢ÿ¯õFô¯K’ó“謧­BDIæ
+¥† è‘ï?9g8B¢ÿÖbd…TùBõ´%ˆèÏ@PC¼f}ÿ	óºD}ëñÈ6êÒª\£ÎzØR­'‚xnúܽ~Œ ¿ìŒ#S©K«ò”:êiKa=- at C˜-ßҐTÚ%ÔãúF–S—–dA]ì­¨§­B°$a_>5oË÷Ÿ0ç”K¨·õŸï.­ÊÃItÕÓ– PRÚ/>…nË÷_5|(íjmÅaEvUH•[5ÐYO[…ˆ’@„F!ú
+Ÿ}ÿIC&— ¿ìŒ#3+¤ÊËè¨[…ˆ’´@B`*Þ–ï?áDÝ%蟁¶"««K»rº:êiKa=- at C˜
+´µa|ÉÚQk+n+2º´+l ³¶ÖA
+A`i¸mßÒóØ%Ô>牳"›¬K»rÉ]õ´U–$"ì'¢#¼úñÈžÿÁ×]B­Í8w@Ú¹w$ÐUO[…`I"Â~"ÆÍñýW‰û\B­1^›»§(åÞ©Dg=m	‚%‰ F"¸ ³}û†%¼Îè–Í­&ô+÷M4jÝŒÖÓnÔ;\êo¤·é—ﻸ§? \B­1›»&\êWî™ ZêiKàAûµïÙÀûåû.n¬¸äúgžlý€§–KýÊ=Dg}Úª](´_<ŽG>ïÆsÁ%¯µ'M¿bפÚ3è¨[…ˆ’´@B`d<9ï†qÑ%ÔÞÖã±kRí™tÖÓV!¢$¡Q|’Þ/ì»hs‡„ÚËz<vM¸tמ‰@g=l	"¬‚Šð[òxôÂB	µsZoµqé®=ÎzØR­'‚:ØwÄn.¡ö¶öcׄKwí™ ºêi«,IDØ„/Aôû.†¿º„Úá½AÖÀ¥»öL]õ´%”‚ö1q…ÞØw4p}Þ±ïhØÇ®!Hµg(ÐQ¶
+%i‚è(Á¾‹±ž¨ß­7ž°oÒ–¾:ëi«QˆÐÄ„‡Øw1¯j›qìšpé©=ÎzØR­'ŠX¸f°ïb>=$Ô»âbׄKOí™tÖÖ"h=ÐB@ØƒwHЛõY—žÚ3AtÖ‡-Iၒ²@û‚pf°?¸þ‘ïÉ%ú¿¬7¢÷LzäÚ:ëÃV!XRh_¡ì»@²;—èÿm½1ãüLª=ÎzÚ*D”"4áS ãÏð
+‰þ?ÖÑ¿.Õž‰@g=mIj–"41€À¾".¡ö±3‡I­öL:ëaKa=ÔPĤψ;}]!EÿYo¼Ù¿GWyõ°¥ZO4áÌÔñY&ü…Ô%öße½Ñ£Ô$¡ÐUO[‚@I!h_!î·_(.±ýsÅ·Ì4ã’$ª!:ëiK,I54Ù
+J˜­χû.Þá½½ç’$¬!º2ÒÀ–¦´™Ÿjb£„Y>Ú?ÿÅ£÷\’DDW&ØÒT íA
+E ‡˜í£ÍØ¾õxæë0©K¾¢+Ÿ‡ÛR­'‚@²Þ™ñÃß]âï×­7Vü¾Gê’òè¬[²3%eöá”ìñy'0_é±ïâ\?Ö#¯¯S'Y?€Îú°%;3PRh_ôý?žxýØgf—$±
+ѹ«ˆ¶dgKÒ5ñÀgf·oHlßÎ83Ô¸$	nˆ®ü7°%;3X’¨¡ˆÐÿþbâR\¿ÖÑ{.IÞ¢+/lÉÎ–¤j(bÁ#äý˜#$¶ÿZo<Ñþ‘†äý Zò‚˜,ˆ°ž ¡<!ó~àù8rß…=q{îš0iHÞ «ž¶dgF{>a_!ï„/H¸÷õF|5fҐ¼@W=mÉÎÞï™÷ƒöAÐÿï‰í/ëè_—$ï
+ÑYO[²3‰%™÷†‚Àa0ï
+æ#óÞØŒcä®	—$ï
+ÑYO[²3ƒ%™÷†Š GèÿÕBŠû×z#ú×%ÉûAtÖÓ–ìÌ`Iæý †"ÐCKŸ`#ó~ÜÖã¹k¤)y?ˆÎzØDXϼÐPF¤yI–:—xÿØŸ»&Lš’÷誧-Ù™’D„}ExļOH1~ü0ã/¥©y?`=ëiKvf dTޏç/Ä‚G¬!±ý×z#ú×%Í{tÖÓ–ìLbIå½ß§
+)Æ/ëè_“^Íûtåýp[Š õÊûqý…@Dޏ'$¶ï¿xìš0éÕ¼ü5£¶Þfl€Æâ…GÌûÑCŠñóhWޏ#½š÷ÃÑUO[šÕãýDо ^ôHäýxCŠñÓz#žï&½š÷ƒ¿fÔÓ– ÞëAûŠ@DÞ›ǏÛz#zÏ%Í{tí*‚-Ý™ô|"¨ñ½wéxĸÓwH1~[oDï¹$û.ˆÎzÚKA
+Eøˆø¾÷Û%¶ï½½gÒ’}Dg=l)‚֍ĂGwÚ%¶ÿZoÄüʤuÏ]«¶A뉀†"ðD\—Ä=v)žÖñ|7iɾ «ž¶tgÆõ‰ }Eø²¸ï|Éʼî¸Ü5aÒ’}@W=m	%… }Etxĸ‡wHl¿YoDï¹$ûŽˆ®]E°¥;“ú'‚ŠÀ5Ã}x?]™÷fxoDï¹$û.ˆÎzÚKA
+Eàšá¾¬Ï¬Ìûa«=+wM˜´eßÑY[Š õD@ã_„û.žR<?­7b~eÒ–}Dg=l)‚Ö
+Eø—}_ú±3ïǼ¬7âùnÒ–œû.êiK()í+‘ͼàvæý0ÆaeÖ“¶äì
+ÔOƉ=ìp„øùG¹á[Ã…"³†ìu«Zy3é|1´ãûîÒ8ü?w!õ/å†ý/™5dûVµâVW"9燁'‚¹s^žˆŸ_håz´EfÙ¾U­`H}%‡?<Ìý8/!~~ýÄE®ÇØ™dûV´‚!õ•rý0œ¨¯	~"õOåÆê¯F-2;Nz§ÕO­¸U•¥@ý`ÌŽtœˆþßBêŸÊ
+¹Wh‹çÿ¤wòŸZy3i{1¤ŸŒùDl̽9!~þVnȽ‰"³†ìu«Zy3i1´#x"˜û1ó‰Ô¿•î¯
+EfÙ¾UA­¸™Á+pG2ðD0÷ãÚ…Ô¿•î¯Ú#³ƒlߪ€V0¤nìx1ðD0÷ã:„øùÓ
+÷Wµ72;Èö­
+hCê+9äøatœˆßûv
+©,7Ü_
+´GfØ®K+nf`e)P?NDÿ›úÇrÃþ´GfÍEïì?´âÞV–õƒ1_…×ÎÜ›«©,7ì¡È¬!Û·*¨73¸bîHƆÑÿ[ˆïïO¹áþªPdví[ÔŠ›\YÉ!÷O$s?®GHýk¹±úÛ¿ëˆÌ²}«ZÁúJy~x"˜ûÑ6!õ¯µÕߎ½‘ÙA¶oU at +R·v¼Nô°ÃRÿZn¸¿èˆÌŽFïôþ§VÜÌÀÊR ~2Nƒ6?ºaÿ«™5`».­¸™„•¥@ýdtœˆþŸBêŸrjÍD‘YCöfÿ¡Õou+pG2nœˆþ_Büü^nØÿB‘ÙAönÿ¡õ|¾Õ­ÀÁ˜Ñ8Qc‡/¤þ¹ÜP÷TèŒÌ²U§V0¤nìx1ðD2÷£ÝBìÆOüÑÜ_
+tFfÙ®C+Rwîv¼ó‰<™û1³‰Ô¿—î¯:#³ìU§ÖbpÅé'ãÀ‰ø½;!õïå†ûہÎȬ{Õ©7“°b†ô“qâD'!~þQnØÿB‘YC¶ëÔêç·ºso¸#ó‰<™ûÑw!Íå†ý/™d»N­gûVwîw$O$s?ú)¤þ½Üp;Йd»­`HݹØñbà‰dîG¿„øù½ÜÐû½Ð™d»­`HݹØñbÌ'òbîÇlT&ÒüPnèý^èŠÌ°WZ‹Á3¤Œù*'¢ÿ]HóC¹±æ‹Q‹Ì°WZ‹Á3¤ŸŒ
+'¢ÿ·û§O¹áþªPd֐í:µC+νáŽdÌ'òbîG„4¿”îoEfÙ®Sëٿ՝ûÁÉ8p¢›–æ—rÃýí@-2;ÈvZÁºs?°ãÅÀùhÂâçŸå†Þï…Zdví:´‚!uç~`Ç‹1ŸÈÆ܏ûÒü2v+µc¢™`¯:µƒ+fH?'¢ÿ§æ—rÃþÔ"³ìU§Öõ|©›!ýdÜ8‘&,!Í/å†ý/™5d»N­Þ¾Õ{ÃɘOdcîÇÝ„øùãOœvØÿB‘êA¶ëÔŠT®8÷ƒ;‚‰¸1÷ãîBšŸÊ
+õW…zä~í:´‚!uç~`Ç‹±áDžæ§rCï÷B=r?ÈvZÁºs?°ãÅØq"~ïÛ#¤ùiìv®G¡¹`¯:µ"Õ+fH?NôpÂÒüTn¸¿¨gf
+ÜuZíó¥ÞV2Îç‡qâDž?ÿ(7ì¡Ì¬Ûujõþ­¾’q¶FÉNxBšŸr®ÇD‘ûA¶ëÔŠT®8÷ƒ;’'’¹Ï)¤ù©ÜPUèŽÜ²]‡V0¤îÜìx1ðD2÷c¾¨'ÒüTnèý^èŽÜ²]‡V0¤îÜìx1œˆßûÖ„4?•z¿º#÷ìU§V¤z`Åéc>Š×ÍÜ›§ñóëOçÚº#÷ìU§V¤Ú`Åé'cÉèÿ-¤ù­Üp[(roÈvZ‘jÃçÞpG2vœˆþ?BšßÊ
+÷·…"÷ƒlש©\qîw$cþDܸ‚ï…›Hó[¹áþv 'S=ÀvZÉ úJùü0ðû'ü
+Òýø{÷ŽrCï÷BOdví:´’Au3°ãŸp¢“¦æ·rÃþôdf
+ÜuZùt_oõ“1"žƒþBšßÊ
+û_µÌ¬»®S+XYê'£ãDôÿâç·rÃþÊÌ°]§V0¸²’qÎƃiÂÒüVn¨¿š(2;ÈvZÁàŠÜüÀsó{÷ºæ·œë1PûDfÙ®O­ƒêfÌožÈ‡ß{xi~+7ô~¨}"³ƒlק֋Au3æŽ7clj4a
+i~+7Üßn£™5øíÖªS+øû†Å ~2œhç„)¤ùm çÚL”™5`»N­`pe%ã|~'Nß{8‘æ·rÃþÊÌ°]§V0¸²’A¶Æ…ñ{w!~þYn¨¿š(S=ÀvZÁàÊJÙ
+'â÷Bšr®G¡-2;ÈvZÉ ºØñbÌŸˆíÃï=<…4?–z¿Ú"³ìU§V0°²ÔOƍÑÿKHóc¹aÿÚ2³îºN­``e1¨ŸŒ'¢ÿMHóc¹aÿef
+Ø®S+\YÉ8í›1G“¶]ôÿÒüVn¸¿-™d»N­`pÅîHÆŽuN˜BšßÊ
+÷·…"³ƒlש®˜ÁÉÀ‰û'ø}ÝDšßÊ
+÷·í™Ù¶ëÐJÕW2Èç‡1ŸÈ÷Oðûº‰4¿•z{Ú3³îºN­``e1¨ŸŒ'êœ0…4¿•ö ý;Õ&êÔ
+V¶w2ΛÑp"úñó§ö¿ÐwªMÔ©®¼“qÞŒù'Ä~ÑÿSHóc¹aÿEfÙ®S+\1ƒ;’qãD7'\!͏冺§‰"³ƒlש®˜ÁÉxp"M¸BšË
+½½‘ÙA¶ëÐJÕÍÀŽdÌ¿hîŸà÷ui~»ëQèˆÌ°WZÁÀÊbP?;NDÿ!Íoå†ûہŽïT›¨S+XYê'ãÀ‰4a
+i~+7ÜßúNµ‰:µ‚Á•w2Λ1ŸÈ÷Oðû‰4¿
+ä\‰2Õlש®¬dí‡qáD'L!Ío冺§Bgdví:´’Au3°ãÅÀ‰û'&ÒüVnèí]èŒÌ²]‡V2¨nv¼':8a
+i~»ëQèŒÌ°WZÁÀÊbP?7NDÿ/!Íoå†ýèÌ̸ë:µ‚•Å ¾Œ`'¢ÿ]Hó[¹aÿ}§Ú¸n-3¼òNÆy36œˆþßBšßr®ÇD‘ÙA6ëÖ2Ã+VàŽdà‰ìñ½Çi~+7ÜßtEfÙ¬Kk1¬nìx1ðDÞüÞ㏐æ·rCoïBWdvÍº´ÃêVÀŽãĉø½Ç›æ·rCoïBWdv€­ºµÌÐÊR ~2æyáþ~_8‘æ·rÃþtef
+ܽí?´®íK})P?'¢ÿ§æ§rÃþÊÌzgÿ¡Õîoõ•Œsþ0nœˆþ_BšŸÊ
+û_(2;ÈÞí?´îë[Ý
+Ü‘<‘¸‚ßN¤ù©ÜP÷T¨EfÙ¬Kk1¬nìHþFàÂýü¾p"ÍOå†ÞÞ…ZdvÍº´ÃêVÀŽcÉ4á	±ú”î¯j‘Ù¶êÖ2C+Kúɘ?¡mç÷~„4?•îoj™YCïä?µ®ýK})P?'NÄïýÞ„4?•îoef
+½³ÿÐjÏ·úJÆÙ~N¤	OHóS¹aÿEfÙ»ý‡ÖݾխÀÉÀÉ܏ëÒü4S;
+õÈì ›ui-†Õ­€/žHæ~\§æ§rCoïB=ͺ´ÃêVÀŽãÁ‰',!Í/å†ÞÞ…zܹèÞÿÔ:ú—úR ~00‘wæÞ\]HóËØíÔšB=2kÀVÝZ×ñ¥¾¨ŸŒ
+'¢ÿ·û§O¹áþªPÜ!û#ÿ©Õ?ßêVàŽdì8ý„4?•îoÅݲwùO­»«¯äç‡'‚¹mÒü2ï—ºãîÙ§ú/h-†Õ­€/Æü	íÌýh»æ—rCoïBwÜ!ûÒûZ‹aõ•²ÿ0NÔ8a	i~)7ìÕâù»ûù§V>Ýí_/ê'£ãDôÿÒüRnØÿî¸;¶êÖºÎ/õ¥@ýdÌ'âfîGkBšÊ
+û_(íÜjEªW¬ÀÁÀD|3÷£u!~þSn¨{š(íÜjEªW¬ÀÉÀÉ܏٘M¤ù¥Üp5ÐwGÈvZO¤zPÝ7T°ãÅÀÉ܏öi~)7Ü_
+ôÄݲ]‡Ö©T÷
+ìx1Nœ¨sÂÒüPn¬ùbÔâîT§wöZÇý¥~û†õ“qáD''!ÍåÆš/F-îŽtzgÿ¡©6X¹}C…úɘOäÃÜü¾ê9íÿtÃþŠ»#d»N­LõhÉðŽdà‰PîÇ%¤ù¡ÜP5Qæ~Ð;Õ©•¹w2¼#x"”ûÑ„4?”ê¯êŸÌý wªO­`X}å~´o&Ò‡¹ø}Ñã܏Ïø‰œë1PÿÄݲWîÇgªgîÇ'Üñfì8ý„Ô¿—îo·Q‹»SÞ©N­HµÁ¼ùø†õ“qàDš0„øù{¹áþvµ¸;rÓ;Õ©©6ç‘ë'ãœ+'sW6!Í9µc¢¸;BöʁV¤zpÅ7T¸#x"pÿ¿¯™Hý{¹áþ¶PÜ!{å‚@+R=¸â*Ü‘<¸‚ß×L¤þ½Üp;ÐwGÈvZ[ä~PÝ7T°ãÅÀû'ø}ÉDüüú‰sjG¡-½R=¦Ö–É O2´#s"'¢ÿ]Hý{¹aÿÚâîÔMïT§VæÞ|’aýdl8ý¿…Ô¿—î¯ÚâîØ«N­HµÁÊÇ7T¨ŸŒ':Øá©È©Åݲ]§V$ƒpÅ7T¸#x"pÿ¿/™ˆŸ”î¯
+Åݲ]§ÖJõЊo¨pG2ðDàþ	þ ˜Hýs¹¡÷{¡=í:´Ã꾡‚/žÜ?Áï+&Rÿ\nèý^h»#d»­Å°ºo¨`Ç‹1Böþ7!~~ýÄ9µ¦Ðw§zgÿ¡•É8O2¬Œùj'¢ÿ]Hýs¹aÿÚãîÈCïT§V&ã|’aýdl8ý¿…Ô?—î¯
+Åݲ]§ÖJõЊo¨pG2ðD ÷¿/˜Hýk¹±úہVf‡Ø®S+\1ƒ;’'¹ø}ÁDüü£Üp5б2;ÄvZÉ ºØñbà‰xÔa©-7Ü_ÕÞ•Ù!¶ëÐJÕÍÀŽc>ÇFÿO!õ¯åÆêoGíÿéý‡V0°²ÔOƃÑÿ&¤þµÜXýí¨]á?½³ÿÐ
+VƒúÁèø?rªÃRÿXn¸¿*Ôð]§V0¸bw$cöŒGcîÚ#ÄÏçq¸¿*ô¬Þ‰lש®«ƒþaàÿHgîÚ&¤þ±Üp5й­w7Ù®C+T7;^Œ'jìp…Ô?–î¯:÷õî&Ûuh%ƒêf`Ç‹Ñq"ø¿BêÇîÛþt®T²WZÁÀÊbP?7NDÿ/!õå†ýèlá?½³ÿÐ
+VƒúÁÀDpžô¿©,7ì¡þÓ;Õ©®˜ÁÉÀÿ‘vüùo'Rÿ6ÐáþªÐ³z'²]§V0¸bw$cþ‰xÞŸ?ÿ
+òDüü½Üðû} k[ïn²]‡V2¨nv¼ø?òô?ÿ
+îDêßÊ
+÷W]ûzw“í:´’Au3°ãÅè8üŸƒÁDêßÊ
+û?Ðu.ïÀ^uj+‹AýdÌ'ô:èÿ%¤þ­Ü°ÿ]-ü§wöZÁÀÊbP?èȯ“þw!õoå†ý/ÔÃz§:µ‚Á3¸ÃŒmcG6ÿýù¶§ª­Þ¿ü×ã@+»Àlס•ª›Áøüýß?Ÿ¿úï?ÿóOûÜóK–{ýKËŠ[øßÿÒ¿ÿù(ç2endstream
+endobj
+6 0 obj
+31824
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 612 792]
+/Rotate 90/Parent 3 0 R
+/Resources<</ProcSet[/PDF /Text]
+/Font 8 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+>>
+endobj
+8 0 obj
+<</R7
+7 0 R>>
+endobj
+7 0 obj
+<</BaseFont/Helvetica/Type/Font
+/Subtype/Type1>>
+endobj
+2 0 obj
+<</Producer(ESP Ghostscript 815.02)
+/CreationDate(Tue Jun 29 16:26:29 2010)
+/ModDate(D:20100629162719)
+/Title(dlog0.eps)
+/Subject(gnuplot plot)
+/Creator(gnuplot 4.2 patchlevel 2 )
+/Author(Paolo Giannozzi)>>endobj
+xref
+0 9
+0000000000 65535 f 
+0000032131 00000 n 
+0000032272 00000 n 
+0000032072 00000 n 
+0000031930 00000 n 
+0000000015 00000 n 
+0000031909 00000 n 
+0000032208 00000 n 
+0000032179 00000 n 
+trailer
+<< /Size 9 /Root 1 0 R /Info 2 0 R
+/ID [(Ø'ùPüù‰ÑÿKœ³%|šC)(Ø'ùPüù‰ÑÿKœ³%|šC)]
+>>
+startxref
+32493
+%%EOF

Copied: trunk/espresso/atomic/Doc/pseudo-gen-fig2.pdf (from rev 8077, trunk/espresso/atomic_doc/pseudo-gen-fig2.pdf)
===================================================================
--- trunk/espresso/atomic/Doc/pseudo-gen-fig2.pdf	                        (rev 0)
+++ trunk/espresso/atomic/Doc/pseudo-gen-fig2.pdf	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,268 @@
+%PDF-1.2
+%Ç쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xœì½Ë®&9r4¸Ï§8»–J烙­ÕSoКŒ H¿ èõ'èæî42ºÕTJÙUÈE'Íh^œ×ïß?®¯áãšÿôÿ?|~	×Ç}	ÿï	ÿøý?~)©^½ŽOü9RüøWüÙJnÜrÏwøÿ¥Äÿóÿ|ù÷™Øü§ÿýáóãïúò·¿oãã§?Þ¸ðñ7S·¤ñQË×1RþøéóË_ýÍõ5ÿõOÿòå~úòO_ríAÕåO¨ËŸªŽ¿Mý¿+š[¸_úKöº¢ÉÎ?Uvþi²ò÷Ï–½Ò×›–nÙDöãrÑ”bRQù¢ò§ŠâïŸ+šRùš>jýš{O*Jïk.*+BVþTYüýsecm_Ë)»¾lµª¬ü	YùSeñ÷Ï•
+c|­§l]²±7“ªìüÓdåïŸ-›Â×vÊv—­WWÕùDç_ª)þ\Éš¾ö½,×ãZÞø_ù)Zаÿ¾^É7;}
+¹¥³èŠ\ŒW1=ù‚<5ôçIÆP¿¶;—þÔ¦’/“”¿!©ÁSRCžd*w1ɸKæÞªIÊߐÔà)©¡?O2ß9ÛM2í’5†`’ò7$5xJjèÏ“¬¡}M&™wIkÚ§¤ü½×,ôçI¶;c‡I–GíÈ­Ä»µþñþr˳Æçúµ´å¿û×ÿö_ÿëøÝÇ~„¿£O(Ý›vmwkœ¾ZÛ—F»Ô˜o… Í&Ìú€kÆ#îå½¼—÷ò^ÞË{y/ïå½¼—÷ò^ÞË{y/ïå½¼—÷ò^ÞË{y/ïå½¼—÷ò^ÞË{y/ïå½¼—÷ò^ÞËûÿÏkñÚżμðò^ÞË{y/ïå½¼—÷ò^ÞË{y/ïå½¼—÷ò^Þ¯™˜˜7˜_ÞË{y/ïå½¼—÷ò~í¼È¼H¼|1/½¼—÷ò^ÞËûuòóóóòËû­ð"ñêØyyáå½¼_ÊËÌËÌ‹Ì+/ïå½¼oÏ+Ì+ÌKÌ«/ïåý¼Ê¼Ê¼Ì¼öò^Þ/á5æ5ææõ—÷ò&´3¯3¯2oüúxy}ç]Ì»~DÞ`Þ`^#^¸^Þ_$¯_Äëó:óÂËûŸåææ
+æÅ—÷?Ë‹Ì‹Ä+óÒËûïñóóóò/ç]ÌkÄKcç‰ñ+æeæeæE敍W˜W˜—˜W4^e^e^f^ûÑxyy…yý×ÊëÌëÌ«Ì¿˜óêÎëÌë	¼Á¼Á¼F¼xýJyã"Þ¸˜×™¾7/0/0o0/þZy‘y‘xõb^úõñÄ%ê¿5”7MÍý—vóò÷æeæeæEæ•ïÍ+Ì+ÌKÌ«ß›W™W™—™×¾7¯1¯1¯0¯o^g^g^eõcyyçUæÕoÉÌÌkÄK×·áëZ¼i¯3/|o^`^`Þ`^ü޼ȼH¼v1/ýr^¨¶×I
+åÝ… y{=O5+^f^f^d^ù޼¼¼ļú­x•y•y™yí[ñóó
+óú/çj{ÕP^ž‹ÆË7o|+Þ`Þ`^#^¾¾/\Äó:ó·âææ
+æÅoÅ‹Ì‹ÄëóÒ/çI´}	j(/ÍIb㥛—¿/3/3/2¯œ¼Â¼Â¼Ä¼ú­x•y•y™yí[ñóó
+óú/çI“´¾_j(/ÎI#ãÅ›7NÞ`Þ`^#^¹¾/^Ä‹ó:óÂÉÌÌ̋ߊ™‰7.æQý“ªQdð<
+å…9¸6^¸yù[ñ2ó2ó"óÊÉ+Ì+ÌK̫ߊW™W™—™×N^c^c^a^ÿå<©rõH§¡¼kÎŒw} ݍ7˜7˜×ˆW¯ƒ—.⥋yyá[ñóóóâÉ‹Ì‹‹‡«IGõAªNÒrÝÔ
+Mj5oÔÌÔ¸Q˃Z7jejÞ¨”MÈS‹@,¥^ê÷|¸©ã¤êôˆR}~D¨©4Ar!Ou¦#5³@­Ã¼˜O³h²Ã¸yãæ7nypëÆ­7o\Ë©ìFkNU³”Û¥îwZ>1à\©+ׇêàvæú`=!g]·˜¥ÜÙlû¸[,x/nÙ¸e㦍[¹££Ú”ÍRnµnÿÓ,Ø.îظcã6æú Õ¹:ÚT®7Á7..rVG€)™¥Üb½ñ§Y>\ܺqëÆÍ—ÊrVGf)š¥Ü,ÕѸÓêãäê(K¹>Ìw0wÐû"wtÄ”‚YʝM¢™ÄòAÓâ֍[7nÞ¸ô¾ÈɤË,åF©UƝÖ'WocSnw7\ô¾È^Äa–rgÛæŒi…+?¸uã֍›7.½/rG]þØÍRîe½Ö§Zá'Wwåº÷î`n ÷EYˆ-³…rG|Z!¬òÜñ†º«9V³”Û¥f·On{pÇÆ·17®úÛñ†º0³”;[ß8­Óƒ[6nÙ¸iã®öª#wt÷TÌf)·ZOð©Vˆýàݹnð­;àvæ¦Õ>‹q£µL&³”[¬5ÿT+¤U&¥ù¹Ñú¢YʝµÝ]Èi…ÔܱqÇÆmÌÍôð†ºò-#±”›¬EþT+äôà–[6nÚ¸ô;ê”I¡K¹QJ¨qgÝÏ«u¼¡®2J –rƒµªŸj…ܲqs}M
+\zf¼¡zH2îK¹³þº‹4­Pè™ñ†ºšYˆÍÃZÆOµBnÞ¸™¸ÁýpWÝoxCõUB5K¹]J™q§E¾JÃêê@(f)·YëöiV‹nÙ¸…¹îo€»ò¹á
+u6<d³”;kÏ‡‹Õè™ñ†ê3„d–r¥”ù3O‹|††§ÔÙßÍRn¶êÓ¬^ܱqÇÆmÌ«6¼¡Î’†`–rgÍñyR±Æªƒ
+o¨}w¸ÌRn´VæÓ,껞R'¯a–rƒ”ãÞV¼Âƒ›6nb®÷¿à®¶®á
+u¾íêf)÷’’bÜkrWûÜð†Ú‡b¢ xš†µŸjEêC+žRg¤0f>%•fé÷9©iÅPܱqÇÆmÌ¥~°â
+u²Cïà³=i–~Ÿî™VŒ+¯*ÞPû2Œ‚ƒ÷e©ZmÿT+R_&3󫁛ÌRn±Úþ©VL”WhÍ«h–r³|mãæÉ¥¼’§Œº[ƒÃèÛÅÒ,Á¾_lZ1¯rUñ”ºÃ	£´è[œR´û©VÌåÁí·oܺqW»Qñ†Ø‚ey±”;˳ï	™V,ôð†Øý€­
+½m‹Úö‚§Ìª›ÍRn•/fÜi5ÒÅSbåÛWÄR.¾˜q§ÕWÙ(xJ´ÏØj#–r³|1ãN‹Ú炧¬ªÌRn²šóiÖ ]<eUÝË,åÎ’äëCb
+ÒÅS¢Åö'±”;K’·±ÓJÔÆ<%nuÂV-±”;KRvÝkrIOÙU·™…Ø0K’¯1L+…¥›ñ”]u«Yʝ%ÉÛÉi%j'3žr¨n1K¹ÍJÿ§Z)’.”0E­…b)WrÝÊÕ´R\åJš™{àF³”;Kƒ·uÓJÔÖa‚9a·0¶^Š¥Ü$¹nÜ4¹«þb®7ÁÆ6Q±”%׍{[‰ügL»&´WØÒ*–rƒ•àOµµW˜MÚ^ÁÛJÞ^…ËJð§Z‰Ú+L&ìžÂÖd±{Íïëû§¦•êêË0¹—°sÛ¨ÅRîü¢¾wG¬ºÊfÙ’¶9ðz’·9÷`çæÚ7‹ÚÌ”%ÌAa{ºXÊ•œ³o$ÍAaæ(Í«`–r“•ÂO³:唊æÕe–r£•ÂO³È¯ÃNÒvDòvãš_ÔÛ
+±¨ÝÀlHÂÜŽµˆ%±óÌËÍÕ¼+ÓÜf4ü+ÁK¹ó‹š%V&ÿ
+³	ó8f$–rçµy±2Í3`v iÝGoœ¬îÏó`7·÷¶2Õ}ŒðÓÐgŽf)7KÎ7O.=³(eŒ»qÄP,åFÉ9ãÞV¦q7F˾
+Ž_Š¥Ü`%éS­L¾
+F­»‡q„V,pûüF¶X¬œ×3cä™1ǏãÅb)w~#›ä+—•ÏfŒ%q$],åΚccI±2%1Ì☿XÊ•œ«Æ1ËÓáJ	±”›æÛ'ãN‹Æteì
+õ¿!ä®ï›ÌR®¼½½ï´JXï/?k=BKŸ½Íå­ìõhZ…ê<õŒÕZüœ…Xʝ9këµb•¸¾/<æ‚9¨ŽÖºØTŸ« Ùæ Ä*kJ½Þ¿½c}¡˜ßÞçŠB6¿]¬²üvõ\–Ê:ZÜbKe½âí;ã|­Ì¼Ï‚¥§Ž¹ëbKO}ÎVg[{«øÚ“yEëZÍâuaÎü¯b­º ^`Ñþó±Åú£>g`‹õG°V¤ž\Q?-_1?¶ÏÙÌb~,¬åǪ7V°Ã©£å+¶Å©yËg±ÆÊgÌ׌Ù;æ늍Ùûœ¡+6f«®1»zTãîŽÖ«Ø¸»Ï™²bãn±êw«gS´<£*^žç¬Sñò<­ºÊ32Ýhô¿hŠí"èsö§Ø6±ªo#0ï¤^ʍf)7Ï·wîmÕL\ Õ7C+RÍ7ësF£˜o&V]¾™z	UǃhEªûœ•(6«®ñ öô5)7›¥Üù†—s§U‰‹÷Õ2‰– z™œ£ôêeR,*“èq+ּƿÕÖ¼úñV[ó‚µÖ¼´×¬U¹Õ,ÄΑgµ9(Xƒ¸xߦÜl–rçfçÞV»ˆtWn0K¹³çÞVÄþFC¬îoÌÑTucZmùÚµK¹Å,ÄÎQMµñ‚X-h”«†ZÕ¼\Í‘Iõr5­Få
+ã…†ùç†ZÕ¢sçWν­¶æŸµ'hØ‘Þàó7Û’Þ§—ßlO:¬¶êZó†1{CÍh6f¿Ë¨¼q§µÆì>pÚfƒÜlM³O¯·Ùš&¬µ¦Ùá‹6ì=l(ÝÍ6¶é}6Û}(V¿V¿€VµÁm(ÝÍüØ6=Èf~¬X}ù±Ú26¬=5Ì”4[{jc–[{«¯µ§߬kÙ@	íV6ÚôÆš•
+±:•
+´n§¼Jh·c^mzTÍÎy‰ÕËúF˜ùíð	[nf;7Ê5ó	ÅêË'옑ìØ•ßPʺmËoMr'wZmõ˜ÝëèËPÐÅR®äŽå•X«/k˜íêðÍFiÝ|³V%w,¯ÄZ¾ŠIЛQ„‚]˜fv7"¬u9¢Õv½ý£¡¤øõmö¸~ÿ‡X됙ï­'§F
+”¤;5èæh¸mæ¬í¸+øŽÛû昩I¬Ts±{7÷Sh>‹|·åÍ•§¨GUŠŸXˆ-ò†šÏb…U´4Ì_Uy ±”æS$ãNkÍ_UÉò¨k‹U>GôµÅz¬èk‹°ÖÚb•dîÔ¤­«"!bS±7ü4kµuúEnw,#›…ØYs‚Ýï(Vôïç|Ž¨E|±fÎZ]+®ºP¸˜ß(­˜…Økrm~C¬¸æ7ª´Èwjò}Þ>Úšu¹¤÷Sè÷…µÖ¬õ«Däs)Õ,pûD[>â|¾ðÌ؏„A¦Xà6yC-“°Ö~¤"•óNMÚœ"ý‘Xˆ­3g­Í+­6ƒ˜Pž1|±e¦dåY¬´Ê³ælÂø·È8E,ÄÞ#“û)µ+­ñoAK‘°Ÿ°H bïâ~
+ý¾°Ö~Â"…æNMò*K+bg«š¬Ý€µÚ‚²¡sŒYßÀæË,
+>Ç(Í1–4æù19%–Äæ1ßÐæùÅÊkž_s'cÏIçX,pïéý”ZÅÊkÏ	&bFÝÇ´Xˆ­ò”ÆkÕ}LGÅŒý„˜ª±wO?¥~_Xk?a®Ðʼn–ŒV3Û‘–œ¦’i«\‹[ _“Ëb!6N%óEÅ*ËÍ2=sWpÑzÏ««Î§4î´
+å•øÀ±`mÓ¶bIìœÔ½ŸR¿¬µ¶˜/(áT[ÊÁ,pïÎ%;×˶¥ÔñÌØ_—b6±ÅŸòS­ºö×%]D+ÀbXô¹‚;i{ÊOµh® ¡.Tì)Š¨Õö¥Yú‹í)«®=EXJŠ}7–™ÄBì=ª‰ÕúnX«ïNè+Ö"úßjkqö¸ÕÖ`­5‚8ÀEÿÓebëD[ÿ+V[ýoòÁûŠ?)bóäÚ	
+¶ºG½í
+º¢<Ã-KÇ¡÷-VžÅª«<Ù¨:.ô|õqÙœ´¯>.‹ÆeEÜ¥ÚdþŽ½ÌÒ”ãmé½Z¾F÷å};¾VuÄÒ”ï7ìö`­o„éóŠ[Èuj½Ú5ä2ñ^írXë"òˆ-o·CEl‡«v=Tœ›åªÝ%V[÷CEl=k¸'!b[Z³{æ”÷méž"µ|OQl’L¨ûU$ÄÒ”§euÖªûØWÐp¾,bPÝì|Yœ;	š/ƒµÎ—Å&ŤEÙ—;g™ÌÒ”ÓmUãN+ù¾Üˆ]€-¡ïnÒˆ¥)O´õÝbåÕwc7mËÈ+Ì¢‰¥)ÇÛ²¼‚µò
+CáV0…Ã'–¦nËÆ¡°|Š
+H÷ÎG®=›!q¡Î—Å‹‘¼½¹>æ¿ßÿã—ÿð·þ÷‡Ï¿ÿéËßþ¾}ŒŸþxãÂÇß„;ü®(õ®Îw΍üñÓç—¿úÝ¿þsø·ÿøú_üÃï>þó#ü]úëŸþåË?üôåŸ$í0ÓÖC¤]ïÊËðJ]–'ÝïÒøŠù/ÿå¿ü—ÿò_þËù/ÿå¿ü—ÿò_þËù/ÿå¿ü—ÿò_þËù/ÿå¿ü—ÿò_þËù/ÿå¿ü—ÿò_þËù/ÿåÿ
+ù}燓ßw~xù/ÿå¿ü—ÿò_þËù/ÿå¿ü—ÿò_þËù/ÿå¿ü—ÿ¿Ã;?žü±óãËù/ÿå¿ü—ÿò_þËÿ¡ùz‡ óÓÁ·ß¶3~zù/ÿå¿ü—ÿòÿøaçç“v~~ù/ÿå¿üß
+?îüròãÎ//ÿå¿üß?íüzòÓί/ÿå¿üoÇÏ;¿ü¼óÛËùIü²óûÉ/;¿¿ü—ÿ-ùu珓_wþxù/ŸùûùWÿÑ çïç_׏˿üßß?Îýsyß?çñ/ÿ/„¿¯_‡sý:ïë×ÿòÿ2øòáÄO_㝟^þ·åïóÇáœ?.ûüq8ç_þ/äïów᜿+ûü]8çï~x~Úùçü‹Æ;ÿœùáùûø?œãÿ²ÿÃ9þÿáùûø5œãײ_Ã9~ýÕó÷ñW8Ç_e…süõÃó÷ñK<Ç/e¿xüo†¿ûÿñôÿËîÿÇÓÿÿîüÝÿ§ÿ[vÿ7>üß_9¿îþg<ýϺûŸÿ›áïþ_<ý¿ºûñôÿ¾;÷¿âéÕÝÿŠ§ÿõÝù»ÿOÿ§îþO<ýŸïÎßýxúu÷?âé|wþî?ÄÓ¨»ÿOÿá»ó÷þ;žýwÝûïxößߝ¿÷¿þ#òÎßû_ÿfü½ÿLgÿY÷þ3ýçwçïý_:û¿º÷éÑÿ}g~Ûû¯tö_mï¿<þ›ñ÷þ'ýOÛûŸtö?¿˜¿÷éì?ÚÞ¤³ÿøîü½ÿHgÿÑöþ#ýÇ/æïí:Ûÿ¶·ÿélÿ1o¿ÓÙ~·½ýNgûý‹ù{û›Îö·íío:Ûß_ÌßÛß|¶¿mo=þ›ñ÷ö3ŸígÛÛÏ|¶Ÿ¿˜¿·ùlÿÚÞþåÕþIËHüxòãÆø“߯Ÿ~¿v~úÖü°óóÉ;?k~Üùåäǝ_N~Úùõ䧝_¿5?ïüvòóÎoßš_v~?ùeç÷oͯ;œüºóÇÉo¿\'¿mür}k~ßùáä÷Nþ^ÿËYÿû^ÿ=þ[ñÇ^ÿËYÿÇ^ÿËYÿÇ^ËYÇ^ËY1¯ÿå¬ÿc¯ÿ…ê—x¯¿Aâ©þŠWøŠÿfü¼óÛÉÏ;¿ü²óûÉ/;¿k~Ýùãäם?N~Ûøõ:ùmã×ëä÷N~ßùá[óÇΏ'ìü¸óñƒÄO;ß❟N~Øùù䇝Oõ§I¼×ñO*ÕŸ‹â
+^˷槝_O~ÚùõäçßN~Þùí䗝ßO~Ùùýäם?N~Ýùã䷍߮“ß6~»N~ßùáä÷¾¿J¼•™Ùm•\^þëoáÚùéà‡k秓v~>ùaçç“w~9ùqç—“Ÿv~=ùiçדŸw~;ùyçSù-oåWfG[åÁËoÙâ_wþ8ùu珓ß6~¿N~Ûøý:ù}燓ßw~8ùcçÇ“?v>•¿™³Xо”ïNå¯Q¼Á{:ùaçç“v~>ùqç—“w~9ùiçדŸv>•¿µà"|)_Ê_¥xƒ÷vòËÎï'¿ìü~òëÎ'¿îüqòûÆáä÷?¨üˆÃ½üHùT~
+Å|ăŸ®Ÿ~ºv~:ùaçç“v>•éß“—ù¾ƒÊO¦xƒròÓί'?íüzòËÎï'¿ì|úþkBOøø>ôýÅ|Œ“ߘ.ú¨˜ xx
+ýH!œ)ô#…U†
+¥^"
+ùHaµ2,~&jFQa¸ xx
+õHaœ)Ô#…Udh5|?v at Fцì0 xx
+ãH!ž)Œ#…Õ&ÈðrøžÖ€Œ¢M­¡@ñðâ‘B9SˆG
+ô5¥Þù¾º€Œ¢u2|cà	à)”#…~¦PŽèkJÅñ½EA3j}M	¾¹¨¤ð‚Ãw·¼&mo	…
+%쀄=|@ÀkÒ&	¾I \; ¡°
+_åú«nJÈðeî<v€§PÆ™B=RXß"cèh-mÀkÒRkP<¦‡¯¼&-†‹
+¦[‚õ„-L\=aµ6GÊ DÑ2fÛÔª–±µOMC¡B}RÛjU“"Ö—KeC(ƒ#œh³–ckvÃBaŒ…(™êºä˜"¼…±Cc!JR•a9†o»z q„2V;ÚÖ‡‚‚¸ö>Xˆ#”A´¸Ñ¶”
+ÕµÀB¡Œ…Ș©‰Ö{ÌŒÇÕ{Xˆ!Œ±#‰hËÐ#¸Ö¡-ÄÆXˆ¬5Ù–b‹Öýµk!†0ÆBä¤[QI«å×G(ƒ9jýð·M@,„,D¼N„¶ô¶
+—Ѥµ
+§!!’Õ SA
+K«ÕÎV¡B$U±õ£ŒÞ4EzÛ±!”Aˆ„Qt´µ—ŒÙž´Ö^4ÄÊ DÒ¾ÀZÜ„©Ï´Z\
+Y0¡µÒŽŠ¤¦ixë !qõ1‹mt’0ːÖèDC¡BÄJ¥_žyºZK
+q„2µE±ÖÒžtµ–ö¶†P!PoD³'…ÊÚ;ª!#¬~${REÔõ¶iG(c!BÓ4ìIX-…Â×ä.¹úåàšÜˆõå4ÄÆXˆÀe{"àI¦µÉB¡B`™(™*žtyÁâe,Ä…V;Y+0O«•²Cc!.};›AÃ㈯Óü0„2ÅÑ»ÔiŽ]Uçå}jÈB€ÁýÚ6ë„é–Û)vïBCŒ…ˆ:[œ¬…ÁÔâÞÂhˆ!Œ±QW)“y}º¬™#=ig„1"b^H:˱I/dŸe±…
+¯…8B„ÈE¿ƒ– tgwÅò¤!ŽP!2<ئG¤ï†ïâg¤-d!À`F'M=éûIåËu÷¤-d!À DÂH¢ëQ¯ûI‘†ŸõòCc!RÕ<´Cíè}嘆‘,‡,Ç4OÇÊ1ËeEc!F|vm¸1º7ÜBFDÍC[©ëî4Y0•
+¾T³¨âK¶ÕYˆ!ŒAô8ÍZ:LYŶZ:q„2‘ ’í]dtr÷íë]²`0%¹Ù(	»åb_£$
+q„2Q+òPg¾uŠB¡B¡B`GUìÖJ5xã}µRbc¥Ð~’Lg¿âúM2Y0!3ßÑG
+_ŸF²`0¥ß®f
+]UÖÛjˆ#”Aˆ&#Ï8|VRFÀqЬ¤†ÂÑdš8Úiî{H>ÿHë4·†,ŒhièŒsÀ}íi×Ԑ…
+Bì*cì+qÝel!†0ÆB ë)ÑnC×SÒºqLC¡B`¹¯$»RÝHIëNY1„1Jv*GsK^§â5d!À`„4­%ÛÕš8ZVòº[ÓB¡Bd
+AË;´ÂX»:-ÄÊ vüÛ=x¸$ÇÖîAq„2£uwˆ–S¬h–ºN¥Yˆ!ŒA™&/ÕnMÀ*`iëÖ
+Y0!–f×½â„Hië¾Wq„2!¯y‡hŽÁ/}嘆8B„ÀŠév3†±e¬›94ÄÊ \‚âWGÃ%(tw´…¡vóvjÔkݼ€…
+MË+Ç,ÄÊ „S[±+鱂Õʺ“ÞB¡Gà2µ¡Ã~KÞÎi€Å+|Å_óßïÿñË¿	ø[ÿûÃçÇßÿôåoß>ÆÇO¼qáãoÂ~?}ý%¿‘?~úüòW¿û×ÿö_ÿëøÝÇ~„¿ËýÓ¿|ù‡Ÿ¾ü“p$mûé¬:æ;øïÊÌ›!?º_ú|ƒ.tÔcq7"ݍtýFhü$×#þÕ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õým붋toƒt;ë†S·ïºáÔí»îÿ꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«ÛëÖ¬OݱëÆSwìºgü«û꾺¯î«û꾺¯î«û꾺¯î«û꾺¯î«ûêþEëF֍¤›/ÖM‡®Çªn:ÒÕx×=ã_ÝW÷Õ}u_ÝW÷Õ}u_ÝW÷Õ}uÿ¬nbÝĺuó©vÝ|ê†]÷Œu_ÝW÷Õ}u_ÝW÷ÕýÍêfÖͬY·œºq×-§nÜuÏøW÷Õ}u_ÝW÷Õý¡uëÖM¬[OÝ´ëÖS7íºgü«û꾺¯î«ûênº•u+ëfÖm§nÞuÛ©›wÝ3þÕ}u_ÝW÷W£ÛX·±naÝ~ê–]·Ÿºe×=ã_ÝW÷Õ}u¶ngÝκ•uÇ©[wÝqêÖ]÷Œu_ÝW÷W¬Ë¿O×ø÷é2ÿ>]¸NÝý÷é<Þu÷ߧ{Ä¿º¯î«ûËu;ßËÔù^¦Ì÷2…ó^&UÝóÞ¥¼ßËôˆu_Ýß”.ŸÓì|N3ó9ÍpžÓÌû9MwÝýœæ#þÕ}uSº|Ž ó9‚r±n:t=VuÓ‘®Æ»îÿ꾺ÿ#º¼o³ó¾ÍÂû6ùo³ìû6=Þu÷}›øW÷ÕýÑå}P÷AÞÎ}PeßÎ}Neßõˆu㺅uë&Ö=÷3x¬êžû4ÞuÏøW÷7®Ë뿝ׯÿ†sý·ìë¿á\ß-ûúï#þÕýëò:]çuºÂëtá\§+û:]8×áʾN÷ˆuÿ—ty=¥ózJáõ”p®§”}=%œë%e_OyÄ¿º¿q]žçï<Ï_xž?^§î>Ïïñ®»Ïó?â_ÝÿÝÁóσçŸÏ?Çsþ¹ìóÏñœ_.ûüó#þ‡ÓåùÉÁó“…ç'ã9?YöùÉxÎ?–}~òÿêþ/éò|Ýàùºz±n:t=VuÓ‘®Æ»îÿêþ/éòüÕàù«ÊóWñœ¿ªûüU<ç§ê>õˆÿáty>gð|NåùœxÎçÔ}>'žó5uŸÏyÄÿpº<¿1x~£òüF<ç7<VuÏù‹ºÏo<â8]ïïWïÇs¼_÷ñ~<Çóuï?â8]wwWwÇsÜ]÷qw<ÇÕuw?â8]‡‡V‡ÆsZ÷qh<Ç™u‡>â8]V¦s<X÷ñ Ç»î>|Ä'ÝqѸl¤Ëã²tŽËê>.K縫îã²3þÇÓ
+¬Ëã£Êã£tŽê>>Jçø§îã£3þÇӍ¬Ëã”Æã”tŽS<VuÏqHÛÇ)gü÷ÓM¬Ëã…Æã…tŽÚ>^Hçx íã…3þûéfÖe¿½±ßžN¿½í~{:ýò¶ûígü§Ë±ûíýötúí«º{v¿ýŒÿ~º•uÙnì?§Ón»ÿœNÿ¸íþóÿýtë²Û؏M§Ûv?6~jÛýØ3þûévÖe²±?™N²íþd:ýŶû“gü÷Ó¬Ëþdc2ŸþdÛýIwÝÝŸ<ã¿›n`¿.°_×د˧_×v¿.Ÿ~]Ûýº3þûé²Ø¿jì_åÓ¿j»•OÿªíþÕÿýtÙ¿
+ì_uö¯òé_y¬êžþUßý«3þûé²Ø¿êì_åӿ껕OÿªïþÕÿýtÙÏ	ìçtösòéçôÝÏɧŸÓw?猁cûý|ú«ºýd»¿qÆ?]ö7ûý|ú}÷7òéoôÝß8ã¿Ÿ.ûýÎþF>ý¾ûùô7úîoœñßO—ýÀþFg#ŸþFßý|ú}÷7Îø¸ßÜïwî÷ËÙï÷½ß÷x×Ýûý3þ»éFî÷#÷ûûýröû}ï÷ËÙï÷½ß?ãGäþ7rÿÛ¹ÿ-gÿÛ÷þ·œýoßûß3þûérÿ¹ÿÜÿ–³ÿõXÕ=ûß±÷¿güˆÜFî÷ƒåìÇÞ–³{?xÆ?]î#÷¿ƒûßrö¿cïËÙÿŽ½ÿ=ãGäØÈýàà~°œý ÇªîcýoïÏøï§Ëý`ä~pp?XÎ~pìý`y¬Ãíýà?"÷G‘û£ÁýQ9û£±÷Gå±.µ÷Ggü÷Óå~0r?8¸,g?8ö~°<Ö‡ö~ðŒ‘û£ÈýÑàþ¨žýÑØû#wݽ?:ãGâþ(q4¸?ªg4öþ¨žýÑØû£3þûér”¸?ÜÕ³?{TÏþhìýÑ?÷G‰ú£qqTþhŪîÙß\{ôˆOÜ/¤ÄºÜ/Ô|êîýB}̧ïýÂ#>q¿2ër¿PË©»÷õ1¿¼÷ø僚ͪÖå~¡ÖSwïêc~yïñ‰û…TY—û…ÚNݽ_¨yÞ½_xÄ'nŸSc]nŸk?u÷ö¹>æ[÷öùŸ¸}Nu¹}®ãÔÝÛçú˜÷ÜÛçG|âö9
+Öåö¹]§îÞ>{¼ëîíó#>s;™/Öåv²…Swo'ÛÙ^{;ùˆÿnºÜ>çÀºÜ>·xêîís;ÛßkoŸ9>ŠÚgùîÓPÝð+>Õh«}Ôc‘ŒÇ[@°öðG|N¬›X7°n>uî›OÝ°ëžñ9³nfÝȺåԍ»n9uã®{ÆgŽÍ…uëÖS7íºõÔM»îŸ+ëVÖͬÛNݼë¶S7ïºg|n¬ÛX·°n?uË®ÛOݲëžñ¹³ngÝʺãÔ­»î8uë®{ÆçÁºƒuéöëÔm›n¿Nݶé>âËE±åbÝκáÔí»n8uû®{Æ—ÀºuëÆSwìºg{Æ®{Æn¯
+·W‘Û«~¶Wqo¯úÙŽ½zÄn¯
+·W‘Û«~¶Wqo¯úÙŽ½zÄn¯
+·W‘Û«~¶W«ºg{÷öê_8¶p{¹½êg{÷öªŸíQÜÛ«G|áöªp{¹½êg{÷öªŸíQÜÛ«G|áöªp{¹½êg{÷öªŸíQÜÛ«G|áöªp{¹½êg{÷öÊã]wo¯ñ•ÛÊíFävcœíFÜۍq¶qo7ñ•ÛÊíFävcœí†ÇªîÙ.ĽÝxÄWn7*·‰Ûq¶io7ÆÙ.¤½ÝxÄWn7*·‰Ûq¶io7ÆÙ.¤½ÝxÄWn7*·‰Ûq¶«ºg»övã_9¶r»‘¸Ýg»‘övcœíBÚۍG|åú[¹þ&®¿ã¬¿i¯¿ã¬Ÿi¯¿øÊõ·rýM\ÇYÓ^ÇY?Ó^ñ•ýÊþF"#\×ép¤Íá €+oÇŸ
+‹§M¼žâ鯧x:ÄëC|+íK{ßJ{>K{?J{>K{?Jû	˜¾Ì&Î¥½o¥=Ÿ¥½¥=Ÿ¥½¥ýÜmýÅñº…RÅ;‹ÓJï»8o’¼à‰Ÿ€éTlâ‘Ä}g ÄÓ!¾6ªx:ĝoâé!ž7ñÌâq/§x<ÄË)ñGó·¹À­À•³À£À•³À£À€[n+p‘ÜØ
+\9Ü8
+\9Ü8
+"ƦºUI|±T¼ë4Ø'ŒpÑf%߬¤)Ñn¤8à‰Ÿ€ÙÃoâq‰ëŒÔRO»ºÇ/ùt¦î)˜þ¡ûiL?oúqÓ/ýxè—‡~<ôÝßbúuÓÏ›~{èçC¿=ôó¡ÿ@è~Óï›~ÝôÇC¿ú¢å)˜þ‘·Â—¯M+}-<ôâ×¥ë:Êß‘·ò—·ò¶ò×å/å¯=JW8Êß‘·ø\6ý´éׇ~:ôëC?ú„­ßW³X¿lúý¡_ýþÐ/‡>!àçÚzz1KõÛd»s7-^RÚ×Ô5-Z4אµª^þÂÖ·‹Y¬?6ýøЇ~|èCÿ°ußbéûÚ-ôË©ïk¿¦_ÎÔ×êoù3[‡-f±~ÞôÛC?úí¡ŸýÂÖE‹Y¬_7ýñЯ‡þxè×Cÿ¨Û÷¯Û÷Û÷ïï?_7ßÿ‰°uÃbéûÚôó©ïk‡¦ŸÏÔ×êaù3ˆº}ÿº}ÿ´}ÿñøþéøþãñuÓñýwÄÖÕ²Yª_¥74ýiñÒiÑ♆¬Õµüg-p|›þ ýpŇþØôbéMÿO l¹)›Eú¾`ý|êûŠ“éç3õµä”ÿÂ~²Y¬Ÿ7ýöÐχþãë®ÅŸügmûþmûþ¹núïŸë¡ÿøº¹úD߾߾޾x|ÿ||ÿðøºùøþŒ@hËÉ,Õ—ÖÐÛáRû´¯L ­@šúZšH¡÷ÿ›~Ýôó¦ßúùÐoý|è?zÏ´éM¿±>]5múmקˤM¿íúO„Þߪ)ŽÈú~+ôÓ©ïw¸š~:S÷LÿeÓ/›~ÚôëC?úõ¡ŸýBïí3ý¶é—M¿?ôË¡ßúåÐ'DATÿ?š¥úYzÓ¿­@Wmñž].#<ý"è}M¦ŸXßï\‚~>õýÎ&Óϧ¾§`ú'"جn4‹õó¦ßúùÐoý|蟈`s«Ñ,Öo¬Ï“«ªßv}š<5ý¶ë3ÂZDijT?}¨·þ©V «$€¾ü.	M‹.‹ˆ™žþ¿&9E?múõ¡ŸýúÐO‡þ‰6ÕÌbýºé‡~=ôÇC¿ú'"èùeaÓ¬OG˜MìútHÙôÇ®ÿ@„¸ÅÇ-ÿÇ–ÿå‘ÿãÈÿòÈÿqä?#¬EBüe–êÇÉöü“Kù¹6Ÿ{Ó´xj-1ÂÓ ‚ž×Óø6ýÁútdÏôÇ®O‡òLìúD°ù¯Ë¬¥Öü—è—C?¬ù/Õ/gêkþëú3ˆ´åê›þ–ÿõÌÿpù_¹{ùÏm‘ÿòaÄRý`Þâ§Yt$GÑ~&GÓ¢C712ÂODÞâ×üÏT\ó?¢_Oý5ÿ£úõLÝS0ýBÏQ˜~ßôë¦?úõÐ䮧`ú„ЩùßÍRýk²=ÿ§Eó/Š^ó/H‹gW#œñD”-¾Ö÷=ìЯ§¾ï7ýz¦î)˜þQƦ?6ýÆúãzè·]\ý¶ë3ÂZÄ7³ p;âwá±ÞS,Ú2­hß3­iѦh
+ñ”ñDèüƒé×M?oúí¡ŸýöÐχþ¡›\5¾]›~'ýHÛ\M¿oú‘¶±š~ßôÿBÇÿ¦ŸXßGïÐϧþÿ«~>S÷L!‚ÖHøÿ¥š¥ú]Z#Óï“»üEûL¤ieŒ0ÆŸ@èø[Sôñ7ôëÓøÛôÇ®O£kÓ»>#´Fj|1KõÛ¬V{§iwž¢}{ÒŠ´ûNS÷ÀøÿšþØôëÓø×ôÛ®O£[Óo»þ¡›Æ4Å‘Xß·}A?Ÿú¾oÌô󙺧`ú„°‰øl–êWó>ÕŠ4þT´?‘V¤Ñ¥¦î)€ñDDÝ̤ñWØôëÓn&Ó»>íV2ý±ë3Bk„Æ'³T­é—Ê_úJñž]Þê×-MÿˆzO£Æ‡kÓï¬OW5š~ßõé2FÓï»þõ~;ÓϬïwÔA¿œú~ǝé—SßS0}BhTÿ'š¥úÙzëOµ"¿€>þÒ´ht
+#<ý"ê½FëûÝD¢OW©¾ßm¤iÑåEªï)húŒÐ¡õ/˜¥úsÄåwÉL+ÒU4Eý
+¯H‹.›	™žþuý_ã}ý_}õ^,ZÿW´¯ÿkZ´º¯!ž‚2a5ñ—Yª­·ü4‹Ößõ·Ÿ+-Z]×OAO„?.³X°>?Tìú4º0ý±ë3BK$Þ?³T?Hm4ýiÑÑqEûÙqM‹‡kˆ§ Œ'BÏ5k|¹6ýÎút´Ùôû®O‡—M¿ïúŒÐ©ñÝ,Õ¿¤6šþ´ÈÿW´ûÿšy÷â)(ã‰Ðó™_¯M¿³>Ñ4ý¾ëÇÛy
+Ê`„–HofA¡MÓÏâ‰EGùígù4-:¬§!ž‚2qi‰Ð÷¯f©þôøÜ{žV"ÿ[Ñ뚤•È»ÖÔ=0þ¢•M¿°~N›~=õs:ôoç)˜>!´Dèû³Tz\~’gZ‰N)z’´ôÑÔ=0þ¢—M¿°þúmpѯ§þ:½¢ú·óLŸZ"ôý³Yª_­·øT+ÑaLýͧ§•è0†¦î)€±!ª–HÄ'³T_jƒµ^M¸Ôþi{ïðu退¦î)€ñD$õ?5ÞýOèÖ'ÿÓôÇ®OÞ¥é]Ÿø"zï¼l=Kõ³ÔÓÏ“»úÿ¬í½!BZt¹<BV
+š>#ðEtþ_C±T?Im0ýÛJ4ÿŸµ½õ
+ÿH‹f÷²RÐôˆ¤þŸé÷M¿núã¡_ýñЯ‡>!´DÀÿ“…±T?Zký©V"ÿ/k{ëÇzywWb„§Ï|½—/
+³Tö¸ën½ÛJt5Бnî6]¾‡•‚¦ÏäˆÞ+–ºYªÍÒèíÏ´èj1E¯›Ç]¦!ž‚2Qÿ+5³ PÇdûìù´ÈÿRôº±	i‘w¥!ž‚2žÝgúõéœÉí§þºaGõû™º§`ú+/¢÷¤j–êwk-?Í¢+Oíñš!4ÄÊ`¾ˆÎ¦b–ê7k-?Í¢ùOE¯ùQ¤E
+q„2Qÿ'e³Tö8ë.‚i‘ÿ£h×´¡!ŽP##ºÿ(%³T_Øk÷ØGÈ´ÿHÑ´?éëÐÔƆ@ŽèüÎ1'Ÿÿ«³Å_ç§óäRùÚã‘#4uG€±!²–ijT¶¸´{åæÒþE¯ý1’#4uG€±!’–Ä_f©¾´¸k÷ÀÍ%ÿCя´¡©;Œ
+<Ôù/ì—M>ÿU¥Åõü“»òNÑkr—šº#ÀØÈÝÿ€ýzÙ÷?ÔKJ£éßV¦ý@¯xM‹YMŸÈÂ~©ìóOÅ[¼Oµ2Í?EjÍ>WZ„׎Ðô	Ñ‘#z=ö«ä`ù_¤ÅóÙ‹>¹”ÿÚšùüÒ"D;BÓgrDϼ`¿Dö3/EZ<Ÿ½º­L‡^¢¶f>?†´ÑûŽÐôÑõg¬—g_.Òâ­Ùó;ŽÖŸ£¶f>?´ÑÛŽÐôÑõ_¬×f_ÿ-R}öL¸ËÿR´ÇkZ„ÐG(ƒx"]ÅzYöõ×"-Κ=½-ZU´ÇkZ„ÐG(ƒx"½çë5¹˜ÿ[¤ÅñÙ«iÑUgŠöxM‹âe0m†Î?`½$ûüCñçÓ,šÔš|®´ÑãŽP##zŸÖrõú'-Ž×¿iÑ•>ŠöxM‹âe¢á‰tüùâìãÿ,5~ÍÞ|„BãE¯ùI‹šº#ÀØx"½óµ¹Û÷ÏRã}ôr[…îÄP´Ç#-FhêŽ
+uØ–>Ïa¢Ì`ý?c%–yXV[>ÕªkýWÑ+^Ó¢b„8ÂÒgÊLRýl–yXók¸þ´*éíñšV}¤~¹~~ Pf²êG³ÌÙ_Ãõ§ÕHh×´Ú#õàúñ@™ÁùKüì¡Xæá̯áÞôÖùKCÇ埈M'45ÄÆ`Êößág5ÅRýYâ|÷œXkÿ¡=^ӏÔ
+aB`F¸6Õ¯f™‡1¿†¥?­v‘>Џ´a©gׯÒ誟̲~~
+ןÜ@úúí\©‡GêÅõÓ‘5Go9è=üü«÷¾¹kîÆЏ´a©B"hŽH<ü•æë?ó£ê«7ÓjkýGÑ+^ÓJgꎰô	©¦í_­fY+_ÃZÏùý©ý«öí¬}DZÔº!d¥ é3¢jŽ >™¥úò5\ÆÒÇ÷÷ÝýšV9S_)húŒÀ7ÃïnôÌRýd¥õÓ¬õÓ†¾Vÿ(6ý8‡†x
+Ê`B°ÿ¢cp³ý}î8nÁ{ïi­ý†öÝšíÐÐOA„Àˆ¼áüuGÝìüuŸ;›ž†µÎ_ÚOWkZtB[C<e0!¸i¶cTÓ«fg1KËeú·Õ×]³†Îûèš–º§
+š>#‚ùמšYZÃgþÛì©X}͝*Úã--š]½®
+aéSX¡êø}–Žþ¢ë´Ìör憍^ÄZ?Ñbh×´¡!ŽP#R4>˜e-ì,-VzÄZcGC{¼¦E
+q„2¡y†ò›YZÃgŽÛì!¬5whh×´¡!ŽP!0CÞ±ÿ§Çl–êÏÏÞzÞÖXûíñH‹šº#ÀØ(³ØÿÝãe–µp37ìëMk¬ý߆öx¤ÅMÝ`l„`ÿsÇ~éq­n–o=nk¬ýÏŠ^ñš!²š>!àêïävì—^ÿ³|
+¯½3Žê?Ð+^Ó"BBÓgDÄ¡ÿÁüœýpÞ­fnXï!ÖÚÿjh×´¡!ŽP!à‘éïuÌOÙÍöbæ†×ži­µC{¼¦E
+q„2‰õÿŽù¡aëÿ}Î8
+[½‡µÖî
+íñš!4ÄÊ`Êúÿ†öjxÿg‰óÞû¶"Ý5oh—´a©Œ
+)㏆õâaã%7lô'wíñ’#,uC€±#"žHÚŸ&ë•b©¾”8o=·ÎßMñšV
+{êaé"#G0ÿÝd|.–Ö°ÙâÙìõ´âµæ®¦xM+—=õ…°ôÁþ§Ö/³T¶xÃko¼ãÖþ§¦íÇkZ…°ô	!®ÈýDÒþÂQKKx›¹a­§X«ï4ôê]‘÷Ð}CƒxfÜ¿„Aôû—ú5ßØnO‚µî_2´ÇkZa!†0!"Jæ_[­fi	ï37ìé§E÷ßÚgW‘!,uOŒ
+[Ê›tTbY
+›¹aO?­°î)7´ÅkZ„°Ô=0ì™%¾ØóY	›ïß¼ôÎ÷_w
++Úã-­…А•‚¦Ï{fÄÛó™þ|ÿî¥w¾ÿê»}­Þ
+iq™7„¥OYšO$ñR1ÅÒÖfn$+=ÓZûÿ}yï‚´j=S÷”Áˆ„'
+ˆ¿ÌRýh_ëÓ¬uþØÐoi-„…x
+Ê 4†>³øŸ-³´„5ûZŸf-ßÑЯibô¡FD<êŸÖ ž¼„Knxéýˆ8ˁXE{<Òb„¦î0!®xŒÚÿˆ£.––0É
+ë=¦©ÿzÅkZÜCÕ¡é3âÂ!ÿ¥cK¿ð˜¹a¹7­¸öî(zÅkZ„è׎Ðô	!MñýD¨ÿÒP‹¥úiæ†Õ^±Öý†öxM‹âeB²&F-ÿ⟉¥%¬ÍÜ°Ò+•]E{¼¦E
+q„22ƒûßêf©þ,qv{¬uÿ›¡=^ÓãLÝÆ ZÄÿ«Â?Šæµ(¹aÞÓ´ÒòíñH‹–º!”Á™‘‰	í?&*ÅÒ/|·øÑ[ïi¥Õv+zÅkZÔC Ä–>#$‡ÖÿkfY	›¹eÞë´ÒZ»WôŠ×´BCaé"á‰pÿkmÉ,+a37¬öŠµî5´ÇkZa!†0!¢>ÊüƒdþOGŠ^z¦µ|C»w£i‘‡¤!ž‚2<ÃþÛZ†Yª?sÜvÏŠE{g
+mñš!,uOF ‡N8ÿRÑ?';ÿRgŸìôŠXy1´ÅkZ„°Ô=0!3t1ãþ%,Ôˆ¥_¸ÎÜJöõn+¯û—íñ–ÖBhÈJAÓ§4Ð"døå%'ÿÂ}æ–±ÅZ¾ƒ¡=^ÓªÔ¡F Gpÿk•…±Tÿš¹eµW¬uÿ«¡=^Ó"„†8B„¬‰¹©þe–~á8sËØÓ*éíñH‹šº#À`F$óÏؘ –}á™[ëëÝÜ5wlhGZŒÐÔ#dkÀÝá!^bÙž¹µ¾ÞGeè¯iå3õ…Ðô	Ypþ¸ÈB‘Xö…gnYík?6´ÇkZµ©ÂŒÀÁï¡–ÞÌÒ3·¬õký$ª¡=^ÓêýLÝÆ „ÍbÁýŸØ˜$–ê_–[ŸjÕuÿ§¡=iÂR7„2‘P"°ÿ³¢ï?©W°ÜúT‹öŽÚã‘!,uC(ƒðH+î_+˜AªvÿZ³ÆÙíibÕuÿš¢=ÞÒZ
+Y)hú„à`þ¡à{U›(}*Úì¬5w`h‹·´ÂB<e5¢âüMÑ/Xý§™[ɾ޴ÖÙC§½vÂB<ePŒÿK
+fiOE½‹ÕÖØÝЏ´¡©;FtåàûÇ`–æðԷ߇«­ß—QôŠ×´…Ðô	BÃø£`|ÐlüQ戣ÙèÖ;Úã5-Bhˆ#”AišcƒÿUd¢Z,Íá»Äµè¹7­å;:®ï#6!4ÄÊ æ,ößeÌO6ÛWæŒgË+÷>b_{çíñH‹–º!”Á”ÈŽõŒö©_žÃw‹×lõB¬¾Ö.½â5­tÖGXú„¦èÿ;£¿ê¶ÿ6ß
+al¶{V¬¾öÎ*Úã-­…А•‚¦OÌPuø?ã¥nþOž3^ݼXËw1tôÒ…´zùÿJ;—]]z£Ï÷U¬Y`@húÄ	1NôÏ"F	 l	¡Ü>õªìoo¡¡5Xv»\ÝíÏíÃãrùGí¥Á96	±´ts	G/ˆüÝ1-i+ÕÒ™n]›Dj/
+ʱë i\÷ú×TQë_óšxšüõÛÖ®,½Ò­k“Е%aý›„Fh¯ÏÞúý1â{ê×CìÝ~I¯tëÚ$teIXÿ&Á©X÷9ðš˜ô<>Ê+j|å®Ø²]KéJ·®MÂWJÂ96‰ÓW8ÿ.ÁÜ<Í‘OíLÒ”®têÚ%R{J(LJÄÔÙŸ‚‘Qg›Í†_<­GÛáf’ÞÒ­kŸÚ—Dêß$†®hü98>uþÌŒϨÓc[cÇ”®tëZy%%2Ç&ÑTf:ÿ`œgÆü†(ñ<½@±uþAJgzêZy¥48Ç&ÁG‹+lÿÛKÆt‡qŒ#OÜd¬­;S:Ó­k“Hí¥A9vD#Ãü]•Gñwl„EÏÛع¥Wºumº²$¬“àRìh²¬˜Œù
+ù4g>=bËv5¥+ݺ6	_)	çØ$.•ˆì?;
+Æ”
+Q<MÖÄú²ÝLéJ—®M"µ§„sìœû_ël¯Fù_‹’ÂÓŒ|z¤­¶ÓÒ+ݺ–„¯”Dêß$†žYã¯~=SêÁ7vï¥Ø;¥t¥[×’È+)‘96	þ4qE÷çx…1¿áÄÓdnÆÖÞ‰”ÎôÔõþ¤½48Ǧƒ„$þéþãÊX¾!žf=ýWTá•×Ò•.]»„µ—„rìúE†üOË1"cù†xšQOiËÿ´¥Wºu?֐%aý›Ä¥'’ýS?FÆü†|šÌÍز]JéJ·®ç'í%á›ÄT™é€h9ªcL©íùr£ùݱ¹ŽˆNéJ—®M"µ§„sìê!¦ìå(‘1¿a˧ýîØ\¶»–^éÖµ$|¥$Rÿ&AB-Ç?Z¨bÌo8òi¿glÙ®¦t¦§®%‘WJƒsl:h€ÓÇ̘ßðÂÓ´|úˆkí,¥+]ºv	k/	åØ%ØǶ¿j¨Sjtñ4n=;×A›–^éÖµIèÊ’°þM‚D"®°ÿ;üyþWë/žÆ½—bëü¯”®tëZy%%2Ç&¡ùTù~ƒ*ÿ˜qEåÍÒCìZe—Ò•.]›DjO	çØ%8ˆ+üþ4P`ÌoØð4g>}Ä®µvhéJO]KÂW–ëß$åÑúŸ*bÌoˆ;æêbkí.¥3=u-‰¼RœcÓ¡Òû/ä¯xÔþ‹-níž`lÛ;‘Ò•.]»„µ—„rìì°Pé]þjóâsõŠ±»Ö®Rz¥[×ZÝò•”(ý›Ätž‡é÷›1¥6Ü1é…bÅ.JºÒ­kэ¼b‰Ê±I¨†Üì»ö2æ7ÄÝ{*öTßYÒÙ»Z×’(í¥A9v	Zä
+Ù?wùgiÿÜáñi¤õ²bËv9¥Ëº9u-ëf_Y¬ÓÁ¦
,	ëß%øE>\ÿî:˜1ßBzæý#öÖÚuIWºtíÖ^Êñ³ÄKÿ3•nÿ3ûëþå;æSÛvÿMb¢MÿQAÇJgl»ÿÝÖý¯cÌï_éÖµIäµýþŸ¯hü)GíŒeél½[cÇ”®tëÚ$|¥$œc—@Ñ\Íý/Œ±ªW«Þ“±­ÿµôê]¥kï¡ïO	çØú_6
+1³õïgÌ÷!]¿ÄúØ~ßïct±K¤öÒ ,‘~©þÏ#cn:¤³ö2ö®ºkéLO]K"¯”çØ%øDcèûç‡Â˜ï%>Žüz»Ö·kéLO]K"¯”çØ$ˆÆ¯éúωÑ5«þ?-¤«ö"6·º+éJO]cþ }i°þ]‚O85þÖÁ ŒùþñÆ3GÏŒkìœÒ5º–®M"µ—åØ%Ø\§Ç_ì(sý_ü¬ÑcÛøËÒ5þ²®}t5>$2Ç>Bã•Ëí?+*cÙ„ôjß#vmm·¤+=um£]Y¬—xxå¹ÜÃg,ëOÄΪß[k—%]éÒµI¤ö³¾ óG	ίûÔ÷ÏŽ‘1ÿ~ˆõü¾{×÷oéJ·®%‘WR"slDs×ãïû…óï-þSßcÛ÷géJ·®íëò•úþœc“`Sx½‡ç_-c.¿ÒwÍ¿"öέí¢ôJ·®MBW–„õo·ò<Ûü±š^ï¹Í?ï£ý0ÿÜÒ©ëCÂÚK‚9>$8C¾ú_óx±š߇½§9V¾ÓJºÒ­k“ð•’pŽM‚=äÝ4þ˜ìsù!vTù"¶Æ)]éÖµIøʱ~Á$NZßÝü‹æçFùÝ!]ô
+±¾ñ/IWzêÚè–®,
+Ö¿IpGÆÝ_Ýÿ|2æç?"venÄF_÷·t¦[×&‘ÚKƒrìì
+îaþp·Œùù£Æ¤ŒÍXºÒ¥k“HíÅ”c—`Ò=]ÿž™1¥¶+bY{Ûk—¤+ݺ–D^Y5tþ(AÑûÔú·…3æç?sõZ±µvÒ•n]K"¯¤Dæ(	y&ŠÅ/oEŒ íy/üt*:FF›RÔ©V³ÒSoæ–øJ?¾ð÷Ûýö_ßšÂþ÷ûï_ÿüË·üíýõ~ýòǐk_ÿИÜ~±@T¤w~ýòýÛßýêOhÿù—_ÿõ¿ÿÕ×µ:ÿþ—ÿøö/¿|ûÍ·–ÊáÇèn<Z‚ÁÉ戮}Á—ŽŒdðOòàǘ5ž+xE°18Ï`g0¥
+"Û`0Fð|"8|Žl<|Ç
+B:ߨ¢ç
+ânÛÄ-û|¿´}d¶ñ¬`\¥S·Ù泂¸ÊjçSÁ(¯‡&ü€T²|!œÎ^AdãáÌò
+ÆC²ÁÊï
+B€/CÊ
+BàVð© ~B¸	_„
+Æ·òÐŒ~Âlµ‚¡Œp!úò¾‚¡Œ.ç"x¯ ”ñ…`x[AÈž
+^+Y½P´D6½Ðu® n¡ºD6½Ð=Vp~½‡^(J½‚OõBñKV°GP/¿N¡A/¿C¯ê…žgß/mý™8³‚íKAì+ˆ[è…ÞùÔ½ç
+ânz¡(ƒ·é-âÅߦG·}[_A>$ÌÍ_Ž„¼–À½‚ÏR¶nяlõŒ'뽞·z¡>ëû*Q:ýª2ëw•d¡÷© ëqâ«Ò~¦øÝÞ
+C¹îñ—ÇÈúð=Îõ® dõ8W<ú¨*÷Ž;+â;ž¬ž)¬´ïԍ㛯`Ì–_À;õz†Ý8P^ùø‘½S7Žòz§n%Žóiø™"›n?ê{ênQCÞ³å7ÿžjVð»#›Š÷t‚«j5P’畍Í{ªíCAO¶Qï¥ö,¾·÷r{Ïpéqÿ÷Ò-âeÞkfãø^ºÞí’ÞŽlÒµéUÏÐðêпníQûÜÄã»Èv=*ší_¬Úê#r¿j a[õªýEñ>îPBV-í@
+)>5~(ÞXãѐMÊP¨lðpÔà×ËVæ^¢ö±åâé/&d÷²Ýá™V/¯sRW‹›Z†°”ÀÿqHK|Ò¦´WMÛÆä¦ùà—-—Á¿g8ÿFødøb˜zèÖóhÒ3æ×s5†ùO¼~„ùOcXy†™îÑÚÁï‹®Â"̼7Ž=øûb˜yc˜…°òâhŸc*/Ž99¦òv†ùÌwcøfø@Y±’˜åDoÍ÷½à"ú`-Ž¹6ÊŠu—®;šÜÚÁ)B„/ÉãH)m7ƒ³
+Ýá{Žù£ÝFOÌ\íÂyÂdÜî”ã9ïtmÏÿ¤›áx¯7]þÆû>é~wÊÝ­êúY»¥e¹ÙEìDßjw­Qïtå¤Ó‰oÜ.Eç}ôtïÉßÔ®6'úD»½œts$”ój=ÝAFý¹Ó5ã<å
+Rõ0º»,œ¨Öv8цەߌŠ›nõ&>E»¸ƒ%lº››hìú-¾#Ý°qˆo—hªížŒã\»
+‹oöH·]ñt¡ÅY¼ÝY‘	صÔDQÚ͇kv¹Ä#&íþˆÇÝØÑÀoj·@r-=rÉ*w9uÞ®käªNndÆ%·1?СÈðxàMW'ñêwºÓ†tbSMºÿÐØmˆÝTŒÑ¯tÁ-ºvß00ö+…ŸÍn
+Fã¦r0ðvÿñ²·ÞÇ¥;·ÁG“vç–ôŽñ¿·‡wŒE½U»ãóð¶éŽöß[˜ã5fn'îp_ê­½m…·ÙÆôª¶¼v¸8óöÓ(â+·‚v¸>ò¶Ì˜W¹E²cüã튀½¹u¦jÞÆ#œÜRÏw¹½­<³Ú%†ä¶¯¨ŽwnÁŠjÚs;TÇœÑ[“àÑ1·	utóÞ²ŸDËí3½a»”¶²Ä—Òr[I|f#·xÄçwåv‹˜«¹õ¡£ÞzBÇÏà-CL›çwUm*ß1•±Ùz4
+WšwüŽ6çîšÛ´ºc(o3çhbÞ49î˜Øü7Â=Mq;àœÍb;ªŽMTu]梒—é&›-›QvL-lÒØ1²y!›3›úñ9mvïÜi×1”·9Z¼o™†u»m¦oÒi2ÕQ”6_ê
+,ÿ.ú´h–¾þ-òý·j¸'aæÌ
+hîšô˜ôS<RAb¾ž{2hª¥ z	Ìõ5Pf°™
+£¾$c¢v"c¢v"6fR&c—(™hË\ôƒï$c×FÆ8«5#µ3»@’Œ½ç"c$Z¦:˜Í™ŒaRd“Œ¡çM2vŽVdŒ¤ÈdìÄï•dõ6Éf”EÆÚ"c “IÆæFÆPÎIÆpl’1ÌâMÆé–ʈ’±|Ÿ_e>@¥LÆ
+ª×’ŒÅLáM2µ÷N2ü"cÝ€ÉXÃ`Êd¬¡k5k7˜Œ5ÄÍúÜ04ùrIÆÚsk<8Ld¬ñH'‘±F‚ª‘|»Ÿ"cm²ÈX»AŠDÆpŽe’±ÆvUd,²Í$cTm2Ö¸Ò!2ÖXgDÆfÖ&c„Yd¬±=cјŒEñ]IÆÛ@‘±(ú7Ëk¤â¢düÙLÉ)¥èDãj‚Fµô^CÊÆ6Pƒ¸†	†)«—)YT»™”¬aFoJUöMJá¢d¬Ö¦dnIÉÚ<Š’ñ“0%k0î4%ãgcJá3)Y<
+FÉ<i$ô|l}‹qUpšc’qU°i’qUð°y#×”y£W/›7
+wep½Æ
+öB¥0ˆ³ÁpWÛ4À²
+^…UA¾28‹°žc»máÒk›7Ò+¸À,í2xÚè‘ýOGáÚè*x¹ï
+>¶Š;3Ï;Ëà,´Œ–ÁV”w„-Ÿo¿øösg±_À5³ßÞ*ÎfÜîÂÀ@nœE„aGg"Ü>Þ‚Ã0g3ˆËà°]%Í6’’i½Ï
+^‰ŒQŒQûŒñÑ?$ÍžI"cc¼´«äÑó¦ÇhhÜ·<D»º1xn‹cìazŒù˜é1Î7=Õ3=~δ«˜Þ˜?4ÝԍQÏÖ°|ozŒ¹é1fH¦ÇêŽè1NM6=#0=ÆÂô#MÓãXU,<Ðô~×L1ˆ0=d0=ÆÁ´¦Çš?°•TgX豜¨™šcðfz€hzŒÕmÓã»ì*#Ø“*šòÃôxÑô¶C¦ÇX™Ã
+Ð]-fª¦Ç°_0=|4='1=ÆTØô#6Óã{–]%¦Ã¦Ç7lgÕ´‰RÚƉÄõ°máUôø¦}ãa›¨£è1\Ž%=¾IbÕbˆjªE ±1=¦m•é±h§í¦ŽE/ÒZ}³œ¹›_$·ú/.ÓcR Óãk³«¤MŽé±¨é0A½Š_÷¢Çí?§iê[ôøº=&eJ»Êk,»JÒWÛUÒ~Òv•ç¢Ç©xÚU.z|cÙUžmÙUÒöÒv•ó]v•sÑã‹äY5ì¢}¬éñÜèñ\v•´_Jz<7<7<7Lʪöž÷2
+æ3˜óÙLƒùü“B›ó}MƒY¦Á×ù
+fš³l[–ÿU4˜¿‹i0&Iƒ¯ÍNò"ݽzÕÓ`RtÓ`Ö%Ó`ÚÇšc”4˜uÕ4˜õÙ43è¤Á7mJ5œ¸IwÓVp
+技ið=¯¢Á´!ôh™+¦Á¤[¦Á7©²í„AMƒo’g•ÕM{H·Ì
+æáà¦Á\=1
+æ1ñ¦Á\…1
+æJí$ŸÍN’«?¶“¤}—í$Ñk¥$úÀ´“Dšv’èCÓN½VÚI¢÷H;IÒNã°´“D»˜v’¤Ó¢Á4*7
+ž°Í0
+žøìMƒçº=¼
+ßàX†îe'I›I¯y¿ËN²‘úÊN²ÑFQv’°E);IÔù´“D]M;IÚ:ÚN¿QÙIŽe'‰63í$DZì$ñÌi'‰g¶$¶Z¤d§íå[{JÊN²-;ÉÑ—ä
+4j,‘6“m)5TEóa<Ϋh0÷n˜s¯i0÷5˜ã´†¤Á+¦Á?¡i0í?Mƒ~~ÓàAZ;½û\Iƒö¥™ÇmZÒà¸ýLÌ•YÓ`T‘4˜«±¦ÁñzOÒà(i<`shLb™4ýZÒ`»o…¼i0f²IƒA.’ƒ>%
+ÆÜ+ið¿KÒ`Ø—&
+Æø!i0ÆIƒï±l&åBX4ÍkÒà뾋ËÍ­	3ÐÚµ-,Ǭ¢Ár‹ª{Éa©h°Ü…ŠËu§žAn4m×z”»K»—ôjì½l&åvQzäÑötG¨ûÊQ ìôä¦Oö‡r '›I¹¯“=¡\ÉÉfRnÝd3)kZu•ó3­–ÊõØðjo+›I¹äò*0Ýc9/WÉfRn›´ú,J^¦;#ÛIÒѐí$éæÇv’t¹£U¹¿±ž§°ÝÂä{½e')ç)Z¹ë’ÓåSØ.=d')g²
+«Ù:Êí„ì$åB¿œ3¼þ—¤Ü(¯\¨nŸ²™þñlTÅ¿.Œî(v¢H/Lêþüï!ü›oÿ›Ú8endstream
+endobj
+6 0 obj
+34004
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 612 792]
+/Rotate 90/Parent 3 0 R
+/Resources<</ProcSet[/PDF /Text]
+/Font 8 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+>>
+endobj
+8 0 obj
+<</R7
+7 0 R>>
+endobj
+7 0 obj
+<</BaseFont/Helvetica/Type/Font
+/Subtype/Type1>>
+endobj
+2 0 obj
+<</Producer(ESP Ghostscript 815.02)
+/CreationDate(Tue Jun 29 16:34:12 2010)
+/ModDate(D:20100629163422)
+/Title(wfc0.eps)
+/Subject(gnuplot plot)
+/Creator(gnuplot 4.2 patchlevel 2 )
+/Author(Paolo Giannozzi)>>endobj
+xref
+0 9
+0000000000 65535 f 
+0000034311 00000 n 
+0000034452 00000 n 
+0000034252 00000 n 
+0000034110 00000 n 
+0000000015 00000 n 
+0000034089 00000 n 
+0000034388 00000 n 
+0000034359 00000 n 
+trailer
+<< /Size 9 /Root 1 0 R /Info 2 0 R
+/ID [(²¤RpžLà÷J¦w¡À­+)(²¤RpžLà÷J¦w¡À­+)]
+>>
+startxref
+34672
+%%EOF

Copied: trunk/espresso/atomic/Doc/pseudo-gen-fig3.pdf (from rev 8077, trunk/espresso/atomic_doc/pseudo-gen-fig3.pdf)
===================================================================
--- trunk/espresso/atomic/Doc/pseudo-gen-fig3.pdf	                        (rev 0)
+++ trunk/espresso/atomic/Doc/pseudo-gen-fig3.pdf	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,227 @@
+%PDF-1.2
+%Ç쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xœ¤½Möº®%6ß¿¢fºb[–2dœÞgÖȨoÒHpýùû¹Ö"YUçàޝƼeJ‹­Ç–åe‰ü/×çýqÙ?þý_Ü×ÇÿûÇýñþáåÿîùc´y}¬{||ñð]ÿŒÃwôWÅo_ý”ÿIÅÿúÿø/fÌþñÏøúøŸþöÇÿðïޏýñ·ÿãàîk펶?fû¼öhûúã¿û·ÏõßÿíÿúãþÛÿëý“ãÐ÷C6Žc5þ¯m³¿ûs~oõÙêý>jÕѪªU?þË­>×çó£Õ<×6N3h‡Þª²UÿÕVϯó¹>æ:­î­æ©>ûXC£8ôFýâø/7zÝŸÝ»ßÞèGžéÓ¶.)¢Q;T£~üW}úó½É<ÏûݺpèMú!›Äñ_mò^.¤±/tîGùIïçÒ…„C´j‡jՏÿr«OÃ…TZÍs—®#?ò6íˆMúá_mñ´µ¾7XîÒ:D<ûõîn¼7Ëþõ
+Ž~¼|?û>¿Š_³ý{s÷¯Úóc4Èbk‘¥­É{¼Ÿût“7yN÷{£OßKú1e±5ÊÒ¿ÖèÓÇé]4ù½ÁÖú¥ý
+²Ødé_k°=óóÑY>?ϲßëV£~ŒFYl²ô¯5Úïþy³Éï
+ŽëijÐÑ ‹­A–þÅwÿ:ËûçYŽ5{4jÇlÅÞ(JÿZ£ãM~op¾×Tƒ~ŒYl
+²ô¯58çó¹t–×ϳÔ#ÚõãïCÁi”¥ñÎWÜ&e`×-ßßq†§·=ÿõÿ–ßnci?ÇBþ›þ§ûúü§þOÿñß|ü?÷ÿX®Ÿ¦pŠòÞg侧Ý~ØÏŒâ<OÖnzÊøáqÇKÏS®0>Ö8<Ï„õÄá&à¸xO®Ý÷ÇWNìëúØ«áðŒ>×uáø9Ç÷‹ãvŽ[Ïãq㸟ãIÌ8Ç‹˜ùqeŸqî¾W·ã3hÝãÁñ>ǘÓ×Ì}ü±ž{çqƒû÷ñçðÿ>þ<“˜ãϳˆ9þ´‹˜ãC{pŽÇ­»5øL×àÿ©¾Û{åñæ9þô‹˜ãCpŽç&¿{ƒÿÏñ¡øÿúKÌñ¡/bŽã"Æïçø.‚ÝN»cÀÿvÛ
+Ìéîç<Þp|ν7øšyz‡ÿ>e˜Ä;ݡ͆	NÎñ±3|¢tŽáCÖ9>¾Ṉ3&1ÇÎXÀœn}†[çøØ™>nãcgúÀuŽ?³sÎkN`νùÌ̹…ž×Ç®s|t_»ÎñÑ}}ì:ÇG÷Àœ.{Þ	L3Ý́>ëÂ9ž{çY7ü?÷˳ü?÷ȳ0ç²>Ã0çRxÖ"æœï¾pŽÇu`ìø\Û~Súñik`Îõì”~s.©Óa8Çó3øIûñ<Ç
+þµ£̹öÎÀ¼†_ÀœËºÝÎñ\
+í~àÿé¾s)ÁÿÓd»1Çæýs®“v/`Î¥|†Oœã¶)™]͆ûöøØåÍ´ÇÇÀsl˜˜Û0˜s¹œËvâئ†>v·Í
+ϱa0çV9C50ç²hmsºàÀýï3TµîcW³Û²uÚ9ýßú
+Â	ÇÏÖJÂií$œpü’V¼ƒp2~F„Ž2‹-'ã)E8Ù»ƒ'obfN6gá„cŒgöøádWYNו„“‹p2òR„“‘—"œü˜„“‘—"œŒ¼ádä¥'?&ádD¦'#/E8y)ÂÉÈKNW!œî+	'#9D8É!ÂɏI8Ý-	'#?D83'#BD8ù1	§ûMÂÉN÷NÂÉÈNç2
+ÂɏI8‰"Âéü´A8¡"Âé)„ÓS§sªA8ù1	'#]D8=;	'#`D8µ;	'#cD8q„„“œ$œœà$áä\
+	''8I89ÁI‰Nj˜-ÂÉÉNNNv’pr²“„““$œœì$áäd'	§s<E89ñIÂɉONN|’prâ“„“Ÿ$œœ"áäÄ'	''>I89ñIÂɉONN|’pñ¹I–Û÷¿M²ÜHÐMÒÝHÐM²ÜHÐM²ÜI&’åN2‘,7Rä"Y~š'áä&H8=û½D89!JÂÉIPN縋prB”„“¢$œœ%áä„(	''DI8ã œœ%áäŸýI899JÂé¿"œœ%áää(	''GI899JÂé±Û›„Ó9"œœ(%átŽ—''JE8ÙãM„“¥"œ¬‹E8Q*ÂÉ^™E8ÙTM„“‘¦"œŒ4ád\Š'#ME8i*ÂÉ«"œ.#rH8]…p2U„“¨"œŒ„ádª'{Wátµ$œ.#«H8]çòád—Ž'#SE8™*Âɦ "œl¸ád¼§Ë¾“pºÆ„“«"œŒXádô‚'›ÖŠp2bU„“qM"œ®™„“M5D8Ù%.ÂÉHVNF²Šp²¡\„Óe	§Ë	*’åçúád¼‚'#\E8á*ÂÉ	"œ.'¨6IÖ+§û\W"œÎ\)'#_E8ÙãD„“†§Û!Nç½D8µÛ‰¥A"vŠp:·î%ÂɉXNçxŠpjFːpjö:@©Y7‘pjNbpò!€„““²$œÎÙùÒý>§Ñ'ÈòÛ~‹	²Ü¨ž>A–Û#ð¼^ÂÿÓeýYnmAºÔ_å÷¹Dú²ü±þ|A–Ûps¦õ GÏ-ÑÈrûÙúéþX_-åÏcå Ëíçìd¹MûYn‹|úYþøW~îFÜö
+²ü1‚
+TÚ9žâÒÎpÖÄ¥5{<“Kk6Ý$—æ$.¹4'qÉ¥ã%.­ÙåB.í\-]\Z³K‡\Ú
+oqiNè’K;Ãâ—Öšñ:àÒιĥ5çóÀ¥ár‰K;Ãå—v†ËK\Zë-¸´3tvqi>t’KkFKk΁Kk6 —ÖìU‹\ÚF·¸´3ŒNqigToâÒšñ7äÒÎÐy‰KsÒ—\Ú:oqiçêâÒšñäÒšÑ\äÒš½¯“Kkö˜'—ÖìÝ‘\Z3
+‹\Z³w*riÍæ®äÒšÍCÈ¥5{®‘Kóa‹\šOäÒº½ÞKë6í#—Öí•™\ZwŽ\Zwn\Z7Ê…\Z7Ú„\Zcó±ë\â—¸´aÏ2ri~YKú”ÝciÈùa¾Å ÙË	¤Û®cH·}á!t.ÅKÒm'	¤Û¾@:ï3MÒmc
+	¤3
+n"ÎûÆ%é¼WÜ"î×|
+²j縋Vó…Ф՜'­æü;iµs<E«ù¢hÒjÍÞjI«ã)ZíoÑjÎÅ“Vs.ž´Ú9ZíL¹‚V;ÇS´Ú9‹X—Õ¬ËH«ù´Œ´šóò¤Õš½rVs^ž´Ú9î¢ÕÚã{Ðȧߏhµæ4h5_PMZíǺ¬æTã¢_E>Ýú
+´Ú9ŽuY
+xp›’Vó…Ö¤Õœ¯'­æSFÒjÍØ&Òj¾èš´Z³µ¤Õš½‘Vköó“Vk6œ‘Vsîž´Úy:?¢Õš½>‘VkFV;ÓÐ.Z­5§Ò0vùî:ÐjÎã“V;ªA«5»ŒH«ù"mÒjÍèÒjíÌYD«Ñ5hµvæ¢ÕœÓ'­ÖŒV ­ÖœÂ­v¦³[´šOgI«5»ìH«µóÜ­ÖƹþI«5§Þ@«5Pl»l­&iµ3Ú7ÑjíÜë¢Õš
+£¤ÕÎÔöýo Õîëö½ÔëóZI«ýçÿûïn
+iæ-Úýµi€ënIÔ5rü¹¤kÒj?u窺sUÝ6«î.>ûÕ`Œù—3>’¨û8É.]ß
+ó
+Iš8˜á³­q¾Óçé¿Š}ÁÂÜA’&æ…|öMø-}žþ«Ø/Ì$iqt·Æß´?rÌñ˜!ÃB’&æ…î_—Þ¼}¶á_Ô0¤	y¡û×¥•÷¯?Nýæ’4'8RŸý›\ñÙûb‡I$M
+Ì‹ðÙÖw?ÅgÿUæEŸ»$Í
+Ì‹ðÙ¾çµâ³ÿ*Óã¨Ø¬@’žìGwkÌñ #Ç¿<ý"žì’ôd7/tÿºôæýë]ÎX<öd—¤'»y¡û×¥•÷/æSö…OvIz²›òÙƒ,\é3&TöEOvIz²›òÙƒ2<ÅgÿUì(žì’ôt6/ä³qhÅgïYûbŠ'¬$=a͍9èa䘃™}aÅV’ž°æ…î_—Þ¼1³yÙÏ>Eå÷Y<aÍ‹ðÙ¤ÚÏÞ³öOXIzšá³}—½ŠÏÞ³öÅOXIzšá³­xÒgÌNì1ž°’ô”4/4æx‹–cf'öyOIIzJšs<(ÆÈ13ûœŠ'$=éŽtëþuéÍû3ûL‰'$=éÌùìÒ*>{ÏÚ§=<é$éIg^„ÏݾyŸ½gísžt’ô¤;ÒŸ}¿EñÙ{Ǧ·xZIÒÓʼИã?zŽ9xÒÛc
+O+IzZ™s<PÈÈ1OúÝŸV’ô´:Ò­û×¥7ï_<é­O+IzZ™òÙ¥>ãimT?ž8’ôÄ1/ä³.¹ŠÏþûýŽ'Ž$=qŽ4å³:yŠÏÖ³¾Â
+!Œ„’4šº]zóþu÷}EF3IÔµ•G-|6iŸq†‹>OIÍÌ‹ðÙ‚"ÞésÃnú¼$ñN¹ÌøÌ€JOúŒÙV8¹î–¤Ñ̼x¤ëkžrÌÁˆl+¢0"I¢®õìÞÒµµP3ï_Œª¶‚
+#’$HæÅ”®IoÞ¿UûìU$Q×BIµðÙcQ¦Ïþ÷ZU$iT1/ÂgÛÃw§ÏÎ’³¼ˆh‰S}Êg8õ¤Ï~yú
+°/ÍÔ¸Ìu}ÕX“n³5a9æ`tàà1Sãú±?ñUùdá)ͼ1º
+ö³Ï¶¸Þ#ƒy>›TúÙy_‘溯$æEøìûÓgõ÷l_š1q=ÛŸø²m«˜©kÒ¼ÓgŒPœ<f=\ÿö'¾„/^éھɖcF¨	^³®—ÃÝm^téZ]Ï1£Ì7¿÷”D]	FvžÒÌû£ÌìôyIâë;@å³K+}žðÒ9z»C%é5/ä³K;}ÆH1§·»LuMòÙ¤÷.>»—¯3õš¼dê}ÀñbI×÷›æ˜ãï°¾‚w™$êÚ*Å¥1Ǥ·ç˜ƒ»ýu®þ\9—$Ýeæ…î_—fÞ¿¸Ûߟñ4~Çw™y!Ÿ]ZÅgœï|y§H¢®Ÿ¡|vi§Ï¸cßEŸ—$Ý)æ…|6iÝé3îØå\½žŠëºãN1/4æøÞÜ–cŽ¿ãø
+K\í’¨ë^èþõý»=ï_Üu«ñŠ’¨ë«8uÿº4óþõ©–¯àüŠ§Ów\íæ…|vi¥Ï˜ó¯¹xÅJ¢®…¾kòÙ¥>ãÎYKW¬$êÚNä!ŸMÚÁÕ[p8Coçêõ”Ø×Wì?d}QÚÁÕÛ:G;WßðÂõ¨¸b?H,QÚÁÕÛºG·É«Num¥ê¥û×¥àêm¿¤£|Æh½‡|¶Ùç~ä³K+}Æ|rOøŒùäž;®º~žú‚Ä¡…ºðyÁgŒ¸{͸ê>8Qü‚ÄI$tý
+ßé¸r$ñ4/_9¶†õ
+®¾á•Å—9ù/øH¢®­ö]ºm
+ë\½­OqtÃý;‡$êú*`Ý¿.WßðùË—¹î–¤+Ǽ ÏVúì«_2_½¸~øOì„åÅöEé¾ÒgŸoø
+c×}%Q×W%éZ0Ä;}ö+É—
+
+¹zH3¸ús±¢]ÿ&b†$ze-ÝòÙ¥ø&rîk?ß96-K¢W~†òÙ¥àêÏíôŸyöäêî}vé½ÒgÜ¿Ó¹zÞªÜ/cµvÇNrõÞàêÏÅ꺯sõçI¨µH)“\=¤7¸zˆëhçêmu¦$ÔZ„ŸI®Ò\ý¹à¼g_ÿ&b7½$è.ßå#Ÿ]Šo"¶6ÓÑ>ã‰ú’«oãö3¤Ï’«Çmá;‚¬cÎK®Þo¨ã}vi%W"ÀwY-îý—\}³
+×ÇŽ9.­äêñ2ï;Ž¼ö–D˾K‰÷¯K+¹ú‰§Èr®ž7÷+¹e‹œC®ÒJ®þu÷}GÓ—‡–]Û9·øM„R|ix¹õPV»¶$ÔÚ§E®žRrõX"ê;¦¬ÖêÜ?eº:š\=¤\ý諍ZŒÖk«öñÒs\ÚÉÕãÕÐwdY-fµ›\}ó{‹\=¤\=¾-ú®/Ü$¡v¸¼]ÚÁÕwp2¾ãëëHEvWms/à3¥ø&Òo7ã;ĬwÕ&Wß=<ù&WO)¸úŽé¡ï(;µ˜:r™Õ"„6|v©_ÁÕŸ§´ÿ¾Û¹úÞüAÅýh§¡µÉÕ»Ô¯àê;èFß±öeÑ>.I¨m¶ã\½Ký
+®þ<û'w¸Y¶2¿«¸ßÍjm–°ÉÕ»Ô¯àê˜ßwjñ}û㎮}Q迉PŠo"¶ÞÑS©u$¡ÖwÑ‘«§\=%ßàfÑG–¯³­f‰MZðšçÕÐ[yœ×ÄGUn³JÛÜ÷Ö„Ô‚ÖäÚ7ß<çY±–$Ôú&;ÒšZК7æ>¾ÙîÔ6Y¸õÎj=`écJAŸ·9´ë´æyYŸöÉjq‚ôRК7XJßÌwj1èqkŸÕN?Cú)hÍûõg…oþ³Ücí‘„Z|NZRZóÆâPß,øe1Xægl´ÚîÁªpIAêAkÞXÒç›­vmI¨}<¸	z.A¡è›¿ÒéãÛ6ÄõNú˜R®îÆ{¼o^ü:Òµ%¡Ö6Nv-ð†”+¼ñ>í›­vlIе@T]K!åd¬ÎõÍ‘§+w»²Ÿ=¶®·w-Aviäd0¾™ÒjýžæÖJÓ}=˜?ߺ4r	2¾ŠúæK«õ‹†[1­öŒÑ½k	²K#— ?>ZúfM¯m’hÙ½ Ïr©w£ÏXêýÐg-õ~ÜK-õ†”K½›w¢oõÚG-Û¦Q-A†”K9Ü,Aæp3´Ù˜¡%È.Í\‚ÜüÆöͦ^{KB­o\Õd—f.AÆšJßœjµèõ©%Èíu/øùÖ¥™Kû],õÆ À­­¦»ÝùìR.õîºXêÝV“„Zp6µÔR.õÆmá›e­„©%ÈvCõ©%È.½¹¹ãJšX‚Ü}hâV[÷ÊzVK]zs	r÷y“oÆ…eIôÊ,i	²Ko.A>?õÍ»nyI’Wæï_—Þ\‚<|fè›}Ýò#‰^ùaùìR.õÆÄÓ7yœ"I¨½lã°–zCÊ¥ÞcÀg,AÆû4·»W楖 »´r	2ù/– ó‘ÿj	²?ä_-Aviåd¬ÇôÍÊ_ÑsKK‡mµÙ¥•K‡¾¾¹Ù½z$ñŒ¬w´Ù¥•Kž)K½1qk´Ÿ‘¡µÔR.õžt±Ô{à‰º´Ô{øÆj-õ†”K½çóÅdöúÒä±üå³o¡Î%ÈxöÍÙîÕ%‰gd=«%È.í\‚<q†ûâmI<# ¨%È.í\‚Œ7hßüígôJ¢î¹s–– »´s	òÄÕ¿±Ô›¿ØÖRoÏ²µÔR.õžè¡3’ÄÞ° †Zê
+)—zO\“K'®É­%È–¼ o-A6i\¹y¾@c	òÄSbk	²%8àüòçžÔµ
+ßìþ¥_›[ßÿD„¾µÙ¤qåd{Låø`HŒlŽ
+˜}k	²IãÊ%È`|3½ë¾’¨k^j©7¤\ê=}¬óÍ÷~FM{Ò½Ï.åRo|›õÍúèÏH©â½a›÷µÙ¥;— ƒ©ðÍýÞ]u­w´Ù¥;— ¿þ¤÷`
+ö«h©·K-—z¿¯–zc=CWü‰àl£i©7¤\êýâjhX‚ŒÉC]ü‰„ £i	2¤\‚Œ©‡ÃÀ/(‰¿`3/8æ¸Ôs	2Væ{ðü‚’¨k\µùEš£¼ýÆö`®»$ñW°_TK]ê¹ï¡œÃ…GuíÕRo—z.õÆêæáºCu=
+b¡‰®Œ
+‚×wþ„;Eu=`”î_‹ì}ed¬ô`Q¸S$Q×ÿ…ÏžÖ/}ö;ÖƒKáN‘DÝ}¤¸âRF\Á7Fõ¥§CSùë¬ä³KuûÕ<x•_u·$Ýeæ…Æ—2R6U{°+×mŸ‘’wÙ‘,Ä¥;ƒ…`c´ÇrÝ!Iw™y¡ûwz¸¬ÜæáÁ´¾ô„ah-×µÞ‰ ,&Ý%
+‹ßí|w™$^±·y!Ÿ]*‘Xün÷`]¸Ë$Q·™òÙ¥ÅgùÜw™$êºs\*áB.ôÃ…ô!‰ºÖ;âê]zJ¸$zð0×}%é5/tÿšô”p!>üx°1×Ý’t‡šòÙ¤§„eñŸÚƒ“ù{KÒj^Èg—JX<˜Ù—žlm†;Ô¼Ï.•°,þxð³/=Ù
+
+w¨y¡1Ç¥.äA_1\Èx%Q×zG\½K­„ñ‘ƒ«á•Ä«ÝzG\½K­„ÁHÑ–ÅTÍ溞XS>›ÔJXŸzð¶/=ÊÍuÝ‹ài¶–ÅÅìíKOE†~s]øö„Ïþ-}öaσÃ}é©ÈPq®k½#®Þ¥^Â…4ôÃ…Ì-‰W» ‹àD–…¡„ñÁȃÏá•D]ëbR/áB0Êt†eñ'*C×áî6/´¥Í¤^²`”éËòvIº»Í‹ðÙ¤–£LgX¢24îî#EX—jXœ!Ã…øD„¡ôpw›âÄ2S”p!e:Ã…ø ÏÐ{¸»Ími3i”p!eÃ…ø
+ÆP}¸»ÍmI5i”p!e†Â²tIº»Í‹ðÙÂø•°,e†Â²LIº»Í‹ðÙ¤–ÅÏp(,Ë+‰ºH0²¸Tòà.dmI¼S<ÏG„±P‚%\ÈÀ*\È-‰º´0Ã…i–p!^áÁqwK¢®{!N<Íl	qâWÃTX–!‰ºž¸6|ö´´?BœxpDÜÝ’¨»Í‹âdΖ#ÔTX–%I#ƒyQBœÌY²`„š
+rIÒÈp¤bak¸œ¡Â…<’42˜.ÄB9þâÁ¿âIþÖp!Ç‹.d¾5\ˆ_
+ïCŸ§$êZÉËba#KXŒP¯Â²,I¼Ú-_K„eq©„eñÞƒM~Å“ü°,Ýz'²¸T²`„z.ä¾%id8R†±tÁ5\ΐáBî&I#ƒyáB<¼e	âg¸ØÏ>a(LŒæEølgJ?c„ZËâƒ>Cgbd0/ÂgK_\²`„ZËâ7CmúbÉ‘#,‹K%,F¨Åp!~2ÍéºÖ;.Ä¥.dá.³€áB†çÑј3<KNŽ9¡Ã…`°"\ˆ½!¬2<üg	âg¸–³€aY†%†Ž°,&í–#ÔfXÌv„e™ž×'B$XÑ–#ÔfXÌv„e± ®;²¸T²`„Ú‚YÀŽp!Óz'Â…¸TÂ…`„Ú¯înIÔµÞ‰p!ÓÝ昃j3\f;Â…ØÛÅŽp!:ôÊ%Èxéòà©_š0”*Fó"|¶pª¹Ôa<Øê—f½Š‘Á¼ˆ	–
+;—z#¬ƒgýÒ,€¡Z12)²¸ôŸ§£.Ä»…¡]]׽ИãR.AFhþú¥Y
+Ö}ÿ°42-$‘L …` îò}¹\ød–߬ÐÝ㧍ö
+Â+³$xgj$b1¨wý¾]®<þý
+!½~ÚÈàß®QÃÓFðýÐ(|Ó¨AÀG^% FAàË{
+ÞQxg”‚¡’
+N…fIðÓÔHÄbÐñŽ0¯5<8K‚§¦F"ˆGp„{­aÂYߨ±÷O,5\8mÄ÷hÄb0òŽÐ±5l8JA‚d©a£ðÔ´!„l$b)°y°Õ~%×0â,B‰Xp^Xk—oÍ!¤‘•DPqhÔ°â´ß Q‹ÁÒók_É5¼8JA‚üj
+¿Noÿn£•sÁÙËŽ°Ì5ü9JA‚Àª®á™kt–!D¨$Xwjޝ%BH#øŽ^‚¢ûOø-,:JA‚X“ççâWa
+Ž’@P£ ðÂU‚¤#lt
+“Ž’@P£ d#XyÚ(¼<m!‰@*¦4!¨kØt–!D`@	žŽPÔ5|:Kòw?*‰¯"ШaÔi£?ßl–º•`êþjü-œ:JA‚À{a	ªŽÐØ5¬:JA‚ÀF±\!²kxu”‚¡’`ói£„Yg‰ÒHÖP”`ë>•ÿn%OœËþÀêÄtݧß®£$Ô(&}ÊàëH	Uï£$Ô(Ù¶Ÿ6JvÚB6ÁRŒo®5;JA‚`*©ÊŽ7Ï–%BH£¬æyþq.~Õðì,yâ\ú„Jâ«‹k|ÓN½WÁS¬áÉK¸v¼GÁTS´aÊKØv¼GÁ”S¼Aykøv¼¡’øZ@%Œ;K„FYýÿòüã+öírî¥PÉç²~ °ºµugøô«œËó
+A‚
+¸ƒGxÎÁãgœËøÀÚ¥ž!ãsOKA‚O¹g at 6bOm”]ßœAâÜ9ÃÄGIì- FÙ]°pþ,ž!ìs¯†Jb/5ÊnŽÅó×¹ Pt†WI ¨QX%]‚Ç#~†
+¤w¡WC%±we÷‰(½Ò	d8ú(‰½"Ô(„WPz®œ+aéU’hT#+8½Rdxz•$Aú%%S,m‚6
+	N¬ž+ùJ¸ú(	5
+ââùǹø¯?êï2¿#¨Qö¬àõ\XÂ×GI ¨Q—® öJ»0KfY”$ä)
+f¯ô³d™EI" Q>­ ö\ŸPÂÚ«$Ш$b™‘z©fÙóÀ’LN»~"EAî¹Ö¡„¹’@P£ 
+~FJZŠŸ%+-KA‚@@íéi1~K‚Z”$°ò3òÔ2è|Ù{‚’D0}AÜð4Öbü–½(I4ÞŸ»'"¾ÒU¼å›KAº‹¾Gz`Á/{RXj’ϼñM3Ø·|ÓbI ¨Q8þÆ7-Ì`Wù¦…’D@£"v?¾iaö¹Ê7-†é4*á÷ßø¦Åàüå›JÁ€ýu·ڍoZ˜9®òM‹% FÝuñàìâ\¼×WùÖÈ’@P£ ˜ ¾i1Y@ù¦Å’@P£îv§ñM³¾]¾i¡$Ш$ÍYñM³¾]¾i¡$Ш¦'ˆoZ˜õíòM‹éŠ@žß´0ëÛå›KA‚xà{|kÄŒm—o,	5~àû\-[Âï+1I"\ãI}v|ÓBÐî«|ÓÂü+ä]H½°ã›±_å›æ_‰`˜üº[žÆ7-„î½Ê7-Ì¿ÑÚOž^ñMa-¯òM‹% FA4øß}h)aú£$Ô(„`ýè%W|õ‚Æ]¾z!ÔkíÇZ¤¶Ÿ%W|õ‚Æ]¾z!¼fïÇ’„¾Ÿ%W|õ‚Æ]w×ÀSñg˜ÑÆŸ%W|õ‚Æ]¾zu´«`þèþÎ_%ñՋ嫸GP¬:®aýU_#©Q¾F2ÑA‹sñ^/áýYrÇW/h<å«ÂÙF¬`®aþYrÇW/h<嫧G°¬d®áþYrÇW/h<å«ByGÐ$›«aÿYrÇW/h<å«ÂÛGðPX5ü¿JrÏÈþŽà›x&¸˜š`•sé5y2Zéq.Þc%
+Â5¾!0CÙ±9®²,B"ÚýÊŽ8ˆŠ}•½8`
+;Úú¥Qxîwî‰bI ¨Qøôß/%RƧÿ~g*e–‚û¥„Êp±ß™R™% FAà‰Üoí”B ¦~g
+k•Ä^*j”$×g§Ë7ò+Ü™bY%‘‚™%	ó
+‚yn%\f„'S.³$Ô(<	û­ÄËXNÑŸL½Ì’@P£ ð³÷;~Ü•Où]PjžbýQ"f¹êO¦bVI¤j¦FIÖŒ!2ßÈ·ñdJf•DÊfj”¤ÍˆÌ®ü%GÃnÇ’ÂD% FAàŽL&L€Yr™¨$Ô(<="£	S–œ&*	5
+Iw#³IÃ2’Û$J"u65揑?2œ´{ •Lݬ’HíL’Üyóüu.¸2×I”DŠgj”$Ï%r…Urž¨$Ô(ˆKÙX4"–|æ>QI ¨Qq•¥!(ZɁ¢’D@£".è(‘6w–\(QjFKeDi¸]r¢DI ¨Q>”DfK8ér¦|VI ¨QÌ-£ÄÏ72ÏdŽ•$$FÊ”Ò0Ô”\)*I4*âA)4¶ý”œ)*I4*£”2§4)(¹S¢$Ô(dP•†!¿äP‰’@P£ 0Â(“J{Ç?s©DI‹Ñòý¸;<U¢hla*9UTjGeVaJÊ’[E% FAptP†•Æ\5™cE% FA ]idZazË’k%J„F"xg+ã
+)ß’s%J„FI6§–2¯0Ufɽ¢’@P£ °¥-2°´‡9V2µ4KA‚À2ÁÈÄÒ|¾äbQI ¨QÈYó
+âQþ³Óä·F•!D<ÊC£sa–šü¦¥!¤‘|ÞŠL0
+A4K.–$ñà)¦Œ0üDRr°$Ðø†À¤Ì0­!¢tæ†aIA ÊtEàé¡1
+A\JŽ–"7W¢Ø+SLk<ÛüÖ¨’@P£ ^c¦®%gL”‚hëÊÃO5%wŒJA‚@’‹È Ã$¼%‡ŒJA‚Àô72É4LK.•‚éd”i6Srʨ$Ô(|îŠÌ2üÜUrËD‰Ò(ˆ‹g§sA¼ÿÌ1% FA n¶2Í4,ï,¹fT’hT3Ùè›’—œ3*I4*‚ù~ôMkàJÎÜ3*	5
+¢3ÿŽ¾5bykÉA£’@P£ b82Ñ0qÉE%BH£ §^i–·–œ4Qj®de¦i˜B—Ü4*I4*yE”¡†IKŽ•‚1üÐ7­‰X陫F% FA Ëhd¬áçž’³F% FE ë‰2×4,Í,¹k¢$Ô(§ "ƒMc¡Ìa% FA`DQ&›ö¢×3—JA‚˜Ì”£oZ¯Ó%§JAŠ¸yv^?(¹mT’hT[Ñ·Fl=,9nTyšæÍP¦›Æ¬™ë&J„FA°õMk‘_¬Tj²L(ó
+S:—Ü7*	5*O`eÀiXEPrà¨$ШˆÁ³ÃèÐñu¥äÂQ‰Ò¨úÁ/‰gІñ%Q%‰ «übÕñ(¹q¢DiüFð‹UÇc£äȉ’@P£ ‰N™rúƒÑ!så¨$Ô¨d¶PƜޘm&¾X©$Ô¨ž¿Xu,ó(¹sTjT2‰)ƒNG¸€’CG% FEÐ3%Ÿ<—L®!¤‘¼rFF¾r–œ:Qj$‚Ù`”Y§c%uÉ­£’@(L ÎT=Ä/VgºD|±RI" QxL;|K®•‚‰À.ôHBMè%¢ð¬ä\0©/™(X z³þÆ—©ÈFqƒ-ù(TjT"f++ō©AÉK%BH£ ë^Ù)îÆ|ÁŠF‰Ò(ˆÉ³ÇÈrwÄþÍ<Q"„4
+QÖ•­âZòU¨$Ô¨Ä+VÖ
+†¢(y+T’h|C Ç”Ñ·aÉ_¡’@PãVÉŠ2äCÉc%BH£ ˜%ƒ¬è„N%ŸE”‚¨èÊjq/žm°¢Q"„4
+‚™>ÈŠÞX¾Pò[¨$ШæÚ +z3Gæ¹PI ¨QŒa¯l7#Üg¾•‚6Êzqcµ|É{% FA0†Vú_Ì”‘+ýUòèl©±òl±:²``O̓Á!¤QÈÙ0ð…¨æÃ`I" Qìe­ôÇ-^ób°$Ô(ˆk¡‡´9ßk~–‚qÁªv`Ü~ä•‚^lø2Qóe¨$Ô(d‰ˆ¬`âkÞ–‚q3ïˆVú?ˆG^òg°$Ô(ˆ›¿¥VúãÖªy4XjTÄųӹ°•ÜÁ’D@£"ðôˆ¬s_ä•‚L#‘]¯š5¿†J„Æ*gÏ´Òùîkž
+–‚Ù]fÛÀ­Uóm°$Ô(„hˬø´Zón°$Ô¨䦈썙+rKÁl'adáÀëZÍá’@P£ põG6Ž†»£äãPI ¨QþºžY9º›5/KA‚Pj¥?>O×ü,	5
+¢)sG‡Ž«°äé`I ¨QxåÏl½ÁFîÀ`I šrpä¹ [DdíèÈvSòv¨Di$¯Í™½¯Í5‡J„FAðwÐJ0V5KŠÀS<²yt<åK>–$»2²ztfÓ(¿‹Î?~¹û'3ÇÈå5¿KŠÀÌ9²|`¸®y>T"„4Ñ;úP+ý±<½æûP‰ÒHDG6 Èú1Ç¤äý`I ¨Q 2ûh„šÿƒ% FA€áÍ, ƒù6rKA‚À6Ì‚¡·æaI ¨Q`‰3+^çk^•!D `fÁçûšD%BH#3øÈ6²æ	AI" ñ
+;(²…ä"È|!,)×ø†ÀYC°å¡ä
+aIA\û'#}dAÐó’?„%<,‘EaJ‘(	5
+âáù¿²Os¥¿JA‚h8­ôˆKŸyET’hTó²h¥ÿDÖ–Ì/¢’@P£ ó¤h«%ψJA‚¿ƒv`L§6K¾•‚+9³Ž`iJÉ;%BH#ƒ9A´Ò*cHŒt*B‰ˆÚYH&³dô*–‚ð™´SÉG¢’@P£ xDV’‰Ì™—D% FAäÁˆì$Y22?‰JA‚
+_"Jþ•‚1BYLž‰™ÇD% FE Ÿƒ²™0¬HÉg¢’D@£"ü±YMš£ä5‰’@P£ 0Â*»É3™¯%£W©$Ô(d0R–“á<Kž•$;[ÙNŽ†·’ùNT’hT2)ëÉ3‘O%óž¨$Шd	Rö“g27JFcI" Qé•åh •Œ*¦’@P£ 0:(ÊšºäC‰’@P£ ÅGYQŽ†·’yQT’hTDãùkü`“Œ^Å’D@£"0Â(K
+C·”<)*	5
+‚#Œ²¥
+´’QÅXjÄì<ÿ!h%£Š©Di”Ì*w%Wrßx—**	5þ›’¬ì)ÉJ/IVLïXç‚ùå9¹¹Kl1%·mdô*.¬²¼ƒD®ÿw3uùÿúVË¥žÉOؾ)P·EZeé9 Q3¥QxYÜþÀÑ
+ÛƒußHç¡,W4V¼ÃLYðŽ‚мÔû¬pMhû¶¦êúi` ”Í	€F-Ì”zD=àY¢my®w®þ^LõÞž«EúvÙÐ
+¨ëw¤ÇŸ«Z˜)õ(ˆzÀós>Þ—'¨¿'Âz_LPOûQùÙÏ…’ӆਖ¥öÃvêÓxÆÃŽK`eã/ö븄Z»’<Ì„šଦ¥ÜL#D€Œ'
+‚=²:^þ/Iz].é\*É„ŽzتZ4
+b2éÐu£…%‰¯RWIäRIDtÔËVû1å/h¿ îü¾Î`IÒ‹|I;äRI:DtÖÓV"XÙ/¤«¸_ZnIš—”Efy)bßÅ‹l%B%BH£ ðûOR.i
+XÒAÊÏ’BG=mKA‚ظ"æ¾’èÿ.©’ eP9¡£ž¶
+‚% F"^%yâÞ’è+i–\*I–„V=m„¬‡hTR±<ד¯×.ñ¥¥—M.•MDG½l%‚%iö#äso¼Î6Iì¿QÒ;¹T’;õ²•–¤Ú/ˆFŸg¾
+»¤þ+©¡ ÍòzÊÞR=m%B%BH£ ”²ª¡‡/I쿧¤•‚”w…ŽzÚJ„J„FA Ðé[Ô¿’Øþ.)©\*	©„Žz&1J„¬·xµ~!ð›­™¯¼.ñ÷%•K%™•ÐQ[!ëBP£"09¯ùªë¿»¤Âr©$Â":ëi+,	„ìWzä¹ÊlÛŸ%–K%‰–î÷¨§­‚@I"h¿ ^úüæë±K¼~î’‚R~:êi« XjT~³Ñq…5Il”ô]ò#ºÐQO[Á’@P£ ||·ýDL&éú-©¿\*‰¿„ŽzتZ=U~‘…þGÒ"“Ø~+iÃ\*IÄŽzتZ4¾!èQç&‰í¿%å˜K%áÑYO[±Öwífý¹Q¿$ñú½Jº2—J²2¢³ž¶
+bßß´_賶x‡Kbû­¤:ƒ”„ŽzÚ*–‚ñÂ#ÖwIl–4ir±‚ÐQO[Á’@P£$ZÃŒø¼£þ•ÄöwI±æRI°&t¤`ƒ­š‚ÖÃ4¾!<Bÿ#!ŠI?Jz6—Jr6¡#}lÕôm´ ñ
+1àëIl¿—Ôn.•ÄnDgê7Ú*©ßP’h¿"Ð#σú.IãWIçRI
+Gt¦£­’6%iö©GÛ¨%±ý]RÊAÊ…BGÊ9Ú*)çX¨Qè‘1Q¿%iü,éè ­2w:ÒÕÑVIWÇ’°@Š@¼è$D4‰í·’ÊÎ¥’ÈNèHu[5Õ­‡h|CLx´9ÂKbû£¤Ás©$Á:ÒäÁVM“Gëaß/<Bÿ.‰íÏ’BÏ¥’@èL±G[%ÅÓ%†Ú¯ˆ
+Z™Á™¤çGI¿çRI¾Gt¦ç£­’ž	
+Ãív<ÿ™$°ëù¿¯’ºR. :RûÑVIíÇ’°@ŠÀ/2^>á$±ý§¤ýƒ”‹oÞ‰ׯāëGâÀ÷wâ@¦|ÑÿL#øªÿw+)]*	ßIׯ¤ƒ²~'T*¿‹OXIl”tƒ.•dƒBG:B&
+,éi=,0Q`E¼ðˆýß%±ýYRºT©i«¤2DIZ ýŠØð¨ó	/‰í¯’æÐ¥’äèLƒ¨4€ã‡õ´ T‚‰`Ú¿~—7“Øþ.)!åB%¡#…¢R>?­‡¥!,\ºþ—$ÍjzE—êõtÔÓV¹ºY’×ÿú…Àñ¢ÿßKÛjjF“JbF¡£ž)KêFZïñ†rýBàŠØèðÓ&iþRÓ:šT’:
+õLXÒ>ÒºÔø†ðh•78“Ø~¯)!M*	!‰ÎzÚ*)#QÙ¯ˆi†%‰íÏšNÒ¤’L’謧­’n%ýŠð+bu<ÿÁ›¤ùSMEéR.:êi«¤ªdÉ3¸ñ±áÑ*o°&±ýUÓXº´Jÿõ´UÒ\²ä‰þŸ?˜¯—õ¯$¶¿k
+L“JL¡£žéKŠLZïÑÿï/®ÈÍþ_’4¬é3M*É3…Žzتé5i}Fÿ¯_ˆmÎp%±ý»¦Þ4©$Þ$:ëi«¤æDI d¿"<ÂüüœIš¿Ö´&•¤Dg=m•´ž(	„ìWD‡G3lIl¿Õ”Ÿ.åÂ;¡£ž¶JJP–Ü1ƒ»!<Bÿ¯G’æÏ5]¨K¹˜R訧­’N”%OÌ Ÿ_ˆ	ØÿMÛ5Õè‘j¢Q¡£ék*RZïÑÿíwÄfÿwIš¿×4¥GªIJ…Žz¤z¬iLi}Fÿ÷_ˆå%÷Å7Iš¿×§Gª	N.õ´UR â{_ d¿"6<zù†!‰í¯šõH59*Ð¥ž¶JúT¼ïBöé ¯Žç?’
+‚í‚ö+ÂG„ÞnÔOIlÕôÕ&ÕäÕoÕÓVA $´_HÜûBý+‰íïšúÚ¥’øšè¨§­‚`I ¨ñ1{­Ÿ½¶i³]ÚãgûQO[Á’@P£"|Dê‹ý¿$ñýé*)·]*	·…ŽzتZ4¾!xÄþß’Øþ]Òu»T’uõ°U´h|C4x$†IÛJªo—J¢o¢³ž¶
+%‰ ý_ˆá['¢¾=¥ýH)“„õ´U,	5*¢Ã#ô?’D¸þ{+)Æ!•k—è¼þa«^Ýý;‚1à‘.Il¿—ôävé £ž¶
+‚% ÆoÄzjýzjûã*í—ÄæBG=Óe­‚)·+b£ú&‰í’Ý¥’]è¨gªí‚ õ@0]wE¼ðó/$Öž·æ_g"œ)Õ]*	Õ‰ÎzÚ*”$‚ö!fkµ¾µÒ~¤c‡”ÉØ…ŽzÚ*–‚±àûHbûoIåi•þçïý[Á’@P£"6<bÿOIl•4ðvéþÞÑÿ°U,	5~#V«õ«ÕöÇ]Ú/	ä…Žz¦G/Z¦Ó¡_˜1}ú¥ù×ù!2ý¼K%ù<ÑYO[’DÐ~EÜðó/¦^×æ“5®’ºÞ¥’¸žè¬§­‚@I"hÿâÅþÕkÿ	ZÔîH¹wDè¨WZøñÓz ”Z¾ |DzûKbû÷-~IZ¥ÿù{GÿÃVA°$Ô¨ˆÐÿL[?£ÿŸ.¢þ’”{G„ŽzÚ*–‚¿Ø¢úÕkûã)í¯Ü;"tÔÃVEÐz  ñ
+á#ÒÂþ¬q‰í7ëà·š%¹Ï¹ÓÃß[õ´U(IíWÄ€Gxþû‡a—Ø~ÿ iþEiåÞ¢³ž¶
+%‰ ý_ˆÕ¾Õkÿ	ZÔîH¹wD訧­‚`I ¨Q>"­Áþo’ؾ÷Fô¿I«ô?ïèØ*–‚ñÂ#ö—Äö§õFô¿I»ô?ïèØ*–‚¿ë[ýµýÑJûûž?ۏzتZ4¾!|DÚØ‚HC.±ýóÄ]Ú=âÒν#Dg=mJAû±ážÿNŒºÄö×Oâ‹Òν#Dg=mJAû¿ûOT¯ý'hQ»G åÞ¡£ž¶
+‚% FAà‹ÈìÿWÛ?OÜýDÿ›´Jÿõ´U,	5*â†Gìÿ%‰ïï—õFò»íºJÿó÷V=RGV­é'ÿbÍÚ¾öŸ }íAû÷û³ý¨gûAë`ûñÀ#Ì¿üÅÔ%¶ž¸[»GLb^l¶_7êi« ð½'´_ÍK°ÿëµ\bûÏ3Ab®DÔ6þÞª§­‚À÷–DÐþO„Ç#(õÚ‚µ{Rî:êi« XjTD‡G褽Fôû`6Õ/I¹wJ訧­‚`I ¨ññ^µþ½jûm•öïëþÙ~ÔÃVEÐz  ñ
+1àûÿ‘Äö»õFôÿ‘î»ô?ÐQ[A끀Æ7Ä„G˜!-ë­ý'TY‡¿(ݹw„謧­‚@I"hÿâÆþÕkÿ	Ú×î´Ÿ{GÔ~ÔÓVA°ý@Ð~E¼ðÏ$½¿µÿäLT>˜yõKRî:êi« XjTÄ‚Gìÿ!‰í¿Ì0ú%i•þ:êi« XjüF¼w­ïÚ~ì/1é){GˆŽzتZ4¾!6<bÿOIl}0ë䥧ì!:êa«"h=Ð(ˆí¢ãë_Il0(È¥§ì:êe+,I´ÿñ`ÿ‰êµÿíÇþo¿ìaûª—­D¨ý°@ûqÃ#<ÿÛ’„Î@xz#ø“ÊÞ¢U/[‰PIX ÆoÄøV¯ýWhQ»§ •½SD?í{ûkþ´¨Q<bÿoIlÿ<ñŸØ_bR+{GˆîÑÿn« d=,@ã¢Á#ô¿$±ýÇz#úÿH­ì!zDÿ»­‚õ°
+BÖs‡Êþûˆ…ý'ªý'Þ~ì/ñöëÞ´¯zÙJ„ÚÏ*û¢Á#<ÿýAåÛ¬7‚ß:Ò*{G&o=ÿi+,I´_¡ÿç-‰í7ëè“ÊÞ)¢ïèØzÇOëa¿Ø¢úØâ-Æþ—ÊÞ¢Ÿý½ýýü´¨Q±ÿIl¿[oDÿi—½#D÷è·U² ñw»Ö¯ØâíÇþo¿ì!Zõj?²Ø~Eøˆ¸±ÿ@—ؾiÇþ“vÝ;‚ëMõ²•–¤Ú¯ˆáùïÃ\bûÓz#¾/i×½#ü½õü§­D°$-Ðþ/Äîßêcÿ•·û«\*{§ˆ¾Û÷ößùÓzX FE,xÄþ’ØþyâîØ_âRÝ;t‹þ‡­Ý~ZÏ*ãbÃ#öÿ”Äö—õFôÿúèWÝ;Âß;úßlU„¬ç•ùÜB‹±ÿÄۏÝ#Þ~Ý;´êÕ~"d=w¨ÌŸïšãžÿþaÞ%¶ž¸;v©_uï~]ÕËV"PR,Ð~EÜ^Âý'þaÔ%Ô^—õFð+ש«{Gø{«ž¶’DÈþOÄñhÖzí¿B‹Ú=©î:êië}ZÏZëâGìÿ-‰íßÖÁ/šT÷Ž
+BÖs‡Êúî?¡Eí?AûÚ=‚öëÞ £ží'BÖs‡Êú…xàžÿþøÄöoëà·ŽÔêÞüºQO[‰`É“;Tö/DƒGèQp‰íŸ'^»¢ÿM*{§ˆŽzÚší§õØEßî?a}ßµýû­í—½#DG=m­ë§õØBŠèðý¿nIl¿YoDÿ›TöŽõ´µßŸÖcÿ	5*bÀ#Ì¿Ö#‰íŸ'^Óî—zÝ;tÔÃVAÈzì?ÆoDçþÖkÿ	Ú×î´_÷Ž ý¨§­D¨ýÜ¡òüBLx„ç¿Ô.±}ïà­®îáï­zÚJKZîPi¿/<bÿwIlZoDÿ›TöNõ´5ûOë±ÿŠ¿ÜÂúqÕöïUÛ¯{G€ŽzÚZ÷Oë¹C¥ÿB,xÄþ’Øþk½ýoRÝ;Âß;ú¶öúi=w¨Œ_ˆ
+0ÿZSÛ_Öñ}÷H£î:êa« d=w¨Ì¿ÜÂzí?AûÚ=‚öëÞ´õ´•µŸ;TæO„?šŽGxþû—Øþ¶Þˆï‹GuïoÕÓV"XÒs‡ÊûqÃ#öÿ’Ä÷÷Ëz#øE“êÞ) £ž¶¡’Ü¡µþ‚ûOX¯ý'hQ»G Õ½#@G=m­ç§õÜ¡²~!xÄþß’Øþm½ü¢IuïïèØÚû§õÜ¡²!<"ÃqIbûõFð[GšeïÑQ[!ë±ÿß>"Lî?ñ.±ýóÄÚ=âÒ,{G€ÎzÚJK!û¿“ûOX¯ý'h_»GÐ~Ù;Âö£ž¶¡öcÿ	íWÄ€G¬$±ýn½ýoRÙ;EtÔÓÖœ?­Çþ+jTÄ„Gìÿ&‰í›ôDÿ›T÷Ž
+©„ì“~z$׋àÑù1øžúúñÞ¼ºªÓk¼rï•ñC¬o„ý'ø½üRœ¿Dz¾2Õ³{GHï:½ŒÀ•MÐ߉†ݨŸ©84öóÝ©vïTÒªÓË^Á¿úO²~5Ÿ¿Ÿ÷Ž$­:½ŒàáÄúFznæ_Rqþi(ÿ©ÆaùóõVþËË	º‹Àˆѱ¢õšŠó¯4ô|+Æzï_ï¬ÃË	º‹Àˆ_b¯zöŸ`~õ—¬ù½wó«N/#8ÿîP©?ÄúFè?Áïå—âüóŽ÷¨¿$ÔðÞ¼ºªÓË\Ùýx°"æ¥âüw¤±ŸïNÕ-¾ÞÊ^FðŠŽpb`E¬÷Tœÿ‰4öóÝ©¼w´êô2‚Wv‡Jÿâ.^¿‹Ï¯þ’©®Ã{G@«¾¼^Ýw‡Jÿø‹Ð@ÿ	~¯¾ç‘FšG)ëáëõåõ"è¾;TîâÄŠ:êO*ž_HCÏ·ŽYóÞ¼ºªÓËü½iôw¢`Eõ‘ŠóÏ;ÎPÉT×á½#HWuz¿÷l‚þ_b®hx=û¯0£ú«–òÞ)¾Þ÷{~#xewh¢bEÈÿ<Rqþiìç»SYïiÕée¯ˆà'V„üÏ3ç¯S©¿$Ôi½#¤U‡—t/âZúOð{í¥8‹4ô|kªÓzGH«/'è.#~‰ý'YÏþ̯þ’5¿õŽp~ÕéeçA':VÄük*οÒØÏwgÍÞ» w^þîîo‚þN¬o„³1ÿ–Šó÷HCù‡²ÞÒªÓË^ÁN<Xó¿Rqþ;ÒPþ¡¼w„¯·ò‡—¼"‚#œXö_gOÅùŸHCϧ*Þ;Zux9A÷Ý¡Òÿ…@ÿI:fÿ	æWÉšß{Gøz÷üFÐ}w¨ô/±þ2W„ûÿ:/ÅùG¤‘wïPÅ{Gøzg^FàÊ&èïĉ1ÿ'ϏG¤¡ç‹S락ëô2W6A'Ö'²4æ?Rqþ3ÒØϧòÞ¾ÞY§—¼²;TÆ¿×ãõì?ÁŒê/YÊ{Gøz÷÷üFðÊîP?DÅŠxÂ>RqþièùÖTÕzGH«/'è.#^ÄúF(è?Áï•—âüóŽSÔ_ªZïiÕáåÝE`Ä‹¸°"Üÿ×c)Îß"ý|qÖ¬w¤ðõÎ:½ŒÀ•MÐ߉Ž±^Sqþ•Æ~¾8kÖ;z×ée®l‚þ?DmÅë­ØüUý%KYïiÕée¯ˆà'n¬ˆù·Tœ¿GûùâTÖ;BZuzÁ+"8‰+Âþ«\©8ÿiìç‹W³ÞÒªÃË	º‹Àˆ1°"ÜÿKOÅùç7~UI¨f½#¤U‡—tN¬(®†þü^v)Î?"ý|qÖ¬wô®ÓË\ÙýˆVº×K÷ùÕ_µæ·Þ)ί:½Œàü"èïĉ1ÿ'ÏoG¤±Ÿ/Nå½# U§—¼²;Tžb}#´ÎüG*ÎFûùâTÞ;Â×[ùÃË^Ù*㇨Xö_õHÅùK¤¡ç[S]Ö;BZux9Awñ"V„û=SqþièùÖT—õŽV^NÐ]F¼ˆõ‰¼Ð‚ß«.Åù[¤¡ç[S]Ö;z×ée®l‚þ?ÄUn¯—ÛçWÕšßz§8¿êô2‚ó‹ ¿+bþ5ç_i(ÿPÖ;BZuzÁ+"8‰õ‰¼:óo©84”(ë!­:½ŒàáăaÿU¯TœÿŽ4ô|kªn½#¤U‡—t/b`Eù„/ç"
+=ßšª[ïiÕáåÝE`Ä&øOÁÍÀqÿ_f–âüó÷RI¨n½# ³./ye;Ðÿ‡èåñzy|~õW­ù­wŠó³./š_ôwâÄŠò	_*žŸŽH#Ó[ÊzGH³.¯»ÝåÀN¬Odï̤âüó¿«¿d)ë!]•?¼FýºË#œ¨Xö_íHÅùK¤±Ÿoý]·õŽf=½6!w9`Ä‹hXîÿíLÅùk¤±ŸoͱÖ;BšõôÚ„Üå€/âŠpÿ__ÌKqþùÛÕ_ê¶ÞÐY——ˆ¼²èïDÇŠ˜MÅùWÊ?jÖ;:ëòêÇÇ};Ðÿ‡¸[÷ºúOÖŒê/YÊzGHŸí=ÿ}ÝåÀNÜXóo©8ÿüÆ¿Õ_²”õŽ®Ê^£}ÝåÀN¬Oäþü^q)ÎGûùÖßõXïiÖÓkr—F¼ˆáþßz*ÎÿDûùÖk½#¤YO¯MÈ]áž?è?Áï—âü#ÒØÏ·fÍzG at g]^"òÊv ¿ëùTæÿ¤âùåˆ42½PõNÎº¼úùqßôw¢`E̤âüg¤‘é-e½#¤ÏÌŸ^÷óu—G8Q±"ä©8‰4ô|+”õŽ®Ê^ãúºË#œXŸˆý'ø½ÜRœ¿Fz¾5Õ°ÞÒ¬§×&ä.ŒøôŸ¤£úOÖüê/Yó[ïéÞßó—ñu—çw⊘IÅù[¤¡ü§öþýì÷?¼üÝ}9!'Ö'rTæ_Sqþ•†òšõŽ\|½•?¼zù¸oú;qcEÌ¿¥âü=ÒPþ¡¬w„ô©üáu¯»8‰+Ê'L©8ÿièùV(ë!]sÿE¯Ñ¿îrà'Ö'r ÿ¿W[ŠóÏoÜ¡þ’©úa½#¤¯Ü!
 -/#ä.‡5â
Eà‰è@ÿ	þP»ç‘†žo9ÖzGH÷¼ÿ//#ä.‡5âMœXQ>aJÅóÃiè|qÌšõN]H÷ÉüéÕúÛÝèïDÁŠ˜ÿHÅùÏ©Ô_²”õŽ>2zõúu—G8Q±"äߏTœ¿D™ÞRÖ;BúTþðzŽ¯»8‰†aÿÕÏTœ¿Fz¾ÊzGH×ÜÑkÜ_w9p„V„ýW/©8›Jý%¡Në!}åþ^›»0âE¬Oĉþü^k)οÒÐó­¨Yïè¬Ë«ž÷í@'n¬ˆù·Tœ¿GʪÓz§@g]^íþ¸oúÿg­^WÿÉšQý%KYïéã|ÏßÛ×]áÄúDžó¿Rqþ;ÒPþ¡¬w„ô©üáõœ_w9p„+Âþ«÷Tœÿ‰4ô|+”õŽ®¹ÿ¢×x¾îrà#ÖWá\îÿýNÅùG¤¡ç[Së!}åý^›»0âE¬OdAÿ	~/µ÷ïG¤‘÷÷PÅzG@ï:½jù¸ŸêP¡¿+bþ#ç?#
+/¦*Ö;z×éÕžû©-ú;Q±"ä©8‰42ߥ¬w„´êôê××]*áÄúDôŸà÷JKqþi(ÿPÖ;BZuz=å뮎p⊰ÿºK*Îß"
+=ß
+e½#¤U§×_wu¨p„+Ê',©8ÿJCÏ·¦ªÖ;BZuxmBîêPÁˆ±>ý'ø½ÐRœ~ã•[Ï·¦ªÖ;z×éUëǽ¨C…þN<Xó¿Rqþ;ÒPþSU락ëôjãã^Ô¡E'V”O8Rqþ'ÒPþ¡¬w„´êôêý뮎0b=‘ëõbþw*Î?¿ñjQþ¡¬w„´êôzê×]*áĉaÿu?©¸>"Ü_…jÖ;BZuxmBîêPÁˆQ°"Üÿï‘ŠóŸ‘FÞßC5ë!­:¼6!wu¨`Ä‹¨Xîÿkc¸çŸßxõÎû{¨f½# w^µ}Ü«:TèïÄ…!ÿ§¤Êós¤¡ü§jÖ;õ0;å¯ëø¸WuhÑ߉ŽužðSåù9ÒPþ¡¬w„´êôê÷×]*áč1ÿ–*ÏÏSåÊzGH«N¯§}ÝÕ¡ÂNà‰þü^d©<?Gz¾5Õe½#¤U‡×&䮌xxG¢ÿ¿×X*ÏÏ‘†žoMuYïiÕáµ	¹«C#œXo…¹¢Æ~ª<?Gz¾2Õe½# w^õú¸7u¨Ð߉õ
+qæÿ¤Êós¤¡ýíT—õNÞuz]çǽ©C‹þN¬ˆùTy~Ž4´¿
+e½#¤U§W¾îê?á'*VÔxÂO•ççH#ó]ÊzGH«N¯çúº«ÿ„#œXŸˆ‹ý'ãL•ççH#÷W¡ºõŽV^›»úO0âEàÁþ“QRåù9ÒÈû{¨n½#¤U‡×&ä®þŒx+Ê~ª<?Gz¾5ë½ëôªýã~©ÿ„þN¬ODgÿÕh©òüi(ÿ©ºõNÞuz]åã~©ÿŠþN¬ˆù÷Ty~Œ4”(ë!­:½úøº«ÿ„#ŒÀ™~å	7Už#
+åÊzGH«N¯§ÝÕÂNàÉþ“u0]*ϏS5ío§º­w„´êðÚ„ÜÕ‚/ïHöŸŒ‘*Ϗ‘FÞßCÝÖ;BZuxmBîê?ÁˆQ±¢þ§¿à/•çÇH#ïï¡îºïÝ w^FàÊ&èïDÊʟþ‚¿Tžçè¡ü§º¯è]§—¸²	ú;qaEãOÁ_*Ϗ‘†òuïìH«N/#xEG8ѱ"æ_Såù1ÒPþ¡Ë´êô2‚WDp„xG®þþ½|©<¿MÕrê9öÞ‰´êðr‚î"0âEà¹úOø÷ê¥òüiäý=ÔSö½›´êðr‚î"0Â	<‘xòý§Êó[¤¡ü§züý#­¬ÓË\Ùý8±"æÿ¤Êó[¤¡ýíTÏeù#]Õée®l‚þN¬wäÓ˜ÿH•ç·HCûÛP·åZuzÁ+"8‰†ÝúòRy~Š4´¿
+õì½iÕée¯ˆà'ðŽ\ý'ü{ñRœ¿E¹¿
+5Ž½w"­:¼œ »ŒxxG®þþ½x©<¿Ey5ʾw“V^NÐ]F¼ˆ+bþ-Užß"
+å?Õ¨–?ÒU^FàÊ&èïă1ÿ+Užß"
+å?Õ¸,¤«:½ŒÀ•MÐßœÈGcþwª<?EÊ?Ômù3»¬ÓË^ÁNœXÑÃ^ª<?EÚ_…zöÞ‰´êô2‚WDp„xGÞyÂK•ç§HCûÛóï>Ž½w"­úòzt±F¼	¼#Gá	/UžŸ¦êy÷žê>ʾw“V}y½º‹X#ÞÄ…=<a¥ÊóK¤¡ü۬՝]avÊ^F༿	ú;ѱ¢<a¥ÊóK¤¡ü£víì
+³Sþð2çýMÐ߉{]iÌ¿¥ÊóËT§òu[þ U§—¼"‚#œx°¢ÁVª<¿D¹{Zjì½iÕée¯ˆà#Þ7îÿåN•ç—H#ïÞ¡Îcß»I«/'è.#^ĉUž°Råùeª®ýÕTgÙ÷nÒªÃË	º‹ÀˆQ°"æ?Råù%ÒÐþvª³Yþø4«N/#peôw¢aE'œTy~ˆ4öùbÖ®]evÊ^FàÊ&èïÄ…UžpRåùaªSù‡ºwv¤U§—¼"‚#œXŸÙ³<á¤ÊóC¤¡ým¨±÷N¤U§—¼"‚#œÀ;â¾yÂHÅùïH#ïޡʱïݤU‡—t/ûí©òüiäÝ;T)ûÞMZux9AwaĹN¤w9™ÿ*Ï‘Æ>_ÌZ³üñiÎzzm‚W¶ý(Xó©rÿih5U¹,fwåüðÚ¯lú;Q±¢ÆFªÜ¿GÚ_…ºwº¤³ž^÷õu—G8±>¡¥Ÿ<a¤âü5ÒÐþ6ÔØ{'ÒYO¯Mä9p„xGÜO©rÿiäÝ;T=ö½›tÖéeDºË#^Þ#O©rÿiäÝ;TµÞÒY§—é.ŒxëQOæßSåþ9ÒPþSÕfù3;å¯V>îہþF¬­Á\ó¿SqþøÄ©¿$TµÞ‘Æì2zm‚W¶ý8±"ÖŸT¹4´¿
+e½#¤³ž^›È+rà'ðŽè…;üT¹žJý%KYï鬧×&òŠ8Â	¼#îÁ~ªÜ?GÚ_MÕ¬w„tÖéeDºË#^Þ÷ÿ«¦Êýs¤‘wïPÍzGHg^F¤»0âEÜXóo©rÿ<G«¿*T³Þ)Ъ§W«÷í@'VÄü{ªÜ¿F{;kÖ;r1;å¯~|Ü·ýÀ‰¨5æ§âü#ÒPþ¡¬w„tÖÓkyEáDÁŠ*wØ©rÿ:UÝûÛ©¬w„tÖÓkyEáÞÏÁvªÜ¿FÚ_MuYïé¬Óˈt—F¼ˆ+Âý¿—T¹4´¿šê²ÞÒY§—é.Œx+ªÜa§Êýk¤±÷·³f½SÙ)xµöqßôwb}#^•ù_©8ÿi(ÿ©.ëéÌNùëŸ÷í@'VÄü{ªÜ¿F{;•õŽ>•?¼îçë.Ž1? ¼‡Åç~]·T¨öuÿǧjÿ¿D«/'è.#Œ8þþ÷Ÿã/þû¯ÿø§Ïßs®°rý¥§üýÏOè?ÿù?^â	ôendstream
+endobj
+6 0 obj
+32291
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 612 792]
+/Rotate 90/Parent 3 0 R
+/Resources<</ProcSet[/PDF /Text]
+/Font 8 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+>>
+endobj
+8 0 obj
+<</R7
+7 0 R>>
+endobj
+7 0 obj
+<</BaseFont/Helvetica/Type/Font
+/Subtype/Type1>>
+endobj
+2 0 obj
+<</Producer(ESP Ghostscript 815.02)
+/CreationDate(Wed Jun 30 18:55:00 2010)
+/ModDate(D:20100630185601)
+/Title(dlog1.eps)
+/Subject(gnuplot plot)
+/Creator(gnuplot 4.2 patchlevel 2 )
+/Author(Paolo Giannozzi)>>endobj
+xref
+0 9
+0000000000 65535 f 
+0000032598 00000 n 
+0000032739 00000 n 
+0000032539 00000 n 
+0000032397 00000 n 
+0000000015 00000 n 
+0000032376 00000 n 
+0000032675 00000 n 
+0000032646 00000 n 
+trailer
+<< /Size 9 /Root 1 0 R /Info 2 0 R
+/ID [(ÿ{ŸÜÚwßVÿ€ý~×Ös)(ÿ{ŸÜÚwßVÿ€ý~×Ös)]
+>>
+startxref
+32960
+%%EOF

Copied: trunk/espresso/atomic/Doc/pseudo-gen-fig4.pdf (from rev 8077, trunk/espresso/atomic_doc/pseudo-gen-fig4.pdf)
===================================================================
--- trunk/espresso/atomic/Doc/pseudo-gen-fig4.pdf	                        (rev 0)
+++ trunk/espresso/atomic/Doc/pseudo-gen-fig4.pdf	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,299 @@
+%PDF-1.2
+%Ç쏢
+5 0 obj
+<</Length 6 0 R/Filter /FlateDecode>>
+stream
+xœì½ËÎ&;’¸?O‘»–}¼“Z
+´VO½Aiz0B€Z‚Я?A7sº“
+˜Ó•]çRD.òwº-‚ÁûíûçoÏÏáÛ3ÿñÿ?~
+Ï·ù)|û’ðoÿð_~*©>ßzß>øs¤øíŸðg+¹ipË=¿áÿ‰ÿóÿùéŸgdóÿûóçÛúÓOÿáÚ·ñíOÿøâ·¿Ÿº%oµü<FÊßþôùéßýýósý÷úï?ýç?ýô_Ê­VªËŸP—?©Ž¿Uýÿ¯hnãçzÊf“
+-ªìü“²óO••¿±l|~Ž§l\²©´NYù²ò'eñ÷/•}?ÐÏ/-½²9ˆì·g‰ÆñÆQù¢ò'Eñ÷/}ÂÏù[­?çÞEÝ»Æ44_ÉŸ”ª¬üýKecŽ§¨}×Іf'ù¢ò'Eñ÷/
+=Îì´ËZ.ñÑì$Rvþ©²ò÷/–éç/oÛ—l}47Í¿ :ÿ¢¦üùK%k:sRXz¾ªˆ£ÉŸÿ䟢†ýÿ×+ùe§ŸCné̸"ãSTOþ† ƒ§"C™dõçö¦Ò÷Þ0•ü¨¤ü
+IOI†þ2ÉTÞâ¡’q—̽U•”¿!Éà)ÉÐ_&™ß”í*™vÉCPIù’ž’ýe’5´Ÿ“Jæ]RÛ“))ïÙõ•dè/“lo•,_JGne–¡·^ýŸÿ÷/ˆ¹åYâsø¹‰ùïþé¿…çü¯Ÿÿåÿüwßþ÷·ðÝ'”6•íéû¢ãç²jù\iÌ·BýŸÚÏeµ
+~¿@ƒ¼Ä©šÑO^÷¼îyÕóÜ÷CR°¼?4È‹œ:ùÀ]`N"/|q]ø$ľÝ——ÄàIZùÌc¤}³ÀX'i_ã%ºO(oÅ#r’¯Æ:"÷æ¹±ŽÈ½ÆKÌ'1{böĸÝGÄk¡ÊäýX›ÓËà8úã%Z)ìx-|E):cíR~‹ÕX»”_ã%ö“Ø=±{b݈ö¥(îë“B>Ö¾¾Ò8ÔüÀmì+RwnD“Ze¬hEÇš/ÑJ¢TVƒ;®¤kÇU)4~`¼DûŽOÇÏi˜9ŠûÀx‰å$O,ž˜6¢ªŽ×âç4HLW}`¼D÷9ðZü
+#H/Ñ}y:.;KøXËÎoû6Ö²s™™<ºÏ!OÇõ\y’±Ösßu¬õÜ2ójtŸCžŽÒJµ
+ËhsÖ >j‘Ù_DC:©–w+uÄ›ÇP‹ÔÀ®ÚÄIµ:¡R§‚ÚÔ‚7jïÔ¤Z
+¤0&ëò(j‘ÚØ‘C£1©–ÂRa¼yú5©EjaŸ•øë²´Rð90¥•GP‹ÔÙ¬kFŒ3Û¤V)H&Ì2å>Ô"5°‡…ÚqR-#$&~rojÁ;K¨æ&Õ’)#™0“{Q‹ÔÆ~ê«IµdÊH&LäžÔ"µ°ëó› ÁœÝ,Á µHMÚ‹ù¨e“W¿h¤Sëj‘+½M(±lc³„jU-xŸ®]’Z6™€þý‹FJµ¤¹(ûÊ•÷µ¤J at c¤žYo¬¡úµñQËëè'β(\VkØýÌ7\ãn±là~Ô‹FÑcñסð[ž´Íÿ¨eƒaôOf‘7ªEîjö?jÙÀíþ,Sâ-C-rgöÕ1*,¤¢!ž…
+ܪ¸½kþQËœ%à™1Ì,Q:Ì=kküQË
+ÑÈy¨EnÐù£–бÙÀÈ,碸­Iq$W,78cåQVÎQ-r³¶®µÜ@ëAÞÀˆ)§®¹Ò^åNËMZ›V¼oÊjÁ[«”*rÅ͸ÈÏÉäô¨En”R¥ÜiÙ`Fk6ÜÆ–cU^é2ë}lb»Më'/2s™Ž/²ô(u€!V°FîxJrhjÁ+.*ˆl¨uñ¾Ì)ÚçÏÒ‘ÑN¿XÁ:ý™tÞ3sŠöÞ³ô)´û.V°î{®HtÃó“Ô‚7I.Óü<­`ñ\©+ï›FW‹ÜGJ†rE×Þ·à}±s4¨¼1kò¡lóhfc„Ý€‰‘nÌÒþè~@±‚mÌl°£,±]Ð-eÙZ‚­`›Ê4÷c÷TâÓíSùiÚ|hÛ@•¥+ù~5©Ÿ“TÜb‘$w+÷µ‚mÞaØm’ÐO
+ºÝ$¢µù‡V°
+'Y’íEãI’ŠnŸi¥]H±‚u!s ¾QyÔ"WZ‘¦Ü×
+ÖÌž+ß)'µÀmEkä­`‹ß	¸€î\JU-x«ÔÈüFbëÏ1'tÊRj‘+µjUîLgë•%éé½À
+jÁ+ƒB]g+ØBcjHY¬¨¥Õ‚W†>º¦&V°Eµ„7 ‡”P[í!%ékI¬`]¤„þkÀJPDt)(I—UׂÄ
+¶”Ðzôs"jÍ ýœ4»€Aû9°¬Ÿ£_}•Øµà
+Qr¹bY_%¡%Xˆ¨½‚.¤'iíöQËR$W¼±µÄÇDk–õ7Úî€ÙðÈ·×éð8[ë óá°lB\¿
+úmhÐ>ClÂå3ò>CxfÌþFô¶‚NÿÆš´†ú¨eÀ‘y²HŒÌ“…e0J.Œ,ƒ°Æ*ƒ=È€YÒµàÍó«è<),›(è´Ý%RÛÖ2µ¬íŽ¬)0)P?ŒR#ë´ XѦ#êØ€ö7 Ž
+ÚþF©Uµý+ZûYOb¾-°žÔ	·0SÀ+ÚŒ[d]‡64ð
+´
+
+¨Ýø}ŊֆƇhxSSÜ:ßWç¤ÄŠ6'¥©ƒv00wk;ŠÔü¾bEk¿/&{¿¯Îöù¢:Ý#V´éT!ó«M/ª±à]Kû‡V´¶, 
+˜FyІFF	Òjê<ŠXÑæQá^´x1øK¼oU%_\±¢m¨U#v‹aL,¸]J;ó•XÑ6Œ=èDìp‹XðÖ¦%öC+Ú&'tÿ_´ÔˆÚ¦ˆ­MyпŠØ‚il±à••î	+Ú¦tÚ^ôüF“	bÁæ7ÒýbEÛ
+@“3‘K_qžñcÉù¨µ¿"6¡¼hx1‚U½URº°ÖQÄFÓ7 ‹ñBlª;G1©î´ÒcºJr«SlãQÞ8¿hVÝi¥Çt™¯d…!6æ«®º’“²êN+ÓŬiìÐÅäNd=ù~KÉÁÔ+­z26æþݘԂ·ÍýZiM¦¿O‰Ô‘)êXÑ–EÎQ¿ä,±œ¤†•Ö$õkË&©ëÞ|^Ô‚WZ Öu°ÒªëÞŽMZÊoE}•¸]8V©¡¸_VZ†_[ž2IÿùmŒ«ZðÎQkdÿVZýçXÑò%©¯"–ºÅ‚wNžFÖW°Òª¯^[òs’ú*rÂ<±¾zãZ9øC+­úêíŒá
+e÷Tä¼_âö©÷ë̼ÁýS°ÒÚ@±6ó¦
+L/²XðΙêÄyXyÍ3L[Ð(û#ž¤eÿ­Î'—e_¬le?b<˜¤Ÿ#¿6û9o\ARŽÜiåÕω]dw¿Õ®¼sF#qÜ
++¯q÷´-}•·¿×Ôo˜=›Ä¾
+¬¼ú*KIv¿Ó¢¼³w’¸V^ˆ_[rp–9þ·o”Ô‚7ÉÛ3ÅÊk’?¢Cÿ¾…ä
+L)ˆï‰%Ž%aå5–|m¢¥ÎyP2ǃo\3u8¤µÆƒÓØï[À‹™ƒœÕûF2Çt´Ö˜.bð}‹YOìÞGÞžõ$¬µ	(²7–¥íØp Öô†¹¹á£Öj»Vû^t/Væ2·h„¹'ï}ûB®Xk“F`#KûØßÈM½³VÍla•ÕþlD|ßBÞ׋%ÞyWpÈ\q‡UÖŠ{èü¢RŽBÇ<af9zãš_…åVYå(t~QY­}ÇTE-xgË—¹^«¬õÚ×t‘9¨Ð0v.œƒzãÊóíÑþÂ*kêµåé·‡†1Na¿}Æ%oOî´Êê·¿6вTö”¦¼|¦•Xe­•½¶¼o‘¥§P1ß^¸ô4ãÒ/ú¡UÖÚÓkW %­*ú±…eaÆ¥_ô£Ö*¯-ß·H{°
+@,xƒ|Qæ+X«=ZJҏ
+\²+ìǾqÍÔa?–ÖêÇìTEv8®nq
+²=¡p­µÉiÚ‚–1ûû9ºZðÆ™“8f‡UטYl¾¨p±¤Z8î–ÌùrQçÀªkÜÍâø>‰|#U±à»xŠæg±ªåg®6ÙDÀjM,xg/°p¬º¶°šß\”ªú(÷‘¯¢ÜiÕl\ÔnUúfì´‰%^™	-ì›Áª«oÆã}ɜͪJ§…_åC«®ñ ×÷-„˹¾š”;g÷ê£\±ªqÑû¬È“(Š%Þ8ä
+È…eyÃŽ÷I¤ìsv§rÍK,ï°ìÃZk^¯
+Ý
+.rw­ÊÍòÊkcœ*k1œÞ9ª©Y¹ÓjqÑv×.ÚîÊu ­u庬Œ‹z£JƒÓMb;kŠÊþ¬¶úsAísAíQîœý©M¹Ójɸxʆ|…E)±àÛ4ªæ+±šå«Á•ùç¹ø£¼ar‡r§ÕŠqÑ£j²#=p¶£qKzxf¹qO:­µ)ýKòF“1ûûÈ]-pç¡qÌNkÙ璍 eM“uÄ‚wÎ,4®iÒZkšáixfÙ{È
+bbÁ;÷75î>„Õ×î× ¥ËýŒbÁ›Ò|Ö“bõՏ
+jä&kOƒ{¨sN„6.=Áêké‰{¤e}©è1tÍsC›ä­n9[µÞç˜_»¸Ä˜Î¹Ãë}z|1ú:ãõ>d¤;ˆ3\bq
+;ƒbôjé‹~U—ÝøìVuîÆ—~Tçn|k7>¶¼ >L4t6_s—î› H«ñÂ>ë÷	$q°dÛÙ›»³ß§FÚÀX1ìb
+¸qðm9•1wå½Q»›ÄnùÀI ·|ÌSAoùÃnù`âãt4Nè==Oï=-†ŽÆö€Sz8™ô”Þ<µô”žvJß§}p"/èiŸyZ/èik»KN7à$fÐÓ
+ó”fÐÓ
+0VghߐçD!ÒÎS¶apDc
+h±G8`/0'¶t/ð<]t/ð4¢mÆ&èw´T…Õ
+Z/‰aõRBºÈ­‹¨Ä
+Ä`#7Õ™0b¬?·œ
+Vfô°„uBoô1åùå§aÓyÜÞ“L©c.D>N|-ΨÃÊkFÛ˜bì:¨Á>ÇŒ¨¯^ÐôeëIÕsBw¥©Áw‘GTªXÕ¨Ò¬Ä\Ðo“A¤X|¦<ŸQûmbuë·É83æ.j‘Üòz¨ùÊVYgGÞž8Ѓ1µøTm>¥>ó´Šuú‚ôÜb	Œ9ªÅ§’§Tî´Š%¶ÓÄ"kxÜj#{Þq>¥ŽaÄZkxÜ"2§ÕóP‹c‰0ŸRÇ!bu7†·a†ZÃ}Ê­ºö±½c'<3ÆäØLטüíÏëS~h¹19–¶c•½;\ö‹c¶4Ÿ’ã±êÚ»3—-íìûI-xg&¬lii­¦–‹?±VxQ¹ÔºF’}>%¿¬507ýÖ`’V˜›‹1ÏÔaË	«›QË"ï‹Ñ®XàvyJ¾¯Xmí´ŸK#‚–zûewµó›ƒknZ«ê~‡ŽRêZÁü…d!±à}3Ø[)êü…XVÛ¤§Ä\OB«Út®'Õ8Ÿ’Ï,Vws=¨©ú/ªªþh̳zjì=Ãê«ûÌéñ7䁷¨ïÛÒŦsybu›ËÃTó\Ø…7©Å˜§¥õ,«7P
+DÜvPED½î~Ny¾VÖy¢iÙ…÷g/#Æ
+«EQoÌ“«ï+–
+aDÜ*p#êµaž»ˆz¯
+ëpìÛyê‚ÎàJ¥/–ÆüZA¹b5ãp±§¤¢cžhÝS"V´=%˜2}‡|ôfµó|J­ÛÅŠV·ãÒ”Œyî¦Ë:1;€¯¥ù
+–å+̵ä„}!˜l‹1¿_%ê¾±’íÁ1áwÀ+ï‹+tÄbÌonHì‹ÒZ}шƒ’™û`0sš×>˜y·D^û`IJ}0	+9gî%j1æüZú`Ùù@¬y¼=pîamjÁûÖæ9ë±{±Š»Ç˜=œáĘ],xß•ËÚÃ*–ÛÃ*Iž1MØ%’ušæA²¬ãPX6MØŒŸk¤÷Q‹1Ç—«g9Īv–+~¹â^ìÞð>eÕ›-Äjv³¦çÞ¾>öÍËèA,xÓûUª«Ù±à Õí;Z‘÷Å¡%±à}+ê÷£ð}aÙy9œxsp¥qÜwÀ’›îo«Ûþf¬•f¬½$¬Bf]|™ç^Kï*e—•`›tæ-‰ØB×5‰sƒu^÷$Šå.JŒH+Þt‘V몓8SgÝu˽¯(ž¾FŸ¡¬Ó׳—×ñëiwü#Þòàûbƒ¹Xà¶ôZú}Å
+ö}“ŒaÏE=”uF蓽\ÍWbù3B	hürZ”¦G,>U}-ýí4±¢ýxÖþKÄímXû‹O^Kïoƒe¸a¼_bçÙ¤¬Ÿj*éíb%»ý§ëÞÖçÖ¤`‹Å§z&ZuŲ‹¹’Ôæo›órÒ½‹O•_´ž—+»ór2çV2n?¦Xà¶öZzÿ,»
+¿žüºóÓ¿
+¿müôœü¶ñ_ªrÇ/'¿ìüø}~ßùáä÷~;|ÔïÚ¾uù¾ÉÚ·ž7¿À½ÿWçKýÜ´}êø¾Ö>I€ùîý?ˆv~>ùaç›_ºÂŽO~Üüÿ?îüròãÎ/?Žßw~8ùaç÷ïóÓί'?íüúãøR¿µUÿãû¸úÿÙü÷þ¿˜/õSÓú¹!}­~ncó‡zø¿îüqòëÎ7¿LE9~?ù}ç—ïóÛÆÏÏÉoßùÿb¾Ô/MëGŽlõck›_àÞÿóQ?hý&	5²Õo­n~{ÿá÷g秃¿üä›_–2¿œü²óã÷ùaçç“v¾«ÿÂÎÏ'?ïüð}~Üùåäǝïê/)ß]ë—†ô±ú¥¥Í/pïÿKù¸ßµkýҐ>V¿´¸ùq?¬óÿ ~Ùùý䗝o~ÜO`üpòÃÎïßçם?N~ÝùæÇù¶¾êIßâêgóã|œóÿÅ|”/­¤£3ŠÕul~œop~òÇΏ'ì|óc°ñûÉï;¿|—?žŸþò“o~ìOZ>+ÒÇʧ˜ûÿ/æKùZ¾+ÒÇÊ·˜ûÃœŸü´óëÉO;ߕ߸óËÉ/;?ž|ÉßCËgÅûYù¬yóc…ó“_v~?ùeç»ò÷ìütòÓξϯ;œüºó—?c}whù’‰’Q­|Õèý€;¿òûÎ'¿ïü`ü¾óÃÉ;¿Ÿ|äÏUþäýª+÷îüxžŸvþò+?_2ì£å£àý¬| @ý„›?cÁãÑòQð~V> ~ÂÍÿ—ó±áYËGÁûYù@€ú	7¿òóÎo'?ïüf|lÕü]>–¿ ~ÂÍŸ1áühþ.x?ËÿP?áuœü¶ñÛsòÛÆo.ÿK†}4ÿJÍ8šå_<+ÿ†ÝŸ1ajütòÓÎ>&ÍÿÏgùê'ÜüÏÎO_ýÊ·üßmC™ðñ~.ÿï'Üü¹Û†"áãý\þ}¼Ÿpó+?íüzòÓηü‹	¯°ö§ãý,ÿ"@ý„›?wÛP!|¼ŸåßܽŸpóçnúÂÇóYþÍÍû	7î¶ -|y¾nù7Wï'ÜüÊï;?œü¾ó]þ³YáËûu˹x?áÝå?[¾¼_·ü—³÷Þ]þ³9áãù,ÿåäý„›?7[>žÏò_ŽÞO¸ù•Ÿv~=ùiç[þÀ;®ü‡÷sù/x?áæÏÍT„÷sùïñ~ÂÍŸ›-HL>ö'w·¾<¼Ÿpóg8ãZ•çn}µ{?áæÏÍ&Ä…/Ï7,ÿ¤æý„›?7›¾<ß8ö·-?áæÏÍ&t…ç;öW-?á#Ÿü¸óËɏ;ßåL¸íû{Ʊ?hù	.ÿ`Âlí¯Àû¹ýÉû	7Æ€'íû+†ûþÑû	7Æ€eý¾“$TxÜ<aǁ€÷€Œ!ǺaT>Õ8–è
+
+gÄ8ó¸fÝ
+Š Ã!kÝ:ÀžA°½ÚWP‘8Š{«ŠkÕdž Ã!Ç‘«ßˆV=¸~#ÛyEá‰µÃZ†}€pë°OÞd8Db}ñì-rp½>†(B†H‰µôj=ˆp­éØd8˺.©±5
+͵¦uGá‰õ§¦:ZÓ`½-
+Y2‚e=¬w!½KØd8Æ!!¬šˆîZ¾#ÈpˆèjG‰ƒ{Ò^vY÷iÉÆÐ#+ÙY2‚åT§úµ³¹~
+Y2‚åtõP®j;‚‡¬Ù´ÆEm¾ZÛ¤…
+ôËõ5*Xßr!Àð¾-WxõËõµÂ»¾åB€áØ‚ÙVªˆÃå „‡hY´¾¾œ|ý^ìË!d!Èp¸ÞTÖTÇȼWKu„,Ñ°2ÒyÔ+â73C_g½Vˆ"”aˆV™Bšb¨¥z·cˆ"”aˆV˜BšbXñíÃÒ”!ŠP†!fÏõÚð7Õ…a÷†kÈBá¹®êÛ"WÚÝib0<=X½~ESÝî_Yßa!ÀðŒ¬úúúy
+÷õ[Ý`xz5zöMu<éšµ^!A†!*fˆô(Þ›êxÒæ¾\ÞÊ0DÅlàˆú¤X¡Þ”!ŠP†!Ðô=
+ò¦úT‰v„!†
+¿vÑç@þÁžƒ9Fd8N
+ǧiª ’¥:B‚‡Àp >Z*1ˆ¡¸TÏ‚‡À±¥÷í’¦kvt…,²½ÝDH­mÀ
+Y2Bª¾¤˜ä±`5®†,†Àöå÷íôËIÕc°/‡… Ã!°C5-Q8£•(†,³>ïÛé“¢ìÇl… Ã!pª!ÆG¿þƒç¨öõ¢e{Èß·ú¶HKu
+Y2âÁ³s7eÄ.à×nʲd;UbÔš;Ec²šŽ!A†C`:2ƶÞVre²ÒÀ… Ã!°£,FÎnDì8‹iÍnhÈBá˜jŽéѯÿ@¥Ù×gˆ"”a첉Ik)쉩»;‚‡@pæ;bÇH´™o
+1ÝïKjª#æh©Ž… Ã!°rwºELçǼvºiÈBáXº‹Yk,oÄl5Œ†(B†ˆÔúõ¥X°€#†(B†ˆTÉŠÑl,!b0<‚*Ú£GqŒÅzô1оæ•b’T±¸CÈBáXÕ‰åÑ/'Ÿ,–j_Ž!ŠP†!°í'
+ØöK·ÄE(Ã5Jáîã÷I…Q×îc
+1ñ{2yRÄa3F1™îX¸2b&üýÑÞ¶o2âA
+Uí¡`«ÙÛqÉö¶mC(ØA{ŸL¿z9uØ—cˆ"”ă²Ã(O*¹¡Yï‚!†
+•5ó­!A†CàÏ·Ö“æ+ön)ÆE(ÉGýI2—¢ý&™†,ÑÑâè¨1à~¯8üÛ††G<H¡õ¶2S‡{[„‡h¨qõz‹€GŽv¿Å
+Q„2Ñd
+"êišd§¹b0<SEQÏkrª(ÙyM†À´WÒeœöJv¢l…,†@5ô”
+§ð’²Y!ŠP†!0™ž¨ætd
+ëDµ†,©Õ¤#N­&YhÈBá¨âRଵ>iX³Ö+d!Èp)Â\´·'O;ÞÖ`8F8IwBê“ÚNÈõìŠ Ã!pbÒÞ8§À“õÆWˆ"”aܤ”bÒ8ÞeXQ„2ÑÉ«"‚)!†
+q0DÊ0Nq¾±òë㦞”×ý²d8nÑ`¬3i¡y8qĶ!ÈpüÉXåm%Õóšµ^!ŠP†!p¾›ËämQÖÈSC†GD¼?ÏJøåPL±º#Àðéšðfˆ‰®	/Q‚!A†C<YOŠ«îIb0Û:xyúDÈ'|öå²d8¶—¼±Mu©µê½®E(ÃIZõ¤+E]ûd+E²d8DB
+S9j¸
+à
+]­C‚‡HRµ¤ÕËá×w½
+Q„2íh©iÉƍԭd3d!ÈpuŒí9l=‡"ÈpœÊK=­w‘ëýËØÊ0DBK¨×zÜU‘ì^o
+Y2'S’^
+P´’Ý
+·B¡C`K[+'K“øægËëhoŒ
+!MM+ÈŒQ~\þ‡ƆÐMŠ,œŸa†,!-з"¤ÆÍ!!†
+tuæ
+§8K²™+†,ê¹$…ÃéÁ’lNC¡‡¦¤µÊ#Cò’Ý*B‚‡ÀM%ëì(nb(ÙfG5DÊpˆ]]Åõ´Åvujˆ!Àð©òËÚ=ˆ¼âv2d!Èðˆ‡!Ì…XÑ,ÕVï5d!ÈpˆÌ]5—Ú³´uk‚†,áÀ¢qdÄÑ-†(BjkÅ)ØÝŠ7B†GÈk•®»ÔÐ-/Ãv©1d!Èð)E¯ŽŽMŠA±»£WÈBá2²(£éžAÔgíøgˆ!Àð´„õYûa¤¤¿
+¡í‡aÈÚC†ß13©-Ù˜¬ÁJ¶†,!Iõ†è4yíÝÎP„,ßyC˜ê¸³F·‘!ŠP†ß£(ˆ¤óÚØ¡Z“ÍkkÈBáÒª×uW at Uwƒ!ŠP†!¸²f½•ôÁ—+v+)C¡x¢×k㚏Zì~m
+Y2B©–µ³\’ªV·³!†
+ø›ÿýùóí?ýé§ÿðíÛøö§|qáÛ߇7ü}úúV$ïc½áŸŸþÝßýÓÏÿø_?ÿË?þùï¾ýïoá?æÿ§ÿþÓþÓOÿUâ3R¯c¾RӐW|Ïo}]úüÃÝø¨zó3ÞÅÆͨ_üW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷­Û§ûN·{Ýpêö]7œº}×=ýW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îÕ½º-xÝàu‡×§îØuã©;vÝÓu¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºW÷ê^Ý«{u¯îoZ7zÝètóãuÓ¡«^ÕMG¼‹MÝÓu¯îÕ½ºW÷ê^Ý«{u¯îÕ½ºÿGÝäu“×
+^7Ÿºa×ͧnØuOÿÕ½ºW÷ê^Ý«{u¯îV7{Ýìu£×-§nÜuË©wÝÓu¯îÕ½ºW÷êþMë¯[¼nòºõÔM»n=uÓ®{ú¯îÕ½ºW÷ê^ÝM·zÝêu³×m§nÞuÛ©›wÝÓu¯îÕ½º¿Ýæu›×-^·Ÿºe×í§nÙuOÿÕ½ºW÷êþbÝîu»×­^wœºuקnÝuOÿÕ½ºW÷w¬ëŸ®ùߧËþ÷éÂùûtꥮùUwÿ}º/þ«{u¯î_®Ûý½LÝßË”ý½Lá¼—I½ª{Þ»´ØÔ=ýW÷êþ¡tý9ÍîÏiæáuÏsšêUÝóæbS÷ô_Ý«û‡Òõçº?GPü9‚pž#(û9ó3Þ²Ÿ#ø⿺W÷ßD×ïÛì~ßfñû6ùo³ìû6ͯºû¾Í/þ«{uÿMtý>¨î÷A¿*œû Ê¾*œûœÊ¾ê‹ÿêþÁu‹×-^×ïgõÔÝ÷3˜_u÷ý_üW÷®ë×»_ÿ-~ý7œë¿e_ÿ
+çúnÙ׿ø¯î\ׯÓu¿NWü:]8×éʾNÎu¸²¯Ó}ñ_Ý¿’®_Oé~=¥T¯;NݺëŽS·îº§ÿêþÁuý<÷óüÅÏóÇsž¿ìóüñœÇ/û<ÿÿÕýëè?ÿ<üüsñóÏñœ.ûüs<ç—Ë>ÿüÅÿ7§ëç'‡ŸŸ,Ãëžó“êUÝsþq±©{ú¯î_I×Ï×
+?_Wý|]<çëê>_Ïù¸ºÏ×}ñ_Ý¿’®Ÿ¿~þªúù«xÎ_Õ}þ*žóSuŸ¿úâÿ›Óõó9ÃÏçT?ŸÏùœºÏçÄs¾¦îó9_üsº~~cøùêç7â9¿Q÷ù
+ó«î>¿ñÅÿ7§ëÇûÏ÷«ïÇs¼_÷ñ~<ÇóuïñÿÍéúq÷ðãîêÇÝñw×}ÜÏquÝÇÝ_üsº~:ü8´úqh<Ç¡êUÝsœ¹ØÔ=ýsº~<8üx°úñ`:ǃu¦s¼W÷ñàÿ¯¤;7.›†Óõã²tŽËê>.K縫îã²Óÿ·§¼®U?>JçøH½ª{Ž›ºño]7z]?Ni~œ’ÎqJÛÇ)釴}œrú=Ýäuýx¡ùñB:Çm/¤s<ÐöñÂéÿõt³×õýöæûíéì··½ßžÎ~yÛûí§ÿoI·‹½…uÛË\ýööò\¿½H¼«ß.јÆF̧ÿ×Ó­^·zÝìuÛ©›wÝvêæ]·ýVt›×m^·xÝ~ê–]·Ÿºe×í¿Ýîu»×­^wœºuקnÝuÇoEwxÝáu›ÓÍÏ©Û6ÝüœºmÓ=ý¿šnxœ7<^·{Ýpêö]7œº}×
+¿Ýàuƒ×^7žºc׍§îØuãoE7zÝètûãuÓ¡ÛŸ]7º‹MÝô[ÑM^7yÝàuó©vÝ|ê†]7ÿVt³×Í^7zÝrêÆ]·œºq×=û9Á{ƒïotßßÈg£ïý|ö7úÞß8ý¿ž®ïoßß辿‘ÏþFßûùìoô½¿qú=]ßß¾¿Ñ}#Ÿý
+õªîÙßXlêžý_M×÷7‚ïotßßÈg£ïý|ö7úÞß8ý#øv?øv¿ûv¿œí~ßÛýr¶û}o÷Oÿ¯¦}»}»ß}»_Îv_½ª{¶û‹Mݳݏ¾ý¾ýí¾ý-gûÛ÷ö·œíoßÛßÓÿëéúö7úöwøö·œíïØÛßr¶¿coOÿˆ¾Œ¾¾,g;8öv°œíàØÛÁÓÿëéúö7úöwøö·œíïØÛ_ó«îÞþžþ½7úvpøv°œíàØÛÁr¶ƒcoOÿ¯§ëÛÁèÛÁáÛÁr¶ƒcoËÙŽ½<ý#úö(úöhøö¨œí‘zU÷l›ºg{ô«éúv0úvpøv°œíàØÛÁr¶ƒcoOÿˆ¾=Š¾=¾=ªg{4öö¨žíÑØÛ£Ó?’o’o†oêÙ©WuÏöh±©{¶G¿‚n)¶G™uë\<SÝúò\{”%ÞÕI45îñ1Ÿþ‘¢×¦;žÇë¦]wyU7ñ.6uOJ^7yÝàuó©vÝ|ê†]÷ô§ìu³×^·œºq×-§nÜuOÿ¯¦ë½©xÝäuë©›!
 vÝzê¦]÷ô
§êu«×Í^·ºy×m§nÞuOj^·yÝâuû©[vÝ~ê–]÷ô§îu»×­^wœºuקnÝuO^wxÝætÛsê¶M·=§nÛt¿øóã¼ùñºÝë†S·ïºg=¸ØÔ=ý¿š®¯Ÿsðº¾~nñÔÝëçvÖ¿Ï^?ñg_?g_?_?·³~{ýÜÎú7ìõóöõsöõsðõs;ëç°×ÏæWݽ~þâϾžÌ¾ž¾žlg=öz²õ`ØëÉ/þì½ÙדÁדí¬'Ã^O¶³{=ùÅŸ}=™}=|=ÙÎzR½ª{Öƒ‹MÝÓŸ}=™}=|=ÙÎz2ìõd;ëÁ°×“_üÙדÙדÁדí¬'Ã^O¶³{=éý² œYO&Ô-<âø¡Ñ]=)Põ2šþñ.6à_üåqÞòxÝîuéÛwÝpêö]÷ô—àuƒ×^7žºc׍§îØuO‰^7:ÝøxÝtèÆg×MG¼‹MÝÓ_’×M^7xÝ|ê†]7Ÿºa×=ý%{Ýìu£×-§nÜuË©wÝÓ_¼·¯›¼n=uÓ®[OÝ´ëžþR½nõºÙë¶S7ïºíÔÍ»îé/Íë6¯[¼n?uË®ÛOݲëžþÒ½n÷ºÕëŽS·îºg}´ØÔ=ýÕ×Õ×Ñ×ã¬7â^oŒ³^ˆ{½ñÅ_}½Q}½}½1Îz#îõÆ8ë…¸×_üÕ×Õ×É×ã¬7Ò^oŒ³^H{½ñÅ_}½Q}½‘|½1Îz#íõÆ8ë…´×ޏ	
+jQNÊ­µ?±ÜÒ!ÑËϸ‚!AÆWD­›~Ýôó¦ß¾èçC¿}Ñχ¾C Gr]-=jQ?Jk¨úÓrKkD/?ãr†,_-x›þpúá‰_ôǦïª?6ýï ¸Ü¤úÉë¯#èçSùU?Ÿ±/„ê;r$~âP‹ús"a-ÝL+¸¥¢—qyc_0¾ƒàŒê÷M¿núã‹~=ôÇýzè;r$CbW‹ú2®]ßÿµ‚[!zù—G0ö…
+î'
+¢í¤âr†,_œ¡Í¿@x}7w¢úc×wÕ»¾Gà‹pÿ{ÈjQ¿joí£–ÛO´íG\Á… Ã#*køµQ}a¯šÓÖv½üŒË!²dxDa
—[!aO¿Gd¤H„?¨Eý$¹Aõ_«ØyM¢ÍϸÁ…Ðø"1Eÿ0?Sôðaž3>YOŠUìì Ñæg\5±/„ÆïH´?˜‰Eý¬¥õ£–µŠ^~ÆåZ†(BÁø/Õ®––ð™Ví5-»)zù—!2DÊpôJ¡?©Å&¹!ié™–Í]+zÍn3.7CΐÁAþg
+¢Ø¥!%Ns¯Xv¢ÓêÝ ®QÎØWd8Zä‚ý˜‹9¼Î¯4÷¾Vµ½ŠV?ãr}Å
+Š:¥)JÛÖîYiÙqÃÊ’rPäÛïiÀ\K‘E³1¡xuø(
+P¾;Q¯tÛZ
+)Eìo
+~Šçñý¯‘XîO£×ÕÏX­Pê¤ÇÖRäHYpŽMá_Då_cÆr‡x_]ýŒ­²u•nÛÚJw~ïXpŽÍÆë+býûö–˜ï%Ϋ·9Vk·•ºÒmkSøH)œcSÜzBlõ÷‰ùñÄÝzR쬶S©+]¶v…­—B9v«Â~ªþ(`L©³"î=µ7cçªÿ­^é¶u^°^ŠØß$¤ýäøØ^gÌwØð´Ž\ýŒ5võJ·­¥ð‘RÄþ¦hz"\ÿµ?¬(óžxo®±Z»µÔI­¥È‘²à›
+ºyE,Þ×ÓíŸy½|w®±j»”ºÒmkSøH)œcS<úEè۟܁ëŸg ÄÙ{V±å;[êJ—­]aë¥PŽ]ÁR?9ÿ¥ßì1¦ÔÙãê§g¯(6jîJ©+]¶6E¬Gá»B5ÂhJW{q´¤8¿WORlÔÚIQ¯tÛZ
+)EìoŠ¦<jÜו˜ÎðâŒi=(¶ÚQ'=¶î?Y/αÙø¤àú¯ý>¯Ä”zó‰ûíU¬Ön-u¥ÛÖ¦ð‘R8Ǧp™yt~—'çg‰ɍØu¬¼VWºlí
+[/…rìŠK
+òç®õBSjÇùï<=Ä®bÇ¥®tÙÚ±…sì
+=‘KåOëU0¦ÔY÷Q¥±k•«Wºm?Z/Eìo
+?Î?îš/ʘ΀ïòìaÇjîp©“[KQÏ;œc³ñé÷Cíš/ĘRïO˵‡bµ¥i©+ݶ6…”Â96…¾×ÿìr”bL©ç›§õ»cw­ÝYêJ—­]aë¥PŽ]1dƒþ'þ¡züOXz¼G[¾#¥®tÙÚ±…s슮#\mÔ#1áëxZn=1v×ÚiQWzl-…,¶¿)Ô#¾Éºæ0æ3ÌÇmzàX±ƒR'=¶–"GÊ‚sl6=³[éíLL©ƒOËob5w¦Ô•n[›ÂGJᛂbVí,ú03¦ÔùÇåÒÃسúÿQWºlmŠXÂ9v…Þˆ‡ÛËtMÔ`Lgø<-ÿzŒ=µ;LÔ•[Ká#Ë‚ío
+~šæ‡’õÿIPɘÎðÌ÷¤÷ Øê;DôØZŠ)αÙxtÍji¢c>î8­'ÅVÛ)êJ·­Má#¥pŽMqé
+éç†*cJí¸ã‘§‡Ø[¾s¥®tÙÚ±…sì
+6…fÓZéê/¿Ga~ñ^(öÖØEÔ•[Ká#Ë‚ío
+þ4óÛߝþqŒéJ¼½g{Ëw6êJ­¥ð‘eÁö7zC_µºÞÏ7ퟎ7þMëE±Õv‰ºÒmkSøH)œcS¨‡ô>¬ÿ›úGˆù³Æ{Ç“Ü3öµª»£®tÙÚ±…sì
+1su-”Ô3þÕ±SÏè•bkì*êJ­­„èȲ`û›OW¤ß_¥1æ3 Äå×cì[¿Õ+ݶ6…Ž,…íoŠGWDÿ·ÞÄë²|o³#س—»cå»VêJ·­Má#¥pŽM1tEœя·%¦Ô†'îÙŒkGÑRW:míŠXB9~(ˆNímÖµPö™½Í:âîÙœŒ±smMfõJ­¥Ð‘Í‚ío6>]‘ÚŸ¿göŸÁ@®ÆOO±ÕvŒºÒmkSøH)œcSܺ"îеô™ýúqâ‰{÷Çjï‚RWºmm
+)…slŠSWÄý:gq½óž󎛊µÚo³Ô•.[KQÖ­HŽ]Á¦Ñ)þÞ´iïþÞ°#ðz®ØbçQ]­Eè}dY°ýÍ	*™Þ[bJ½N\ÍåÜŒ•ïj©+ݶ6…”Â96Å¥+¢ÿg{¿+1ŸOÜÞ›ŠõòÝ,u¥ËÖ¦ˆõ(œcWPZ­½ì/œY­}GÃÕœ¶ØZ;-ê•n[Ká#¥ˆýMÁÉ)þÇ›Ät†‡Wӝ›±j;•:é±µ9Rœc³A-8*1]5H¿sþñáj*7bßÊku¥ÛÖ÷'ë¥pŽM¡©sçØö¨¾è_ÎßÏ_všüݱ³v~-u¥ËÖ¦ˆõ(œcWÐ5G˜N0ØÏðâjÎäž±³ÖŽŽºÒck)|dY°ýMA2(
+sÆt†gàj’›±wßê¤ÇÖû'ëeÁ96ú"Ü ÚŽšŒ)õ:x5΍ب
+žK]é²µ+l½ʱ+Hhpé7+fÆ”Úï\íòݍz¥ÛÖRøH)bSœ:Bÿ×v?-1¥g®ö÷ÄÊwµÔ•n[K‘#Q$Ǧ`W
+Ûߏóðûwob¾CœÑ»w9V{w•ºÒmkSøH)œcS\ÎÃç/0Řïg¬§‡Ø½ž]Ô•.[›"Ö£pŽ]A41ðýÓz±Œùû//âÿ»cwF½Òmk)|¤±¿)øi>oŽÿ5­—ǘïpàj¾\=b5vWê¤ÇÖRäHYpŽÍ‡âNÍ¿hZ¯êÌü‹†ÏÌžPl͝(u¥ËÖ®°õR(Ç®Påáø—'&3æ;œoüíÑ+Åž»Šz¥Û֦Б¥°ýM¡_Dü£i}à3ü£aÅá3ô±b¥®tÛÚ>R
+çت!}µ>&c¾ÃYã>ùz2ö®ogÔ•.[›"Ö£pŽ]ABzÊÿÙœñÆÄU\MJbËw9ê•n[Ká#¥ˆýMq:Ÿ¿Ö+`ÌO˜WSO±;.u¥ÛÖRäHɱ)T#~œÞ´>c~³Åûzö¸b_͏ºÒck)|dY°ý]Áù
+ýþj/#æóÏïkõë!ö¬ßßêVåC¶–"GÊ‚sl
+ÕŸê_ñRÆüÏçKí‰Ø8VÝuÕ®´µ+b½,0ÇO…ŽèýWÃ`dÃãyÆùÅÍŽÅŒµ_±Õ+=¶¶·[ßßeÁö7Å¡#·Ï'æöÎؙ܌}Ûù¥Nzl}²^œãOŠvìçGl;ÿ³Ÿ¿:ÿóóü›"ç~žW…6|þ'1Ÿÿ›±VçGìÙÎ/u«ç/[ÏŸ¬—çØ'¼.ÿGbþýûŒ])½ˆõ¶•©“n[›"ÖË‚rüPðŠzwúHÌç¿gîôë«ï`u¥ÇÖRøȲ`û›¢ëˆë?‚¹ÿ›†÷F¯Ú‹±­þ³ºê?ÛÚk·ñC‘{
+É#'ךéob.?ÇT{õ&ÅÎZ»)ê•n[Ká#¥ˆýM1”ç.ብüÌX¯ß±wýþVWºm½×­G‘›B5’ÖÿjZ¯idý/ÔŸ3v§õ†ØZ»«Ô•.[›"Ö£pŽ]Á¤1ôþi}xÆüüf;êýbl{w¬®tÛÚ>R
+çØlŠ¡þ§ËëHÿ1Ò{dìZ}Ǩ+]¶v…­—B9v‡ÇuêþY11–럱cÝߌÝëÚ­®tÛÚ>R
+çXŠ[5„Æ¿çïu$æëŸ5NF¯[c×¥NºmmŠX/ʱ+tEwßZŒUÿc\©=»·ºCê•n[Ká#¥ˆýM¡é~ôüÙ_dÌý¯YãÜž=¡ØslOWêJ—­Më£~¡öGGˆÆӏí	"æþ'r¿é½#&²ýé®tÛÚ:²¶¿‹ÆxTÿÞl˜1æþ÷,ñOjOÅ¾í·“:é±µ9RœcS°k0[6:?&cî¿C½è	Ò6þ"õ³ñ™¿üTøȲ`û;¡Ñú?7u”Fæß5tÄFfÏ9ö­¾«Õ•n[K‘#Q$Ǧ Š_ÛøcÎ?kü÷-û3ö­¾³Õ+ݶÆ­/…í/…¦FŽO¿ÿ3ÞÄœg¬ß—±í·³:é±µ9RœcSÎz™åÿ¡£
+[/…rlŠ=âKûÎ3ŒÄœÿž¹‹ï"Ö6v+u¥ÇÖRøȲ`û›bèŠ8þ<Ïð&¦ÔÙâ¸ÚÈè
+b½ÆŽK]é²µ)b=
+çج¡.LmæÎÄœ±£Å>bwõ¢®tÛÚ>R
+ç(E׌ ÙO}u†/1åŸ=®«Û{F±³|gJïÛZŠ²^”cWð˜-Ý?_TÆœÿ:£‡Œ=ëtÛZÞM9Òrÿα)X5^Có‚zÆ”zAÙŒ5wÁê•n[›BG–Âö—¢ùˆüÿ411åÿúŒÅ{O±å»uÒck)r¤,8Ǧ Š¹´þ]×F•WÖ¿ëØóÊêuŠ­µë¢^鶵>RŠØ_
+m
+siý¯®q¯¬ÿ5óP·ØŸ±µvW©“n[›"ÖË‚rì
+zÄÌ!ý´1#cÎÿB}Ä>bÕv,u¥ÛÖRäHɱ)T#ßÜÿºkc2Æ”:xÆØGìé+¯Õ•.[»ÂÖK¡›B+”\Ï¥ó³¡Î˜òÏŽÀT'7cï²nuÒcëý“õ²à›‚DêzUþ40ɘR;Ïï5ÄÞ­ì|¶–tÛZ
+)Eìo
+zÈ\/Ç¿»ÖcL©÷
+µ½'ûjìºÔ•.[»ÂÖK¡›B™³NÿULŒ)õ¨3þžX­SêJ·­¥È‘(’cS°DÎ*ÿS~Sê :Þ£iµv´Õ[ºmm
+•÷¥°ý¥!¼Í¿dLùßµk/ÅÖܹ¨“[K‘#eÁ96{(³_ ûgÿ„1¥ÎÏÝŽø×2¶¾QWºm-EŽD‘›‚M“»ÉÿYûU0¦Ô»CÿfÄúæ»lu¥ËÖ®°õR(Ǧ¸ù)ºû-ÿw~¨SêüNuüÛ«µÃJ]鶵9Erl
+zdÌ~ªæ?Ð_‚1çg,Þ«Š-ßÕ¨+ݶ6…”Â9–BK3ÝZ½k¡²;ë¯w,„vgõtÅÖÚéQWzl-…,¶¿)|„íï~³¿Â˜RÛ,qcdöbWµK]é²µ)b=
+çØ$4÷%ÿs
+Ì1æüߌ¥}¥Øj;E]鶵)|¤αZ
+é¾Uÿk¡$Æœ¾ñWjoÆîUw[]é±µ>²,Øþ¦ ‘¹5þéùy÷]óÛ¼ã»f"¶Æ.K]é²õüqváR8Ç®àåýpý
+ϏdÌùç/þxõÇjíŒRWºmm
+)…s,ÅÇ/ôýfþ땘ó?3¶æ¿"¶Ï•zÍ•­}þëûC‘›‚]Ñû“ÿåˆ)cJáû÷$cßØîNÖ+ݶ–ÂGJû›‚Eãþ^ßÁ—XòϘwÏbì9jï¬RW:mýPØz)˜cSØõ9nÍgya,ùg¬eÆjí´RguµØZ««åHYpŽMÁbÖ,Z€õcÉ?cY½N±g{vRWºm­Õír$íäØDя÷ÿ<Ø1~jÿÏcÌ;®Ý;Ûöî´z¥Û֦Б¥°ý¥Ð§ùéZÿ\þ¢Œ9ÿ1cwÙŸ±s­]uÒmkSÄzYPŽ]Áàs>Zÿ„BÆt†y!Ï9ò|m=;«“n[›"ÖË‚rì
+¾‘ÏÐú*Œ9ÿ˜±”/Ŷ²cu¥ÛÖRäH•PçØ*Ç¿g?ýMÌùç¿<zíX]—ºÒmkSøH)œ£Z™hþàxü/›eŒ íýnütztŒœÕnŠÔ©6³Òc7¹%_éÇ/üýÝþíüÖö¿øý×üëoÿþïž_߯¿þÓÔµ_ÿ®1¹ý­y?3á÷ßþÍßü·lÇÿ_ù—ú‡¿ùõ¿µÿpýÛ¿þóoÿ鯿ýío-ƱŽÑÓ¸µƒƒïõ‰á÷Ö†×òk7ƒÏ¯—?
+r(v°ßƒÉö•ÿ
+ŽŸA;›³õŸÁ®`›Ás}âãgP×;ï@ ØAÝÛýþr&ö¡þÔÙf3÷ëç
+êÒïyC]g»ç]ô{}¶ógðUpÞEÿ*xêÞæ›ô#èk˜wqêæÏùç
+ê®÷gP—sÍK?u9×¼ÞS×pÍë=ßÔ5\óz‡N<›
+œW6t
+ócö
+_üœq® N<[{ZˆۈΠN<æ5xÁ’(âl:ñ4ô]:Û4ÿ]:Û<éwélóR¾Kg›×ú]:Û¼™ïÒÙæ-j
+wüþ.í„]m>ºïÖ)æ³ýnb>üïÖ)æ¯óÝ:Åü%¿[§˜¿ïwëd·Ã‚ìÎÏÎwë.fûb–<-HÆ
+H¿GvgÙýÙ=f¶G×{ ›ìÎá{d÷˜gã’‚ÜÂðãì6î&¨‰.Øy‡‚Ðò"±Ýܧž¡,}S¿OƦÍyҏ«ž˜<þ}2†wˆk	œ/Ã'(ʬ㴣ÒqÈV7=]ÐüQfXF°ê÷qÈ
+vÀ9™Án4š)sbàYCÉvI?ô“5—n»7zw¹“ÇÑdk¼iÄëå#¬kÀjLJÞÉqð8óbp~†_…aGïw8ôVq¥þC/Љ]Ë4£æ<±žØ¡—圤z/NÞ»Þ†ùÓ"ÌkæŠã‡ŠûÉ{T!?±ú¡¢}bUÐC¥øÄ!‡Ê.œ(šVòÂ:¸3¬rÚ±‹ƒfØhEჽm­î{¨$b¦ßl4IÏëT©ÃÆÈ3,=•°~ÂŽÊUÇ.1‡Jf̵Cõ{çõ¼¼~,ðÓRƳ}ó~¯ÞóV°÷º*ùvatöŠÏ6¦M®HØTvoªÇV*múÝ‘m†y8å”ð:œK#=˜„°4¸Ç¦Š?Éó^îÅ®ßŨ5Ud(²3;ïHk¬“:ÞΦ•¤:j‹–Ï­±‡…õ f˜•ÖfBøf+]7¾ÿ˜¬ˆðÉ0ÊOãÎÞؼ-Úñü_[ô±¦ý;–4¾—èû!̼ìt¾wè“"̼˜øÛ:?‹³Üܹá›ûòb2qv¨ïð÷nñýÆê¼Ú¹½ßÜ)œe¾ÃkÀ;šwx0xwqÒ$ïôÝQS{×í®]¾oG9ÑnÔ}ð¼z&Ü	M»4ƒ1fÇd.âÝ‹û‰µµ“pçÎÚÕ·Ÿ(?Úa³d·ÛÎwD;Ïv¾Ú¶sÕeíÈÊ…™¼;jï­e§RÌëÌ®¡½á}Ñžï¦ÙY&µ³%æÅe—É~x=†Ç™Ý;ª'ï„Ø>î|Ê{i÷äïØð©ôn}\´Ô;çÍ_d»öj×@Úy©gÙæ"ÇÞi>{×3,žÈÚ3®ìÖà᝹è	à]²ÚM=?$ôðîQØä#;9Á&»*µ‹{z°\q£ï6„Mb²óOãN»Ú…‡§ñŽ8ó²Zv§™·ôd§˜¦yøŽ4í™Â÷/f7þTÞYdþ´gvù`ñŽ
+ŽoÞýbÓ';Q48äyWˆùªŒìÐÐà(èÝwí\0«€3»4ôZ¼¢ãzžZ]ŸÕ¢WºgµëUç§äÈ
+ðíàúÓ|GF½2:?™^¥k/þáÉjín´_¼Œ6ZV^Ñ-A/.µÔ¼ÎóÇe•ùPÑÒöêǬv´1†#¼&0Ò¼<ï‹:YMÝUˆ”︳~ì;¿m^Êõ=kUÕ›˜iÓ·¿YkôÅÒ.ZöóÏÚ+p¾}d1Lå×LÚç,l˜à¶¼p"Îæ5ßù½œà‹Ù㪏߫e‘=܅׻ýyé9ܱWÓ¢kü¼XAk£y™2´ë½bÚÉ^¼­Q¯£õqÙ(~èÑôòêRŒéUgÅ‹.±ÕàfQ8³¿À^h~ðFéi\”VæðëäÅkæá–…døeð¢.³ø~Y`¥á¶¼Ø	k\/<ÒÐ,ð" 
+›NxAÖp^£¡)ã…*fmôfѾ–^À¡¡IçÅ|ú¼°ACC׋ЩÏþùÖzò=ö(ÊDxV+ž”>µ'ÄçÛsd²ö¬ªÎLœžoƝI̳ä™PÌòîɽ³Æ~2ÑëagÒ+Ë®' Îûe2hG‹Ò31¬ŸI’³ôõLXìø-<yk\f"_G5áIu_QOp›e©g²K'~õÙ&Ê$,,!‘	QMLONšEäËD!+eÒ©<¦Ã„'³tô¡<±d~†LòÀÚ,™p1ï¨gòÃüÌŸ™ˆÐ9ñMÝ2,aýÙŒèq–ïÏ×â¸NPm'r¬}‡îùÓŽ8W³‰cGçŽ.¬Ž;úcv
+,RvàFÄg×Èê³7ñdp{»;Íì‘yЗ›{
+λÐëùÜç
+Â.oèÁm:8¿jŠ°Öªà=ƒ¼¡w–‰´¼!̯à´ËJ“±VÙxCïx+xÁoè½·àR‰'SÁ+Ð6+ˆ£¼¡—é NÁB½ZÁyT<䱂Àž¼!Â
+â(oÌ®‚ólb/Àl„`(øTð:‚SQÑVÞ`V!x|+øÀ«àXAXÐ
+áwspþ$Æ´xS+Ž«šw[Áþëý=ª ²é†À«üzzßè½¼Vg»|Vð3HZ‚¸ÞWÁ¾‚°û)8Vð2@ [BôÁ®àû3¨ëmŸ±²Þ+ø,ï
+~ëlëúQWÖ[]o‚Ý°Y÷Æ^¬n>Á×ÜYª¯Ç—ài=Ðé0wÉ«àÍßMXÐÜL¤‚w4ZFÐ(0FÐÀ˜æÎàœ	¯A£-mý‘g?)¿FÐ »þ’}¤Æ:ñ(D#h˜7‚ÆeAãqAãáAãÝ4‚Fa1‚FÙ5‚Æf÷Ý•’4ª
+#h4±Œ QÃAèA£eýžo4ZÌFÐo/ï¹4š×FШ ~Œ Ÿç
+‚2‚~îBÐèkA?àäúŠ 27‚FkÉúA1Êçà‚F÷ÀMu#hô‘ ñ™1‚FÃúžÅÂÓìýa¿Q<=&„š@éµ4Gi>(¼Aг­MV¯úìÂûæ
+Ac;á èY·ô h
+K	AÏ:ê‚ÖPš4Ö 	‚f_Íšã§FÐ[7‚žUñ=+ëBÐ'ºÒFÐó‹pAŸ ˜FÐçCê±´Qú$!‚ÆAÐ'šXFÐlÇA³•iÍöŒô8ðû
+AëA†ò)=Q³Zí-=P¼Œ ‘¯ôèO!èyµ-z {n=æMA
+AA
+A,,=†60gÛ
+_##èï•ô ‚ÄæBÐãæV´º†›x™uì
+«ÆÞ2aÕX~;¬š‹§›Uc?†°jìVÝñ‰5«ÆaÕóUêçëý†UsC³êþŒš¸ÓQÿ›UËi^¬îßaÕõžY5ë³êŽ¾¶Yudz
+«Æ#«F]V}€‘›U·c±j4ÙêqêÑD«F_,¬zV(ŪÑö«ž7V¬¯nX5Þ—°jÔEÿ?¬úûWXõ³±j¼R‹UÃX5:
+aÕÿ_\=ÝÆ-܃ö¸¼íÉyýÚsüÚ…ôüt+¶¯`i†'ç`ùlîÁ×®“Ï
+t†£fGHóuŸ+ØCš1šð#X¾•?‚v³¼Wð*÷Øëü´óe[Á#¤ù"Ìvð	iF+³‚#¤õS[H3<#+ø†4_$ÍŽfTbl!ÍÏ©à[>¼}¹óÉ›Ìô¾‚-¤-¨
+>!ͨN*x†4_òHð(ß`_:Ó2ÁÒLÏÈ‹4`´Ë»x[+Üu¸Õó¬àeÒ,É[<‘Aš*x›4Ëu2ÁnÒ<ƒGé],WÅûZÁÓЙ•	^Îë«àg8Ó$8B¥OtÁììŒO~ËïþVqàl‚¥Ú·²‡UÏàYA€¸8\ÞqŒ…­ÉÒ¾å…iéAíàwéó¶>áñ• |Wí¯	è,V
+— H¨8fÝ¡~
+[ŸðÓNð¶>é#m?Í+Ø.›fÕέ`¶†ï¦±5>9ÆÖèÅ[£!flF‹Yõ‰§“`¶>Q”í+Jþ,×LÚaT؃­1mlÝqób`vøóÒƒ­ña4¶îwa뎲sI´`klÅ`lÝéOívü¶î¸·ËT£<§;=œu
+Mä3x[[·¯<§’Œ­Ñ2¶„2¶nøÝnk¯`k.cëv•ç4ÚÎÆÖÀgÆÖè…[Â[·^žÓðí0¶â1¶F§ÎØú ?µxF?ì’ð¶FKÁØm.ck Ock¬¯ol
+Ïck°Wcë׫Zî€G•±µ°©ê.´pƒ­…PU÷Dɪ[„S…,aÙغcÎØ;Õ[cÖT°õ,eW°u§'¢›’ø¥Œ­;~lcëþswc¸òœî±¯ºI±r°]¶îxU­ûÇûú$æ¶6º•{	±ÑaOÜ£<§ûGoc¹Ð¼ÂÓÂŽ¼ßËxñ¶–Ç­ºôý%¾¥'n¾>Ü”º¶²¶–·îÏݧ°õ{—çôÂÖ/=­…­_à<ck"Qck…P¡	žVø,›…§¯…§‰ª§éIl<ýô…§éµl<ý¼O£O¿×ÂÓï·ð4q¹ñ4<8§?!iý.ÄÇcýŽñ&2¶‡4½¢ã!ý-i”ŸxH_O³ìOËëZx=¿àé×æדף–<¹ýþ¿6»Mv¿_Oóu5žæm<­ÒÝ|oÀdÂÓ&ž>é
+,<mäÑ‚§gýöO³7o<­!ãéNoiW£wyHOcYð4ÜÉ‚§Ï±ðôIþÙŨž&Ê4žËC˦žFû$xD'xšXÓxZ(Ùs‡€Ë§¯¯žž&Ö4ž¾©×}Ýø팧é…|Æ…ä.<ý<å!å~OÃY4xšóÆÓ/1qó(îSxšCDÆÓ*0žFWÐxš#ðÆÓãXxËœ.<
+lj<M`ãi÷ÂÓx¿Œ§éUl<݁>ƒ§1”<ßÈxšÃ
+žF÷7xh8xú¡‹õe7Ý^xZ.ÓÒcfNð4êäàiîmi<=PðttŸ>íŠüOw"Wáiâoãi®Qe<ÝÁƒŒ§µwV\©ïg¹R÷…§ÑèžFo)xÀ xú½îÂÓž~´S†ðè(WêïÄàiíŸ!<
+<uEƒ§/àlãi€£àiЕài¼/ÁÓ:
+ž!žF?xŸ„àiÑài”Ÿàiâài|r‚§\Ž§K<=6<=Þ
+OßOßwái®ãm<ùž…§·ð4 at Mð4ÀQð4øWðô5ë¥ài¥OgO£êžÖú¡ÂÓ’ž~®ZórþŽoðtÃL6ãiV»ÆÓ
+¸Êxº¡“o<ÝÐqžF×(xú˜×<}Ìw!x]ºàéwhãiô<ƒ§û¹ð4šSÁӨ߂§Q4ƒ§QO£º	žF<SOÃE9xúš¯Sðô
+whãiìû<ý£ð4<´Œ§;¦<OÓEÃxš®'ÆÓ¬Œ§Ù7žî ÆÓl?O£<.Yð4Šfðôñ…§g»»ð4Šið4fCžþ{³ãY,ÿe±j8z½\ÞÏãžeíþ×)þÛßþ×Ìë¸endstream
+endobj
+6 0 obj
+35177
+endobj
+4 0 obj
+<</Type/Page/MediaBox [0 0 612 792]
+/Rotate 90/Parent 3 0 R
+/Resources<</ProcSet[/PDF /Text]
+/Font 8 0 R
+>>
+/Contents 5 0 R
+>>
+endobj
+3 0 obj
+<< /Type /Pages /Kids [
+4 0 R
+] /Count 1
+>>
+endobj
+1 0 obj
+<</Type /Catalog /Pages 3 0 R
+>>
+endobj
+8 0 obj
+<</R7
+7 0 R>>
+endobj
+7 0 obj
+<</BaseFont/Helvetica/Type/Font
+/Subtype/Type1>>
+endobj
+2 0 obj
+<</Producer(ESP Ghostscript 815.02)
+/CreationDate(Wed Jun 30 18:55:00 2010)
+/ModDate(D:20100630185544)
+/Title(wfc1.eps)
+/Subject(gnuplot plot)
+/Creator(gnuplot 4.2 patchlevel 2 )
+/Author(Paolo Giannozzi)>>endobj
+xref
+0 9
+0000000000 65535 f 
+0000035484 00000 n 
+0000035625 00000 n 
+0000035425 00000 n 
+0000035283 00000 n 
+0000000015 00000 n 
+0000035262 00000 n 
+0000035561 00000 n 
+0000035532 00000 n 
+trailer
+<< /Size 9 /Root 1 0 R /Info 2 0 R
+/ID [(Å3‹¯ÕX®‘X`š1²Ü)(Å3‹¯ÕX®‘X`š1²Ü)]
+>>
+startxref
+35845
+%%EOF

Copied: trunk/espresso/atomic/Doc/pseudo-gen.tex (from rev 8077, trunk/espresso/atomic_doc/pseudo-gen.tex)
===================================================================
--- trunk/espresso/atomic/Doc/pseudo-gen.tex	                        (rev 0)
+++ trunk/espresso/atomic/Doc/pseudo-gen.tex	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,1532 @@
+\documentclass[12pt,a4paper]{article}
+\usepackage{amssymb}
+\usepackage{graphicx}
+\pagestyle{empty}
+\textwidth = 15.5 cm
+\textheight = 23.5 cm
+\topmargin =-1.0 cm
+\oddsidemargin = 0.5 cm
+\listparindent=0pt
+\itemsep=5pt
+\def\r{{\bf r}}
+\begin{document} 
+\title{Notes on pseudopotential generation}
+\author{\em Paolo Giannozzi\\
+Universit\`a di Udine and IOM-Democritos, Trieste\\
+URL: {\tt http://www.fisica.uniud.it/$\thicksim$giannozz}}
+\maketitle
+\date
+\tableofcontents
+
+\section{Introduction} 
+
+When I started to do my first first-principle calculation
+(that is, my first$^2$-principle calculation) with Stefano Baroni
+on CsI under pressure (1985), it became quickly evident that
+available pseudopotentials (PP's) couldn't do the job. So we 
+generated our own PP's. Since that first experience I have 
+generated a large number of PP's and people keep asking me 
+new PP's from time to time. I am happy that "my" PP's are 
+appreciated and used by other people. I don't think however 
+that the generation of PP's is such a hard task that it requires 
+an official (or unofficial) PP wizard to do this. For this reason 
+I want to share here my (little) experience.
+
+These notes are written in general but having in mind the capabilities of
+the {\tt atomic} package, included in the {\sc Quantum ESPRESSO} 
+distribution 
+(\texttt{http://www.quantum-espresso.org}). {\tt atomic}, mostly written
+and maintained by Andrea Dal Corso and others, is the evolution of 
+an older code I maintained for several years. {\tt atomic} can generate 
+both Norm-Conserving (NC) \cite{NC} and Ultrasoft (US) \cite{van} PP's,
+plus Projector Augmented Waves (PAW) \cite{PAW} sets.
+It allows multiple projectors, full relativistic calculations,
+spin-split PP's for spin-orbit calculations.
+For the complete description of the input of \texttt{atomic},
+please refer to files \texttt{INPUT\_LD1.txt} and 
+\texttt{INPUT\_LD1.html}.
+
+\subsection{Who needs to generate a pseudopotential?}
+
+There are at least three well-known published sets of NC-PP's:
+those of Bachelet, Hamann, and Schl\"uter \cite{BHS},
+those of Gonze, Stumpf, and Scheffler \cite{Gonze}, and
+those of Goedecker, Teter, and Hutter \cite{Goedecker}. 
+Moreover, all major packages for electronic-structure calculations
+include a downloadable table of PP's. One could then wonder 
+what a PP generation code is useful for. The problem is that 
+sometimes available PP's will not suit your needs. For instance,
+you may want:
+\begin{enumerate}
+ \item[--] a better accuracy;
+ \item[--] PP's generated with some exotic or new exchange-correlation
+     functional;
+ \item[--] a different partition of electrons into valence and core;
+ \item[--] ``softer'' PP's (i.e. PP that require a smaller cutoff
+           in plane-wave calculations);
+ \item[--] PP's with a core-hole for calculations of X-ray Adsorption
+           Spectra;
+ \item[--] all-electron wavefunctions reconstruction (requires the
+           knowledge of atomic all-electron and pseudo-orbitals used in
+           the generation of PP's);
+\end{enumerate}
+or you may simply want to know what is a PP, how to produce PP's, 
+how reliable they are.
+
+\subsection{About similar work}
+
+There are other PP generation packages available on-line.
+Those I am aware of include:
+\begin{itemize}
+\item the code by Jos\'e-Lu{\'\i}s Martins {\em et al.}\cite{TM}:\\
+{\tt http://bohr.inesc-mn.pt/\~{}jlm/pseudo.html}
+\item the {\tt fhi98PP} package\cite{fhi98PP}:\\
+{\tt http://www.fhi-berlin.mpg.de/th/fhi98md/fhi98PP}
+\item the OPIUM code by Andrew Rappe {\em et al.}\cite{RRKJ}:\\
+{\tt http://opium.sourceforge.net/}
+\item David Vanderbilt's US-PP package \cite{van}:\\
+{\tt http://www.physics.rutgers.edu/\~{}dhv/uspp/index.html}.
+\end{itemize}
+Other codes may be available upon request from the authors.
+
+Years ago, it occurred to me that a web-based PP generation
+tool would have been nice. Being too lazy and too ignorant 
+in web-based applications, I did nothing.
+I recently discovered that Miguel Marques {\em et al.} have
+implemented something like this: see
+{\tt http://www.tddft.org/programs/octopus/pseudo.php}.
+
+\subsection{Pseudopotential generation, in general} 
+
+In the following I am assuming that the basic PP theory 
+is known to the reader. Otherwise, see 
+Refs.\cite{NC,BHS,TM,fhi98PP,RRKJ} and references quoted 
+therein for NC-PP's; Refs.\cite{van,PAW} for US-PP's and PAWsets. 
+I am also assuming that the generated PP's are to be used
+in separable form \cite{KB} with a plane-wave (PW) basis set.
+
+The PP generation is a three-step process. First, one generates
+atomic levels and orbitals with Density-functional theory (DFT). 
+Second, from atomic results one generates the PP. Third, one checks 
+whether the reesulting PP is actually working. If not, one tries again in 
+a different way.
+
+The first step is invariably done assuming a spherically symmetric
+self-consistent Hamiltonian, so that all elementary quantum mechanics 
+results for the atom apply. The atomic state is defined by the
+"electronic configuration", one-electron states are defined by a
+principal quantum number and by the angular momentum and are obtained
+by solving a self-consistent radial Schr\"odinger-like (Kohn-Sham)
+equation.
+
+The second step exists in many variants. One can generate ``traditional'' 
+single-projector NC-PP's; multiple-projector NC-PP's; or US-PP's.
+The crucial step is in all cases the generation of smooth
+``pseudo-orbitals''  from atomic all-electron (AE) orbitals. 
+Two popular pseudization
+methods are presently implemented: Troullier-Martins \cite{TM}
+and Rappe-Rabe-Kaxiras-Joannopoulos \cite{RRKJ} (RRKJ).
+
+The third step is closer to cooking than to science. There is a
+large arbitrariness in the preceding step that one would like to 
+exploit in order to get the "best" PP, but there is no well-defined
+way to do this. Moreover one is often forced to strike a compromise
+between transferability (thus accuracy) and hardness (i.e. computer 
+time). This last step is the main focus of these notes.
+
+\section{Step-by-step Pseudopotential generation} 
+
+If you want to generate a PP for a given atom, the checklist is the
+following:
+
+\begin{itemize}
+\item choose the generation parameters:
+\begin{enumerate}
+\item exchange-correlation functional
+\item valence-core partition
+\item electronic reference configuration
+\item nonlinear core correction
+\item type of pseudization
+\item pseudization energies 
+\item pseudization radii
+\item local potential
+\end{enumerate}
+\item generate the pseudopotential
+\item check for transferability
+\end{itemize}
+In case of trouble or of unsatisfactory results, one has to 
+go back to the first step and change the generation parameters,
+usually in the last four items.
+
+\subsection{Choosing the generation parameters}
+
+\subsubsection{Exchange-correlation functional}
+\label{XC}
+PP's must be generated with the {\em same} exchange-correlation
+(XC) functional that will
+be later used in calculations. The use of, for instance, a
+GGA (Generalized Gradient Approximation) functional tegether
+with PP's generated with Local-Density Approximation (LDA) 
+is inconsistent. This is why the PP file contains information 
+on the DFT level used in their generation: if you or your code 
+ignore it, you do it at your own risk.
+
+The \texttt{atomic} package allows PP generation for a large number of 
+functionals, both LDA and GGA. Most of them have 
+been extensively tested, but beware: some exotic or seldom-used functionals 
+might contain bugs. Currently, \texttt{atomic} does not allow PP generation
+with meta-GGA (TPSS) or hybrid functionals. For the former, an old version 
+of \texttt{atomic}, modified by Xiaofei Wang, is available. 
+Work is in progress for the latter.
+
+Some functionals may present numerical problems
+when the charge density goes to zero. For instance, the Becke
+gradient correction to the exchange may diverge for 
+$\rho \rightarrow 0$. This does not happen in a free atom
+if the charge density behaves as it should, that is, as
+$\rho(r)\rightarrow exp(-\alpha r)$ for $r \rightarrow \infty$.
+In a pseudoatom, however, a weird behavior may arise 
+around the core region, $r\rightarrow 0$, because the 
+pseudocharge in that region is very small or sometimes 
+vanishing (if there are no filled $s$ states). As a consequence,
+nasty-looking ``spikes'' appear in the unscreened pseudopotential
+very close to the nucleus. This is not nice at all but it is
+usually harmless, because the interested region is really 
+very small. However in some unfortunate cases there can be 
+convergence problems. If you do not want to see those horrible 
+spikes, or if you experience problems, you have the following
+choices:
+\begin{enumerate}
+\item[--] Use a better-behaved GGA, such as PBE
+\item[--] Use the nonlinear core correction, which ensures
+          the presence of some charge close to the nucleus.
+\end{enumerate}
+A further possibility would be to cut the gradient correction for small 
+$r$ (it used to be implemented, but it isn't any longer).
+% (set variable {\tt rcut} to $\sim 0.001$ or so).
+
+\subsubsection{Valence-core partition}
+\label{ValCore}
+This seems to be a trivial step, and often it is: valence states 
+are those that contribute to bonding, core states are those that 
+do not contribute. Things may sometimes be more complicated than 
+this. For instance:
+\begin{enumerate}
+\item[--] in transition metals, whose typical outer electronic
+configuration is something like ($n=$ main quantum number)
+$nd^i(n+1)s^j(n+1)p^k$, it is not
+always evident that the $ns$ and $np$ states (``semicore states'')
+can be safely put into the core. The problem is that $nd$ states 
+are localized in the same spatial region as $ns$ and $np$ states, 
+deeper than $(n+1)s$ and $(n+1)p$ states. This may lead to poor 
+transferability. Typically, PP's with semicore states in the core 
+work well in solids with weak or metallic bonding, but perform poorly 
+in compounds with a stronger (chemical) type of bonding.
+\item[--] Heavy alkali metals (Rb, Cs, maybe also K) have a large
+polarizable core. PP's with just one electron may not always give
+satisfactory results.
+\item[--] In some II-VI and III-V semiconductors, such as ZnSe and
+GaN, the contribution of the $d$ states of the cation to the bonding 
+is not negligible and may require explicit inclusion of those $d$ 
+states into the valence.
+\end{enumerate}
+In all these cases, promoting the highest core states $ns$ and $np$,
+or $nd$, into valence may be a computationally
+expensive but obliged way to improve poor transferability. . 
+
+You should include semicore states into valence only if really needed:
+their inclusion in fact makes your PP harder (unless you resort to 
+US pseudization) and increases the number of electrons. In principle 
+you should also use more than one projector per angular momentum, 
+because the energy range to be covered by the PP with semicore electrons 
+is much wider than without. If you don't, the transferability of your PP 
+may suffer (a typical phenomenon:
+the error on the lattice parameter of a simple metal gets worse).
+
+\subsubsection{Electronic reference configuration}
+\label{RefConf}
+This may be any reasonable configuration not too far away from
+the expected configuration in solids or molecules. As a first
+choice, use the atomic ground state, unless you have a reason 
+to do otherwise, such as for instance:
+\begin{enumerate}
+\item[--]
+   You do not want to deal with unbound states.
+   Very often states with highest angular momentum $l$ are not bound
+   in the atom (an example: the $3d$ state in Si is not bound on the
+   ground state $3s^23p^2$, at least with LDA or GGA). In such a case 
+   one has the choice between 
+   \begin{enumerate} 
+      \item[--] using one configuration for $s$ and $p$, another, more
+                ionic one, for $d$, as in Refs.\cite{BHS,Gonze};
+      \item[--] choosing a single, more ionic configuration for which 
+                all desired states are bound;
+      \item[--] generate PP's on unbound states: requires to choose
+                a suitable reference energy.
+   \end{enumerate}
+\item[--]
+   The results of your PP are very sensitive to the chosen configuration.
+   This is something that in principle should not happen, but
+   I am aware of at least one case in which it does. In III-V
+   zincblende semiconductors, the equilibrium lattice parameter
+   is rather sensitive to the form of the $d$ potential of the 
+   cation (due to the presence of $p-d$ coupling between anion 
+   $p$ states and cation $d$ states \cite{Zunger}). By varying
+   the reference configuration, one can change the equilibrium 
+   lattice parameter by as much as $1-2\%$. 
+   The problem arises if you want to calculate accurate dynamical
+   properties of GaAs/AlAs alloys and superlattices: you need to
+   get a good theoretical lattice matching between GaAs and AlAs,
+   or otherwise unpleasant spurious effects may arise. When I was 
+   confronted with this problem, I didn't find any better solution
+   than to tweak the $4d$ reference configuration for Ga until I got
+   the observed lattice-matching.
+\item[--]
+   You know that for the system you are interested in, the atom will 
+   be in a given configuration and you try to stay close to it.
+   This is not very elegant but sometimes it is needed. For instance,
+   in transition metals described by a PP with semicore states in the 
+   core, it is probably wise to chose an electronic configuration for 
+   $d$ states that is close to what you expect in your system (as a
+   hand-waiving argument, consider that the $(n+1)s$ and $(n+1)p$ PP 
+   have a hard time in reproducing the true potential if the $nd$ state,
+   which is much more localized, changes a lot with respect to the
+   starting configuration). In Rare-Earth compounds, leaving the $4f$ 
+   electrons in the core with the correct occupancy (if known) may be 
+   a quick and dirty way to avoid the well-known problems of DFT yielding 
+   the wrong occupancy in highly correlated materials.
+\item[--]
+   You don't manage to build a decent PP with the ground state configuration, 
+   for whatever reason.
+\end{enumerate}
+
+NOTE 1: you can calculate PP for a $l$ as high as you want, but you
+are not obliged to use all of them in PW calculations. The general
+rule is that if your atom has states up to $l=l_c$ in the core, you
+need a PP with angular momenta up to $l=l_c+1$. Angular momenta
+$l>l_c+1$ will feel the same potential as $l=l_c+1$, because
+for all of them there is no orthogonalization to core states.
+As a consequence a PP should have projectors on angular momenta up to
+$l_c$; $l=l_c+1$ should be the local reference state for PW
+calculations. This rule is not very strict and may be relaxed: high
+angular momenta are seldom important (but be careful if they are). 
+Moreover separable PP pose serious constraints on local reference $l$
+(see below) and the choice is sometimes obliged. Note also that the
+highest the $l$ in the PP, the more expensive the PW calculation will 
+be.
+
+NOTE 2: a completely empty configuration ($s^0p^0d^0$) or
+a configuration with fractional occupation numbers are both
+acceptable. Even if fractional occupation numbers do
+not correspond to a physical atomic state, they correspond to a
+well-defined mathematical object.
+
+NOTE 3: PP could in principle be generated on a spin-polarized
+configuration, but a spin-unpolarized one is typically used.
+Since PP are constructed to be transferrable, they can describe
+spin-polarized configurations as well. The nonlinear core correction
+is needed if you plan to use PP in spin-polarized (magnetic)
+systems.
+
+\subsubsection{Nonlinear core correction}
+\label{nlcc}
+The nonlinear core correction\cite{CoreCorr} 
+accounts at least partially for the nonlinearity
+in the XC potential. During PP generation one first
+produces a potential yielding the desired pseudo-orbitals and
+pseudoenergies. In order to extract a ``bare'' PP that can be used
+in a self-consistent DFT calculation, one subtracts out the screening 
+(Hartree and XC) potential generated by the valence 
+charge only. This introduces a trasferability error because the XC 
+potential is not
+linear in the charge density. With the nonlinear core correction one 
+keeps a pseudized core charge to be added to the valence charge both 
+at the unscreening step and when using the PP.
+
+The nonlinear core correction {\em must} be present in one-electron PP's for
+alkali atoms (especially in ionic compounds) and for PP's to be used in 
+spin-polarized (magnetic) systems. It is recommended whenever there is a 
+large overlap between valence and core charge: for instance, in transition 
+metals if the semicore states are kept into the core. Since it is {\em never}
+harmful, one can take the point of view that it should always be included,
+even in cases where it will not be very useful.
+
+The pseudized core charge used in practice is equal to the true
+core charge for $r\ge r_{cc}$, differs from it  for $r < r_{cc}$
+in such a way as to be much smoother. The parameter $r_{cc}$ is
+typically chosen as the point at which the core charge $\rho_c(r_{cc})$ 
+is twice as big as the valence charge $\rho_v(r_{cc})$. In fact the 
+effect of nonlinearity is important only in regions where 
+$\rho_c(r)\sim\rho_v(r)$. Alternatively, $r_{cc}$ can be provided 
+in input, Note that the smaller $r_{cc}$, the more accurate the core 
+correction, but also the harder the pseudized core charge, and vice versa.
+
+\subsection{Type of pseudization}
+\label{pseudization}
+The \texttt{atomic} package implements two different NC pseudization 
+algorithms, both claiming to yield optimally smooth PP's:
+\begin{itemize}
+\item Troullier-Martins \cite{TM} (TM) 
+\item Rappe-Rabe-Kaxiras-Joannopoulos \cite{RRKJ} (RRKJ).
+\end{itemize}
+Both algorithms replace atomic orbitals in the core region 
+with smooth nodeless pseudo-orbitals. The TM method uses an
+exponential of a polynomial (see Appendix B); the RRKJ method 
+uses three or four Bessel functions for the pseudo-orbitals in
+the core region. The former is very robust. The latter may 
+occasionally fail to produce the required nodeless pseudo-orbital.
+If this happens, first try to force the usage of four Bessel functions
+(this is achieved by setting a  small nonzero value of 
+the charge density at the origin, variable \texttt{rho0}:
+unfortunately it works only for $s$ states).
+
+Second-row elements N, O, F, $3d$ transition metals, rare earths, 
+are typically ``hard'' atoms, i.e. described by NC PP's requiring
+a high PW cutoff. These atoms are characterized by $2p$ (N, O, F), 
+$3d$ (transition metals), $4f$ (rare earths) valence states with no 
+orthogonalization to core states of the same $l$ and no nodes.
+In addition, as mentioned in Secs.\ref{ValCore} and \ref{RefConf}, 
+there are case in which you may be forced to include semicore states
+in valence, thus making the PP hard (or even harder).  
+In all such cases, one should consider 
+{\em ultrasoft} pseudization, unless there is a good reason to stick
+to NC-PP's. For the specific case of rare earths, however, remember 
+that the problem of DFT reliability preempts the (tough) problem of 
+generating a PP. With US-PP's one can give up the NC requirement
+and get much software PP's, at the price of introducing an augmentation 
+charge that compensates for the missing charge. 
+
+Currently, the \texttt{atomic} package generates US-PP's on top of
+a ``hard'' NC-PP. In order to ensure sufficient transferability, 
+at least two states per angular momentum $l$ are required. 
+
+\subsubsection{Pseudization energies}
+\label{pseudiz}
+If you stick to single-projector PP's (one potential per angular momentum 
+$l$, i.e. one projector per $l$ in the separable form), the choice of the 
+electronic configuration automatically determines the reference states
+to pseudize: for each $l$, the bound valence eigenstate is pseudized
+at the corresponding eigenvalue. If no bound valence eigenstate exists,
+one has to select a reference energy. The choice is rather arbitrary:
+you may try something between than other valence bound state energies
+and zero. 
+
+If you have semicore states in valence, remember that for each $l$
+only the state with lowest $n$ can be used to generate a single-projector
+PP. The \texttt{atomic} package requires that you explicitly specify the 
+configuration for unscreening in the ``test'' configuration:
+see the detailed input documentation.
+
+It is possible to generate PP's by pseudizing atomic waves,
+i.e. regular solutions of the radial Kohn-Sham equation, at any
+energy. More than one such atomic waves of different energy can be
+pseudized for the same $l$, resulting in a PP with more than one 
+projector per $l$. Note that the resulting PP is directly produced
+in the separable form. 
+
+Such possibility considerably extends the transferability, but also the 
+number of ``degrees of freedom'' in the generation of a PP. As a rule of 
+thumb: 
+\begin{itemize}
+\item start with one projector per $l$, at the energy of the bound state;
+\item add a second projector at a second, higher energy not too far above 
+the former. 
+\end{itemize}
+The latter hint seems to be counterintuitive if you have semicore states 
+in valence: the obvious choice would be to include two projectors, using 
+both bound states energies. Unfortunately this is currently not possible 
+with the \texttt{atomic} package, because the state pseudized at the upper 
+bound-state energy will necessarily have a node (in order to be orthogonal 
+to the one with lower energy).
+
+For US-PP pseudization, you should first find a suitable multi-projector 
+NC-PP as above, than turn on the US-PP pseudization. This is done by
+setting different NC and US pseudization radii (see Sec.\ref{radii}),
+
+\subsubsection{Pseudization radii}
+\label{radii}
+
+For NC pseudization, one has to choose, for each state to be pseudized,
+a NC pseudization radius $r_c$, at which the AE orbital and the 
+corresponding NC-PP orbital match, with continuous first derivative 
+at $r=r_c$. For bound states, $r_c$ is typically at the outermost peak or 
+somewhat larger. The larger the $r_c$, the softer the potential 
+(less PW needed in the calculations), but also the less transferable.
+The $r_c$ may differ for different $l$; as a rule, one should avoid large
+differences between the $r_c$'s, but this is not always possible. Also,
+the $r_c$ cannot be smaller than the outermost node.
+
+A big problem in NC-PP's is how strike a compromise between softness
+and transferability, especially for difficult elements. The basic question:
+``how much should I push $r_c$ outwards in order to have reasonable results 
+with a reasonable PW cutoff''. has no clear-cut answer. The choice of $r_c$ 
+at the outermost maximum for ``difficult'' elements (those described in 
+Sec.\ref{pseudiz}): typically 0.7-0.8 a.u, even less for $4f$ electrons, 
+yields very hard PP's 
+(more than 100 Ry needed in practical calculations). With a little bit of 
+experience one can say that for second-row ($2p$) elements, $r_c=1.1-1.2$ 
+will yield reasonably good results for 50-70 Ry PW kinetic energy cutoff; 
+for $3d$ transition metals, the same $r_c$ will require $> 80$ Ry cutoff
+(highest $l$ have slower convergence for the same $r_c$). The above
+estimates are for TM pseudization. RRKJ pseudization will yield an
+estimate of the required cutoff.
+
+For multiple-projectors NC-PP's, the $r_c$ of unbound states may be chosen 
+in the same range as for bound states. If this is the first step for US-PP 
+generation, use small $r_c$ and don't try to push them outwards: the
+US pseudization will take care of softness. US pseudization radii can 
+be chosen much larger than NC ones (e.g. 1.3$\div$ 1.5 a.u. for second-row
+$2p$ elements, 1.7$\div$ 2.2 a.u. for $3d$ transition metals), but do not
+forget that the sum of the $r_c$ of two atoms should not exceed the typical
+bond length of those atoms.
+
+Note that it is the hardest atom that determines the PW cutoff in a
+solid or molecule. Do not waste time trying to find optimally soft 
+PP's for element X if element Y is harder then element X.
+
+\subsubsection{Choosing the local potential}
+
+As explained in Sec. \ref{RefConf}, note 1, one needs in principle
+angular momentum channels in PP's up to $l_c+1$. In the semilocal
+form, the choice of a ''local'', $l$-independent potential is natural
+and affects only seldom-important PW components with $l> l_c$.
+In PW calculations, however, a separable, fully nonlocal form -- 
+one in which the PP's is written as a local potential plus pr
+ojectors -- is used.
+An arbitrary function can be added to the local potential and 
+subtracted to all $l$ components. Generally one exploits this 
+arbitrariness to remove one $l$ component using it as local potential.
+The separable form can be either obtained by the Kleinman-Bylander
+projection \cite{KB} applied to single-projector PP's, or directly 
+produced using Vanderbilt's procedure \cite{van} (for single-projector
+PP's the two approaches are equivalent).
+
+Unfortunately the separable form is not guaranteed to have the
+correct ground state (unlike the semilocal form, which, by construction,
+has the correct ground states): ``ghost'' states, having the wrong number 
+of nodes, 
+can appear among the occupied states or close to them, making the 
+PP completely useless. This problem may show up in multiple-projectors 
+NC-PP's and in US-PP's as well.
+
+The freedom in choosing the local part can (and usually must) be used 
+in order to avoid the appearance of ghosts. For PW calculations it is 
+convenient to choose as local part the highest $l$, because this removes
+more projectors ($2l+1$ per atom) than for low $l$. According to Murphy's 
+law, this is also the choice that more often gives raise to problems, 
+and one is forced to use a different $l$. Another possibility is to generate 
+a local potential by pseudizing the AE potential.
+
+Note that ghosts may not be visible to atomic codes based on radial
+integration, since the algorithm discards states with the wrong number 
+of nodes. Difficult convergence or mysterious errors are almost invariably
+a sign tha there is something wrong with our PP. 
+A simple and safe way to check for the presence of a ghost is to diagonalize 
+the Kohn-Sham hamiltonian in a basis set of spherical Bessel functions. 
+This can be done together with transferability tests
+(see Sec.\ref{trans})
+
+\subsection{Generating the pseudopotential}
+
+As a first step, one can generate AE Kohn-Sham orbitals and one-electron 
+levels for the reference configuration. This is done by using executable
+\texttt{ld1.x}. You must specify in the input data:
+\begin{quote} 
+atomic symbol,\\
+electronic reference configuration,\\
+exchange-correlation functional (default is LDA).
+\end{quote}
+A complete description of the input is contained in the documentation.
+For accurate AE results in heavy atoms, you may want to specify a denser 
+radial grid in $r$-space than the default one. The default grid should
+however be good enough for PP generation.
+
+Before you proceed, it is a good idea to verify that the atomic data
+you just produced actually make sense. Some kind souls have posted on
+the web a complete set of reference atomic data :
+\begin{quote}
+{\tt http://physics.nist.gov/PhysRefData/DFTdata/ }
+\end{quote}
+These data have been obtained with the Vosko-Wilk-Nusair functional,
+that for the unpolarized case is very similar to the Perdew-Zunger 
+LDA functional (this is hte LDA default).
+
+The generation step is also done by program \texttt{ld1.x}.
+One has to supply, in addition to AE data: 
+\begin{quote}
+a list of orbitals to be pseudized, with pseudization energies and radii,\\
+the filename where the newly generated PP is written,
+\end{quote}
+plus a number of other optional parameters, 
+fully described in the documentation.
+
+\subsection{Checking for transferability}
+\label{trans}
+A simple way to check for correctness and to get a feeling for 
+the transferability of a PP, with little effort, is to test the 
+results of PP and AE atomic calculations on atomic configurations 
+differing from the starting one. The error on total energy 
+differences between PP and AE results gives a feeling on how 
+good the PP is. Just to give an idea: an error $\sim 0.001$ Ry 
+is very good, $\sim 0.01$ Ry may still be acceptable.
+The code \texttt{ld1.x} has a ``testing'' mode in which it does
+exactly the above operation. You provide the input PP file and
+a number of test configurations.
+
+You are advised to perform also the test with a basis set of spherical
+Bessel functions $j_l (qr)$. In addition to revealing the presence of
+``ghosts'', this test also gives an idea of the smoothness of the 
+potential: the dependence of energy levels upon the cutoff in the kinetic 
+energy is basically the same for the pseudo-atom in the basis of $j_l (qr)$'s
+and for the same pseudo-atom in a solid-state calculation using PW's.
+
+Another way to check for transferability is to compare AE and pseudo (PS) 
+logarithmic derivatives, also calculated by \texttt{ld1.x}. Typically 
+this comparison is done on the reference configuration,
+but not necessarily so. You should supply on input:
+\begin{enumerate}
+\item[--] the radius $r_d$ at which logarithmic derivatives are 
+          calculated ($r_d$ should be of the order of the
+          ionic or covalent radius, and larger than any of the $r_c$'s)
+\item[--] the energy range $E_{min}, E_{max}$ and the number 
+          of points for the plot. The energy range
+          should cover the typical valence one-electron energy 
+          range expected in the targeted application of the PP. 
+\end{enumerate}
+The files containing logarithmic derivatives can be easily read and 
+plotted using for instance the plotting program \texttt{gnuplot} 
+or \texttt{xmgrace}. 
+Sizable discrepancies between AE and PS logarithmic derivatives 
+are a sign of trouble (unless your energy range is too large or 
+not centered around the range of pseudization energies, of course).
+
+Note that the above checks, based on atomic calculations only,
+do not replace the usual checks (convergence tests, bond lengths,
+etc) one has to perform in at least some simple solid-state or 
+molecular systems before starting a serious calculation.
+
+\section{A worked example: Ti}
+
+Let us consider the Ti atom: $Z=22$, electronic configuration: 
+$1s^2 2s^2 2p^6 3s^2 3p^6 3d^2 4s^2$, with PBE XC functional.
+The input data for the AE calculation is simple:
+\begin{verbatim}
+ &input
+   atom='Ti', dft='PBE', config='[Ar] 3d2 4s2 4p0'
+ /
+\end{verbatim}
+and yields the total energy and Kohn-Sham levels. Let us concentrate
+on the outermost states:
+\begin{verbatim}
+     3 0     3S 1( 2.00)        -4.6035        -2.3017       -62.6334
+     3 1     3P 1( 6.00)        -2.8562        -1.4281       -38.8608
+     3 2     3D 1( 2.00)        -0.3130        -0.1565        -4.2588
+     4 0     4S 1( 2.00)        -0.3283        -0.1641        -4.4667
+     4 1     4P 1( 0.00)        -0.1078        -0.0539        -1.4663
+\end{verbatim}
+and on their spatial extension:
+\begin{verbatim}
+s(3S/3S) =  1.000000  <r> =   1.0069  <r2> =    1.1699  r(max) =   0.8702
+s(3P/3P) =  1.000000  <r> =   1.0860  <r2> =    1.3907  r(max) =   0.8985
+s(3D/3D) =  1.000000  <r> =   1.6171  <r2> =    3.5729  r(max) =   0.9811
+s(4S/4S) =  1.000000  <r> =   3.5138  <r2> =   14.2491  r(max) =   2.9123
+s(4P/4P) =  1.000000  <r> =   4.8653  <r2> =   27.9369  r(max) =   3.8227
+\end{verbatim}
+Note that the $3d$ state has a small spatial extension, comparable to that of
+$3s$ and $3p$ states and much smaller than for $4s$ and $4p$ states; the
+$3d$ energy is instead comparable to that of $4s$ and $4p$ states and much
+higher than the $3s$ and $3p$ energies.. Much of the chemistry of Ti is 
+determined by its $3d$ states. What should we do? We have the choice among 
+several possibilities:
+\begin{enumerate}
+\item single-projector NC-PP with 4 electrons in valence ($3d^2 4s^2$),
+with nonlinear core correction;
+\item single-projector NC-PP with 12 electrons in valence 
+($3s^2 3p^6 3d^2 4s^2$);
+\item multiple-projector NC-PP with 12 electrons in valence;
+\item US-PP with 12 electrons in valence;
+\item US-PP with 4 electrons in valence and nonlinear core correction;
+\item ...
+\end{enumerate}
+The PP of case 1) will be hard due to the presence of $3d$ states, and 
+its transferability may turn out not be sufficient for all purposes;
+PP's for 2) and 3) will be even harder due to the presence of $3d$ and
+semicore $3s$ and $3p$ states; PP 4) can be made soft, but generating
+one is not trivial; PP 5) may suffer from insufficient transferability.
+
+\subsection {Single-projector, norm-conserving, no semicore}
+
+\subsubsection{Generation}
+Let us start from the simplest case with the following input:
+\begin{verbatim}
+ &input
+   atom='Ti',  dft='PBE',  config='[Ar] 3d2 4s2 4p0',
+   rlderiv=2.90, eminld=-2.0, emaxld=2.0, deld=0.01, nld=3,
+   iswitch=3
+ /
+ &inputp
+   pseudotype=1, nlcc=.true., lloc=1,
+   file_pseudopw='Ti.pbe-n-rrkj.UPF'
+ /
+3
+4S 1 0 2.00  0.00 2.9 2.9
+3D 3 2 2.00  0.00 1.3 1.3
+4P 2 1 0.00  0.00 2.9 2.9
+\end{verbatim}
+In the \texttt{\&input} namelist,
+we specify the we want to generate a PP (\texttt{iswitch=3}) and to
+calculate \texttt{nld=3} logarithmic derivatives at \texttt{rlderiv=2.90} a.u.
+from the origin, in the energy range \texttt{eminld=-2.0} Ry to 
+\texttt{emaxld=2.0} Ry, in energy steps \texttt{deld=0.01} Ry
+(note that these values will not affect PP generation).
+In the \texttt{\&inputp} namelist, we specify the we want a single-projector,
+NC-PP (\texttt{pseudotype=1}), with nonlinear core correction 
+(\texttt{nlcc=.true.}), using the $l=1$ channel as local (\texttt{lloc=1}).
+The output PP will be written in UPF format to file \texttt{Ti.pbe-n-rrkj.UPF}
+(following the {\sc quantum ESPRESSO} convention for PP names).
+Following the two namelists, there is a list of states used for pseudization:
+the 4S state, with pseudization radius $r_c=2.9$ a.u.; the 3D state,
+ $r_c=1.3$ a.u.; the 4P, $r_c=2.9$ a.u.,  listed as last because it is
+the channel to be chosen as local potential.
+
+There is nothing magic or especially deep in the choice of the radius
+and energy range for logarithmic derivatives, of the local 
+potential and of pseudization radii: it is just a reasonable guess.
+Running the input, one gets an error:
+\begin{verbatim}
+      Wfc   4S  rcut= 2.883  Estimated cut-off energy=   14.82 Ry
+     l=   0 Node at 0.71997236
+      This function has    1 nodes for 0 < r <    2.883
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+     from compute_phi : error #         1
+     phi has nodes before r_c
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{verbatim}
+This means that the 4S pseudized orbitals has one node. With RRKJ 
+pseudization (the default), this may occasionally happen. One can
+either choose TM pseudization (\texttt{tm=.true.}) or set a small
+value of $\rho(r=0)$ (e.g. \texttt{rho0=0.001}). Let us do the latter.
+You should carefully look at the output, which will consists in
+an all-electron calculation, followed by the pseudopotential generation
+step, followed by a final test. In particular, notice this message
+about the nonlinear core correction:
+\begin{verbatim}
+      Computing core charge for nlcc:
+
+       r > 1.73 : true rho core
+       r < 1.73 : rho core = a sin(br)/r    a=   2.40  b=   1.56
+
+      Integrated core pseudo-charge :   3.43
+\end{verbatim}
+(this is actually not an ideal situation: the pseudization radius for the 
+charge density should be smaller than all pseudization radii; in our 
+case, smaller than $r_c^{(min)} = r_c^{(l=2)}=1.3$ a.u.). 
+Also notice messages on pseudization:
+\begin{verbatim}
+      Wfc   4S  rcut= 2.883  Estimated cut-off energy=        5.32 Ry
+      Using 4 Bessel functions for this wfc, rho(0) = 0.001
+      This function has    0 nodes for 0 < r <    2.883
+
+      Wfc   3D  rcut= 1.296  Estimated cut-off energy=      137.82 Ry
+      This function has    0 nodes for 0 < r <    1.296
+\end{verbatim}
+(note the large difference between the estimated cutoff for the $s$ and
+the $d$ channel! Of course, it is only the latter the ``problem'' one 
+here); and look at the final consistency check:
+\begin{verbatim}
+     n l     nl             e AE (Ry)        e PS (Ry)    De AE-PS (Ry)
+     1 0     4S   1( 2.00)       -0.32830       -0.32830        0.00000
+     3 2     3D   1( 2.00)       -0.31302       -0.31302        0.00000
+     2 1     4P   1( 0.00)       -0.10777       -0.10777        0.00000
+\end{verbatim}
+You should get exactly 0 (within numerical accuracy) in the columnn
+at the right. 
+
+As a further check, let's have a look at the logaritmic derivatives
+and at pseudized Kohn-Sham orbitals. Logarithmic derivatives are written 
+to files \texttt{ld1.dlog} and \texttt{ld1ps.dlog}, for AE and PS 
+calculations respectively (file names can be changed using variable 
+\texttt{prefix}). They can be plotted using for instance 
+\texttt{gnuplot} and the following commands:
+\begin{verbatim}
+plot [-2:2][-20:20] 'ld1.dlog' u 1:2 w l lt 1, 'ld1.dlog' u 1:3 w l lt 2,\
+                    'ld1.dlog' u 1:4 w l lt 3, 'ld1ps.dlog' u 1:2 lt 1, \
+                  'ld1ps.dlog' u 1:3     lt 2, 'ld1ps.dlog' u 1:4 lt 3
+\end{verbatim}
+PS orbitals and the corresponding AE ones are written to file 
+\texttt{ld1ps.wfc} (PS on the left, AE on the right). They can be 
+plotted using the following commands:
+\begin{verbatim}
+plot [0:5] 'ld1ps.wfc' u 1:2 lt 1    , 'ld1ps.wfc' u 1:3 lt 3    , \
+           'ld1ps.wfc' u 1:4 lt 2    , 'ld1ps.wfc' u 1:5 lt 1 w l, \
+           'ld1ps.wfc' u 1:6 lt 3 w l, 'ld1ps.wfc' u 1:7 lt 2 w l
+\end{verbatim}
+One gets the following plots (AE=lines, PS=points; 
+\texttt{lt 1}=red=$s$; \texttt{lt 2}=green=$p$; \texttt{lt 3}=blue=$d$; 
+note that in the files, orbitals are ordered as given in input, 
+logarithmic derivatives as $s$, $p$, $d$).
+
+\includegraphics[width=7.5cm]{pseudo-gen-fig1.pdf}
+\includegraphics[width=7.5cm]{pseudo-gen-fig2.pdf}
+
+We observe that our PP seems to reproduce fairly well
+the logarithmic derivatives, with deviations appearing only at 
+relatively high ($> 1$ Ry) energies. AE and PS orbitals match
+very well beyond the pseudization radii; the $3d$ orbital is 
+slightly deformed, because we have chosen a relatively large 
+$r_c^{(l=2)}=1.3$ a.u.. It is easy to verify that a smaller
+$r_c^{(l=2)}$ yields a better $3d$ PS orbital, but also a harder
+$d$ potential: e.g., for $r_c^{(l=2)}=1.0$ a.u., you get
+\begin{verbatim}
+      Wfc   3D  rcut= 1.009  Estimated cut-off energy=      225.64 Ry
+\end{verbatim}
+Before proceding, it is wise to verify whether our PP has ``ghosts''.
+Let us prepare the following input for the testing phase 
+(note the variable \texttt{iswitch=2} and the \texttt{\&test}
+namelist):
+\begin{verbatim}
+ &input
+   atom='Ti',  dft='PBE',  config='[Ar] 3d2 4s2 4p0',
+   iswitch=2
+ /
+ &test
+   file_pseudo='Ti.pbe-n-rrkj.UPF',
+   nconf=1, configts(1)='3d2 4s2 4p0',
+   ecutmin=50, ecutmax=200, decut=50
+ /
+\end{verbatim}
+This will solve the Kohn-Sham equation for the PP read from  
+\texttt{file\_pseudo}, for a single valence configuration
+(\texttt{nconf=1}) listed in \texttt{configts(1)} (the ground state
+in this case), using a base of spherical waves whose cutoff
+(in Ry) ranges from \texttt{ecutmin} to \texttt{ecutmax} in steps of
+\texttt{decut}. The initial part of the output looks good, but let us
+look at the test with spherical waves, towards the end:
+\begin{verbatim}
+     Cutoff (Ry) :  200.0
+                          N = 1       N = 2       N = 3
+     E(L=0) =        -0.7483 Ry   -0.3282 Ry   -0.0042 Ry
+     E(L=1) =        -0.1077 Ry    0.0192 Ry    0.0630 Ry
+     E(L=2) =        -0.2961 Ry    0.0304 Ry    0.0654 Ry
+\end{verbatim}
+The lowest levels found in this way should be the same\footnote{actually 
+there are numerical differences, especially large for localized states 
+like $3d$, whose origin is under investigation} 
+as those calculated from radial integration (see above). 
+This is true for the $4p$ state (-0.1077 Ry), 
+for the $3d$ state (-0.2961 Ry vs -0.31302 Ry, see footnote),
+for the $4s$ state (-0.3282 Ry)....but note the spurious $4s$ 
+level at -0.7483 Ry! Our PP has a ghost and is unusable. 
+
+What should be do now? we may try to change the definition of the
+local potential. We had chosen $l=1$, let us try $l=2$ and $l=0$.
+The former has the same pathology, the latter has no ghosts.
+So our data for PP generation are as follows:
+\begin{verbatim}
+ &input
+   atom='Ti',  dft='PBE',  config='[Ar] 3d2 4s2 4p0',
+   rlderiv=2.90, eminld=-2.0, emaxld=2.0, deld=0.01, nld=3,
+   iswitch=3
+ /
+ &inputp
+   pseudotype=1, nlcc=.true., lloc=0,
+   file_pseudopw='Ti.pbe-n-rrkj.UPF',
+ /
+3
+4P 2 1 0.00  0.00 2.9 2.9
+3D 3 2 2.00  0.00 1.3 1.3
+4S 1 0 2.00  0.00 2.9 2.9
+\end{verbatim}
+(note \texttt{lloc=0} and the $4s$ state at the end of the list). 
+Let us plot again logarithmic derivatives and orbitals (they look 
+quite the same as before) and run again the test with spherical 
+waves. We get (see the last section in the output):
+\begin{verbatim}
+     Cutoff (Ry) :   50.0
+                           N = 1       N = 2       N = 3
+     E(L=0) =        -0.3282 Ry   -0.0049 Ry    0.0361 Ry
+     E(L=1) =        -0.1077 Ry    0.0192 Ry    0.0630 Ry
+     E(L=2) =        -0.1469 Ry    0.0311 Ry    0.0682 Ry
+
+     Cutoff (Ry) :  100.0
+                           N = 1       N = 2       N = 3
+     E(L=0) =        -0.3282 Ry   -0.0049 Ry    0.0361 Ry
+     E(L=1) =        -0.1077 Ry    0.0192 Ry    0.0630 Ry
+     E(L=2) =        -0.2959 Ry    0.0303 Ry    0.0652 Ry
+     Cutoff (Ry) :  150.0
+                           N = 1       N = 2       N = 3
+     E(L=0) =        -0.3282 Ry   -0.0049 Ry    0.0361 Ry
+     E(L=1) =        -0.1077 Ry    0.0192 Ry    0.0630 Ry
+     E(L=2) =        -0.2961 Ry    0.0303 Ry    0.0652 Ry
+\end{verbatim}
+This time the first column yields (with a small discrepancy for $3d$)
+the expected levels, and only those levels. It is wise to inspect
+the second column as well for absence of suspiciously low levels: 
+ghosts may appear also as spurious excited states close to occupied
+states. Note how bad the energy for the $3d$ level is at 50 Ry.
+At 100 Ry however we are close to convergence and at 150 Ry 
+well converged, in agreement with the estimate given during 
+the PP generation (138 Ry).
+
+We have now our first candidate (i.e. not surely wrong) PP. 
+In order to 1) verify if it really does the job, 2) quantify
+its transferability, 3) quantify its hardness, and 4) improve 
+it, if possible, we need to perform some more testing.
+
+\subsubsection{Testing}
+
+As a first idea of how good our PP is, let us verify how it
+behaves on differente electronic configuration. The code
+allows to test several configurations in the following way:
+\begin{verbatim}
+ &input
+   atom='Ti',  dft='PBE',  config='[Ar] 3d2 4s2 4p0',
+   iswitch=2
+ /
+ &test
+   file_pseudo='Ti.pbe-n-rrkj.UPF',
+   nconf=9
+   configts(1)='3d2 4s2 4p0'
+   configts(2)='3d2 4s1 4p1'
+   configts(3)='3d2 4s1 4p0'
+   configts(4)='3d2 4s0 4p0'
+   configts(5)='3d1 4s2 4p1'
+   configts(6)='3d1 4s2 4p0'
+   configts(7)='3d1 4s1 4p0'
+   configts(8)='3d1 4s0 4p0'
+   configts(9)='3d0 4s0 4p0'
+/
+\end{verbatim}
+here we have chosen 9 different valence configurations 
+(the corresponding AE configurations are obtained by 
+superimposing \texttt{configts} to core states in \texttt{config}).
+Some of them are neutral, some are ionic, the first five leave
+the $3d$ states unchanged, the last one is a completely ionized
+Ti$^{4+}$. For each configuration, the code writes results 
+(e.g. orbitals) into files \texttt{ld1}$N.*$ and \texttt{ld1ps}$N.*$,
+where $N$ is the index of the configuration. A summary is written to
+file \texttt{ld1.test}. For the first configuration, AE and PS 
+eigenvalues and total energies are written:
+\begin{verbatim}
+     3 2     3D   1( 2.00)       -0.31302       -0.31302        0.00000
+     1 0     4S   1( 2.00)       -0.32830       -0.32830        0.00000
+     2 1     4P   1( 0.00)       -0.10777       -0.10777        0.00000
+     Etot =   -1707.131006 Ry,    -853.565503 Ha,  -23226.698556 eV
+     Etotps =    -9.748745 Ry,      -4.874372 Ha,    -132.638416 eV
+\end{verbatim}
+(AE and PS eigenvalues are in this case the same, since this is the
+reference configuration used to build the PP). For the following
+configurations, AE and PS eigenvalues, plus total energy
+{\em differences}\footnote{Reminder: absolute PS total energies 
+depend upon the specific PP! Only energy differences are significant.}
+wrt configuration 1 are printed:
+\begin{verbatim}
+     3 2     3D   1( 2.00)       -0.40319       -0.40457        0.00138
+     1 0     4S   1( 1.00)       -0.38394       -0.38420        0.00026
+     2 1     4P   1( 1.00)       -0.15248       -0.15237       -0.00011
+     dEtot_ae =       0.226061 Ry
+     dEtot_ps =       0.226250 Ry,   Delta E=      -0.000189 Ry
+\end{verbatim}
+The discrepancy between AE and PS energy differences (in this case,
+wrt the ground state) as well as the discrepancies in AE and PS 
+eigenvalues, are a measure of how transferrable a PP is. In this case,
+the AE-PS discrepancy on $\delta E = E(4s^14p^13d^2) - E(4s^24p^03d^2)$
+(look at \texttt{Delta E}) is quite small, $<0.2$ mRy, while the 
+maximum discrepancy of the eigenvalues (rightmost column) $\sim 1$ mRy. 
+These are very good results.
+Unfortunately this is also a configuration that doesn't differ much
+from the reference one. Let us see the other cases:
+\begin{verbatim}
+     3 2     3D   1( 2.00)       -0.83550       -0.83256       -0.00295
+     1 0     4S   1( 1.00)       -0.76075       -0.76163        0.00088
+     2 1     4P   1( 0.00)       -0.48549       -0.48617        0.00068
+     dEtot_ae =       0.539968 Ry
+     dEtot_ps =       0.540344 Ry,   Delta E=      -0.000376 Ry
+ 
+     3 2     3D   1( 2.00)       -1.44648       -1.44538       -0.00110
+     1 0     4S   1( 0.00)       -1.24186       -1.24652        0.00465
+     2 1     4P   1( 0.00)       -0.91224       -0.91599        0.00375
+     dEtot_ae =       1.537516 Ry
+     dEtot_ps =       1.540285 Ry,   Delta E=      -0.002769 Ry
+ 
+     3 2     3D   1( 1.00)       -0.68514       -0.74236        0.05722
+     1 0     4S   1( 2.00)       -0.45729       -0.45802        0.00073
+     2 1     4P   1( 1.00)       -0.18855       -0.18471       -0.00383
+     dEtot_ae =       0.343391 Ry
+     dEtot_ps =       0.371650 Ry,   Delta E=      -0.028259 Ry
+ 
+     3 2     3D   1( 1.00)       -1.16621       -1.21438        0.04817
+     1 0     4S   1( 2.00)       -0.87720       -0.87620       -0.00100
+     2 1     4P   1( 0.00)       -0.56807       -0.56137       -0.00670
+     dEtot_ae =       0.716203 Ry
+     dEtot_ps =       0.739110 Ry,   Delta E=      -0.022907 Ry
+ 
+     3 2     3D   1( 1.00)       -1.82248       -1.87471        0.05223
+     1 0     4S   1( 1.00)       -1.39447       -1.39936        0.00489
+     2 1     4P   1( 0.00)       -1.03942       -1.03465       -0.00476
+     dEtot_ae =       1.848995 Ry
+     dEtot_ps =       1.873240 Ry,   Delta E=      -0.024245 Ry
+ 
+     3 2     3D   1( 1.00)       -2.54976       -2.61959        0.06983
+     1 0     4S   1( 0.00)       -1.94361       -1.96745        0.02383
+     2 1     4P   1( 0.00)       -1.53584       -1.54419        0.00835
+     dEtot_ae =       3.518170 Ry
+     dEtot_ps =       3.554733 Ry,   Delta E=      -0.036564 Ry
+ 
+     3 2     3D   1( 0.00)       -3.84145       -3.95251        0.11106
+     1 0     4S   1( 0.00)       -2.73793       -2.81405        0.07612
+     2 1     4P   1( 0.00)       -2.25938       -2.28768        0.02831
+     dEtot_ae =       6.699594 Ry
+     dEtot_ps =       6.831938 Ry,   Delta E=      -0.132344 Ry
+\end{verbatim} 
+It is evident that configurations with $3d^2$ occupancy are well 
+reproduced, with errors on total energy differences $<3$ mRy and
+on eigenvalues$<5$ mRy. Configurations with different $3d$ occupancy,
+however, have errors one order of magnitude higher. For the extreme
+case of Ti$^{4+}$, the error is $\sim$ 0.1 Ry.
+
+In order to better understand what is going on, let us have a
+look at the AE vs PS orbitals and logarithmic derivatives for
+configuration 9 (i.e. for the bare PP). Let us add a line
+like this:
+\begin{verbatim}
+   rlderiv=2.90, eminld=-4.0, emaxld=0.0, deld=0.01, nld=3,
+\end{verbatim}
+and plot files \texttt{ld19ps.wfc}, \texttt{ld19.dlog},
+\texttt{ld19ps.dlog} using \texttt{gnuplot} as above :
+
+\includegraphics[width=7.5cm]{pseudo-gen-fig3.pdf}
+\includegraphics[width=7.5cm]{pseudo-gen-fig4.pdf}
+
+Both the orbitals and the logarithmic derivatives (note the 
+different energy range) start to exhibit some visible
+discrepancy now.
+
+One can try to fiddle with all generation parameters,
+better if one at the time, to see whether things improve.
+Curiously enough, the pseudization radius for the core
+correction, which in principle should be as small as
+possible, seems to improve things if pushed slightly 
+outwards (try \texttt{rcore=2.0}). Also surprisingly,
+a smaller pseudization radius for the $3d$ state, 0.9 
+or 1.0 a.u., doesn't bring any visible improvement 
+to transferability
+(but it increases a lot the required cutoff!).
+Changing the pseudization radii for $4s$ and $4p$ states
+doesn't affect much the results. 
+
+A different local potential -- a pseudized version 
+of the total self-consistent potential -- can be chosen 
+by setting \texttt{lloc=-1} and setting \texttt{rcloc}
+to the desired pseudization radius (a.u.). For small 
+\texttt{rcloc} ghosts re-appear;  \texttt{rcloc=2.9}
+yields slighty better total energy differences but slightly worse
+eigenvalues. Note that the PP so generated will also have a 
+$s$ projector, while the previous
+ones had only $p$ and $d$ projectors. 
+
+One could also generate the PP from a different electronic 
+configuration. Since Ti tends to lose rather than to attract
+electrons, it will be more easily found in a ionized state than
+in the neutral one. One might for instance use the electronic
+configuration of the Bachelet-Hamann-Schl\"uter paper\cite{BHS}:
+$3d^2 4s^{0.75} 4p^{0.25}$. This however doesn't seem to improve
+much. 
+
+Finally we end up with these generation data:
+\begin{verbatim}
+ &input
+   atom='Ti',  dft='PBE',  config='[Ar] 3d2 4s2 4p0',
+   iswitch=3
+ /
+ &inputp
+   pseudotype=1, nlcc=.true., rcore=2.0, lloc=0,
+   file_pseudopw='Ti.pbe-n-rrkj.UPF'
+ /
+3
+4P 2 1 0.00  0.00 2.9 2.9
+3D 3 2 2.00  0.00 1.3 1.3
+4S 1 0 2.00  0.00 2.9 2.9
+\end{verbatim}
+
+\subsection {Single-projector, norm-conserving, with semicore states}
+
+The results of transferability tests suggest that a Ti PP with only
+$3d$, $4s$, $4p$ states have limited transferability to cases with 
+different $3d$ configurations. In order to improve it, a possible
+way is to put semicore $3s$ and $3p$ states in valence. The maximum
+for those states (0.87 a.u. and 0.90 a.u. respectively) is in the 
+same range as for $3d$ (0.98 a.u.). Let us try thus the following:
+\begin{verbatim}
+ &input
+   atom='Ti',  dft='PBE',  config='[Ar] 3d2 4s2 4p0',
+   rlderiv=2.90, eminld=-4.0, emaxld=2.0, deld=0.01, nld=3,
+   iswitch=3
+ /
+ &inputp
+   pseudotype=1, rho0=0.001, ...
+   file_pseudopw='Ti.pbe-sp-rrkj.UPF'
+ /
+3
+3S 1 0 2.00  0.00 1.1 1.1
+3P 2 1 6.00  0.00 1.2 1.2
+3D 3 2 2.00  0.00 1.3 1.3
+ &test
+   configts(1)='3s2 3p6 3d2 4s2 4p0',
+ /
+\end{verbatim}
+Note the presence of the \texttt{\&test} namelist: it is used in this
+context to supply the electronic valence configuration, to be used
+for unscreening. As a first step, we do not include the core correction.
+In place of the dots we should specify the local reference potential. 
+If we use \texttt{lloc=-1} with large values of \texttt{rcloc},
+(comparable to pseudization radii for the previous case) 
+we get all kinds of mysterious errors:
+\begin{verbatim}
+     from compute_chi : error #         1
+     n is too large
+\end{verbatim}
+for \texttt{rcloc=2.5}, while \texttt{rcloc=2.7} produces an equally 
+mysterious
+\begin{verbatim}
+     from run_pseudo : error #         1
+     Errors in PS-KS equation
+\end{verbatim}
+while smaller values (e.g. 1.5) lead to other errors:
+\begin{verbatim}
+     WARNING! Expected number of nodes: 0 = 2-1-1, number of nodes found: 1.
+\end{verbatim}
+Even if the code doesn't stop, the presence of such messages
+is a signal of something going wrong in the generation algorithm.
+With some more experiments, though, one finds that \texttt{rcloc=1.3} 
+yields a good potential. We still have other choices. In this case, 
+$d$ as reference potential: \texttt{lloc=2}, seems to work as well
+(and produces a PP with less projectors: only $s$ and $p$). 
+The generation algorithm in the latter case yields these 
+results for Kohn-Sham energies:
+\begin{verbatim}
+     n l     nl             e AE (Ry)        e PS (Ry)    De AE-PS (Ry) 
+     1 0     3S   1( 2.00)       -4.60347       -4.60348        0.00001
+     2 1     3P   1( 6.00)       -2.85621       -2.85623        0.00002
+     3 2     3D   1( 2.00)       -0.31302       -0.31301       -0.00001
+     2 0     4S   1( 2.00)       -0.32830       -0.32892        0.00062
+     3 1     4P   1( 0.00)       -0.10777       -0.10732       -0.00045
+\end{verbatim}
+Note that the $3s$, $3p$, $3d$ levels should be the same by construction
+(the difference is numerical noise); the $4s$ and $4p$ levels are not
+guaranteed to be the same. The fact that they are, to a very good degree,
+is very reassuring. A look at the orbitals will reveal that $3s, 3p, 3d$
+are nodeless, $4s$ and $4p$ have one node. The spherical wave basis 
+set confirms the absence of ghosts:
+\begin{verbatim}
+    Cutoff (Ry) :   50.0
+                           N = 1       N = 2       N = 3
+     E(L=0) =        -4.5385 Ry   -0.3263 Ry   -0.0047 Ry
+     E(L=1) =        -2.8427 Ry   -0.1071 Ry    0.0193 Ry
+     E(L=2) =        -0.1511 Ry    0.0311 Ry    0.0685 Ry
+
+     Cutoff (Ry) :  100.0
+                           N = 1       N = 2       N = 3
+     E(L=0) =        -4.5883 Ry   -0.3279 Ry   -0.0048 Ry
+     E(L=1) =        -2.8547 Ry   -0.1073 Ry    0.0193 Ry
+     E(L=2) =        -0.2918 Ry    0.0303 Ry    0.0649 Ry
+
+     Cutoff (Ry) :  150.0
+                           N = 1       N = 2       N = 3
+     E(L=0) =        -4.5899 Ry   -0.3280 Ry   -0.0048 Ry
+     E(L=1) =        -2.8549 Ry   -0.1073 Ry    0.0193 Ry
+     E(L=2) =        -0.2936 Ry    0.0303 Ry    0.0649 Ry
+\end{verbatim}
+Note that for $l=0$ the first ($N=1$) level is the $3s$ level, 
+the second ($N=2$) level is the $4s$ level, and the like for 
+$l=1$. Let us now repeat the testing on the nine
+selected configurations as for the 4-electron PP. You will
+have to add \texttt{3s2 3p6} to all test configurations
+\texttt{configts}. Let us see check the errors on total energy 
+differences:
+\begin{verbatim}
+$ grep Delta ld1.test
+     dEtot_ps =       0.227291 Ry,   Delta E=      -0.001230 Ry
+     dEtot_ps =       0.540886 Ry,   Delta E=      -0.000918 Ry
+     dEtot_ps =       1.540155 Ry,   Delta E=      -0.002640 Ry
+     dEtot_ps =       0.343314 Ry,   Delta E=       0.000077 Ry
+     dEtot_ps =       0.715061 Ry,   Delta E=       0.001142 Ry
+     dEtot_ps =       1.849816 Ry,   Delta E=      -0.000820 Ry
+     dEtot_ps =       3.522904 Ry,   Delta E=      -0.004735 Ry
+     dEtot_ps =       6.702626 Ry,   Delta E=      -0.003032 Ry
+\end{verbatim}
+Energy differences are reproduced with an
+error that does not exceed a few mRy (see column at the rhs). 
+Eigenvalues are also well reproduced, e.g.:
+\begin{verbatim}
+     1 0     3S   1( 2.00)       -8.37382       -8.37230       -0.00152
+     2 1     3P   1( 6.00)       -6.57173       -6.57195        0.00021
+     3 2     3D   1( 0.00)       -3.84145       -3.83518       -0.00627
+     2 0     4S   1( 0.00)       -2.73793       -2.74985        0.01192
+     3 1     4P   1( 0.00)       -2.25938       -2.25525       -0.00412
+\end{verbatim}
+although errors may reach 0.01 Ry (still one order of magnitude 
+better than what we get with the previous 4-electron PP). The price 
+to pay is the presence of more electrons in the valence.
+\newpage
+\subsection{Testing in molecules and solids}
+
+Even if our PP looks good
+(or not too bad) on paper based on the results of atomic calculations,
+it is always a good idea to test it in simple molecular or solid-state
+systems, for which all-electron data (i.e. calculations performed with
+the same XC functional but without PP's, such as e.g. FLAPW, LMTO,
+Quantum Chemstry calculations) is available. The comparison with
+experiments is of course interesting, but the goal of PP's is to 
+reproduce AE data, not to improve DFT.
+
+
+\appendix
+
+\section{Atomic Calculations}
+
+\subsection{Nonrelativistic case}
+
+Let us assume that the charge density $n(r)$ and the potential $V(r)$
+are spherically symmetric. The Kohn-Sham (KS) equation:
+\begin{equation}
+\left(-{\hbar^2\over 2m}\nabla^2 + V(r)-\epsilon\right) \psi(\r)=0
+\end{equation}
+can be written in spherical coordinates. We write the wavefunctions as
+\begin{equation}
+\psi(\r)=\left({R_{nl}(r)\over r}\right)Y_{lm}(\hat\r),
+\end{equation}
+where $n$ is the main quantum 
+number $l=n-1,n-2,\dots,0$ is angular momentum, $m=l,l-1,\dots,-l+1,-l$
+is the projection of the angular momentum on some axis. 
+The radial KS equation becomes:
+\begin{eqnarray}
+\left(-{\hbar^2\over 2m} {1\over r} {d^2 R_{nl}(r)\over dr^2}
+      +(V(r)-\epsilon) {1\over r} R_{nl}(r)
+\right) Y_{lm}(\hat\r) \hskip 4cm \nonumber \\ \mbox{} - 
+{\hbar^2\over 2m} \left({1\over\mbox{sin}\theta}{\partial\over\partial\theta}
+                        \left(\mbox{sin}\theta{\partial Y_{lm}(\hat\r)
+                                               \over\partial\theta}\right)
+                      + {1\over\mbox{sin}^2\theta}
+                           {\partial^2Y_{lm}(\hat\r)\over\partial\phi^2}
+                  \right) {1\over r^3} R_{nl}(r) = 0.
+\end{eqnarray}
+This yields an angular equation for the spherical harmonics $Y_{lm}(\hat\r)$:
+\begin{equation}
+-\left({1\over\mbox{sin}\theta}{\partial\over\partial\theta}
+       \left(\mbox{sin}\theta{\partial Y_{lm}(\hat\r)\over\partial\theta}
+       \right)
+     + {1\over\mbox{sin}^2\theta}
+                           {\partial^2Y_{lm}(\hat\r)\over\partial\phi^2}
+\right) = l(l+1)Y_{lm}(\hat\r)
+\end{equation}
+and a radial equation for the radial part $R_{nl}(r)$:
+\begin{equation}
+-{\hbar^2\over 2m} {d^2 R_{nl}(r)\over dr^2}
++\left( {\hbar^2\over 2m} {l(l+1)\over r^2} + V(r)-\epsilon
+\right) R_{nl}(r) = 0.
+\end{equation}
+The charge density is given by
+\begin{equation}
+n(r) = \sum_{nlm} \Theta_{nl}\left |{R_{nl}(r)\over r}Y_{lm}(\hat r)\right|^2 
+     = \sum_{nl} \Theta_{nl}{R^2_{nl}(r)\over 4\pi r^2}
+\end{equation}
+where $\Theta_{nl}$ are the occupancies ($\Theta_{nl}\le 2l+1$)
+and it is assumed that the occupancies of $m$ are such as to yield
+a spherically symmetric charge density (which is true only for closed
+shell atoms).
+\subsubsection{Useful formulae} 
+
+Gradient in spherical coordinates $(r,\theta,\phi)$:
+\begin{equation}
+\nabla\psi = \left({\partial\psi\over\partial r},
+                   {1\over r}{\partial\psi\over\partial\theta},
+                   {1\over r \mbox{sin}\theta}
+                              {\partial\psi\over\partial\phi}
+             \right)
+\end{equation}
+Laplacian in spherical coordinates:
+\begin{equation}
+\nabla^2\psi = {1\over r} {\partial^2\over\partial r^2}(r\psi)
+             + {1\over r^2\mbox{sin}\theta} {\partial\over\partial\theta}
+               \left(\mbox{sin}\theta{\partial\psi\over\partial\theta}\right)
+             + {1\over r^2\mbox{sin}^2\theta}
+                {\partial^2\psi\over\partial\phi^2}
+\end{equation}
+
+\subsection{Fully relativistic case} 
+
+The relativistic KS equations are
+Dirac-like equations for a spinor with a ``large'' $R_{nlj}(r)$ and
+a ``small'' $S_{nlj}(r)$ component:
+\begin{eqnarray}
+c\left({d \over dr} + {\kappa\over r}\right)R_{nlj}(r) & = & 
+       \left(2mc^2 - V(r) + \epsilon \right)S_{nlj}(r)\\
+c\left({d \over dr} - {\kappa\over r}\right)S_{nlj}(r) & = & 
+       \left( V(r) + \epsilon \right)       R_{nlj}(r)
+\end{eqnarray}
+where $j$ is the total angular momentum ($j=1/2$ if $l=0$, 
+$j=l+1/2,l-1/2$ otherwise); $\kappa=-2(j-l)(j+1/2)$ is the Dirac 
+quantum number ($\kappa=-1$ is $l=0$, $\kappa=-l-1,l$ otherwise);
+and the charge density is given by
+\begin{equation}
+  n(r) = \sum_{nlj} \Theta_{nlj}{R^2_{nlj}(r)+S^2_{nlj}(r)\over 4\pi r^2}.
+\end{equation}
+
+
+\subsection{Scalar-relativistic case} 
+
+The full relativistic KS equations
+is be transformed into an equation for the large component only
+and averaged over spin-orbit components. In atomic units
+(Rydberg: $\hbar=1, m=1/2, e^2=2$):
+\begin{eqnarray}
+-{d^2 R_{nl}(r)\over dr^2}
++\left( {l(l+1)\over r^2} + M(r)\left(V(r)-\epsilon\right)
+\right) R_{nl}(r) \qquad \nonumber \\ \mbox{} -
+ {\alpha^2\over 4M(r)} {dV(r)\over dr} 
+                    \left({dR_{nl}(r)\over dr} +
+                          \langle\kappa\rangle {R_{nl}(r)\over r}\right)= 0,
+\end{eqnarray}
+where $\alpha=1/137.036$ is the fine-structure constant,
+$\langle\kappa\rangle=-1$ is the degeneracy-weighted average value 
+of the Dirac's $\kappa$ for the two spin-orbit-split levels, $M(r)$ is
+defined as
+\begin{equation}
+M(r)= 1 - {\alpha^2\over 4} \left(V(r)-\epsilon\right).
+\end{equation}
+The charge density is defined as in the nonrelativistic case:
+\begin{equation}
+n(r) = \sum_{nl} \Theta_{nl}{R^2_{nl}(r)\over 4\pi r^2}.
+\end{equation}
+
+\subsection{Numerical solution} 
+
+The radial (scalar-relativistic) KS equation is integrated 
+on a radial grid. It is convenient to
+have a denser grid close to the nucleus and a coarser one far
+away. Traditionally a logarithmic grid is used: 
+$r_i=r_0\mbox{exp}(i\Delta x)$. With this grid, one has
+\begin{equation}
+\int_0^\infty f(r) d r = \int_0^\infty f(x) r(x) dx
+\end{equation}
+and
+\begin{equation}
+{d f(r)\over d r}={1\over r} {d f(x)\over d x},\qquad
+{d^2 f(r)\over d r^2}=-{1\over r^2} {d f(x)\over d x}
++ {1\over r^2} {d^2 f(x)\over d x^2}.
+\end{equation}
+We start with a given self-consistent potential $V$ and
+a trial eigenvalue $\epsilon$. The equation is integrated
+from $r=0$ outwards to $r_t$, the outermost classical 
+(nonrelativistic for simplicity) turning point, defined
+by $ {l(l+1) /r_t^2} + \left(V(r_t)-\epsilon\right)=0$.
+In a logarithmic grid (see above) the equation to solve becomes:
+\begin{eqnarray}
+{1\over r^2} {d^2 R_{nl}(x)\over d x^2} & = & 
+  {1\over r^2} {d R_{nl}(x)\over d x} + 
+  \left( {l(l+1)\over r^2} + 
+  M(r)\left(V(r)-\epsilon\right) \right) R_{nl}(r) \nonumber \\
+ & & \mbox{} - {\alpha^2\over 4M(r)} {dV(r)\over dr} 
+      \left({1\over r} {dR_{nl}(x)\over dx} +
+            \langle\kappa\rangle {R_{nl}(r)\over r}\right).
+\end{eqnarray}
+This determines ${d^2 R_{nl}(x)/d x^2}$ which is used to
+determine ${d R_{nl}(x)/ dx}$ which in turn is used to
+determine $R_{nl}(r)$, using predictor-corrector or whatever
+classical integration method. ${dV(r)/dr}$ is evaluated
+numerically from any finite difference method. The series
+is started using the known (?) asymptotic behavior of $R_{nl}(r)$ 
+close to the nucleus (with ionic charge $Z$)
+\begin{equation}
+R_{nl}(r)\simeq r^\gamma,\qquad \gamma={l\sqrt{l^2-\alpha^2 Z^2}+
+(l+1)\sqrt{(l+1)^2-\alpha^2 Z^2}\over 2l+1}.
+\end{equation}
+The number of nodes is counted. If there are too few (many)
+nodes, the trial eigenvalue is increased (decreased) and
+the procedure is restarted until the correct number $n-l-1$
+of nodes is reached. Then a second integration is started 
+inward, starting from a suitably large $r\sim 10r_t$ down 
+to $r_t$, using as a starting point the asymptotic behavior 
+of $R_{nl}(r)$ at large $r$: 
+\begin{equation}
+R_{nl}(r)\simeq e^{-k(r)r},\qquad 
+k(r)=\sqrt{{l(l+1)\over r^2} + \left(V(r)-\epsilon\right)}.
+\end{equation}
+The two pieces are continuously joined at $r_t$ and a correction to the trial 
+eigenvalue is estimated using perturbation theory (see below). The procedure 
+is iterated to self-consistency.
+
+The perturbative estimate of correction to trial eigenvalues is described in
+the following for the nonrelativistic case (it is not worth to make relativistic
+corrections on top of a correction). The trial eigenvector $R_{nl}(r)$ will have 
+a cusp at $r_t$ if the trial eigenvalue is not a true eigenvalue:
+\begin{equation}
+A = {d R_{nl}(r_t^+)\over dr} - {d R_{nl}(r_t^-)\over dr} \ne 0.
+\end{equation}
+Such discontinuity in the first derivative translates into a
+$\delta(r_t)$ in the second derivative:
+\begin{equation}
+{d^2  R_{nl}(r)\over dr^2} = {d^2 \widetilde R_{nl}(r)\over dr^2}
+  + A \delta(r-r_t)
+\end{equation}
+where the tilde denotes the function obtained by matching the
+second derivatives in the $r< r_t$ and $r> r_t$ regions.
+This means that we are actually solving a different problem in which 
+$V(r)$ is replaced by $V(r)+\Delta V(r)$, 
+given by
+\begin{equation}
+ \Delta V(r) = -{\hbar^2 \over 2m} {A\over R_{nl}(r_t)}\delta(r-r_t).
+\end{equation}
+The energy difference between the solution to such fictitious potential 
+and the solution to the real potential can be estimated from
+perturbation theory:
+\begin{equation}
+ \Delta\epsilon_{nl} = - \langle\psi|\Delta V |\psi\rangle
+                     =   {\hbar^2 \over 2m} R_{nl}(r_t) A.
+\end{equation}
+
+\section{Equations for the Troullier-Martins method}
+
+We assume a pseudowavefunction $R^{ps}$ having the following form:
+\begin{eqnarray}
+R^{ps}(r)&=&r^{l+1}e^{p(r)} \quad r\le r_c \\
+R^{ps}(r)&=&R(r)         \quad r\ge r_c
+\end{eqnarray}
+where
+\begin{equation}
+p(r)=c_0+c_2r^2+c_4r^4+c_6r^6+c_8r^8+c_{10}r^{10}+c_{12}r^{12}.
+\end{equation}
+On this pseudowavefunction we impose the norm conservation
+condition:
+\begin{equation}
+\int_{r<r_c} (R^{ps}(r))^2 dr=\int_{r<r_c} (R(r))^2 dr
+\end{equation}
+and continuity conditions on the wavefunction and its derivatives up
+to order four at the matching point:
+\begin{equation}
+{d^nR^{ps}(r_c)\over dr^n}={d^nR(r_c)\over dr^n}, \quad n=0,...,4
+\end{equation}
+
+\noindent$\bullet$ Continuity of the wavefunction:
+\begin{equation}
+R^{ps}(r_c)=r_c^{l+1}e^{p(r_c)}=R(r_c)
+\end{equation}
+\begin{equation}
+p(r_c) = \mbox{log}{R(r_c)\over r_c^{l+1}} 
+\end{equation}
+
+\noindent$\bullet$ Continuity of the first derivative of the wavefunction:
+\begin{equation}
+{dR^{ps}(r)\over dr} = (l+1)r^le^{p(r)} + r^{l+1}e^{p(r)}p'(r)
+                         ={l+1\over r}R^{ps}(r) + p'(r)R^{ps}(r)
+\end{equation}
+that is
+\begin{equation}
+ p'(r_c) = {dR(r_c)\over dr} {1\over R^{ps}(r_c)} -
+           {l+1\over r_c}.
+\end{equation}
+
+\noindent$\bullet$ Continuity of the second  derivative of the wavefunction:
+\begin{eqnarray}
+{d^2R^{ps}(r)\over d^2r} 
+   & = &
+     {d\over dr}\left((l+1)r^le^{p(r)} + r^{l+1}e^{p(r)}p'(r)\right) 
+\nonumber \\ & = &
+     l(l+1)r^{l-1}e^{p(r)} + 2(l+1)r^le^{p(r)}p'(r) +
+     r^{l+1}e^{p(r)}\left[p'(r)\right]^2 + r^{l+1}e^{p(r)}p''(r)
+\nonumber\\ & = &
+     \left( {l(l+1)\over r^2}+ {2(l+1)\over r}p'(r) +
+            \left[p'(r)\right]^2 + p''(r) \right) r^{l+1}e^{p(r)}.
+\end{eqnarray}
+From the radial Schr\"odinger equation:
+\begin{equation}
+ {d^2R^{ps}(r)\over dr^2} = 
+    \left ( {l(l+1)\over r^2} +{2m\over\hbar^2}(V(r)-\epsilon)\right)R^{ps}(r)
+\end{equation}
+that is
+\begin{equation}
+p''(r_c) = {2m\over\hbar^2}(V(r_c)-\epsilon) - 2 {l+1\over r_c}p'(r_c)
+         -\left[p'(r_c)\right]^2 
+\end{equation}
+
+\noindent$\bullet$ Continuity of the third and fourth derivatives of the
+wavefunction. This is assured if the third and fourth derivatives of
+$p(r)$ are continuous. By direct derivation of the expression of
+$p''(r)$:
+\begin{equation}
+p'''(r_c) = {2m\over\hbar^2}V'(r_c) + 2 {l+1\over r^2_c}p'(r_c)
+          - 2{l+1\over r_c}p''(r_c) -2 p'(r_c)p''(r_c)
+\end{equation}
+
+\begin{eqnarray}
+p''''(r_c) & = & {2m\over\hbar^2}V''(r_c) - 4 {l+1\over r^3_c}p'(r_c)
+                 + 4{l+1\over r^2_c}p''(r) \nonumber \\ & & \mbox{} 
+            - 2{l+1\over r_c}p'''(r_c)
+           - 2 \left[p''(r_c)p''(r_c)\right]^2 -2 p'(r_c)p'''(r_c)
+\end{eqnarray}
+
+The additional condition: $V''(0)=0$ is imposed. 
+The screened potential is
+\begin{eqnarray}
+V(r)&=&{\hbar^2\over2m}\left({1\over R^{ps}(r)}{d^2R^{ps}(r)\over dr^2} 
+     - {l(l+1)\over r^2}\right)+\epsilon \\
+    &=&{\hbar^2\over2m}\left( 2{l+1\over r} p'(r)+\left[p(r)\right]^2+p''(r)
+       \right)+\epsilon
+\end{eqnarray}
+
+Keeping only lower-order terms in $r$:
+\begin{eqnarray}
+V(r) &\simeq&{\hbar^2\over2m}\left( 2{l+1\over r} (2c_2r + 4c_4r^3) 
+               + 4c_2^2r^2 + 2c_2 + 12c_4r^2\right) + \epsilon \\
+     &   =  & {\hbar^2\over2m}\left( 2c_2(2l+3) + 
+              \left((2l+5)c_4+c_2^2\right) r^2\right)+ \epsilon .
+\end{eqnarray}
+The additional constraint is:
+\begin{equation}
+(2l+5)c_4+c_2^2=0.
+\end{equation}
+
+
+
+\begin{thebibliography}{10}
+
+\bibitem{NC} 
+D.R. Hamann, M. Schl\"uter, and C. Chiang, 
+Phys. Rev. Lett. {\bf 43}, 1494 (1979).
+
+\bibitem{van} D. Vanderbilt, Phys. Rev. B  {\bf 47}, 10142 (1993).
+
+\bibitem{PAW} P.~E. Bl\"ochl, Phys. Rev. B {\bf 50}, 17953 (1994).
+
+\bibitem{BHS} 
+G.B. Bachelet, D.R. Hamann and M. Schl\"uter, Phys. Rev. B {\bf 26},
+4199 (1982). 
+
+\bibitem{Gonze} 
+X. Gonze, R. Stumpf, and M. Scheffler, Phys. Rev. B {\bf 44}, 8503 (1991).
+
+\bibitem{Goedecker} 
+S. Goedecker, M. Teter, and J. Hutter, Phys. Rev. B {\bf 54}, 1703 (1996).
+
+\bibitem{TM} N. Troullier and J.L. Martins, Phys. Rev. B {\bf 43},
+1993 (1991).
+
+\bibitem{fhi98PP} 
+M.Fuchs and M. Scheffler, Comput. Phys. Commun. {\bf 119}, 67 (1999).
+
+\bibitem{RRKJ} A. M. Rappe, K. M. Rabe, E. Kaxiras, and J. D. Joannopoulos, 
+Phys. Rev. B {\bf 41}, 1227 (1990) 
+(erratum: Phys. Rev. B {\bf 44}, 13175 (1991)).
+
+\bibitem{KB} L. Kleinman and D.M. Bylander, Phys. Rev. Lett. 48, 1425 (1982).
+
+\bibitem{CoreCorr} 
+S.G. Louie, S. Froyen, and M.L. Cohen, Phys. Rev. B {\bf 26}, 1738 (1982).
+
+\bibitem{Zunger} S.H. Wei and A. Zunger, Phys. Rev. B {\bf 37}, 8958 (1987).
+
+\end{thebibliography}
+
+\end{document}

Deleted: trunk/espresso/atomic/Makefile
===================================================================
--- trunk/espresso/atomic/Makefile	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/Makefile	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,126 +0,0 @@
-#
-# Makefile for atomic code
-#
-
-include ../make.sys
-
-# location of needed modules
-MODFLAGS= $(MOD_FLAG)../iotk/src $(MOD_FLAG)../Modules $(MOD_FLAG).
-
-LD1OBJS = \
-add_exchange.o \
-all_electron.o \
-ascheq.o \
-ascheqps.o \
-ascheqps_drv.o \
-c6_dft.o \
-c6_tfvw.o \
-calculate_gipaw_orbitals.o \
-cfdsol.o \
-chargeps.o \
-compute_chi.o \
-compute_chi_tm.o \
-compute_phi.o \
-compute_phi_tm.o \
-compute_phius.o \
-compute_potps.o \
-compute_potps_new.o \
-compute_q_3bess.o \
-compute_relpert.o \
-compute_solution.o \
-descreening.o \
-dfx_new.o \
-dir_outward.o \
-dirsol.o \
-dmixp.o \
-drhoofv.o \
-drho0ofvx.o \
-dvex.o \
-el_config.o \
-elsd.o \
-elsd_highv.o \
-elsdps.o \
-elsdps_paw.o \
-esic.o \
-export_upf.o \
-find_qi.o \
-gener_pseudo.o \
-grad_log.o \
-green.o \
-import_upf.o \
-int_0_inf_dr.o \
-integrate_inward.o \
-integrate_outward.o \
-inward.o \
-outward.o \
-intref.o \
-kin_e_density.o \
-ld1_readin.o \
-ld1_setup.o \
-ld1_writeout.o \
-lderiv.o \
-lderivps.o \
-lschps.o \
-newd_at.o \
-new_potential.o \
-nodenum.o \
-normalize.o \
-occ_spin.o \
-paw_type.o \
-partial_wave_expansion.o \
-pseudovloc.o \
-pseudo_q.o \
-read_pseudo_ncpp.o \
-read_pseudo_rrkj3.o \
-run_lda_half.o \
-run_pseudo.o \
-run_test.o \
-scf.o \
-seriebes.o \
-set_rho_core.o \
-set_psi_in.o \
-set_rc_rv.o \
-set_sl3.o \
-sic_correction.o \
-starting_potential.o \
-start_potps.o \
-start_scheq.o \
-test_bessel.o \
-trou.o \
-vdpack.o \
-vext.o \
-vpack.o \
-v_of_rho_at.o \
-vxcgc.o \
-write_cpmd.o \
-write_ae_pseudo.o \
-write_files.o \
-write_paw_recon.o \
-write_pseudo.o \
-write_results.o \
-write_resultsps.o \
-write_upf.o
-
-LD1MODS = \
-atomic_paw.o \
-ld1inc.o \
-parameters.o 
-
-QEMODS=../Modules/libqemod.a
-
-TLDEPS= bindir mods libs 
-
-all: tldeps ld1.x
-
-ld1.x: $(LD1OBJS) ld1.o $(LD1MODS) $(QEMODS) $(LIBOBJS)
-	$(LD) $(LDFLAGS) -o ld1.x \
-		ld1.o $(LD1OBJS) $(LD1MODS) $(QEMODS) $(LIBOBJS) $(LIBS)
-	- ( cd ../bin ; ln -fs ../atomic/ld1.x . )
-
-tldeps:
-	test -n "$(TLDEPS)" && ( cd .. ; $(MAKE) $(MFLAGS) $(TLDEPS) || exit 1) || :
-
-clean:
-	- /bin/rm -f *.o *.F90 *.x $(LIB) *~ *.d *.mod *.tmp.* *.L
-
-include make.depend

Added: trunk/espresso/atomic/Makefile
===================================================================
--- trunk/espresso/atomic/Makefile	                        (rev 0)
+++ trunk/espresso/atomic/Makefile	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,19 @@
+# Makefile for atomic
+# Adapted from TDDFPT main Makefile
+
+default: all
+
+all:
+	if test -d src ; then \
+	( cd src ; if test "$(MAKE)" = "" ; then make $(MFLAGS) $@; \
+	else $(MAKE) $(MFLAGS) $@ ; fi ) ; fi ; \
+
+clean :
+	if test -d src ; then \
+	( cd src ; if test "$(MAKE)" = "" ; then make clean ; \
+	else $(MAKE) clean ; fi ) ; fi ;\
+
+distclean: clean
+
+
+

Copied: trunk/espresso/atomic/README (from rev 8077, trunk/espresso/atomic_doc/README)
===================================================================
--- trunk/espresso/atomic/README	                        (rev 0)
+++ trunk/espresso/atomic/README	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,39 @@
+This is the distribution of the "atomic"  code for electronic structure 
+atomic calculations and pseudo-potentials generation.
+
+The "atomic"  code, maintained by Andrea Dal Corso (SISSA, Trieste) 
+is the result of several additions to the original ld1 code by
+P. Giannozzi (http://www.fisica.uniud.it/~giannozz/software.html) 
+for pseudopotential generation. The major additions are:
+
+a) Generation and test of norm-conserving and ultrasoft pseudo-potentials
+   with the Rappe-Rabe-Kaxiras-Joannopoulos (RRKJ) recipe
+   ( Phys. Rev. B41, 1227 (1990); Phys. Rev. B 44, 13175 (1991) )
+b) Generation of fully relativistic pseudo-potentials including 
+   spin-orbit coupling.
+c) Generation of PAW dataset. Based on the original implementation by 
+   G. Fratesi with several additions by R. Mazzarello and L. Paulatto.
+
+A general introduction on (norm-conserving) pseudopotential generation
+can be found in file pseudo-gen.pdf (LaTex source in pseudo-gen.tex). 
+Input variables are described in files INPUT_LD1.txt, INPUT_LD1.html
+in the directory Doc/ of the Quantum ESPRESSO distribution.
+Directories all-electron/, pseudo-gen/, pseudo-test/,
+contain tests for the three modes of operation, respectively:
+all-electron run, pseudo-potential generation, pseudo-potential testing. 
+Directories pseudo_library/ and paw_library/ contain input data used 
+for pseudopotential generation of many elements.
+
+All the material included in this distribution is free software;
+you can redistribute it and/or modify it under the terms of the GNU
+General Public License as published by the Free Software Foundation;
+either version 2 of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+675 Mass Ave, Cambridge, MA 02139, USA.

Deleted: trunk/espresso/atomic/add_exchange.f90
===================================================================
--- trunk/espresso/atomic/add_exchange.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/add_exchange.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,98 +0,0 @@
-!
-!--------------------------------------------------------------------
-subroutine add_exchange ( energy )
-!--------------------------------------------------------------------
-#undef DEBUG
-   !  
-   use io_global, only: stdout
-   use kinds,  only: DP
-   use constants, only: e2
-   use ld1_parameters, only : nwfx
-   use ld1inc, only: nwf, oc, psi, vx, sl3, ll, nn, enl, el, &
-                     isw, nspin, enzero, grid
-   use radial_grids, only: ndmx, hartree
-   implicit none
-   !
-   ! I/O variables
-   !
-   real (DP) :: energy
-   !
-   ! local variables
-   !
-   integer :: i, l0, l1, l2, l3, nu, mu, nst, is, half
-   real (DP) :: ex_hf, ocs, doc, sss, fac, sxc, sxc1
-   real (DP) :: wrk(ndmx), wrk1(ndmx), wrk2(ndmx), int_0_inf_dr, enzhf(nwfx)
-!
-   ex_hf = 0.0
-   do nu=1,nwf
-      is = isw(nu)
-      l1 = ll(nu)
-      half = 2.d0 * l1 + 1.d0
-      sxc = 0.0d0
-      do mu=1,nwf
-!
-! only wfc with the same spin contribute to exchange term
-!
-         if (isw(mu) /= is) cycle
-         ocs = oc(mu) * (0.5d0 * nspin )
-         if ( mu == nu ) then
-            doc = 0.d0
-            if( (l1 /= 0) .and. (ocs > 0.d0) ) then
-              i = int(ocs)
-              doc = (i*(2.d0*ocs-i-1.d0)/(half-1.d0) - ocs*ocs/half) * half/ocs
-            end if
-            ocs = ocs + doc
-!            if (doc /= 0.d0) write (*,*) "DOC ",nu, doc
-         end if
-
-         l2 = ll(mu)
-         l0=abs(l1-l2)
-         do i=1,grid%mesh
-            wrk(i) = psi(i,1,mu)*psi(i,1,nu)
-            wrk1(i)= 0.0d0
-         end do
-         do l3=l0,l1+l2
-            sss = sl3(l1,l2,l3)
-            if (abs(sss).gt.1.0d-10) then
-               call hartree(l3,l1+l2+2,grid%mesh,grid,wrk,wrk2)
-               fac = -e2*ocs*sss/2.0d0
-               do i=1,grid%mesh
-                  wrk1(i)= wrk1(i) + fac*wrk2(i)*wrk(i)
-               end do
-            end if
-         end do
-!- spurious hartree part 
-          if (mu.eq.nu) then
-            call hartree(0,2,grid%mesh,grid,wrk,wrk2)
-            fac = doc*e2
-            do i=1,grid%mesh
-               wrk1(i) = wrk1(i) + fac*wrk2(i)*wrk(i)
-            end do
-          end if
-!
-         nst = 2 * min(l1,l2) + 2
-         sxc = sxc + int_0_inf_dr(wrk1,grid,grid%mesh,nst)
-      end do 
-!
-      do i=1,grid%mesh
-         wrk1(i) = vx(i,is)*psi(i,1,nu)*psi(i,1,nu)
-      end do
-      sxc1 = int_0_inf_dr(wrk1,grid,grid%mesh,2*ll(nu)+2)
-      ex_hf = ex_hf + 0.5d0*oc(nu)*sxc
-      enzhf(nu)=sxc1-sxc
-      if(oc(nu)>0) enzero(is) = enzhf(nu)
-   end do 
-
-   energy = energy + ex_hf
-
-#ifdef DEBUG
-   write (*,*) enzero
-   write(stdout,1100) (nn(nu),ll(nu),el(nu),oc(nu),enl(nu)-enzero(isw(nu)), &
-                  enl(nu)-enzhf(nu), nu=1,nwf)
-
-1100 format(4x,2i2,5x,a2,'(',f5.2,')',2f11.4)
-#endif
-
-   return
-
-end subroutine add_exchange

Deleted: trunk/espresso/atomic/all_electron.f90
===================================================================
--- trunk/espresso/atomic/all_electron.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/all_electron.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,81 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-SUBROUTINE all_electron(ild,ic)
-  !---------------------------------------------------------------
-  !
-  !  this routine is a driver to an all-electron calculation
-  !  with the parameters given in input
-  !
-  !
-  USE kinds, ONLY : DP
-  USE radial_grids, ONLY: ndmx
-  USE ld1inc, ONLY: isic, grid, zeta, rho, enne, vpot, vxt, enl, &
-                     deld, encl, etot, ecxc, evxt, ehrt, epseu, ekin, &
-                     vnl, vh, lsd, nspin, nlcc, vdw, nn, ll, oc, nwf, &
-                     zed, zval, vxc, exc, excgga, v0, verbosity, &
-                     relpert, evel, edar, eso, vsic, vsicnew, vhn1, egc
-  IMPLICIT NONE
-
-  INTEGER, INTENT(in) :: ic   ! counter on configurations
-  LOGICAL :: ild    ! if true compute log der
-  !
-  !    compute an initial estimate of the potential
-  !
-  CALL starting_potential (ndmx, grid%mesh, zval, zed, nwf, oc, nn, ll,&
-                           grid%r,enl, v0, vxt, vpot, enne, nspin )
-  !
-  ! allocate variables for SIC, if needed
-  !
-  IF (isic /= 0) THEN
-     ALLOCATE(vsic(ndmx,nwf), vsicnew(ndmx), vhn1(ndmx), egc(ndmx))
-     vsic=0.0_dp
-  ENDIF
-  !
-  !     solve the eigenvalue self-consistent equation
-  !
-  CALL scf(ic)
-  !
-  !   compute relativistic corrections to the eigenvalues
-  !
-  IF ( relpert ) CALL compute_relpert(evel,edar,eso)
-  !
-  !  compute total energy
-  !
-  CALL elsd (zed,grid,rho,vxt,vh,vxc,exc,excgga,nwf,nspin,enl,oc,    &
-             etot,ekin,encl,ehrt,ecxc,evxt)
-  !
-  IF (verbosity=='high') CALL elsd_highv(ic)
-  !
-  !   add sic correction if needed
-  !
-  IF(isic /= 0) CALL esic
-  !
-  !   print results
-  !
-  CALL write_results
-  !
-  !  compute logarithmic derivative
-  !
-  IF (deld > 0.0_DP .and. ild) CALL lderiv
-  !
-  ! compute C6 coefficient if required
-  !
-  IF (vdw) THEN
-     CALL c6_tfvw ( grid%mesh, zed, grid, rho(1,1) )
-     CALL c6_dft  ( grid%mesh, zed, grid )
-  ENDIF
-  !
-  IF (isic /= 0) THEN
-     DEALLOCATE(egc, vhn1, vsicnew, vsic)
-  ENDIF
-  !
-  RETURN
-  !
-END SUBROUTINE all_electron

Deleted: trunk/espresso/atomic/ascheq.f90
===================================================================
--- trunk/espresso/atomic/ascheq.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ascheq.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,254 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine ascheq(nn,lam,e,mesh,grid,vpot,ze2,thresh0,y,nstop)
-  !---------------------------------------------------------------
-  !
-  !  numerical integration of the radial schroedinger equation for
-  !  bound states in a local potential.
-  !  thresh determines the absolute accuracy for the eigenvalue
-  !
-  use kinds, only : DP
-  use radial_grids, only: radial_grid_type, series
-  implicit none
-  type(radial_grid_type), intent(in) :: grid
-  integer :: mesh,lam, ierr
-  integer:: nn,nstop,maxter,iter,l1,i,ik,ncross,n, &
-       nstart,ns,n2,nst2,ndcr
-  real(DP) :: ze2,ddx12,eup,elw,b0e,ymx,rap,rstart,di,expn,  &
-       c1,c2,fe,a0,a1,a2,sum0,f2,sum,sqlhf,f0,f1,dfe,de,eps, &
-       yln,xp,sum1,xl1,x4l6
-  real(DP):: vpot(mesh), y(mesh)
-  real(DP),allocatable:: c(:), el(:), f(:)
-  real(DP):: b(0:3),e,thresh0, thresh
-  data maxter/50/
-  !
-  !  set up constants and initialize
-  !
-  allocate(c(mesh),stat=ierr)
-  allocate(f(mesh),stat=ierr)
-  allocate(el(mesh),stat=ierr)
-
-  thresh=thresh0
-  if (e<-5.e+2) thresh=thresh0*10.0_DP
-  iter=0
-  ddx12=grid%dx*grid%dx/12.0_dp
-  l1=lam+1
-  sqlhf=(DBLE(lam)+0.5_dp)**2
-  ndcr=nn-lam-1
-  !
-  !  set initial lower and upper bounds to the eigenvalue
-  !
-  eup=vpot(mesh)+sqlhf/grid%r2(mesh)
-  elw=eup
-  do i=1,mesh
-     elw=min(elw,vpot(i)+sqlhf/grid%r2(i))
-  enddo
-  nstop=200
-  if(eup.eq.elw) go to 900
-  if(e.gt.eup) e=0.9_DP*eup+0.1_DP*elw
-  if(e.lt.elw) e=0.9_DP*elw+0.1_DP*eup
-  !
-  !  series developement of the potential near the origin
-  !
-  do i=1,4
-     y(i)=vpot(i)-ze2/grid%r(i)
-  enddo
-  call series(y,grid%r,grid%r2,b)
-  !
-300 continue
-  iter=iter+1
-  nstop=300
-  if(iter.gt.maxter) go to 900
-  !
-  !  set up the f-function and determine the position of its last
-  !  change of sign
-  !  f < 0 (approximatively) means classically allowed   region
-  !  f > 0         "           "        "      forbidden   "
-  !
-  f(1)=ddx12*(grid%r2(1)*(vpot(1)-e)+sqlhf)
-  do i=2,mesh
-     f(i)=ddx12*(grid%r2(i)*(vpot(i)-e)+sqlhf)
-     if( f(i) .ne. sign(f(i),f(i-1)) ) ik=i
-  enddo
-  nstop=302
-  
-  if(ik.ge.mesh-2) go to 900
-  do i=1,mesh
-     f(i)=1.0_dp-f(i)
-  enddo
-  !
-  y(:) = 0.0_dp
-  !
-  !  determination of the wave-function in the first two points by
-  !  series developement
-  !
-  xl1=lam+1.0_DP
-  x4l6=4.0_dp*lam+6.0_dp
-  b0e=b(0)-e
-  c1=0.5_dp*ze2/xl1
-  c2=(c1*ze2+b0e)/x4l6
-  call start_scheq( lam, e, b, grid, ze2, y )
-  !
-  !  start outward integration and count number of crossings
-  !
-  ncross=0
-  ymx=0.0_dp
-  do n=2,ik-1
-     y(n+1)=((12.0_dp-10.0_dp*f(n))*y(n)-f(n-1)*y(n-1))/f(n+1)
-     if ( y(n) .ne. sign(y(n),y(n+1)) ) ncross=ncross+1
-     ymx=max(ymx,abs(y(n+1)))
-  end do
-  !
-  !  matching radius has been reached going out. if ncross is not
-  !  equal to ndcr, modify the trial eigenvalue.
-  !
-  if(ndcr < ncross) then
-     !
-     !  too many crossings. e is an upper bound to the true eigen-
-     !  value. increase abs(e)
-     !
-     eup=e
-     rap=(DBLE(ncross+l1)/DBLE(nn))**2
-     e=(e-vpot(mesh))*rap+vpot(mesh)
-     if(e.lt.elw) e=0.9_dp*elw+0.1_dp*eup
-     go to 300
-  else if (ndcr > ncross) then
-     !
-     !  too few crossings. e is a lower bound to the true eigen-
-     !  value. decrease abs(e)
-     !
-     elw=e
-     rap=(DBLE(ncross+l1)/DBLE(nn))**2
-     e=(e-vpot(mesh))*rap+vpot(mesh)
-     if(e.gt.eup) e=0.9_dp*eup+0.1_dp*elw
-     go to 300
-  end if
-  !
-  !  prepare inward integration
-  !  charlotte froese can j phys 41,1895(1963)
-  !
-  !            start at  min( rmax, 10*rmatch )
-  !
-  nstart=mesh
-  ns=10
-  rstart=ns*grid%r(ik)
-  if(rstart.lt.grid%r(mesh)) then
-     do  i=ik,mesh
-        nstart=i
-        if(grid%r(i).ge.rstart) go to 403
-     enddo
-403  nstart=nstart/2
-     nstart=2*nstart+1
-  end if
-  !
-  !  set up a, l, and c vectors
-  !
-  n=ik+1
-  el(n)=10.0_dp*f(n)-12.0_dp
-  c(n)=-f(ik)*y(ik)
-  n2=ik+2
-  do n=n2,nstart
-     di=10.0_dp*f(n)-12.0_dp
-     el(n)=di-f(n)*f(n-1)/el(n-1)
-     c(n)=-c(n-1)*f(n-1)/el(n-1)
-  enddo
-  !
-  !  start inward integration by the froese's tail procedure
-  !
-  expn=exp(-sqrt(12.0_dp*abs(1.0_dp-f(nstart-1))))
-  y(nstart-1)=c(nstart-1)/(el(nstart-1)+f(nstart)*expn)
-  y(nstart)=expn*y(nstart-1)
-  do n=nstart-2,ik+1,-1
-    y(n)=(c(n)-f(n+1)*y(n+1))/el(n)
- end do
-  !
-  !  if necessary, improve the trial eigenvalue by the cooley's
-  !  procedure. jw cooley math of comp 15,363(1961)
-  !
-  fe=(12.0_dp-10.0_dp*f(ik))*y(ik)-f(ik-1)*y(ik-1)-f(ik+1)*y(ik+1)
-  !
-  !  calculate the normalization
-  !
-  if(ymx.ge.1.0e10_dp) then
-     do  i=1,mesh
-        y(i)=y(i)/ymx
-     enddo
-  end if
-  a0=1.0_dp/DBLE(2*lam+3)
-  a1=c1/DBLE(lam+2)
-  a2=(c1*c1+c2+c2)/DBLE(2*lam+5)
-  sum0=(a0+grid%r(1)*(a1+grid%r(1)*a2))*grid%r(1)**(2*lam+3)
-  nst2=nstart-2
-  f2=grid%r2(1  )*y(1  )*y(1  )
-  sum=grid%r(1)*f2/DBLE(2*l1+1)
-  do n=1,nst2,2
-     f0=f2
-     f1=grid%r2(n+1)*y(n+1)*y(n+1)
-     f2=grid%r2(n+2)*y(n+2)*y(n+2)
-     sum=sum+f0+f2+4.0_DP*f1
-  enddo
-  sum=sum0+grid%dx*sum/3.0_dp
-  dfe=-y(ik)*f(ik)/grid%dx/sum
-  de=-fe*dfe
-  eps=abs(de/e)
-  if(abs(de).lt.thresh) go to 600
-  if(eps.gt.0.25_dp) de=0.25_dp*de/eps
-  if(de.gt.0.0_dp) elw=e
-  if(de.lt.0.0_dp) eup=e
-  e=e+de
-  if(e.gt.eup) e=0.9_dp*eup+0.1_dp*elw
-  if(e.lt.elw) e=0.9_dp*elw+0.1_dp*eup
-  if(iter.lt.maxter) go to 300
-  nstop=50
-600 continue
-  !
-  !  normalize the eigenfunction and exit
-  !
-  do n=nstart,mesh-1
-     y(n+1)=0.0_dp
-     if(y(n).eq.0.0_dp) go to 601
-     yln=log(abs(y(n)))
-     xp=-sqrt(12.0_dp*abs(1.0_dp-f(n)))
-     expn=yln+xp
-     if(expn.lt.-80.0_dp) go to 601
-     y(n+1)=sign(exp(expn),y(n))
-601 continue
-  enddo
-  sum1=0.0_dp
-  do n=nstart,mesh-2,2
-     f0=f2
-     f1=grid%r2(n+1)*y(n+1)*y(n+1)
-     f2=grid%r2(n+2)*y(n+2)*y(n+2)
-     sum1=sum1+f0+f2+4.0_dp*f1
-  enddo
-  sum=sum+grid%dx*sum1/3.0_dp
-  sum=sqrt(sum)
-  do n=1,mesh
-     y(n)=grid%sqr(n)*y(n)/sum
-  enddo
-  if(nstop.lt.100) go to 900
-  nstop=0
-  deallocate(el)
-  deallocate(f )
-  deallocate(c )
-  return
-  !
-  !  error exit
-  !
-  ! 900  write(6,9000) nstop,nn,lam,elw,eup
-  ! 9000 format(5x,'error in ascheq: nstop =',i4,'. n l =',2i3,/ &
-  !     & 5x,'elw =',f15.10,' eup =',f15.10)
-900 continue
-  deallocate(el)
-  deallocate(f )
-  deallocate(c )
-  return
-
-end subroutine ascheq

Deleted: trunk/espresso/atomic/ascheqps.f90
===================================================================
--- trunk/espresso/atomic/ascheqps.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ascheqps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,315 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine ascheqps(nam,lam,jam,e0,mesh,ndm,grid,vpot,thresh,y,beta,ddd,&
-           qq,nbeta,nwfx,lls,jjs,ikk,nstop)
-  !---------------------------------------------------------------
-  !
-  !  numerical integration of the radial schroedinger equation for
-  !  bound states in a local potential.
-  !
-  !  This routine works at fixed e
-  !  It allows a nonlocal potential and an overlap
-  !  operator. Therefore it can solve a general schroedinger
-  !  equation necessary to solve a US pseudopotential
-  !
-  use io_global, only : stdout
-  use kinds, only : DP
-  use radial_grids, only: radial_grid_type, series
-
-  implicit none
-
-  type(radial_grid_type), intent(in) :: grid
-  integer :: &
-       nam, &
-       lam, &      ! l angular momentum
-       mesh,&      ! size of radial mesh
-       ndm, &      ! maximum radial mesh 
-       nbeta,&     ! number of beta function  
-       nwfx, &     ! maximum number of beta functions
-       ndcr,  &    ! number of required nodes
-       n1, n2, &   ! counters
-       ikl,    &   ! auxiliary
-       nstop,  &   ! used to check the behaviour of the routine
-       lls(nbeta),&! for each beta the angular momentum
-       ikk(nbeta) ! for each beta the point where it become zero
-
-  real(DP) :: &
-       e0,e,    &  ! output eigenvalue
-       jam,     &  ! j angular momentum
-       vpot(mesh),&! the local potential 
-       thresh,   & ! precision of eigenvalue
-       y(mesh),  & ! the output solution
-       jjs(nwfx), & ! the j angular momentum
-       beta(ndm,nwfx),& ! the beta functions
-       work(nbeta),  & ! auxiliary space
-       ddd(nwfx,nwfx),qq(nwfx,nwfx) ! parameters for computing B_ij
-  !
-  !    the local variables
-  !
-  real(DP) :: &
-       ddx12,      &  ! dx**2/12 used for Numerov integration
-       sqlhf,      &  ! the term for angular momentum in equation
-       ze2,        &  ! possible coulomb term aroun the origin (set 0)
-       b(0:3),     &  ! coefficients of taylor expansion of potential
-       eup,elw,    & ! actual energy interval
-       ymx,        & ! the maximum value of the function
-       fe,integ,dfe,de, &! auxiliary for numerov computation of e
-       eps,        & ! the epsilon of the delta e
-       yln, xp, expn,& ! used to compute the tail of the solution
-       int_0_inf_dr  ! integral function
-
-  real(DP), allocatable :: &
-       fun(:),  &   ! integrand function
-       f(:),    &   ! the f function
-       el(:),c(:) ! auxiliary for inward integration
-
-  integer, parameter :: &
-       maxter=100    ! maximum number of iterations
-
-  integer :: &
-       n,  &    ! counter on mesh points
-       iter,&   ! counter on iteration
-       ik,  &   ! matching point
-       ns,  &   ! counter on beta functions
-       l1,  &   ! lam+1
-       nst, &   ! used in the integration routine
-       ierr, &
-       ncross,& ! actual number of nodes
-       nstart  ! starting point for inward integration
-
-  logical, save :: first(0:10,0:10) = .true.
-
-
-   if (mesh.ne.grid%mesh) call errore('compute_solution','mesh dimension is not as expected',1)
-  !
-  !  set up constants and allocate variables the 
-  !
-  allocate(fun(mesh), stat=ierr)
-  allocate(f(mesh), stat=ierr)
-  allocate(el(mesh), stat=ierr)
-  allocate(c(mesh), stat=ierr)
-
-  nstop=0
-  nstart=0
-  e=e0
-!  write(6,*) 'entering ', nam,lam, e
-  eup=0.3_DP*e
-  elw=1.3_dp*e
-  ndcr=nam-lam-1
-!  write(6,*) 'entering ascheqps', vpot(mesh-20)*grid%r(mesh-20)
-
-  ddx12=grid%dx*grid%dx/12.0_dp
-  l1=lam+1
-  nst=l1*2
-  sqlhf=(DBLE(lam)+0.5_dp)**2
-  !
-  !  series developement of the potential near the origin
-  !
-  do n=1,4
-     y(n)=vpot(n)
-  enddo
-  call series(y,grid%r,grid%r2,b)
-
-  !      write(stdout,*) 'eneter lam,eup,elw,e',lam,nbeta,eup,elw,e
-  !
-  !  set up the f-function and determine the position of its last
-  !  change of sign
-  !  f < 0 (approximatively) means classically allowed   region
-  !  f > 0         "           "        "      forbidden   "
-  !
-  do iter=1,maxter
-!  write(6,*) 'starting iter', iter, elw, e, eup
-  ik=1
-  f(1)=ddx12*(grid%r2(1)*(vpot(1)-e)+sqlhf)
-  do n=2,mesh
-     f(n)=ddx12*(grid%r2(n)*(vpot(n)-e)+sqlhf)
-     if( f(n).ne.sign(f(n),f(n-1)).and.n.lt.mesh-5 ) ik=n
-  enddo
-!  if (ik.eq.0.and.nbeta.eq.0) ik=mesh*3/4
-  if (ik.eq.1.or.grid%r(ik)>4.0_DP) ik=mesh*3/4
-
-  if(ik.ge.mesh-2) then
-     do n=1,mesh
-        write(stdout,*) grid%r(n), vpot(n), f(n)
-     enddo
-     call errore('compute_solution', 'No point found for matching',1)
-  endif
-  !
-  !     determine if ik is sufficiently large
-  !
-  do ns=1,nbeta
-     if (lls(ns).eq.lam .and. jjs(ns).eq.jam .and. ikk(ns).gt.ik) ik=ikk(ns)+3
-  enddo
-  !
-  !     if everything is ok continue the integration and define f
-  !
-  do n=1,mesh
-     f(n)=1.0_dp-f(n)
-  enddo
-  !
-  !  determination of the wave-function in the first two points by
-  !  series developement
-  !
-  ! no coulomb divergence in the origin for a pseudopotential
-  ze2=0.d0 
-  call start_scheq( lam, e, b, grid, ze2, y )
-  !
-  !    outward integration before ik
-  !
-  call integrate_outward (lam,jam,e,mesh,ndm,grid,f,b,y,beta,ddd,qq,&
-       nbeta,nwfx,lls,jjs,ikk,ik)
-
-  ncross=0
-  ymx=0.0_dp
-  do n=2,ik-1
-     if ( y(n) .ne. sign(y(n),y(n+1)) ) ncross=ncross+1
-     ymx=max(ymx,abs(y(n+1)))
-  end do
-!
-!  If at this point the number of nodes is wrong it means that something
-!  is probably wrong in the calling routines. A ghost might be present
-!  in the pseudopotential. With a nonlocal pseudopotential there is no
-!  node theorem so strictly speaking the following instructions are
-!  wrong but sometimes they help so we keep them here.
-!
-  if(ndcr /= ncross .and. first(nam,lam)) then
-  write(stdout,'(/,7x,5(a,i3))') 'WARNING! Expected number of nodes: ',ndcr, '=   ',nam,'-',lam,&
-                                 '-  1, number of nodes found:', ncross,'.'
-  write(stdout,'(7x,a,/,7x,a,/)') 'Setting wfc to zero for this iteration.',&
-                                 '(This warning will only be printed once per wavefunction)'
-  first(nam,lam) = .false.
-  endif
-
-  if(ndcr < ncross) then
-     !
-     !  too many crossings. e is an upper bound to the true eigen-
-     !  value. increase abs(e)
-     !
-
-     eup=e
-     e=0.9_dp*elw+0.1_dp*eup
-!     write(6,*) 'too many crossing', ncross, ndcr
-!     call errore('aschqps','wrong number of nodes. Probably a Ghost?',1)
-     y=0.0_DP
-     ymx=0.0_dp
-     go to 300
-  else if (ndcr > ncross) then
-     !
-     !  too few crossings. e is a lower bound to the true eigen-
-     !  value. decrease abs(e)
-     !
-     elw=e
-     e=0.9_dp*eup+0.1_dp*elw
-!     write(6,*) 'too few crossing', ncross, ndcr
-!     call errore('aschqps','wrong number of nodes. Probably a Ghost?',1)
-     y=0.0_DP
-     ymx=0.0_dp
-     go to 300
-  end if
-  !
-  !    inward integration up to ik
-  !
-  call integrate_inward(e,mesh,ndm,grid,f,y,c,el,ik,nstart)
-  !
-  !  if necessary, improve the trial eigenvalue by the cooley's
-  !  procedure. jw cooley math of comp 15,363(1961)
-  !
-  fe=(12.0_dp-10.0_dp*f(ik))*y(ik)-f(ik-1)*y(ik-1)-f(ik+1)*y(ik+1)
-  !
-  ! audjust the normalization if needed
-  !
-  if(ymx.ge.1.0e10_dp) y=y/ymx
-  !
-  !  calculate the normalization
-  !
-  do n1=1,nbeta
-     if (lam.eq.lls(n1).and.abs(jam-jjs(n1)).lt.1.e-7_dp) then
-        ikl=ikk(n1)
-        do n=1,ikl
-           fun(n)=beta(n,n1)*y(n)*grid%sqr(n)
-        enddo
-        work(n1)=int_0_inf_dr(fun,grid,ikl,nst)
-     else
-        work(n1)=0.0_dp
-     endif
-  enddo
-  do n=1,nstart
-     fun(n)= y(n)*y(n)*grid%r(n)
-  enddo
-  integ=int_0_inf_dr(fun,grid,nstart,nst)
-  do n1=1,nbeta
-     do n2=1,nbeta
-        integ = integ + qq(n1,n2)*work(n1)*work(n2)
-     enddo
-  enddo
-  dfe=-y(ik)*f(ik)/grid%dx/integ
-  de=-fe*dfe
-  eps=abs(de/e)
-!  write(6,'(i5, 3f20.12)') iter, e, de
-  if(abs(de).lt.thresh) go to 600
-  if(eps.gt.0.25_dp) de=0.25_dp*de/eps
-  if(de.gt.0.0_dp) elw=e
-  if(de.lt.0.0_dp) eup=e
-  e=e+de
-  if(e.gt.eup) e=0.9_dp*eup+0.1_dp*elw
-  if(e.lt.elw) e=0.9_dp*elw+0.1_dp*eup
-300 continue
-  enddo
-  nstop=1
-  if (nstart==0) goto 900
-600 continue
-
-  !
-  !   exponential tail of the solution if it was not computed
-  !
-  if (nstart.lt.mesh) then
-     do n=nstart,mesh-1
-        if (y(n) == 0.0_dp) then
-           y(n+1)=0.0_dp
-        else
-           yln=log(abs(y(n)))
-           xp=-sqrt(12.0_dp*abs(1.0_dp-f(n)))
-           expn=yln+xp
-           if (expn.lt.-80.0_dp) then
-              y(n+1)=0.0_dp
-           else
-              y(n+1)=sign(exp(expn),y(n))
-           endif
-        endif
-     enddo
-  endif
-  !
-  !  normalize the eigenfunction as if they were norm conserving. 
-  !  If this is a US PP the correct normalization is done outside this
-  !  routine.
-  !
-  do n=1,mesh
-     el(n)=grid%r(n)*y(n)*y(n)
-  enddo
-  integ=int_0_inf_dr(el,grid,mesh,nst)
-  if (integ>0.0_DP) then
-     integ=sqrt(integ)
-     do n=1,mesh
-        y(n)=grid%sqr(n)*y(n)/integ
-     enddo
-     e0=e
-  else
-     nstop=1
-  endif
-
-900 continue
-
-  deallocate(el)
-  deallocate(f )
-  deallocate(c )
-  deallocate(fun )
-  return
-
-end subroutine ascheqps

Deleted: trunk/espresso/atomic/ascheqps_drv.f90
===================================================================
--- trunk/espresso/atomic/ascheqps_drv.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ascheqps_drv.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,98 +0,0 @@
-
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!--------------------------------------------------------------------------
-subroutine ascheqps_drv(veff, ncom, thresh, flag_all, nerr)
-  !--------------------------------------------------------------------------
-  !
-  !     This routine is a driver that calculates for the test
-  !     configuration the solutions of the Kohn and Sham equation
-  !     with a fixed pseudo-potential. The potentials are
-  !     assumed to be screened. The effective potential veff is given
-  !     in input.
-  !     The output wavefunctions are written in phits and are normalized.
-  !     If flag is .true. compute all wavefunctions, otherwise only
-  !     the wavefunctions with positive occupation.
-  !      
-  use kinds, only: dp
-  use ld1_parameters, only: nwfsx
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid, pseudotype, rel, &
-                    lls, jjs, qq, ikk, ddd, betas, nbeta, vnl, &
-                    nwfts, iswts, octs, llts, jjts, nnts, enlts, phits 
-  implicit none
-
-  integer ::    &
-          nerr, &     ! control the errors of the routine ascheqps
-          ncom        ! number of components of the pseudopotential
-
-  real(DP) :: &
-       veff(ndmx,ncom)    ! work space for writing the potential 
-
-  logical :: flag_all    ! if true calculates all the wavefunctions
-
-  integer ::  &
-       ns,    &  ! counter on pseudo functions
-       is,    &  ! counter on spin
-       nbf,   &  ! auxiliary nbeta
-       n,     &  ! index on r point
-       nstop, &  ! errors in each wavefunction
-       ind
-
-  real(DP) :: &
-       vaux(ndmx,2)     ! work space for writing the potential 
-
-  real(DP) :: thresh         ! threshold for selfconsistency
-  !
-  !    compute the pseudowavefunctions in the test configuration
-  !
-  if (pseudotype.eq.1) then
-     nbf=0
-  else
-     nbf=nbeta
-  endif
-
-  nerr=0
-  do ns=1,nwfts
-     if (octs(ns).gt.0.0_dp.or.(octs(ns).gt.-1.0_dp .and. flag_all)) then
-        is=iswts(ns)
-        if (ncom==1.and.is==2) call   &
-                               errore('ascheqps_drv','uncompatible spin',1)
-        if (pseudotype ==1) then
-           if ( rel < 2 .or. llts(ns) == 0 .or. &
-                abs(jjts(ns)-llts(ns)+0.5_dp) < 0.001_dp) then
-              ind=1
-           else if ( rel == 2 .and. llts(ns) > 0 .and. &
-                abs(jjts(ns)-llts(ns)-0.5_dp) < 0.001_dp) then
-              ind=2
-           else
-              call errore('ascheqps_drv','something strange',1)
-           endif
-           do n=1,grid%mesh
-              vaux(n,is)=veff(n,is)+vnl(n,llts(ns),ind)
-           enddo
-        else
-           do n=1,grid%mesh
-              vaux(n,is)=veff(n,is)
-           enddo
-        endif
-        call ascheqps(nnts(ns),llts(ns),jjts(ns),enlts(ns),grid%mesh,ndmx,grid,&
-             vaux(1,is),thresh,phits(1,ns),betas,ddd(1,1,is),qq,nbf, &
-             nwfsx,lls,jjs,ikk,nstop)
-        !           write(6,*) ns, nnts(ns),llts(ns), jjts(ns), enlts(ns)
-        !
-        !   normalize the wavefunctions 
-        !
-        call normalize(phits(1,ns),llts(ns),jjts(ns), ns)
-        nerr=nerr+nstop
-     endif
-  enddo
-
-  return
-end subroutine ascheqps_drv

Deleted: trunk/espresso/atomic/atomic_paw.f90
===================================================================
--- trunk/espresso/atomic/atomic_paw.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/atomic_paw.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,1243 +0,0 @@
-!#define __DEBUG_V_H_vs_SPHEROPOLE
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-MODULE atomic_paw
-  !
-  !============================================================================
-  !
-  !   Module for Projector Augmented Wave (PAW) calculations assuming
-  !   spherical symmetry. Kresse's notations are adopted.
-  !   Contains the type describing a PAW dataset, the routine for
-  !   generating it from the ld1 code, and the routines to compute
-  !   the hamiltonian and energy.
-  !   GGA and LSD are implemented, relativistic calculations are not.
-  !
-  !   References:
-  !   P.E.Blochl, Phys. Rev. B 50, 17953 (1994)
-  !   G.Kresse, D.Joubert, Phys. Rev. B 59, 1758 (1999)
-  !
-  !   WARNINGS:
-  !   Still work in progress on many aspects.
-  !   The PAW dataset is written in a temporary format which is not supposed
-  !   to be used any longer.
-  !   Consistency with the input of the ld1 code yet to be checked
-  !
-  !   Written by Guido Fratesi, february 2005
-  !   Modified by Riccardo Mazzarello, july 2006
-  !   Fully Relativistic generalization by Andrea Dal Corso, november 2009 
-  !   Other people involved: Lorenzo Paulatto and Stefano de Gironcoli
-  !
-  !============================================================================
-  !
-  USE kinds,            ONLY: dp
-  USE ld1_parameters,   ONLY: nwfsx
-  USE parameters,       ONLY: lmaxx
-  USE constants,        ONLY: pi, fpi, e2, eps8
-  USE radial_grids,     ONLY: ndmx, radial_grid_type
-  USE paw_type,         ONLY: paw_t, nullify_pseudo_paw, allocate_pseudo_paw
-  !
-  IMPLICIT NONE
-  PRIVATE
-  SAVE
-  !
-  REAL(dp), PARAMETER :: ZERO=0._dp, ONE=1._dp, TWO=2._dp, HALF=0.5_dp
-  !
-  ! TEMP, to be substituted by module constants
-!   REAL(dp), PARAMETER :: &
-!        PI=3.14159265358979323846_dp, FPI=4._dp*PI, E2=2._dp, EPS8=1.0e-8_dp
-  !
-  !============================================================================
-  !
-  PUBLIC :: paw_t
-  PUBLIC :: us2paw
-  PUBLIC :: paw2us
-  PUBLIC :: check_multipole
-  PUBLIC :: new_paw_hamiltonian
-  PUBLIC :: find_bes_qi
-  PUBLIC :: compute_nonlocal_coeff_ion
-  !
-CONTAINS
-  !
-  !============================================================================
-  !                          PUBLIC ROUTINES                                !!!
-  !============================================================================
-  !
-  ! Compute the values of the local pseudopotential and the NL coefficients
-  ! Compute also the total energy
-  ! 
-  SUBROUTINE new_paw_hamiltonian (veffps_, ddd_, etot_, &
-       pawset_, nwfc_, l_, j_, nspin_, spin_, oc_, pswfc_, eig_, paw_energy,dddion_)
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: veffps_(ndmx,2)
-    REAL(dp), INTENT(OUT) :: ddd_(nwfsx,nwfsx,2)
-    REAL(dp), INTENT(OUT) :: etot_
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    INTEGER,       INTENT(IN)  :: nwfc_
-    INTEGER,       INTENT(IN)  :: l_(nwfsx)
-    INTEGER,       INTENT(IN)  :: nspin_
-    INTEGER,       INTENT(IN)  :: spin_(nwfsx)
-    REAL(dp), INTENT(IN)  :: j_(nwfsx)
-    REAL(dp), INTENT(IN)  :: oc_(nwfsx)
-    REAL(dp), INTENT(IN)  :: pswfc_(ndmx,nwfsx)
-    REAL(dp), INTENT(IN)  :: eig_(nwfsx)
-    REAL(dp), OPTIONAL :: dddion_(nwfsx,nwfsx)
-    REAL(dp), INTENT(OUT), OPTIONAL :: paw_energy(5,3) 
-    !
-    REAL(dp) :: &                                        ! one center:
-         eps,             e1,             e1ps,             & ! energies;
-                          veff1(ndmx,2),   veff1ps(ndmx,2),   & ! eff potentials;
-         chargeps(ndmx,2), charge1(ndmx,2), charge1ps(ndmx,2), & ! charges.
-         projsum(nwfsx,nwfsx,2), eigsum !  sum of projections, sum of eigenval.
-    !
-    INTEGER :: ns, is, n
-    REAL(dp) :: energy(5,3)
-    !
-    ! Compute the valence charges
-    CALL compute_charges(projsum, chargeps, charge1, charge1ps, &
-       pawset_, nwfc_, l_, j_, nspin_, spin_, oc_, pswfc_, 1 )
- !
- !  Check for negative charge
- !
-     do is=1,nspin_
-        do n=2,pawset_%grid%mesh
-!           write(6,*) n, pawset_%grid%r(n), chargeps(n,is)
-           if (chargeps(n,is)<-1.d-12) &
-                   call  errore('new_paw_hamiltonian','negative rho',1)
-        enddo
-     enddo
-
-!     write(766,"(4f12.6)") (pawset_%grid%r(ns), chargeps(ns,1), charge1(ns,1), charge1ps(ns,1), ns=1,pawset_%grid%mesh)
-!     write(767,"(4f12.6)") (pawset_%grid%r(ns), chargeps(ns,2), charge1(ns,2), charge1ps(ns,2), ns=1,pawset_%grid%mesh)
-    !
-    ! Compute the one-center energy and effective potential:
-    ! E = Eh[n_v] + Exc[n_v+n_c] - Int[veff*n_v],
-    ! veff = vh[n_v] + v_xc[n_v+n_c],
-    ! where n_v can be n~+n^ or n1 or n1~+n^ and n_c can be nc or nc~
-    ! n~+n^ , nc~
-    CALL compute_onecenter_energy ( eps,  veffps_, &
-       pawset_, chargeps,  pawset_%nlcc, pawset_%psccharge, nspin_,&
-             pawset_%grid%mesh, pawset_%psloc, energy(1,1))
-    ! n1 , nc
-    CALL compute_onecenter_energy ( e1,   veff1, &
-       pawset_, charge1,  .TRUE.,        pawset_%aeccharge, nspin_,&
-            pawset_%irc, pawset_%aeloc, energy(1,2))
-    ! n1~+n^ , nc~
-    CALL compute_onecenter_energy ( e1ps, veff1ps, &
-       pawset_, charge1ps, pawset_%nlcc, pawset_%psccharge, nspin_,&
-            pawset_%irc, pawset_%psloc, energy(1,3))
-    ! Add the local part
-    DO is=1,nspin_
-       veffps_(1:pawset_%grid%mesh,is) = veffps_(1:pawset_%grid%mesh,is) +  &
-            pawset_%psloc(1:pawset_%grid%mesh)
-       veff1  (1:pawset_%grid%mesh,is) = veff1  (1:pawset_%grid%mesh,is) +  &
-            pawset_%aeloc(1:pawset_%grid%mesh)
-       veff1ps(1:pawset_%grid%mesh,is) = veff1ps(1:pawset_%grid%mesh,is) +  &
-            pawset_%psloc(1:pawset_%grid%mesh)
-    END DO
-    !
-    ! Compute the nonlocal D coefficients
-    CALL compute_nonlocal_coeff (ddd_,pawset_,nspin_,veffps_,veff1,veff1ps)
-    IF (PRESENT(dddion_)) THEN
-       CALL compute_nonlocal_coeff_ion (dddion_,pawset_)
-    END IF
-    !
-    ! Compute total energy
-    eigsum=ZERO
-    DO ns=1,nwfc_
-       IF (oc_(ns)>ZERO) eigsum = eigsum + oc_(ns)*eig_(ns)
-    END DO
-    etot_ = eigsum + eps + e1 - e1ps
-
-    if (PRESENT(paw_energy)) paw_energy=energy
-    !
-  END SUBROUTINE new_paw_hamiltonian
-  !
-  !============================================================================
-  !
-  ! Convert the USPP to a PAW dataset
-  !
-  SUBROUTINE us2paw (pawset_,                                        &
-       zval, grid, rmatch_augfun, ikk,                               &
-       nbeta, lls, jjs, ocs, enls, els, rcutus, psipaw, psipaw_rel,  &
-       phis, betas,  qvan, kindiff,                                  &
-       nlcc, aerhoc, psrhoc, aevtot, psvtot, which_paw_augfun,rel     )
-
-    USE funct,        ONLY : dft_name, get_iexch, get_icorr, get_igcx, get_igcc, get_inlc
-    USE ld1inc,       ONLY : zed, file_screen
-    USE paw_type,     ONLY : nullify_pseudo_paw, allocate_pseudo_paw
-    USE io_global,    ONLY : stdout, ionode, ionode_id
-    USE radial_grids, ONLY : allocate_radial_grid
-    USE mp,        only : mp_bcast
-    IMPLICIT NONE
-    TYPE(paw_t),      INTENT(OUT) :: pawset_
-    REAL(dp), INTENT(IN)  :: zval
-    type(radial_grid_type), INTENT(IN) :: grid
-    REAL(dp), INTENT(IN)  :: rmatch_augfun
-    INTEGER,  INTENT(IN)  :: ikk(nwfsx)
-    !
-    INTEGER,  INTENT(IN)  :: nbeta, rel
-    INTEGER,  INTENT(IN)  :: lls(nwfsx)
-    REAL(dp), INTENT(IN)  :: ocs(nwfsx)
-    CHARACTER(LEN=2), INTENT(IN)  :: els(nwfsx)
-    REAL(dp), INTENT(IN)  :: jjs(nwfsx)
-    REAL(dp), INTENT(IN)  :: rcutus(nwfsx)
-    REAL(dp), INTENT(IN)  :: enls(nwfsx)
-    REAL(dp), INTENT(IN)  :: psipaw(ndmx,nwfsx)
-    REAL(dp), INTENT(IN)  :: psipaw_rel(ndmx,nwfsx)
-    REAL(dp), INTENT(IN)  :: phis(ndmx,nwfsx)
-    REAL(dp), INTENT(IN)  :: betas(ndmx,nwfsx)
-    !
-    REAL(dp), INTENT(IN)  :: qvan(ndmx,nwfsx,nwfsx)
-    REAL(dp), INTENT(IN)  :: kindiff(nwfsx,nwfsx)
-    LOGICAL,  INTENT(IN)  :: nlcc
-    REAL(dp), INTENT(IN)  :: aerhoc(ndmx)
-    REAL(dp), INTENT(IN)  :: psrhoc(ndmx)
-    REAL(dp), INTENT(IN)  :: aevtot(ndmx)
-    REAL(dp), INTENT(IN)  :: psvtot(ndmx)
-    CHARACTER(20), INTENT(IN)  :: which_paw_augfun
-    !
-    REAL(DP),  EXTERNAL :: int_0_inf_dr
-    CHARACTER(len=2), EXTERNAL :: atom_name
-    REAL(dp) :: vps(ndmx,2), projsum(nwfsx,nwfsx,2), ddd(nwfsx,nwfsx,2), dddion(nwfsx,nwfsx)
-    INTEGER  :: irc, ns, ns1, n, leading_power, mesh, ios
-    REAL(dp) :: aux(ndmx), aux2(ndmx,2), raux
-    REAL(dp) :: aecharge(ndmx,2), pscharge(ndmx,2)
-    REAL(dp) :: etot
-    INTEGER  :: nspin=1, spin(nwfsx)=1 ! PAW generat. from spin-less calculation
-    CHARACTER(LEN=6) :: shortname
-    !
-    ! variables for aug. functions generation
-    ! 
-    REAL(DP) :: energy(5,3), max_aug_cutoff = -1._dp
-    INTEGER  :: nc, iok          ! index Bessel function, ...
-    INTEGER :: l1,l2,l3, lll, ircm, ir, ir0
-    REAL(dp) :: twosigma2, rm                  ! needed for "gaussian" augfun
-    REAL(dp) :: zeta, resi,usigma=4._dp        ! needed for "Bloechl" augfun
-    REAL(DP),ALLOCATABLE :: gaussian(:)        ! needed for gaussian and Bloechl
-    REAL(DP),ALLOCATABLE :: aug_real(:,:,:)    ! needed for PSQ augfun
-    REAL(DP) :: qc(2), xc(2), b1(2), b2(2)     ! needed for BESSEL augfun
-    REAL(DP), ALLOCATABLE :: j1(:,:)           ! needed for BESSEL augfun
-    !
-    mesh = grid%mesh
-    irc = maxval(ikk(1:nbeta))+8
-    CALL nullify_pseudo_paw(pawset_)
-    CALL allocate_pseudo_paw(pawset_,ndmx,nwfsx,lmaxx)
-    CALL allocate_radial_grid(pawset_%grid, mesh)
-    pawset_%symbol = atom_name(nint(zed))
-    pawset_%zval = zval
-    !
-    ! Copy the mesh
-    pawset_%grid%mesh  = grid%mesh
-    pawset_%grid%r(:)  = grid%r(:)
-    pawset_%grid%r2(:) = grid%r2(:)
-    pawset_%grid%rab(:)= grid%rab(:)
-    pawset_%grid%sqr(:)= grid%sqr(:)
-    pawset_%grid%xmin  = grid%xmin
-    pawset_%grid%rmax  = grid%rmax
-    pawset_%grid%zmesh = grid%zmesh
-    pawset_%grid%dx    = grid%dx
-    !
-    pawset_%rmatch_augfun = rmatch_augfun
-    if (rmatch_augfun <= 0.0_dp) pawset_%rmatch_augfun = grid%r(irc)
-    pawset_%rel = rel
-    pawset_%irc = irc
-    pawset_%ikk(1:nbeta)=ikk(1:nbeta)
-    !
-    ! Copy the wavefunctions
-    pawset_%nwfc = nbeta
-    pawset_%l(1:nbeta) = lls(1:nbeta)
-    pawset_%lmax = MAXVAL(pawset_%l(1:nbeta))
-    pawset_%oc(1:nbeta) = ocs(1:nbeta)
-    pawset_%jj(1:nbeta) = jjs(1:nbeta)
-    pawset_%rcutus(1:nbeta) = rcutus(1:nbeta)
-    pawset_%els(1:nbeta)= els(1:nbeta)
-    pawset_%enl(1:nbeta)= enls(1:nbeta)
-    pawset_%aewfc(1:mesh,1:nbeta) = psipaw(1:mesh,1:nbeta)
-    pawset_%aewfc_rel(1:mesh,1:nbeta) = psipaw_rel(1:mesh,1:nbeta)
-    pawset_%pswfc(1:mesh,1:nbeta) = phis  (1:mesh,1:nbeta)
-    pawset_%proj (1:mesh,1:nbeta) = betas (1:mesh,1:nbeta)
-    !
-    pawset_%augfun = 0._dp
-    !
-    !
-    ! Augmentation functions:
-    ! The specific radial part is not important, as long as the
-    ! multipole moments of the exact augmentation functions are
-    ! reproduced. So we write on the file the exact augmentation
-    ! functions and their multipole moments, keeping in mind that
-    ! the PW program should not use the radial part as is but
-    ! substitute it with some smoothened analogue.
-    !
-    ! Sdg>> not quite sure this is correct because the shape of augfun,
-    ! arbitrary as it may be, determines the shape of vloc since this
-    ! is obtained by unscreening vscf with the GIVEN augfun...
-    !
-    ! moreover in order to give the right electrostatics in the solid the
-    ! augmentation functions should not overlap.
-    !
-    ! Compute the exact augmentation functions and their moments
-    !
-    write(stdout,'(//,4x,a)') 'multipoles (all-electron charge) - (pseudo charge)'
-    write(stdout,'(7x,2a,":",2a,2x,6a)') ' ns',' l1','ns1',' l2',&
-                 '  l=0   ','  l=1   ','  l=2   ','  l=3   ','  l=4   ', '  l=5  '
-    pawset_%augfun(:,:,:,:) = 0.0_dp
-    pawset_%augmom(:,:,:) = 0.0_dp
-    DO ns=1,nbeta
-       l1=pawset_%l(ns)
-       DO ns1=1,ns
-          l2=pawset_%l(ns1)
-          do l3 = max(l1-l2,l2-l1), l1+l2, 2
-             pawset_%augfun(1:mesh,ns,ns1,l3) = &
-                 pawset_%aewfc(1:mesh,ns) * pawset_%aewfc(1:mesh,ns1) - &
-                 pawset_%pswfc(1:mesh,ns) * pawset_%pswfc(1:mesh,ns1)
-             IF (pawset_%rel==2) &
-             pawset_%augfun(1:irc,ns,ns1,l3) =pawset_%augfun(1:irc,ns,ns1,l3)&
-                 +pawset_%aewfc_rel(1:irc,ns) * pawset_%aewfc_rel(1:irc,ns1)
-             pawset_%augfun(1:mesh,ns1,ns,l3) = pawset_%augfun(1:mesh,ns,ns1,l3)
-             aux(1:irc) = pawset_%augfun(1:irc,ns,ns1,l3) * pawset_%grid%r(1:irc)**l3
-             lll = l1 + l2 + 2 + l3
-             pawset_%augmom(ns,ns1,l3)=int_0_inf_dr(aux(1:irc),pawset_%grid,irc,lll)
-             pawset_%augmom(ns1,ns,l3)=pawset_%augmom(ns,ns1,l3)
-          end do
-          write (stdout,'(7x,2i3,a,2i3,10f8.4)') ns,l1,":",ns1,l2,&
-                              (pawset_%augmom(ns,ns1,l3), l3=0,l1+l2)
-       END DO
-    END DO
-    !
-    !
-    IF (which_paw_augfun/='AE') THEN
-       ! The following lines enables to test the idependence on the 
-       ! specific shape of the radial part of the augmentation functions
-       ! in a spherically averager system (as is the case in atoms) only
-       ! the zero-th moment contribute to the scf charge
-       write(stdout, '(5x,2a)') 'Required augmentation: ',TRIM(which_paw_augfun)
-       !
-101    pawset_%augfun(:,:,:,:) = 0.0_dp
-       DO ns=1,nbeta
-          l1 = pawset_%l(ns)
-          DO ns1=1,ns
-             l2 = pawset_%l(ns1)
-             !
-             SELECT CASE (which_paw_augfun)
-             CASE ('PSQ')
-                continue ! the work is done at the end
-             CASE ('QVAN')
-                IF(ns==1 .and. ns1==1) &
-                CALL infomsg('us2paw', 'WARNING: QVAN augmentation function are for testing ONLY: '//&
-                                       'they will not work in pw!')
-                ! Choose the shape of the augmentation functions: NC Q ...
-                pawset_%augfun(1:mesh,ns,ns1,0) = qvan(1:mesh,ns,ns1)
-                ! Renormalize the aug. functions so that their integral is correct
-                leading_power = l1 + l2 + 2 
-                raux=int_0_inf_dr(pawset_%augfun(1:irc,ns,ns1,0),pawset_%grid,irc,leading_power)
-                IF (ABS(raux) < eps8) CALL errore &
-                   ('ld1_to_paw','norm of augm.func. is too small',ns*100+ns1)
-                raux=pawset_%augmom(ns,ns1,0)/raux
-                pawset_%augfun(1:mesh,ns,ns1,0)=raux*pawset_%augfun(1:mesh,ns,ns1,0)
-                !
-             CASE ('BG')
-                IF(ns==1 .and. ns1==1) &
-                CALL infomsg('us2paw', 'WARNING: using Bloechl style augmentation functions '//&
-                                       'is not a good idea, as analytical overlap are not '//&
-                                       'implemented in pwscf: use BESSEL or GAUSS instead.')
-                IF(.not. allocated(gaussian)) ALLOCATE(gaussian(mesh))
-                ! use Bloechl style augmentation functions, as linear combinations of
-                ! gaussians functions (this is quite pointless if the the plane-wave
-                ! code doesn't use double-augmentation with analytical gaussian overlaps)
-                DO ir0 = 1,mesh
-                    IF(grid%r(ir0) > pawset_%rmatch_augfun) &
-                        exit
-                ENDDO
-                ! look for a sigma large enough to keep (almost) all the gaussian in the aug sphere
-                zeta = (usigma/pawset_%rmatch_augfun)**2
-                DO ir = 1,mesh
-                    gaussian(ir) = exp( - zeta*(grid%r(ir))**2 ) * grid%r2(ir)
-                ENDDO
-                DO l3 = max (l1-l2,l2-l1), l1+l2
-                    ! Functions has to be normalized later, so I can use a constant factor 
-                    ! = rc**l3 to prevent very large numbers when integrating:
-                    aux(1:grid%mesh) = gaussian(1:grid%mesh) * grid%r(1:grid%mesh)**l3
-                    ! Normalization to have unitary multipole l3
-                    ! and check norm of augmentation functions.
-                    raux = int_0_inf_dr(aux,pawset_%grid,mesh,l3+2)
-                    IF (abs(raux) < eps8) CALL errore &
-                        ('ld1_to_paw','norm of augm. func. is too small',ns*100+ns1)
-                    ! Check if gaussians are localized enough into the augmentation sphere,
-                    ! otherwise try again with a larger sigma.
-                    resi = int_0_inf_dr(aux,pawset_%grid,ir0, l3+2)
-                    resi = (raux-resi)/raux
-                    IF (abs(resi) > 1.e-10_dp) THEN
-                        usigma = usigma + .0625_dp
-                        GOTO 101
-                    ENDIF
-                    raux=pawset_%augmom(ns,ns1,l3)/raux
-
-                    pawset_%augfun(1:mesh,ns,ns1,l3) = raux*gaussian(1:mesh)
-                    pawset_%augfun(1:mesh,ns1,ns,l3) = raux*gaussian(1:mesh)
-                ENDDO
-                DEALLOCATE(gaussian)
-                !
-             CASE ('GAUSS')
-                ! use linear combinations of gaussians functions, not the Bloechl style
-                ! but it looks a bit alike... (used for testing, now obsolete)
-                IF(ns==1 .and. ns1==1) &
-                CALL infomsg('us2paw', 'GAUSS augmentation functions are ususally '//&
-                                       'harder than BESSEL; use BESSEL instead unless'//&
-                                       ' you have discontinuity in local potential')
-                ALLOCATE(gaussian(mesh))
-                !
-                rm = pawset_%rmatch_augfun
-                twosigma2 = TWO*(rm/3.0_dp)**2
-                do ir=1,mesh
-                   if (grid%r(ir) <= rm) then
-                      gaussian(ir) = ( EXP(-grid%r(ir)**2/twosigma2) + &
-                                       EXP(-(grid%r(ir)-TWO*rm)**2/twosigma2 ) - &
-                                       TWO*EXP(-rm**2/twosigma2) ) * grid%r2(ir)
-                   else
-                      gaussian(ir) = 0.0_dp
-                   endif
-                end do
-                DO l3 = max (l1-l2,l2-l1), l1+l2
-                   ! 
-                   aux(1:irc) = gaussian(1:irc) * pawset_%grid%r(1:irc)**l3
-                   ! calculate the corresponding multipole
-                   raux=int_0_inf_dr(aux,pawset_%grid,irc,l3+2)
-                   IF (ABS(raux) < eps8) CALL errore &
-                      ('ld1_to_paw','norm of augm. func. is too small',ns*100+ns1)
-                   raux=pawset_%augmom(ns,ns1,l3)/raux
-                   pawset_%augfun(1:mesh,ns,ns1,l3) = raux*gaussian(1:mesh)
-                   pawset_%augfun(1:mesh,ns1,ns,l3) = raux*gaussian(1:mesh)
-                   ! 
-                END DO
-                DEALLOCATE(gaussian)
-                !
-             CASE ('BESSEL')
-                ! Use Kresse-Joubert style augmentation functions
-                ! Defined as linear combination of Bessel functions.
-                ALLOCATE (j1 (pawset_%grid%mesh,2))
-                do ir=1,irc
-                   if (grid%r(ir)<pawset_%rmatch_augfun) ircm=ir
-                end do
-                do l3 = max(l1-l2,l2-l1), l1+l2 
-                   ! 
-                   CALL find_bes_qi(qc,pawset_%grid%r(ircm),l3,2,iok)
-                   IF (iok.ne.0) CALL errore('compute_augfun', &
-                         'problems with find_bes_qi',1)
-                   DO nc = 1, 2
-                      !
-                      CALL sph_bes(irc,grid%r(1),qc(nc),l3,j1(1,nc))
-                      aux(1:irc) = j1(1:irc,nc) * grid%r(1:irc)**(l3+2)
-                      b1(nc) = j1(ircm,nc)
-                      b2(nc) = int_0_inf_dr(aux,pawset_%grid,ircm,l3+2)
-                      !
-                   ENDDO
-                   xc(1) = b1(2) / (b1(2) * b2(1) - b1(1) * b2(2))
-                   xc(2) = - b1(1) * xc(1) / b1(2)
-                   pawset_%augfun(1:ircm,ns,ns1,l3) =                   &
-                          pawset_%augmom(ns,ns1,l3) * grid%r2(1:ircm) * &
-                          (xc(1) * j1(1:ircm,1) + xc(2) * j1(1:ircm,2))
-                   ! Symmetrize augmentation functions:
-                   pawset_%augfun(1:mesh,ns1,ns,l3)=pawset_%augfun(1:mesh,ns,ns1,l3)
-                   !
-                   ! Save higher bessel coefficient to compute suggested cutoff
-                   max_aug_cutoff=MAX( max_aug_cutoff, MAXVAL(qc(1:2))**2)
-                   !
-                end do 
-                DEALLOCATE (j1)
-                !
-             CASE DEFAULT
-                !
-                CALL errore ('ld1_to_paw','Specified augmentation functions ('// &
-                             TRIM(which_paw_augfun)//') not allowed or coded',1)
-                !
-             END SELECT
-          END DO
-       END DO
-       IF ( which_paw_augfun == 'BG') &
-         write(stdout,"(5x,a,f12.6)") "Gaussians generated with zeta: ", zeta
-       IF ( which_paw_augfun == 'BESSEL') &
-         write(stdout,'(5x, "Suggested rho cutoff for augmentation:",f7.2," Ry")') max_aug_cutoff
-       !
-       IF ( which_paw_augfun == 'PSQ') THEN
-            ALLOCATE(aug_real(ndmx,nwfsx,nwfsx))
-            DO ns=1,nbeta
-            DO ns1=ns,nbeta
-               aug_real(1:mesh,ns,ns1) = &
-                     pawset_%aewfc(1:mesh,ns) * pawset_%aewfc(1:mesh,ns1) - &
-                     pawset_%pswfc(1:mesh,ns) * pawset_%pswfc(1:mesh,ns1)
-               IF (pawset_%rel==2) &
-               aug_real(1:irc,ns,ns1) = aug_real(1:irc,ns,ns1) + &
-                     pawset_%aewfc_rel(1:irc,ns)*pawset_%aewfc_rel(1:irc,ns1) 
-               aug_real(1:mesh,ns1,ns) = aug_real(1:mesh,ns,ns1)
-            ENDDO
-            ENDDO
-            !
-            CALL pseudo_q(aug_real,pawset_%augfun)
-            !
-            DEALLOCATE(aug_real)
-       ENDIF
-
-    END IF
-!
-!   Outside the PAW spheres augfun should be exactly 0. On some machine
-!   it is equal to zero to machine precision and sometimes it is negative, 
-!   so as to confuse the check for negative charge. So we set it to zero
-!   explicitely.
-!
-    DO ns = 1, nbeta
-       l1 = pawset_%l(ns)
-       DO ns1 = ns, nbeta
-          l2 = pawset_%l(ns1)
-          DO l3 = max (l1-l2,l2-l1), l1+l2
-             DO n = pawset_%irc+1, pawset_%grid%mesh
-                pawset_%augfun(n,ns,ns1,l3) = 0.0_DP
-                pawset_%augfun(n,ns1,ns,l3) = 0.0_DP
-             END DO
-          END DO
-       END DO
-    END DO
-    !
-    !
-    ! Copy kinetic energy differences
-    pawset_%kdiff(1:nbeta,1:nbeta)=kindiff(1:nbeta,1:nbeta)
-    !
-    ! Copy the core charge (if not NLCC copy only the AE one)
-    pawset_%nlcc=nlcc
-    IF (pawset_%nlcc) pawset_%psccharge(1:mesh)=psrhoc(1:mesh)
-    pawset_%aeccharge(1:mesh)=aerhoc(1:mesh)
-    !
-    ! Copy the local potentials
-    pawset_%psloc(1:mesh)=psvtot(1:mesh)
-    pawset_%aeloc(1:mesh)=aevtot(1:mesh)
-    ! and descreen them:
-    CALL compute_charges(projsum, pscharge, aecharge, aux2, &
-       pawset_, nbeta, lls, jjs, nspin, spin, ocs, phis )
-    pawset_%pscharge(1:mesh)=pscharge(1:mesh,1)
-    !
-    CALL compute_onecenter_energy ( raux,  aux2, &
-       pawset_, pscharge, pawset_%nlcc, pawset_%psccharge, nspin, &
-       pawset_%grid%mesh )
-    pawset_%psloc(1:mesh)=psvtot(1:mesh)-aux2(1:mesh,1)
-    !
-    CALL compute_onecenter_energy ( raux,  aux2, &
-       pawset_, aecharge, .TRUE.,       pawset_%aeccharge, nspin, &
-       pawset_%grid%mesh)
-    pawset_%aeloc(1:mesh)=aevtot(1:mesh)-aux2(1:mesh,1)
-    !
-    if (file_screen .ne.' ') then
-        if (ionode) &
-            open(unit=20,file=file_screen, status='unknown', iostat=ios, err=105 )
-105     call mp_bcast(ios, ionode_id)
-        call errore('descreening','opening file'//file_screen,abs(ios))
-        if (ionode) then
-            write(20,'(a)') "#   n, r(n),       aeloc(n),   psloc(n),   pscharge(n)"
-            do n=1,grid%mesh
-            write(20,'(i5,7e12.4)') n,grid%r(n), pawset_%aeloc(n), &
-                    pawset_%psloc(n), pawset_%pscharge(n)
-            enddo
-            close(20)
-        endif
-    endif
-    !
-    write(pawset_%dft,'(80x)') !fill it with spaces
-    CALL dft_name (get_iexch(), get_icorr(), get_igcx(), get_igcc(), get_inlc(), pawset_%dft, shortname)
-    !
-    !
-    ! Generate the paw hamiltonian for test (should be equal to the US one)
-    CALL new_paw_hamiltonian (vps, ddd, etot, &
-       pawset_, pawset_%nwfc, pawset_%l, pawset_%jj, nspin, spin, pawset_%oc, pawset_%pswfc, pawset_%enl, energy, dddion)
-    pawset_%dion(1:nbeta,1:nbeta)=dddion(1:nbeta,1:nbeta)
-    WRITE(stdout,'(/5x,A,f12.6,A)') 'Estimated PAW energy =',etot,' Ryd'
-    WRITE(stdout,'(/5x,A)') 'The PAW screened D coefficients'
-    DO ns1=1,pawset_%nwfc
-       WRITE(stdout,'(6f12.5)') (ddd(ns1,ns,1),ns=1,pawset_%nwfc)
-    END DO
-    WRITE(stdout,'(/5x,A)') 'The PAW descreened D coefficients (US)'
-    DO ns1=1,pawset_%nwfc
-       WRITE(stdout,'(6f12.5)') (dddion(ns1,ns),ns=1,pawset_%nwfc)
-    END DO
-    !
-    !
-  END SUBROUTINE us2paw
-  !
-  !============================================================================
-  !
-  ! ...
-  !
-  SUBROUTINE paw2us (pawset_,zval,grid,nbeta,lls,jjs,ikk,betas,qq,qvan,&
-                     vpsloc, bmat, rhos, els, rcutus, pseudotype,psipaw_rel)
-    USE funct, ONLY : set_dft_from_name
-    use radial_grids, only: radial_grid_type, allocate_radial_grid
-    IMPLICIT NONE
-    TYPE(radial_grid_type), INTENT(OUT) :: grid
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    REAL(dp), INTENT(OUT) :: zval
-    INTEGER,       INTENT(OUT) :: nbeta
-    INTEGER,       INTENT(OUT) :: lls(nwfsx)
-    INTEGER,       INTENT(OUT) :: ikk(nwfsx)
-    INTEGER,       INTENT(OUT) :: pseudotype
-    CHARACTER(LEN=2), INTENT(OUT) :: els(nwfsx)
-    REAL(dp), INTENT(OUT) :: jjs(nwfsx)
-    REAL(dp), INTENT(OUT) :: rcutus(nwfsx)
-    REAL(dp), INTENT(OUT) :: betas(ndmx,nwfsx)
-    REAL(dp), INTENT(OUT) :: psipaw_rel(ndmx,nwfsx)
-    REAL(dp), INTENT(OUT) :: qq(nwfsx,nwfsx)
-    REAL(dp), INTENT(OUT) :: qvan(ndmx,nwfsx,nwfsx)
-    REAL(dp), INTENT(OUT) :: vpsloc(ndmx)     ! the local pseudopotential
-    REAL(dp), INTENT(OUT) :: bmat(nwfsx,nwfsx)! the pseudo coefficients (unscreened D)
-    REAL(dp), INTENT(OUT) :: rhos(ndmx)     ! the pseudo density
-
-    INTEGER :: ns, ns1, mesh
-    zval=pawset_%zval
-    !
-    mesh=pawset_%grid%mesh
-    ! Copy the mesh
-    call allocate_radial_grid(grid, mesh)
-    grid%mesh  = pawset_%grid%mesh
-    grid%r(1:mesh)  = pawset_%grid%r(1:mesh)
-    grid%r2(1:mesh) = pawset_%grid%r2(1:mesh)
-    grid%rab(1:mesh)= pawset_%grid%rab(1:mesh)
-    grid%sqr(1:mesh)= pawset_%grid%sqr(1:mesh)
-    grid%xmin  = pawset_%grid%xmin
-    grid%rmax  = pawset_%grid%rmax
-    grid%zmesh = pawset_%grid%zmesh
-    grid%dx    = pawset_%grid%dx
-
-    !
-    nbeta=pawset_%nwfc
-    lls(1:nbeta)=pawset_%l(1:nbeta)
-    jjs(1:nbeta)=pawset_%jj(1:nbeta)
-    els(1:nbeta)=pawset_%els(1:nbeta)
-    rcutus(1:nbeta)=pawset_%rcutus(1:nbeta)
-    ikk(1:nbeta)=pawset_%ikk(1:nbeta)
-    !
-    DO ns=1,nbeta
-       DO ns1=1,nbeta
-          qvan(1:mesh,ns,ns1)=pawset_%augfun(1:mesh,ns,ns1,0)
-          IF (lls(ns)==lls(ns1)) THEN
-             qq(ns,ns1)=pawset_%augmom(ns,ns1,0)
-          ELSE ! different spherical harmonic => 0
-             qq(ns,ns1)=ZERO
-          END IF
-       END DO
-    END DO
-    !
-    vpsloc(1:mesh)=pawset_%psloc(1:mesh)
-    bmat(1:nbeta,1:nbeta)=pawset_%dion(1:nbeta,1:nbeta)
-    !
-    rhos(1:mesh)=pawset_%pscharge(1:mesh)
-    !
-    psipaw_rel(1:mesh,1:nbeta)=pawset_%aewfc_rel(1:mesh,1:nbeta)
-    betas(1:mesh,1:nbeta)=pawset_%proj(1:mesh,1:nbeta)
-    pseudotype=3
-    !
-    CALL set_dft_from_name (pawset_%dft)
-
-  END SUBROUTINE paw2us
-  !
-  !============================================================================
-  !
-  ! ...
-  !
-  SUBROUTINE check_multipole (pawset_)
-    USE radial_grids, ONLY: hartree
-    USE io_global, ONLY : stdout
-    IMPLICIT NONE
-    TYPE(paw_t), INTENT(IN)  :: pawset_
-    INTEGER:: mesh
-    REAL(dp) :: r(ndmx), r2(ndmx), sqr(ndmx), dx
-    INTEGER :: nbeta
-    INTEGER :: lls(nwfsx)
-    INTEGER :: ir, ns1, ns2, l1, l2, l3, irc, ir0
-    REAL(dp) :: auxpot(ndmx,0:2*lmaxx+2), auxrho(ndmx)
-    !
-    ! set a few internal variables 
-    write (stdout,*) "check_multipole : lmaxx =",lmaxx
-    mesh=pawset_%grid%mesh
-    r(1:mesh)=pawset_%grid%r(1:mesh)
-    r2(1:mesh)=pawset_%grid%r2(1:mesh)
-    sqr(1:mesh)=pawset_%grid%sqr(1:mesh)
-    dx=pawset_%grid%dx
-    irc = pawset_%irc
-    !
-    nbeta=pawset_%nwfc
-    lls(1:nbeta)=pawset_%l(1:nbeta)
-    !
-    do ns1=1,nbeta
-       l1 = lls(ns1)
-       do ns2=1,nbeta
-          l2 = lls(ns2)
-          auxpot(:,:) = 0.0_dp
-          do l3 = max(l1-l2,l2-l1), l1+l2
-             auxrho(1:mesh) = &
-                pawset_%aewfc(1:mesh,ns1) * pawset_%aewfc(1:mesh,ns2) - &
-                pawset_%pswfc(1:mesh,ns1) * pawset_%pswfc(1:mesh,ns2) - &
-                pawset_%augfun(1:mesh,ns1,ns2,l3) 
-             call hartree(l3,l1+l2+2,mesh,pawset_%grid,auxrho,auxpot(1,l3))
-          end do
-          write (stdout,'(a,2i3,a,2i3)') " MULTIPOLO DI ",ns1,l1,":",ns2, l2
-          do ir=1,irc
-             if (r(ir) < 1.0_dp) ir0 = ir
-          end do
-          do ir=ir0,irc+30, 3
-             write (stdout,'(10f8.4)') r(ir),(auxpot(ir,l3), l3=0,l1+l2)
-          end do
-       end do
-    end do
-    return
-  END SUBROUTINE check_multipole
-  !
-  !============================================================================
-  !                          PRIVATE ROUTINES                               !!!
-  !============================================================================
-  !
-  SUBROUTINE compute_charges (projsum_, chargeps_, charge1_, charge1ps_, &
-       pawset_, nwfc_, l_, j_, nspin_, spin_, oc_, pswfc_ , iflag, unit_)
-    USE io_global, ONLY : ionode
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: projsum_(nwfsx,nwfsx,2)
-    REAL(dp), INTENT(OUT) :: chargeps_(ndmx,2)
-    REAL(dp), INTENT(OUT) :: charge1_(ndmx,2)
-    REAL(dp), INTENT(OUT) :: charge1ps_(ndmx,2)
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    INTEGER,       INTENT(IN)  :: nwfc_
-    INTEGER,       INTENT(IN)  :: l_(nwfsx)
-    INTEGER,       INTENT(IN)  :: nspin_
-    INTEGER,       INTENT(IN)  :: spin_(nwfsx)
-    REAL(dp), INTENT(IN)  :: j_(nwfsx)
-    REAL(dp), INTENT(IN)  :: oc_(nwfsx)
-    REAL(dp), INTENT(IN)  :: pswfc_(ndmx,nwfsx)
-    INTEGER, OPTIONAL :: unit_, iflag
-    REAL(dp) :: augcharge(ndmx,2), chargetot
-    INTEGER :: i, n, iflag0
-
-    iflag0=0
-    if (present(iflag)) iflag0=iflag
-    CALL compute_sumwfc2(chargeps_,pawset_,nwfc_,pswfc_,oc_,spin_)
-    CALL compute_projsum(projsum_,pawset_,nwfc_,l_,j_,spin_,pswfc_,oc_)
-!    WRITE (6200,'(20e20.10)') ((projsum_(ns,ns1,1),ns=1,ns1),ns1=1,pawset_%nwfc)
-    CALL compute_onecenter_charge(charge1ps_,pawset_,projsum_,nspin_,"PS")
-    CALL compute_onecenter_charge(charge1_  ,pawset_,projsum_,nspin_,"AE")
-    ! add augmentation charges
-    CALL compute_augcharge(augcharge,pawset_,projsum_,nspin_)
-
-    if (present(unit_).and.ionode) then
-       write(unit_,*) 
-       write(unit_,*) "#"
-       do i=1,pawset_%grid%mesh
-          write (unit_,'(4f12.8)') pawset_%grid%r(i), augcharge(i,1), chargeps_(i,1), charge1ps_(i,1)
-       end do
-    end if
-    chargeps_ (1:pawset_%grid%mesh,1:nspin_) = chargeps_ (1:pawset_%grid%mesh,1:nspin_) &
-                                        + augcharge(1:pawset_%grid%mesh,1:nspin_)
-    charge1ps_(1:pawset_%grid%mesh,1:nspin_) = charge1ps_(1:pawset_%grid%mesh,1:nspin_) &
-                                        + augcharge(1:pawset_%grid%mesh,1:nspin_)
-!
-!  If there are unbounded scattering states in the pseudopotential generation,
-!  n1 and n~1 separately diverge. This makes the hartree and exchange and
-!  correlation energies separately diverging. The cancellation becomes
-!  very difficult numerically. Outside the sphere however the two charges 
-!  should be equal and opposite and we set them to zero. 
-!  Is this the right solution? 
-!
-    do n=pawset_%irc+1,pawset_%grid%mesh
-       chargetot=chargeps_(n,1)
-       if (nspin_==2) chargetot=chargetot+chargeps_(n,2)
-       if (chargetot<1.d-11.or.iflag0==1) then
-          charge1_(n,1:nspin_)=0.0_DP
-          charge1ps_(n,1:nspin_)=0.0_DP
-       endif
-    enddo
-!    do n=1,pawset_%grid%mesh
-!       write(6,'(4f20.15)') pawset_%grid%r(n), chargeps_(n,1), charge1_(n,1),
-!                                               charge1ps_(n,1)
-
-  END SUBROUTINE compute_charges
-  !
-  !============================================================================
-  !
-  ! Compute the one-center energy and effective potential:
-  ! E = Eh[n_v] + Exc[n_v+n_c] - Int[veff*n_v],
-  ! veff = vh[n_v] + v_xc[n_v+n_c],
-  ! where n_v can be n~+n^ or n1 or n1~+n^ and n_c can be nc or n~c
-  !
-  SUBROUTINE compute_onecenter_energy ( totenergy_, veff_, &
-       pawset_, vcharge_, nlcc_, ccharge_, nspin_, iint, vloc, energies_ , unit_)
-    USE funct, ONLY: dft_is_gradient, exc_t, vxc_t !igcx, igcc
-    USE radial_grids, ONLY: hartree
-    USE io_global, ONLY : stdout, ionode
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: totenergy_            ! H+XC+DC
-    REAL(dp), INTENT(OUT) :: veff_(ndmx,2)         ! effective potential
-    TYPE(paw_t),   INTENT(IN)  :: pawset_          ! the PAW dataset
-    REAL(dp), INTENT(IN)  :: vcharge_(ndmx,2)      ! valence charge
-    LOGICAL,       INTENT(IN)  :: nlcc_            ! non-linear core correction
-    REAL(dp), INTENT(IN)  :: ccharge_(ndmx)        ! core charge
-    INTEGER,       INTENT(IN)  :: nspin_           ! 1 for LDA, 2 for LSDA
-    INTEGER,       INTENT(IN)  :: iint             ! integrals up to iint
-    REAL(dp), INTENT(IN), OPTIONAL :: vloc(ndmx)   ! 
-    REAL(dp), INTENT(OUT), OPTIONAL :: energies_(5)! Etot,H,XC,DC terms
-    INTEGER, OPTIONAL :: unit_
-    !
-    REAL(dp), PARAMETER :: rho_eq_0(ndmx) = ZERO ! ccharge=0 when nlcc=.f.
-    !
-    REAL(dp) :: &
-         eh, exc, edc, & ! hartree, xc and double counting energies
-         eloc,         & ! local energy
-         rhovtot(ndmx), & ! total valence charge
-         aux(ndmx),     & ! auxiliary to compute integrals
-         vh(ndmx),      & ! hartree potential
-         vxc(ndmx,2),   & ! exchange-correlation potential (LDA+GGA)
-         vgc(ndmx,2),   & ! exchange-correlation potential (GGA only)
-         egc(ndmx),     & ! exchange correlation energy density (GGA only)
-         rh(2),        & ! valence charge at a given point without 4 pi r^2
-         rhc,          & ! core    charge at a given point without 4 pi r^2
-         vxcr(2)         ! exchange-correlation potential at a given point
-    REAL(dp) :: & ! compatibility with metaGGA - not yet used
-         tau(ndmx) = ZERO, vtau(ndmx) = ZERO  !
-    !
-    INTEGER :: i, is
-    INTEGER :: lsd
-    REAL(DP), EXTERNAL :: int_0_inf_dr
-#if defined __DEBUG_V_H_vs_SPHEROPOLE
-    REAL(DP) :: dummy_charge,aux1(ndmx),aux2(ndmx),res1,res2
-#endif
-    !
-    ! Set up total valence charge
-    rhovtot(1:pawset_%grid%mesh) = vcharge_(1:pawset_%grid%mesh,1)
-    IF (nspin_==2) rhovtot(1:pawset_%grid%mesh) = rhovtot(1:pawset_%grid%mesh) +   &
-         vcharge_(1:pawset_%grid%mesh,2)
-    !
-    ! Hartree
-    CALL hartree(0,2,pawset_%grid%mesh,pawset_%grid,rhovtot,vh)
-    if (PRESENT(unit_).and.ionode) then
-       write (unit_,*)  " " 
-       write (unit_,*)  "#" 
-       do i=1,pawset_%grid%mesh
-          write (unit_,'(3f12.7)') pawset_%grid%r(i),rhovtot(i),vh(i)
-       end do
-    end if
-#if defined __DEBUG_V_H_vs_SPHEROPOLE
-    dummy_charge=int_0_inf_dr(rhovtot,pawset_%grid,pawset_%grid%mesh,2)
-    aux1(1:pawset_%grid%mesh) = FPI*pawset_%grid%r2(1:pawset_%grid%mesh)*vh(1:pawset_%grid%mesh) - &
-         FPI*dummy_charge * pawset_%grid%r(1:pawset_%grid%mesh)
-    aux2(1:pawset_%grid%mesh) = rhovtot(1:pawset_%grid%mesh)*pawset_%grid%r2(1:pawset_%grid%mesh)
-    res1 = int_0_inf_dr(aux1,pawset_%grid,pawset_%grid%mesh,1)
-    res2 = int_0_inf_dr(aux2,pawset_%grid,pawset_%grid%mesh,4)
-    WRITE (stdout,'(4(A,1e15.7))') ' INT rho', dummy_charge,' INT V_H', &
-         res1, ' INT r^2*rho', res2, ' ERR:', (1.d0-  res1/ (-res2 * (2.d0*PI/3.d0)))
-#endif
-    vh(1:pawset_%grid%mesh) = e2 * vh(1:pawset_%grid%mesh)
-    aux(1:pawset_%grid%mesh) = vh(1:pawset_%grid%mesh) * rhovtot(1:pawset_%grid%mesh)
-    eh = HALF * int_0_inf_dr(aux,pawset_%grid,iint,2)
-    !
-    ! Exhange-Correlation
-    rh=(/ZERO,ZERO/)
-    rhc=ZERO
-    lsd=nspin_-1
-    DO i=1,pawset_%grid%mesh
-       DO is=1,nspin_
-          rh(is) = vcharge_(i,is)/pawset_%grid%r2(i)/FPI
-       ENDDO
-       IF (nlcc_) rhc = ccharge_(i)/pawset_%grid%r2(i)/FPI
-       CALL vxc_t(rh,rhc,lsd,vxcr)
-       vxc(i,1:nspin_)=vxcr(1:nspin_)
-       IF (nlcc_) THEN
-          aux(i)=exc_t(rh,rhc,lsd) * (rhovtot(i)+ccharge_(i))
-       ELSE
-          aux(i)=exc_t(rh,rhc,lsd) *  rhovtot(i)
-       END IF
-    END DO
-    IF (dft_is_gradient()) THEN
-       IF (nlcc_) THEN
-          CALL vxcgc(ndmx,pawset_%grid%mesh,nspin_,pawset_%grid%r,&
-                     pawset_%grid%r2,vcharge_,ccharge_,vgc,egc, &
-                     tau, vtau, 1)
-       ELSE
-          CALL vxcgc(ndmx,pawset_%grid%mesh,nspin_,pawset_%grid%r,&
-                     pawset_%grid%r2,vcharge_,rho_eq_0,vgc,egc, &
-                     tau, vtau, 1)
-       END IF
-       vxc(1:pawset_%grid%mesh,1:nspin_) = vxc(1:pawset_%grid%mesh,1:nspin_) + &
-                                      vgc(1:pawset_%grid%mesh,1:nspin_)
-       aux(1:pawset_%grid%mesh) = aux(1:pawset_%grid%mesh) + &
-           egc(1:pawset_%grid%mesh) * pawset_%grid%r2(1:pawset_%grid%mesh) * FPI
-    END IF
-    exc = int_0_inf_dr(aux,pawset_%grid,iint,2)
-    !
-    ! Double counting
-    edc=ZERO
-    DO is=1,nspin_
-       veff_(1:pawset_%grid%mesh,is)=vxc(1:pawset_%grid%mesh,is)+vh(1:pawset_%grid%mesh)
-       aux(1:pawset_%grid%mesh)=veff_(1:pawset_%grid%mesh,is)*vcharge_(1:pawset_%grid%mesh,is)
-       edc=edc+int_0_inf_dr(aux,pawset_%grid,iint,2)
-    END DO
-    !
-    eloc=ZERO
-    !
-    IF (present(vloc)) THEN
-       DO is=1,nspin_
-          aux(1:pawset_%grid%mesh)=vloc(1:pawset_%grid%mesh)        &
-                               *vcharge_(1:pawset_%grid%mesh,is)
-          eloc=eloc+int_0_inf_dr(aux,pawset_%grid,iint,2)
-       ENDDO
-    ENDIF
-    !
-    ! Total
-    totenergy_ = eh + exc - edc
-    !
-    IF (PRESENT(energies_)) THEN
-       energies_(1)=totenergy_
-       energies_(2)=eh
-       energies_(3)=exc
-       energies_(4)=edc
-       energies_(5)=eloc
-    END IF
-    !
-  END SUBROUTINE compute_onecenter_energy
-  !
-  !============================================================================
-  !
-  ! Compute NL 'D' coefficients = D^ + D1 - D1~
-  !
-  SUBROUTINE compute_nonlocal_coeff(ddd_, pawset_, nspin_, veffps_, veff1_, veff1ps_)
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: ddd_(nwfsx,nwfsx,2)
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    INTEGER,       INTENT(IN)  :: nspin_
-    REAL(dp), INTENT(IN)  :: veffps_(ndmx,2)
-    REAL(dp), INTENT(IN)  :: veff1_(ndmx,2)
-    REAL(dp), INTENT(IN)  :: veff1ps_(ndmx,2)
-    INTEGER :: is, ns, ns1
-    REAL(dp) :: aux(ndmx), dd
-    REAL(DP), EXTERNAL :: int_0_inf_dr
-!     REAL(dp):: dddd(nwfsx,nwfsx,3) = 0.d0
-
-    !
-    ! D^ = Int Q*v~
-    ! D1-D1~ = kindiff + Int[ae*v1*ae - ps*v1~*ps - Q*v1~]
-    ddd_(:,:,:)=ZERO
-    DO is=1,nspin_
-       DO ns=1,pawset_%nwfc
-          DO ns1=1,ns
-             IF (pawset_%l(ns)==pawset_%l(ns1).and.&
-                       ABS(pawset_%jj(ns)-pawset_%jj(ns1))<1.d-8) THEN
-                ! Int[Q*v~]
-                aux(1:pawset_%grid%mesh) =                        &
-                   pawset_%augfun(1:pawset_%grid%mesh,ns,ns1,0) * &
-                   veffps_(1:pawset_%grid%mesh,is)
-                dd = int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-!                 dddd(ns,ns1,1) = int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-                ! Int[ae*v1*ae]
-                aux(1:pawset_%grid%mesh) =                        &
-                     pawset_%aewfc(1:pawset_%grid%mesh,ns ) *     &
-                     pawset_%aewfc(1:pawset_%grid%mesh,ns1) *     &
-                     veff1_(1:pawset_%grid%mesh,is)
-                IF (pawset_%rel==2) &
-                    aux(1:pawset_%irc) =  aux(1:pawset_%irc) +     &
-                     pawset_%aewfc_rel(1:pawset_%irc,ns ) *     &
-                     pawset_%aewfc_rel(1:pawset_%irc,ns1) *     &
-                     veff1_(1:pawset_%irc,is)
-                dd = dd +                                    &
-                     int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-!                 dddd(ns,ns1,2) = int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-                ! Int[ps*v1~*ps + aufun*v1~]
-                aux(1:pawset_%grid%mesh) =                        &
-                   ( pawset_%pswfc(1:pawset_%grid%mesh,ns ) *     &
-                     pawset_%pswfc(1:pawset_%grid%mesh,ns1) +     &
-                     pawset_%augfun(1:pawset_%grid%mesh,ns,ns1,0) ) * &
-                     veff1ps_(1:pawset_%grid%mesh,is)
-                dd = dd -                                    &
-                     int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-!                 dddd(ns,ns1,3) = int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-                ! collect
-                ddd_(ns,ns1,is) = pawset_%kdiff(ns,ns1) + dd
-                ddd_(ns1,ns,is) = ddd_(ns,ns1,is)
-             END IF
-          END DO
-       END DO
-    END DO
-!     write(*,*) 'deeq', pawset_%irc
-!     write(*,'(4f13.8)') dddd(1:4,1:4,1)
-!     write(*,*) 'ddd ae'
-!     write(*,'(4f13.8)') dddd(1:4,1:4,2)
-!     write(*,*) 'ddd ps'
-!     write(*,'(4f13.8)') dddd(1:4,1:4,3)
-
-  END SUBROUTINE compute_nonlocal_coeff
-  !
-  !============================================================================
-  !
-  ! 'D_ion' coefficients = D1 - D1~
-  !
-  SUBROUTINE compute_nonlocal_coeff_ion(ddd_, pawset_)
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: ddd_(nwfsx,nwfsx)
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    INTEGER :: ns, ns1
-    REAL(dp) :: aux(ndmx), dd
-    REAL(DP), EXTERNAL :: int_0_inf_dr
-    !
-    ! D^ = Int Q*v~
-    ! D1-D1~ = kindiff + Int[ae*v1*ae - ps*v1~*ps - Q*v1~]
-!     write(666,"(4f12.6)") (pawset_%grid%r(ns), veffps_(ns,1), veff1_(ns,1), veff1ps_(ns,1), ns=1,pawset_%grid%mesh)
-!     write(667,"(4f12.6)") (pawset_%grid%r(ns), veffps_(ns,2), veff1_(ns,2), veff1ps_(ns,2), ns=1,pawset_%grid%mesh)
-    ddd_(:,:)=ZERO
-    DO ns=1,pawset_%nwfc
-       DO ns1=1,ns
-          IF (pawset_%l(ns)==pawset_%l(ns1).and. &
-                      ABS(pawset_%jj(ns)-pawset_%jj(ns1))<1.d-8 ) THEN
-             ! Int[ae*v1*ae]
-             aux(1:pawset_%grid%mesh) =                        &
-                  pawset_%aewfc(1:pawset_%grid%mesh,ns ) *     &
-                  pawset_%aewfc(1:pawset_%grid%mesh,ns1) *     &
-                  pawset_%aeloc(1:pawset_%grid%mesh)
-             IF (pawset_%rel==2) &
-             aux(1:pawset_%irc) = aux(1:pawset_%irc) +         &
-                  pawset_%aewfc_rel(1:pawset_%irc,ns ) *     &
-                  pawset_%aewfc_rel(1:pawset_%irc,ns1) *     &
-                  pawset_%aeloc(1:pawset_%irc)
-             dd = int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-             ! Int[ps*v1~*ps + Q*v1~]
-             aux(1:pawset_%grid%mesh) =                        &
-                ( pawset_%pswfc(1:pawset_%grid%mesh,ns ) *     &
-                  pawset_%pswfc(1:pawset_%grid%mesh,ns1) +     &
-                  pawset_%augfun(1:pawset_%grid%mesh,ns,ns1,0) ) * &
-                  pawset_%psloc(1:pawset_%grid%mesh)
-             dd = dd - &
-                  int_0_inf_dr(aux,pawset_%grid,pawset_%irc,(pawset_%l(ns)+1)*2)
-             !
-             ddd_(ns,ns1) = pawset_%kdiff(ns,ns1) +  dd
-             ddd_(ns1,ns)=ddd_(ns,ns1)
-          END IF
-       END DO
-    END DO
-  END SUBROUTINE compute_nonlocal_coeff_ion
-  !
-  !============================================================================
-  !
-  ! Write PAW dataset wfc and potentials on files
-  !
-  SUBROUTINE human_write_paw(pawset_)
-    USE io_global, ONLY : ionode
-    IMPLICIT NONE
-    TYPE(paw_t), INTENT(In) :: pawset_
-    INTEGER :: n,ns
-    IF (.not.ionode) return
-    DO ns=1,pawset_%nwfc
-       WRITE (5000+ns,'(A)') "# r                 AEwfc               PSwfc               projector"
-       DO n=1,pawset_%grid%mesh
-          WRITE (5000+ns,'(4f20.12)') pawset_%grid%r(n), pawset_%aewfc(n,ns), pawset_%pswfc(n,ns),pawset_%proj(n,ns)
-       END DO
-    END DO
-    !
-    WRITE (6000,'(A)') "# r                 AEpot               PSpot"
-    DO n=1,pawset_%grid%mesh
-       WRITE (6000,'(3f20.8)') pawset_%grid%r(n), pawset_%aeloc(n), pawset_%psloc(n)
-    END DO
-  END SUBROUTINE human_write_paw
-  !
-  !============================================================================
-  !                       LOWER-LEVEL ROUTINES                              !!!
-  !============================================================================
-  !
-  ! Compute Sum_i oc_i * wfc_i^2
-  !
-  SUBROUTINE compute_sumwfc2(charge_, pawset_, nwfc_, wfc_, oc_, spin_)
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: charge_(ndmx,2)
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    INTEGER,       INTENT(IN)  :: nwfc_
-    REAL(dp), INTENT(IN)  :: wfc_(ndmx,nwfsx)
-    REAL(dp), INTENT(IN)  :: oc_(nwfsx)
-    INTEGER,       INTENT(IN)  :: spin_(nwfsx)
-    INTEGER :: nf
-    charge_(1:pawset_%grid%mesh,:)=ZERO
-    DO nf=1,nwfc_
-       IF (oc_(nf)>ZERO) charge_(1:pawset_%grid%mesh,spin_(nf)) = &
-                         charge_(1:pawset_%grid%mesh,spin_(nf)) + oc_(nf) * &
-                         wfc_(1:pawset_%grid%mesh,nf) * wfc_(1:pawset_%grid%mesh,nf)
-    END DO
-  END SUBROUTINE compute_sumwfc2
-  !
-  !============================================================================
-  !
-  ! Compute Sum_n oc_n <pswfc_n|proj_i> <proj_j|pswfc_n>
-  !
-  SUBROUTINE compute_projsum (projsum_, pawset_, nwfc_, l_, j_, spin_, pswfc_, oc_)
-    REAL(dp), INTENT(OUT) :: projsum_(nwfsx,nwfsx,2)
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    INTEGER,       INTENT(IN)  :: nwfc_
-    INTEGER,       INTENT(IN)  :: l_(nwfsx)
-    INTEGER,       INTENT(IN)  :: spin_(nwfsx)
-    REAL(dp),      INTENT(IN)  :: j_(nwfsx)
-    REAL(dp), INTENT(IN)  :: pswfc_(ndmx,nwfsx)
-    REAL(dp), INTENT(IN)  :: oc_(nwfsx)
-    REAL(dp) :: proj_dot_wfc(nwfsx,nwfsx), aux(ndmx)
-    INTEGER :: ns, ns1, nf, nr, is, nst
-    REAL(DP), EXTERNAL :: int_0_inf_dr
-    ! Compute <projector|wavefunction>
-    DO ns=1,pawset_%nwfc
-       DO nf=1,nwfc_
-          IF (pawset_%l(ns)==l_(nf).AND.pawset_%jj(ns)==j_(nf)) THEN
-             DO nr=1,pawset_%grid%mesh
-                aux(nr)=pawset_%proj(nr,ns)*pswfc_(nr,nf)
-             END DO
-             nst=(l_(nf)+1)*2
-             proj_dot_wfc(ns,nf)=int_0_inf_dr(aux,pawset_%grid,pawset_%ikk(ns),nst)
-          ELSE
-             proj_dot_wfc(ns,nf)=ZERO
-          END IF
-       END DO
-    END DO
-    ! Do the sum over the wavefunctions
-    projsum_(:,:,:)=ZERO
-    DO ns=1,pawset_%nwfc
-       DO ns1=1,ns
-          DO nf=1,nwfc_
-             is=spin_(nf)
-             IF (oc_(nf)>ZERO) THEN
-                projsum_(ns,ns1,is) = projsum_(ns,ns1,is) + oc_(nf) * &
-                     proj_dot_wfc(ns,nf) * proj_dot_wfc(ns1,nf)
-             END IF
-          END DO
-          projsum_(ns1,ns,:)=projsum_(ns,ns1,:)
-       END DO
-    END DO
-  END SUBROUTINE compute_projsum
-  !
-  !============================================================================
-  !
-  !
-  ! Compute augmentation charge as Sum_ij W_ij * Q_ij
-  !
-  SUBROUTINE compute_augcharge(augcharge_, pawset_, projsum_, nspin_)
-    IMPLICIT NONE
-    REAL(dp), INTENT(OUT) :: augcharge_(ndmx,2)
-    TYPE(paw_t),   INTENT(IN)  :: pawset_
-    REAL(dp), INTENT(IN)  :: projsum_(nwfsx,nwfsx,2)
-    INTEGER,       INTENT(IN)  :: nspin_
-    INTEGER :: ns, ns1, is
-    REAL(dp) :: factor
-    augcharge_=ZERO
-    DO is=1,nspin_
-       DO ns=1,pawset_%nwfc
-          DO ns1=1,ns
-             ! multiply by TWO off-diagonal terms
-             factor=TWO
-             IF (ns1==ns) factor=ONE
-             !
-             ! NB: in a spherically averaged system only the l=0 component 
-             !     of the augmentation functions is present
-             !
-             augcharge_(1:pawset_%grid%mesh,is) = augcharge_(1:pawset_%grid%mesh,is) + &
-                    factor * projsum_(ns,ns1,is) * &
-                    pawset_%augfun(1:pawset_%grid%mesh,ns,ns1,0)
-          END DO
-       END DO
-    END DO
-  END SUBROUTINE compute_augcharge
-  !
-  !============================================================================
-  !
-  ! Compute n1 and n1~, as Sum_ij W_ij wfc_i(r)*wfc_j(r) 
-  !
-  SUBROUTINE compute_onecenter_charge(charge1_, pawset_, projsum_, nspin_, which_wfc)
-    IMPLICIT NONE
-    REAL(dp),   INTENT(OUT) :: charge1_(ndmx,2)
-    TYPE(paw_t),     INTENT(IN)  :: pawset_
-    REAL(dp),   INTENT(IN)  :: projsum_(nwfsx,nwfsx,2)
-    INTEGER,         INTENT(IN)  :: nspin_
-    CHARACTER(LEN=2),INTENT(IN)  :: which_wfc
-    INTEGER :: ns, ns1, is
-    REAL(dp) :: factor
-    charge1_=ZERO
-    DO is=1,nspin_
-       DO ns=1,pawset_%nwfc
-          DO ns1=1,ns
-             ! multiply times TWO off-diagonal terms
-             IF (ns1==ns) THEN
-                factor=ONE
-             ELSE
-                factor=TWO
-             END IF
-             SELECT CASE (which_wfc)
-             CASE ("AE")
-                charge1_(1:pawset_%grid%mesh,is) = charge1_(1:pawset_%grid%mesh,is) + factor * &
-                     projsum_(ns,ns1,is) * pawset_%aewfc(1:pawset_%grid%mesh,ns) *     &
-                     pawset_%aewfc(1:pawset_%grid%mesh,ns1)
-                IF (pawset_%rel==2) &
-                charge1_(1:pawset_%irc,is) = charge1_(1:pawset_%irc,is) + factor * &
-                     projsum_(ns,ns1,is) * pawset_%aewfc_rel(1:pawset_%irc,ns) *     &
-                     pawset_%aewfc_rel(1:pawset_%irc,ns1)
-             CASE ("PS")
-                charge1_(1:pawset_%grid%mesh,is) = charge1_(1:pawset_%grid%mesh,is) + factor * &
-                     projsum_(ns,ns1,is) * pawset_%pswfc(1:pawset_%grid%mesh,ns) *     &
-                     pawset_%pswfc(1:pawset_%grid%mesh,ns1)
-             CASE DEFAULT
-                call errore ('compute_onecenter_charge','specify AE or PS wavefunctions',1)
-             END SELECT
-          END DO
-       END DO
-    END DO
-  END SUBROUTINE compute_onecenter_charge
-!
-!--------------------------------------------------------------------------
-SUBROUTINE find_bes_qi(qc,rmatch,lam,ncn,iok)
-  !--------------------------------------------------------------------------
-  !
-  !      This routine finds two values of q such that the
-  !      functions f_l have a derivative equal to 0 at rmatch
-  !  
-  IMPLICIT NONE
-
-  INTEGER,     INTENT(IN)  ::      &
-       lam,   & ! input: the angular momentum
-       ncn      ! input: the number of qi to compute
-  INTEGER,     INTENT(INOUT)  ::      &
-       iok      ! output: if 0 the calculation in this routine is ok
-
-  REAL (dp),   INTENT(OUT)   :: &
-       qc(ncn)  ! output: the values of qi
-  REAL (dp),   INTENT(IN)  :: rmatch
-
-  REAL (dp) ::   &
-       zeroderjl (2,7) ! first two zeros of the first derivative of 
-                       ! spherical Bessel function j_l for l = 0,...,6
-
-  INTEGER ::    &
-       nc       ! counter on the q found
-
-  data zeroderjl / 0.0_dp,                 4.4934094579614_dp, &
-                   2.0815759780862_dp,     5.9403699890844_dp, &
-                   3.3420936578747_dp,     7.2899322987026_dp, &
-                   4.5140996477983_dp,     8.5837549433127_dp, &
-                   5.6467036213923_dp,     9.8404460168549_dp, &
-                   6.7564563311363_dp,    11.0702068269176_dp, &
-                   7.8510776799611_dp,    12.2793339053177_dp  /
-  iok=0
-  IF (ncn.gt.2) &
-       CALL errore('find_aug_qi','ncn is too large',1)
-
-  IF (lam.gt.6) &
-       CALL errore('find_aug_qi','l not programmed',1)
-  !
-  !    fix deltaq and the maximum step number
-  !
-  DO nc = 1, ncn
-     !
-     qc(nc) = zeroderjl (nc, lam + 1) / rmatch
-     !
-  ENDDO
-  RETURN
-END SUBROUTINE find_bes_qi 
-  !
-  !============================================================================
-  !
-END MODULE atomic_paw
-

Deleted: trunk/espresso/atomic/c6_dft.f90
===================================================================
--- trunk/espresso/atomic/c6_dft.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/c6_dft.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,294 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-#undef DEBUG
-!---------------------------------------------------------------
-subroutine c6_dft (mesh, zed, grid)
-   !--------------------------------------------------------------------
-   !
-   use kinds,      only : DP
-   use constants,  only : e2, pi, fpi, BOHR_RADIUS_ANGS
-   use ld1inc,     only : lsd, nwf, oc, nn, ll, isw, psi, enl, vpot,vxt,vh, &
-                          enne, latt, rho
-   use radial_grids, only: radial_grid_type, ndmx
-   !
-   implicit none
-   !
-   ! I/O variables
-   !
-   type(radial_grid_type), intent(in) :: grid
-   integer mesh , mesh_save
-   real(DP) :: zed
-   !
-   ! local variables
-   !
-   logical :: csi, l_add_tf_term
-   real(DP) :: vnew(ndmx,2), rhoc1(ndmx), ze2, fac, vme(ndmx)
-   real(DP) :: rho_save(ndmx,2)
-   real(DP) :: error, error2, e, charge, beta, u, alpha, dalpha, c6, du1, &
-               du2, factor, thresh
-   real(DP), allocatable :: y(:), yy(:), sqr(:)
-   real(DP), allocatable :: dvpot(:), dvscf(:), drho(:), dvhx(:), dvxc(:), pp(:)
-   complex(DP), allocatable :: dy(:), drho_old(:)
-   integer i, is, n, l, iu, Nu, Nc, counter, nstop, nerr
-
-   allocate ( y(mesh),yy(mesh),sqr(mesh) )
-   allocate ( dvpot(mesh),dvscf(mesh),drho(mesh),dvhx(mesh),dvxc(mesh),pp(mesh) )
-   allocate ( dy(mesh), drho_old(mesh) )
-   !
-   write(6,'(/,/,/,5x,20(''-''),'' Compute C6 from polarizability.'',10(''-''),/)')
-   !
-   if (mesh.ne.grid%mesh) call errore('c6_dft',' mesh dimension is not as expected',1)
-   counter = 1
-   do i = 1, mesh
-      if (rho(i,1) .gt. 1.0d-30) counter = counter + 1
-   enddo
-   mesh_save = mesh
-   mesh = counter
-
-   if (lsd .ne. 0) call errore ('c6_dft', 'implemented only for non-magnetic ions', lsd) 
-   csi = .true.
-   do i = 1, nwf
-      csi = csi .and. ( ((ll(i).eq.0) .and. (oc(i).eq.2 )) .or. &
-                        ((ll(i).eq.1) .and. (oc(i).eq.6 )) .or. & 
-                        ((ll(i).eq.2) .and. (oc(i).eq.10)) .or. &
-                        ((ll(i).eq.3) .and. (oc(i).eq.14)) )
-   enddo
-   if (.not. csi) call errore ('c6_dft', 'implemented only for closed-shell ions', 1)
-! 
- 
-   n = 1
-   l = 0
-   e = -1.d-7
-   charge=0.d0
-   ze2 = - zed * e2
-   thresh = 1.d-10
-!
-   rho_save =  rho
-   rho=0.0_dp
-   do n=1,nwf
-      do i=1,mesh
-         rho(i,isw(n))=rho(i,isw(n))+oc(n)*(psi(i,1,n)**2+psi(i,2,n)**2)
-      enddo
-   enddo
-
-   error = 0.d0
-   do i=1,mesh
-      error = error + abs( rho(i,1)-rho_save(i,1) ) * grid%r2(i) * grid%dx
-      error = error + abs( rho(i,2)-rho_save(i,2) ) * grid%r2(i) * grid%dx
-   end do
-
-   if (error > 1.d-8) then
-      write (*,*) error
-      call errore('c6_dft','charge density rho from last vnew is inaccurate',1)
-   end if
-
-   rhoc1=0.d0
-   call new_potential(ndmx,mesh,grid,zed,vxt,lsd,.false.,latt,enne,rhoc1,rho,vh,vnew,0)
-   error = 0.d0
-   do i=1,mesh
-      error = error + abs( vpot(i,1)-vnew(i,1) ) * grid%r2(i) * grid%dx
-      error = error + abs( vpot(i,2)-vnew(i,2) ) * grid%r2(i) * grid%dx
-   end do
-   write (*,*) "Vpot-Vnew", error
-
-   nerr = 0
-   do n=1,nwf
-      if (oc(n) >= 0.0_dp) then
-         is=isw(n)
-         call ascheq (nn(n),ll(n),enl(n),mesh,grid,vnew(1,is),ze2,&
-                      thresh,psi(1,1,n),nstop)
-         nerr = nerr + nstop
-         write (*,'(4i3,2f10.5,i5)') n, nn(n),ll(n),isw(n),oc(n),enl(n),nstop
-      else
-         enl(n)=0.0_dp
-         psi(:,:,n)=0.0_dp
-      end if
-   end do
-
-!  from now on rho is the REAL rho w/o the volume element
-   do i = 1, mesh
-      rho(i,1) = rho(i,1) / (fpi*grid%r(i)**2)
-   end do
-!
-! initialize external perturbation (electric field)
-!
-   call init_dpot(grid%r,mesh,dvpot)
-!
-! derivative of xc-potential
-!
-   call dvxc_dn(mesh, rho, dvxc)
-!
-!write(*,'(1PE20.12)')sum(abs(dvxc))
-!stop
-   write(6,'(5x,''Frequency dependent polarizability is written into freq-pol.dat'',/)')
-
-   c6    = 0.0d0
-   alpha = 0.0d0
-
-   open(1, file = 'freq-pol-dft.dat')
-   write (1,'(15x,"    u          alpha(angstrong)       alpha(a.u.)  ",/)')
-   !
-   Nu  = 230
-   Nc  = 50
-   du1 = 0.1d0
-   du2 = 0.25d0
-   u   = -du1
-   !
-   do iu=0,Nu
-      !
-      if (iu .le. 50) then
-         u = u + du1
-      else
-         u = u + du2
-      endif
-      !
-      if (iu.eq.0) then
-         do i=1,mesh
-            dvscf(i) = dvpot(i)
-            drho_old(i) = 0.d0
-         end do 
-      end if
-      beta = 0.05
-      dalpha = 1.0d+99
-      alpha = 0.d0
-      counter = 0
-      do while (dalpha > 1.d-9)
-         counter =  counter + 1
-         !
-         ! solve Sternheimer equation for the auxiliary wavefunction
-         !
-         drho = 0.d0
-         do n=1,nwf
-            do l = 1 + ll(n), max( 1 - ll(n), 0 ), - 2
-!               write (*,*) l, ll(n)
-               y(1:mesh) = psi(1:mesh,1,n)/grid%sqr(1:mesh)
-               vme(:) = vnew(:,isw(n)) - enl(n)
-               call sternheimer(u,l,ll(n),mesh,grid%dx,grid%r,grid%sqr,grid%r2,vme,zed,y,dvscf,dy)
-               fac = 2.0d0 * (2.d0 * ll(n) + 1.d0 )
-               if (ll(n)==1 .and. l==2) fac = fac * 2.d0/3.d0
-               if (ll(n)==1 .and. l==0) fac = fac * 1.d0/3.d0
-               if (ll(n)==2 .and. l==3) fac = fac * 3.d0/5.d0
-               if (ll(n)==2 .and. l==1) fac = fac * 2.d0/5.d0
-               call inc_drho_of_r(mesh, grid%dx, grid%r, grid%r2, y, dy, fac, drho)
-#ifdef DEBUG
-         write (*,*) "========================", n, l
-         write (*,*) "y(1:3)"
-         write (*,*) y(1:3)
-         write (*,*) "dy(1:3)"
-         write (*,*) dy(1:3)
-         write (*,*) "drho(1:3)"
-         write (*,*) drho(1:3)
-#endif
-             
-            end do
-         end do
-#ifdef DEBUG
-         write (*,*) "========================"
-         write (*,*) "drho(1:3)"
-         write (*,*) drho(1:3)
-         write (*,*) "drho(20:22)"
-         write (*,*) drho(20:22)
-         write (*,*) "drho(40:42)"
-         write (*,*) drho(40:42)
-         write (*,*) "drho(mesh-2:mesh)"
-         write (*,*) drho(mesh-2:mesh)
-#endif 
-         !
-         ! compute dv of drho (w/o the TF term)
-         !
-         l_add_tf_term = .false.
-         call dv_of_drho(mesh, grid%dx, grid%r,grid%r2,rho,drho,dvhx,dvxc,pp,l_add_tf_term)
-
-#ifdef DEBUG
-         write (*,*) "========================"
-         write (*,*) "dvhx(1:3)"
-         write (*,*) dvhx(1:3)
-         write (*,*) "dvhx(20:22)"
-         write (*,*) dvhx(20:22)
-         write (*,*) "dvhx(40:42)"
-         write (*,*) dvhx(40:42)
-         write (*,*) "dvhx(mesh-2:mesh)"
-         write (*,*) dvhx(mesh-2:mesh)
-         write (*,*) "========================"
-         write (*,*) "pp(1:3)"
-         write (*,*) pp(1:3)
-         write (*,*) "pp(20:22)"
-         write (*,*) pp(20:22)
-         write (*,*) "pp(40:42)"
-         write (*,*) pp(40:42)
-         write (*,*) "pp(mesh-2:mesh)"
-         write (*,*) pp(mesh-2:mesh)
-#endif 
-         !
-         ! mix
-         !
-         error = 0.d0
-         error2 = 0.d0
-         do i=1,mesh
-            dvscf(i) = dvscf(i) + beta * (dvpot(i)+dvhx(i) -dvscf(i))
-            error = error + abs (drho(i) -drho_old(i))
-            error2 = error2 + abs (drho(i) -drho_old(i))* grid%r(i) * grid%dx
-            drho_old(i) = drho(i)
-         end do 
-         dalpha = abs(alpha + pp(mesh)) 
-         alpha = -pp(mesh)
-!         write (*,'(4e16.6)') alpha, dalpha, error, error2
-        
-      end do
-
-      write (1,'(17x, f8.4, 3x, 1PE14.6, 9x, 1PE14.6)') u, pp(mesh)*BOHR_RADIUS_ANGS**3, pp(mesh)
-      if (iu .eq. 0) & 
-      write (6,'(5x, "Static polarizability: ", f10.5, " (in angstrom^3)   --->", f10.5,&
-                & "  (in e^2a0^3)")') pp(mesh)*BOHR_RADIUS_ANGS**3, pp(mesh)
-
-      if (iu .eq. 0)                  factor = 0.5d0 * du1
-      if (iu .gt. 0 .and. iu .lt. Nc) factor = du1
-      if (iu .eq. Nc)                 factor = 0.5d0 * ( du1 + du2)
-      if (iu .gt. Nc .and. iu .lt. Nu) factor = du2
-      if (iu .eq. Nu)                 factor = 0.5d0 * du2
-      c6 = c6 + factor*alpha*alpha
-
-   end do
-
-   c6 = c6 * 3.d0 / pi 
-
-   write (*,'(/, 5x, a, f12.6)') "C6 coefficient in units [e2*a0**5]", c6/e2
-   !
-   write(6,'(/,5x,20(''-''),'' End of C6 calculation '',20(''-''),/)')
-
-   deallocate ( dy )
-   deallocate ( y, yy, sqr )
-   deallocate ( dvpot, dvscf, drho, dvhx, pp )
-   
-   return
-end subroutine c6_dft
-  
-!--------------------------------------------------------------------
-subroutine inc_drho_of_r(mesh, dx, r, r2, y, dy, fac, drho)
-   !--------------------------------------------------------------------
-   ! compute the first order variation of the density from
-   ! the zeroth and first order auxiliary wavefunctions y and dy
-   !
-   use constants, only : e2, pi, fpi
-   implicit none
-   !
-   ! I/O vaiables
-   !
-   integer mesh
-   real (kind=8) :: dx, fac, r(mesh), r2(mesh), y(mesh), drho(mesh)
-   complex (kind=8) :: dy(mesh)
-   ! local variables
-   integer i
-
-   do i=1,mesh
-      drho(i) = drho(i) + fac * 2.d0 * y(i) * real(dy(i)) * r(i) / (fpi*r2(i))
-   end do
-
-   return
-end subroutine
-

Deleted: trunk/espresso/atomic/c6_tfvw.f90
===================================================================
--- trunk/espresso/atomic/c6_tfvw.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/c6_tfvw.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,670 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-#undef DEBUG
-!---------------------------------------------------------------
-subroutine c6_tfvw (mesh, zed, grid, rho_input)
-   !--------------------------------------------------------------------
-   !
-   use kinds,      only : DP
-   use constants,  only : e2, pi, fpi, BOHR_RADIUS_ANGS
-   use ld1inc,     only : lsd, nwf, oc, ll
-   use radial_grids, only: radial_grid_type
-   !
-   implicit none
-   !
-   ! I/O variables
-   !
-   type(radial_grid_type), intent(in):: grid
-   integer mesh
-   real (kind=8) :: rho_input(mesh)
-   real (kind=8) :: zed, rho(mesh)
-   !
-   !real (kind=8) :: vw_lambda=9.0_dp ! describes exactly the low-q limit
-   !real (kind=8) :: vw_lambda=3.0_dp ! interpolate between high and low q's
-   real (kind=8) :: vw_lambda=1.0_dp ! describes exactly the high-q limit
-   !
-   ! local variables
-   !
-   logical :: csi, l_add_tf_term
-   real (kind=8) :: error, error2, e, charge, beta, u, alpha, dalpha, c6, du1, &
-                    du2, factor, ze2, thresh
-   real (kind=8), allocatable :: veff(:), y(:), yy(:)
-   real (kind=8), allocatable :: dvpot(:), dvscf(:), drho(:), dvhx(:), dvxc(:), pp(:)
-   complex (kind=8), allocatable :: dy(:), drho_old(:)
-   integer i, iter, n, l, ly, iu, Nu, Nc, counter, nstop, mesh_save
-
-   allocate ( veff(mesh),y(mesh),yy(mesh))
-   allocate ( dvpot(mesh),dvscf(mesh),drho(mesh),dvhx(mesh),dvxc(mesh),pp(mesh) )
-   allocate ( dy(mesh), drho_old(mesh) )
-   !
-   write(6,'(/,/,/,5x,10(''-''),'' Compute C6 from polarizability with TFvW approx.'',10(''-''),/)')
-   if (vw_lambda.ne.1.d0) write(6,*) " value of vw_lambda ", vw_lambda
-   !
-   if (mesh.ne.grid%mesh) call errore('c6_tfwv',' mesh dimension is not as expected',1)
-   do i = 1, mesh
-      rho(i) = rho_input(i) / (fpi*grid%r(i)**2)
-   end do
-   !
-   counter = 1
-   do i = 1, mesh
-      if (rho(i) .gt. 1.0d-30) counter = counter + 1 
-   enddo
-   mesh_save = mesh
-   mesh = counter
-#ifdef DEBUG
-   write (*,*) "mesh ", mesh
-#endif
-   !
-   if (lsd .ne. 0) call errore ('c6_tfvw', 'implemented only for non-magnetic ions', lsd) 
-   csi = .true.
-   do i = 1, nwf
-      csi = csi .and. ( ((ll(i).eq.0) .and. (oc(i).eq.2 )) .or. &
-                        ((ll(i).eq.1) .and. (oc(i).eq.6 )) .or. & 
-                        ((ll(i).eq.2) .and. (oc(i).eq.10)) .or. &
-                        ((ll(i).eq.3) .and. (oc(i).eq.14)) )
-   enddo
-   if (.not. csi) call errore ('c6_tfvw', 'implemented only for closed-shell ions', 1)
-!   rho = 0.d0
-!   open (7,file='rho.out',status='unknown',form='formatted')
-!   do i=1,mesh
-!      read (7,'(P5E20.12)') r(i), rho(i), y(i), y(i), y(i)
-!      write (6,'(P5E15.6)') r(i), rho(i)
-!   end do
-!   close (7)
-!
-! compute unperturbed effective potential
-!
-   call veff_of_rho(mesh,grid%dx,grid%r,grid%r2,rho,y,veff)
-#ifdef DEBUG
-   write (*,*) "veff(1:3)"
-   write (*,*) veff(1:3)
-   write (*,*) "veff(mesh-5:mesh)"
-   write (*,*) veff(mesh-5:mesh)
-#endif
-!
-! check that veff and y are what we think
-!
-   n = 1
-   l = 0
-   e = -1.d-7
-   charge=0.d0
-   ze2 = - zed * e2
-   thresh = 1.d-14
-
-   do i=1,mesh
-      charge = charge + rho(i) * fpi * grid%r2(i) * grid%r(i) * grid%dx
-   end do
-!   call solve_scheq(n,l,e,mesh,dx,r,sqr,r2,veff,zed,yy)
-   call ascheq (n, l, e, mesh, grid, veff, ze2, thresh, yy, nstop)
-
-   error = 0.d0
-   do i=1,mesh
-      error = error + (y(i)-yy(i)/grid%sqr(i)*sqrt(charge))**2 * grid%r2(i) * grid%dx
-   end do
-
-#ifdef DEBUG
-      write (*,*) "ascheq called with mesh"
-      write (*,*) "nstop", nstop, e
-      write (*,*) "error ",error
-      write (*,*) "y(1:3)"
-      write (*,*) y(1:3)
-      write (*,*) "y(mesh-2:mesh)"
-      write (*,*) y(mesh-2:mesh)
-      write (*,*) "yy(1:3)"
-      write (*,*) yy(1:3)
-      write (*,*) "yy(mesh-2:mesh)"
-      write (*,*) yy(mesh-2:mesh)
-      write (*,*) grid%sqr(1:3)
-      write (*,*) "sqrt(charge)", sqrt(charge)
-#endif
-   if (error > 1.d-8) then
-      call errore('c6_tfvw','auxiliary funtions veff(r) and y(r) are inaccurate',1)
-   end if
-!
-! initialize external perturbation (electric field)
-!
-   call init_dpot(grid%r,mesh,dvpot)
-!
-! derivative of xc-potential
-!
-   call dvxc_dn(mesh, rho, dvxc)
-!
-!write(*,'(1PE20.12)')sum(abs(dvxc))
-!stop
-   write(6,'(5x,''Frequency dependent polarizability is written into freq-pol.dat'',/)')
-
-   c6    = 0.0d0
-   alpha = 0.0d0
-
-   open(1, file = 'freq-pol.dat')
-   write (1,'(15x,"    u          alpha(angstrong)       alpha(a.u.)  ",/)')
-   !
-   Nu  = 230
-   Nc  = 50
-   du1 = 0.1d0
-   du2 = 0.25d0
-   u   = -du1
-   !
-   do iu=0,Nu
-      !
-      if (iu .le. 50) then
-         u = u + du1
-      else
-         u = u + du2
-      endif
-      !
-      if (iu.eq.0) then
-         do i=1,mesh
-            dvscf(i) = dvpot(i)
-            drho_old(i) = 0.d0
-         end do 
-      end if
-      beta = 0.05
-      dalpha = 1.0d+99
-      alpha = 0.d0
-      counter = 0
-      do while (dalpha > 1.d-9)
-         counter =  counter + 1
-         !
-         ! solve Sternheimer equation for the auxiliary wavefunction
-         !
-         l = 1
-         ly = 0
-         call sternheimer(u*vw_lambda,l,ly,mesh,grid%dx,grid%r,grid%sqr,grid%r2,veff,zed,y,dvscf,dy)
-         dy = dy*vw_lambda
-         ! compute drho of r
-         !
-         call drho_of_r(mesh, grid%dx, grid%r, grid%r2, y, dy, drho)
-#ifdef DEGUG
-         write (*,*) "========================"
-         write (*,*) "drho(1:3)"
-         write (*,*) drho(1:3)
-         write (*,*) "drho(20:22)"
-         write (*,*) drho(20:22)
-         write (*,*) "drho(40:42)"
-         write (*,*) drho(40:42)
-         write (*,*) "drho(mesh-2:mesh)"
-         write (*,*) drho(mesh-2:mesh)
-#endif
-         !
-         ! compute dv of drho (including the TF term)
-         !
-         l_add_tf_term = .true.
-         call dv_of_drho(mesh, grid%dx, grid%r,grid%r2,rho,drho,dvhx,dvxc,pp, l_add_tf_term)
-
-#ifdef DEGUG
-         write (*,*) "========================"
-         write (*,*) "dvhx(1:3)"
-         write (*,*) dvhx(1:3)
-         write (*,*) "dvhx(20:22)"
-         write (*,*) dvhx(20:22)
-         write (*,*) "dvhx(40:42)"
-         write (*,*) dvhx(40:42)
-         write (*,*) "dvhx(mesh-2:mesh)"
-         write (*,*) dvhx(mesh-2:mesh)
-         write (*,*) "========================"
-         write (*,*) "pp(1:3)"
-         write (*,*) pp(1:3)
-         write (*,*) "pp(20:22)"
-         write (*,*) pp(20:22)
-         write (*,*) "pp(40:42)"
-         write (*,*) pp(40:42)
-         write (*,*) "pp(mesh-2:mesh)"
-         write (*,*) pp(mesh-2:mesh)
-#endif
-         !
-         ! mix
-         !
-         error = 0.d0
-         error2 = 0.d0
-         do i=1,mesh
-            dvscf(i) = dvscf(i) + beta * (dvpot(i)+dvhx(i) -dvscf(i))
-            error = error + abs (drho(i) -drho_old(i))
-            error2 = error2 + abs (drho(i) -drho_old(i))* grid%r(i) * grid%dx
-            drho_old(i) = drho(i)
-         end do 
-         dalpha = abs(alpha + pp(mesh)) 
-         alpha = -pp(mesh)
-!         write (*,'(4e16.6)') alpha, dalpha, error, error2
-      end do
-
-      write (1,'(17x, f8.4, 3x, 1PE14.6, 9x, 1PE14.6)') u, pp(mesh)*BOHR_RADIUS_ANGS**3, pp(mesh)
-      if (iu .eq. 0) & 
-      write (6,'(5x, "Static polarizability: ", f10.5, " (in A^3) --->", f10.5,&
-                & "  (in e^2a0^3)")') pp(mesh)*BOHR_RADIUS_ANGS**3, pp(mesh)
-
-      if (iu .eq. 0)                  factor = 0.5d0 * du1
-      if (iu .gt. 0 .and. iu .lt. Nc) factor = du1
-      if (iu .eq. Nc)                 factor = 0.5d0 * ( du1 + du2)
-      if (iu .gt. Nc .and. iu .lt. Nu) factor = du2
-      if (iu .eq. Nu)                 factor = 0.5d0 * du2
-      c6 = c6 + factor*alpha*alpha
- 
-   end do
-
-   c6 = c6 * 3.d0 / pi 
-
-   write (*,'(/, 5x, a, f12.6)') "C6 coefficient in units [e2*a0**5]", c6/e2
-   !
-   write(6,'(/,5x,20(''-''),'' End of C6 calculation '',20(''-''),/)')
-
-   deallocate ( dy )
-   deallocate ( veff, y, yy )
-   deallocate ( dvpot, dvscf, drho, dvhx, pp )
-   
-   mesh = mesh_save
-   return
-end subroutine
-  
-!--------------------------------------------------------------------
-subroutine veff_of_rho(mesh,dx,r,r2,rho,y,veff)
-   !--------------------------------------------------------------------
-   ! compute unperturbed auxiliary wavefunction y and
-   ! the corresponding effective potential veff
-   !
-   use constants, only : e2, pi, fpi
-   implicit none
-   ! 
-   ! I/O variables
-   !
-   integer mesh
-   real (kind=8) :: dx, r(mesh), r2(mesh), rho(mesh), veff(mesh), y(mesh)
-   ! 
-   ! local variables
-   !
-   real (kind=8), allocatable :: vold(:)
-   real (kind=8) :: dx2, error
-   integer i, iter, k
-
-!
-! compute auxiliary wavefunction y
-!
-   do i=1,mesh
-      y(i) = sqrt(rho(i)*r(i)*fpi)
-   end do
-!
-! compute effective potential veff
-!
-   allocate (vold(mesh))
-
-   do i=1,mesh
-      vold(i) = 0.d0
-   end do
-   dx2= dx*dx
-   error = 1.d0
-   k = 0
-   do while (error > 1.d-9) 
-      !
-      k=k+1
-      !
-      do i=2,mesh-1
-         veff(i) = ( y(i+1)/y(i) + y(i-1)/y(i) -2.d0 )/dx2  &
-                 - ( vold(i+1)*y(i+1)/y(i) + vold(i-1)*y(i-1)/y(i) -2.d0*vold(i) )/12.d0
-      end do
-      veff(1) = veff(2) + (veff(3)-veff(2))*(r(1)-r(2))/(r(3)-r(2)) 
-      veff(mesh) = (y(mesh-1)/y(mesh) -2.d0 )/dx2 &
-                 - (vold(mesh-1)*y(mesh-1)/y(mesh) -2.d0*vold(mesh) )/12.d0
-!
-! the routine that integrates the Sh.Eq. requires that v(mesh) is an upper bound
-!
-      veff(mesh) = max(veff(mesh),veff(mesh-1))
-!
-      error = 0.d0
-      do i=1,mesh
-         error = error + abs( veff(i) - vold(i) )
-         vold(i) = veff(i)
-      end do
-      error = error / mesh
-!      write (*,*) 'iteration # ', k, error
-   end do
-
-   deallocate (vold)
-   !
-   do i=1,mesh
-      veff(i) = (veff(i) -0.25d0)/r2(i)
-   end do
-   !
-!   open (7,file='veff.out',status='unknown',form='formatted')
-!   write (7,*) "#  r(i),        rho(i),        y(i),          veff(i),       veff(i)*r(i) "
-!   do i=0,mesh
-!      write (7,'(P6E15.6)') r(i), rho(i), y(i), veff(i), veff(i)*r(i)
-!   end do
-!   close (7)
-   !
-   return
-end subroutine
-!
-!--------------------------------------------------------------------
-subroutine dv_of_drho(mesh,dx,r,r2,rho,drho,dvhx,dvxc,pp, l_add_tf_term)
-   !--------------------------------------------------------------------
-   use constants, only : e2, pi, fpi
-!   use flags,      only : HartreeFock, rpa
-   implicit none
-   !
-   ! I/O variables
-   !
-   logical l_add_tf_term
-   integer mesh
-   real (kind=8) :: dx, r(mesh), r2(mesh)
-   real (kind=8) :: rho(mesh), drho(mesh), dvhx(mesh), pp(mesh), dvxc(mesh)
-   !
-   ! local variables
-   !
-   real (kind=8) :: dr3, kf2, charge
-   real (kind=8), allocatable :: qq(:)
-   integer i
-
-   allocate (qq(mesh))
-
-   do i=1,mesh 
-      dr3   = fpi * r2(i) * r(i) * dx
-      pp(i) = drho(i) * r(i)  * dr3 /3.d0
-      qq(i) = drho(i) / r2(i) * dr3 /3.d0
-   end do
-   do i=1,mesh
-      pp(i) = pp(i) + pp(i-1) 
-   end do
-!   write (*,*) "pp in dv_of_drho"
-!   write (*,*) pp(1:6)
-!   write (*,*) pp(mesh-5:mesh)
-!   write (*,*) "qq -prima in dv_of_drho"
-!   write (*,*) qq(1:6)
-!   write (*,*) qq(mesh-5:mesh)
-   do i=mesh-1,1,-1
-      qq(i) = qq(i) + qq(i+1)
-   end do
-!   write (*,*) "qq -dopo in dv_of_drho"
-!   write (*,*) qq(1:6)
-!   write (*,*) "r2 in dv_of_drho"
-!   write (*,*) r2(1:6)
-!   write (*,*) "r in dv_of_drho"
-!   write (*,*) r(1:6)
-   do i=1,mesh
-      dvhx(i) = e2 * ( pp(i) / r2(i) + qq(i) * r(i) ) ! Hartree term
-   end do
-
-!   write (*,*) "Hartree in dv_of_drho"
-!   write (*,*) dvhx(1:6)
-!   write (*,*) dvhx(mesh-5:mesh)
-! add TF term
-   if (l_add_tf_term) then
-      do i=1,mesh
-         kf2 = ( 3.d0*pi*pi*rho(i) )**(2.d0/3.d0)
-         dvhx(i) = dvhx(i) + e2/3.d0* kf2 / rho(i) * drho(i)
-      end do
-   end if
-!
-!add xc term
-!         
-!   write (*,*) "dvxc in dv_of_drho"
-!   write (*,*) dvxc(1:6)
-   do i=1,mesh
-      dvhx(i) = dvhx(i) + dvxc(i) * drho(i)
-   end do
-!   write (*,*) "Hartree + dvxc in dv_of_drho"
-!   write (*,*) dvhx(1:3)
-!   write (*,*) dvhx(mesh-2:mesh)
-!
-   deallocate (qq)
-
-   return
-end subroutine
-!----------------------------------------------------------------------
-subroutine dvxc_dn(mesh, rho, dvxc)
-   !-------------------------------------------------------------------
-   ! compute the derivative of xc-potential w.r.t local density.
-   ! some routine in PH and flibs will be called
-   !
-   use funct,  only : dft_is_gradient, dmxc
-   !
-   implicit none
-   !
-   ! I/O variables
-   !
-   integer :: mesh
-   real(kind=8) :: rho(mesh), dvxc(mesh)
-   !
-   ! local variables
-   !
-   integer :: i
-   !
-   !
-   !
-   if ( dft_is_gradient() ) &
-      call errore ('dvxc_dn', 'gradient correction to dvxc not yet implemented', 1)
-   do i = 1, mesh
-      ! LDA only
-      dvxc(i) = dmxc (rho(i))
-      !
-   end do
-   !
-   return
-   !
-end subroutine dvxc_dn
-!--------------------------------------------------------------------
-subroutine drho_of_r(mesh, dx, r, r2, y, dy, drho)
-   !--------------------------------------------------------------------
-   ! compute the first order variation of the density from
-   ! the zeroth and first order auxiliary wavefunctions y and dy
-   !
-   use constants, only : e2, pi, fpi
-   implicit none
-   !
-   ! I/O vaiables
-   !
-   integer mesh
-   real (kind=8) :: dx, r(mesh), r2(mesh), y(mesh), drho(mesh)
-   complex (kind=8) :: dy(mesh)
-   ! local variables
-   integer i
-   do i=1,mesh
-      drho(i) = 2.d0 * y(i) * real(dy(i)) * r(i) / (fpi*r2(i))
-   end do
-
-   return
-end subroutine
-!--------------------------------------------------------------------
-subroutine init_dpot(r,mesh,dvpot)
-   !--------------------------------------------------------------------
-   !
-   ! initialize external potential
-   !
-   use constants, only : e2
-   implicit none
-   !
-   ! I/O variables
-   !
-   integer mesh
-   real (kind=8) :: r(mesh), dvpot(mesh)
-   !
-   ! local variables
-   !
-   integer i
-
-   do i =1,mesh
-      dvpot (i) = - e2*r(i)
-   end do
-
-   return
-end subroutine
-
-!--------------------------------------------------------------------
-subroutine sternheimer(u, l, ll, mesh, dx, r, sqr, r2, vpot, zed, y, dvpot, dy)
-   !--------------------------------------------------------------------
-   !
-   ! solve the sternheimer equation for imaginary frequency 
-   ! in radial coordinates by Numerov method
-   !
-   implicit none
-   !
-   ! I/O variables
-   ! 
-   integer mesh, l, ll
-   real (kind=8) :: u,  dx, zed
-   real (kind=8) :: r(mesh), sqr(mesh), r2(mesh)
-   real (kind=8) :: vpot(mesh), y(mesh), dvpot(mesh)
-   complex (kind=8) :: dy(mesh)
-   !
-   ! local variables
-   !
-   integer i, icl, j
-   real (kind=8) :: ddx12, sqlhf, x2l2
-   complex (kind=8) :: gg, aa, bb, fac, e
-   complex (kind=8), allocatable :: f(:), g(:), yy(:)
-
-   allocate ( f(mesh), g(mesh), yy(mesh) )
-
-   ddx12=dx*dx/12.d0
-   sqlhf = (l+0.5d0)**2
-   x2l2 = 2*l+2
-   e = cmplx (0.d0, u, kind=8)
-   !
-   ! set up the f-function and determine the position of its last
-   ! change of sign
-   ! f < 0 (approximatively) means classically allowed   region
-   ! f > 0         "           "        "      forbidden   "
-   !
-   icl = 2
-!   f(0) = ddx12 *( sqlhf + r2(0) * (vpot(0)-e) )
-   f(1) = ddx12 *( r2(1) * (vpot(1)-e) )
-   do i=2,mesh
-!      f(i) = ddx12 * ( sqlhf + r2(i) *(vpot(i)-e) )
-      f(i) = ddx12 * ( r2(i) *(vpot(i)-e) )
-      if( real(f(i)) .ne. sign(real(f(i)),real(f(i-1))) &
-          .and. real(f(i)).gt.0d0 ) icl=i
-   end do
-   ! write (*,*) icl
-
-   do i=1,mesh
-      f(i) = ddx12 * ( sqlhf + r2(i) *(vpot(i)-e) )
-   end do
-
-   do i=1,mesh
-      f(i)=1.0d0-f(i)
-      g(i)= ddx12 * r2(i) * dvpot(i) * y(i) 
-   end do 
-   ! step 1) determine a solution to the homogeneous equation that
-   !         satisfies proper boundary conditions at 0 and infty
-   !         NB it will NOT satisfy the homogeneous equation at icl 
-   !
-   ! determination of the wave-function in the first two points 
-   !
-   yy(1) = r(1)**(l+1) *(1.d0 - 2.d0*zed*r(1)/x2l2) / sqr(1)
-   yy(2) = r(2)**(l+1) *(1.d0 - 2.d0*zed*r(2)/x2l2) / sqr(2)
-   !
-   ! outward integration 
-   !
-   do i =2, icl-1
-      yy(i+1)=( (12.d0-10.d0*f(i))*yy(i)-f(i-1)*yy(i-1) )/f(i+1)
-   end do
-   !
-   ! rescale to 1 at icl
-   !
-   fac = 1.d0/yy(icl)
-   do i =1, icl
-      yy(i)= yy(i) * fac 
-   end do
-   !
-   ! determination of the wave-function in the last two points 
-   ! assuming y(mesh+1) = 0 and y(mesh) = dx
-   !
-   yy(mesh) = dx
-   yy(mesh-1) = (12.d0-10.d0*f(mesh))*yy(mesh)/f(mesh-1) 
-   !
-   ! inward integration 
-   !
-   do i = mesh-1,icl+1,-1
-      yy(i-1)=( (12.d0-10.d0*f(i))*yy(i)-f(i+1)*yy(i+1) )/f(i-1)
-      if (abs(yy(i-1)).gt.1.d6) then
-         fac = 1.d0/yy(i-1)
-         do j=i-1,mesh
-            yy(j) = yy(j) * fac
-         end do
-      end if
-   end do
-   !
-   ! rescale to 1 at icl
-   !
-   fac = 1.d0 / yy(icl)
-   do i = icl, mesh
-      yy(i)= yy(i) * fac
-   end do
-   !
-   ! step 2) determine a solution to the inhomogeneous equation that
-   !         satisfies proper boundary conditions at 0 and infty
-   !         and matches in value at icl
-   !         NB it will NOT satisfy the inhomogeneous equation at icl 
-   !
-   ! determination of the wave-function in the first two points 
-   !
-   dy(1) = r(1)**(l+1) *(1.d0 - 2.d0*zed*r(1)/x2l2) / sqr(1)
-   dy(2) = r(2)**(l+1) *(1.d0 - 2.d0*zed*r(2)/x2l2) / sqr(2)
-   !
-   ! outward integration 
-   !
-   do i =2, icl-1
-      gg = g(i+1) + 10.d0*g(i) + g(i-1)
-      dy(i+1)=( (12.d0-10.d0*f(i))*dy(i)-f(i-1)*dy(i-1) + gg )/f(i+1)
-   end do
-   !
-   ! choose the solution that goes to 1 in icl
-   !
-   fac =  dy(icl) - 1.d0
-   do i = 1,icl
-      dy(i) = dy(i) - fac * yy(i)
-   end do
-   !
-   ! determination of the wave-function in the last two points 
-   ! assuming y(mesh+1) = 0 and y(mesh) = dx
-   !
-   dy(mesh) = dx
-   dy(mesh-1) = (12.d0-10.d0*f(mesh))*yy(mesh)/f(mesh-1) 
-   !
-   ! inward integration 
-   !
-   do i = mesh-1,icl+1,-1
-      gg = g(i+1) + 10.d0*g(i) + g(i-1)
-      dy(i-1)=( (12.d0-10.d0*f(i))*dy(i)-f(i+1)*dy(i+1) + gg )/f(i-1)
-      if (abs(dy(i-1)).gt.1.d6) then
-         if (abs(yy(i-1)).gt. 1.d-12) then
-            fac = ( dy(i-1) - 1.d0 ) / yy(i-1)
-            do j = i-1, mesh
-               dy(j) = dy(j) - fac * yy(j)
-            end do
-         else
-            do j = i-1, mesh
-               dy(j) = 0.d0
-            end do
-         end if
-      end if
-   end do
-   !
-   ! choose the solution that goes to 1 in icl
-   !
-   fac =  dy(icl) - 1.d0
-   do i = icl, mesh
-      dy(i) = dy(i) - fac * yy(i)
-   end do
-   !
-   ! step 3) chose the proper combination of dy and yy so that the
-   !         inhomogeneous equation is satisfied also in icl
-   i = icl
-   gg = g(i+1) + 10.d0*g(i) + g(i-1)
-   aa= (12.d0-10.d0*f(i))*dy(i)-f(i+1)*dy(i+1)-f(i-1)*dy(i-1) + gg 
-   bb= (12.d0-10.d0*f(i))*yy(i)-f(i+1)*yy(i+1)-f(i-1)*yy(i-1) 
-   !   write (*,*) aa, bb
-   fac = aa/bb
-   do i=1,mesh
-      dy(i) = dy(i) - fac * yy(i)
-   end do
-   deallocate ( f, g, yy )
-
-   return
-
-end subroutine
-

Deleted: trunk/espresso/atomic/calculate_gipaw_orbitals.f90
===================================================================
--- trunk/espresso/atomic/calculate_gipaw_orbitals.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/calculate_gipaw_orbitals.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,328 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------
-SUBROUTINE calculate_gipaw_orbitals
-  !------------------------------------------------------------
-
-  USE ld1_parameters, ONLY : nwfsx
-  USE ld1inc,         ONLY : nld, file_logder, zed, grid, &
-       wfc_ae_recon, wfc_ps_recon, nspin, nwftsc, lltsc, enltsc, &
-       nwfs, eltsc, el, nwf, enl, rel, vpot, nbeta, pseudotype, &
-       vpstot, nstoaets, enlts, vnl, lls, betas, ddd, qq, jjs, els, &
-       rcutus, ikk, nwfts, verbosity
-  USE io_global,     ONLY : stdout
-  USE kinds,         ONLY : dp
-  USE radial_grids,  ONLY : ndmx, series
-  IMPLICIT NONE
-
-  !<apsi> from lderiv.f90
-  INTEGER ::        &
-       lam,    &   ! the angular momentum
-       nc,     &   ! counter on logarithmic derivatives
-       is,     &   ! counter on spin
-       ierr,   &   ! used for allocation control
-       ios,    &   ! used for I/O control
-       n,ie        ! generic counter
-
-  real(DP) ::            &
-       aux(ndmx),         & ! the square of the wavefunction
-       aux_dir(ndmx,2),   & ! the square of the wavefunction
-       ze2,              & ! the nuclear charge in Ry units
-       e,                & ! the eigenvalue
-       j                   ! total angular momentum for log_der
-
-  INTEGER  ::       &
-       nbf           ! number of b functions
-
-  real(DP) ::  &
-       jam,     &    ! the total angular momentum
-       lamsq,            & ! combined angular momentum
-       b(0:3),c(4),      & ! used for starting guess of the solution
-       b0e, rr1,rr2,     & ! auxiliary
-       xl1, x4l6, ddx12, &
-       x6l12, x8l20
-
-  real(DP) :: &
-       vaux(ndmx),     &  ! auxiliary: the potential
-       al(ndmx)           ! the known part of the differential equation
-
-  real(DP), EXTERNAL :: int_0_inf_dr
-
-  INTEGER :: &
-       ib,jb,iib,jjb, &  ! counters on beta functions
-       nst,nstop,     &  ! auxiliary for integrals
-       ind               ! counters on index
-
-  REAL ( dp ) :: r1, r2, thrdum = 0.0_dp
-
-  INTEGER :: ns, outer_r_radial_index, n_idx, ik, i, r_write_max_index
-  INTEGER :: ik_stop
-  REAL ( dp ) :: factor, rcut_match, max_val
-  REAL ( dp ) :: wfc_ae_recon2(ndmx,nwfsx)
-  REAL ( dp ) :: wfc_ps_recon2(ndmx,nwfsx)
-  REAL ( dp ) :: de
-  REAL ( dp ), ALLOCATABLE :: f_ae(:), f_ps(:)
-
-  IF ( verbosity == 'high' ) THEN
-     WRITE ( stdout, '( 3A )' ) &
-          "     ------------------------", &
-          " (GI)PAW reconstruction ", &
-          "-------------------------"
-  ENDIF
-  IF ( nld > nwfsx ) &
-       CALL errore ( 'calculate_gipaw_orbitals', 'nld is too large', 1 )
-
-  vaux(:) = 0.0_dp
-  ze2=-zed*2.0_dp
-
-  ! Choose a radius for the normalisation of all-electron wave functions
-  ! In principle the value for radius is arbitrary [apsi]
-  ik_stop = 10
-  DO n = 1, grid%mesh
-     IF ( grid%r(n) < 1.5 ) ik_stop = n
-  ENDDO
-
-  DO is=1,nspin
-
-     DO ns = 1, nwftsc(1)
-        lam = lltsc(ns,1)
-        j = 0.0_dp
-
-        DO n = 1, grid%mesh
-           IF ( grid%r(n) < 15.0 ) THEN
-              outer_r_radial_index = n
-           ENDIF
-        ENDDO
-
-        n_idx = -1
-        IF ( abs ( enltsc(ns,1) ) > 1e-8 ) THEN
-           e = enltsc(ns,1)
-           DO n = 1, nwf
-              IF ( eltsc(ns,1) == el(n) ) THEN
-                 n_idx = n
-              ENDIF
-           ENDDO
-        ELSE
-           DO n = 1, nwf
-              IF ( eltsc(ns,1) == el(n) ) THEN
-                 e = enl(n)
-                 n_idx = n
-              ENDIF
-           ENDDO
-        ENDIF
-
-        IF ( verbosity == 'high' ) THEN
-           WRITE ( stdout, '( /, 5X, 3A )') "========================= ", &
-                trim(el(n_idx)), &
-                " ========================="
-           WRITE ( stdout, * ) "     AE: e(ref), l, n_idx ", e, lam, n_idx
-        ENDIF
-
-           !
-           !    integrate outward up to ik_stop
-           !
-           IF (rel == 1) THEN
-              CALL lschps(3, zed, thrdum, grid, outer_r_radial_index, &
-                   1, lam, e, vpot(1,is), aux, nstop)
-           ELSEIF (rel == 2) THEN
-              CALL dir_outward(ndmx,outer_r_radial_index,lam,j,e,grid%dx,&
-                   aux_dir,grid%r,grid%rab,vpot(1,is))
-              aux(:)=aux_dir(:,1)
-           ELSE
-              CALL intref(lam,e,outer_r_radial_index,grid,vpot(1,is),ze2,aux)
-           ENDIF
-
-           wfc_ae_recon(:grid%mesh,n_idx) = aux(:grid%mesh)
-
-           ! Set the maximum to be +-1
-           wfc_ae_recon(:grid%mesh,n_idx) = wfc_ae_recon(:grid%mesh,n_idx) &
-                / maxval ( abs ( wfc_ae_recon(:ik_stop,n_idx) ) )
-
-     ENDDO
-
-  ENDDO
-  !</apsi> from lderiv.f90
-
-  !<apsi> from lderivps.f90
-
-  DO is = 1, nspin
-
-     IF ( .not. rel < 2 ) THEN
-        CALL errore ( 'calculate_gipaw_orbitals', &
-             'not implemented for rel >= 2', rel )
-     ENDIF
-
-     DO ns = 1, nwftsc(1)
-        lam = lltsc(ns,1)
-        jam=0.0_dp
-
-        xl1=lam+1
-        x4l6=4*lam+6
-        x6l12=6*lam+12
-        x8l20=8*lam+20
-        ddx12=grid%dx*grid%dx/12.0_dp
-        nst=(lam+1)*2
-        nbf=nbeta
-        IF (pseudotype == 1) THEN
-           IF (rel < 2 .or. lam == 0 .or. abs(jam-lam+0.5_dp) < 0.001_dp) THEN
-              ind=1
-           ELSEIF (rel==2 .and. lam>0 .and. abs(jam-lam-0.5_dp)<0.001_dp) THEN
-              ind=2
-           ENDIF
-           DO n=1,grid%mesh
-              vaux(n) = vpstot(n,is) + vnl(n,lam,ind)
-           ENDDO
-           nbf=0.0
-        ELSE
-           DO n=1,grid%mesh
-              vaux(n) = vpstot(n,is)
-           ENDDO
-        ENDIF
-
-        DO n=1,4
-           al(n)=vaux(n)-ze2/grid%r(n)
-        ENDDO
-        CALL series(al,grid%r,grid%r2,b)
-
-        IF ( abs ( enltsc(ns,1) ) > 1e-8 ) THEN
-           e = enltsc(ns,1)
-        ELSE
-           e = enlts(ns)
-        ENDIF
-
-        DO n = 1, nwftsc(1)
-           IF ( eltsc(n,1) == el(nstoaets(ns)) ) THEN
-              n_idx = n
-           ENDIF
-        ENDDO
-        IF ( verbosity == 'high' ) THEN
-           WRITE ( stdout, '( /, 5X, 3A )' ) "========================= ", &
-                trim(eltsc(ns,1)), &
-                " ========================="
-           WRITE ( stdout, * ) "     PS: e(ref), e(eig), n_idx ", &
-                e, enlts(ns), n_idx
-        ENDIF
-
-        rcut_match = -1.0_dp
-        DO n = 1, nwfs
-           ! If this one has already a core radius...
-           IF ( els(n) == el(nstoaets(ns)) ) THEN
-              rcut_match = rcutus(n)
-           ENDIF
-        ENDDO
-        IF ( rcut_match < 0.0_dp ) THEN
-           DO n = 1, nwfs
-              ! If there is one with the same l...
-              IF ( lltsc(ns,1) == lls(n) ) THEN
-                 rcut_match = rcutus(n)
-              ENDIF
-           ENDDO
-        ENDIF
-        IF ( rcut_match < 0.0_dp ) THEN
-           max_val = -1.0_dp
-           DO n = 1, grid%mesh
-              IF ( grid%r(n) < 5.0_dp &
-                   .and. abs ( wfc_ae_recon(n,n_idx) ) > max_val ) THEN
-                 rcut_match = grid%r(n)
-                 max_val = abs ( wfc_ae_recon(n,n_idx) )
-              ENDIF
-           ENDDO
-           ! In case over divergence
-           rcut_match = min ( rcut_match, 5.0_dp )
-        ENDIF
-        ik = 10
-        DO n = 1, grid%mesh
-           IF ( grid%r(n) < rcut_match ) ik = n
-        ENDDO
-        IF ( verbosity == 'high' ) THEN
-           WRITE ( stdout, * ) "     r(cut): ", rcut_match, ik, outer_r_radial_index
-        ENDIF
-
-        DO n = 1, grid%mesh
-           IF ( grid%r(n) < 15.0 ) THEN
-              outer_r_radial_index = n
-           ENDIF
-        ENDDO
-
-           lamsq=(lam+0.5_dp)**2
-           !
-           !     b) find the value of solution s in the first two points
-           !
-           b0e=b(0)-e
-           c(1)=0.5_dp*ze2/xl1
-           c(2)=(c(1)*ze2+b0e)/x4l6
-           c(3)=(c(2)*ze2+c(1)*b0e+b(1))/x6l12
-           c(4)=(c(3)*ze2+c(2)*b0e+c(1)*b(1)+b(2))/x8l20
-           r1 = grid%r(1)
-           r2 = grid%r(2)
-           rr1=(1.0_dp+r1*(c(1)+r1*(c(2)+r1*(c(3)+r1*c(4)))))*r1**(lam+1)
-           rr2=(1.0_dp+r2*(c(1)+r2*(c(2)+r2*(c(3)+r2*c(4)))))*r2**(lam+1)
-           aux(1)=rr1/grid%sqr(1)
-           aux(2)=rr2/grid%sqr(2)
-
-           DO n=1,grid%mesh
-              al(n)=( (vaux(n)-e)*grid%r2(n) + lamsq )*ddx12
-              al(n)=1.0_dp-al(n)
-           ENDDO
-
-           CALL integrate_outward (lam,jam,e,grid%mesh,ndmx,grid,al,b,aux, &
-                betas,ddd,qq,nbf,nwfsx,lls,jjs,ikk,outer_r_radial_index)
-           wfc_ps_recon(:grid%mesh,n_idx) = aux(:grid%mesh) &
-                * sqrt ( grid%r(:grid%mesh) )
-
-           DO n = 1, grid%mesh
-              IF ( grid%r(n) > 5.0 ) exit
-           ENDDO
-
-           IF ( abs ( wfc_ps_recon(ik,n_idx) ) < 1e-5 ) THEN
-              WRITE ( stdout, * ) "     Warning: ", wfc_ps_recon(ik,n_idx), ns
-              CALL errore ( "calculate_gipaw_orbitals", &
-                   "safer to stop here...", ik )
-           ENDIF
-
-           factor = wfc_ae_recon(ik,nstoaets(n_idx)) / wfc_ps_recon(ik,n_idx)
-           wfc_ps_recon(:grid%mesh,n_idx) = wfc_ps_recon(:grid%mesh,n_idx) &
-                * factor
-
-           IF ( verbosity == 'high' ) THEN
-              WRITE ( stdout, * ) "     SCALE: ", &
-                   wfc_ae_recon(ik,nstoaets(n_idx)) &
-                   / wfc_ps_recon(ik,n_idx), grid%r(ik), factor
-              WRITE ( stdout, * ) "     SCALE: ", &
-                   wfc_ae_recon(ik+5,nstoaets(n_idx)) &
-                   / wfc_ps_recon(ik+5,n_idx),grid%r(ik+5)
-
-              ALLOCATE ( f_ae(grid%mesh), f_ps(grid%mesh) )
-
-              f_ae = wfc_ae_recon(:grid%mesh,nstoaets(n_idx)) ** 2
-              f_ps = wfc_ps_recon(:grid%mesh,n_idx) ** 2
-
-              ! Test the norm
-              nst = ( lam + 1 ) * 2
-              IF ( verbosity == 'high' ) THEN
-                 WRITE ( stdout, '(A,3F12.8)' ) "     NORM: ", &
-                      int_0_inf_dr ( f_ae, grid, ik, nst ), &
-                      int_0_inf_dr ( f_ps, grid, ik, nst )
-              ENDIF
-
-              DEALLOCATE ( f_ae, f_ps )
-           ENDIF
-
-        ENDDO
-
-  ENDDO
-  !</apsi> from lderivps.f90
-
-  IF ( verbosity == 'high' ) THEN
-     WRITE ( stdout, '( 3A )' ) &
-          "     ---------------------", &
-          " End of (GI)PAW reconstruction ", &
-          "---------------------"
-  ENDIF
-
-END SUBROUTINE calculate_gipaw_orbitals

Deleted: trunk/espresso/atomic/cfdsol.f90
===================================================================
--- trunk/espresso/atomic/cfdsol.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/cfdsol.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,135 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!   This routine is a f90 translation of the routine present in 
-!   Vanderbilt code.
-!
-!-----------------------------------------------------------------------
-!
-subroutine cfdsol(zz,yy,jj1,jj2,idim1)
-  !
-  !-----------------------------------------------------------------------
-  !
-  !     routine for solving coupled first order differential equations
-  !
-  !      d yy(x,1)
-  !      ---------   =  zz(x,1,1) * yy(x,1) + zz(x,1,2) * yy(2,1)
-  !         dx
-  !
-  !      d yy(x,2)
-  !      ---------   =  zz(x,2,1) * yy(x,1) + zz(x,2,2) * yy(2,1)
-  !         dx
-  !     
-  !
-  !     using fifth order predictor corrector algorithm
-  !
-  !     routine integrates from jj1 to jj2 and can cope with both cases
-  !     jj1 < jj2 and jj1 > jj2.  first five starting values of yy must 
-  !     be provided by the calling program.
-  !
-  !-----------------------------------------------------------------------
-  !
-  !
-  use kinds, only : DP
-  implicit none
-  integer :: idim1, jj1, jj2, ip
-  real(DP):: zz(idim1,2,2),yy(idim1,2)
-  real(DP):: fa(0:5),fb(0:5),abp(1:5),amc(0:4)
-  real(DP):: arp, brp
-
-  integer :: isgn, i, j
-  !
-  !
-  !-----------------------------------------------------------------------
-  !
-  !                   i n i t i a l i s a t i o n
-  !
-  !     decide whether integrating from:
-  !            left to right ---> isgn = + 1
-  !        or  right to left ---> isgn = - 1
-  !
-  isgn = ( jj2 - jj1 ) / iabs( jj2 - jj1 )
-  !
-  !     run some test just to be conservative
-  if ( isgn .eq. + 1 ) then
-     if ( jj1 .le. 5 .or. jj2 .gt. idim1 ) then
-        write(6,10) isgn,jj1,jj2,idim1
-        call errore('cfdsol','stopping jj1 to small or jj2 to large',1)
-     endif
-  elseif ( isgn .eq. - 1 ) then
-     if ( jj1 .ge. ( idim1 - 4 ) .or. jj2 .lt. 1 ) then
-        write(6,10) isgn,jj1,jj2,idim1
-        call errore('cfdsol','stopping jj1 to large or jj2 too small',1)
-     endif
-  else
-     write(6,10) isgn,jj1,jj2,idim1
-  endif
-
-10 format(' ***error in subroutine cfdsol',/,   &
-       &  ' isgn =',i2,' jj1 =',i5,' jj2 =',i5,' idim1 =',i5, &
-       &  ' are not allowed')
-  !
-  !     integration coefficients
-  !
-    abp(1) = 1901.0_dp / 720.0_dp
-    abp(2) = -1387.0_dp / 360.0_dp
-    abp(3) = 109.0_dp / 30.0_dp
-    abp(4) = -637.0_dp / 360.0_dp
-    abp(5) = 251.0_dp / 720.0_dp
-    amc(0) = 251.0_dp / 720.0_dp
-    amc(1) = 323.0_dp / 360.0_dp
-    amc(2) = -11.0_dp / 30.0_dp
-    amc(3) = 53.0_dp / 360.0_dp
-    amc(4) = -19.0_dp / 720.0_dp
-    !
-    !     set up the arrays of derivatives
-    do j = 1,5
-       ip = jj1 - isgn * j
-       fa(j) = zz(ip,1,1) * yy(ip,1) + zz(ip,1,2) * yy(ip,2)
-       fb(j) = zz(ip,2,1) * yy(ip,1) + zz(ip,2,2) * yy(ip,2)
-    enddo
-    !
-    !-----------------------------------------------------------------------
-    !
-    !                i n t e g r a t i o n  l o o p
-    !
-    do j = jj1,jj2,isgn
-       !
-       !       predictor (adams-bashforth)
-       !
-       arp = yy(j-isgn,1)
-       brp = yy(j-isgn,2)
-       do i = 1,5
-          arp = arp + DBLE(isgn) * abp(i) * fa(i)
-          brp = brp + DBLE(isgn) * abp(i) * fb(i)
-       enddo
-
-       fa(0) = zz(j,1,1) * arp + zz(j,1,2) * brp
-       fb(0) = zz(j,2,1) * arp + zz(j,2,2) * brp
-       !
-       !       corrector (adams-moulton)
-       !
-       yy(j,1) = yy(j-isgn,1)
-       yy(j,2) = yy(j-isgn,2)
-       do i = 0,4,1
-          yy(j,1) = yy(j,1) + DBLE(isgn) * amc(i) * fa(i)
-          yy(j,2) = yy(j,2) + DBLE(isgn) * amc(i) * fb(i)
-       enddo
-       !
-       !       book keeping
-       !
-       do i = 5,2,-1
-          fa(i) = fa(i-1)
-          fb(i) = fb(i-1)
-       enddo
-       fa(1) = zz(j,1,1) * yy(j,1) + zz(j,1,2) * yy(j,2)
-       fb(1) = zz(j,2,1) * yy(j,1) + zz(j,2,2) * yy(j,2)
-    enddo
-
-    return
-end subroutine cfdsol

Deleted: trunk/espresso/atomic/chargeps.f90
===================================================================
--- trunk/espresso/atomic/chargeps.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/chargeps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,107 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine chargeps(rho_i,phi_i,nwf_i,ll_i,jj_i,oc_i,iswf_i)
-  !---------------------------------------------------------------
-  !
-  !   calculate the (spherical) pseudo charge density 
-  !
-  use kinds, only: dp
-  use ld1_parameters, only: nwfsx
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid, pseudotype, qvan, nbeta, betas, lls, jjs, ikk,  &
-                    which_augfun, lpaw, qvanl, nspin
-  implicit none
-
-  integer :: &
-       nwf_i,        & ! input: the number of wavefunctions
-       iswf_i(nwfsx),& ! input: their spin
-       ll_i(nwfsx)     ! input: their angular momentum
-
-  real(DP) ::  &
-       jj_i(nwfsx), & ! input: their total angular momentum
-       oc_i(nwfsx), & ! input: the occupation
-       phi_i(ndmx,nwfsx), & ! input: the functions to add
-       rho_i(ndmx,2)   ! output: the (nspin) components of the charge
-
-  integer ::     &
-       is,     &   ! counter on spin
-       n,n1,n2,&   ! counters on beta and mesh function
-       ns,nst,ikl  ! counter on wavefunctions
-
-  real(DP) ::    &
-       work(nwfsx), & ! auxiliary variable for becp
-       int_0_inf_dr,& ! integration function
-       gi(ndmx)        ! used to compute the integrals
-
-
-  rho_i=0.0_dp
-  !
-  !    compute the square modulus of the eigenfunctions
-  !
-  do ns=1,nwf_i
-     if (oc_i(ns).gt.0.0_dp) then
-        is=iswf_i(ns)
-        do n=1,grid%mesh
-           rho_i(n,is)=rho_i(n,is)+oc_i(ns)*phi_i(n,ns)**2
-        end do
-     endif
-  enddo
-  !
-  !    if US pseudopotential compute the augmentation part
-  !
-  if (pseudotype.eq.3) then
-     do ns=1,nwf_i
-        if (oc_i(ns).gt.0.0_dp) then
-           is=iswf_i(ns)
-           do n1=1,nbeta
-              if (ll_i(ns).eq.lls(n1).and. &
-                   abs(jj_i(ns)-jjs(n1)).lt.1.e-7_dp) then
-                 nst=(ll_i(ns)+1)*2
-                 ikl=ikk(n1)
-                 do n=1,ikl
-                    gi(n)=betas(n,n1)*phi_i(n,ns)
-                 enddo
-                 work(n1)=int_0_inf_dr(gi,grid,ikl,nst)
-              else
-                 work(n1)=0.0_dp
-              endif
-           enddo
-           !
-           !   and adding to the charge density
-           !
-           do n1=1,nbeta
-              do n2=1,nbeta
-                 IF (which_augfun=='PSQ') then
-                    do n=1,grid%mesh
-                       rho_i(n,is)=rho_i(n,is)+qvanl(n,n1,n2,0)*oc_i(ns)* &
-                            work(n1)*work(n2)
-                    enddo
-                 ELSE
-                    do n=1,grid%mesh
-                       rho_i(n,is)=rho_i(n,is)+qvan(n,n1,n2)*oc_i(ns)* &
-                            work(n1)*work(n2)
-                    enddo
-                 ENDIF
-              enddo
-           enddo
-        endif
-     enddo
-  endif
-!
-!  Check for negative charge
-!
-  do is=1,nspin
-     do n=2,grid%mesh
-        if (rho_i(n,is)<-1.d-12) call errore('chargeps','negative rho',1)
-     enddo
-  enddo
-
-  return
-end subroutine chargeps

Deleted: trunk/espresso/atomic/compute_chi.f90
===================================================================
--- trunk/espresso/atomic/compute_chi.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_chi.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,265 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!--------------------------------------------------------------------------
-subroutine compute_chi(lam,ikk_in,phi_in,chi_out,xc,e,lbes4)
-  !--------------------------------------------------------------------------
-  !
-  !     This routine computes the chi functions:
-  !          |chi> = (\epsilon -T -V_{loc}) |psi>
-  !      
-  use io_global, only : stdout, ionode
-  use kinds, only : DP
-  use radial_grids, only: ndmx, series
-  use ld1inc, only:  grid, vpsloc, rho0, verbosity
-
-  implicit none
-  integer :: &
-       ikk_in,& ! the point after which the chi should be zero
-       lam      ! the angular momentum
-  logical :: &
-       lbes4 
-
-  real(DP) :: &
-       e,     &       ! input: the energy
-       xc(8), &       ! input: the coefficients of the bessel function
-       phi_in(ndmx), & ! input: pseudo wavefunction
-       chi_out(ndmx)   ! output: the chi function
-  !
-  real(DP) :: &
-       j1(ndmx), aux(ndmx), gi(ndmx),&
-       b(4),c(4), arow(ndmx),brow(ndmx),crow(ndmx),drow(ndmx), &
-       b0e, g0, g1, g2, &
-       r_clean,         &
-       ddx12,           &
-       x4l6,            &
-       x6l12,           &
-       int_0_inf_dr,    &
-       integral
-
-  integer :: &
-       n, nstart, nst
-  !
-  !   RRKJ: first expand in a taylor series the phis function
-  !   Since we know that the phis functions are a sum of Bessel 
-  !   functions with coefficients xc, we compute analytically
-  !   the asymptotic expansion
-  !
-  !
-  ddx12=grid%dx*grid%dx/12.0_dp
-  x4l6=4*lam+6
-  x6l12=6*lam+12
-
-  do n=1,6
-     j1(n)=phi_in(n)/grid%r(n)**(lam+1)
-  enddo
-  call seriesbes(j1,grid%r,grid%r2,6,c)
-  !
-  if (lam == 0) then
-     if(lbes4.or.rho0.eq.0.0_dp)then
-        c(1)=xc(1)+xc(2)+xc(3)
-        c(2)=0.0_dp
-        c(3)=-xc(1)*(xc(4)**2/6.0_dp) &
-             -xc(2)*(xc(5)**2/6.0_dp) &
-             -xc(3)*(xc(6)**2/6.0_dp)
-        c(4)=0.0_dp
-     else
-        c(1)=xc(1)+xc(2)+xc(3)+xc(4)
-        c(2)=0.0_dp
-        c(3)=-xc(1)*(xc(5)**2/6.0_dp)  &
-             -xc(2)*(xc(6)**2/6.0_dp)  &
-             -xc(3)*(xc(7)**2/6.0_dp)  &
-             -xc(4)*(xc(8)**2/6.0_dp)
-        c(4)=0.0_dp
-     endif
-  elseif (lam == 3) then
-     c(1)=xc(1)*(48.0_dp*xc(4)**3/5040.0_dp)+   &
-          xc(2)*(48.0_dp*xc(5)**3/5040.0_dp)+   &
-          xc(3)*(48.0_dp*xc(6)**3/5040.0_dp)
-     c(2)=0.0_dp
-     c(3)=-xc(1)*(192.0_dp*xc(4)**5/362880.0_dp)  &
-          -xc(2)*(192.0_dp*xc(5)**5/362880.0_dp)  &
-          -xc(3)*(192.0_dp*xc(6)**5/362880.0_dp)
-     c(4)=0.0_dp
-  elseif (lam == 2) then
-     c(1)=xc(1)*(xc(4)**2/15.0_dp)+   &
-          xc(2)*(xc(5)**2/15.0_dp)+   &
-          xc(3)*(xc(6)**2/15.0_dp)
-     c(2)=0.0_dp
-     c(3)=-xc(1)*(xc(4)**4/210.0_dp)  &
-          -xc(2)*(xc(5)**4/210.0_dp)  &
-          -xc(3)*(xc(6)**4/210.0_dp)
-     c(4)=0.0_dp
-  elseif (lam == 1) then
-     c(1)=xc(1)*(xc(4)/3.0_dp)+  &
-          xc(2)*(xc(5)/3.0_dp)+  &
-          xc(3)*(xc(6)/3.0_dp)
-     c(2)=0.0_dp
-     c(3)=-xc(1)*(xc(4)**3/30.0_dp) &
-          -xc(2)*(xc(5)**3/30.0_dp) &
-          -xc(3)*(xc(6)**3/30.0_dp)
-     c(4)=0.0_dp
-  else
-     call errore('compute_chi','lam not programmed',1) 
-  endif
-  !
-  !     and the potential
-  !
-  do n=1,4
-     j1(n)=vpsloc(n)
-  enddo
-  if (abs(j1(1)-j1(4))>1.d-12) then
-      call series(j1,grid%r,grid%r2,b)
-  else
-     b=0.0_dp
-     b(1)=j1(1)
-  endif
-  !
-  !   and compute the taylor expansion of the chis
-  !
-  b0e=(b(1)-e)
-
-  g0=x4l6*c(3)-b0e*c(1)
-  g1=x6l12*c(4)-c(1)*b(2)
-  g2=-(b0e*c(3)+b(3)*c(1))
-  nstart=5
-  do n=1,nstart-1
-     chi_out(n)= (g0+grid%r(n)*(g1+g2*grid%r(n)))*grid%r(n)**(lam+3)/grid%sqr(n)
-  enddo
-  do n=1,grid%mesh
-     aux(n)= (g0+grid%r(n)*(g1+g2*grid%r(n)))
-  enddo
-  !
-  !    set up the equation
-  !
-  do n=1,grid%mesh
-     gi(n)=phi_in(n)/grid%sqr(n)
-  enddo
-  do n=1,grid%mesh
-     j1(n)=grid%r2(n)*(vpsloc(n)-e)+(lam+0.5_dp)**2
-     j1(n)=1.0_dp-ddx12*j1(n)
-  enddo
-
-  do n=nstart,grid%mesh-3
-     drow(n)= gi(n+1)*j1(n+1)   &
-            + gi(n)*(-12.0_dp+10.0_dp*j1(n))+ &
-              gi(n-1)*j1(n-1)
-
-     brow(n)=10.0_dp*ddx12
-     crow(n)=ddx12
-     arow(n)=ddx12
-  enddo
-  drow(nstart)=drow(nstart)-ddx12*chi_out(nstart-1)
-  chi_out(grid%mesh-2)=0.0_dp
-  chi_out(grid%mesh-1)=0.0_dp
-  chi_out(grid%mesh)=0.0_dp
-  !
-  !    and solve it
-  !
-  call tridiag(arow(nstart),brow(nstart),crow(nstart), &
-       drow(nstart),chi_out(nstart),grid%mesh-3-nstart)
-  !
-  !   put the correct normalization and r dependence
-  !  
-  do n=1,grid%mesh
-     chi_out(n)=chi_out(n)*grid%sqr(n)/grid%r2(n)
-     !         if(lam.eq.0)
-     !     +    write(stdout,'(5(e20.13,1x))')
-     !     +          r(n),chi_out(n),chi_out(n)/r(n)**(lam+1),
-     !     +          aux(n),aux(n)*r(n)**(lam+1)
-  enddo
-  !
-  !    smooth close to the origin with asymptotic expansion
-  !
-  do n=nstart,grid%mesh
-     if (abs(chi_out(n)/grid%r(n)**(lam+1)-aux(n))  &
-          .lt.1.e-3_dp*abs(aux(n)) ) goto 100
-     chi_out(n)=aux(n)*grid%r(n)**(lam+1)
-  enddo
-
-100 if (n.eq.grid%mesh+1.or.grid%r(min(n,grid%mesh)).gt.0.05_dp)then
-     write(stdout,*) lam,n,grid%mesh,grid%r(min(n,grid%mesh))
-     call errore('compute_chi','n is too large',1)
-  endif
-!
-!    When the input wavefunction is a diverging scattering state 
-!    this routine might become numerically unstable at large r. 
-!    Here chi_out should be 0.0 but it is not due to this instability. 
-!    We now clean chi_out when phi_in > 20.0.
-!    Clean also after 7.0 a.u..
-!     
-  r_clean=100.d0
-  do n=1,grid%mesh
-     if (abs(phi_in(n))>20.0_DP) then
-        r_clean=grid%r(n)
-        exit
-     endif
-  enddo
-  r_clean=min(r_clean,7.0_DP)
-  if (r_clean<grid%r(ikk_in)) &
-     call errore ('compute_chi ','phi_in too large before r_c', 1)
-
-  do n=grid%mesh,1,-1
-     if (grid%r(n).lt.r_clean) goto 200
-     chi_out(n)=0.0_dp
-  enddo
-200 continue
-     !    check that the chi are zero beyond ikk
-  nst=0
-  gi=0.0_dp
-  do n=ikk_in+1,grid%mesh
-     gi(n)=chi_out(n)**2
-  enddo
-  do n=min(ikk_in+20,grid%mesh),grid%mesh
-     chi_out(n)=0.0_dp
-  enddo
-  integral=int_0_inf_dr(gi,grid,grid%mesh,nst)
-  if (integral > 2.e-6_dp) then
-      write(stdout, '(5x,'' l='',i4, '' integral='',f15.9, &
-           & '' r(ikk) '',f15.9)') lam, integral, grid%r(ikk_in)
-      IF (verbosity=='high') THEN
-         do n=ikk_in,grid%mesh
-            write(stdout,*) grid%r(n),gi(n)
-         enddo
-      ENDIF
-     call errore ('gener_pseudo ','chi too large beyond r_c', 1)
-  endif
-  return
-end subroutine compute_chi
-
-
-subroutine tridiag(a,b,c,r,u,n)
-  !
-  !     See Numerical Recipes.
-  !
-  use kinds, only : DP
-  implicit none
-
-  integer :: n
-  real(DP) :: a(n),b(n),c(n),r(n),u(n)
-  real(DP) :: gam(n), bet
-
-  integer j
-
-  if (abs(b(1)).lt.1.e-10_DP)  &
-       call errore('tridiag','b(1) is too small',1)
-
-  bet=b(1)
-  u(1)=r(1)/bet
-  do j=2,n
-     gam(j)=c(j-1)/bet
-     bet=b(j)-a(j)*gam(j)
-     if (abs(bet) < 1.e-10_DP) &
-          call errore('tridiag','bet is too small',1)
-     u(j)=(r(j)-a(j)*u(j-1))/bet
-  enddo
-  do j=n-1,1,-1
-     u(j)=u(j)-gam(j+1)*u(j+1)
-  enddo
-  return
-end subroutine tridiag

Deleted: trunk/espresso/atomic/compute_chi_tm.f90
===================================================================
--- trunk/espresso/atomic/compute_chi_tm.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_chi_tm.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,53 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!--------------------------------------------------------------------------
-subroutine compute_chi_tm(lam,ik,ikk_in,phi_in,chi_out,xc,e)
-  !--------------------------------------------------------------------------
-  !
-  !     This routine computes the chi functions:
-  !          |chi> = (\epsilon -T -V_{loc)) |psi>
-  !      
-  use kinds, only : DP
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid, vpot, vpsloc
-
-  implicit none
-  integer :: &
-       ik,    & ! the point corresponding to rc
-       ikk_in,& ! the point after which the chi should be zero
-       lam      ! the angular momentum
-
-  real(DP) :: &
-       e,     &       ! input: the energy
-       xc(8),       & ! input: the parameters of the fit
-       phi_in(ndmx), & ! input: pseudo wavefunction
-       chi_out(ndmx)   ! output: the chi function
-  !
-  real(DP) :: &
-       dpoly           
-
-  real(DP), external :: pr, d2pr, dpr
-
-  integer :: &
-       n
-  !
-  !   Troullier-Martins: use the analytic formula
-  !
-  do n=1,ik
-     dpoly = dpr(xc,xc(7),grid%r(n))
-     ! dpr =  first derivate of polynomial pr
-     ! d2pr= second derivate of polynomial pr
-     chi_out(n) = (e + (2*lam+2)/grid%r(n)*dpoly + &
-             d2pr(xc,xc(7),grid%r(n)) + dpoly**2 - vpsloc(n))*phi_in(n)
-  enddo
-  do n = ik+1,grid%mesh
-     chi_out(n) = (vpot(n,1) - vpsloc(n))*phi_in(n)
-  enddo
-  return
-end subroutine compute_chi_tm

Deleted: trunk/espresso/atomic/compute_phi.f90
===================================================================
--- trunk/espresso/atomic/compute_phi.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_phi.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,265 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-subroutine compute_phi(lam,ik,chir,phi_out,xc,iflag,occ,e,els_in)
-  !--------------------------------------------------------------------------
-  !
-  !     This routine computes the phi functions by pseudizing the
-  !     all_electron chi functions. In input it receives, the point
-  !     ik where the cut is done, the angular momentum lam,
-  !     and the all electron wavefunction
-  !
-  !
-  !      
-  use io_global, only : stdout
-  use kinds, only : DP
-  use constants, only: pi
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid, tm, rho0
-  implicit none
-
-  integer ::    &
-       lam,  &   ! input: the angular momentum
-       ik,   &   ! input: the point corresponding to rc
-       iflag     ! input: if 1 print the message
-
-  real(DP) :: &
-       xc(8), &  ! output: the coefficients of the Bessel functions
-       occ,   &  ! input: the occupation of the level
-       e         ! input: the energy of the level
-
-  real(DP) ::       &
-       chir(ndmx),   &    ! input: the all-electron function
-       phi_out(ndmx)      ! output: the phi function
-
-  character(len=2) :: els_in  ! input: the label of the state
-  !
-  real(DP) :: &
-       fae,    & ! the value of the all-electron function
-       f1ae,   & ! its first derivative
-       f2ae,   & ! the second derivative
-       wmax,   & !
-       den,    & ! denominator
-       faenor    ! the norm of the function
-
-  integer ::    &
-       isign,   &! sign of the max of the ae-wfc
-       n, nst, nnode, nc, nc1, ij
-
-  real(DP) :: &
-       gi(ndmx), j1(ndmx,4), &
-       jnor, psnor, fact(4), &
-       cm(10), bm(4), &
-       delta, a, b, c, deter, gamma, &
-       lamda0, lamda3, lamda4, mu0, mu4, s0, s4, t0, t4
-
-  real(DP), external :: deriv_7pts, deriv2_7pts, int_0_inf_dr
-  integer ::  &
-       iok,   &  ! number of nodes
-       nbes      ! number of Bessel functions to be used
-
-  !
-  !   decide whether to use 4 Bessel functions or 3 (default)
-  !
-  if ( (rho0 /= 0.0_dp) .and. (lam == 0) ) then
-     nbes = 4
-  else
-     nbes = 3
-  end if
-  !
-  nst=(lam+1)*2
-  !
-  !   compute the first and second derivative of all-electron function
-  !
-  fae=chir(ik)
-  f1ae=deriv_7pts(chir,ik,grid%r(ik),grid%dx)
-  f2ae=deriv2_7pts(chir,ik,grid%r(ik),grid%dx)
-  !
-  !   compute the norm of the all-electron function
-  !
-  do n=1,ik+1
-     gi(n)=chir(n)**2  
-  enddo
-  faenor=int_0_inf_dr(gi,grid,ik,nst)
-  !
-  !
-  !   RRKJ: the pseudo-wavefunction is written as an expansion into (3 or 4) 
-  !         spherical bessel functions for r < r_c
-  !   find q_i with the correct log derivatives
-     
-  call find_qi(f1ae/fae,xc(nbes+1),ik,lam,nbes,1,iok)
-  if (iok.ne.0) &
-     call errore('compute phi','problem with the q_i coefficients',1)
-  !
-  !    compute the bessel functions
-  !
-  do nc=1,nbes
-     call sph_bes(ik+5,grid%r,xc(nbes+nc),lam,j1(1,nc))
-     jnor=j1(ik,nc)*grid%r(ik)
-     fact(nc)=chir(ik)/jnor
-     do n=1,ik+5
-        j1(n,nc)=j1(n,nc)*grid%r(n)*chir(ik)/jnor
-     enddo
-  enddo
-  !
-  !    compute the bm functions (second derivative of the j1)
-  !    and the integrals for cm
-  !
-  ij=0
-  do nc=1, nbes
-     bm(nc)=deriv2_7pts(j1(1,nc),ik,grid%r(ik),grid%dx)
-     do nc1=1,nc
-        ij=ij+1
-        do n=1,ik
-           gi(n)=j1(n,nc)*j1(n,nc1)
-        enddo
-        cm(ij)=int_0_inf_dr(gi,grid,ik,nst)
-     enddo
-  enddo
-     !
-     !    solve the second order equation
-     !
-  if (nbes == 4) then
-     wmax=0.0_dp
-     do n=1,grid%mesh
-        if (abs(chir(n)) > wmax .and. grid%r(n) < 4.0_dp) then
-           wmax=abs(chir(n))
-           if(chir(n).lt.0.0_dp)then
-              isign=-1
-           else
-              isign=+1
-           endif
-        endif
-     enddo
-     lamda0=(f2ae-bm(1))/(bm(2)-bm(1))
-     lamda3=(bm(3)-bm(1))/(bm(2)-bm(1))
-     lamda4=(bm(4)-bm(1))/(bm(2)-bm(1))
-     den=abs(occ)
-     mu0=(isign*sqrt(rho0*4.0_dp*pi/den) &
-          -fact(1)+fact(1)*lamda0-fact(2)*lamda0)  &
-          /(fact(1)*lamda3-fact(1)-fact(2)*lamda3+fact(3))
-     mu4=(fact(1)*lamda4-fact(1)-fact(2)*lamda4+fact(4)) &
-          /(fact(1)*lamda3-fact(1)-fact(2)*lamda3+fact(3))
-     s0=lamda0-mu0*lamda3
-     s4=lamda4-mu4*lamda3
-     t0=1.0_dp-lamda0+mu0*lamda3-mu0
-     t4=1.0_dp+mu4*lamda3-mu4-lamda4
-
-     a=cm(1)*t4**2+cm(3)*s4**2+cm(6)*mu4**2+cm(10)  &
-          +2.0_dp*cm(4)*t4*mu4+2.0_dp*cm(2)*t4*s4+2.0_dp*cm(5)*s4*mu4 &
-          -2.0_dp*cm(7)*t4-2.0_dp*cm(8)*s4-2.0_dp*cm(9)*mu4
-        
-     b=-2.0_dp*cm(1)*t0*t4-2.0_dp*cm(3)*s0*s4-2.0_dp*cm(6)*mu0*mu4  &
-          -2.0_dp*cm(4)*t0*mu4-2.0_dp*cm(4)*t4*mu0-2.0_dp*cm(2)*t0*s4  &
-          -2.0_dp*cm(2)*t4*s0-2.0_dp*cm(5)*s0*mu4-2.0_dp*cm(5)*s4*mu0  &
-          +2.0_dp*cm(7)*t0+2.0_dp*cm(8)*s0+2.0_dp*cm(9)*mu0
-        
-     c=cm(1)*t0**2+cm(3)*s0**2+cm(6)*mu0**2+2.0_dp*cm(4)*t0*mu0 &
-          +2.0_dp*cm(2)*t0*s0+2.0_dp*cm(5)*s0*mu0-faenor
-        
-     deter=b**2-4.0_dp*a*c
-     if (deter < 0.0_dp) then
-        call infomsg ('compute phi','negative determinant') 
-        write(stdout,100) f1ae/fae, f2ae, faenor
-100        format(/5x,' ld= ',f10.6,' f2ae',f10.6,' faenor',f10.6)
-        iok=1
-        return
-     endif
-     
-     xc(4)=(-b+sqrt(deter))/(2.0_dp*a)
-     xc(3)=mu0-mu4*xc(4)
-     xc(2)=s0-s4*xc(4)
-     xc(1)=t0-t4*xc(4)
-     !
-     
-     do n=1,ik
-        phi_out(n)= xc(1)*j1(n,1) + xc(2)*j1(n,2)  &
-                  + xc(3)*j1(n,3) + xc(4)*j1(n,4)
-     enddo
-  else
-     gamma=(bm(3)-bm(1))/(bm(2)-bm(1))
-     delta=(f2ae-bm(1))/(bm(2)-bm(1))
-       
-     a=(gamma-1.0_dp)**2*cm(1)+gamma**2*cm(3)  &
-          -2.0_dp*gamma*(gamma-1.0_dp)*cm(2) &
-          +2.0_dp*(gamma-1.0_dp)*cm(4)-2.0_dp*gamma*cm(5)+cm(6)
-        
-     b=2.0_DP*(1.0_dp-delta)*(gamma-1.0_dp)*cm(1) &
-          -2.0_dp*gamma*delta*cm(3) &
-          -2.0_dp*gamma*(1.0_dp-delta)*cm(2) &
-          +2.0_dp*delta*(gamma-1.0_dp)*cm(2) & 
-          +2.0_dp*(1.0_dp-delta)*cm(4)+2.0_dp*delta*cm(5)
-        
-     c=-faenor+(1.0_dp-delta)**2*cm(1)+delta**2*cm(3) &
-          +2.0_dp*delta*(1.0_dp-delta)*cm(2)
-     
-     deter=b**2-4.0_dp*a*c
-     if (deter < 0.0_dp) then
-        call infomsg ('compute phi','negative determinant') 
-        write(stdout,110) f1ae/fae, f2ae, faenor
-110        format (/5x,' ld= ',f10.6,' f2ae',f10.6, ' faenor',f10.6)
-        iok=1
-        return
-     endif
-     
-     xc(3)=(-b+sqrt(deter))/(2.0_dp*a)
-     xc(2)=-xc(3)*gamma+delta
-     xc(1)=1.0_dp-xc(2)-xc(3)
-     
-     do n=1,ik
-        phi_out(n)= xc(1)*j1(n,1) + xc(2)*j1(n,2) &
-                  + xc(3)*j1(n,3)
-     enddo
-
-  endif
-  do nc=1,nbes
-     xc(nc)=xc(nc)*fact(nc)
-  enddo
-  !
-  !      for r > r(ik) the pseudo and all-electron psi(r) coincide
-  !
-  do n=ik+1,grid%mesh
-     phi_out(n)= chir(n)
-  enddo
-  !
-  !      check for the norm of the pseudo wavefunction
-  !
-  do n=1,ik
-     gi(n)=phi_out(n)**2
-  enddo
-  psnor=int_0_inf_dr(gi,grid,ik,nst)
-
-  if (iflag == 1) then
-     write(stdout,130) els_in,grid%r(ik),2.0_dp*xc(6)**2 
-130  format (/ /5x, ' Wfc  ',a3,'  rcut=',f6.3, &
-          '  Estimated cut-off energy= ', f11.2,' Ry')
-     if (nbes == 4) write(stdout,140) rho0
-140     format (5x,' Using 4 Bessel functions for this wfc,', &
-                ' rho(0) =',f6.3)
-     ! write(stdout,'(5x," AE norm = ",f6.3,"  PS norm = ",f6.3)') faenor, psnor
-  end if
-  !
-  !      check for absence of nodes in the pseudo wavefunction
-  !
-  nnode=0  
-  do n=1,ik+1
-     if ( phi_out(n) .ne. sign(phi_out(n),phi_out(n+1)) ) then
-        if (iflag==1) write(stdout,150) lam,grid%r(n)
-150     format (5x,'l=',i4,' Node at ',f10.8)
-        nnode=nnode+1
-     endif
-  enddo
-  iok=nnode
-  if (iflag == 1) then
-     write(stdout,160) nnode,grid%r(ik)
-160 format (5x,' This function has ',i4,' nodes', ' for 0 < r < ',f8.3)
-     if (nnode>0) call errore('compute_phi','phi has nodes before r_c',1)
-  endif
-
-  return
-end subroutine compute_phi

Deleted: trunk/espresso/atomic/compute_phi_tm.f90
===================================================================
--- trunk/espresso/atomic/compute_phi_tm.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_phi_tm.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,94 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-subroutine compute_phi_tm(lam,ik,chir,phi_out,iflag,xc,e,els_in)
-  !--------------------------------------------------------------------------
-  !
-  !     This routine computes the phi functions by pseudizing the
-  !     all_electron chi functions. In input it receives, the point
-  !     ik where the cut is done, the angular momentum lam,
-  !     and the all electron wavefunction
-  !
-  !
-  !      
-  use io_global, only : stdout
-  use kinds, only : DP
-  use constants, only: pi
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid, vpot
-  implicit none
-
-  integer ::    &
-       lam,  &   ! input: the angular momentum
-       ik,   &   ! input: the point corresponding to rc
-       iflag     ! input: if 1 print the message
-
-  real(DP) :: &
-       e         ! input: the energy of the level
-
-  real(DP) ::       &
-       xc(8),       &    ! output: parameters of the fit
-       chir(ndmx),   &    ! input: the all-electron function
-       phi_out(ndmx)      ! output: the phi function
-
-  character(len=2) :: els_in  ! input: the label of the state
-  !
-  real(DP) :: &
-       faenor    ! the norm of the function
-
-  integer ::    &
-       n, nst
-
-  real(DP) :: &
-       gi(ndmx), &
-       cn(6), c2
-
-  real(DP), external :: deriv_7pts, deriv2_7pts, int_0_inf_dr, pr
-  !
-  !
-  !   compute the norm of the all-electron function
-  !
-  nst=(lam+1)*2
-  do n=1,ik+1
-     gi(n)=chir(n)**2  
-  enddo
-  faenor=int_0_inf_dr(gi,grid,ik,nst)
-  !
-  !
-  ! TM: the pseudo-wavefunction is written as polynomial times exponential
-  !
-  call find_coefficients &
-          (ik, chir, e, grid%r, grid%dx, faenor, vpot, cn, c2, lam, grid%mesh)
-  do n=1,ik
-     phi_out(n)=sign(grid%r(n)**(lam+1)*exp(pr(cn,c2,grid%r(n))),chir(ik))
-  end do
-  xc(1:6) = cn(:)
-  xc(7) = c2
-  !
-  !      for r > r(ik) the pseudo and all-electron psi(r) coincide
-  !
-  do n=ik+1,grid%mesh
-     phi_out(n)= chir(n)
-  enddo
-  !
-  !      check for the norm of the pseudo wavefunction
-  !
-!  do n=1,ik
-!     gi(n)=phi_out(n)**2
-!  enddo
-!  psnor=int_0_inf_dr(gi,grid,ik,nst)
-! write(stdout,'(5x," AE norm = ",f6.3,"  PS norm = ",f6.3)') faenor, psnor
-
-  if (iflag == 1) then
-     write(stdout,120) els_in, grid%r(ik)
-120  format (/ /5x, ' Wfc  ',a3,'  rcut=',f6.3, &
-       '  Using Troullier-Martins method ')
-  end if
-
-  return
-end subroutine compute_phi_tm

Deleted: trunk/espresso/atomic/compute_phius.f90
===================================================================
--- trunk/espresso/atomic/compute_phius.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_phius.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,116 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-      subroutine compute_phius(lam,ik,psi_in,phi_out,xc,iflag,els_in)
-!--------------------------------------------------------------------------
-!
-!     This routine computes the phi functions by pseudizing the
-!     all_electron chi functions. In input it receives, the point
-!     ik where the cut is done, the angular momentum lam,
-!     and the correspondence with the all eletron wavefunction
-!
-!
-!
-use kinds, only: dp
-use io_global, only : stdout
-use radial_grids, only: ndmx
-use ld1inc, only: grid, verbosity
-  implicit none
-
-      real(DP) :: &
-             psi_in(ndmx), & ! input: the norm conserving wavefunction
-             phi_out(ndmx)   ! output: the us wavefunction
-
-      character(len=2) :: els_in
-
-      real(DP) :: &
-               fae,    & ! the value of the all-electron function
-               f1ae,   & ! its first derivative
-               xc(8),  & ! the coefficients of the fit
-               f2ae      ! the second derivative
-
-      integer :: &
-               ik, &     ! the point corresponding to rc
-               iflag, &  ! if 1 print
-               iok,   &  ! if 0 there are no problem
-               lam       ! the angular momentum
-
-
-      real(DP) :: &
-               bm(2),  &              ! the derivative of the bessel
-               fact(2), &             ! factor of normalization
-               j1(ndmx,8)             ! the bessel functions
-     
-      real(DP) :: &
-            deriv_7pts, deriv2_7pts
-
-
-      integer :: &
-               n, &        ! counter on mesh points
-               nc         ! counter on bessel
-
-      xc=0.0_dp
-!
-!    compute first and second derivative
-!
-      fae=psi_in(ik)
-      f1ae=deriv_7pts(psi_in,ik,grid%r(ik),grid%dx)
-      f2ae=deriv2_7pts(psi_in,ik,grid%r(ik),grid%dx)
-!
-!    find the q_i of the bessel functions
-!      
-      call find_qi(f1ae/fae,xc(4),ik,lam,2,1,iok)
-      if (iok.ne.0) &
-             call errore('compute_phius','problems with find_qi',1)
-!
-!    compute the functions
-!
-      do nc=1,2
-         call sph_bes(ik+5,grid%r,xc(3+nc),lam,j1(1,nc))
-         fact(nc)=psi_in(ik)/(j1(ik,nc)*grid%r(ik))
-         do n=1,ik+5
-            j1(n,nc)=j1(n,nc)*grid%r(n)*fact(nc)
-         enddo
-      enddo
-!
-!    compute the second derivative and impose continuity of zero, 
-!    first and second derivative
-!
-       
-      do nc=1,2
-            bm(nc)=deriv2_7pts(j1(1,nc),ik,grid%r(ik),grid%dx)
-      enddo
-
-      xc(2)=(f2ae-bm(1))/(bm(2)-bm(1))
-      xc(1)=1.0_dp-xc(2)
-      if (iflag.eq.1) then
-         write(stdout,110) els_in,grid%r(ik),2.0_dp*xc(5)**2
-110      format (5x, ' Wfc-us ',a3,' rcutus=',f6.3, &
-                '  Estimated cut-off energy= ', f8.2,' Ry')
-         if (verbosity=='high') then
-           write (stdout,'(5x,a)') 'rc*logder, xc(1), xc(2), rc*q(1),rc*q(2)'
-           write (stdout,'(7f12.5)') grid%r(ik)*f1ae/fae,xc(1:2),xc(4:5)*grid%r(ik)
-         endif
-      endif
-!
-!    define the phis function
-!
-      do n=1,ik
-         phi_out(n)=xc(1)*j1(n,1)+xc(2)*j1(n,2)
-      enddo
-
-      do n=ik+1,grid%mesh
-         phi_out(n)=psi_in(n)
-      enddo
-
-      do nc=1,2
-         xc(nc)=xc(nc)*fact(nc)
-      enddo
-
-      return
-      end subroutine compute_phius

Deleted: trunk/espresso/atomic/compute_potps.f90
===================================================================
--- trunk/espresso/atomic/compute_potps.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_potps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,93 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-      SUBROUTINE compute_potps(ik,v_in,v_out,xc)
-!--------------------------------------------------------------------------
-!
-!     This routine computes the pseudized pseudopotential by pseudizing the
-!     all_electron potential. In input it receives, the point
-!     ik where the cut is done.
-!
-use kinds, only: dp
-use radial_grids, only: ndmx
-use ld1inc, only: grid
-IMPLICIT NONE
-
-REAL(DP) :: &
-         v_in(ndmx), & ! input: the potential to pseudize
-         v_out(ndmx),& ! output: the pseudized potential
-         xc(8)        ! output: the coefficients of the fit
-
-INTEGER :: &
-         ik        ! input: the point corresponding to rc
-
-REAL(DP) :: &
-         p1aep1, p1aem1, &
-         fae,    & ! the value of the all-electron function
-         f1ae,   & ! its first derivative
-         f2ae      ! the second derivative
-
-REAL(DP) :: &
-         bm(2),  &              ! the derivative of the bessel
-         fact(2), &             ! factor of normalization
-         j1(ndmx,8)              ! the bessel functions
-     
-REAL(DP) :: &
-         deriv_7pts, deriv2_7pts
-
-INTEGER :: &
-         iok, &  ! if 0 there are no problem
-         n,   &  ! counter on mesh points
-         nc      ! counter on bessel
-!
-!    compute first and second derivative
-!
-fae=v_in(ik)
-f1ae=deriv_7pts(v_in,ik,grid%r(ik),grid%dx)
-f2ae=deriv2_7pts(v_in,ik,grid%r(ik),grid%dx)
-!
-!    find the q_i of the bessel functions
-!      
-CALL find_qi(f1ae/fae,xc(4),ik,0,2,0,iok)
-IF (iok.NE.0) &
-        CALL errore('compute_potps','problems with find_qi',1)
-!
-!    compute the functions
-!
-DO nc=1,2
-   call sph_bes(ik+1,grid%r,xc(3+nc),0,j1(1,nc))
-   fact(nc)=v_in(ik)/j1(ik,nc)
-   DO n=1,ik+1
-      j1(n,nc)=j1(n,nc)*fact(nc)
-   ENDDO
-ENDDO
-!
-!    compute the second derivative and impose continuity of zero, 
-!    first and second derivative
-!
-DO nc=1,2
-   p1aep1=(j1(ik+1,nc)-j1(ik,nc))/(grid%r(ik+1)-grid%r(ik))
-   p1aem1=(j1(ik,nc)-j1(ik-1,nc))/(grid%r(ik)-grid%r(ik-1))
-   bm(nc)=(p1aep1-p1aem1)*2.0_dp/(grid%r(ik+1)-grid%r(ik-1))
-ENDDO
-
-xc(2)=(f2ae-bm(1))/(bm(2)-bm(1))
-xc(1)=1.0_dp-xc(2)
-!
-!    define the v_out function
-!
-DO n=1,ik
-   v_out(n)=xc(1)*j1(n,1)+xc(2)*j1(n,2)
-ENDDO
-
-DO n=ik+1,grid%mesh
-   v_out(n)=v_in(n)
-ENDDO
-
-RETURN
-END SUBROUTINE compute_potps

Deleted: trunk/espresso/atomic/compute_potps_new.f90
===================================================================
--- trunk/espresso/atomic/compute_potps_new.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_potps_new.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,161 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-SUBROUTINE compute_potps_new(ik,v_in,v_out,xc)
-   !--------------------------------------------------------------------------
-   !
-   !     This routine computes the local pseudopotential by smoothing the
-   !     all_electron potential. In input it receives, the point
-   !     ik where the cut is done.
-   !
-   !     The smooth potential has the following form for r < rc
-   !
-   !     V(r) = A + B * f( q * r)
-   !
-   !     where f(x) = [a*a*sen(x)/x - sen(a*x)/(a*x)]/[a*a-1]
-   !
-   !     V,V' and V'' are matched to the ae value in rc and 
-   !     both V'(0) and V''(0) vanish.
-   !
-   !     According to Troulier and Martins this is an optimal choice for
-   !     rapidly converging and transferable potentials.
-   !
-   use kinds, only: dp
-   use radial_grids, only: ndmx
-   use ld1inc, only: grid
-   IMPLICIT NONE
-   REAL(DP), PARAMETER :: a =  .707106781186547 !=sqrt(0.5_dp) ! the parameter defining f(x)
-
-   REAL(DP) :: &
-         v_in(ndmx), & ! input: the potential to pseudize
-         v_out(ndmx),& ! output: the pseudized potential
-         xc(8)        ! output: the coefficients of the fit
-
-   INTEGER :: &
-         ik        ! input: the point corresponding to rc
-
-   REAL(DP) :: &
-         fae,    & ! the value of the all-electron function
-         f1ae,   & ! its first derivative
-         f2ae      ! the second derivative
-
-   REAL(DP) :: &
-         AA,     & ! the matching value
-         deriv,  &  ! auxilairy quantities
-         j1(ndmx,2) ! auxiliary functions
-     
-   REAL(DP) :: &
-         deriv_7pts, deriv2_7pts
-
-   INTEGER :: &
-         n,   &  ! counter on mesh points
-         nc      ! counter on bessel
-   !
-   !    compute first and second derivative
-   !
-   fae=v_in(ik)
-   f1ae=deriv_7pts(v_in,ik,grid%r(ik),grid%dx)
-   f2ae=deriv2_7pts(v_in,ik,grid%r(ik),grid%dx)
-   !
-   ! set the matching value
-   !
-   AA = f2ae*grid%r(ik)/f1ae
-   ! find the solution
-   call find_matching_x(AA,xc(5))
-   ! rescale the solution
-   xc(5) = xc(5)/grid%r(ik)
-   xc(4) = sqrt(0.5_dp)*xc(5)
-   ! build the auxiliary functions const and f(x)
-   DO nc=1,2
-      call sph_bes(ik+1,grid%r,xc(3+nc),0,j1(1,nc))
-   end do
-   j1(1:ik+1,2) = 0.5_dp * j1(1:ik+1,2) - j1(1:ik+1,1)
-   j1(1:ik+1,1) = 1.0_dp
-   ! determine A and B
-   deriv = 0.5_dp *(j1(ik+1,2)-j1(ik,2))/(grid%r(ik+1)-grid%r(ik)) +  &
-           0.5_dp *(j1(ik,2)-j1(ik-1,2))/(grid%r(ik)-grid%r(ik-1))
-   xc(2) = f1ae / deriv
-   xc(1) = fae - xc(2) * j1(ik,2)
-   !
-   ! define the v_out function
-   !
-   DO n=1,ik
-      v_out(n)=xc(1)*j1(n,1)+xc(2)*j1(n,2)
-   ENDDO
-   DO n=ik+1,grid%mesh
-      v_out(n)=v_in(n)
-   ENDDO
-
-   RETURN
-
-CONTAINS
-
-   SUBROUTINE find_matching_x(AA,x)
-      real(dp) :: x, AA
-      real(dP) :: aa_min, aa_max, aa_test, xmin, xmax, xtest, dx
-      !
-      dx = 0.1_dp
-      !
-      xmin = 0._dp
-      aa_min = 3._dp - AA
-      IF (aa_min < 0._dp) CALL errore('compute_potps_new', &
-                               'unable to find a solution.. try lloc=-1',1)
-      xmax = dx
-      call fz(xmax, AA, aa_max)
-      ! bracket the first solution
-      do while (aa_min * aa_max >0)
-         xmin   = xmax
-         aa_min = aa_max
-         xmax   = xmin + dx
-         call fz(xmax, AA, aa_max)
-      end do
-      ! refine by bisection
-      do while (abs(aa_max-aa_min) > 1.d-8) 
-         xtest= (xmax+xmin)/2.d0
-         call fz(xtest, AA, aa_test)
-         if (aa_test * aa_max > 0 ) then
-            aa_max = aa_test
-            xmax = xtest
-         else
-            aa_min = aa_test
-            xmin = xtest
-         endif
-      end do
-      x = (xmax+xmin)/2.d0
-      return
-   END SUBROUTINE find_matching_x
-   !
-   ! the auxiliary target function  x*f''(x)/f'(x)-AA
-   SUBROUTINE fz(x,AA,aa_f)
-      use kinds, only: dp
-      real(dp) :: x, AA, aa_f
-      real(dp) :: fs, f1s, f2s, fac
-      real(dp) :: gs, g1s, g2s, xx
-      fac = 1._dp/(a*a-1._dp)
-      call ffz(x,fs,f1s,f2s)
-      xx = a*x
-      call ffz(xx,gs,g1s,g2s)
-      fs = fac*(a*a*fs-gs)
-      f1s= fac*(a*a*f1s-a*g1s)
-      f2s= fac*(a*a*f2s-a*a*g2s)
-      aa_f = x * f2s / f1s - AA
-      return
-   END SUBROUTINE
-   !
-   ! the first bessel function and its derivatives
-   SUBROUTINE ffz(x,fs,f1s,f2s)
-      use kinds, only: dp
-      implicit none
-      real(dp) :: x, fs, f1s, f2s
-      fs  = (sin(x))/x
-      f1s = (x*cos(x)-sin(x))/x**2
-      f2s = (-x*x*sin(x) - 2*x*cos(x) + 2*sin(x))/x**3
-      return
-   END SUBROUTINE ffz
-
-END SUBROUTINE compute_potps_new

Deleted: trunk/espresso/atomic/compute_q_3bess.f90
===================================================================
--- trunk/espresso/atomic/compute_q_3bess.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_q_3bess.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,126 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-subroutine compute_q_3bess(ldip,lam,ik,chir,phi_out,ecutrho)
-  !--------------------------------------------------------------------------
-  !
-  !   This routine computes the phi_out function by pseudizing the
-  !   chir function with a linear combination of three Bessel functions
-  !   multiplied by r**2. In input it receives the point
-  !   ik where the cut is done, the angular momentum lam of the 
-  !   bessel functions and the function chir.
-  !   Phi_out has the same ldip dipole moment of chir.
-  !
-  !      
-  use kinds, only : DP
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid
-  implicit none
-
-  integer ::    &
-       ldip,    & ! input: the order of the dipole
-       lam,     & ! input: the angular momentum
-       ik         ! input: the point corresponding to rc
-
-  real(DP) :: &
-       xc(8)      ! output: the coefficients of the Bessel functions
-
-  real(DP) ::         &
-       chir(ndmx),    &   ! input: the all-electron function
-       phi_out(ndmx)      ! output: the phi function
-  !
-  real(DP) ::  &
-       ecutrho,& ! the expected cut-off on the charge density for this q
-       fae,    & ! the value of the all-electron function
-       f1ae,   & ! its first derivative
-       f2ae,   & ! the second derivative
-       dip       ! the norm of the function
-
-  integer ::    &
-       n, nst, nc
-
-  real(DP) :: &
-       gi(ndmx), j1(ndmx,3), jnor, cm(3), bm(3), delta, gam
-
-  real(DP), external :: deriv_7pts, deriv2_7pts, int_0_inf_dr
-
-  integer ::  &
-       iok,   &  ! flag
-       nbes      ! number of Bessel functions to be used
-
-  nbes = 3
-  !
-  nst=lam+2+ldip
-  !
-  !   compute the first and second derivative of input function at r(ik)
-  !
-  fae=chir(ik)
-  f1ae=deriv_7pts(chir,ik,grid%r(ik),grid%dx)
-  f2ae=deriv2_7pts(chir,ik,grid%r(ik),grid%dx)
-  !
-  !   compute the ldip dipole moment of the input function
-  !
-  do n=1,ik+1
-     gi(n)=chir(n) * grid%r(n)**ldip  
-  enddo
-  dip=int_0_inf_dr(gi,grid,ik,nst)
-  !
-  !   RRKJ: the pseudo-wavefunction is written as an expansion into 3  
-  !         spherical Bessel functions for r < r(ik)
-  !   find q_i with the correct log derivatives
-  !   
-  call find_qi(f1ae/fae,xc(nbes+1),ik,ldip,nbes,2,iok)
- 
-  if (iok.ne.0) &
-     call errore('compute_q_3bess', 'problem with the q_i coefficients', 1)
-  !
-  !   compute the Bessel functions and multiply by r**2
-  !
-  do nc=1,nbes
-     call sph_bes(ik+5,grid%r,xc(nbes+nc),ldip,j1(1,nc))
-     jnor=j1(ik,nc)*grid%r2(ik)
-     do n=1,ik+5
-        j1(n,nc)=j1(n,nc)*grid%r2(n)*chir(ik)/jnor
-     enddo
-  enddo
-  !
-  !    compute the bm functions (second derivative of the j1)
-  !    and the ldip dipole moment of the Bessel function (cm)
-  !
-  do nc=1, nbes
-     bm(nc)=deriv2_7pts(j1(1,nc),ik,grid%r(ik),grid%dx)
-     do n=1,ik
-        gi(n)=j1(n,nc)*grid%r(n)**ldip
-     enddo
-     cm(nc)=int_0_inf_dr(gi,grid,ik,nst)
-  enddo
-  !
-  !    solve the linear system to find the coefficients
-  !
-  gam=(bm(3)-bm(1))/(bm(2)-bm(1))
-  delta=(f2ae-bm(1))/(bm(2)-bm(1))
-  !   
-  xc(3)= (dip-cm(1)+delta*(cm(1)-cm(2)))/(gam*(cm(1)-cm(2))+cm(3)-cm(1))
-  xc(2)=-xc(3)*gam+delta
-  xc(1)=1.0_dp-xc(2)-xc(3)
-  !
-  !  Set the function for r<=r(ik)
-  !
-  do n=1,ik
-     phi_out(n)= xc(1)*j1(n,1) + xc(2)*j1(n,2) + xc(3)*j1(n,3)
-  enddo
-  !
-  !  for r > r(ik) the function does not change
-  !
-  do n=ik+1,grid%mesh
-     phi_out(n)= chir(n)
-  enddo
-  ecutrho=2.0_dp*xc(6)**2
-
-  return
-end subroutine compute_q_3bess

Deleted: trunk/espresso/atomic/compute_relpert.f90
===================================================================
--- trunk/espresso/atomic/compute_relpert.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_relpert.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,115 +0,0 @@
-! 
-!--------------------------------------------
-subroutine compute_relpert( evel, edar, eso )
-  !------------------------------------------
-  !
-  ! Starting from the all-electron wave-functions and eigenvalues
-  ! (calculated with rel=0 and lsd=0), computes the relativistic
-  ! corrections to the eigenvalues in perturbation theory (in v/c).
-  !
-  ! For each wavefunction iwf:
-  !   evel(iwf): velocity (p^4) correction
-  !   edar(iwf): Darwin term
-  !   eso(iwf):  spin-orbit term 
-  !
-  ! Formulas and notation follow the Herman-Skillman book:
-  !
-  !  Herman, Frank and Skillman, Sherwood, "Atomic Structure Calculations", 
-  !  Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1963
-  ! 
-
-  use kinds, only : DP
-  use radial_grids, only : series
-  use ld1inc, only : rel, isic, zed, cau_fact, &
-                     grid, vpot, vsic, psi, &
-                     nwf, nn, ll, enl 
-  implicit none
-
-  ! output variables
-  real(DP), intent(out) :: evel(nwf), edar(nwf), eso(nwf)
-  ! local variables
-  integer :: nrx
-  integer :: iwf, l
-  real(DP) :: pre, relct1, relct2, b(0:3) 
-  real(DP) :: gvpot(grid%mesh), vtmp(grid%mesh), gtmp(grid%mesh)
-
-  real(DP), external :: int_0_inf_dr
-
-  nrx = grid%mesh
-  pre =  0.25_DP / cau_fact**2
-
-  if (isic.eq.0) then
-    ! calculate d/dr[ V(r) ], where V = V_ion + V_H + V_xc + V_ext
-    call grad_log(vpot(1:nrx,1),gvpot,grid%rm1(1:nrx),grid%dx,nrx,4)
-  endif
-
-  !!! loop on the wave functions
-  do iwf=1,nwf
-
-    l = ll(iwf) ! angular quantum number
-    
-    ! if SIC allowed, every wfc has a different potential
-    if (isic /= 0) then
-      ! calculate d/dr[ V(r) ], where V = V_ion + V_H + V_xc + V_ext
-      call grad_log(vpot(1:nrx,1)-vsic(1:nrx,iwf),gvpot,grid%rm1(1:nrx),grid%dx,nrx,2)
-    endif
-
-    ! if calculation has no relativistic terms (rel==0)
-    if (rel.eq.0) then
-      !
-      ! calculate velocity (p^4) correction
-      if (isic.eq.0) then
-        vtmp = (enl(iwf)-vpot(1:nrx,1))**2 * psi(1:nrx,1,iwf)**2
-      else 
-        vtmp = (enl(iwf)-vpot(1:nrx,1)-vsic(1:nrx,iwf))**2 * psi(1:nrx,1,iwf)**2
-      endif
-      evel(iwf) = pre * int_0_inf_dr(vtmp,grid,nrx,2*l)
-      !
-      ! compute Darwin term:
-      ! A) "hydrogrenoid" term (vanishes for ang. mom. GT 0)
-      if (l.eq.0) then
-        call series(psi(1:4,1,iwf)*grid%rm1(1:4),grid%r(1:4),grid%r2(1:4),b)
-        ! lim_{r\to 0}[ r^2 * dV/dr ] = 2*zed
-        relct1 = -zed * pre * b(0)*b(0)
-        !!!
-        ! exact value for hydrogenoid atom (one electron and isic=1)
-        !relct2 = -4._DP * pre * (zed)**4 / nn(iwf)**3
-        !!!
-      else
-        relct1 = 0._DP
-        !!!
-        !relct2 = 0._DP
-        !!!
-      endif
-      ! B)
-      ! calculate d/dr[ r^2 * dV/dr ]
-      vtmp = gvpot(1:nrx)*grid%r2(1:nrx)
-      ! third order polynomial extrapolation for the first point
-      call series(vtmp(2:5),grid%r(2:5),grid%r2(2:5),b)
-      vtmp(1) = b(0) + b(1)*grid%r(1) + b(2)*grid%r2(1) +&
-                b(3)*grid%r(1)*grid%r2(1)
-      call radial_gradient(vtmp,gtmp,grid%r(1:nrx),nrx,1)
-      vtmp = gtmp(1:nrx) * (psi(1:nrx,1,iwf)*grid%rm1(1:nrx))**2
-      ! in the hydrogenoid atom (one electron and isic=1), 
-      !  this term should be vanishing (xmin-> -\inf)
-      edar(iwf) = -0.5_DP * pre * int_0_inf_dr(vtmp,grid,nrx,2*l+1)
-      edar(iwf) = edar(iwf) + relct1
-      !
-    endif
-
-    ! compute spin-orbit term (only for ang. mom. greater than zero)
-    if (l.eq.0) then
-      eso(iwf) = 0._DP
-    else
-      if (rel.eq.0) then
-        vtmp = grid%rm1(1:nrx)*gvpot(1:nrx)*psi(1:nrx,1,iwf)**2
-        eso(iwf) = -1._DP * pre * int_0_inf_dr(vtmp,grid,nrx,2*l-1)
-      else
-         call errore('compute_relpert','not programmed for rel>0!!!',1)
-      endif
-    endif
-
-  enddo
-  !!! end loop on the wave functions
-
-end subroutine compute_relpert

Deleted: trunk/espresso/atomic/compute_solution.f90
===================================================================
--- trunk/espresso/atomic/compute_solution.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/compute_solution.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,175 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine compute_solution(lam,jam,e,mesh,ndm,grid,vpot,y,beta,ddd,&
-           qq,nbeta,nwfx,lls,jjs,ikk)
-  !---------------------------------------------------------------
-  !
-  !  numerical integration of the radial schroedinger equation for
-  !  bound states in a local potential.
-  !
-  !  This routine works at fixed e
-  !  It allows a nonlocal potential and an overlap
-  !  operator. Therefore it can solve a general schroedinger
-  !  equation necessary to solve a US pseudopotential
-  !
-  use io_global, only : stdout
-  use kinds, only : DP
-  use radial_grids, only: radial_grid_type, series
-
-  implicit none
-
-  type(radial_grid_type), intent(in) :: grid
-  integer :: &
-       lam, &      ! l angular momentum
-       mesh,&      ! size of radial mesh
-       ndm, &      ! maximum radial mesh 
-       nbeta,&     ! number of beta function  
-       nwfx, &     ! maximum number of beta functions
-       lls(nbeta),&! for each beta the angular momentum
-       ikk(nbeta) ! for each beta the point where it become zero
-
-  real(DP) :: &
-       e,       &  ! output eigenvalue
-       jam,     &  ! j angular momentum
-       vpot(mesh),&! the local potential 
-       y(mesh),  & ! the output solution
-       jjs(nwfx), & ! the j angular momentum
-       beta(ndm,nwfx),& ! the beta functions
-       ddd(nwfx,nwfx),qq(nwfx,nwfx) ! parameters for computing B_ij
-  !
-  !    the local variables
-  !
-  real(DP) :: &
-       ddx12,      &  ! dx**2/12 used for Numerov integration
-       sqlhf,      &  ! the term for angular momentum in equation
-       ze2,        &  ! possible coulomb term aroun the origin (set 0)
-       b(0:3),     &  ! coefficients of taylor expansion of potential
-       sum,       &! auxiliary 
-       yln, xp, expn,& ! used to compute the tail of the solution
-       int_0_inf_dr  ! integral function
-
-  real(DP), allocatable :: &
-       f(:),    &   ! the f function
-       el(:),c(:) ! auxiliary for inward integration
-
-  integer :: &
-       n,  &    ! counter on mesh points
-       ik,  &   ! matching point
-       ns,  &   ! counter on beta functions
-       l1,  &   ! lam+1
-       nst, &   ! used in the integration routine
-       ierr, &
-       nstart  ! starting point for inward integration
-
-   if (mesh.ne.grid%mesh) call errore('compute_solution','mesh dimension is not as expected',1)
-  !
-  !  set up constants and allocate variables the 
-  !
-  allocate(f(mesh), stat=ierr)
-  allocate(el(mesh), stat=ierr)
-  allocate(c(mesh), stat=ierr)
-
-  ddx12=grid%dx*grid%dx/12.0_dp
-  l1=lam+1
-  nst=l1*2
-  sqlhf=(DBLE(lam)+0.5_dp)**2
-  !
-  !  series developement of the potential near the origin
-  !
-  ze2=0.0_dp
-  do n=1,4
-     y(n)=vpot(n)-ze2/grid%r(n)
-  enddo
-  call series(y,grid%r,grid%r2,b)
-
-  !      write(stdout,*) 'eneter lam,eup,elw,e',lam,nbeta,eup,elw,e
-  !
-  !  set up the f-function and determine the position of its last
-  !  change of sign
-  !  f < 0 (approximatively) means classically allowed   region
-  !  f > 0         "           "        "      forbidden   "
-  !
-  ik=0
-  f(1)=ddx12*(grid%r2(1)*(vpot(1)-e)+sqlhf)
-  do n=2,mesh
-     f(n)=ddx12*(grid%r2(n)*(vpot(n)-e)+sqlhf)
-     if( f(n).ne.sign(f(n),f(n-1)).and.n.lt.mesh-5 ) ik=n
-  enddo
-  if (ik.eq.0.and.nbeta.eq.0) ik=mesh*3/4
-
-  if(ik.ge.mesh-2) then
-     do n=1,mesh
-        write(stdout,*) grid%r(n), vpot(n), f(n)
-     enddo
-     call errore('compute_solution', 'No point found for matching',1)
-  endif
-  !
-  !     determine if ik is sufficiently large
-  !
-  do ns=1,nbeta
-     if (lls(ns).eq.lam.and.ikk(ns).gt.ik) ik=ikk(ns)
-  enddo
-  !
-  !     if everything is ok continue the integration and define f
-  !
-  do n=1,mesh
-     f(n)=1.0_dp-f(n)
-  enddo
-  !
-  !  determination of the wave-function in the first two points by
-  !  series developement
-  !
-  call start_scheq( lam, e, b, grid, ze2, y )
-  !
-  !    outward integration before ik
-  !
-  call integrate_outward (lam,jam,e,mesh,ndm,grid,f, b,y,beta,ddd,qq,&
-       nbeta,nwfx,lls,jjs,ikk,ik)
-  !
-  !    inward integration up to ik
-  !
-  call integrate_inward(e,mesh,ndm,grid,f,y,c,el,ik,nstart)
-  !
-  !   exponential tail of the solution if it was not computed
-  !
-  if (nstart.lt.mesh) then
-     do n=nstart,mesh-1
-        if (y(n) == 0.0_dp) then
-           y(n+1)=0.0_dp
-        else
-           yln=log(abs(y(n)))
-           xp=-sqrt(12.0_dp*abs(1.0_dp-f(n)))
-           expn=yln+xp
-           if (expn.lt.-80.0_dp) then
-              y(n+1)=0.0_dp
-           else
-              y(n+1)=sign(exp(expn),y(n))
-           endif
-        endif
-     enddo
-  endif
-  !
-  !  normalize the eigenfunction and exit
-  !
-  do n=1,mesh
-     el(n)=grid%r(n)*y(n)*y(n)
-  enddo
-  sum=int_0_inf_dr(el,grid,mesh,nst)
-  sum=sqrt(sum)
-  do n=1,mesh
-     y(n)=grid%sqr(n)*y(n)/sum
-  enddo
-
-  deallocate(el)
-  deallocate(f )
-  deallocate(c )
-  return
-
-end subroutine compute_solution

Deleted: trunk/espresso/atomic/descreening.f90
===================================================================
--- trunk/espresso/atomic/descreening.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/descreening.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,118 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!--------------------------------------------------------------------------
-subroutine descreening
-  !--------------------------------------------------------------------------
-  !
-  !     This routine descreens the local potential and the ddd
-  !     coefficients (the latter only in the US case)
-  !     The charge density is computed with the test configuration,
-  !     not the one used to generate the pseudopotential
-  !      
-  use kinds, only: dp
-  use io_global, only : stdout, ionode, ionode_id
-  use mp,        only : mp_bcast
-  use radial_grids, only: ndmx
-  use ld1_parameters, only: nwfsx
-  use ld1inc, only: grid, nlcc, vxt, lsd, vpstot, vpsloc, file_screen, &
-                    vh, enne, rhoc, latt, rhos, enl, &
-                    nbeta, bmat, qvan, qvanl, jjs, lls, ikk, pseudotype, &
-                    nwfts, enlts, octs, llts, jjts, phits, nstoaets, lpaw, &
-                    which_augfun
-  implicit none
-
-  integer ::  &
-       ns,    &  ! counter on pseudo functions
-       ns1,   &  ! counter on pseudo functions
-       ib,jb, &  ! counter on beta functions
-       lam       ! the angular momentum
-
-  real(DP) :: &
-       vaux(ndmx,2)     ! work space
-
-  real(DP), external :: int_0_inf_dr ! the integral function
-
-  real(DP), parameter :: &
-       thresh= 1.e-12_dp          ! threshold for selfconsistency
-
-  integer  :: &
-       n, nst, iwork(nwfsx), ios, nerr
-  !
-  !     descreening the local potential: NB: this descreening is done with
-  !     the occupation of the test configuration. This is required
-  !     for pseudopotentials with semicore states. In the other cases
-  !     a test configuration equal to the one used for pseudopotential
-  !     generation is strongly suggested
-  !
-  do n=1,nwfts
-     enlts(n)=enl(nstoaets(n))
-  enddo
-  !
-  !    compute the pseudowavefunctions in the test configuration
-  !
-  call ascheqps_drv(vpsloc, 1, thresh, .false., nerr)
-  !
-  !    descreening the D coefficients
-  !
-  if (pseudotype.eq.3) then
-     do ib=1,nbeta
-        do jb=1,ib
-           if (lls(ib).eq.lls(jb).and.abs(jjs(ib)-jjs(jb)).lt.1.e-7_dp) then
-              lam=lls(ib)
-              nst=(lam+1)*2
-              IF (which_augfun=='PSQ') then
-                 do n=1,ikk(ib)
-                    vaux(n,1)=qvanl(n,ib,jb,0)*vpsloc(n)
-                 enddo
-              ELSE
-                 do n=1,ikk(ib)
-                    vaux(n,1)=qvan(n,ib,jb)*vpsloc(n)
-                 enddo
-              ENDIF
-              bmat(ib,jb)= bmat(ib,jb)  &
-                   - int_0_inf_dr(vaux(1,1),grid,ikk(ib),nst)
-           endif
-           bmat(jb,ib)=bmat(ib,jb)
-        enddo
-     enddo
-     write(stdout,'(/5x,'' The ddd matrix'')')
-     do ns1=1,nbeta
-        write(stdout,'(6f12.5)') (bmat(ns1,ns),ns=1,nbeta)
-     enddo
-  endif
-  !
-  !    descreening the local pseudopotential
-  !
-  iwork=1
-  call chargeps(rhos,phits,nwfts,llts,jjts,octs,iwork)
-
-  call new_potential(ndmx,grid%mesh,grid,0.0_dp,vxt,lsd,nlcc,latt,enne,&
-       rhoc,rhos,vh,vaux,1)
-
-  do n=1,grid%mesh
-     vpstot(n,1)=vpsloc(n)
-     vpsloc(n)=vpsloc(n)-vaux(n,1)
-  enddo
-
-  if (file_screen .ne.' ') then
-     if (ionode) &
-        open(unit=20,file=file_screen, status='unknown', iostat=ios, err=100 )
-100  call mp_bcast(ios, ionode_id)
-     call errore('descreening','opening file'//file_screen,abs(ios))
-     if (ionode) then
-        do n=1,grid%mesh
-           write(20,'(i5,7e12.4)') n,grid%r(n), vpsloc(n)+vaux(n,1), &
-                vpsloc(n), vaux(n,1), rhos(n,1)
-        enddo
-        close(20)
-     endif
-  endif
-
-  return
-end subroutine descreening

Deleted: trunk/espresso/atomic/dfx_new.f90
===================================================================
--- trunk/espresso/atomic/dfx_new.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/dfx_new.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,220 +0,0 @@
-!---------------------------------------------------------------------
-subroutine dfx_new(dchi0, vx)
-!---------------------------------------------------------------------
-#undef DEBUG 
-
-   use constants, only: pi
-   use kinds,     only: DP
-   use ld1_parameters, only : nwfx
-   use ld1inc,    only: nwf, nspin, oc, rho, psi, isw, grid
-   use radial_grids, only: ndmx, hartree
-   implicit none
-   ! 
-   ! I/O variables
-   !
-   real(DP) :: dchi0(ndmx,nwfx), vx(ndmx,2)
-   !
-   ! local variables
-   ! 
-   integer, parameter :: niterx = 12 ! 6, 12, 24
-   real(DP) :: drho0(ndmx,2),appchim1(ndmx,2), vslater(ndmx,2)
-   real(DP) :: int_0_inf_dr
-   real(DP) :: vvx(ndmx,2,niterx),drhox(ndmx,2,niterx), dvh(ndmx,2,niterx), &
-                    dvh0(ndmx,2), aux(ndmx), drho1(ndmx,2), dvh1(ndmx,2)
-   real(DP) :: a(niterx,niterx), inva(niterx,niterx), &
-                    b1(niterx), b2(niterx), c, c1, work(niterx), x(niterx), uno
-   integer :: iwork(niterx), info, iterx
-   integer :: i, j, jter, k, nu, is
-   real(DP) :: third, fac, capel
-   logical :: first = .true.
-   save first
-
-!-set the left hand side of the equation
-   call drho0ofvx(drho0,dchi0)
-
-   do is=1,nspin
-      call hartree(0,2,grid%mesh,grid,drho0(1,is),dvh0(1,is))
-   end do
-
-   aux(1:grid%mesh) = drho0(1:grid%mesh,1)*dvh0(1:grid%mesh,1)
-   if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) + &
-                               drho0(1:grid%mesh,2)*dvh0(1:grid%mesh,2) )
-   c = int_0_inf_dr(aux,grid,grid%mesh,2)
-
-   if (first) then
-!      first = .false.
-!-slater exchange potential
-      do is=1,nspin
-         vslater(1:grid%mesh,is) = 0.d0
-         do nu=1,nwf
-            if (isw(nu) == is) vslater(1:grid%mesh,is) = vslater(1:grid%mesh,is) + &
-                                    oc(nu)*psi(1:grid%mesh,1,nu)*dchi0(1:grid%mesh,nu)
-         end do
-         vslater(1:grid%mesh,is) = vslater(1:grid%mesh,is) / rho(1:grid%mesh,is)
-!         write (*,*) vslater(1:grid%mesh,is)
-       end do
-   else
-      vslater(1:grid%mesh,1:nspin) = vx(1:grid%mesh,1:nspin)
-   end if
-!- is a reasonable starting guess
-   call drhoofv(drho1,vslater)
-
-   drho1(1:grid%mesh,1:nspin) = drho1(1:grid%mesh,1:nspin) - drho0(1:grid%mesh,1:nspin)
-   do is=1,nspin
-      call hartree(0,2,grid%mesh,grid,drho1(1,is),dvh1(1,is))
-   end do
-   aux(1:grid%mesh) = drho1(1:grid%mesh,1) * dvh1(1:grid%mesh,1)
-   if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) + &
-                               drho1(1:grid%mesh,2) * dvh1(1:grid%mesh,2) )
-   c1 = int_0_inf_dr(aux,grid,grid%mesh,2)
-
-#ifdef DEBUG
-   write (*,'(a,2f16.10)') "C, C1 ", c, c1
-#endif
-
-!- simple Thomas-Fermi approximation to \chi^-1
-   third = 1.0d0/3.0d0
-   fac   = -(0.75d0*pi)**(2.0d0/3.0d0)
-   do is =1, nspin
-      appchim1(1:grid%mesh,is) = fac/(grid%r(1:grid%mesh)* &
-                            (nspin*rho(1:grid%mesh,is)*grid%r(1:grid%mesh))**third)
-   end do
-
-   drhox(1:grid%mesh,1:nspin,1) = drho1(1:grid%mesh,1:nspin)
-
-   if (c1 < 1.d-12 ) then
-      vx(1:grid%mesh,1:nspin) = vslater(1:grid%mesh,1:nspin) 
-      return
-   end if
-!- ITERATE !
-   do iterx =1,niterx
-!- set a new normalized correction vector vvx = chim1*drho/norm
-     
-      vvx(1:grid%mesh,1:nspin,iterx) = appchim1(1:grid%mesh,1:nspin) * &
-                                             drhox(1:grid%mesh,1:nspin,iterx)
-      do is=1,nspin
-         call hartree(0,2,grid%mesh,grid,vvx(1,is,iterx),dvh(1,is,iterx))
-      end do
-      aux(1:grid%mesh) =vvx(1:grid%mesh,1,iterx) * dvh(1:grid%mesh,1,iterx)
-      if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) +  &
-                                  vvx(1:grid%mesh,2,iterx) * dvh(1:grid%mesh,2,iterx) )
-      capel = int_0_inf_dr(aux,grid,grid%mesh,2)
-#ifdef DEBUG
-      write (*,*) "norm ", capel
-#endif
-      if (capel >0) then
-         capel = 1.d0/sqrt(capel)
-         vvx(1:grid%mesh,1:nspin,iterx) = vvx(1:grid%mesh,1:nspin,iterx) * capel
-      end if
-!- compute the corresponding drho
-      call drhoofv(drhox(1,1,iterx),vvx(1,1,iterx) )
-      do is =1,nspin
-         call hartree(0,2,grid%mesh,grid,drhox(1,is,iterx),dvh(1,is,iterx))
-      end do
-
-      aux(1:grid%mesh) = drhox(1:grid%mesh,1,iterx) * dvh1(1:grid%mesh,1)
-      if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) + &
-                                  drhox(1:grid%mesh,2,iterx) * dvh1(1:grid%mesh,2) )
-      b1(iterx) = int_0_inf_dr(aux,grid,grid%mesh,2)
-
-      aux(1:grid%mesh) = drho1(1:grid%mesh,1) * dvh(1:grid%mesh,1,iterx)
-      if (nspin==2) aux(1:grid%mesh) =  2.d0 * ( aux(1:grid%mesh) + &
-                                   drho1(1:grid%mesh,2) * dvh(1:grid%mesh,2,iterx) )
-      b2(iterx) = int_0_inf_dr(aux,grid,grid%mesh,2)
-
-      do jter =1,iterx
-     
-         aux(1:grid%mesh) = drhox(1:grid%mesh,1,iterx) * dvh(1:grid%mesh,1,jter)
-         if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) + &
-                                     drhox(1:grid%mesh,2,iterx)*dvh(1:grid%mesh,2,jter) )
-         a(iterx,jter) = int_0_inf_dr(aux,grid,grid%mesh,2)
-
-         aux(1:grid%mesh) = drhox(1:grid%mesh,1,jter) * dvh(1:grid%mesh,1,iterx)
-         if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) + &
-                                     drhox(1:grid%mesh,2,jter)*dvh(1:grid%mesh,2,iterx) )
-         a(jter,iterx) = int_0_inf_dr(aux,grid,grid%mesh,2)
-
-      end do
-      capel = 0.d0
-      do i=1,iterx
-         do j=1,iterx
-            capel = capel + abs(a(i,j)-a(j,i))
-            a(i,j) = 0.5d0*(a(i,j)+a(j,i))
-            a(j,i) = a(i,j)
-         end do
-      end do
-#ifdef DEBUG
-      write (*,'(a,12f16.10)') "CAPEL a  ", capel
-#endif
-  
-      inva = a
-
-      CALL DSYTRF('U', iterx, inva, niterx, iwork, work, niterx,info)
-      if (info.ne.0) stop 'factorization'
-      CALL DSYTRI( 'U', iterx, inva, niterx, iwork, work, info )
-      if (info.ne.0) stop 'DSYTRI'
-      forall ( i=1:iterx, j=1:iterx, j>i ) inva(j,i) = inva(i,j)
-
-!      write (*,*) "INVA "
-!      write (*,'(12f16.10)') inva
-      capel = 0.d0
-      do i=1,iterx
-         do j=1,iterx
-            uno = 0.d0
-            do k=1,iterx
-               uno = uno + a(i,k)*inva(k,j)
-            end do
-            if (i.eq.j) uno = uno - 1.d0
-            capel = capel + abs(uno)
-         end do
-      end do
-#ifdef DEBUG
-      write (*,'(a,12f16.10)') "CAPEL uno", capel
-#endif
-    
-      x = 0.d0
-      capel = c1
-      do i=1,iterx
-         do j=1,iterx
-            x(i) = x(i) - inva(i,j) * 0.5d0*(b1(j)+b2(j))
-         end do        
-         capel = capel + x(i) * (b1(i)+b2(i)) 
-         do j =1,i
-            capel = capel + x(i)*a(i,j)*x(j)
-         end do
-         do j =1,i-1
-            capel = capel + x(i)*a(j,i)*x(j)
-         end do
-      end do        
-!      write (*,'(a,12f16.10)') "X ", x
-#ifdef DEBUG
-      write (*,*) "capel       ", capel
-#endif
-
-
-      vx(1:grid%mesh,1:nspin) = vslater(1:grid%mesh,1:nspin)
-      do j=1,iterx
-         vx(1:grid%mesh,1:nspin) = vx(1:grid%mesh,1:nspin) + x(j) * vvx(1:grid%mesh,1:nspin,j)
-      end do
-
-      if (iterx.eq.niterx) return
-
-      call drhoofv(drhox(1,1,iterx+1), vx )
-      drhox(1:grid%mesh,1:nspin,iterx+1) = drhox(1:grid%mesh,1:nspin,iterx+1) - &
-                                      drho0(1:grid%mesh,1:nspin)
-      do is=1,nspin
-         call hartree(0,2,grid%mesh,grid,drhox(1,1,iterx+1),dvh(1,1,iterx+1))
-      end do
-
-      aux(1:grid%mesh) = drhox(1:grid%mesh,1,iterx+1)*dvh(1:grid%mesh,1,iterx+1)
-      if (nspin==2) aux(1:grid%mesh) = 2.d0 * ( aux(1:grid%mesh) + &
-                                  drhox(1:grid%mesh,1,iterx+1)*dvh(1:grid%mesh,1,iterx+1))
-      capel = int_0_inf_dr(aux,grid,grid%mesh,2)
-#ifdef DEBUG
-      write (*,*) "capel-check ", capel
-#endif
-!
-   end do
-!
-   return
-end subroutine dfx_new

Deleted: trunk/espresso/atomic/dir_outward.f90
===================================================================
--- trunk/espresso/atomic/dir_outward.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/dir_outward.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,181 +0,0 @@
-!
-! Copyright (C) 2002 Vanderbilt group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-! This routine has been modified in order to be compatible with the
-! ld1 code. The numerical algorithm is unchanged.
-! ADC Nov 2003
-! ADC Sep 2007 Clean-up
-!
-!-------------------------------------------------------------------------
-!
-subroutine dir_outward(idim1,mesh,lcur,jcur,e0,dx,snl,r,rab,ruae)
-!
-!     subroutine to compute solutions to the full dirac equation
-!
-!     the dirac equation in rydberg units reads:
-!
-!     df(r)     k                     alpha
-!     ----- = + - f(r) - ( e - v(r) ) ----- g(r)
-!      dr       r                       2
-!
-!     dg(r)     k                          4      alpha
-!     ----- = - - g(r) + ( e - v(r) +  -------- ) ----- f(r)
-!      dr       r                      alpha**2     2
-!
-!     where 
-!            alpha is the fine structure constant
-!            f(r) is r*minor component
-!            g(r) is r*major component
-!            k is quantum number 
-!               k = - (l+1)    if  j = l+0.5
-!               k = + l        if  j = l-0.5
-!     IMPORTANT: on output, snl(:,1) contains the MAJOR component
-!                           snl(:,2) contains the MINOR component
-!
-!----------------------------------------------------------------------------
-!
-use kinds, only : DP
-use ld1inc, only : cau_fact, zed
-implicit none
-integer :: idim1 
-real(DP) :: r(idim1),     &   ! the radial mesh
-                 rab(idim1),   &   ! derivative of the radial mesh
-                 ruae(idim1),  &   ! the all electron potential
-                 snl(idim1,2)       ! the wavefunction
-
-real(DP) :: e0,       &     ! the starting energy eigenvalue
-                 dx,       &     ! dx mesh value
-                 jcur            ! the j of the state
-                  
-integer ::  mesh,  &          ! the dimension of the mesh 
-            lcur              ! the l of the state
-
-real(DP) :: tbya, abyt,        &  
-                 zz(idim1,2,2),     &
-                 yy(idim1,2),       &
-                 gamma0,            &
-                 vzero,             &
-                 f0,f1,f2,g0,g1,g2, &
-                 ecur                
-real(DP) :: r2(idim1)
-
-integer :: ir,    &     ! counter
-           kcur         ! current k
-!
-!     r o u t i n e  i n i t i a l i s a t i o n
-!     set ( 2 / fine structure constant )
-!tbya = 2.0_DP * 137.04_DP
-tbya = 2.0_DP * cau_fact
-!     set ( fine structure constant / 2 )
-abyt = 1.0_DP / tbya
-
-r2=r**2
-
-if (abs(jcur-DBLE(lcur)-0.5_DP)<1.d-8) then
-    kcur = - ( lcur + 1 )
-else
-    kcur = lcur
-endif
-!
-!       set initial upper and lower bounds for the eigen value
-ecur=e0
-!
-yy = 0.0_DP
-!
-!         define the zz array
-!         ===================
-!
-do ir = 1,mesh
-   zz(ir,1,1) = rab(ir) * DBLE(kcur) / r(ir)
-   zz(ir,2,2) = - zz(ir,1,1)
-   zz(ir,1,2) = - rab(ir) * ( ecur - ruae(ir) )  * abyt
-   zz(ir,2,1) = - zz(ir,1,2) + rab(ir) * tbya
-enddo
-!
-!         ===========================================================
-!         analytic start up of minor and major components from origin
-!         ===========================================================
-!
-!         with finite nucleus so potential constant at origin we have
-!
-!         f(r) = sum_n f_n r ** ( ig + n )
-!         g(r) = sum_n g_n r ** ( ig + n )
-!
-!         with
-!
-!         f_n+1 = - (ecur-v(0)) * abyt * g_n / ( ig - kcur + n + 1 )
-!         g_n+1 = (ecur-v(0)+tbya**2 ) * abyt * f_n / ( ig + kcur + n + 1)
-!
-!         if kcur > 0  ig = + kcur , f_0 = 1 , g_0 = 0
-!         if kcur < 0  ig = - kcur , f_0 = 0 , g_1 = 1
-!
-!vzero = ruae(1) 
-!
-!         set f0 and g0
-!if ( kcur .lt. 0 ) then
-!   ig = - kcur
-!   f0 = 0
-!   g0 = 1
-!else
-!   ig = kcur
-!   f0 = 1
-!   g0 = 0
-!endif
-! 
-!f1 = - (ecur-vzero) * abyt * g0 / DBLE( ig - kcur + 1 )
-!g1 = (ecur-vzero+tbya**2) * abyt * f0 / DBLE( ig + kcur + 1 )
-!f2 = - (ecur-vzero) * abyt * g1 / DBLE( ig - kcur + 2 )
-!g2 = (ecur-vzero+tbya**2) * abyt * f1 / DBLE( ig + kcur + 2 )
-!
-!
-!do ir = 1,5
-!   yy(ir,1) = r(ir)**ig * ( f0 + r(ir) * ( f1 + r(ir) * f2 ) )
-!   yy(ir,2) = r(ir)**ig * ( g0 + r(ir) * ( g1 + r(ir) * g2 ) )
-!enddo
-!
-!  The following boundary conditions are for the Coulomb nuclear potential
-!  ADC 05/10/2007
-!
-vzero = ruae(1)+zed*2.0_DP/r(1)
-!
-gamma0=sqrt(kcur**2-4.0_DP*(abyt*zed)**2)
-if ( kcur .lt. 0 ) then
-   f0 = (kcur+gamma0)/(2.0_DP*abyt*zed)
-   g0 = 1.0_DP
-else
-   f0 = 1.0_DP
-   g0 = (kcur-gamma0)/(2.0_DP*abyt*zed)
-endif
-f1 = - (ecur-vzero) * abyt * g0 / ( gamma0 - kcur + 1 )
-g1 = (ecur-vzero+tbya**2) * abyt * f0 / ( gamma0 + kcur + 1 )
-f2 = - (ecur-vzero) * abyt * g1 / ( gamma0 - kcur + 2 )
-g2 = (ecur-vzero+tbya**2) * abyt * f1 / ( gamma0 + kcur + 2 )
-
-
-do ir = 1,5
-   yy(ir,1) = r(ir)**gamma0 * ( f0 + r(ir) * ( f1 + r(ir) * f2 ) )
-   yy(ir,2) = r(ir)**gamma0 * ( g0 + r(ir) * ( g1 + r(ir) * g2 ) )
-enddo
-
-!         ===========================
-!         outward integration to mesh
-!         ===========================
-!
-!         fifth order predictor corrector integration routine
-call cfdsol(zz,yy,6,mesh,idim1)
-!
-!         =======================================================
-!         copy the wavefunction 
-!         =======================================================
-!
-snl=0.0_DP
-do ir=1,mesh
-   snl(ir,2)=yy(ir,1)
-   snl(ir,1)=yy(ir,2)
-enddo
-return
-end subroutine dir_outward

Deleted: trunk/espresso/atomic/dirsol.f90
===================================================================
--- trunk/espresso/atomic/dirsol.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/dirsol.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,389 +0,0 @@
-!
-! Copyright (C) 2002 Vanderbilt group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-! This routine has been modified in order to be compatible with the
-! ld1 code. The numerical algorithm is unchanged.
-! ADC Nov 2003
-!
-!-------------------------------------------------------------------------
-!
-subroutine dirsol(idim1,mesh,ncur,lcur,jcur,it,e0,thresh,grid,snl,ruae,nstop)
-!
-!     subroutine to compute solutions to the full dirac equation
-!
-!     the dirac equation in rydberg units reads:
-!
-!     df(r)     k                     alpha
-!     ----- = + - f(r) - ( e - v(r) ) ----- g(r)
-!      dr       r                       2
-!
-!     dg(r)     k                          4      alpha
-!     ----- = - - g(r) + ( e - v(r) +  -------- ) ----- f(r)
-!      dr       r                      alpha**2     2
-!
-!     where 
-!            alpha is the fine structure constant
-!            f(r) is r*minor component
-!            g(r) is r*major component
-!            k is quantum number 
-!               k = - (l+1)    if  j = l+0.5
-!               k = + l        if  j = l-0.5
-!     IMPORTANT: on output, snl(:,1) contains the MAJOR component
-!                           snl(:,2) contains the MINOR component
-!
-!----------------------------------------------------------------------------
-!
-use io_global, only : stdout
-use kinds, only : DP
-use radial_grids, only: radial_grid_type
-use ld1inc, only : cau_fact, zed
-implicit none
-integer :: idim1 
-type(radial_grid_type),intent(in)::grid
-real(DP) :: ruae(idim1),  &   ! the all electron potential
-            snl(idim1,2)       ! the wavefunction
-
-real(DP) :: e0,       &     ! the starting energy eigenvalue
-                 jcur,     &     ! the j of the state
-                 thresh
-                  
-integer ::  mesh,  &          ! the dimension of the mesh 
-            it,    &          ! the iteration
-            ncur,  &          ! the n of the state
-            lcur              ! the l of the state
-
-real(DP) :: tbya, abyt,        &  
-                 emin, emax,        &
-                 zz(idim1,2,2),     &
-                 tolinf,alpha2,alpha,  &
-                 yy(idim1,2),       &
-                 vzero,             &
-                 f0,f1,f2,g0,g1,g2, &
-                 gout, gpout,       &
-                 gin, gpin,         &
-                 factor,gamma0,     &
-                 ecur,              &
-                 decur, decurp          
-real(DP) :: f(idim1), int_0_inf_dr
-
-integer :: itmax, &     ! maximum number of iterations
-           iter,  &     ! current iteration
-           ir,    &     ! counter
-           ig,    &     ! auxiliary
-           kcur,  &     ! current k
-           nctp,  &     ! index of the classical turning point
-           nodes, &     ! the number of nodes
-           ninf,  &     ! practical infinite
-           nstop        ! 0 if all ok, 1 otherwise
-!
-!               r o u t i n e  i n i t i a l i s a t i o n
-if (mesh.ne.grid%mesh) call errore('dirsol','mesh dimension is not as expected',1)
-nstop=0
-!
-!     set the maximum number of iterations for improving wavefunctions
-!
-itmax = 100
-!
-!     set ( 2 / fine structure constant )
-!tbya = 2.0_DP * 137.04_DP
-tbya = 2.0_DP * cau_fact
-
-!     set ( fine structure constant / 2 )
-abyt = 1.0_DP / tbya
-
-if (jcur.eq.lcur+0.5_DP) then
-    kcur = - ( lcur + 1 )
-else
-    kcur = lcur
-endif
-!
-!       set initial upper and lower bounds for the eigen value
-emin = - 1.0e10_DP
-emax = 1.0_DP
-ecur=e0
-!
-do iter = 1,itmax
-   yy = 0.0_DP
-!
-!         define the zz array
-!         ===================
-!
-  if ( iter .eq. 1 ) then
-    do ir = 1,mesh
-       zz(ir,1,1) = grid%rab(ir) * DBLE(kcur) / grid%r(ir)
-       zz(ir,2,2) = - zz(ir,1,1)
-    enddo
-  endif
-  do ir = 1,mesh
-     zz(ir,1,2) = - grid%rab(ir) * ( ecur - ruae(ir) ) * abyt
-     zz(ir,2,1) = - zz(ir,1,2) + grid%rab(ir) * tbya
-  enddo
-!
-!   ==============================================
-!   classical turning point and practical infinity
-!   ==============================================
-!
-  do nctp = mesh,10,-1
-     if ( zz(nctp,1,2) .lt. 0.0_DP ) goto 240
-  enddo
-  call errore('dirsol', 'no classical turning point found', 1)
-!
-!         jump point out of classical turning point loop
-240   continue
-
-  if ( nctp .gt. mesh - 10 ) then 
-!     write(stdout,*) 'State nlk=', ncur, lcur, kcur, nctp, mesh
-!     write(stdout,*) 'ecur, ecurmax=', ecur, ruae(mesh-10)
-     write(stdout,*) 'classical turning point too close to mesh',ncur,lcur,kcur
-     snl=0.0_DP
-     e0=e0-0.2_DP
-     nstop=1
-     goto 700
-  endif
-!
-  tolinf = log(thresh) ** 2
-  do ninf = nctp+10,mesh
-     alpha2 = (ruae(ninf)-ecur) * (grid%r(ninf) - grid%r(nctp))**2
-     if ( alpha2 .gt. tolinf ) goto 260
-  enddo
-!
-!         jump point out of practical infinity loop
-260     continue
-!
-  if (ninf.gt.mesh) ninf=mesh
-!
-!         ===========================================================
-!         analytic start up of minor and major components from origin
-!         ===========================================================
-!
-!         with finite nucleus so potential constant at origin we have
-!
-!         f(r) = sum_n f_n r ** ( ig + n )
-!         g(r) = sum_n g_n r ** ( ig + n )
-!
-!         with
-!
-!         f_n+1 = - (ecur-v(0)) * abyt * g_n / ( ig - kcur + n + 1 )
-!         g_n+1 = (ecur-v(0)+tbya**2 ) * abyt * f_n / ( ig + kcur + n + 1)
-!
-!         if kcur > 0  ig = + kcur , f_0 = 1 , g_0 = 0
-!         if kcur < 0  ig = - kcur , f_0 = 0 , g_1 = 1
-!
-!    Uncomment the following instruction if you need this boundary conditions
-!
-!  vzero = ruae(1) 
-!
-!         set f0 and g0
-!  if ( kcur .lt. 0 ) then
-!     ig = - kcur
-!     f0 = 0
-!     g0 = 1
-!  else
-!     ig = kcur
-!     f0 = 1
-!     g0 = 0
-!  endif
-! 
-!  f1 = - (ecur-vzero) * abyt * g0 / DBLE( ig - kcur + 1 )
-!  g1 = (ecur-vzero+tbya**2) * abyt * f0 / DBLE( ig + kcur + 1 )
-!  f2 = - (ecur-vzero) * abyt * g1 / DBLE( ig - kcur + 2 )
-!  g2 = (ecur-vzero+tbya**2) * abyt * f1 / DBLE( ig + kcur + 2 )
-!
-!
-!  do ir = 1,5
-!     yy(ir,1) = grid%r(ir)**ig * ( f0 + grid%r(ir) * ( f1 + grid%r(ir) * f2 ) )
-!     yy(ir,2) = grid%r(ir)**ig * ( g0 + grid%r(ir) * ( g1 + grid%r(ir) * g2 ) )
-!  enddo
-
-!
-!  The following boundary conditions are for the Coulomb nuclear potential
-!  ADC 05/10/2007
-!
-   vzero = ruae(1)+zed*2.0_DP/grid%r(1) 
-!
-  gamma0=sqrt(kcur**2-4.0_DP*(abyt*zed)**2)
-  if ( kcur .lt. 0 ) then
-     ig = - kcur
-     f0 = (kcur+gamma0)/(2.0_DP*abyt*zed)
-     g0 = 1.0_DP
-  else
-     ig = kcur
-     f0 = 1.0_DP
-     g0 = (kcur-gamma0)/(2.0_DP*abyt*zed)
-  endif
-! 
-  f1 = - (ecur-vzero) * abyt * g0 / ( gamma0 - kcur + 1.0_DP )
-  g1 = (ecur-vzero+tbya**2) * abyt * f0 / ( gamma0 + kcur + 1.0_DP )
-  f2 = - (ecur-vzero) * abyt * g1 / ( gamma0 - kcur + 2.0_DP )
-  g2 = (ecur-vzero+tbya**2) * abyt * f1 / ( gamma0 + kcur + 2.0_DP )
-!
-!
-  do ir = 1,5
-     yy(ir,1) = grid%r(ir)**gamma0*(f0+grid%r(ir)*(f1+grid%r(ir)*f2))
-     yy(ir,2) = grid%r(ir)**gamma0*(g0+grid%r(ir)*(g1+grid%r(ir)*g2))
-  enddo
-
-!         ===========================
-!         outward integration to nctp
-!         ===========================
-!
-!         fifth order predictor corrector integration routine
-  call cfdsol(zz,yy,6,nctp,idim1)
-!
-!         save major component and its gradient at nctp
-  gout = yy(nctp,2)
-  gpout = zz(nctp,2,1)*yy(nctp,1) + zz(nctp,2,2)*yy(nctp,2)
-  gpout = gpout / grid%rab(nctp)
-!
-!   ==============================================
-!   start up of wavefunction at practical infinity
-!   ==============================================
-!
-  do ir = ninf,ninf-4,-1
-     alpha = sqrt( ruae(ir) - ecur )
-     yy(ir,2) = exp ( - alpha * ( grid%r(ir) - grid%r(nctp) ) )
-     yy(ir,1) = ( DBLE(kcur)/grid%r(ir) - alpha ) * yy(ir,2)*tbya / &
-  &               ( ecur - ruae(ir) + tbya ** 2 )
-  enddo
-!
-!         ==========================
-!         inward integration to nctp
-!         ==========================
-!
-!         fifth order predictor corrector integration routine
-  call cfdsol(zz,yy,ninf-5,nctp,idim1)
-!
-!         save major component and its gradient at nctp
-  gin = yy(nctp,2)
-  gpin = zz(nctp,2,1)*yy(nctp,1) + zz(nctp,2,2)*yy(nctp,2)
-  gpin = gpin / grid%rab(nctp)
-!
-!
-!         ===============================================
-!         rescale tail to make major component continuous
-!         ===============================================
-!
-  factor = gout / gin
-  do ir = nctp,ninf
-     yy(ir,1) = factor * yy(ir,1)
-     yy(ir,2) = factor * yy(ir,2)
-  enddo
-!
-  gpin = gpin * factor
-!
-!         =================================
-!         check that the number of nodes ok
-!         =================================
-!
-!         count the number of nodes in major component
-  call nodeno(yy(1,2),1,ninf,nodes,idim1)
- 
-  if ( nodes .lt. ncur - lcur - 1 ) then
-!           energy is too low
-     emin = ecur
-!         write(stdout,*) 'energy too low'
-!         write(stdout,'(i5,3f12.5,2i5)') &
-!    &         iter,emin,ecur,emax,nodes,ncur-lcur-1
-     if ( ecur * 0.9_DP .gt. emax ) then
-         ecur = 0.5_DP * ecur + 0.5_DP * emax 
-     else
-         ecur = 0.9_DP * ecur
-     endif
-     goto 370
-  endif
-!
-  if ( nodes .gt. ncur - lcur - 1 ) then
-!           energy is too high
-     emax = ecur
-!         
-!         write(stdout,*) 'energy too high'
-!         write(stdout,'(i5,3f12.5,2i5)') &
-!    &         iter,emin,ecur,emax,nodes,ncur-lcur-1
-     if ( ecur * 1.1_DP .lt. emin ) then
-        ecur = 0.5_DP * ecur + 0.5_DP * emin
-     else
-        ecur = 1.1_DP * ecur
-     endif
-     goto 370
-  endif
-!
-!
-!         =======================================================
-!         find normalisation of wavefunction 
-!         =======================================================
-!
-   do ir = 1,ninf
-      f(ir) = (yy(ir,1)**2 + yy(ir,2)**2)
-   enddo
-   factor=int_0_inf_dr(f,grid,ninf,2*ig)
-!
-!
-!         =========================================
-!         variational improvement of the eigenvalue
-!         =========================================
-!
-   decur = gout * ( gpout - gpin ) / factor
-!
-!         to prevent convergence problems:
-!         do not allow decur to exceed 20% of | ecur |
-!         do not allow decur to exceed 70% of distance to emin or emax
-   if (decur.gt.0.0_DP) then
-      emin=ecur
-      decurp=min(decur,-0.2_DP*ecur,0.7_DP*(emax-ecur))
-   else
-      emax=ecur
-      decurp=-min(-decur,-0.2_DP*ecur,0.7_DP*(ecur-emin))
-   endif
-!
-!         write(stdout,'(i5,3f12.5,1p2e12.4)') &
-!    &         iter,emin,ecur,emax,decur,decurp
-!
-!         test to see whether eigenvalue converged
-   if ( abs(decur) .lt. thresh ) goto 400
- 
-   ecur = ecur + decurp
-!
-!         jump point from node check
-370  continue
-!
-!         =======================================================
-!         check that the iterative loop is not about to terminate
-!         =======================================================
-!
-   if ( iter .eq. itmax ) then
-!           eigenfunction has not converged in allowed number of iterations
-            
-!      write(stdout,999) it,ncur,lcur,jcur,e0,ecur
-!999   format('iter',i4,' state',i4,i4,f4.1,' could not be converged.',/,   &
-!    &      ' starting energy for calculation was',f10.5, &
-!    &      ' and end value =',f10.5)
-       write(stdout,*) 'state nlj',ncur,lcur,jcur, ' not converged'
-       snl=0.0_DP
-       nstop=1
-       goto 700
-   endif
-!
-!       close iterative loop
-enddo
-!
-!       jump point on successful convergence of eigenvalue
-400   continue
-!
-!   normalize the wavefunction and exit. Note also that in this routine
-!   yy(.,1) is the small component
-!   yy(.,2) is the large component
-!   
-!      
-snl=0.0_DP
-do ir=1,mesh
-   snl(ir,1)=yy(ir,2)/sqrt(factor)
-   snl(ir,2)=yy(ir,1)/sqrt(factor)
-enddo
-e0=ecur
-700 continue
-return
-end subroutine dirsol

Deleted: trunk/espresso/atomic/dmixp.f90
===================================================================
--- trunk/espresso/atomic/dmixp.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/dmixp.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,187 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!-------------------------------------------------------------------
-subroutine dmixp (nmsh,a,b,beta,tr2,in,id,r2,conv,itmax)
-  !-------------------------------------------------------------------
-  !
-  !     dmixp - written by k.c. pandey, apr. 1981. 
-  !     (heavily modified version - PG - last modified march 1996)
-  !
-  !     using anderson's extrapolation scheme
-  !     eqs. 4.1 - 4.9, eqs. 4.15 - 4.18 of:
-  !     donald g. anderson, j. assoc. computing machinery, 12, 547 (1965)
-  !     computes input vector for the next iteration
-  !
-  !---- input -------
-  !     nmsh = size of a and b
-  !     a = y(l) = new vector (potential)
-  !     b = x(l) = old vector
-  !     beta = mixing factor
-  !        in simple schemes one uses: new input = (1-beta)*b + beta*a
-  !     tr2 = convergence factor
-  !        if r2 < tr2  we assume convergence has been achieved
-  !        no new input vector is calculated
-  !     in = iteration number
-  !        even if id = 2 or 3, for in = 1
-  !        calculations are done as if id = 1
-  !        for in = 2 and id = 3, calculations are done as if id = 2
-  !     id = 1,2, or 3
-  !        depending on whether we want to use: only a and b; a, b and
-  !        the last iteration; a, b, and the last two iterations
-  !---- output --------
-  !     a = y(l)-x(l)
-  !     b = x(l+1) = new input vector (potential)
-  !     r2 = mean-square of (a(i)-b(i))**2
-
-  use io_global, only : stdout
-  use kinds, only : DP
-  implicit none
-  integer :: nmsh, id, in, ierr, itmax
-  logical :: conv
-  real(DP):: a (nmsh), b (nmsh), r2, tr2, beta
-
-  ! detol: if det < d11*d22*detol we assume that the det = 0
-  !        in this case only last iteration is used for
-  !        computation of the new input vector
-
-  real(DP), parameter:: detol =1.0e-9_DP
-  real(DP):: t1,t2, d11,d22,d12, aa2,det,dett,rd1m,rd2m, ddot
-  real(DP),allocatable:: c(:), d(:), a1(:), a2(:), b1(:), b2(:)
-  integer:: i
-  external ddot
-  save c, d, a1, a2, b1, b2
-
-
-  ! a = y(l) = V_out(l), b = x(l) = V_in(l)
-  conv=.false.
-  call trns(a,b,-1.0_DP,nmsh)
-  ! Now: a = r(l) == (V_out-V_in)(l)
-  r2 = ddot(nmsh,a,1,a,1)/DBLE(nmsh)
-
-  if(r2.lt.tr2.or.in==itmax) then
-     if (r2.lt.tr2) conv=.true.
-     ! Convergence achieved or last iteration: Deallocate working space
-     if (id.eq.3.and.in.ne.1) then
-        deallocate(b2)
-        deallocate(a2)
-        deallocate(d )
-     end if
-     if (id.eq.2 .or. id.eq.3.and.in.ne.1) then 
-        deallocate(b1)
-        deallocate(a1)
-        deallocate(c )
-     end if
-     return
-  end if
-  !
-  if(id.eq.1) then
-
-     call trns(b,a,beta,nmsh)
-     ! id=1, simple mixing: b = beta*a+ (1-beta)*b
-     return
-
-  else if(id.lt.1.or.id.gt.3.or.in.lt.1) then
-     write(stdout,'('' *** stop in dmixp *** id,in = '',2i6 )') id,in
-  end if
-
-  if (in.eq.1) then
-     ! First iteration: allocate working space
-     if (id.eq.2 .or. id.eq.3) then 
-        allocate(c(nmsh),stat=ierr)
-        allocate(a1(nmsh),stat=ierr)
-        allocate(b1(nmsh),stat=ierr)
-     end if
-     if (id.eq.3) then
-        allocate(d(nmsh),stat=ierr)
-        allocate(a2(nmsh),stat=ierr)
-        allocate(b2(nmsh),stat=ierr)
-     end if
-
-     call dcopy(nmsh,a,1,a1,1)
-     call dcopy(nmsh,b,1,b1,1)
-     ! a1 = r(l-1),  b1 = V_in(l-1)
-     call trns(b,a,beta,nmsh)
-     ! Simple mixing: b = beta*a+ (1-beta)*b
-     return
-  end if
-
-  do i=1,nmsh
-     c(i)=a1(i)-a(i)
-  end do
-  ! Now: c = r(l-1)-r(l)
-
-  d11 =ddot(nmsh,c,1,c,1)
-  rd1m=ddot(nmsh,a,1,c,1)
-
-  if(id.eq.3.and.in.gt.2) then
-
-     do i=1,nmsh
-        d(i)=a2(i)-a(i)
-     end do
-     ! Now: d = r(l-2)-r(l)
-
-     d22 =ddot(nmsh,d,1,d,1)
-     d12 =ddot(nmsh,c,1,d,1)
-     rd2m=ddot(nmsh,a,1,d,1)
-     aa2=d11*d22
-     det=aa2-d12*d12
-     dett=det/aa2
-     if(abs(dett).lt.detol) then
-        t1=-rd1m/d11
-        t2=0.0_dp
-     else
-        t1=(-rd1m*d22+rd2m*d12)/det
-        t2=( rd1m*d12-rd2m*d11)/det
-     end if
-     ! Write the new input vector on c
-     do i=1,nmsh
-        c(i) = (1.0_dp-t1-t2)*b(i) + ( t1*b1(i) + t2*b2(i) ) &
-             + beta * ( a(i) + t1*c(i) + t2*d(i) )
-     end do
-
-  else
-
-     ! t1 = theta1   (eq 4.8)
-     t1 = -rd1m/d11
-     ! Write the new input vector on c
-     do i=1,nmsh
-        c(i) = (1.0_dp-t1)*b(i) + t1*b1(i) + beta*(a(i)+t1*c(i))
-     end do
-
-  end if
-
-  ! Save a1=r(l-1), a2=r(l-2), b1=V_in(l-1), b2=V_in(l-2), for next iteration
-
-  if(id.eq.3) then
-     call dcopy(nmsh,b1,1,b2,1)
-     call dcopy(nmsh,a1,1,a2,1)
-  end if
-  call dcopy(nmsh,a,1,a1,1)
-  call dcopy(nmsh,b,1,b1,1)
-
-  ! Copy the new input vector on b
-
-  call dcopy(nmsh,c,1,b,1)
-
-  return
-end subroutine dmixp
-!
-!     trns calculates a(i)=a(i)+c*b(i) for i=1,n
-!     b(i) and n remain unchanged
-!
-subroutine trns(a,b,c,n)
-
-  use kinds, only : DP
-  implicit none
-  integer:: n,i
-  real(DP):: a(n),b(n),c
-  do i=1,n
-     a(i)=a(i)+c*b(i)
-  end do
-  return
-end subroutine trns

Deleted: trunk/espresso/atomic/drho0ofvx.f90
===================================================================
--- trunk/espresso/atomic/drho0ofvx.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/drho0ofvx.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,41 +0,0 @@
-!   
-!---------------------------------------------------------------
-subroutine drho0ofvx(drho,dchi0)
-!---------------------------------------------------------------
-   use constants, only: e2
-   use kinds,     only: DP
-   use ld1_parameters, only : nwfx
-   use ld1inc,    only: nwf, zed, oc, psi, ll, enl, vpot, isw, grid
-   use radial_grids, only: ndmx
-   implicit none
-   !
-   ! I/O variables
-   !
-   real(DP) :: drho(ndmx,2), dchi0(ndmx,nwfx)
-   ! local variables
-   real(DP) :: dvy(ndmx), dchi(ndmx), int_0_inf_dr,wrk(ndmx)
-   real(DP) :: ze2, fac, ocs
-   integer :: i, nu, is
-
-   ze2 = - zed * e2
-   
-   drho = 0.d0
-
-   do nu=1,nwf
-      do i=1,grid%mesh
-         dvy(i)=dchi0(i,nu)
-         wrk(i)=dvy(i)*psi(i,1,nu)
-      end do
-      fac=int_0_inf_dr(wrk,grid,grid%mesh,2*ll(nu)+2)
-      do i=1,grid%mesh
-         dvy(i) = dvy(i) - fac*psi(i,1,nu)
-      end do
-      is = isw(nu)
-      call green(dchi,ll(nu),enl(nu),dvy,psi(1,1,nu),vpot(1,is),ze2)
-      do i=1,grid%mesh
-         drho(i,is)=drho(i,is) + 2.0d0*oc(nu)*psi(i,1,nu)*dchi(i)
-      end do
-   end do
-!
-   return
-end subroutine drho0ofvx

Deleted: trunk/espresso/atomic/drhoofv.f90
===================================================================
--- trunk/espresso/atomic/drhoofv.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/drhoofv.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,38 +0,0 @@
-!
-!---------------------------------------------------------------
-subroutine drhoofv(drho,v)
-!---------------------------------------------------------------
-   !  
-   use constants, only: e2
-   use kinds,     only: DP
-   use ld1inc,    only: nwf, zed, oc, psi, ll, enl, isw, nspin, vpot, grid
-   use radial_grids, only: ndmx
-   implicit none
-   !
-   ! I/O variables
-   !
-   real (DP) :: drho(ndmx,2), v(ndmx,2)
-   !
-   ! local variables
-   !
-   real (DP) :: dvy(ndmx), dchi(ndmx), int_0_inf_dr, wrk(ndmx)
-   real (DP) :: ze2, fac
-   integer ::  nu, is
-
-   ze2 = -zed*e2
-
-   drho = 0.d0
-
-   do nu=1,nwf
-      is = isw(nu)
-      dvy(1:grid%mesh) = v(1:grid%mesh,is)*psi(1:grid%mesh,1,nu)
-      wrk(1:grid%mesh) = dvy(1:grid%mesh)*psi(1:grid%mesh,1,nu)
-      fac=int_0_inf_dr(wrk,grid,grid%mesh,2*ll(nu)+2)
-      dvy(1:grid%mesh) = dvy(1:grid%mesh) - fac*psi(1:grid%mesh,1,nu)
-      call green(dchi,ll(nu),enl(nu),dvy,psi(1,1,nu),vpot(1,is),ze2)
-      drho(1:grid%mesh,is) = drho(1:grid%mesh,is) + &
-                        2.0d0*oc(nu)*psi(1:grid%mesh,1,nu)*dchi(1:grid%mesh)
-   end do
-!
-   return
-end subroutine drhoofv

Deleted: trunk/espresso/atomic/dvex.f90
===================================================================
--- trunk/espresso/atomic/dvex.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/dvex.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,72 +0,0 @@
-!--------------------------------------------------------------------
-subroutine dvex(nu,dvy)
-!--------------------------------------------------------------------
-   !  
-   USE kinds,     ONLY: DP
-   USE constants, ONLY: e2
-   USE ld1inc,    ONLY: nwf, psi, ll, oc, sl3, nspin, isw, grid
-   use radial_grids, only: ndmx, hartree
-
-   implicit none
-   ! 
-   ! I/O variables
-   !
-   integer :: nu
-   real (DP) :: dvy(ndmx)
-   !
-   ! local variables
-   !
-   integer :: i, mu, l0, l1, l2, l3
-   real (DP) :: wrk(ndmx), wrk1(ndmx)
-   real (DP) :: fac, sss, ocs, doc, half
-   !
-   do i=1,grid%mesh
-      dvy(i)=0.0d0
-   end do
-   l1 = ll(nu)
-   half = 2.d0 * l1 + 1.d0
-   do mu=1,nwf
-!
-! only wfc with the same spin contribute to exchange term
-!
-      if (isw(mu) /= isw(nu) ) cycle
-      ocs = oc(mu) * (0.5d0 * nspin)
-!      write (*,*) mu, oc(mu), ocs
-      if ( mu == nu ) then
-         doc = 0.d0
-         if( (l1 /= 0) .and. (ocs > 0.d0) ) then
-           i = int(ocs)
-           doc = (i*(2.d0*ocs-i-1.d0)/(half-1.d0) - ocs*ocs/half) * half/ocs
-         end if
-         ocs = ocs + doc
-!         if (doc /= 0.d0) write (*,*) "DOC ",nu, doc
-      end if
-!
-      l2 = ll(mu)
-      l0=abs(l1-l2)
-      do i=1,grid%mesh
-         wrk(i) = psi(i,1,mu)*psi(i,1,nu)
-      end do
-      do l3=l0,l1+l2
-         sss = sl3(l1,l2,l3)
-!         write (*,*) l1,l2,l3,sss
-         if (abs(sss).gt.1.0d-10) then
-            call hartree(l3,l1+l2+2,grid%mesh,grid,wrk,wrk1)
-            fac =-e2*ocs*sss/2.0d0
-            do i=1,grid%mesh
-               dvy(i)= dvy(i) + fac*wrk1(i)*psi(i,1,mu)
-            end do
-         end if
-      end do
-!- spurious hartree part 
-      if (mu == nu ) then
-          call hartree(0,2,grid%mesh,grid,wrk,wrk1)
-          fac = doc*e2
-          do i=1,grid%mesh
-             dvy(i)= dvy(i) + fac*wrk1(i)*psi(i,1,mu)
-          end do
-        end if
-   end do 
-
-  return
-end subroutine dvex

Deleted: trunk/espresso/atomic/el_config.f90
===================================================================
--- trunk/espresso/atomic/el_config.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/el_config.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,373 +0,0 @@
-!
-! Copyright (C) 2004-2005 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine el_config &
-     ( config, rel, lsd, all_elec, nwf, el, nn, ll, oc, isw, jj)
-  !---------------------------------------------------------------
-  !
-  ! read electronic configuration from string "config"
-  ! example: config = '[Ar] 3d10 4s2 4p2.5'
-  ! Replicated wavefunctions are allowed and correspond to:
-  !   spin-up, spin-down for lsd;
-  !   j=l-1/2, j=j+1/2 for relativistic calculation and l > 0 ;
-  !   error in all other cases
-  ! See file INPUT_LD1 for full syntax
-  !
-  use kinds, only: dp
-  use ld1_parameters
-  implicit none
-  ! input: electronic configuration
-  character(len=*), intent(in):: config
-  logical, intent(in) :: all_elec
-  integer, intent(in) :: lsd, rel
-  ! output: atomic states
-  character(len=2), intent(out) :: el(nwfx)
-  integer, intent(out) :: nwf, nn(nwfx), ll(nwfx), isw(nwfx)
-  real(DP), intent(out) :: oc(nwfx), jj(nwfx)
-  ! local variables
-  logical :: toomany
-  integer ::  i, n, l, len, n0, first, start(nwfx), finish(nwfx)
-  character ::  occup*10, core*2, prev*1, curr*1
-  character(len=1), external :: capital
-  ! core states
-  character(len=2) :: elc(15)
-  integer :: nwfc, nnc(15), llc(15)
-  real(DP) :: occ(15)
-  data elc/'1S','2S','2P','3S','3P','4S','4P','3D','5S','5P','4D', &
-       &   '6S','6P','5D','4F'/
-  data nnc/1 ,2 ,2 ,3 ,3 ,4 ,4 ,3 ,5 ,5 ,4 ,6 ,6 ,5 ,4 /
-  data llc/0, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 3/
-  data occ/2.0,2.0,6.0,2.0,6.0,2.0,6.0,10.0,2.0,6.0,10.0,2.0,6.0,10.0,14.0/
-  !
-  ! len is the length of the string, excluding trailing blanks
-  !
-  len=len_trim(config)
-  if (len == 0) call errore('el_config','empty string',1)
-  !
-  ! first is the position of the first nonblank character in the string
-  !
-  do first=1,len
-     if (config(first:first) /= ' ') go to 10
-  end do
-10 continue
-  !
-  ! find core wavefunctions (if any)
-  !
-  if (all_elec .and. &
-       &    config(first  :first  ) == '[' .and. &
-       &    config(first+3:first+3) == ']') then
-     core = config(first+1:first+2)
-     if (core == 'He'.or.core == 'he'.or.core == 'HE') then
-        nwfc =1
-     else if (core == 'Ne'.or.core == 'ne'.or.core == 'NE') then
-        nwfc =3
-     else if (core == 'Ar'.or.core == 'ar'.or.core == 'AR') then
-        nwfc =5
-     else if (core == 'Kr'.or.core == 'kr'.or.core == 'KR') then
-        nwfc =8
-     else if (core == 'Xe'.or.core == 'xe'.or.core == 'XE') then
-        nwfc =11
-     else if (core == 'Rn'.or.core == 'rn'.or.core == 'RN') then
-        nwfc =15
-     else
-        call errore('el_config','wrong core: '//core,1)
-     end if
-     do n=1,nwfc
-        el(n)=elc(n)
-        ll(n)=llc(n)
-        nn(n)=nnc(n)
-        oc(n)=occ(n)
-        isw(n)=1
-     end do
-     ! find first nonblank character after core term
-     do i=first+4,len
-        if (config(i:i) /= ' ') go to 20
-     end do
-20   first=i
-  else
-     nwfc=0
-     first=1
-  end if
-  if (first >= len) then
-     nwf=nwfc
-     return
-  endif
-  !
-  ! now count and find the various terms "NLf" (eg: 1s2.0)
-  ! N=main quantum number, L=angular quantum number, f=occupancy
-  !
-  nwf=nwfc+1
-  if (nwf > nwfx) call errore('config','too many states',nwf)
-  start(nwf)=first
-  do i=first+1,len
-     prev=config(i-1:i-1)
-     curr=config(i  :i  )
-     if ((curr == ' ' .or.  curr == ',') .and.  &
-       &  prev /= ' ' .and. prev /= ',') then
-        finish(nwf)=i-1
-     nwf=nwf+1
-  else if (curr /= ' ' .and. curr /= ',' .and.  &
-       &  (prev == ' ' .or.  prev == ',')) then
-     start(nwf)=i
-  endif
-enddo
-finish(nwf)=len
-!
-! extract N,L,f from "NLf" terms !
-!
-do n=nwfc+1,nwf
-   prev = config(start(n):start(n))
-   read(prev,*) nn(n)
-   if (nn(n) <= 0 .or. nn(n) > 7) &
-  &    call errore('el_config','wrong main quantum number',n)
-
-   curr = capital(config(start(n)+1:start(n)+1))
-   ll(n)=-1
-   if (curr == 'S') ll(n)=0
-   if (curr == 'P') ll(n)=1
-   if (curr == 'D') ll(n)=2
-   if (curr == 'F') ll(n)=3
-   if (ll(n) == -1) call errore('el_config','l not found:'//curr,n)
-   if (ll(n).ge.nn(n)) call errore('el_config', &
-       &              'main/angular quantum number mismatch',n)
-
-   el(n)=prev//curr
-
-   if (start(n)+2 > finish(n))  &
-   &   call errore('el_config','no occupancy field?',n)
-   occup = config(start(n)+2:finish(n))
-   read(occup,*) oc(n)
-   if (oc(n) > 2*(2*ll(n)+1)) &
-        call errore('el_config','wrong occupancy:'//occup,n)
-
-enddo
-!
-! check same labels corresponding to different spin or j value
-!
-do n=nwfc+1,nwf
-   isw(n)=1
-   jj(n) =0.0_dp
-   toomany = .false.
-   do i=1,n-1
-      if (el(i) == el(n)) then
-         !
-         if (rel == 2) then
-            !
-            ! relativistic case: j=l-1/2, j=l+1/2
-            !
-            toomany = (jj(i) > 0.0_dp) .or. ll(n) == 0
-            !
-            jj(i)=ll(i)-0.5_dp
-            jj(n)=ll(n)+0.5_dp
-            if ( oc(n) > (2.0_dp*jj(n)+1.0_dp) ) &
-                 call errore('el_config','occupation wrong',n)
-            if ( oc(i) > (2.0_dp*jj(i)+1.0_dp) ) &
-                 call errore('el_config','occupation wrong',i)
-         else  if (lsd == 1) then
-            !
-            ! lsda case: spin up, spin down
-            !
-            toomany = (isw(i) > 1)
-            !
-            isw(n)=2
-         else
-            !
-            ! lda case: this shouldn't happen
-            !
-            toomany = .true.
-         end if
-      endif
-   enddo
-   !
-   if (toomany) call errore('el_config',  &
-        'wavefunction '//el(n)//' found too many times',n)
-   !
-end do
-!
-! pseudopotentials: N quantum number .ne. wavefunction label
-! we find the lowest N for each L and reassign N as it
-!
-if (.not.all_elec) then
-   do l=0,3
-      n0=1000
-      do n=1,nwf
-         if (ll(n) == l) n0=min(n0,nn(n))
-      end do
-      do n=1,nwf
-         if (ll(n) == l) nn(n)=nn(n)-n0+1+l
-      end do
-   end do
-endif
-
-return
-end subroutine el_config
-!
-!---------------------------------------------------------------
-subroutine read_config(rel, lsd, nwf, el, nn, ll, oc, isw, jj)
-  !---------------------------------------------------------------
-  !
-  ! read electronic configuration from input. Syntax:
-  !    nwf
-  ! followed by nwf cards
-  !    label N L occ  (example: 4S 4 0 2.0) for lda
-  ! or
-  !    label N L occ spin (example: 4S 4 0 1.0 1) for lsda
-  ! or
-  !    label N L occ j (example: 4P 4 1 1.0 1.5) for full relativistic
-  ! See file INPUT_LD1 for full syntax
-  !
-  use kinds, only: dp
-  use ld1_parameters, only: nwfx
-  implicit none
-  ! input
-  integer :: rel, lsd 
-  ! output: atomic states
-  character(len=2) :: el(nwfx)
-  integer :: nwf, nn(nwfx), ll(nwfx), isw(nwfx)
-  real(DP) :: oc(nwfx), jj(nwfx)
-  ! local variables
-  integer :: ios, n, ncheck
-  character (len=2) :: label
-  character (len=1), external :: capital
-  !
-  !
-  read(5,*,err=200,iostat=ios) nwf
-200 call errore('read_config','reading nwf ',abs(ios))
-  if (nwf <= 0) call errore('read_config','nwf is wrong',1)
-  if (nwf > nwfx) call errore('read_config','too many wfcs',1)
-  !
-  !     read the occupation of the states
-  !
-  do n=1,nwf  
-     if (rel < 2) then
-        jj(n) = 0.0_dp
-        if (lsd == 0) then
-           read(5,*,err=20,end=20,iostat=ios) &
-                el(n), nn(n), ll(n), oc(n)
-           isw(n)=1
-20         call errore('read_config','reading orbital (lda)',abs(ios))
-        else  
-           read(5,*,err=21,end=21,iostat=ios) &
-                el(n), nn(n), ll(n), oc(n), isw(n)
-21         call errore('read_config','reading orbital (lsd)',abs(ios))
-           if(isw(n) > 2 .or. isw(n) < 1) &
-                call errore('read_config','spin variable wrong ',n)
-        endif
-     else
-        read(5,*,err=22,end=22,iostat=ios) &
-             el(n), nn(n), ll(n), oc(n), jj(n)
-        isw(n)=1
-        if ((abs(ll(n)+0.5_dp-jj(n)) > 1.e-3_dp) .and. &
-            (abs(ll(n)-0.5_dp-jj(n)) > 1.e-3_dp) .and. abs(jj(n)) > 1.e-3_dp) &
-            call errore('read_config','jj wrong',n)
-        if (oc(n) > (2.0_dp*jj(n)+1.0_dp) .and. abs(jj(n)) > 1e-3_dp) &
-             call errore('read_config','occupations wrong',n)
-22      call errore('read_config','reading orbital (rel)',abs(ios))
-     endif
-     !
-     ! Check: no two same wavefunctions
-     !
-     do ncheck=1,n-1
-        if ( el(ncheck) == el(n) .and. isw(ncheck) == isw(n) .and. &
-             jj(ncheck) == jj(n) ) then
-           call errore('read_config', &
-                'same wavefunction '//el(n)//' appears twice',n)
-        endif
-     enddo
-     !
-     ! More sanity checks
-     !
-     write(label,'(a2)') el(n)
-     read (label,'(i1)') ncheck
-     if (ncheck /= nn(n)  .or. &
-         capital(label(2:2)) == 'S' .and. ll(n) /= 0 .or. &
-         capital(label(2:2)) == 'P' .and. ll(n) /= 1 .or. &
-         capital(label(2:2)) == 'D' .and. ll(n) /= 2 .or. &
-         capital(label(2:2)) == 'F' .and. ll(n) /= 3 .or. &
-         oc(n) > 2.0_dp*(2*ll(n)+1) .or. nn(n) < ll(n)+1  ) &
-         call errore('read_config',label//' wrong?',n)
-  enddo
-  !
-  return
-end subroutine read_config
-!
-!---------------------------------------------------------------
-subroutine read_psconfig (rel, lsd, nwfs, els, nns, lls, ocs, &
-     isws, jjs, enls, rcut, rcutus )
-  !---------------------------------------------------------------
-  ! read pseudostates and pseudization information from input
-  ! See file INPUT_LD1 for full syntax
-  !
-  use kinds, only: dp
-  use ld1_parameters, only: nwfsx
-  implicit none
-  ! input
-  integer :: rel, lsd 
-  ! output: atomic states
-  character(len=2) :: els(nwfsx)
-  integer :: nwfs, nns(nwfsx), lls(nwfsx), isws(nwfsx)
-  real(DP) :: ocs(nwfsx), jjs(nwfsx), enls(nwfsx), &
-       rcut(nwfsx), rcutus(nwfsx)
-  ! local variables
-  integer :: ios, n
-  character (len=2) :: label
-  character (len=1), external :: capital
-
-  read(5,*,err=600,iostat=ios) nwfs
-600 call errore('read_psconfig','reading number of pseudo wavefunctions (nwfs)',abs(ios))
-
-  if (nwfs <= 0 .or. nwfs > nwfsx) &
-       call errore('read_psconfig','number of pseudo wavefunctions is wrong',1)
-
-  do n=1,nwfs
-     if (rel < 2) then
-        if (lsd == 1) then
-           read(5,*,err=30,end=30,iostat=ios) &
-                els(n), nns(n), lls(n), ocs(n), enls(n), &
-                rcut(n), rcutus(n), isws(n)
-           if (isws(n) > 2 .or. isws(n) < 1) &
-                call errore('read_psconfig', 'spin variable wrong',n)
-           if (ocs(n) > (2.0_dp*lls(n)+1.0_dp))                 &
-             call errore('read_psconfig','occupations (ls) wrong',n)
-        else
-           read(5,*,err=30,end=30,iostat=ios) &
-                els(n), nns(n), lls(n), ocs(n), enls(n), &
-                rcut(n), rcutus(n)
-           isws(n)=1
-           if (ocs(n) > 2.0_dp*(2.0_dp*lls(n)+1.0_dp))                 &
-             call errore('read_psconfig','occupations (l) wrong',n)
-        end if
-        jjs(n)=0.0_dp
-     else
-        read(5,*,err=30,end=30,iostat=ios) &
-             els(n), nns(n), lls(n), ocs(n), enls(n),     &
-             rcut(n), rcutus(n), jjs(n)
-        isws(n)=1
-        if ((abs(lls(n)+0.5_dp-jjs(n)) > 1.e-3_dp).and.      &
-            (abs(lls(n)-0.5_dp-jjs(n)) > 1.e-3_dp).and. abs(jjs(n)) > 1.e-3_dp) &
-             call errore('read_psconfig', 'jjs wrong',n)
-        if (ocs(n) > (2.0_dp*jjs(n)+1.0_dp).and. abs(jjs(n)) > 1.e-3_dp) &
-             call errore('read_psconfig','occupations (j) wrong',n)
-     endif
-     write(label,'(a2)') els(n)
-     if ( capital(label(2:2)) == 'S'.and.lls(n) /= 0.or.   &
-          capital(label(2:2)) == 'P'.and.lls(n) /= 1.or.   &
-          capital(label(2:2)) == 'D'.and.lls(n) /= 2.or.   &
-          capital(label(2:2)) == 'F'.and.lls(n) /= 3.or.   &
-          ocs(n) > 2*(2*lls(n)+1).or.                 &
-          nns(n) < lls(n)+1 )                         &
-          call errore('read_psconfig','ps-label'//' wrong?',n)
-     if (rcut(n) > rcutus(n)) &
-          call errore('read_psconfig','rcut or rcutus is wrong',1)
-  enddo
-30 call errore('read_psconfig','reading pseudo wavefunctions configuration',abs(ios))
-  !
-  return
-end subroutine read_psconfig
-!------------------------------------------------------------------------

Deleted: trunk/espresso/atomic/elsd.f90
===================================================================
--- trunk/espresso/atomic/elsd.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/elsd.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,110 +0,0 @@
-!
-! Copyright (C) 2004-2010 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine elsd ( zed, grid, rho, vxt, vh, vxc, exc, excgga, nwf,&
-                  nspin, enl, oc, etot, ekin, encl, ehrt, ecxc, evxt )    
-  !---------------------------------------------------------------
-  !
-  !   atomic total energy in the local-spin-density scheme
-  !   atomic pseudopotentials with nonlinear core correction are allowed
-  !   gradient correction allowed (A. Dal Corso fecit AD 1993)
-  !
-  use kinds, only : DP
-  use constants, only: fpi
-  use radial_grids, only: ndmx, radial_grid_type
-  use funct, only: get_iexch, dft_is_meta
-  use ld1inc, only: vx, noscf, tau, vtau
-  implicit none
-  integer, intent(in) :: nwf, nspin
-  type(radial_grid_type),intent(in)::grid
-  real(DP), intent(in)  :: zed
-  real(DP), intent(in)  :: enl(nwf), oc(nwf), rho(ndmx,2), &
-                           vxt(ndmx), vh(ndmx), vxc(ndmx,2), exc(ndmx), &
-                           excgga(ndmx)
-  real(DP), intent(out) :: etot,encl,ekin,ehrt,ecxc,evxt
-  real(DP),allocatable :: f1(:), f2(:), f3(:), f4(:), f5(:)
-  real(DP) :: int_0_inf_dr, rhotot
-  integer:: i,n,is,ierr
-  logical:: oep, meta
-
-  if (noscf) return
-  oep=get_iexch().eq.4
-  meta=dft_is_meta()
-
-  allocate(f1(grid%mesh),stat=ierr)
-  allocate(f2(grid%mesh),stat=ierr)
-  allocate(f3(grid%mesh),stat=ierr)
-  allocate(f4(grid%mesh),stat=ierr)
-  allocate(f5(grid%mesh),stat=ierr)
-
-  do i=1,grid%mesh
-     rhotot=rho(i,1)
-     if (nspin==2) rhotot=rhotot+rho(i,2) 
-!
-!   The integral for the energy due to the interaction with nuclei
-!
-     f1(i)=-2.0_DP*zed/grid%r(i) * rhotot
-!
-!   The integral for the Hartree energy
-!
-     f2(i)= vh (i) * rhotot
-!
-!   The integral for the exchange and correlation energy 
-!
-     f3(i) = exc(i) * rhotot + excgga(i)
-!
-!   The integral for the interaction with an external potential
-!
-     f4(i)= vxt(i) * rhotot
-!
-!   The integral to be subtracted to the sum of the eigenvalues to
-!   get the kinetic energy
-!
-     f5(i) =-vxc(i,1)*rho(i,1)-f1(i)-f2(i)-f4(i)
-     if (nspin==2) f5(i) =f5(i)-vxc(i,2)*rho(i,2)
-
-     if (oep) then
-        do is = 1, nspin
-           f5(i) = f5(i) - vx(i,is)*rho(i,is)
-        end do
-     end if
-     if (meta) THEN
-        do is = 1, nspin
-           f5(i) = f5(i) - vtau(i)*tau(i,is)*fpi*grid%r2(i) 
-        end do 
-     end if
-  enddo
-!
-!  Now compute the integrals
-!
-  encl=       int_0_inf_dr(f1,grid,grid%mesh,1)
-  ehrt=0.5_DP*int_0_inf_dr(f2,grid,grid%mesh,2)
-  ecxc=       int_0_inf_dr(f3,grid,grid%mesh,2)
-  evxt=       int_0_inf_dr(f4,grid,grid%mesh,2)
-  !
-!
-!  The kinetic energy is the sum of the eigenvalues plus the f5 integral
-!
-  ekin = int_0_inf_dr(f5,grid,grid%mesh,1)
-  do n=1,nwf
-     if (oc(n)>0.0_DP) ekin=ekin+oc(n)*enl(n)
-  enddo
-
-  if (oep) call add_exchange (ecxc)
-
-  etot= ekin + encl + ehrt + ecxc + evxt
-
-  deallocate(f5)
-  deallocate(f4)
-  deallocate(f3)
-  deallocate(f2)
-  deallocate(f1)
-
-  return
-end subroutine elsd

Deleted: trunk/espresso/atomic/elsd_highv.f90
===================================================================
--- trunk/espresso/atomic/elsd_highv.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/elsd_highv.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,118 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine elsd_highv (nc)
-  !---------------------------------------------------------------
-  !
-  !   additional information on the atomic total energy. The valence
-  !   and core contributions to the different terms are calculated
-  !
-  use kinds, only : DP
-  use constants, only : e2
-  use radial_grids, only: ndmx, hartree
-  use ld1inc, only: grid, aeccharge, aevcharge, nwf, nspin, enl, oc, v0, &
-                    vxcts, excts, excggats, nlcc, enclc, enclv, ehrtvv, &
-                    ehrtcv, ehrtcc, ekinc, ekinv, ecxc, ae_fc_energy, &
-                    core_state, ekinc0, etot, frozen_core, iswitch
-  implicit none
-  integer, intent(in) :: nc
-  real(DP),allocatable :: f2vv(:), f2cv(:), f2vc(:), f2cc(:), f1c(:), f1v(:),  &
-                          f5c(:), f5v(:), vhval(:), vhcore(:), vnew(:,:)
-
-  real(DP) :: int_0_inf_dr, rhotot, fact
-  integer:: i,n,ierr
-!
-!  when iswitch=1 this routine cannot work because the code does not
-!  know which are the core and valence states.
-!
-  if (iswitch==1) return
-
-  allocate(f1c(grid%mesh),stat=ierr)
-  allocate(f1v(grid%mesh),stat=ierr)
-
-  allocate(f2vv(grid%mesh),stat=ierr)
-  allocate(f2cv(grid%mesh),stat=ierr)
-  allocate(f2vc(grid%mesh),stat=ierr)
-  allocate(f2cc(grid%mesh),stat=ierr)
-
-  allocate(vnew(ndmx,2),stat=ierr)
-  allocate(vhval(ndmx),stat=ierr)
-  allocate(vhcore(ndmx),stat=ierr)
-
-  allocate(f5c(grid%mesh),stat=ierr)
-  allocate(f5v(grid%mesh),stat=ierr)
-
-  call set_rc_rv()
-  call v_of_rho_at (aevcharge,aeccharge,vhval,vxcts,excts,excggats, &
-                   vnew,.true.,1)
-  call hartree(0,2,grid%mesh,grid,aeccharge,vhcore)
-  vhcore=e2*vhcore
-
-  fact=1.0_DP/nspin
-  do i=1,grid%mesh
-     rhotot=aevcharge(i,1)
-     if (nspin==2) rhotot=rhotot+aevcharge(i,2) 
-!
-!   The integral for the energy due to the interaction with the nuclei
-!
-     f1c(i)= v0(i) * aeccharge(i)
-     f1v(i)= v0(i) * rhotot
-!
-!   The integrals for the Hartree energy
-!
-     f2vv(i)= vhval (i) * rhotot
-     f2cv(i)= vhcore(i) * rhotot
-     f2vc(i)= vhval(i) *  aeccharge(i)
-     f2cc(i)= vhcore(i) * aeccharge(i)  
-!
-!   The integral to be subtracted to the sum of the eigenvalues to
-!   get the kinetic energy
-!
-     f5c(i) =-vxcts(i,1)*aeccharge(i)*fact-f1c(i)-f2vc(i)-f2cc(i)
-     if (nspin==2) f5c(i) =f5c(i)-vxcts(i,2)*aeccharge(i)*fact
-     f5v(i) =-vxcts(i,1)*aevcharge(i,1)-f1v(i)-f2cv(i)-f2vv(i)
-     if (nspin==2) f5v(i) =f5v(i)-vxcts(i,2)*aevcharge(i,2)
-  enddo
-!
-!  Now compute the integrals
-!
-  enclc=      int_0_inf_dr(f1c,grid,grid%mesh,1)
-  enclv=      int_0_inf_dr(f1v,grid,grid%mesh,1)
-  ehrtvv=0.5_DP*int_0_inf_dr(f2vv,grid,grid%mesh,2)
-  ehrtcc=0.5_DP*int_0_inf_dr(f2cc,grid,grid%mesh,2)
-  ehrtcv=     int_0_inf_dr(f2cv,grid,grid%mesh,2)
-
-  ekinc=      int_0_inf_dr(f5c,grid,grid%mesh,1)
-  ekinv=      int_0_inf_dr(f5v,grid,grid%mesh,1)
-  do n=1,nwf
-     if (oc(n)>0.0_DP.and.core_state(n)) ekinc=ekinc+oc(n)*enl(n)
-     if (oc(n)>0.0_DP.and..not.core_state(n)) ekinv=ekinv+oc(n)*enl(n)
-  enddo
-  if (nc==1) ekinc0=ekinc
-  if (frozen_core.and.nc>1) then
-     etot=etot-ekinc+ekinc0
-     ekinc=ekinc0
-  endif
-
-  ae_fc_energy=ekinv+ehrtvv+ehrtcv+ecxc+enclv
-
-  deallocate(f5c)
-  deallocate(f5v)
-  deallocate(f2vc)
-  deallocate(f2cv)
-  deallocate(f2cc)
-  deallocate(f2vv)
-  deallocate(f1c)
-  deallocate(f1v)
-  deallocate(vnew)
-  deallocate(vhval)
-  deallocate(vhcore)
-
-  return
-end subroutine elsd_highv

Deleted: trunk/espresso/atomic/elsdps.f90
===================================================================
--- trunk/espresso/atomic/elsdps.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/elsdps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,205 +0,0 @@
-!
-! Copyright (C) 2004-2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine elsdps 
-  !---------------------------------------------------------------
-  !
-  !   atomic total energy in the local-spin-density scheme
-  !   atomic pseudopotentials with nonlinear core correction are allowed
-  !   gradient correction allowed (A. Dal Corso fecit AD 1993)
-  !
-  use kinds, only: DP
-  use constants, only: fpi
-  use radial_grids, only : ndmx
-  use ld1_parameters, only : nwfsx
-  use ld1inc, only : nlcc, grid, nspin, rhoc, rhos, lsd, vpsloc, vxt, vh, &
-       encl, ehrt, ecxc, evxt, ekin, ecc, epseu, vnl, &
-       etots, pseudotype, phits, ikk, nbeta, betas, bmat, &
-       nwfts, rel, jjts, llts, octs, enlts, jjs, lls, &
-       vxc, exc, excgga
-  use funct, only : dft_is_gradient, exc_t
-  implicit none
-  real(DP) :: &
-       int_0_inf_dr,  &   ! the integral function
-       rh0(2),        &   ! the charge in a given point
-       rhc,           &   ! core charge in a given point
-       rho_tot,       &   ! the total charge in one point
-       work(nwfsx)        ! auxiliary space (similar to becp)
-
-  real(DP),allocatable :: &
-       f1(:),      &   ! auxiliary
-       f2(:),      &   ! auxiliary
-       f3(:),      &   ! auxiliary
-       f4(:),      &   ! auxiliary
-       f5(:),      &   ! auxiliary
-       vgc(:,:),   &   ! the gga potential
-       egc(:),     &   ! the gga energy
-       rho_aux(:,:), & ! auxiliary space
-       exccc(:)        ! the exchange and correlation energy of the core
-  REAL(dp) :: & ! compatibility with metaGGA - not yet used
-       tau(ndmx) = 0.0_dp, vtau(ndmx) = 0.0_dp
-
-  integer :: &
-       n,i,ns,nst,lam,n1,n2,ikl,ierr,ind
-
-  allocate(f1(grid%mesh), stat=ierr)
-  allocate(f2(grid%mesh), stat=ierr)
-  allocate(f3(grid%mesh), stat=ierr)
-  allocate(f4(grid%mesh), stat=ierr)
-  allocate(f5(grid%mesh), stat=ierr)
-  allocate(exccc(ndmx), stat=ierr)
-  !
-  !  If there is NLCC we calculate here also the exchange and correlation
-  !  energy of the pseudo core charge.
-  !  This quantity is printed but not added to the total energy
-  !
-  exccc=0.0_DP
-  ecc=0.0_DP
-  if (nlcc) then
-     rh0(1)=0.0_DP
-     rh0(2)=0.0_DP
-     do i=1,grid%mesh
-        rhc= rhoc(i)/grid%r2(i)/fpi
-        exccc(i) = exc_t(rh0,rhc,lsd)*rhoc(i) 
-     enddo
-     if (dft_is_gradient()) then
-        allocate(rho_aux(ndmx,2), stat=ierr)
-        allocate(vgc(ndmx,2),stat=ierr)
-        allocate(egc(ndmx),stat=ierr)
-        vgc=0.0_DP
-        egc=0.0_DP
-        rho_aux=0.0_DP
-        call vxcgc ( ndmx, grid%mesh, nspin, grid%r, grid%r2, rho_aux, &
-             rhoc, vgc, egc, tau, vtau, 1)
-        do i=1,grid%mesh
-           exccc(i) = exccc(i) + egc(i)*fpi*grid%r2(i)
-        enddo
-        deallocate(egc)
-        deallocate(vgc)
-        deallocate(rho_aux)
-     endif
-     ecc=  int_0_inf_dr(exccc,grid,grid%mesh,2)
-  endif
-  !
-  !  Now prepare the integrals
-  !
-  do i=1,grid%mesh
-     rho_tot=rhos(i,1)
-     if (lsd.eq.1) rho_tot=rho_tot+rhos(i,2)
-     !
-     !    The integral for the interaction with the local potential
-     !
-     f1(i)= vpsloc(i) * rho_tot
-     !
-     !    The integral for the Hartree energy
-     !
-     f2(i)= vh(i) * rho_tot
-     !
-     !    The integral for the exchange and correlation energy
-     !
-     f3(i)= exc(i) * (rho_tot+rhoc(i)) + excgga(i)
-     !
-     !    The integral for the interaction with the external potential
-     !
-     f4(i)= vxt(i)*rho_tot
-     !
-     !    The integral to add to the sum of the eigenvalues to have the
-     !    kinetic energy.
-     !
-     f5(i) =-vxc(i,1)*rhos(i,1)-f1(i)-f2(i)-f4(i)
-     if (nspin==2) f5(i)=f5(i)-vxc(i,2)*rhos(i,2)
-  enddo
-  !
-  !  And now compute the integrals
-  !
-  encl=       int_0_inf_dr(f1,grid,grid%mesh,1)
-  ehrt=0.5_DP*int_0_inf_dr(f2,grid,grid%mesh,2)
-  ecxc=       int_0_inf_dr(f3,grid,grid%mesh,2)
-  evxt=       int_0_inf_dr(f4,grid,grid%mesh,2)
-  !
-  !  Now compute the nonlocal pseudopotential energy. There are two cases:
-  !  The potential in semilocal form or in fully separable form
-  !
-  epseu=0.0_DP
-  if (pseudotype == 1) then
-     !
-     !   Semilocal form
-     !
-     do ns=1,nwfts
-        if (octs(ns)>0.0_DP) then
-           if ( rel < 2 .or. llts(ns) == 0 .or. &
-                abs(jjts(ns)-llts(ns)+0.5_dp) < 0.001_dp) then
-              ind=1
-           else if ( rel == 2 .and. llts(ns) > 0 .and. &
-                abs(jjts(ns)-llts(ns)-0.5_dp) < 0.001_dp) then
-              ind=2
-           endif
-           f1=0.0_DP
-           lam=llts(ns)
-           do n=1, grid%mesh
-              f1(n) = f1(n) + phits(n,ns)**2 * octs(ns)
-           enddo
-           do n=1,grid%mesh
-              f1(n) = f1(n) * vnl(n,lam,ind)
-           end do
-           if (ikk(ns) > 0) &
-                epseu = epseu + int_0_inf_dr(f1,grid,ikk(ns),2*(lam+1))
-        endif
-     enddo
-  else
-     !
-     !  Fully separable form
-     !
-     do ns=1,nwfts
-        if (octs(ns).gt.0.0_DP) then
-           do n1=1,nbeta
-              if ( llts(ns).eq.lls(n1).and.   &
-                   abs(jjts(ns)-jjs(n1)).lt.1.e-7_DP) then
-                 nst=(llts(ns)+1)*2
-                 ikl=ikk(n1)
-                 do n=1,ikl
-                    f1(n)=betas(n,n1)*phits(n,ns)
-                 enddo
-                 work(n1)=int_0_inf_dr(f1,grid,ikl,nst)
-              else
-                 work(n1)=0.0_DP
-              endif
-           enddo
-           do n1=1,nbeta
-              do n2=1,nbeta
-                 epseu=epseu  &
-                      + bmat(n1,n2)*work(n1)*work(n2)*octs(ns)
-              enddo
-           enddo
-        endif
-     enddo
-  endif
-  !
-  !  Now compute the kinetic energy
-  !
-  ekin = int_0_inf_dr(f5,grid,grid%mesh,2) - epseu
-  do ns=1,nwfts
-     if (octs(ns).gt.0.0_DP) then
-        ekin=ekin+octs(ns)*enlts(ns)
-     endif
-  end do
-  !
-  !  And the total energy
-  !
-  etots= ekin + encl + epseu + ehrt + ecxc + evxt
-
-  deallocate(f5)
-  deallocate(f4)
-  deallocate(f3)
-  deallocate(f2)
-  deallocate(f1)
-  deallocate(exccc)
-
-  return
-end subroutine elsdps

Deleted: trunk/espresso/atomic/elsdps_paw.f90
===================================================================
--- trunk/espresso/atomic/elsdps_paw.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/elsdps_paw.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,96 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine elsdps_paw( )
-  !---------------------------------------------------------------
-  !
-  !   total paw energy in the local-spin-density scheme
-  !
-  use kinds, only: DP
-  use constants, only: fpi
-  use radial_grids, only : ndmx
-  use ld1_parameters, only : nwfsx
-  use ld1inc, only : nlcc, grid, nspin, rhoc, lsd, &
-       encl, ehrt, ecxc, evxt, ekin, ecc, epseu,  &
-       nwfts, enlts, octs, paw_energy
-  use funct, only : dft_is_gradient, exc_t
-  implicit none
-  real(DP) :: &
-       int_0_inf_dr,  &   ! the integral function
-       rh0(2),        &   ! the charge in a given point
-       rhc,           &   ! core charge in a given point
-       edcts              ! auxiliary energy
-
-  real(DP),allocatable :: &
-       vgc(:,:),   &   ! the gga potential
-       egc(:),     &   ! the gga energy
-       rho_aux(:,:), & ! auxiliary space
-       exccc(:)        ! the exchange and correlation energy of the core
-  REAL(dp) :: & ! compatibility with metaGGA - not yet used
-       tau(ndmx) = 0.0_dp, vtau(ndmx) = 0.0_dp
-
-  integer :: &
-       i,ns,ierr
-
-  !
-  !  If there is NLCC we calculate here also the exchange and correlation
-  !  energy of the pseudo core charge.
-  !  This quantity is printed but not added to the total energy
-  !
-  ecc=0.0_DP
-  if (nlcc) then
-     allocate(exccc(ndmx), stat=ierr)
-     exccc=0.0_DP
-     rh0(1)=0.0_DP
-     rh0(2)=0.0_DP
-     do i=1,grid%mesh
-        rhc= rhoc(i)/grid%r2(i)/fpi
-        exccc(i) = exc_t(rh0,rhc,lsd)*rhoc(i) 
-     enddo
-     if (dft_is_gradient()) then
-        allocate(rho_aux(ndmx,2), stat=ierr)
-        allocate(vgc(ndmx,2),stat=ierr)
-        allocate(egc(ndmx),stat=ierr)
-        vgc=0.0_DP
-        egc=0.0_DP
-        rho_aux=0.0_DP
-        call vxcgc ( ndmx, grid%mesh, nspin, grid%r, grid%r2, rho_aux, &
-             rhoc, vgc, egc, tau, vtau, 1)
-        do i=1,grid%mesh
-           exccc(i) = exccc(i) + egc(i)*fpi*grid%r2(i)
-        enddo
-        deallocate(egc)
-        deallocate(vgc)
-        deallocate(rho_aux)
-     endif
-     ecc=  int_0_inf_dr(exccc,grid,grid%mesh,2)
-     deallocate(exccc)
-  endif
-  !
-  !  Add the three contributions for each energy
-  !
-  encl= paw_energy(5,1)+paw_energy(5,2)-paw_energy(5,3)
-  ehrt= paw_energy(2,1)+paw_energy(2,2)-paw_energy(2,3)
-  ecxc= paw_energy(3,1)+paw_energy(3,2)-paw_energy(3,3)
-  edcts=  paw_energy(4,1)+paw_energy(4,2)-paw_energy(4,3)
-  !
-  !  The nonlocal pseudopotential energy is not computed.
-  !
-  epseu=0.0_DP
-  !
-  !  Now compute the kinetic energy
-  !
-  ekin = -encl-edcts
-  do ns=1,nwfts
-     if (octs(ns) > 0.0_DP) then
-        ekin=ekin+octs(ns)*enlts(ns)
-     endif
-  end do
-  return
-end subroutine elsdps_paw

Deleted: trunk/espresso/atomic/esic.f90
===================================================================
--- trunk/espresso/atomic/esic.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/esic.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,54 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine esic
-  !---------------------------------------------------------------
-  !
-  use kinds, only: dp
-  use radial_grids, only: ndmx
-  use ld1inc, only: grid, etot, ehrt, ecxc, ekin, rel, dhrsic, dxcsic, &
-                    nwf, ll,  oc, psi 
- 
-  implicit none
-  ! output
-  ! local
-  integer:: n, i
-  real(DP) :: int_0_inf_dr,deksic  
-  real(DP) :: work1(ndmx),v(ndmx),vsic(ndmx)
-  external int_0_inf_dr
-  !
-  deksic = 0.0_DP
-  dhrsic = 0.0_DP
-  dxcsic = 0.0_DP
-  do n=1,nwf
-     call sic_correction(n,v,vsic,work1)
-     if (rel.eq.2) then
-        do i=1,grid%mesh
-           v(i)=v(i)*(psi(i,1,n)**2+psi(i,2,n)**2)
-           vsic(i)=vsic(i)*(psi(i,1,n)**2+psi(i,2,n)**2)
-        end do
-     else
-        do i=1,grid%mesh
-           v(i)=v(i)*psi(i,1,n)**2
-           vsic(i)=vsic(i)*psi(i,1,n)**2
-        enddo
-     endif
-     deksic = deksic +  &
-          &      oc(n)*int_0_inf_dr(vsic,grid,grid%mesh,2*(ll(n)+1))
-     dhrsic = dhrsic - 0.5_DP*oc(n)*int_0_inf_dr(v    ,grid,grid%mesh,2)
-     dxcsic = dxcsic -        oc(n)*int_0_inf_dr(work1,grid,grid%mesh,2)
-  enddo
-  !
-  ekin=ekin+deksic
-  ehrt=ehrt
-  ecxc=ecxc+dxcsic+dhrsic
-  etot=etot+dhrsic+dxcsic+deksic
-  !
-  return
-end subroutine esic

Copied: trunk/espresso/atomic/examples/all-electron (from rev 8077, trunk/espresso/atomic_doc/all-electron)

Modified: trunk/espresso/atomic/examples/all-electron/test.job
===================================================================
--- trunk/espresso/atomic_doc/all-electron/test.job	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/all-electron/test.job	2011-08-23 09:39:15 UTC (rev 8100)
@@ -2,8 +2,8 @@
 
 work=./results
 reference=./reference
-. ../../examples/environment_variables
-BIN_DIR=../../bin
+. ../../../examples/environment_variables
+BIN_DIR=../../../bin
 
 mkdir $work
 rm -f $work/*

Copied: trunk/espresso/atomic/examples/make_clean (from rev 8077, trunk/espresso/atomic_doc/make_clean)
===================================================================
--- trunk/espresso/atomic/examples/make_clean	                        (rev 0)
+++ trunk/espresso/atomic/examples/make_clean	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# run from directory where this script is
+cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
+
+# check whether echo has the -e option
+if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
+
+# clean all example directories
+for dir in all-electron paw-gen-test pseudo-gen pseudo-test vdw-in-tfvw
+do
+    if test -d $dir/results
+    then
+        cd $dir
+        $ECHO "cleaning `pwd`...\c"
+        clean.sh
+        $ECHO " done"
+        cd ..
+    fi
+done
+cd pseudo_library
+. make_clean
+cd ..
+rm -f INPUT_*.html INPUT_*.txt
+$ECHO "cleaning all : done"

Copied: trunk/espresso/atomic/examples/paw_examples (from rev 8077, trunk/espresso/atomic_doc/paw_library)

Modified: trunk/espresso/atomic/examples/paw_examples/clean
===================================================================
--- trunk/espresso/atomic_doc/paw_library/clean	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/paw_examples/clean	2011-08-23 09:39:15 UTC (rev 8100)
@@ -24,3 +24,5 @@
   rm -rf ${input/.in/.out} ${input/.in/-dlog.ps} ${input/.in/}
 done
 
+cd ../
+rm -r -f results

Modified: trunk/espresso/atomic/examples/paw_examples/test
===================================================================
--- trunk/espresso/atomic_doc/paw_library/test	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/paw_examples/test	2011-08-23 09:39:15 UTC (rev 8100)
@@ -7,7 +7,7 @@
 cd $(dirname $0) || 
    error "Cannot find myself! Run the script as ./test" 4
 
-LD1=$(cd ../../bin/; echo `pwd`/ld1.x)
+LD1=$(cd ../../../bin/; echo `pwd`/ld1.x)
 test -x $LD1 ||
    error "Cannot find ld1.x, or not executable." 126
  

Copied: trunk/espresso/atomic/examples/pseudo-LDA-0.5 (from rev 8077, trunk/espresso/atomic_doc/pseudo-LDA-0.5)

Modified: trunk/espresso/atomic/examples/pseudo-LDA-0.5/Si.pz-vbc.UPF
===================================================================
--- trunk/espresso/atomic_doc/pseudo-LDA-0.5/Si.pz-vbc.UPF	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/pseudo-LDA-0.5/Si.pz-vbc.UPF	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,7 +1,7 @@
 <PP_INFO>
 Generated using unknown code
-Author: Von Barth-Car (<1984)
-Info: automatically converted from PWSCF format
+Author: von Barth and Car   Generation date: before 1984
+Info: Si LDA 3s2 3p2 VonBarth-Car, l=2 local
     0        The Pseudo was generated with a Non-Relativistic Calculation
   0.00000000000E+00    Local Potential cutoff radius
 nl pn  l   occ               Rcut            Rcut US             E pseu
@@ -534,7 +534,7 @@
   5.83659229570E-01  5.20632657218E-01  4.58991859834E-01  3.99400107725E-01
   3.42479886306E-01  2.88795544123E-01  2.38837195864E-01  1.93006684515E-01
   1.51606425963E-01  1.14831739656E-01  8.27672263457E-02  5.53874313492E-02
-  3.25619009130E-02  1.40643868234E-02 -4.14221888247E-04 -1.12499692866E-02
+  3.25619009130E-02  1.40643868234E-02 -4.14221888248E-04 -1.12499692866E-02
  -1.88677774040E-02 -2.37222921714E-02 -2.62787118393E-02 -2.69946494903E-02
  -2.63039853428E-02 -2.46034832072E-02 -2.22427201751E-02 -1.95176110128E-02
  -1.66675366623E-02 -1.38758334570E-02 -1.12731713991E-02 -8.94319737367E-03
@@ -562,7 +562,7 @@
 
 
 <PP_PSWFC>
-*S    0  2.00          Wavefunction
+3S    0  2.00          Wavefunction
   1.84219730000E-04  1.88883320000E-04  1.93664970000E-04  1.98567680000E-04
   2.03594500000E-04  2.08748580000E-04  2.14033140000E-04  2.19451480000E-04
   2.25007000000E-04  2.30703160000E-04  2.36543530000E-04  2.42531750000E-04
@@ -671,7 +671,7 @@
   7.66535140000E-18  2.68858640000E-18  9.18039800000E-19  3.04964680000E-19
   9.84885070000E-20  3.09000610000E-20  9.41137000000E-21  2.78060930000E-21
   7.96317720000E-22  2.20876360000E-22  5.92893960000E-23
-*P    1  2.00          Wavefunction
+3P    1  2.00          Wavefunction
   5.58448210000E-07  5.87080470000E-07  6.17180730000E-07  6.48824270000E-07
   6.82090210000E-07  7.17061740000E-07  7.53826290000E-07  7.92475800000E-07
   8.33106910000E-07  8.75821230000E-07  9.20725560000E-07  9.67932190000E-07
@@ -893,3 +893,4 @@
   3.45850628223E-24  8.26258107363E-25  1.90269739282E-25  4.21934575465E-26
   9.00173688475E-27  1.84581078498E-27  3.63404947693E-28
 </PP_RHOATOM>
+

Modified: trunk/espresso/atomic/examples/pseudo-LDA-0.5/clean.sh
===================================================================
--- trunk/espresso/atomic_doc/pseudo-LDA-0.5/clean.sh	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/pseudo-LDA-0.5/clean.sh	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1 +1,2 @@
-rm -r results
+rm -r -f results
+rm -r -f *CRASH*

Modified: trunk/espresso/atomic/examples/pseudo-LDA-0.5/test.job
===================================================================
--- trunk/espresso/atomic_doc/pseudo-LDA-0.5/test.job	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/pseudo-LDA-0.5/test.job	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-LD1=../../bin/ld1.x
+LD1=../../../bin/ld1.x
 workd=./results/
 
 mkdir -p $workd

Copied: trunk/espresso/atomic/examples/pseudo-gen (from rev 8077, trunk/espresso/atomic_doc/pseudo-gen)

Modified: trunk/espresso/atomic/examples/pseudo-gen/test.job
===================================================================
--- trunk/espresso/atomic_doc/pseudo-gen/test.job	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/pseudo-gen/test.job	2011-08-23 09:39:15 UTC (rev 8100)
@@ -2,8 +2,8 @@
 
 work=./results
 reference=./reference
-. ../../examples/environment_variables
-BIN_DIR=../../bin
+. ../../../examples/environment_variables
+BIN_DIR=../../../bin
 
 mkdir $work
 rm -f $work/*

Copied: trunk/espresso/atomic/examples/pseudo-test (from rev 8077, trunk/espresso/atomic_doc/pseudo-test)

Modified: trunk/espresso/atomic/examples/pseudo-test/clean.sh
===================================================================
--- trunk/espresso/atomic_doc/pseudo-test/clean.sh	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/pseudo-test/clean.sh	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,3 +1,4 @@
 rm -rf results
 rm -f difference
 rm -f ld1*
+rm -rf *CRASH*

Modified: trunk/espresso/atomic/examples/pseudo-test/test.job
===================================================================
--- trunk/espresso/atomic_doc/pseudo-test/test.job	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/pseudo-test/test.job	2011-08-23 09:39:15 UTC (rev 8100)
@@ -2,8 +2,8 @@
 
 work=./results
 reference=./reference
-. ../../examples/environment_variables
-BIN_DIR=../../bin
+. ../../../examples/environment_variables
+BIN_DIR=../../../bin
 
 mkdir $work
 rm -f $work/*

Copied: trunk/espresso/atomic/examples/vdw-in-tfvw (from rev 8077, trunk/espresso/atomic_doc/vdw-in-tfvw)

Modified: trunk/espresso/atomic/examples/vdw-in-tfvw/test.job
===================================================================
--- trunk/espresso/atomic_doc/vdw-in-tfvw/test.job	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/examples/vdw-in-tfvw/test.job	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-LD1=../../bin/ld1.x
+LD1=../../../bin/ld1.x
 workd=./results/
 
 mkdir -p $workd

Deleted: trunk/espresso/atomic/export_upf.f90
===================================================================
--- trunk/espresso/atomic/export_upf.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/export_upf.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,429 +0,0 @@
-!
-! Copyright (C) 2008 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!---------------------------------------------------------------------
-SUBROUTINE export_upf(iunps)
-  !---------------------------------------------------------------------
-  !
-  use constants, only : fpi
-  use kinds, only : dp
-  use radial_grids, only : radial_grid_COPY, nullify_radial_grid, &
-                           deallocate_radial_grid
-  use ld1inc, only : author, nlcc, zval, lpaw, write_coulomb, &
-                     etots, rel, ecutwfc, ecutrho, iswitch, &
-                     nwfts, nbeta, lmax, which_augfun, elts, octs, llts, &
-                     nnts, rcutusts, rcutts, rcut, rcutus, els, ikk, nwfs, &
-                     lls, nns, ocs, beta, bmat, qq, qvan, qvanl, rcloc, lloc, &
-                     betas, grid, rhos, phits, psipaw, vpsloc, phis, &
-                     rmatch_augfun, etot, etots, jjs, pawsetup, nn, &
-                     core_state, ll, el, nwf, psi, vpot, nconf, zed, &
-                     jjts, vpstot, lltsc, rcuttsc, rcutustsc, eltsc, &
-                     lsave_wfc, wfc_ae_recon, wfc_ps_recon, tm, enlts, &
-                     nstoaets, pseudotype, enls, rhoc, vnl, vpsloc, &
-                     lgipaw_reconstruction, use_paw_as_gipaw
-  use funct, only: get_dft_name
-  use iotk_module, only: iotk_newline
-  !
-  use pseudo_types
-  use upf_module, only : write_upf, pseudo_config, deallocate_pseudo_config
-  !
-  implicit none
-  !
-  !CHARACTER(len=*),INTENT(IN) :: filename
-  INTEGER,INTENT(IN)::iunps
-  !
-  integer :: ibeta, jbeta, kbeta, l, ind, l1, l2
-  !
-  !     Local variables
-  !
-  integer :: nb, mesh
-  TYPE (pseudo_upf)              :: upf
-  TYPE (pseudo_config)           :: at_conf
-  TYPE (radial_grid_type),TARGET :: internal_grid
-  CHARACTER(len=2), external :: atom_name
-  CHARACTER(len=9) :: day, hour
-
-  call date_and_tim(day,hour)
-  !
-  CALL nullify_pseudo_upf( upf )
-  CALL nullify_radial_grid( internal_grid )
-  !
-  IF (iswitch < 4 ) THEN
-     upf%generated='Generated using "atomic" code by A. Dal Corso &
-                  & (Quantum ESPRESSO distribution)'
-  ELSE IF (iswitch==4) THEN
-     upf%generated='Generated using LDA-1/2 implemented by Leonardo&
-                  & Matheus Marion Jorge'
-  ENDIF
-  upf%author=trim(author)
-  upf%date=trim(day)
-  upf%nv = "2.0.1" ! format version
-  !
-  upf%zp   = zval
-  upf%nlcc = nlcc
-  upf%dft  = get_dft_name()
-  upf%psd  = atom_name(nint(zed))
-
-  if( pseudotype == 3) then
-     upf%tvanp = .true.
-     upf%typ='USPP'
-  else
-     upf%tvanp = .false.
-     upf%typ='NC'
-  endif
-  if(lpaw)          upf%typ='PAW'
-  if(write_coulomb) upf%typ='1/r'
-
-  upf%tpawp = lpaw
-  upf%tcoulombp = write_coulomb
-  upf%has_gipaw = lgipaw_reconstruction
-  upf%paw_as_gipaw = use_paw_as_gipaw
-  upf%etotps = etots
-  upf%has_so = (rel == 2)
-  IF (rel == 2) THEN
-      upf%rel='full'
-  ELSE IF (rel == 1) THEN
-      upf%rel='scalar'
-  ELSE IF (rel < 1) THEN
-      upf%rel='no'
-  ELSE
-      call errore('export_upf', 'Unknown relativistic',1)
-  ENDIF
-  !
-  upf%ecutwfc = ecutwfc
-  upf%ecutrho = max(ecutrho, ecutwfc*4._dp)
-  !
-  upf%nwfc = nwfts 
-  upf%nbeta = nbeta
-  !
-  if (.not. lpaw) then
-   upf%lmax = lmax
-   upf%q_with_l = (which_augfun == 'PSQ')
-  else
-   upf%lmax = pawsetup%lmax
-   upf%q_with_l = .true.
-  endif
-  upf%lmax_rho = 2*upf%lmax
-  upf%nqlc = 2* upf%lmax+1
-
-  call radial_grid_COPY(grid, internal_grid)
-  !
-  upf%grid => internal_grid
-  upf%mesh  = upf%grid%mesh
-  upf%dx    = upf%grid%dx
-  upf%xmin  = upf%grid%xmin
-  upf%zmesh = upf%grid%zmesh
-  upf%rmax  = upf%grid%rmax
-  !
-  upf%r   => upf%grid%r
-  upf%rab => upf%grid%rab
-  !
-  ! when possible, write semilocal PP's in the UPF file - may be
-  ! useful if one wants to use PPs in the UPF format in other codes
-  !
-  if( pseudotype == 1 ) then
-      if ( rel == 2 ) then
-        allocate(upf%vnl(1:grid%mesh, 0:upf%lmax,2))
-     else
-        allocate(upf%vnl(1:grid%mesh, 0:upf%lmax,1))
-     end if
-     do nb=1, nbeta
-        l=lls(nb)
-        if ( rel < 2 .or. l == 0 .or. &
-             abs(jjs(nb)-l+0.5_dp) < 0.001_dp) then
-           ind = 1
-        else if ( rel == 2 .and. l > 0 .and. &
-                  abs(jjs(nb)-l-0.5_dp) < 0.001_dp) then
-           ind = 2
-        endif
-        upf%vnl(1:grid%mesh,l,ind) = vnl(1:grid%mesh,l,ind) + &
-                                     vpsloc(1:grid%mesh)
-     end do
-  end if
-  !
-  allocate(upf%lll(nbeta))
-  upf%lll(1:nbeta) = lls(1:nbeta)
-  !
-  ! *initial* wavefunctions indexes and parameters
-  allocate(upf%els(upf%nwfc), upf%oc(upf%nwfc), &
-           upf%nchi(upf%nwfc), upf%lchi(upf%nwfc), &
-           upf%epseu(upf%nwfc), upf%rcut_chi(upf%nwfc), &
-           upf%rcutus_chi(upf%nwfc) )
-  upf%els(1:upf%nwfc)   = elts(1:upf%nwfc)
-  upf%oc(1:upf%nwfc)    = octs(1:upf%nwfc)
-  upf%lchi(1:upf%nwfc)  = llts(1:upf%nwfc)
-  upf%nchi(1:upf%nwfc)  = nnts(1:upf%nwfc)
-  upf%epseu(1:upf%nwfc) = enlts(1:upf%nwfc)
-  upf%rcut_chi(1:upf%nwfc)   = rcutts(1:upf%nwfc)
-  upf%rcutus_chi(1:upf%nwfc) = rcutusts(1:upf%nwfc)
-  !
-  ! projectors indexes and parameters
-  !
-  allocate(upf%kbeta(nbeta), upf%els_beta(nbeta),&
-           upf%rcut(nbeta), upf%rcutus(nbeta))
-  do nb=1,nbeta
-     upf%kbeta(nb)   = ikk(nb)
-     upf%els_beta(nb)= els(nb)
-     upf%rcut(nb)    = rcut(nb)
-     upf%rcutus(nb)  = rcutus(nb)
-  end do
-  upf%kkbeta = maxval(upf%kbeta(1:nbeta))
-  !
-  ! Save GENERATION configuration: not needed to use the pseudopotential, 
-  ! but must be saved for reference and for re-generating the pseudo
-  !
-   at_conf%nwfs  = nwfs
-   if (tm) then
-      at_conf%pseud = 'troullier-martins'
-   else
-      at_conf%pseud = 'rrkj'
-   endif
-
-   allocate(at_conf%els   (nwfs),&
-            at_conf%nns   (nwfs),&
-            at_conf%lls   (nwfs),&
-            at_conf%ocs   (nwfs),&
-            at_conf%rcut  (nwfs),&
-            at_conf%rcutus(nwfs),&
-            at_conf%enls  (nwfs))
-   at_conf%els   (1:nwfs) = els   (1:nwfs) ! label (char*2)
-   at_conf%nns   (1:nwfs) = nns   (1:nwfs) ! n
-   at_conf%lls   (1:nwfs) = lls   (1:nwfs) ! l
-   at_conf%ocs   (1:nwfs) = ocs   (1:nwfs) ! occupation
-   at_conf%rcut  (1:nwfs) = rcut  (1:nwfs) ! inner cutoff radius
-   at_conf%rcutus(1:nwfs) = rcutus(1:nwfs) ! outer cutoff radius
-   at_conf%enls  (1:nwfs) = enls  (1:nwfs) ! one-particle energy
-
-
-  ! projectors
-  allocate(upf%beta(grid%mesh, upf%nbeta))
-  upf%beta(1:grid%mesh, 1:upf%nbeta) = betas(1:grid%mesh, 1:nbeta)
-  !
-  ! hamiltonian terms
-  allocate(upf%dion(upf%nbeta, upf%nbeta))
-  upf%dion(1:upf%nbeta, 1:upf%nbeta) = bmat(1:nbeta, 1:nbeta)
-  !
-  if (pseudotype.eq.3) then
-     allocate(upf%qqq(upf%nbeta, upf%nbeta))
-     upf%qqq(1:upf%nbeta,1:upf%nbeta) = qq(1:nbeta,1:nbeta)
-     !
-     upf%qqq_eps = 1.e-12_dp ! (hardcoded)
-     upf%nqf = 0             ! polinomial expansion of aug.charge is not supported by atomic
-     !
-     if (upf%q_with_l .or. lpaw) then
-        allocate(upf%qfuncl(upf%mesh, upf%nbeta*(upf%nbeta+1)/2, 0:2*upf%lmax))
-     else
-        allocate(upf%qfunc(upf%mesh, upf%nbeta*(upf%nbeta+1)/2))
-     endif
-     !
-     if(lpaw) qvanl(1:grid%mesh,:,:,:) = pawsetup%augfun(1:grid%mesh,:,:,:)
-     do ibeta=1,nbeta
-        do jbeta=ibeta,nbeta
-           kbeta = jbeta * (jbeta-1) / 2 + ibeta
-           if (upf%q_with_l .or. lpaw) then
-              l1=upf%lll(ibeta)
-              l2=upf%lll(jbeta)
-              do l=abs(l1-l2), l1+l2
-                 upf%qfuncl(1:grid%mesh,kbeta,l) = qvanl(1:grid%mesh,ibeta,jbeta,l)
-              enddo
-           else
-              upf%qfunc(1:grid%mesh,kbeta) = qvan (1:grid%mesh, ibeta, jbeta)
-           endif
-        enddo
-     enddo
-     !
-  endif
-  !
-  allocate(upf%rho_atc(upf%mesh))
-  if (upf%nlcc) then
-     upf%rho_atc(1:grid%mesh) = rhoc(1:grid%mesh)/fpi/grid%r2(1:grid%mesh)
-  else
-     upf%rho_atc(:) = 0.0_dp
-  end if
-
-  allocate(upf%rho_at(upf%mesh))
-  upf%rho_at (1:grid%mesh) = rhos (1:grid%mesh,1)
-  !
-  allocate(upf%chi(upf%mesh,upf%nwfc))
-  upf%chi(1:grid%mesh,1:upf%nwfc) = phits(1:grid%mesh,1:upf%nwfc)
-  !
-  allocate(upf%vloc(upf%mesh))
-  upf%vloc(1:grid%mesh) = vpsloc(1:grid%mesh)
-  upf%lloc = lloc
-  upf%rcloc = rcloc
-  !
-  !
-  if (upf%has_so)    CALL export_upf_so()
-  if (upf%tpawp)     CALL export_upf_paw()
-  if (upf%has_gipaw) CALL export_upf_gipaw()
-  upf%has_wfc = lsave_wfc
-  if (upf%has_wfc)   CALL export_upf_wfc()
-  !
-  CALL write_upf(upf, at_conf, unit=iunps)
-  !
-  CALL deallocate_pseudo_upf( upf )
-  CALL deallocate_radial_grid( internal_grid )
-  CALL deallocate_pseudo_config( at_conf )
-
-   RETURN
-
- CONTAINS
-
-   SUBROUTINE export_upf_wfc
-      ALLOCATE( upf%aewfc(upf%mesh, upf%nbeta), upf%pswfc(upf%mesh, upf%nbeta) )
-      upf%aewfc(1:upf%mesh,1:upf%nbeta) = psipaw(1:upf%mesh,1:upf%nbeta)
-      upf%pswfc(1:upf%mesh,1:upf%nbeta) = phis(1:upf%mesh,1:upf%nbeta)
-   END SUBROUTINE export_upf_wfc
-
-   SUBROUTINE export_upf_so
-      ALLOCATE( upf%nn(upf%nwfc), upf%jchi(upf%nwfc), upf%jjj(upf%nbeta) )
-
-      upf%els(1:upf%nwfc)  = elts(1:upf%nwfc)
-      upf%nn(1:upf%nwfc)   = nnts(1:upf%nwfc)
-      upf%lchi(1:upf%nwfc) = llts(1:upf%nwfc)
-      upf%jchi(1:upf%nwfc) = jjts(1:upf%nwfc)
-      !
-      upf%lll(1:upf%nbeta) = lls(1:upf%nbeta)
-      upf%jjj(1:upf%nbeta) = jjs(1:upf%nbeta)
-
-   END SUBROUTINE export_upf_so
-   !
-   SUBROUTINE export_upf_paw
-      INTEGER :: co,n   !EMINE
-      upf%paw_data_format = 2
-      !
-      upf%paw%core_energy = etot -etots
-      upf%paw%lmax_aug = 2*upf%lmax
-      upf%paw%augshape = which_augfun
-      upf%paw%raug     = rmatch_augfun
-      upf%paw%iraug    = pawsetup%irc
-
-      allocate(upf%paw%ae_rho_atc(upf%mesh))
-      upf%paw%ae_rho_atc(1:upf%mesh) = pawsetup%aeccharge(1:upf%mesh)/fpi/grid%r2(1:grid%mesh)
-      !
-      allocate(upf%paw%ae_vloc(upf%mesh))
-      upf%paw%ae_vloc(1:upf%mesh)    = pawsetup%aeloc(1:upf%mesh)
-      !
-      allocate(upf%paw%oc(upf%nbeta))
-      do nb = 1,upf%nbeta
-         upf%paw%oc(nb)  = max(pawsetup%oc(nb),0._dp)
-      enddo
-      !
-      allocate(upf%paw%augmom(upf%nbeta, upf%nbeta, 0:2*upf%lmax))
-      upf%paw%augmom(1:upf%nbeta,1:upf%nbeta,0:2*upf%lmax) &
-            = pawsetup%augmom(1:upf%nbeta,1:upf%nbeta,0:2*upf%lmax)
-      !
-      upf%kkbeta = max(upf%kkbeta, upf%paw%iraug)
-
-      IF (upf%has_so) THEN
-         ALLOCATE( upf%paw%aewfc_rel(upf%mesh, upf%nbeta) )
-         upf%paw%aewfc_rel(1:upf%mesh,1:upf%nbeta) = &
-                              pawsetup%aewfc_rel(1:upf%mesh,1:upf%nbeta)
-      ENDIF
-      !
-      !upf%paw%pfunc(:)  = not used when writing, reconstructed from upf%aewfc
-      !upf%paw%ptfunc(:) = not used when writing, reconstructed from upf%pswfc
-      !===============================================================
-      !For PAW pseudopotentials, now we also include core information:
-      !even when lgipaw_reconstruction = .false.
-      !EMINE
-      upf%gipaw_ncore_orbitals = COUNT(core_state(1:nwf))
-      co = upf%gipaw_ncore_orbitals
-      ALLOCATE ( &
-         upf%gipaw_core_orbital_n(co), &
-         upf%gipaw_core_orbital_l(co), &
-         upf%gipaw_core_orbital_el(co), &
-         upf%gipaw_core_orbital(upf%mesh,co))
-      upf%gipaw_core_orbital_n(1:co)  = nn(1:co)
-      upf%gipaw_core_orbital_l(1:co)  = ll(1:co)
-      upf%gipaw_core_orbital_el(1:co) = el(1:co)
-      DO n = 1,co
-         upf%gipaw_core_orbital(1:upf%mesh,n) &
-            = psi(1:upf%mesh,1,n)
-      ENDDO
-      !================================================================
-      RETURN
-   END SUBROUTINE export_upf_paw
-   SUBROUTINE export_upf_gipaw
-      INTEGER :: co,nw,n,nb
-
-      IF ( nconf /= 1 ) CALL errore ( "write_gipaw_orbitals", &
-            "The (GI)PAW reconstruction requires one test configuration", abs(nconf) )
-
-      upf%gipaw_data_format = 2  ! The version of the format
-
-      upf%gipaw_ncore_orbitals = COUNT(core_state(1:nwf))
-      co = upf%gipaw_ncore_orbitals
-      upf%gipaw_wfs_nchannels  = nwfts
-      nw = upf%gipaw_wfs_nchannels
-
-      ALLOCATE ( &
-         upf%gipaw_core_orbital_n(co), &
-         upf%gipaw_core_orbital_l(co), &
-         upf%gipaw_core_orbital_el(co), &
-         upf%gipaw_core_orbital(upf%mesh,co), &
-         upf%gipaw_wfs_el(nw), &
-         upf%gipaw_wfs_ll(nw), &
-         upf%gipaw_wfs_rcut(nw), &
-         upf%gipaw_wfs_rcutus(nw), &
-         upf%gipaw_wfs_ae(upf%mesh,nw), &
-         upf%gipaw_wfs_ps(upf%mesh,nw), &
-         upf%gipaw_vlocal_ae(upf%mesh), &
-         upf%gipaw_vlocal_ps(upf%mesh) &
-         )
-
-      upf%gipaw_core_orbital_n(1:co)  = nn(1:co)
-      upf%gipaw_core_orbital_l(1:co)  = ll(1:co)
-      upf%gipaw_core_orbital_el(1:co) = el(1:co)
-
-      DO n = 1,co
-         upf%gipaw_core_orbital(1:upf%mesh,n) &
-            = psi(1:upf%mesh,1,n)
-      ENDDO
-
-      upf%gipaw_vlocal_ae(1:upf%mesh) &
-            = grid%r(1:upf%mesh) * vpot(1:mesh,1)
-      upf%gipaw_vlocal_ps(1:upf%mesh) &
-            = grid%r(1:upf%mesh) * vpstot(1:mesh,1)
-
-      upf%gipaw_wfs_el(1:nw)     = elts(1:nw)
-      upf%gipaw_wfs_ll(1:nw)     = lltsc(1:nw,1)
-
-     ! Find the suitable core radii to be written out
-     !*apsi WARNING: DOES NOT WORK WITH VANDERBILT PP YET
-      DO nb = 1,nw
-         upf%gipaw_wfs_rcut(nb) = -1.0_dp
-         DO n = 1, nwfs
-            IF ( els(n) == eltsc(nb,1) ) THEN
-               upf%gipaw_wfs_rcut(nb)   = rcuttsc(nb,1)
-               upf%gipaw_wfs_rcutus(nb) = rcutustsc(nb,1)
-            END IF
-         END DO
-         !
-         IF ( upf%gipaw_wfs_rcut(nb) < 0.0_dp ) THEN
-            DO n = 1, nwfs
-               ! If there is one with the same l...
-               IF ( lltsc(nb,1) == lls(n) ) THEN
-                  upf%gipaw_wfs_rcut(nb)   = rcuttsc(nb,1)
-                  upf%gipaw_wfs_rcutus(nb) = rcutustsc(nb,1)
-               END IF
-            END DO
-         END IF
-      ENDDO
-
-      DO n = 1,nw
-         !
-         upf%gipaw_wfs_ae(1:upf%mesh,n) = wfc_ae_recon(1:upf%mesh,nstoaets(n))
-         !
-         upf%gipaw_wfs_ps(1:upf%mesh,n) = wfc_ps_recon(1:upf%mesh,n)
-      ENDDO
-
-
-      RETURN
-   END SUBROUTINE export_upf_gipaw
-   !
-END SUBROUTINE export_upf

Deleted: trunk/espresso/atomic/find_qi.f90
===================================================================
--- trunk/espresso/atomic/find_qi.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/find_qi.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,160 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!--------------------------------------------------------------------------
-subroutine find_qi(logderae,xc,ik,lam,ncn,flag,iok)
-  !--------------------------------------------------------------------------
-  !
-  !      This routine finds three values of q such that the
-  !      functions f_l have a logarithmic derivative equal to
-  !      logderae at the point ik
-  !
-  !      f_l=j_l(r) * r**flag
-  !
-  use kinds, only:dp
-  use ld1inc, only: grid
-  implicit none
-
-  integer,parameter ::  ncmax=10   ! maximum allowed nc
-
-  integer ::      &
-       ik,    & ! input: the point corresponding to rcut
-       ncn,   & ! input: the number of qi to compute
-       flag,  & ! input: the type of function
-       iok,   & ! output: if 0 the calculation in this routine is ok
-       lam      ! input: the angular momentum
-
-  real(DP) :: &
-       xc(ncn),& ! output: the values of qi
-       logderae  ! input: the logarithmic derivative
-
-
-  real(DP) ::   &
-       j1(ncmax),& ! the bessel function in three points
-       qmax,qmin,& ! the limits of the q search
-       logdermax,logdermin,& ! the maximum and minimum logder
-       logder, & ! the actual logder
-       jlmin, jlmax, & ! the value of jl in qmin and qmax
-       compute_log, &! function for log derivative
-       dq, dq_0 ! the step to braket the q
-
-  integer ::    &
-       nc,  &    ! counter on the q found
-       icount, &  ! too many iterations
-       imax,&   ! maximum number of iteration to braket
-       iq      ! counter on iteration
-
-  iok=0
-  if (ncn.gt.ncmax) &
-       call errore('find_qi','ncn is too large',1)
-
-  if (flag.eq.0.and.lam.ne.0) &
-       call errore('find_qi','lam too large for this iflag',1)
-
-  if (lam.gt.6) &
-       call errore('find_qi','l not programmed',1)
-  !
-  !    fix deltaq and the maximum step number
-  !
-  dq_0=0.05_dp
-  imax=600
-  !
-  !    prepare for the first iteration  
-  !
-  qmax=0.1_dp
-  call sph_bes(7,grid%r(ik-3),qmax,lam,j1)
-  j1(1:7) = j1(1:7)*grid%r(ik-3:ik+3)**flag
-  logdermax=compute_log(j1,grid%r(ik),grid%dx)-logderae
-  jlmax = j1(4)
-
-  icount=0
-  do nc=1,ncn
-     !
-     !    bracket the zero
-     !
-200  dq=dq_0
-     qmin=qmax
-     logdermin=logdermax
-     jlmin = jlmax
-     do iq=1,imax
-        qmax=qmin+dq
-        call sph_bes(7,grid%r(ik-3),qmax,lam,j1)
-        j1(1:7) = j1(1:7)*grid%r(ik-3:ik+3)**flag
-        logdermax=compute_log(j1,grid%r(ik),grid%dx)-logderae
-        jlmax = j1(4)
-        !
-        !    the zero has been bracketed?
-        !
-        if ( jlmin * jlmax .gt. 0.0_dp ) then ! far from an asintote
-           !
-           if (logdermax*logdermin.lt.0.0_dp) goto 100
-           !
-           qmin = qmax
-           logdermin=logdermax
-           jlmin = jlmax
-        else
-           if (logdermax*logdermin.lt.0.0_dp) then
-              qmin = qmax
-              logdermin=logdermax
-              jlmin = jlmax
-           else
-              dq = 0.5_dp * dq
-           end if
-        end if
-     enddo
-     call infomsg ('find_qi','qmax not found ')
-     iok=1
-     return
-100  continue
-     !
-     !      start bisection loop
-     !
-     xc(nc)=qmin+(qmax-qmin)/2.0_dp
-     call sph_bes(7,grid%r(ik-3),xc(nc),lam,j1)
-     j1(1:7) = j1(1:7)*grid%r(ik-3:ik+3)**flag
-     logder=compute_log(j1,grid%r(ik),grid%dx)-logderae
-     if (logder*logdermin.lt.0.0_dp) then
-        qmax=xc(nc)
-        logdermax=logder
-     else
-        qmin=xc(nc)
-        logdermin=logder
-     endif
-     !
-     !    avoid the asintotes
-     !
-     if (abs(logdermin-logdermax).gt.1.e3_dp) then 
-        qmax=xc(nc)  
-        logdermax=logder
-        goto 200
-     endif
-     !
-     !    check for convergence
-     !
-     icount=icount+1
-     if (icount>1000) call errore('find_q','too many iterations',1)
-     if (abs(logdermax-logdermin).gt.1.e-8_dp) goto 100
-  enddo
-
-  return
-end subroutine find_qi
-
-function compute_log(j1,rj,dx)
-  use kinds, only : DP
-  implicit none
-  real(DP) ::   &
-       compute_log, &
-       deriv_7pts,  &
-       dx,          &
-       j1(7),       &
-       rj(2)    
-
-  !      compute_log=(j1(2)-j1(1))*2.0_dp/( (rj(2)-rj(1))*(j1(2)+j1(1)) )
-  compute_log=deriv_7pts(j1,4,rj(1),dx)/j1(4)
-
-  return
-end function compute_log

Deleted: trunk/espresso/atomic/gener_pseudo.f90
===================================================================
--- trunk/espresso/atomic/gener_pseudo.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/gener_pseudo.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,518 +0,0 @@
-!
-! Copyright (C) 2004-2008 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!--------------------------------------------------------------------------
-subroutine gener_pseudo
-  !--------------------------------------------------------------------------
-  !
-  !     This routine generate a pseudopotential in separable form
-  !     It can be of NC type or of US type
-  !     Multiple projections are allowed.
-  !     Spin-orbit split pseudopotentials are also available.
-  !     NB: bmat indices are as in the Vanderbilt paper PRB (1990)
-  !
-  !     The output of the routine are:
-  !
-  !     phis: the pseudo wavefunctions
-  !     betas: the nonlocal projectors
-  !     bmat:  the pseudopotential coefficients
-  !     qq:    the integrals of the q functions
-  !     qvan:  the augmentation functions
-  !     vpsloc: the local pseudopotential
-  !     chis:   auxiliary functions
-  !
-  !
-  !     The construction of a PAW dataset can also be done (experimental)
-  !      
-  use kinds, only: dp
-  use radial_grids, only: ndmx
-  use ld1_parameters, only: nwfsx
-  use io_global, only : stdout, ionode, ionode_id
-  use mp,        only : mp_bcast
-  use ld1inc, only: grid, lls, jjs, new, psipaw, psi, ecutwfc, ecutrho, &
-                    psipsus, tm, ocs, phis, els, nwfs, nspin, rel, nlcc, &
-                    file_chi, file_beta, file_wfcncgen, file_qvan, &
-                    file_wfcusgen, file_wfcaegen, psccharge, aeccharge, &
-                    qvan, qvanl, qq, bmat, ddd, betas, nbeta, ikk, pseudotype, &
-                    pawsetup, zval, vpsloc, vpot, vnl, lpaw, rcloc, rcutus, &
-                    enl, enls, rcut, chis, nstoae, rmatch_augfun,&
-                    lnc2paw, rhos, which_augfun, psipaw_rel, &
-                    cau_fact, ik, ikus
-  use atomic_paw, only : us2paw, paw2us
-  implicit none
-
-  integer ::   &
-       ikloc, &  ! the point corresponding to rc local
-       ns,    &  ! counter on pseudo functions
-       ns1,   &  ! counter on pseudo functions
-       nnode, &  ! the number of nodes of phi
-       lam,   &  ! the angular momentum
-       irc       ! the maximum radius of the sphere
-
-  real(DP) ::    &
-       xc(8),         &  ! parameters of bessel functions
-       psi_in(ndmx),  &  ! the all_electron wavefunction
-       gi(ndmx),      &  ! auxiliary to compute the integrals
-       occ, norm1, norm2, &  !
-       speed,        & ! an estimate of electron speed at rcutus
-       db, work(nwfsx)   ! work space
-
-  real(DP), allocatable :: &
-       b(:,:), binv(:,:) ! the B matrix and its inverse
-
-  real(DP) ::    &
-       aekin(nwfsx,nwfsx),  & ! AE kinetic energies
-       pskin(nwfsx,nwfsx),  & ! PS kinetic energies
-       kindiff(nwfsx,nwfsx)   ! AE-PS k.e.
-
-  real(DP), external :: int_0_inf_dr    ! the function calculating the integral 
-
-  character(len=6), external :: int_to_char
-
-  integer :: &
-       n, nwf0, nst, ikl, &
-       is, ios, ind, nmax
-
-  character(len=5) :: indqvan
-  character(len=256) :: filename
-
-  logical :: &
-       lbes4     ! use 4 Bessel functions expansion
-
-  ! additional vars for paw
-  real(DP) :: vpotpaw (ndmx) ! total potential to be used for PAW 
-                             ! generation (normally the AE potential)
-
-  if (lpaw) then
-     write(stdout, &
-          '(/,5x,21(''-''),'' Generating PAW atomic setup '',20(''-''),/)')
-  elseif (pseudotype == 1.or.pseudotype == 2) then
-     write(stdout, &
-          '(/,5x,21(''-''),'' Generating NC pseudopotential '',21(''-''),/)')
-  elseif (pseudotype == 3) then
-     write(stdout, &
-          '(/,5x,21(''-''),'' Generating US pseudopotential '',21(''-''),/)')
-  else
-     call errore('gener_pseudo','pseudotype not programmed',1)
-  endif
-  if (pseudotype == 1.and.rel == 2) call errore('gener_pseudo', &
-       'not programmed' ,2)
-  if (pseudotype /= 3.and. lpaw) call errore('gener_pseudo', &
-       'please start from a US for generating a PAW dataset' ,pseudotype)
-  psipaw=0.0_dp
-  phis=0.0_dp
-  !
-  !   compute the local potential from the all-electron potential
-  !
-  call pseudovloc ( )
-  !
-  !   initialize total potential for PAW generation
-  if (lpaw) then
-     if (.not.lnc2paw) then
-        vpotpaw(1:grid%mesh) = vpot(1:grid%mesh,1)
-     else
-        vpotpaw(1:grid%mesh) = vpsloc(1:grid%mesh)
-     end if
-  endif
-  !
-  !   if nlcc is true compute here the core charge
-  !   the core charge is needed also for the PAW dataset
-  !
-  if (nlcc .or. lpaw) call set_rho_core
-  !
-  !   set the appropriate energies and the correspondence all-electron
-  !   pseudo
-  !
-  do n=1,nwfs
-     if (enls(n) == 0.0_dp) enls(n)=enl(nstoae(n))
-  enddo
-  !
-  ik=0
-  ikus=0
-  ikloc=0
-  do ns=1,nbeta
-     do n=1,grid%mesh
-        if (grid%r(n).lt.rcut(ns)) ik(ns)=n
-        if (grid%r(n).lt.rcutus(ns)) ikus(ns)=n
-        if (grid%r(n).lt.rcloc) ikloc=n
-     enddo
-     if (mod(ik(ns),2) == 0) ik(ns)=ik(ns)+1
-     if (mod(ikus(ns),2) == 0) ikus(ns)=ikus(ns)+1
-     if (mod(ikloc,2) == 0) ikloc=ikloc+1
-     if (ik(ns).gt.grid%mesh) call errore('gener_pseudo','ik is wrong ',ns)
-     if (ikus(ns)+10.gt.grid%mesh) call errore('gener_pseudo','ikus is wrong ',ns)
-     if (ikloc+5.gt.grid%mesh) call errore('gener_pseudo','ikloc is wrong ',ns)
-     if (pseudotype == 3) then
-        ikk(ns)=max(ikus(ns)+10,ikloc+5)
-     else
-        ikk(ns)=max(ik(ns)+10,ikloc+5)
-     endif
-     if (ikk(ns).gt.grid%mesh) call errore('gener_pseudo','ikk is wrong ',ns)
-  end do
-  do ns=1,nbeta
-     do ns1=1,nbeta
-        if (lls(ns) == lls(ns1).and.ikk(ns1).gt.ikk(ns)) &
-             ikk(ns)=ikk(ns1)
-     enddo
-  enddo
-  irc = maxval(ikk(1:nbeta))+8
-  IF (mod(irc,2) == 0) irc=irc+1
-  IF (irc>grid%mesh) CALL errore('gener_pseudo','irc is too large',1)
-  !
-  ! Set the all-electron wavefunctions, calculating those at user supplied
-  ! energies. The wavefunctions are written on file at this point, so
-  ! the user can check them also when the pseudopotential generation is  
-  ! unsuccessful
-  ! 
-  IF (rel==2) WRITE(stdout,'(/,5x,"Fully relativistic calculation: |psi|^2")')
-  do ns=1,nbeta
-     nwf0=nstoae(ns)
-     if (new(ns)) then
-        if(lpaw)then !AE scattering wfc normalized with rcutus
-           call set_psi_in(ikus(ns),lls(ns),jjs(ns),enls(ns),psipaw(1,ns),&
-                                                        psipaw_rel(1,ns))
-        else
-           call set_psi_in(ik(ns),lls(ns),jjs(ns),enls(ns),psipaw(1,ns),&
-                                                        psipaw_rel(1,ns))
-        endif
-     else
-        lam=lls(ns)
-        nst=(lam+1)*2
-        psipaw(:,ns)=psi(:,1,nwf0)
-        do n=1,grid%mesh
-           gi(n)=psipaw(n,ns)*psipaw(n,ns)
-        enddo
-        norm1=sqrt(int_0_inf_dr(gi,grid,grid%mesh,nst))
-        IF (rel==2) THEN
-           psipaw_rel(:,ns)=psi(:,2,nwf0)
-           DO n=1,irc
-              gi(n)=psipaw_rel(n,ns)*psipaw_rel(n,ns)
-           ENDDO
-           norm2=sqrt(int_0_inf_dr(gi,grid,irc,nst))
-           WRITE(stdout,'(/,5x,"Wfc ",a2," LC norm =",f12.8," SC norm ="&
-                         &,f12.8," missing",f12.8)') els(ns), norm1**2, &
-                         norm2**2, 1.0_DP-(norm1**2+norm2**2)
-           norm1=sqrt(norm1**2+norm2**2)
-           psipaw_rel(:,ns)=psipaw_rel(:,ns)/norm1
-           IF (lpaw) THEN
-              speed=psipaw(ikus(ns),ns)*(enls(ns)-vpotpaw(ikus(ns))) &
-                   *psipaw(ikus(ns),ns)
-              WRITE(stdout,'(5x,"Speed at rcutus ",f10.3, " a.u.,  &
-                   &v/c =",f10.6,",  (v/c)^2 =",f12.8 )') sqrt(abs(speed)), &
-                                sqrt(abs(speed)/cau_fact**2),speed/cau_fact**2
-           END IF
-        END IF   
-        psipaw(:,ns)=psipaw(:,ns)/norm1
-     END IF
-  END DO
-
-  call write_wfcfile(file_wfcaegen,psipaw,els,nwfs)
-  !
-  !   compute the pseudowavefunctions by expansion in spherical
-  !   bessel function before r_c
-  !
-  ecutrho=0.0_dp
-  ecutwfc=0.0_dp
-  do ns=1,nbeta
-     lam=lls(ns)
-     nst=(lam+1)*2
-     nwf0=nstoae(ns)
-
-     if (new(ns)) then
-        occ=1.0_DP
-     else
-        occ=ocs(ns)
-     endif
-     !
-     !   save the all-electron function for the PAW setup
-     !
-     psi_in(1:grid%mesh) = psipaw(1:grid%mesh,ns) 
-     !
-     !  compute the phi functions
-     !
-     if (lpaw.and.lnc2paw) then
-        ! first compute possibly harder NC pseudowfcs to be
-        ! used as AE reference for PAW generation
-        nnode=0
-        call compute_phi(lam,ik(ns),psi_in,phis(1,ns),xc,1,occ,enls(ns),els(ns))
-        psipaw(1:grid%mesh,ns)=phis(1:grid%mesh,ns)
-     endif
-     !
-!     IF (which_augfun=='PSQ' .and. .not. lpaw) THEN
-     IF ((which_augfun=='PSQ'.AND.ik(ns)/=ikus(ns)).OR.&
-                             (lpaw.AND..NOT.lnc2paw)) THEN
-        psipsus(:,ns)=psi_in(:) 
-     ELSE
-        if (tm) then
-           call compute_phi_tm(lam,ik(ns),psi_in,phis(1,ns),1,xc,enls(ns),els(ns))
-        else
-           call compute_phi(lam,ik(ns),psi_in,phis(1,ns),xc,1,occ,enls(ns),els(ns))
-           ecutrho=max(ecutrho,8.0_dp*xc(6)**2)
-        endif
-     !
-     !   US only on the components where ikus <> ik
-     ! 
-        psipsus(:,ns)=phis(:,ns) 
-     ENDIF
-     if (ikus(ns).ne.ik(ns)) then
-        call compute_phius(lam,ikus(ns),psipsus(1,ns),phis(1,ns),xc,1,els(ns))
-        ecutwfc=max(ecutwfc,2.0_dp*xc(5)**2)
-        lbes4=.true.
-     else
-        lbes4=.false.
-        if (.not.tm) ecutwfc=max(ecutwfc,2.0_dp*xc(6)**2)
-     endif
-     if (tm.and.ik(ns)==ikus(ns)) then
-        call compute_chi_tm(lam,ik(ns),ikk(ns),phis(1,ns),chis(1,ns),xc,enls(ns))
-     else
-        call compute_chi(lam,ikk(ns),phis(1,ns),chis(1,ns),xc,enls(ns),lbes4)
-     endif
-  enddo
-  !
-  !    for each angular momentum take the same integration point
-  !
-  !
-  !     construct B_{ij}
-  !
-  bmat=0.0_dp
-  do ns=1,nbeta
-     do ns1=1,nbeta
-        if (lls(ns) == lls(ns1).and.abs(jjs(ns)-jjs(ns1)).lt.1.e-7_dp) then
-           nst=(lls(ns)+1)*2
-           ikl=ikk(ns1)
-           do n=1,grid%mesh
-              gi(n)=phis(n,ns)*chis(n,ns1)
-           enddo
-           bmat(ns,ns1)=int_0_inf_dr(gi,grid,ikl,nst)
-        endif
-     enddo
-  enddo
-
-  allocate ( b(nbeta, nbeta), binv(nbeta, nbeta) )
-
-  if (pseudotype == 1) then
-     !
-     !     NC single-projector PP: construct the semilocal potential 
-     !
-     vnl=0.0_dp
-     do ns=1,nbeta
-        lam=lls(ns)
-        if ( rel < 2 .or. lls(ns) == 0 .or. &
-             abs(jjs(ns)-lls(ns)+0.5_dp) < 0.001_dp) then
-           ind=1
-        else if ( rel == 2 .and. lls(ns) > 0 .and. &
-             abs(jjs(ns)-lls(ns)-0.5_dp) < 0.001_dp) then
-           ind=2
-        endif
-        do n=1,ikk(ns)
-           vnl(n,lam,ind) = chis(n,ns)/phis(n,ns)
-        enddo
-     enddo
-     !
-  else if (pseudotype == 2) then
-     !
-     !     symmetrize the B matrix
-     !
-     do ns=1,nbeta
-        do ns1=1,ns-1
-           bmat(ns,ns1)=0.5_dp*(bmat(ns,ns1)+bmat(ns1,ns))
-           bmat(ns1,ns)=bmat(ns,ns1)
-        enddo
-     enddo
-  end if
-  !
-  do ns=1,nbeta
-     do ns1=1,nbeta
-        b(ns,ns1)=bmat(ns,ns1)
-     enddo
-  enddo
-  !
-  !   compute the inverse of the matrix B_{ij}:  B_{ij}^-1
-  !
-  write(stdout,'(/5x,'' The bmat matrix'')')
-  do ns1=1,nbeta
-     write(stdout,'(6f12.5)') (bmat(ns1,ns),ns=1,nbeta)
-  enddo
-  if (nbeta > 0) call invmat(nbeta, b, binv, db)
-  !
-  !   compute the beta functions
-  !
-  betas=0.0_dp
-  do ns=1,nbeta
-     do ns1=1,nbeta
-        do n=1,grid%mesh
-           betas(n,ns)=betas(n,ns)+ binv(ns1,ns)*chis(n,ns1)
-        enddo
-     enddo
-  enddo
-  deallocate (b, binv)
-  !
-  qq=0.0_dp
-  if (pseudotype == 3) then
-     !
-     !    compute the Q functions
-     !
-     do ns=1,nbeta
-        do ns1=1,ns
-           ikl=max(ikk(ns),ikk(ns1))
-           if (which_augfun=='PSQ'.and.rel==2) then
-              do n=1, ikl
-                 qvan(n,ns,ns1) = psipsus(n,ns) * psipsus(n,ns1) &
-                      + psipaw_rel(n,ns) * psipaw_rel(n,ns1) &
-                      - phis(n,ns) * phis(n,ns1)
-                 gi(n)=qvan(n,ns,ns1)
-              enddo
-           else
-              do n=1, ikl
-                 qvan(n,ns,ns1) = psipsus(n,ns) * psipsus(n,ns1) &
-                      - phis(n,ns) * phis(n,ns1)
-                 gi(n)=qvan(n,ns,ns1)
-              enddo
-           end if
-
-           do n=ikl+1,grid%mesh
-              qvan(n,ns,ns1)=0.0_dp
-           enddo
-           !
-           !     and puts its integral in qq
-           !
-           if (lls(ns) == lls(ns1).and.abs(jjs(ns)-jjs(ns1)).lt.1.e-8_dp) then
-              nst=(lls(ns)+1)*2
-              qq(ns,ns1)=int_0_inf_dr(gi,grid,ikl,nst)
-           endif
-           !
-           !     set the bmat with the eigenvalue part
-           !
-           bmat(ns,ns1)=bmat(ns,ns1)+enls(ns1)*qq(ns,ns1)
-           !
-           !    Use symmetry of the n,ns1 indeces to set qvan and qq and bmat
-           !
-           if (ns.ne.ns1) then
-              do n=1,grid%mesh
-                 qvan(n,ns1,ns)=qvan(n,ns,ns1)
-              enddo
-              qq(ns1,ns)=qq(ns,ns1)
-              bmat(ns1,ns)=bmat(ns1,ns)+enls(ns)*qq(ns1,ns)
-           endif
-        enddo
-     enddo
-     write(stdout,'(/5x,'' The bmat + epsilon qq matrix'')')
-     do ns1=1,nbeta
-        write(stdout,'(6f12.5)') (bmat(ns1,ns),ns=1,nbeta)
-     enddo
-     write(stdout,'(/5x,'' The qq matrix'')')
-     do ns1=1,nbeta
-        write(stdout,'(6f12.5)') (qq(ns1,ns),ns=1,nbeta)
-     enddo
-  endif
-
-  do is=1,nspin
-     ddd(:,:,is)=bmat(:,:)
-  enddo
-  !
-  !    generate a PAW dataset if required
-  !
-  if (lpaw) then
-     if (lnc2paw) write (stdout,'(/5x,''WARNING: __PAW_FROM_NC__'')')
-     !
-     !symbol=atom_name(nint(zed))
-     !
-     ! compute kinetic energy differences, using:
-     ! AE:   T |psi> = (e - Vae) |psi>
-     ! PS:   T |phi> = (e - Vps) |phi> - |chi>
-     do ns=1,nbeta
-        do ns1=1,ns
-           if (lls(ns)==lls(ns1).and.jjs(ns)==jjs(ns1)) then
-              ikl=max(ikk(ns),ikk(ns1))
-              nst=2*(lls(ns)+1)
-              do n=1,ikl
-                 gi(n)=psipaw(n,ns)*(enls(ns1)-vpotpaw(n))*psipaw(n,ns1)
-              end do
-              aekin(ns,ns1)=int_0_inf_dr(gi(1:grid%mesh),grid,ikl,nst)
-              IF (rel==2) THEN
-                 do n=1,irc
-                    gi(n)=psipaw_rel(n,ns)*(enls(ns1)-vpotpaw(n))*&
-                                    psipaw_rel(n,ns1)
-                 enddo
-                 aekin(ns,ns1)=aekin(ns,ns1)+&
-                               int_0_inf_dr(gi(1:grid%mesh),grid,irc,nst)
-              ENDIF
-              do n=1,ikl
-                 gi(n)=phis(n,ns)*( (enls(ns1)-vpsloc(n))*phis(n,ns1) - chis(n,ns1) )
-              end do
-              pskin(ns,ns1)=int_0_inf_dr(gi(1:grid%mesh),grid,ikl,nst)
-           else
-              aekin(ns,ns1)=0._dp
-              pskin(ns,ns1)=0._dp
-           end if
-           kindiff(ns,ns1)=aekin(ns,ns1)-pskin(ns,ns1)
-           kindiff(ns1,ns)=aekin(ns,ns1)-pskin(ns,ns1)
-        end do
-     end do
-     !
-     ! create the 'pawsetup' object containing the atomic setup for PAW
-     call us2paw ( pawsetup,                                         &
-          zval, grid, rmatch_augfun, ikk,  &
-          nbeta, lls, jjs, ocs, enls, els, rcutus, psipaw, psipaw_rel, &
-          phis, betas, qvan, kindiff, nlcc, aeccharge, psccharge, vpotpaw, &
-          vpsloc, which_augfun, rel)
-     !
-     ! reread augmentation functions and descreened potentials from PAW
-     call paw2us ( pawsetup, zval, grid, nbeta, lls, jjs, ikk, betas, &
-                   qq, qvan, vpsloc, bmat, rhos, els, rcutus, pseudotype, &
-                   psipaw_rel )
-  else
-     !
-     !  Pseudize the Q functions if required. This might be needed for
-     !  pseudo-potentials with semicore states. In this case the cut-off radius
-     !  for the norm conserving wavefunctions is quite small and without
-     !  the Q pseudization the augmentation charges are very hard making the
-     !  ASR in phonon calculation very difficult to converge.
-     ! 
-     IF (which_augfun=='PSQ') CALL pseudo_q(qvan,qvanl)
-     !
-     !    unscreen the local potential and the D coefficients
-     !
-     call descreening
-  end if
-  !
-  ! write the main functions on files
-  !
-  ! The beta functions  
-  !
-  call write_wfcfile(file_beta,betas,els,nbeta)
-  call write_wfcfile_ft(file_beta,betas,nbeta)
-  !
-  ! The chi functions
-  !
-  call write_wfcfile(file_chi,chis,els,nbeta)
-  call write_wfcfile_ft(file_chi,chis,nbeta)
-  !
-  ! The augmentations functions
-  !
-  if (file_qvan .ne. ' ') then
-     do ns1=1,nbeta
-        call write_wfcfile(TRIM(file_qvan)//TRIM(int_to_char(ns1)),&
-                                                  qvan(1,1,ns1),els,ns1)
-     enddo
-  endif
-  !
-  !  The norm conserving wavefunctions
-  !
-  call write_wfcfile(file_wfcncgen,psipsus,els,nwfs)
-  call write_wfcfile_ft(file_wfcncgen,psipsus,nwfs)
-  !
-  !  The us wavefunctions
-  !
-  call write_wfcfile(file_wfcusgen,phis,els,nwfs)
-  call write_wfcfile_ft(file_wfcusgen,phis,nwfs)
-
-  write(stdout,"(/,5x,19('-'),' End of pseudopotential generation ',19('-'),/)")
-
-  return
-end subroutine gener_pseudo

Deleted: trunk/espresso/atomic/grad_log.f90
===================================================================
--- trunk/espresso/atomic/grad_log.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/grad_log.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,58 +0,0 @@
-!-----------
-subroutine grad_log(v,dv,rm1,dx,nx,method)
-  !----------
-  ! Computes derivative of a function v(:) on a radial logarithmic mesh
-  ! using d/dr = 1/r d/dx, since r \propto exp(x)
-  ! Two methods are available (method=2,4), the second (method=4)
-  ! is more precise (but more sensitive to noise)
-  !
-
-  use kinds, only : DP
-  implicit none
-  ! input/output variables
-  real(DP), intent(in) :: v(nx), rm1(nx), dx
-  ! function, 1/r, dx (step of the log. mesh)
-  real(DP), intent(out) :: dv(nx)
-  ! derivative
-  integer :: nx, method
-  ! dimensions, method used
-
-  integer :: i
-
-  select case ( method )
-  case ( 2 )
-     ! "leap frog" derivative O(dx^2)
-     ! use 2 points for each derivative
-     dv(2:nx-1) = 0.5_DP/dx * (v(3:nx) - v(1:nx-2)) * rm1(2:nx)
-
-     ! this (forward) formula is also O(dx^2),
-     ! but the error coefficient in front of dx^2 is different
-     !gv(1) = 0.5_DP/dx * (4._DP*v(2) - 3._DP*v(1) - v(3)) * rm1(1) 
-     ! while this has the same error coefficient in front of dx^2
-     dv(1) = 0.5_DP/dx * (-4._DP*(v(1)+v(3)) + 7._DP*v(2) + v(4)) * rm1(1)
-
-     ! backward O(dx^2) formula (with different error coeff.)
-     dv(nx) = -0.5_DP/dx *(4._DP*v(nx-1) - 3._DP*v(nx) - v(nx-2)) * rm1(nx)
-  case ( 4 )  
-     ! use 4 points for each derivative
-     !
-     ! calculate dv/dr (taken from subroutine lschps.f90)
-     dv(1)=(-50.0_dp*v(1)+96.0_dp*v(2)-72.0_dp*v(3)+32.0_dp*v(4) &
-          -6.0_dp*v(5))/(24.0_dp*dx) * rm1(1)
-     dv(2)=(-6.0_dp*v(1)-20.0_dp*v(2)+36.0_dp*v(3)-12.0_dp*v(4) &
-          +2.0_dp*v(5))/(24.0_dp*dx) * rm1(2)
-     !
-     do i=3,nx-2
-        dv(i)=(2.0_dp*v(i-2)-16.0_dp*v(i-1)+16.0_dp*v(i+1) &
-             -2.0_dp*v(i+2))/(24.0_dp*dx) * rm1(i)
-     end do
-     !
-     dv(nx-1)=( 3.0_dp*v(nx)+10.0_dp*v(nx-1)-18.0_dp*v(nx-2)+ &
-          6.0_dp*v(nx-3)-v(nx-4))/(12.0_dp*dx) * rm1(nx-1)
-     dv(nx)=( 25.0_dp*v(nx)-48.0_dp*v(nx-1)+36.0_dp*v(nx-2)-&
-          16.0_dp*v(nx-3)+3.0_dp*v(nx-4))/(12.0_dp*dx) * rm1(nx)
-   case default
-      call errore('grad_log','method unknown',1)
-   end select
-
-end subroutine grad_log

Deleted: trunk/espresso/atomic/green.f90
===================================================================
--- trunk/espresso/atomic/green.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/green.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,97 +0,0 @@
-!
-!---------------------------------------------------------------
-subroutine green(y,lam,e,dvy,chi,vpot,ze2)
-!---------------------------------------------------------------
-   !
-   use kinds, only: DP
-   use ld1inc, only: grid
-   use radial_grids, only: ndmx, series
-   implicit none
-   !
-   ! I/O variables
-   !
-   integer :: lam
-   real(DP) :: y(ndmx), chi(ndmx), dvy(ndmx), vpot(ndmx)
-   real(DP) :: e, ze2
-   !
-   ! local variables
-   !
-   integer :: i, l1, ncross, imatch
-   real(DP) :: f(ndmx), g(ndmx)
-   real(DP) :: work(ndmx), int_0_inf_dr
-   real(DP) :: a(0:3), b(0:3), c0, c1, c2, c3, c4, b0e
-   real(DP) :: rr1, rr2, r1, r2
-   real(DP) :: ddx12, sqlhf, xl1, x4l6, x6l12, x8l20
-   real(DP) :: gi, gim1
-   real(DP) :: fac
-! set up constants and initialize
-   ddx12=grid%dx*grid%dx/12.0
-   l1=lam+1
-   sqlhf=(DBLE(lam)+.5)**2
-   xl1=l1
-   x4l6=4*lam+6
-   x6l12=6*lam+12
-   x8l20=8*lam+20
-! series developement of the potential and r.h.s. term near the origin
-   do i=1,4
-      y(i)=vpot(i)-ze2/grid%r(i)
-   end do
-   call series(y,grid%r,grid%r2,b)
-   do i=1,4
-      y(i)= dvy(i)/grid%r(i)**l1
-   end do
-   call series(y,grid%r,grid%r2,a)
-!
-! determine the position of the last change of sign of the f-function 
-! f < 0 (approximatively) means classically allowed   region
-! f > 0         "           "        "      forbidden   "
-! set up the f-, g- and y-functions
-!
-   f(1)=ddx12*(grid%r2(1)*(vpot(1)-e)+sqlhf)
-   do i=2,grid%mesh
-      f(i)=ddx12*(grid%r2(i)*(vpot(i)-e)+sqlhf)
-      if( f(i) .ne. sign(f(i),f(i-1)) ) imatch=i
-   end do
-   do i=1,grid%mesh
-      f(i)=1-f(i)
-      g(i)=ddx12*dvy(i)*grid%r(i)*grid%sqr(i)
-      y(i)=0.d0
-   end do
-! wave-function in the first two points by series developement
-   b0e=b(0)-e
-   c0 = 1.0d0
-   c1=0.5*ze2*c0/xl1
-   c2=(c1*ze2+b0e*c0+a(0))/x4l6
-   c3=(c2*ze2+c1*b0e+b(1)*c0+a(1))/x6l12
-   c4=(c3*ze2+c2*b0e+c1*b(1)+b(2)*c0+a(2))/x8l20
-   r1=grid%r(1)
-   r2=grid%r(2)
-   rr1=(c0+r1*(c1+r1*(c2+r1*(c3+r1*c4))))*r1**l1
-   rr2=(c0+r2*(c1+r2*(c2+r2*(c3+r2*c4))))*r2**l1
-   y(1)=rr1/grid%sqr(1)
-   y(2)=rr2/grid%sqr(2)
-!
-! new set up of the g- function
-   gim1 = g(1)
-   do i=2,grid%mesh-1
-      gi=g(i)
-      g(i)=gim1+10.0d0*gi+g(i+1)
-      gim1=gi
-   end do
-! outward integration: numerov's algorithm
-   call outward(y,f,g,grid%mesh,imatch,ncross)
-! inward integration: froese's algorithm
-   call inward(y,f,g,grid%mesh,imatch)
-!-orthogonalize to the 0^th order eigenvector
-   do i=1,grid%mesh
-      y(i) = y(i)*grid%sqr(i)
-      work(i)=y(i)*chi(i)
-   end do
-   fac=int_0_inf_dr(work,grid,grid%mesh,2*lam+2)
-   do i=1,grid%mesh
-      y(i) = y(i) - fac*chi(i)
-   end do
-!
-   return
-
-end subroutine green

Deleted: trunk/espresso/atomic/import_upf.f90
===================================================================
--- trunk/espresso/atomic/import_upf.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/import_upf.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,262 +0,0 @@
-!
-! Copyright (C) 2004-2008 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!---------------------------------------------------------------------
-subroutine import_upf ( )
-  !---------------------------------------------------------------------
-  !
-  !   read "is"-th pseudopotential in the Unified Pseudopotential Format
-  !   from unit "iunps" - convert and copy to internal PWscf variables
-  !   return error code in "ierr" (success: ierr=0)
-  !
-  ! PWSCF modules
-  !
-  use constants, only : fpi
-  use kinds, only : dp
-  use radial_grids, only : ndmx, radial_grid_type, allocate_radial_grid, &
-                           nullify_radial_grid, deallocate_radial_grid
-  use ld1inc, only : file_pseudo, zval, nlcc, pseudotype, etots, lmax, lsave_wfc,&
-                     zed, nbeta, betas, lls, jjs, ikk, els, rcut, rcutus, &
-                     lloc, vpsloc, grid, nwfs, bmat, qq, qvan, qvanl, rhoc, &
-                     rhos, phis, which_augfun, lpaw, rmatch_augfun, pawsetup, psipaw
-  use funct, only: set_dft_from_name
-  !
-  use pseudo_types
-  use paw_type
-  use upf_module
-  !
-  implicit none
-  !
-  integer :: iunps, ierr, ibeta, jbeta, kbeta, l, l1, l2
-  !
-  !     Local variables
-  !
-  integer :: nb, ios
-  TYPE (pseudo_upf) :: upf
-  TYPE (radial_grid_type), TARGET :: rgrid
-  !
-  CALL nullify_pseudo_upf( upf )
-  CALL nullify_radial_grid( rgrid )
-  !
-  ! upf%grid => rgrid  is be associated in read_upf
-  !
-  iunps=2
-  open(unit=iunps,file=file_pseudo,status='old',form='formatted', &
-       err=100, iostat=ios)
-100   call errore('import_upf','open error on file '//file_pseudo,ios)
-  call read_upf(upf, rgrid, ierr, unit=iunps)
-  !
-  if (ierr .ne. 0) &
-     call errore('import_upf','reading pseudo upf',abs(ierr))
-  !
-  zval  = upf%zp
-  nlcc = upf%nlcc
-  call set_dft_from_name (upf%dft)
-
-  if (upf%typ.eq.'NC'.OR.upf%typ.eq.'SL') then
-     pseudotype=2
-  else
-     pseudotype=3
-  endif
-  lpaw = upf%tpawp
-
-  etots=upf%etotps
-  lmax = upf%lmax
-  grid%mesh = upf%mesh
-  call allocate_radial_grid(grid, grid%mesh)
-  grid%r  (1:grid%mesh) = upf%r  (1:upf%mesh)
-  grid%rab(1:grid%mesh) = upf%rab(1:upf%mesh)
-  grid%r2 (1:grid%mesh) = grid%r(1:grid%mesh)**2
-  grid%sqr(1:grid%mesh) = sqrt(grid%r(1:grid%mesh))
-  if (.not.upf%has_so) then
-     if (grid%r(1) > 0.0_dp) then
-        !
-        ! r(i+1) = exp(xmin)/zmesh * exp(i*dx)
-        !
-        grid%dx=log(grid%r(grid%mesh)/grid%r(1))/(grid%mesh-1)
-        grid%rmax=grid%r(grid%mesh)
-        grid%xmin=log(zed*grid%r(1))
-        grid%zmesh=zed
-     else
-        !
-        ! r(i+1) = exp(xmin)/zmesh * ( exp(i*dx) - 1 )
-        !
-        grid%dx=log( (grid%r(3)-grid%r(2)) / grid%r(2) )
-        grid%rmax=grid%r(grid%mesh)
-        grid%zmesh=zed
-        grid%xmin=log(zed*grid%r(2)**2/(grid%r(3)-2.0_dp*grid%r(2)))
-     end if
-  else
-     grid%dx=upf%dx
-     grid%xmin=upf%xmin
-     grid%zmesh=upf%zmesh
-     grid%rmax=exp(grid%xmin+(grid%mesh-1)*grid%dx)/grid%zmesh
-  endif
-  if (abs(exp(grid%xmin+(grid%mesh-1)*grid%dx)/zed-grid%rmax).gt.1.e-6_dp) &
-       call errore('read_pseudoup','mesh not supported',1)
-
-  nwfs = upf%nwfc
-
-  nbeta= upf%nbeta
-  lls(1:nbeta)=upf%lll(1:nbeta)
-
-  if (upf%has_so) then
-     jjs(1:nbeta)=upf%jjj(1:nbeta)
-  else
-     jjs=0.0_dp
-  endif
-  !
-  !
-  do nb=1,nbeta
-     ikk(nb)=upf%kbeta(nb)
-     els(nb)=upf%els_beta(nb)
-     rcut(nb)=upf%rcut(nb)
-     rcutus(nb)=upf%rcutus(nb)
-  end do
-  betas(1:grid%mesh, 1:nbeta) = upf%beta(1:upf%mesh, 1:upf%nbeta)
-  bmat(1:nbeta, 1:nbeta) = upf%dion(1:upf%nbeta, 1:upf%nbeta)
-  !
-  if (pseudotype.eq.3) then
-     qq(1:nbeta,1:nbeta) = upf%qqq(1:upf%nbeta,1:upf%nbeta)
-     do ibeta=1,nbeta
-        do jbeta=ibeta,nbeta
-           kbeta = jbeta * (jbeta-1) / 2 + ibeta
-           if (upf%q_with_l .or. lpaw) then
-              l1=upf%lll(ibeta)
-              l2=upf%lll(jbeta)
-              do l=abs(l1-l2), l1+l2
-                 qvanl(1:upf%mesh,ibeta,jbeta,l)=upf%qfuncl(1:upf%mesh,kbeta,l)
-                 if (ibeta /= jbeta) qvanl (1:grid%mesh, jbeta, ibeta, l)= &
-                                    upf%qfuncl(1:upf%mesh,kbeta,l)
-              enddo
-              qvan(1:upf%mesh,ibeta,jbeta)=upf%qfuncl(1:upf%mesh,kbeta,0)
-              if (ibeta /= jbeta) qvan(1:grid%mesh, jbeta, ibeta)= &
-                                    upf%qfuncl(1:upf%mesh,kbeta,0)
-              which_augfun='PSQ'
-           else
-              qvan (1:grid%mesh, ibeta, jbeta) = upf%qfunc(1:upf%mesh,kbeta)
-              if (ibeta /= jbeta) qvan (1:grid%mesh, jbeta, ibeta)= &
-                                       upf%qfunc(1:upf%mesh,kbeta)
-              which_augfun='AE'
-           endif
-        enddo
-     enddo
-  else
-     qq=0.0_dp
-     qvan=0.0_dp
-  endif
-  !
-  if (upf%nlcc) then
-     rhoc(1:grid%mesh) = upf%rho_atc(1:upf%mesh)*fpi*grid%r2(1:upf%mesh)
-  else
-     rhoc(:) = 0.0_dp
-  end if
-  rhos=0.0_dp
-  rhos (1:grid%mesh,1) = upf%rho_at (1:upf%mesh)
-
-  !phis(1:grid%mesh,1:nwfs)=upf%chi(1:grid%mesh,1:nwfs)
-  if(upf%has_wfc) then
-      lsave_wfc = .true.
-      phis(1:grid%mesh,1:nbeta)=upf%pswfc(1:grid%mesh,1:nbeta)
-      psipaw(1:grid%mesh,1:nbeta)=upf%aewfc(1:grid%mesh,1:nbeta)
-  endif
-  !!! TEMP
-  lloc = -1
-  vpsloc(1:grid%mesh) = upf%vloc(1:upf%mesh)
-  !!!
-  ! paw:
-  if (lpaw) then
-    which_augfun = upf%paw%augshape
-    rmatch_augfun = upf%paw%raug
-    call allocate_pseudo_paw( pawsetup, grid%mesh, nbeta, lmax )
-    CALL nullify_radial_grid( pawsetup%grid )
-    call allocate_radial_grid(pawsetup%grid,grid%mesh)
-    call set_pawsetup( pawsetup, upf )
-  endif
-
-  CALL deallocate_pseudo_upf( upf )
-  CALL deallocate_radial_grid( rgrid )
-
-
-end subroutine import_upf
-
-SUBROUTINE set_pawsetup(pawset_, upf_)
-USE kinds, ONLY : DP
-USE constants, ONLY : fpi
-USE paw_type, ONLY : paw_t
-USE pseudo_types, ONLY: pseudo_upf
-USE ld1_parameters,   ONLY: nwfsx
-USE radial_grids, ONLY : radial_grid_copy
-USE atomic_paw,    ONLY : compute_nonlocal_coeff_ion
-IMPLICIT NONE
-TYPE(paw_t), INTENT(INOUT) :: pawset_
-TYPE(pseudo_upf), INTENT(IN) :: upf_
-REAL(DP), ALLOCATABLE :: ddd_(:,:)
-INTEGER :: mesh, nbeta,ih,jh,ijh
-
-   nbeta=upf_%nbeta
-   mesh=upf_%mesh
-   pawset_%augfun=0.0_DP
-   pawset_%augmom=0.0_DP
-   pawset_%enl(:) = 0.0_DP
-   if (upf_%has_so) then
-      pawset_%jj(1:nbeta) = upf_%jjj(1:nbeta)
-      pawset_%rel=2
-   else
-      pawset_%jj(:) = 0.0_DP
-      pawset_%rel=1
-   endif
-   pawset_%l(1:nbeta) = upf_%lll(1:nbeta)
-   pawset_%ikk(1:nbeta) = upf_%kbeta(1:nbeta)
-   pawset_%oc(1:nbeta) = upf_%paw%oc(1:nbeta)
-   pawset_%aewfc(1:mesh,1:nbeta) = upf_%aewfc(1:mesh,1:nbeta)
-   pawset_%pswfc(1:mesh,1:nbeta) = upf_%pswfc(1:mesh,1:nbeta)
-   IF (upf_%has_so) &
-   pawset_%aewfc_rel(1:mesh,1:nbeta) = upf_%paw%aewfc_rel(1:mesh,1:nbeta)
-   pawset_%proj(1:mesh,1:nbeta) = upf_%beta(1:mesh,1:nbeta)
-
-   DO ih = 1,nbeta
-   DO jh = ih,nbeta
-      ijh = jh * (jh-1) / 2 + ih
-      pawset_%augfun(1:mesh,ih,jh,0:upf_%paw%lmax_aug) = &
-                           upf_%qfuncl(1:mesh,ijh,0:upf_%paw%lmax_aug)
-      IF ( ih /= jh ) &
-      pawset_%augfun(1:mesh,jh,ih,0:upf_%paw%lmax_aug) = &
-                           upf_%qfuncl(1:mesh,ijh,0:upf_%paw%lmax_aug)
-   ENDDO
-   ENDDO
-
-   pawset_%augmom(1:nbeta,1:nbeta,0:upf_%paw%lmax_aug) = & 
-                  upf_%paw%augmom(1:nbeta,1:nbeta,0:upf_%paw%lmax_aug)
-   pawset_%aeccharge(1:mesh) = upf_%paw%ae_rho_atc(1:mesh)*fpi*upf_%grid%r2(1:mesh)
-   pawset_%psccharge(1:mesh) = upf_%rho_atc(1:mesh)*fpi*upf_%grid%r2(1:mesh)
-   pawset_%pscharge(1:mesh) = upf_%rho_at(1:mesh)
-   pawset_%aeloc(1:mesh) = upf_%paw%ae_vloc(1:mesh)
-   pawset_%psloc(1:mesh) = upf_%vloc(1:mesh)
-   pawset_%kdiff(1:nbeta,1:nbeta) = 0.0_DP
-   pawset_%dion (1:nbeta,1:nbeta) = upf_%dion(1:nbeta,1:nbeta)
-   pawset_%symbol=upf_%psd
-   pawset_%zval=upf_%zp
-   pawset_%z=upf_%zmesh
-   pawset_%nlcc=upf_%nlcc
-   pawset_%nwfc=upf_%nbeta
-   pawset_%irc=upf_%kkbeta
-   pawset_%lmax=upf_%lmax
-   pawset_%rmatch_augfun=upf_%paw%raug
-   CALL radial_grid_copy(upf_%grid, pawset_%grid)
-!
-!  The kinetic energy must be recalculated
-!
-   ALLOCATE(ddd_(nwfsx,nwfsx))
-
-   CALL compute_nonlocal_coeff_ion(ddd_, pawset_)
-   pawset_%kdiff(1:nbeta,1:nbeta) = upf_%dion(1:nbeta,1:nbeta)- &
-                                    ddd_(1:nbeta,1:nbeta)
-
-   DEALLOCATE(ddd_)
-
-END SUBROUTINE set_pawsetup

Deleted: trunk/espresso/atomic/int_0_inf_dr.f90
===================================================================
--- trunk/espresso/atomic/int_0_inf_dr.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/int_0_inf_dr.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,54 +0,0 @@
-!
-! Copyright (C) 2004-2008 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-function int_0_inf_dr(f,grid,mesh,nst)
-  !---------------------------------------------------------------
-  !
-  !      integral of f from 0 to infinity
-  !      f is given on a logarithmic mesh. 
-  !      f(r) is assumed to be proportional to r**nst for small r
-  !
-  use kinds, only : DP
-  use radial_grids, only: radial_grid_type, series
-  implicit none
-  !
-  ! I/O variables
-  !
-  integer, intent(in) :: mesh, nst
-  real(DP), intent(in):: f(mesh)
-  type(radial_grid_type), intent(in) :: grid
-  real(DP) :: int_0_inf_dr
-  !
-  ! local variables
-  !
-  real(DP):: fs(4), b(4), sum1
-  integer :: i
-  !
-  ! series development: contribution for small r
-  !
-  if (mesh > grid%mesh) &
-     call errore('int_0_inf_dr','value of mesh is larger than expected',mesh)
-
-  do i=1,4
-     fs(i)=f(i)/grid%r(i)**nst
-  end do
-  call series(fs,grid%r,grid%r2,b)
-  int_0_inf_dr = ( b(1)/(nst+1) + grid%r(1)* &
-                  (b(2)/(nst+2) + grid%r(1)*b(3)/(nst+3)) ) * grid%r(1)**(nst+1)
-  !
-  ! simpson integration (logarithmic mesh: dr ==> r dx)
-  !
-  sum1=0.0_DP
-  do i=1,mesh-2,2
-     sum1 = sum1 + f(i)*grid%r(i)+4.0_dp*f(i+1)*grid%r(i+1)+f(i+2)*grid%r(i+2)
-  end do
-  int_0_inf_dr = int_0_inf_dr + sum1*grid%dx/3.0_DP
-
-  return
-end function int_0_inf_dr

Deleted: trunk/espresso/atomic/integrate_inward.f90
===================================================================
--- trunk/espresso/atomic/integrate_inward.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/integrate_inward.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,82 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!----------------------------------------------------------------------
-subroutine integrate_inward(e,mesh,ndm,grid,f,y,c,el,ik,nstart)
-  !----------------------------------------------------------------------
-  !
-  !     this subroutine integrate inward the schroedinger equation
-  !     only local potential allowed
-  !
-  use kinds, only : DP
-  use radial_grids, only: radial_grid_type
-  implicit none
-  type(radial_grid_type), intent(in):: grid
-  integer :: &
-       mesh,  &    ! size of radial mesh
-       ndm,   &    ! maximum radial mesh
-       ik          ! the matching point
-
-  real(DP) :: &
-       e,       &  ! output eigenvalue
-       f(mesh), &  ! the function defining the equation
-       y(mesh), &  ! the output solution
-       c(mesh),el(mesh) ! auxiliary space
-
-  real(DP) :: &
-       rstart,  &  ! the starting r of the inward integration
-       di,      &  ! auxiliary for integration  
-       expn        ! exponential for tail of wavefunction
-
-  integer :: &
-       nstart, &   ! the starting point of inward integration
-       n           ! counter on mesh points
-
-  !
-  !     prepare inward integration
-  !     charlotte froese can j phys 41,1895(1963)
-  !
-  !     start at  min( rmax, 10*rmatch )
-  !
-  nstart=mesh
-  if (mesh .ne. grid%mesh) call errore('integrate_inward','mesh dimention not as expected',1)
-  rstart=10.0_dp*grid%r(ik)
-  if (rstart.lt.grid%r(mesh)) then
-     do n=ik,mesh
-        nstart=n
-        if(grid%r(n).ge.rstart) go to 100
-     enddo
-100  if (mod(nstart,2) == 0) nstart=nstart+1
-  endif
-  !
-  !  set up a, l, and c vectors
-  !
-  n=ik+1
-  el(n)=10.0_dp*f(n)-12.0_dp
-  c(n)=-f(ik)*y(ik)
-  do n=ik+2,nstart
-     di=10.0_dp*f(n)-12.0_dp
-     el(n)=di-f(n)*f(n-1)/el(n-1)
-     c(n)=-c(n-1)*f(n-1)/el(n-1)
-  enddo
-  !
-  !  start inward integration by the froese's tail procedure
-  !
-  n=nstart-1
-  expn=exp(-sqrt(12.0_dp*abs(1.0_dp-f(n))))
-  y(n)=c(n)/(el(n)+f(nstart)*expn)
-  y(nstart)=expn*y(n)
-  !
-  !    and integrate inward
-  !
-  do n=nstart-2,ik+1,-1
-     y(n)=(c(n)-f(n+1)*y(n+1))/el(n)
-  enddo
-
-  return
-end subroutine integrate_inward

Deleted: trunk/espresso/atomic/integrate_outward.f90
===================================================================
--- trunk/espresso/atomic/integrate_outward.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/integrate_outward.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,183 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------------
-subroutine integrate_outward (lam,jam,e,mesh,ndm,grid,f, &
-     b,y,beta,ddd,qq,nbeta,nwfx,lls,jjs,ikk,ik)
-  !---------------------------------------------------------------------
-  !
-  !    Integrate the wavefunction from 0 to r(ik) 
-  !    generalized separable or US pseudopotentials are allowed
-  !    This routine assumes that y countains already the
-  !    correct values in the first two points
-  !
-  use kinds, only : DP
-  use radial_grids, only : radial_grid_type
-  implicit none
-  type(radial_grid_type):: grid
-  integer ::   &
-       lam,    &     ! l angular momentum
-       mesh,   &    ! size of radial mesh
-       ndm,    &   ! maximum radial mesh
-       nbeta,  &   ! number of beta function
-       nwfx,   &   ! maximum number of beta functions
-       lls(nbeta),&! for each beta the angular momentum
-       ikk(nbeta),&! for each beta the integration point
-       ik         ! the last integration point
-
-  real(DP) :: &
-       e,       &  ! output eigenvalue
-       jam,     &  ! j angular momentum
-       f(mesh), &  ! the f function
-       b(0:3), &   ! the taylor expansion of the potential
-       y(mesh), &  ! the output solution
-       jjs(nwfx), & ! the j angular momentum
-       beta(ndm,nwfx),& ! the beta functions
-       ddd(nwfx,nwfx),qq(nwfx,nwfx) ! parameters for computing B_ij
-
-  integer ::  &
-       nst, &      ! the exponential around the origin
-       n,    &     ! counter on mesh points
-       iib,jjb, &  ! counter on beta with correct lam
-       ierr,    &  ! used to control allocation
-       ib,jb,   &  ! counter on beta
-       info      ! info on exit of LAPACK subroutines
-
-  integer, allocatable :: iwork(:) ! auxiliary space  
-
-  real(DP) :: &
-       b0e,     & ! the expansion of the known part
-       ddx12,   & ! the deltax enetering the equations
-       x4l6,    & ! auxiliary for small r expansion
-       j1(4),d(4),& ! auxiliary for starting values of chi
-       delta,xc(4),& ! auxiliary for starting values of eta
-       int_0_inf_dr  ! the integral function
-
-  real(DP), allocatable :: &
-       el(:), &  ! auxiliary for integration
-       cm(:,:), &! the linear system
-       bm(:), & ! the known part of the linear system
-       c(:), &   ! the chi functions
-       coef(:), & ! the solution of the linear system
-       eta(:,:) ! the partial solution of the nonomogeneous
-
-
-  allocate(c(ik), stat=ierr)
-  allocate(el(ik), stat=ierr)
-  allocate(cm(nbeta,nbeta), stat=ierr)
-  allocate(bm(nbeta), stat=ierr)
-  allocate(coef(nbeta), stat=ierr)
-  allocate(iwork(nbeta), stat=ierr)
-  allocate(eta(ik,nbeta), stat=ierr)
-
-  if (mesh.ne.grid%mesh) call errore('integrate_outward','mesh dimension is not as expected',1)
-  ddx12=grid%dx*grid%dx/12.0_DP
-  b0e=b(0)-e
-  x4l6=4*lam+6
-  nst=(lam+1)*2
-  !
-  !  first solve the omogeneous equation
-  !
-  do n=2,ik-1
-     y(n+1)=((12.0_DP-10.0_DP*f(n))*y(n)-f(n-1)*y(n-1))/f(n+1)
-  enddo
-  !
-  !     for each beta function with correct angular momentum
-  !     solve the inhomogeneous equation
-  !
-  iib=0
-  jjb=0
-  do ib=1,nbeta
-     !
-     !    set up the known part
-     !         
-     if (lls(ib).eq.lam.and.jjs(ib).eq.jam) then
-        iib=iib+1
-        c=0.0_DP
-        do jb=1,nbeta
-           if (lls(jb).eq.lam.and.jjs(jb).eq.jam) then
-              do n=1,ikk(jb)
-                 c(n)= c(n)+(ddd(jb,ib) -e*qq(jb,ib))*beta(n,jb)
-              enddo
-           endif
-        enddo
-        !
-        !     compute the starting values of the solutions
-        !
-        do n=1,4
-           j1(n)=c(n)/grid%r(n)**(lam+1)
-        enddo
-        call seriesbes(j1,grid%r,grid%r2,4,d)
-        delta=b0e**2+x4l6*b(2)
-        xc(1)=(-d(1)*b0e-x4l6*d(3))/delta
-        xc(3)=(-b0e*d(3)+d(1)*b(2))/delta
-        xc(2)=0.0_DP
-        xc(4)=0.0_DP
-        do n=1,3
-           eta(n,iib)=grid%r(n)**(lam+1)*(xc(1)+grid%r2(n)*xc(3))/grid%sqr(n)
-        enddo
-
-        do n=1,ik
-           c(n)=c(n)*grid%r2(n)/grid%sqr(n)
-        enddo
-        !
-        !   solve the inhomogeneous equation
-        !
-        do n=3,ik-1
-           eta(n+1,iib)=((12.0_DP-10.0_DP*f(n))*eta(n,iib) &
-                -f(n-1)*eta(n-1,iib) &
-                + ddx12*(10.0_DP*c(n)+c(n-1)+c(n+1)) )/f(n+1)
-        enddo
-        !
-        !    compute the coefficents of the linear system
-        !
-        jjb=0
-        do jb=1,nbeta
-           if (lls(jb).eq.lam.and.jjs(jb).eq.jam) then
-              jjb=jjb+1
-              do n=1,min(ik,ikk(jb))
-                 el(n)=beta(n,jb)*eta(n,iib)*grid%sqr(n)
-              enddo
-              cm(jjb,iib)=-int_0_inf_dr(el,grid,min(ik,ikk(jb)),nst)
-           endif
-        enddo
-
-        do n=1,min(ik,ikk(ib))
-           el(n)=beta(n,ib)*y(n)*grid%sqr(n)
-        enddo
-        bm(iib)=int_0_inf_dr(el,grid,min(ik,ikk(ib)),nst)
-        cm(iib,iib)=1.0_DP+cm(iib,iib)
-     endif
-  enddo
-  if (iib.ne.jjb) call errore('integrate_outward','jjb.ne.iib',1)
-
-  if (iib.gt.0) then
-     call dcopy(iib,bm,1,coef,1)
-
-     call DGESV(iib,1,cm,nbeta,iwork,coef,nbeta,info)
-
-     if (info /= 0) call errore('integrate_outward', &
-                &  'problems solving the linear system',info)
-
-     do ib=1,iib
-        do n=1,ik
-           y(n)= y(n)+coef(ib)*eta(n,ib)
-        enddo
-     enddo
-  endif
-
-  deallocate(eta)
-  deallocate(iwork)
-  deallocate(coef)
-  deallocate(bm)
-  deallocate(cm)
-  deallocate(el)
-  deallocate(c)
-
-  return
-end subroutine integrate_outward

Deleted: trunk/espresso/atomic/intref.f90
===================================================================
--- trunk/espresso/atomic/intref.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/intref.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,81 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-         subroutine intref(lam,e,mesh,grid,vpot,ze2,chi)
-!---------------------------------------------------------------
-!
-!  numerical integration of the radial schroedinger equation 
-!  computing logarithmic derivatives
-!  thresh dermines the absolute accuracy for the eigenvalue
-!
-!
-!
-      use kinds, only : DP
-      use radial_grids, only: radial_grid_type, series
-      implicit none
-      type(radial_grid_type), intent(in):: grid
-      integer :: &
-              mesh,    &     ! the mesh size
-              lam           ! the angular momentum
-      real(DP) :: &
-              vpot(mesh), &   ! the local potential
-              chi(mesh),  &   ! the solution
-              ze2,       &   ! the nuclear charge in Ry units
-              e             ! the eigenvalue
-
-      integer :: &
-              ierr,  &      ! used to control allocation
-              n             ! generic counter 
-
-      real(DP) :: &
-              lamsq,   &     ! combined angular momentum
-              b(0:3),c(4)      ! used for starting guess of the solution 
-
-      real(DP),allocatable :: &
-              al(:)      ! the known part of the differential equation
-
-      if (mesh.gt.grid%mesh) &
-          call errore('intref','mesh dimension is too large',1)
-
-      allocate(al(mesh),stat=ierr)
-
-      do n=1,4
-         al(n)=vpot(n)-ze2/grid%r(n)
-      enddo
-      call series(al,grid%r,grid%r2,b)
-
-
-      lamsq=(lam+0.5_DP)**2
-!
-!     b) find the value of solution s in the first two points
-!
-      call start_scheq( lam, e, b, grid, ze2, chi )
-
-      do n=1,mesh
-         al(n)=( (vpot(n)-e)*grid%r2(n) + lamsq )*grid%dx**2/12.0_DP
-         al(n)=1.0_DP-al(n)
-      enddo
-!
-!     Integrate forward the equation:
-!     c) integrate the equation from 0 to matching radius
-!
-      do n=2,mesh-1
-         chi(n+1)=((12.0_DP-10.0_DP*al(n))*chi(n) -al(n-1)*chi(n-1))/al(n+1)
-      enddo
-!
-!     set the correct r dependence
-!            
-      do n=1,mesh
-         chi(n)= chi(n)*grid%sqr(n)
-      enddo
-
-
-      deallocate(al)
-      return
-      end subroutine intref

Deleted: trunk/espresso/atomic/inward.f90
===================================================================
--- trunk/espresso/atomic/inward.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/inward.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,44 +0,0 @@
-!
-!---------------------------------------------------------------
-subroutine inward(y,f,g,mesh,imatch)
-!---------------------------------------------------------------
-   ! inward integration, charlotte froese can j phys 41,1895(1963)
-   !
-   use kinds,  only:DP
-   use radial_grids, only:ndmx
-   implicit none
-   !
-   ! I/O variables
-   !
-   integer :: mesh, imatch
-   real(DP) :: y(ndmx), f(ndmx), g(ndmx)
-   !
-   ! local variables
-   !
-   integer :: imp1, imp2, nm1, n
-   real(DP) :: di, ff, expn
-   real(DP) :: el(ndmx),c(ndmx)
-
-   if (ndmx.lt.mesh) stop ' inward : ndmx .lt. mesh !!!!'
-! set up el, and c vectors
-   imp1=imatch+1
-   el(imp1)=10.d0*f(imp1)-12.d0
-   c(imp1)=g(imp1)-f(imatch)*y(imatch)
-   imp2=imatch+2
-   nm1=mesh-1
-   do n=imp2,nm1
-      di=10.d0*f(n)-12.d0
-      el(n)=di-f(n)*f(n-1)/el(n-1)
-      c(n)=g(n)-c(n-1)*f(n-1)/el(n-1)
-   end do
-! start with y=aexp(-ax)-b, with b="g"/f
-   ff=12.d0*abs(1.d0-f(nm1))
-   expn=exp(-sqrt(ff))
-   y(mesh)=(c(nm1)*expn+g(nm1)*el(nm1)*(expn-1.d0)/ff)/(el(nm1)+f(mesh)*expn)
-! inward integration
-   do n=nm1,imp1,-1
-      y(n)=(c(n)-f(n+1)*y(n+1))/el(n)
-   end do
-!
-   return
-end subroutine inward

Deleted: trunk/espresso/atomic/kin_e_density.f90
===================================================================
--- trunk/espresso/atomic/kin_e_density.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/kin_e_density.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,89 +0,0 @@
-!-----------------------------------------------------------------------
-      subroutine kin_e_density &
-         (ndm, mesh, nwf, ll, oc, chi, r, r2, dx, tau )
-!-----------------------------------------------------------------------
-!
-!     calculate the (spherical) kinetic energy density 
-!     tau = sum_nwf 0.5*|\nabla phi|^2     in Cartesian coordinate
-!     = 0.5*sum_nwf occ(nwf)/4pi*{[d(chi/r)/dr]^2 + (chi/r)^2*ll*(ll+1)/r^2}
-!     = 0.5*sum_nwf occ(nwf)/4pi*[(1/r*dchi-chi/r^2)^2+(chi/r)^2*ll(ll+1)/r^2)]
-!       in spherical coordinate
-!     temporary - must be rewritten in a cleaner way
-!
-      implicit none
-! input
-      integer ndm, mesh, nwf,ll(nwf)
-      real*8 oc(nwf), chi(ndm,2,nwf),r2(ndm),r(ndm),dx
-! output
-      real*8 tau(ndm,2)
-! local
-      logical tspin
-      integer i,n
-      real*8  z,full,half,rho_tot, fourpi,                              &
-     &     ocup,ocdn,temp,nll, corr
-      parameter ( fourpi = 4.d0*3.141592653589793d+00 )
-      real*8 dchi(ndm)
-      tspin = .false.
-!
-      tau (:,:)=0.0d0
-!
-      do n=1,nwf
-         half=2*ll(n)+1
-         full=half+half
-         nll=ll(n)*(ll(n)+1)
-         call deriv5pt(mesh,dx,r,chi(1,1,n),dchi)
-         if( oc(n).le.half) then
-            ocup=oc(n)
-            ocdn=0.d0
-         else
-            tspin = .true.
-            ocup=half
-            ocdn=oc(n)-half
-         end if
-!
-         do i=1,mesh
-!     kinetic energy density
-            temp=(dchi(i)-chi(i,1,n)/r(i))**2.0d0                         &
-     &           + chi(i,1,n)**2.0d0/r2(i)*nll
-            tau(i,1)=tau(i,1)+ocup*temp
-            tau(i,2)=tau(i,2)+ocdn*temp
-         end do
-      end do
-!
-      do i=1,mesh
-         tau(i,:)=tau(i,:)/fourpi*0.5d0/r2(i)
-      end do
-      return
-      end
-!
-      subroutine deriv5pt(mesh,dx,r,v,dv)
-!
-! numerical derivative using 5-point formula - error: O(dx^5)
-! Assumes a logarithmic grid  r_i = r_0 exp((i-1)dx)
-!
-      implicit none
-! input
-      integer mesh
-      real*8 v(mesh), r(mesh), dx
-! output:  dv = dv/dr = (1/r) dv/dx
-      real*8 dv(mesh)
-!
-      integer i
-!
-!
-      dv(1)=(-25.d0*v(1)+48.d0*v(2)-36.d0*v(3)+16.d0*v(4)               &
-     &       -3.d0*v(5))/(12.d0*dx*r(1))
-      dv(2)=(-3.d0*v(1)-10.d0*v(2)+18.d0*v(3)- 6.d0*v(4)                &
-     &       +     v(5))/(12.d0*dx*r(2))
-!
-      do i=3,mesh-2
-         dv(i)=(v(i-2)-8.d0*v(i-1)+8.d0*v(i+1)-v(i+2))/(12.d0*dx*r(i))
-      end do
-!
-      dv(mesh-1)=( 3.d0*v(mesh)+10.d0*v(mesh-1)-18.d0*v(mesh-2)+        &
-     &             6.d0*v(mesh-3)-     v(mesh-4))/(12.d0*dx*r(mesh-1))
-      dv(mesh)=( 25.d0*v(mesh)  -48.d0*v(mesh-1)+36.d0*v(mesh-2)-       &
-     &           16.d0*v(mesh-3)+3.d0*v(mesh-4))/(12.d0*dx*r(mesh))
-!
-      return
-      end

Deleted: trunk/espresso/atomic/ld1.f90
===================================================================
--- trunk/espresso/atomic/ld1.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ld1.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,78 +0,0 @@
-!
-! Copyright (C) 2004-2009 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!---------------------------------------------------------------
-program ld1
-  !---------------------------------------------------------------
-  !
-  !     atomic self-consistent local-density program
-  !     atomic rydberg units are used : e^2=2, m=1/2, hbar=1
-  !     psi(r) = rR(r), where R(r) is the radial part of the wfct
-  !     rho(r) = psi(r)^2 => rho(r) = (true charge density)*(4\pi r^2)
-  !                       The same applies to the core charge
-  !---------------------------------------------------------------
-  !
-  USE mp_global,         ONLY : mp_startup, mp_global_end
-  USE environment,       ONLY : environment_start
-  USE ld1inc,            ONLY : iswitch, write_coulomb, grid
-  use radial_grids,      ONLY : deallocate_radial_grid
-
-  !
-  implicit none
-  CHARACTER (LEN=9) :: code = 'LD1'
-  !
-  !   write initialization information
-  !
-  call mp_startup( )
-  call environment_start ( code )
-  !
-  !    read input, possible pseudopotential and set the main variables
-  !
-  call ld1_readin ( )
-  call ld1_setup ( )
-  !
-  !   three possible working mode:
-  !
-  if (iswitch.eq.1) then
-     !
-     !   all-electron calculation
-     !
-     call all_electron(.true.,1)
-     if ( write_coulomb ) call write_ae_pseudo ( )
-     !
-  elseif (iswitch.eq.2) then
-     !
-     !   pseudopotential test
-     !
-     call run_test ( )
-     call ld1_writeout ( )
-     !
-  elseif (iswitch.eq.3) then
-     !
-     !  pseudopotential generation and test
-     !
-     call all_electron(.false.,1)
-     call gener_pseudo ( )
-     call run_test ( )
-     call ld1_writeout ( )
-     !
-  elseif (iswitch.eq.4) then
-     !
-     ! LDA-1/2 correction to the input pseudopotential 
-     !
-     call run_lda_half ( )
-     call ld1_writeout ( )
-     !
-  else
-     call errore('ld1','iswitch not implemented',1)
-  endif
-  call deallocate_radial_grid( grid )
-
-  call mp_global_end()
-
-end program ld1
-!

Deleted: trunk/espresso/atomic/ld1_readin.f90
===================================================================
--- trunk/espresso/atomic/ld1_readin.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ld1_readin.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,810 +0,0 @@
-!
-! Copyright (C) 2004-2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!---------------------------------------------------------------
-subroutine ld1_readin
-  !---------------------------------------------------------------
-  !
-  !     This routine reads the input parameters of the calculation
-  !
-  use kinds,      ONLY : dp
-  use radial_grids, only: ndmx, nullify_radial_grid
-  use ld1_parameters, only: ncmax1, nwfx, nwfsx
-  use parameters,     only: lmaxx
-  use constants,  ONLY : rytoev, c_au
-  USE io_global,  ONLY : ionode, ionode_id, stdout
-  USE mp,         ONLY : mp_bcast
-  use ld1inc,     only : els, lls, betas, qq, qvan, ikk, nbeta, pseudotype, &
-                         el, nn, ll, jj, oc, isw, nwf,rcut, rcutus, &
-                         enls, nns, jjs, ocs, isws, nwfs, &
-                         eltsc, nntsc, lltsc, jjtsc, octsc, iswtsc, nwftsc, &
-                         enltsc, rcuttsc, rcutustsc, &
-                         vpsloc, vnl, iswitch, tr2, &
-                         nspin, lsd, rel, isic, latt, vdw, lpaw,  tm, &
-                         grid, zed, lmax, beta, rhoc, nconf, prefix,  &
-                         nnl, jjts, zval, title, write_coulomb, &
-                         nlc, rm, rho0, lloc, rcore, rcloc, nlcc, & 
-                         upf_v1_format, file_pseudo, file_pseudopw, &
-                         file_potscf, file_screen, file_qvan, file_recon, &
-                         file_wfcaegen, file_wfcncgen, file_wfcusgen, &
-                         file_core, file_beta, file_chi, file_charge, author, &
-                         nld, rpwe, rlderiv, eminld, emaxld, deld, &
-                         ecutmin, ecutmax, decut, rytoev_fact, verbosity, &
-                         frozen_core, lsdts, new_core_ps, cau_fact, &
-                         lnc2paw, use_paw_as_gipaw, pawsetup,  & !paw EMINE
-                         rmatch_augfun, which_augfun,         & !paw
-                         rmatch_augfun_nc,                    &
-                         rhos, bmat, lsmall, &              ! extra for paw2us
-                         lgipaw_reconstruction, lsave_wfc, &
-                         relpert, noscf, max_out_wfc, &
-                         rcutv ! LDA-1/2
-
-  use funct, only : set_dft_from_name
-  use radial_grids, only: do_mesh, check_mesh
-  use atomic_paw, only : paw2us
-  implicit none
-
-  integer ::  &
-       n,     &          ! counters on wavefunctions
-       nc,    &          ! counter on configuration
-       ns,ns1,&          ! counters on pseudo wavefunctions
-       c1,    &          ! counter
-       ios               ! I/O control
-
-  real(DP) :: xmin, dx, rmax, zdum ! auxiliary variables
-  character(len=6)  :: zval_,zdum_
-  character(len=80) :: config, configts(ncmax1)
-  character(len=2)  :: atom
-  character(len=25) :: dft, rel_dist
-  character(len=2), external :: atom_name
-  integer, external :: atomic_number
-  logical, external :: matches
-
-  namelist /input/ xmin,    &  ! the minimum x of the linear mesh
-       dx,      &  ! parameters of the mesh
-       rmax,    &  ! the maximum r of the mesh
-       zed,     &  ! the atomic charge
-       atom,    &  ! atomic symbol - can be specified instead of zed
-       beta,    &  ! the mixing coefficient
-       tr2,     &  ! the scf threshold
-       iswitch, &  ! the type of calculation
-       nld, rlderiv, eminld, emaxld, deld,& ! log derivatives
-       rpwe,    &  ! the radius of the pwe
-       config,  &  ! a string with electron configuration
-       lsd,     &  ! if 1 lsda is computed      
-       rel,     &  ! 0 non-relativistic calculation
-                   ! 1 scalar-relativistic calculation
-                   ! 2 dirac-relativistic calculation
-       rel_dist, & ! 'energy' or 'average'. Distribution of electrons in 
-                   !  relativistic case
-       dft,     &  ! LDA, GGA, exchange only or Hartree ?
-       isic,    &  ! if 1 self-interaction correction
-       latt,    &  ! if <> 0 Latter correction is applied
-       title,   &  ! the title of the run
-       verbosity,& ! if 'high' writes more information on output
-       prefix,   & ! the prefix for file names
-       lsmall,   & ! if true the small component is written on file
-       rytoev_fact, & ! conversion between Ry and eV 
-       cau_fact, & ! speed of light in a.u.
-       vdw,      & ! if .true. vdW coefficient in TF+vW will be calculated
-       noscf,    & ! if .true. the charge density is not computed
-       file_charge, & ! file with the all-electron charge
-       write_coulomb, & ! if .true. write a fake pseudopotential file with the
-                     ! Coulomb potential for usage in all-electron calculations
-       max_out_wfc,   & ! maximum number of wavefunctions written in the
-                        ! output file
-       relpert       ! compute relativistic perturbative corrections
-
-  namelist /test/                 &
-       nconf,         & ! the number of configurations
-       configts,      & ! the configurations of the tests
-       file_pseudo,   & ! input file containing the pseudopotential
-       file_pseudopw, & ! output file containing the pseudopotential
-       file_potscf,   & ! output file with the scf potential at each iteration 
-       frozen_core,   & ! if true make a frozen-core all-electron calculation
-       lsdts,         & ! the lsd of each configuration
-       ecutmin,       & ! for test with spherical Bessel functions:
-       ecutmax,       & ! min and max energy cutoff for j_l(qr),
-       decut,         & ! step: ecut = ecutmin, ecutmin+decut, ... , ecutmax
-       rm,            & ! radius of the box
-       rcutv            ! CUT for LDA-1/2
-
-  namelist /inputp/ &
-       pseudotype,&! the pseudopotential type
-       tm,    &    ! use Troullier-Martins instead of RRKJ
-       rho0,  &    ! value of the charge at the origin
-       zval,  &    ! the pseudo valence
-       lloc,  &    ! l component considered as local 
-       nlcc,  &    ! if true nlcc is set
-       new_core_ps, & ! if true the core charge is pseudized with bessel funct.
-       rcore, &    ! the core radius for nlcc
-       rcloc, &    ! the local cut-off for pseudo
-       author, &   ! the author of the PP
-       ! paw variables:
-       which_augfun, &  ! choose shape of aug.fun. (GAUSS, BESSEL..)
-       lpaw,             &  ! if true generate or test a PAW dataset
-       lnc2paw,          &  ! if true the PAW dataset is generate from the NC one
-       rmatch_augfun,    & ! define the matching radius for aug.fun.
-       ! output files:
-       rmatch_augfun_nc, & ! if true the norm conserving core radii are
-                           ! used to smooth the Q functions
-       upf_v1_format, & ! set to true to use UPF version 1 file format (instead of version 2)
-       file_pseudopw, & ! output file where the pseudopotential is written
-       file_screen,   & ! output file for the screening potential
-       file_core,     & ! output file for total and core charge
-       file_beta,     & ! output file for the beta functions
-       file_chi,      & ! outpu  file for the chi functions
-       file_qvan,     & ! output file for the qvan functions
-       file_potscf,   & ! output file with the scf potential at each iteration 
-       file_wfcaegen, & ! output file where the all-electron wfc used for 
-                        !        pseudo generation are written
-       file_wfcncgen, & ! output file where the norm-conserving wfc used for 
-                        !        pseudo generation are written
-       file_wfcusgen, & ! output file where the ultra-soft wfc used for 
-                        !        pseudo generation are written
-       file_recon, &    ! output file needed for the paw reconstruction
-       lsave_wfc,&      ! set to true to save all-electron and ps wfc to file
-       lgipaw_reconstruction, & ! write data for (GI)PAW reconstruction
-       use_paw_as_gipaw  ! EMINE: if true gipaw data will be read from paw
-
-   !
-  prefix       = 'ld1'
-  file_pseudo  = ' '
-  file_pseudopw= ' '
-  file_recon   = ' '
-  file_screen  = ' '
-  file_core    = ' '
-  file_charge  = ' '
-  file_chi     = ' '
-  file_beta    = ' '
-  file_qvan    = ' '
-  file_potscf  = ' '
-  file_wfcaegen = ' '
-  file_wfcncgen = ' '
-  file_wfcusgen = ' '
-  !
-  ! nullify grid object before it is used
-  !
-  CALL nullify_radial_grid( grid )
-  !
-  !   set default values 
-  !
-  atom  = '  '
-  zed   = 0.0_dp
-!  xmin  = -7.0_dp
-!  dx    =  0.0125_dp
-  xmin  = 0.0_dp
-  dx    = 0.0_dp
-  rmax  =100.0_dp
-
-  beta  =  0.2_dp
-  tr2   = 1.0e-14_dp
-  iswitch=1
-
-  rpwe=0.0_dp
-  rlderiv=4.0_dp
-  eminld=-3.0_dp
-  emaxld=3.0_dp
-  nld=0
-  deld=0.03_dp
-
-  rytoev_fact=rytoev
-  cau_fact=c_au
-  rel = 5 
-  lsd = 0
-  lsmall=.false.
-  dft = 'LDA'
-  rel_dist='energy'
-  isic= 0
-  latt= 0
-  title = ' '
-  config= ' '
-  max_out_wfc=7
-
-  verbosity='low'
-  lpaw = .false.
-  author='anonymous'
-
-  vdw  = .false.
-  noscf = .false.
-  write_coulomb = .false.
-  lsave_wfc = .false.
-  lgipaw_reconstruction = .false.
-  use_paw_as_gipaw = .false. !EMINE
-  relpert = .false.
-
-  ! read the namelist input
-
-  if (ionode) then
-     CALL input_from_file()
-     read(5,input,err=100,iostat=ios) 
-  end if
-100  call mp_bcast(ios, ionode_id)
-  call errore('ld1_readin','reading input namelist ',abs(ios))
-  call bcast_input()
-  call mp_bcast( xmin, ionode_id )
-  call mp_bcast( dx, ionode_id )
-  call mp_bcast( rmax, ionode_id )
-  call mp_bcast(atom, ionode_id )
-  call mp_bcast(config, ionode_id )
-  call mp_bcast(dft, ionode_id )
-  call mp_bcast(rel_dist, ionode_id )
-!
-  call set_dft_from_name(dft)
-
-  if (zed == 0.0_dp .and. atom /= ' ') then
-     zed = DBLE(atomic_number(atom))
-  else if (zed /= 0.0_dp .and. atom == ' ') then
-     if (DBLE(int(zed)) /= zed .or. zed < 1.0_dp .or. zed > 103) then
-        write(zdum_,'(f6.2)') zed
-        call errore('ld1_readin','wrong nuclear charge zed: '//zdum_,1)
-     end if
-     atom = atom_name(nint(zed))
-  else
-     zdum = DBLE(atomic_number(atom))
-     if (zdum /= zed) call errore &
-          ('ld1_readin','inconsistent Z/atom specification',nint(zdum))
-  end if
-! with LDA-1/2 now iswitch <=4
-  if (iswitch < 1 .or. iswitch > 4) &
-       call errore('ld1_readin','wrong iswitch',1)
-  if (eminld > emaxld) &
-       call errore('ld1_readin','eminld or emaxld wrong',1)
-  if (deld < 0.0_dp) &
-       call errore('ld1_readin','negative deld',1)
-  if (nld > nwfsx) &
-       call errore('ld1_readin','too many nld',1)
-
-  if (nld>0 .and. rpwe==0.0_DP) rpwe=rlderiv
-
-  if ( noscf .and. iswitch /= 1) call errore('ld1_readin',&
-      'hydrogenic levels available only with iswitch=1',1)
-  if ( noscf .and. lsd == 1 ) call errore('ld1_readin',&
-      'hydrogenic levels available only with lsd=0',1)
-
-  if (isic == 1 .and. latt == 1) call errore('ld1_readin', &
-       &    'isic and latter correction not allowed',1)
-  if (isic == 1 .and. iswitch .ne. 1 ) call errore('ld1_readin', &
-       &    'SIC available with all-electron only', 1)
-
-  if ( relpert ) then
-     if (iswitch.gt.1 .or. rel.gt.0) call errore('ld1_readin',&
-      'perturbative SO-splitting for AE calculations with rel=0 only',1)
-     if (lsd.ne.0) call errore('ld1_readin',&
-      'spin-polarized perturbative corrections not available',1)
-  endif
-
-  if (rel == 5 ) then
-     if (zed < 19.0_dp) then
-        rel=0
-     else
-        rel=1
-     endif
-  endif
-  if (rel < 0 .or. rel > 2) call errore('ld1_readin','wrong rel',1)
-  !
-  !     No lsda with pseudopotential generation
-  !
-  if (iswitch > 2) lsd = 0
-  if (iswitch==2) tm=.true.
-  if (lsd == 0) then
-     nspin = 1
-  else if(lsd == 1) then
-     nspin = 2
-     if (rel == 2) call errore('ld1_readin', &
-       &    'local spin density and spin-orbit not allowed',1)
-  else
-     call errore('ld1_readin','lsd not correct',1)
-  endif
-
-  if (config == ' ') then
-     if (ionode) call read_config (rel, lsd, nwf, el, nn, ll, oc, isw, jj)
-     call bcast_config()
-  else
-     call el_config (config, rel, lsd, .true., nwf, el, nn, ll, oc, isw, jj)
-  end if
-  !
-  !  In the spin polarized or relativistic case adjust the occupations
-  !
-  if (lsd == 1.and.iswitch==1) then
-     call occ_spin(nwf,nwfx,el,nn,ll,oc,isw)
-  else if (rel == 2) then
-     call occ_spinorb(nwf,nwfx,el,nn,ll,jj,oc,isw,rel_dist)
-  endif
-  if (xmin==0.0_DP) then
-     if (iswitch==1.and..not.vdw.and.rel>0) then
-        xmin=-8.0_DP
-     else
-        xmin=-7.0_DP
-     endif
-  endif
-  if (dx==0.0_DP) then
-     if (iswitch==1.and..not.vdw) then
-        dx=0.008_DP
-     else
-        dx=0.0125_DP
-     endif
-  endif
-  if (xmin > -2.0_dp) call errore('ld1_readin','wrong xmin',1)
-  if (dx <=0.0_dp) call errore('ld1_readin','wrong dx',1)
-  !
-  ! generate the radial grid - note that if iswitch = 2 the radial grid
-  ! is not generated but read from the pseudopotential file
-  !
-! also for LDA-1/2 radial grid has to be read
-  if (iswitch /= 2.or.iswitch/=4) then
-     call do_mesh(rmax,zed,xmin,dx,0,grid)
-     rhoc=0.0_dp
-  endif
-  !
-  which_augfun = 'DEFAULT'
-  if (iswitch == 1) then
-     !
-     !    no more data needed for AE calculations
-     !
-     frozen_core=.false.
-     return
-     !     
-  else if (iswitch == 3) then
-     !
-     !    reading input for PP generation
-     !
-     zval=0.0_dp
-     lloc=-1
-     rcloc=-1_dp
-     nlcc=.false.
-     new_core_ps=.false.
-     rcore=0.0_dp
-     rho0=0.0_dp
-     tm  = .false.
-     pseudotype=0
-     jjs=0.0_dp
-     !
-     ! format defaults
-     upf_v1_format = .false.
-
-     !    paw defaults:
-     lnc2paw = .false.
-     rmatch_augfun=-1.0_dp   ! force a crash
-     rmatch_augfun_nc =.false.
-
-     if (ionode) read(5,inputp,err=500,iostat=ios)
-500  call mp_bcast(ios, ionode_id)
-     call errore('ld1_readin','reading inputp',abs(ios))
-     call bcast_inputp()
-
-     if(which_augfun=='DEFAULT') then
-        if( (lpaw .and. lnc2paw) .or. (.not. lpaw) ) then
-            which_augfun='AE'
-        else
-            which_augfun='BESSEL'
-        endif
-     endif
-
-     if (lloc < 0 .and. rcloc <=0.0_dp) &
-          call errore('ld1_readin','rcloc must be positive',1)
-     if (pseudotype < 1.or.pseudotype > 3) &
-          call errore('ld1_readin','specify correct pseudotype',1)
-     if (rel==2 .and. pseudotype==1 ) &
-          call errore('ld1_readin','Generation of a FR PP with'// & 
-                  &     ' pseudotype=1 not allowed',1)
-     if (which_augfun=='PSQ'.and.pseudotype.ne.3) &
-          call errore('ld1_readin','PSQ requires pseudotype=3',1)
-     !
-     if (ionode) &
-        call read_psconfig (rel, lsd, nwfs, els, nns, lls, ocs, &
-             isws, jjs, enls, rcut, rcutus )
-     call bcast_psconfig()
-     !
-     if (rel==2) call occ_spinorbps &
-          (nwfs,nwfsx,els,nns,lls,jjs,ocs,rcut,rcutus,enls,isws,rel_dist)
-     !
-     lmax = maxval(lls(1:nwfs))
-     !
-     do ns=1,nwfs
-        if (pseudotype < 3) rcutus(ns) = rcut(ns)
-        do ns1=1,ns-1
-           if (lls(ns) == lls(ns1).and.pseudotype == 1) &
-                call errore('ld1_readin','Two wavefunctions for the same l',1)
-        enddo
-        !
-        if (enls(ns) /= 0.0_dp .and. ocs(ns) > 0.0_dp) &
-             call errore('ld1_readin','unbound states must be empty',1)
-        if (rcut(ns) /= rcutus(ns)) then
-           !
-           ! this channel is US. Check that there is at least another energy
-           !
-          c1=0
-          do ns1=1,nwfs
-             if (lls(ns) == lls(ns1) .and. jjs(ns) == jjs(ns1)) c1=c1+1 
-          enddo
-!!!!
-          if (c1 < 2) then
-             write (stdout,'(/,5x,A)') &
-                  '!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!'
-             call infomsg ('ld1_readin', &
-                  'US requires at least two energies per channel '//els(ns))
-             write (stdout,'(5x,A)') &
-                  '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
-          endif
-!!!!
-        endif
-     enddo
-     if (nwfs > 1) then
-        if (els(nwfs)==els(nwfs-1) .and. jjs(nwfs)==jjs(nwfs-1) .and. &
-            lloc > -1) call errore('ld1_readin','only one local channel',1)
-     endif
-     nlc=0
-     nnl=0
-
-  end if
-  !
-  !    reading input for PP testing
-  !
-  jjts=0.0_dp
-  jjtsc=0.0_dp
-  
-  nconf=1
-  configts=' '
-  frozen_core=.false.
-  lsdts=lsd
-  ecutmin = 0.0_dp
-  ecutmax = 0.0_dp
-  decut   = 5.0_dp
-  rm      =30.0_dp
-
-!
-! default value for LDA-1/2
-!
-  rcutv = -1.0
-!
-  if (ionode) read(5,test,err=300,iostat=ios)
-300  call mp_bcast(ios, ionode_id)
-
-! LDA-1/2
-  if(iswitch==4) nconf = 2
-  if(iswitch==4.and.rcutv<0.0) call errore('ld1_readin','inconsistent rcutv',1)
-!
-
-! Added iswitch ==4 for LDA-1/2
-  if (iswitch==2.or.iswitch==4) call errore('ld1_readin','reading test',abs(ios))
-  call bcast_test()
-  call mp_bcast(configts, ionode_id)
-  !
-  !  PP generation: if namelist test is not found, use defaults
-  !
-  if (iswitch == 3 .and. ios /= 0 ) then
-     !
-     ! use for testing the same configuration as for PP generation
-     ! (unless a different one is explicitely specified in namelist &test)
-     !
-     ns1 = 0
-     do ns=1,nwfs
-        !
-        if ( ocs(ns)  > 0.0_dp .or. &
-            (ocs(ns) == 0.0_dp .and. enls(ns) == 0.0_dp) ) then
-           !
-           ! copy states used in the PP generation to testing configuration
-           ! Only bound states must be copied. Note that this WILL NOT WORK
-           ! if bound states are not used in the generation of the PP
-           !
-           ns1 = ns1 + 1
-           eltsc (ns1,1)= els (ns)
-           nntsc (ns1,1)= nns (ns)
-           lltsc (ns1,1)= lls (ns)
-           octsc (ns1,1)= ocs (ns)
-           iswtsc(ns1,1)= isws(ns)
-           jjtsc (ns1,1)= jjs (ns)
-        end if
-     end do
-     !
-     nwftsc(1) = ns1
-  else
-     !
-     if (nconf > ncmax1.or.nconf < 1) &
-          call errore('ld1_readin','nconf is wrong',1)
-     if (iswitch == 3 .and. nconf > 1) &
-          call errore('ld1_readin','too many test configurations',1)
-     if (frozen_core.and.lsdts(1)==1) call errore('ld1_readin',&
-         'With frozen-core the first configuration must be spin-unpolarized',1)
-     if (iswitch==3.and.lsdts(1)==1) call errore('ld1_readin',&
-         'No spin-polarization with iswitch==3',1)
-     if (frozen_core) verbosity='high'
-     !  
-     do nc=1,nconf
-        if (lsdts(nc)<0.or.lsdts(nc)>1) call errore('ld1_readin', &
-                         'lsdts must be 0 or 1',1)
-        if (rel==2.and.lsdts(nc)==1) call errore('ld1_readin',&
-            'Fully relativistic spin-polarized calculations not allowed',1)
-        if (configts(nc) == ' ') then
-           if (ionode) &
-           call read_psconfig (rel, lsdts(nc), nwftsc(nc), eltsc(1,nc), &
-                nntsc(1,nc), lltsc(1,nc), octsc(1,nc), iswtsc(1,nc), &
-                jjtsc(1,nc), enltsc(1,nc), rcuttsc(1,nc), rcutustsc(1,nc) )
-           call mp_bcast(eltsc(:,nc),ionode_id)
-           call mp_bcast(enltsc(:,nc),ionode_id)
-           do ns=1,nwftsc(nc)
-              do ns1=1,ns-1
-                 if (eltsc(ns,nc) == eltsc(ns1,nc)   &
-                    .and.ABS(jjtsc(ns,nc)-jjtsc(ns1,nc))<1.e-5_DP.and. &
-                     iswtsc(ns,nc)==iswtsc(ns1,nc)) &
-                    call errore('ld1_readin', &
-                               & 'Two test wavefunctions for the same n l',1)
-              enddo
-           enddo
-        else
-           call el_config( configts(nc), rel, lsdts(nc), .false., nwftsc(nc), &
-                eltsc(1,nc), nntsc(1,nc), lltsc(1,nc), octsc(1,nc), &
-                iswtsc(1,nc), jjtsc(1,nc))
-        endif
-     enddo
-     call bcast_pstsconfig()
-     do nc=1,nconf
-        !
-        !  adjust the occupations of the test cases if this is a lsd run
-        !
-        if (lsdts(nc) == 1) then
-           call occ_spin(nwftsc(nc),nwfsx,eltsc(1,nc),nntsc(1,nc),lltsc(1,nc),&
-             octsc(1,nc), iswtsc(1,nc)) 
-        else if (rel == 2) then
-           call occ_spinorb(nwftsc(nc),nwfsx,eltsc(1,nc), &
-             nntsc(1,nc),lltsc(1,nc),jjtsc(1,nc),octsc(1,nc),iswtsc(1,nc),&
-             rel_dist)
-        endif
-     end do
-  endif
-
-  zdum = zed
-  do n=1,nwf
-     if ( oc(n) > 0.0_dp) zdum = zdum - oc(n)
-  end do
-     !
-  do ns=1,nwftsc(1)
-     if ( octsc(ns,1) > 0.0_dp) zdum = zdum + octsc(ns,1)
-  end do
-     !
-  if (zval == 0.0_DP) then
-     zval = zdum
-     if ( abs(nint(zdum)-zdum) > 1.d-8 .and. iswitch==3 ) then
-         write(zdum_,'(f6.2)') zdum
-         call errore ('ld1_readin', 'found noninteger valence ' &
-              &//zdum_//', if you want this specify zval in inputp',1)
-     end if
-  else if ( abs(zval-zdum) > 1.d-8 ) then
-     write(zdum_,'(f6.2)') zdum
-     write(zval_,'(f6.2)') zval
-     call errore ('ld1_readin','supplied ('//zval_//') and calculated (' &
-                               //zdum_//') valence charge do not match',1)
-  end if
-  !
-  !    PP testing: reading the pseudopotential
-  !
-  if (iswitch ==2.or.iswitch==4) then
-     lpaw=.false.
-     !
-     if (file_pseudo == ' ') &
-       call errore('ld1_readin','file_pseudo is needed',1)
-     if (matches('.upf',file_pseudo) .or. matches('.UPF', file_pseudo)) then
-        !
-        !    UPF format
-        !
-        call import_upf ( )
-        call check_mesh(grid)
-        !
-     else if ( matches('.rrkj3', file_pseudo) .or. &
-               matches('.RRKJ3', file_pseudo)) then
-        !
-        !    Old RRKJ format
-        !
-        call read_pseudo_rrkj3 (ios)
-        !
-        if (ios /= 0) then
-           !
-           !    try old Norm-Conserving format
-           !
-           pseudotype = 1
-           !
-        else
-           call check_mesh(grid)
-           lmax=0
-           do ns=1,nwfs
-              lmax=max(lmax,lls(ns))
-           enddo
-        end if
-     else
-        !
-        !    Old Norm-Conserving format
-        !
-        pseudotype = 1
-        !
-     endif
-     !
-     if (pseudotype == 1) then
-        !
-        call read_pseudo_ncpp  (file_pseudo,zed,grid,ndmx, &
-             dft,lmax,lloc,zval,nlcc,rhoc,vnl,vpsloc,rel)
-        call check_mesh(grid)
-        call set_dft_from_name(dft)
-        !
-        do ns=1,lmax+1
-           ikk(ns)=grid%mesh
-        enddo
-     endif
-     !
-  endif
-  !
-  if (lpaw) then
-     lsave_wfc = .true.
-     if (pseudotype /= 3) call errore('ld1_readin', &
-          'please start from a US for generating a PAW dataset' ,pseudotype)
-     if (latt /= 0) call errore('ld1_readin', &
-          'Latter correction not implemented in PAW' ,latt)
-     call errore('ld1_readin', &
-          'PAW dataset generation and test is experimental' ,-1)
-     if(use_paw_as_gipaw)write(*,*)"PAW DATA WILL BE READ FOR GIPAW CALCULATION"
-  endif
-
-  return
-
-end subroutine ld1_readin
-
-subroutine bcast_input()
-  USE io_global,  ONLY : ionode_id
-  USE mp,         ONLY : mp_bcast
-  USE ld1inc,   ONLY : zed, beta, tr2, iswitch, nlc, rlderiv, eminld, emaxld, &
-                     deld, lsd, rel, lsmall, isic, latt, title, prefix, vdw, &
-                     nld, noscf, relpert, file_charge, max_out_wfc
-
-
-implicit none
-#ifdef __PARA
-   call mp_bcast( zed, ionode_id )
-   call mp_bcast( beta, ionode_id )
-   call mp_bcast( tr2, ionode_id )
-   call mp_bcast( iswitch, ionode_id )
-   call mp_bcast( nld, ionode_id )
-   call mp_bcast( rlderiv, ionode_id )
-   call mp_bcast( eminld, ionode_id )
-   call mp_bcast( emaxld, ionode_id )
-   call mp_bcast( deld, ionode_id )
-   call mp_bcast( lsd, ionode_id )
-   call mp_bcast( rel, ionode_id )
-   call mp_bcast( lsmall, ionode_id )
-   call mp_bcast( isic, ionode_id )
-   call mp_bcast( latt, ionode_id )
-   call mp_bcast( title, ionode_id )
-   call mp_bcast( prefix, ionode_id )
-   call mp_bcast( noscf, ionode_id )
-   call mp_bcast( relpert, ionode_id )
-   call mp_bcast( vdw, ionode_id )
-   call mp_bcast( file_charge, ionode_id )
-   call mp_bcast( max_out_wfc, ionode_id )
-#endif
-return
-end subroutine bcast_input
-
-subroutine bcast_inputp()
-  USE io_global,  ONLY : ionode_id
-  USE mp,         ONLY : mp_bcast
-  use ld1inc,     ONLY : pseudotype, tm, rho0, zval, lloc, nlcc, &
-                         rcore, rcloc, new_core_ps, lpaw, verbosity, &
-                         file_pseudopw, file_screen, file_core, file_beta, &
-                         file_chi, file_qvan, file_wfcaegen, file_wfcncgen, &
-                         file_wfcusgen, file_recon, which_augfun, &
-                         rmatch_augfun, lgipaw_reconstruction, lsave_wfc, &
-                         use_paw_as_gipaw !EMINE
-implicit none
-#ifdef __PARA
-  call mp_bcast( pseudotype, ionode_id )
-  call mp_bcast( tm,  ionode_id ) 
-  call mp_bcast( rho0,  ionode_id )
-  call mp_bcast( zval,  ionode_id )
-  call mp_bcast( lloc,  ionode_id )
-  call mp_bcast( nlcc,  ionode_id )
-  call mp_bcast( rcore, ionode_id )
-  call mp_bcast( rcloc, ionode_id )
-  call mp_bcast( new_core_ps,  ionode_id )
-  call mp_bcast( lpaw,  ionode_id )
-  call mp_bcast( verbosity,  ionode_id )
-  call mp_bcast( file_pseudopw, ionode_id )
-  call mp_bcast( file_screen, ionode_id ) 
-  call mp_bcast( file_core, ionode_id )
-  call mp_bcast( file_beta, ionode_id )
-  call mp_bcast( file_chi, ionode_id )
-  call mp_bcast( file_qvan, ionode_id )
-  call mp_bcast( file_wfcaegen, ionode_id )
-  call mp_bcast( file_wfcncgen, ionode_id )
-  call mp_bcast( file_wfcusgen, ionode_id )
-  call mp_bcast( file_recon,  ionode_id )
-  call mp_bcast( which_augfun,  ionode_id )
-  call mp_bcast( rmatch_augfun,  ionode_id )
-  call mp_bcast( lsave_wfc, ionode_id )
-  call mp_bcast( lgipaw_reconstruction, ionode_id )
-#endif
-  return
-end subroutine bcast_inputp
-
-subroutine bcast_test()
-  USE io_global,  ONLY : ionode_id
-  USE mp,         ONLY : mp_bcast
-  USE ld1inc,     ONLY : nconf, file_pseudo, ecutmin, ecutmax, decut, rm, &
-                         frozen_core, lsdts
-
-implicit none
-#ifdef __PARA
-   call mp_bcast( nconf, ionode_id ) 
-   call mp_bcast( file_pseudo, ionode_id )
-   call mp_bcast( ecutmin, ionode_id ) 
-   call mp_bcast( ecutmax, ionode_id ) 
-   call mp_bcast( decut, ionode_id ) 
-   call mp_bcast( rm, ionode_id )      
-   call mp_bcast( frozen_core, ionode_id )
-   call mp_bcast( lsdts, ionode_id )
-#endif
-return
-end subroutine bcast_test
-
-subroutine bcast_config()
-  USE io_global,  ONLY : ionode_id
-  USE mp,         ONLY : mp_bcast
-  USE ld1inc,     ONLY : nwf, el, nn, ll, oc, isw, jj
-
-implicit none
-#ifdef __PARA
-  call mp_bcast( nwf, ionode_id )
-  call mp_bcast( el, ionode_id )
-  call mp_bcast( nn, ionode_id )
-  call mp_bcast( ll, ionode_id )
-  call mp_bcast( oc, ionode_id )
-  call mp_bcast( isw, ionode_id )
-  call mp_bcast( jj, ionode_id )
-#endif
-return
-end subroutine bcast_config
-
-subroutine bcast_psconfig()
-  USE io_global,  ONLY : ionode_id
-  USE mp,         ONLY : mp_bcast
-  USE ld1inc,     ONLY : nwfs, els, nns, lls, ocs, jjs, isws, enls, rcut, &
-                         rcutus
-
-implicit none
-#ifdef __PARA
-  call mp_bcast( nwfs, ionode_id )
-  call mp_bcast( els, ionode_id )
-  call mp_bcast( nns, ionode_id )
-  call mp_bcast( lls, ionode_id )
-  call mp_bcast( ocs, ionode_id )
-  call mp_bcast( jjs, ionode_id )
-  call mp_bcast( isws, ionode_id )
-  call mp_bcast( enls, ionode_id )
-  call mp_bcast( rcut, ionode_id )
-  call mp_bcast( rcutus, ionode_id )
-#endif
-return
-end subroutine bcast_psconfig
-
-subroutine bcast_pstsconfig()
-  USE io_global,  ONLY : ionode_id
-  USE mp,         ONLY : mp_bcast
-  USE ld1inc,     ONLY : nwftsc, nntsc, lltsc, octsc, jjtsc, iswtsc, rcuttsc,&
-                         rcutustsc
-
-implicit none
-#ifdef __PARA
-  call mp_bcast( nwftsc, ionode_id )
-  call mp_bcast( nntsc, ionode_id )
-  call mp_bcast( lltsc, ionode_id )
-  call mp_bcast( octsc, ionode_id )
-  call mp_bcast( jjtsc, ionode_id )
-  call mp_bcast( iswtsc, ionode_id )
-  call mp_bcast( rcuttsc, ionode_id ) 
-  call mp_bcast( rcutustsc, ionode_id )
-#endif
-return
-end subroutine bcast_pstsconfig
-

Deleted: trunk/espresso/atomic/ld1_setup.f90
===================================================================
--- trunk/espresso/atomic/ld1_setup.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ld1_setup.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,184 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-SUBROUTINE ld1_setup
-  !---------------------------------------------------------------
-  !
-  !     this routine computes the general variables needed in
-  !     the atomic calculation
-  !
-  !
-  USE kinds, ONLY : dp
-  USE ld1inc, ONLY : iswitch, lsd, rel,sl3, lmx, nconf, &
-                nbeta, lloc, nsloc, etot, etot0, etots0, vxt, tau, vtau, &
-                file_wavefunctions, file_logder,  &
-                file_wavefunctionsps, file_logderps, file_pawexp, &
-                prefix, new, core_state, enls, enl,  &
-                nwf,                  jj,    el,    isw,    oc, nstoae, &
-                nwfs,          lls,   jjs,   els,   isws,   ocs, &
-                nwfts,  nnts,  llts,  jjts,  elts,  iswts,  octs, nstoaets, &
-                nwftsc, nntsc, lltsc, jjtsc, eltsc, iswtsc, octsc, nstoaec, lpaw
-  USE funct, ONLY : get_iexch, dft_is_meta, start_exx, dft_is_nonlocc 
-  IMPLICIT NONE
-
-  INTEGER :: n, n1, nc
-  LOGICAL :: hf, oep, meta, non_locc
-  real(DP) :: ocs_loc
-  !
-  !
-  meta = dft_is_meta()
-  IF ( meta .and. rel > 1 ) &
-      CALL errore('setup','meta-GGA not implemented for fully-relativistic case', 1)
-  IF ( meta .and. lsd == 1 ) &
-      CALL errore('setup','meta-GGA not implemented for LSDA', 2)
-  IF ( meta .and. iswitch > 1 ) &
-      CALL errore('setup','meta-GGA implemented only for all-electron case', 3)
-  hf  = get_iexch()==5
-  IF (hf)     CALL errore('setup','HF not implemented yet',1)
-  oep = get_iexch()==4
-  IF (oep.and.iswitch>1) &
-     CALL errore('setup','OEP is implemented only for all-electron calc.',1)
-  IF (oep.and.rel>0) &
-     CALL errore('setup','OEP is implemented only for non-relativistic calc.',1)
-  IF (oep) CALL start_exx
-  ! 
-  non_locc = dft_is_nonlocc()
-  IF ( non_locc ) &
-     CALL errore('setup','non-local functionals not implemented yet', 1)
-  !
-  CALL set_sl3(sl3,lmx)
-  !
-  !  make the correspondence all-electron pseudopotential
-  !
-  IF (iswitch >= 3) THEN
-     DO nc=1, nconf
-        DO n=1,nwftsc(nc)
-           nstoaec(n,nc)=0
-           DO n1=1,nwf
-              IF (lsd==1) THEN
-                 IF (eltsc(n,nc)==el(n1) &
-                      .and.iswtsc(n,nc)==isw(n1)) THEN
-                    nstoaec(n,nc)=n1
-                 ENDIF
-              ELSE
-                 IF (eltsc(n,nc)==el(n1).and.abs(jjtsc(n,nc)-jj(n1))<1.d-7) &
-                         & nstoaec(n,nc)=n1
-              ENDIF
-           ENDDO
-           IF (nstoaec(n,nc)==0) CALL errore('ld1_setup', &
-                'all electron wfc corresponding to pseudo-state ' &
-          &     //eltsc(n,nc)//' not found',nc)
-        ENDDO
-     ENDDO
-!
-!  set the test configuration for descreening
-!
-     IF (iswitch == 3) THEN
-        nwfts=nwftsc(1)
-        DO n=1,nwfts
-           nnts(n)=nntsc(n,1)
-           llts(n)=lltsc(n,1)
-           elts(n)=eltsc(n,1)
-           jjts(n) = jjtsc(n,1)
-           iswts(n)=iswtsc(n,1)
-           octs(n)=octsc(n,1)
-           nstoaets(n)=nstoaec(n,1)
-        ENDDO
-     ENDIF
-  ENDIF
-  !
-  new(:)=.false.
-  !
-  !  divide the core and valence states
-  !
-  gen_and_test:&
-  IF (iswitch == 3) THEN
-     isws=1
-     DO n=1,nwf
-        core_state(n)=.true.
-     ENDDO
-     DO n=1,nwfs
-        nstoae(n)=0
-        DO n1=1,nwf
-           IF (rel==2) THEN
-              IF (els(n)==el(n1).and.jjs(n)==jj(n1)) THEN
-                 nstoae(n)=n1
-                 core_state(n1)=.false.
-              ENDIF
-           ELSE
-              IF (els(n)==el(n1)) THEN
-                 nstoae(n)=n1
-                 core_state(n1)=.false.
-              ENDIF
-           ENDIF
-        ENDDO
-        IF (nstoae(n)==0) CALL errore('ld1_setup', &
-             'no all electron for this ps',n)
-        IF (enls(n)/=0.0_dp) new(n)=.true.
-     ENDDO
-     IF (lloc > -1) THEN
-        nsloc=nwfs
-        nbeta=nwfs-1
-        IF (rel==2.and.lloc/=0) THEN
-           nsloc=nwfs-1
-           nbeta=nwfs-2
-           IF (lls(nsloc+1)/=lloc) &
-             CALL errore('ld1_setup','mismatch between lloc and l of ' // &
-           &           'spin-orbit split wfc chosen for local potential',nsloc)
-        ENDIF
-        IF (lls(nsloc)/=lloc) THEN
-           IF (rel==2) THEN
-              CALL errore('ld1_setup','mismatch between lloc and l of ' // &
-           &            'spin-orbit split wfc chosen for local potential',nsloc)
-           ELSE
-              CALL errore('ld1_setup','mismatch between lloc and l of ' // &
-           &            'the wavefunction chosen for local potential',nsloc)
-           ENDIF
-        ENDIF
-        ocs_loc=ocs(nsloc)
-        IF (rel==2.and.lloc>0) ocs_loc=ocs_loc+ocs(nsloc+1)
-        IF (lpaw .and. ocs_loc>0.0_DP) &
-            CALL errore('ld1_setup','Paw generation with electrons' // &
-            &    'in the local channel is not available',1)
-     ELSE
-        nsloc=-1
-        nbeta=nwfs
-     ENDIF
-     !
-     !     test the occupations: for pseudopotential generation
-     !     all-electron and pseudopotential occupations must match
-     !
-     DO n=1,nwfs
-        IF (.not.new(n)) THEN
-           IF (abs(oc(nstoae(n))-ocs(n)) > 1.0d-8 ) CALL errore &
-             ('ld1_setup','mismatched all-electron/pseudo occupations',n)
-        ENDIF
-     ENDDO
-  ENDIF gen_and_test
-  !
-  !     zero the external potential, metaGGA potential, total energies
-  !
-  vxt=0.0_dp
-  vtau=0.0_dp
-  tau=0.0_dp
-  etot0=0.0_dp
-  etots0=0.0_dp
-  enl=0.0_dp
-  !
-  !    initialize file names (used in all_electron)
-  !
-  file_wavefunctions  = trim(prefix)//'.wfc'
-  file_wavefunctionsps= trim(prefix)//'ps.wfc'
-  file_logder   = trim(prefix)//'.dlog'
-  file_logderps = trim(prefix)//'ps.dlog'
-  file_pawexp = trim(prefix)//'.pwe'
-
-  RETURN
-END SUBROUTINE ld1_setup
-

Deleted: trunk/espresso/atomic/ld1_writeout.f90
===================================================================
--- trunk/espresso/atomic/ld1_writeout.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ld1_writeout.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,198 +0,0 @@
-!
-! Copyright (C) 2004-2010 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!     
-!---------------------------------------------------------------------
-subroutine ld1_writeout
-  !---------------------------------------------------------------------
-  !
-  !     This routine writes on output the quantities which defines 
-  !     a multiprojector pseudopotential. It can be in the
-  !     Vanderbilt form or in the norm-conserving form
-  !
-  use radial_grids, only: ndmx
-  use io_global, only : stdout, ionode, ionode_id
-  use mp,        only : mp_bcast
-  use ld1inc, only : file_pseudopw, upf_v1_format, zed, grid, &
-                     nconf , lpaw, rel, pawsetup, pseudotype, &
-                     rhoc, vnl, phits, vpsloc, & 
-                     elts, llts, octs, rcut, etots, nwfts, &
-                     lmax, lloc, zval, nlc, nnl, alps, alpc, alc, cc, nlcc, &
-                     iswitch
-  use funct, only : get_dft_name
-  use paw_type, only : deallocate_pseudo_paw
-
-  implicit none
-
-  integer :: &
-       ios,   &  ! I/O control
-       iunps     ! the unit with the pseudopotential
-
-  logical, external :: matches
-  logical :: oldformat
-  character (len=20) :: dft_name
-  
-  if (file_pseudopw == ' ') return
-
-  if (iswitch/=4.and.nconf > 1) &
-       call errore('ld1_writeout','more than one test configuration',1)
-
-  if ( (( rel == 2) .or. lpaw) &
-       .and. .not. matches('.UPF',file_pseudopw) &
-       .and. .not. matches('.upf',file_pseudopw) ) then
-     file_pseudopw=trim(file_pseudopw)//'.UPF'
-  end if
-
-  oldformat = .not. matches('.UPF',file_pseudopw) .and. &
-              .not. matches('.upf',file_pseudopw)
-
-  iunps=28
-  if (ionode) &
-     open(unit=iunps, file=trim(file_pseudopw), status='unknown',  &
-          form='formatted', err=50, iostat=ios)
-50  call mp_bcast(ios, ionode_id)
-  call errore('ld1_writeout','opening file_pseudopw',abs(ios))
-
-  if (ionode) then
-     if (oldformat) then
-        !
-        if (pseudotype == 1) then
-          dft_name = get_dft_name()
-          !
-          ! write in CPMD format 
-          if ( matches('.psp',file_pseudopw) ) then
-             call write_cpmd &
-                  (iunps,zed,grid%xmin,grid%dx,grid%mesh,ndmx,grid%r,grid%r2,  &
-                  dft_name,lmax,lloc,zval,nlc,nnl,cc,alpc,alc,alps,nlcc, &
-                  rhoc,vnl,phits,vpsloc,elts,llts,octs,rcut,etots,nwfts)
-          else
-          !
-          ! write old "NC" format (semilocal)
-          !
-             call write_pseudo &
-                  (iunps,zed,grid%xmin,grid%dx,grid%mesh,ndmx,grid%r,grid%r2,  &
-                  dft_name,lmax,lloc,zval,nlc,nnl,cc,alpc,alc,alps,nlcc, &
-                  rhoc,vnl,phits,vpsloc,elts,llts,octs,etots,nwfts)
-          end if
-        else
-          !
-          ! write old "RRKJ" format (nonlocal)
-          !
-           call write_rrkj ( iunps )
-        end if
-        !
-     else
-        !
-        if(upf_v1_format) then
-            call write_upf_atomic(iunps)
-        else
-            call export_upf(iunps)
-        endif
-        !
-        if(lpaw) call deallocate_pseudo_paw( pawsetup )
-        !
-     endif
-     !
-     close(iunps)
-  endif
-  !
-  return
-end subroutine ld1_writeout
-
-!---------------------------------------------------------------------
-subroutine write_rrkj (iunps)
-  !---------------------------------------------------------------------
-  !
-  use ld1inc, only : title, pseudotype, rel, nlcc, zval, etots, lmax, &
-                     els, nns, lls, rcut, rcutus, betas, phis, grid, &
-                     nwfs, nbeta, bmat, qq, qvan, ikk, rhoc, rhos, &
-                     vpsloc, ocs, rcloc
-  use funct, only: get_iexch, get_icorr, get_igcx, get_igcc, dft_is_nonlocc
-  implicit none
-  !
-  integer, intent(in):: iunps ! I/O unit
-  !
-  integer :: nb, mb, & ! counters on beta functions
-             ios,    & ! I/O control
-             ir        ! counter on mesh points
-  integer :: iexch, icorr, igcx, igcc, inlc
-  logical :: nonlocc
-  !
-  !
-  nonlocc = dft_is_nonlocc()
-  if (nonlocc) &
-     CALL errore('setup','non-local functional not implemented yet', 1)
-
-  write( iunps, '(a75)', err=100, iostat=ios ) title
-  !
-  write( iunps, '(i5)',err=100, iostat=ios ) pseudotype
-  if (rel > 0) then
-     write( iunps, '(2l5)',err=100, iostat=ios ) .true., nlcc
-  else
-     write( iunps, '(2l5)',err=100, iostat=ios ) .false., nlcc
-  endif
-  iexch = get_iexch()
-  icorr = get_icorr()
-  igcx  = get_igcx()
-  igcc  = get_igcc()
-  inlc  = 0
-  write( iunps, '(4i5)',err=100, iostat=ios ) iexch, icorr, igcx, igcc
-
-  write( iunps, '(2e17.11,i5)') zval, etots, lmax
-  write( iunps, '(4e17.11,i5)',err=100, iostat=ios ) &
-       grid%xmin,grid%rmax,grid%zmesh,grid%dx,grid%mesh
-
-  write( iunps, '(2i5)', err=100, iostat=ios ) nwfs, nbeta
-  write( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-       ( rcut(nb), nb=1,nwfs )
-  write( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-       ( rcutus(nb), nb=1,nwfs )
-  do nb=1,nwfs
-     write(iunps,'(a2,2i3,f6.2)',err=100,iostat=ios) &
-          els(nb), nns(nb), lls(nb), ocs(nb)
-  enddo
-  do nb=1,nbeta
-     write ( iunps, '(i6)',err=100, iostat=ios ) ikk(nb)
-     write ( iunps, '(1p4e19.11)',err=100, iostat=ios ) &
-          ( betas(ir,nb), ir=1,ikk(nb))
-     do mb=1,nb
-        write( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-             bmat(nb,mb)
-        if (pseudotype == 3) then
-           write(iunps,'(1p4e19.11)',err=100,iostat=ios) &
-                qq(nb,mb)
-           write(iunps,'(1p4e19.11)',err=100,iostat=ios) & 
-                (qvan(ir,nb,mb),ir=1,grid%mesh)
-        endif
-     enddo
-  enddo
-  !
-  !   writes the local potential 
-  !
-  write( iunps, '(1p4e19.11)',err=100, iostat=ios ) rcloc, &
-       ( vpsloc(ir), ir=1,grid%mesh )
-  !
-  !   writes the atomic charge
-  !
-  write( iunps, '(1p4e19.11)',err=100, iostat=ios )  &
-       ( rhos(ir,1), ir=1,grid%mesh )
-  !
-  !   If present writes the core charge
-  !
-  if ( nlcc ) then 
-     write( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-          ( rhoc(ir), ir=1,grid%mesh )
-  endif
-  !
-  !    Writes the wavefunctions of the atom
-  !      
-  write( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-       ((phis(ir,nb),ir=1,grid%mesh),nb=1,nwfs)
-100 call errore('ld1_writeout','Writing pseudopw file',abs(ios))
-  !
-end subroutine write_rrkj
-

Deleted: trunk/espresso/atomic/ld1inc.f90
===================================================================
--- trunk/espresso/atomic/ld1inc.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/ld1inc.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,358 +0,0 @@
-!
-! Copyright (C) 2004-2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-MODULE ld1inc
-  USE kinds, ONLY : dp
-  USE ld1_parameters
-  USE radial_grids, ONLY: radial_grid_type, ndmx
-  USE paw_type, ONLY : paw_t
-  IMPLICIT NONE
-  SAVE
-  PRIVATE :: nwfx, nwfsx, ncmax1
-  INTEGER, PARAMETER :: lmx=3, lmx2=2*lmx
-  !
-  !    variables for the all-electron calculation
-  !
-  INTEGER  ::      &
-       nn(nwfx),   &   ! the main quantum number
-       ll(nwfx),   &   ! the orbital angular momentum
-       nwf,        &   ! the number of wavefunctions
-       isw(nwfx),  &   ! spin of the wfc. if(.not.lsd) all 1 (default)
-       nspin           ! 1 (default) or 2 (if lsd=true)
-
-  CHARACTER(len=2) ::&
-       el(nwfx)        !  the label of the states
-
-  real(DP) ::   &
-       jj(nwfx),     & ! the total angular momentum
-       oc(nwfx),     & ! the occupations of the all-electron atom
-       zed,          & ! the ionic charge
-       enne,         & ! the number of electrons
-       sl3(0:lmx2,0:lmx2,0:lmx2)
-
-  real(DP)::          &
-       enl(nwfx),          & ! the energies of the all-electron atom
-       psi(ndmx,2,nwfx),    & ! the all-electron (dirac) wavefunctions
-                             ! psi(:,1,n) = major component for state n
-                             ! psi(:,2,n) = minor component for state n
-       rho(ndmx,2),         & ! the all-electron density
-                             ! rho(:,1) = spin-up, rho(:,2) = spin-down
-       zeta(ndmx),           & ! the all-electron magnetization
-       ! relativistic perturbative terms
-       evel(nwfx),       & ! p^4 ("velocity") correction
-       edar(nwfx),       & ! Darwin term
-       eso(nwfx)           ! spin-orbit splitting
-
-  LOGICAL :: &
-       core_state(nwfx)   ! if true the state is in the core
-  !
-  !    the parameters of the logarithmic mesh
-  !
-  TYPE(radial_grid_type) :: grid
-  !
-  !    the variables for computing logarithmic derivatives
-  !
-  INTEGER :: &
-       nld,  &  ! computes the log der of the last nld wavefunctions
-       npte     ! number of energy points
-
-  real(DP) :: &
-       rlderiv,    & ! the radius of logarithmic derivatives
-       eminld,     & ! the minimum energy
-       emaxld,     & ! the maximum energy
-       deld,       & ! the deltae of energy
-       rpwe          ! the radius of the partial wave expansion
-  !
-  !   the variables which define the pseudopotential
-  !
-  INTEGER ::       &
-       nns(nwfsx), & ! the main quantum number of pseudopotential
-       lls(nwfsx), & ! the angular momentum of pseudopotential
-       isws(nwfsx),& ! the spin of each pseudo-wavefunctions (not used)
-       ikk(nwfsx), & ! the maximum ik of each beta functions
-       ik(nwfsx),  & ! the ik that correspond to rcut
-       ikus(nwfsx), & ! the ik that corresponds to rcutus
-       nwfs,       & ! the number of pseudo wavefunctions
-       nbeta,      & ! the number of projectors
-       nsloc,      & ! the wavefunction which correspond to the loc pot
-       lloc,       & ! the l component considered as local
-       pseudotype, &  ! the type of pseudopotential
-       nstoae(nwfsx)  ! for each pseudo the all-electron
-
-  CHARACTER(len=2) :: &
-       els(nwfsx)       !  the label of the states
-
-  real(DP) ::       &
-       enls(nwfsx),      & ! the energies of the pseudo atom
-       jjs(nwfsx),       & ! the j of each wavefunction (only rel=2)
-       ocs(nwfsx),       & ! the occupations of the pseudo atom
-       rcut(nwfsx),      & ! the cut-off radius for pseudowavefunctions
-       rcutus(nwfsx),    & ! the cut-off radius for us-pseudowavefunctions
-       rcloc,            & ! cut-off for local potential
-       ecutrho,          & ! suggested cut-off for the change
-       ecutwfc,          & ! suggested cut-off for the wavefunctions
-       zval,             & ! the ionic pseudo charge
-       phis(ndmx,nwfsx),  & ! the pseudo wavefunctions
-       psipsus(ndmx,nwfx),& ! the all-electron wavefunctions for us pseudo
-       rhos(ndmx,2),      & ! the pseudo density
-       zetas(ndmx),       & ! the pseudo magnetization
-       vnl(ndmx,0:3,2),   & ! the pseudopotential in semilocal form
-       betas(ndmx,nwfsx), & ! the projector functions
-       chis(ndmx,nwfsx),  & ! auxiliary functions
-       rho0,             & ! value of the charge at the origin
-       bmat(nwfsx,nwfsx), &! the pseudo coefficients (unscreened D)
-       ddd(nwfsx,nwfsx,2),&! the screened D
-       qq(nwfsx,nwfsx),   &! the integrals of the qvan
-       qvan(ndmx,nwfsx,nwfsx), & ! the augmentation functions
-       qvanl(ndmx,nwfsx,nwfsx,0:lmx2) ! the augmentation functions, l dependent
-
-  LOGICAL :: &
-       tm,            &!  if true use Troullier-Martins for norm-conserving PP
-       new(nwfsx)      !  if true the fit is on arbitrary energy
-  !
-  !    the variable for multiconfigurations
-  !
-  INTEGER ::                 &
-       nconf,                & ! number of configuration
-       nstoaec(nwfsx,ncmax1),& ! correspondence all-electron test
-       lsdts(ncmax1),        & ! for each configuration the lsd
-       nwftsc(ncmax1),       & ! number of wavefunctions for each config.
-       nntsc(nwfsx,ncmax1),lltsc(nwfsx,ncmax1),& ! the quantum numbers of
-                                ! each configuration
-       iswtsc(nwfsx,ncmax1)    ! the spin index
-
-  CHARACTER(len=2) ::  &
-       eltsc(nwfsx,ncmax1)     !  the labels for each configuration
-
-  real(DP) ::              &
-       rcuttsc(nwfsx,ncmax1),   & ! the cut-off radius of each configuration
-       rcutustsc(nwfsx,ncmax1), & ! cut-off radius for us
-       jjtsc(nwfsx,ncmax1),     & ! the j of a configuration
-       octsc(nwfsx,ncmax1),     & ! the occupations of each configuration
-       enltsc(nwfsx,ncmax1)       ! the energies of each configuration
-  !
-  ! for tests
-  !
-  INTEGER ::        &
-       nnts(nwfsx),  &   ! the main quantum number of pseudopotential
-       llts(nwfsx),  &   ! the angular momentum of pseudopotential
-       iswts(nwfsx), &   ! spin of the wfc. if(.not.lsd) all 1 (default)
-       nstoaets(nwfsx), & ! for each test wavefunction the all-electron
-       nwfts             ! the number of pseudo wavefunctions
-
-  real(DP) ::        &
-       enlts(nwfsx),       & ! the energies for the test configuration
-       phits(ndmx,nwfsx),   & ! the pseudo wavefunctions
-       rcutts(nwfsx),      & ! cut-off radius for test wavefunction
-       rcutusts(nwfsx),    & ! us cut-off radii for test wavefunct.
-       jjts(nwfsx),        & ! jj of the test function (rel=2)
-       octs(nwfsx)           ! the occupation numbers
-
-  CHARACTER(len=2) ::  &
-       elts(nwfsx)           ! the label of the states
-  !
-  ! for LDA-1/2
-  !
-  real(DP) :: rcutv ! CUT for LDA-1/2
-  !
-  !    The control of the run
-  !
-  INTEGER ::      &
-       iter,      &  ! iteration conter
-       lsd,       &  ! if true lsd calculation
-       isic,      &  ! if true uses self-interaction correction
-       latt,      &  ! if true Latter's correction is applied
-       iswitch,   &  ! control the type of run
-       max_out_wfc, & ! maximum number of wavefunctions written on the
-                     !   wavefunctions file.
-       rel           ! 0 nonrelativistic calculation
-  ! 1 scalar relativistic calculation
-  ! 2 calculation with the full dirac equation
-  LOGICAL ::      &
-       lsmall,    &     ! if true writes the small component on file
-       relpert,   &     ! compute relativistic perturbative corrections
-       frozen_core, &   ! if true the all-electron calculation is frozen core
-       write_coulomb, & ! if true write a fake UPF pseudopotential file named
-                        ! X.coul (X=atomic symbol) - for usage in special cases
-                        ! when the bare coulomb potential is required
-       noscf            ! if true a hydrogenic atom is solved. The charge
-                        ! density is not computed.
-
-
-
-  CHARACTER(len=4) :: &
-       verbosity     ! if 'high' writes more information on output
-
-
-  real(DP) :: &
-       beta,       &   ! the mixing parameter
-       tr2,        &   ! the required precision of the scf
-       eps0            ! the reached precision of the scf
-  !
-  !    parameters for the old type pseudopotential
-  !
-  INTEGER ::   &
-       lmin,   &  ! the minimum angular momentum
-       lmax,   &  ! the maximum angular momentum
-       nlc,    &  ! number of core functions
-       nnl        ! number of angular momentum functions
-
-  real(DP) ::     &
-       cc(2),          & ! the coeffients of the core part
-       alpc(2),        & ! the alpha parameters of the core
-       alc(6,0:3),     & ! the coefficients of the pseudopotential
-       alps(3,0:3)       ! the alpha parameters
-  !
-  !   the energy parameters
-  !
-  real(DP) :: &
-       etot,       &    ! total energy
-       etot0,      &    ! saved value of the total energy
-       ekin,       &    ! kinetic energy
-       encl,       &    ! nuclear Coulomb energy
-       ehrt,       &    ! Hartree energy
-       ecxc,       &    ! exchange-correlation energy
-       ecc,        &    ! core-only contribution to the energy
-       evxt,       &    ! external field energy
-       epseu,      &    ! pseudopotential energy
-       ekinc,      &    ! core kinetic energy
-       ekinc0,     &    ! core kinetic energy
-       ekinv,      &    ! valence kinetic energy
-       enclv, enclc,  & ! nuclear Coulomb energy of valence and core
-       ehrtvv,     &    ! valence-valence Hartree energy
-       ehrtcv,     &    ! core-valence Hartree energy
-       ehrtcc,     &    ! core-core Hartree energy
-       ae_fc_energy, &  ! frozen core energy calculated with all-electron char
-       dhrsic,     &    ! Hartree sic energy
-       dxcsic,     &    ! exchange sic energy
-       etots,      &    ! total pseudopotential energy
-       etots0           ! saved value of the total pseudopotential energy
-  !
-  !  variable for nlcc
-  !
-  real(DP) :: &
-       rcore,      &  ! the points where core charge is smooth
-       rhoc(ndmx)      ! the core charge
-
-  LOGICAL :: &
-       new_core_ps, & ! if true pseudize the core charge with bessel functions
-       nlcc    ! if true nlcc pseudopotential
-  !
-  !  the potential for the scf
-  !
-  real(DP) ::   &
-       v0(ndmx),      & ! the coulomb potential
-       vpot(ndmx,2),  & ! the all-electron scf potential
-       vxt(ndmx),     & ! the external potential
-       vh(ndmx),      & ! the hartree potential
-       vxc(ndmx,2),   & ! the exchange and correlation potential
-       exc(ndmx),     & ! the exchange and correlation energy
-       excgga(ndmx),  & ! the GGA exchange and correlation energy
-       vxcts(ndmx,2), & ! the pseudo exchange and correlation potential
-       excts(ndmx),   & ! the pseudo exchange and correlation energy
-       excggats(ndmx),& ! the GGA exchange and correlation energy
-       vpstot(ndmx,2),& ! the total local pseudopotential
-       vpsloc(ndmx)  ,& ! the local pseudopotential
-       vx(ndmx,2)    ,& ! the OEP-X potential (when needed)
-       enzero(2)
-  real(DP) ::  &
-       tau(ndmx,2),   & ! kinetic energy density for metaGGA
-       vtau(ndmx)       ! potential for metaGGA
-  real(DP), ALLOCATABLE ::  &
-       vsic(:,:), vsicnew(:), vhn1(:), egc(:) ! potentials for SIC
-  !
-  LOGICAL :: lsave_wfc  ! if true, wfcs (AE and PS) are saved to the UFP file
-  !
-  !  variables needed for PAW dataset generation and test
-  !
-  LOGICAL :: &
-       lpaw,      &! if true generate or test a PAW dataset
-       lnc2paw, &  ! if true the PAW dataset is generate from the NC one
-       rmatch_augfun_nc, &  ! if .true. the norm conserving radii are
-                            ! used to pseudize the q functions
-       use_paw_as_gipaw ! if true, PAW data will be used for GIPAW
-  TYPE(paw_t) :: &
-       pawsetup    ! the PAW dataset
-  real(DP) ::       &
-       rmatch_augfun,     & ! define the matching radius for paw aug.fun.
-       psipaw(ndmx,nwfsx),& ! the all-electron wavefunctions for any beta
-       psipaw_rel(ndmx,nwfsx),& ! the all-electron wfc small component
-       aeccharge(ndmx),   & ! true, not smoothened, AE core charge for PAW
-       psccharge(ndmx),   & ! smoothened core charge for PAW
-       paw_energy(5,3)
-
-   CHARACTER(len=20) ::&
-       which_augfun     ! choose shape of paw fun. (GAUSS, BESSEL..)
-  !
-  ! conversion factor
-  !
-  real(DP) :: &
-             rytoev_fact    ! Conversion from Ry and eV. A value
-                            ! different from default can be used
-                            ! to reproduce results of old papers.
-  real(DP) :: &
-             cau_fact       ! speed of light in atomic units.
-  !
-  !  Auxiliary quantities for verbose output
-  !
-  real(DP) ::       &
-       aevcharge(ndmx,2)     ! the all-electron valence charge
-
-  !
-  !  file names
-  !
-  LOGICAL :: upf_v1_format     ! set to true to use version 1 of UPF file format
-  CHARACTER(len=75)  :: title  ! the title of the run
-  CHARACTER(len=75)  :: author ! the author of the pseudopotential
-  CHARACTER(len=240) :: prefix ! prefix for file names
-  CHARACTER(len=256) ::      & !
-       file_pseudo,          & ! input file containing the pseudopotential
-       file_pseudopw           ! output file where the pseudopot is written
-  CHARACTER(len=256) ::      & ! output filenames read from input, containing:
-       file_charge,          & ! all-electron total charge only
-       file_chi,             & ! chi functions
-       file_beta,            & ! beta functions
-       file_qvan,            & ! qvan functions
-       file_screen,          & ! screening potential
-       file_core,            & ! core charge
-       file_recon              ! information for paw reconstruction
-  ! the following filenames are determined by "prefix", not read from input
-  CHARACTER(len=256) ::      & ! output files, containing:
-       file_wfcaegen,        & ! all-electron wavefunctions for generation
-       file_wfcncgen,        & ! norm-conserving wavefunctions for generation
-       file_wfcusgen,        & ! ultra-soft wavefunctions for generation
-       file_potscf,          & ! scf potential at each iteration
-       file_wavefunctions,   & ! all-electron results for orbitals
-       file_wavefunctionsps, & ! pseudopotential results for orbitals
-       file_logder,          & ! all-electron logarithmic derivatives
-       file_logderps,        & ! pseudopotential logarithmic derivatives
-       file_pawexp,          & ! quality index of partial wave expansion
-       file_tests              ! results of pseudopotential tests
-  !
-  ! vdw calculation
-  !
-  LOGICAL :: vdw        ! optional variable
-  !
-  real(DP) :: um,     & ! maximum frequency
-              du,     & ! step of frequency
-              tr_s    ! threshold for scf solution of modified Sternheimer equation
-  !
-  ! test on ghosts and convergences with spherical Bessel functions
-  !
-  real(DP) :: ecutmin, & ! min kinetic energy cutoff for j_l(qr)
-              ecutmax, & ! max energy cutoff
-              decut,   & ! step: ecut = ecutmin, ecutmin+decut, ... , ecutmax
-              rm         ! radius of the box
-  !
-  ! (GI)PAW reconstruction
-  !
-  LOGICAL :: lgipaw_reconstruction
-  REAL ( dp ) :: wfc_ae_recon(ndmx,nwfx)
-  REAL ( dp ) :: wfc_ps_recon(ndmx,nwfsx)
-  REAL ( dp ) :: wfc_us_recon(ndmx,nwfsx)
-  !
-END MODULE ld1inc

Deleted: trunk/espresso/atomic/lderiv.f90
===================================================================
--- trunk/espresso/atomic/lderiv.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/lderiv.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,123 +0,0 @@
-!
-! Copyright (C) 2004-201 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-SUBROUTINE lderiv
-  !---------------------------------------------------------------
-  !
-  !  numerical integration of the radial schroedinger equation
-  !  computing logarithmic derivatives for Coulomb potential
-  !
-  !
-  USE kinds,     ONLY : dp
-  USE radial_grids, ONLY : ndmx
-  USE io_global, ONLY : stdout
-  USE mp,        ONLY : mp_bcast
-  USE ld1_parameters, ONLY : nwfsx
-  USE ld1inc,    ONLY : file_logder, grid, vpot, rel, nspin, nld, zed, &
-                        npte, deld, eminld, emaxld, rlderiv
-
-  IMPLICIT NONE
-
-  INTEGER ::        &
-       lam,    &   ! the angular momentum
-       ikrld,  &   ! index of matching radius
-       nc,     &   ! counter on logarithmic derivatives
-       nin,    &   ! integer variable for lschps
-       is,     &   ! counter on spin
-       nstop,  &   ! integer to monitor errors
-       ios,    &   ! used for I/O control
-       n,ie        ! generic counter
-
-  real(DP) ::           &
-       aux(ndmx),         & ! the square of the wavefunction
-       aux_dir(ndmx,2),   & ! the square of the wavefunction
-       ze2,              & ! the nuclear charge in Ry units
-       e,                & ! the eigenvalue
-       j,                & ! total angular momentum for log_der
-       thrdum = 0.0_dp     ! real variable (not used) for lschps
-
-  real(DP), EXTERNAL :: compute_log
-
-  real(DP), ALLOCATABLE ::        &
-       ene(:),        &    ! the energy grid
-       dlchi(:, :)         ! the logarithmic derivative
-
-  CHARACTER(len=256) :: flld
-
-
-  IF (nld == 0 .or. file_logder == ' ') RETURN
-  IF (nld > nwfsx) CALL errore('lderiv','nld is too large',1)
-
-  ze2=-zed*2.0_dp
-
-  DO n=1,grid%mesh
-     IF (grid%r(n) > rlderiv) GOTO 10
-  ENDDO
-  CALL errore('lderiv','wrong rlderiv?',1)
-10 ikrld = n-1
-  WRITE(stdout,'(5x,''Computing logarithmic derivative in'',f10.5)') &
-       (grid%r(ikrld)+grid%r(ikrld+1))*0.5_dp
-
-  npte= (emaxld-eminld)/deld + 1
-  ALLOCATE ( dlchi(npte, nld) )
-  ALLOCATE ( ene(npte) )
-  DO ie=1,npte
-     ene(ie)= eminld+deld*(ie-1)
-  ENDDO
-
-  DO is=1,nspin
-     DO nc=1,nld
-        IF (rel < 2) THEN
-           lam=nc-1
-           j=0.0_dp
-        ELSE
-           lam=nc/2
-           IF (mod(nc,2)==0) j=lam-0.5_dp
-           IF (mod(nc,2)==1) j=lam+0.5_dp
-        ENDIF
-        DO ie=1,npte
-           e=ene(ie)
-           !
-           !    integrate outward up to ikrld+1
-           !
-           IF (rel == 1) THEN
-              nin = ikrld+5
-              CALL lschps (3, zed, thrdum, grid, nin, 1, lam, e, &
-                   vpot(1,is), aux, nstop )
-           ELSEIF (rel == 2) THEN
-              CALL dir_outward(ndmx,ikrld+5,lam,j,e,grid%dx,&
-                   aux_dir,grid%r,grid%rab,vpot(1,is))
-              aux(:)=aux_dir(:,1)
-           ELSE
-              CALL intref(lam,e,ikrld+5,grid,vpot(1,is),ze2,aux)
-           ENDIF
-           !
-           !    compute the logarithmic derivative and save in dlchi
-           !
-           dlchi(ie, nc) = compute_log(aux(ikrld-3),grid%r(ikrld),grid%dx)
-        ENDDO
-     ENDDO
-
-     IF (nspin == 2 .and. is == 1) THEN
-        flld = trim(file_logder)//'up'
-     ELSEIF (nspin == 2 .and. is == 2) THEN
-        flld = trim(file_logder)//'dw'
-     ELSE
-        flld = trim(file_logder)
-     ENDIF
-
-     CALL write_efun(flld,dlchi,ene,npte,nld)
-     !
-  ENDDO
-
-  DEALLOCATE (ene)
-  DEALLOCATE (dlchi)
-  RETURN
-END SUBROUTINE lderiv
-

Deleted: trunk/espresso/atomic/lderivps.f90
===================================================================
--- trunk/espresso/atomic/lderivps.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/lderivps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,166 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine lderivps
-  !---------------------------------------------------------------
-  !
-  !  numerical integration of the radial schroedinger equation 
-  !  computing logarithmic derivatives for pseudo-potentials
-  !  multiple nonlocal projectors are allowed
-  !
-  use kinds,     only : DP
-  use radial_grids, only : ndmx
-  use io_global, only : stdout
-  use mp,        only : mp_bcast
-  use radial_grids, only: series
-  use ld1_parameters, only : nwfsx
-  use ld1inc,    only : grid, nld, nbeta, nspin, rel, ikk, file_logderps, &
-                        betas, ddd, qq, lls, jjs, pseudotype, vpstot, vnl, &
-                        rlderiv, npte, emaxld, eminld, deld
-  implicit none
-
-  integer  ::       &
-       lam,   &      ! the angular momentum
-       ikrld, &      ! index of matching radius
-       nc,    &      ! counter on logarithmic derivatives
-       nbf,   &      ! number of b functions
-       n,ie          ! generic counters
-
-  real(DP) ::  &
-       ze2,     &    ! the nuclear charge in Ry units
-       jam,     &    ! the total angular momentum
-       e,       &    ! the eigenvalue
-       lamsq,   &    ! combined angular momentum
-       ddx12,   &    !
-       b(0:3)          ! used for starting guess of the solution 
-
-  real(DP),allocatable :: &
-       ene(:),      &  ! the energy mesh
-       dlchis(:,:), &  ! the logarithmic derivatives
-       vaux(:),     &  ! auxiliary: the potential 
-       aux(:),      &  ! the square of the wavefunction
-       al(:)           ! the known part of the differential equation
-
-  real(DP), external :: compute_log
-  real(DP), external :: int_0_inf_dr
-
-  integer :: &
-       ikmin,         &  ! minimum value of ik
-       ios,           &  ! used for I/O control
-       is, ind           ! counters on index
-
-  character(len=256) :: flld
-
-
-  if (nld == 0 .or. file_logderps == ' ') return
-  if (nld > nwfsx) call errore('lderivps','nld is too large',1)
-
-  allocate( al(grid%mesh), aux(grid%mesh), vaux(grid%mesh) )
-
-  ze2=0.0_dp
-
-  do n=1,grid%mesh
-     if (grid%r(n) > rlderiv) go to 10
-  enddo
-  call errore('lderivps','wrong rlderiv?',1)
-10 ikrld = n-1
-  write(stdout,'(5x,''Computing logarithmic derivative in'',f10.5)') &
-       (grid%r(ikrld)+grid%r(ikrld+1))*0.5_dp
-  npte= (emaxld-eminld)/deld + 1
-  allocate ( dlchis(npte,nld) )
-  allocate ( ene(npte) )
-  do ie=1,npte
-     ene(ie)= eminld+deld*(ie-1)
-  enddo
-
-  ikmin=ikrld+5
-  if (nbeta>0) then
-     do nbf=1,nbeta
-        ikmin=max(ikmin,ikk(nbf))
-     enddo
-  endif
-  do is=1,nspin
-     do nc=1,nld
-        if (rel < 2) then
-           lam=nc-1
-           jam=0.0_dp
-        else
-           lam=nc/2
-           if (mod(nc,2)==0) jam=lam-0.5_dp
-           if (mod(nc,2)==1) jam=lam+0.5_dp
-        endif
-
-        ddx12=grid%dx*grid%dx/12.0_dp
-        nbf=nbeta
-        if (pseudotype == 1) then
-           if (rel < 2 .or. lam == 0 .or. abs(jam-lam+0.5_dp) < 0.001_dp) then
-              ind=1
-           else if (rel==2 .and. lam>0 .and. abs(jam-lam-0.5_dp)<0.001_dp) then
-              ind=2
-           endif
-           do n=1,grid%mesh
-              vaux(n) = vpstot(n,is) + vnl(n,lam,ind)
-           enddo
-           nbf=0
-        else
-           do n=1,grid%mesh
-              vaux(n) = vpstot(n,is)
-           enddo
-        endif
-
-        do n=1,4
-           al(n)=vaux(n)-ze2/grid%r(n)
-        enddo
-        call series(al,grid%r,grid%r2,b)
-
-        do ie=1,npte
-           e=ene(ie)
-           lamsq=(lam+0.5_dp)**2
-           !
-           !     b) find the value of solution s in the first two points
-           !
-           call start_scheq( lam, e, b, grid, ze2, aux )
-
-           do n=1,grid%mesh
-              al(n)=( (vaux(n)-e)*grid%r2(n) + lamsq )*ddx12
-              al(n)=1.0_dp-al(n)
-           enddo
-
-           call integrate_outward (lam,jam,e,grid%mesh,ndmx,grid,al,b,aux,betas,ddd,&
-                qq,nbf,nwfsx,lls,jjs,ikk,ikmin)
-
-           !
-           !    compute the logarithmic derivative and save in dlchi
-           !            
-           do n=-3,3
-              aux(ikrld+n)= aux(ikrld+n)*grid%sqr(ikrld+n)
-           enddo
-
-           dlchis(ie,nc)=compute_log(aux(ikrld-3),grid%r(ikrld),grid%dx)
-        enddo
-     enddo
-
-     if (nspin == 2 .and. is == 1) then
-        flld = trim(file_logderps)//'up'
-     else if (nspin == 2 .and. is == 2) then
-        flld = trim(file_logderps)//'dw'
-     else
-        flld = trim(file_logderps)
-     end if
-
-     call write_efun(flld,dlchis,ene,npte,nld)
-     !
-  enddo
-
-  deallocate(ene)
-  deallocate(dlchis)
-  deallocate(vaux, aux, al)
-
-  return
-end subroutine lderivps

Deleted: trunk/espresso/atomic/lschps.f90
===================================================================
--- trunk/espresso/atomic/lschps.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/lschps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,761 +0,0 @@
-!
-! Copyright (C) 2004-2010 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-SUBROUTINE lschps (mode, z, eps, grid, nin, n, l, e, v, u, nstop)
-  !
-  ! integrates radial pauli-type scalar-relativistic equation
-  ! on a logarithmic grid
-  ! modified routine to be used in finding norm-conserving
-  ! pseudopotential
-  !
-  ! on input:
-  !   mode = 1 find energy and wavefunction of bound states,
-  !            scalar-relativistic (all-electron)
-  !   mode = 2 find energy and wavefunction of bound state,
-  !            nonrelativistic (pseudopotentials)
-  !   mode = 3 fixed-energy calculation, for logarithmic derivatives
-  !   mode = 4 find energy which produces a specified logarithmic
-  !            derivative (nonrelativistic, pseudopotentials)
-  !   mode = 5 is for pseudopotential to produce wavefunction beyond
-  !            radius used for pseudopotential construction
-  !   z    = atomic number
-  !   eps  = convergence factor: eiganvalue is considered converged if
-  !          the correction to eigenvalue is smaller in magnitude than
-  !          eps times the magnitude of the current guess
-  !   grid = structure containing radial grid information
-  !   l, n = main and angular quantum numbers
-  !   e    = starting estimate of the energy (mode=1,2)
-  !          fixed energy at which the wavefctn is calculated (mode=3,4)
-  !   v(i) = self-consistent potential
-  !   nin  = integration up to r(nin) (mode=3,4,5)
-  !
-  ! on output:
-  !   e    = final energy (mode=1,2)
-  !   u(i) = radial wavefunction (defined as the radial part of the wavefct
-  !          multiplied by r)
-  !   nstop= 0 if regular termination, 1 otherwise
-  !   nin  = last grid point for which the wavefct is calculated (mode=1,2)
-  !
-  USE kinds, ONLY : DP
-  USE radial_grids, ONLY: radial_grid_type
-  USE ld1inc, ONLY : cau_fact
-  IMPLICIT NONE
-  !
-  ! I/O variables
-  !
-  INTEGER, INTENT (in) :: mode, n, l
-  real(DP), INTENT(in) :: z, eps
-  TYPE (radial_grid_type), INTENT(in) :: grid
-  real(DP), INTENT(in) :: v(grid%mesh)
-  INTEGER, INTENT(inout) :: nin
-  real(DP), INTENT(inout) :: e
-  INTEGER, INTENT(out) :: nstop
-  real (DP), INTENT(out) :: u(grid%mesh)
-  !
-  ! local variables
-  !
-  INTEGER, PARAMETER :: maxter=60
-  real(DP), EXTERNAL:: aei, aeo, aii, aio
-  ! arrays  used as work space
-  real(DP),ALLOCATABLE :: up(:),upp(:),cf(:),dv(:),fr(:),frp(:)
-  real(DP):: al, als, cn
-  real(DP):: de, emax, emin
-  real(DP):: fss, gamma, ro, sc
-  real(DP):: sls, sn, uld, uout,  upin, upout
-  real(DP):: xkap
-  INTEGER:: i, it, mmax, n_it, node, mch, ierr
-  !
-  !
-  nstop=0
-  al   = grid%dx
-  mmax = grid%mesh
-
-  ALLOCATE(up(mmax), stat=ierr)
-  ALLOCATE(upp(mmax), stat=ierr)
-  ALLOCATE(cf(mmax), stat=ierr)
-  ALLOCATE(dv(mmax), stat=ierr)
-  ALLOCATE(fr(mmax), stat=ierr)
-  ALLOCATE(frp(mmax), stat=ierr)
-
-  uld=0.0_dp
-  !
-  !
-  IF(mode == 1 .or. mode == 3) THEN
-     !     relativistic calculation
-     !     fss=(1.0_dp/137.036_dp)**2
-     fss=(1.0_dp/cau_fact)**2
-     IF(l == 0) THEN
-        gamma=sqrt(1.0_dp-fss*z**2)
-     ELSE
-        gamma=(l*sqrt(l**2-fss*z**2) + &
-             (l+1)*sqrt((l+1)**2-fss*z**2))/(2*l+1)
-     ENDIF
-  ELSE
-     !     non-relativistic calculation
-     fss=1.0e-20_dp
-     gamma=l+1
-  ENDIF
-  !
-  sls=l*(l+1)
-  !
-  ! emin, emax = estimated bounds for e
-  !
-  IF(mode == 1 .or. mode == 2) THEN
-     emax=v(mmax)+sls/grid%r(mmax)**2
-     emin=0.0_dp
-     DO i=1,mmax
-        emin=min(emin,v(i)+sls/grid%r(i)**2)
-     ENDDO
-     IF(e > emax) e=1.25_dp*emax
-     IF(e < emin) e=0.75_dp*emin
-     IF(e > emax) e=0.5_dp*(emax+emin)
-  ELSEIF(mode == 4) THEN
-     emax=e + 10.0_dp
-     emin=e - 10.0_dp
-  ENDIF
-  !
-  DO i=1,4
-     u(i)=0.0_dp
-     up(i)=0.0_dp
-     upp(i)=0.0_dp
-  ENDDO
-  als=al**2
-  !
-  ! calculate dv/dr for darwin correction
-  !
-  CALL derv (mmax, al, grid%r, v, dv )
-  !
-  !     starting of loop on energy for bound state
-  !
-  DO n_it = 1, maxter
-     !
-     ! coefficient array for u in differential eq.
-     DO i=1,mmax
-        cf(i)=als*(sls + (v(i)-e)*grid%r(i)**2)
-     ENDDO
-     !
-     ! find classical turning point for matching
-     !
-     IF(mode == 1 .or. mode == 2) THEN
-        DO i=mmax,2,-1
-           IF(cf(i-1) <= 0.0_dp .and. cf(i) > 0.0_dp) THEN
-              mch=i
-              GOTO 40
-           ENDIF
-        ENDDO
-        !PRINT '('' warning: wfc '',2i2,'' no turning point'')', n, l
-        e=0.0_dp
-        DO i=1,mmax
-           u (i)=0.0_dp
-        ENDDO
-        nstop=1
-        GOTO 999
-     ELSE
-        mch=nin
-     ENDIF
-40   CONTINUE
-
-     !  relativistic coefficient arrays for u (fr) and up (frp).
-     DO i=1,mmax
-        fr(i)=als*(grid%r(i)**2)*0.25_dp*(-fss*(v(i)-e)**2 + &
-             fss*dv(i)/ (grid%r(i)*(1.0_dp+0.25_dp*fss*(e-v(i)))))
-        frp(i)=-al*grid%r(i)*0.25_dp*fss*dv(i)/(1.0_dp+0.25_dp*fss*(e-v(i)))
-     ENDDO
-     !
-     ! start wavefunction with series
-     !
-     DO i=1,4
-        u(i)=grid%r(i)**gamma
-        up(i)=al*gamma*grid%r(i)**gamma
-        upp(i)=(al+frp(i))*up(i)+(cf(i)+fr(i))*u(i)
-     ENDDO
-     !
-     ! outward integration using predictor once, corrector
-     ! twice
-     node=0
-     !
-     DO i=4,mch-1
-        u(i+1)=u(i)+aeo(up,i)
-        up(i+1)=up(i)+aeo(upp,i)
-        DO it=1,2
-           upp(i+1)=(al+frp(i+1))*up(i+1)+(cf(i+1)+fr(i+1))*u(i+1)
-           up(i+1)=up(i)+aio(upp,i)
-           u(i+1)=u(i)+aio(up,i)
-        ENDDO
-        IF(u(i+1)*u(i) <= 0.0_dp) node=node+1
-     ENDDO
-     !
-     uout=u(mch)
-     upout=up(mch)
-     !
-     IF(node-n+l+1 == 0 .or. mode == 3 .or. mode == 5) THEN
-        !
-        IF(mode == 1 .or. mode == 2) THEN
-           !
-           ! start inward integration at 10*classical turning
-           ! point with simple exponential
-           nin=mch+2.3_dp/al
-           IF(nin+4 > mmax) nin=mmax-4
-           xkap=sqrt(sls/grid%r(nin)**2 + 2.0_dp*(v(nin)-e))
-           !
-           DO i=nin,nin+4
-              u(i)=exp(-xkap*(grid%r(i)-grid%r(nin)))
-              up(i)=-grid%r(i)*al*xkap*u(i)
-              upp(i)=(al+frp(i))*up(i)+(cf(i)+fr(i))*u(i)
-           ENDDO
-           !
-           ! integrate inward
-           !
-           DO i=nin,mch+1,-1
-              u(i-1)=u(i)+aei(up,i)
-              up(i-1)=up(i)+aei(upp,i)
-              DO it=1,2
-                 upp(i-1)=(al+frp(i-1))*up(i-1)+(cf(i-1)+fr(i-1))*u(i-1)
-                 up(i-1)=up(i)+aii(upp,i)
-                 u(i-1)=u(i)+aii(up,i)
-              ENDDO
-           ENDDO
-           !
-           ! scale outside wf for continuity
-           sc=uout/u(mch)
-           !
-           DO i=mch,nin
-              up(i)=sc*up(i)
-              u (i)=sc*u (i)
-           ENDDO
-           !
-           upin=up(mch)
-           !
-        ELSE
-           !
-           upin=uld*uout
-           !
-        ENDIF
-        !
-        ! perform normalization sum
-        !
-        ro=grid%r(1)*exp(-0.5_dp*grid%dx)
-        sn=ro**(2.0_dp*gamma+1.0_dp)/(2.0_dp*gamma+1.0_dp)
-        !
-        DO i=1,nin-3
-           sn=sn+al*grid%r(i)*u(i)**2
-        ENDDO
-        !
-        sn=sn + al*(23.0_dp*grid%r(nin-2)*u(nin-2)**2 &
-             + 28.0_dp*grid%r(nin-1)*u(nin-1)**2 &
-             +  9.0_dp*grid%r(nin  )*u(nin  )**2)/24.0_dp
-        !
-        ! normalize u
-        cn=1.0_dp/sqrt(sn)
-        uout=cn*uout
-        upout=cn*upout
-        upin=cn*upin
-        !
-        DO i=1,nin
-           up(i)=cn*up(i)
-           u(i)=cn*u(i)
-        ENDDO
-        DO i=nin+1,mmax
-           u(i)=0.0_dp
-        ENDDO
-        !
-        ! exit for fixed-energy calculation
-        !
-        IF(mode == 3 .or. mode == 5) GOTO 999
-
-        ! perturbation theory for energy shift
-        de=uout*(upout-upin)/(al*grid%r(mch))
-        !
-        ! convergence test and possible exit
-        !
-        IF ( abs(de) < max(abs(e),0.2_dp)*eps) GOTO 999
-        !
-        IF(de > 0.0_dp) THEN
-           emin=e
-        ELSE
-           emax=e
-        ENDIF
-        e=e+de
-        IF(e > emax .or. e < emin) e=0.5_dp*(emax+emin)
-        !
-     ELSEIF(node-n+l+1 < 0) THEN
-        ! too few nodes
-        emin=e
-        e=0.5_dp*(emin+emax)
-
-     ELSE
-        ! too many nodes
-        emax=e
-        e=0.5_dp*(emin+emax)
-     ENDIF
-  ENDDO
-
-  !PRINT '('' warning: wfc '',2i2,'' not converged'')', n, l
-  u=0.0_dp
-  nstop=1
-  !
-  ! deallocate arrays and exit
-  !
-999 CONTINUE
-  DEALLOCATE(frp)
-  DEALLOCATE(fr)
-  DEALLOCATE(dv)
-  DEALLOCATE(cf)
-  DEALLOCATE(upp)
-  DEALLOCATE(up)
-  RETURN
-
-END SUBROUTINE lschps
-!
-!----------------------------------------------------------------
-SUBROUTINE lschps_meta (mode, z, eps, grid, nin, n, l, e, v, vtau, &
-                        u, nstop)
-  !----------------------------------------------------------------
-  !
-  ! Meta-GGA version of lschps
-  ! vtau is the meta-GGA potential
-  !
-  USE kinds, ONLY : DP
-  USE radial_grids, ONLY: radial_grid_type
-  USE ld1inc, ONLY : cau_fact
-  IMPLICIT NONE
-  !
-  ! I/O variables
-  !
-  INTEGER, INTENT (in) :: mode, n, l
-  real(DP), INTENT(in) :: z, eps
-  TYPE (radial_grid_type), INTENT(in) :: grid
-  real(DP), INTENT(in) :: v(grid%mesh), vtau(grid%mesh)
-  INTEGER, INTENT(inout) :: nin
-  real(DP), INTENT(inout) :: e
-  INTEGER, INTENT(out) :: nstop
-  real (DP), INTENT(out) :: u(grid%mesh)
-  !
-  ! local variables
-  !
-  INTEGER, PARAMETER :: maxter=60
-  real(DP), EXTERNAL:: aei, aeo, aii, aio, d2u, int_0_inf_dr
-  ! arrays used as work space
-  real(DP), ALLOCATABLE :: up(:),upp(:),cf(:),dv(:),fr(:),frp(:),dvtau(:)
-  real(DP):: al, als, cn
-  real(DP):: de, emax, emin
-  real(DP):: fss, gamma, ro, sc
-  real(DP):: sls, sn, uld, uout,  upin, upout
-  real(DP):: xkap, mm, mvt, fac1, fact2, alpha
-  INTEGER :: i, it, mmax, n_it, node, mch, ierr
-  LOGICAL ::  rel, find_e, fixed_e
-  !
-  !
-  IF (mode<1.or.mode>5) STOP 'lschps: wrong mode'
-  !
-  nstop=0
-  al   = grid%dx
-  mmax = grid%mesh
-  !
-  ALLOCATE(up(mmax), stat=ierr)
-  ALLOCATE(upp(mmax), stat=ierr)
-  ALLOCATE(cf(mmax), stat=ierr)
-  ALLOCATE(dv(mmax), stat=ierr)
-  ALLOCATE(fr(mmax), stat=ierr)
-  ALLOCATE(frp(mmax), stat=ierr)
-  ALLOCATE(dvtau(mmax), stat=ierr)
-  !
-  uld=0.0_dp
-  !
-  rel    = ( mode == 1 .or. mode == 3 )
-  find_e = ( mode == 1 .or. mode == 2 )
-  fixed_e= ( mode == 3 .or. mode == 5 )
-  !
-  ! fss  : square of the fine structure constant
-  ! gamma: u(r)=r^gamma is the asymptotic behavior of u(r) for r->0
-  !
-  IF (rel) THEN
-     ! relativistic calculation
-     !    fss=(1.0_dp/137.036_dp)**2
-     fss=(1.0_dp/cau_fact)**2
-     IF(l == 0) THEN
-        gamma=sqrt(1.0_dp-fss*z**2)
-     ELSE
-        gamma=(l*sqrt(l**2-fss*z**2) + &
-              (l+1)*sqrt((l+1)**2-fss*z**2))/(2*l+1)
-     ENDIF
-  ELSE
-     ! nonrelativistic calculation
-     fss=0.0_dp
-     gamma=l+1
-  ENDIF
-  sls=l*(l+1)
-  !
-  ! emin, emax = estimated bounds for e
-  !
-  IF(find_e) THEN
-     emax=v(mmax)+sls/grid%r(mmax)**2
-     emin=0.0_dp
-     DO i=1,mmax
-        emin=min(emin,v(i)+sls/grid%r(i)**2)
-     ENDDO
-     IF(e > emax) e=1.25_dp*emax
-     IF(e < emin) e=0.75_dp*emin
-     IF(e > emax) e=0.5_dp*(emax+emin)
-  ELSEIF(mode == 4) THEN
-     emax=e + 10.0_dp
-     emin=e - 10.0_dp
-  ENDIF
-  !
-  DO i=1,mmax
-     u(i)=0.0_dp
-     up(i)=0.0_dp
-     upp(i)=0.0_dp
-  ENDDO
-  als=al**2
-  !
-  ! calculate dv = dv/dr for darwin correction
-  ! calculate dvtau = d tau / dr
-  !
-  CALL derV(mmax,al,grid%r,v,dv)
-  CALL derV(mmax,al,grid%r,vtau,dvtau)
-  !
-  !     starting of loop on energy for bound state
-  !
-  DO n_it = 1, maxter
-     !
-     !     find classical turning point for matching
-     !
-     DO i=1,mmax
-        cf(i)=(sls + (v(i)-e)*grid%r(i)**2)
-     ENDDO
-     IF(find_e) THEN
-        DO i=mmax,2,-1
-           IF(cf(i-1) <= 0.0_dp .and. cf(i) > 0.0_dp) THEN
-              mch=i
-              GOTO 40
-           ENDIF
-        ENDDO
-        !PRINT '('' warning: wfc '',2i2,'' no turning point'')', n, l
-        e=0.0
-        DO i=1,mmax
-           u (i)=0.0
-           ! up(i)=0.0
-        ENDDO
-        nstop=1
-        GOTO 999
-     ELSE
-        mch=nin
-     ENDIF
-40   CONTINUE
-     !
-     ! coefficient array for u in differential eq.
-     !
-     DO i=1,mmax
-        mm=1.0_dp+0.25_dp*fss*(e-v(i))
-        mvt=1.0_dp/(1.0_dp+0.5_dp*vtau(i))
-        fac1=grid%r(i)*fss*0.25_dp*dv(i)*mvt/mm
-        !
-        cf(i)=als*(sls+mvt*(mm*(v(i)-e)*grid%r(i)**2                     &
-             &           +grid%r(i)*0.5_dp*dvtau(i)))
-        !
-        !            cf(i)=als*(sls+mvt*(mm*(v(i)-e)*grid%r(i)**2))
-        !
-        !     relativistic coefficient arrays for u (fr) and up (frp).
-        !
-        fr(i)=als*fac1
-        frp(i)=-al*(0.5*mvt*grid%r(i)*dvtau(i)+fac1)
-        !            frp(i)=-al*fac1
-        !
-     ENDDO
-     !
-     !     start wavefunction with series
-     !
-     fac1=1.0_dp+0.5_dp*vtau(1)
-     alpha=-z/(l+1.0_dp)/fac1*grid%r(1)
-     fact2=-l/(2.0_dp*(l+1.0_dp))
-     DO i=1,4
-        u(i) = grid%r(i)**gamma*exp(alpha)*(1+0.5_dp*vtau(i))**fact2
-        up(i)=al*(gamma+(fact2-z/(l+1.0_dp))*grid%r(i)/fac1)*u(i)
-        upp(i)=d2u(al,cf(i),fr(i),frp(i),u(i),up(i))
-        fac1=(1.0_dp+0.5*vtau(i+1))
-        alpha = alpha - z/(l+1.0_dp)/fac1*(grid%r(i+1)-grid%r(i))
-     ENDDO
-     !
-     !     outward integration using predictor once, corrector twice
-     !
-     node=0
-     DO i=4,mch-1
-        u (i+1)=u (i)+aeo(up,i)
-        up(i+1)=up(i)+aeo(upp,i)
-        DO it=1,2
-           upp(i+1)=d2u(al,cf(i+1),fr(i+1),frp(i+1),u(i+1),up(i+1))
-           up (i+1)=up(i)+aio(upp,i)
-           u  (i+1)=u (i)+aio(up,i)
-        ENDDO
-        IF(u(i+1)*u(i) <= 0.0_dp) node=node+1
-     ENDDO
-     !
-     uout=u(mch)
-     upout=up(mch)
-     !
-     IF(node-n+l+1 == 0 .or. fixed_e) THEN
-        !
-        IF (find_e) THEN
-           !
-           ! good number of nodes: start inward integration
-           ! at 10*classical turning point with simple exponential
-           !
-           nin=mch+2.3_dp/al
-           IF(nin+4 > mmax ) nin=mmax-4
-           !
-           mm=1.0_dp+0.25_dp*fss*(e-v(nin))
-           fac1=0.5_dp*dvtau(nin)/(1.0_dp+mm*0.5_dp*vtau(nin))
-           fact2=0.5_dp*dvtau(nin)/grid%r(nin)
-           alpha=1.0_dp+mm*0.5_dp*vtau(nin)
-           xkap=sqrt(fac1**2.0_dp + 4.0_dp*(sls/grid%r(nin)**2 + &
-                   (v(nin)-e+fact2)/alpha))
-           !
-           xkap=(-fac1+xkap)/2.0_dp
-           DO i=nin,nin+4
-              u (i) =exp(-xkap*(grid%r(i)-grid%r(nin)))
-              up(i) =-grid%r(i)*al*xkap*u(i)
-              upp(i)=d2u(al,cf(i),fr(i),frp(i),u(i),up(i))
-           ENDDO
-           !
-           ! integrate inward
-           !
-           DO i=nin,mch+1,-1
-              u (i-1)=u (i)+aei(up,i)
-              up(i-1)=up(i)+aei(upp,i)
-              DO it=1,2
-                 upp(i-1)=d2u(al,cf(i-1),fr(i-1),frp(i-1),u(i-1),up(i-1))
-                 up(i-1)=up(i)+aii(upp,i)
-                 u (i-1)=u (i)+aii(up,i)
-              ENDDO
-           ENDDO
-           !
-           ! scale outside wf for continuity
-           !
-           sc=uout/u(mch)
-           DO i=mch,nin
-              up(i)=sc*up(i)
-              u (i)=sc*u (i)
-           ENDDO
-           !
-           upin=up(mch)
-           !
-        ELSE
-           !
-           ! this is used only in fixed-logarithmic-derivative calculation
-           !
-           upin=uld*uout
-           !
-        ENDIF
-        !
-        ! normalization: upp is used to store u^2
-        !
-        DO i=1,nin
-           upp(i)=u(i)**2
-        ENDDO
-        !
-        ! integral over dr (includes series expansion for r->0) ...
-        ! assumes u(r)=r^(l+1) behaviour at the origin
-        !
-        sn=int_0_inf_dr ( upp, grid, nin-3, 2*l+2 )
-        !
-        ! ...extrapolation for the asymptotic behaviour (maybe useless...)
-        !
-        sn=sn + al*(23.0_dp*grid%r(nin-2)*upp(nin-2)     &
-                  + 28.0_dp*grid%r(nin-1)*upp(nin-1)     &
-                  +  9.0_dp*grid%r(nin  )*upp(nin  ))/24.0_dp
-        !
-        ! ...normalize u
-        !
-        cn=1.0_dp/sqrt(sn)
-        uout=cn*uout
-        upout=cn*upout
-        upin=cn*upin
-        !
-        DO i=1,nin
-           up(i)=cn*up(i)
-           u(i)=cn*u(i)
-        ENDDO
-        DO i=nin+1,mmax
-           u(i) =0.0_dp
-           up(i)=0.0_dp
-        ENDDO
-        !
-        !
-        ! exit for fixed-energy calculation
-        !
-        IF (fixed_e)  GOTO 999
-        !
-        ! perturbation theory for energy shift
-        de=uout*(upout-upin)/(al*grid%r(mch))
-        !
-        ! convergence test and possible exit
-        !
-        IF ( abs(de) < max(abs(e),0.2_dp)*eps) GOTO 999
-        !
-        IF(de > 0.0_dp) THEN
-           emin=e
-        ELSE
-           emax=e
-        ENDIF
-        e=e+de
-        IF(e > emax .or. e < emin) e=0.5_dp*(emax+emin)
-        !
-     ELSEIF(node-n+l+1 < 0) THEN
-        !
-        ! too few nodes
-        !
-        emin=e
-        e=0.5_dp*(emin+emax)
-        !
-     ELSE
-        !
-        ! too many nodes
-        !
-        emax=e
-        e=0.5_dp*(emin+emax)
-        !
-     ENDIF
-     !
-     ! loop back to converge e
-     !
-  ENDDO
-  !
-  !PRINT '('' warning: wfc '',2i2,'' not converged'')', n, l
-  nstop=1
-  u=0.0_dp
-  nstop=1
-  !
-  ! deallocate arrays and exit
-  !
-999 CONTINUE
-
-  DEALLOCATE(frp)
-  DEALLOCATE(fr)
-  DEALLOCATE(dv)
-  DEALLOCATE(cf)
-  DEALLOCATE(upp)
-  DEALLOCATE(up)
-  !do i=1,mmax
-  !   up(i)=up(i)/grid%r(i)/al
-  !enddo
-  RETURN
-  !
-END SUBROUTINE lschps_meta
-!
-!---------------------------------------------------------------
-FUNCTION d2u(al,cf,fr,frp,u,up)
-  !---------------------------------------------------------------
-  ! second derivative from radial KS equation
-  USE kinds, ONLY : DP
-  IMPLICIT NONE
-  real(dp):: d2u
-  real(dp), INTENT(in):: al,cf,fr,frp,u,up
-  !
-  d2u = (al+frp)*up + (cf+fr)*u
-  RETURN
-END FUNCTION d2u
-
-!-----------------------------------------------------------
-FUNCTION estimatealpha(mmax,u,up,al,r)
-  !-----------------------------------------------------------
-  USE kinds, ONLY : DP
-  IMPLICIT NONE
-  INTEGER, INTENT(in) :: mmax
-  real(dp) :: estimatealpha
-  real(dp), INTENT(in) :: u(mmax),up(mmax),al,r(mmax)
-  INTEGER i,istart,iend
-  estimatealpha = 0.0_dp
-  istart=5
-  iend=100
-  DO i=istart,iend
-     IF(u(i) > 1.0d-8) THEN
-        estimatealpha=estimatealpha+(1.0_dp-up(i)/u(i)/al)/r(i)
-     ENDIF
-  ENDDO
-  estimatealpha=estimatealpha/(iend-istart+1)
-  RETURN
-END FUNCTION estimatealpha
-
-FUNCTION aei(y,j)
-  !
-  USE kinds, ONLY : DP
-  IMPLICIT NONE
-  INTEGER j
-  real(DP):: y(j+3), aei
-  !
-  aei=-(4.16666666667e-2_dp)*(55.0_dp*y(j)-59.0_dp*y(j+1) &
-       +37.0_dp*y(j+2)-9.0_dp*y(j+3))
-  RETURN
-END FUNCTION aei
-!
-! adams extrapolation and interpolation formulas for
-! outward and inward integration, abramowitz and stegun, p. 896
-FUNCTION aeo(y,j)
-  !
-  USE kinds, ONLY : DP
-  IMPLICIT NONE
-  INTEGER:: j
-  real(DP):: y(j), aeo
-  !
-  aeo=(4.16666666667e-2_dp)*(55.0_dp*y(j)-59.0_dp*y(j-1) &
-       +37.0_dp*y(j-2)-9.0_dp*y(j-3))
-  RETURN
-END FUNCTION aeo
-!
-FUNCTION aii(y,j)
-  !
-  USE kinds, ONLY : DP
-  IMPLICIT NONE
-  INTEGER:: j
-  real(DP) :: y(j+2), aii
-  !
-  aii=-(4.16666666667e-2_dp)*(9.0_dp*y(j-1)+19.0_dp*y(j) &
-       -5.0_dp*y(j+1)+y(j+2))
-  RETURN
-END FUNCTION aii
-!
-FUNCTION aio(y,j)
-  !
-  USE kinds, ONLY : DP
-  IMPLICIT NONE
-  INTEGER :: j
-  real(DP):: y(j+1), aio
-  !
-  aio=(4.16666666667e-2_dp)*(9.0_dp*y(j+1)+19.0_dp*y(j) &
-       -5.0_dp*y(j-1)+y(j-2))
-  RETURN
-END FUNCTION aio
-
-SUBROUTINE derV (mmax,al,r,v,dv)
-  ! dv = dv/dr
-  USE kinds, ONLY : dp
-  IMPLICIT NONE
-  INTEGER, INTENT(in)  :: mmax
-  REAL(dp), INTENT(in) :: al, r(mmax), v(mmax)
-  REAL(dp), INTENT(out):: dv(mmax)
-  !
-  INTEGER :: i
-  !
-  dv(1)=(-50.0_dp*v(1)+96.0_dp*v(2)-72.0_dp*v(3)+32.0_dp*v(4) &
-       -6.0_dp*v(5))/(24.0_dp*al*r(1))
-  dv(2)=(-6.0_dp*v(1)-20.0_dp*v(2)+36.0_dp*v(3)-12.0_dp*v(4) &
-       +2.0_dp*v(5))/(24.0_dp*al*r(2))
-  !
-  DO i=3,mmax-2
-     dv(i)=(2.0_dp*v(i-2)-16.0_dp*v(i-1)+16.0_dp*v(i+1) &
-          -2.0_dp*v(i+2))/(24.0_dp*al*r(i))
-  ENDDO
-  !
-  dv(mmax-1)=( 3.0_dp*v(mmax)+10.0_dp*v(mmax-1)-18.0_dp*v(mmax-2)+ &
-       6.0_dp*v(mmax-3)-v(mmax-4))/(12.0_dp*al*r(mmax-1))
-  dv(mmax)=( 25.0_dp*v(mmax)-48.0_dp*v(mmax-1)+36.0_dp*v(mmax-2)-&
-       16.0_dp*v(mmax-3)+3.0_dp*v(mmax-4))/(12.0_dp*al*r(mmax))
-  !
-  RETURN
-  !
-END SUBROUTINE derV

Deleted: trunk/espresso/atomic/make.depend
===================================================================
--- trunk/espresso/atomic/make.depend	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/make.depend	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,367 +0,0 @@
-add_exchange.o : ../Modules/constants.o
-add_exchange.o : ../Modules/io_global.o
-add_exchange.o : ../Modules/kind.o
-add_exchange.o : ../Modules/radial_grids.o
-add_exchange.o : ld1inc.o
-add_exchange.o : parameters.o
-all_electron.o : ../Modules/kind.o
-all_electron.o : ../Modules/radial_grids.o
-all_electron.o : ld1inc.o
-ascheq.o : ../Modules/kind.o
-ascheq.o : ../Modules/radial_grids.o
-ascheqps.o : ../Modules/io_global.o
-ascheqps.o : ../Modules/kind.o
-ascheqps.o : ../Modules/radial_grids.o
-ascheqps_drv.o : ../Modules/kind.o
-ascheqps_drv.o : ../Modules/radial_grids.o
-ascheqps_drv.o : ld1inc.o
-ascheqps_drv.o : parameters.o
-atomic_paw.o : ../Modules/constants.o
-atomic_paw.o : ../Modules/funct.o
-atomic_paw.o : ../Modules/io_global.o
-atomic_paw.o : ../Modules/kind.o
-atomic_paw.o : ../Modules/mp.o
-atomic_paw.o : ../Modules/parameters.o
-atomic_paw.o : ../Modules/radial_grids.o
-atomic_paw.o : ld1inc.o
-atomic_paw.o : parameters.o
-atomic_paw.o : paw_type.o
-c6_dft.o : ../Modules/constants.o
-c6_dft.o : ../Modules/kind.o
-c6_dft.o : ../Modules/radial_grids.o
-c6_dft.o : ld1inc.o
-c6_tfvw.o : ../Modules/constants.o
-c6_tfvw.o : ../Modules/funct.o
-c6_tfvw.o : ../Modules/kind.o
-c6_tfvw.o : ../Modules/radial_grids.o
-c6_tfvw.o : ld1inc.o
-calculate_gipaw_orbitals.o : ../Modules/io_global.o
-calculate_gipaw_orbitals.o : ../Modules/kind.o
-calculate_gipaw_orbitals.o : ../Modules/radial_grids.o
-calculate_gipaw_orbitals.o : ld1inc.o
-calculate_gipaw_orbitals.o : parameters.o
-cfdsol.o : ../Modules/kind.o
-chargeps.o : ../Modules/kind.o
-chargeps.o : ../Modules/radial_grids.o
-chargeps.o : ld1inc.o
-chargeps.o : parameters.o
-compute_chi.o : ../Modules/io_global.o
-compute_chi.o : ../Modules/kind.o
-compute_chi.o : ../Modules/radial_grids.o
-compute_chi.o : ld1inc.o
-compute_chi_tm.o : ../Modules/kind.o
-compute_chi_tm.o : ../Modules/radial_grids.o
-compute_chi_tm.o : ld1inc.o
-compute_phi.o : ../Modules/constants.o
-compute_phi.o : ../Modules/io_global.o
-compute_phi.o : ../Modules/kind.o
-compute_phi.o : ../Modules/radial_grids.o
-compute_phi.o : ld1inc.o
-compute_phi_tm.o : ../Modules/constants.o
-compute_phi_tm.o : ../Modules/io_global.o
-compute_phi_tm.o : ../Modules/kind.o
-compute_phi_tm.o : ../Modules/radial_grids.o
-compute_phi_tm.o : ld1inc.o
-compute_phius.o : ../Modules/io_global.o
-compute_phius.o : ../Modules/kind.o
-compute_phius.o : ../Modules/radial_grids.o
-compute_phius.o : ld1inc.o
-compute_potps.o : ../Modules/kind.o
-compute_potps.o : ../Modules/radial_grids.o
-compute_potps.o : ld1inc.o
-compute_potps_new.o : ../Modules/kind.o
-compute_potps_new.o : ../Modules/radial_grids.o
-compute_potps_new.o : ld1inc.o
-compute_q_3bess.o : ../Modules/kind.o
-compute_q_3bess.o : ../Modules/radial_grids.o
-compute_q_3bess.o : ld1inc.o
-compute_relpert.o : ../Modules/kind.o
-compute_relpert.o : ../Modules/radial_grids.o
-compute_relpert.o : ld1inc.o
-compute_solution.o : ../Modules/io_global.o
-compute_solution.o : ../Modules/kind.o
-compute_solution.o : ../Modules/radial_grids.o
-descreening.o : ../Modules/io_global.o
-descreening.o : ../Modules/kind.o
-descreening.o : ../Modules/mp.o
-descreening.o : ../Modules/radial_grids.o
-descreening.o : ld1inc.o
-descreening.o : parameters.o
-dfx_new.o : ../Modules/constants.o
-dfx_new.o : ../Modules/kind.o
-dfx_new.o : ../Modules/radial_grids.o
-dfx_new.o : ld1inc.o
-dfx_new.o : parameters.o
-dir_outward.o : ../Modules/kind.o
-dir_outward.o : ld1inc.o
-dirsol.o : ../Modules/io_global.o
-dirsol.o : ../Modules/kind.o
-dirsol.o : ../Modules/radial_grids.o
-dirsol.o : ld1inc.o
-dmixp.o : ../Modules/io_global.o
-dmixp.o : ../Modules/kind.o
-drho0ofvx.o : ../Modules/constants.o
-drho0ofvx.o : ../Modules/kind.o
-drho0ofvx.o : ../Modules/radial_grids.o
-drho0ofvx.o : ld1inc.o
-drho0ofvx.o : parameters.o
-drhoofv.o : ../Modules/constants.o
-drhoofv.o : ../Modules/kind.o
-drhoofv.o : ../Modules/radial_grids.o
-drhoofv.o : ld1inc.o
-dvex.o : ../Modules/constants.o
-dvex.o : ../Modules/kind.o
-dvex.o : ../Modules/radial_grids.o
-dvex.o : ld1inc.o
-el_config.o : ../Modules/kind.o
-el_config.o : parameters.o
-elsd.o : ../Modules/constants.o
-elsd.o : ../Modules/funct.o
-elsd.o : ../Modules/kind.o
-elsd.o : ../Modules/radial_grids.o
-elsd.o : ld1inc.o
-elsd_highv.o : ../Modules/constants.o
-elsd_highv.o : ../Modules/kind.o
-elsd_highv.o : ../Modules/radial_grids.o
-elsd_highv.o : ld1inc.o
-elsdps.o : ../Modules/constants.o
-elsdps.o : ../Modules/funct.o
-elsdps.o : ../Modules/kind.o
-elsdps.o : ../Modules/radial_grids.o
-elsdps.o : ld1inc.o
-elsdps.o : parameters.o
-elsdps_paw.o : ../Modules/constants.o
-elsdps_paw.o : ../Modules/funct.o
-elsdps_paw.o : ../Modules/kind.o
-elsdps_paw.o : ../Modules/radial_grids.o
-elsdps_paw.o : ld1inc.o
-elsdps_paw.o : parameters.o
-esic.o : ../Modules/kind.o
-esic.o : ../Modules/radial_grids.o
-esic.o : ld1inc.o
-export_upf.o : ../Modules/constants.o
-export_upf.o : ../Modules/funct.o
-export_upf.o : ../Modules/kind.o
-export_upf.o : ../Modules/pseudo_types.o
-export_upf.o : ../Modules/radial_grids.o
-export_upf.o : ../Modules/upf.o
-export_upf.o : ../iotk/src/iotk_module.o
-export_upf.o : ld1inc.o
-find_qi.o : ../Modules/kind.o
-find_qi.o : ld1inc.o
-gener_pseudo.o : ../Modules/io_global.o
-gener_pseudo.o : ../Modules/kind.o
-gener_pseudo.o : ../Modules/mp.o
-gener_pseudo.o : ../Modules/radial_grids.o
-gener_pseudo.o : atomic_paw.o
-gener_pseudo.o : ld1inc.o
-gener_pseudo.o : parameters.o
-grad_log.o : ../Modules/kind.o
-green.o : ../Modules/kind.o
-green.o : ../Modules/radial_grids.o
-green.o : ld1inc.o
-import_upf.o : ../Modules/constants.o
-import_upf.o : ../Modules/funct.o
-import_upf.o : ../Modules/kind.o
-import_upf.o : ../Modules/pseudo_types.o
-import_upf.o : ../Modules/radial_grids.o
-import_upf.o : ../Modules/upf.o
-import_upf.o : atomic_paw.o
-import_upf.o : ld1inc.o
-import_upf.o : parameters.o
-import_upf.o : paw_type.o
-int_0_inf_dr.o : ../Modules/kind.o
-int_0_inf_dr.o : ../Modules/radial_grids.o
-integrate_inward.o : ../Modules/kind.o
-integrate_inward.o : ../Modules/radial_grids.o
-integrate_outward.o : ../Modules/kind.o
-integrate_outward.o : ../Modules/radial_grids.o
-intref.o : ../Modules/kind.o
-intref.o : ../Modules/radial_grids.o
-inward.o : ../Modules/kind.o
-inward.o : ../Modules/radial_grids.o
-ld1.o : ../Modules/environment.o
-ld1.o : ../Modules/mp_global.o
-ld1.o : ../Modules/radial_grids.o
-ld1.o : ld1inc.o
-ld1_readin.o : ../Modules/constants.o
-ld1_readin.o : ../Modules/funct.o
-ld1_readin.o : ../Modules/io_global.o
-ld1_readin.o : ../Modules/kind.o
-ld1_readin.o : ../Modules/mp.o
-ld1_readin.o : ../Modules/parameters.o
-ld1_readin.o : ../Modules/radial_grids.o
-ld1_readin.o : atomic_paw.o
-ld1_readin.o : ld1inc.o
-ld1_readin.o : parameters.o
-ld1_setup.o : ../Modules/funct.o
-ld1_setup.o : ../Modules/kind.o
-ld1_setup.o : ld1inc.o
-ld1_writeout.o : ../Modules/funct.o
-ld1_writeout.o : ../Modules/io_global.o
-ld1_writeout.o : ../Modules/mp.o
-ld1_writeout.o : ../Modules/radial_grids.o
-ld1_writeout.o : ld1inc.o
-ld1_writeout.o : paw_type.o
-ld1inc.o : ../Modules/kind.o
-ld1inc.o : ../Modules/radial_grids.o
-ld1inc.o : parameters.o
-ld1inc.o : paw_type.o
-lderiv.o : ../Modules/io_global.o
-lderiv.o : ../Modules/kind.o
-lderiv.o : ../Modules/mp.o
-lderiv.o : ../Modules/radial_grids.o
-lderiv.o : ld1inc.o
-lderiv.o : parameters.o
-lderivps.o : ../Modules/io_global.o
-lderivps.o : ../Modules/kind.o
-lderivps.o : ../Modules/mp.o
-lderivps.o : ../Modules/radial_grids.o
-lderivps.o : ld1inc.o
-lderivps.o : parameters.o
-lschps.o : ../Modules/kind.o
-lschps.o : ../Modules/radial_grids.o
-lschps.o : ld1inc.o
-new_potential.o : ../Modules/constants.o
-new_potential.o : ../Modules/funct.o
-new_potential.o : ../Modules/kind.o
-new_potential.o : ../Modules/radial_grids.o
-new_potential.o : ld1inc.o
-newd_at.o : ../Modules/kind.o
-newd_at.o : ../Modules/radial_grids.o
-newd_at.o : ld1inc.o
-nodenum.o : ../Modules/kind.o
-normalize.o : ../Modules/io_global.o
-normalize.o : ../Modules/kind.o
-normalize.o : ../Modules/radial_grids.o
-normalize.o : ld1inc.o
-normalize.o : parameters.o
-occ_spin.o : ../Modules/kind.o
-occ_spin.o : ../Modules/radial_grids.o
-outward.o : ../Modules/kind.o
-outward.o : ../Modules/radial_grids.o
-partial_wave_expansion.o : ../Modules/io_global.o
-partial_wave_expansion.o : ../Modules/kind.o
-partial_wave_expansion.o : ../Modules/mp.o
-partial_wave_expansion.o : ../Modules/radial_grids.o
-partial_wave_expansion.o : ld1inc.o
-partial_wave_expansion.o : parameters.o
-paw_type.o : ../Modules/kind.o
-paw_type.o : ../Modules/radial_grids.o
-pseudo_q.o : ../Modules/io_global.o
-pseudo_q.o : ../Modules/kind.o
-pseudo_q.o : ld1inc.o
-pseudo_q.o : parameters.o
-pseudovloc.o : ../Modules/io_global.o
-pseudovloc.o : ../Modules/kind.o
-pseudovloc.o : ../Modules/radial_grids.o
-pseudovloc.o : ld1inc.o
-read_pseudo_ncpp.o : ../Modules/constants.o
-read_pseudo_ncpp.o : ../Modules/kind.o
-read_pseudo_ncpp.o : ../Modules/radial_grids.o
-read_pseudo_rrkj3.o : ../Modules/funct.o
-read_pseudo_rrkj3.o : ../Modules/kind.o
-read_pseudo_rrkj3.o : ../Modules/radial_grids.o
-read_pseudo_rrkj3.o : ld1inc.o
-run_lda_half.o : ../Modules/io_global.o
-run_lda_half.o : ../Modules/kind.o
-run_lda_half.o : ../Modules/mp.o
-run_lda_half.o : ../Modules/radial_grids.o
-run_lda_half.o : ld1inc.o
-run_lda_half.o : parameters.o
-run_pseudo.o : ../Modules/kind.o
-run_pseudo.o : ../Modules/radial_grids.o
-run_pseudo.o : atomic_paw.o
-run_pseudo.o : ld1inc.o
-run_pseudo.o : parameters.o
-run_test.o : ../Modules/io_global.o
-run_test.o : ../Modules/kind.o
-run_test.o : ../Modules/mp.o
-run_test.o : ../Modules/radial_grids.o
-run_test.o : ld1inc.o
-run_test.o : parameters.o
-scf.o : ../Modules/constants.o
-scf.o : ../Modules/funct.o
-scf.o : ../Modules/kind.o
-scf.o : ../Modules/radial_grids.o
-scf.o : ld1inc.o
-seriebes.o : ../Modules/kind.o
-set_psi_in.o : ../Modules/kind.o
-set_psi_in.o : ../Modules/radial_grids.o
-set_psi_in.o : ld1inc.o
-set_rc_rv.o : ../Modules/kind.o
-set_rc_rv.o : ld1inc.o
-set_rc_rv.o : parameters.o
-set_rho_core.o : ../Modules/constants.o
-set_rho_core.o : ../Modules/io_global.o
-set_rho_core.o : ../Modules/kind.o
-set_rho_core.o : ../Modules/mp.o
-set_rho_core.o : ld1inc.o
-set_sl3.o : ../Modules/kind.o
-sic_correction.o : ../Modules/constants.o
-sic_correction.o : ../Modules/funct.o
-sic_correction.o : ../Modules/kind.o
-sic_correction.o : ../Modules/radial_grids.o
-sic_correction.o : ld1inc.o
-start_potps.o : ../Modules/io_global.o
-start_potps.o : ../Modules/kind.o
-start_potps.o : ../Modules/radial_grids.o
-start_potps.o : ld1inc.o
-start_scheq.o : ../Modules/kind.o
-start_scheq.o : ../Modules/radial_grids.o
-starting_potential.o : ../Modules/kind.o
-starting_potential.o : ld1inc.o
-test_bessel.o : ../Modules/constants.o
-test_bessel.o : ../Modules/io_global.o
-test_bessel.o : ../Modules/kind.o
-test_bessel.o : ld1inc.o
-trou.o : ../Modules/kind.o
-trou.o : ../Modules/random_numbers.o
-v_of_rho_at.o : ../Modules/constants.o
-v_of_rho_at.o : ../Modules/funct.o
-v_of_rho_at.o : ../Modules/kind.o
-v_of_rho_at.o : ../Modules/radial_grids.o
-v_of_rho_at.o : ld1inc.o
-vdpack.o : ../Modules/kind.o
-vext.o : ../Modules/kind.o
-vpack.o : ../Modules/kind.o
-vxcgc.o : ../Modules/constants.o
-vxcgc.o : ../Modules/funct.o
-vxcgc.o : ../Modules/kind.o
-write_ae_pseudo.o : ../Modules/io_global.o
-write_ae_pseudo.o : ../Modules/kind.o
-write_ae_pseudo.o : ../Modules/mp.o
-write_ae_pseudo.o : ld1inc.o
-write_cpmd.o : ../Modules/constants.o
-write_cpmd.o : ../Modules/funct.o
-write_cpmd.o : ../Modules/kind.o
-write_files.o : ../Modules/io_global.o
-write_files.o : ../Modules/kind.o
-write_files.o : ../Modules/mp.o
-write_files.o : ../Modules/radial_grids.o
-write_files.o : ld1inc.o
-write_paw_recon.o : ../Modules/io_global.o
-write_paw_recon.o : ../Modules/kind.o
-write_paw_recon.o : ../Modules/mp.o
-write_paw_recon.o : ld1inc.o
-write_pseudo.o : ../Modules/constants.o
-write_pseudo.o : ../Modules/funct.o
-write_pseudo.o : ../Modules/kind.o
-write_results.o : ../Modules/constants.o
-write_results.o : ../Modules/funct.o
-write_results.o : ../Modules/io_global.o
-write_results.o : ../Modules/kind.o
-write_results.o : ../Modules/mp.o
-write_results.o : ../Modules/radial_grids.o
-write_results.o : ld1inc.o
-write_resultsps.o : ../Modules/constants.o
-write_resultsps.o : ../Modules/funct.o
-write_resultsps.o : ../Modules/io_global.o
-write_resultsps.o : ../Modules/kind.o
-write_resultsps.o : ../Modules/mp.o
-write_resultsps.o : ../Modules/radial_grids.o
-write_resultsps.o : ld1inc.o
-write_upf.o : ../Modules/constants.o
-write_upf.o : ../Modules/funct.o
-write_upf.o : ../Modules/kind.o
-write_upf.o : ld1inc.o

Deleted: trunk/espresso/atomic/new_potential.f90
===================================================================
--- trunk/espresso/atomic/new_potential.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/new_potential.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,131 +0,0 @@
-!
-! Copyright (C) 2004-2010 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine new_potential &
-     (ndm,mesh,grid,zed,vxt,lsd,nlcc,latt,enne,rhoc,rho,vh,vnew,iflag)
-  !---------------------------------------------------------------
-  !   set up the selfconsistent atomic potential
-  !
-  use constants, only: fpi, e2
-  use radial_grids, only: radial_grid_type, hartree
-  use kinds, only : DP
-  use funct, only : get_iexch, dft_is_meta, dft_is_gradient, exc_t, vxc_t
-  use ld1inc, only : nwf, vx, vxc, exc, excgga, tau, vtau
-  implicit none
-  type(radial_grid_type),intent(in):: grid
-  integer, intent(in) :: iflag
-  logical :: nlcc, gga, oep, meta
-  integer :: ndm,mesh,lsd,latt,i,is,nu, nspin, ierr
-  real(DP):: rho(ndm,2),vxcp(2),vnew(ndm,2),vxt(ndm),vh(ndm), rhoc(ndm)
-  real(DP):: zed,enne,rh(2),rhc
-  real(DP),allocatable:: vgc(:,:), egc(:), rhotot(:)
-!  real(DP),allocatable:: vx(:,:)
-  real(DP),allocatable:: dchi0(:,:)
-
-  if (mesh.ne.grid%mesh) &
-       call errore('new_potential','mesh dimension is not as expected',1)
-  gga=dft_is_gradient()
-  meta=dft_is_meta()
-  oep=get_iexch().eq.4
-  nspin=1
-  if (lsd.eq.1) nspin=2
-  !
-  !   compute hartree potential with the total charge
-  !
-  allocate(rhotot(ndm),stat=ierr)
-  do i=1,ndm
-     rhotot(i)=rho(i,1)
-  enddo
-  if (lsd.eq.1) then
-     do i=1,ndm
-        rhotot(i)=rhotot(i)+rho(i,2)
-     enddo
-  endif
-  call hartree(0,2,mesh,grid,rhotot,vh)
-  deallocate(rhotot)
-  !
-  ! add exchange and correlation potential: LDA or LSDA only
-  !
-  rhc=0.0_DP
-  do i=1,mesh
-     vh(i) = e2*vh(i)
-     do is=1,nspin
-        rh(is) = rho(i,is)/grid%r2(i)/fpi
-     enddo
-     if (nlcc) rhc = rhoc(i)/grid%r2(i)/fpi
-     if (meta) then
-        !
-        ! Workaround: the meta-GGA XC functional already contains the LDA part
-        !
-        vxcp(:)=0.0_dp
-        exc(i) =0.0_dp
-     else
-        call vxc_t(rh,rhc,lsd,vxcp)
-        exc(i)=exc_t(rh,rhc,lsd)
-     endif
-     do is=1,nspin
-        vxc(i,is)=vxcp(is)
-        vnew(i,is)= - zed*e2/grid%r(i)+vxt(i)+vh(i)+vxcp(is)
-     enddo
-  end do
-  !
-  ! add exchange and correlation potential: GGA only
-  !
-  if (gga) then
-     allocate(vgc(ndm,2),stat=ierr)
-     allocate(egc(ndm),stat=ierr)
-     call errore('new_potential','allocating vgc and egc',ierr)
-
-     call vxcgc (ndm, mesh, nspin, grid%r, grid%r2, rho, rhoc, &
-          vgc, egc, tau, vtau, iflag)
-     do is=1,nspin
-        do i=1,mesh
-           vxc(i,is)=vxc(i,is)+vgc(i,is)
-           vnew(i,is)=vnew(i,is)+vgc(i,is)
-           excgga(i) =egc(i)*fpi*grid%r2(i)
-        enddo
-     enddo
-     deallocate(egc)
-     deallocate(vgc)
-  else
-     excgga=0.0_DP
-  end if
-  !
-  ! add OEP exchange 
-  !
-  if (oep) then
-!     write (*,*) ndm, nwf
-     allocate(dchi0(ndm,nwf))
-
-     do nu=1,nwf
-        call dvex(nu,dchi0(1,nu))
-     end do
-
-     call dfx_new(dchi0, vx)
-     do is=1,nspin
-        do i=1,mesh
-! ADD OEP VX
-           vnew(i,is)= vnew(i,is)  + vx(i,is)
-        end do
-     end do
-     deallocate(dchi0)
-  end if 
-  !
-  ! latter correction
-  !
-  if (latt.ne.0) then
-     do is=1,nspin
-        do i=1,mesh
-           vnew(i,is)= min(vnew(i,is),-e2*(zed-enne+1.0_DP)/grid%r(i))
-        enddo
-     enddo
-  end if
-
-  return
-end subroutine new_potential

Deleted: trunk/espresso/atomic/newd_at.f90
===================================================================
--- trunk/espresso/atomic/newd_at.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/newd_at.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,64 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!-------------------------------------------------------------------------
-subroutine newd_at ( )
-  !-------------------------------------------------------------------------
-  !
-  !     this routine computes the new D coefficients
-  !
-  !
-  use kinds, only : dp
-  use radial_grids, only : ndmx
-  use ld1inc, only : ddd, bmat, nbeta, nspin, lls, jjs, ikk, qvan, vpstot, &
-                     grid, pseudotype, lpaw, which_augfun, qvanl
-  implicit none
-
-  integer :: &
-       ib,jb,n,is,nst
-
-  real(DP) :: &
-       int_0_inf_dr, &   ! the integral function
-       gi(ndmx)          ! the gi function
-
-  !
-  !    screening the D coefficients
-  !
-  if (pseudotype == 3) then
-     do ib=1,nbeta
-        do jb=1,ib
-           if (lls(ib).eq.lls(jb).and.abs(jjs(ib)-jjs(jb)).lt.1.0e-7_dp) then
-              nst=(lls(ib)+1)*2
-              do is=1,nspin
-                 IF (which_augfun=='PSQ') then
-                    do n=1,ikk(ib)
-                       gi(n)=qvanl(n,ib,jb,0)*vpstot(n,is)
-                    enddo
-                 ELSE
-                    do n=1,ikk(ib)
-                       gi(n)=qvan(n,ib,jb)*vpstot(n,is)
-                    enddo
-                 ENDIF
-                 ddd(ib,jb,is)= bmat(ib,jb) &
-                      + int_0_inf_dr(gi,grid,ikk(ib),nst)
-                 ddd(jb,ib,is)=ddd(ib,jb,is)
-              enddo
-           endif
-        enddo
-     enddo
-  else if (pseudotype == 2) then
-     !
-     !    non-US separable PP case: just copy unscreened D coeffs
-     !
-     do is=1,nspin
-        ddd(:,:,is)= bmat(:,:)
-     enddo
-  endif
-
-  return
-end subroutine newd_at

Deleted: trunk/espresso/atomic/nodenum.f90
===================================================================
--- trunk/espresso/atomic/nodenum.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/nodenum.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,32 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!----------------------------------------------------------------------------
-subroutine nodeno(snlo,jj1,jj2,nodes,idim1)
-  !----------------------------------------------------------------------------
-  !
-  !   routine counts the number of nodes of the wavefunction snlo
-  !   between the points jj1 and jj2
-  !
-  use kinds, only : DP
-  implicit none
-  integer :: jj1,jj2,nodes,idim1
-  !
-  !   wavefunction array
-  !
-  real(DP) :: snlo(idim1)
-
-  integer :: i
-  !
-  nodes = 0
-  !
-  do i = jj1+1,jj2
-     if ( snlo(i-1) * snlo(i) .lt. 0.0_DP ) nodes = nodes + 1
-  enddo
-  return
-end subroutine nodeno

Deleted: trunk/espresso/atomic/normalize.f90
===================================================================
--- trunk/espresso/atomic/normalize.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/normalize.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,82 +0,0 @@
-
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine normalize(phi,l,j,ns)
-  !---------------------------------------------------------------
-  !
-  !     normalize the US wavefunction so that <phis|S|phis>=1
-  !
-  use kinds, only : dp
-  use ld1_parameters, only : nwfsx
-  use radial_grids, only : ndmx
-  use io_global,    only : stdout
-  use ld1inc, only: grid, qq, betas, ikk, lls, jjs, nbeta, pseudotype
-
-  implicit none
-
-  real(DP) ::    &
-       phi(ndmx), &  ! function to normalize
-       j            ! total angular momentum
-  integer ::    &
-       l,       &   ! orbital angular momentum
-       ns           ! state index
-  integer ::    &
-       n,n1,n2, &   ! counters on beta and mesh function
-       nst,ikl   ! counter on wavefunctions
-
-  real(DP) :: &
-       work(nwfsx), & ! auxiliary variable for becp
-       work1,       & ! the norm
-       int_0_inf_dr,& ! integration function
-       gi(ndmx)        ! used to compute the integrals
-
-  if (pseudotype.ne.3) return 
-  !
-  !    if US pseudopotential compute the augmentation part
-  !
-  nst=(l+1)*2
-  do n1=1,nbeta
-     if (l.eq.lls(n1).and.abs(j-jjs(n1)).lt.1.e-7_dp) then
-        ikl=ikk(n1)
-        do n=1,ikl
-           gi(n)=betas(n,n1)*phi(n)
-        enddo
-        work(n1)=int_0_inf_dr(gi,grid,ikl,nst)
-     else
-        work(n1)=0.0_dp
-     endif
-  enddo
-  do n=1,grid%mesh
-     gi(n)=phi(n)*phi(n)
-  enddo
-  work1=int_0_inf_dr(gi,grid,grid%mesh,nst)
-  !
-  !   and adding to the charge density
-  !
-  do n1=1,nbeta
-     do n2=1,nbeta
-        work1=work1+qq(n1,n2)*work(n1)*work(n2)  
-     enddo
-  enddo
-  if (abs(work1) < 1e-10_dp) then
-     !call infomsg('normalize','zero norm: not a true US PP ?')
-     write(stdout,'(7x,a,i3,a,i3,a,f3.1,a)') &
-     'Zero norm: self consistency problem; state:',ns,' (l=' ,l,', j=',j,')'
-     work1=1.0_dp
-  else if (work1 <= -1e-10_dp) then
-     call errore('normalize','negative norm?',ns)   
-  end if
-  work1=sqrt(work1)
-  do n=1,grid%mesh
-     phi(n)=phi(n)/work1
-  enddo
-
-  return
-end subroutine normalize

Deleted: trunk/espresso/atomic/occ_spin.f90
===================================================================
--- trunk/espresso/atomic/occ_spin.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/occ_spin.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,266 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine occ_spin(nwf,nwfx,el,nn,ll,oc,isw)
-  !---------------------------------------------------------------
-  !
-  !  This routine splits the occupations of the states between spin-up
-  !  and spin down. If the occupations are lower than 2*l+1 it does
-  !  nothing, otherwise 2*l+1 states are assumed with spin up and
-  !  the difference with spin down. 
-  !
-  use kinds, only : DP
-  implicit none
-  integer :: nwf, nwfx, nn(nwfx), ll(nwfx), isw(nwfx)
-  real(DP) :: oc(nwfx)
-  character(len=2) :: el(nwfx)
-
-  integer :: nwf0, n, n1
-  logical :: ok
-
-  nwf0=nwf
-  do n=1,nwf0
-     if (oc(n) > (2*ll(n)+1)) then
-        !
-        !    check that the new state is not already available
-        !
-        do n1=n+1,nwf0
-           if (el(n1)==el(n)) call errore('ld1_readin','wrong occupations',1)
-        enddo
-        !
-        !    and add it
-        !
-        nwf=nwf+1
-        if (nwf > nwfx) call errore('ld1_readin','too many wavefunctions',1)
-        el(nwf)=el(n)
-        nn(nwf)=nn(n)
-        ll(nwf)=ll(n)
-        oc(nwf)=oc(n)-2*ll(n)-1
-        oc(n)=2*ll(n)+1
-        if (isw(n) == 1) isw(nwf)=2 
-        if (isw(n) == 2) isw(nwf)=1 
-     else
-        ok=.true.
-        do n1=1,nwf0
-           if (n1 /= n) ok=ok.and.(el(n1) /= el(n))  
-        enddo
-        if (ok) then
-           nwf=nwf+1
-           if (nwf > nwfx) &
-                & call errore('occ_spin','too many wavefunctions',1)
-           el(nwf)=el(n)
-           nn(nwf)=nn(n)
-           ll(nwf)=ll(n)
-           oc(nwf)=0.0_dp
-           if (oc(n)<0.0_dp) oc(nwf)=oc(n)
-           if (isw(n) == 1) isw(nwf)=2 
-           if (isw(n) == 2) isw(nwf)=1 
-        endif
-     endif
-  enddo
-  return
-end subroutine occ_spin
-!
-subroutine occ_spinorb(nwf,nwfx,el,nn,ll,jj,oc,isw,rel_dist)
-  !
-  ! This subroutine splits the states according to their j as needed to
-  ! make a spin orbit calculation.
-  !
-  use kinds, only : DP
-  implicit none
-  integer :: nwf, nwfx, nn(nwfx), ll(nwfx), isw(nwfx)
-  real(DP) :: oc(nwfx), jj(nwfx)
-  character(len=2) :: el(nwfx)
-  character(len=20) :: rel_dist
-
-  integer :: nwftot, nwf0, n, m
-  logical :: ok
-
-  nwftot=0
-  do n=1,nwf
-     nwftot=nwftot+1
-     if (ll(n).gt.0 .and. abs(jj(n)).lt.1.e-2_dp) nwftot=nwftot+1
-  enddo
-  ok=.true.
-  nwf0=nwf
-  do n=1,nwftot
-     if (ok) then
-        if (ll(n).gt.0.and.abs(jj(n)).lt.1.e-2_dp) then
-           ok=.false.
-           jj(n)=ll(n)-0.5_dp
-           nwf0=nwf0+1
-           if (nwf0.gt.nwfx) call errore('ld1_setup','too many wfc',1)
-           do m=nwf0-1,n+1,-1
-              nn(m+1)=nn(m)
-              ll(m+1)=ll(m)
-              jj(m+1)=jj(m)
-              el(m+1)=el(m)
-              isw(m+1)=isw(m)
-              oc(m+1)=oc(m)
-           enddo
-           nn(n+1)=nn(n)
-           ll(n+1)=ll(n)
-           jj(n+1)=ll(n)+0.5_dp  
-           el(n+1)=el(n)
-           isw(n+1)=isw(n)
-           if (oc(n).gt.-1.e-3_dp) then
-              if (rel_dist=='average'.or.rel_dist=='AVERAGE' &
-                          .or.rel_dist=='Average') then
-                 oc(n+1)=oc(n)*(2.0_DP*(ll(n)+1))/(2.0_DP*(2*ll(n)+1)) 
-                 oc(n)=oc(n)*(2.0_DP*ll(n))/(2.0_DP*(2*ll(n)+1)) 
-              else
-                 oc(n+1)=max(0.0_dp,oc(n)-min(2.0_dp*ll(n),oc(n)))
-                 oc(n)=min(2.0_dp*ll(n),oc(n))
-              endif
-           else
-              oc(n+1)=oc(n)
-           endif
-        else
-           if (abs( jj(n) ).lt. 1.e-2_dp) jj(n)=0.5_dp
-        endif
-     else
-        ok=.true.
-     endif
-  enddo
-  nwf=nwf0
-  return
-end subroutine occ_spinorb
-!---------------------------------------------------------------
-subroutine occ_spinorbps(nwf,nwfx,el,nn,ll,jj,oc,rcut,rcutus,enls,isw,rel_dist)
-!---------------------------------------------------------------
-  !
-  ! This subroutine splits the states according to their j as needed to
-  ! make a spin orbit calculation.
-  !
-  use kinds, only : DP
-  implicit none
-  integer :: nwf, nwfx, nn(nwfx), ll(nwfx), isw(nwfx)
-  real(DP) :: oc(nwfx), jj(nwfx), rcut(nwfx), rcutus(nwfx), enls(nwfx)
-  character(len=2) :: el(nwfx)
-  character(len=20) :: rel_dist
-
-  integer :: nwftot, nwf0, n, m
-  logical :: ok
-
-  nwftot=0
-  do n=1,nwf
-     nwftot=nwftot+1
-     if (ll(n).gt.0.and.abs(jj(n)).lt.1.e-2_dp) nwftot=nwftot+1
-  enddo
-  ok=.true.
-  nwf0=nwf
-  do n=1,nwftot
-     if (ok) then
-        if (ll(n).gt.0.and.abs(jj(n)).lt.1.e-2_dp) then
-           ok=.false.
-           jj(n)=ll(n)-0.5_dp
-           nwf0=nwf0+1
-           if (nwf0.gt.nwfx) call errore('ld1_setup','too many wfc',1)
-           do m=nwf0-1,n+1,-1
-              nn(m+1)=nn(m)
-              ll(m+1)=ll(m)
-              jj(m+1)=jj(m)
-              el(m+1)=el(m)
-              isw(m+1)=isw(m)
-              oc(m+1)=oc(m)
-              rcut(m+1)=rcut(m)
-              rcutus(m+1)=rcutus(m)
-              enls(m+1)=enls(m)
-           enddo
-           nn(n+1)=nn(n)
-           ll(n+1)=ll(n)
-           jj(n+1)=ll(n)+0.5_dp
-           el(n+1)=el(n)
-           rcut(n+1)=rcut(n)
-           rcutus(n+1)=rcutus(n)
-           enls(n+1)=enls(n)
-           isw(n+1)=isw(n)
-           if (rel_dist=='average'.or.rel_dist=='AVERAGE' &
-                          .or.rel_dist=='Average') then
-              oc(n+1)=oc(n)*(2.0_DP*(ll(n)+1))/(2.0_DP*(2*ll(n)+1)) 
-              oc(n)=oc(n)*(2.0_DP*ll(n))/(2.0_DP*(2*ll(n)+1)) 
-           else
-              oc(n+1)=max(0.0_dp,oc(n)-min(2.0_dp*ll(n),oc(n)))
-              oc(n)=min(2.0_dp*ll(n),oc(n))
-           endif
-        else
-           if (abs(jj(n)).lt.1.e-2_dp) jj(n)=0.5_dp
-        endif
-     else
-        ok=.true.
-     endif
-  enddo
-  nwf=nwf0
-  return
-end subroutine occ_spinorbps
-
-!---------------------------------------------------------------
-subroutine occ_spin_tot(nwf,nwfx,el,nn,ll,oc,isw,enl,psi)
-  !---------------------------------------------------------------
-  !
-  !  This routine is similar to occ_spin, but updates also energies
-  !  and wavefunctions for frozen_core calculations
-  !
-  use radial_grids, only : ndmx
-  use kinds, only : DP
-  implicit none
-  integer :: nwf, nwfx, nn(nwfx), ll(nwfx), isw(nwfx)
-  real(DP) :: oc(nwfx), enl(nwfx), psi(ndmx,2,nwfx)
-  character(len=2) :: el(nwfx)
-
-  integer :: nwf0, n, n1
-  logical :: ok
-
-  nwf0=nwf
-  do n=1,nwf0
-     if (oc(n) > (2*ll(n)+1)) then
-        !
-        !    check that the new state is not already available
-        !
-        do n1=n+1,nwf0
-           if (el(n1)==el(n)) call errore('ld1_readin','wrong occupations',1)
-        enddo
-        !
-        !    and add it
-        !
-        nwf=nwf+1
-        if (nwf > nwfx) call errore('ld1_readin','too many wavefunctions',1)
-        el(nwf)=el(n)
-        nn(nwf)=nn(n)
-        ll(nwf)=ll(n)
-        oc(nwf)=oc(n)-2*ll(n)-1
-        oc(n)=2*ll(n)+1
-        if (isw(n) == 1) isw(nwf)=2 
-        if (isw(n) == 2) isw(nwf)=1 
-        enl(nwf)=enl(n)
-        psi(:,1,nwf)=psi(:,1,n)
-     else
-        ok=.true.
-        do n1=1,nwf0
-           if (n1 /= n) ok=ok.and.(el(n1) /= el(n))  
-        enddo
-        if (ok) then
-           nwf=nwf+1
-           if (nwf > nwfx) &
-                & call errore('occ_spin','too many wavefunctions',1)
-           el(nwf)=el(n)
-           nn(nwf)=nn(n)
-           ll(nwf)=ll(n)
-           oc(nwf)=0.0_dp
-           if (oc(n)<0.0_DP) oc(nwf)=oc(n)
-           if (isw(n) == 1) isw(nwf)=2 
-           if (isw(n) == 2) isw(nwf)=1 
-           enl(nwf)=enl(n)
-           psi(:,1,nwf)=psi(:,1,n)
-        endif
-     endif
-  enddo
-  return
-end subroutine occ_spin_tot
-!

Deleted: trunk/espresso/atomic/outward.f90
===================================================================
--- trunk/espresso/atomic/outward.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/outward.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,33 +0,0 @@
-!---------------------------------------------------------------
-subroutine outward(y,f,g,mesh,imatch,ncross)
-!---------------------------------------------------------------
-   ! outward integration. numerov method.
-   !
-   use kinds, only: DP
-   use radial_grids, only: ndmx
-   implicit none
-   !
-   ! I/O variables
-   !
-   integer :: mesh,imatch, ncross
-   real (DP) :: y(ndmx), f(ndmx), g(ndmx)
-   !
-   ! local variables
-   !
-   integer :: n
-   real (DP) :: ymx
-
-   if (ndmx.lt.mesh) stop ' outward : ndmx .lt. mesh !!!!'
-   !
-   ncross=0
-   ymx=0.d0
-   do n=2,imatch-1
-      y(n+1)=((12.d0-10.d0*f(n))*y(n)-f(n-1)*y(n-1)+g(n))/f(n+1)
-      if ( y(n) .ne. sign(y(n),y(n+1)) ) ncross=ncross+1
-      ymx=max(ymx,abs(y(n)))
-   end do
-   if(ymx.ge.1.0d10) write (*,*) ' ******** ymx.ge.1.0e10 ********'
-!
-   return
-end subroutine outward
-

Deleted: trunk/espresso/atomic/parameters.f90
===================================================================
--- trunk/espresso/atomic/parameters.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/parameters.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,13 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-module ld1_parameters
-   integer, parameter :: &
-           ncmax1=10,    & ! the maximum configuration number
-           nwfsx=14,     & ! the maximum number of pseudo wavefunctions
-           nwfx=38         ! the maximum number of wavefunctions
-end module ld1_parameters

Deleted: trunk/espresso/atomic/partial_wave_expansion.f90
===================================================================
--- trunk/espresso/atomic/partial_wave_expansion.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/partial_wave_expansion.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,199 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine partial_wave_expansion
-  !---------------------------------------------------------------
-  !
-  !  numerical integration of the radial schroedinger equation 
-  !  computing logarithmic derivatives for pseudo-potentials
-  !  multiple nonlocal projectors are allowed
-  !
-  use kinds,     only : DP
-  use radial_grids, only : ndmx
-  use io_global, only : stdout
-  use mp,        only : mp_bcast
-  use radial_grids, only: series
-  use ld1_parameters, only : nwfsx
-  use ld1inc,    only : grid, nld, nbeta, nspin, rel, ikk, file_pawexp, &
-                        betas, ddd, qq, lls, jjs, pseudotype, vpstot, vnl, &
-                        rpwe, npte, emaxld, eminld, deld, phis, rcutus, rcloc
-  implicit none
-
-  integer  ::       &
-       lam,   &      ! the angular momentum
-       ikrld, &      ! index of matching radius
-       nc,    &      ! counter on logarithmic derivatives
-       nbf,   &      ! number of b functions
-       n,ie          ! generic counters
-
-  real(DP) ::  &
-       norm, norm2,& ! auxiliary variables
-       ze2,     &    ! the nuclear charge in Ry units
-       jam,     &    ! the total angular momentum
-       e,       &    ! the eigenvalue
-       lamsq,   &    ! combined angular momentum
-       b(0:3),  &    ! used for starting guess of the solution 
-       ddx12     
-
-  real(DP),allocatable :: &
-       ene(:),      &  ! the energy grid
-       nnn(:,:),    &  ! the expansion fraction
-       vaux(:),     &  ! auxiliary: the potential 
-       aux(:),      &  ! the square of the wavefunction
-       aux2(:),     &  ! auxiliary wavefunction
-       al(:)           ! the known part of the differential equation
-
-  real(DP), external :: compute_log
-  real(DP), external :: int_0_inf_dr
-
-  integer :: &
-       ik, jb,        &  ! auxiliary variables
-       ikmin,         &  ! minimum value of ik
-       nst,           &  ! auxiliary for integrals
-       ios,           &  ! used for I/O control
-       is, ind           ! counters on index
-
-  logical :: found
-
-  character(len=256) :: flld
-
-
-  if (nld == 0 .or. file_pawexp == ' ') return
-  if (nld > nwfsx) call errore('lderivps','nld is too large',1)
-
-  allocate( al(grid%mesh), aux(grid%mesh), aux2(grid%mesh),vaux(grid%mesh) )
-
-  ze2=0.0_dp
-
-  do n=1,grid%mesh
-     if (grid%r(n) > rpwe) go to 10
-  enddo
-  call errore('partial_wave_expansion','wrong rpwe?',1)
-10 ikrld = n-1
-  write(stdout,'(5x,''Computing the partial wave expansion '')') 
-  npte= (emaxld-eminld)/deld + 1
-  allocate ( nnn(npte,nld) )
-  allocate ( ene(npte) )
-  do ie=1,npte
-     ene(ie)=eminld+deld*(ie-1)
-  enddo
-  ikmin=ikrld+5
-  if (nbeta>0) then
-     do nbf=1,nbeta
-        ikmin=max(ikmin,ikk(nbf))
-     enddo
-  endif
-  spinloop : &
-  do is=1,nspin
-     nlogdloop : &
-     do nc=1,nld
-        if (rel < 2) then
-           lam=nc-1
-           jam=0.0_dp
-        else
-           lam=nc/2
-           if (mod(nc,2)==0) jam=lam-0.5_dp
-           if (mod(nc,2)==1) jam=lam+0.5_dp
-        endif
-        ddx12=grid%dx*grid%dx/12.0_dp
-        nst=(lam+1)*2  
-        nbf=nbeta
-        if (pseudotype == 1) then
-           if (rel < 2 .or. lam == 0 .or. abs(jam-lam+0.5_dp) < 0.001_dp) then
-              ind=1
-           else if (rel==2 .and. lam>0 .and. abs(jam-lam-0.5_dp)<0.001_dp) then
-              ind=2
-           endif
-           do n=1,grid%mesh
-              vaux(n) = vpstot(n,is) + vnl(n,lam,ind)
-           enddo
-           nbf=0
-        else
-           do n=1,grid%mesh
-              vaux(n) = vpstot(n,is)
-           enddo
-        endif
-
-        do n=1,4
-           al(n)=vaux(n)-ze2/grid%r(n)
-        enddo
-        call series(al,grid%r,grid%r2,b)
-
-        energiesloop : &
-        do ie=1,npte
-           e=eminld+deld*(ie-1.0_dp)
-           lamsq=(lam+0.5_dp)**2
-           !
-           !     b) find the value of solution s in the first two points
-           !
-           call start_scheq( lam, e, b, grid, ze2, aux )
-
-           do n=1,grid%mesh
-              al(n)=( (vaux(n)-e)*grid%r2(n) + lamsq )*ddx12
-              al(n)=1.0_dp-al(n)
-           enddo
-
-           !
-           ! integrate outward at fixed energy
-           !
-           call integrate_outward (lam,jam,e,grid%mesh,ndmx,grid,al,b,aux,betas,ddd,&
-                qq,nbf,nwfsx,lls,jjs,ikk,ikmin)
-           !            
-           aux(1:ikmin) = aux(1:ikmin)*grid%sqr(1:ikmin)
-           !
-           ! calculate the accuracy of the expasion of the solution at 
-           ! a given energy in terms of the partial waves at the chosen
-           ! reference energies.
-           ! a vanishing value of nnn indicates a perfect expansion
-           !
-           aux2(:) = 0.d0
-           ik=min(ikrld,ikmin)
-           if (mod(ik,2)==0) ik=ik+1
-           found = .false.
-           do jb=1,nbeta
-              if (lls(jb).eq.lam.and.jjs(jb).eq.jam) then
-                 found = .true.
-                 IF (grid%r(ik)>max(rcutus(jb),rcloc).and.ie==1) &
-                    write(stdout, &
-                 '(5x,"R is outside the sphere for l=",i5," j=",f5.2)') lam,jam
-                 al(1:ikk(jb))=betas(1:ikk(jb),jb)*aux(1:ikk(jb))
-                 norm = int_0_inf_dr(al,grid,ikk(jb),nst)
-                 aux2(1:ik) = aux2(1:ik) + phis(1:ik,jb)*norm
-              endif
-           enddo
-           if( .not. found) then
-               nnn(:,nc) = 0._dp
-               write(stdout, '(7x,a,i3)') "no projector for channel: ", lam
-               cycle nlogdloop
-           endif
-
-           aux2(ik+1:ikmin) = 0._dp
-           al(1:ik)= aux(1:ik)**2
-           !
-           norm=int_0_inf_dr(al,grid,ik,nst)
-           !
-           al(1:ik)= (aux2(1:ik)-aux(1:ik))**2
-           norm2=int_0_inf_dr(al,grid,ik,nst)
-           nnn(ie,nc) = norm2/norm
-           !
-           !
-        enddo energiesloop
-     enddo nlogdloop
-
-     flld = trim(file_pawexp)
-     nnn=100.0_DP*nnn
-     call write_efun(flld,nnn,ene,npte,nld)
-  enddo spinloop
-
-  deallocate(ene)
-  deallocate(nnn)
-  deallocate(vaux, aux, al)
-
-  return
-end subroutine partial_wave_expansion

Deleted: trunk/espresso/atomic/paw_type.f90
===================================================================
--- trunk/espresso/atomic/paw_type.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/paw_type.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,126 +0,0 @@
-!
-! Copyright (C) 2008 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-MODULE paw_type
-   USE kinds,       ONLY : DP
-   USE radial_grids, ONLY : radial_grid_type, nullify_radial_grid, deallocate_radial_grid
-   !
-   PUBLIC
-   !
-   TYPE :: paw_t
-      !
-      ! Type describing a PAW dataset (temporary).
-      ! Functions are defined on a logarithmic radial mesh.
-      !
-      CHARACTER(LEN=2) :: symbol
-      REAL (DP)        :: zval
-      REAL (DP)        :: z
-      CHARACTER(LEN=80):: dft
-      TYPE(radial_grid_type) :: grid
-      REAL (DP)        :: rmatch_augfun  ! the matching radius for augmentation charges
-      LOGICAL          :: nlcc ! nonlinear core correction
-      INTEGER          :: nwfc ! number of wavefunctions/projectors
-      INTEGER          :: lmax ! maximum angular momentum of projectors
-      INTEGER          :: rel  ! the relativistic level
-      INTEGER, POINTER :: l(:) !l(nwfsx) ! angular momentum of projectors
-      INTEGER, POINTER :: ikk(:) !ikk(nwfsx) ! cutoff radius for the projectors
-      INTEGER          :: irc ! r(irc) = radius of the augmentation sphere
-      CHARACTER(LEN=2),POINTER ::  els (:) ! the name of the wavefunction
-      REAL (DP), POINTER :: &
-         oc(:), &          !(nwfsx) the occupations
-         enl(:), &         !(nwfsx) the energy of the wavefunctions
-         jj (:), &         ! the total angular momentum
-         rcutus (:), &     ! the cutoff
-         aewfc(:,:), &     !(ndmx,nwfsx) all-electron wavefunctions
-         aewfc_rel(:,:), &     !(ndmx,nwfsx) all-electron wavefunctions
-         pswfc(:,:), &     !(ndmx,nwfsx) pseudo wavefunctions
-         proj(:,:), &      !(ndmx,nwfsx) projectors
-         augfun(:,:,:,:), &!(ndmx,nwfsx,nwfsx,0:2*lmaxx+1),
-         augmom(:,:,:), &  !(nwfsx,nwfsx,0:2*lmaxx) moments of the augmentation functions
-         aeccharge(:), &   !(ndmx) AE core charge * 4PI r^2
-         psccharge(:), &   !(ndmx) PS core charge * 4PI r^2
-         pscharge(:), &    !(ndmx) PS charge * 4PI r^2
-         aeloc(:), &       !(ndmx) descreened AE potential: v_AE-v_H[n1]-v_XC[n1+nc]
-         psloc(:), &       !(ndmx) descreened local PS potential: v_PS-v_H[n~+n^]-v_XC[n~+n^+n~c]
-         kdiff(:,:), &     !(nwfsx,nwfsx) kinetic energy differences
-         dion(:,:)         !(nwfsx,nwfsx) descreened D coeffs
-   !!!  Notes about screening:
-   !!!       Without nlcc, the local PSpotential is descreened with n~+n^ only.
-   !!!       The local AEpotential is descreened ALWAYS with n1+nc. This improves
-   !!!       the accuracy, and will not cost in the plane wave code (atomic
-   !!!       contribution only).
-   END TYPE paw_t
-
- CONTAINS
-!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-! Nullify, allocate and deallocate for paw_t type. Used only
-! in atomic code.
-!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-        SUBROUTINE nullify_pseudo_paw( paw )
-        TYPE( paw_t ), INTENT(INOUT) :: paw
-        CALL nullify_radial_grid( paw%grid ) ! nullify grid object, here grid is not a POINTER!
-        NULLIFY( paw%l, paw%ikk )
-        NULLIFY( paw%oc, paw%enl, paw%aewfc, paw%aewfc_rel, paw%pswfc, paw%proj)
-        NULLIFY( paw%augfun, paw%augmom, paw%aeccharge, paw%psccharge, paw%pscharge )
-        NULLIFY( paw%aeloc, paw%psloc, paw%dion )
-        NULLIFY( paw%kdiff )
-        RETURN
-        END SUBROUTINE nullify_pseudo_paw
-        
-        SUBROUTINE allocate_pseudo_paw( paw, size_mesh, size_nwfc, size_lmax )
-        TYPE( paw_t ), INTENT(INOUT) :: paw
-        INTEGER, INTENT(IN) :: size_mesh, size_nwfc, size_lmax
-        !WRITE(0,"(a,3i5)") "Allocating PAW setup: ",size_mesh, size_nwfc, size_lmax
-        ALLOCATE ( paw%l(size_nwfc) )
-        ALLOCATE ( paw%jj(size_nwfc) )
-        ALLOCATE ( paw%ikk(size_nwfc) )
-        ALLOCATE ( paw%oc(size_nwfc) )
-        ALLOCATE ( paw%rcutus(size_nwfc) )
-        ALLOCATE ( paw%els(size_nwfc) )
-        ALLOCATE ( paw%enl(size_nwfc) )
-        ALLOCATE ( paw%aewfc(size_mesh,size_nwfc) )
-        ALLOCATE ( paw%aewfc_rel(size_mesh,size_nwfc) )
-        ALLOCATE ( paw%pswfc(size_mesh,size_nwfc) )
-        ALLOCATE ( paw%proj (size_mesh,size_nwfc) )
-        ALLOCATE ( paw%augfun(size_mesh,size_nwfc,size_nwfc,0:2*size_lmax) )
-        ALLOCATE ( paw%augmom(size_nwfc,size_nwfc,0:2*size_lmax) )
-        ALLOCATE ( paw%aeccharge(size_mesh) )
-        ALLOCATE ( paw%psccharge(size_mesh) )
-        ALLOCATE ( paw%pscharge(size_mesh) )
-        ALLOCATE ( paw%aeloc(size_mesh) )
-        ALLOCATE ( paw%psloc(size_mesh) )
-        ALLOCATE ( paw%kdiff(size_nwfc,size_nwfc) )
-        ALLOCATE ( paw%dion (size_nwfc,size_nwfc) )
-        END SUBROUTINE allocate_pseudo_paw
-        
-        SUBROUTINE deallocate_pseudo_paw( paw )
-        TYPE( paw_t ), INTENT(INOUT) :: paw
-        CALL deallocate_radial_grid( paw%grid ) ! here grid is not a POINTER!
-        IF( ASSOCIATED( paw%l ) ) DEALLOCATE( paw%l )
-        IF( ASSOCIATED( paw%jj ) ) DEALLOCATE( paw%jj )
-        IF( ASSOCIATED( paw%ikk ) ) DEALLOCATE( paw%ikk )
-        IF( ASSOCIATED( paw%oc ) ) DEALLOCATE( paw%oc )
-        IF( ASSOCIATED( paw%els ) ) DEALLOCATE( paw%els )
-        IF( ASSOCIATED( paw%rcutus ) ) DEALLOCATE( paw%rcutus )
-        IF( ASSOCIATED( paw%enl ) ) DEALLOCATE( paw%enl )
-        IF( ASSOCIATED( paw%aewfc ) ) DEALLOCATE( paw%aewfc )
-        IF( ASSOCIATED( paw%pswfc ) ) DEALLOCATE( paw%pswfc )
-        IF( ASSOCIATED( paw%proj ) ) DEALLOCATE( paw%proj )
-        IF( ASSOCIATED( paw%augfun ) ) DEALLOCATE( paw%augfun )
-        IF( ASSOCIATED( paw%augmom ) ) DEALLOCATE( paw%augmom )
-        IF( ASSOCIATED( paw%aeccharge ) ) DEALLOCATE( paw%aeccharge )
-        IF( ASSOCIATED( paw%psccharge ) ) DEALLOCATE( paw%psccharge )
-        IF( ASSOCIATED( paw%pscharge ) ) DEALLOCATE( paw%pscharge )
-        IF( ASSOCIATED( paw%aeloc ) ) DEALLOCATE( paw%aeloc )
-        IF( ASSOCIATED( paw%psloc ) ) DEALLOCATE( paw%psloc )
-        IF( ASSOCIATED( paw%kdiff ) ) DEALLOCATE( paw%kdiff )
-        IF( ASSOCIATED( paw%dion ) ) DEALLOCATE( paw%dion )
-        RETURN
-        END SUBROUTINE deallocate_pseudo_paw
-
-END MODULE paw_type

Copied: trunk/espresso/atomic/pseudo_library (from rev 8077, trunk/espresso/atomic_doc/pseudo_library)

Modified: trunk/espresso/atomic/pseudo_library/LDA/REL/make_ps
===================================================================
--- trunk/espresso/atomic_doc/pseudo_library/LDA/REL/make_ps	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/pseudo_library/LDA/REL/make_ps	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PWDIR='../../../../'
+PWDIR='../../../..'
 work=./WORK
 . $PWDIR/examples/environment_variables
 BIN_DIR=$PWDIR/bin

Modified: trunk/espresso/atomic/pseudo_library/LDA/SR/make_ps
===================================================================
--- trunk/espresso/atomic_doc/pseudo_library/LDA/SR/make_ps	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/pseudo_library/LDA/SR/make_ps	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PWDIR='../../../../'
+PWDIR='../../../..'
 work=./WORK
 . $PWDIR/examples/environment_variables
 BIN_DIR=$PWDIR/bin

Modified: trunk/espresso/atomic/pseudo_library/PBE/REL/make_ps
===================================================================
--- trunk/espresso/atomic_doc/pseudo_library/PBE/REL/make_ps	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/pseudo_library/PBE/REL/make_ps	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PWDIR='../../../../'
+PWDIR='../../../..'
 work=./WORK
 . $PWDIR/examples/environment_variables
 BIN_DIR=$PWDIR/bin

Modified: trunk/espresso/atomic/pseudo_library/PBE/SR/make_ps
===================================================================
--- trunk/espresso/atomic_doc/pseudo_library/PBE/SR/make_ps	2011-08-11 19:35:50 UTC (rev 8077)
+++ trunk/espresso/atomic/pseudo_library/PBE/SR/make_ps	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PWDIR='../../../../'
+PWDIR='../../../..'
 work=./WORK
 . $PWDIR/examples/environment_variables
 BIN_DIR=$PWDIR/bin

Deleted: trunk/espresso/atomic/pseudo_q.f90
===================================================================
--- trunk/espresso/atomic/pseudo_q.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/pseudo_q.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,89 +0,0 @@
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-SUBROUTINE pseudo_q (qfunc, qfuncl)       
-USE kinds, ONLY : DP
-USE io_global, ONLY : stdout
-USE ld1_parameters, ONLY : nwfsx
-USE ld1inc, ONLY : rcut, lls,  grid, ndmx, lmx2, nbeta, ikk, ecutrho, &
-            rmatch_augfun, rmatch_augfun_nc
-IMPLICIT NONE
-!
-REAL(DP), INTENT(IN) :: qfunc(ndmx,nwfsx,nwfsx)
-REAL(DP), INTENT(OUT) :: qfuncl(ndmx,nwfsx,nwfsx,0:lmx2) 
-REAL(DP),  EXTERNAL :: int_0_inf_dr
-!
-! variables for aug. functions generation
-! 
-INTEGER  :: irc, ns, ns1, l1, l2, l3, lll, mesh, n, ik
-INTEGER  :: l1_e, l2_e
-REAL(DP) :: aux(ndmx)
-REAL(DP) :: augmom, ecutrhoq, rmatch
-
-ecutrho=0.0_DP
-mesh = grid%mesh
-qfuncl=0.0_DP
-do ns=1,nbeta
-   l1 = lls(ns)
-   do ns1=ns,nbeta
-      l2 = lls(ns1)
-      !
-      !  Find the matching point
-      !
-      ik=0
-      IF (rmatch_augfun_nc) THEN
-         rmatch=min(rcut(ns),rcut(ns1))
-      ELSE
-         rmatch=rmatch_augfun
-      ENDIF
-      do n=1,mesh
-         if (grid%r(n)>rmatch) then
-            ik=n
-            exit
-         endif
-      enddo
-      if (ik==0.or.ik>mesh-20) call errore('pseudo_q','wrong rmatch_augfun',1)
-      !
-      ! Do the pseudization
-      !
-      do l3 = abs(l1-l2), l1+l2, 2
-         CALL compute_q_3bess(l3,l1+l2,ik,qfunc(1,ns,ns1), &
-                                          qfuncl(1,ns,ns1,l3),ecutrhoq)
-         IF (ecutrhoq>ecutrho) then
-            ecutrho=ecutrhoq
-            l1_e=l1
-            l2_e=l2
-         ENDIF
-         qfuncl(1:mesh,ns1,ns,l3)=qfuncl(1:mesh,ns,ns1,l3)
-      end do
-   end do
-end do
-!
-!  Check that multipoles have not changed
-!
-irc = maxval(ikk(1:nbeta))+8
-augmom=0.0_DP
-DO ns=1,nbeta
-   l1=lls(ns)
-   DO ns1=ns,nbeta
-      l2=lls(ns1)
-      DO l3 = abs(l1-l2), l1+l2, 2
-         aux(1:irc) = (qfuncl(1:irc,ns,ns1,l3)-qfunc(1:irc,ns,ns1)) &
-                                               * grid%r(1:irc)**l3
-         lll = l1 + l2 + 2 + l3
-         augmom=int_0_inf_dr(aux(1:irc),grid,irc,lll)
-      
-         IF (abs(augmom)>1.d-5) WRITE (stdout,'(5x,a,2i3,a,2i3,a,i3,f15.7)') &
-              " Problem with multipole",ns,l1,":",ns1,l2, " l3=",l3, augmom
-      END DO
-   END DO
-END DO
-WRITE(stdout,'(/,5x, "Q pseudized with Bessel functions")')
-WRITE(stdout,'(5x,"Expected ecutrho= ",f12.4," due to l1=",i3,"   l2=",i3)') &
-                            ecutrho, l1_e, l2_e
-RETURN
-END SUBROUTINE pseudo_q

Deleted: trunk/espresso/atomic/pseudovloc.f90
===================================================================
--- trunk/espresso/atomic/pseudovloc.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/pseudovloc.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,157 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!--------------------------------------------------------------------------
-subroutine pseudovloc
-  !--------------------------------------------------------------------------
-  !
-  !     This routine generate a local pseudopotential 
-  !     The output of the routine are:
-  !     vpsloc: the local pseudopotential
-  !      
-  use kinds, only : DP
-  use radial_grids, only : ndmx
-  use io_global, only : stdout
-  use ld1inc, only : lloc, rcloc, grid, vpot, vpsloc, rel, nsloc, &
-                     phis, els, chis, psipsus, &
-                     jjs, nstoae, enls, new, psi, enl, rcut, psipaw, &
-                     psipaw_rel
-  implicit none
-
-  integer :: &
-       nwf0, &  ! used to specify the all electron function
-       nst,  &  ! auxiliary
-       ik       ! the point corresponding to rc
-
-  real(DP) ::             &
-       xc(8),              &  ! the coefficients of the fit
-       vaux(ndmx,2),        &  ! keeps the potential
-       psi_in(ndmx)            ! auxiliary
-
-  integer ::         &
-       n,        &  ! counter on mesh points
-       ns,       &  ! auxiliary
-       indi,rep, &  ! auxiliary
-       indns(0:1)    ! auxiliary
-
-  if (lloc < 0) then
-     !
-     !   Compute the potential by smoothing the AE potential
-     !
-     !   Compute the ik which correspond to this cutoff radius
-     !
-     write(stdout, &
-          "(/,5x,' Generating local potential from pseudized AE potential:',&
-            &  /,5x,' Matching radius rcloc = ',f8.4)") rcloc
-     ik=0
-     do n=1,grid%mesh
-        if (grid%r(n) < rcloc) ik=n
-     enddo
-     if (mod(ik,2) == 0) ik=ik+1
-     if (ik <= 1 .or. ik > grid%mesh) &
-          call errore('pseudovloc','wrong matching point',1)
-!
-!  smooth the potential before ik.
-!
-!  ... with the original recipe
-     if (lloc==-1) call compute_potps(ik,vpot,vpsloc,xc)
-!  ... or with a modified recipe that enforce V''(0)=0 as suggested by TM
-     if (lloc==-2) write(stdout,"(5x,' Enforcing V''''(0)=0 (lloc=-2)')")
-     if (lloc==-2) call compute_potps_new(ik,vpot,vpsloc,xc)
-     write(stdout, 110) grid%r(ik),xc(5)**2 
-110  format (/5x, ' Local pseudo, rcloc=',f6.3, &
-          ' Estimated cut-off energy= ', f8.2,' Ry')
-  else
-     !
-     !    if a given angular momentum gives the local component this is done 
-     !    here
-     !
-     nst=(lloc+1)*2
-     if (rel==2 .and. lloc > 0) then
-        rep=1
-        indns(0)=nsloc
-        indns(1)=nsloc+1
-        if (jjs(nsloc) > jjs(nsloc+1) ) then
-           indns(0)=nsloc+1
-           indns(1)=nsloc
-        endif
-     else
-        rep=0
-        indns(0)=nsloc
-     endif
-     vpsloc=0.0_dp
-     vaux=0.0_dp
-     do indi=0,rep
-        nwf0=nstoae(nsloc+indi)
-        if (enls(nsloc+indi) == 0.0_dp)  enls(nsloc+indi)=enl(nwf0)
-        !
-        !    compute the ik closer to r_cut
-        !
-        ik=0
-        do n=1,grid%mesh
-           if (grid%r(n) < rcut(nsloc+indi)) ik=n
-        enddo
-        if (mod(ik,2).eq.0) ik=ik+1
-        if (ik <= 1 .or. ik > grid%mesh) &
-           call errore('pseudovloc','wrong matching point',1)
-        rcloc=rcut(nsloc+indi)
-        if (rep == 0) then
-           write(stdout,"(/,5x,' Generating local pot.: lloc=',i1, &
-                  & ', matching radius rcloc = ',f8.4)") lloc, rcloc
-        else
-           if (rel==2) then
-              write(stdout,"(/,5x,' Generating local pot.: lloc=',i1, &
-                  &', j=',f5.2,', matching radius rcloc = ',f8.4)") &
-                  lloc, lloc-0.5d0+indi, rcloc
-           else
-              write(stdout,"(/,5x,' Generating local pot.: lloc=',i1, &
-                  &', spin=',i1,', matching radius rcloc = ',f8.4)") &
-                  lloc, indi+1, rcloc
-           endif
-        endif
-        !
-        !   compute the phi functions
-        !
-        ns=indns(indi)
-        if (new(ns)) then
-           call set_psi_in(ik,lloc,jjs(ns),enls(ns),psi_in,psipaw_rel)
-        else
-           psi_in(:)=psi(:,1,nwf0)
-        endif
-        psipaw(:,ns)=psi_in(:)
-        !
-        !  compute the phi and chi functions
-        !
-        call compute_phi_tm(lloc,ik,psi_in,phis(1,ns),0,xc,enls(ns),els(ns))
-        call compute_chi_tm(lloc,ik,ik+10,phis(1,ns),chis(1,ns),xc,enls(ns))
-        !
-        !     set the local potential equal to the all-electron one at large r
-        !
-        do n=1,grid%mesh
-           if (grid%r(n) > rcloc) then
-              vaux(n,indi+1)=vpot(n,1)
-           else
-              vaux(n,indi+1)=chis(n,ns)/phis(n,ns)
-           endif
-        enddo
-        psipsus(:,ns)=phis(:,ns)
-     enddo
-     if (rep==0) then
-        do n=1,grid%mesh
-           vpsloc(n)=vaux(n,1)
-        enddo
-     else
-        do n=1,grid%mesh
-           vpsloc(n)=(lloc*vaux(n,1)+(lloc+1.0_dp)*vaux(n,2))/ &
-                (2.0_dp*lloc+1.0_dp)
-        enddo
-     endif
-  endif
-
-  return
-end subroutine pseudovloc

Deleted: trunk/espresso/atomic/read_pseudo_ncpp.f90
===================================================================
--- trunk/espresso/atomic/read_pseudo_ncpp.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/read_pseudo_ncpp.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,218 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-
-!-----------------------------------------------------------------------
-subroutine read_pseudo_ncpp (file_pseudo,zed,grid,ndmx,&
-                        dft,lmax,lloc,zval,nlcc,rhoc,vnl,vpsloc,rel)
-  !-----------------------------------------------------------------------
-  !
-  use kinds, only : DP
-  use constants, only : fpi
-  use radial_grids, only: radial_grid_type, do_mesh
-  implicit none
-  !
-  ! I/O variables
-  !
-  type (radial_grid_type), intent(out):: grid
-  !
-  integer  ::    &
-       ndmx, &    ! input: the mesh dimensions
-       rel, &    ! input: rel=2 for spin-orbit pseudopotential
-       mesh,&    ! output: the number of mesh points
-       lmax,&    ! output: the maximum angular momentum
-       lloc      ! output: the local potential
-
-  real(DP) ::       &
-       zed,            & ! input: the atomic charge
-       zval,           & ! output: the valence charge
-!       xmin,dx,        & ! output: the mesh 
-!       rmax,           & ! output: the maximum mesh value
-!       r(ndmx),r2(ndmx), & ! output: the mesh
-!       rab(ndmx),       & ! output: derivative of the mesh
-!       sqr(ndmx),       & ! output: the square root of the mesh
-       vnl(ndmx,0:3,2), & ! output: the potential in numerical form
-       vpsloc(ndmx),    & ! output: the local pseudopotential
-       rhoc(ndmx)         ! output: the core charge
- 
-  real(DP) :: xmin, dx, rmax ! auxiliary mesh data
-
-  logical :: &
-       nlcc    ! output: if true the pseudopotential has nlcc
-
-  character ::   &
-       file_pseudo*20, &    ! input: the file with the pseudopotential
-       dft*20              ! output: the type of xc
-
-  integer :: &
-       ios, i, l, k, ir, iunps, nbeta,nlc,nnl   
-
-  real(DP) :: &
-       vnloc, a_core, b_core, alfa_core, &
-       cc(2),alpc(2),alc(6,0:3),alps(3,0:3)
-  real(DP), external :: qe_erf 
-
-  logical :: &
-       bhstype, numeric
-
-  character(len=3)  cdum
-
-  iunps=2
-  open(unit=iunps,file=file_pseudo,status='old',form='formatted', &
-       err=100, iostat=ios)
-100 call errore('read_pseudo_ncpp','open error on file '//file_pseudo,ios)
-  !
-  !     reads the starting lines
-  !
-  read( iunps, '(a)', end=300, err=300, iostat=ios ) dft
-  if (dft(1:2).eq.'**') dft='LDA'
-  if (dft(1:17).eq.'slater-pz-ggx-ggc') dft='PW'
-
-  read ( iunps, *, err=300, iostat=ios ) cdum,  &
-       zval, lmax, nlc, nnl, nlcc,  &
-       lloc, bhstype
-
-  if ( nlc.gt.2 .or. nnl.gt.3)  &
-       call errore( 'read_pseudo_ncpp','Wrong nlc or nnl', 1)
-  if ( nlc .lt.0 .or. nnl .lt. 0 )  &
-       call errore( 'read_pseudo_ncpp','nlc or nnl < 0 ? ', 1 )
-  if ( zval.le.0.0_dp )  &
-       call errore( 'read_pseudo_ncpp','Wrong zval ', 1 )
-
-  !
-  !   In numeric pseudopotentials both nlc and nnl are zero.
-  !
-  numeric = nlc.le.0 .and. nnl.le.0
-  if (lloc.eq.-1000) lloc=lmax
-
-  if (.not.numeric) then
-     read( iunps, *, err=300, iostat=ios )  &
-          ( alpc(i), i=1, 2 ), ( cc(i), i=1,2 )
-     if ( abs(cc(1)+cc(2)-1.0_dp).gt.1.0e-6_dp) call errore  &
-          ('read_pseudo_ncpp','wrong pseudopotential coefficients',1)
-     do l = 0, lmax
-        read ( iunps, *, err=300, iostat=ios ) &
-             ( alps(i,l),i=1,3 ), (alc(i,l),i=1,6)
-     enddo
-     if (nlcc) then
-        read( iunps, *, err=300, iostat=ios ) a_core,  &
-             b_core, alfa_core
-        if (alfa_core.le.0.0_dp)  &
-             call errore('readin','nlcc but alfa=0',1)
-     endif
-     if (cc(2).ne.0.0_dp.and.alpc(2).ne.0.0_dp.and.bhstype) then
-        call bachel(alps,alc,1,lmax)
-     endif
-
-  endif
-  !
-  !     read the mesh parameters
-  !
-  read( iunps, *, err=300, iostat=ios ) zed, xmin, dx, mesh, nbeta
-  rmax=exp( (mesh-1)*dx+xmin )/zed
-  !
-  !    and generate the mesh: this overwrites the mesh defined in the
-  !    input parameters
-  !
-  call do_mesh(rmax,zed,xmin,dx,0,grid)
-  if (mesh.ne.grid%mesh) &
-       call errore('read_pseudo_ncpp','something wrong in mesh',1)
-  !
-  !    outside this routine all pseudo are numeric: construct vnl and
-  !    core charge
-  !    
-  if (.not.numeric) then
-     !
-     !  obsolescent format with analytical coefficients
-     !
-     read( iunps, '(a)', err=300, iostat=ios ) cdum
-     if (nlcc) then 
-        do ir=1, mesh
-           rhoc(ir)=(a_core+b_core*grid%r2(ir))*exp(-alfa_core*grid%r2(ir)) &
-                *grid%r2(ir)*fpi
-        enddo
-     else
-        rhoc=0.0_dp
-     endif
-     do l=0,lmax
-        do ir=1,mesh
-           vnloc = 0.0_dp
-           do k=1,3
-              vnloc = vnloc + exp(-alps(k,l)*grid%r2(ir))*  &
-                   ( alc(k,l) + grid%r2(ir)*alc(k+3,l) )
-           enddo
-           !
-           !  NB: the factor 2 converts from hartree to rydberg
-           !      spin-orbit not implemented for analytical PP
-           !
-           vnl(ir,l,1) = 2.0_dp*vnloc
-        enddo
-     enddo
-     do ir=1,mesh
-        vpsloc(ir) = -2.0_dp*zval/grid%r(ir)* &
-                   ( cc(1)*qe_erf(grid%r(ir)*sqrt(alpc(1))) &
-                   + cc(2)*qe_erf(grid%r(ir)*sqrt(alpc(2))) )
-     end do
-  endif
-
-  if (numeric) then
-     !
-     !      pseudopotentials in numerical form
-     !
-     do l = 0, lmax
-        read( iunps, '(a)', err=300, iostat=ios ) cdum
-        read( iunps, *, err=300, iostat=ios )  &
-             (vnl(ir,l,1),ir=1,mesh)
-        if (rel ==2 .and. l > 0) then
-           !
-           read( iunps, '(a)', err=300, iostat=ios ) cdum
-           read( iunps, *, err=300, iostat=ios )  &
-                (vnl(ir,l,2),ir=1,mesh)
-        endif
-     enddo
-     !
-     !  the local part is subtracted from the non-local part
-     !  and stored in vpsloc - just for consistency
-     !
-     if (lloc == -1) then
-        read( iunps, '(a)', err=300, iostat=ios )
-        read( iunps, *, err=300, iostat=ios ) &
-             (vpsloc(ir),ir=1,mesh)
-     else if (rel < 2) then
-        vpsloc(1:mesh) = vnl(1:mesh,lloc,1)
-     else
-        vpsloc(1:mesh) = (l*vnl(1:mesh,lloc,1)+(l+1)*vnl(1:mesh,lloc,2)) / &
-             (2*l+1)
-     end if
-     do l=0,lmax
-        vnl(1:mesh,l,1) = vnl(1:mesh,l,1) - vpsloc(1:mesh) 
-        if (rel == 2) vnl(1:mesh,l,2) = vnl(1:mesh,l,2) - vpsloc(1:mesh) 
-     end do
-     !
-     if(nlcc) then
-        read( iunps, *, err=300, iostat=ios )  &
-             ( rhoc(ir), ir=1,mesh )
-        do ir=1, mesh
-           rhoc(ir)=rhoc(ir)*grid%r2(ir)*fpi
-        enddo
-     else
-        rhoc=0.0_dp
-     endif
-
-  endif
-300 call errore('read_pseudo_ncpp','reading pseudofile',abs(ios))
-  !
-  !   all the components of the nonlocal potential beyond lmax are taken
-  !   equal to the local part
-  !
-  do l=lmax+1,3
-     vnl(1:mesh,l,1)=vpsloc(1:mesh)
-     if (rel ==2 .and. l > 0) vnl(1:mesh,l,2)=vpsloc(1:mesh)
-  enddo
-  close(iunps)
-  return
-end subroutine read_pseudo_ncpp

Deleted: trunk/espresso/atomic/read_pseudo_rrkj3.f90
===================================================================
--- trunk/espresso/atomic/read_pseudo_rrkj3.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/read_pseudo_rrkj3.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,142 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!     
-!---------------------------------------------------------------------
-      subroutine read_pseudo_rrkj3 (ios)
-!---------------------------------------------------------------------
-!
-!     This routine reads from input the quantities which defines 
-!     a multiprojector pseudopotential. It can be in the
-!     Vanderbilt form or in the norm-conserving form
-!
-use kinds, only : dp
-use funct, only: set_dft_from_indices
-use radial_grids, only: do_mesh
-use ld1inc, only : file_pseudo, title, pseudotype, nlcc, rel, zval, etots, &
-                   grid, ikk, betas, bmat, qq, qvan, rcloc, vpsloc, rhos, &
-                   rhoc, phis, lmax, nwfs, nbeta, rcut, rcutus, &
-                   els, nns, lls, ocs
-   implicit none
-
-      integer :: &
-             nb,mb, &  ! counters on beta functions
-             n,     &  ! counter on mesh points
-             ir,    &  ! counters on mesh points
-             ios,   &  ! I/O control: ios /= 0 means error
-             iunps    ! the unit with the pseudopotential
-      integer :: iexch, icorr, igcx, igcc
-
-      logical :: reldum
- 
-      real(DP):: xmin, dx, rmax, zmesh ! auxliary mesh data
-      integer :: mesh
-
-      if (file_pseudo.eq.' ') return
-
-      iunps=29
-      open(unit=iunps,file=file_pseudo,status='unknown', &
-         &  form='formatted', err=50, iostat=ios)
-50    call errore('read_pseudo_rrkj3','opening file_pseudo',abs(ios))
-
-      read( iunps, '(a75)', err=100, iostat=ios ) title
-
-      read( iunps, '(i5)',err=100, iostat=ios ) pseudotype
-      if (pseudotype /= 2 .and. pseudotype /= 3) &
-         call errore('read_pseudo_rrkj3','pseudotype is wrong',1)
-
-      read( iunps, '(2l5)',err=100, iostat=ios ) reldum, nlcc
-      if (reldum.and.rel.eq.0) call errore('read_pseudo_rrkj3', &
-   &    'relativistic pseudopotential and non relativistic calculation',-1)
-      if (.not.reldum.and.rel.gt.0) call errore('read_pseudo_rrkj3', &
-   &    'non relativistic pseudopotential and relativistic calculation',-1)
-         
-      read( iunps, '(4i5)',err=100, iostat=ios ) iexch, icorr, igcx, igcc
-      call set_dft_from_indices(iexch, icorr, igcx, igcc, 0)
-      
-      read( iunps, '(2e17.11,i5)') zval, etots, lmax
-
-      read( iunps, '(4e17.11,i5)',err=100, iostat=ios ) xmin,rmax,zmesh,dx,mesh
-
-      call do_mesh(rmax,zmesh,xmin,dx,0,grid)
-      if (mesh.ne.grid%mesh) &
-          call errore ('read_pseudo_rrkj3','wrong meah dimensions',1)
-
-      read( iunps, '(2i5)', err=100, iostat=ios ) nwfs, nbeta
-      read( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-                                    ( rcut(nb), nb=1,nwfs )
-      read( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-                                    ( rcutus(nb), nb=1,nwfs )
-
-      do nb=1,nwfs
-         read(iunps,'(a2,2i3,f6.2)',err=100,iostat=ios) &
-                          els(nb), nns(nb), lls(nb), ocs(nb)
-      enddo
-      do nb=1,nbeta
-         read ( iunps, '(i6)',err=100, iostat=ios ) ikk(nb)
-         read ( iunps, '(1p4e19.11)',err=100, iostat=ios ) &
-                            ( betas(ir,nb), ir=1,ikk(nb))
-         do ir=ikk(nb)+1,grid%mesh
-            betas(ir,nb)=0.0_dp
-         enddo
-         do mb=1,nb
-            read( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-                  bmat(nb,mb)
-            bmat(mb,nb)=bmat(nb,mb)
-            if (pseudotype.eq.3) then
-              read(iunps,'(1p4e19.11)',err=100,iostat=ios) & 
-                  qq(nb,mb)
-              qq(mb,nb)=qq(nb,mb)
-              read(iunps,'(1p4e19.11)',err=100,iostat=ios)   &  
-                 (qvan(n,nb,mb),n=1,grid%mesh)
-              do n=1,grid%mesh
-                 qvan(n,mb,nb)=qvan(n,nb,mb)
-              enddo
-            else
-              qq(nb,mb)=0.0_dp
-              qq(mb,nb)=0.0_dp
-              do n=1,grid%mesh
-                 qvan(n,mb,nb)=0.0_dp
-                 qvan(n,nb,mb)=0.0_dp
-              enddo
-            endif
-         enddo
-      enddo
-!
-!   reads the local potential 
-!
-      read( iunps, '(1p4e19.11)',err=100, iostat=ios ) rcloc, &
-                             ( vpsloc(ir), ir=1,grid%mesh )
-!
-!     reads the atomic charge
-!
-      read( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-                               ( rhos(ir,1), ir=1,grid%mesh )
-!
-!  if present reads the core charge
-!
-      if ( nlcc ) then 
-         read( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-                               ( rhoc(ir), ir=1,grid%mesh )
-      else
-         rhoc = 0.0_dp
-      endif
-!
-!    read the pseudo wavefunctions of the atom
-!      
-      read( iunps, '(1p4e19.11)', err=100, iostat=ios ) &
-                   ((phis(ir,nb),ir=1,grid%mesh),nb=1,nwfs)
-100   continue
-      !
-      ! do not stop with error message here: return error code instead
-      !
-      !call errore('read_pseudo_rrkj3','Reading pseudo file', &
-      !                                         abs(ios))
-      close(iunps)
-
-      return
-      end subroutine read_pseudo_rrkj3

Deleted: trunk/espresso/atomic/run_lda_half.f90
===================================================================
--- trunk/espresso/atomic/run_lda_half.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/run_lda_half.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,81 +0,0 @@
-!
-! Copyright (C) 2010 Quantm-Espresso group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine run_lda_half
-  !
-  !   This routine is a driver to correct pseudopotentials with LDA-1/2
-  !   Courtesy of Leonardo Matheus Marion jorge, University of Sao Paolo (Brazil)
-  !   L. G. Ferreira, M. Marques and L. K. Teles, Phys. Rev. B 78 125116 (2008)
-  !---------------------------------------------------------------
-  !
-  use kinds, only : dp
-  use io_global, only : ionode, ionode_id, stdout
-  use mp,        only : mp_bcast
-  use radial_grids
-  use ld1_parameters, only : nwfx
-  use ld1inc,    only : file_tests, prefix, nconf, rel, etot0, &
-                    nbeta, grid, psi, pseudotype, els, zed, bmat, &
-                    rcut, rcutus, rcutts, rcutusts,  etot, etots0, etots, &
-                    nwf, lls, ikk, betas, ll, file_potscf, oc, el, &
-                    nwfts, nnts, llts, jjts, iswts, octs, elts, nstoaets, &
-                    nwftsc, nntsc, lltsc, jjtsc, iswtsc, octsc, eltsc,nstoaec, &
-                    file_wavefunctions, file_logder, file_pseudopw, &
-                    file_wavefunctionsps, file_logderps, vpot, vpsloc, rcutv
-  implicit none
-
-  integer  &
-       n, &  ! counter on wavefunctions
-       n1,&  ! counter on mesh points
-       ir,&  ! counter on mesh points
-       im,&  ! position of the maximum
-       nc,&  ! counter on configurations
-       nb    ! counter on betas
-  integer   ::      &
-       nn_old(nwfx), ll_old(nwfx), nwf_old, isw_old(nwfx), lsd_old
-  real(DP) ::              &
-       jj_old(nwfx), oc_old(nwfx), enl_old(nwfx), psi_old(ndmx,2,nwfx), beta2, f
-  logical ::  &
-       core_state_old(nwfx)
-  integer :: ios, ncut
-  character(len=1) :: nch
-  real(DP) :: dum, wrcutv
-  real(DP) :: dvpot(ndmx,2)
-!  file_tests = trim(prefix)//'.test'
-!  if (ionode) &
-!     open(unit=13, file=file_tests, iostat=ios, err=1111, status='unknown')
-!1111 call mp_bcast(ios, ionode_id)
-!     call errore('ld1_setup','opening file_tests',abs(ios))
-
-  do nc=1,nconf
-     write (nch, '(i1)') nc 
-     nwfts=nwftsc(nc)
-     call set_conf(nc)
-     call all_electron(.true.,nc)
-     !
-     if (nc.eq.1) then
-        dvpot = vpot
-     elseif (nc .eq. 2) then 
-        dvpot = dvpot - vpot
-     endif
-  enddo
-  ncut = 8
-  do ir=1, grid%mesh
-     if (grid%r(ir).le.rcutv) then
-        wrcutv = (1.0_dp - (grid%r(ir)/rcutv)**ncut)**3
-        dvpot(ir,1) = dvpot(ir,1)*wrcutv
-        vpsloc(ir) = vpsloc(ir) - dvpot(ir,1)
-     endif
-  enddo
-!
-! re-call set conf to write in the pseudo file the Valence
-! config without LDA-1/2
-!
-  call set_conf(1)
-  return
-end subroutine run_lda_half

Deleted: trunk/espresso/atomic/run_pseudo.f90
===================================================================
--- trunk/espresso/atomic/run_pseudo.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/run_pseudo.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,189 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine run_pseudo
-  !---------------------------------------------------------------
-  !
-  !     this routine is a driver to a pseudopotential calculation
-  !     with the parameters given in input
-  !
-  !
-  use kinds, only : dp
-  use radial_grids, only : ndmx
-  use ld1_parameters, only : nwfsx
-  use ld1inc, only : enl, lpaw, nlcc, lsd, latt, pawsetup, &
-                     nstoaets, grid, nspin, iter, rhos, rhoc, &
-                     nwfts, enlts, llts, jjts, iswts, octs, phits, &
-                     vxt, enne, vh, vpsloc, file_potscf, beta, tr2,  &
-                     eps0, file_recon, deld, vpstot, nbeta, ddd, etots, &
-                     paw_energy, iswitch, lgipaw_reconstruction, use_paw_as_gipaw
-  use atomic_paw, only : new_paw_hamiltonian
-  implicit none
-
-  integer :: &
-       ns, &    ! counter on pseudowavefunctions
-       n,  &    ! counter on mesh
-       is       ! counter on spin
-
-  real(DP) :: &
-       vnew(ndmx,2)   ! the potential
-
-  integer :: &
-       ios
-
-  logical :: &
-       conv       ! if true convergence reached
-
-  real(DP) :: &
-       dddnew(nwfsx,nwfsx,2),   & ! the new D coefficients
-       vd(2*(ndmx+nwfsx+nwfsx)), & ! Vloc and D in one array for mixing
-       vdnew(2*(ndmx+nwfsx+nwfsx)) ! the new vd array
-  integer :: &
-       nerr                       ! error message 
-
-  real(DP), parameter :: thresh=1.e-10_dp
-  integer, parameter :: itmax=200
-  character(len=256) :: nomefile
-
-  !
-  !     initial estimate of the eigenvalues
-  !
-  do ns=1,nwfts
-     enlts(ns)=enl(nstoaets(ns))
-  enddo
-  !
-  !    compute an initial estimate of the potential
-  !
-  call guess_initial_wfc()
-  if (.not.lpaw) then
-     call start_potps ( )
-  else
-     CALL new_paw_hamiltonian (vpstot, ddd, etots,pawsetup, nwfts, &
-                               llts, jjts, nspin, iswts, octs, phits, enlts)
-     do is=1,nspin
-        vpstot(1:grid%mesh,is)=vpstot(1:grid%mesh,is)-pawsetup%psloc(1:grid%mesh)
-     enddo
-     call vdpack (grid%mesh, ndmx, nbeta, nwfsx, nspin, vpstot, ddd, vd, "PACK")
-     do is=1,nspin
-        vpstot(1:grid%mesh,is)=vpstot(1:grid%mesh,is)+pawsetup%psloc(1:grid%mesh)
-     enddo
-  endif
-  !
-  !     iterate to self-consistency
-  !
-  do iter=1,itmax
-     call ascheqps_drv(vpstot, nspin, thresh, .false., nerr)
-
-     if (.not.lpaw) then
-        !
-        call chargeps(rhos,phits,nwfts,llts,jjts,octs,iswts)
-        call new_potential(ndmx,grid%mesh,grid,0.0_dp,vxt,lsd,&
-             nlcc,latt,enne,rhoc,rhos,vh,vnew,1)
-
-        do is=1,nspin
-           vpstot(:,is)=vpstot(:,is)-vpsloc(:)
-        enddo
-
-        if (file_potscf.ne.' ') then
-           if (iter<10) then
-              write(nomefile,'(a,"_",i1)') trim(file_potscf), iter
-           elseif(iter<100) then
-              write(nomefile,'(a,"_",i2)') trim(file_potscf), iter
-           elseif(iter<1000) then
-              write(nomefile,'(a,"_",i3)') trim(file_potscf), iter
-           else
-              call errore('run_pseudo','problem with iteration',1)
-           endif
-           open(unit=18,file=trim(nomefile), status='unknown', &
-                                             err=100, iostat=ios)
-100        call errore('run_pseudo','opening file' // nomefile,abs(ios))
-           if (lsd==1) then
-              do n=1,grid%mesh
-                 write(18,'(5e20.12)') grid%r(n),vnew(n,1)-vpstot(n,1), &
-                         vnew(n,1), vnew(n,2)-vpstot(n,2), vnew(n,2)
-              enddo
-           else
-              do n=1,grid%mesh
-                 write(18,'(3e26.15)') grid%r(n),vnew(n,1)-vpstot(n,1), &
-                          vnew(n,1)
-              enddo
-           endif
-           close(18)
-        endif
-
-        call vpack(grid%mesh,ndmx,nspin,vnew,vpstot,1)
-        call dmixp(grid%mesh*nspin,vnew,vpstot,beta,tr2,iter,3,eps0,conv,itmax)
-        call vpack(grid%mesh,ndmx,nspin,vnew,vpstot,-1)
-
-        do is=1,nspin
-           do n=1,grid%mesh
-              vpstot(n,is)=vpstot(n,is)+vpsloc(n)
-           enddo
-        enddo
-        call newd_at
-        !
-     else
-        !
-        call new_paw_hamiltonian (vnew, dddnew, etots, &
-             pawsetup, nwfts, llts, jjts, nspin, iswts, octs, phits, enlts)
-        do is=1,nspin
-           vnew(1:grid%mesh,is)=vnew(1:grid%mesh,is)-pawsetup%psloc(1:grid%mesh)
-        enddo
-        call vdpack (grid%mesh, ndmx, nbeta, nwfsx, nspin, vnew, dddnew, vdnew, "PACK")
-        call dmixp((grid%mesh+nbeta*nbeta)*nspin,vdnew,vd,beta,tr2,iter,3,eps0,conv,itmax)
-        call vdpack (grid%mesh, ndmx, nbeta, nwfsx, nspin, vpstot, ddd, vd, "UNDO")
-        do is=1,nspin
-           vpstot(1:grid%mesh,is)=vpstot(1:grid%mesh,is)+pawsetup%psloc(1:grid%mesh)
-        enddo
-        !
-     endif
-
-!            write(6,*) 'iteration number',iter, eps0
-     if (conv) then
-        if (nerr /= 0) then
-           if (iswitch==2) then
-              call infomsg ('run_pseudo','Errors in PS-KS equations')
-           else
-              call errore ('run_pseudo','Errors in PS-KS equation', 1)
-           endif
-        endif
-        goto 900
-     endif
-  enddo
-  call infomsg('run_pseudo','convergence not achieved')
-  !
-  !    final calculation with all states
-  !
-900 continue
-
-  call ascheqps_drv(vpstot, nspin, thresh, .true., nerr)
-
-  if (.not.lpaw) then
-     call elsdps ( )
-  else
-     call new_paw_hamiltonian (vnew, dddnew, etots, pawsetup, nwfts, &
-                llts, jjts, nspin, iswts, octs, phits, enlts, paw_energy)
-     call elsdps_paw()
-  endif
-
-  IF ( lgipaw_reconstruction.and.(.not.use_paw_as_gipaw) ) CALL calculate_gipaw_orbitals()
-  
-  if (file_recon.ne.' ')  call write_paw_recon ( )
-
-  !
-  !    compute logarithmic derivatives
-  !
-  if ( deld > 0.0_dp) call lderivps ( )
-  !
-  !    compute expansion in partial waves 
-  !
-  if ( deld > 0.0_dp) call partial_wave_expansion ( )
-
-  return
-end subroutine run_pseudo

Deleted: trunk/espresso/atomic/run_test.f90
===================================================================
--- trunk/espresso/atomic/run_test.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/run_test.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,275 +0,0 @@
-!
-! Copyright (C) 2004-2008 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-SUBROUTINE run_test
-  !
-  !   This routine is a driver to the tests of the pseudopotential
-  !---------------------------------------------------------------
-  !
-  use kinds, only : dp
-  use io_global, only : ionode, ionode_id
-  use mp,        only : mp_bcast
-  use radial_grids, only : ndmx
-  use ld1_parameters, only : nwfx
-  use ld1inc,    only : file_tests, prefix, nconf, rel, etot0, &
-                    nbeta, grid, psi, pseudotype, els, zed, &
-                    rcut, rcutus, rcutts, rcutusts,  etot, etots0, etots, &
-                    nwf,         ll,                oc, el, &
-                    nwfts, nnts, llts, jjts, iswts, octs, elts, nstoaets, &
-                    nwftsc, nntsc, lltsc, jjtsc, iswtsc, octsc, eltsc,nstoaec, &
-                    file_wavefunctions, file_logder, &
-                    file_wavefunctionsps, file_logderps, &
-                    core_state, use_paw_as_gipaw !EMINE
-  implicit none
-
-  integer  &
-       n, &  ! counter on wavefunctions
-       n1,&  ! counter on mesh points
-       ir,&  ! counter on mesh points
-       im,&  ! position of the maximum
-       nc    ! counter on configurations
-  integer   ::      &
-       nn_old(nwfx), ll_old(nwfx), nwf_old, isw_old(nwfx), lsd_old
-  real(DP) ::              &
-       jj_old(nwfx), oc_old(nwfx), enl_old(nwfx), psi_old(ndmx,2,nwfx)
-  logical ::  &
-       core_state_old(nwfx)
-  integer :: ios
-  character(len=1) :: nch
-  real(DP) :: dum
-
-  file_tests = trim(prefix)//'.test'
-  if (ionode) &
-     open(unit=13, file=file_tests, iostat=ios, err=1111, status='unknown')
-1111 call mp_bcast(ios, ionode_id)
-     call errore('ld1_setup','opening file_tests',abs(ios))
-
-  do nc=1,nconf
-     if (nconf == 1) then
-        file_wavefunctions  = trim(prefix)//'.wfc'
-        file_wavefunctionsps= trim(prefix)//'ps.wfc'
-        file_logder   = trim(prefix)//'.dlog'
-        file_logderps = trim(prefix)//'ps.dlog'
-     else
-        if (nc < 10) then
-           write (nch, '(i1)') nc 
-        else
-           nch='0'
-           call errore ('run_test', &
-                'results for some configs not written to file',-1)
-        endif
-        file_wavefunctions  = trim(prefix)//nch//'.wfc'
-        file_wavefunctionsps= trim(prefix)//nch//'ps.wfc'
-        file_logder   = trim(prefix)//nch//'.dlog'
-        file_logderps = trim(prefix)//nch//'ps.dlog'
-     endif
-     nwfts=nwftsc(nc)
-     if (nc>1) call save_ae(nwf_old,nn_old,ll_old,jj_old,enl_old,   &
-                            oc_old,isw_old, core_state_old,psi_old,lsd_old,-1)
-     !EMINE
-     core_state_old = core_state
-     call set_conf(nc)
-     call all_electron(.true.,nc)
-     if (nc.eq.1) then
-         etot0=etot
-         call save_ae(nwf_old,nn_old,ll_old,jj_old,enl_old,oc_old,isw_old, &
-                core_state_old,psi_old,lsd_old,1)
-     endif
-     !
-     !   choose the cut-off radius for the initial estimate of the wavefunctions
-     !   find the maximum of the all electron wavefunction
-     !
-     do n=1,nwfts
-        do n1=1,nbeta
-           if (els(n1).eq.elts(n).and.(rcut(n1).gt.1.e-3_dp.or.&
-                                      rcutus(n1)>1.e-3_DP)) then
-              rcutts(n)=rcut(n1)
-              rcutusts(n)=rcutus(n1)
-              goto 20
-           endif
-        enddo
-        dum=0.0_dp
-        im=2
-        do ir=1,grid%mesh-1
-           dum=abs(psi(ir+1,1,nstoaets(n)))
-           if(dum.gt.abs(psi(ir,1,nstoaets(n)))) im=ir+1
-        enddo
-        if (pseudotype.lt.3) then
-           rcutts(n)=grid%r(im)*1.1_dp
-           rcutusts(n)=grid%r(im)*1.1_dp
-           if (el(nstoaets(n))=='6S'.or.el(nstoaets(n))=='5S') then
-              rcutts(n)=grid%r(im)*1.2_dp
-              rcutusts(n)=grid%r(im)*1.2_dp
-           endif
-        else
-           if (ll(nstoaets(n)).eq.0) then
-              rcutts(n)=grid%r(im)*1.6_dp
-              rcutusts(n)=grid%r(im)*1.7_dp
-           elseif (ll(nstoaets(n)).eq.1) then
-              rcutts(n)=grid%r(im)*1.6_dp
-              rcutusts(n)=grid%r(im)*1.7_dp
-              if (el(nstoaets(n)).eq.'2P') then
-                 rcutts(n)=grid%r(im)*1.7_dp
-                 rcutusts(n)=grid%r(im)*1.8_dp
-              endif
-           elseif (ll(nstoaets(n)).eq.2) then
-              rcutts(n)=grid%r(im)*2.0_dp
-              rcutusts(n)=grid%r(im)*2.2_dp
-              if (el(nstoaets(n)).eq.'3D') then
-                 rcutts(n)=grid%r(im)*2.5_dp
-                 if (zed>28) then
-                    rcutusts(n)=grid%r(im)*3.4_dp
-                 else
-                    rcutusts(n)=grid%r(im)*3.0_dp
-                 endif
-              endif
-           endif
-        endif
-20   continue
-!     write(6,*) n, rcutts(n), rcutusts(n)
-     enddo
-     !
-     !   and run the pseudopotential test
-     !
-     call run_pseudo
-     !
-     if (nc.eq.1) etots0=etots
-     !
-     !   print results
-     !
-     call write_resultsps 
-     !
-     call test_bessel ( )
-     !
-  enddo
-  if (ionode) close (unit = 13)  
-
-  !EMINE
-  if(use_paw_as_gipaw)core_state = core_state_old
-
-END SUBROUTINE run_test
-
-
-SUBROUTINE save_ae(nwf_old,nn_old,ll_old,jj_old,enl_old,oc_old,isw_old, &
-               core_state_old,psi_old,lsd_old,iflag)
-!
-! This routine saves the all-electron configuration, or copy it in the
-! all-electron variables 
-
-use kinds, only : dp
-use ld1_parameters, only : nwfx
-use radial_grids, only : ndmx
-use ld1inc, only : nwf, nn, ll, jj, enl, oc, isw, core_state, psi, lsd
-implicit none
-integer, intent(in) :: iflag
-integer   ::      &
-       nn_old(nwfx),   &   ! the main quantum number
-       ll_old(nwfx),   &   ! the orbital angular momentum
-       nwf_old,        &   ! the number of wavefunctions
-       lsd_old,        &   ! if 1 the calculation has spin
-       isw_old(nwfx)       ! spin of the wfc. if(.not.lsd) all 1 (default)
-
-real(DP) ::              &
-       jj_old(nwfx),     & ! the total angular momentum
-       oc_old(nwfx),     & ! the occupations of the all-electron atom
-       enl_old(nwfx),        & ! the energies of the all-electron atom
-       psi_old(ndmx,2,nwfx)    ! the all-electron (dirac) wavefunctions
-
-logical ::   &
-       core_state_old(nwfx) 
-
-if (iflag==1) then
-   nwf_old=nwf
-   lsd_old=lsd
-   nn_old=nn
-   ll_old=ll
-   jj_old=jj
-   oc_old=oc
-   isw_old=isw
-   enl_old=enl
-   psi_old=psi
-else
-   nwf=nwf_old
-   lsd=lsd_old
-   nn=nn_old
-   ll=ll_old
-   jj=jj_old
-   oc=oc_old
-   isw=isw_old
-   enl=enl_old
-   psi=psi_old
-endif
-
-END SUBROUTINE save_ae
-
-
-SUBROUTINE set_conf(nc)
-!
-!  This routine copy the variables of the current configuration in the
-!  test variables. If we pass from a non-spin polarized to a spin
-!  polarized calculation it splits the occupations of the all-electron states.
-!
-use ld1_parameters, only : nwfx
-use ld1inc, only : nwf, nn, ll, oc, isw, el, enl, psi, nstoaets, nwftsc,  &
-                   core_state, lsdts, eltsc, iswtsc, nnts, llts, jjts,   &
-                   octs, elts, iswts, nntsc, lltsc, jjtsc, octsc, &
-                   jj, frozen_core, lsd, nwfts, nspin
-implicit none
-integer, intent(in) :: nc
-integer :: n, n1
-
-if (lsdts(nc)==1) then
-   if (frozen_core.and.nc>1) then
-      call occ_spin_tot(nwf,nwfx,el,nn,ll,oc,isw,enl,psi)
-   else
-      call occ_spin(nwf,nwfx,el,nn,ll,oc,isw)
-   endif 
-   lsd=1
-   nspin=2
-else
-   lsd=0
-   nspin=1
-endif
-
-do n=1,nwf
-   core_state(n)=.true.
-enddo
-do n=1,nwftsc(nc)
-   nstoaets(n)=0
-   do n1=1,nwf
-      if (lsdts(nc).eq.1) then
-         if (eltsc(n,nc).eq.el(n1) &
-                    .and.iswtsc(n,nc).eq.isw(n1)) then
-            nstoaets(n)=n1
-            core_state(n1)=.false.
-         endif
-      else
-         if (eltsc(n,nc).eq.el(n1).and.jjtsc(n,nc).eq.jj(n1)) then
-            nstoaets(n)=n1
-            core_state(n1)=.false.
-         endif
-      endif
-   enddo
-   if (nstoaets(n).eq.0) call errore('set_conf', &
-                'all electron wfc corresponding to pseudo-state ' &
-          &     //eltsc(n,nc)//' not found',nc)
-enddo
-
-do n=1,nwfts
-   nnts(n)=nntsc(n,nc)
-   llts(n)=lltsc(n,nc)
-   elts(n)=eltsc(n,nc)
-   jjts(n)=jjtsc(n,nc)
-   iswts(n)=iswtsc(n,nc)
-   octs(n)=octsc(n,nc)
-   oc(nstoaets(n))=octs(n)
-enddo
-
-END SUBROUTINE set_conf
-

Deleted: trunk/espresso/atomic/scf.f90
===================================================================
--- trunk/espresso/atomic/scf.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/scf.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,141 +0,0 @@
-!
-! Copyright (C) 2004i-2010 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!---------------------------------------------------------------
-SUBROUTINE scf(ic)
-  !---------------------------------------------------------------
-  !
-  !   this routine performs the atomic self-consistent procedure
-  !   self-interaction-correction allowed
-  !
-  USE kinds, ONLY : dp
-  USE funct, ONLY : dft_is_meta
-  USE radial_grids, ONLY : ndmx
-  USE constants, ONLY: e2
-  USE ld1inc, ONLY : grid, zed, psi, isic, vpot, vh, vxt, rho, iter, &
-                     lsd, rel, latt, enne, beta, nspin, tr2, eps0, &
-                     nwf, nn, ll, jj, enl, oc, isw, core_state, frozen_core, &
-                     tau, vtau, vsic, vsicnew, vhn1, egc, relpert, noscf
-  IMPLICIT NONE
-
-  INTEGER, INTENT(in) :: ic
-
-  LOGICAL:: meta, conv
-  INTEGER:: nerr, nstop, n, i, is, id, nin
-  real(DP) ::  vnew(ndmx,2), vtaunew(ndmx), rhoc1(ndmx), ze2
-  INTEGER, PARAMETER :: maxter=200
-  real(DP), PARAMETER :: thresh=1.0e-10_dp
-  !
-  !
-  meta = dft_is_meta() 
-  ze2 = - zed * e2
-  rhoc1=0.0_dp
-  IF (.not.frozen_core.or.ic==1) psi=0.0_dp
-  DO iter=1,maxter
-     nerr=0
-     vnew=vpot
-     vtaunew=vtau
-     DO n=1,nwf
-        IF (oc(n) >= 0.0_dp) THEN
-           IF (ic==1.or..not.frozen_core.or..not.core_state(n)) THEN
-              is=isw(n)
-              IF (isic /= 0 .and. iter > 1) vnew(:,is)=vpot(:,is)-vsic(:,n)
-              IF (rel == 0) THEN
-                 IF ( meta ) THEN
-                    CALL lschps_meta (2, zed, thresh, grid, nin, nn(n), ll(n),&
-                         enl(n), vnew(1,is), vtaunew, psi(1,1,n), nstop)
-                 ELSE
-                    CALL ascheq (nn(n),ll(n),enl(n),grid%mesh,grid,vnew(1,is),&
-                      ze2,thresh,psi(1,1,n),nstop)
-                 END IF
-              ELSEIF (rel == 1) THEN
-                 IF ( meta ) THEN
-                    CALL lschps_meta (1, zed, thresh, grid, nin, nn(n), ll(n),&
-                         enl(n), vnew(1,is), vtaunew, psi(1,1,n), nstop)
-                 ELSE
-                    CALL lschps (1, zed, thresh, grid, nin, nn(n), ll(n),&
-                         enl(n), vnew(1,is), psi(1,1,n), nstop)
-                 END IF
-                 IF (nstop>0.and.oc(n)<1.e-10_DP) nstop=0
-              ELSEIF (rel == 2) THEN
-                 CALL dirsol (ndmx,grid%mesh,nn(n),ll(n),jj(n),iter,enl(n), &
-                      thresh,grid,psi(1,1,n),vnew(1,is),nstop)
-              ELSE
-                 CALL errore('scf','relativistic not programmed',1)
-              ENDIF
-              !      write(6,*) nn(n),ll(n),enl(n)
-              ! if (nstop /= 0) write(6,'(4i6)') iter,nn(n),ll(n),nstop
-              nerr=nerr+nstop
-           ENDIF
-        ELSE
-           enl(n)=0.0_dp
-           psi(:,:,n)=0.0_dp
-        ENDIF
-     ENDDO
-     !
-     ! calculate charge density (spherical approximation)
-     !
-     rho=0.0_dp
-     IF (noscf) GOTO 500
-     DO n=1,nwf
-        DO i=1,grid%mesh
-           rho(i,isw(n))=rho(i,isw(n))+oc(n)*(psi(i,1,n)**2+psi(i,2,n)**2)
-        ENDDO
-     ENDDO
-     !
-     ! calculate kinetc energy density (spherical approximation)
-     !
-     IF ( meta ) CALL kin_e_density (ndmx, grid%mesh, nwf, &
-         ll, oc, psi, grid%r, grid%r2, grid%dx, tau)
-     !
-     ! calculate new potential
-     !
-     CALL new_potential ( ndmx, grid%mesh, grid, zed, vxt, &
-          lsd, .false., latt, enne, rhoc1, rho, vh, vnew, 1 )
-     !
-     ! calculate SIC correction potential (if present)
-     !
-     IF (isic /= 0) THEN
-        DO n=1,nwf
-           IF (oc(n) >= 0.0_dp) THEN
-              is=isw(n)
-              CALL sic_correction(n,vhn1,vsicnew,egc)
-              !
-              ! use simple mixing for SIC correction
-              !
-              vsic(:,n) = (1.0_dp-beta)*vsic(:,n)+beta*vsicnew(:)
-           ENDIF
-        ENDDO
-     ENDIF
-     !
-     ! mix old and new potential
-     !
-     id=3
-     IF (isic /= 0 .and. relpert)  id=1
-     !
-     CALL vpack(grid%mesh,ndmx,nspin,vnew,vpot,1)
-     CALL dmixp(grid%mesh*nspin,vnew,vpot,beta,tr2,iter,id,eps0,conv,maxter)
-     CALL vpack(grid%mesh,ndmx,nspin,vnew,vpot,-1)
-!        write(6,*) iter, eps0
-     !
-     ! mix old and new metaGGA potential - use simple mixing
-     !
-     IF ( meta ) vtau(:) = (1.0_dp-beta)*vtaunew(:)+beta*vtau(:)
-     !
-500  IF (noscf) THEN
-        conv=.true.
-        eps0=0.0_DP
-     ENDIF
-     IF (conv) THEN
-        IF (nerr /= 0) CALL infomsg ('scf','warning: at least one error in KS equations')
-        GOTO 45
-     ENDIF
-  ENDDO
-  CALL infomsg('scf','warning: convergence not achieved')
-45 RETURN
-
-END SUBROUTINE scf

Deleted: trunk/espresso/atomic/seriebes.f90
===================================================================
--- trunk/espresso/atomic/seriebes.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/seriebes.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,38 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-subroutine seriesbes(fun,r,r2,npt,xc)
-  !
-  !     assume that the input function has the form xc(1)
-  !                              +xc(2)*r(n)+xc(3)*r(n)**2
-  !     and finds the two coefficients. works with KKR3 beta functions
-  !
-  use kinds, only : DP
-  implicit none
-  integer :: &
-       npt,  &        ! the number of points  
-       npt2          ! intermediate point
-
-  real(DP) :: &
-       fun(npt),   &  ! the function
-       r(npt),     &  ! the mesh     
-       r2(npt),    &  ! the mesh     
-       xc(4)         ! the coefficients
-
-  if (npt.lt.3) call errore('seriesbes','at least 3 points',1)
-  npt2=npt/2+1
-
-  !      xc(1)=0.5_dp*(fun(1)-xc(3)*r2(1)+fun(npt)-xc(3)*r2(npt))
-
-  xc(3)=((fun(1)-fun(npt2))/(r(1)-r(npt2)) &
-       -(fun(npt)-fun(npt2))/(r(npt)-r(npt2)) )/ ( r(1)-r(npt) )
-  xc(1)=fun(1)
-  xc(2)=( fun(npt)-fun(npt2) ) / (r(npt)-r(npt2)) -xc(3)*(r(npt)+ &
-       r(npt2) )
-  xc(4)=0.0_dp
-  return
-end subroutine seriesbes

Deleted: trunk/espresso/atomic/set_psi_in.f90
===================================================================
--- trunk/espresso/atomic/set_psi_in.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/set_psi_in.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,58 +0,0 @@
-!
-! Copyright (C) 2010 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-
-SUBROUTINE set_psi_in(ik,l,j,e,psi_out,psi_out_rel)
-  !
-  !  This subroutine calculates the all electron wavefunction psi at the
-  !  input energy e
-  !
-  USE kinds, ONLY : dp
-  USE radial_grids, ONLY : ndmx
-  USE ld1inc, ONLY : grid, rel, zed, vpot
-  IMPLICIT NONE
-  INTEGER :: l, ik    ! input: angular momentum and index of the cut-off radius
-  REAL(DP) :: e, j    ! input: energy and total angular momentum
-  REAL(DP) :: psi_out(ndmx) ! output: the function psi.
-  REAL(DP) :: psi_out_rel(ndmx) ! output: the function psi (small component).
-  REAL(DP) :: psi_dir(ndmx,2) ! auxiliary function.
-  REAL(DP) :: ze2, jnor, thrdum=0.0_dp
-  INTEGER  :: n, nstop
-
-  psi_out_rel=0.0_DP
-  IF (rel == 1) THEN
-     n =  grid%mesh
-     CALL lschps (3, zed, thrdum, grid, n, 1, l, e, vpot, psi_out, nstop )
-  ELSEIF (rel == 2) THEN
-     CALL dir_outward (ndmx, grid%mesh, l, j, e, grid%dx, psi_dir, &
-          grid%r, grid%rab, vpot )
-     psi_out(:)=psi_dir(:,1)
-     psi_out_rel(:)=psi_dir(:,2)
-  ELSE
-     ze2=-zed*2.0_dp
-     CALL intref(l,e,grid%mesh,grid,vpot,ze2,psi_out)
-  ENDIF
-  !
-  !    fix arbitrarily the norm at the cut-off radius equal to (about) 0.5**2
-  !
-  jnor=0.0_dp
-  DO n=1,ik
-     jnor = jnor + grid%dx*grid%r(n)*psi_out(n)**2
-  ENDDO
-  jnor = sqrt(jnor)
-  DO n=1,grid%mesh
-     psi_out(n)=psi_out(n)*0.5_dp/jnor
-  ENDDO
-  IF (rel==2) THEN
-     DO n=1,grid%mesh
-        psi_out_rel(n)=psi_out_rel(n)*0.5_dp/jnor
-     ENDDO
-  ENDIF
-
-  RETURN
-END SUBROUTINE set_psi_in
-

Deleted: trunk/espresso/atomic/set_rc_rv.f90
===================================================================
--- trunk/espresso/atomic/set_rc_rv.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/set_rc_rv.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,52 +0,0 @@
-!
-! Copyright (C) 2007 Quantum ESPRESSO group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!-----------------------------------------------------------------------
-subroutine set_rc_rv()
-  !-----------------------------------------------------------------------
-  !
-  !      input : all-electron wavefunctions + valence states
-  !      output: separated core and valence charges 
-  !
-  use kinds, only : dp
-  use ld1_parameters, only : nwfx
-  
-  use ld1inc, only : grid, aeccharge, aevcharge, nwf, oc, isw, rel, psi, &
-                     core_state
-  implicit none
-
-  integer :: n, ns, is
-  !
-  !      calculates core charge density
-  !
-  aevcharge=0.0_DP
-  aeccharge=0.0_DP
-  do n=1,grid%mesh
-     do ns=1,nwf
-        if (oc(ns)>0.0_DP) then
-           is=isw(ns)
-           if (rel==2) then
-              if (core_state(ns)) then
-                 aeccharge(n)=aeccharge(n) &
-                              +oc(ns)*( psi(n,1,ns)**2 + psi(n,2,ns)**2 )
-              else
-                 aevcharge(n,is)=aevcharge(n,is)+oc(ns)*(psi(n,1,ns)**2 &
-                                                       + psi(n,2,ns)**2)
-              endif
-           else
-              if (core_state(ns)) then
-                 aeccharge(n) = aeccharge(n) + oc(ns)*psi(n,1,ns)**2
-              else
-                 aevcharge(n,is) = aevcharge(n,is) + oc(ns)*psi(n,1,ns)**2
-              endif
-           endif
-        endif
-     enddo
-  enddo
-  return
-end subroutine set_rc_rv

Deleted: trunk/espresso/atomic/set_rho_core.f90
===================================================================
--- trunk/espresso/atomic/set_rho_core.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/set_rho_core.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,184 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!-----------------------------------------------------------------------
-subroutine set_rho_core
-  !-----------------------------------------------------------------------
-  !
-  !      input : all-electron wavefunctions + valence states
-  !      output: smoothed core charge for r > rcore
-  !
-  use kinds, only : dp
-  use constants, only : pi
-  use io_global, only : stdout, ionode, ionode_id
-  use mp,        only : mp_bcast
-  use ld1inc, only : nlcc, grid, rhoc, aeccharge, psccharge, rcore, &
-                     nwf, oc, rel, core_state, psi, file_core, new_core_ps,&
-                     lpaw, lnc2paw
-  implicit none
-
-  real(DP) :: drho, const, br1, br2, &
-       eps1, eps2, br12, xc(8), a, b, eps12, totrho
-  real(DP), allocatable:: rhov(:)
-  real(DP), external :: int_0_inf_dr
-  integer :: i, ik, n, ns, ios
-
-  if (nlcc) then
-     write(stdout,'(/,5x,'' Computing core charge for nlcc: '')')
-  else
-     if (lpaw) write(stdout,'(/,5x,'' Computing core charge for PAW: '')')
-  end if
-  allocate (rhov(grid%mesh))
-  !
-  !      calculates core charge density
-  !
-  do n=1,grid%mesh
-     rhov(n) = 0.0_dp
-     rhoc(n) = 0.0_dp
-     do ns=1,nwf
-        if (rel==2) then
-           if (core_state(ns)) then
-              rhoc(n)=rhoc(n)+oc(ns)*(psi(n,1,ns)**2+psi(n,2,ns)**2)
-           else
-              rhov(n)=rhov(n)+oc(ns)*(psi(n,1,ns)**2+psi(n,2,ns)**2)
-           endif
-        else
-           if (core_state(ns)) then
-              rhoc(n) = rhoc(n) + oc(ns)*psi(n,1,ns)**2
-           else
-              rhov(n) = rhov(n) + oc(ns)*psi(n,1,ns)**2
-           endif
-        endif
-     enddo
-  enddo
-  totrho = int_0_inf_dr(rhoc,grid,grid%mesh,2)
-  if (totrho<1.d-6.and.lpaw) then
-!
-!  All valence charge for this atom (mainly for H)
-!
-     aeccharge(1:grid%mesh) = 0.0_DP
-     psccharge(1:grid%mesh) = 0.0_DP
-     goto 1100
-  endif
-
-!  write(stdout,'("Integrated core charge",f15.10)') totrho
-  aeccharge(1:grid%mesh) = rhoc(1:grid%mesh)
-  !
-  if (rcore > 0.0_dp) then
-     !      rcore read on input
-     do ik=1,grid%mesh
-        if (grid%r(ik) > rcore) go to 100
-     enddo
-     call infomsg('set_rho_core','rcore too big')
-     return
-  else
-     !      rcore determined by the condition  rhoc(rcore) = 2*rhov(rcore)
-     do ik=1,grid%mesh
-        if (rhoc(ik) < 2.0 * rhov(ik)) go to 100
-     enddo
-  end if
-100 rcore=grid%r(ik)
-  drho = ( rhoc(ik+1)/grid%r2(ik+1) - rhoc(ik)/grid%r2(ik) ) / grid%dx / grid%r(ik)
-  !
-  !   true_rho = rhoc(r)/r**2/4 pi
-  !      (factor 1/r from logarithmic mesh)
-  !   smoothened core charge density for nonlinear core correction:
-  !      rhoc(r) = core charge        for r > rcore
-  !      rhoc(r) = r^2 a sin(b r)/r   for r < rcore
-  !
-  if (new_core_ps) then
-     call compute_phius(1,ik,aeccharge,rhoc,xc,0,'  ')
-  else
-     if (drho > 0.0_dp) then
-        call infomsg('set_rho_core','d rho/ d r > 0')
-        return
-     endif
-     const= grid%r(ik)*drho / ( rhoc(ik)/grid%r2(ik) ) + 1.0_dp
-     if (const > 0.0_dp) then
-        br1 = 0.00001_dp
-        br2 = pi/2.0_dp-0.00001_dp
-     else
-        br1 = pi/2.0_dp+0.00001_dp
-        br2 = pi
-     end if
-     do n=1, 15
-        eps1 = br1 - const*tan(br1)
-        eps2 = br2 - const*tan(br2)
-        br12 = (br1+br2)/2.0_dp
-        eps12 = br12 - const*tan(br12)
-        if(eps1*eps12 < 0.0_dp) then
-           br2 = br12
-        else if(eps12*eps2 < 0.0_dp) then
-           br1 = br12
-        else
-           call errore('set_rho_core','error in bisection',n)
-        end if
-     end do
-     b = br12/grid%r(ik)
-     a = ( rhoc(ik)/grid%r2(ik) ) * grid%r(ik)/sin(br12)
-     do n=1,ik
-        rhoc(n) = a*sin(b*grid%r(n))/grid%r(n) * grid%r2(n)
-     end do
-  endif
-  if (lpaw) then
-     if (lnc2paw) then
-        ! Mimic NC calculation. If NLCC, the pseudized core charge.
-        if (nlcc) then
-           aeccharge(1:grid%mesh) = rhoc(1:grid%mesh)
-           ! Here one could set another pseudized ccharge, for
-           ! example with a larger matching radius. Right now,
-           ! just take the same as the AE (ie NC) one:
-           psccharge(1:grid%mesh) = rhoc(1:grid%mesh)
-        else
-           ! Reference NC calculation does not have core charge.
-           aeccharge(1:grid%mesh) = 0._dp
-           psccharge(1:grid%mesh) = 0._dp
-        end if
-     else
-!        aeccharge(1:grid%mesh) = rhoc(1:grid%mesh)
-        if (nlcc) then
-           psccharge(1:grid%mesh) = rhoc(1:grid%mesh)
-        else
-           psccharge(1:grid%mesh) = 0._dp
-        end if
-     end if
-  end if
-  write(stdout,'(/,5x,''  r > '',f4.2,'' : true rho core'')') grid%r(ik)
-  if (new_core_ps) then
-     write(stdout,'(6x,"Core charge pseudized with two Bessel functions")')
-  else
-     write(stdout,110) grid%r(ik), a, b
-  endif
-110 format (5x, '  r < ',f4.2,' : rho core = a sin(br)/r', &
-       '    a=',f7.2,'  b=',f7.2/)
-1100 continue
-  if (file_core .ne. ' ') then
-     write(stdout,'(6x, "***Writing file ",a, " ***")') trim(file_core)
-     if (ionode) &
-        open(unit=26,file=file_core, status='unknown', iostat=ios, err=300 )
-300  call mp_bcast(ios, ionode_id)
-     call errore('set_rho_core','opening file '//file_core,abs(ios))
-     if (ionode) then
-        if (totrho>1.d-6) then
-           do n=1,grid%mesh
-              write(26,'(4f20.10)') grid%r(n),rhoc(n),rhov(n),aeccharge(n)
-           enddo
-        else
-           do n=1,grid%mesh
-              write(26,'(2f20.10)') grid%r(n),rhov(n)
-           enddo
-        endif
-        close(26)
-     endif
-  endif
-  totrho = int_0_inf_dr(rhoc,grid,grid%mesh,2)
-  write(stdout,'(6x,''Integrated core pseudo-charge : '',f6.2)')  totrho
-  if (.not.nlcc) rhoc(1:grid%mesh) = 0.0_dp
-  deallocate (rhov)
-  return
-end subroutine set_rho_core

Deleted: trunk/espresso/atomic/set_sl3.f90
===================================================================
--- trunk/espresso/atomic/set_sl3.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/set_sl3.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,47 +0,0 @@
-!-----------------------------------------------------------------------
-subroutine set_sl3(sl3,lmax)
-!-----------------------------------------------------------------------
-   ! compute sl3(l1,l2,l3)=\int pl(x,l1) pl(x,l2) pl(x,l3) dx
-   !
-   use kinds, only: DP
-   implicit none
-   !
-   ! I/O variables
-   !
-   integer :: lmax
-   real (DP) :: sl3(0:2*lmax,0:2*lmax,0:2*lmax)
-   !
-   ! local variables
-   !
-   integer :: lmax2, l1, l2, l3, l1i, l1f
-
-   lmax2 = 2*lmax
-   do l1=0,lmax2
-      do l2=0,lmax2
-         do l3=0,lmax2
-            sl3(l1,l2,l3) = 0.0d0
-         end do
-      end do
-   end do
-
-   do l3=0,lmax2
-      sl3(l3,0,l3) = 2.0d0/(2.0d0*l3+1.0d0)
-      sl3(0,l3,l3) = 2.0d0/(2.0d0*l3+1.0d0)
-      do l2=1,lmax2
-         l1i = max(abs(l2-l3),1)
-         l1f = lmax2-abs(lmax2-l2-l3)
-         if (l1f.eq.lmax2) then
-            sl3(lmax2,l2,l3) = (2.0d0*l2-1.0d0)/(2.0d0*l1f+1.0d0) *  &
-                               l1f*sl3(l1f-1,l2-1,l3)/l2
-            l1f=l1f-1
-         end if
-         do l1=l1i,l1f
-            sl3(l1,l2,l3) = (2.0d0*l2-1.0d0)/(2.0d0*l1+1.0d0) * &
-               ((l1+1.0d0)*sl3(l1+1,l2-1,l3)+l1*sl3(l1-1,l2-1,l3))/l2
-            if (l2.gt.1) sl3(l1,l2,l3) = sl3(l1,l2,l3) -(l2-1.0d0)/l2 * &
-                                        sl3(l1,l2-2,l3)
-         end do
-      end do
-   end do
-   return
-end subroutine set_sl3

Deleted: trunk/espresso/atomic/sic_correction.f90
===================================================================
--- trunk/espresso/atomic/sic_correction.f90	2011-08-23 05:47:59 UTC (rev 8099)
+++ trunk/espresso/atomic/sic_correction.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -1,78 +0,0 @@
-!
-! Copyright (C) 2004 PWSCF group
-! This file is distributed under the terms of the
-! GNU General Public License. See the file `License'
-! in the root directory of the present distribution,
-! or http://www.gnu.org/copyleft/gpl.txt .
-!
-!
-!---------------------------------------------------------------
-subroutine sic_correction(n,vhn1,vhn2,egc) 
-  !---------------------------------------------------------------
-  !   set up the orbital-dependent selfconsistent potential generated
-  !   by the n-th wavefunction - for self-interaction correction
-  !
-  use kinds, only : dp
-  use radial_grids, only : ndmx
-  use constants, only: e2, fpi
-  use ld1inc, only : nspin, lsd, rel, nlcc, rhoc, grid, psi
-  use funct, only: dft_is_gradient, exc_t, vxc_t
-  use radial_grids, only: hartree
-  implicit none
-  integer :: n
-  real(DP):: vhn1(ndmx),vhn2(ndmx), egc(ndmx)
-  REAL(dp) :: & ! compatibility with metaGGA - not yet used
-       tau(ndmx) = 0.0_dp, vtau(ndmx) = 0.0_dp
-  !
-  integer :: i
-  real(DP):: rh(2), rhc, vxcp(2)
-  real(DP):: vgc(ndmx,2),  egc0(ndmx), rhotot(ndmx,2)
-  logical :: gga
-
-  vhn1=0.0_dp
-  vhn2=0.0_dp
-  gga=dft_is_gradient()
-  nspin=1
-  if (lsd.eq.1) nspin=2
-  !
-  !   compute hartree potential with the charge of orbital n
-  !
-  rhotot=0.0_dp
-  if (rel.eq.2) then
-     do i=1,grid%mesh
-        rhotot(i,1)=psi(i,1,n)**2+psi(i,2,n)**2
-     enddo
-  else
-     do i=1,grid%mesh
-        rhotot(i,1)=psi(i,1,n)**2
-     enddo
-  endif
-  !call hartree(0,2*(ll(n)+1),grid%mesh,grid,rhotot,vhn1)
-  call hartree(0,2,grid%mesh,grid,rhotot,vhn1)
-  !
-  !    add exchange and correlation potential: LDA or LSDA terms
-  !
-  rhc=0.0_dp
-  rh=0.0_dp
-  do i=1,grid%mesh
-     vhn1(i) = e2*vhn1(i)
-     rh(1) = rhotot(i,1)/grid%r2(i)/fpi
-     if (nlcc) rhc = rhoc(i)/grid%r2(i)/fpi
-     call vxc_t(rh,rhc,lsd,vxcp)
-     vhn2(i)= vhn1(i)+vxcp(1)
-     egc(i)= exc_t(rh,rhc,lsd)*rhotot(i,1)
-  end do
-
-  if (.not.gga) return
-  !
-  !   add gradient-correction terms to exchange-correlation potential
-  !
-  egc0=egc
-  call vxcgc ( ndmx, grid%mesh, nspin, grid%r, grid%r2, rhotot, rhoc, &
-       vgc, egc, tau, vtau, 1)
-  do i=1,grid%mesh
-     vhn2(i)=vhn2(i)+vgc(i,1)
-     egc(i)=egc(i)*grid%r2(i)*fpi+egc0(i)
-  enddo
-  return
-end subroutine sic_correction

Copied: trunk/espresso/atomic/src/Makefile (from rev 8077, trunk/espresso/atomic/Makefile)
===================================================================
--- trunk/espresso/atomic/src/Makefile	                        (rev 0)
+++ trunk/espresso/atomic/src/Makefile	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,130 @@
+#
+# Makefile for atomic code
+#
+
+include ../../make.sys
+
+# location of needed modules
+MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG).
+
+LIBOBJS = ../../iotk/src/libiotk.a ../../flib/flib.a \
+         ../../clib/clib.a ../../flib/ptools.a
+
+LD1OBJS = \
+add_exchange.o \
+all_electron.o \
+ascheq.o \
+ascheqps.o \
+ascheqps_drv.o \
+c6_dft.o \
+c6_tfvw.o \
+calculate_gipaw_orbitals.o \
+cfdsol.o \
+chargeps.o \
+compute_chi.o \
+compute_chi_tm.o \
+compute_phi.o \
+compute_phi_tm.o \
+compute_phius.o \
+compute_potps.o \
+compute_potps_new.o \
+compute_q_3bess.o \
+compute_relpert.o \
+compute_solution.o \
+descreening.o \
+dfx_new.o \
+dir_outward.o \
+dirsol.o \
+dmixp.o \
+drhoofv.o \
+drho0ofvx.o \
+dvex.o \
+el_config.o \
+elsd.o \
+elsd_highv.o \
+elsdps.o \
+elsdps_paw.o \
+esic.o \
+export_upf.o \
+find_qi.o \
+gener_pseudo.o \
+grad_log.o \
+green.o \
+import_upf.o \
+int_0_inf_dr.o \
+integrate_inward.o \
+integrate_outward.o \
+inward.o \
+outward.o \
+intref.o \
+kin_e_density.o \
+ld1_readin.o \
+ld1_setup.o \
+ld1_writeout.o \
+lderiv.o \
+lderivps.o \
+lschps.o \
+newd_at.o \
+new_potential.o \
+nodenum.o \
+normalize.o \
+occ_spin.o \
+paw_type.o \
+partial_wave_expansion.o \
+pseudovloc.o \
+pseudo_q.o \
+read_pseudo_ncpp.o \
+read_pseudo_rrkj3.o \
+run_lda_half.o \
+run_pseudo.o \
+run_test.o \
+scf.o \
+seriebes.o \
+set_rho_core.o \
+set_psi_in.o \
+set_rc_rv.o \
+set_sl3.o \
+sic_correction.o \
+starting_potential.o \
+start_potps.o \
+start_scheq.o \
+test_bessel.o \
+trou.o \
+vdpack.o \
+vext.o \
+vpack.o \
+v_of_rho_at.o \
+vxcgc.o \
+write_cpmd.o \
+write_ae_pseudo.o \
+write_files.o \
+write_paw_recon.o \
+write_pseudo.o \
+write_results.o \
+write_resultsps.o \
+write_upf.o
+
+LD1MODS = \
+atomic_paw.o \
+ld1inc.o \
+parameters.o 
+
+QEMODS=../../Modules/libqemod.a
+
+TLDEPS= bindir mods libs 
+
+all: tldeps ld1.x
+
+ld1.x: $(LD1OBJS) ld1.o $(LD1MODS) $(QEMODS) $(LIBOBJS)
+	$(LD) $(LDFLAGS) -o ld1.x \
+		ld1.o $(LD1OBJS) $(LD1MODS) $(QEMODS) $(LIBOBJS) $(LIBS)
+	- ( cd ../../bin ; ln -fs ../atomic/src/ld1.x . )
+
+tldeps:
+	test -n "$(TLDEPS)" && ( cd ../.. ; $(MAKE) $(MFLAGS) $(TLDEPS) || exit 1) || :
+
+clean:
+	- /bin/rm -f *.o *.F90 *.x *~ *.d *.mod *.tmp.* *.L
+	- /bin/rm -f ../../bin/ld1.x
+
+include make.depend

Copied: trunk/espresso/atomic/src/add_exchange.f90 (from rev 8077, trunk/espresso/atomic/add_exchange.f90)
===================================================================
--- trunk/espresso/atomic/src/add_exchange.f90	                        (rev 0)
+++ trunk/espresso/atomic/src/add_exchange.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,98 @@
+!
+!--------------------------------------------------------------------
+subroutine add_exchange ( energy )
+!--------------------------------------------------------------------
+#undef DEBUG
+   !  
+   use io_global, only: stdout
+   use kinds,  only: DP
+   use constants, only: e2
+   use ld1_parameters, only : nwfx
+   use ld1inc, only: nwf, oc, psi, vx, sl3, ll, nn, enl, el, &
+                     isw, nspin, enzero, grid
+   use radial_grids, only: ndmx, hartree
+   implicit none
+   !
+   ! I/O variables
+   !
+   real (DP) :: energy
+   !
+   ! local variables
+   !
+   integer :: i, l0, l1, l2, l3, nu, mu, nst, is, half
+   real (DP) :: ex_hf, ocs, doc, sss, fac, sxc, sxc1
+   real (DP) :: wrk(ndmx), wrk1(ndmx), wrk2(ndmx), int_0_inf_dr, enzhf(nwfx)
+!
+   ex_hf = 0.0
+   do nu=1,nwf
+      is = isw(nu)
+      l1 = ll(nu)
+      half = 2.d0 * l1 + 1.d0
+      sxc = 0.0d0
+      do mu=1,nwf
+!
+! only wfc with the same spin contribute to exchange term
+!
+         if (isw(mu) /= is) cycle
+         ocs = oc(mu) * (0.5d0 * nspin )
+         if ( mu == nu ) then
+            doc = 0.d0
+            if( (l1 /= 0) .and. (ocs > 0.d0) ) then
+              i = int(ocs)
+              doc = (i*(2.d0*ocs-i-1.d0)/(half-1.d0) - ocs*ocs/half) * half/ocs
+            end if
+            ocs = ocs + doc
+!            if (doc /= 0.d0) write (*,*) "DOC ",nu, doc
+         end if
+
+         l2 = ll(mu)
+         l0=abs(l1-l2)
+         do i=1,grid%mesh
+            wrk(i) = psi(i,1,mu)*psi(i,1,nu)
+            wrk1(i)= 0.0d0
+         end do
+         do l3=l0,l1+l2
+            sss = sl3(l1,l2,l3)
+            if (abs(sss).gt.1.0d-10) then
+               call hartree(l3,l1+l2+2,grid%mesh,grid,wrk,wrk2)
+               fac = -e2*ocs*sss/2.0d0
+               do i=1,grid%mesh
+                  wrk1(i)= wrk1(i) + fac*wrk2(i)*wrk(i)
+               end do
+            end if
+         end do
+!- spurious hartree part 
+          if (mu.eq.nu) then
+            call hartree(0,2,grid%mesh,grid,wrk,wrk2)
+            fac = doc*e2
+            do i=1,grid%mesh
+               wrk1(i) = wrk1(i) + fac*wrk2(i)*wrk(i)
+            end do
+          end if
+!
+         nst = 2 * min(l1,l2) + 2
+         sxc = sxc + int_0_inf_dr(wrk1,grid,grid%mesh,nst)
+      end do 
+!
+      do i=1,grid%mesh
+         wrk1(i) = vx(i,is)*psi(i,1,nu)*psi(i,1,nu)
+      end do
+      sxc1 = int_0_inf_dr(wrk1,grid,grid%mesh,2*ll(nu)+2)
+      ex_hf = ex_hf + 0.5d0*oc(nu)*sxc
+      enzhf(nu)=sxc1-sxc
+      if(oc(nu)>0) enzero(is) = enzhf(nu)
+   end do 
+
+   energy = energy + ex_hf
+
+#ifdef DEBUG
+   write (*,*) enzero
+   write(stdout,1100) (nn(nu),ll(nu),el(nu),oc(nu),enl(nu)-enzero(isw(nu)), &
+                  enl(nu)-enzhf(nu), nu=1,nwf)
+
+1100 format(4x,2i2,5x,a2,'(',f5.2,')',2f11.4)
+#endif
+
+   return
+
+end subroutine add_exchange

Copied: trunk/espresso/atomic/src/all_electron.f90 (from rev 8077, trunk/espresso/atomic/all_electron.f90)
===================================================================
--- trunk/espresso/atomic/src/all_electron.f90	                        (rev 0)
+++ trunk/espresso/atomic/src/all_electron.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,81 @@
+!
+! Copyright (C) 2004 PWSCF group
+! This file is distributed under the terms of the
+! GNU General Public License. See the file `License'
+! in the root directory of the present distribution,
+! or http://www.gnu.org/copyleft/gpl.txt .
+!
+!
+!---------------------------------------------------------------
+SUBROUTINE all_electron(ild,ic)
+  !---------------------------------------------------------------
+  !
+  !  this routine is a driver to an all-electron calculation
+  !  with the parameters given in input
+  !
+  !
+  USE kinds, ONLY : DP
+  USE radial_grids, ONLY: ndmx
+  USE ld1inc, ONLY: isic, grid, zeta, rho, enne, vpot, vxt, enl, &
+                     deld, encl, etot, ecxc, evxt, ehrt, epseu, ekin, &
+                     vnl, vh, lsd, nspin, nlcc, vdw, nn, ll, oc, nwf, &
+                     zed, zval, vxc, exc, excgga, v0, verbosity, &
+                     relpert, evel, edar, eso, vsic, vsicnew, vhn1, egc
+  IMPLICIT NONE
+
+  INTEGER, INTENT(in) :: ic   ! counter on configurations
+  LOGICAL :: ild    ! if true compute log der
+  !
+  !    compute an initial estimate of the potential
+  !
+  CALL starting_potential (ndmx, grid%mesh, zval, zed, nwf, oc, nn, ll,&
+                           grid%r,enl, v0, vxt, vpot, enne, nspin )
+  !
+  ! allocate variables for SIC, if needed
+  !
+  IF (isic /= 0) THEN
+     ALLOCATE(vsic(ndmx,nwf), vsicnew(ndmx), vhn1(ndmx), egc(ndmx))
+     vsic=0.0_dp
+  ENDIF
+  !
+  !     solve the eigenvalue self-consistent equation
+  !
+  CALL scf(ic)
+  !
+  !   compute relativistic corrections to the eigenvalues
+  !
+  IF ( relpert ) CALL compute_relpert(evel,edar,eso)
+  !
+  !  compute total energy
+  !
+  CALL elsd (zed,grid,rho,vxt,vh,vxc,exc,excgga,nwf,nspin,enl,oc,    &
+             etot,ekin,encl,ehrt,ecxc,evxt)
+  !
+  IF (verbosity=='high') CALL elsd_highv(ic)
+  !
+  !   add sic correction if needed
+  !
+  IF(isic /= 0) CALL esic
+  !
+  !   print results
+  !
+  CALL write_results
+  !
+  !  compute logarithmic derivative
+  !
+  IF (deld > 0.0_DP .and. ild) CALL lderiv
+  !
+  ! compute C6 coefficient if required
+  !
+  IF (vdw) THEN
+     CALL c6_tfvw ( grid%mesh, zed, grid, rho(1,1) )
+     CALL c6_dft  ( grid%mesh, zed, grid )
+  ENDIF
+  !
+  IF (isic /= 0) THEN
+     DEALLOCATE(egc, vhn1, vsicnew, vsic)
+  ENDIF
+  !
+  RETURN
+  !
+END SUBROUTINE all_electron

Copied: trunk/espresso/atomic/src/ascheq.f90 (from rev 8077, trunk/espresso/atomic/ascheq.f90)
===================================================================
--- trunk/espresso/atomic/src/ascheq.f90	                        (rev 0)
+++ trunk/espresso/atomic/src/ascheq.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,254 @@
+!
+! Copyright (C) 2004 PWSCF group
+! This file is distributed under the terms of the
+! GNU General Public License. See the file `License'
+! in the root directory of the present distribution,
+! or http://www.gnu.org/copyleft/gpl.txt .
+!
+!
+!---------------------------------------------------------------
+subroutine ascheq(nn,lam,e,mesh,grid,vpot,ze2,thresh0,y,nstop)
+  !---------------------------------------------------------------
+  !
+  !  numerical integration of the radial schroedinger equation for
+  !  bound states in a local potential.
+  !  thresh determines the absolute accuracy for the eigenvalue
+  !
+  use kinds, only : DP
+  use radial_grids, only: radial_grid_type, series
+  implicit none
+  type(radial_grid_type), intent(in) :: grid
+  integer :: mesh,lam, ierr
+  integer:: nn,nstop,maxter,iter,l1,i,ik,ncross,n, &
+       nstart,ns,n2,nst2,ndcr
+  real(DP) :: ze2,ddx12,eup,elw,b0e,ymx,rap,rstart,di,expn,  &
+       c1,c2,fe,a0,a1,a2,sum0,f2,sum,sqlhf,f0,f1,dfe,de,eps, &
+       yln,xp,sum1,xl1,x4l6
+  real(DP):: vpot(mesh), y(mesh)
+  real(DP),allocatable:: c(:), el(:), f(:)
+  real(DP):: b(0:3),e,thresh0, thresh
+  data maxter/50/
+  !
+  !  set up constants and initialize
+  !
+  allocate(c(mesh),stat=ierr)
+  allocate(f(mesh),stat=ierr)
+  allocate(el(mesh),stat=ierr)
+
+  thresh=thresh0
+  if (e<-5.e+2) thresh=thresh0*10.0_DP
+  iter=0
+  ddx12=grid%dx*grid%dx/12.0_dp
+  l1=lam+1
+  sqlhf=(DBLE(lam)+0.5_dp)**2
+  ndcr=nn-lam-1
+  !
+  !  set initial lower and upper bounds to the eigenvalue
+  !
+  eup=vpot(mesh)+sqlhf/grid%r2(mesh)
+  elw=eup
+  do i=1,mesh
+     elw=min(elw,vpot(i)+sqlhf/grid%r2(i))
+  enddo
+  nstop=200
+  if(eup.eq.elw) go to 900
+  if(e.gt.eup) e=0.9_DP*eup+0.1_DP*elw
+  if(e.lt.elw) e=0.9_DP*elw+0.1_DP*eup
+  !
+  !  series developement of the potential near the origin
+  !
+  do i=1,4
+     y(i)=vpot(i)-ze2/grid%r(i)
+  enddo
+  call series(y,grid%r,grid%r2,b)
+  !
+300 continue
+  iter=iter+1
+  nstop=300
+  if(iter.gt.maxter) go to 900
+  !
+  !  set up the f-function and determine the position of its last
+  !  change of sign
+  !  f < 0 (approximatively) means classically allowed   region
+  !  f > 0         "           "        "      forbidden   "
+  !
+  f(1)=ddx12*(grid%r2(1)*(vpot(1)-e)+sqlhf)
+  do i=2,mesh
+     f(i)=ddx12*(grid%r2(i)*(vpot(i)-e)+sqlhf)
+     if( f(i) .ne. sign(f(i),f(i-1)) ) ik=i
+  enddo
+  nstop=302
+  
+  if(ik.ge.mesh-2) go to 900
+  do i=1,mesh
+     f(i)=1.0_dp-f(i)
+  enddo
+  !
+  y(:) = 0.0_dp
+  !
+  !  determination of the wave-function in the first two points by
+  !  series developement
+  !
+  xl1=lam+1.0_DP
+  x4l6=4.0_dp*lam+6.0_dp
+  b0e=b(0)-e
+  c1=0.5_dp*ze2/xl1
+  c2=(c1*ze2+b0e)/x4l6
+  call start_scheq( lam, e, b, grid, ze2, y )
+  !
+  !  start outward integration and count number of crossings
+  !
+  ncross=0
+  ymx=0.0_dp
+  do n=2,ik-1
+     y(n+1)=((12.0_dp-10.0_dp*f(n))*y(n)-f(n-1)*y(n-1))/f(n+1)
+     if ( y(n) .ne. sign(y(n),y(n+1)) ) ncross=ncross+1
+     ymx=max(ymx,abs(y(n+1)))
+  end do
+  !
+  !  matching radius has been reached going out. if ncross is not
+  !  equal to ndcr, modify the trial eigenvalue.
+  !
+  if(ndcr < ncross) then
+     !
+     !  too many crossings. e is an upper bound to the true eigen-
+     !  value. increase abs(e)
+     !
+     eup=e
+     rap=(DBLE(ncross+l1)/DBLE(nn))**2
+     e=(e-vpot(mesh))*rap+vpot(mesh)
+     if(e.lt.elw) e=0.9_dp*elw+0.1_dp*eup
+     go to 300
+  else if (ndcr > ncross) then
+     !
+     !  too few crossings. e is a lower bound to the true eigen-
+     !  value. decrease abs(e)
+     !
+     elw=e
+     rap=(DBLE(ncross+l1)/DBLE(nn))**2
+     e=(e-vpot(mesh))*rap+vpot(mesh)
+     if(e.gt.eup) e=0.9_dp*eup+0.1_dp*elw
+     go to 300
+  end if
+  !
+  !  prepare inward integration
+  !  charlotte froese can j phys 41,1895(1963)
+  !
+  !            start at  min( rmax, 10*rmatch )
+  !
+  nstart=mesh
+  ns=10
+  rstart=ns*grid%r(ik)
+  if(rstart.lt.grid%r(mesh)) then
+     do  i=ik,mesh
+        nstart=i
+        if(grid%r(i).ge.rstart) go to 403
+     enddo
+403  nstart=nstart/2
+     nstart=2*nstart+1
+  end if
+  !
+  !  set up a, l, and c vectors
+  !
+  n=ik+1
+  el(n)=10.0_dp*f(n)-12.0_dp
+  c(n)=-f(ik)*y(ik)
+  n2=ik+2
+  do n=n2,nstart
+     di=10.0_dp*f(n)-12.0_dp
+     el(n)=di-f(n)*f(n-1)/el(n-1)
+     c(n)=-c(n-1)*f(n-1)/el(n-1)
+  enddo
+  !
+  !  start inward integration by the froese's tail procedure
+  !
+  expn=exp(-sqrt(12.0_dp*abs(1.0_dp-f(nstart-1))))
+  y(nstart-1)=c(nstart-1)/(el(nstart-1)+f(nstart)*expn)
+  y(nstart)=expn*y(nstart-1)
+  do n=nstart-2,ik+1,-1
+    y(n)=(c(n)-f(n+1)*y(n+1))/el(n)
+ end do
+  !
+  !  if necessary, improve the trial eigenvalue by the cooley's
+  !  procedure. jw cooley math of comp 15,363(1961)
+  !
+  fe=(12.0_dp-10.0_dp*f(ik))*y(ik)-f(ik-1)*y(ik-1)-f(ik+1)*y(ik+1)
+  !
+  !  calculate the normalization
+  !
+  if(ymx.ge.1.0e10_dp) then
+     do  i=1,mesh
+        y(i)=y(i)/ymx
+     enddo
+  end if
+  a0=1.0_dp/DBLE(2*lam+3)
+  a1=c1/DBLE(lam+2)
+  a2=(c1*c1+c2+c2)/DBLE(2*lam+5)
+  sum0=(a0+grid%r(1)*(a1+grid%r(1)*a2))*grid%r(1)**(2*lam+3)
+  nst2=nstart-2
+  f2=grid%r2(1  )*y(1  )*y(1  )
+  sum=grid%r(1)*f2/DBLE(2*l1+1)
+  do n=1,nst2,2
+     f0=f2
+     f1=grid%r2(n+1)*y(n+1)*y(n+1)
+     f2=grid%r2(n+2)*y(n+2)*y(n+2)
+     sum=sum+f0+f2+4.0_DP*f1
+  enddo
+  sum=sum0+grid%dx*sum/3.0_dp
+  dfe=-y(ik)*f(ik)/grid%dx/sum
+  de=-fe*dfe
+  eps=abs(de/e)
+  if(abs(de).lt.thresh) go to 600
+  if(eps.gt.0.25_dp) de=0.25_dp*de/eps
+  if(de.gt.0.0_dp) elw=e
+  if(de.lt.0.0_dp) eup=e
+  e=e+de
+  if(e.gt.eup) e=0.9_dp*eup+0.1_dp*elw
+  if(e.lt.elw) e=0.9_dp*elw+0.1_dp*eup
+  if(iter.lt.maxter) go to 300
+  nstop=50
+600 continue
+  !
+  !  normalize the eigenfunction and exit
+  !
+  do n=nstart,mesh-1
+     y(n+1)=0.0_dp
+     if(y(n).eq.0.0_dp) go to 601
+     yln=log(abs(y(n)))
+     xp=-sqrt(12.0_dp*abs(1.0_dp-f(n)))
+     expn=yln+xp
+     if(expn.lt.-80.0_dp) go to 601
+     y(n+1)=sign(exp(expn),y(n))
+601 continue
+  enddo
+  sum1=0.0_dp
+  do n=nstart,mesh-2,2
+     f0=f2
+     f1=grid%r2(n+1)*y(n+1)*y(n+1)
+     f2=grid%r2(n+2)*y(n+2)*y(n+2)
+     sum1=sum1+f0+f2+4.0_dp*f1
+  enddo
+  sum=sum+grid%dx*sum1/3.0_dp
+  sum=sqrt(sum)
+  do n=1,mesh
+     y(n)=grid%sqr(n)*y(n)/sum
+  enddo
+  if(nstop.lt.100) go to 900
+  nstop=0
+  deallocate(el)
+  deallocate(f )
+  deallocate(c )
+  return
+  !
+  !  error exit
+  !
+  ! 900  write(6,9000) nstop,nn,lam,elw,eup
+  ! 9000 format(5x,'error in ascheq: nstop =',i4,'. n l =',2i3,/ &
+  !     & 5x,'elw =',f15.10,' eup =',f15.10)
+900 continue
+  deallocate(el)
+  deallocate(f )
+  deallocate(c )
+  return
+
+end subroutine ascheq

Copied: trunk/espresso/atomic/src/ascheqps.f90 (from rev 8077, trunk/espresso/atomic/ascheqps.f90)
===================================================================
--- trunk/espresso/atomic/src/ascheqps.f90	                        (rev 0)
+++ trunk/espresso/atomic/src/ascheqps.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,315 @@
+!
+! Copyright (C) 2004 PWSCF group
+! This file is distributed under the terms of the
+! GNU General Public License. See the file `License'
+! in the root directory of the present distribution,
+! or http://www.gnu.org/copyleft/gpl.txt .
+!
+!
+!---------------------------------------------------------------
+subroutine ascheqps(nam,lam,jam,e0,mesh,ndm,grid,vpot,thresh,y,beta,ddd,&
+           qq,nbeta,nwfx,lls,jjs,ikk,nstop)
+  !---------------------------------------------------------------
+  !
+  !  numerical integration of the radial schroedinger equation for
+  !  bound states in a local potential.
+  !
+  !  This routine works at fixed e
+  !  It allows a nonlocal potential and an overlap
+  !  operator. Therefore it can solve a general schroedinger
+  !  equation necessary to solve a US pseudopotential
+  !
+  use io_global, only : stdout
+  use kinds, only : DP
+  use radial_grids, only: radial_grid_type, series
+
+  implicit none
+
+  type(radial_grid_type), intent(in) :: grid
+  integer :: &
+       nam, &
+       lam, &      ! l angular momentum
+       mesh,&      ! size of radial mesh
+       ndm, &      ! maximum radial mesh 
+       nbeta,&     ! number of beta function  
+       nwfx, &     ! maximum number of beta functions
+       ndcr,  &    ! number of required nodes
+       n1, n2, &   ! counters
+       ikl,    &   ! auxiliary
+       nstop,  &   ! used to check the behaviour of the routine
+       lls(nbeta),&! for each beta the angular momentum
+       ikk(nbeta) ! for each beta the point where it become zero
+
+  real(DP) :: &
+       e0,e,    &  ! output eigenvalue
+       jam,     &  ! j angular momentum
+       vpot(mesh),&! the local potential 
+       thresh,   & ! precision of eigenvalue
+       y(mesh),  & ! the output solution
+       jjs(nwfx), & ! the j angular momentum
+       beta(ndm,nwfx),& ! the beta functions
+       work(nbeta),  & ! auxiliary space
+       ddd(nwfx,nwfx),qq(nwfx,nwfx) ! parameters for computing B_ij
+  !
+  !    the local variables
+  !
+  real(DP) :: &
+       ddx12,      &  ! dx**2/12 used for Numerov integration
+       sqlhf,      &  ! the term for angular momentum in equation
+       ze2,        &  ! possible coulomb term aroun the origin (set 0)
+       b(0:3),     &  ! coefficients of taylor expansion of potential
+       eup,elw,    & ! actual energy interval
+       ymx,        & ! the maximum value of the function
+       fe,integ,dfe,de, &! auxiliary for numerov computation of e
+       eps,        & ! the epsilon of the delta e
+       yln, xp, expn,& ! used to compute the tail of the solution
+       int_0_inf_dr  ! integral function
+
+  real(DP), allocatable :: &
+       fun(:),  &   ! integrand function
+       f(:),    &   ! the f function
+       el(:),c(:) ! auxiliary for inward integration
+
+  integer, parameter :: &
+       maxter=100    ! maximum number of iterations
+
+  integer :: &
+       n,  &    ! counter on mesh points
+       iter,&   ! counter on iteration
+       ik,  &   ! matching point
+       ns,  &   ! counter on beta functions
+       l1,  &   ! lam+1
+       nst, &   ! used in the integration routine
+       ierr, &
+       ncross,& ! actual number of nodes
+       nstart  ! starting point for inward integration
+
+  logical, save :: first(0:10,0:10) = .true.
+
+
+   if (mesh.ne.grid%mesh) call errore('compute_solution','mesh dimension is not as expected',1)
+  !
+  !  set up constants and allocate variables the 
+  !
+  allocate(fun(mesh), stat=ierr)
+  allocate(f(mesh), stat=ierr)
+  allocate(el(mesh), stat=ierr)
+  allocate(c(mesh), stat=ierr)
+
+  nstop=0
+  nstart=0
+  e=e0
+!  write(6,*) 'entering ', nam,lam, e
+  eup=0.3_DP*e
+  elw=1.3_dp*e
+  ndcr=nam-lam-1
+!  write(6,*) 'entering ascheqps', vpot(mesh-20)*grid%r(mesh-20)
+
+  ddx12=grid%dx*grid%dx/12.0_dp
+  l1=lam+1
+  nst=l1*2
+  sqlhf=(DBLE(lam)+0.5_dp)**2
+  !
+  !  series developement of the potential near the origin
+  !
+  do n=1,4
+     y(n)=vpot(n)
+  enddo
+  call series(y,grid%r,grid%r2,b)
+
+  !      write(stdout,*) 'eneter lam,eup,elw,e',lam,nbeta,eup,elw,e
+  !
+  !  set up the f-function and determine the position of its last
+  !  change of sign
+  !  f < 0 (approximatively) means classically allowed   region
+  !  f > 0         "           "        "      forbidden   "
+  !
+  do iter=1,maxter
+!  write(6,*) 'starting iter', iter, elw, e, eup
+  ik=1
+  f(1)=ddx12*(grid%r2(1)*(vpot(1)-e)+sqlhf)
+  do n=2,mesh
+     f(n)=ddx12*(grid%r2(n)*(vpot(n)-e)+sqlhf)
+     if( f(n).ne.sign(f(n),f(n-1)).and.n.lt.mesh-5 ) ik=n
+  enddo
+!  if (ik.eq.0.and.nbeta.eq.0) ik=mesh*3/4
+  if (ik.eq.1.or.grid%r(ik)>4.0_DP) ik=mesh*3/4
+
+  if(ik.ge.mesh-2) then
+     do n=1,mesh
+        write(stdout,*) grid%r(n), vpot(n), f(n)
+     enddo
+     call errore('compute_solution', 'No point found for matching',1)
+  endif
+  !
+  !     determine if ik is sufficiently large
+  !
+  do ns=1,nbeta
+     if (lls(ns).eq.lam .and. jjs(ns).eq.jam .and. ikk(ns).gt.ik) ik=ikk(ns)+3
+  enddo
+  !
+  !     if everything is ok continue the integration and define f
+  !
+  do n=1,mesh
+     f(n)=1.0_dp-f(n)
+  enddo
+  !
+  !  determination of the wave-function in the first two points by
+  !  series developement
+  !
+  ! no coulomb divergence in the origin for a pseudopotential
+  ze2=0.d0 
+  call start_scheq( lam, e, b, grid, ze2, y )
+  !
+  !    outward integration before ik
+  !
+  call integrate_outward (lam,jam,e,mesh,ndm,grid,f,b,y,beta,ddd,qq,&
+       nbeta,nwfx,lls,jjs,ikk,ik)
+
+  ncross=0
+  ymx=0.0_dp
+  do n=2,ik-1
+     if ( y(n) .ne. sign(y(n),y(n+1)) ) ncross=ncross+1
+     ymx=max(ymx,abs(y(n+1)))
+  end do
+!
+!  If at this point the number of nodes is wrong it means that something
+!  is probably wrong in the calling routines. A ghost might be present
+!  in the pseudopotential. With a nonlocal pseudopotential there is no
+!  node theorem so strictly speaking the following instructions are
+!  wrong but sometimes they help so we keep them here.
+!
+  if(ndcr /= ncross .and. first(nam,lam)) then
+  write(stdout,'(/,7x,5(a,i3))') 'WARNING! Expected number of nodes: ',ndcr, '=   ',nam,'-',lam,&
+                                 '-  1, number of nodes found:', ncross,'.'
+  write(stdout,'(7x,a,/,7x,a,/)') 'Setting wfc to zero for this iteration.',&
+                                 '(This warning will only be printed once per wavefunction)'
+  first(nam,lam) = .false.
+  endif
+
+  if(ndcr < ncross) then
+     !
+     !  too many crossings. e is an upper bound to the true eigen-
+     !  value. increase abs(e)
+     !
+
+     eup=e
+     e=0.9_dp*elw+0.1_dp*eup
+!     write(6,*) 'too many crossing', ncross, ndcr
+!     call errore('aschqps','wrong number of nodes. Probably a Ghost?',1)
+     y=0.0_DP
+     ymx=0.0_dp
+     go to 300
+  else if (ndcr > ncross) then
+     !
+     !  too few crossings. e is a lower bound to the true eigen-
+     !  value. decrease abs(e)
+     !
+     elw=e
+     e=0.9_dp*eup+0.1_dp*elw
+!     write(6,*) 'too few crossing', ncross, ndcr
+!     call errore('aschqps','wrong number of nodes. Probably a Ghost?',1)
+     y=0.0_DP
+     ymx=0.0_dp
+     go to 300
+  end if
+  !
+  !    inward integration up to ik
+  !
+  call integrate_inward(e,mesh,ndm,grid,f,y,c,el,ik,nstart)
+  !
+  !  if necessary, improve the trial eigenvalue by the cooley's
+  !  procedure. jw cooley math of comp 15,363(1961)
+  !
+  fe=(12.0_dp-10.0_dp*f(ik))*y(ik)-f(ik-1)*y(ik-1)-f(ik+1)*y(ik+1)
+  !
+  ! audjust the normalization if needed
+  !
+  if(ymx.ge.1.0e10_dp) y=y/ymx
+  !
+  !  calculate the normalization
+  !
+  do n1=1,nbeta
+     if (lam.eq.lls(n1).and.abs(jam-jjs(n1)).lt.1.e-7_dp) then
+        ikl=ikk(n1)
+        do n=1,ikl
+           fun(n)=beta(n,n1)*y(n)*grid%sqr(n)
+        enddo
+        work(n1)=int_0_inf_dr(fun,grid,ikl,nst)
+     else
+        work(n1)=0.0_dp
+     endif
+  enddo
+  do n=1,nstart
+     fun(n)= y(n)*y(n)*grid%r(n)
+  enddo
+  integ=int_0_inf_dr(fun,grid,nstart,nst)
+  do n1=1,nbeta
+     do n2=1,nbeta
+        integ = integ + qq(n1,n2)*work(n1)*work(n2)
+     enddo
+  enddo
+  dfe=-y(ik)*f(ik)/grid%dx/integ
+  de=-fe*dfe
+  eps=abs(de/e)
+!  write(6,'(i5, 3f20.12)') iter, e, de
+  if(abs(de).lt.thresh) go to 600
+  if(eps.gt.0.25_dp) de=0.25_dp*de/eps
+  if(de.gt.0.0_dp) elw=e
+  if(de.lt.0.0_dp) eup=e
+  e=e+de
+  if(e.gt.eup) e=0.9_dp*eup+0.1_dp*elw
+  if(e.lt.elw) e=0.9_dp*elw+0.1_dp*eup
+300 continue
+  enddo
+  nstop=1
+  if (nstart==0) goto 900
+600 continue
+
+  !
+  !   exponential tail of the solution if it was not computed
+  !
+  if (nstart.lt.mesh) then
+     do n=nstart,mesh-1
+        if (y(n) == 0.0_dp) then
+           y(n+1)=0.0_dp
+        else
+           yln=log(abs(y(n)))
+           xp=-sqrt(12.0_dp*abs(1.0_dp-f(n)))
+           expn=yln+xp
+           if (expn.lt.-80.0_dp) then
+              y(n+1)=0.0_dp
+           else
+              y(n+1)=sign(exp(expn),y(n))
+           endif
+        endif
+     enddo
+  endif
+  !
+  !  normalize the eigenfunction as if they were norm conserving. 
+  !  If this is a US PP the correct normalization is done outside this
+  !  routine.
+  !
+  do n=1,mesh
+     el(n)=grid%r(n)*y(n)*y(n)
+  enddo
+  integ=int_0_inf_dr(el,grid,mesh,nst)
+  if (integ>0.0_DP) then
+     integ=sqrt(integ)
+     do n=1,mesh
+        y(n)=grid%sqr(n)*y(n)/integ
+     enddo
+     e0=e
+  else
+     nstop=1
+  endif
+
+900 continue
+
+  deallocate(el)
+  deallocate(f )
+  deallocate(c )
+  deallocate(fun )
+  return
+
+end subroutine ascheqps

Copied: trunk/espresso/atomic/src/ascheqps_drv.f90 (from rev 8077, trunk/espresso/atomic/ascheqps_drv.f90)
===================================================================
--- trunk/espresso/atomic/src/ascheqps_drv.f90	                        (rev 0)
+++ trunk/espresso/atomic/src/ascheqps_drv.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,98 @@
+
+!
+! Copyright (C) 2007 Quantum ESPRESSO group
+! This file is distributed under the terms of the
+! GNU General Public License. See the file `License'
+! in the root directory of the present distribution,
+! or http://www.gnu.org/copyleft/gpl.txt .
+!
+!
+!--------------------------------------------------------------------------
+subroutine ascheqps_drv(veff, ncom, thresh, flag_all, nerr)
+  !--------------------------------------------------------------------------
+  !
+  !     This routine is a driver that calculates for the test
+  !     configuration the solutions of the Kohn and Sham equation
+  !     with a fixed pseudo-potential. The potentials are
+  !     assumed to be screened. The effective potential veff is given
+  !     in input.
+  !     The output wavefunctions are written in phits and are normalized.
+  !     If flag is .true. compute all wavefunctions, otherwise only
+  !     the wavefunctions with positive occupation.
+  !      
+  use kinds, only: dp
+  use ld1_parameters, only: nwfsx
+  use radial_grids, only: ndmx
+  use ld1inc, only: grid, pseudotype, rel, &
+                    lls, jjs, qq, ikk, ddd, betas, nbeta, vnl, &
+                    nwfts, iswts, octs, llts, jjts, nnts, enlts, phits 
+  implicit none
+
+  integer ::    &
+          nerr, &     ! control the errors of the routine ascheqps
+          ncom        ! number of components of the pseudopotential
+
+  real(DP) :: &
+       veff(ndmx,ncom)    ! work space for writing the potential 
+
+  logical :: flag_all    ! if true calculates all the wavefunctions
+
+  integer ::  &
+       ns,    &  ! counter on pseudo functions
+       is,    &  ! counter on spin
+       nbf,   &  ! auxiliary nbeta
+       n,     &  ! index on r point
+       nstop, &  ! errors in each wavefunction
+       ind
+
+  real(DP) :: &
+       vaux(ndmx,2)     ! work space for writing the potential 
+
+  real(DP) :: thresh         ! threshold for selfconsistency
+  !
+  !    compute the pseudowavefunctions in the test configuration
+  !
+  if (pseudotype.eq.1) then
+     nbf=0
+  else
+     nbf=nbeta
+  endif
+
+  nerr=0
+  do ns=1,nwfts
+     if (octs(ns).gt.0.0_dp.or.(octs(ns).gt.-1.0_dp .and. flag_all)) then
+        is=iswts(ns)
+        if (ncom==1.and.is==2) call   &
+                               errore('ascheqps_drv','uncompatible spin',1)
+        if (pseudotype ==1) then
+           if ( rel < 2 .or. llts(ns) == 0 .or. &
+                abs(jjts(ns)-llts(ns)+0.5_dp) < 0.001_dp) then
+              ind=1
+           else if ( rel == 2 .and. llts(ns) > 0 .and. &
+                abs(jjts(ns)-llts(ns)-0.5_dp) < 0.001_dp) then
+              ind=2
+           else
+              call errore('ascheqps_drv','something strange',1)
+           endif
+           do n=1,grid%mesh
+              vaux(n,is)=veff(n,is)+vnl(n,llts(ns),ind)
+           enddo
+        else
+           do n=1,grid%mesh
+              vaux(n,is)=veff(n,is)
+           enddo
+        endif
+        call ascheqps(nnts(ns),llts(ns),jjts(ns),enlts(ns),grid%mesh,ndmx,grid,&
+             vaux(1,is),thresh,phits(1,ns),betas,ddd(1,1,is),qq,nbf, &
+             nwfsx,lls,jjs,ikk,nstop)
+        !           write(6,*) ns, nnts(ns),llts(ns), jjts(ns), enlts(ns)
+        !
+        !   normalize the wavefunctions 
+        !
+        call normalize(phits(1,ns),llts(ns),jjts(ns), ns)
+        nerr=nerr+nstop
+     endif
+  enddo
+
+  return
+end subroutine ascheqps_drv

Copied: trunk/espresso/atomic/src/atomic_paw.f90 (from rev 8077, trunk/espresso/atomic/atomic_paw.f90)
===================================================================
--- trunk/espresso/atomic/src/atomic_paw.f90	                        (rev 0)
+++ trunk/espresso/atomic/src/atomic_paw.f90	2011-08-23 09:39:15 UTC (rev 8100)
@@ -0,0 +1,1243 @@
+!#define __DEBUG_V_H_vs_SPHEROPOLE
+!
+! Copyright (C) 2004 PWSCF group
+! This file is distributed under the terms of the
+! GNU General Public License. See the file `License'
+! in the root directory of the present distribution,
+! or http://www.gnu.org/copyleft/gpl.txt .
+!
+MODULE atomic_paw
+  !
+  !============================================================================
+  !
+  !   Module for Projector Augmented Wave (PAW) calculations assuming
+  !   spherical symmetry. Kresse's notations are adopted.
+  !   Contains the type describing a PAW dataset, the routine for
+  !   generating it from the ld1 code, and the routines to compute
+  !   the hamiltonian and energy.
+  !   GGA and LSD are implemented, relativistic calculations are not.
+  !
+  !   References:
+  !   P.E.Blochl, Phys. Rev. B 50, 17953 (1994)
+  !   G.Kresse, D.Joubert, Phys. Rev. B 59, 1758 (1999)
+  !
+  !   WARNINGS:
+  !   Still work in progress on many aspects.
+  !   The PAW dataset is written in a temporary format which is not supposed
+  !   to be used any longer.
+  !   Consistency with the input of the ld1 code yet to be checked
+  !
+  !   Written by Guido Fratesi, february 2005
+  !   Modified by Riccardo Mazzarello, july 2006
+  !   Fully Relativistic generalization by Andrea Dal Corso, november 2009 
+  !   Other people involved: Lorenzo Paulatto and Stefano de Gironcoli
+  !
+  !============================================================================
+  !
+  USE kinds,            ONLY: dp
+  USE ld1_parameters,   ONLY: nwfsx
+  USE parameters,       ONLY: lmaxx
+  USE constants,        ONLY: pi, fpi, e2, eps8
+  USE radial_grids,     ONLY: ndmx, radial_grid_type
+  USE paw_type,         ONLY: paw_t, nullify_pseudo_paw, allocate_pseudo_paw
+  !
+  IMPLICIT NONE
+  PRIVATE
+  SAVE
+  !
+  REAL(dp), PARAMETER :: ZERO=0._dp, ONE=1._dp, TWO=2._dp, HALF=0.5_dp
+  !
+  ! TEMP, to be substituted by module constants
+!   REAL(dp), PARAMETER :: &
+!        PI=3.14159265358979323846_dp, FPI=4._dp*PI, E2=2._dp, EPS8=1.0e-8_dp
+  !
+  !============================================================================
+  !
+  PUBLIC :: paw_t
+  PUBLIC :: us2paw
+  PUBLIC :: paw2us
+  PUBLIC :: check_multipole
+  PUBLIC :: new_paw_hamiltonian
+  PUBLIC :: find_bes_qi
+  PUBLIC :: compute_nonlocal_coeff_ion
+  !
+CONTAINS
+  !
+  !============================================================================
+  !                          PUBLIC ROUTINES                                !!!
+  !============================================================================
+  !
+  ! Compute the values of the local pseudopotential and the NL coefficients
+  ! Compute also the total energy
+  ! 
+  SUBROUTINE new_paw_hamiltonian (veffps_, ddd_, etot_, &
+       pawset_, nwfc_, l_, j_, nspin_, spin_, oc_, pswfc_, eig_, paw_energy,dddion_)
+    IMPLICIT NONE
+    REAL(dp), INTENT(OUT) :: veffps_(ndmx,2)
+    REAL(dp), INTENT(OUT) :: ddd_(nwfsx,nwfsx,2)
+    REAL(dp), INTENT(OUT) :: etot_
+    TYPE(paw_t),   INTENT(IN)  :: pawset_
+    INTEGER,       INTENT(IN)  :: nwfc_
+    INTEGER,       INTENT(IN)  :: l_(nwfsx)
+    INTEGER,       INTENT(IN)  :: nspin_
+    INTEGER,       INTENT(IN)  :: spin_(nwfsx)
+    REAL(dp), INTENT(IN)  :: j_(nwfsx)
+    REAL(dp), INTENT(IN)  :: oc_(nwfsx)
+    REAL(dp), INTENT(IN)  :: pswfc_(ndmx,nwfsx)
+    REAL(dp), INTENT(IN)  :: eig_(nwfsx)
+    REAL(dp), OPTIONAL :: dddion_(nwfsx,nwfsx)
+    REAL(dp), INTENT(OUT), OPTIONAL :: paw_energy(5,3) 
+    !
+    REAL(dp) :: &                                        ! one center:
+         eps,             e1,             e1ps,             & ! energies;
+                          veff1(ndmx,2),   veff1ps(ndmx,2),   & ! eff potentials;
+         chargeps(ndmx,2), charge1(ndmx,2), charge1ps(ndmx,2), & ! charges.
+         projsum(nwfsx,nwfsx,2), eigsum !  sum of projections, sum of eigenval.
+    !
+    INTEGER :: ns, is, n
+    REAL(dp) :: energy(5,3)
+    !
+    ! Compute the valence charges
+    CALL compute_charges(projsum, chargeps, charge1, charge1ps, &
+       pawset_, nwfc_, l_, j_, nspin_, spin_, oc_, pswfc_, 1 )
+ !
+ !  Check for negative charge
+ !
+     do is=1,nspin_
+        do n=2,pawset_%grid%mesh
+!           write(6,*) n, pawset_%grid%r(n), chargeps(n,is)
+           if (chargeps(n,is)<-1.d-12) &
+                   call  errore('new_paw_hamiltonian','negative rho',1)
+        enddo
+     enddo
+
+!     write(766,"(4f12.6)") (pawset_%grid%r(ns), chargeps(ns,1), charge1(ns,1), charge1ps(ns,1), ns=1,pawset_%grid%mesh)
+!     write(767,"(4f12.6)") (pawset_%grid%r(ns), chargeps(ns,2), charge1(ns,2), charge1ps(ns,2), ns=1,pawset_%grid%mesh)
+    !
+    ! Compute the one-center energy and effective potential:
+    ! E = Eh[n_v] + Exc[n_v+n_c] - Int[veff*n_v],
+    ! veff = vh[n_v] + v_xc[n_v+n_c],
+    ! where n_v can be n~+n^ or n1 or n1~+n^ and n_c can be nc or nc~
+    ! n~+n^ , nc~
+    CALL compute_onecenter_energy ( eps,  veffps_, &
+       pawset_, chargeps,  pawset_%nlcc, pawset_%psccharge, nspin_,&
+             pawset_%grid%mesh, pawset_%psloc, energy(1,1))
+    ! n1 , nc
+    CALL compute_onecenter_energy ( e1,   veff1, &
+       pawset_, charge1,  .TRUE.,        pawset_%aeccharge, nspin_,&
+            pawset_%irc, pawset_%aeloc, energy(1,2))
+    ! n1~+n^ , nc~
+    CALL compute_onecenter_energy ( e1ps, veff1ps, &
+       pawset_, charge1ps, pawset_%nlcc, pawset_%psccharge, nspin_,&
+            pawset_%irc, pawset_%psloc, energy(1,3))
+    ! Add the local part
+    DO is=1,nspin_
+       veffps_(1:pawset_%grid%mesh,is) = veffps_(1:pawset_%grid%mesh,is) +  &
+            pawset_%psloc(1:pawset_%grid%mesh)
+       veff1  (1:pawset_%grid%mesh,is) = veff1  (1:pawset_%grid%mesh,is) +  &
+            pawset_%aeloc(1:pawset_%grid%mesh)
+       veff1ps(1:pawset_%grid%mesh,is) = veff1ps(1:pawset_%grid%mesh,is) +  &
+            pawset_%psloc(1:pawset_%grid%mesh)
+    END DO
+    !
+    ! Compute the nonlocal D coefficients
+    CALL compute_nonlocal_coeff (ddd_,pawset_,nspin_,veffps_,veff1,veff1ps)
+    IF (PRESENT(dddion_)) THEN
+       CALL compute_nonlocal_coeff_ion (dddion_,pawset_)
+    END IF
+    !
+    ! Compute total energy
+    eigsum=ZERO
+    DO ns=1,nwfc_
+       IF (oc_(ns)>ZERO) eigsum = eigsum + oc_(ns)*eig_(ns)
+    END DO
+    etot_ = eigsum + eps + e1 - e1ps
+
+    if (PRESENT(paw_energy)) paw_energy=energy
+    !
+  END SUBROUTINE new_paw_hamiltonian
+  !
+  !============================================================================
+