 	for (unsigned int k = 0; k < sampleCount; k++)
 	{
 		MixingRatioKernel<<<gridSize, blockSize, 0, stream>>>(d_temperatureSample, d_Psurface, d_P500m,
-		                                                      d_humiditySample, d_Tpot, d_MR, k, sampleCount, N);
+		                                                      d_humiditySample, d_Tfirst, d_RHfirst, d_Tpot, d_MR, k,
+		                                                      sampleCount, N);
 		if (k > 0)
 		{
 			MeanKernel<<<gridSize, blockSize, 0, stream>>>(d_Tpot, d_MR, d_prevTpot, d_prevMR, d_meanTpot, d_meanMR,

	}
}

__global__ void MixingRatioKernel(const float* __restrict__ d_T, const float* __restrict__ d_Pstart,
                                  const float* __restrict__ d_Pstop, const float* __restrict__ d_RH,
                                  float* __restrict__ d_Tpot, float* __restrict__ d_MR, size_t k, size_t n, size_t N)
{
	int idx = blockIdx.x * blockDim.x + threadIdx.x;

				sample = himan::MissingFloat();
			}

			d_sampled[idx * sampleCount + i] = __float2half(himan::MissingFloat());

			for (int j = 1; j < levelCount; j++)
			{
				const int ii = idx * levelCount + j - 1;
				const float x1 = d_x0[idx] - __half2float(d_x[ii]);
				const float y1 = d_yfirst[idx] - __half2float(d_y[ii]);
				const float x2 = d_x0[idx] - __half2float(d_x[ii + 1]);
				const float y2 = d_yfirst[idx] - __half2float(d_y[ii + 1]);

				if (x1 >= sample && x2 <= sample)
				{
					const float val = interpolation::Linear<float>(sample, x1, x2, y1, y2);

					if (h == 0)
					{
						d_first[idx] = val;
					}

					d_sampled[idx * sampleCount + h] = __float2half(d_first[idx] - val);
					h++;
					break;
				}
