<div dir="ltr"><div class="gmail_default" style="font-size:small">Ana,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Whenever you get error messages regarding a variable, we always recommend "looking at your data" by using routines like printVarSummary, printMinMax, or just print.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The error message is telling you what the problem is:<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: </font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'</font></div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">so it would be helpful to do a printVarSummary on both lat2 and lon2 to see if they contain any "units":</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> printVarSummary(lat2)</div><div class="gmail_default" style="font-size:small"><div class="gmail_default"> printVarSummary(lon2)</div><div><br></div></div><div class="gmail_default" style="font-size:small">My guess is that your "lon2" and "lat2" variables either don't have units attributes at all, or they are wrong. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Try adding this code right after you read lat2 and lon2 off the file:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">lat2@units = "degrees_north"</div><div class="gmail_default" style="font-size:small">lon2@units = "degrees_east"</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, it appears the leftmost two dimensions of z1 are dimensioned lon x lat, and NCL needs them to be lat x lon in order to correctly plot them.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You will need to reorder the data when you call gsn_csm_contour_map. First, you need to name the other two dimensions, which I'm assuming level and time dimensions:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">z1!2 = "lev"</div><div class="gmail_default" style="font-size:small">z2!3 = "time"</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Now you can reorder with:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div style="font-size:12.8px">plot= gsn_csm_contour_map(wks,z1(lat|:,lon|:<wbr>,lev|25,time|0),res)</div><div><br></div></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"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 18, 2017 at 5:19 PM, Anahita Amiri Farahani <span dir="ltr"><<a href="mailto:aamir003@ucr.edu" target="_blank">aamir003@ucr.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello all,<div><br></div><div>I tried to plot a simple map but I got warnings. Here is my code and warnings:</div><div><br></div><div><div><br></div><div>;*********** From Observation **********</div><div><br></div><div>ana=addfile("NOaerosol_allsky_<wbr>3DQ.nc","r")</div><div>lat2=ana->lat</div><div>lon2=ana->lon</div><div>lev2=ana->lev/10</div><div>Absp3D=ana->Absp3D ; Atmospheric heating (K/sec)</div><div>Absp=ana->Absp ; Solar radiation absorption in the atmosphere (W/m^2)</div><div>Sfc=ana->Sfc ; Surface net flux (W/m^2)</div><div><br></div><div>delete(ana)</div><div><br></div><div>;********* T's data *************</div><div>;z1 = asciiread("Absp.dat",(/12,128,<wbr>64,26/),"float")</div><div>z1 = asciiread("Absp.dat",(/128,64,<wbr>26,12/),"float")</div><div><br></div><div>z1!1="lat"</div><div>z1!0="lon"</div><div>;Coordinate</div><div>z1&lat=lat2</div><div>z1&lon=lon2</div><div><br></div><div><br></div><div>wks = gsn_open_wks("eps","T_<wbr>Atmospheric_heating_26")</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;</div><div> res = True ; plot mods desired</div><div> res@cnFillOn = True ; turn on color </div><div> res@gsnSpreadColors = True ; use full color map</div><div> res@cnLinesOn = False ; no contour lines</div><div> res@cnLineLabelsOn = False ; no line labels</div><div><br></div><div> res@mpMaxLatF = 87.8638 ; specify the plot domain</div><div> res@mpMinLatF = -87.8638 ; </div><div> res@mpMinLonF = 0 ;</div><div> res@mpMaxLonF = 357.1875 </div><div> </div><div> res@gsnAddCyclic = False </div><div><br></div><div> res@cnLevelSelectionMode = "AutomaticLevels" ; AutomaticLevels</div><div><br></div><div><br></div><div> ;res@cnLevelSelectionMode = "ManualLevels" ; AutomaticLevels</div><div> ;res@cnMinLevelValF = -15. ; min level</div><div> ;res@cnMaxLevelValF = 15. ; max level</div><div> ;res@cnLevelSpacingF = 1. ; interval</div><div><br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<wbr>;;;;;;;;;;;;</div><div>res@tiMainString = "Atmospheric Heating in Jan at 26th level"</div><div><br></div><div>plot= gsn_csm_contour_map(wks,z1(:,:<wbr>,25,0),res)</div><div>delete(wks)</div><div><br></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.</span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: </span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'</span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.</span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: </span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'</span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) gsn_csm_map_ce: Warning: you set mpMaxLonF to a value > 180, but</span></p>
<p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1">(0) didn't set mpCenterLonF. Setting mpCenterLonF to 178.594</span></p><p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1"><br></span></p><p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1"><br></span></p><p class="m_1246101706110765046gmail-p1"><span class="m_1246101706110765046gmail-s1"><br></span></p><p class="m_1246101706110765046gmail-p1">Thanks,</p><p class="m_1246101706110765046gmail-p1">Ana</p></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>