OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
opt.h File Reference
#include "common.h"
#include "getopt.h"
#include "strlist.h"
#include <netcdf.h>
Include dependency graph for opt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  NCCMPOPTS
 

Macros

#define USAGE   "\Compare two NetCDF files.\n\nccmp is silent when files are equivalent, otherwise it will echo to STDERR whether metadata or a specific variable differs. By default, comparing stops after the first difference.\n\\n\Exit code 0 is returned for identical files, 1 for different files, and 2 for a fatal error.\n\\n\Usage: nccmp [OPTION...] file1 file2\n\\n\ -A, --Attribute=att1[,...] Ignore attribute(s) att1[,...]\n\ for all variables.\n\ -b, --verbose Print messages to show progress.\n\ -d, --data Compare data (variable values).\n\ -C, --maxdiff=CNT Print differences up until CNT messages per var.\n\ -D, --debug Prints verbose debug messages.\n\ -f, --force Forcefully compare, do not stop after first\n\ difference.\n\ -F, --fortran Print position indices using Fortran style\n\ (1-based reverse order).\n\ -g, --global Compare global attributes.\n\ (-m required)\n\ -G, --globalex att1[,...] Exclude global attributes att1[,...].\n\ (-mg required)\n\ -h, --history Compare global history attribute.\n\ (-mg required)\n\ -H, --help Give this usage message.\n\ --usage \n\ -m, --metadata Compare metadata, excluding global attributes.\n\ -M, --missing Ignore difference between values that have\n\ different missing_value and/or _FillValue.\n\ Attribute differences are still reported.\n\ -N, --nans-are-equal Allow NaNs to be equal.\n\ -n, --notolerance Turn off 0.0001 percent auto-tolerance for float and double.\n\ -p, --precision='%%.17g' Precision of difference printing\n\ (default is '%%g').\n\ Use '%%x' to print bytes.\n\ -s, --report-identical-files\n\ Report when files are the same.\n\ -t, --tolerance=TOL Compare if absolute difference > TOL.\n\ -T, --Tolerance=TOL Compare if relative percent difference > TOL.\n\ -v, --variable=var1[,...] Compare variable(s) var1[,...] only.\n\ -V, --version Print program version.\n\ -x, --exclude=var1[,...] Exclude variable(s) var1[,...].\n\ -w, --warn=tag[,...] Selectively make certain differences\n\ exceptions, but still print messages.\n\ Supported tags and their meanings:\n\ all: All differences.\n\ format: File formats.\n\ eos: Extra attribute end-of-string nulls.\n\\n\Original development by Remik . Ziemlinski @ noaa . gov.\n\\n\Converted to C++ for type generalization by Richard . Healy @ NASA . gov (January 2015)\n\"
 
#define NCCMP_MAX_STRINGS   256
 
#define NCCMP_W_TAGS   "all,format,eos"
 
#define NCCMP_W_NUMTAGS   3
 
#define NCCMP_W_ALL   0
 
#define NCCMP_W_FORMAT   1
 
#define NCCMP_W_EOS   2
 

Functions

int getnccmpopts (int argc, char **argv, nccmpopts *popts)
 
void printusage ()
 
void printversion ()
 
void freenccmpopts (nccmpopts *popts)
 
void initnccmpopts (nccmpopts *popts)
 

Macro Definition Documentation

◆ NCCMP_MAX_STRINGS

#define NCCMP_MAX_STRINGS   256

Definition at line 93 of file opt.h.

◆ NCCMP_W_ALL

#define NCCMP_W_ALL   0

Definition at line 98 of file opt.h.

◆ NCCMP_W_EOS

#define NCCMP_W_EOS   2

Definition at line 100 of file opt.h.

◆ NCCMP_W_FORMAT

#define NCCMP_W_FORMAT   1

Definition at line 99 of file opt.h.

◆ NCCMP_W_NUMTAGS

#define NCCMP_W_NUMTAGS   3

Definition at line 97 of file opt.h.

◆ NCCMP_W_TAGS

#define NCCMP_W_TAGS   "all,format,eos"

Definition at line 96 of file opt.h.

◆ USAGE

#define USAGE   "\Compare two NetCDF files.\n\nccmp is silent when files are equivalent, otherwise it will echo to STDERR whether metadata or a specific variable differs. By default, comparing stops after the first difference.\n\\n\Exit code 0 is returned for identical files, 1 for different files, and 2 for a fatal error.\n\\n\Usage: nccmp [OPTION...] file1 file2\n\\n\ -A, --Attribute=att1[,...] Ignore attribute(s) att1[,...]\n\ for all variables.\n\ -b, --verbose Print messages to show progress.\n\ -d, --data Compare data (variable values).\n\ -C, --maxdiff=CNT Print differences up until CNT messages per var.\n\ -D, --debug Prints verbose debug messages.\n\ -f, --force Forcefully compare, do not stop after first\n\ difference.\n\ -F, --fortran Print position indices using Fortran style\n\ (1-based reverse order).\n\ -g, --global Compare global attributes.\n\ (-m required)\n\ -G, --globalex att1[,...] Exclude global attributes att1[,...].\n\ (-mg required)\n\ -h, --history Compare global history attribute.\n\ (-mg required)\n\ -H, --help Give this usage message.\n\ --usage \n\ -m, --metadata Compare metadata, excluding global attributes.\n\ -M, --missing Ignore difference between values that have\n\ different missing_value and/or _FillValue.\n\ Attribute differences are still reported.\n\ -N, --nans-are-equal Allow NaNs to be equal.\n\ -n, --notolerance Turn off 0.0001 percent auto-tolerance for float and double.\n\ -p, --precision='%%.17g' Precision of difference printing\n\ (default is '%%g').\n\ Use '%%x' to print bytes.\n\ -s, --report-identical-files\n\ Report when files are the same.\n\ -t, --tolerance=TOL Compare if absolute difference > TOL.\n\ -T, --Tolerance=TOL Compare if relative percent difference > TOL.\n\ -v, --variable=var1[,...] Compare variable(s) var1[,...] only.\n\ -V, --version Print program version.\n\ -x, --exclude=var1[,...] Exclude variable(s) var1[,...].\n\ -w, --warn=tag[,...] Selectively make certain differences\n\ exceptions, but still print messages.\n\ Supported tags and their meanings:\n\ all: All differences.\n\ format: File formats.\n\ eos: Extra attribute end-of-string nulls.\n\\n\Original development by Remik . Ziemlinski @ noaa . gov.\n\\n\Converted to C++ for type generalization by Richard . Healy @ NASA . gov (January 2015)\n\"

Definition at line 38 of file opt.h.

Function Documentation

◆ freenccmpopts()

void freenccmpopts ( nccmpopts *  popts)

Definition at line 54 of file opt.c.

◆ getnccmpopts()

int getnccmpopts ( int  argc,
char **  argv,
nccmpopts *  popts 
)

Definition at line 121 of file opt.c.

◆ initnccmpopts()

void initnccmpopts ( nccmpopts *  popts)

Definition at line 65 of file opt.c.

◆ printusage()

void printusage ( )

Definition at line 107 of file opt.c.

◆ printversion()

void printversion ( )

Definition at line 111 of file opt.c.