<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Bo,</div><div class=""><br class=""></div><div class="">1) Assuming that your limited area grid is a Regular, Fixed or Fixed-Offset(e.g. with rotated coordinates) grid, you can use the function “uv2dv_cfd()” to calculate the divergence(div). However, you have to be careful with the definitions/positions of the wind components on the grid - whether staggered or non-staggered.</div><div class=""><br class=""></div><div class="">2) Calculating velocity potential(Chi) and divergent wind component in a limited area domain is however an endeavor.</div><div class=""> i) First, you cannot define wind field from velocity potential(Chi) alone, you also need the stream-function(Psi). That means you have to calculate the vorticity(vr) as well using the function “uv2vr_cfd()” assuming conditions in (1)</div><div class=""> i.e. from Helmholtz theorem, you end up with two elliptic equations</div><div class=""> Laplace(Psi)= vr (a)</div><div class=""> Laplace(Chi)= div (b)</div><div class=""> ii) In a global domain equations (a) and (b) are ‘not bound to’ any boundary condition. However, in a limited area domain the equations are coupled by the boundary conditions and should be solved simultaneously.</div><div class=""> i.e. if you consider wind field(V) decomposed into non-divergent and irrotational components as,</div><div class=""> V=k x grad(Psi)+grad(Chi) (c)</div><div class="">then, for Chi and Psi to satisfy equation (c) at the boundaries you need the normal and tangential wind components each of which involves derivatives of both Chi and Psi. </div><div class=""><br class=""></div><div class="">Equations (a) and (b) are commonly solved using successive over-relaxation(SOR) method, but any elliptic solver can be applied with a properly defined boundary condition.</div><div class=""><br class=""></div><div class="">I can only suggest that you write your own solver for equations (a) and (b) in c++ or fortran or whatever program language you deem suitable and call it in ncl using WRAPIT script - <a href="https://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml" class="">https://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml</a>. If you don’t want to go all the way to write your own program, there are even efficient direct solver subroutines specifically “hwscrt()” and “hwsssp()” from the “FISHPACK” library - <a href="https://www2.cisl.ucar.edu/legacy/fishpack/documentation" class="">https://www2.cisl.ucar.edu/legacy/fishpack/documentation</a>, which you can “wrap” in ncl as well.</div><div class=""><br class=""></div><div class="">Jack. </div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On 01 Oct 2015, at 03:57, Dong, Bo <<a href="mailto:bdong@albany.edu" class="">bdong@albany.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" class="">
<style type="text/css" style="display:none;" class=""><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div dir="ltr" class="">
<div id="divtagdefaultwrapper" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class=""><p class="">Hi All,</p><p class=""><br class="">
</p><p class="">As I'm trying to calculate the divergence and divergent wind component, I found a few functions such as dv2uvf, dv2ufg. However, all these functions require that U and V wind on a global grid. I'm wondering that for regional data, how can I compute the divergence,
velocity potential and divergent wind component on a non-global grid? Thanks.</p><p class=""><br class="">
</p><p class="">regards,</p><p class="">Bo</p>
</div>
</div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></body></html>