OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
nc4utils.h File Reference
#include <netcdf.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for nc4utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dim_str_nc
 
struct  att_str_nc
 
struct  var_str_nc
 
struct  grp_str_nc
 

Macros

#define TRYMEM(file, line, memstat)
 
#define TRY_NC(file, line, ncstat)
 

Functions

dim_str_ncload_dims_nc (int ncid)
 
void print_dims_nc (dim_str_nc *dim, int ndims)
 
void free_dims_nc (dim_str_nc *dim)
 
int find_dimid_nc (int ncid, int *dimid, const char *dimnames[])
 
att_str_ncload_atts_nc (int ncid, int varid)
 
void print_atts_nc (att_str_nc *att, int natts, char *varname)
 
void free_atts_nc (att_str_nc *att, int natts)
 
var_str_ncload_vars_nc (int ncid)
 
var_str_ncfind_var_byname_nc (grp_str_nc nc, const char *varname, const char *grpname)
 
int readall_var (var_str_nc *var)
 
void print_vars_nc (var_str_nc *var, int nvars)
 
void free_vars_nc (var_str_nc *var, int nvars)
 
int find_varid_nc (int ncid, int *varid, const char *varnames[])
 
int load_grp_nc (grp_str_nc *grp)
 
void print_grp_nc (grp_str_nc grp)
 
void free_grp_nc (grp_str_nc *grp)
 
void check_err (const int stat, const int line, const char *file)
 
void report_err (const int stat, const int line, const char *file)
 
int createNCDF (int ncid, const char *sname, const char *lname, const char *standard_name, const char *units, void *fill_value, const char *flag_values, const char *flag_meanings, double low, double high, int nt, int rank, int *dimids, size_t *chunksize)
 
void nc_init_compress (int32_t nc_id, int32_t var_id, int32_t *dimids, int32_t rank, size_t *chunksize, int deflate_level)
 
int nc_init_compress2 (int32_t nc_id, char *varnam, int32_t var_id, int32_t *dimids, int32_t rank, size_t *chunksize, int type_size, int deflate_level)
 
int check_chunksizes (size_t type_len, int32_t ndims, const size_t *chunksizes)
 

Macro Definition Documentation

◆ TRY_NC

#define TRY_NC (   file,
  line,
  ncstat 
)
Value:
{ \
if (ncstat != NC_NOERR) { \
fprintf(stderr, "-E- %s:%d: " \
"%s\n", \
file, line, nc_strerror(ncstat)); \
fflush(stderr); \
exit(1); } \
}

Definition at line 31 of file nc4utils.h.

◆ TRYMEM

#define TRYMEM (   file,
  line,
  memstat 
)
Value:
{ \
if (memstat == NULL) { \
fprintf(stderr, "-E- %s:%d: " \
"Memory allocation error.\n", \
file, line); \
fflush(stderr); \
exit(1); } \
}

Definition at line 22 of file nc4utils.h.

Function Documentation

◆ check_chunksizes()

int check_chunksizes ( size_t  type_len,
int32_t  ndims,
const size_t *  chunksizes 
)

Definition at line 159 of file nc_init_compress.c.

◆ check_err()

void check_err ( const int  stat,
const int  line,
const char *  file 
)

Definition at line 35 of file nc4utils.c.

◆ createNCDF()

int createNCDF ( int  ncid,
const char *  sname,
const char *  lname,
const char *  standard_name,
const char *  units,
void *  fill_value,
const char *  flag_values,
const char *  flag_meanings,
double  low,
double  high,
int  nt,
int  rank,
int *  dimids,
size_t *  chunksize 
)

Definition at line 17 of file createNCDF.c.

◆ find_dimid_nc()

int find_dimid_nc ( int  ncid,
int *  dimid,
const char *  dimnames[] 
)

Find ID of first dimension found in input list.

Parameters
[in]ncidNetCDF file or group ID,
[in]dimnamesNull-terminated list of possible dimension names.
[out]dimidNetCDF dimension ID
Returns
Error if no matching dimension found.

Definition at line 161 of file nc4utils.c.

◆ find_var_byname_nc()

var_str_nc* find_var_byname_nc ( grp_str_nc  nc,
const char *  varname,
const char *  grpname 
)

Definition at line 314 of file nc4utils.c.

◆ find_varid_nc()

int find_varid_nc ( int  ncid,
int *  varid,
const char *  varnames[] 
)

Find ID of first variable found in input list.

Parameters
[in]ncidNetCDF file or group ID,
[in]varnamesNull-terminated list of possible variable names.
[out]varidNetCDF variable ID
Returns
Error if no variable found.

Definition at line 407 of file nc4utils.c.

◆ free_atts_nc()

void free_atts_nc ( att_str_nc att,
int  natts 
)

Definition at line 236 of file nc4utils.c.

◆ free_dims_nc()

void free_dims_nc ( dim_str_nc dim)

Definition at line 147 of file nc4utils.c.

◆ free_grp_nc()

void free_grp_nc ( grp_str_nc grp)

Definition at line 495 of file nc4utils.c.

◆ free_vars_nc()

void free_vars_nc ( var_str_nc var,
int  nvars 
)

Definition at line 384 of file nc4utils.c.

◆ load_atts_nc()

att_str_nc* load_atts_nc ( int  ncid,
int  varid 
)

Definition at line 177 of file nc4utils.c.

◆ load_dims_nc()

dim_str_nc* load_dims_nc ( int  ncid)

◆ load_grp_nc()

int load_grp_nc ( grp_str_nc grp)

Definition at line 423 of file nc4utils.c.

◆ load_vars_nc()

var_str_nc* load_vars_nc ( int  ncid)

Definition at line 254 of file nc4utils.c.

◆ nc_init_compress()

void nc_init_compress ( int32_t  nc_id,
int32_t  var_id,
int32_t *  dimids,
int32_t  rank,
size_t *  chunksize,
int  deflate_level 
)

nc_init_compress

R. Healy 9/26/2016

Parameters
[in]

Definition at line 24 of file nc_init_compress.c.

◆ nc_init_compress2()

int nc_init_compress2 ( int32_t  nc_id,
char *  varnam,
int32_t  var_id,
int32_t *  dimids,
int32_t  rank,
size_t *  chunksize,
int  type_size,
int  deflate_level 
)

nc_init_compress

R. Healy 9/26/2016

Parameters
[in]

Definition at line 94 of file nc_init_compress.c.

◆ print_atts_nc()

void print_atts_nc ( att_str_nc att,
int  natts,
char *  varname 
)

Definition at line 224 of file nc4utils.c.

◆ print_dims_nc()

void print_dims_nc ( dim_str_nc dim,
int  ndims 
)

Definition at line 139 of file nc4utils.c.

◆ print_grp_nc()

void print_grp_nc ( grp_str_nc  grp)

Definition at line 466 of file nc4utils.c.

◆ print_vars_nc()

void print_vars_nc ( var_str_nc var,
int  nvars 
)

Definition at line 362 of file nc4utils.c.

◆ readall_var()

int readall_var ( var_str_nc var)

Definition at line 334 of file nc4utils.c.

◆ report_err()

void report_err ( const int  stat,
const int  line,
const char *  file 
)

Definition at line 28 of file nc4utils.c.

#define NULL
Definition: decode_rs.h:63
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed file
Definition: HISTORY.txt:413