Official patch #2 to netcdf 1.11

Hi,

This set of patches to netcdf-1.11.1 fixes several problems identified since
the last release.

 1.  If you tried to open two or more netCDF files for writing and had more
     than one file in redefine mode at one time, a segmentation violation
     would occur on the second call to ncendef (NCENDF for FORTRAN).  The
     fix permits multiple netCDF files in redefine mode simultaneously.

 2.  The documentation in the INSTALL file was insufficiently clear in
     places, and the example for installing on an Ultrix platform contained
     a typo that could cause a mysterious failure of "make install".

 3.  The name of the large postscript file for the netCDF User's Guide was
     changed, but the old name was still in one of the Makefiles.

 4.  Slight additions were made to the man page documentation to clarify the
     range of dimension and variable IDs.

 5.  The constants for XDR infinity in the FORTRAN interface on Ultrix
     systems were changed to be consistent with the C interface.

Appended to this note is a set of context diffs to the netCDF 1.11.1
distribution, which you can apply automatically if you have Larry Wall's
"patch" program (available from numerous archive sites).  Just change to the
root directory of the netcdf distribution, save this message in a file named
patch2, and type

        patch -p1 < patch2

These patches are also available for anonymous FTP in the file
pub/netcdf-1.11-patch2 on unidata.ucar.edu.  A current version of the
distribution with these patches already applied is available as
pub/netcdf.tar.Z on unidata.ucar.edu.

--Russ

------------------ patch #2 to netcdf 1.11 ----------------------------
If the file netcdf/fortran/jackets.c exists, this file should be deleted
before starting the installation.  It was mistakenly included in an earlier
distribution.

diff -r -c1 netcdf-1.11.1/INSTALL netcdf-1.11.2/INSTALL
*** netcdf-1.11.1/INSTALL       Thu Apr  4 14:21:04 1991
--- netcdf-1.11.2/INSTALL       Wed May 15 16:31:01 1991
***************
*** 87,88 ****
--- 87,90 ----
        Testing ncfoo ...
+    and
+       *** ncbar test successful ***
  
***************
*** 94,98 ****
  
! 5) Make "clean".
  
! 6) Make "realclean" in subdirectory "fortran" this directory will be used
     to build netCDF on more than one type of machine (e.g. via a remotely-
--- 96,104 ----
  
! 5) Make "clean".  If you are installing on a Sun and have just made the
!    sharable library (the default), at this point it is recommended that you
!    also make and install a nonsharable library for use in potential future
!    debugging.  You can do this by changing LIBTYPE to "nonsharable" and
!    rerunning "make", "make install", and "make clean".
  
! 6) Make "realclean" in subdirectory "fortran" if this directory will be used
     to build netCDF on more than one type of machine (e.g. via a remotely-
***************
*** 101,107 ****
  7) Here's some examples of what worked for us on some of the platforms we
!    tested netCDF on, with the Makefile as distributed (you will also have to
!    set DESTDIR appropriately):
  
!    SunOS 4.1.1 on Sun 3 or Sun 4:
!       make
  
--- 107,117 ----
  7) Here's some examples of what worked for us on some of the platforms we
!    tested netCDF on, with the Makefile as distributed.  These correspond to
!    the "make all" step above, and provide definitions for the "anticipated"
!    macros on the command line, instead of altering them in the top-level
!    Makefile, except that we assume DESTDIR has been properly defined in the
!    top-level Maskefile.  If you are doing it this way, the subsequent "make
!    install" should have the same command-line arguments.
  
!    SunOS 4.1 or 4.1.1 on Sun 3 or Sun 4:
!       make  all
  
***************
*** 108,110 ****
     AIX 3.1 on an IBM RS 6000:
!       make FC=xlf OS=aix_3.1
  
--- 118,120 ----
     AIX 3.1 on an IBM RS 6000:
!       make FC=xlf OS=aix_3.1  all
  
***************
*** 111,113 ****
     Ultrix 4.0 on a DECstation or VAXstation:
!       make LIBTYPE=nonsharable OS=ultrix_4.0 XDRINC
  
--- 121,123 ----
     Ultrix 4.0 on a DECstation or VAXstation:
!       make LIBTYPE=nonsharable OS=ultrix_4.0 XDR_INC=  all
  
***************
*** 115,117 ****
        make CC=scc FC=cf77 FOPTS= INSTALL=install.sh LIBTYPE=nonsharable \
!            OS=unicos RANLIB=touch XDR_LD="-lrpc -lnet"
     
--- 125,127 ----
        make CC=scc FC=cf77 FOPTS= INSTALL=install.sh LIBTYPE=nonsharable \
