anchor.diff:          character(len=*), intent(in) :: value_name
           integer :: error
           real :: test_value
  -        
  +
           ! default return value assumes no error
           error = 0
  -        
  +
           call io_read_attribute(filename, value_name, test_value)
           if (abs(default_value - test_value)>1e-20) then
               error = 1
  
positive.code:         integer, intent(in), optional :: n
          integer :: error
          integer :: ncerror, dim_length
          
          error = 0
          
          ncerror = NF90_INQ_DIMID(ncid, dimname, dimid)
          if (ncerror/=NF90_NOERR) then
              call check( nf90_def_dim(ncid, dimname, n, dimid), "setup_dim:Creating dim:"//dimname )
          endif
          
          if (present(n)) then
              call check( nf90_inquire_dimension(ncid, dimid, len = dim_length), "setup_dim:Reading dim:"//dimname)
              
              if (dim_length/=n) then
                  error = 1
              endif
          endif
          
          ! return error
      end function setup_dim
  
      function check_real_attribute(filename, default_value, value_name) result(error)
          implicit none
          character(len=*), intent(in) :: filename
          real, intent(in) :: default_value
  
negative.code:         ! type(lt_options_type), intent(inout) :: options
          integer :: error
          error=0
  
          if (.not.file_exists(filename)) then
              error = 3
              return
          endif
          error = check_attribute(filename,lt_lut_version, "lt_LUT_version")
          if (error/=0) then
              error=4
              write(*,*) "WARNING: LUT not read, file lt_lut_version does not match code"
              return
          endif
          if (.not.dims_match(filename, dims)) then
              error = 2
              write(*,*) "WARNING: LUT not read, LUT dims and specified dims do not match"
              return
          endif
  
          ! read in the parameter values and test them against the input parameters
          ! if the file and input parameters do not match, adjust the input parameter to match
          error = error + check_attribute(filename, options%dirmax, "dirmax")
          error = error + check_attribute(filename, options%dirmin, "dirmin")
          error = error + check_attribute(filename, options%spdmax, "spdmax")
          error = error + check_attribute(filename, options%spdmin, "spdmin")
          error = error + check_attribute(filename, options%nsqmax, "nsqmax")
          error = error + check_attribute(filename, options%nsqmin, "nsqmin")
          error = error + check_attribute(filename, options%n_dir_values, "n_dir_values")
          error = error + check_attribute(filename, options%n_nsq_values, "n_nsq_values")
          error = error + check_attribute(filename, options%n_spd_values, "n_spd_values")
  
          if (error/=0) return
  
          ! this is the slow part where we actually read in all the data
          call io_read(filename,"uLUT",uLUT)
          call io_read(filename,"vLUT",vLUT)
  
          ! return error
      end function read_LUT
  
  