[Met_help] pb2nc 'Segmentation fault' about the version 2

John Halley Gotway johnhg at rap.ucar.edu
Fri May 1 16:27:33 MDT 2009


Kefeng,

Good news.  For METv2.0, all you'll need to do is change the name of the variable used in the NetCDF file.  I'd suggest using the GRIB code "REFC" for "Maximum/Composite radar reflectivity".  This is
GRIB code 212 in the GRIB parameter table version number 129 (http://www.nco.ncep.noaa.gov/pmb/docs/on388/table2.html).  The variable in your NetCDF file should be named "REFC".

However, please note that when you run any of the MET tools using these NetCDF files as input, you'll need to set the "grib_ptv" parameter in the configuration file.  You should set "grib_ptv = 129"
to tell MET to use GRIB parameter table version number 129.

Also, you may have problems with your APCP NetCDF variable name.  In METv2.0, the naming convention has changed slightly to be "APCP_HH" where HH is the accumulation interval for the precipitation.
So 12 hours of accumulation would be "APCP_12".

Hope that helps.

John

Zhu,Kefeng wrote:
> Hi, John:
> 
>       I use the mosaic data as the observation and model forecast . Right now, i first interpolate the mosaic data to the model grid but in RIP4 format. Because the RIP4 program contain the subroutine to interpolate the data to the height like 3km and also compute the reflectivity of WRF output.  And then read back the  RIP4 format data and transfer it to the pcp_combine NECDF format. Since i'm not familiar with the grib format, So i choose the NETCDF format. The attachment is the data that can be read by the mode program. 
>       But as i said, i treat the reflectivity as the APCP data.  I'm wondering if i change the variable name to the "Ref", what change do i need to make in the MET source code?  In my opinion,  if the program can read in arbitrary variable (not just the APCP) and read in attribute given by the NETCDF file, it would be more generally.
> 
>       Thanks!
> 
> 
> Kefeng
> 
> 2009-05-01 
> 
> 
> 
> Zhu,Kefeng 
> 
> 
> 
> 发件人: John Halley Gotway 
> 发送时间: 2009-05-01  16:15:20 
> 收件人: Zhu, Kefeng 
> 抄送: met_help 
> 主题: Re: [Met_help] pb2nc 'Segmentation fault' about the version 2 
>  
> Kefeng,
> I just tried running the METv2.0 version of Point-Stat using the METv1.1 output of PB2NC.  Unfortunately, it doesn't work.  It appears there was a minor change to how some of the timestrings are
> stored.  So you'll need to the METv2.0 PB2NC working.
> As for verifying reflectivity, I'm not sure exactly what you're trying to do.  MET should be able to read and verify reflectivity data as long as it's in GRIB format.  Perhaps you could send me one of
> the reflectivity files you'd like to use, and I could get a better idea what you'd need to do to read it in MET.
> Thanks,
> John
> Zhu,Kefeng wrote:
>> Hi, John:
>>
>>      Ok, Maybe i can try another computer. I will let you know if i successed. 
>>
>>      There are other questions i would like to know:
>>      
>>      If i use the METv1.1 pb2nc output netcdf file, can it be still be used by METv2.0?
>>
>>      I want to use the Refectivity instead of APCP for verification. Right now, i just treat the data as the APCP. And it can run successfully. Could you give me some suggestion if i want to modified the MET source code? You know, the MET can not process the reflectivity data in the currerent version.
>>    
>>      Thanks!
>>
>> Kefeng
>>
>> 2009-05-01 
>>
>>
>>
>> Zhu,Kefeng 
>>
>>
>>
>> 发件人: John Halley Gotway 
>> 发送时间: 2009-05-01  10:23:26 
>> 收件人: Zhu, Kefeng 
>> 抄送: met_help 
>> 主题: Re: [Met_help] pb2nc 'Segmentation fault' about the version 2 
>>  
>> Kefeng,
>> Sorry for not getting back to you sooner on this.  I wanted to check in with you to see how this is going.
>> If it's available on your machine, I'd suggest using the GNU gfortran compiler instead of g77.  You may have better luck with gfortran than g77.  When using gfortran, you'll need to uncomment the
>> "-lgfortran" compiler option in the top-level MET Makefile.  And you'd need to rebuild BUFRLIB with gfortran as well.
>> If using gfortran doesn't help, I'd suggest trying PGI with/without the -DBLOCK4 option.
>> Thanks,
>> John
>> Kefeng.Zhu-1 at ou.edu wrote:
>>> Hi, John:
>>>
>>> I have tried with the option "-DBLOCK4" and without the option "-DBlOCK". Both of them show the segmentation fault. I have also tried built the program as 64 bit and 32 bit ( "-m32" option). Below is the size of pb2nc*.pb. The before is using 64 bit and the after is using 32 bit.
>>> -rw-------  1 kfzhu G-81589 6262040 Apr 28 08:38 pb2nc_11248_0_blk.pb ( 64 bit)
>>> -rw-------  1 kfzhu G-81589 6267448 Apr 28 08:46 pb2nc_14026_0_blk.pb ( 32 bit)
>>>
>>> Also, I have tried built it with pgi, it still failed to the program as the previous version. But it do generate the pb2nc*.pb file, see below:
>>>
>>> **************BUFR ARCHIVE LIBRARY ABORT*****************
>>>  BUFRLIB: OPENBF - ERROR READING INPUT FILE CONNECTED TO UNIT  11 WHEN CHECKING FOR 'BUFR' IN FIRST 4 BYTES OF RECORD            
>>>  **************BUFR ARCHIVE LIBRARY ABORT*****************
>>>
>>> -rw-------  1 kfzhu G-81589 6267448 Apr 28 08:54 pb2nc_26729_0_blk.pb
>>>
>>> I built the METv1.1 using the g++ and g77, and with the -m32 option. And using the cwordsh to process the prebufr file. And it can run smoothly. Here is the version of  the gnu: 
>>>
>>> Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
>>> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
>>> Thread model: posix
>>> gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)
>>>
>>> Thanks!
>>>
>>> Kefeng
>>>
>>>
>>>
>>>
>>> Kefeng.Zhu-1 at ou.edu
>>> 2009-04-28
>>>
>>>
>>>
>>> 发件人: John Halley Gotway
>>> 发送时间: 2009-04-28 08:24:00
>>> 收件人: Zhu, Kefeng
>>> 抄送: met_help
>>> 主题: Re: [Met_help] pb2nc 'Segmentation fault' about the version 2
>>>
>>> Kefeng,
>>>
>>> To answer your question, the major change we've made to PB2NC for METv2.0 is that we're now doing the Fortran-Blocking step internal to PB2NC.  In METv1.1, we required you to run the "cwordsh" utility
>>> to Fortran-Block the input PrepBUFR files on your machine.  Now, we're doing that step inside of PB2NC itself.
>>>
>>> In the error message you sent, I see that PB2NC may be having problems while performing that blocking step.  But I'm not sure why.  I see that you must have edited the "tmp_dir" setting in the PB2NC
>>> configuration file to point to the current directory instead of "/tmp":
>>> tmp_dir = "./";
>>> So PB2NC is trying to write that temporary file in the current directory.  Do you have permissions to write to that directory?  After PB2NC seg-faults, do you see a temporary PB2NC file in that
>>> directory?  It'd be named something like pb2nc_NNN_blk.pb.  What is the size of that file?
>>>
>>> Also, there is one option when compiling MET that relates to this Fortran-Blocking step.  In the top-level MET Makefile, look in the line that contains "ARCH_FLAGS".  You should see "-DBLOCK4" either
>>> commented out or uncommented.  Whichever you see, try switching it by either adding or removing the '#' character.  Then try rebuilding MET, being sure to do "make clean" first.  And try rerunning the
>>> test scripts.
>>>
>>> If you're still experiencing this error after rebuilding, I'll need to get more details from you about the type of operating system and machine your using and the compiler types and versions.
>>>
>>> Thanks,
>>> John
>>>
>>> Kefeng.Zhu-1 at ou.edu wrote:
>>>> Hi:
>>>>
>>>> I use the same bufr library as METv1.1. But the METv2.0 didn't work. I'm wondering what possible change in 'pb2nc' may cause such a problem. I have tried to build the pb2nc with and without the option '-DBLOCK4'. Both of them show the segmentation fault in the run time.
>>>>
>>>> *** Running PB2NC on a PREPBUFR file ***
>>>> Reading Config File:    config/PB2NCConfig_G212
>>>> Creating NetCDF File:   ../out/pb2nc/sample_pb.nc
>>>> Processing PrepBufr File:       ../data/sample_obs/prepbufr/ndas.t00z.prepbufr.tm12.20070401.nr
>>>> Blocking PrepBufr file to:      .//pb2nc_8808_0_blk.pb
>>>> ./test_pb2nc.sh: line 9:  8808 Segmentation fault      ../bin/pb2nc ../data/sample_obs/prepbufr/ndas.t00z.prepbufr.tm12.20070401.nr ../out/pb2nc/sample_pb.nc config/PB2NCConfig_G212 -v 2
>>>>
>>>> Thanks!
>>>>
>>>> Kefeng
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Kefeng.Zhu-1 at ou.edu
>>>> 2009-04-24
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Met_help mailing list
>>>> Met_help at mailman.ucar.edu
>>>> http://mailman.ucar.edu/mailman/listinfo/met_help


More information about the Met_help mailing list