      SUBROUTINE XYMETS(JDIM,KDIM,X,Y,XY,XIT,ETT,XYJ,WORK)
      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),XYJ(JDIM*KDIM)
      DIMENSION XIT(JDIM*KDIM),ETT(JDIM*KDIM)
      DIMENSION X(JDIM*KDIM),Y(JDIM*KDIM)
      DIMENSION WORK(JDIM*KDIM*4)
C
C
C    COMPUTE XI DERIVATIVES OF X, Y
C
       CALL XIDIF(JDIM,KDIM,X,Y,XY)
C
C   COMPUTE  ETA DERIVATIVES OF X, Y
C
       CALL ETADIF(JDIM,KDIM,X,Y,XY)
C
C   FORM METRICS AND JACOBIAN
C
       CALL CALCME(JDIM,KDIM,XY,XIT,ETT,XYJ)
C  
      RETURN
      END
