-
Notifications
You must be signed in to change notification settings - Fork 442
Description
I believe that MetPy was recently updated to include the virtual temperature correction in its calculation of CAPE and CIN. From what I can see, this has been done by simply overwriting the parcel and environmental temperature profiles with the corresponding virtual temperature profiles in the cape_cin function (L2840-2841 of thermo.py). The problem comes when these virtual temperatures are passed to the lfc and el functions, where the virtual temperature is then used to calculate the LCL pressure as though it were still just temperature (L955 and L1166 of thermo.py). This will inevitably lead to an overestimation of the LCL height (an underestimation of LCL pressure and temperature), which in turn could lead to an overestimation of the heights of the LFC and EL (since these levels cannot be below the LCL). The effect is more likely to be seen for the LFC, since the EL will typically reside much higher up in the profile.
To rectify this issue, I would recommend defining the parcel and environmental temperatures as new arrays, rather than overwriting the corresponding temperature profiles. These could either be passed as additional arguments to the lfc and el functions or could simply be recalculated within these functions. This should help to ensure that virtual temperature is not inadvertently being treated as standard air temperature in any downstream functions.
Operating System
Linux
Version
Latest
Python Version
N/A
Code to Reproduce
N/A