<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear NCL users,<br>
I have encountered a problem relating to the plotting of contour lines.<br>
The data to be plotted is an 8 by 8 matrix that looks like this.<br>
<br>
<table border="0" cellpadding="0" cellspacing="0" width="512">
<colgroup><col style="width:48pt" span="8" width="64"></colgroup>
<tbody>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt; width:48pt" align="right" width="64" height="20">-0.084</td>
<td style="width:48pt" align="right" width="64">-0.066</td>
<td style="width:48pt" align="right" width="64">-0.04</td>
<td style="width:48pt" align="right" width="64">0.021</td>
<td style="width:48pt" align="right" width="64">0.031</td>
<td style="width:48pt" align="right" width="64">-0.026</td>
<td style="width:48pt" align="right" width="64">-0.065</td>
<td style="width:48pt" align="right" width="64">-0.075</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.028</td>
<td align="right">0.005</td>
<td align="right">0.053</td>
<td align="right">0.177</td>
<td align="right">0.224</td>
<td align="right">0.136</td>
<td align="right">0.028</td>
<td align="right">-0.003</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.009</td>
<td align="right">0.038</td>
<td align="right">0.111</td>
<td align="right">0.266</td>
<td align="right">0.327</td>
<td align="right">0.333</td>
<td align="right">0.221</td>
<td align="right">0.101</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.049</td>
<td align="right">-0.024</td>
<td align="right">0.08</td>
<td align="right">0.184</td>
<td align="right">0.275</td>
<td align="right">0.352</td>
<td align="right">0.29</td>
<td align="right">0.152</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">-0.046</td>
<td align="right">-0.029</td>
<td align="right">0.022</td>
<td align="right">0.082</td>
<td align="right">0.164</td>
<td align="right">0.195</td>
<td align="right">0.147</td>
<td align="right">0.127</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">0.002</td>
<td align="right">0.007</td>
<td align="right">-0.005</td>
<td align="right">-0.017</td>
<td align="right">-0.02</td>
<td align="right">0.006</td>
<td align="right">0.05</td>
<td align="right">0.059</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">0.03</td>
<td align="right">0.022</td>
<td align="right">-0.034</td>
<td align="right">-0.095</td>
<td align="right">-0.105</td>
<td align="right">-0.069</td>
<td align="right">-0.033</td>
<td align="right">-0.016</td>
</tr>
<tr style="height:15.0pt" height="20">
<td style="height:15.0pt" align="right" height="20">0.043</td>
<td align="right">0.035</td>
<td align="right">0.011</td>
<td align="right">-0.022</td>
<td align="right">-0.053</td>
<td align="right">-0.063</td>
<td align="right">-0.045</td>
<td align="right">-0.03</td>
</tr>
</tbody>
</table>
<br>
While the script is working fine with the 'cnFillOn' resource set to True, erroneous contour lines<br>
are present when 'cnFillOn' resource is set to False (please see the attached images).<br>
<b><br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot; <br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot; <br>
<br>
diri = &quot;/home/nli045/Desktop/sharedJ/Documents/data/&quot;<br>
fili = systemfunc(&quot;ls &quot; &#43; diri &#43; &quot;x*csv&quot;)<br>
<br>
in = asciiread(fili(0),(/8,8/),&quot;float&quot;)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ; read the matrix from the directory<br>
<br>
wks = gsn_open_wks(&quot;png&quot;,&quot;test&quot;)<br>
colors = read_colormap_file(&quot;BlWhRe&quot;)<br>
<br>
res&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = True<br>
res@cnFillOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = False&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ; CONTOURS WRONG!<br>
res@cnLinesOn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
res@gsnAddCyclic&nbsp;&nbsp;&nbsp; &nbsp;= False&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;; the plot is not global <br>
<br>
res@cnLevelSelectionMode&nbsp;&nbsp;&nbsp; = &quot;ManualLevels&quot;&nbsp;&nbsp;&nbsp; ; manual contour levels<br>
res@cnMinLevelValF&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; = -0.1<br>
res@cnMaxLevelValF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 0.5<br>
res@cnLevelSpacingF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&nbsp; 0.1<br>
<br>
plot = gsn_csm_contour(wks,in,res)&nbsp;&nbsp;&nbsp; </b><br>
&nbsp;<br>
I used R to make the plot and there is no problem. <br>
I have also used a different dataset in NCL, the errorneous contours are also present (see the circled contours in 'datasetB.png').<br>
<br>
I am using version 6.2.0. The system is 86-64 GNU/Linux.<br>
<br>
I wonder if anyone experienced the same problem in the past and how should it be resolved?
<br>
<br>
Any help would be great! Thank you very much!
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">Ning LI<br>
<br>
PhD candidate<br>
School of Environment<br>
The University of Auckland<br>
</div>
</div>
</div>
</div>
</body>
</html>