mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-04-06 18:00:24 +08:00
Merge branch 'master' into ghpull-375
This commit is contained in:
commit
eeb673bf8c
@ -11,8 +11,9 @@ This file contains a high-level description of this package's evolution. Release
|
||||
|
||||
## 4.4.2 - TBD
|
||||
|
||||
* [Upgrade] Update utf8proc.[ch] to use the version now maintained by the
|
||||
Julia Language project (https://github.com/JuliaLang/utf8proc/blob/master/LICENSE.md).
|
||||
* [Enhancement] Modified netCDF4 to use ASCII for NC_CHAR. See [Github Pull request #316](https://github.com/Unidata/netcdf-c/pull/316) for more information.
|
||||
* [Upgrade][Bug] Corrected an issue regarding how "orphaned" DAS attributes were handled. See [GitHub #376](https://github.com/Unidata/netcdf-c/pull/376) for more information.
|
||||
* [Upgrade] Update utf8proc.[ch] to use the version now maintained by the Julia Language project (https://github.com/JuliaLang/utf8proc/blob/master/LICENSE.md).
|
||||
* [Bug] Addressed conversion problem with Windows sscanf. This primarily affected some OPeNDAP URLs on Windows. See [GitHub #365](https://github.com/Unidata/netcdf-c/issues/365) and [GitHub #366](https://github.com/Unidata/netcdf-c/issues/366) for more information.
|
||||
* [Enhancement] Added support for HDF5 collective metadata operations when available. Patch submitted by Greg Sjaardema, see [Pull request #335](https://github.com/Unidata/netcdf-c/pull/335) for more information.
|
||||
* [Bug] Addressed a potential type punning issue. See [GitHub #351](https://github.com/Unidata/netcdf-c/issues/351) for more information.
|
||||
|
@ -625,7 +625,7 @@ data are written). In that case the specified endian type will be used
|
||||
in HDF5 (for example, a H5T_STD_I16LE will be used for NC_SHORT, if
|
||||
little-endian has been specified for that variable.)
|
||||
- NC_BYTE = H5T_NATIVE_SCHAR
|
||||
- NC_UBYTE = H5T_NATIVE_SCHAR
|
||||
- NC_UBYTE = H5T_NATIVE_UCHAR
|
||||
- NC_CHAR = H5T_C_S1
|
||||
- NC_STRING = variable length array of H5T_C_S1
|
||||
- NC_SHORT = H5T_NATIVE_SHORT
|
||||
|
30
libdap2/env
30
libdap2/env
@ -4,12 +4,12 @@ alias xx="cd ..;make; cd libdap2"
|
||||
PARMS=""; ARGS=""; CON="" ; CE=""; OCON="" ; VAR=""; SHARP='#'
|
||||
alias q0=;alias qq=;alias qv=;alias q=;alias qh=;alias qqh=;alias qall=;alias qv=;alias qo=;
|
||||
|
||||
F="http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/pressure/air.1947.nc"
|
||||
F='https://cida.usgs.gov/thredds/dodsC/new_gmo?longitude[0:1:461],latitude[0:1:221],time[0:1:22644]'
|
||||
|
||||
if test -e "/cygdrive/f/git/netcdf-c" ; then
|
||||
TOP="/cygdrive/f/git/netcdf-c"
|
||||
elif test -e "/cygdrive/d/git/netcdf-c" ; then
|
||||
if test -e "/cygdrive/d/git/netcdf-c" ; then
|
||||
TOP="/cygdrive/d/git/netcdf-c"
|
||||
elif test -e "/cygdrive/f/git/netcdf-c" ; then
|
||||
TOP="/cygdrive/f/git/netcdf-c"
|
||||
elif test -e "/home/dmh/git/netcdf-c" ; then
|
||||
TOP="/home/dmh/git/netcdf-c"
|
||||
else
|
||||
@ -25,15 +25,15 @@ fi
|
||||
P=`pwd`
|
||||
|
||||
PARMS="log"
|
||||
#PARMS="${PARMS}&netcdf3"
|
||||
#PARMS="${PARMS}&fetch=disk"
|
||||
#PARMS="${PARMS}&cache"
|
||||
#PARMS="${PARMS}&nocache"
|
||||
#PARMS="${PARMS}&wholevar"
|
||||
PARMS="${PARMS}&show=fetch"
|
||||
#PARMS="${PARMS}&noprefetch"
|
||||
#PARMS="${PARMS}&prefetch"
|
||||
#PARMS="${PARMS}&prefetch=eager"
|
||||
#PARMS="${PARMS}[netcdf3]"
|
||||
#PARMS="${PARMS}[fetch=disk]"
|
||||
#PARMS="${PARMS}[cache]"
|
||||
#PARMS="${PARMS}[nocache]"
|
||||
#PARMS="${PARMS}[wholevar]"
|
||||
PARMS="${PARMS}[show=fetch]"
|
||||
#PARMS="${PARMS}[noprefetch]"
|
||||
#PARMS="${PARMS}[prefetch]"
|
||||
#PARMS="${PARMS}[prefetch=eager]"
|
||||
PARMS="[log][cache][noprefetch]"
|
||||
|
||||
VARGS="--leak-check=full"
|
||||
@ -52,10 +52,9 @@ if test "x$PROG" = x ; then
|
||||
PROG="../ncdump/ncdump"
|
||||
fi
|
||||
|
||||
if test "x$PARMS" != "x" ; then PARMS="\#$PARMS"; fi
|
||||
U="$F"
|
||||
if test "x$CON" != "x" ; then U="$U?$CON"; fi
|
||||
UALL="$U${PARMS}"
|
||||
UALL="${PARMS}$U"
|
||||
#ARGS="-h $ARGS"
|
||||
#ARGS="-w $ARGS"
|
||||
#ARGS="-c $ARGS"
|
||||
@ -133,4 +132,5 @@ F="http://nomads.ncep.noaa.gov:9090/dods/gens/gens20140123/gep_all_12z"
|
||||
VAR=prmslmsl
|
||||
F="http://data.nodc.noaa.gov/thredds/dodsC/testdata/pathfinderAgg/pathFinderV5.2_night.ncml"
|
||||
CON="sst_dtime.sst_dtime"
|
||||
F="http://www.esrl.noaa.gov/psd/thredds/dodsC/Datasets/ncep.reanalysis.dailyavgs/pressure/air.1947.nc"
|
||||
fi
|
||||
|
@ -325,7 +325,7 @@ nc4_get_hdf_typeid(NC_HDF5_FILE_INFO_T *h5, nc_type xtype,
|
||||
return NC_EHDFERR;
|
||||
if (H5Tset_strpad(typeid, H5T_STR_NULLTERM) < 0)
|
||||
BAIL(NC_EVARMETA);
|
||||
if(H5Tset_cset(typeid, H5T_CSET_UTF8) < 0)
|
||||
if(H5Tset_cset(typeid, H5T_CSET_ASCII) < 0)
|
||||
BAIL(NC_EVARMETA);
|
||||
|
||||
/* Take ownership of the newly created HDF5 datatype */
|
||||
|
@ -27,8 +27,9 @@ main(int argc, char **argv)
|
||||
int ncid, i;
|
||||
char *data_in[ATT_LEN];
|
||||
char *data[ATT_LEN] = {"An appeaser is one who feeds a crocodile — "
|
||||
"hoping it will eat him last."};
|
||||
|
||||
"hoping it will eat him last. "
|
||||
"Here are some non-ASCII characters: "
|
||||
"\x00\xAA\xBB\xFF"};
|
||||
|
||||
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
|
||||
if (nc_put_att(ncid, NC_GLOBAL, ATT_NAME, NC_STRING, ATT_LEN, data)) ERR;
|
||||
|
@ -7,10 +7,6 @@ variables:
|
||||
"Ph.D" ;
|
||||
:Facility.DataCenter = "COAS Environmental Computer Facility" ;
|
||||
:Facility.DrifterType = "MetOcean WOCE/OCM" ;
|
||||
:b.Description = "A test byte" ;
|
||||
:b.units = "unknown" ;
|
||||
:i32.Description = "A 32 bit test server int" ;
|
||||
:i32.units = "unknown" ;
|
||||
data:
|
||||
|
||||
f64 = 1000 ;
|
||||
|
@ -9,10 +9,6 @@ variables:
|
||||
"Ph.D" ;
|
||||
:Facility.DataCenter = "COAS Environmental Computer Facility" ;
|
||||
:Facility.DrifterType = "MetOcean WOCE/OCM" ;
|
||||
:b.Description = "A test byte" ;
|
||||
:b.units = "unknown" ;
|
||||
:i32.Description = "A 32 bit test server int" ;
|
||||
:i32.units = "unknown" ;
|
||||
data:
|
||||
|
||||
person.age = 1, 2, 3, 5, 8 ;
|
||||
|
@ -11,10 +11,6 @@ variables:
|
||||
"Ph.D" ;
|
||||
:Facility.DataCenter = "COAS Environmental Computer Facility" ;
|
||||
:Facility.DrifterType = "MetOcean WOCE/OCM" ;
|
||||
:b.Description = "A test byte" ;
|
||||
:b.units = "unknown" ;
|
||||
:i32.Description = "A 32 bit test server int" ;
|
||||
:i32.units = "unknown" ;
|
||||
data:
|
||||
|
||||
person.name =
|
||||
|
@ -9,10 +9,6 @@ variables:
|
||||
"Ph.D" ;
|
||||
:Facility.DataCenter = "COAS Environmental Computer Facility" ;
|
||||
:Facility.DrifterType = "MetOcean WOCE/OCM" ;
|
||||
:b.Description = "A test byte" ;
|
||||
:b.units = "unknown" ;
|
||||
:i32.Description = "A 32 bit test server int" ;
|
||||
:i32.units = "unknown" ;
|
||||
data:
|
||||
|
||||
types.f32 = 0, 0.9999833, 1.999867, 2.99955, 3.998933 ;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
set -e
|
||||
|
||||
quiet=0
|
||||
|
@ -70,5 +70,5 @@ ADD_CUSTOM_TARGET(makeparser DEPENDS ncgentab.h)
|
||||
|
||||
## Specify files to be distributed by 'make dist'
|
||||
FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
|
||||
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ncgen.y ncgenl.c ncgen.l internals.html c0.cdl c0_4.cdl ref_camrun.cdl ncf199.cdl CMakeLists.txt Makefile.am ncgen.1)
|
||||
SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ncgen.y ncgenl.c ncgen.l internals.html c0.cdl c0_4.cdl ref_camrun.cdl ncf199.cdl tst_gattenum.cdl CMakeLists.txt Makefile.am ncgen.1)
|
||||
ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
|
||||
|
@ -24,7 +24,7 @@ man_MANS = ncgen.1
|
||||
EXTRA_DIST = ncgen.y ncgen.l ncgenl.c $(man_MANS) internals.html \
|
||||
run_tests.sh run_nc4_tests.sh c0.cdl c0_4.cdl ref_camrun.cdl \
|
||||
ncf199.cdl CMakeLists.txt XGetopt.c c5.cdl \
|
||||
compound_datasize_test.cdl compound_datasize_test2.cdl
|
||||
compound_datasize_test.cdl compound_datasize_test2.cdl tst_gattenum.cdl
|
||||
|
||||
# This shell script causes ncgen to build a classic and a 64-bit
|
||||
# offset file from a cdl file shipped with the distribution.
|
||||
@ -38,6 +38,7 @@ endif # USE_NETCDF4
|
||||
CLEANFILES = c0.nc c0_64.nc c0_4.nc c0_4c.nc ref_camrun.c \
|
||||
ncf199.nc c5.nc compound_datasize_test.nc compound_datasize_test2.nc \
|
||||
tst_compound_datasize_test.cdl tst_compound_datasize_test2.cdl tst_ncf199.cdl \
|
||||
tst_tst_gattenum.cdl tst_gattenum.nc \
|
||||
tst_c0.cdl tst_c0_4.cdl tst_c0_4c.cdl tst_c0_64.cdl
|
||||
|
||||
# These rules are used if someone wants to rebuild ncgenl.c or ncgeny.c
|
||||
|
@ -54,5 +54,8 @@ validateNC "compound_datasize_test" "compound_datasize_test" -k nc4
|
||||
echo "*** github issue 323 test 2"
|
||||
validateNC "compound_datasize_test2" "compound_datasize_test2" -k nc4
|
||||
|
||||
echo "*** Global Attribute with Enum type"
|
||||
validateNC "tst_gattenum" "tst_gattenum" -k nc4
|
||||
|
||||
echo "*** Test successful!"
|
||||
exit 0
|
||||
|
@ -422,6 +422,11 @@ processeconstrefs(void)
|
||||
{
|
||||
unsigned long i;
|
||||
/* locate all the datalist and walk them recursively */
|
||||
for(i=0;i<listlength(gattdefs);i++) {
|
||||
Symbol* att = (Symbol*)listget(gattdefs,i);
|
||||
if(att->data != NULL && listlength(att->data) > 0)
|
||||
processeconstrefsR(att->data);
|
||||
}
|
||||
for(i=0;i<listlength(attdefs);i++) {
|
||||
Symbol* att = (Symbol*)listget(attdefs,i);
|
||||
if(att->data != NULL && listlength(att->data) > 0)
|
||||
|
8
ncgen/tst_gattenum.cdl
Normal file
8
ncgen/tst_gattenum.cdl
Normal file
@ -0,0 +1,8 @@
|
||||
netcdf tst_gattenum {
|
||||
types:
|
||||
ubyte enum Bradys {Mike = 0, Carol = 1, Greg = 2, Marsha = 3, Peter = 4,
|
||||
Jan = 5, Bobby = 6, Whats-her-face = 7, Alice = 8} ;
|
||||
|
||||
// global attributes:
|
||||
Bradys :brady_attribute = Mike, Marsha, Alice;
|
||||
}
|
38
oc2/ocnode.c
38
oc2/ocnode.c
@ -10,9 +10,10 @@ static const unsigned int MAX_UINT = 0xffffffff;
|
||||
|
||||
static OCerror mergedas1(OCnode* dds, OCnode* das);
|
||||
static OCerror mergedods1(OCnode* dds, OCnode* das);
|
||||
static OCerror mergeother1(OCnode* root, OCnode* das);
|
||||
static char* pathtostring(OClist* path, char* separator);
|
||||
static void computefullname(OCnode* node);
|
||||
static OCerror mergeother1(OCnode* root, OCnode* das);
|
||||
static OCerror mergeother(OCnode* ddsroot, OClist* dasnodes);
|
||||
|
||||
/* Process ocnodes to fix various semantic issues*/
|
||||
void
|
||||
@ -334,13 +335,14 @@ ocddsdasmerge(OCstate* state, OCnode* dasroot, OCnode* ddsroot)
|
||||
if(das == NULL) continue;
|
||||
mergedods1(ddsroot,das);
|
||||
}
|
||||
|
||||
/* 6. Assign other orphan attributes, which means
|
||||
construct their full name and assign as a global attribute. */
|
||||
for(i=0;i<oclistlength(dasnodes);i++) {
|
||||
OCnode* das = (OCnode*)oclistget(dasnodes,i);
|
||||
if(das == NULL) continue;
|
||||
mergeother1(ddsroot, das);
|
||||
}
|
||||
construct their full name and assign as a global attribute.
|
||||
This is complicated because some servers (e.g. thredds) returns
|
||||
attributes for variables that were not referenced in the DDS.
|
||||
These we continue to suppress.
|
||||
*/
|
||||
mergeother(ddsroot,dasnodes);
|
||||
|
||||
done:
|
||||
/* cleanup*/
|
||||
@ -362,6 +364,11 @@ mergedas1(OCnode* dds, OCnode* das)
|
||||
for(i=0;i<oclistlength(das->subnodes);i++) {
|
||||
OCnode* attnode = (OCnode*)oclistget(das->subnodes,i);
|
||||
if(attnode->octype == OC_Attribute) {
|
||||
if(dds->octype == OC_Atomic
|
||||
|| dds->octype == OC_Sequence
|
||||
|| dds->octype == OC_Structure
|
||||
|| dds->octype == OC_Grid)
|
||||
attnode->att.var = dds;
|
||||
OCattribute* att = makeattribute(attnode->name,
|
||||
attnode->etype,
|
||||
attnode->att.values);
|
||||
@ -406,6 +413,19 @@ mergedods1(OCnode* dds, OCnode* dods)
|
||||
return OCTHROW(stat);
|
||||
}
|
||||
|
||||
static OCerror
|
||||
mergeother(OCnode* ddsroot, OClist* dasnodes)
|
||||
{
|
||||
OCerror stat = OC_NOERR;
|
||||
int i;
|
||||
for(i=0;i<oclistlength(dasnodes);i++) {
|
||||
OCnode* das = (OCnode*)oclistget(dasnodes,i);
|
||||
if(das == NULL) continue;
|
||||
if((stat = mergeother1(ddsroot, das))) break;
|
||||
}
|
||||
return stat;
|
||||
}
|
||||
|
||||
static OCerror
|
||||
mergeother1(OCnode* root, OCnode* das)
|
||||
{
|
||||
@ -415,6 +435,9 @@ mergeother1(OCnode* root, OCnode* das)
|
||||
OCASSERT(root != NULL);
|
||||
if(root->attributes == NULL) root->attributes = oclistnew();
|
||||
|
||||
/* Only include if this is not connected to a variable */
|
||||
if(das->att.var != NULL) goto done;
|
||||
|
||||
if(das->octype == OC_Attribute) {
|
||||
/* compute the full name of this attribute */
|
||||
computefullname(das);
|
||||
@ -431,6 +454,7 @@ mergeother1(OCnode* root, OCnode* das)
|
||||
}
|
||||
} else
|
||||
stat = OC_EDAS;
|
||||
done:
|
||||
return OCTHROW(stat);
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ typedef struct OCattinfo {
|
||||
int isglobal; /* is this supposed to be a global attribute set?*/
|
||||
int isdods; /* is this a global DODS_XXX attribute set */
|
||||
OClist* values; /* oclist<char*>*/
|
||||
struct OCnode* var; /* containing var else null */
|
||||
} OCattinfo;
|
||||
|
||||
/*! Specifies the OCnode. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user