C     **************
      SUBROUTINE ADD(NVH,NVL,IPM,WK3,WK2,WK1)
C     **************
C
C
      DOUBLE PRECISION WK1(NVH,18),WK2(NVH,18),WK3(NVH,18)
C
C
      IF( IPM .EQ. 1 ) THEN
C
C
C         IN THIS CASE THE PRAEFACTOR IS EQUAL TO (-I)
C
C
          DO 10 J = 1,18
C
          JM = MOD(J+8,18) + 1
C
          DO 1 IVL = 1,NVL
    1     WK3(IVL,J) = WK2(IVL,J) - WK1(IVL,JM)
C
   10     CONTINUE
C
      ENDIF
C
      IF( IPM .EQ. 2 ) THEN
C
C
C         IN THIS CASE THE PRAEFACTOR IS EQUAL TO (-1)
C
C
          DO 20 J = 1,18
C
          DO 2 IVL = 1,NVL
    2     WK3(IVL,J) = WK2(IVL,J) - WK1(IVL,J)
C
   20     CONTINUE
C
      ENDIF
C
      IF( IPM .EQ. 3 ) THEN
C
C
C         IN THIS CASE THE PRAEFACTOR IS EQUAL TO (+I)
C
C
          DO 30 J = 1,18
C
          JM = MOD(J+8,18) + 1
C
          DO 3 IVL = 1,NVL
    3   WK3(IVL,J) = WK2(IVL,J) + WK1(IVL,JM)
C
   30     CONTINUE
C
      ENDIF
C
      IF( IPM .EQ. 4 ) THEN
C
C
C         IN THIS CASE THE PRAEFACTOR IS EQUAL TO (+1)
C
C
          DO 40 J = 1,18
C
          DO 4 IVL = 1,NVL
    4     WK3(IVL,J) = WK2(IVL,J) + WK1(IVL,J)
C
   40     CONTINUE
C
      ENDIF
C
C
      RETURN
      END
