c    @(#)pois.f	1.2
c
      subroutine pois (iflag,nperod,n,mperod,m,a,b,c,idimy,y,w)
      external         trid       ,tridp
      dimension  w(6*n+5*m)       ,b(m)       ,a(m)       ,c(m)       ,
     1           y(idimy,n)
      iwdim1 = 5.25*n+1
      iwdim2 = iwdim1+m
      iwdim3 = iwdim2+m
      iwdim4 = iwdim3+m
      iwdim5 = iwdim4+m
          do 102 i=1,m
          a(i) = -a(i)
          c(i) = -c(i)
  101     w(iwdim5+i-1) = -b(i)+2.
  102     continue
      if (mperod.eq.0) go to 103
      call poisgn (nperod,n,iflag,m,a,w(iwdim5),c,idimy,y,w(1),
     1             w(iwdim1),w(iwdim2),w(iwdim3),w(iwdim4),trid)
      go to 104
  103 call poisgn (nperod,n,iflag,m,a,w(iwdim5),c,idimy,y,w(1),
     1             w(iwdim1),w(iwdim2),w(iwdim3),w(iwdim4),tridp)
  104     do 106 i=1,m
          a(i) = -a(i)
  105     c(i) = -c(i)
  106     continue
  107 return
      end
