      SUBROUTINE ETADIF(JDIM,KDIM,X,Y,XY)
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      COMMON/BASE/
     1  JMAX,       KMAX,     JM,          KM,          JBEGIN,   JEND,
     1  KBEGIN,     KEND,     JPLUS(999),  JMINU (999), JLOW,     JUP,
     1  KLOW,       KUP,      PERIDC  ,    NP,          DT,   CP2TIM,
     1  FSMACH,     ALPHA,    GAMMA,       GAMI,        PI,
     1  DIS2X,      DIS2Y,    DIS4X,       DIS4Y,       PHIDT,    
     1  THETAD ,    RESID,    JACDT,       IPRINT,      NPCP,
     1  JTAIL1,     JTAIL2,   NUMITE ,     ISTART,      NSTEPS
      LOGICAL PERIDC  
      COMMON/GRID/DYM,YMAX,XMIN,XMAX,THICK
C
      DIMENSION XY(JDIM,KDIM,4)
      DIMENSION X(JDIM,KDIM),Y(JDIM,KDIM)
C
C  XY2 = XETA, XY1 = YETA
C
      DO 21 J=JBEGIN,JEND
         DO 20 K=KLOW,KUP
            XY(J,K,2) = ( X(J,K+1) - X(J,K-1))*.5
            XY(J,K,1) = ( Y(J,K+1) - Y(J,K-1))*.5
20       CONTINUE
         K = KBEGIN
         XY(J,K,2) = ( -3.*X(J,K) +4.*X(J,K+1) - X(J,K+2))*.5
         XY(J,K,1) = ( -3.*Y(J,K) +4.*Y(J,K+1) -Y(J,K+2))*.5
         K = KEND
         XY(J,K,2) = ( 3.*X(J,K) -4.*X(J,K-1) + X(J,K-2))*.5
         XY(J,K,1) = ( 3.*Y(J,K) -4.*Y(J,K-1) + Y(J,K-2))*.5
   21 CONTINUE
C
C
         RETURN
         END
