      SUBROUTINE DMS2DEG(IDEG,MIN,SEC,DEG)
C
C     CONVERT DEGREES, MINUTES, SECONDS TO DEGREES AND FRACTION
C
C     B. KNAPP, 2000-12-28, 2001-04-24 (i*4)
C
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      IMPLICIT NONE
      INTEGER*4 IDEG,MIN
      REAL*8 DEG,SEC
C
      DEG=DBLE(ABS(IDEG))+DBLE(ABS(MIN))/60.0D0+ABS(SEC)/3600.0D0
C
C     HANDLE SIGN
      IF (IDEG.NE.0) THEN
         DEG = SIGN(DEG,DBLE(IDEG))
      ELSE IF (MIN.NE.0) THEN
         DEG = SIGN(DEG,DBLE(MIN))
      ELSE
         DEG = SIGN(DEG,SEC)
      ENDIF
C
      RETURN
      END
