# [ncl-talk] Clarification in velocity potential (fixed grid) calculations

Lyndon Mark Olaguera olagueralyndonmark429 at gmail.com
Fri Apr 28 21:00:27 MDT 2017

```Dear Sir Dennis,

Many many thanks for the help. I guess, i'll just use spherical harmonics
in calculating the velocity potential.

Sincerely,

Lyndz

On Sat, Apr 29, 2017 at 6:41 AM, Dennis Shea <shea at ucar.edu> wrote:

> attached a 'my' calculation script and figure.
>
> On Wed, Apr 26, 2017 at 10:14 PM, Lyndon Mark Olaguera <
> olagueralyndonmark429 at gmail.com> wrote:
>
>> Dear all,
>>
>> I am trying to plot the divergent winds and velocity potential using a
>> modified version of wind_3.ncl (https://www.ncl.ucar.edu/Appl
>> ications/wind.shtml) in the NCL page. I am doing the calculation for a
>> fixed grid.
>>
>> *I am not sure if I'm doing the calculations correctly.*
>>
>> I have some problems with the velocity potential calculation. The results
>> do not agree with the divergent winds (e.g. divergent winds at 200hPa
>> should correspond to negative velocity potential).
>>
>> I think I am missing something in the script or I am incorrectly doing
>> the calculations.
>>
>>
>> I am calculating the divergent winds and velocity potential like this:
>>
>>  * ;Divergence*
>>   div = uv2dvF_Wrap(u,v)
>>
>>   chi = uv2sfvpF(u,v)
>>   chi := chi(1,:,:,:)                     ; 1 for velocity potential
>>   chi = (/chi/1e6/)                     ; arbitrary scale
>>   chi at long_name = "velocity potential"
>>   chi at units     = "m/s"
>>   printVarSummary(chi)
>>
>>
>> *;Divergent wind components*
>>
>>   ud    = new ( dimsizes(u), typeof(u), u at _FillValue )
>>   vd    = new ( dimsizes(v), typeof(v), v at _FillValue )
>>   dv2uvf(div,ud,vd) ; div  ==> divergent  wind components
>>
>> *;Plotting*
>> plot=gsn_csm_vector_scalar_map(wks,ud(0,:,:),vd(0,:,:),chi(0,:,:),res)
>>
>>
>> Here are the data files that I am using.I am also attaching the sample
>> image and script here.
>>
>> /view?usp=sharing
>>
>> [UWIND]
>> /view?usp=sharing
>>
>>
>> I'll appreciate if anyone can suggest any way to improve this.
>>
>>
>> Sincerely,
>>
>> Lyndz
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...