      SUBROUTINE SECOND
 
 
***   THIS SUBROUTINE COMPUTES THE DIFFERENCE IN TWO POSITIONS IN
***   SECONDS.
***
 
      CHARACTER*30 NAME
      DOUBLE PRECISION LATSEC,LONSEC,LAT1,LAT2,LONG1,LONG2,SUDLON,
     1             RHOSEC,DLAT,DLONG,SUMLAT,SUMLON,SUDLAT,
     2             AVLAT,AVLON,AVDLAT,AVDLON,AXIS,E2,W,LM,LP,
     3             ILTSEC,ILNSEC,LATMTR,LONMTR,ASSEC,BSSEC,
     4             SLAT,SLON
      NO = 0
      SUMLAT = 0.0D0
      SUMLON = 0.0D0
      SUDLAT = 0.0D0
      SUDLON = 0.0D0
      RHOSEC = 206264.806247D0
      AXIS = 6378137.0D0
      E2 = 0.0066943800229D0
  100 WRITE(6,5)
    5 FORMAT (1H1,T45,'SHIFT = NAD83 DATUM - NAD27 DATUM ',/)
      WRITE (6,10)
   10 FORMAT (1H ,86X,'         ',16X,'LATITUDE',3X,'LONGITUDE'/,
     1            48X,'NAD 1927 DATUM',22X,'NAD 1983 DATUM',
     2            15X,'SHIFT',7X,'SHIFT'/,
     3             3X,'NO.',2X,'STATION NAME',22X,'LATITUDE',
     4             8X,'LONGITUDE',11X,'LATITUDE',8X,'LONGITUDE',
     5             8X,'(SECONDS)',3X,'(SECONDS)')
      LINES = 0
  200 READ (10,155,END=999) NAME,ID,IM,SLAT,JD,JM,SLON,
     &                      IDNEW,IMNEW,ASSEC,JDNEW,JMNEW,BSSEC
  155 FORMAT(A30,2X,I2.2,2X,I2.2,F9.5,2X,I3.3,2X,I2.2,F9.5,
     &       2X,I2.2,2X,I2.2,F9.5,2X,I3.3,2X,I2.2,F9.5)
 
 
 
      NO = NO + 1
 
      CALL DMSTOR(ID,IM,SLAT,LAT1)
      CALL DMSTOR(JD,JM,SLON,LONG1)
      CALL DMSTOR(IDNEW,IMNEW,ASSEC,LAT2)
      CALL DMSTOR(JDNEW,JMNEW,BSSEC,LONG2)
 
 
      DLAT  = (LAT2 -LAT1)*RHOSEC
      DLONG = (LONG2 - LONG1)*RHOSEC
 
 
      SUMLAT = SUMLAT + LAT2
      SUMLON = SUMLON + LONG2
      SUDLAT = SUDLAT + DLAT
      SUDLON = SUDLON + DLONG
 
      WRITE (6,30) NO,NAME,ID,IM,SLAT,JD,JM,SLON
   30 FORMAT (1H0,I4,3X,A30,2I3,F9.5,2X,2I3,F9.5)
      WRITE (6,40) IDNEW,IMNEW,ASSEC,JDNEW,JMNEW,BSSEC,
     &             DLAT,DLONG
   40 FORMAT (1H+,73X,2I3,F9.5,2X,2I3,F9.5,5X,F9.5,3X,F9.5)
      LINES = LINES + 1
      IF (LINES.EQ.25) GO TO 100
      GO TO 200
  999 AVLAT  = SUMLAT/NO
      AVLON  = SUMLON/NO
      AVDLAT = SUDLAT/NO
      AVDLON = SUDLON/NO
      W  = DSQRT(1.0D0 - E2*DSIN(AVLAT)**2)
      LM = AXIS*(1.0D0 - E2)/(W**3*RHOSEC)
      LP = AXIS*DCOS(AVLAT)/(W*RHOSEC)
      LATMTR = LM*AVDLAT
      LONMTR = LP*AVDLON
      CALL RTODMS(AVLAT,LATDEG,LATMIN,LATSEC)
      CALL RTODMS(AVLON,LONDEG,LONMIN,LONSEC)
      WRITE (6,60)
   60 FORMAT (1H1,9X,'SOME STATISTICS ON THESE DATA:')
      WRITE (6,70) NO,LATDEG,LATMIN,LATSEC,
     1             LONDEG,LONMIN,LONSEC,
     2             AVDLAT,LATMTR,AVDLON,LONMTR
   70 FORMAT (1H0,9X,'NUMBER OF POINTS IN AREA =',I5,//
     1           10X,'AVERAGE NAD 1983 LATITUDE  =',
     2               I4,' DEG',I3,' MIN',F6.2,' SEC',//
     3           10X,'AVERAGE NAD 1983 LONGITUDE =',
     4               I4,' DEG',I3,' MIN',F6.2,' SEC',//
     5           10X,'POSITION SHIFTS (NAD 1983 ',
     6               'MINUS NAD 1927):',//
     7           15X,'AVERAGE LATITUDE SHIFT  =',F8.3,' SECONDS =',
     8               F8.1,' METERS',//
     9           15X,'AVERAGE LONGITUDE SHIFT =',F8.3,' SECONDS =',
     A               F8.1,' METERS')
      RETURN
      END
