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:        !rhos(ndmx,2), i guess this is up and down density. with nspin=1 only 1 channel here is nonzero
         !(check this again later, i might have the wrong channel ^)
  
         !set the projector stuff
         info%have_kb=.true.
         info%kb_l_local=lloc
         info%kb_n_proj=nbeta
         !allocate(info%kb_l(info%kb_n_proj))
         !info%kb_l(:)=pawsetup%l(:)
         allocate(info%kb_v_local(ndmax))
         info%kb_v_local(:)=vpsloc(:)
         allocate(info%kb_proj(ndmx,nwfsx))
         info%kb_proj(:,:)=betas(:,:)
         allocate(info%kb_l(nbeta))
         info%kb_l=lls
         allocate(info%kb_j(nbeta))
         !just pretend that we can calculate this from j=l+/-s
         do i=1,nbeta,1!most likly wrong all the s values are 1
          info%kb_j(i)=lls(i)+isws(i)!isws is the spin of the pseudowavefunction
         enddo
         allocate(info%kb_e(nbeta))
         !just pretend that we can calculate this from wfs_ev
         do i=1,nbeta,1
          info%kb_e(i)=info%wfs_ev(i)
         enddo
  
         !set xc stuff
         info%ixc=1!this should be set as a constant for now, check code later on to see how to integrate it properly
         info%nlcc=nlcc
  
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
  