      subroutine calmpp(max_p,np,ip,ispp)
      IMPLICIT REAL*8(A-H,O-X,Z),LOGICAL*1 (Y)
      parameter(maxsym=8,maxorbcas=16)
      include 'maxorb.prm'
      common/sym/ itsym(maxorb*2),its(maxsym,maxsym),nsym
      common /orb/ enuc,eref,norb,noca,nocb
     *,iorb(2*maxorb),ninac,nvirt,noca0
      common /co_max/ maxtt(2,maxsym,0:1),maxpp(0:2,maxsym,0:1)
      dimension ip(2)
      yw=.false.
      yw1=.false.
      if(np.eq.0) then
         max_p=1
      else
         if(np.eq.1) then
            isp=itsym(iorb(ip(1)))
         else
            isp=its(itsym(iorb(ip(1))),itsym(iorb(ip(2))))
         endif
         jspin=iabs(ispp)
         if(jspin.eq.2) jspin=1
         max_p=maxpp(np,isp,jspin)
      endif
      if(yw)write(6,*)'np,isp,ispp,max_p',np,isp,ispp,max_p
      return
      end
