File: init.c

package info (click to toggle)
libhdf4 4.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,384 kB
  • sloc: ansic: 128,700; sh: 15,015; fortran: 12,444; java: 5,863; xml: 1,205; makefile: 794; yacc: 678; pascal: 418; perl: 360; javascript: 203; lex: 163; csh: 41
file content (42 lines) | stat: -rw-r--r-- 1,667 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*********************************************************************
 *   Copyright 1993, UCAR/Unidata
 *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
 *********************************************************************/

#include <stdio.h>
#include "ncgen.h"
#include "genlib.h"

extern int netcdf_flag;
extern int c_flag;
extern int fortran_flag;

struct dims dims[H4_MAX_NC_DIMS]; /* table of netcdf dimensions */

int  ncid;                 /* handle for netCDF */
int  ndims;                /* number of dimensions declared for netcdf */
int  nvars;                /* number of variables declared for netcdf */
int  natts;                /* number of attributes */
int  nvdims;               /* number of dimensions for variables */
int  dimnum;               /* dimension number index for variables */
int  varnum;               /* variable number index for attributes */
int  valnum;               /* value number index for attributes */
int  rec_dim;              /* number of the unlimited dimension, if any */
long var_len;              /* variable length (product of dimensions) */
int  var_size;             /* size of each element of variable */
long netcdf_record_number; /* current record number for variables */

struct vars vars[H4_MAX_NC_VARS]; /* should be a malloc'ed list, not an array */

struct atts atts[H4_MAX_NC_ATTRS]; /* should be a malloc'ed list, not an array */

extern void clearout();

void
init_netcdf()
{               /* initialize global counts, flags */
    clearout(); /* reset symbol table to empty */
    ndims   = 0;
    nvars   = 0;
    rec_dim = -1; /* means no unlimited dimension (yet) */
}