<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1496049997873_3733"><span></span></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1496049997873_3732"><br><br></div>  <div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1496049997873_3709" style="display: block;"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1496049997873_3708"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1496049997873_3707"> <div dir="ltr" id="yui_3_16_0_ym19_1_1496049997873_3731"><font size="2" face="Arial" id="yui_3_16_0_ym19_1_1496049997873_3730"> On Sunday, 28 May 2017 8:50 PM, gurbrinder aulakh &lt;gurbrinderaulakh@yahoo.co.in&gt; wrote:<br></font></div>  <br><br> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1496049997873_3706"><div id="yiv6157683804"><div id="yui_3_16_0_ym19_1_1496049997873_3705"><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_ym19_1_1496049997873_3704"><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8906" dir="ltr">I want to compute wind divergence reading u and v wind components but I am getting the following warnings when I run the script.Plot is also not as expected... Please help tried everything from the earlier queries but not finding any solution.... Am I reading the correct values....Thanks in advance..</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8906"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8906"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8906"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8906"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8906">warning:IrTransInitialize: trYCoordPoints contains invalid coordinate array: defaulting trYAxisType to LinearAxis</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8907">warning:AutoComputeMajorTickMarks: min and max are so close together or so far apart that arithmetic error may cause problems, proceed at own risk</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8908">warning:ComputeMinorTickMarks: The distance between major tickmarks is so close or so far apart that arithmetic error may cause problems determining the accurate locations of minor tickmarks</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8909">warning:AutoComputeMajorTickMarks: min and max are so close together or so far apart that arithmetic error may cause problems, proceed at own risk</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8910">warning:ComputeMinorTickMarks: The distance between major tickmarks is so close or so far apart that arithmetic error may cause problems determining the accurate locations of minor tickmarks</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8911">warning:StreamlinePlotInitialize: coordinate spacing is irregular; linear spacing only possible using index coordinates for Y Axis</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8912">warning:IrTransInitialize: trYCoordPoints contains invalid coordinate array: defaulting trYAxisType to LinearAxis</div><div dir="ltr" id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8913"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8914"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8760"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8760"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8760"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8760"><br></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8760">*************************************************</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8761">;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8762">; These files are loaded by default in NCL V6.2.0 and newer</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8763">; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" &nbsp;&nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8764">; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" &nbsp; &nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8765">; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"&nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8766">;*************************************************</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8767">begin</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8768"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8769"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8770">&nbsp; uf = addfile("uwind500.nc","r") &nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8771">&nbsp; &nbsp; vf = addfile("vwind500.nc","r")</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8772">&nbsp; &nbsp;&nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8773">&nbsp; &nbsp; &nbsp;u &nbsp; = uf-&gt;UGRD_500_ISBL(0,:,:)</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8774">&nbsp; &nbsp; v &nbsp; = vf-&gt;VGRD_500_ISBL(0,:,:)</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8775"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8776"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8777">lat = uf-&gt;u&amp;YCells &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8778">&nbsp; &nbsp; lon = uf-&gt;v&amp;XCells</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8779"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8780"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8781">u!0="lat"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8782">u!1="lon"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8783"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8784"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8785">u&amp;lat@units="degrees_north"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8786">u&amp;lon@units="degrees_east"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8787"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8788"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8789">printVarSummary(u);</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8790">&nbsp; div = uv2dvG_Wrap(u,v) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; u,v ==&gt; divergence</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8791"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8792"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8793">&nbsp; dv2uvg(div,u,v) ; div &nbsp;==&gt; divergent &nbsp;wind components</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8794"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8795"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8796">&nbsp;&nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8797">&nbsp;u@long_name &nbsp;= "Zonal Divergent Wind"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8798">&nbsp; u@units &nbsp; &nbsp; &nbsp;= u@units</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8799">&nbsp; v@long_name &nbsp;= "Meridional Divergent Wind"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8800">&nbsp; v@units &nbsp; &nbsp; &nbsp;= v@units</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8801"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8802"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8803">;*************************************************</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8804">; plot results</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8805">;************************************************* &nbsp; &nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8806">&nbsp; wks &nbsp;= gsn_open_wks("png","wind123") &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; send graphics to PNG file</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8807">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8808">&nbsp; res &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = True</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8809">&nbsp; res@vcRefMagnitudeF = 3. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; make vectors larger</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8810">&nbsp; res@vcRefLengthF &nbsp; &nbsp;= 0.050 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; reference vector length</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8811">&nbsp; res@vcGlyphStyle &nbsp; &nbsp;= "CurlyVector" &nbsp; &nbsp; &nbsp; &nbsp; ; turn on curly vectors</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8812">&nbsp; res@vcMinDistanceF &nbsp;= 0.012 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; thin the vectors</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8813"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8814"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8815">&nbsp; res@gsnLeftString &nbsp; = "Divergent Wind"</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8816">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; plot 1st time step</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8817">&nbsp; plot= gsn_csm_vector_map(wks,u(:,:),v(:,:),res)</div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8818"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8819"></div><div id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8820">end</div><div dir="ltr" id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8821"><br id="yiv6157683804yui_3_16_0_ym19_1_1495972864413_8822"></div></div></div></div><br><br></div>  </div> </div>  </div></div></body></html>