Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
873128bb
Commit
873128bb
authored
4 years ago
by
Volker Neff
Browse files
Options
Downloads
Patches
Plain Diff
extend c to julia macro converter
parent
527b1dea
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
interfaces/julia/cdi_macro.jl
+210
-0
210 additions, 0 deletions
interfaces/julia/cdi_macro.jl
src/cdi.h
+27
-20
27 additions, 20 deletions
src/cdi.h
with
237 additions
and
20 deletions
interfaces/julia/cdi_macro.jl
0 → 100644
+
210
−
0
View file @
873128bb
@enum
ByteOrder
::
Cint
begin
CDI_BIGENDIAN
=
0
# Byte order BIGENDIAN
CDI_LITTLEENDIAN
=
1
# Byte order LITTLEENDIAN
CDI_PDPENDIAN
=
2
end
@enum
NumberType
::
Cint
begin
CDI_REAL
=
1
# Real numbers
CDI_COMP
=
2
# Complex numbers
CDI_BOTH
=
3
# Both numbers
end
@enum
ErrorIdentifier
::
Cint
begin
CDI_EEOF
=
-
1
# The end of file was encountered
CDI_ETMOF
=
-
9
# Too many open files
CDI_ESYSTEM
=
-
10
# Operating system error
CDI_EINVAL
=
-
20
# Invalid argument
CDI_EISDIR
=
-
21
# Is a directory
CDI_EISEMPTY
=
-
22
# Is empty
CDI_EUFTYPE
=
-
23
# Unsupported file type
CDI_ELIBNAVAIL
=
-
24
# xxx library not available
CDI_EUFSTRUCT
=
-
25
# Unsupported file structure
CDI_EUNC4
=
-
26
# Unsupported NetCDF4 structure
CDI_EDIMSIZE
=
-
27
# Invalid dimension size
CDI_ELIMIT
=
-
99
# Internal limits exceeded
end
@enum
FileTypes
::
Cint
begin
CDI_FILETYPE_GRB
=
1
# File type GRIB
CDI_FILETYPE_GRB2
=
2
# File type GRIB version 2
CDI_FILETYPE_NC
=
3
# File type NetCDF
CDI_FILETYPE_NC2
=
4
# File type NetCDF version 2 (64-bit offset)
CDI_FILETYPE_NC4
=
5
# File type NetCDF version 4
CDI_FILETYPE_NC4C
=
6
# File type NetCDF version 4 (classic)
CDI_FILETYPE_NC5
=
7
# File type NetCDF version 5 (64-bit data)
CDI_FILETYPE_SRV
=
8
# File type SERVICE
CDI_FILETYPE_EXT
=
9
# File type EXTRA
CDI_FILETYPE_IEG
=
10
# File type IEG
end
@enum
CompressTypes
::
Cint
begin
CDI_COMPRESS_NONE
=
0
CDI_COMPRESS_SZIP
=
1
CDI_COMPRESS_AEC
=
2
CDI_COMPRESS_ZIP
=
3
CDI_COMPRESS_JPEG
=
4
end
@enum
dataTypes
::
Cint
begin
CDI_DATATYPE_PACK
=
0
CDI_DATATYPE_PACK1
=
1
CDI_DATATYPE_PACK2
=
2
CDI_DATATYPE_PACK3
=
3
CDI_DATATYPE_PACK4
=
4
CDI_DATATYPE_PACK5
=
5
CDI_DATATYPE_PACK6
=
6
CDI_DATATYPE_PACK7
=
7
CDI_DATATYPE_PACK8
=
8
CDI_DATATYPE_PACK9
=
9
CDI_DATATYPE_PACK10
=
10
CDI_DATATYPE_PACK11
=
11
CDI_DATATYPE_PACK12
=
12
CDI_DATATYPE_PACK13
=
13
CDI_DATATYPE_PACK14
=
14
CDI_DATATYPE_PACK15
=
15
CDI_DATATYPE_PACK16
=
16
CDI_DATATYPE_PACK17
=
17
CDI_DATATYPE_PACK18
=
18
CDI_DATATYPE_PACK19
=
19
CDI_DATATYPE_PACK20
=
20
CDI_DATATYPE_PACK21
=
21
CDI_DATATYPE_PACK22
=
22
CDI_DATATYPE_PACK23
=
23
CDI_DATATYPE_PACK24
=
24
CDI_DATATYPE_PACK25
=
25
CDI_DATATYPE_PACK26
=
26
CDI_DATATYPE_PACK27
=
27
CDI_DATATYPE_PACK28
=
28
CDI_DATATYPE_PACK29
=
29
CDI_DATATYPE_PACK30
=
30
CDI_DATATYPE_PACK31
=
31
CDI_DATATYPE_PACK32
=
32
CDI_DATATYPE_CPX32
=
64
CDI_DATATYPE_CPX64
=
128
CDI_DATATYPE_FLT32
=
132
CDI_DATATYPE_FLT64
=
164
CDI_DATATYPE_INT8
=
208
CDI_DATATYPE_INT16
=
216
CDI_DATATYPE_INT32
=
232
CDI_DATATYPE_UINT8
=
308
CDI_DATATYPE_UINT16
=
316
CDI_DATATYPE_UINT32
=
332
CDI_DATATYPE_INT
=
251
CDI_DATATYPE_FLT
=
252
CDI_DATATYPE_TXT
=
253
CDI_DATATYPE_CPX
=
254
CDI_DATATYPE_UCHAR
=
255
CDI_DATATYPE_LONG
=
256
CDI_DATATYPE_UINT
=
257
end
@enum
Chunks
::
Cint
begin
CDI_CHUNK_AUTO
=
1
# use default chunk size
CDI_CHUNK_GRID
=
2
CDI_CHUNK_LINES
=
3
end
@enum
GRID
::
Cint
begin
GRID_GENERIC
=
1
# Generic grid
GRID_GAUSSIAN
=
2
# Regular Gaussian lon/lat grid
GRID_GAUSSIAN_REDUCED
=
3
# Reduced Gaussian lon/lat grid
GRID_LONLAT
=
4
# Regular longitude/latitude grid
GRID_SPECTRAL
=
5
# Spherical harmonic coefficients
GRID_FOURIER
=
6
# Fourier coefficients
GRID_GME
=
7
# Icosahedral-hexagonal GME grid
GRID_TRAJECTORY
=
8
# Trajectory
GRID_UNSTRUCTURED
=
9
# General unstructured grid
GRID_CURVILINEAR
=
10
# Curvilinear grid
GRID_PROJECTION
=
12
# Projected coordinates
GRID_CHARXY
=
13
# One horizontal character dimension
CDI_PROJ_RLL
=
21
# Rotated Latitude Longitude
CDI_PROJ_LCC
=
22
# Lambert Conformal Conic
CDI_PROJ_LAEA
=
23
# Lambert Azimuthal Equal Area
CDI_PROJ_SINU
=
24
# Sinusoidal
CDI_PROJ_STERE
=
25
# Polar stereographic
end
@enum
ZAXIS
::
Cint
begin
ZAXIS_SURFACE
=
0
# Surface level
ZAXIS_GENERIC
=
1
# Generic level
ZAXIS_HYBRID
=
2
# Hybrid level
ZAXIS_HYBRID_HALF
=
3
# Hybrid half level
ZAXIS_PRESSURE
=
4
# Isobaric pressure level in Pascal
ZAXIS_HEIGHT
=
5
# Height above ground
ZAXIS_DEPTH_BELOW_SEA
=
6
# Depth below sea level in meters
ZAXIS_DEPTH_BELOW_LAND
=
7
# Depth below land surface in centimeters
ZAXIS_ISENTROPIC
=
8
# Isentropic
ZAXIS_TRAJECTORY
=
9
# Trajectory
ZAXIS_ALTITUDE
=
10
# Altitude above mean sea level in meters
ZAXIS_SIGMA
=
11
# Sigma level
ZAXIS_MEANSEA
=
12
# Mean sea level
ZAXIS_TOA
=
13
# Norminal top of atmosphere
ZAXIS_SEA_BOTTOM
=
14
# Sea bottom
ZAXIS_ATMOSPHERE
=
15
# Entire atmosphere
ZAXIS_CLOUD_BASE
=
16
# Cloud base level
ZAXIS_CLOUD_TOP
=
17
# Level of cloud tops
ZAXIS_ISOTHERM_ZERO
=
18
# Level of 0o C isotherm
ZAXIS_SNOW
=
19
# Snow level
ZAXIS_LAKE_BOTTOM
=
20
# Lake or River Bottom
ZAXIS_SEDIMENT_BOTTOM
=
21
# Bottom Of Sediment Layer
ZAXIS_SEDIMENT_BOTTOM_TA
=
22
# Bottom Of Thermally Active Sediment Layer
ZAXIS_SEDIMENT_BOTTOM_TW
=
23
# Bottom Of Sediment Layer Penetrated By Thermal Wave
ZAXIS_MIX_LAYER
=
24
# Mixing Layer
ZAXIS_REFERENCE
=
25
# zaxis reference number
ZAXIS_CHAR
=
26
# Area types
end
@enum
TIME
::
Cint
begin
TIME_CONSTANT
=
0
# Time constant
TIME_VARYING
=
1
# Time varying
TIME_VARIABLE
=
1
# obsolate, use TIME_VARYING
end
@enum
TimeSteps
::
Cint
begin
TSTEP_INSTANT
=
1
# Instant
TSTEP_AVG
=
2
# Average
TSTEP_ACCUM
=
3
# Accumulation
TSTEP_MAX
=
4
# Maximum
TSTEP_MIN
=
5
# Minimum
TSTEP_DIFF
=
6
# Difference
TSTEP_RMS
=
7
# Root mean square
TSTEP_SD
=
8
# Standard deviation
TSTEP_COV
=
9
# Covariance
TSTEP_RATIO
=
10
# Ratio
TSTEP_SUM
=
11
# Summation
TSTEP_RANGE
=
12
TSTEP_INSTANT2
=
13
TSTEP_INSTANT3
=
14
end
@enum
TAXIS
::
Cint
begin
TAXIS_ABSOLUTE
=
1
TAXIS_RELATIVE
=
2
TAXIS_FORECAST
=
3
end
This diff is collapsed.
Click to expand it.
src/cdi.h
+
27
−
20
View file @
873128bb
...
...
@@ -21,19 +21,18 @@ extern "C" {
#define CDI_GLOBAL -1 // Global var ID for vlist
// #BEGIN# ByteOrder
#define CDI_BIGENDIAN 0 // Byte order BIGENDIAN
#define CDI_LITTLEENDIAN 1 // Byte order LITTLEENDIAN
#define CDI_PDPENDIAN 2
// #END# ByteOrder
// #BEGIN# NumberType
#define CDI_REAL 1 // Real numbers
#define CDI_COMP 2 // Complex numbers
#define CDI_BOTH 3 // Both numbers
// #END# NumberType
// Error identifier
// #BEGIN# ErrorIdentifier
#define CDI_NOERR 0 // No Error
#define CDI_EEOF -1 // The end of file was encountered
#define CDI_ETMOF -9 // Too many open files
...
...
@@ -47,9 +46,9 @@ extern "C" {
#define CDI_EUNC4 -26 // Unsupported NetCDF4 structure
#define CDI_EDIMSIZE -27 // Invalid dimension size
#define CDI_ELIMIT -99 // Internal limits exceeded
// #END# ErrorIdentifier
// File types
// #BEGIN# FileTypes
#define CDI_FILETYPE_GRB 1 // File type GRIB
#define CDI_FILETYPE_GRB2 2 // File type GRIB version 2
#define CDI_FILETYPE_NC 3 // File type NetCDF
...
...
@@ -60,17 +59,18 @@ extern "C" {
#define CDI_FILETYPE_SRV 8 // File type SERVICE
#define CDI_FILETYPE_EXT 9 // File type EXTRA
#define CDI_FILETYPE_IEG 10 // File type IEG
// #END# FileTypes
// Compress types
// #BEGIN# CompressTypes
#define CDI_COMPRESS_NONE 0
#define CDI_COMPRESS_SZIP 1
#define CDI_COMPRESS_AEC 2
#define CDI_COMPRESS_ZIP 3
#define CDI_COMPRESS_JPEG 4
// #END# CompressTypes
// #BEGIN# dataTypes
// external data types
#define CDI_DATATYPE_PACK 0
#define CDI_DATATYPE_PACK1 1
#define CDI_DATATYPE_PACK2 2
...
...
@@ -123,15 +123,16 @@ extern "C" {
#define CDI_DATATYPE_UCHAR 255
#define CDI_DATATYPE_LONG 256
#define CDI_DATATYPE_UINT 257
// #END# dataTypes
// Chunks
// #BEGIN# Chunks
#define CDI_CHUNK_AUTO 1 // use default chunk size
#define CDI_CHUNK_GRID 2
#define CDI_CHUNK_LINES 3
// #END# Chunks
//
GRID types
//
#BEGIN# GRID
// GRID Types
#define GRID_GENERIC 1 // Generic grid
#define GRID_GAUSSIAN 2 // Regular Gaussian lon/lat grid
#define GRID_GAUSSIAN_REDUCED 3 // Reduced Gaussian lon/lat grid
...
...
@@ -150,9 +151,10 @@ extern "C" {
#define CDI_PROJ_LAEA 23 // Lambert Azimuthal Equal Area
#define CDI_PROJ_SINU 24 // Sinusoidal
#define CDI_PROJ_STERE 25 // Polar stereographic
// #END# GRID
// #BEGIN# ZAXIS
// ZAXIS types
#define ZAXIS_SURFACE 0 // Surface level
#define ZAXIS_GENERIC 1 // Generic level
#define ZAXIS_HYBRID 2 // Hybrid level
...
...
@@ -180,6 +182,7 @@ extern "C" {
#define ZAXIS_MIX_LAYER 24 // Mixing Layer
#define ZAXIS_REFERENCE 25 // zaxis reference number
#define ZAXIS_CHAR 26 // Area types
// #END# ZAXIS
// SUBTYPE types
...
...
@@ -200,15 +203,15 @@ typedef struct {
}
subtype_query_t
;
// #BEGIN# TIME
// TIME types
#define TIME_CONSTANT 0 // Time constant
#define TIME_VARYING 1 // Time varying
#define TIME_VARIABLE 1 // obsolate, use TIME_VARYING
// #END# TIME
// #BEGIN# TimeSteps
// TSTEP types
#define TSTEP_INSTANT 1 // Instant
#define TSTEP_AVG 2 // Average
#define TSTEP_ACCUM 3 // Accumulation
...
...
@@ -223,15 +226,17 @@ typedef struct {
#define TSTEP_RANGE 12
#define TSTEP_INSTANT2 13
#define TSTEP_INSTANT3 14
// #END# TimeSteps
// #BEGIN# TAXIS
// TAXIS types
#define TAXIS_ABSOLUTE 1
#define TAXIS_RELATIVE 2
#define TAXIS_FORECAST 3
// #END# TAXIS
// #BEIGN# TimeUnit
// TUNIT types
#define TUNIT_SECOND 1
#define TUNIT_MINUTE 2
#define TUNIT_QUARTER 3
...
...
@@ -243,9 +248,10 @@ typedef struct {
#define TUNIT_DAY 9
#define TUNIT_MONTH 10
#define TUNIT_YEAR 11
// #END# TimeUnit
// #BEGIN# Calender
// CALENDAR types
#define CALENDAR_STANDARD 0 // don't change this value (used also in cgribexlib)!
#define CALENDAR_GREGORIAN 1
#define CALENDAR_PROLEPTIC 2
...
...
@@ -253,6 +259,7 @@ typedef struct {
#define CALENDAR_365DAYS 4
#define CALENDAR_366DAYS 5
#define CALENDAR_NONE 6
// #END# Calender
// number of unsigned char needed to store UUID
#define CDI_UUID_SIZE 16
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment