C$$$  SUBPROGRAM DOCUMENTATION BLOCK
C                .      .    .                                       .
C SUBPROGRAM:    MSFCRDSTA   READ SFC STATION INFO FROM NETCDF FILE
C   PRGMMR: M. BARTH         ORG: FSL        DATE: 99-09-14
C
C ABSTRACT: INPUT SFC STATION INFO FROM A SINGLE, OPEN NETCDF FILE.
C
C PROGRAM HISTORY LOG:
C   98-04-07  M. BARTH    ORIGINAL VERSION
C   98-07-24  M. BARTH    MODIFIED TO PUT WMO ID'S INTO LDAD MESONET
C                         STATION NAMES THAT HAVE BLANK NAMES BUT DO
C                         HAVE ID'S.
C   98-07-24  M. BARTH    CHANGED OBTIME CALCULATION FOR NEW I4TIME.
C   99-05-03  M. BARTH    FSL FACILITY MARITIME FILES REPLACE OLD
C                         BUOY FILES.  (STILL CALLED BUOY HERE, BUT
C                         LOOK JUST LIKE WFOA FACILITY FILES.)
C   99-09-06  M. BARTH    - ADDED ELEVATION PROCESSING FOR BUOYS.
C                         - FIXED BUG IN HANDLING MESONET WMOID.
C   99-09-14  M. BARTH    COPIED FROM MSAS RDQCIDS ROUTINE AND
C                         MODIFIED FOR MADIS.
C   00-03-22  M. BARTH    - RENAMED MXST_P TO MXSFC_P
C                         - DIMENSIONED LOCAL ARRAYS FOR 4 HOURS
C                         - CHANGED STAID FROM 5 TO 8 CHARACTERS
C   01-04-24  M. BARTH    - CHANGED MESONET TIME HANDLING, INCLUDING
C                           A CHECK TO MAKE SURE THAT RECEIVED TIME
C                           IS LATER THAN OBTIME
C                         - PROTECT AGAINST PARTIALLY-WRITTEN MESONET
C                           RECORDS
C   01-06-29  M. BARTH    - REMOVED PSOS AND GSOS DATASETS
C                         - SET AWIPS METAR ELEVS OF -1 TO MISS_P
C   01-07-25  M. BARTH    - STAID CHANGED FROM 8 TO 10 CHARACTERS
C                         - CHANGED METAR SUBCATEGORIES TO
C                           ASOS, AUTO-MTR, OTHER-MTR & ADDED
C                           ALL-MTR CATEGORY
C   02-06-03  M. BARTH    CALL M_UPDSRCIN TO UPDATE THE SFCSRCIN TABLE 
C                         FROM REAL-TIME MESONET DATA
C   02-07-29  M. BARTH    KEEP NAN'S OUT OF VARIABLES FOR FILLVALS.
C   03-05-27  M. BARTH    - ASOS STATIONS IN STN_VEC NOW IDENTIFIED BY
C                           THE FULL FIVE CHARACTERS.
C                         - REMOVED AUTO-MTR DESIGNATION, THESE NOW
C                           GET LUMPED INTO OTHER-MTR.
C   04-03-22  M. BARTH    ADDED COOP DATASET.
C   05-11-29  L. BENJAMIN ADDED DTIME COMMON BETWEEN DATASETS
C                         COMBINED SAME USAGE, DIFFERENT SIZED NAMES 
C                         INTO AN EQUIVALENCE
C   06-02-13  L. BENJAMIN CHANGED MEMORY LOCATION FOR LOCAL VARIABLES
C   06-08-01  L. BENJAMIN ADDED URBANET DATASET.
C   08-06-23  M. BARTH    ADDED HIGH FREQUENCY METAR DATASET.
C   09-07-23  L. BENJAMIN ADDED NEPP, HCN, AND CRN AS A SFC DATASETS.
C
C USAGE:    CALL MSFCRDSTA (SOURCE,NCID,RECDIM,STARTR,NRECS,NDSTA,
C                           OBTIME,STAID,WMOID,PROVDR,LAT,LON,ELEV,
C                           SUBSRC,ATYPE,RTYPE,STATUS)
C
C   INPUT ARGUMENT LIST:
C     SOURCE   - I       DATASET CODE NUMBER
C     NCID     - I       ID OF THE OPEN NETCDF QC FILE
C     RECDIM   - I       DIMENSION ID OF THE FILE'S RECORD DIMENSION
C     STARTR   - I       STARTING RECORD TO READ
C     NRECS    - I       NUMBER OF RECORDS TO READ
C     NDSTA    - I       SIZE TO USE FOR STATION DIMENSION IN ARRAYS
C
C   OUTPUT ARGUMENT LIST:
C     OBTIME   - IA      TIMES FOR THE OB RECORDS
C     STAID    - CA      STATION NAMES FOR THE OB RECORDS
C     WMOID    - IA      WMO IDS FOR THE OB RECORDS
C     PROVDR   - CA      PROVIDER NAMES FOR THE OB RECORDS
C     LAT      - RA      LATITUDES FOR THE OB RECORDS
C     LON      - RA      LONGITUDES FOR THE OB RECORDS
C     ELEV     - RA      STATION ELEVATION FOR THE OB RECORDS
C     SUBSRC   - IA      SUBSRC NUMBERS FOR THE OB RECORDS
C     ATYPE    - CA      AUTO STATION TYPE FOR THE OB RECORDS
C     RTYPE    - CA      REPORT TYPE FOR THE OB RECORDS
C     STATUS   - I       SUCCESS_P OR ERROR CODE
C
C   INPUT FILES:
C     NETCDF FILE OPEN WITH NCID ID
C
C SUBPROGRAMS CALLED:
C     LIBRARY: - NETCDF LIBRARY:
C                NCAGT
C                NCDINQ
C                NCINQ
C                NCVGT
C                NCVGTC
C                NCVID
C                NCVINQ
C     UNIQUE:  - M_IDSUBSRC
C                M_LSTCHR
C                M_MARELV
C                M_UPDSRCIN
C                MERROR
C
C REMARKS:
C   - SOME OF THE RETURNED ARRAYS ONLY HAVE INFO FOR SOME SOURCES.
C   - CHARACTER ARRAYS ARE BLANK-FILLED TO THE RIGHT AND ONLY THE
C     MAXIMUM SIZE THAT CAN HAVE CHARACTERS ARE ACTUALLY RETURNED
C     (E.G., ATYPE DIMENSION IS 6 CHAR, BUT LAST ONE IS ZERO-
C     TERMINATOR FOR C-CODE --> WE TURN THIS INTO 5 CHAR).
C
C ATTRIBUTES:
C   LANGUAGE: FORTRAN-77 + EXTENSIONS
C   MACHINE:  UNIX
C$$$






      SUBROUTINE MSFCRDSTA(SOURCE,NCID,RECDIM,STARTR,NRECS,NDSTA,OBTIME,
     1                     STAID,WMOID,PROVDR,LAT,LON,ELEV,SUBSRC,ATYPE,
     2                     RTYPE,STATUS)





