<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hi, Ryo -- <div>I took your ncdump output and used it (and ncgen) to generate a test netcdf file:</div><div><br class="webkit-block-placeholder"></div><div><div>netcdf test {</div><div>dimensions: </div><div>        lon = 1 ;</div><div>        lat = 1 ;</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>dep = 30;</div><div>        time = 1 ;</div><div>variables:</div><div>        float lon(lon) ;</div><div>                lon:units = "degrees_east" ;</div><div>        float lat(lat) ;</div><div>                lat:units = "degrees_north" ;</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>float dep(dep) ;</div><div><span class="Apple-tab-span" style="white-space:pre">             </span>dep:units = "meters" ;</div><div><span class="Apple-tab-span" style="white-space:pre">              </span>dep:axis = "Z" ;</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>dep:positive = "down" ;</div><div>        int time(time) ;</div><div>                time:units = "days" ;</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>float var(time, dep, lat, lon);</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>var:long_name="test variable";</div><div>data: </div><div> lon = 1;</div><div> lat = 1;</div><div> time = 1;</div><div> dep = 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 105, 115.9789, 129.7985,</div><div>    148.0428, 171.8625, 201.8625, 238.0428, 279.7985, 325.9789, 375, 425,</div><div>    491.1513, 604.1757, 790.2066, 1068.231, 1448.231, 1930.207, 2504.176,</div><div>    3151.151, 3845 ;</div><div> var = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,</div><div>    20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30;</div><div>}</div><div><br class="webkit-block-placeholder"></div><div>I can open this netcdf file with GrADS 1.9 and 2.0 and display the test variable without any seg faults. You will have to provide all the ncdump -c output from your file -- maybe this will help me to reproduce the error. </div><div><br class="webkit-block-placeholder"></div><div>As for the positive:down attribute, GrADS was designed with the atmosphere in mind, so z=1 is the bottom (close to the surface) and z=zmax is at the top. When your z axis is depth, this orientation is maintained, so that the bottom (deepest) level is z=1 and the top (shallowest) layer is z=30. That is somewhat opposite to the way oceanographers think of the Z (depth) axis, where z=1 is usually at or just below the surface. </div><div>--Jennifer</div><div><br class="webkit-block-placeholder"></div><div><br><div><div>On Feb 18, 2008, at 4:40 AM, Ryo Furue wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Dear GrADS maintainers,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'd like to report a bug.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">For a netCDF file, line 3237</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>3237 <span class="Apple-converted-space">  </span>fgrid[ginx] = fakefgrid[indx] ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">of gasdf.c causes a segmentation fault.<span class="Apple-converted-space">  </span>It turns out that ginx</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">gets a negative value, which in turn is caused by</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>3230 <span class="Apple-converted-space">  </span>ginx = (gtinx - gridptr-&gt;dimmin[GTINDEX]) * zyxsize +</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>3231<span class="Apple-converted-space">          </span>(gzinx - gridptr-&gt;dimmin[GZINDEX]) * yxsize +</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>3232<span class="Apple-converted-space">          </span>(gyinx - gridptr-&gt;dimmin[GYINDEX]) * gxsize +</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">  </span>3233<span class="Apple-converted-space">          </span>(gxinx - gridptr-&gt;dimmin[GXINDEX]) ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">where</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gtinx == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gridptr-&gt;dimmin[GTINDEX] == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gzinx == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gridptr-&gt;dimmin[GZINDEX] == 30</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gyinx == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gridptr-&gt;dimmin[GYINDEX] == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gxinx == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>gridptr-&gt;dimmin[GXINDEX] == 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Another, probably related oddity is that GrADS seems to be confused</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">about a vertical axis with an attribute 'positive = "down" '.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Index 1 of my depth coordinate corresponds the shallowest level</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and index 30 corresponds to the deepest.<span class="Apple-converted-space">  </span>But, in GrADS, z = 1</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">corresponds to the deepest level.<span class="Apple-converted-space">  </span>I suspect this is the reason</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for gridptr-&gt;dimmin[GZINDEX] == 30 and gzinx == 1 .</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Here is how the vertical axis is defined (from ncdump -h):</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>float dep(dep) ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>dep:units = "meters" ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>dep:axis = "Z" ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>dep:positive = "down" ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>dep = 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 105, 115.9789, 129.7985,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">    </span>148.0428, 171.8625, 201.8625, 238.0428, 279.7985, 325.9789, 375, 425,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">    </span>491.1513, 604.1757, 790.2066, 1068.231, 1448.231, 1930.207, 2504.176,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">    </span>3151.151, 3845 ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I can send you my netCDF file as well as an instruction on how to</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">reproduce the segmentation fault.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm using grads-1.9b4 on Linux.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Regards,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Ryo</div> </blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br></div></span></span></span> </div><br></div></div></body></html>