anchor.diff:                  enddo
               enddo
           enddo
  -        
  +
       end subroutine  geo_interp2d
   
  -    
  +
  +    subroutine standardize_coordinates(domain)
  +        implicit none
  +        class(interpolable_type), intent(inout) :: domain
  +
  +        real, dimension(:,:), allocatable :: temporary_geo_data
  +        integer :: nx, ny, i
  +
  +        ! if the lat, lon data were given as 1D variables, we need to make them 2D for interpolability
  +        if (size(domain%lat,2)==1) then
  +            nx = size(domain%lon,1)
  +            ny = size(domain%lat,1)
  +
  +            allocate(temporary_geo_data(nx,ny))
  +            do i = 1, ny
  +                temporary_geo_data(:,i) = domain%lon(:,1)
  +            end do
  +            deallocate(domain%lon)
  +            allocate(domain%lon(nx,ny))
  +            domain%lon = temporary_geo_data
  +
  +            do i = 1, nx
  +                temporary_geo_data(i,:) = domain%lat(:,1)
  +            end do
  +            deallocate(domain%lat)
  +            allocate(domain%lat(nx,ny))
  +            domain%lat = temporary_geo_data
  +
  +        endif
  +
  +        ! also convert from a -180 to 180 coordinate system into a 0-360 coordinate system if necessary
  +        where(domain%lon<0) domain%lon = 360+domain%lon
  +
  +    end subroutine standardize_coordinates
  +
   end module geo
  
positive.code:         !       yc=ny/2
          xc = lastpos%x
          yc = lastpos%y
          
          x = lo%lon(xc,yc)
          y = lo%lat(xc,yc)
          
          ! steps to take = the difference the between the current point and the input point / dx
          xstep = (lon-x)/dx
          ystep = (lat-y)/dy
          
          ! CASE 1 assume a quasi regular dx/dy and caluate new location
          !  while we need to step by more than one grid cell, iterate
          !  if the grid is highly regular, we will only iterate 1-2x, highly irregular might require more iterations
          !  in the diabolical case, this could fail? 
          !  in most cases this succeeds with a few iterations. 
          iterations = 0
          do while (((abs(xstep)>1).or.(abs(ystep)>1)).and.iterations<20)
              iterations = iterations+1
  
negative.code:         endif
          ! the weights for the other x are just the complement
          x3=1-x2
  
          ! now compute the y interpolation weights
          ! first find the y locations after performing the x interpolation
          y5=y(0)*x1+y(1)*x0
  