<div dir="ltr"><div>[1] As indicated in the documentation, the advection is via:</div><div><br></div><div> <b>adv_X = U*(dX/dlon) + V*(dX/dlat)</b></div><div><b><br></b></div><div><b> </b>There is *no* minus sign<b>. </b><br></div><div><br></div><div> Perhaps, something your are looking at has a convention<b>:</b></div><div><b><br></b></div><div><b> <b>minus_adv_X_ = -( U*(dX/dlon) + V*(dX/dlat) )<br></b></b></div><div><b><b><br></b></b></div><div><b><b>[2]</b></b> As indicated in the documentation: If <b><em>opt_adv</em>=1</b>, then:
<pre> adv_X = <strong>advect_variable</strong>(u,v,X,gridType,long_name,units,<b>opt_adv</b>)
; For clarity: explicitly extract the returned elements of the list variable. All meta data is present.
Xadv = adv_X[0] ; advected quantity
Xgrx = adv_X[1] ; longitudinal gradient
Xgry = adv_X[2] ; latitudinal gradient
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/printVarSummary.shtml"><strong>printVarSummary</strong></a>(Xadv) ; advection of 'X'<br> printMinMax(Xadv, 0)<br> print("---")<br></pre><pre> <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/printVarSummary.shtml"><strong>printVarSummary</strong></a>(Xgrx) ; longitudinal gradient
<a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/printVarSummary.shtml"><strong>printVarSummary</strong></a>(Xgry) ; latitudinal gradient<br><br></pre><pre><b><b><b>[3] </b></b></b>You can add the following<b><b><b><br></b></b></b></pre><pre><b><b><b> meridional_advX = v*Xgry<br> <b><b><b>meridional_advX@long_name = "..."<br> meridional_advX@units = "..."<br> copy_VarCoords(v<b><b><b><b><b><b>, meridional_advX)<br></b></b></b></b></b></b></b></b></b></b></b></b></pre><pre><b><b><b><b><b><b><b><b><b><b><b><b> printVarSummary(<b><b><b><b><b><b>meridional_advX)<br> printMinMax(<b><b><b><b><b><b>meridional_advX, 0)</b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></b></pre><pre><b><b><b> zonal_adv_X = u*Xgrx<br> ...<br></b></b></b></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 28, 2019 at 11:54 PM Lyndz <<a href="mailto:olagueralyndonmark429@gmail.com">olagueralyndonmark429@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Dear NCL-experts,<div><br></div><div>I just want to clarify the following:</div><div><br></div><div>I am calculating moisture advection from this example:</div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/advect_variable.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Contributed/advect_variable.shtml</a><br></div><div><br></div><div>Problems:</div><div>[1] I am a little confused about the sign of the given equation here. Should the final output (advection) be multipled by -1? Not multiplying by -1 seems to give me the correct result, but if this is the case, all the terms should be negative in the equation: <span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px"> </span></div><div><b style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px;margin:0px;padding:0px">adv_X = -U*(dX/dlon) -V*(dX/dlat)</b></div><div><br></div><div>[2] If I have to separate the zonal and meridional components, they should be also multiplied by -1?</div><div><br></div><div>Sincerely,</div><div><br></div><div>Lyndz</div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div>