OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
nccmp.c File Reference
#include "nccmp.h"
#include "ncinfo.h"
#include "strlist.h"
#include <stdint.h>
#include <float.h>
Include dependency graph for nccmp.c:

Go to the source code of this file.

Macros

#define NCFORMATSTR(f)
 
#define BROADCAST_MISSING(T)
 
#define CMP_VAR(TYPE, NCFUNTYPE, ncid1, ncid2, P1, P2, M)
 
#define CMP_VARTOL(TYPE, NCFUNTYPE, ncid1, ncid2, P1, P2, M)
 

Functions

void getidxstr (varstruct *var, size_t *start, int curidx, char *out)
 
void getidxstr_fortran (varstruct *var, size_t *start, int curidx, char *out)
 
void doubleToString (double v, char *out, char *formatprec)
 
void floatToString (float v, char *out, char *formatprec)
 
void intToString (int v, char *out, char *ignore)
 
void shortToString (short v, char *out, char *ignore)
 
void byteToString (unsigned char v, char *out, char *ignore)
 
void textToString (char v, char *out, char *ignore)
 
void doubleToHex (double v, char *out)
 
void floatToHex (float v, char *out)
 
void intToHex (int v, char *out)
 
void shortToHex (short v, char *out)
 
void byteToHex (int8_t v, char *out)
 
void textToHex (char v, 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)
 
int getgroupinfo (int ncid, int numgroups, 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)
 
void getvarinfo (int ncid, varstruct *vars, int *nvars, int verbose)
 
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)
 
off_t cmp_text (char *in1, char *in2)
 
off_t cmp_text_missing (char *in1, char *in2, char m1, char m2)
 
off_t cmp_byte (int8_t *in1, int8_t *in2)
 
off_t cmp_byte_missing (int8_t *in1, int8_t *in2, int8_t m1, int8_t m2)
 
off_t cmp_short (short *in1, short *in2)
 
off_t cmp_short_missing (short *in1, short *in2, short m1, short m2)
 
off_t cmp_int (int *in1, int *in2)
 
off_t cmp_int_missing (int *in1, int *in2, int m1, int m2)
 
off_t cmp_float (float *in1, float *in2)
 
off_t cmp_float_missing (float *in1, float *in2, float m1, float m2)
 
off_t cmp_double (double *in1, double *in2)
 
off_t cmp_double_missing (double *in1, double *in2, double m1, double m2)
 
int cmpvar (char *name, int rec, nccmpopts *opts, int ncid1, int ncid2)
 
int cmpvartol (char *name, int rec, nccmpopts *opts, int ncid1, int ncid2)
 
int nccmpdatarecvartol (int ncid1, int ncid2, char *varname, nccmpopts *opts, size_t recstart, size_t recend)
 
int nccmpdatarecvar (int ncid1, int ncid2, char *varname, nccmpopts *opts, size_t recstart, size_t recend)
 
int nccmpdatatol (int ncid1, int ncid2, nccmpopts *opts)
 
int nccmpdata (nccmpopts *opts, int ncid1, int ncid2)
 
int nccmp (nccmpopts *opts)
 
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
 

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_SHORT: values->T = values->s; break; \
case NC_INT: values->T = values->i; break; \
case NC_FLOAT: values->T = values->f; break; \
case NC_DOUBLE: values->T = values->d; break; \
} \
}

◆ CMP_VAR

#define CMP_VAR (   TYPE,
  NCFUNTYPE,
  ncid1,
  ncid2,
  P1,
  P2,
  M 
)

◆ CMP_VARTOL

#define CMP_VARTOL (   TYPE,
  NCFUNTYPE,
  ncid1,
  ncid2,
  P1,
  P2,
  M 
)

◆ 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 31 of file nccmp.c.

Function Documentation

◆ allvarnames()

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

Definition at line 968 of file nccmp.c.

◆ broadcast_missing()

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

Definition at line 799 of file nccmp.c.

◆ byteToHex()

void byteToHex ( int8_t  v,
char *  out 
)

Definition at line 149 of file nccmp.c.

◆ byteToString()

void byteToString ( unsigned char  v,
char *  out,
char *  ignore 
)

Definition at line 88 of file nccmp.c.

◆ cmp_byte()

off_t cmp_byte ( int8_t *  in1,
int8_t *  in2 
)

Definition at line 1553 of file nccmp.c.

◆ cmp_byte_missing()

off_t cmp_byte_missing ( int8_t *  in1,
int8_t *  in2,
int8_t  m1,
int8_t  m2 
)

Definition at line 1559 of file nccmp.c.

◆ cmp_double()

off_t cmp_double ( double *  in1,
double *  in2 
)

Definition at line 1601 of file nccmp.c.

◆ cmp_double_missing()

off_t cmp_double_missing ( double *  in1,
double *  in2,
double  m1,
double  m2 
)

Definition at line 1607 of file nccmp.c.

◆ cmp_float()

off_t cmp_float ( float *  in1,
float *  in2 
)

Definition at line 1589 of file nccmp.c.

◆ cmp_float_missing()

off_t cmp_float_missing ( float *  in1,
float *  in2,
float  m1,
float  m2 
)

Definition at line 1595 of file nccmp.c.

◆ cmp_int()

off_t cmp_int ( int *  in1,
int *  in2 
)

Definition at line 1577 of file nccmp.c.

◆ cmp_int_missing()

off_t cmp_int_missing ( int *  in1,
int *  in2,
int  m1,
int  m2 
)

Definition at line 1583 of file nccmp.c.

◆ cmp_short()

off_t cmp_short ( short *  in1,
short *  in2 
)

