anchor.diff:        module siesta_pass
         !APE modules (modified)
         use global
  -      use mesh, only: mesh_null, mesh_type, mesh_generation, mesh_end, mesh_transfer
  +      use mesh, only: mesh_null, mesh_type, mesh_generation, mesh_end,&
  +      mesh_transfer
         !QE modules
         use radial_grids, only: radial_grid_type,ndmx
  -      use ld1inc, only: zed,enne,zval,nwf,nn,ll,jj,el,rcut,octsc,enltsc,&
  -      phis,lloc,nbeta,rhos,pawsetup,enls,vpsloc,betas,rho,lls,isws,nlcc,&
  +      use ld1inc, only: zed,enne,zval,nwf,nn,ll,jj,el,rcut,octsc,&
  +      enltsc,phis,lloc,nbeta,rhos,pawsetup,enls,vpsloc,betas,rho,&
  +      lls,isws,nlcc,&
         rhoc,rcore,nns,nwfs,vnl,ikk
         use ld1_parameters, only: nwfx,nwfsx
   
  
positive.code:        type(ps_io_type) :: info
         print *, "call the ps fill up routine"
         call ps_io_type_fill(grid_in,info)
         print *, "core charge"
         print *, info%rho_core(1)
         call ps_io_save(info)
        endsubroutine siesta_output
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
negative.code:        !set pseudo_potentials
         info%have_psp=.true.
         info%n_psp=nwfs
  
         !the l components are equal to those of the wavefunctions
         allocate(info%psp_l(nwfs))
         info%psp_l=lls(:nwfs)
  
         !this is for spin polarised crap !ignore for now 
         allocate(info%psp_j(nwfs))
         do i=1,nwfs,1
         info%psp_j(i)=M_ZERO!not needed for non spin polarised 
         enddo
  
         allocate(info%psp_v(ndmx,4))
  
         do lam=1,4
           do n=1,ndmx
  !           !info%psp_v(n,lam)= (vnl(n,lam,1)+m%r(n)*0.5*vpsloc(n))
  !           !info%psp_v(n,lam)= (vnl(n,lam,1)+0.5*vpsloc(n))
              info%psp_v(n,lam)= (vnl(n,lam,1)+0.5*vpsloc(n))
           enddo
         enddo
  !
  !       l=0
  !       n=1
  !
  !       !do while (abs(info%psp_v(n,l)) .gt. 0.00012)
  !       !do while (abs(info%psp_v(n,l)) .gt. 0.0012)
  !       !  info%wfs_rc(l)=info%m%r(n)
  !       !  n=n+1
  !       !enddo
  !       print *, "these are the droids you're looking for."
  !       print *,  info%wfs_rc(:)
  !
  !!       do l=0,4
  !!       !do ir=1,ndmx
  !!       do ir=1,ndmx
  !!       !!it should always be vnl(:,l,1), i.e. non relativistic
  !!       !info%psp_v(ir,l)= (vnl(ir,l,2)+vpsloc(ir)*0.5)
  !!       !info%psp_v(ir,l)= (vpsloc(ir)*0.5)
  !!       !info%psp_v(ir,l)= (vnl(ir,l,2))
  !!       info%psp_v(ir,l)= m%r(ir)*(vnl(ir,l,1)+vpsloc(ir))
  !!       enddo
  !!       enddo
        endsubroutine ps_io_type_fill
  
        subroutine ps_io_save(info)!this seems only necessary to setup the filename and assign io units
  