!            OS=unicos RANLIB=touch XDR_LD="-lrpc -lnet"  all
     
***************
*** 118,120 ****
  
! Good Luck
  
--- 128,130 ----
  
! Good Luck.
  
diff -r -c1 netcdf-1.11.1/doc/Makefile netcdf-1.11.2/doc/Makefile
*** netcdf-1.11.1/doc/Makefile  Thu Apr  4 14:21:16 1991
--- netcdf-1.11.2/doc/Makefile  Wed May 15 16:31:14 1991
***************
*** 50,52 ****
  
! ug.ps: guide.dvi
!       dvips -o ug.ps guide.dvi
--- 50,52 ----
  
! guide.ps: guide.dvi
!       dvips -o guide.ps guide.dvi
diff -r -c1 netcdf-1.11.1/doc/netcdf.3 netcdf-1.11.2/doc/netcdf.3
*** netcdf-1.11.1/doc/netcdf.3  Thu Apr  4 14:21:11 1991
--- netcdf-1.11.2/doc/netcdf.3  Wed May 15 16:31:09 1991
***************
*** 232,234 ****
  \fIdimid\fP is the dimension ID returned from a previous, successful call to
! \fBncdimid(\|)\fP or \fBncdimdef(\|)\fP.
  \fIname\fP is the returned dimension name.
--- 232,235 ----
  \fIdimid\fP is the dimension ID returned from a previous, successful call to
! \fBncdimid(\|)\fP or \fBncdimdef(\|)\fP, or a small integer in the range
! from zero to the number of dimensions in the netCDF file.
  \fIname\fP is the returned dimension name.
***************
*** 294,296 ****
  \fIvarid\fP is the variable ID, returned from a previous call to 
! \fBncvardef(\|)\fP or \fBncvarid(\|)\fP.
  \fIname\fP is the returned variable name.
--- 295,298 ----
  \fIvarid\fP is the variable ID, returned from a previous call to 
! \fBncvardef(\|)\fP or \fBncvarid(\|)\fP, or a small integer in the range
! from zero to the number of variables in the netCDF file.
  \fIname\fP is the returned variable name.
diff -r -c1 netcdf-1.11.1/fortran/ultrix0.inc netcdf-1.11.2/fortran/ultrix0.inc
*** netcdf-1.11.1/fortran/ultrix0.inc   Thu Apr  4 14:21:29 1991
--- netcdf-1.11.2/fortran/ultrix0.inc   Wed May 15 16:31:26 1991
***************
*** 5,8 ****
  c
!       parameter(XDRDINF = 1.7014e+38)
!       parameter(XDRFINF = 2.93873588e-39)
  c     
--- 5,8 ----
  c
!       parameter(XDRDINF = 1.70141178e+38)
!       parameter(XDRFINF = 1.70141178e+38)
  c     
diff -r -c1 netcdf-1.11.1/src/file.c netcdf-1.11.2/src/file.c
*** netcdf-1.11.1/src/file.c    Thu Apr  4 14:22:13 1991
--- netcdf-1.11.2/src/file.c    Wed May 15 16:32:13 1991
***************
*** 4,6 ****
   */
! /*    $Id: file.c,v 1.44 1991/03/18 22:51:42 russ Exp $ */
  
--- 4,6 ----
   */
! /*    $Id: file.c,v 1.46 1991/05/08 17:27:31 davis Exp $ */
  
***************
*** 36,40 ****
  static int _ncdf = 0 ; /* number of open cdf's */
! static NC *_cdfs[MAX_NC_OPEN+1] ;
! /* _cdfs[MAX_NC_OPEN] is reserved for stash during redefinition */
! #define OLD (_cdfs[MAX_NC_OPEN])
  
--- 36,40 ----
  static int _ncdf = 0 ; /* number of open cdf's */
! static NC *_cdfs[2*MAX_NC_OPEN] ;
! /* _cdfs[MAX_NC_OPEN + id] is reserved for stash of 'id' during redefinition 
*/
! #define STASH(id) (_cdfs[MAX_NC_OPEN+(id)])
  
***************
*** 97,99 ****
        {
!               NCadvise(NC_ENOTINDEFINE, "Not in define mode") ;
        }
--- 97,100 ----
        {
!               NCadvise(NC_ENOTINDEFINE, "%s Not in define mode",
!                       _cdfs[cdfid]->path) ;
        }
***************
*** 298,301 ****
                {
!                       NC_free_cdf(OLD) ;
!                       OLD = NULL ;
                }
--- 299,302 ----
                {
!                       NC_free_cdf(STASH(cdfid)) ;
!                       STASH(cdfid) = NULL ;
                }
***************
*** 400,402 ****
        {
!               NCadvise(NC_EINDEFINE, "%s: in define mode aleady", OLD->path) ;
                return(-1) ;
--- 401,403 ----
        {
!               NCadvise(NC_EINDEFINE, "%s: in define mode aleady", 
STASH(cdfid)->path) ;
                return(-1) ;
***************
*** 478,480 ****
        _cdfs[cdfid] = new ;
!       _cdfs[MAX_NC_OPEN] = handle ;
  
--- 479,481 ----
        _cdfs[cdfid] = new ;
!       STASH(cdfid) = handle ;
  
***************
*** 640,641 ****
--- 641,643 ----
        NC_var **vpp ;
+       NC *stash = STASH(cdfid) ; /* faster rvalue */
  
***************
*** 668,671 ****
  
!               if( !(handle->flags & NC_CREAT) && OLD->vars != NULL
!                       && ii < OLD->vars->count)
                {
--- 670,673 ----
  
!               if( !(handle->flags & NC_CREAT) && stash->vars != NULL
!                       && ii < stash->vars->count)
                {
***************
*** 672,674 ****
                        /* copy data */
!                       if( !NC_vcpy(xdrs, OLD, ii) )
                                return(-1) ;
--- 674,676 ----
                        /* copy data */
!                       if( !NC_vcpy(xdrs, stash, ii) )
                                return(-1) ;
***************
*** 684,686 ****
        {
!               for(jj = 0 ; jj < OLD->numrecs ; jj++)
                {
--- 686,688 ----
        {
!               for(jj = 0 ; jj < stash->numrecs ; jj++)
                {
***************
*** 693,695 ****
                                }
!                               if( OLD->vars != NULL && ii < OLD->vars->count)
                                {
--- 695,697 ----
                                }
!                               if( stash->vars != NULL && ii < 
stash->vars->count)
                                {
***************
*** 696,698 ****
                                        /* copy data */
!                                       if( !NC_reccpy(xdrs, OLD, ii, jj) )
                                                return(-1) ;
--- 698,700 ----
                                        /* copy data */
!                                       if( !NC_reccpy(xdrs, stash, ii, jj) )
                                                return(-1) ;
***************
*** 705,707 ****
                }
!               handle->numrecs = OLD->numrecs ;
                if(!xdr_numrecs(handle->xdrs, handle) )
--- 707,709 ----
                }
!               handle->numrecs = stash->numrecs ;
                if(!xdr_numrecs(handle->xdrs, handle) )
***************
*** 719,727 ****
                /* pc style file system, macOS */
!               xdr_destroy(OLD->xdrs) ;
!               fclose(OLD->stream) ;
!               OLD->stream = NULL ;
!               OLD->xdrs->x_private = NULL ; /* xdr implementation dependent */
!               if(remove(OLD->path) != 0)
                {
!                       nc_serror("remove of %s failed", OLD->path) ;
                }
--- 721,729 ----
                /* pc style file system, macOS */
!               xdr_destroy(stash->xdrs) ;
!               fclose(stash->stream) ;
!               stash->stream = NULL ;
!               stash->xdrs->x_private = NULL ; /* xdr implementation dependent 
*/
!               if(remove(stash->path) != 0)
                {
!                       nc_serror("remove of %s failed", stash->path) ;
                }
***************
*** 732,734 ****
  #endif
!               if( rename(handle->path, OLD->path) != 0)
                {
--- 734,736 ----
  #endif
!               if( rename(handle->path, stash->path) != 0)
                {
***************
*** 737,740 ****
                        NC_free_cdf(handle) ;
!                       _cdfs[cdfid] = OLD ;
!                       OLD = NULL ;
                        handle->flags &= NC_RDWR ;
--- 739,742 ----
                        NC_free_cdf(handle) ;
!                       _cdfs[cdfid] = stash ;
!                       STASH(cdfid) = NULL ;
                        handle->flags &= NC_RDWR ;
***************
*** 742,744 ****
                }
!               (void) strncpy(handle->path, OLD->path, FILENAME_MAX) ;
  #ifdef MSDOS
--- 744,746 ----
                }
!               (void) strncpy(handle->path, stash->path, FILENAME_MAX) ;
  #ifdef MSDOS
***************
*** 753,756 ****
  #endif
!               NC_free_cdf(OLD) ;
!               OLD = NULL ;
        }
--- 755,758 ----
  #endif
!               NC_free_cdf(stash) ;
!               STASH(cdfid) = NULL ;
        }



  • 1991 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: