Skip Navigation Links 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center

About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > copygb

FYI using copygb with ECMWF grib files

ECMWF grib files use a different convention for the precision than used by the Global Branch of EMC (source of copygb). To use copygb with ECMWF files, change the options for copygb so that it uses the ECMWF-style precision convention.

Global EMC/NCEP:  copygb (list of options)
ECMWF:            copygb -N namelist12 (list of options)
By using namelist12, all the fields have 12 bits precision. If you use namelist16 instead, all the fields will have 16 bits precision.

Support for the "linux port of copygb" is suspended 2/14/2013

Official copygb is now linux compatible and replaces the linux port

I created the linux port of copygb because copygb is an essential program for users of reanalyses. The support for the linux port of copygb was separate from the official code from NCEP Central Operations (NCO) because the linux port uses various libraries that I had ported to linux and the ported code was based on an older code base.

Since the last major upgrade to the linux port of copygb (NARR, 2002), my linux port of the libraries and 2 other branches were merged and given back to NCO to manage. In the last few months, operations have been moving to linux and they are now using the linux libraries and have ported the operational copygb to linux. Consequently there is no need for a linux port of copygb. Copygb is maintained by NCO. NCAR users should contact DTC for support.

    Wesley Ebisuzaki 2/2013

The following was the page prior to 2/2013.

copygb is a program to change grids of a grib file. It can be used to make regional subsets, change the resolution. and the projection. It's a nifty program.

The support for copygb is limited to bug fixes of the g95 version running on linux (i386). (Poor documentation doesn't count as a bug.) If you need to port the code to another system, good luck as you are on your own. If you don't understand the directions, read them again.

WRF users can get copygb support through regular WRF support.

The codes are available from
Files dated before 1/2005 are for historical continuity.

         How to make custom lat-long grids with copygb

NX = number of points on latitude cirle
NY = number of points on longitude meridian
LAT0 = latitude of origin * 1000  (lat = -90 .. 90)
LON0 = longitude of origin * 1000  (lon=-360 .. 360 ?)
LAT1 = latitude of extreme (last) point * 1000
LON1 = latitude of extreme (last) point * 1000
DX = latitudianal increment * 1000  (sign used)
DY = longitudinal increment * 1000  (sign used)

grid='255 0 NX NY LAT0 LON0 128 LAT1 LON1 DX DY 64'
copygb -g"$grid" -x in.grb out.grb

ex 0.1 x 0.1 degree grid from 25N to 45N and from 90W to 70W.
grid='255 0 201 201 25000 270000 128 45000 290000 100 100 64'
copygb -g"$grid" -x in.grb out.grb

The resultant grid is W to E, S to N.

Copygb understands winds. If one considers the interpolation near the poles, one quickly realizes that vector quantities need a different interpolation scheme than scalars. Consequently one can not interpolate the zonal (meridional) wind component without having the corresponding meridonal (zonal) wind component in the same grib file. If only one component is available, copygb will not do an interpolation.


NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: 8/21/2006
Disclaimer Privacy Policy