<div dir="ltr">Hi Guo,<div>I am pretty sure your problem is that you tried to use the gribtab_GLDAS2_NOAH.gtb as is. NCL uses a slightly different format for its </div><div>text file GRIB tables than the wgrib-type format used for the file you sent me. Basically the difference is that NCL uses four colon-separated fields instead of 3. The units, which follow the descriptor field inside square brackets in your file, are the third field in an NCL grib table file.</div>
<div><br></div><div>I have converted your table file into an NCL-compliant file and am attaching it here. Also I am attaching a short Python script that does the conversion for anyone who might need it. Note it just writes to standard output so you need to redirect it to a file. Also you need to manually add the header line (the line that starts with -1). </div>
<div>You can use either</div><div>-1:-1:-1:-1<br></div><div>or more specifically for this file:</div><div>-1:173 :4 :130<br></div><div><br></div><div><br></div><div>Run it like this:</div><div>python wgrib2ncltxt.py GLDAS2_NOAH.gtb > ncl_GLDAS2_NOAH.gtb<br>
</div><div><br></div><div>That said, I will also be adding more validation into the NCL code, to prevent it from crashing when it gets an invalid grib table text file.</div><div><br></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Wed, Jul 30, 2014 at 8:48 PM, guozfruit <span dir="ltr"><<a href="mailto:guozfruit@aliyun.com" target="_blank">guozfruit@aliyun.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="color:#333333;font-size:14px;font-family:Tahoma,Arial,STHeiti,SimSun">Thanks, Dave.</div><div style="color:#333333;font-size:14px;font-family:Tahoma,Arial,STHeiti,SimSun">When I set gribtable for GLDAS_v1 as the same way, it works. But when it comes to GLDAS_V2(they have different grib tables), error occurs. Maybe there is something wrong with the table?</div>
<div style="color:#333333;font-size:14px;font-family:Tahoma,Arial,STHeiti,SimSun">-Guo</div><div><br><br></div><div><div><div style="color:#333333">------------------------------------------------------------------<br>From:David Brown <<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@ucar.edu</a>><br>
Send time:Thursday, July 31, 2014 09:11<br>To:guozfruit <<a href="mailto:guozfruit@aliyun.com" target="_blank">guozfruit@aliyun.com</a>><br>Cc:NCL <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>
Subject:Re: [ncl-talk] Fw: read grib data<br><br></div><div class=""><div>Hi Guo,<div><br></div><div>I am looking into this. </div><div> -dave</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">
On Wed, Jul 30, 2014 at 5:36 PM, guozfruit <span><<a href="mailto:guozfruit@aliyun.com" target="_blank">guozfruit@aliyun.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 0.8ex;border-left:1.0px #cccccc solid;padding-left:1.0ex"><div><div class="h5"><div><div style="color:#333333;font-size:14.0px;font-family:tahoma,arial,stheiti,simsun">
<br></div><div><br><br></div><div>
<div><div style="color:#333333">------------------------------------------------------------------<br>From:guozfruit <<a href="mailto:guozfruit@aliyun.com" target="_blank">guozfruit@aliyun.com</a>><br>Send time:Thursday, July 31, 2014 07:14<br>
To:NCL <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>><br>Subject: read grib data<br><br></div><div style="color:#333333;font-size:14.0px;font-family:tahoma,arial,stheiti,simsun"><span style="font-family:tahoma,arial,stheiti,simsun">Hi all,</span><br>
</div><div><div><div style="color:#333333;font-size:14.0px;font-family:tahoma,arial,stheiti,simsun"><br></div><div style="color:#333333;font-size:14.0px;font-family:tahoma,arial,stheiti,simsun">Recently I've been processing GLDAS (Global Land Data Assimilation System Version 2 Products) grib data. After I set the parameter table, I have error message as below:<div>
<br></div><div>grib_in = addfile("./GLDAS_NOAH025SUBP_3H.A2008001.2100.001.2008197115723.grb","r")</div><div>Segmentation fault (core dumped)</div><div><br></div><div>I'm using NCAR Command Language Version 6.2.0, I'm not sure if there is something wrong with the ncl version. I also attached the parameter table. Could you please help me find out what the problem is. Thanks.</div>
<div><br></div><div>Best,</div><div><br></div><div>Guo </div></div><div><br><br></div></div></div></div></div></div><br></div></div><div class="">_______________________________________________<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></div></blockquote></div><br></div></div></div></div></blockquote></div><br></div>