# [ncl-talk] Calculation of vertical vapor flux divergence from WRF out file

Dennis Shea shea at ucar.edu
Sat Jul 15 12:05:37 MDT 2023

```There are no specific functions or examples to calculate vertical vapor
flux divergence:

(1/g*[d(qw)/dz])

from a WRF output.
=================

I do not remember much about WRF output.

Generically:

QW = Q*W

dQWdz = *center_finite_diff_n*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/center_finite_diff_n.shtml>
(QW,'z',False,0,0)

=======================

There are several examples for doing this type of activity on 'regular/
rectilinear' grids with pressure [also, hybrid levels]:
*https://www.ncl.ucar.edu/Applications/wind.shtml*
<https://www.ncl.ucar.edu/Applications/wind.shtml>

========================
Good Luck

On Thu, Jul 13, 2023 at 9:35 PM Anie K Lal via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi all,
>
> I want to calculate the vertical vapor flux divergence
> (1/g*[d(qw)/dz])from a WRF output.
>
> I found the vapor flux as below:
>    shum        =   mixhum_ptrh(pres,temp,rh,2)  ;units:
> (hPA,K,%,kg/kg);calculate the specific humidity(2),(1)means mixing ratio
>    ;printVarSummary(shum)
>    uq          =   ua * shum                        ;vapor flux
>    vq          =   va * shum
>    wq          =   wa * shum
>
> Not sure how to find the divergence.
> I have gone through few examples in:
> https://www.ncl.ucar.edu/Applications/wind.shtml
> https://www.ncl.ucar.edu/Applications/ESMF.shtml
>
> All consider only u and v. How do I do it?
>
> Looking forward to any kind of help or advise.
>
> Thank you.
> Anie K Lal
> PhD Student
> IIT Delhi
> India
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20230715/136f0ab5/attachment.htm>
```