<div dir="ltr"><div class="gmail_default" style="font-size:small">Dear Grubinder,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It looks like your latitude / longitude values are two-dimensional rather than one-dimensional, which means you can't treat them as coordinate arrays:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"> float longitude ( YCells, XCells ) <------ This is a 2d array!</div><div class="gmail_default"> long_name : longitude coordinate</div><div class="gmail_default"> units : degrees_east</div><div class="gmail_default"> precision : 6</div><div class="gmail_default"> grid_mapping : MapProjection</div><div class="gmail_default"> standard_name : longitude</div><div class="gmail_default"> _CoordinateAxisType : Lon</div><div class="gmail_default"><br></div><div class="gmail_default"> float latitude ( YCells, XCells ) <------ This is a 2d array!</div><div class="gmail_default"> long_name : latitude coordinate</div><div class="gmail_default"> units : degrees_north</div><div class="gmail_default"> precision : 6</div><div class="gmail_default"> grid_mapping : MapProjection</div><div class="gmail_default"> standard_name : latitude</div><div class="gmail_default"> _CoordinateAxisType : Lat</div><div class="gmail_default"><br></div></div><div class="gmail_default" style="font-size:small">Your data is on a "curvilinear" grid which is data represented by 2D lat/lon arrays.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Because of this, you also cannot use uv2dvg or uv2vrg to calculate divergence and vorticity, because these are meant to be used with gaussian grids only. It looks like you are not using these calculations for anything anyway, so I'm not sure why they are in there.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To plot u and v which on a curvilinear grid, you need to replace this code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">lat=uf->latitude(:,0)</font></div><div class="gmail_default"><font face="monospace, monospace">lon=uf->longitude(0,:)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">u&YCells = uf->latitude(: ,0)</font></div><div class="gmail_default"><font face="monospace, monospace">u&XCells = uf->longitude(0,:)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">v&YCells = vf->latitude(:,0)</font></div><div class="gmail_default"><font face="monospace, monospace">v&XCells= vf->longitude(0,:)</font></div><div class="gmail_default"><br></div><div class="gmail_default">with:</div><div class="gmail_default"><br></div><div class="gmail_default"><font face="monospace, monospace">delete(u&YCells) ; Remove these coordinate arrays since</font></div><div class="gmail_default"><font face="monospace, monospace">delete(u&XCells) ; they don't represent latitude/longitude </font></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">delete(v&YCells)</font></div><div class="gmail_default"><font face="monospace, monospace">delete(v&XCells)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">u@lat2d = uf->latitude ; lat2d/lon2d are recognized by the gsn_csm_xxxx_map</font></div><div class="gmail_default"><font face="monospace, monospace">u@lon2d = uf->longitude ; routines for plotting curvilinear data.</font></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">v@lat2d = vf->latitude</font></div><div class="gmail_default"><font face="monospace, monospace">v@lon2d = vf->longitude</font></div><div class="gmail_default"><br></div><div>For more information about plotting U,V on a curvilinear grid, please see dataonmap_4.ncl at:</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml">http://www.ncl.ucar.edu/Applications/plot_data_on_map.shtml</a><br></div><div><br></div><div>If you are new to NCL, I recommend reading the NCL User Guide:</div><div><br></div><div><a href="http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/">http://www.ncl.ucar.edu/Document/Manuals/NCL_User_Guide/</a><br></div><div><br></div><div>--Mary</div><div><br></div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 1, 2017 at 1:38 AM, gurbrinder aulakh <span dir="ltr"><<a href="mailto:gurbrinderaulakh@yahoo.co.in" target="_blank">gurbrinderaulakh@yahoo.co.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4657"><span></span></div><div class="m_1912884374143782876qtdSeparateBR" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4652"><br></div><div class="m_1912884374143782876yahoo_quoted" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4674" style="display:block"><div style="font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4673"><div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4672"><br> <div class="m_1912884374143782876y_msg_container" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4707"><div id="m_1912884374143782876yiv5175715787"><div id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4706"><div style="color:#000;background-color:#fff;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4705"><div id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_5004"><span>Dear Mary Haley,</span></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56567"><span id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56566">Thanks a lot for your reply... I really appreciate that. Your explanation was crystal clear. I have used ncl_filedump and made changes accordingly by replacing YCells and XCells with latitude and longitude....Then I have warnings like</span></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56567"><span><br clear="none"></span></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56567"><span><br clear="none"></span></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56627">(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56628">(0) You may want to set gsnAddCyclic to False to avoid a warning</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56629">(0) message from the spline function.</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56630">(0) gsn_add_cyclic: Warning: The range of your longitude data is not 360.</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56631">(0) You may want to set gsnAddCyclic to False to avoid a warning</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56632">(0) message from the spline function.</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56569"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633">warning:VectorFieldSetValues: irregular coordinate array vfXArray non-monotonic: defaulting vfXArray</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633"><br clear="none"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633">I have added res@gsnAddCyclic = False res@gsnAddCyclic = False </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633">but still left with the last warning.....</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633">warning:VectorFieldSetValues: irregular coordinate array vfXArray non-monotonic: defaulting vfXArray</div><div dir="ltr" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4745"><br id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4746"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633"><br clear="none"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633">Here is my code with changes </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57128">begin</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57129"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57130"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57131"> uf = addfile("<a href="http://uwind500.nc" target="_blank">uwind500.nc</a>","r") </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57132"> vf = addfile("<a href="http://vwind500.nc" target="_blank">vwind500.nc</a>","r")</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57133"> </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57134"> u = uf->UGRD_500_ISBL(0,:,:)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57135"> v = vf->VGRD_500_ISBL(0,:,:)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57136"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57137"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57138"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57139"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57140"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57141"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57142">lat=uf->latitude(:,0)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57143">lon=uf->longitude(0,:)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57144"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57145"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57146"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57147"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57148">u&YCells = uf->latitude(: ,0)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57149">u&XCells = uf->longitude(0,:)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57150"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57151"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57152"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57153"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57154"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57155"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57156">v&YCells = vf->latitude(:,0)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57157">v&XCells= vf->longitude(0,:)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57158"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57159"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57160"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57161"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57162">printVarSummary(u)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57163"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57164"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57165"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57166"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57167"> </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57168"> </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57169">div = uv2dvG_Wrap(u,v) ; u,v ==> divergence</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57170"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57171"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57172"> dv2uvg(div,u,v) ; div ==> divergent wind components</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57173"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57174"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57175"> </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57176"> u@long_name = "Zonal Divergent Wind"</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57177"> u@units = u@units</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57178"> v@long_name = "Meridional Divergent Wind"</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57179"> v@units = v@units</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57180"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57181"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57182">;*****************************<wbr>********************</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57183">; plot results</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57184">;*****************************<wbr>******************** </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57185"> wks = gsn_open_wks("png","wind123") ; send graphics to PNG file</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57186"> </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57187"> res = True</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57188"> res@vcRefMagnitudeF = 3. ; make vectors larger</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57189"> res@vcRefLengthF = 0.050 ; reference vector length</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57190"> res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57191"> res@vcMinDistanceF = 0.012 ; thin the vectors</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57192"> res@gsnAddCyclic = False</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57193"> res@gsnLeftString = "Divergent Wind"</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57194"> ; plot 1st time step</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57195"> plot= gsn_csm_vector_map(wks,u(:,:),<wbr>v(:,:),res)</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57196"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57197"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_57198">end</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56633"> </div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634"><br clear="none" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56635"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634">output of the <a href="http://uwind500.nc" target="_blank">uwind500.nc</a> is also attached... please help me to understand am i reading the data right...thanks a lot for time and help....</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634"><br clear="none"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634">Regards,</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634">Gurbrinder Kaur</div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634"><br clear="none"></div><div dir="ltr" id="m_1912884374143782876yiv5175715787yui_3_16_0_ym19_1_1496215850755_56634"><br clear="none"></div> <div class="m_1912884374143782876yiv5175715787qtdSeparateBR" id="m_1912884374143782876yui_3_16_0_ym19_1_1496302320150_4787"><br clear="none"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787yahoo_quoted" style="display:block"> <div style="font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"> <div class="m_1912884374143782876yiv5175715787yqt4799037442" id="m_1912884374143782876yiv5175715787yqtfd12880"><div dir="ltr"><font size="2" face="Arial"> On Tuesday, 30 May 2017 10:04 PM, Mary Haley <<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>> wrote:<br clear="none"></font></div> <br clear="none"><br clear="none"> <div class="m_1912884374143782876yiv5175715787y_msg_container"><div id="m_1912884374143782876yiv5175715787"><div><div dir="ltr"><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">I think you need to look at your data more closely. </div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_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="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_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="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><font face="monospace, monospace">lat = uf->u&YCells <br clear="none">lon = uf->v&XCells<br clear="none"><br clear="none">u!0="lat"<br clear="none">u!1="lon"<br clear="none"><br clear="none">u&lat@units="degrees_north"<br clear="none">u&lon@units="degrees_east"</font><div><br clear="none">However, I'm suspicious that YCells and XCells actually represent the latitude and longitude values of your array. <br clear="none"><br clear="none"><div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">It helps if you use "printVarSummary" to look at your data before you plot it:</div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">printVarSummary(u)</div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_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="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre-wrap"><br clear="none" class="m_1912884374143782876yiv5175715787gmail-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-wrap">Coordinates:
lat: [</b><i style="font-family:monospace;white-space:pre-wrap">...you'll see a numeric range here...</i><b style="font-family:monospace;white-space:pre-wrap">]
lon: [</b><i style="font-family:monospace;white-space:pre-wrap">...ditto...</i><b style="font-family:monospace;white-space:pre-wrap">]</b><span style="font-family:monospace;white-space:pre-wrap">
Number Of Attributes:</span><span style="font-family:monospace;white-space:pre-wrap">
</span></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre-wrap"><br clear="none"></span></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">If u has an attribute called "coordinates", 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 "YCells" and "XCells". It would look something like this:</div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre-wrap"><br clear="none" class="m_1912884374143782876yiv5175715787gmail-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-wrap">Coordinates:
lat: [</b><i style="font-family:monospace;white-space:pre-wrap">...you'll see a numeric range here...</i><b style="font-family:monospace;white-space:pre-wrap">]
lon: [</b><i style="font-family:monospace;white-space:pre-wrap">...ditto...</i><b style="font-family:monospace;white-space:pre-wrap">]</b><span style="font-family:monospace;white-space:pre-wrap">
Number Of Attributes: 5</span><span style="font-family:monospace;white-space:pre-wrap">
</span><span style="font-family:monospace;white-space:pre-wrap"> </span><b style="font-family:monospace;white-space:pre-wrap">coordinates</b><span style="font-family:monospace;white-space:pre-wrap">: "latitude longitude"</span><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace;white-space:pre-wrap"><br clear="none"></span></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">Important note: the "coordinates" attribute is a different thing than "Coordinates", which you *always* see when you do a printVarSummary. The "Coordinates" output from printVarSummary represents coordinate *arrays* that may already be attached to your file. </div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">If you do see a "coordinates" attribute, then make note of the names in the attribute, then do an "ncl_filedump" 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="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">lat = uf->u&YCells </span><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">lon = uf->v&XCells</span><br clear="none" style="font-family:monospace,monospace"><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u!0="lat"</span><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u!1="lon"</span><br clear="none" style="font-family:monospace,monospace"><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u&lat@units="degrees_north"</span><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u&lon@units="degrees_east"</span><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace,monospace"><br clear="none"></span></div>with:</div><div><br clear="none"><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">u!0="lat"</span><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">u!1="lon"</span><span style="font-family:monospace,monospace"><br clear="none"></span></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">u&lat := uf->latitude ; The ":=" forces YCell and XCell to be overwritten, in case</span></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace,monospace">u&lon := uf->longitude ;</span><span style="font-family:monospace,monospace"> they are different types than latitude and longitude.</span></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><span style="font-family:monospace,monospace"><br clear="none"></span></div>You need to do the same for "v":</div><div><br clear="none"><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><div class="m_1912884374143782876yiv5175715787gmail_default"><span style="font-family:monospace,monospace">v!0="lat"</span><br clear="none" style="font-family:monospace,monospace"><span style="font-family:monospace,monospace">v!1="lon"</span><span style="font-family:monospace,monospace"><br clear="none"></span></div><div class="m_1912884374143782876yiv5175715787gmail_default"><span style="font-family:monospace,monospace">v&lat = vf->latitude</span></div><div class="m_1912884374143782876yiv5175715787gmail_default"><span style="font-family:monospace,monospace">v&lon = vf->longitude</span></div></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">If the above doesn't work, then it would help if you could email ncl-talk and provide the output from doing an "ncl_filedump" on <a rel="nofollow" shape="rect" href="http://uwind500.nc/" target="_blank">uwind500.nc</a>.</div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"><br clear="none"></div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small">--Mary</div><div class="m_1912884374143782876yiv5175715787gmail_default" style="font-size:small"></div><br clear="none"></div></div></div><div class="m_1912884374143782876yiv5175715787gmail_extra"><br clear="none"><div class="m_1912884374143782876yiv5175715787gmail_quote">On Tue, May 30, 2017 at 3:36 AM, gurbrinder aulakh <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:gurbrinderaulakh@yahoo.co.in" target="_blank">gurbrinderaulakh@yahoo.co.in</a>></span> wrote:<br clear="none"><blockquote class="m_1912884374143782876yiv5175715787gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_1912884374143782876yiv5175715787yqt3896658420" id="m_1912884374143782876yiv5175715787yqt97188"><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_1912884374143782876yiv5175715787m_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_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14163"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14164"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14165"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14166"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14167"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14168"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14169"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14170"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14171">warning:IrTransInitialize: trYCoordPoints contains invalid coordinate array: defaulting trYAxisType to LinearAxis</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14172">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="m_1912884374143782876yiv5175715787m_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_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14174">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="m_1912884374143782876yiv5175715787m_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_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14176">warning: StreamlinePlotInitialize: coordinate spacing is irregular; linear spacing only possible using index coordinates for Y Axis</div><div id="m_1912884374143782876yiv5175715787m_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_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14178"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14179"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14180"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14181"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14182"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14183"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14184"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14185"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14186"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14187"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14188">****************************** *******************</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14189">;</div><div id="m_1912884374143782876yiv5175715787m_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_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14191">; load "$NCARG_ROOT/lib/ncarg/ nclscripts/csm/gsn_code.ncl" </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14192">; load "$NCARG_ROOT/lib/ncarg/ nclscripts/csm/gsn_csm.ncl" </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14193">; load "$NCARG_ROOT/lib/ncarg/ nclscripts/csm/contributed. ncl" </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14194">;***************************** ********************</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14195">begin</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14196"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14197"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14198"> uf = addfile("<a rel="nofollow" shape="rect" href="http://uwind500.nc/" target="_blank">uwind500.nc</a>","r") </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14199"> vf = addfile("<a rel="nofollow" shape="rect" href="http://vwind500.nc/" target="_blank">vwind500.nc</a>","r")</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14200"> </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14201"> u = uf->UGRD_500_ISBL(0,:,:)</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14202"> v = vf->VGRD_500_ISBL(0,:,:)</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14203"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14204"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14205">lat = uf->u&YCells </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14206"> lon = uf->v&XCells</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14207"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14208"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14209">u!0="lat"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14210">u!1="lon"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14211"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14212"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14213">u&lat@units="degrees_north"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14214">u&lon@units="degrees_east"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14215"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14216"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14217">printVarSummary(u);</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14218"> div = uv2dvG_Wrap(u,v) ; u,v ==> divergence</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14219"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14220"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14221"> dv2uvg(div,u,v) ; div ==> divergent wind components</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14222"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14223"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14224"> </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14225"> u@long_name = "Zonal Divergent Wind"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14226"> u@units = u@units</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14227"> v@long_name = "Meridional Divergent Wind"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14228"> v@units = v@units</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14229"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14230"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14231">;***************************** ********************</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14232">; plot results</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14233">;***************************** ******************** </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14234"> wks = gsn_open_wks("png","wind123") ; send graphics to PNG file</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14235"> </div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14236"> res = True</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14237"> res@vcRefMagnitudeF = 3. ; make vectors larger</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14238"> res@vcRefLengthF = 0.050 ; reference vector length</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14239"> res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14240"> res@vcMinDistanceF = 0.012 ; thin the vectors</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14241"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14242"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14243"> res@gsnLeftString = "Divergent Wind"</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14244"> ; plot 1st time step</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14245"> plot= gsn_csm_vector_map(wks,u(:,:), v(:,:),res)</div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14246"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14247"></div><div id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14248">end</div><div dir="ltr" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14249"><br clear="none" id="m_1912884374143782876yiv5175715787m_4653405811811315891yui_3_16_0_ym19_1_1496136335885_14250"></div></div></div></div><br clear="none">______________________________ _________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/ mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br clear="none"><br clear="none"></div> </div></div><div class="m_1912884374143782876yiv5175715787yqt4799037442" id="m_1912884374143782876yiv5175715787yqtfd28323"> </div></div><div class="m_1912884374143782876yiv5175715787yqt4799037442" id="m_1912884374143782876yiv5175715787yqtfd43383"> </div></div></div></div></div><br><br></div> </div> </div> </div></div></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>