anchor.diff:     iostat = 0
      do while (iostat == 0)
         if (fixed_rad) then
  -         read(*,*,iostat=iostat) lon, lat
  +         if (value) then
  +            read(*,*,iostat=iostat) lon, lat, val
  +         else
  +            read(*,*,iostat=iostat) lon, lat
  +         endif
         else
  -         read(*,*,iostat=iostat) lon, lat, r
  +         if (value) then
  +            read(*,*,iostat=iostat) lon, lat, r, val
  +         else
  +            read(*,*,iostat=iostat) lon, lat, r
  +         endif
         endif
         if (iostat < 0) exit
         if (iostat > 0) then
  
positive.code:          stop 1
        endif
        call geog2cart(lon, lat, r, x, y, z, degrees=.true.)
        write(*,*) x, y, z
     enddo
  
  contains
  
negative.code:    subroutine usage()
     !===============================================================================
        write(0,'(a)') &
           'Usage: lonlat2xyz (options) < [lon] [lat] [radius] (value)', &
           'Reads geographic coordinates from stdin and writes cartesian to stdout.', &
           'Options:', &
           '   -v          : Output the value in the third/fourth column', &
           '   -r [radius] : Fix radius.  If not present, r must be on stdin.'
        stop 1
     end subroutine usage
  