C     ------------------------------------------------------------------
C     INCLUDES AND COMMONS
C     ------------------------------------------------------------------
      INCLUDE 'IMPLICIT'
      INCLUDE 'MADISCON'
      INCLUDE 'MADISCOM'
      INCLUDE 'NETCDFI'
      INCLUDE 'MADISTMP'


C     ------------------------------------------------------------------
C     ARGUMENTS
C     ------------------------------------------------------------------

      INTEGER       SOURCE
      INTEGER       NCID
      INTEGER       RECDIM
      INTEGER       STARTR
      INTEGER       NRECS
      INTEGER       NDSTA
      INTEGER       OBTIME(NDSTA)
      INTEGER       SUBSRC(NDSTA)
      CHARACTER*10  STAID(NDSTA)
      CHARACTER*10  PROVDR(NDSTA)
      REAL          ELEV(NDSTA)
      REAL          LAT(NDSTA)
      REAL          LON(NDSTA)
      INTEGER       WMOID(NDSTA)
      INTEGER       STATUS
      CHARACTER*5   ATYPE(NDSTA)
      CHARACTER*5   RTYPE(NDSTA)

C     ------------------------------------------------------------------
C     LOCAL
C     ------------------------------------------------------------------
      INTEGER       LSTAID
      PARAMETER     (LSTAID = 10)
      INTEGER       I,J,K,N,NT
      INTEGER       M_LSTCHR
      INTEGER       RCODE
      CHARACTER*(MAXNCNAM) VARNAM,DIMNAM
      INTEGER       VDIMS(MAXVDIMS),DIMSIZ,NVDIMS,LENSTR
      INTEGER       VARTYP,NVATTS,START(MAXVDIMS),COUNT(MAXVDIMS)
      CHARACTER*5   C5(MXSFC_P*4)
      CHARACTER*6   C6(MXSFC_P*4)
      CHARACTER*8   C8(MXSFC_P*4)
      CHARACTER*11  DPNAME(MXSFC_P*4)
      CHARACTER*15  TIMNAM(3)
      CHARACTER*10  SRC
      INTEGER       IDLEN,NTIME,ISRC
      REAL          ELEV_FILL
      INTEGER       WMOID_FILL
      REAL          LAT_FILL
      REAL          LON_FILL
      INTEGER       METARTYPE_FILL
      LOGICAL       HAVE_FILL,HAVE_MISS,HAS_WMOID
      DOUBLE PRECISION DTIME(MXSFC_P*4,3),DTIME_FILL(3)
      INTEGER METARTYPE(MXSFC_P*4)
      REAL MISVAL
      PARAMETER (MISVAL = -9999.0)

      EQUIVALENCE(C5,C6,C8,DPNAME,TMP_L2_C2)
      EQUIVALENCE(DTIME,TMP_L2_N1)
      EQUIVALENCE(METARTYPE,TMP_L2_N2)

C     *****************************************************************
C     ******************* BEGIN OF MODULE *****************************
C     *****************************************************************

      STATUS = NC_READ_P

C     ------------------------------------------------------------------
C     FILL IN DATA STRUCTURES NEEDED TO READ MOST OF THE VARIABLES
C     FROM NETCDF FILES, DEPENDING ON THE SOURCE.  ALSO HANDLE ANY
C     SOURCE-SPECIFIC INITIALIZATION.
C     ------------------------------------------------------------------
      IF(SOURCE .NE. MESONET_DS_P .AND. SOURCE .NE. COOP_DS_P .AND. 
     1     SOURCE .NE. URBANET_DS_P .AND. SOURCE .NE. HFMETAR_DS_P 
     2     .AND. SOURCE .NE. NEPP_DS_P .AND. SOURCE .NE. HCN_DS_P
     3     .AND. SOURCE .NE. CRN_DS_P)THEN
         TIMNAM(1) = 'timeObs'
      ELSE
         TIMNAM(1) = 'observationTime'
      ENDIF

      IF(SOURCE .EQ. METAR_DS_P .OR. SOURCE .EQ. SAO_DS_P)THEN

         NTIME = 1
         IDLEN = 5
         HAS_WMOID = .TRUE.
         IF(SOURCE .EQ. METAR_DS_P)THEN
            SRC = 'OTHER-MTR '
            ISRC = 3
         ELSE
            SRC = 'SAO       '
            ISRC = 4
         ENDIF

