File: fort-nc4.c

package info (click to toggle)
netcdf-fortran 4.4.4%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,420 kB
  • ctags: 8,797
  • sloc: fortran: 51,087; f90: 20,357; sh: 11,601; ansic: 7,034; makefile: 548; pascal: 313; xml: 173
file content (241 lines) | stat: -rw-r--r-- 9,325 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
/*
This file is part of netcdf-4, a netCDF-like interface for HDF5, or a
HDF5 backend for netCDF, depending on your point of view.

This file provides the fortran functions for the new functions added
to the API as part of netCDF-4. This file is only compiled for
netCDF-4 builds.

Copyright 2005, University Corporation for Atmospheric Research. See
COPYRIGHT file for copying and redistribution conditions.

$Id: fort-nc4.c,v 1.55 2010/01/19 18:31:43 ed Exp $
*/

#include <config.h>
#include "netcdf_f.h"
#include <ncfortran.h>
#include <fort-lib.h>


FCALLSCFUN5(NF_INT, nc_create_par_fortran, NF_CREATE_PAR, nf_create_par,
	    STRING, FINT2CINT, FINT2CINT, FINT2CINT, PCINT2FINT)

FCALLSCFUN5(NF_INT, nc_open_par_fortran, NF_OPEN_PAR, nf_open_par,
	    STRING, FINT2CINT, FINT2CINT, FINT2CINT, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_var_par_access, NF_VAR_PAR_ACCESS, nf_var_par_access,
	    NCID, VARID, FINT2CINT)

FCALLSCFUN3(NF_INT, nc_inq_ncid, NF_INQ_NCID, nf_inq_ncid,
	    NCID, STRING, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_inq_grps, NF_INQ_GRPS, nf_inq_grps,
	    NCID, PCINT2FINT, INTV)

FCALLSCFUN2(NF_INT, nc_inq_grpname, NF_INQ_GRPNAME, nf_inq_grpname,
	    NCID, PSTRING)

FCALLSCFUN3(NF_INT, nc_inq_grpname_full, NF_INQ_GRPNAME_FULL, nf_inq_grpname_full,
	    NCID, PSIZET, PSTRING)

FCALLSCFUN2(NF_INT, nc_inq_grpname_len, NF_INQ_GRPNAME_LEN, nf_inq_grpname_len,
	    NCID, PSIZET)

FCALLSCFUN2(NF_INT, nc_inq_grp_parent, NF_INQ_GRP_PARENT, nf_inq_grp_parent,
	    NCID, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_inq_grp_ncid, NF_INQ_GRP_NCID, nf_inq_grp_ncid,
	    NCID, STRING, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_inq_grp_full_ncid, NF_INQ_GRP_FULL_NCID, nf_inq_grp_full_ncid,
	    NCID, STRING, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_inq_varids_f, NF_INQ_VARIDS, nf_inq_varids,
	    NCID, PCINT2FINT, INTV)

FCALLSCFUN4(NF_INT, nc_inq_dimids_f, NF_INQ_DIMIDS, nf_inq_dimids,
	    NCID, PCINT2FINT, INTV, FINT2CINT)

FCALLSCFUN3(NF_INT, nc_inq_typeids, NF_INQ_TYPEIDS, nf_inq_typeids,
	    NCID, PCINT2FINT, INTV)

FCALLSCFUN3(NF_INT, nc_inq_typeid, NF_INQ_TYPEID, nf_inq_typeid,
	    NCID, STRING, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_def_grp, NF_DEF_GRP, nf_def_grp,
	    NCID, STRING, PCINT2FINT)

FCALLSCFUN2(NF_INT, nc_rename_grp, NF_RENAME_GRP, nf_rename_grp,
            NCID, STRING)

FCALLSCFUN4(NF_INT, nc_def_compound, NF_DEF_COMPOUND, nf_def_compound,
	    NCID, FINT2CSIZET, STRING, PCINT2FINT)

FCALLSCFUN5(NF_INT, nc_insert_compound, NF_INSERT_COMPOUND, nf_insert_compound,
	    NCID, FINT2CINT, STRING, FINT2CSIZET, FINT2CINT)

FCALLSCFUN7(NF_INT, nc_insert_array_compound_f, NF_INSERT_ARRAY_COMPOUND, 
	    nf_insert_array_compound,
	    NCID, FINT2CINT, STRING, FINT2CSIZET, 
	    FINT2CINT, FINT2CINT, INTV)

FCALLSCFUN4(NF_INT, nc_inq_type, NF_INQ_TYPE, nf_inq_type,
	    NCID, FINT2CINT, PSTRING, PSIZET)

FCALLSCFUN5(NF_INT, nc_inq_compound, NF_INQ_COMPOUND, nf_inq_compound,
	    NCID, FINT2CINT, STRING, PSIZET, PSIZET)

FCALLSCFUN3(NF_INT, nc_inq_compound_name, NF_INQ_COMPOUND_NAME, nf_inq_compound_name,
	    NCID, FINT2CINT, STRING)

FCALLSCFUN3(NF_INT, nc_inq_compound_size, NF_INQ_COMPOUND_SIZE, nf_inq_compound_size,
	    NCID, FINT2CINT, PSIZET)

FCALLSCFUN3(NF_INT, nc_inq_compound_nfields, NF_INQ_COMPOUND_NFIELDS, 
	    nf_inq_compound_nfields,
	    NCID, FINT2CINT, PSIZET)

FCALLSCFUN8(NF_INT, nc_inq_compound_field_f, NF_INQ_COMPOUND_FIELD, 
	    nf_inq_compound_field,
	    NCID, FINT2CINT, VARID, PSTRING, PSIZET, PCINT2FINT, 
	    PCINT2FINT, INTV)

FCALLSCFUN4(NF_INT, nc_inq_compound_fieldname, NF_INQ_COMPOUND_FIELDNAME, 
	    nf_inq_compound_fieldname,
	    NCID, FINT2CINT, FIELDIDX, PSTRING)

FCALLSCFUN4(NF_INT, nc_inq_compound_fieldindex, NF_INQ_COMPOUND_FIELDINDEX, 
	    nf_inq_compound_fieldindex,
	    NCID, FINT2CINT, STRING, PCNDX2FNDX)

FCALLSCFUN4(NF_INT, nc_inq_compound_fieldoffset, NF_INQ_COMPOUND_FIELDOFFSET, 
	    nf_inq_compound_fieldoffset,
	    NCID, FINT2CINT, FIELDIDX, PSIZET)

FCALLSCFUN4(NF_INT, nc_inq_compound_fieldtype, NF_INQ_COMPOUND_FIELDTYPE, 
	    nf_inq_compound_fieldtype,
	    NCID, FINT2CINT, FIELDIDX, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_inq_compound_fieldndims, NF_INQ_COMPOUND_FIELDNDIMS, 
	    nf_inq_compound_fieldndims,
	    NCID, FINT2CINT, FIELDIDX, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_inq_compound_fielddim_sizes, NF_INQ_COMPOUND_FIELDDIM_SIZES, 
	    nf_inq_compound_fielddim_sizes,
	    NCID, FINT2CINT, FIELDIDX, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_def_vlen, NF_DEF_VLEN, nf_def_vlen,
	    NCID, STRING, FINT2CINT, PCINT2FINT)

FCALLSCFUN5(NF_INT, nc_inq_vlen, NF_INQ_VLEN, nf_inq_vlen,
	    NCID, FINT2CINT, PSTRING, PSIZET, PCINT2FINT)

FCALLSCFUN7(NF_INT, nc_inq_user_type, NF_INQ_USER_TYPE, nf_inq_user_type,
	    NCID, FINT2CINT, PSTRING, PSIZET, PCINT2FINT, PSIZET, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_def_enum, NF_DEF_ENUM, nf_def_enum,
	    NCID, FINT2CINT, STRING, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_insert_enum, NF_INSERT_ENUM, nf_insert_enum,
	    NCID, FINT2CINT, STRING, PVOID)

FCALLSCFUN6(NF_INT, nc_inq_enum, NF_INQ_ENUM, nf_inq_enum,
	    NCID, FINT2CINT, STRING, PCINT2FINT, PSIZET, PSIZET)

FCALLSCFUN5(NF_INT, nc_inq_enum_member, NF_INQ_ENUM_MEMBER, nf_inq_enum_member,
	    NCID, FINT2CINT, FNDX2CNDX, PSTRING, PVOID)

FCALLSCFUN4(NF_INT, nc_inq_enum_ident, NF_INQ_ENUM_IDENT, nf_inq_enum_ident,
	    NCID, FINT2CINT, FINT2CINT, PSTRING)

FCALLSCFUN4(NF_INT, nc_def_opaque, NF_DEF_OPAQUE, nf_def_opaque,
	    NCID, FINT2CSIZET, STRING, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_inq_opaque, NF_INQ_OPAQUE, nf_inq_opaque,
	    NCID, FINT2CSIZET, STRING, PSIZET)

FCALLSCFUN4(NF_INT, nc_def_var_chunking_ints, NF_DEF_VAR_CHUNKING, nf_def_var_chunking,
	    NCID, VARID, FINT2CINT, CHUNKSIZES)

FCALLSCFUN5(NF_INT, nc_def_var_deflate, NF_DEF_VAR_DEFLATE, nf_def_var_deflate,
	    NCID, VARID, FINT2CINT, FINT2CINT, FINT2CINT)

FCALLSCFUN4(NF_INT, nc_def_var_fill, NF_DEF_VAR_FILL, nf_def_var_fill,
	    NCID, VARID, FINT2CINT, PVOID)

FCALLSCFUN4(NF_INT, nc_inq_var_fill, NF_INQ_VAR_FILL, nf_inq_var_fill,
	    NCID, VARID, PCINT2FINT, PVOID)

FCALLSCFUN3(NF_INT, nc_def_var_fletcher32, NF_DEF_VAR_FLETCHER32, nf_def_var_fletcher32,
	    NCID, VARID, FINT2CINT)

FCALLSCFUN4(NF_INT, nc_inq_var_chunking_ints, NF_INQ_VAR_CHUNKING, nf_inq_var_chunking,
	    NCID, VARID, PCINT2FINT, PCHUNKSIZES)

