mo_cdi.f90 326 KB
Newer Older
1
2
! >>> Warning: This is a generated file. If you modify it, you get what you deserve. <<<
!
Thomas Jahns's avatar
Thomas Jahns committed
3
! Generated by "interfaces/f2003/bindGen.rb" from input file "src/cdi.h".
Uwe Schulzweida's avatar
Uwe Schulzweida committed
4
5

module mo_cdi
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
  use iso_c_binding
  implicit none
  private

  public ctrim
  public c_len

  interface
    integer(c_size_t) function lib_strlen(charPtr) bind(c, name = "strlen")
      import c_size_t, c_ptr
      type(c_ptr), value :: charPtr
    end function lib_strlen

    subroutine lib_free(pointer) bind(c, name = "free")
      import c_ptr
      type(c_ptr), value :: pointer
    end subroutine lib_free
  end interface

  integer(c_int), public, parameter :: CDI_MAX_NAME = 256
  integer(c_int), public, parameter :: CDI_UNDEFID = -1
  integer(c_int), public, parameter :: CDI_GLOBAL = -1
  integer(c_int), public, parameter :: CDI_BIGENDIAN = 0
  integer(c_int), public, parameter :: CDI_LITTLEENDIAN = 1
  integer(c_int), public, parameter :: CDI_REAL = 1
  integer(c_int), public, parameter :: CDI_COMP = 2
  integer(c_int), public, parameter :: CDI_BOTH = 3
  integer(c_int), public, parameter :: CDI_NOERR = 0
  integer(c_int), public, parameter :: CDI_EEOF = -1
  integer(c_int), public, parameter :: CDI_ESYSTEM = -10
  integer(c_int), public, parameter :: CDI_EINVAL = -20
  integer(c_int), public, parameter :: CDI_EUFTYPE = -21
  integer(c_int), public, parameter :: CDI_ELIBNAVAIL = -22
  integer(c_int), public, parameter :: CDI_EUFSTRUCT = -23
  integer(c_int), public, parameter :: CDI_EUNC4 = -24
  integer(c_int), public, parameter :: CDI_ELIMIT = -99
  integer(c_int), public, parameter :: FILETYPE_UNDEF = -1
  integer(c_int), public, parameter :: FILETYPE_GRB = 1
  integer(c_int), public, parameter :: FILETYPE_GRB2 = 2
  integer(c_int), public, parameter :: FILETYPE_NC = 3
  integer(c_int), public, parameter :: FILETYPE_NC2 = 4
  integer(c_int), public, parameter :: FILETYPE_NC4 = 5
  integer(c_int), public, parameter :: FILETYPE_NC4C = 6
  integer(c_int), public, parameter :: FILETYPE_SRV = 7
  integer(c_int), public, parameter :: FILETYPE_EXT = 8
  integer(c_int), public, parameter :: FILETYPE_IEG = 9
  integer(c_int), public, parameter :: COMPRESS_NONE = 0
  integer(c_int), public, parameter :: COMPRESS_SZIP = 1
  integer(c_int), public, parameter :: COMPRESS_GZIP = 2
  integer(c_int), public, parameter :: COMPRESS_BZIP2 = 3
  integer(c_int), public, parameter :: COMPRESS_ZIP = 4
  integer(c_int), public, parameter :: COMPRESS_JPEG = 5
  integer(c_int), public, parameter :: DATATYPE_PACK = 0
  integer(c_int), public, parameter :: DATATYPE_PACK1 = 1
  integer(c_int), public, parameter :: DATATYPE_PACK2 = 2
  integer(c_int), public, parameter :: DATATYPE_PACK3 = 3
  integer(c_int), public, parameter :: DATATYPE_PACK4 = 4
  integer(c_int), public, parameter :: DATATYPE_PACK5 = 5
  integer(c_int), public, parameter :: DATATYPE_PACK6 = 6
  integer(c_int), public, parameter :: DATATYPE_PACK7 = 7
  integer(c_int), public, parameter :: DATATYPE_PACK8 = 8
  integer(c_int), public, parameter :: DATATYPE_PACK9 = 9
  integer(c_int), public, parameter :: DATATYPE_PACK10 = 10
  integer(c_int), public, parameter :: DATATYPE_PACK11 = 11
  integer(c_int), public, parameter :: DATATYPE_PACK12 = 12
  integer(c_int), public, parameter :: DATATYPE_PACK13 = 13
  integer(c_int), public, parameter :: DATATYPE_PACK14 = 14
  integer(c_int), public, parameter :: DATATYPE_PACK15 = 15
  integer(c_int), public, parameter :: DATATYPE_PACK16 = 16
  integer(c_int), public, parameter :: DATATYPE_PACK17 = 17
  integer(c_int), public, parameter :: DATATYPE_PACK18 = 18
  integer(c_int), public, parameter :: DATATYPE_PACK19 = 19
  integer(c_int), public, parameter :: DATATYPE_PACK20 = 20
  integer(c_int), public, parameter :: DATATYPE_PACK21 = 21
  integer(c_int), public, parameter :: DATATYPE_PACK22 = 22
  integer(c_int), public, parameter :: DATATYPE_PACK23 = 23
  integer(c_int), public, parameter :: DATATYPE_PACK24 = 24
  integer(c_int), public, parameter :: DATATYPE_PACK25 = 25
  integer(c_int), public, parameter :: DATATYPE_PACK26 = 26
  integer(c_int), public, parameter :: DATATYPE_PACK27 = 27
  integer(c_int), public, parameter :: DATATYPE_PACK28 = 28
  integer(c_int), public, parameter :: DATATYPE_PACK29 = 29
  integer(c_int), public, parameter :: DATATYPE_PACK30 = 30
  integer(c_int), public, parameter :: DATATYPE_PACK31 = 31
  integer(c_int), public, parameter :: DATATYPE_PACK32 = 32
  integer(c_int), public, parameter :: DATATYPE_CPX32 = 64
  integer(c_int), public, parameter :: DATATYPE_CPX64 = 128
  integer(c_int), public, parameter :: DATATYPE_FLT32 = 132
  integer(c_int), public, parameter :: DATATYPE_FLT64 = 164
  integer(c_int), public, parameter :: DATATYPE_INT8 = 208
  integer(c_int), public, parameter :: DATATYPE_INT16 = 216
  integer(c_int), public, parameter :: DATATYPE_INT32 = 232
  integer(c_int), public, parameter :: DATATYPE_UINT8 = 308
  integer(c_int), public, parameter :: DATATYPE_UINT16 = 316
  integer(c_int), public, parameter :: DATATYPE_UINT32 = 332
  integer(c_int), public, parameter :: DATATYPE_INT = 251
  integer(c_int), public, parameter :: DATATYPE_FLT = 252
  integer(c_int), public, parameter :: DATATYPE_TXT = 253
  integer(c_int), public, parameter :: DATATYPE_CPX = 254
  integer(c_int), public, parameter :: DATATYPE_UCHAR = 255
  integer(c_int), public, parameter :: DATATYPE_LONG = 256
  integer(c_int), public, parameter :: CHUNK_AUTO = 1
  integer(c_int), public, parameter :: CHUNK_GRID = 2
  integer(c_int), public, parameter :: CHUNK_LINES = 3
  integer(c_int), public, parameter :: GRID_GENERIC = 1
  integer(c_int), public, parameter :: GRID_GAUSSIAN = 2
  integer(c_int), public, parameter :: GRID_GAUSSIAN_REDUCED = 3
  integer(c_int), public, parameter :: GRID_LONLAT = 4
  integer(c_int), public, parameter :: GRID_SPECTRAL = 5
  integer(c_int), public, parameter :: GRID_FOURIER = 6
  integer(c_int), public, parameter :: GRID_GME = 7
  integer(c_int), public, parameter :: GRID_TRAJECTORY = 8
  integer(c_int), public, parameter :: GRID_UNSTRUCTURED = 9
  integer(c_int), public, parameter :: GRID_CURVILINEAR = 10
  integer(c_int), public, parameter :: GRID_LCC = 11
  integer(c_int), public, parameter :: GRID_LCC2 = 12
  integer(c_int), public, parameter :: GRID_LAEA = 13
  integer(c_int), public, parameter :: GRID_SINUSOIDAL = 14
  integer(c_int), public, parameter :: GRID_PROJECTION = 15
  integer(c_int), public, parameter :: ZAXIS_SURFACE = 0
  integer(c_int), public, parameter :: ZAXIS_GENERIC = 1
  integer(c_int), public, parameter :: ZAXIS_HYBRID = 2
  integer(c_int), public, parameter :: ZAXIS_HYBRID_HALF = 3
  integer(c_int), public, parameter :: ZAXIS_PRESSURE = 4
  integer(c_int), public, parameter :: ZAXIS_HEIGHT = 5
  integer(c_int), public, parameter :: ZAXIS_DEPTH_BELOW_SEA = 6
  integer(c_int), public, parameter :: ZAXIS_DEPTH_BELOW_LAND = 7
  integer(c_int), public, parameter :: ZAXIS_ISENTROPIC = 8
  integer(c_int), public, parameter :: ZAXIS_TRAJECTORY = 9
  integer(c_int), public, parameter :: ZAXIS_ALTITUDE = 10
  integer(c_int), public, parameter :: ZAXIS_SIGMA = 11
  integer(c_int), public, parameter :: ZAXIS_MEANSEA = 12
  integer(c_int), public, parameter :: ZAXIS_TOA = 13
  integer(c_int), public, parameter :: ZAXIS_SEA_BOTTOM = 14
  integer(c_int), public, parameter :: ZAXIS_ATMOSPHERE = 15
  integer(c_int), public, parameter :: ZAXIS_CLOUD_BASE = 16
  integer(c_int), public, parameter :: ZAXIS_CLOUD_TOP = 17
  integer(c_int), public, parameter :: ZAXIS_ISOTHERM_ZERO = 18
  integer(c_int), public, parameter :: ZAXIS_SNOW = 19
  integer(c_int), public, parameter :: ZAXIS_LAKE_BOTTOM = 20
  integer(c_int), public, parameter :: ZAXIS_SEDIMENT_BOTTOM = 21
  integer(c_int), public, parameter :: ZAXIS_SEDIMENT_BOTTOM_TA = 22
  integer(c_int), public, parameter :: ZAXIS_SEDIMENT_BOTTOM_TW = 23
  integer(c_int), public, parameter :: ZAXIS_MIX_LAYER = 24
  integer(c_int), public, parameter :: ZAXIS_REFERENCE = 25
  integer(c_int), public, parameter :: MAX_KV_PAIRS_MATCH = 10
  integer(c_int), public, parameter :: TIME_CONSTANT = 0
  integer(c_int), public, parameter :: TIME_VARIABLE = 1
  integer(c_int), public, parameter :: TSTEP_CONSTANT = 0
  integer(c_int), public, parameter :: TSTEP_INSTANT = 1
  integer(c_int), public, parameter :: TSTEP_AVG = 2
  integer(c_int), public, parameter :: TSTEP_ACCUM = 3
  integer(c_int), public, parameter :: TSTEP_MAX = 4
  integer(c_int), public, parameter :: TSTEP_MIN = 5
  integer(c_int), public, parameter :: TSTEP_DIFF = 6
  integer(c_int), public, parameter :: TSTEP_RMS = 7
  integer(c_int), public, parameter :: TSTEP_SD = 8
  integer(c_int), public, parameter :: TSTEP_COV = 9
  integer(c_int), public, parameter :: TSTEP_RATIO = 10
  integer(c_int), public, parameter :: TSTEP_RANGE = 11
  integer(c_int), public, parameter :: TSTEP_INSTANT2 = 12
  integer(c_int), public, parameter :: TSTEP_INSTANT3 = 13
  integer(c_int), public, parameter :: TAXIS_ABSOLUTE = 1
  integer(c_int), public, parameter :: TAXIS_RELATIVE = 2
  integer(c_int), public, parameter :: TAXIS_FORECAST = 3
  integer(c_int), public, parameter :: TUNIT_SECOND = 1
  integer(c_int), public, parameter :: TUNIT_MINUTE = 2
  integer(c_int), public, parameter :: TUNIT_QUARTER = 3
  integer(c_int), public, parameter :: TUNIT_30MINUTES = 4
  integer(c_int), public, parameter :: TUNIT_HOUR = 5
  integer(c_int), public, parameter :: TUNIT_3HOURS = 6
  integer(c_int), public, parameter :: TUNIT_6HOURS = 7
  integer(c_int), public, parameter :: TUNIT_12HOURS = 8
  integer(c_int), public, parameter :: TUNIT_DAY = 9
  integer(c_int), public, parameter :: TUNIT_MONTH = 10
  integer(c_int), public, parameter :: TUNIT_YEAR = 11
  integer(c_int), public, parameter :: CALENDAR_STANDARD = 0
  integer(c_int), public, parameter :: CALENDAR_PROLEPTIC = 1
  integer(c_int), public, parameter :: CALENDAR_360DAYS = 2
  integer(c_int), public, parameter :: CALENDAR_365DAYS = 3
  integer(c_int), public, parameter :: CALENDAR_366DAYS = 4
  integer(c_int), public, parameter :: CALENDAR_NONE = 5
  integer(c_int), public, parameter :: CDI_UUID_SIZE = 16

  public t_CdiParam
  type, bind(c) :: t_CdiParam
    integer(c_int) :: discipline
    integer(c_int) :: category
    integer(c_int) :: number
  end type t_CdiParam

  public t_CdiIterator
  type t_CdiIterator
    type(c_ptr) :: ptr
  end type t_CdiIterator

  public t_CdiGribIterator
  type t_CdiGribIterator
    type(c_ptr) :: ptr
  end type t_CdiGribIterator
  public cdiReset
  public cdiStringError
  public cdiDebug
  public cdiLibraryVersion
  public cdiPrintVersion
  public cdiHaveFiletype
  public cdiDefMissval
  public cdiInqMissval
  public cdiDefGlobal
  public namespaceNew
  public namespaceSetActive
  public namespaceDelete
  public cdiParamToString
  public cdiDecodeParam
  public cdiEncodeParam
  public cdiDecodeDate
  public cdiEncodeDate
  public cdiDecodeTime
  public cdiEncodeTime
  public cdiGetFiletype
  public streamOpenRead
  public streamOpenWrite
  public streamOpenAppend
  public streamClose
  public streamSync
  public streamDefVlist
  public streamInqVlist
  public streamInqVlistIDorig
  public streamInqFiletype
  public streamDefByteorder
  public streamInqByteorder
  public streamDefCompType
  public streamInqCompType
  public streamDefCompLevel
  public streamInqCompLevel
  public streamDefTimestep
  public streamInqTimestep
  public streamInqCurTimestepID
  public streamFilename
  public streamFilesuffix
  public streamInqNvars
  public streamWriteVar
  public streamWriteVarF
  public streamReadVar
  public streamReadVarF
  public streamWriteVarSlice
  public streamWriteVarSliceF
  public streamReadVarSlice
  public streamReadVarSliceF
  public streamWriteVarChunk
  public streamDefRecord
  public streamInqRecord
  public streamWriteRecord
  public streamWriteRecordF
  public streamReadRecord
  public streamCopyRecord
  public cdiIterator_new
  public cdiIterator_clone
  public cdiIterator_serialize
  public cdiIterator_deserialize
  public cdiIterator_delete
  public cdiIterator_nextField
  public cdiIterator_inqStartTime
  public cdiIterator_inqEndTime
  public cdiIterator_inqVTime
  public cdiIterator_inqLevelType
  public cdiIterator_inqLevel
  public cdiIterator_inqLevelUuid
  public cdiIterator_inqParam
  public cdiIterator_inqDatatype
  public cdiIterator_inqTsteptype
  public cdiIterator_inqVariableName
  public cdiIterator_inqGridId
  public cdiIterator_readField
  public cdiIterator_readFieldF
  public cdiGribIterator_clone
  public cdiGribIterator_delete
  public cdiGribIterator_getLong
  public cdiGribIterator_getDouble
  public cdiGribIterator_getLength
  public cdiGribIterator_getString
  public cdiGribIterator_getSize
  public cdiGribIterator_getLongArray
  public cdiGribIterator_getDoubleArray
  public cdiGribIterator_inqEdition
  public cdiGribIterator_inqLongValue
  public cdiGribIterator_inqLongDefaultValue
  public cdiGribIterator_inqDoubleValue
  public cdiGribIterator_inqDoubleDefaultValue
  public cdiGribIterator_inqStringValue
  public vlistCreate
  public vlistDestroy
  public vlistDuplicate
  public vlistCopy
  public vlistCopyFlag
  public vlistClearFlag
  public vlistCat
  public vlistMerge
  public vlistPrint
  public vlistNumber
  public vlistNvars
  public vlistNgrids
  public vlistNzaxis
  public vlistNsubtypes
  public vlistDefNtsteps
  public vlistNtsteps
  public vlistGridsizeMax
  public vlistGrid
  public vlistGridIndex
  public vlistChangeGridIndex
  public vlistChangeGrid
  public vlistZaxis
  public vlistZaxisIndex
  public vlistChangeZaxisIndex
  public vlistChangeZaxis
  public vlistNrecs
  public vlistSubtype
  public vlistSubtypeIndex
  public vlistDefTaxis
  public vlistInqTaxis
  public vlistDefTable
  public vlistInqTable
  public vlistDefInstitut
  public vlistInqInstitut
  public vlistDefModel
  public vlistInqModel
  public vlistDefVarTiles
  public vlistDefVar
  public vlistChangeVarGrid
  public vlistChangeVarZaxis
  public vlistInqVar
  public vlistInqVarGrid
  public vlistInqVarZaxis
  public vlistInqVarID
  public vlistDefVarTsteptype
  public vlistInqVarTsteptype
  public vlistDefVarCompType
  public vlistInqVarCompType
  public vlistDefVarCompLevel
  public vlistInqVarCompLevel
  public vlistDefVarParam
  public vlistInqVarParam
  public vlistDefVarCode
  public vlistInqVarCode
  public vlistDefVarDatatype
  public vlistInqVarDatatype
  public vlistDefVarChunkType
  public vlistInqVarChunkType
  public vlistDefVarXYZ
  public vlistInqVarXYZ
  public vlistInqVarNumber
  public vlistDefVarInstitut
  public vlistInqVarInstitut
  public vlistDefVarModel
  public vlistInqVarModel
  public vlistDefVarTable
  public vlistInqVarTable
  public vlistDefVarName
  public vlistInqVarName
  public vlistCopyVarName
  public vlistDefVarStdname
  public vlistInqVarStdname
  public vlistDefVarLongname
  public vlistInqVarLongname
  public vlistDefVarUnits
  public vlistInqVarUnits
  public vlistDefVarMissval
  public vlistInqVarMissval
  public vlistDefVarExtra
  public vlistInqVarExtra
  public vlistDefVarScalefactor
  public vlistInqVarScalefactor
  public vlistDefVarAddoffset
  public vlistInqVarAddoffset
  public vlistDefVarTimave
  public vlistInqVarTimave
  public vlistDefVarTimaccu
  public vlistInqVarTimaccu
  public vlistDefVarTypeOfGeneratingProcess
  public vlistInqVarTypeOfGeneratingProcess
  public vlistDefVarProductDefinitionTemplate
  public vlistInqVarProductDefinitionTemplate
  public vlistInqVarSize
  public vlistDefIndex
  public vlistInqIndex
  public vlistDefFlag
  public vlistInqFlag
  public vlistFindVar
  public vlistFindLevel
  public vlistMergedVar
  public vlistMergedLevel
  public vlistDefVarEnsemble
  public vlistInqVarEnsemble
  public cdiClearAdditionalKeys
  public cdiDefAdditionalKey
  public vlistDefVarIntKey
  public vlistDefVarDblKey
  public vlistHasVarKey
  public vlistInqVarDblKey
  public vlistInqVarIntKey
  public vlistInqNatts
  public vlistInqAtt
  public vlistDelAtt
  public vlistDefAttInt
  public vlistDefAttFlt
  public vlistDefAttTxt
  public vlistInqAttInt
  public vlistInqAttFlt
  public vlistInqAttTxt
  public gridName
  public gridNamePtr
  public gridCompress
  public gridDefMaskGME
  public gridInqMaskGME
  public gridDefMask
  public gridInqMask
  public gridPrint
  public gridCreate
  public gridDestroy
  public gridDuplicate
  public gridInqType
  public gridInqSize
  public gridDefXsize
  public gridInqXsize
  public gridDefYsize
  public gridInqYsize
  public gridDefNP
  public gridInqNP
  public gridDefXvals
  public gridInqXvals
  public gridDefYvals
  public gridInqYvals
  public gridDefXname
  public gridInqXname
  public gridDefXlongname
  public gridInqXlongname
  public gridDefXunits
  public gridInqXunits
  public gridDefYname
  public gridInqYname
  public gridDefYlongname
  public gridInqYlongname
  public gridDefYunits
  public gridInqYunits
  public gridInqXstdname
  public gridInqYstdname
  public gridDefPrec
  public gridInqPrec
  public gridInqXval
  public gridInqYval
  public gridInqXinc
  public gridInqYinc
  public gridIsCircular
  public gridIsRotated
  public gridDefXpole
  public gridInqXpole
  public gridDefYpole
  public gridInqYpole
  public gridDefAngle
  public gridInqAngle
  public gridInqTrunc
  public gridDefTrunc
  public gridDefGMEnd
  public gridInqGMEnd
  public gridDefGMEni
  public gridInqGMEni
  public gridDefGMEni2
  public gridInqGMEni2
  public gridDefGMEni3
  public gridInqGMEni3
  public gridDefNumber
  public gridInqNumber
  public gridDefPosition
  public gridInqPosition
  public gridDefReference
  public gridInqReference
  public gridDefUUID
  public gridInqUUID
  public gridDefLCC
  public gridInqLCC
  public gridDefLcc2
  public gridInqLcc2
  public gridDefLaea
  public gridInqLaea
  public gridDefArea
  public gridInqArea
  public gridHasArea
  public gridDefNvertex
  public gridInqNvertex
  public gridDefXbounds
  public gridInqXbounds
  public gridDefYbounds
  public gridInqYbounds
  public gridDefRowlon
  public gridInqRowlon
  public gridChangeType
  public gridDefComplexPacking
  public gridInqComplexPacking
  public zaxisName
  public zaxisCreate
  public zaxisDestroy
  public zaxisInqType
  public zaxisInqSize
  public zaxisDuplicate
  public zaxisResize
  public zaxisPrint
  public zaxisDefLevels
  public zaxisInqLevels
  public zaxisDefLevel
  public zaxisInqLevel
  public zaxisDefNlevRef
  public zaxisInqNlevRef
  public zaxisDefNumber
  public zaxisInqNumber
  public zaxisDefUUID
  public zaxisInqUUID
  public zaxisDefName
  public zaxisInqName
  public zaxisDefLongname
  public zaxisInqLongname
  public zaxisDefUnits
  public zaxisInqUnits
  public zaxisInqStdname
  public zaxisDefPrec
  public zaxisInqPrec
  public zaxisDefPositive
  public zaxisInqPositive
  public zaxisDefLtype
  public zaxisInqLtype
  public zaxisInqLevelsPtr
  public zaxisDefVct
  public zaxisInqVct
  public zaxisInqVctSize
  public zaxisInqVctPtr
  public zaxisDefLbounds
  public zaxisInqLbounds
  public zaxisInqLbound
  public zaxisDefUbounds
  public zaxisInqUbounds
  public zaxisInqUbound
  public zaxisDefWeights
  public zaxisInqWeights
  public zaxisChangeType
  public taxisCreate
  public taxisDestroy
  public taxisDuplicate
  public taxisCopyTimestep
  public taxisDefType
  public taxisDefVdate
  public taxisDefVtime
  public taxisInqVdate
  public taxisInqVtime
  public taxisDefRdate
  public taxisDefRtime
  public taxisInqRdate
  public taxisInqRtime
  public taxisDefFdate
  public taxisDefFtime
  public taxisInqFdate
  public taxisInqFtime
  public taxisHasBounds
  public taxisDeleteBounds
  public taxisDefVdateBounds
  public taxisDefVtimeBounds
  public taxisInqVdateBounds
  public taxisInqVtimeBounds
  public taxisDefCalendar
  public taxisInqCalendar
  public taxisDefTunit
  public taxisInqTunit
  public taxisDefForecastTunit
  public taxisInqForecastTunit
  public taxisDefForecastPeriod
  public taxisInqForecastPeriod
  public taxisDefNumavg
  public taxisInqType
  public taxisInqNumavg
  public tunitNamePtr
  public institutDef
  public institutInq
  public institutInqNumber
  public institutInqCenter
  public institutInqSubcenter
  public institutInqNamePtr
  public institutInqLongnamePtr
  public modelDef
  public modelInq
  public modelInqInstitut
  public modelInqGribID
  public modelInqNamePtr
  public tableWriteC
  public tableWrite
  public tableRead
  public tableDef
  public tableInqNamePtr
  public tableDefEntry
  public tableInq
  public tableInqNumber
  public tableInqNum
  public tableInqModel
  public tableInqPar
  public tableInqParCode
  public tableInqParName
  public tableInqParLongname
  public tableInqParUnits
  public tableInqParNamePtr
  public tableInqParLongnamePtr
  public tableInqParUnitsPtr
  public streamDefHistory
  public streamInqHistorySize
  public streamInqHistoryString
  public subtypeCreate
  public subtypePrint
  public subtypeCompare
  public subtypeInqSize
  public subtypeInqActiveIndex
  public subtypeDefActiveIndex
  public subtypeInqTile
  public vlistInqVarSubtype
  public gribapiLibraryVersion
Uwe Schulzweida's avatar
Uwe Schulzweida committed
626
627

contains
Thomas Jahns's avatar
Thomas Jahns committed
628

629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
  subroutine ctrim(str)
    character(kind = c_char, len = *), intent(inout) :: str
    integer :: i

    do i=1,len(str)
      if (str(i:i) == c_null_char) then
        str(i:len(str)) = ' '
        exit
      end if
    end do
  end subroutine ctrim

  function c_len(s) result(i)
    character(kind = c_char, len = *), intent(in) :: s
    integer :: i

    do i = 1, len(s)
      if (s(i:i) == c_null_char) exit
    end do
    i = i - 1
  end function

  subroutine cdiReset()
    interface
      subroutine lib_cdiReset() bind(c, name = 'cdiReset')
      end subroutine lib_cdiReset
    end interface
    call lib_cdiReset()
  end subroutine cdiReset

  function cdiStringError(cdiErrno_dummy) result(result)
    character(kind = c_char), dimension(:), pointer :: result
    integer(c_int), value :: cdiErrno_dummy
    type(c_ptr) :: ptr
    integer :: shape(1)
    interface
665
666
      type(c_ptr) function lib_cdiStringError(cdiErrno_dummy) bind(c, name =&
      & 'cdiStringError')
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
        import c_int, c_ptr
        integer(c_int), value :: cdiErrno_dummy
      end function lib_cdiStringError
    end interface
    result => null()
    ptr = lib_cdiStringError(cdiErrno_dummy)
    if(c_associated(ptr)) then
      shape(1) = int(lib_strlen(ptr))
      call c_f_pointer(ptr, result, shape)
    end if
  end function cdiStringError

  subroutine cdiDebug(debug_dummy)
    integer(c_int), value :: debug_dummy
    interface
      subroutine lib_cdiDebug(debug_dummy) bind(c, name = 'cdiDebug')
        import c_int
        integer(c_int), value :: debug_dummy
      end subroutine lib_cdiDebug
    end interface
    call lib_cdiDebug(debug_dummy)
  end subroutine cdiDebug

  function cdiLibraryVersion() result(result)
    character(kind = c_char), dimension(:), pointer :: result
    type(c_ptr) :: ptr
    integer :: shape(1)
    interface
695
696
      type(c_ptr) function lib_cdiLibraryVersion() bind(c, name =&
      & 'cdiLibraryVersion')
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
        import c_ptr
      end function lib_cdiLibraryVersion
    end interface
    result => null()
    ptr = lib_cdiLibraryVersion()
    if(c_associated(ptr)) then
      shape(1) = int(lib_strlen(ptr))
      call c_f_pointer(ptr, result, shape)
    end if
  end function cdiLibraryVersion

  subroutine cdiPrintVersion()
    interface
      subroutine lib_cdiPrintVersion() bind(c, name = 'cdiPrintVersion')
      end subroutine lib_cdiPrintVersion
    end interface
    call lib_cdiPrintVersion()
  end subroutine cdiPrintVersion

  function cdiHaveFiletype(filetype_dummy) result(result)
    integer(c_int) :: result
    integer(c_int), value :: filetype_dummy
    interface
720
721
      integer(c_int) function lib_cdiHaveFiletype(filetype_dummy) bind(c, name&
      & = 'cdiHaveFiletype')
722
723
724
725
726
727
728
729
730
731
        import c_int
        integer(c_int), value :: filetype_dummy
      end function lib_cdiHaveFiletype
    end interface
    result = lib_cdiHaveFiletype(filetype_dummy)
  end function cdiHaveFiletype

  subroutine cdiDefMissval(missval_dummy)
    real(c_double), value :: missval_dummy
    interface
732
733
      subroutine lib_cdiDefMissval(missval_dummy) bind(c, name =&
      & 'cdiDefMissval')
734
735
736
737
738
739
740
741
742
743
        import c_double
        real(c_double), value :: missval_dummy
      end subroutine lib_cdiDefMissval
    end interface
    call lib_cdiDefMissval(missval_dummy)
  end subroutine cdiDefMissval

  function cdiInqMissval() result(result)
    real(c_double) :: result
    interface
744
745
      real(c_double) function lib_cdiInqMissval() bind(c, name =&
      & 'cdiInqMissval')
746
747
748
749
750
751
752
753
754
755
756
757
        import c_double
      end function lib_cdiInqMissval
    end interface
    result = lib_cdiInqMissval()
  end function cdiInqMissval

  subroutine cdiDefGlobal(string_dummy, val_dummy)
    character(kind = c_char, len = *), intent(in) :: string_dummy
    integer(c_int), value :: val_dummy
    character(kind = c_char) :: string_temp(len(string_dummy) + 1)
    integer :: string_i
    interface
758
759
      subroutine lib_cdiDefGlobal(string_dummy, val_dummy) bind(c, name =&
      & 'cdiDefGlobal')
760
761
762
763
764
765
        import c_char, c_int
        character(kind = c_char) :: string_dummy(*)
        integer(c_int), value :: val_dummy
      end subroutine lib_cdiDefGlobal
    end interface
    do string_i = 1, len(string_dummy)
Thomas Jahns's avatar
Thomas Jahns committed
766
      string_temp(string_i) = string_dummy(string_i:string_i)
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
    end do
    string_temp(len(string_dummy) + 1) = c_null_char
    call lib_cdiDefGlobal(string_temp, val_dummy)
  end subroutine cdiDefGlobal

  function namespaceNew() result(result)
    integer(c_int) :: result
    interface
      integer(c_int) function lib_namespaceNew() bind(c, name = 'namespaceNew')
        import c_int
      end function lib_namespaceNew
    end interface
    result = lib_namespaceNew()
  end function namespaceNew

  subroutine namespaceSetActive(namespaceID_dummy)
    integer(c_int), value :: namespaceID_dummy
    interface
785
786
      subroutine lib_namespaceSetActive(namespaceID_dummy) bind(c, name =&
      & 'namespaceSetActive')
787
788
789
790
791
792
793
794
795
796
        import c_int
        integer(c_int), value :: namespaceID_dummy
      end subroutine lib_namespaceSetActive
    end interface
    call lib_namespaceSetActive(namespaceID_dummy)
  end subroutine namespaceSetActive

  subroutine namespaceDelete(namespaceID_dummy)
    integer(c_int), value :: namespaceID_dummy
    interface
797
798
      subroutine lib_namespaceDelete(namespaceID_dummy) bind(c, name =&
      & 'namespaceDelete')
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
        import c_int
        integer(c_int), value :: namespaceID_dummy
      end subroutine lib_namespaceDelete
    end interface
    call lib_namespaceDelete(namespaceID_dummy)
  end subroutine namespaceDelete

  subroutine cdiParamToString(param_dummy, paramstr_dummy, maxlen_dummy)
    integer(c_int), value :: param_dummy
    character(kind = c_char, len = *), intent(inout) :: paramstr_dummy
    integer(c_int), value :: maxlen_dummy
    character(kind = c_char) :: paramstr_temp(len(paramstr_dummy))
    integer :: paramstr_i
    logical :: paramstr_padding = .true.
    interface
814
815
      subroutine lib_cdiParamToString(param_dummy, paramstr_dummy,&
      & maxlen_dummy) bind(c, name = 'cdiParamToString')
816
817
818
819
820
821
822
        import c_char, c_int
        integer(c_int), value :: param_dummy
        character(kind = c_char) :: paramstr_dummy(*)
        integer(c_int), value :: maxlen_dummy
      end subroutine lib_cdiParamToString
    end interface
    do paramstr_i = len(paramstr_dummy), 1, -1
823
824
      if(paramstr_dummy(paramstr_i:paramstr_i) /= ' ') paramstr_padding =&
      & .false.
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
      if(paramstr_padding) then
        paramstr_temp(paramstr_i) = c_null_char
      else
        paramstr_temp(paramstr_i) = paramstr_dummy(paramstr_i:paramstr_i)
      end if
    end do
    call lib_cdiParamToString(param_dummy, paramstr_temp, maxlen_dummy)
    paramstr_padding = .false.
    do paramstr_i = 1, len(paramstr_dummy)
      if(paramstr_temp(paramstr_i) == c_null_char) paramstr_padding = .true.
      if(paramstr_padding) then
        paramstr_dummy(paramstr_i:paramstr_i) = ' '
      else
        paramstr_dummy(paramstr_i:paramstr_i) = paramstr_temp(paramstr_i)
      end if
    end do
  end subroutine cdiParamToString

  subroutine cdiDecodeParam(param_dummy, pnum, pcat, pdis)
    integer(c_int), value :: param_dummy
    integer(c_int), optional, intent(inout) :: pnum
    integer(c_int), optional, intent(inout) :: pcat
    integer(c_int), optional, intent(inout) :: pdis
    integer(c_int), target :: pnum_temp
    type(c_ptr) :: pnum_ptr
    integer(c_int), target :: pcat_temp
    type(c_ptr) :: pcat_ptr
    integer(c_int), target :: pdis_temp
    type(c_ptr) :: pdis_ptr
    interface
855
856
      subroutine lib_cdiDecodeParam(param_dummy, pnum, pcat, pdis) bind(c, name&
      & = 'cdiDecodeParam')
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
        import c_int, c_ptr
        integer(c_int), value :: param_dummy
        type(c_ptr), value :: pnum
        type(c_ptr), value :: pcat
        type(c_ptr), value :: pdis
      end subroutine lib_cdiDecodeParam
    end interface
    pnum_ptr = c_null_ptr
    if(present(pnum)) pnum_ptr = c_loc(pnum_temp)
    pcat_ptr = c_null_ptr
    if(present(pcat)) pcat_ptr = c_loc(pcat_temp)
    pdis_ptr = c_null_ptr
    if(present(pdis)) pdis_ptr = c_loc(pdis_temp)
    call lib_cdiDecodeParam(param_dummy, pnum_ptr, pcat_ptr, pdis_ptr)
    if(present(pnum)) pnum = pnum_temp
    if(present(pcat)) pcat = pcat_temp
    if(present(pdis)) pdis = pdis_temp
  end subroutine cdiDecodeParam

  function cdiEncodeParam(pnum_dummy, pcat_dummy, pdis_dummy) result(result)
    integer(c_int) :: result
    integer(c_int), value :: pnum_dummy
    integer(c_int), value :: pcat_dummy
    integer(c_int), value :: pdis_dummy
    interface
882
883
      integer(c_int) function lib_cdiEncodeParam(pnum_dummy, pcat_dummy,&
      & pdis_dummy) bind(c, name = 'cdiEncodeParam')
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
        import c_int
        integer(c_int), value :: pnum_dummy
        integer(c_int), value :: pcat_dummy
        integer(c_int), value :: pdis_dummy
      end function lib_cdiEncodeParam
    end interface
    result = lib_cdiEncodeParam(pnum_dummy, pcat_dummy, pdis_dummy)
  end function cdiEncodeParam

  subroutine cdiDecodeDate(date_dummy, year, month, day)
    integer(c_int), value :: date_dummy
    integer(c_int), optional, intent(inout) :: year
    integer(c_int), optional, intent(inout) :: month
    integer(c_int), optional, intent(inout) :: day
    integer(c_int), target :: year_temp
    type(c_ptr) :: year_ptr
    integer(c_int), target :: month_temp
    type(c_ptr) :: month_ptr
    integer(c_int), target :: day_temp
    type(c_ptr) :: day_ptr
    interface
905
906
      subroutine lib_cdiDecodeDate(date_dummy, year, month, day) bind(c, name =&
      & 'cdiDecodeDate')
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
        import c_int, c_ptr
        integer(c_int), value :: date_dummy
        type(c_ptr), value :: year
        type(c_ptr), value :: month
        type(c_ptr), value :: day
      end subroutine lib_cdiDecodeDate
    end interface
    year_ptr = c_null_ptr
    if(present(year)) year_ptr = c_loc(year_temp)
    month_ptr = c_null_ptr
    if(present(month)) month_ptr = c_loc(month_temp)
    day_ptr = c_null_ptr
    if(present(day)) day_ptr = c_loc(day_temp)
    call lib_cdiDecodeDate(date_dummy, year_ptr, month_ptr, day_ptr)
    if(present(year)) year = year_temp
    if(present(month)) month = month_temp
    if(present(day)) day = day_temp
  end subroutine cdiDecodeDate

  function cdiEncodeDate(year_dummy, month_dummy, day_dummy) result(result)
    integer(c_int) :: result
    integer(c_int), value :: year_dummy
    integer(c_int), value :: month_dummy
    integer(c_int), value :: day_dummy
    interface
932
933
      integer(c_int) function lib_cdiEncodeDate(year_dummy, month_dummy,&
      & day_dummy) bind(c, name = 'cdiEncodeDate')
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
        import c_int
        integer(c_int), value :: year_dummy
        integer(c_int), value :: month_dummy
        integer(c_int), value :: day_dummy
      end function lib_cdiEncodeDate
    end interface
    result = lib_cdiEncodeDate(year_dummy, month_dummy, day_dummy)
  end function cdiEncodeDate

  subroutine cdiDecodeTime(time_dummy, hour, minute, second)
    integer(c_int), value :: time_dummy
    integer(c_int), optional, intent(inout) :: hour
    integer(c_int), optional, intent(inout) :: minute
    integer(c_int), optional, intent(inout) :: second
    integer(c_int), target :: hour_temp
    type(c_ptr) :: hour_ptr
    integer(c_int), target :: minute_temp
    type(c_ptr) :: minute_ptr
    integer(c_int), target :: second_temp
    type(c_ptr) :: second_ptr
    interface
955
956
      subroutine lib_cdiDecodeTime(time_dummy, hour, minute, second) bind(c,&
      & name = 'cdiDecodeTime')
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
        import c_int, c_ptr
        integer(c_int), value :: time_dummy
        type(c_ptr), value :: hour
        type(c_ptr), value :: minute
        type(c_ptr), value :: second
      end subroutine lib_cdiDecodeTime
    end interface
    hour_ptr = c_null_ptr
    if(present(hour)) hour_ptr = c_loc(hour_temp)
    minute_ptr = c_null_ptr
    if(present(minute)) minute_ptr = c_loc(minute_temp)
    second_ptr = c_null_ptr
    if(present(second)) second_ptr = c_loc(second_temp)
    call lib_cdiDecodeTime(time_dummy, hour_ptr, minute_ptr, second_ptr)
    if(present(hour)) hour = hour_temp
    if(present(minute)) minute = minute_temp
    if(present(second)) second = second_temp
  end subroutine cdiDecodeTime

  function cdiEncodeTime(hour_dummy, minute_dummy, second_dummy) result(result)
    integer(c_int) :: result
    integer(c_int), value :: hour_dummy
    integer(c_int), value :: minute_dummy
    integer(c_int), value :: second_dummy
    interface
982
983
      integer(c_int) function lib_cdiEncodeTime(hour_dummy, minute_dummy,&
      & second_dummy) bind(c, name = 'cdiEncodeTime')
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
        import c_int
        integer(c_int), value :: hour_dummy
        integer(c_int), value :: minute_dummy
        integer(c_int), value :: second_dummy
      end function lib_cdiEncodeTime
    end interface
    result = lib_cdiEncodeTime(hour_dummy, minute_dummy, second_dummy)
  end function cdiEncodeTime

  function cdiGetFiletype(path_dummy, byteorder) result(result)
    integer(c_int) :: result
    character(kind = c_char, len = *), intent(in) :: path_dummy
    integer(c_int), optional, intent(inout) :: byteorder
    character(kind = c_char) :: path_temp(len(path_dummy) + 1)
    integer :: path_i
    integer(c_int), target :: byteorder_temp
    type(c_ptr) :: byteorder_ptr
For faster browsing, not all history is shown. View entire blame