Re: [netcdfgroup] version 4.0.1 of netCDF now available at Unidata web site...

  • To: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] version 4.0.1 of netCDF now available at Unidata web site...
  • From: Jeff Whitaker <jswhit@xxxxxxxxxxx>
  • Date: Tue, 31 Mar 2009 08:57:25 -0600
Ed Hartnett wrote:
Howdy all!

I am very happy to announce the release of version 4.0.1 of netCDF.

Version 4.0.1 provides full compatibility with existing netCDF
programs and data. This release adds performance enhancements, an
upgraded Fortran 90 API, ncdump handling of netCDF-4 features,
bug-fixes, and portability improvements.

This release also includes an experimental release of ncgen4 and the
opendap client. These features are being prepared for full release in
netCDF-4.1, but are optionally available in version 4.0.1 for intrepid
users who want to gain early access to these new features. For for
more information try:
./configure --help

A full release announcement can be found here:
http://www.unidata.ucar.edu/software/netcdf/release-notes-4.0.1.html

The 4.0.1 release can be found here:
ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.0.tar.gz

This release is widely tested. Output from successful builds on
various test machines can be found on the 4.0.1 test page (Unidata web
login required):
http://www.unidata.ucar.edu/software/netcdf/builds/4_0_1/index.jsp

Questions or suggestions about this release may be sent to
support-netcdf@xxxxxxxxxxxxxxxx, mentioning the platform and version
of the software.

Thanks!

Ed

Ed: Dennis fixed one last bug in the DAP support yesterday that didn't make it into the release. A patch is attached. Without the patch, accessing http://test.opendap.org/dap/data/nc/test.nc will cause a crash. Any chance you could update the 4.0.1 tarball to include this?

-Jeff

--
Jeffrey S. Whitaker         Phone  : (303)497-6313
Meteorologist               FAX    : (303)497-6449
NOAA/OAR/PSD  R/PSD1        Email  : Jeffrey.S.Whitaker@xxxxxxxx
325 Broadway                Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web    : http://tinyurl.com/5telg

--- libncdap3/oc/dapparselex.c.orig     2009-03-31 05:47:54.000000000 -0600
+++ libncdap3/oc/dapparselex.c  2009-03-31 05:48:34.000000000 -0600
@@ -137,7 +137,8 @@
 {
     OClist* alist = (OClist*)valuelist;
     if(alist == NULL) alist = oclistnew();
-    oclistpush(alist,(ocelem)strdup(value));
+    /* Watch out for empty values */
+    oclistpush(alist,(ocelem)nulldup(value));
     return alist;
 }
 
--- libncdap3/oc/ocnode.c.orig  2009-03-31 05:48:00.000000000 -0600
+++ libncdap3/oc/ocnode.c       2009-03-31 05:48:41.000000000 -0600
@@ -140,8 +140,7 @@
     memp = memory;
     for(i=0;i<count;i++) {
        char* value = (char*)oclistget(avset,i);
-        if(!converttype(etype,value,memp))
-           OCPANIC1("converttype failure: %d",etype);
+        converttype(etype,value,memp);
        memp += typesize;
     }
     return memory;
@@ -156,65 +155,72 @@
     char c[1];
     long long llv;
     unsigned long long ullv;
+    int outofrange = 0;
 
     switch (etype) {
     case OC_Char:
-       if(sscanf(value,"%c",c) != 1) return 0;
+       if(sscanf(value,"%c",c) != 1) goto fail;
        *((char*)memory) = c[0];
        break;
     case OC_Byte:
-       if(sscanf(value,"%ld",&iv) != 1) return 0;
-        else if(iv > OC_BYTE_MAX || iv < OC_BYTE_MIN) return 0;
+       if(sscanf(value,"%ld",&iv) != 1) goto fail;
+        else if(iv > OC_BYTE_MAX || iv < OC_BYTE_MIN) {iv = OC_BYTE_MAX; 
outofrange = 1;}
        *((signed char*)memory) = (signed char)iv;
        break;
     case OC_UByte:
-       if(sscanf(value,"%lu",&uiv) != 1) return 0;
-        else if(uiv > OC_UBYTE_MAX) return 0;
+       if(sscanf(value,"%lu",&uiv) != 1) goto fail;
+        else if(uiv > OC_UBYTE_MAX) {uiv = OC_UBYTE_MAX; outofrange = 1;}
        *((unsigned char*)memory) = (unsigned char)uiv;
        break;
     case OC_Int16:
-       if(sscanf(value,"%ld",&iv) != 1) return 0;
-        else if(iv > OC_INT16_MAX || iv < OC_INT16_MIN) return 0;
+       if(sscanf(value,"%ld",&iv) != 1) goto fail;
+        else if(iv > OC_INT16_MAX || iv < OC_INT16_MIN) {iv = OC_INT16_MAX; 
outofrange = 1;}
        *((signed short*)memory) = (signed short)iv;
        break;
     case OC_UInt16:
-       if(sscanf(value,"%ld",&uiv) != 1) return 0;
-        else if(uiv > OC_UINT16_MAX) return 0;
+       if(sscanf(value,"%ld",&uiv) != 1) goto fail;
+        else if(uiv > OC_UINT16_MAX) {uiv = OC_UINT16_MAX; outofrange = 1;}
        *((unsigned short*)memory) = (unsigned short)uiv;
        break;
     case OC_Int32:
-       if(sscanf(value,"%ld",&iv) != 1) return 0;
-        else if(iv > OC_INT32_MAX || iv < OC_INT32_MIN) return 0;
+       if(sscanf(value,"%ld",&iv) != 1) goto fail;
+        else if(iv > OC_INT32_MAX || iv < OC_INT32_MIN) {iv = OC_INT32_MAX; 
outofrange = 1;}
        *((signed int*)memory) = (signed int)iv;
        break;
     case OC_UInt32:
-       if(sscanf(value,"%ld",&uiv) != 1) return 0;
-        else if(uiv > OC_UINT32_MAX) return 0;
+       if(sscanf(value,"%ld",&uiv) != 1) goto fail;
+        else if(uiv > OC_UINT32_MAX) {uiv = OC_UINT32_MAX; outofrange = 1;}
        *((unsigned char*)memory) = (unsigned int)uiv;
        break;
     case OC_Int64:
-       if(sscanf(value,"%lld",&llv) != 1) return 0;
-        /*else if(iv > OC_INT64_MAX || iv < OC_INT64_MIN) return 0;*/
+       if(sscanf(value,"%lld",&llv) != 1) goto fail;
+        /*else if(iv > OC_INT64_MAX || iv < OC_INT64_MIN) goto fail;*/
        *((signed long long*)memory) = (signed long long)iv;
        break;
     case OC_UInt64:
-       if(sscanf(value,"%llu",&ullv) != 1) return 0;
+       if(sscanf(value,"%llu",&ullv) != 1) goto fail;
        *((unsigned long long*)memory) = (unsigned long long)ullv;
        break;
     case OC_Float32:
-       if(sscanf(value,"%lf",&dv) != 1) return 0;
+       if(sscanf(value,"%lf",&dv) != 1) goto fail;
        *((float*)memory) = (float)dv;
        break;
     case OC_Float64:
-       if(sscanf(value,"%lf",&dv) != 1) return 0;
+       if(sscanf(value,"%lf",&dv) != 1) goto fail;
        *((double*)memory) = (double)dv;
        break;
     case OC_String: case OC_URL:
        *((char**)memory) = strdup(value);
        break;
-    default: return 0;
+    default:
+       goto fail;
     }
+    if(outofrange)
+        oclog(LOGERR,"converttype range failure: %d: %s",etype,value);
     return 1;
+fail:
+    oclog(LOGERR,"converttype bad value: %d: %s",etype,value);
+    return 0;
 }
 
 /* For those nodes that are uniform in size, compute size
  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: