      subroutine c_hab1(it,ip,nt,np,dum,it4,ip4,nocz,nvz,
     *stvp,stv,stpv,spv,stvpv)
      implicit real*8 (a-h,o-x,z),logical*1(y)
      parameter (nexci=2,ngru3=2048)
      parameter(maxsym=8)
      include 'maxorb.prm'
      parameter(maxorbcas=16)
      dimension it4(1),ip4(1)
      dimension it(1),ip(1)
c      dimension ecp(nvz),ect(nocz)
c      common /orb/ enuc,eref,norb,noca,nocb
c     *,iorb(2*maxorb),ninac,nvirt,noca0
c      common/csc2/ nicdi,nv2,norbs,nocas,nvs,ii28,itptp1,itptp2
      common /cstes_hab/sttpp,sttp,stt,stpp,stp,st,spp,sp
      real*4 stvp(nocz),stv(nocz),stpv(nvz),spv(nvz),stvpv(nocz,nvz)
c      common /cs/ noac,nelac,numac(maxorbcas),itype(maxorb),is0,ms2
c      common/sym/ itsym(maxorb*2),its(maxsym,maxsym),nsym
c      common/l40/ hmono(maxorb*(maxorb+1)/2),aj(maxorb*(maxorb+1)/2)
c     *,ak(maxorb*(maxorb+1)/2),f(maxorb*(maxorb+1)/2),e0
c     *,ajk(maxorb*(maxorb+1)/2),escf
      yw=.false.
      if(yw)write(6,'('' it,ip,it4,ip4 '',4i3,2x,4i3)')it,ip,it4,ip4
c
      if(nt.eq.1) then
         if(np.eq.1) then
c******* nt=1 np=1
c ------ epv : 1 dimension : 1t ou 1p
c ------ epv : 2 dimensions: 1t/1p
c ------ cstes
            stp=stp+dum
c ---      + CAS
            stpv(ip4(1))=stpv(ip4(1))+dum
            stvp(it4(1))=stvp(it4(1))+dum
            stvpv(it4(1),ip4(1))=stvpv(it4(1),ip4(1))+dum
c ---
c******* nt=1 np=0
         else if(np.eq.0) then
c ------ epv : 1 dimension : 1t
c ------ cstes
            st=st+dum
c ---      + CAS
            stpv(ip4(1))=stpv(ip4(1))+dum
            stvpv(it4(1),ip4(1))=stvpv(it4(1),ip4(1))+dum
c ---
            stv(it4(1))=stv(it4(1))+dum
c ---
         endif
c ---
c******* nt=0 np=1
      else     if(nt.eq.0) then
         if(np.eq.1) then
c ------ epv : 1 dimension : 1p
c ------ cstes
 
            sp=sp+dum
c ---        + CAS
            stvp(it4(1))=stvp(it4(1))+dum
c           print*,'it4(1),ip4(1)',it4(1),ip4(1)
            stvpv(it4(1),ip4(1))=stvpv(it4(1),ip4(1))+dum
c ---
            spv(ip4(1))=spv(ip4(1))+dum
         endif
      endif
      return
      end
