[ncl-talk] CAPE calculation

Wang, Jiali jialiwang at anl.gov
Thu Nov 11 09:48:51 MST 2021


Dear Dave, Barry and Dennis,

Thank you all for the detail notes, they are extremely helpful for me to continue exploring my problem. While I now understand the missing values are normal, I did test the difference in CAPE calculation between different versions as Dave suggested. I do find differences between v6.5.0 and v6.6.2, and I also found an even bigger difference between v6.3.0 and v6.6.2. In v 6.3.0 (the only version I tested), there is a bug in CAPE calculation in WRFARWUser.ncl, the PSFC should be converted to hPa. This is fixed in 6.5.0 and after (again these are the versions I tested, it seems v6.4.0 is also good from previous ncl-talk). See images below for JJA averaged CAPE_2D (maximum CAPE) in 2018, left v6.6.2 vs 6.3.0; right v6.6.2 vs 6.5.0.

[cid:image001.png at 01D7D6E9.B39CCA00][cid:image002.png at 01D7D6E9.B39CCA00]

From: Dave Allured - NOAA Affiliate <dave.allured at noaa.gov>
Date: Tuesday, November 9, 2021 at 10:38 PM
To: Barry Lynn <barry.h.lynn at gmail.com>
Cc: "Dennis edu>" <shea at ucar.edu>, Jiali Wang <jialiwang at anl.gov>, "ncl-talk at mailman.ucar.edu" <ncl-talk at mailman.ucar.edu>
Subject: Re: [ncl-talk] CAPE calculation

Output missing values are normal for the WRF CAPE and CIN functions.  Please refer to NCL documentation for the specific functions wrf_cape_2d and wrf_cape_3d.  The descriptions are confusing.  They are trying to say in essence, "Missing values are returned for out-of-range values".  It is also not clear what "out of range" means.  With a quick look at the fortran code, it seems that "out of range" means very low energy values by a combination of two different tests.

I recently used wrf_cape_2d with global grids from a climate model.  Spot checking gave these results which are similar to Jiali's graphical results.

CAPE:  64% to 71% missing globally.   Minimum value = 0.10000 J/kg.
CIN:     77% to 80% missing globally.   Minimum value = 0.10000 J/kg.

The large difference in proportion missing between Jiali's case and mine may be explained because Jiali's region is central US, a land region with a reputation for high convective activity.  Presumably a distribution of global grid points including oceans and arctic regions averages to much less convective energy per grid point, therefore more out-of-range low values.  Also I suspect that the proportion missing has a seasonal variation, but I did not do enough checks to confirm this.

On a final note, there was an undocumented change in the code for the CAPE and CIN functions, somewhere between NCL versions 6.5.0 and 6.6.2.  The two versions produce significantly different numeric results!  The fortran 90 CAPE code in 6.6.2 is obviously more modern than the corresponding fortran 77 code in 6.5.0.  I recommend that only NCL version 6.6.2 or later should be used to calculate CAPE and CIN.


On Tue, Nov 9, 2021 at 8:39 PM Barry Lynn via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
My guess would be that some locations do not meet the criteria within the code for calculating CAPE -- these points are ignored.  For instance, if the iteration fails within.

Barry

On Wed, Nov 10, 2021 at 3:11 AM Dennis Shea via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
NCL developers did not write CAPE_{2D/3D) fortran subroutines called by NCL. I have no experience with these functions.

I have attached the fortran code invoked by NCL. Perhaps the following subroutines will provide some insight.

DCAPECALC3D
DCAPECALC2D

Note that at the top of the code a disclaimer is issued:

"! Also, be advised that missing data values are not checked during the computation."
===
Perhaps some input variable has _FillValue

Good Luck


On Tue, Nov 9, 2021 at 10:21 AM Wang, Jiali via ncl-talk <ncl-talk at mailman.ucar.edu<mailto:ncl-talk at mailman.ucar.edu>> wrote:
Dear NCL users,

I have been using wrf_get_uservar to get cape_2d and cape_3d for my research domain, over the Great Lakes region. There are water bodies and land. I noticed there are many missing values in both cape_2d and 3d outcomes. See some examples attached. I have also tried to use wrf_cape_2d to calculate cape_2d, and I made sure the PSFC is converted to hPa. The outcome is almost the same, with lots of missing values. Missing values are located over different places at different times.

However, it seems the missing value is not expected? https://www.ncl.ucar.edu/Support/talk_archives/2013/2422.html

Can you advice what is the correct way to calculate CAPE or whether I am getting reasonable results?

Thank you!
Jiali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211111/a2321819/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 700740 bytes
Desc: image001.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211111/a2321819/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 757452 bytes
Desc: image002.png
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20211111/a2321819/attachment-0003.png>


More information about the ncl-talk mailing list