c    @(#)yofij.f	1.1
c
c
c
      function yofij(i,j)
      include 'qg_par.inc'
      common/cnn/n,nm1,nm2,np1
      common/parm/kz,m,mm1,mm2,mp1,msq,tim,tmax,tstart,hy,rea,dt,
     +  xbasin,yy(mx0),icalc,kzp1,kzm1,iftop,ifbot,iftvv,ifrel,theta,
     +   ifsbl,ifeva

c
      if(icall.ne.0)goto 10
      rm=(m+1)/2.0
      rn=(n+1.)/2.
      c2=cos(theta)*hy
      c1=sin(theta)*hy
      icall=1
   10 continue
      ri=i-rm
      rj=j-rn
      yofij=c1*ri+c2*rj
      return
      end
