       SUBROUTINE METERS
 
***  THIS SUBROUTINE COMPUTES THE DIFFERENCE IN TWO POSITIONS
***  IN METERS.
***
 
      CHARACTER*30 NAME
      DOUBLE PRECISION LATSEC,LONSEC,
     1                 RHOSEC,DLAT,DLONG,SUMLAT,SUMLON,SUDLAT,SUDLON,
     2                 AVLAT,AVLON,AVDLAT,AVDLON,AXIS,E2,W,LM,LP,
     3                 LATMTR,LONMTR,LAT1,LONG1,LAT2,LONG2,
     4                 ILTSEC,ILNSEC,SLAT,SLON,ASNEW,BSNEW
      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             9X,'(METERS)',4X,'(METERS)')
      LINES = 0
  200 READ (10,155,END=999) NAME,ID,IM,SLAT,JD,JM,SLON,
     &                      IDNEW,IMNEW,ASNEW,JDNEW,JMNEW,BSNEW
  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,ASNEW,LAT2)
      CALL DMSTOR(JDNEW,JMNEW,BSNEW,LONG2)
 
      DLAT  = (LAT2 - LAT1)*RHOSEC
      DLONG = (LONG2 - LONG1)*RHOSEC
      AVLAT = (LAT1 + LAT2)/2.0D0
 
      W  = DSQRT(1.0D0 - E2*DSIN(AVLAT)**2)
      LM = AXIS*(1.0D0 - E2)/(W**3*RHOSEC)
      LP = AXIS*DCOS(AVLAT)/(W*RHOSEC)
      LATMTR = LM*DLAT
      LONMTR = LP*DLONG
      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,ASNEW,JDNEW,JMNEW,BSNEW,
     &             LATMTR,LONMTR
   40 FORMAT (1H+,73X,2I3,F9.5,2X,2I3,F9.5,6X,F7.2,5X,F7.2)
      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
