OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
nccmp.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2004-2006, 2009 Remik Ziemlinski <first d0t surname att n0aa d0t g0v>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2, or (at your option)
7  any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; see the file COPYING.
16  If not, write to the Free Software Foundation,
17  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19 
20 #ifndef NCCMP_H
21 #define NCCMP_H 1
22 #include "opt.h"
23 #include <netcdf.h>
24 #include <math.h>
25 #include <stdint.h>
26 #include "nccmp_user_type.h"
27 
28 typedef struct MISSING_STRUCT {
29  nc_type type;
30 
31  union {
32  char c;
33  int8_t b;
34  short s;
35  int i;
36  float f;
37  double d;
38  };
39 } missing_struct;
40 
41 typedef struct VARSTRUCT {
42  char name[NC_MAX_NAME];
43  int varid;
44  off_t len; /* # elements per record (or overall if static). */
45  size_t dimlens[NC_MAX_VAR_DIMS];
46  nc_type type;
47  int ndims;
48  int dimids[NC_MAX_VAR_DIMS];
49  char hasrec; /* has record dimension? */
50  int natts;
51  char hasmissing;
52  missing_struct missing;
54 } varstruct;
55 
56 typedef struct DIMSTRUCT {
57  int dimid;
58  size_t len;
59  char name[NC_MAX_NAME];
60 } dimstruct;
61 
62 typedef struct GROUP_NODE {
63  int groupID;
64  char groupName[NC_MAX_NAME];
65  int ngroups;
69 } GROUP_NODE;
70 
71 int openfiles(nccmpopts* opts, int *ncid1, int *ncid2);
72 int nccmp(nccmpopts* opts);
73 int nccmpmetadata(nccmpopts* opts, int ncid1, int ncid2);
74 int nccmpdata(nccmpopts* opts, int ncid1, int ncid2);
75 void getvarinfo(int ncid, varstruct* vars, int* nvars, int debug, int *ntypes, nccmp_user_type_t *user_types);
76 void type2string(nc_type type, char* str);
77 int excludevars(int ncid1, int ncid2, char** finallist,
78  int nfinal, char** excludelist, int nexclude);
79 
80 int allvarnames(char** list, int nvars, int ncid1, int ncid2);
81 int cmpattval(int nc1, int nc2, int varid1, int varid2, char* name, int len, nc_type type);
82 int findvar(char * name, varstruct *vars);
83 
84 #endif /* !NCCMP_H */
int ndims
Definition: nccmp.h:47
size_t len
Definition: nccmp.h:58
nccmp_user_type_t * user_types
Definition: nccmp.h:67
nc_type type
Definition: nccmp.h:29
int dimid
Definition: nccmp.h:57
char groupName[NC_MAX_NAME]
Definition: nccmp.h:64
list(APPEND LIBS ${PGSTK_LIBRARIES}) add_executable(atteph_info_modis atteph_info_modis.c) target_link_libraries(atteph_info_modis $
Definition: CMakeLists.txt:7
char c
Definition: nccmp.h:32
void getvarinfo(int ncid, varstruct *vars, int *nvars, int debug, int *ntypes, nccmp_user_type_t *user_types)
double d
Definition: nccmp.h:37
short s
Definition: nccmp.h:34
off_t len
Definition: nccmp.h:44
int natts
Definition: nccmp.h:50
int varid
Definition: nccmp.h:43
char hasrec
Definition: nccmp.h:49
size_t dimlens[NC_MAX_VAR_DIMS]
Definition: nccmp.h:45
int nccmpdata(nccmpopts *opts, int ncid1, int ncid2)
Definition: nccmp.c:2085
int nuser_types
Definition: nccmp.h:66
int8_t b
Definition: nccmp.h:33
int cmpattval(int nc1, int nc2, int varid1, int varid2, char *name, int len, nc_type type)
Definition: nccmp.c:503
int allvarnames(char **list, int nvars, int ncid1, int ncid2)
Definition: nccmp.c:968
int groupID
Definition: nccmp.h:63
nc_type type
Definition: nccmp.h:46
int openfiles(nccmpopts *opts, int *ncid1, int *ncid2)
Definition: nccmp.c:692
int findvar(char *name, varstruct *vars)
Definition: nccmp.c:1527
float f
Definition: nccmp.h:36
const char * str
Definition: l1c_msi.cpp:35
char name[NC_MAX_NAME]
Definition: nccmp.h:59
missing_struct missing
Definition: nccmp.h:52
void type2string(nc_type type, char *str)
Definition: nccmp.c:664
int ngroups
Definition: nccmp.h:65
char name[NC_MAX_NAME]
Definition: nccmp.h:42
char hasmissing
Definition: nccmp.h:51
struct GROUP_NODE * childGroups
Definition: nccmp.h:68
int dimids[NC_MAX_VAR_DIMS]
Definition: nccmp.h:48
int nccmp(nccmpopts *opts)
Definition: nccmp.c:2202
int excludevars(int ncid1, int ncid2, char **finallist, int nfinal, char **excludelist, int nexclude)
Definition: nccmp.c:176
int comp_type_idx
Definition: nccmp.h:53
int nccmpmetadata(nccmpopts *opts, int ncid1, int ncid2)
Definition: nccmp.c:1248