anchor.diff:          integer, dimension(io_maxDims)  :: diminfo ! will hold dimension lengths
           integer, dimension(io_maxDims)  :: dimstart
           ! This will be the netCDF ID for the file and data_in variable.
  -        integer :: ncid, varid,i
  +        integer :: ncid, varid,i, err
  +        real :: scale, offset
   
           if (present(extradim)) then
               dimstart=extradim
  
positive.code:         call check(nf90_open(filename, NF90_NOWRITE, ncid),filename)
          ! Get the varid of the data_in variable, based on its name.
          call check(nf90_inq_varid(ncid, varname, varid),trim(filename)//":"//trim(varname))
  
          ! Read the data_in. skip the slowest varying indices if there are more than 3 dimensions (typically this will be time)
          if (diminfo(1)>3) then
  
negative.code:         integer, dimension(io_maxDims)  :: diminfo !will hold dimension lengths
          integer, dimension(io_maxDims)  :: dimstart
          ! This will be the netCDF ID for the file and data_in variable.
          integer :: ncid, varid,i, err
          real :: scale, offset
  
          if (present(extradim)) then
              dimstart=extradim
  