      DOUBLE PRECISION FUNCTION DQWGTF (X, OMEGA, P2, P3, P4, INTEGR)
C
      DOUBLE PRECISION OMEGA,OMX,P2,P3,P4,X
      INTEGER INTEGR
C***FIRST EXECUTABLE STATEMENT  DQWGTF
      OMX = OMEGA*X
      GO TO(10,20),INTEGR
   10 DQWGTF = COS(OMX)
      GO TO 30
   20 DQWGTF = SIN(OMX)
   30 RETURN
      END
