NetCDF  4.9.2
pres_temp_4D_wr.c File Reference

A more complex example of writing a netCDF file. More...

#include <stdio.h>
#include <string.h>
#include <netcdf.h>
Include dependency graph for pres_temp_4D_wr.c:

Go to the source code of this file.

Macros

#define DEGREES_EAST   "degrees_east"
 
#define DEGREES_NORTH   "degrees_north"
 
#define ERR(e)   {printf("Error: %s\n", nc_strerror(e)); return 2;}
 
#define FILE_NAME   "pres_temp_4D.nc"
 
#define LAT_NAME   "latitude"
 
#define LAT_UNITS   "degrees_north"
 
#define LON_NAME   "longitude"
 
#define LON_UNITS   "degrees_east"
 
#define LVL_NAME   "level"
 
#define MAX_ATT_LEN   80
 
#define NDIMS   4
 
#define NLAT   6
 
#define NLON   12
 
#define NLVL   2
 
#define NREC   2
 
#define PRES_NAME   "pressure"
 
#define PRES_UNITS   "hPa"
 
#define REC_NAME   "time"
 
#define SAMPLE_PRESSURE   900
 
#define SAMPLE_TEMP   9.0
 
#define START_LAT   25.0
 
#define START_LON   -125.0
 
#define TEMP_NAME   "temperature"
 
#define TEMP_UNITS   "celsius"
 
#define UNITS   "units"
 
#define UNITS   "units"
 

Functions

int main ()
 

Detailed Description

A more complex example of writing a netCDF file.

This is an example program which writes some 4D pressure and temperatures. It is intended to illustrate the use of the netCDF C API. The companion program pres_temp_4D_rd.c shows how to read the netCDF data file created by this program.

Author
Ed Hartnett

Definition in file pres_temp_4D_wr.c.