<div dir="ltr"><div>If you had done what ncl-talk *always* advises .... *look at your data*<br><br></div><div>you would have seen some issues.<br></div><div><br>===============<br>a = addfile ("<a href="http://w_jja.nc" target="_blank">w_jja.nc</a>", "r")<br>W = a->w/100 ; this eliminates all meta data!!!<br></div><div>printVarSummary(W) ; *look* at this!!!<br><br></div><div>you would not see any meta data. (eg, named dimensions)<br><br>==============<br></div><div>Later you do<br><br>WM=dim_avg_n(W,0)/100<br><br></div><div>I don't get it.<br></div><div>==============<br></div><div>If you had done<br><br>W = a->w ; this retains all meta data<br>printVarSummary(W)<br><br></div><div>W = W/100<br></div><div>printVarSummary(W)<br><br></div><div>or, better<br><br><div>W = W/100<br></div><div>@@units = "... whatever ..."<br></div>printVarSummary(W)<br><br>==================<br><br></div><div>It is your responsibility to carefully examine each step of your actions.<br><br><br>a = addfile ("<a href="http://w_jja.nc" target="_blank">w_jja.nc</a>", "r")<br>W = a->w<br>W = W/100<br>W@units = "..."<br>printVarSummary(W)<br>l<br>WM=dim_avg_n_Wrap(W,0)<br></div><div>printVarSummary(WM)<br><br>===================<br></div><div>There is absolutely no need to reorder your data.<br></div><div>The graphics codes do not care.<br><br></div><div>You state: <br> I am using global ERA-INTERIM Reanalysis.<br><br></div><div>The way you have done the plots <br></div><div><br>res@gsnAddCyclic = False<br><br></div><div>should be True (that is the default)<br><br><br><br></div><div>Even though you are specifying a limited area, you are feeding the entire global array,<br></div><div>hence, under the hood, the plotis global but you are plotting a subset<br></div><div><br><br></div><div><br></div><div><br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 3, 2015 at 4:47 PM, Rabah Hachelaf <span dir="ltr"><<a href="mailto:hachelaf@sca.uqam.ca" target="_blank">hachelaf@sca.uqam.ca</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"><div><div><div><div><div><div><br><br></div>Hi all,<br><br></div>Why i still getting this troubles : <br><br>Variable: W<br>Type: integer<br>Total Size: 13881600 bytes<br> 3470400 values<br>Number of Dimensions: 4<br>Dimensions and sizes: [15] x [2] x [241] x [480] <span style="color:rgb(255,255,255)"><span style="background-color:rgb(255,0,0)">(Time,Le<span style="background-color:rgb(255,255,255)"><span></span></span>vels,Latitude,Longitude)</span></span><br>Coordinates: <br>Number Of Attributes: 1<br> _FillValue : -32767<br>warning:Dimension (2) has not been defined<br>(0) lonFlip: warning: last dimension is not named<br>(0) <br>(0) min=-2.01933 max=1.308<br>(0) <br>(0) min=-2.44533 max=2.15867<br>(0) check_for_y_lat_coord: Warning: Data either does not contain a valid latitude coordinate array or doesn't contain one at all.<br>(0) A valid latitude coordinate array should have a 'units' attribute equal to one of the following values: <br>(0) 'degrees_north' 'degrees-north' 'degree_north' 'degrees north' 'degrees_N' 'Degrees_north' 'degree_N' 'degreeN' 'degreesN' 'deg north'<br>(0) check_for_lon_coord: Warning: Data either does not contain a valid longitude coordinate array or doesn't contain one at all.<br>(0) A valid longitude coordinate array should have a 'units' attribute equal to one of the following values: <br>(0) 'degrees_east' 'degrees-east' 'degree_east' 'degrees east' 'degrees_E' 'Degrees_east' 'degree_E' 'degreeE' 'degreesE' 'deg east'<br>warning:ContourPlotDraw: out of range coordinates encountered; standard AreaFill rendering method may be unreliable;<br> consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values<br><br></div>here is my script : <br></div>I want to plot a temporal average of W variable in one of levels , When i turn one <br>; WM&latitude@units="degrees_north"<br>; WM&longitude@units="degrees_east"<br></div>I get this : <br>warning:Dimension (2) has not been defined<br>(0) lonFlip: warning: last dimension is not named<br>fatal:No coordinate variable exists for dimension (latitude) in variable (WM)<br>fatal:(latitude) is not coordinate variable in variable(WM).<br>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 26 in file read_w.ncl <br><br></div>I am using global ERA-INTERIM Reanalysis. <br><div><br><div><br><div>;***************************************************************************<br>; era_1.ncl<br>;<br>;***************************************************************************<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" <br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" <br><br>begin<br><br><br>a = addfile ("<a href="http://w_jja.nc" target="_blank">w_jja.nc</a>", "r")<br><br>W = a->w/100<br><br>printVarSummary(W)<br>lat=a->latitude<br>lon=a->longitude<br>WM=dim_avg_n(W,0)/100<br><br>WM=lonFlip(WM)<br>WM!1="latitude"<br>WM!2="longitude"<br><br><br><br>; WM&latitude@units="degrees_north"<br>; WM&longitude@units="degrees_east"<br><br><br><br>printMinMax(WM(0,:,:),True)<br>printMinMax(WM(1,:,:),True)<br><br>;*********************************************************************<br> wks = gsn_open_wks ("png", "era_djf") ; open workstation <br> gsn_define_colormap (wks,"gui_default") ; choose color map<br> <br> res = True<br> res@gsnAddCyclic = False<br> res@mpProjection = "Mercator" ; choose projection<br> res@mpGridAndLimbOn = True ; turn on lat/lon lines<br> res@mpPerimOn = False ; turn off box around plot<br> res@mpFillOn = False<br> res@cnLinesOn = False <br> res@mpOutlineOn = True<br> res@cnFillOn = True ; color plot desired<br> res@cnLineLabelsOn = False ; turn off contour lines<br> res@mpLimitMode = "LatLon"<br> res@mpMinLatF = 15 ;5.0<br> res@mpMaxLatF = 85 ;35.0 <br> res@mpMinLonF = -180 ;105<br> res@mpMaxLonF = -50 ;140<br><br> res@cnLevelSelectionMode = "ManualLevels" ; manual contour levels<br> res@cnMinLevelValF = -1 ; min level<br> res@cnMaxLevelValF = 0 ; max level<br> res@cnLevelSpacingF = 0.1 ; interval<br><br> res@cnFillOn = True ; turn on color<br><br><br><br> plot = gsn_csm_contour_map(wks,W(2,0,:,:),res) ; Draw original grid on map<br><br>end<span class="HOEnZb"><font color="#888888"><br><br><div><br><br clear="all"><div><div><br clear="all"><br>-- <br><div><div dir="ltr"><div>------------------------------</div>Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div></div>
</div></div></div></font></span></div></div></div></div>
<br>_______________________________________________<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" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>