<div dir="ltr">Hi Rabah,<div>Sorry for the delay in answering your question. The reason you are getting this message is that the correct coordinate arrays are not being communicated to the plotting routines. There are two ways to fix your script.</div>
<div><br></div><div>1) You are using the routine gsn_contour_map. This function does not automatically communicate the coordinates that are attached to the variable. To make it do what you want you need to set the resources sfXArray and sfYArray. Just add these lines prior to the gsn_contour_map call:</div>
<div>res@sfXArray = lon</div><div>res@sfYArray = lat</div><div><br></div><div>2) Just substitute the routine gsn_csm_contour_map for gsn_contour_map. The 'csm' version of the routine does extract the coordinates from the variable. This is the easiest fix.</div>
<div><br></div><div> -dave</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 3, 2014 at 5:20 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 class="HOEnZb"><div class="h5"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Hi All,<div><br></div>
<div>May be this is an easy issue for you but i have some errors when i try to plot Pmsl variable using gsn_contour_map .</div><div><br></div>
<div>When using the ncl script below i get this error : </div>
<div><br></div><div><div>fatal:ContourPlotDraw: coordinates are out of range for drawing over a map: standard line or line label rendering method will not work;</div><div> consider setting the resource trGridType to "TriangularMesh" if coordinates contain missing values</div>
<div><br></div><div><div>;************************************************</div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" </div><div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" </div>
<div>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" </div><div>;************************************************</div><div>begin</div><div><br></div><div>;************************************************</div>
<div>; read in GRIB2 file</div><div>;************************************************</div><div><br></div><div><br></div><div> a = addfile("gfs_data/gfs.t00z.pgrb2f12.grib2","r")</div><div><br></div>
<div> lon = a->lon_0</div><div> lat = a->lat_0</div><div> slp = short2flt(a->PRMSL_P0_L101_GLL0(:,:))</div><div> slp = (/ slp/100 /) ; convert to hpa</div><div><br></div><div>;************************************************</div>
<div><br></div><div>printMinMax(slp, True)</div><div>;********************************************************</div><div>; Display parameters</div><div>;***************************************</div><div><br></div><div>pixel=2048</div>
<div>;***************************************************</div><div><br></div><div>wks_type="png"</div><div><br></div><div> wks_type@wkWidth = pixel</div><div> wks_type@wkHeight = pixel</div><div> wks_type@wkBackgroundOpacityF = 1.0</div>
<div>wks = gsn_open_wks(wks_type,"slp_test")</div><div><br></div><div><br></div><div>res = True</div><div><br></div><div>res = True</div><div> res@mpProjection = "Mercator" ; choose projection</div>
<div> res@mpGridAndLimbOn = False ; turn on lat/lon lines</div><div> res@mpPerimOn = False ; turn off box around plot</div><div> res@mpFillOn = False</div><div> res@cnLinesOn = False </div>
<div> res@mpOutlineOn = True </div><div> res@cnLineLabelsOn = True ; turn off contour lines</div><div> res@mpLimitMode = "LatLon"</div><div> res@mpMinLatF = -85.0</div><div>
res@mpMaxLatF = 85.0 </div><div> res@mpMinLonF = -180</div><div> res@mpMaxLonF = 180</div><div> res@vpXF = 0 ; make plot bigger</div><div> res@vpYF = 1 </div>
<div> res@vpWidthF = 1</div><div> res@vpHeightF = 1</div><div><br></div><div><span style="white-space:pre-wrap">        </span></div><div> res@cnLevelSelectionMode <span style="white-space:pre-wrap">        </span>= "ManualLevels" ; manually set cont levels</div>
<div><br></div><div> res@cnLevelSpacingF = 4 ; spacing in hpa</div><div> res@cnLineThicknessF = 1.10 ; change line thickness</div><div> res@cnLineColor = "Black"</div>
<div><span style="white-space:pre-wrap">        </span></div><div> map = gsn_contour_map(wks,slp,res)</div><div> </div><div>end</div></div><span><font color="#888888"><div><br></div><div>
<br></div>-- <br><div dir="ltr"><div>------------------------------</div>
Cordialement,<br>Best regards,<br>Rabah Hachelaf <br></div>
</font></span></div></div>
</div><br><br clear="all"><div><br></div>
</div>
</div></div><br>_______________________________________________<br>
ncl-talk mailing list<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>