Commit ce9cc8f1 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

interp_X: simplify if statement.

parent 83a52189
......@@ -265,12 +265,10 @@ void interp_X(const double *restrict gt, double *pt, const double *restrict hyb_
{
nl = nxl[i] * ngp + i;
nh = nl + ngp;
if ( nh >= ngp*nhlev )
ptl[i] = gt[nl];
else
ptl[i] = gt[nl] + (pres-hyb_press[nl])
* (gt[nh] - gt[nl])
/ (hyb_press[nh] - hyb_press[nl]);
ptl[i] = (nh >= ngp*nhlev) ? gt[nl] :
gt[nl] + (pres-hyb_press[nl])
* (gt[nh] - gt[nl])
/ (hyb_press[nh] - hyb_press[nl]);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment