NEP 4.3.0
NetCDF Expansion Pack
Loading...
Searching...
No Matches
nxcdf.h
Go to the documentation of this file.
1
22#ifndef NXCDF_H
23#define NXCDF_H
24
25#include <stdint.h>
26#include <netcdf.h>
27#include <netcdf_dispatch.h>
28#include <nep.h>
29
32#define NC_FORMATX_NXCDF NC_FORMATX_UDF9
33
35#define NC_NXCDF NEP_UDF_NXCDF
36
38#define NC_NETCDF4_MODEL 0x04000000
39
53#define NC_SWMR_WRITE 0x08000000
54
69#define NC_SWMR_READ 0x10000000
70
74#define NC_FLOAT16 17
78#define NC_BFLOAT16 18
81#define NC_FLOAT8_E4M3 19
84#define NC_FLOAT8_E5M2 20
87#define NC_FLOAT6_E2M3 21
90#define NC_FLOAT6_E3M2 22
93#define NC_FLOAT4_E2M1 23
95#define NC_COMPLEX 24
97#define NC_DOUBLECOMPLEX 25
99#define NC_BITFIELD8 26
101#define NC_BITFIELD16 27
103#define NC_BITFIELD32 28
105#define NC_BITFIELD64 29
110#define NC_STD_REF 30
111
115#define NC_STD_REF_SIZE 64
116
121typedef struct nc_std_ref_s {
122 union {
123 unsigned char bytes[NC_STD_REF_SIZE];
124 int64_t align;
125 } u;
127
129#define NC_STD_REF_OBJECT 1
131#define NC_STD_REF_REGION 2
133#define NC_STD_REF_ATTR 3
134
137#define NC_REF_OBJ_VAR 1
139#define NC_REF_OBJ_GRP 2
142#define NC_REF_OBJ_TYPE 3
148#define NC_REF_OBJ_ATT 4
149
150#if defined(__cplusplus)
151extern "C" {
152#endif
153
159extern NC_Dispatch *NC_NXCDF_initialize(void);
160
162extern int NC_NXCDF_finalize(void);
163
170 int nc_ref_object(int ncid, int obj_type, int objid, nc_std_ref_t *ref);
171
177 int nc_deref_object(int ncid, const nc_std_ref_t *ref, int *obj_typep,
178 int *grpidp, int *idp);
179
186 int nc_ref_region(int ncid, int varid, const size_t *startp,
187 const size_t *countp, const ptrdiff_t *stridep,
188 nc_std_ref_t *ref);
189
196 int nc_deref_region(int ncid, const nc_std_ref_t *ref, int *grpidp,
197 int *varidp, int *ndimsp, size_t *startp,
198 size_t *countp, ptrdiff_t *stridep);
199
206 int nc_ref_attr(int ncid, int obj_type, int objid,
207 const char *att_name, nc_std_ref_t *ref);
208
215 int nc_deref_attr(int ncid, const nc_std_ref_t *ref, int *obj_typep,
216 int *grpidp, int *idp, char *att_name);
217
235 int nc_ref_object_ext(int ncid, const char *filename, const char *path,
236 nc_std_ref_t *ref);
237
249 int nc_ref_region_ext(int ncid, const char *filename, const char *path,
250 const size_t *startp, const size_t *countp,
251 const ptrdiff_t *stridep, nc_std_ref_t *ref);
252
264 int nc_ref_attr_ext(int ncid, const char *filename, const char *path,
265 const char *att_name, nc_std_ref_t *ref);
266
291 int nc_ref_open_target(int ncid, const nc_std_ref_t *ref,
292 int *target_ncidp);
293
299 int nc_ref_get_type(const nc_std_ref_t *ref, int *ref_typep);
300
309 int nc_ref_get_file_name(const nc_std_ref_t *ref, char *name, size_t size);
310
320 int nc_ref_get_obj_name(const nc_std_ref_t *ref, char *name, size_t size);
321
335 int nc_ref_free(nc_std_ref_t *ref);
336
390 int nc_ref_open_remote(int ncid, const char *url, const char *path,
391 int *target_ncidp, int *kindp, int *objidp,
392 char *att_name, size_t att_name_size);
393
435 int nc_ref_resolve(int ncid, const char *path, int *kindp,
436 int *objidp, char *att_name, size_t att_name_size);
437
475 int nc_start_swmr_write(int ncid);
476
504 int nc_swmr_flush(int ncid);
505
547 int nc_swmr_refresh(int ncid);
548
549#if defined(__cplusplus)
550}
551#endif
552
553#endif /* NXCDF_H */
NetCDF Expansion Pack (NEP) - Public API.
int nc_ref_region(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, nc_std_ref_t *ref)
Create a dataset region reference to a strided hyperslab of a variable in a nxCDF file.
Definition nxcdf_ref.c:565
int nc_ref_free(nc_std_ref_t *ref)
Release the resources held by a reference token.
Definition nxcdf_ref.c:1277
int nc_deref_region(int ncid, const nc_std_ref_t *ref, int *grpidp, int *varidp, int *ndimsp, size_t *startp, size_t *countp, ptrdiff_t *stridep)
Resolve a dataset region reference token back to its variable and selection.
Definition nxcdf_ref.c:664
int nc_ref_region_ext(int ncid, const char *filename, const char *path, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, nc_std_ref_t *ref)
Create a dataset region reference pointing into another file.
Definition nxcdf_ref.c:1006
int nc_deref_object(int ncid, const nc_std_ref_t *ref, int *obj_typep, int *grpidp, int *idp)
Resolve an object reference token back to NetCDF ids.
Definition nxcdf_ref.c:501
int nc_swmr_refresh(int ncid)
Refresh a nxCDF SWMR reader session so newly published data becomes visible.
Definition nxcdf_file.c:380
int nc_ref_open_remote(int ncid, const char *url, const char *path, int *target_ncidp, int *kindp, int *objidp, char *att_name, size_t att_name_size)
Open a remote reference target and resolve its object path.
Definition nxcdf_remoteref.c:218
int nc_ref_get_obj_name(const nc_std_ref_t *ref, char *name, size_t size)
Copy the object path stored in a reference token.
Definition nxcdf_ref.c:1248
int NC_NXCDF_finalize(void)
Finalize process-wide nxCDF dispatch state.
Definition nxcdf_dispatch.c:169
int nc_ref_get_type(const nc_std_ref_t *ref, int *ref_typep)
Report the kind of a reference token.
Definition nxcdf_ref.c:1190
int nc_deref_attr(int ncid, const nc_std_ref_t *ref, int *obj_typep, int *grpidp, int *idp, char *att_name)
Resolve an attribute reference token back to its owner and attribute name.
Definition nxcdf_ref.c:840
struct nc_std_ref_s nc_std_ref_t
int nc_ref_object(int ncid, int obj_type, int objid, nc_std_ref_t *ref)
Create an HDF5 object reference to a variable, group, or user-defined type in a nxCDF file.
Definition nxcdf_ref.c:398
int nc_ref_get_file_name(const nc_std_ref_t *ref, char *name, size_t size)
Copy the file name stored in a reference token.
Definition nxcdf_ref.c:1220
int nc_ref_resolve(int ncid, const char *path, int *kindp, int *objidp, char *att_name, size_t att_name_size)
Resolve an object path on an already-open remote session.
Definition nxcdf_remoteref.c:115
#define NC_STD_REF_SIZE
Definition nxcdf.h:115
int nc_ref_open_target(int ncid, const nc_std_ref_t *ref, int *target_ncidp)
Open the external file a reference token points into.
Definition nxcdf_ref.c:1137
int nc_ref_attr_ext(int ncid, const char *filename, const char *path, const char *att_name, nc_std_ref_t *ref)
Create an attribute reference pointing into another file.
Definition nxcdf_ref.c:1086
NC_Dispatch * NC_NXCDF_initialize(void)
Register the nxCDF dispatch table in UDF slot 9.
Definition nxcdf_dispatch.c:140
int nc_ref_attr(int ncid, int obj_type, int objid, const char *att_name, nc_std_ref_t *ref)
Create an HDF5 attribute reference to an attribute on a variable, group, or committed datatype in a n...
Definition nxcdf_ref.c:780
int nc_swmr_flush(int ncid)
Publish all datasets and dimension scales of an active SWMR writer.
Definition nxcdf_file.c:223
int nc_start_swmr_write(int ncid)
Start a single-writer/multiple-reader session on a native nxCDF file.
Definition nxcdf_file.c:200
int nc_ref_object_ext(int ncid, const char *filename, const char *path, nc_std_ref_t *ref)
Create an object reference pointing into another file.
Definition nxcdf_ref.c:966
Definition nxcdf.h:121
unsigned char bytes[NC_STD_REF_SIZE]
Definition nxcdf.h:123
union nc_std_ref_s::@174233035077314321010047204033130117353022053212 u
int64_t align
Definition nxcdf.h:124