CAPE and CIN calculation in Python

Hi James,

I have managed to run CLIMT’s . Most of the functions I tested from within the Driver.f90 works fine except the CAPE and CIN routines. I sent an e-mail to the author regarding this but nothing back from him so far. Would you give a test if I send you a simple sounding data? My system is Window 7 (x64) and using Python(XY). f2py uses the gfortran provided in MinGW32 folder.

Could you provide an example (with some test data) for Kerry Emanuel’s code? That code has definitely more functions than I need but it might be a valuable source.

As for the NCL, it is easy to interface to a WRF output, it also includes a SkewT/LogP [], but the CAPE estimation in this script is very sensitive to the number of data-points, which I have bitten a couple of times. Dennis Shea has provided some CAPE calculation routines coded in fortran. [Check under for the files starting with cape*]. Yet I have no luck wrapping them via f2py.


On Sat, Mar 29, 2014 at 7:11 PM, James Boyle <jsboyle314@…287…> wrote:

I have used the CAPE and CIN from ClMT - a bit of overkill but many useful functions:

I have also wrapped using f2py the the Fortran CAPE and CIN of Kerry Emanuel ( a prestigious source) in his convect code:

If you prowl about in the NCL source distribution, you will find the fortran that the NCL skew - T uses.

If you ask, Dennis Shea of NCAR might break the code out for you. It is trivial to wrap using f2py ( f77).

On Mar 29, 2014, at 3:32 PM, Gökhan Sever <gokhansever@…2015…87…> wrote:


Lately, I am working on plotting sounding profiles on a SkewT/LogP diagram. The SkewT package which is located at has a nice feature to lift a parcel on dry/moist adiabats. This is very useful to demonstrate the regions of CIN and CAPE overlaid with the full sounding.

However, the package misses these diagnostic calculations. This is the only step holding me back to use Python only (migrating from NCL) for my plotting tasks. I am aware that these calculations are usually performed in fortran. Are there any routines wrapped in Python to calculate CAPE and CIN parameters? Any suggestions or comments would be really appreciated.


Matplotlib-users mailing list