I have noticed an inconsistency in the way layer averaging is performed for different variables when the interpolated sounding is used (exact=False). The layer-mean mixing ratio is computed without pressure weighting, whereas the layer-mean potential temperature and equivalent potential temperature are both computed with pressure weighting. Furthermore, when interpolation is not performed (exact=True) the layer means are computed as simple averages without accounting for variations in layer mass or thickness. I note that the exact=True option is used in the definition of the forecast parcel and the mixed-layer parcel, whereas the default exact=False options is used in the definition of the effective-layer parcel and in the calculation of DCAPE.
I think that, in general, the layer average of a quantity X should be computed as
Xavg = sum(X * rho * dz) / sum(rho * dz) = sum(X * dp) / sum(dp)
when using pressure weighting and as
Xavg = sum(X * dz) / sum(dz) = sum(X * dp / rho) / sum( dp / rho)
when not using pressure weighting. Here dz is the height increment, dp = -rho*g*dz is the pressure increment, rho is air density, and g is the acceleration due to gravity.
I have noticed an inconsistency in the way layer averaging is performed for different variables when the interpolated sounding is used (
exact=False
). The layer-mean mixing ratio is computed without pressure weighting, whereas the layer-mean potential temperature and equivalent potential temperature are both computed with pressure weighting. Furthermore, when interpolation is not performed (exact=True
) the layer means are computed as simple averages without accounting for variations in layer mass or thickness. I note that theexact=True
option is used in the definition of the forecast parcel and the mixed-layer parcel, whereas the defaultexact=False
options is used in the definition of the effective-layer parcel and in the calculation of DCAPE.I think that, in general, the layer average of a quantity
X
should be computed asXavg = sum(X * rho * dz) / sum(rho * dz) = sum(X * dp) / sum(dp)
when using pressure weighting and asXavg = sum(X * dz) / sum(dz) = sum(X * dp / rho) / sum( dp / rho)
when not using pressure weighting. Heredz
is the height increment,dp = -rho*g*dz
is the pressure increment,rho
is air density, andg
is the acceleration due to gravity.