anchor.diff:  !-------------------------------------------------------------------------------
   
   !===============================================================================
  +subroutine rad3_save(tr, file)
  +!===============================================================================
  +! Save a trace as a RAD3-format file, including the header file.
  +! file should be the name of the file without the suffix.
  +   type(rad3trace), intent(in) :: tr
  +   character(len=*), intent(in) :: file
  +   integer :: i
  +   real(rs) :: scale
  +   call rad3_check_file_name(file)
  +   ! Normalise trace to fit into short int
  +   scale = real(huge(1_rad3int))/maxval(abs(tr%tr))
  +   ! Save binary part
  +   open(IOUT, file=trim(file)//'.rd3', access='direct', recl=rad3int*tr%n)
  +   do i = 1, tr%last_trace
  +      write(IOUT, rec=i) int(tr%tr(:,i)*scale, kind=rad3int)
  +   enddo
  +   close(IOUT)
  +   ! Save ASCII header
  +   call rad3_write_rad_file(tr, file)
  +end subroutine rad3_save
  +!-------------------------------------------------------------------------------
  +
  +!===============================================================================
   subroutine rad3_info(tr)
   !===============================================================================
   ! Write some useful information about a rad3 file to stdout
      type(rad3trace), intent(in) :: tr
      write(ISTDOUT,'(a,f0.8)') 'delta = ', tr % delta
  -   write(ISTDOUT,'(a,i0.0)') 'npts  = ', tr % n
  +   write(ISTDOUT,'(a,i0)')   'npts  = ', tr % n
      write(ISTDOUT,'(a,f0.8)') 'dx    = ', tr % distance_interval
      write(ISTDOUT,'(a,f0.8)') 'xmax  = ', tr % x(tr%last_trace)
      write(ISTDOUT,'(a,f0.8)') 'tmax  = ', tr % twtt(tr%n)
  -   write(ISTDOUT,'(a,i0.0)') 'xpts  = ', tr % last_trace
  +   write(ISTDOUT,'(a,i0)')   'xpts  = ', tr % last_trace
   end subroutine rad3_info
   !-------------------------------------------------------------------------------
   
  
positive.code:    logical :: exists
     integer :: i
  
     if (len_trim(file) > 5) then
        if (file(len_trim(file)-3:len_trim(file)) == '.rd3') &
           call rad3_warning('rad3_load: Supplied filename includes extension.  Do not supply.')
     endif
     ! Get header information
     call rad3_read_rad_file(trim(file)//'.rad', tr)
     ! Allocate memory for section
  
negative.code:       ! Header part; not all fields needed
        integer :: n  ! number of samples
        real(rs) :: frequency
        integer :: frequency_steps
        real(rs) :: signal_position
        integer :: raw_signal_position
        integer :: distance_flag
        integer :: time_flag
        integer :: program_flag
  