<div dir="ltr"><div class="gmail_default" style="font-size:small">I think you need to look at your data more closely.  </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">My guess is that YCells and XCells are not actually lat / lon arrays, but yet you are trying to use them to plot your data over a map.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You have this code, which looks like you were trying to get NCL to recognize YCells and XCells as lat/lon arrays:</div><div class="gmail_default" style="font-size:small"><br></div><font face="monospace, monospace">lat = uf-&gt;u&amp;YCells                                <br>lon = uf-&gt;v&amp;XCells<br><br>u!0=&quot;lat&quot;<br>u!1=&quot;lon&quot;<br><br>u&amp;lat@units=&quot;degrees_north&quot;<br>u&amp;lon@units=&quot;degrees_east&quot;</font><div><br>However, I&#39;m suspicious that YCells and XCells actually represent the latitude and longitude values of your array. <br><br><div><div class="gmail_default" style="font-size:small">​It helps if you use &quot;printVarSummary&quot; to look at your data before you plot it:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">printVarSummary(u)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The above should also print the numeric range of the lat / lon arrays, and you will see very quickly whether they actually look like lat / lon values.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre"><br class="gmail-Apple-interchange-newline">   Variable : u
   Type : float
   . . .
   Number of Dimensions: 2
   Dimensions and sizes: [lat | <i>some number</i>] x [lon | <i>some number</i>]
   </span><b style="font-family:monospace;white-space:pre">Coordinates: 
               lat: [</b><i style="font-family:monospace;white-space:pre">...you&#39;ll see a numeric range here...</i><b style="font-family:monospace;white-space:pre">]
               lon: [</b><i style="font-family:monospace;white-space:pre">...ditto...</i><b style="font-family:monospace;white-space:pre">]</b><span style="font-family:monospace;white-space:pre">
   Number Of Attributes:</span><span style="font-family:monospace;white-space:pre">
</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre"><br></span></div><div class="gmail_default" style="font-size:small">If u has an attribute called &quot;coordinates&quot;, then it is very important to pay attention to this because this will likely tell you what the name is of your lat/lon arrays on the file, which you will need to use to replace &quot;YCells&quot; and &quot;XCells&quot;. It would look something like this:</div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre"><br class="gmail-Apple-interchange-newline">   Variable : u
   Type : float
   . . .
   Number of Dimensions: 2
   Dimensions and sizes: [lat | <i>some number</i>] x [lon | <i>some number</i>]
   </span><b style="font-family:monospace;white-space:pre">Coordinates: 
               lat: [</b><i style="font-family:monospace;white-space:pre">...you&#39;ll see a numeric range here...</i><b style="font-family:monospace;white-space:pre">]
               lon: [</b><i style="font-family:monospace;white-space:pre">...ditto...</i><b style="font-family:monospace;white-space:pre">]</b><span style="font-family:monospace;white-space:pre">
   Number Of Attributes: 5</span><span style="font-family:monospace;white-space:pre">
</span><span style="font-family:monospace;white-space:pre">   </span><b style="font-family:monospace;white-space:pre">coordinates</b><span style="font-family:monospace;white-space:pre">: &quot;latitude longitude&quot;</span><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre"><br></span></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Important note: the &quot;coordinates&quot; attribute is a different thing than &quot;Coordinates&quot;, which you *always* see when you do a printVarSummary.  The &quot;Coordinates&quot; output from printVarSummary represents coordinate *arrays* that may already be attached to your file. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you do see a &quot;coordinates&quot; attribute, then make note of the names in the attribute, then do an &quot;ncl_filedump&quot; on your file on the UNIX command line to see if your file contains variables with these names.  If it does, then you can replace this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">lat = uf-&gt;u&amp;YCells                                </span><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">lon = uf-&gt;v&amp;XCells</span><br style="font-family:monospace,monospace"><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u!0=&quot;lat&quot;</span><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u!1=&quot;lon&quot;</span><br style="font-family:monospace,monospace"><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u&amp;lat@units=&quot;degrees_north&quot;</span><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u&amp;lon@units=&quot;degrees_east&quot;</span><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace,monospace"><br></span></div>with:</div><div><br><div class="gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">u!0=&quot;lat&quot;</span><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u!1=&quot;lon&quot;</span><span style="font-family:monospace,monospace"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">u&amp;lat := uf-&gt;latitude     ; The &quot;:=&quot; forces YCell and XCell to be overwritten, in case</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">u&amp;lon := uf-&gt;longitude    ;</span><span style="font-family:monospace,monospace"> they are different types than latitude and longitude.</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace,monospace"><br></span></div>You need to do the same for &quot;v&quot;:</div><div><br><div class="gmail_default" style="font-size:small"><div class="gmail_default"><span style="font-family:monospace,monospace">v!0=&quot;lat&quot;</span><br style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">v!1=&quot;lon&quot;</span><span style="font-family:monospace,monospace"><br></span></div><div class="gmail_default"><span style="font-family:monospace,monospace">v&amp;lat = vf-&gt;latitude</span></div><div class="gmail_default"><span style="font-family:monospace,monospace">v&amp;lon = vf-&gt;longitude</span></div></div><div class="gmail_default" style="font-size:small">​<br></div><div class="gmail_default" style="font-size:small">If the above doesn&#39;t work, then it would help if you could email ncl-talk and provide the output from doing an &quot;ncl_filedump&quot; on <a href="http://uwind500.nc">uwind500.nc</a>.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">​--Mary</div><div class="gmail_default" style="font-size:small">​</div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 30, 2017 at 3:36 AM, gurbrinder aulakh <span dir="ltr">&lt;<a href="mailto:gurbrinderaulakh@yahoo.co.in" target="_blank">gurbrinderaulakh@yahoo.co.in</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div dir="ltr" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14162">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="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14163"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14164"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14165"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14166"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14167"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14168"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14169"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14170"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14171">warning:IrTransInitialize: trYCoordPoints contains invalid coordinate array: defaulting trYAxisType to LinearAxis</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14172">warning:<wbr>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="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14173">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="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14174">warning:<wbr>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="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14175">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="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14176">warning:<wbr>StreamlinePlotInitialize: coordinate spacing is irregular; linear spacing only possible using index coordinates for Y Axis</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14177">warning:IrTransInitialize: trYCoordPoints contains invalid coordinate array: defaulting trYAxisType to LinearAxis</div><div dir="ltr" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14178"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14179"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14180"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14181"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14182"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14183"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14184"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14185"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14186"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14187"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14188">******************************<wbr>*******************</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14189">;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14190">; These files are loaded by default in NCL V6.2.0 and newer</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14191">; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;   </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14192">; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot;    </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14193">; load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot; </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14194">;*****************************<wbr>********************</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14195">begin</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14196"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14197"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14198">  uf = addfile(&quot;<a href="http://uwind500.nc" target="_blank">uwind500.nc</a>&quot;,&quot;r&quot;)  </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14199">    vf = addfile(&quot;<a href="http://vwind500.nc" target="_blank">vwind500.nc</a>&quot;,&quot;r&quot;)</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14200">    </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14201">     u   = uf-&gt;UGRD_500_ISBL(0,:,:)</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14202">    v   = vf-&gt;VGRD_500_ISBL(0,:,:)</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14203"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14204"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14205">lat = uf-&gt;u&amp;YCells                                </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14206">    lon = uf-&gt;v&amp;XCells</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14207"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14208"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14209">u!0=&quot;lat&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14210">u!1=&quot;lon&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14211"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14212"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14213">u&amp;lat@units=&quot;degrees_north&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14214">u&amp;lon@units=&quot;degrees_east&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14215"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14216"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14217">printVarSummary(u);</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14218">  div = uv2dvG_Wrap(u,v)                ; u,v ==&gt; divergence</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14219"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14220"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14221">  dv2uvg(div,u,v) ; div  ==&gt; divergent  wind components</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14222"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14223"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14224">  </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14225"> u@long_name  = &quot;Zonal Divergent Wind&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14226">  u@units      = u@units</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14227">  v@long_name  = &quot;Meridional Divergent Wind&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14228">  v@units      = v@units</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14229"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14230"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14231">;*****************************<wbr>********************</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14232">; plot results</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14233">;*****************************<wbr>********************    </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14234">  wks  = gsn_open_wks(&quot;png&quot;,&quot;wind123&quot;)           ; send graphics to PNG file</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14235">                                             </div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14236">  res                 = True</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14237">  res@vcRefMagnitudeF = 3.                    ; make vectors larger</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14238">  res@vcRefLengthF    = 0.050                 ; reference vector length</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14239">  res@vcGlyphStyle    = &quot;CurlyVector&quot;         ; turn on curly vectors</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14240">  res@vcMinDistanceF  = 0.012                 ; thin the vectors</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14241"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14242"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14243">  res@gsnLeftString   = &quot;Divergent Wind&quot;</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14244">                                              ; plot 1st time step</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14245">  plot= gsn_csm_vector_map(wks,u(:,:),<wbr>v(:,:),res)</div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14246"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14247"></div><div id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14248">end</div><div dir="ltr" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14249"><br clear="none" id="m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14250"></div></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>