C     ------------------------------------------------------------------
C     GET THE AUTO STATION TYPE.
C     ------------------------------------------------------------------
         J = NCVID(NCID,'autoStationType',RCODE)
         IF(RCODE.NE.0)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVID - ATYPE')
            GO TO 900
         ENDIF
         CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVINQ - ATYPE')
            GO TO 900
         ENDIF
         LENSTR = 1
         DO 40 K = 1, NVDIMS
            CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCDINQ - ATYPE')
               GO TO 900
            ENDIF
            IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
               START(K) = 1
               COUNT(K) = DIMSIZ
               LENSTR = LENSTR * DIMSIZ
            ELSE
               START(K) = STARTR
               COUNT(K) = NRECS
               LENSTR = LENSTR * NRECS
            ENDIF
 40      CONTINUE
         CALL NCVGTC(NCID,J,START,COUNT,C6,LENSTR,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGTC - ATYPE')
            GO TO 900
         ENDIF
         DO 453 I = 1, NRECS
            N = M_LSTCHR(C6(I),6)
            IF(N .NE. 6)THEN
               DO 454 K = N+1, 5
                  C6(I)(K:K) = ' '
 454           CONTINUE
            ENDIF
            ATYPE(I) = C6(I)(1:5)
 453     CONTINUE

C     ------------------------------------------------------------------
C     GET THE REPORT TYPE.
C     ------------------------------------------------------------------
         J = NCVID(NCID,'reportType',RCODE)
         IF(RCODE.NE.0)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVID - RTYPE')
            GO TO 900
         ENDIF
         CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVINQ - RTYPE')
            GO TO 900
         ENDIF
         LENSTR = 1
         DO 440 K = 1, NVDIMS
            CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCDINQ - RTYPE')
               GO TO 900
            ENDIF
            IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
               START(K) = 1
               COUNT(K) = DIMSIZ
               LENSTR = LENSTR * DIMSIZ
            ELSE
               START(K) = STARTR
               COUNT(K) = NRECS
               LENSTR = LENSTR * NRECS
            ENDIF
 440     CONTINUE
         IF(SOURCE .EQ. SAO_DS_P) THEN
            CALL NCVGTC(NCID,J,START,COUNT,C5,LENSTR,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCVGTC - RTYPE')
               GO TO 900
            ENDIF
            DO 553 I = 1, NRECS
               N = M_LSTCHR(C5(I),5)
               IF(N .NE. 5)THEN
                  DO 554 K = N+1, 5
                     C5(I)(K:K) = ' '
 554              CONTINUE
               ENDIF
               RTYPE(I) = C5(I)(1:5)
 553        CONTINUE
         ELSE IF(SOURCE .EQ. METAR_DS_P) THEN
            CALL NCVGTC(NCID,J,START,COUNT,C6,LENSTR,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCVGTC - RTYPE')
               GO TO 900
            ENDIF
            DO 653 I = 1, NRECS
               N = M_LSTCHR(C6(I),6)
               IF(N .NE. 6)THEN
                  DO 654 K = N+1, 6
                     C6(I)(K:K) = ' '
 654              CONTINUE
               ENDIF
               RTYPE(I) = C6(I)(1:5)
 653        CONTINUE
         ENDIF

      ELSE IF(SOURCE .EQ. MARITIME_DS_P)THEN

         NTIME = 1
         IDLEN = 8
         SRC = 'MARITIME  '
         ISRC = 5
         HAS_WMOID = .FALSE.

      ELSE IF(SOURCE .EQ. COOP_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         SRC = 'COOP      '
         ISRC = 2
         HAS_WMOID = .FALSE.

      ELSE IF(SOURCE .EQ. URBANET_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         SRC = 'UrbaNet   '
         ISRC = 31
         HAS_WMOID = .FALSE.

      ELSE IF(SOURCE .EQ. NEPP_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         SRC = 'NEPP      '
         ISRC = 33
         HAS_WMOID = .FALSE.

      ELSE IF(SOURCE .EQ. HCN_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         SRC = 'HCN       '
         ISRC = 34
         HAS_WMOID = .FALSE.

      ELSE IF(SOURCE .EQ. CRN_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         SRC = 'CRN       '
         ISRC = 35
         HAS_WMOID = .FALSE.

      ELSE IF(SOURCE .EQ. HFMETAR_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         SRC = 'OTHER-HFM '
         ISRC = 32
         HAS_WMOID = .FALSE.

C     ------------------------------------------------------------------
C     WE'LL NEED THE METARTYPE BELOW TO SET PROVDR CORRECTLY.
C     ------------------------------------------------------------------
         J = NCVID(NCID,'metarType',RCODE)
         IF(RCODE.NE.0)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVID - METARTYPE')
            GO TO 900
         ENDIF
         CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVINQ - METARTYPE')
            GO TO 900
         ENDIF
         DO K = 1, NVDIMS
            CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCDINQ - METARTYPE')
               GO TO 900
            ENDIF
            IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
               START(K) = 1
               COUNT(K) = DIMSIZ
            ELSE
               START(K) = STARTR
               COUNT(K) = NRECS
            ENDIF
         ENDDO

         CALL NCVGT(NCID,J,START,COUNT,METARTYPE,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGT - METARTYPE')
            GO TO 900
         ENDIF

         CALL NCAGT(NCID,J,'_FillValue',METARTYPE_FILL,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            HAVE_FILL = .FALSE.
            METARTYPE_FILL = 0
         ELSE
            HAVE_FILL = .TRUE.
         ENDIF
         
         DO I = 1, NRECS
            IF((HAVE_FILL.AND.METARTYPE(I).EQ.METARTYPE_FILL).OR.
     1         METARTYPE(I).EQ.MISVAL)THEN
               METARTYPE(I) = MISS_P
            ENDIF
         ENDDO

      ELSE IF(SOURCE .EQ. MESONET_DS_P)THEN

         NTIME = 3
         IDLEN = 6
         TIMNAM(2) = 'reportTime'
         TIMNAM(3) = 'receivedTime'
         HAS_WMOID = .TRUE.

C     ------------------------------------------------------------------
C     GET THE DATA PROVIDER NAMES.
C     ------------------------------------------------------------------
         J = NCVID(NCID,'dataProvider',RCODE)
         IF(RCODE.NE.0)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVID - DPNAME')
            GO TO 900
         ENDIF
         CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVINQ - DPNAME')
            GO TO 900
         ENDIF
         LENSTR = 1
         DO 51 K = 1, NVDIMS
            CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCDINQ - DPNAME')
               GO TO 900
            ENDIF
            IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
               START(K) = 1
               COUNT(K) = DIMSIZ
               LENSTR = LENSTR * DIMSIZ
            ELSE
               START(K) = STARTR
               COUNT(K) = NRECS
               LENSTR = LENSTR * NRECS
            ENDIF
 51      CONTINUE
         CALL NCVGTC(NCID,J,START,COUNT,DPNAME,LENSTR,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGTC - DPNAME')
            GO TO 900
         ENDIF


C     ------------------------------------------------------------------
C     MOVE THE DATA PROVIDER NAMES INTO THE CALLER'S ARRAY, WITH
C     BLANKS AT THE END OF THE STRINGS.
C     ------------------------------------------------------------------
         DO 100 K = 1, NRECS
            N = M_LSTCHR(DPNAME(K),10)
            IF(N.NE.10)THEN
               DO 101 J = N+1, 10
                  DPNAME(K)(J:J) = ' '
 101           CONTINUE
            ENDIF
            PROVDR(K) = DPNAME(K)(1:10)
 100     CONTINUE

      ENDIF

C     ------------------------------------------------------------------
C     READ THE STATION NAMES INTO THE PROPER SIZE CHARACTER ARRAY, PUT
C     BLANKS AT THE END OF THE STRING, THEN TRANSFER TO CALLER'S ARRAY.
C     ------------------------------------------------------------------
      J = NCVID(NCID,
     1          VNAME(STANAM_VN_P,SOURCE)(1:VLEN(STANAM_VN_P,SOURCE)),
     2          RCODE)
      IF(RCODE.NE.0)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVID - STATION NAME')
         GO TO 900
      ENDIF
      CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVINQ - STATION NAME')
         GO TO 900
      ENDIF
      LENSTR = 1
      DO 52 K = 1, NVDIMS
         CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCDINQ - STATION NAME')
            GO TO 900
         ENDIF
         IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
            START(K) = 1
            COUNT(K) = DIMSIZ
            LENSTR = LENSTR * DIMSIZ
         ELSE
            START(K) = STARTR
            COUNT(K) = NRECS
            LENSTR = LENSTR * NRECS
         ENDIF
 52   CONTINUE

      IF(IDLEN .EQ. 5)THEN
         CALL NCVGTC(NCID,J,START,COUNT,C5,LENSTR,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGTC - STATION NAME')
            GO TO 900
         ENDIF
         DO 53 I = 1, NRECS
            N = M_LSTCHR(C5(I),IDLEN)
            IF(N .NE. IDLEN)THEN
               DO 54 K = N+1, IDLEN
                  C5(I)(K:K) = ' '
 54            CONTINUE
            ENDIF
            STAID(I) = C5(I)(1:5)//'     '
 53      CONTINUE

      ELSE IF(IDLEN .EQ. 6)THEN
         CALL NCVGTC(NCID,J,START,COUNT,C6,LENSTR,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGTC - STATION NAME')
            GO TO 900
         ENDIF
         DO 63 I = 1, NRECS
            N = M_LSTCHR(C6(I),IDLEN)
            IF(N .NE. IDLEN)THEN
               DO 64 K = N+1, IDLEN
                  C6(I)(K:K) = ' '
 64            CONTINUE
            ENDIF
            STAID(I) = C6(I)(1:6)//'    '
 63      CONTINUE

      ELSE IF(IDLEN .EQ. 8)THEN
         CALL NCVGTC(NCID,J,START,COUNT,C8,LENSTR,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGTC - STATION NAME')
            GO TO 900
         ENDIF
         DO 83 I = 1, NRECS
            N = M_LSTCHR(C8(I),IDLEN)
            IF(N .NE. IDLEN)THEN
               DO 84 K = N+1, IDLEN
                  C8(I)(K:K) = ' '
 84            CONTINUE
            ENDIF
            STAID(I) = C8(I)(1:8)//'  '
 83      CONTINUE

      ENDIF

C     ------------------------------------------------------------------
C     GET THE WMO ID'S.  THEN, FOR MESONET, USE THEM (WHERE AVAILABLE)
C     TO REPLACE BLANK STATION NAMES.
C     ------------------------------------------------------------------
      IF(HAS_WMOID)THEN

         J = NCVID(NCID,
     1             VNAME(WMOID_VN_P,SOURCE)(1:VLEN(WMOID_VN_P,SOURCE)),
     2             RCODE)
         IF(RCODE.NE.0)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVID - WMO ID')
            GO TO 900
         ENDIF
         CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVINQ - WMO ID')
            GO TO 900
         ENDIF
         DO 551 K = 1, NVDIMS
            CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCDINQ - WMO ID')
               GO TO 900
            ENDIF
            IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
               START(K) = 1
               COUNT(K) = DIMSIZ
            ELSE
               START(K) = STARTR
               COUNT(K) = NRECS
            ENDIF
 551     CONTINUE
         CALL NCVGT(NCID,J,START,COUNT,WMOID,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGT - WMO ID')
            GO TO 900
         ENDIF
         CALL NCAGT(NCID,J,'_FillValue',WMOID_FILL,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            HAVE_FILL = .FALSE.

C     NOTE WE HAVE TO PUT A VALID NUMBER INTO THE FILLVAL
C     VARIABLE FOR THE CASE OF IT DOESN'T EVEN EXIST -- GOT A
C     NAN THAT CAUSED PROBLEMS WHEN THIS WAS DONE ON A DEC ALPHA.

            WMOID_FILL = 0
         ELSE
            HAVE_FILL = .TRUE.
         ENDIF

         IF(SOURCE .NE. MESONET_DS_P)THEN

            IF(HAVE_FILL)THEN

               DO 549 I = 1, NRECS
                  IF(WMOID(I).EQ.WMOID_FILL)WMOID(I) = MISS_P
 549           CONTINUE

            ENDIF

         ELSE

            DO 552 I = 1, NRECS

               IF((HAVE_FILL.AND.WMOID(I).EQ.WMOID_FILL).OR.
     1            (WMOID(I).EQ.MISVAL.OR.WMOID(I).LE.0.OR.
     2             WMOID(I).GT.99999))WMOID(I) = MISS_P

               IF(STAID(I).EQ.'          '.AND.
     1              .NOT.((HAVE_FILL.AND.WMOID(I).EQ.WMOID_FILL).OR.
     2              WMOID(I).EQ.MISVAL.OR.WMOID(I).LE.0.OR.
     3              WMOID(I).GT.99999))THEN

                  IF(WMOID(I).LT.10)THEN
                     WRITE(STAID(I)(1:1),1011)WMOID(I)
 1011                FORMAT(I1)
                  ELSE IF(WMOID(I).LT.100)THEN
                     WRITE(STAID(I)(1:2),1012)WMOID(I)
 1012                FORMAT(I2)
                  ELSE IF(WMOID(I).LT.1000)THEN
                     WRITE(STAID(I)(1:3),1013)WMOID(I)
 1013                FORMAT(I3)
                  ELSE IF(WMOID(I).LT.10000)THEN
                     WRITE(STAID(I)(1:4),1014)WMOID(I)
 1014                FORMAT(I4)
                  ELSE IF(WMOID(I).LT.100000)THEN
                     WRITE(STAID(I)(1:5),1015)WMOID(I)
 1015                FORMAT(I5)
                  ENDIF

               ENDIF

 552        CONTINUE

         ENDIF

      ELSE

         DO 750 I = 1, NRECS

            WMOID(I) = MISS_P

 750     CONTINUE

      ENDIF

C     ------------------------------------------------------------------
C     GET THE LATITUDES AND LONGITUDES.
C     ------------------------------------------------------------------
      J = NCVID(NCID,VNAME(LAT_VN_P,SOURCE)(1:VLEN(LAT_VN_P,SOURCE)),
     1          RCODE)
      IF(RCODE.NE.0)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVID - LATITUDE')
         GO TO 900
      ENDIF
      CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVINQ - LATITUDE')
         GO TO 900
      ENDIF
      DO 8551 K = 1, NVDIMS
         CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCDINQ - LATITUDE')
            GO TO 900
         ENDIF
         IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
            START(K) = 1
            COUNT(K) = DIMSIZ
         ELSE
            START(K) = STARTR
            COUNT(K) = NRECS
         ENDIF
 8551 CONTINUE
      CALL NCVGT(NCID,J,START,COUNT,LAT,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVGT - LATITUDE')
         GO TO 900
      ENDIF
      CALL NCAGT(NCID,J,'_FillValue',LAT_FILL,RCODE)
      IF(RCODE.EQ.SUCCESS_P)THEN
         DO 8552 I = 1, NRECS
            IF(LAT(I).EQ.LAT_FILL)LAT(I) = MISS_P
 8552    CONTINUE
      ENDIF

      J = NCVID(NCID,VNAME(LON_VN_P,SOURCE)(1:VLEN(LON_VN_P,SOURCE)),
     1          RCODE)
      IF(RCODE.NE.0)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVID - LONGITUDE')
         GO TO 900
      ENDIF
      CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVINQ - LONGITUDE')
         GO TO 900
      ENDIF
      DO 9551 K = 1, NVDIMS
         CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCDINQ - LONGITUDE')
            GO TO 900
         ENDIF
         IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
            START(K) = 1
            COUNT(K) = DIMSIZ
         ELSE
            START(K) = STARTR
            COUNT(K) = NRECS
         ENDIF
 9551 CONTINUE
      CALL NCVGT(NCID,J,START,COUNT,LON,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVGT - LONGITUDE')
         GO TO 900
      ENDIF
      CALL NCAGT(NCID,J,'_FillValue',LON_FILL,RCODE)
      IF(RCODE.EQ.SUCCESS_P)THEN
         DO 9552 I = 1, NRECS
            IF(LON(I).EQ.LON_FILL)LON(I) = MISS_P
 9552    CONTINUE
      ENDIF

C     ------------------------------------------------------------------
C     READ IN ELEVATION.
C     ------------------------------------------------------------------
      J = NCVID(NCID,VNAME(ELEV_VN_P,SOURCE)(1:VLEN(ELEV_VN_P,SOURCE)),
     1          RCODE)
      IF(RCODE.NE.0)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVID - ELEVATION')
         GO TO 900
      ENDIF
      CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVINQ - ELEVATION')
         GO TO 900
      ENDIF
      DO 153 K = 1, NVDIMS
         CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCDINQ - ELEVATION')
            GO TO 900
         ENDIF
         IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
            START(K) = 1
            COUNT(K) = DIMSIZ
         ELSE
            START(K) = STARTR
            COUNT(K) = NRECS
         ENDIF
 153  CONTINUE

      CALL NCVGT(NCID,J,START,COUNT,ELEV,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         CALL MERROR('MSFCRDSTA: BAD NCVGT - ELEVATION')
         GO TO 900
      ENDIF

      CALL NCAGT(NCID,J,'_FillValue',ELEV_FILL,RCODE)
      IF(RCODE.NE.SUCCESS_P)THEN
         HAVE_FILL = .FALSE.
         ELEV_FILL = 0
      ELSE
         HAVE_FILL = .TRUE.
      ENDIF
      IF(SOURCE.EQ.MESONET_DS_P)THEN
         HAVE_MISS = .TRUE.
      ELSE
         HAVE_MISS = .FALSE.
      ENDIF

      DO 154 I = 1, NRECS
         IF((HAVE_FILL.AND.ELEV(I).EQ.ELEV_FILL).OR.
     1      (HAVE_MISS.AND.ELEV(I).EQ.MISVAL))THEN
            ELEV(I) = MISS_P
         ENDIF
 154  CONTINUE

C     ------------------------------------------------------------------
C     KNOCK OUT AWIPS DATABASE METAR ELEVATIONS OF -1.
C     ------------------------------------------------------------------
      IF(SOURCE.EQ.METAR_DS_P.AND.CDBTYPE.EQ.AWIPS_DB_P)THEN

         DO 155 I = 1, NRECS
            IF(ELEV(I).EQ.-1)ELEV(I) = MISS_P
 155     CONTINUE

      ENDIF

C     ------------------------------------------------------------------
C     FOR MARITIME, FILL IN ZERO/MISSING VALUES, WHERE POSSIBLE, WITH
C     VALUES INTERPOLATED FROM GRIDDED TOPOGRAPHY.
C     ------------------------------------------------------------------
      IF(SOURCE.EQ.MARITIME_DS_P)THEN

         CALL M_MARELV(NRECS,MISS_P,LAT,LON,ELEV)

      ENDIF

C     ------------------------------------------------------------------
C     FOR MESONET, UPDATE THE SUBSRCIN TABLE BASED ON THE TABLE 
C     CONTAINED IN THE MESONET FILE.
C     ------------------------------------------------------------------
      IF(SOURCE.EQ.MESONET_DS_P)THEN

         CALL M_UPDSRCIN(NCID,RECDIM,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            STATUS = RCODE
            GO TO 900
         ENDIF

      ENDIF

C     ------------------------------------------------------------------
C     READ THE DOUBLE PRECISION TIME & ITS FILL VALUE, IF THE TIME ISN'T
C     MISSING, TRANSLATE TO I4TIME (UNIX TIME + 10 YEARS IN SECONDS),
C     AND TRANSFER TO CALLER'S INTEGER ARRAY.
C     - FOR NON-MESONET DATA WE'LL ALSO FILL IN THE PROVIDER NAME &
C       SUBSRC NUMBER.
C     - FOR MESONET DATA WE HAVE TO READ TWO TIME ARRAYS, THEN SORT OUT
C     THE PROPER VALUE GIVEN THE STATION TYPE.
C     ------------------------------------------------------------------
      DO 500 N = 1, NTIME

         J = NCVID(NCID,TIMNAM(N),RCODE)
         IF(RCODE.NE.0)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVID - OBTIME')
            GO TO 900
         ENDIF
         CALL NCVINQ(NCID,J,VARNAM,VARTYP,NVDIMS,VDIMS,NVATTS,RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVINQ - OBTIME')
            GO TO 900
         ENDIF
         DO 152 K = 1, NVDIMS
            CALL NCDINQ(NCID,VDIMS(K),DIMNAM,DIMSIZ,RCODE)
            IF(RCODE.NE.SUCCESS_P)THEN
               CALL MERROR('MSFCRDSTA: BAD NCDINQ - OBTIME')
               GO TO 900
            ENDIF
            IF(K.LT.NVDIMS.OR.(NVDIMS.EQ.K.AND.VDIMS(K).NE.RECDIM))THEN
               START(K) = 1
               COUNT(K) = DIMSIZ
            ELSE
               START(K) = STARTR
               COUNT(K) = NRECS
            ENDIF
 152     CONTINUE

         CALL NCVGT(NCID,J,START,COUNT,DTIME(1,N),RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCVGT - OBTIME')
            GO TO 900
         ENDIF
         CALL NCAGT(NCID,J,'_FillValue',DTIME_FILL(N),RCODE)
         IF(RCODE.NE.SUCCESS_P)THEN
            CALL MERROR('MSFCRDSTA: BAD NCAGT - OBTIME')
            GO TO 900
         ENDIF

 500  CONTINUE

      IF(SOURCE .NE. MESONET_DS_P .AND. SOURCE .NE. COOP_DS_P .AND. 
     1     SOURCE .NE. URBANET_DS_P .AND. SOURCE .NE. HFMETAR_DS_P
     2     .AND. SOURCE .NE. NEPP_DS_P .AND. SOURCE .NE. HCN_DS_P 
     3     .AND. SOURCE .NE. CRN_DS_P) THEN

         DO 600 I = 1, NRECS
            IF(DTIME(I,1) .NE. MISVAL .AND.
     1           DTIME(I,1) .LT. DTIME_FILL(1))THEN
               OBTIME(I) = DTIME(I,1)
               OBTIME(I) = OBTIME(I) - 1325376000
            ELSE
               OBTIME(I) = MISS_P
            ENDIF
 600     CONTINUE

         IF(SOURCE .EQ. METAR_DS_P)THEN

C     ------------------------------------------------------------------
C     METARS CONSIST OF "OTHER-MTR" (THE DEFAULT) AND "ASOS".  WE 
C     IDENTIFY ASOS STATIONS BY CHECKING THE ASOS STATION DICTIONARY.
C     ------------------------------------------------------------------
            DO 650 I = 1, NRECS

               PROVDR(I) = SRC
               SUBSRC(I) = ISRC

               DO 1070 J = 1, TOTAL_STNS
                  IF(STAID(I)(1:5) .EQ. STN_VEC(J))THEN
                     PROVDR(I) = 'ASOS      '
                     SUBSRC(I) = 1
C     *** KNOWN ASOS'S
                     GO TO 650
                  ENDIF
 1070          CONTINUE

 650        CONTINUE

         ELSE 

            DO 651 I = 1, NRECS
               PROVDR(I) = SRC
               SUBSRC(I) = ISRC
 651        CONTINUE

         ENDIF

      ELSE

C     ------------------------------------------------------------------
C     FOR MESONET/COOP/URBANET/HFMETAR/NEPP/HCN/CRN STATIONS WE HAVE TO 
C     HANDLE THE CASE OF "PARTIALLY-WRITTEN" RECORDS.  A BUG IN THE LDAD 
C     PROCESSING CAN CAUSE RECORDS THAT HAVE ONLY BEEN PARTIALLY WRITTEN 
C     TO THE FILE BEFORE WE READ IT.  MOST OF THESE CAN BE IDENTIFIED 
C     BY:
C
C     - FILL VALUE IN TIME,
C     - ZERO IN TIME,
C     - BLANK STATION NAME,
C     - BLANK PROVIDER NAME (FOR MESONET).
C
C     THEREFORE, TO KEEP THE M_IDSUBSRC ROUTINE FROM IDENTIFYING BOGUS
C     PROVIDERS, WE'LL FILL IN SUBSRC 0 FOR PARTIALLY-WRITTEN RECORDS.
C     OTHERWISE, WE'LL CALL M_IDSUBSRC TO FILL IN THE SUBSRC.
C
C     WE ALSO HAVE TO COVER THE CASE OF THE TIME ZONE BEING WRONG IN
C     THE LDAD METADATA.  FOR SOME OF THOSE CASES (TYPICALLY, DST
C     ERRORS) WE CAN IDENTIFY THIS BY LOOKING FOR OBS THAT WERE
C     RECEIVED *BEFORE* THEY WERE OBSERVED.  (NOTE THAT WE DO THIS
C     CHECK AFTER IDENTIFYING PARTIALLY-WRITTEN RECORDS.  OTHERWISE,
C     THE MISSING OBTIME WOULD ERRONEOUSLY PUT THE RECORD INTO THAT
C     CATEGORY.)
C     ------------------------------------------------------------------
         IF(SOURCE .EQ. COOP_DS_P .OR. SOURCE .EQ. URBANET_DS_P
     1         .OR. SOURCE .EQ. NEPP_DS_P .OR. SOURCE .EQ. HCN_DS_P 
     2        .OR. SOURCE .EQ. CRN_DS_P)THEN

            DO I = 1, NRECS
               PROVDR(I) = SRC
               SUBSRC(I) = ISRC
            ENDDO

         ELSE IF(SOURCE .EQ. HFMETAR_DS_P)THEN

C     ------------------------------------------------------------------
C     HIGH FREQUENCY METARS CONSIST OF "OTHER-HFM" (THE DEFAULT) AND 
C     "ASOS-HFM".  WE IDENTIFY ASOS STATIONS BY CHECKING THE METARTYPE
C     VARIABLE READ IN ABOVE.
C     ------------------------------------------------------------------
            DO I = 1, NRECS

               IF(METARTYPE(I).EQ.1.OR.METARTYPE(1).EQ.4)THEN
                  PROVDR(I) = 'ASOS-HFM  '
                  SUBSRC(I) = 6
               ELSE
                  PROVDR(I) = SRC
                  SUBSRC(I) = ISRC
               ENDIF

            ENDDO

         ENDIF
            
         K = 0
         N = 0
         DO 700 I = 1, NRECS

            IF(DTIME(I,1) .NE. MISVAL .AND. DTIME(I,1) .NE. 0 .AND.
     1           DTIME(I,1) .LT. DTIME_FILL(1))THEN
               OBTIME(I) = DTIME(I,1)
               OBTIME(I) = OBTIME(I) - 1325376000
               NT = 1
            ELSE IF(DTIME(I,2) .NE. MISVAL .AND. DTIME(I,2) .NE. 0 .AND.
     1           DTIME(I,2) .LT. DTIME_FILL(2))THEN
               OBTIME(I) = DTIME(I,2)
               OBTIME(I) = OBTIME(I) - 1325376000
               NT = 2
            ELSE
               OBTIME(I) = MISS_P
            ENDIF

            J = M_LSTCHR(STAID(I),LSTAID)
            IF(J .EQ. 0 .OR. PROVDR(I) .EQ. '          '
     1         .OR. OBTIME(I).EQ.MISS_P)THEN

               SUBSRC(I) = 0
               IF(N .NE. 0)THEN
                  IF(SOURCE .EQ. MESONET_DS_P)THEN
                     CALL M_IDSUBSRC(N,PROVDR(K),SUBSRC(K),RCODE)
                     IF(RCODE .NE. SUCCESS_P)GO TO 900
                  ENDIF
                  N = 0
                  K = 0
               ENDIF

            ELSE

               IF(N .EQ. 0)K = I
               N = N + 1

            ENDIF

            IF(OBTIME(I).NE.MISS_P)THEN
               IF(DTIME(I,3).LT.DTIME(I,NT))OBTIME(I) = MISS_P
            ENDIF

 700     CONTINUE

         IF(N .NE. 0 .AND. SOURCE .EQ. MESONET_DS_P)THEN
            CALL M_IDSUBSRC(N,PROVDR(K),SUBSRC(K),RCODE)
            IF(RCODE .NE. SUCCESS_P)GO TO 900
         ENDIF

      ENDIF

      STATUS = SUCCESS_P

 900  RETURN
      END
C**---------------------------------------------------------------------
C**REQUIRED STANDARD FSL DISCLAIMER (NOVEMBER 2000)
C**---------------------------------------------------------------------
C**  OPEN SOURCE LICENSE/DISCLAIMER,  FORECAST SYSTEMS LABORATORY
C**  NOAA/OAR/FSL, 325 BROADWAY BOULDER, CO 80305
C**
C**  THIS SOFTWARE IS DISTRIBUTED UNDER THE OPEN SOURCE DEFINITION, 
C**  WHICH MAY BE FOUND AT http://www.opensource.org/osd.html.
C**
C**  IN PARTICULAR, REDISTRIBUTION AND USE IN SOURCE AND BINARY FORMS,
C**  WITH OR WITHOUT MODIFICATION, ARE PERMITTED PROVIDED THAT THE 
C**  FOLLOWING CONDITIONS ARE MET:
C**
C**  - REDISTRIBUTIONS OF SOURCE CODE MUST RETAIN THIS NOTICE, THIS LIST
C**    OF CONDITIONS AND THE FOLLOWING DISCLAIMER.
C**
C**  - REDISTRIBUTIONS IN BINARY FORM MUST PROVIDE ACCESS TO THIS 
C**    NOTICE, THIS LIST OF CONDITIONS AND THE FOLLOWING DISCLAIMER, AND
C**    THE UNDERLYING SOURCE CODE.
C**
C**  - ALL MODIFICATIONS TO THIS SOFTWARE MUST BE CLEARLY DOCUMENTED, 
C**    AND ARE SOLELY THE RESPONSIBILITY OF THE AGENT MAKING THE 
C**    MODIFICATIONS.
C**
C**  - IF SIGNIFICANT MODIFICATIONS OR ENHANCEMENTS ARE MADE TO THIS
C**    SOFTWARE, THE FSL SOFTWARE POLICY MANAGER 
C**    (softwaremgr.fsl@noaa.gov) BE NOTIFIED.
C**
C**  THIS SOFTWARE AND ITS DOCUMENTATION ARE IN THE PUBLIC DOMAIN AND 
C**  ARE FURNISHED "AS IS."  THE AUTHORS, THE UNITED STATES GOVERNMENT,
C**  ITS INSTRUMENTALITIES, OFFICERS, EMPLOYEES, AND AGENTS MAKE NO 
C**  WARRANTY, EXPRESS OR IMPLIED, AS TO THE USEFULNESS OF THE SOFTWARE
C**  AND DOCUMENTATION FOR ANY PURPOSE.  THEY ASSUME NO RESPONSIBILITY 
C**  (1) FOR THE USE OF THE SOFTWARE AND DOCUMENTATION; OR (2) TO 
C**  PROVIDE TECHNICAL SUPPORT TO USERS.
C**---------------------------------------------------------------------
