Loading...
Searching...
No Matches
pres_temp_4D_rd.c File Reference
Tutorial Examples

Example program for reading a 4D netCDF file. More...

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

Go to the source code of this file.

## Macros

#define | DEGREES_EAST "degrees_east"
#define | DEGREES_NORTH "degrees_north"
#define | ERR(e)
#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

Example program for reading a 4D netCDF file.

This is an example which reads some 4D pressure and temperatures. The data file read by this program is produced by the companion program pres_temp_4D_wr.c. It is intended to illustrate the use of the netCDF C API.

This is part of the netCDF package. Full documentation of the netCDF can be found at https://docs.unidata.ucar.edu/netcdf-c.

Author
  Ed Hartnett

Definition in file pres_temp_4D_rd.c.

## Macro Definition Documentation

## DEGREES_EAST

#define DEGREES_EAST "degrees_east"

Definition at line 42 of file pres_temp_4D_rd.c.

## DEGREES_NORTH

#define DEGREES_NORTH "degrees_north"

Definition at line 43 of file pres_temp_4D_rd.c.

## ERR

#define ERR | ( |  | e | ) |

Value:
{printf("Error: %s\n", nc_strerror(e)); return 2;}
nc_strerror
EXTERNL const char * nc_strerror(int ncerr)
Given an error number, return an error message.
Definition derror.c:87

Definition at line 61 of file pres_temp_4D_rd.c.

## FILE_NAME

#define FILE_NAME "pres_temp_4D.nc"

Definition at line 24 of file pres_temp_4D_rd.c.

## LAT_NAME

#define LAT_NAME "latitude"

Definition at line 31 of file pres_temp_4D_rd.c.

## LAT_UNITS

#define LAT_UNITS "degrees_north"

Definition at line 55 of file pres_temp_4D_rd.c.

## LON_NAME

#define LON_NAME "longitude"

Definition at line 32 of file pres_temp_4D_rd.c.

## LON_UNITS

#define LON_UNITS "degrees_east"

Definition at line 56 of file pres_temp_4D_rd.c.

## LVL_NAME

#define LVL_NAME "level"

Definition at line 35 of file pres_temp_4D_rd.c.

## MAX_ATT_LEN

#define MAX_ATT_LEN 80

Definition at line 57 of file pres_temp_4D_rd.c.

## NDIMS

#define NDIMS 4

Definition at line 28 of file pres_temp_4D_rd.c.

## NLAT

#define NLAT 6

Definition at line 29 of file pres_temp_4D_rd.c.

## NLON

#define NLON 12

Definition at line 30 of file pres_temp_4D_rd.c.

## NLVL

#define NLVL 2

Definition at line 36 of file pres_temp_4D_rd.c.

## NREC

#define NREC 2

Definition at line 33 of file pres_temp_4D_rd.c.

## PRES_NAME

#define PRES_NAME "pressure"

Definition at line 39 of file pres_temp_4D_rd.c.

## PRES_UNITS

#define PRES_UNITS "hPa"

Definition at line 53 of file pres_temp_4D_rd.c.

## REC_NAME

#define REC_NAME "time"

Definition at line 34 of file pres_temp_4D_rd.c.

## SAMPLE_PRESSURE

#define SAMPLE_PRESSURE 900

Definition at line 46 of file pres_temp_4D_rd.c.

## SAMPLE_TEMP

#define SAMPLE_TEMP 9.0

Definition at line 47 of file pres_temp_4D_rd.c.

## START_LAT

#define START_LAT 25.0

Definition at line 48 of file pres_temp_4D_rd.c.

## START_LON

#define START_LON -125.0

Definition at line 49 of file pres_temp_4D_rd.c.

## TEMP_NAME

#define TEMP_NAME "temperature"

Definition at line 40 of file pres_temp_4D_rd.c.

## TEMP_UNITS

#define TEMP_UNITS "celsius"

Definition at line 54 of file pres_temp_4D_rd.c.

## UNITS [1/2]

#define UNITS "units"

Definition at line 41 of file pres_temp_4D_rd.c.

## UNITS [2/2]

#define UNITS "units"

Definition at line 41 of file pres_temp_4D_rd.c.

## Function Documentation

## main()

int main | ( |  | ) |

Definition at line 64 of file pres_temp_4D_rd.c.