MET Online Tutorial for METv1.1

PB2NC Tool: General

PB2NC Functionality

The PB2NC tool is used to stratify the contents of an input PrepBufr point observation file and reformat it into NetCDF format for use by the Point-Stat tool. The PB2NC tool must be run on the input PrepBufr point observation file prior to running Point-Stat. In addition, prior to running the PB2NC tool, the input PrepBufr file will likely need to be Fortran-blocked using the cwordsh utility. Fortran-blocking has already been performed on the test data distributed with MET, but depending on your system, it may or may not need to be redone. For completeness sake, the Fortran-blocking steps are covered below.

Run cwordsh

It is the user's responsibility to download and install the cwordsh utility, as described on the Compilation: Recommended Software page. If you have not already done so during the installation process, modify the script that runs cwordsh as follows:

  • cd /path/to/cwordsh/directory
  • Open up the cwordsh script file for editing with your preferred text editor.
  • Change the line from CWRD=. to CWRD=/path/to/cwordsh/directory
  • Save and close the cwordsh script file.

Next, return to the top-level MET directory. Running cwordsh on the sample PrepBufr file consists of the following steps to unblock and reblock the file:

    cd /path/to/METv1.1

    /path/to/cwordsh unblk \
    data/sample_obs/prepbufr/ndas.t00z.prepbufr.tm12.20070401.nr.blk \
    data/sample_obs/prepbufr/ndas.t00z.prepbufr.tm12.20070401.nr


    /path/to/cwordsh block \
    data/sample_obs/prepbufr/ndas.t00z.prepbufr.tm12.20070401.nr \
    data/sample_obs/prepbufr/ndas.t00z.prepbufr.tm12.20070401.nr.blk

arrow The "\" symbol used in the command above indicates the continuation of the command from one line to the next.

PB2NC Usage

Once the input file has been Fortran-blocked, the PrepBufr file is ready to be processed by the PB2NC tool. View the usage statement for PB2NC by simply typing the following:

    bin/pb2nc

At a minimum, the input prepbufr_file, the output netcdf_file, and the configuration config_file must be passed in on the command line. You may use the -pbfile command line argument to run PB2NC using multiple input PrepBufr files, likely adjacent in time.