<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em; MARGIN-TOP: 0px
}
OL {
        MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
UL {
        MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
DIV.FoxDiv20150325111006402339 {
        COLOR: #000000
}
P {
        MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px
}
BODY {
        FONT-SIZE: 10.5pt; FONT-FAMILY: 微软雅黑; COLOR: #000080; LINE-HEIGHT: 1.5
}
</STYLE>
<META name=GENERATOR content="MSHTML 11.00.9600.17690"></HEAD>
<BODY style="MARGIN: 10px">
<DIV><SPAN><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; COLOR: #000000"><FONT color=#000080
face=微软雅黑>
<DIV
style="COLOR: #000000">The problem disappeared when I use NCL version 6.3.0.</DIV>
<DIV
style="COLOR: #000000">As you said maybe NCL v6.1.2 has some NetCDF issue.</DIV>
<DIV
style="COLOR: #000000">Thanks for all of your help.</DIV>
<DIV style="COLOR: #000000">Feng</DIV></FONT></DIV></SPAN></SPAN>
<DIV> </DIV>
<DIV
style="BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0cm; PADDING-TOP: 3pt; PADDING-LEFT: 0cm; BORDER-LEFT: medium none; PADDING-RIGHT: 0cm">
<DIV
style="FONT-SIZE: 12px; BACKGROUND: #efefef; COLOR: #000000; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px">
<DIV><B>From:</B> <A href="mailto:shea@ucar.edu">Dennis Shea</A></DIV>
<DIV><B>Date:</B> 2015-03-25 03:06</DIV>
<DIV><B>To:</B> <A href="mailto:fengfengabc003@163.com">ChenFeng</A></DIV>
<DIV><B>CC:</B> <A
href="mailto:alexander.schaefer@mines.sdsmt.edu">alexander.schaefer</A>; <A
href="mailto:ncl-talk@ucar.edu">ncl-talk</A></DIV>
<DIV><B>Subject:</B> Re: Re: [ncl-talk] Segmentation fault when reading
variables from NC</DIV></DIV></DIV>
<DIV>
<DIV class=FoxDiv20150325111006402339>
<DIV dir=ltr>
<DIV><BR></DIV>
<DIV>I 'found' 6.2.0 and 6.2.1. I have run the attached test script with:
6.2.0, 6.2.1, 6.3.0<BR></DIV>
<DIV><BR></DIV>It runs correctly under all versions. The file is netCDF4 which,
'under-the-hood', is HDF5.<BR>
<DIV>
<DIV><BR>%> ncdump -k <A href="http://geo_em.d01.nc">geo_em.d01.nc</A>
<BR>netCDF-4<BR><BR></DIV>
<DIV>%> ncl_filedump <A href="http://geo_em.d01.nc">geo_em.d01.nc</A>
>&! dump.geo_em<BR><BR></DIV>
<DIV>%> ncl tst_geo.ncl <BR><BR>===<BR></DIV>
<DIV>Summary: I do not know what is wrong. I can not replicate the
problem.<BR><BR></DIV>
<DIV>D<BR></DIV></DIV></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>On Tue, Mar 24, 2015 at 12:13 AM, ChenFeng <SPAN
dir=ltr><<A href="mailto:fengfengabc003@163.com"
target=_blank>fengfengabc003@163.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><U></U>
<DIV style="MARGIN: 10px">
<DIV><SPAN><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; COLOR: #000000"><FONT color=#000080
face=微软雅黑></FONT></SPAN></SPAN><SPAN><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; COLOR: #000000">
<DIV>
<DIV>What I do not understand is the file is generated from the standard WRF-WPS program, which I used several times with no problem.</DIV>
<DIV>I can read the variable without the dimention name, and then reorder or subcite the data. This approach can solve the problem temporarily.</DIV>
<DIV>Thanks for your help.</DIV>
<DIV> </DIV>
<DIV>Feng</DIV></DIV></SPAN></SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0cm; PADDING-TOP: 3pt; PADDING-LEFT: 0cm; BORDER-LEFT: medium none; PADDING-RIGHT: 0cm">
<DIV
style="FONT-SIZE: 12px; BACKGROUND: #efefef; COLOR: #000000; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px">
<DIV><B>From:</B> <A href="mailto:alexander.schaefer@mines.sdsmt.edu"
target=_blank>Alex Schaefer</A></DIV>
<DIV><B>Date:</B> 2015-03-24 13:25</DIV>
<DIV><B>To:</B> <A href="mailto:fengfengabc003@163.com"
target=_blank>ChenFeng</A></DIV>
<DIV><B>CC:</B> <A href="mailto:shea@ucar.edu" target=_blank>Dennis
Shea</A>; <A href="mailto:ncl-talk@ucar.edu" target=_blank>ncl-talk</A></DIV>
<DIV>
<DIV class=h5>
<DIV><B>Subject:</B> Re: [ncl-talk] Segmentation fault when reading
variables from NC</DIV></DIV></DIV></DIV></DIV>
<DIV>
<DIV class=h5>
<DIV>
<DIV>Feng,
<DIV><BR></DIV>
<DIV>I got the same seg fault that you got with your file. My guess is
something is just not quite right with that file. The size of that
domain should not be an issue. My ncl 6.1.2 is compiled from
source so the precompiled binary theory affecting it is not the case. I
am not sure what other things will spit out seg faults so Dennis will have to
take lead.</DIV>
<DIV><BR></DIV>
<DIV>Sorry I couldn’t be of more help,</DIV>
<DIV>-Alex</DIV>
<DIV><BR></DIV>
<DIV><BR>
<DIV>
<DIV>On Mar 23, 2015, at 9:51 PM, ChenFeng <<A
href="mailto:fengfengabc003@163.com"
target=_blank>fengfengabc003@163.com</A>> wrote:</DIV><BR>
<BLOCKQUOTE type="cite">
<DIV
style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(0,0,128); FONT: 10.5pt/1.5 微软雅黑; MARGIN: 10px; LETTER-SPACING: normal; TEXT-INDENT: 0px">
<DIV><SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体"><FONT
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; FONT-WEIGHT: bold"
color=#008000 size=1 face=""><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体"><FONT style="FONT-WEIGHT: normal"
color=#000001 face=微软雅黑>And I use the pre-compiled binary version
which is downloaded from the NCAR
website.</FONT></SPAN></FONT></SPAN></SPAN></DIV><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体"></SPAN>
<DIV> </DIV>
<DIV
style="BORDER-TOP: rgb(181,196,223) 1pt solid; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0cm; PADDING-TOP: 3pt; PADDING-LEFT: 0cm; BORDER-LEFT: medium none; PADDING-RIGHT: 0cm">
<DIV
style="FONT-SIZE: 12px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND-COLOR: rgb(239,239,239)">
<DIV><B>From:</B> <A href="mailto:fengfengabc003@163.com"
target=_blank>ChenFeng</A></DIV>
<DIV><B>Date:</B> 2015-03-24 11:47</DIV>
<DIV><B>To:</B> <A href="mailto:shea@ucar.edu" target=_blank>Dennis
Shea</A>;<SPAN> </SPAN><A
href="mailto:alexander.schaefer@mines.sdsmt.edu"
target=_blank>alexander.schaefer</A></DIV>
<DIV><B>CC:</B> <A href="mailto:ncl-talk@ucar.edu"
target=_blank>ncl-talk</A></DIV>
<DIV><B>Subject:</B> Re: Re: [ncl-talk] Segmentation fault when reading
variables from NC</DIV></DIV></DIV>
<DIV>
<DIV
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 微软雅黑; COLOR: rgb(0,0,128); MARGIN: 10px; LINE-HEIGHT: 1.5">
<DIV><SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体"><FONT
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Times New Roman'; FONT-WEIGHT: bold"
color=#008000 size=1 face=""><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体"><FONT color=#000080 face=微软雅黑>
<DIV style="FONT-WEIGHT: normal">Thanks Dennis and Alexander</DIV>
<DIV
style="FONT-WEIGHT: normal">The reason I use the printVarSummary(lon2d) is only want to make sure whether the code above this line is correct.</DIV>
<DIV
style="FONT-WEIGHT: normal">There is no problem when I use this code to read another <A
href="http://geo_em.d01.nc"
target=_blank>geo_em.d01.nc</A> file. So I think there is something wrong with the NC file. But I can use ncdump to see the structure and find nothing special.</DIV>
<DIV
style="FONT-WEIGHT: normal">Is the variable dimention too large (474*524)? But I have also use this ncl version to read variables more large than this.</DIV>
<DIV
style="FONT-WEIGHT: normal">I attached the file. Could you please help me check it with another ncl version and platform.</DIV>
<DIV style="FONT-WEIGHT: normal">Thanks.</DIV>
<DIV style="FONT-WEIGHT: normal"> </DIV>
<DIV
style="FONT-WEIGHT: normal">Feng</DIV></FONT></SPAN></FONT></SPAN></SPAN></DIV><SPAN
style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体"></SPAN>
<DIV> </DIV>
<DIV
style="BORDER-TOP: rgb(181,196,223) 1pt solid; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0cm; PADDING-TOP: 3pt; PADDING-LEFT: 0cm; BORDER-LEFT: medium none; PADDING-RIGHT: 0cm">
<DIV
style="FONT-SIZE: 12px; PADDING-BOTTOM: 8px; PADDING-TOP: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND-COLOR: rgb(239,239,239)">
<DIV><B>From:</B> <A href="mailto:shea@ucar.edu" target=_blank>Dennis
Shea</A></DIV>
<DIV><B>Date:</B> 2015-03-23 22:40</DIV>
<DIV><B>To:</B> <A href="mailto:fengfengabc003@163.com"
target=_blank>ChenFeng</A></DIV>
<DIV><B>CC:</B> <A href="mailto:ncl-talk@ucar.edu"
target=_blank>ncl-talk</A></DIV>
<DIV><B>Subject:</B> Re: [ncl-talk] Segmentation fault when reading
variables from NC</DIV></DIV></DIV>
<DIV>
<DIV>
<DIV dir=ltr>Also, forgot to mention ...<BR><BR>Using named dimensions
should only be done when reordering an array. Nothing wrong with doing so
but is is less efficient than
..<BR><BR>lon2d = inp0->XLONG_M (0, :, :)<BR></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>On Mon, Mar 23, 2015 at 8:11 AM, Dennis
Shea<SPAN> </SPAN><SPAN dir=ltr><<A href="mailto:shea@ucar.edu"
target=_blank>shea@ucar.edu</A>></SPAN><SPAN> </SPAN>wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV dir=ltr>
<DIV>I don't understand why either. 6.1.2 is no longer available
here so I can not test with 6.1.2<BR><BR></DIV>When it does work ... what
does printVarSummary(lon2d) indicate?<BR></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>
<DIV>
<DIV>On Mon, Mar 23, 2015 at 2:47 AM, ChenFeng<SPAN> </SPAN><SPAN
dir=ltr><<A href="mailto:fengfengabc003@163.com"
target=_blank>fengfengabc003@163.com</A>></SPAN><SPAN> </SPAN>wrote:<BR></DIV></DIV>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV><U></U>
<DIV
style="FONT-SIZE: 10pt; FONT-FAMILY: 微软雅黑; MARGIN-LEFT: 10px; MARGIN-TOP: 10px; MARGIN-RIGHT: 10px">
<DIV>Hi ncl-users,</DIV>
<DIV> </DIV>
<DIV>I have encounted an error when reading a variable from an NC file.</DIV>
<DIV>the code is listed below:</DIV>
<DIV>;************************************************</DIV>
<DIV>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</DIV>
<DIV>;************************************************</DIV>
<DIV>begin</DIV>
<DIV> inp0 = addfile("/public/home/chenf/AHWRF/TEST/WPSwks.T02/<A
href="http://geo_em.d01.nc/" target=_blank>geo_em.d01.nc</A>","r")</DIV>
<DIV
style="FONT-WEIGHT: bold"> lon2d = inp0->XLONG_M (Time|0, south_north|:, west_east|:)</DIV>
<DIV> printVarSummary(lon2d)</DIV>
<DIV>;************************************************</DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>the error message is:</DIV>
<DIV> Copyright (C) 1995-2013 - All Rights Reserved</DIV>
<DIV> University Corporation for Atmospheric Research</DIV>
<DIV> NCAR Command Language Version 6.1.2</DIV>
<DIV> The use of this software is governed by a License Agreement.</DIV>
<DIV> See <A href="http://www.ncl.ucar.edu/"
target=_blank>http://www.ncl.ucar.edu/</A> for more details.</DIV>
<DIV>Segmentation fault (core dumped)</DIV>
<DIV> </DIV>
<DIV>The strange thing is when i'm reading the variable without any dimention name cited, the error disappeared.</DIV>
<DIV>The code changes into :</DIV>
<DIV>;************************************************</DIV>
<DIV>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"</DIV>
<DIV>;************************************************</DIV>
<DIV>begin</DIV>
<DIV> inp0 = addfile("/public/home/chenf/AHWRF/TEST/WPSwks.T02/<A
href="http://geo_em.d01.nc/" target=_blank>geo_em.d01.nc</A>","r")</DIV>
<DIV
style="FONT-WEIGHT: bold"> lon2d = inp0->XLONG_M</DIV>
<DIV> printVarSummary(lon2d)</DIV>
<DIV>;************************************************</DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>I don't understand why. It is very appreciate if anybody can
tell me the reason.</DIV>
<DIV>Thanks.</DIV>
<DIV> </DIV>
<DIV>Feng</DIV></DIV><BR></DIV></DIV>_______________________________________________<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></BLOCKQUOTE></DIV></DIV></BLOCKQUOTE></DIV></DIV></DIV></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BODY></HTML>