Making long time series

The Annual NCEP/NCAR CD-ROMs are an easy way to acquire data Reanalysis. However, many people would like to analyze multi-year time series. Making long time series is easy because you can concatinate GRIB files. This page gives more detailed instructions for a unix machine.

Without Filtering

  1. Mount the first CD-ROM. (system dependent)
  2. Copy the data to disk.
    ex. cp /cdrom/data/monthly/prs/all.prs /disk3/data/all.prs
  3. Repeat steps 4-5 for remaining CD-ROMs.
  4. Mount the next CD-ROM.
  5. Append the data to the disk file.
    ex. cat /cdrom/data/monthly/prs/all.prs >>/disk3/data/all.prs

With Filtering

Some of GRIB files on CD-ROM contain multiple variables on multiple levels. It is possible to eliminate unwanted variables and levels using a wgrib as a filter.

  1. Mount the first CD-ROM. (system dependent)
  2. Copy the data to disk.
    ex. cp /cdrom/data/monthly/prs/all.prs /disk3/data/tmpfile
  3. Remove extra GRIB records
    ex. keep 500 mb heights
    wgrib /disk3/data/tmpfile -s | grep ":HGT:500 mb:" | \
    wgrib /disk3/data/tmpfile -s -i -grib -o /disk3/data/z500.grib
  4. Repeat steps 5-7 for remaining CD-ROMs.
  5. Mount the next CD-ROM.
  6. Copy the data to disk.
    ex. cp /cdrom/data/monthly/prs/all.prs /disk3/data/tmpfile
  7. Remove extra GRIB records and append to data file
    ex. wgrib /disk3/data/tmpfile -s | grep ":HGT:500 mb:" | \
    wgrib /disk3/data/tmpfile -s -i -grib -append -o /disk3/data/z500.grib

Making GrADS control and index files can be done using and gribmap.

  1. Make a GrADS control file. z500.grib >z500.ctl
  2. Make a GrADS index file (optional).
    gribmap -i z500.ctl -0

    Making long time series: the easy way

    The previous proceedure was written when disk space was a precious commodity. Now PCs come with 60 GB drives and saving a few hundred megabytes just doesn't seem that important. This example shows how to make a 2 year time series of the "monthly/all.prs" dataset.

    1. Copy data/monthly/prs/all.prs to allprs.grb
      $ cp data/monthly/prs/all.prs allprs.grb
    2. Copy ctl/monthly/prs/all.prs to allprs.ctl
      $ cp ctl/monthly/prs/all.prs allprs.ctl
    3. For the next year, append data/monthly/prs/all.prs to allprs.grb
      (mount the next year's cd-rom)
      $ cat data/monthly/prs/all.prs >>allprs.grb
    4. Edit allprs.ctl
        from: dset ^../../../data/monthly/prs/all.prs
        to: dset ^allprs.grb

        from: index ^../../../index/monthly/prs/all.prs
        to: index ^allprs.idx

        from: tdef 12 linear 00z01jan79 1mo
        to: tdef 24 linear 00z01jan1979 1mo
        (You should change 24 and 1979 to the appropriate values.)
    5. Make an index file
      $ gribmap -0 -i allprs.ctl


    Privacy Policy