anchor.diff:  c the wavelength of the InSAR satellite.
   c----
         IMPLICIT NONE
  -      REAL pi,d2r
  -      PARAMETER (pi=4.0*atan(1.0),d2r=pi/180.0)
  -
  -      REAL stlo,stla,ulos,wvl,phase
  -      
  +      REAL*8 pi,d2r,tpi
  +      PARAMETER (pi=4.0d0*datan(1.0d0),d2r=pi/180.0d0,tpi=2.0d0*pi)
  +      REAL*8 stlo,stla,ulos,wvl,phase
         INTEGER narg,i
  -      CHARACTER*30 ifile,ofile
  +      CHARACTER*40 ifile,ofile
  +      LOGICAL ex
   
         call gcmdln(wvl,ifile,ofile)
  +      if (wvl.le.0.0d0) then
  +          write(*,*) '!! Error: wavelength is undefined'
  +          call usage('!! Use -w WVLNTH')
  +      endif
  +      if (ifile.eq.'none') then
  +          write(*,*) '!! Error: Input LOS vector file unspecified'
  +          call usage('!! Use -f IFILE to specify input file')
  +      else
  +          inquire(file=ifile,EXIST=ex)
  +          if (.not.ex) call usage('!! Error: no input file: '//ifile)
  +      endif
  +      if (ofile.eq.'none') then
  +          write(*,*) '!! Error: No output file specified'
  +          call usage('!! Use -o OFILE to specify phase output file')
  +      endif
   
         open (unit=10,file=ifile,status='old')
         open (unit=20,file=ofile,status='unknown')
  
positive.code: c Convert line of sight displacement to phase difference from satellite
  c----
     13 read (10,*,end=14) stlo,stla,ulos
            ulos = 100.0*ulos
            phase = 2.0*(2.0*pi)*ulos/wvl
            phase = mod(phase,2.0*pi)
            if (phase.lt.-pi) phase = phase + 2.0*pi
            if (phase.gt.pi) phase = phase - 2.0*pi
            write (20,*) stlo,stla, phase
            goto 13
     14 continue
  
negative.code: C======================================================================C
  
        SUBROUTINE gcmdln(wvl,ifile,ofile)
        IMPLICIT none
        REAL*8 wvl
        CHARACTER*40 tag,ifile,ofile
        INTEGER i,narg
        wvl = -1.0d0
        ifile = 'none'
        ofile = 'none'
        narg = iargc()
        if (narg.eq.0) call usage(' ')
        i = 0
     11 i = i + 1
        if (i.gt.narg) goto 12
  