forked from CESM-Development/cime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on netcdf integration layer!
- Loading branch information
1 parent
df9d5ed
commit fb66aa3
Showing
4 changed files
with
210 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/** | ||
* @file | ||
* @internal Dispatch layer for netcdf PIO integration. | ||
* | ||
* @author Ed Hartnett | ||
*/ | ||
|
||
#include "config.h" | ||
#include <stdlib.h> | ||
#include "ncintdispatch.h" | ||
|
||
/* This is the dispatch object that holds pointers to all the | ||
* functions that make up the NCINT dispatch interface. */ | ||
static const NC_Dispatch NCINT_dispatcher = { | ||
|
||
NC_FORMATX_NC_HDF4, | ||
|
||
NC_RO_create, | ||
NC_NCINT_open, | ||
|
||
NC_RO_redef, | ||
NC_RO__enddef, | ||
NC_RO_sync, | ||
NC_NCINT_abort, | ||
NC_NCINT_close, | ||
NC_RO_set_fill, | ||
NC_NOTNC3_inq_base_pe, | ||
NC_NOTNC3_set_base_pe, | ||
NC_NCINT_inq_format, | ||
NC_NCINT_inq_format_extended, | ||
|
||
NC4_inq, | ||
NC4_inq_type, | ||
|
||
NC_RO_def_dim, | ||
NC4_inq_dimid, | ||
NC4_inq_dim, | ||
NC4_inq_unlimdim, | ||
NC_RO_rename_dim, | ||
|
||
NC4_inq_att, | ||
NC4_inq_attid, | ||
NC4_inq_attname, | ||
NC_RO_rename_att, | ||
NC_RO_del_att, | ||
NC4_get_att, | ||
NC_RO_put_att, | ||
|
||
NC_RO_def_var, | ||
NC4_inq_varid, | ||
NC_RO_rename_var, | ||
NC_NCINT_get_vara, | ||
NC_RO_put_vara, | ||
NCDEFAULT_get_vars, | ||
NCDEFAULT_put_vars, | ||
NCDEFAULT_get_varm, | ||
NCDEFAULT_put_varm, | ||
|
||
NC4_inq_var_all, | ||
|
||
NC_NOTNC4_var_par_access, | ||
NC_RO_def_var_fill, | ||
|
||
NC4_show_metadata, | ||
NC4_inq_unlimdims, | ||
|
||
NC4_inq_ncid, | ||
NC4_inq_grps, | ||
NC4_inq_grpname, | ||
NC4_inq_grpname_full, | ||
NC4_inq_grp_parent, | ||
NC4_inq_grp_full_ncid, | ||
NC4_inq_varids, | ||
NC4_inq_dimids, | ||
NC4_inq_typeids, | ||
NC4_inq_type_equal, | ||
NC_NOTNC4_def_grp, | ||
NC_NOTNC4_rename_grp, | ||
NC4_inq_user_type, | ||
NC4_inq_typeid, | ||
|
||
NC_NOTNC4_def_compound, | ||
NC_NOTNC4_insert_compound, | ||
NC_NOTNC4_insert_array_compound, | ||
NC_NOTNC4_inq_compound_field, | ||
NC_NOTNC4_inq_compound_fieldindex, | ||
NC_NOTNC4_def_vlen, | ||
NC_NOTNC4_put_vlen_element, | ||
NC_NOTNC4_get_vlen_element, | ||
NC_NOTNC4_def_enum, | ||
NC_NOTNC4_insert_enum, | ||
NC_NOTNC4_inq_enum_member, | ||
NC_NOTNC4_inq_enum_ident, | ||
NC_NOTNC4_def_opaque, | ||
NC_NOTNC4_def_var_deflate, | ||
NC_NOTNC4_def_var_fletcher32, | ||
NC_NOTNC4_def_var_chunking, | ||
NC_NOTNC4_def_var_endian, | ||
NC_NOTNC4_def_var_filter, | ||
NC_NOTNC4_set_var_chunk_cache, | ||
NC_NOTNC4_get_var_chunk_cache | ||
}; | ||
|
||
const NC_Dispatch* NCINT_dispatch_table = NULL; | ||
|
||
/** | ||
* @internal Initialize NCINT dispatch layer. | ||
* | ||
* @return ::NC_NOERR No error. | ||
* @author Ed Hartnett | ||
*/ | ||
int | ||
NC_NCINT_initialize(void) | ||
{ | ||
NCINT_dispatch_table = &NCINT_dispatcher; | ||
return NC_NOERR; | ||
} | ||
|
||
/** | ||
* @internal Finalize NCINT dispatch layer. | ||
* | ||
* @return ::NC_NOERR No error. | ||
* @author Ed Hartnett | ||
*/ | ||
int | ||
NC_NCINT_finalize(void) | ||
{ | ||
return NC_NOERR; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* @file @internal This header file contains the prototypes for the | ||
* PIO netCDF integration layer. | ||
* | ||
* Ed Hartnett | ||
*/ | ||
#ifndef _NCINTDISPATCH_H | ||
#define _NCINTDISPATCH_H | ||
|
||
#include "config.h" | ||
#include "ncdispatch.h" | ||
#include "nc4dispatch.h" | ||
|
||
/** This is the max size of an SD dataset name in HDF4 (from HDF4 | ||
* documentation).*/ | ||
#define NC_MAX_HDF4_NAME 64 | ||
|
||
/** This is the max number of dimensions for a HDF4 SD dataset (from | ||
* HDF4 documentation). */ | ||
#define NC_MAX_HDF4_DIMS 32 | ||
|
||
/* Stuff below is for hdf4 files. */ | ||
typedef struct NC_VAR_HDF4_INFO | ||
{ | ||
int sdsid; | ||
int hdf4_data_type; | ||
} NC_VAR_HDF4_INFO_T; | ||
|
||
typedef struct NC_HDF4_FILE_INFO | ||
{ | ||
int sdid; | ||
} NC_HDF4_FILE_INFO_T; | ||
|
||
#if defined(__cplusplus) | ||
extern "C" { | ||
#endif | ||
|
||
extern int | ||
NC_NCINT_open(const char *path, int mode, int basepe, size_t *chunksizehintp, | ||
void *parameters, const NC_Dispatch *, NC *); | ||
|
||
extern int | ||
NC_NCINT_abort(int ncid); | ||
|
||
extern int | ||
NC_NCINT_close(int ncid, void *ignore); | ||
|
||
extern int | ||
NC_NCINT_inq_format(int ncid, int *formatp); | ||
|
||
extern int | ||
NC_NCINT_inq_format_extended(int ncid, int *formatp, int *modep); | ||
|
||
extern int | ||
NC_NCINT_get_vara(int ncid, int varid, const size_t *start, const size_t *count, | ||
void *value, nc_type); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif /*_NCINTDISPATCH_H */ |