Calculating DCAPE for a WRF-ARW grid

spacekace3005

New member
Hi everyone,

I was wondering if anyone has successfully plotted gridded DCAPE using WRF-ARW output. I was able to successfully write a script to do this using MetPy and xarray/xwrf, but the computing time required to produce even one plot is far beyond what I can afford both time-wise and computationally. E.g., it took over 6 hours to loop through grid points, and was still unable to produce a plot due to walltime limitations. I know the script works as I printed the data to my output file... It's just far too computationally heavy. Any suggestions or recommendations on how to speed up the processing time are much appreciated. My script and the output file produced (before the job was killed) are located here:

/glade/derecho/scratch/kshourd/WRFOUT/12_May_2022/convection/d02/dcape-pythia_v4.py
/glade/derecho/scratch/kshourd/WRFOUT/12_May_2022/convection/d02/dcape.o5063314

I based my method on the MetPy example located here: Most-Unstable Convective Available Potential Energy (MUCAPE) - The MetPy Cookbook

Is there any effort with WRF-Python to integrate these calculations in a similar way to the getvar computations of 2D and 3D CAPE/CIN? I can't remember if DCAPE was available in NCL/fortran, but if it was, I imagine this would be an easy addition.

Thanks in advance!
Kacie
 
Last edited:
Kacie,

Sorry that I cannot help with your issue. I am not an expert in parallel python programming, and I am in the learning process, too.

I have asked around and it seems that my colleagues are also not familiar with this topic.

You probably can get some information from unidata? Please keep me posted if you get any updates. Thanks in advance.
 
Hi Ming,

No problem at all, and thanks for the response. I am trying to get an alternate Python module working (GitHub - leaver2000/nzthermo: 2d (N, Z) Atmospheric thermodynamic functions), which utilizes Cython to do the computations differently/faster. Have yet to make it work with 3D WRF data, but I think I am close! I will update if it is successful, in case it is useful for someone else in the future.

Cheers,
Kacie
I would also send a message to the MetPy help email, I know they are overhauling met py and i'm sure they would like your feedback.
 
Back
Top