anchor.diff:        endif
         write(*,*)
        1 'Usage: grid -x X1 X2 [-nx NX|-dx DX] ',
  -     2            '-y Y1 Y2 [-ny NY|-dy DY]'
  +     2            '-y Y1 Y2 [-ny NY|-dy DY] '
         write(*,*)
        1 '            [-z Z|-dip X0 Y0 Z0 STR ',
  -     2              'DIP] [-xsec X0 Y0 AZ] [-xz]'
  -      write(*,*)
  -     1 '            [-o OFILE] [-p] [-h]'
  -      write(*,*)
  -      write(*,*)
  -     1 '-x X1 X2    First column (x) limits'
  -      write(*,*)
  -     1 '-nx NX      Number of x grid points'
  -      write(*,*)
  -     1 '-dx DX      Increment in x direction (overrides -nx)'
  -      write(*,*)
  -     1 '-y Y1 Y2    Second column (y) limits'
  -      write(*,*)
  -     1 '-ny NY      Number of y grid points'
  -      write(*,*)
  -     1 '-dy DY      Increment in y direction (overrides -ny)'
  -      write(*,*)
  -     1 '-z Z        Third column (z) value'
  -      write(*,*)
  -     1 '-dip X0 Y0 Z0 STR DIP   Put grid onto plane with STR/DIP ',
  +     2              'DIP|-xsec X0 Y0 AZ [-xz]]'
  +      write(*,*)
  +     1 '            [-clip XYFILE] [-o OFILE] [-p] [-h]'
  +      write(*,*)
  +      write(*,*)
  +     1 '-x X1 X2               First column (x) limits'
  +      write(*,*)
  +     1 '-nx NX                 Number of x grid points'
  +      write(*,*)
  +     1 '-dx DX                 Increment in x direction (overrides -nx)'
  +      write(*,*)
  +     1 '-y Y1 Y2               Second column (y) limits'
  +      write(*,*)
  +     1 '-ny NY                 Number of y grid points'
  +      write(*,*)
  +     1 '-dy DY                 Increment in y direction (overrides -ny)'
  +      write(*,*)
  +     1 '-z Z                   Third column (z) value'
  +      write(*,*)
  +     1 '-dip X0 Y0 Z0 STR DIP  Put grid onto plane with STR/DIP ',
        2                'and containing (X0,Y0,Z0)'
         write(*,*)
  -     1 '-xsec X0 Y0 AZ          Create a vertical cross section ',
  +     1 '-xsec X0 Y0 AZ         Create a vertical cross section ',
        2                 'through (X0,Y0) with strike AZ'
         write(*,*)
  -     1 '-xz                     Print cross section x-z instead of ',
  +     1 '-xz                    Print cross section x-z instead of ',
        2                            'lon lat z'
         write(*,*)
  -     1 '-o OFILE    Output to file (default prints to standard ',
  -     2              'output)'
  +     1 '-clip XYFILE           Clip points to lie in interior of ',
  +     2                            'XYFILE (outside points are nan)'
  +      write(*,*)
  +     1 '-o OFILE               Output to file (default prints to ',
  +     2              'standard output)'
         write (*,*)
  -     1 '-p          Print results to standard output (overrides -o)'
  +     1 '-p                     Print results to standard output ',
  +     2                               '(overrides -o)'
         write (*,*)
  -     1 '-h/-?       Online help (this screen)'
  +     1 '-h/-?                  Online help (this screen)'
         write (*,*)
         STOP
         END
  
positive.code:                   dz = dd*dtan(ref(5)*d2r)
                    z = ref(3) + dz
                endif
                if (p.eq.0.and.xsec.eq.0) then
                    write(101,9999) x,y,z
                elseif (p.eq.1.and.xsec.eq.0) then
  
negative.code:       p = 0
        xsec = 0
        xz = 0
        clip = 'none'
        do 100 i = 1,5
            ref(i) = -1.0d0
    100 continue
  