-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2109 from DennisHeimbigner/ncgenenum.dmh
Fix handling of enum constants nested in compound types.
- Loading branch information
Showing
6 changed files
with
218 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ variables: | |
data: | ||
test1=pass; | ||
test2=e2.undefined; | ||
test3=/e1.fail; | ||
test3=e1.fail; | ||
} |
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,46 @@ | ||
netcdf foo { // an example netCDF specification in CDL | ||
|
||
types: | ||
ubyte enum enum_t {Clear = 0, Cumulonimbus = 1, Stratus = 2}; | ||
opaque(11) opaque_t; | ||
int(*) vlen_t; | ||
|
||
dimensions: | ||
lat = 10, lon = 5, time = unlimited ; | ||
|
||
variables: | ||
long lat(lat), lon(lon), time(time); | ||
float Z(time,lat,lon), t(time,lat,lon); | ||
double p(time,lat,lon); | ||
long rh(time,lat,lon); | ||
|
||
string country(time,lat,lon); | ||
ubyte tag; | ||
|
||
// variable attributes | ||
lat:long_name = "latitude"; | ||
lat:units = "degrees_north"; | ||
lon:long_name = "longitude"; | ||
lon:units = "degrees_east"; | ||
time:units = "seconds since 1992-1-1 00:00:00"; | ||
|
||
// typed variable attributes | ||
string Z:units = "geopotential meters"; | ||
float Z:valid_range = 0., 5000.; | ||
double p:_FillValue = -9999.; | ||
long rh:_FillValue = -1; | ||
vlen_t :globalatt = {17, 18, 19}; | ||
data: | ||
lat = 0, 10, 20, 30, 40, 50, 60, 70, 80, 90; | ||
lon = -140, -118, -96, -84, -52; | ||
group: g { | ||
types: | ||
compound cmpd_t { vlen_t f1; enum_t f2; enum_t f3;}; | ||
} // group g | ||
group: h { | ||
variables: | ||
/g/cmpd_t compoundvar; | ||
data: | ||
compoundvar = { {3,4,5}, Stratus, enum_t.Clear } ; | ||
} // group h | ||
} |
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,56 @@ | ||
netcdf ref_tst_econst2 { | ||
types: | ||
ubyte enum enum_t {Clear = 0, Cumulonimbus = 1, Stratus = 2} ; | ||
opaque(11) opaque_t ; | ||
int(*) vlen_t ; | ||
dimensions: | ||
lat = 10 ; | ||
lon = 5 ; | ||
time = UNLIMITED ; // (0 currently) | ||
variables: | ||
int lat(lat) ; | ||
lat:long_name = "latitude" ; | ||
lat:units = "degrees_north" ; | ||
int lon(lon) ; | ||
lon:long_name = "longitude" ; | ||
lon:units = "degrees_east" ; | ||
int time(time) ; | ||
time:units = "seconds since 1992-1-1 00:00:00" ; | ||
float Z(time, lat, lon) ; | ||
string Z:units = "geopotential meters" ; | ||
Z:valid_range = 0.f, 5000.f ; | ||
float t(time, lat, lon) ; | ||
double p(time, lat, lon) ; | ||
p:_FillValue = -9999. ; | ||
int rh(time, lat, lon) ; | ||
rh:_FillValue = -1 ; | ||
string country(time, lat, lon) ; | ||
ubyte tag ; | ||
|
||
// global attributes: | ||
vlen_t :globalatt = {17, 18, 19} ; | ||
data: | ||
|
||
lat = 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 ; | ||
|
||
lon = -140, -118, -96, -84, -52 ; | ||
|
||
tag = 255 ; | ||
|
||
group: g { | ||
types: | ||
compound cmpd_t { | ||
vlen_t f1 ; | ||
enum_t f2 ; | ||
enum_t f3 ; | ||
}; // cmpd_t | ||
} // group g | ||
|
||
group: h { | ||
variables: | ||
/g/cmpd_t compoundvar ; | ||
data: | ||
|
||
compoundvar = {{3, 4, 5}, Stratus, Clear} ; | ||
} // group h | ||
} |
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