      subroutine width(wzs,wzc,avdx,avdy,akx2,aky2,wh,meq,neq)
c
      include 'itg.par'
c
      dimension wxx(mz,nz),wh(mz,nz),wyy(mz,nz)
     * ,wkxs(mz,nz),wkxc(mz,nz),wzs(lz,mz,nz,nspecz),
     * wzc(lz,mz,nz,nspecz)
      include 'post.cmn'
c
      call kenrgyp(wzs,eksx,eksy,wkis,wkxs,wxx,wyy)
      call kenrgyp(wzc,ekcx,ekcy,wkic,wkxc,wxx,wyy)
      call penrgyp(wzs,wk2s,wxx)
      call penrgyp(wzc,wk2c,wyy)
      ekx=eksx+ekcx
      eky=eksy+ekcy
      wk2=wk2s+wk2c
      akx2=ekx/wk2
      aky2=eky/wk2
      avdx=sqrt(1.0/akx2)
      avdy=sqrt(1.0/aky2)
c
      do 10 n=1,nd
      do 10 m=1,md
      if(m.eq.meq.and.n.eq.neq) goto 10      
      dnom=wxx(m,n)+wyy(m,n)
      if(dnom.lt.1.0e-33) then
      wh(m,n)=0.0
      else
      akx2=(wkxs(m,n)+wkxc(m,n))/dnom
      wh(m,n)=sqrt(1.0/akx2)
      endif
   10 continue
c
      return
      end