Definition at line 1565 of file nccmp.c.

◆ cmp_short_missing()

off_t cmp_short_missing ( short *  in1,
short *  in2,
short  m1,
short  m2 
)

Definition at line 1571 of file nccmp.c.

◆ cmp_text()

off_t cmp_text ( char *  in1,
char *  in2 
)

Definition at line 1541 of file nccmp.c.

◆ cmp_text_missing()

off_t cmp_text_missing ( char *  in1,
char *  in2,
char  m1,
char  m2 
)

Definition at line 1547 of file nccmp.c.

◆ cmpatt()

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

Definition at line 402 of file nccmp.c.

◆ cmpattval()

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

Definition at line 503 of file nccmp.c.

◆ cmpvar()

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

Definition at line 1619 of file nccmp.c.

◆ cmpvartol()

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

Definition at line 1801 of file nccmp.c.

◆ doubleToHex()

void doubleToHex ( double  v,
char *  out 
)

Definition at line 97 of file nccmp.c.

◆ doubleToString()

void doubleToString ( double  v,
char *  out,
char *  formatprec 
)

Definition at line 72 of file nccmp.c.

◆ excludevars()

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

Definition at line 176 of file nccmp.c.

◆ findvar()

int findvar ( char *  name,
varstruct *  vars 
)

Definition at line 1527 of file nccmp.c.

◆ floatToHex()

void floatToHex ( float  v,
char *  out 
)

Definition at line 110 of file nccmp.c.

◆ floatToString()

void floatToString ( float  v,
char *  out,
char *  formatprec 
)

Definition at line 76 of file nccmp.c.

◆ get_missing()

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

Definition at line 821 of file nccmp.c.

◆ getdiminfo()

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

Definition at line 778 of file nccmp.c.

◆ getgroupinfo()

int getgroupinfo ( int  ncid,
int  numgroups,
GROUP_NODE groups 
)

Definition at line 762 of file nccmp.c.

◆ getidxstr()

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

Definition at line 41 of file nccmp.c.

◆ getidxstr_fortran()

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

Definition at line 57 of file nccmp.c.

◆ getvarinfo()

void getvarinfo ( int  ncid,
varstruct *  vars,
int *  nvars,
int  verbose 
)

Definition at line 865 of file nccmp.c.

◆ handle_error()

void handle_error ( int  status)

Definition at line 219 of file nccmp.c.

◆ intToHex()

void intToHex ( int  v,
char *  out 
)

Definition at line 123 of file nccmp.c.

◆ intToString()

void intToString ( int  v,
char *  out,
char *  ignore 
)

Definition at line 80 of file nccmp.c.

◆ isinvarstructlist()

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

Definition at line 917 of file nccmp.c.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 2340 of file nccmp.c.

◆ makecmpvarlist()

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

Definition at line 930 of file nccmp.c.

◆ nccmp()

int nccmp ( nccmpopts *  opts)

Definition at line 2202 of file nccmp.c.

◆ nccmpdata()

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

Definition at line 2085 of file nccmp.c.

◆ nccmpdatarecvar()

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

Definition at line 2006 of file nccmp.c.

◆ nccmpdatarecvartol()

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

Definition at line 1985 of file nccmp.c.

◆ nccmpdatatol()

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

Definition at line 2026 of file nccmp.c.

◆ nccmpformats()

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

Definition at line 1000 of file nccmp.c.

◆ nccmpglobalatts()

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

Definition at line 1023 of file nccmp.c.

◆ nccmpmetadata()

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

Definition at line 1248 of file nccmp.c.

◆ nccmprecinfo()

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

Definition at line 707 of file nccmp.c.

◆ odometer()

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

Definition at line 236 of file nccmp.c.

◆ openfiles()

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

Definition at line 692 of file nccmp.c.

◆ prettyprintatt()

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

Definition at line 270 of file nccmp.c.

◆ shortToHex()

void shortToHex ( short  v,
char *  out 
)

Definition at line 136 of file nccmp.c.

◆ shortToString()

void shortToString ( short  v,
char *  out,
char *  ignore 
)

Definition at line 84 of file nccmp.c.

◆ textToHex()

void textToHex ( char  v,
char *  out 
)

Definition at line 162 of file nccmp.c.

◆ textToString()

void textToString ( char  v,
char *  out,
char *  ignore 
)

Definition at line 92 of file nccmp.c.

◆ type2string()

void type2string ( nc_type  type,
char *  str 
)

Definition at line 664 of file nccmp.c.

Variable Documentation

◆ dims1

dimstruct dims1[(int) NC_MAX_DIMS]

Definition at line 27 of file nccmp.c.

◆ dims2

dimstruct dims2[(int) NC_MAX_DIMS]

Definition at line 27 of file nccmp.c.

◆ ndims1

int ndims1

Definition at line 29 of file nccmp.c.

◆ ndims2

int ndims2

Definition at line 29 of file nccmp.c.

◆ nrec1

size_t nrec1

Definition at line 28 of file nccmp.c.

◆ nrec2

size_t nrec2

Definition at line 28 of file nccmp.c.

◆ nvars1

int nvars1

Definition at line 29 of file nccmp.c.

◆ nvars2

int nvars2

Definition at line 29 of file nccmp.c.

◆ recid1

int recid1

Definition at line 29 of file nccmp.c.

◆ recid2

int recid2

Definition at line 29 of file nccmp.c.

◆ vars1

varstruct vars1[(int) NC_MAX_VARS]

Definition at line 26 of file nccmp.c.

◆ vars2

varstruct vars2[(int) NC_MAX_VARS]

Definition at line 26 of file nccmp.c.

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