source: XIOS/dev/dev_cmip6_omp/extern/src_netcdf4/ncd3dispatch.c @ 1606

Last change on this file since 1606 was 409, checked in by ymipsl, 11 years ago

Add improved nectdf internal library src

YM

  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1/*********************************************************************
2 *   Copyright 1993, UCAR/Unidata
3 *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
4 *   $Header: /upc/share/CVS/netcdf-3/libncdap3/ncd3dispatch.c,v 1.7 2010/05/27 21:34:09 dmh Exp $
5 *********************************************************************/
6
7#include "config.h"
8#include <stdlib.h>
9#include <string.h>
10
11#include "nc.h"
12#include "ncdap3.h"
13#include "ncdispatch.h"
14#include "ncd3dispatch.h"
15
16static int
17NCD3_create(const char *path, int cmode,
18           size_t initialsz, int basepe, size_t *chunksizehintp,
19           int use_parallel, void* mpidata,
20           NC_Dispatch*,NC** ncp);
21
22static int NCD3_redef(int ncid);
23static int NCD3__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align);
24static int NCD3_sync(int ncid);
25static int NCD3_abort(int ncid);
26
27static int NCD3_put_vara(int ncid, int varid,
28            const size_t *start, const size_t *edges0,
29            const void *value0,
30            nc_type memtype);
31
32static int NCD3_get_vara(int ncid, int varid,
33            const size_t *start, const size_t *edges,
34            void *value,
35            nc_type memtype);
36
37static int NCD3_put_vars(int ncid, int varid,
38            const size_t *start, const size_t *edges, const ptrdiff_t* stride,
39            const void *value0, nc_type memtype);
40
41static int NCD3_get_vars(int ncid, int varid,
42            const size_t *start, const size_t *edges, const ptrdiff_t* stride,
43            void *value, nc_type memtype);
44
45NC_Dispatch NCD3_dispatch_base = {
46
47NC_DISPATCH_NC3 | NC_DISPATCH_NCD,
48
49/* Note: we are using the standard substrate struct NC creator */
50NULL,
51
52NCD3_create,
53NCD3_open,
54
55NCD3_redef,
56NCD3__enddef,
57NCD3_sync,
58NCD3_abort,
59NCD3_close,
60NULL, /*set_fill*/
61NULL, /*inq_base_pe*/
62NULL, /*set_base_pe*/
63NULL, /*inq_format*/
64
65NULL, /*inq*/
66NULL, /*inq_type*/
67
68NULL, /*def_dim*/
69NULL, /*inq_dimid*/
70NULL, /*inq_dim*/
71NULL, /*inq_unlimdim*/
72NULL, /*rename_dim*/
73
74NULL, /*inq_att*/
75NULL, /*inq_attid*/
76NULL, /*inq_attname*/
77NULL, /*rename_att*/
78NULL, /*del_att*/
79NULL, /*get_att*/
80NULL, /*put_att*/
81
82NULL, /*def_var*/
83NULL, /*inq_varid*/
84NULL, /*rename_var*/
85NCD3_get_vara,
86NCD3_put_vara,
87NCD3_get_vars,
88NCD3_put_vars,
89NCDEFAULT_get_varm,
90NCDEFAULT_put_varm,
91
92NULL, /*inq_var_all*/
93
94#ifdef USE_NETCDF4
95NULL, /*show_metadata*/
96NULL, /*inq_unlimdims*/
97NULL, /*var_par_access*/
98NULL, /*inq_ncid*/
99NULL, /*inq_grps*/
100NULL, /*inq_grpname*/
101NULL, /*inq_grpname_full*/
102NULL, /*inq_grp_parent*/
103NULL, /*inq_grp_full_ncid*/
104NULL, /*inq_varids*/
105NULL, /*inq_dimids*/
106NULL, /*inq_typeids*/
107NULL, /*inq_type_equal*/
108NULL, /*def_grp*/
109NULL, /*inq_user_type*/
110NULL, /*inq_typeid*/
111
112NULL, /*def_compound*/
113NULL, /*insert_compound*/
114NULL, /*insert_array_compound*/
115NULL, /*inq_compound_field*/
116NULL, /*inq_compound_fieldindex*/
117NULL, /*def_vlen*/
118NULL, /*put_vlen_element*/
119NULL, /*get_vlen_element*/
120NULL, /*def_enum*/
121NULL, /*insert_enum*/
122NULL, /*inq_enum_member*/
123NULL, /*inq_enum_ident*/
124NULL, /*def_opaque*/
125NULL, /*def_var_deflate*/
126NULL, /*def_var_fletcher32*/
127NULL, /*def_var_chunking*/
128NULL, /*def_var_fill*/
129NULL, /*def_var_endian*/
130NULL, /*set_var_chunk_cache*/
131NULL, /*get_var_chunk_cache*/
132
133#endif /*USE_NETCDF4*/
134
135};
136
137NC_Dispatch* NCD3_dispatch_table = NULL; /* moved here from ddispatch.c */
138
139NC_Dispatch NCD3_dispatcher; /* overlay result */
140
141int
142NCD3_initialize(void)
143{
144    /* Create our dispatch table as the merge of NCD3 table and NCSUBSTRATE */
145    /* watch the order because we want NCD3 to overwrite NCSUBSTRATE */
146    NC_dispatch_overlay(&NCD3_dispatch_base, NCSUBSTRATE_dispatch_table, &NCD3_dispatcher);   
147    NCD3_dispatch_table = &NCD3_dispatcher;
148    return NC_NOERR;
149}
150
151static int
152NCD3_redef(int ncid)
153{
154    return (NC_EPERM);
155}
156
157static int
158NCD3__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align)
159{
160    return (NC_EPERM);
161}
162
163static int
164NCD3_sync(int ncid)
165{
166    return (NC_EINVAL);
167}
168
169static int
170NCD3_abort(int ncid)
171{
172    return NCD3_close(ncid);
173}
174
175static int
176NCD3_create(const char *path, int cmode,
177           size_t initialsz, int basepe, size_t *chunksizehintp,
178           int use_parallel, void* mpidata,
179           NC_Dispatch* dispatch, NC** ncp)
180{
181   return NC_EPERM;
182}
183
184static int
185NCD3_put_vara(int ncid, int varid,
186            const size_t *start, const size_t *edges,
187            const void *value,
188            nc_type memtype)
189{
190    return NC_EPERM;
191}
192
193static int
194NCD3_get_vara(int ncid, int varid,
195            const size_t *start, const size_t *edges,
196            void *value,
197            nc_type memtype)
198{
199    int stat = nc3d_getvarx(ncid, varid, start, edges, nc_ptrdiffvector1, value,memtype);
200    return stat;
201}
202
203static int
204NCD3_put_vars(int ncid, int varid,
205            const size_t *start, const size_t *edges, const ptrdiff_t* stride,
206            const void *value0, nc_type memtype)
207{
208    return NC_EPERM;
209}
210
211static int
212NCD3_get_vars(int ncid, int varid,
213            const size_t *start, const size_t *edges, const ptrdiff_t* stride,
214            void *value, nc_type memtype)
215{
216    int stat = nc3d_getvarx(ncid, varid, start, edges, stride, value, memtype);
217    return stat;
218}
Note: See TracBrowser for help on using the repository browser.