FCALLSCFUN5(NF_INT, nc_inq_var_deflate, NF_INQ_VAR_DEFLATE, nf_inq_var_deflate,
	    NCID, VARID, PCINT2FINT, PCINT2FINT, PCINT2FINT)

FCALLSCFUN4(NF_INT, nc_inq_var_szip, NF_INQ_VAR_SZIP, nf_inq_var_szip,
	    NCID, VARID, PCINT2FINT, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_inq_var_fletcher32, NF_INQ_VAR_FLETCHER32, nf_inq_var_fletcher32,
	    NCID, VARID, PCINT2FINT)

FCALLSCFUN3(NF_INT, nc_def_var_endian, NF_DEF_VAR_ENDIAN, nf_def_var_endian,
	    NCID, VARID, FINT2CINT)

FCALLSCFUN3(NF_INT, nc_inq_var_endian, NF_INQ_VAR_ENDIAN, nf_inq_var_endian,
	    NCID, VARID, PCINT2FINT)

FCALLSCFUN6(NF_INT, nc_put_att, NF_PUT_ATT, nf_put_att,
	    NCID, VARID, STRING, FINT2CINT, FINT2CSIZET, PVOID)

FCALLSCFUN4(NF_INT, nc_get_att, NF_GET_ATT, nf_get_att,
	    NCID, VARID, STRING, PVOID)

FCALLSCFUN5(NF_INT, nc_put_vlen_element, NF_PUT_VLEN_ELEMENT, nf_put_vlen_element,
	    NCID, FINT2CINT, PVOID, FINT2CSIZET, PVOID)

FCALLSCFUN5(NF_INT, nc_get_vlen_element, NF_GET_VLEN_ELEMENT, nf_get_vlen_element,
	    NCID, FINT2CINT, PVOID, PSIZET, PVOID)

FCALLSCFUN1(NF_INT, nc_free_vlen, NF_FREE_VLEN, nf_free_vlen, PVOID)
FCALLSCFUN2(NF_INT, nc_free_vlens, NF_FREE_VLENS, nf_free_vlens, FINT2CSIZET, PVOID)
FCALLSCFUN2(NF_INT, nc_free_string, NF_FREE_STRING, nf_free_string, FINT2CSIZET, PVOID)

FCALLSCFUN4(NF_INT, nc_put_var1_longlong, NF_PUT_VAR1_INT64, nf_put_var1_int64,
	    NCID, VARID, COORDS, INTVAR)
FCALLSCFUN5(NF_INT, nc_put_vara_longlong, NF_PUT_VARA_INT64, nf_put_vara_int64,
	    NCID, VARID, COORDS, COUNTS, INTVARV)
FCALLSCFUN6(NF_INT, nc_put_vars_longlong, NF_PUT_VARS_INT64, nf_put_vars_int64,
	    NCID, VARID, COORDS, COUNTS, STRIDES, INTVARV)
FCALLSCFUN7(NF_INT, nc_put_varm_longlong, NF_PUT_VARM_INT64, nf_put_varm_int64,
            NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
FCALLSCFUN3(NF_INT, nc_put_var_longlong, NF_PUT_VAR_INT64, nf_put_var_int64,
	    NCID, VARID, PINTVAR)

FCALLSCFUN4(NF_INT, nc_get_var1_longlong, NF_GET_VAR1_INT64, nf_get_var1_int64,
	    NCID, VARID, COORDS, INTVAR)
FCALLSCFUN5(NF_INT, nc_get_vara_longlong, NF_GET_VARA_INT64, nf_get_vara_int64,
	    NCID, VARID, COORDS, COUNTS, INTVARV)
FCALLSCFUN6(NF_INT, nc_get_vars_longlong, NF_GET_VARS_INT64, nf_get_vars_int64,
	    NCID, VARID, COORDS, COUNTS, STRIDES, INTVARV)
FCALLSCFUN7(NF_INT, nc_get_varm_longlong, NF_GET_VARM_INT64, nf_get_varm_int64,
            NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
FCALLSCFUN3(NF_INT, nc_get_var_longlong, NF_GET_VAR_INT64, nf_get_var_int64,
	    NCID, VARID, PINTVAR)

FCALLSCFUN3(NF_INT, nc_set_chunk_cache_ints, NF_SET_CHUNK_CACHE, nf_set_chunk_cache,
	    INT, INT, INT)
FCALLSCFUN3(NF_INT, nc_get_chunk_cache_ints, NF_GET_CHUNK_CACHE, nf_get_chunk_cache,
	    PINT, PINT, PINT)

FCALLSCFUN5(NF_INT, nc_set_var_chunk_cache_ints, NF_SET_VAR_CHUNK_CACHE, nf_set_var_chunk_cache,
	    NCID, VARID, INT, INT, INT)
FCALLSCFUN5(NF_INT, nc_get_var_chunk_cache_ints, NF_GET_VAR_CHUNK_CACHE, nf_get_var_chunk_cache,
	    NCID, VARID, PINT, PINT, PINT)