 
 		arr[idx] = lower;
 		arr[Index(i,nj-1-j,ni)] = upper;
-		
 	}
 }
 

	targetGrid.Reset();
	
	int i = 0;
	
	while(targetGrid.Next())
	{
		NFmiPoint latlon = targetGrid.LatLon();
		NFmiPoint gp = sourceGrid.LatLonToGrid(targetGrid.LatLon());

#ifdef EXTRADEBUG
		if (!sourceArea->IsInside(latlon))
		{
			std::cout << "Latlon " << latlon << " is outside source area!" << std::endl;

	{
		// Force +x-y --> +x+y

		// This is needed because latlon coordinates are created from newbase area
		// and they are in +x+y. This also means that we have to flip the data
		// back after interpolation.

		// TODO: Do not flip the data twice, but create the grid in the correct scanning mode!
		
		size_t N = sourceInfo->size_x * sourceInfo->size_y * 0.5 ;

		int bs = 256;
		int gs = N/bs + (N % bs == 0?0:1);
		Swap <<<gs,bs,0,stream>>>(d_source, sourceInfo->size_x, sourceInfo->size_y);

		sourceInfo->j_scans_positive = true;
	}
