<div dir="ltr"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear all,</div><div dir="ltr"><br></div><div>I am trying to plot the divergent winds and velocity potential using a modified version of wind_3.ncl (<a href="https://www.ncl.ucar.edu/Applications/wind.shtml">https://www.ncl.ucar.edu/Applications/wind.shtml</a>) in the NCL page. I am doing the calculation for a fixed grid.</div><div><br></div><div><b>I am not sure if I&#39;m doing the calculations correctly.</b></div><div><br></div><div>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).</div><div><br></div><div>I think I am missing something in the script or I am incorrectly doing the calculations.</div><div><br></div><div><br></div><div>I am calculating the divergent winds and velocity potential like this:</div><div><br></div><div> <b> ;Divergence</b></div><div>  div = uv2dvF_Wrap(u,v)</div><div><br></div><div><div>  chi = uv2sfvpF(u,v)</div><div>  chi := chi(1,:,:,:)                     ; 1 for velocity potential</div><div>  chi = (/chi/1e6/)                     ; arbitrary scale</div><div>  chi@long_name = &quot;velocity potential&quot;</div><div>  chi@units     = &quot;m/s&quot;</div><div>  printVarSummary(chi)</div></div><div><br></div><div><br></div><div><b>;Divergent wind components</b></div><div><b><br></b></div><div>  ud    = new ( dimsizes(u), typeof(u), u@_FillValue )</div><div>  vd    = new ( dimsizes(v), typeof(v), v@_FillValue )</div><div>  dv2uvf(div,ud,vd) ; div  ==&gt; divergent  wind components</div><div><br></div><div><b>;Plotting</b></div><div>plot=gsn_csm_vector_scalar_map(wks,ud(0,:,:),vd(0,:,:),chi(0,:,:),res)<br></div><div><br></div><div><br></div><div>Here are the data files that I am using.I am also attaching the sample image and script here.</div><div><br></div><div dir="ltr">[VWIND] <a href="https://drive.google.com/file/d/0B9faET7Bc2o8MzlGVUZsMjdHa28/view?usp=sharing">https://drive.google.com/file/d/0B9faET7Bc2o8MzlGVUZsMjdHa28/view?usp=sharing</a><br><div><br></div><div>[UWIND]</div><div><a href="https://drive.google.com/file/d/0B9faET7Bc2o8QTh1OG4zOVYtVlU/view?usp=sharing">https://drive.google.com/file/d/0B9faET7Bc2o8QTh1OG4zOVYtVlU/view?usp=sharing</a><br></div><div><br></div><div><br></div><div>I&#39;ll appreciate if anyone can suggest any way to improve this.</div><div><br></div><div><br></div><div>Sincerely,</div><div><br></div><div>Lyndz</div></div></div></div></div></div></div></div></div>
</div>