C FORTRAN data retrieval code to read and print the GHCN station
C inventory files (Files 8-11 on the first magnetic tape)...
C
C Variable declarations...
C
      INTEGER COUNTRY, STATION, ELEV, FIRST, LAST, DISC
      REAL LAT, LON, MISSING
      CHARACTER * 25 NAME
C
C Initialize a record counter...
C
      NREC = 0
C
C Read in one line of data...
C
   10 READ (1, 1, END=99) COUNTRY, STATION, NAME, LAT, LON, ELEV,
     *FIRST, LAST, MISSING, DISC
C
    1 FORMAT (I3, I7, 2X, A25, 1X, F6.2, 1X, F7.2, 1X, I4,
     *1X, I4, 1X, I4, 1X, F4.1, 1X, I1)
C
C If 58 lines of data have been read, then begin a new page...
C
      IF (MOD(NREC, 58) .EQ. 0) WRITE (6, 60)
C
   60 FORMAT ('1', ' Country/Station', 7X, 'Station Name',
     *15X, 'Latitude', 2X, 'Longitude', 2X, 'Elevation', 2X,
     *'Period of Record', 2X, 'Missing (%)', 2X,
     *'Discontinuity', /)
C
C Write out one line of data...
C
      WRITE (6, 6) COUNTRY, STATION, NAME, LAT, LON, ELEV,
     *FIRST, LAST, MISSING, DISC
C
    6 FORMAT (4X, I3, 3X, I7, 7X, A25, 3X, F6.2, 4X, F7.2, 6X, I4,
     *8X, I4, '-', I4, 9X, F4.1, 11X, I1) 
C
C Increment the record counter, then retrieve another line of data...
C
      NREC = NREC + 1
C
      GO TO 10
C
C If end of file, then stop...
C
   99 STOP
      END
