      FUNCTION NADANG(HCTANG,STPANG,ANGCOR,SPOT)
C***********************************************************************
C
C    NAME- NADANG
C
C    LANGUAGE- VS FORTRAN     TYPE- SUBROUTINE  COMPUTER- NAS9000
C
C    VERSION- 1.0    DATE- 4/1/91   PROGRAMMER CARLA NEIGH(SMSRC)
C    VERSION- 3.0    DATE- 4/28/96  PROGRAMMER TIM GARDNER (HSTX)
C
C    FUNCTION- THIS FUNCTION RETURNS ANGLE FROM NADIR FOR A SPOT FOR
C              ANY INSTRUMENT GIVEN THE CONSTANTS HCTANG, STPAND,
C              ANGCOR AND THE SPOT NUMBER  (NEGATIVE VALUES OF NADANG
C              INDICATE IN THE DIRECTION OF THE SUN)
C
C    VERSION 3.0- DOCUMENTATION AND SYNTAX CHANGES FOR ATOVS BASELINE
C                 ON THE CRAY.
C
C    CALLING SEQUENCES-
C      VARIABLE  TYPE  I/O  DESCRIPTION
C      --------  ----  ---  -----------
C      HCTANG    REAL   I   HALF THE CROSS-TRACK SCAN ANGLE FOR
C                           FOR INSTRUMENT; NEGATIVE IF THE DIRECTION
C                           OF SCAN IS FROM LEFT TO RIGHT ACROSS THE
C                           VECTOR OF THE SATELLITE MOTION, POSITIVE
C                           IF RIGHT TO LEFT (FROM CDB)
C      STPANG    REAL   I   STEP ANGLE FOR THE INSTRUMENT; POSITIVE
C                           IF THE DIRECTION OF SCAN IS FROM LEFT TO
C                           RIGHT ACROSS THE VECTOR OF SATELLITE
C                           MOTION, NEGATIVE IF FROM RIGHT TO LEFT
C                           (FROM CDB)
C      ANGCOR    REAL   I   ANGLE CORRECTION FOR INSTRUMENT MISALIGNMENT
C                           (FROM CDB)
C      SPOT      INT    I   NUMBER OF SPOT FROM THE BEGINNING OF SCAN
C                           LINE, STARTING WITH 1
C
C   EXIT STATES- NONE
C
C   COMMENTS:  VALUES OF HCTANG, STPANG, AND ANGCOR GIVEN IN RADIANS
C              GIVE OUTPUT OF NADANG IN RADIANS; VALUES IN DEGREES
C              GIVE OUTPUT IN DEGREES
C
C***********************************************************************
      REAL HCTANG, STPANG, ANGCOR, NADANG
      INTEGER SPOT
C
      INCLUDE'SPVAL'
C
C  INITIAL VALUE OF ANGLE FROM NADIR
C
      NADANG = R4SPV
C
C  COMPUTE ANGLE FROM NADIR
C
      NADANG = HCTANG + STPANG*(SPOT-1) + ANGCOR
C
      RETURN
      END
