NEP 4.3.0
NetCDF Expansion Pack
Loading...
Searching...
No Matches
nep.h
Go to the documentation of this file.
1
27#ifndef NEP_H
28#define NEP_H
29
30#include <stdio.h>
31#include <stdint.h>
32#include <netcdf.h>
33#include <netcdf_filter.h>
34
35
44#if defined(__BFLT16_MAX__)
45#define NEP_HAVE_NATIVE_BFLOAT16 1
46typedef __bf16 nc_bfloat16_t;
47#else
48#define NEP_HAVE_NATIVE_BFLOAT16 0
49typedef uint16_t nc_bfloat16_t;
50#endif
51
61#if defined(__FLT16_MAX__)
62#define NEP_HAVE_NATIVE_FLOAT16 1
63typedef _Float16 nc_float16_t;
64#else
65#define NEP_HAVE_NATIVE_FLOAT16 0
66typedef uint16_t nc_float16_t;
67#endif
68
69#if defined(__cplusplus)
70extern "C" {
71#endif
72
73 /* Library prototypes... */
75 int nep_set_log_level(int new_level);
76
88 int nc_get_var1_bfloat16(int ncid, int varid, const size_t *indexp, nc_bfloat16_t *ip);
89
101 int nc_put_var1_bfloat16(int ncid, int varid, const size_t *indexp, const nc_bfloat16_t *op);
102
113 int nc_get_var_bfloat16(int ncid, int varid, nc_bfloat16_t *ip);
114
125 int nc_put_var_bfloat16(int ncid, int varid, const nc_bfloat16_t *op);
126
140 int nc_get_vars_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, nc_bfloat16_t *ip);
141
155 int nc_put_vars_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const nc_bfloat16_t *op);
156
180 int nc_get_vara_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, nc_bfloat16_t *ip);
181
202 int nc_put_vara_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, const nc_bfloat16_t *op);
203
215 int nc_get_var1_float16(int ncid, int varid, const size_t *indexp, nc_float16_t *ip);
216
228 int nc_put_var1_float16(int ncid, int varid, const size_t *indexp, const nc_float16_t *op);
229
240 int nc_get_var_float16(int ncid, int varid, nc_float16_t *ip);
241
252 int nc_put_var_float16(int ncid, int varid, const nc_float16_t *op);
253
267 int nc_get_vars_float16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, nc_float16_t *ip);
268
282 int nc_put_vars_float16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const nc_float16_t *op);
283
307 int nc_get_vara_float16(int ncid, int varid, const size_t *startp, const size_t *countp, nc_float16_t *ip);
308
329 int nc_put_vara_float16(int ncid, int varid, const size_t *startp, const size_t *countp, const nc_float16_t *op);
330
331
332#if defined(__cplusplus)
333}
334#endif
335
365
367#define NEP_UDF_GEOTIFF_BIGTIFF NC_UDF0
368
370#define NEP_UDF_GEOTIFF_STANDARD NC_UDF1
371
373#define NEP_UDF_GRIB2 NC_UDF2
374
376#define NEP_UDF_CDF NC_UDF4
377
379#define NEP_UDF_FITS NC_UDF3
380
382#define NEP_UDF_PDS4 NC_UDF5
383
385#define NEP_UDF_DICOM NC_UDF6
386
388#define NEP_UDF_PDB NC_UDF7
389
391#define NEP_UDF_MMCIF NC_UDF8
392
394#define NEP_UDF_NXCDF NC_UDF9
395
396
397
399
423
425#define NEP_MAGIC_GEOTIFF_STANDARD "II*"
426
428#define NEP_MAGIC_GEOTIFF_BIGTIFF "II+"
429
431#define NEP_MAGIC_CDF "\xCD\xF3\x00\x01"
432
434#define NEP_MAGIC_GRIB2 "GRIB"
435
437#define NEP_MAGIC_FITS "SIMPLE"
438
440#define NEP_MAGIC_PDS4 "<?xml"
441
443#define NEP_MAGIC_DICOM "DICM"
444
446#define NEP_MAGIC_PDB "HEADER"
447
449#define NEP_MAGIC_MMCIF "data_"
450
452
473
475#define NEP_FORMAT_NAME_GEOTIFF "GeoTIFF"
476
478#define NEP_FORMAT_NAME_CDF "NASA CDF"
479
481#define NEP_FORMAT_NAME_GRIB2 "GRIB2"
482
484#define NEP_FORMAT_NAME_FITS "FITS"
485
487#define NEP_FORMAT_NAME_PDS4 "PDS4"
488
490#define NEP_FORMAT_NAME_DICOM "DICOM"
491
493#define NEP_FORMAT_NAME_PDB "PDB"
494
496#define NEP_FORMAT_NAME_MMCIF "mmCIF"
497
499
500#endif /* NEP_H */
int nc_get_var_float16(int ncid, int varid, nc_float16_t *ip)
Read a whole variable as IEEE 754 float16.
int nep_set_log_level(int new_level)
Definition nep.c:63
int nc_put_var_bfloat16(int ncid, int varid, const nc_bfloat16_t *op)
Write a whole variable from bfloat16 values.
Definition nep_bfloat16.c:388
int nc_put_var1_bfloat16(int ncid, int varid, const size_t *indexp, const nc_bfloat16_t *op)
Write one value to a variable as bfloat16.
Definition nep_bfloat16.c:339
int nc_put_vars_float16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const nc_float16_t *op)
Write a strided hyperslab of a variable from IEEE 754 float16 values.
int nc_get_var1_float16(int ncid, int varid, const size_t *indexp, nc_float16_t *ip)
Read one value from a variable as IEEE 754 float16.
int nc_put_var_float16(int ncid, int varid, const nc_float16_t *op)
Write a whole variable from IEEE 754 float16 values.
int nc_put_vara_float16(int ncid, int varid, const size_t *startp, const size_t *countp, const nc_float16_t *op)
Write a hyperslab of a variable from IEEE 754 float16 values.
int nc_get_var_bfloat16(int ncid, int varid, nc_bfloat16_t *ip)
Read a whole variable as bfloat16.
Definition nep_bfloat16.c:363
int nc_get_var1_bfloat16(int ncid, int varid, const size_t *indexp, nc_bfloat16_t *ip)
Read one value from a variable as bfloat16.
Definition nep_bfloat16.c:316
int nc_put_vars_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const nc_bfloat16_t *op)
Write a strided hyperslab of a variable from bfloat16 values.
Definition nep_bfloat16.c:272
int nc_put_vara_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, const nc_bfloat16_t *op)
Write a hyperslab of a variable from bfloat16 values.
Definition nep_bfloat16.c:302
int nc_get_vara_float16(int ncid, int varid, const size_t *startp, const size_t *countp, nc_float16_t *ip)
Read a hyperslab of a variable as IEEE 754 float16.
int nc_put_var1_float16(int ncid, int varid, const size_t *indexp, const nc_float16_t *op)
Write one value to a variable as IEEE 754 float16.
int nc_get_vars_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, nc_bfloat16_t *ip)
Read a strided hyperslab of a variable as bfloat16.
Definition nep_bfloat16.c:258
uint16_t nc_bfloat16_t
Definition nep.h:49
uint16_t nc_float16_t
Definition nep.h:66
int nc_get_vara_bfloat16(int ncid, int varid, const size_t *startp, const size_t *countp, nc_bfloat16_t *ip)
Read a hyperslab of a variable as bfloat16.
Definition nep_bfloat16.c:288
int nc_get_vars_float16(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, nc_float16_t *ip)
Read a strided hyperslab of a variable as IEEE 754 float16.