Skip Navigation Links www.nws.noaa.gov 
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 > wgrib2 format
 

wgrib2: bin, ieee, text formats

The bin, text and ieee formats

The -bin, -text, -ieee and -lola options create bin/text/ieee format files. The format doesn't change from that used by wgrib. The difference between bin and ieee is that bin writes the numbers in the machine's native format and ieee writes the numbers in big_endian ieee format.


			Text Format, with header


(grid 1)	(nx) (ny)		grid dimensions
		(grid value)
		(grid value)
		...
		(grid value)		nx*ny values
(grid 2)	(nx) (ny)		grid dimensions
		(grid value)
		(grid value)
		...
		(grid value)		nx*ny values
(grid 3)	...



		        Text Format, with no header

(grid 1)	(grid value)
		(grid value)
		...
		(grid value)		nx*ny values
(grid 2)	(grid value)
		(grid value)
		...
		(grid value)		nx*ny values
(grid 3)	...


	This format is not a recommended format because your code
could easily read too many or few grid points.



			Binary and IEEE, no header

(grid 1)	(binary float value)		grid value
		(binary float value)
		...
		(binary float value)		nx*ny values

(grid 2)	(binary float value)
		(binary float value)
		...
		(binary float value)		nx*ny values
		etc

	The no-header format is not a recommended format to use.  
The format does not indicate the size of the grid. If your program 
makes a mistake on the grid dimension, you could get interesting results.  
However, some fortran compilers require this format for binary files (Cray, 
ABSoft under AmigaOS).  In addition, this is the default GrADs binary format.



			Binary and IEEE, with header


(grid 1)	(binary integer)	nx*ny*sizeof(float)
		(binary float value)
		...
		(binary float value)	nx*ny values
		(binary integer)	nx*ny*sizeof(float)

(grid 2)	(binary integer)	nx*ny*sizeof(float)
		(binary float value)
		...
		(binary float value)	nx*ny values
		(binary integer)	nx*ny*sizeof(float)


    The binary-with-header format is commonly used by UNIX 
fortrans for their binary files.  Some MS-DOS fortran compilers
also support this format.  You can use this format with GrADS
with the "options sequential" line in the control file.

Note, the order of the numbers is controled by the -order option.

See also: -text, -bin, -ieee, -lola, -order,


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: May 15, 2005
Disclaimer Privacy Policy