OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
nccmp.cpp File Reference
#include "nccmp.hpp"
#include "ncinfo.h"
#include "strlist.h"
#include <stdint.h>
#include <float.h>
#include "strlist.c"
#include "ncinfo.c"
#include "opt.c"
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
Include dependency graph for nccmp.cpp:

Go to the source code of this file.

Macros

#define NC_MAX_TYPES   64
 
#define NCFORMATSTR(f)
 
#define BROADCAST_MISSING(T)
 

Functions

const char * getGroupPath ()
 
template<typename T >
int cmp_ (T *in1, T *in2)
 
template<typename T >
int cmp_missing (T *in1, T *in2, T m1, T m2)
 
template<typename T >
int cmp_nanequal (T *in1, T *in2)
 
template<typename T >
int cmp_missing_nanequal (T *in1, T *in2, T m1, T m2)
 
template<typename T >
void ToHex (T v, char *out)
 
template<typename T >
void ToString (T v, char *out, char *formatprec)
 
template<typename T >
int cmp_var (int ncid1, int ncid2, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
 
template<typename T >
int cmp_vartol (int ncid1, int ncid2, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
 
template<typename T >
int cmp_var_ut (int ncid1, int ncid2, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
 
template<typename T >
int cmp_vartol_ut (void *P1, void *P2, int offset1, int offset2, int size1, int size2, char *name, nccmpopts *opts, int rec, size_t *odomax, off_t nitems, size_t *count, size_t *start, varstruct *v1, varstruct *v2, T M1, T M2)
 
void getidxstr (varstruct *var, size_t *start, int curidx, char *out)
 
void getidxstr_fortran (varstruct *var, size_t *start, int curidx, char *out)
 
int excludevars (int ncid1, int ncid2, char **finallist, int nfinal, char **excludelist, int nexclude)
 
void handle_error (int status)
 
int odometer (size_t *odo, size_t *limits, int first, int last)
 
void prettyprintatt (int ncid, char *varname, int varid, char *name, char *str)
 
int cmpatt (int ncid1, int ncid2, int varid1, int varid2, char *name, char *varname, nccmpopts *opts)
 
int cmpattval (int nc1, int nc2, int varid1, int varid2, char *name, int len, nc_type type)
 
void type2string (nc_type type, char *str)
 
int openfiles (nccmpopts *opts, int *ncid1, int *ncid2)
 
int nccmprecinfo (nccmpopts *opts, int ncid1, int ncid2)
 
void getgroupinfo (int ncid, vector< string > names, GROUP_NODE *groups)
 
void getdiminfo (int ncid, dimstruct *dims, int *ndims)
 
void broadcast_missing (nc_type var_type, nc_type att_type, missing_struct *values)
 
char get_missing (int ncid, varstruct *var, const char *attname)
 
nccmp_user_type_tgetvarinfo (int ncid, varstruct *vars, int *nvars, int verbose, int *nuser_types)
 
void freevarinfo (int nuser_types, nccmp_user_type_t *comp_types)
 
int isinvarstructlist (char *name, varstruct *vars, int nvars)
 
int makecmpvarlist (nccmpopts *opts, int ncid1, int ncid2)
 
int allvarnames (char **list, int nvars, int ncid1, int ncid2)
 
int nccmpformats (nccmpopts *opts, int ncid1, int ncid2)
 
int nccmpglobalatts (nccmpopts *opts, int ncid1, int ncid2)
 
int nccmpmetadata (nccmpopts *opts, int ncid1, int ncid2)
 
int findvar (char *name, varstruct *vars)
 
int cmpvar (char *name, int rec, nccmpopts *opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
 
int cmpvartol (char *name, int rec, nccmpopts *opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
 
int nccmpdatarecvartol (int ncid1, int ncid2, char *varname, nccmpopts *opts, size_t recstart, size_t recend, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
 
int nccmpdatarecvar (int ncid1, int ncid2, char *varname, nccmpopts *opts, size_t recstart, size_t recend, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
 
int nccmpdatatol (int ncid1, int ncid2, nccmpopts *opts, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
 
int nccmpdata (nccmpopts *opts, int ncid1, int ncid2, nccmp_user_type_t *user_types1, nccmp_user_type_t *user_types2)
 
int nccmp (nccmpopts *opts)
 
int compareGroup (nccmpopts *opts, int ncid1, int ncid2)
 
int main (int argc, char **argv)
 

Variables

varstruct vars1 [(int) NC_MAX_VARS]
 
varstruct vars2 [(int) NC_MAX_VARS]
 
dimstruct dims1 [(int) NC_MAX_DIMS]
 
dimstruct dims2 [(int) NC_MAX_DIMS]
 
size_t nrec1
 
size_t nrec2
 
int nvars1
 
int nvars2
 
int ndims1
 
int ndims2
 
int recid1
 
int recid2
 
vector< stringgroupPath
 

Macro Definition Documentation

◆ BROADCAST_MISSING

#define BROADCAST_MISSING (   T)
Value:
{ \
switch(att_type) { \
case NC_CHAR: values->T = values->c; break; \
case NC_BYTE: values->T = values->b; break; \
case NC_UBYTE: values->T = values->ub; break; \
case NC_SHORT: values->T = values->s; break; \
case NC_USHORT: values->T = values->us; break; \
case NC_INT: values->T = values->i; break; \
case NC_UINT: values->T = values->ui; break; \
case NC_INT64: values->T = values->l; break; \
case NC_UINT64: values->T = values->ul; break; \
case NC_FLOAT: values->T = values->f; break; \
case NC_DOUBLE: values->T = values->d; break; \
} \
}

◆ NC_MAX_TYPES

#define NC_MAX_TYPES   64

Definition at line 48 of file nccmp.cpp.

◆ NCFORMATSTR

#define NCFORMATSTR (   f)
Value:
(f == NC_FORMAT_CLASSIC ? "NC_FORMAT_CLASSIC" : \
(f == NC_FORMAT_64BIT ? "NC_FORMAT_64BIT" : \
(f == NC_FORMAT_NETCDF4 ? "NC_FORMAT_NETCDF4" : \
"NC_FORMAT_NETCDF4_CLASSIC"))) \

Definition at line 61 of file nccmp.cpp.

Function Documentation

◆ allvarnames()

int allvarnames ( char **  list,
int  nvars,
int  ncid1,
int  ncid2 
)

Definition at line 1636 of file nccmp.cpp.

◆ broadcast_missing()

void broadcast_missing ( nc_type  var_type,
nc_type  att_type,
missing_struct *  values 
)

Definition at line 1380 of file nccmp.cpp.

◆ cmp_()

int cmp_ ( T *  in1,
T *  in2 
)

Definition at line 81 of file nccmp.cpp.

◆ cmp_missing()

int cmp_missing ( T *  in1,
T *  in2,
m1,
m2 
)

Definition at line 88 of file nccmp.cpp.

◆ cmp_missing_nanequal()

int cmp_missing_nanequal ( T *  in1,
T *  in2,
m1,
m2 
)

Definition at line 102 of file nccmp.cpp.

◆ cmp_nanequal()

int cmp_nanequal ( T *  in1,
T *  in2 
)

Definition at line 95 of file nccmp.cpp.

◆ cmp_var()

int cmp_var ( int  ncid1,
int  ncid2,
nccmpopts *  opts,
int  rec,
size_t *  odomax,
off_t  nitems,
size_t *  count,
size_t *  start,
varstruct *  v1,
varstruct *  v2,
M1,
M2 
)

Definition at line 126 of file nccmp.cpp.

◆ cmp_var_ut()

int cmp_var_ut ( int  ncid1,
int  ncid2,
nccmpopts *  opts,
int  rec,
size_t *  odomax,
off_t  nitems,
size_t *  count,
size_t *  start,
varstruct *  v1,
varstruct *  v2,
M1,
M2 
)

Definition at line 294 of file nccmp.cpp.

◆ cmp_vartol()

int cmp_vartol ( int  ncid1,
int  ncid2,
nccmpopts *  opts,
int  rec,
size_t *  odomax,
off_t  nitems,
size_t *  count,
size_t *  start,
varstruct *  v1,
varstruct *  v2,
M1,
M2 
)

Definition at line 213 of file nccmp.cpp.

◆ cmp_vartol_ut()

int cmp_vartol_ut ( void *  P1,
void *  P2,
int  offset1,
int  offset2,
int  size1,
int  size2,
char *  name,
nccmpopts *  opts,
int  rec,
size_t *  odomax,
off_t  nitems,
size_t *  count,
size_t *  start,
varstruct *  v1,
varstruct *  v2,
M1,
M2 
)

Definition at line 381 of file nccmp.cpp.

◆ cmpatt()

int cmpatt ( int  ncid1,
int  ncid2,
int  varid1,
int  varid2,
char *  name,
char *  varname,
nccmpopts *  opts 
)

Definition at line 809 of file nccmp.cpp.

◆ cmpattval()

int cmpattval ( int  nc1,
int  nc2,
int  varid1,
int  varid2,
char *  name,
int  len,
nc_type  type 
)

Definition at line 908 of file nccmp.cpp.

◆ cmpvar()

int cmpvar ( char *  name,
int  rec,
nccmpopts *  opts,
int  ncid1,
int  ncid2,
nccmp_user_type_t user_types1,
nccmp_user_type_t user_types2 
)

Definition at line 2241 of file nccmp.cpp.

◆ cmpvartol()

int cmpvartol ( char *  name,
int  rec,
nccmpopts *  opts,
int  ncid1,
int  ncid2,
nccmp_user_type_t user_types1,
nccmp_user_type_t user_types2 
)

Definition at line 2538 of file nccmp.cpp.

◆ compareGroup()

int compareGroup ( nccmpopts *  opts,
int  ncid1,
int  ncid2 
)

Definition at line 3095 of file nccmp.cpp.

◆ excludevars()

int excludevars ( int  ncid1,
int  ncid2,
char **  finallist,
int  nfinal,
char **  excludelist,
int  nexclude 
)

Definition at line 488 of file nccmp.cpp.

◆ findvar()

int findvar ( char *  name,
varstruct *  vars 
)

Definition at line 2225 of file nccmp.cpp.

◆ freevarinfo()

void freevarinfo ( int  nuser_types,
nccmp_user_type_t comp_types 
)

Definition at line 1568 of file nccmp.cpp.

◆ get_missing()

char get_missing ( int  ncid,
varstruct *  var,
const char *  attname 
)

Definition at line 1424 of file nccmp.cpp.

◆ getdiminfo()

void getdiminfo ( int  ncid,
dimstruct *  dims,
int *  ndims 
)

Definition at line 1359 of file nccmp.cpp.

◆ getgroupinfo()

void getgroupinfo ( int  ncid,
vector< string names,
GROUP_NODE groups 
)

Definition at line 1327 of file nccmp.cpp.

◆ getGroupPath()

const char* getGroupPath ( )

Definition at line 67 of file nccmp.cpp.

◆ getidxstr()

void getidxstr ( varstruct *  var,
size_t *  start,
int  curidx,
char *  out 
)

Definition at line 457 of file nccmp.cpp.

◆ getidxstr_fortran()

void getidxstr_fortran ( varstruct *  var,
size_t *  start,
int  curidx,
char *  out 
)

Definition at line 473 of file nccmp.cpp.

◆ getvarinfo()

nccmp_user_type_t* getvarinfo ( int  ncid,
varstruct *  vars,
int *  nvars,
int  verbose,
int *  nuser_types 
)

Definition at line 1489 of file nccmp.cpp.

◆ handle_error()

void handle_error ( int  status)

Definition at line 530 of file nccmp.cpp.

◆ isinvarstructlist()

int isinvarstructlist ( char *  name,
varstruct *  vars,
int  nvars 
)

Definition at line 1582 of file nccmp.cpp.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 3260 of file nccmp.cpp.

◆ makecmpvarlist()

int makecmpvarlist ( nccmpopts *  opts,
int  ncid1,
int  ncid2 
)

Definition at line 1595 of file nccmp.cpp.

◆ nccmp()

int nccmp ( nccmpopts *  opts)

Definition at line 3005 of file nccmp.cpp.

◆ nccmpdata()

int nccmpdata ( nccmpopts *  opts,
int  ncid1,
int  ncid2,
nccmp_user_type_t user_types1,
nccmp_user_type_t user_types2 
)

Definition at line 2883 of file nccmp.cpp.

◆ nccmpdatarecvar()

int nccmpdatarecvar ( int  ncid1,
int  ncid2,
char *  varname,
nccmpopts *  opts,
size_t  recstart,
size_t  recend,
nccmp_user_type_t user_types1,
nccmp_user_type_t user_types2 
)

Definition at line 2804 of file nccmp.cpp.

◆ nccmpdatarecvartol()

int nccmpdatarecvartol ( int  ncid1,
int  ncid2,
char *  varname,
nccmpopts *  opts,
size_t  recstart,
size_t  recend,
nccmp_user_type_t user_types1,
nccmp_user_type_t user_types2 
)

Definition at line 2783 of file nccmp.cpp.

◆ nccmpdatatol()

int nccmpdatatol ( int  ncid1,
int  ncid2,
nccmpopts *  opts,
nccmp_user_type_t user_types1,
nccmp_user_type_t user_types2 
)

Definition at line 2824 of file nccmp.cpp.

◆ nccmpformats()

int nccmpformats ( nccmpopts *  opts,
int  ncid1,
int  ncid2 
)

Definition at line 1668 of file nccmp.cpp.

◆ nccmpglobalatts()

int nccmpglobalatts ( nccmpopts *  opts,
int  ncid1,
int  ncid2 
)

Definition at line 1691 of file nccmp.cpp.

◆ nccmpmetadata()

int nccmpmetadata ( nccmpopts *  opts,
int  ncid1,
int  ncid2 
)

Definition at line 1929 of file nccmp.cpp.

◆ nccmprecinfo()

int nccmprecinfo ( nccmpopts *  opts,
int  ncid1,
int  ncid2 
)

Definition at line 1273 of file nccmp.cpp.

◆ odometer()

int odometer ( size_t *  odo,
size_t *  limits,
int  first,
int  last 
)

Definition at line 548 of file nccmp.cpp.

◆ openfiles()

int openfiles ( nccmpopts *  opts,
int *  ncid1,
int *  ncid2 
)

Definition at line 1258 of file nccmp.cpp.

◆ prettyprintatt()

void prettyprintatt ( int  ncid,
char *  varname,
int  varid,
char *  name,
char *  str 
)

Definition at line 582 of file nccmp.cpp.

◆ ToHex()

void ToHex ( v,
char *  out 
)

Definition at line 109 of file nccmp.cpp.

◆ ToString()

void ToString ( v,
char *  out,
char *  formatprec 
)

Definition at line 122 of file nccmp.cpp.

◆ type2string()

void type2string ( nc_type  type,
char *  str 
)

Definition at line 1216 of file nccmp.cpp.

Variable Documentation

◆ dims1

dimstruct dims1[(int) NC_MAX_DIMS]

Definition at line 53 of file nccmp.cpp.

◆ dims2

dimstruct dims2[(int) NC_MAX_DIMS]

Definition at line 53 of file nccmp.cpp.

◆ groupPath

vector<string> groupPath

Definition at line 59 of file nccmp.cpp.

◆ ndims1

int ndims1

Definition at line 57 of file nccmp.cpp.

◆ ndims2

int ndims2

Definition at line 57 of file nccmp.cpp.

◆ nrec1

size_t nrec1

Definition at line 56 of file nccmp.cpp.

◆ nrec2

size_t nrec2

Definition at line 56 of file nccmp.cpp.

◆ nvars1

int nvars1

Definition at line 57 of file nccmp.cpp.

◆ nvars2

int nvars2

Definition at line 57 of file nccmp.cpp.

◆ recid1

int recid1

Definition at line 57 of file nccmp.cpp.

◆ recid2

int recid2

Definition at line 57 of file nccmp.cpp.

◆ vars1

varstruct vars1[(int) NC_MAX_VARS]

Definition at line 52 of file nccmp.cpp.

◆ vars2

varstruct vars2[(int) NC_MAX_VARS]

Definition at line 52 of file nccmp.cpp.

double precision function f(R1)
Definition: tmd.lp.f:1454
HISTORY txt for MOD_PR01(step one of PGE01) History follows the following convention needed due to new Aqua ReprocessingActual and the expected LUT revision number from PCF Changed to use PGE version for ProductionHistory Added Archive including ProcessingEnvironment Corrected handling of bad to resovle GSFcd02514 Changed to check staged LUT revision number versus the expected LUT revision number from thereby resolving defect report MODxl02056 This change also avoids the memory access violation reported in MODur00039 Changed the way output arrays were initialized with fill values
Definition: HISTORY.txt:162