+ Xdfv is a developer-centric visualizer for NetCDF/HDF4/HDF5 data files. The project is available from GitHub at https://github.com/gmcgarragh/xdfv.
+
Zebra (formerly named Zeb)
is a system for data ingest, storage, integration and display, designed to operate
diff -Nru netcdf-parallel-4.7.3/docs/testserver.dox netcdf-parallel-4.7.4/docs/testserver.dox
--- netcdf-parallel-4.7.3/docs/testserver.dox 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/docs/testserver.dox 2020-08-31 10:33:26.000000000 +0000
@@ -19,7 +19,7 @@
under a Tomcat server on some machine with a known IP address
or DNS name. For example, accessing this URL.
````
-http://149.165.169.123:8080/dts/
+https://remotetest.unidata.ucar.edu/dts/
````
will bring up a page with a variety of DAP2 accessible files.
These files are accessed by the netcdf-c test case
@@ -30,7 +30,7 @@
_netcdf-c/ncdap_test/test_remote.sh_
and it accesses the test server web page with this URL.
````
-http://149.165.169.123:8080/d4ts/
+https://remotetest.unidata.ucar.edu/d4ts/
````
Setting up and Maintaining the test server involves a somewhat complex
set of tasks. This document shows how to do those tasks.
diff -Nru netcdf-parallel-4.7.3/docs/types.dox netcdf-parallel-4.7.4/docs/types.dox
--- netcdf-parallel-4.7.3/docs/types.dox 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/docs/types.dox 1970-01-01 00:00:00.000000000 +0000
@@ -1,304 +0,0 @@
-/** \file types.dox Documentation related to NetCDF Types
-Documentation of types.
-
-\page data_type Data Types
-
-\tableofcontents
-
-Data in a netCDF file may be one of the \ref external_types, or may be
-a user-defined data type (see \ref user_defined_types).
-
-\section external_types External Data Types
-
-The atomic external types supported by the netCDF interface are:
-- ::NC_BYTE 8-bit signed integer
-- ::NC_UBYTE 8-bit unsigned integer *
-- ::NC_CHAR 8-bit character
-- ::NC_SHORT 16-bit signed integer
-- ::NC_USHORT 16-bit unsigned integer *
-- ::NC_INT (or ::NC_LONG) 32-bit signed integer
-- ::NC_UINT 32-bit unsigned integer *
-- ::NC_INT64 64-bit signed integer *
-- ::NC_UINT64 64-bit unsigned integer *
-- ::NC_FLOAT 32-bit floating point
-- ::NC_DOUBLE 64-bit floating point
-- ::NC_STRING variable length character string +
-
-\remark * These types are available only for CDF5 (NC_CDF5) and netCDF-4 format (NC_NETCDF4) files. All the unsigned ints and the 64-bit ints are for CDF5 or netCDF-4 files only.
-\remark + These types are available only for netCDF-4 (NC_NETCDF4) files.
-
-These types were chosen to provide a reasonably wide range of
-trade-offs between data precision and number of bits required for each
-value. These external data types are independent from whatever
-internal data types are supported by a particular machine and language
-combination.
-
-These types are called "external", because they correspond to the
-portable external representation for netCDF data. When a program reads
-external netCDF data into an internal variable, the data is converted,
-if necessary, into the specified internal type. Similarly, if you
-write internal data into a netCDF variable, this may cause it to be
-converted to a different external type, if the external type for the
-netCDF variable differs from the internal type.
-
-The separation of external and internal types and automatic type
-conversion have several advantages. You need not be aware of the
-external type of numeric variables, since automatic conversion to or
-from any desired numeric type is available. You can use this feature
-to simplify code, by making it independent of external types, using a
-sufficiently wide internal type, e.g., double precision, for numeric
-netCDF data of several different external types. Programs need not be
-changed to accommodate a change to the external type of a variable.
-
-If conversion to or from an external numeric type is necessary, it is
-handled by the library.
-
-Converting from one numeric type to another may result in an error if
-the target type is not capable of representing the converted
-value. For example, an internal short integer type may not be able to
-hold data stored externally as an integer. When accessing an array of
-values, a range error is returned if one or more values are out of the
-range of representable values, but other values are converted
-properly.
-
-Note that mere loss of precision in type conversion does not return an
-error. Thus, if you read double precision values into a
-single-precision floating-point variable, for example, no error
-results unless the magnitude of the double precision value exceeds the
-representable range of single-precision floating point numbers on your
-platform. Similarly, if you read a large integer into a float
-incapable of representing all the bits of the integer in its mantissa,
-this loss of precision will not result in an error. If you want to
-avoid such precision loss, check the external types of the variables
-you access to make sure you use an internal type that has adequate
-precision.
-
-The names for the primitive external data types (char, byte, ubyte, short,
-ushort, int, uint, int64, uint64, float or real, double, string) are
-reserved words in CDL, so the names of variables, dimensions, and
-attributes must not be type names.
-
-It is possible to interpret byte data as either signed (-128 to 127)
-or unsigned (0 to 255). However, when reading byte data to be
-converted into other numeric types, it is interpreted as signed.
-
-For the correspondence between netCDF external data types and the data
-types of a language see \ref variables.
-
-\section classic_structures Data Structures in Classic Files
-
-The only kind of data structure directly supported by the netCDF
-classic abstraction, i.e. CDF-1, 2, and 5 formats, is a collection of named
-arrays with attached vector attributes. NetCDF is not particularly
-well-suited for storing linked lists, trees, sparse matrices, ragged
-arrays or other kinds of data structures requiring pointers.
-
-It is possible to build other kinds of data structures in netCDF
-classic formats, from sets of arrays by adopting
-various conventions regarding the use of data in one array as pointers
-into another array. The netCDF library won't provide much help or
-hindrance with constructing such data structures, but netCDF provides
-the mechanisms with which such conventions can be designed.
-
-The following netCDF classic example stores a ragged array ragged_mat
-using an attribute row_index to name an associated index variable
-giving the index of the start of each row. In this example, the first
-row contains 12 elements, the second row contains 7 elements (19 -
-12), and so on. (NetCDF-4 includes native support for variable length
-arrays. See below.)
-
-\code
- float ragged_mat(max_elements);
- ragged_mat:row_index = "row_start";
- int row_start(max_rows);
- data:
- row_start = 0, 12, 19, ...
-\endcode
-
-As another example, netCDF variables may be grouped within a netCDF
-classic dataset by defining attributes that list the
-names of the variables in each group, separated by a conventional
-delimiter such as a space or comma. Using a naming convention for
-attribute names for such groupings permits any number of named groups
-of variables. A particular conventional attribute for each variable
-might list the names of the groups of which it is a member. Use of
-attributes, or variables that refer to other attributes or variables,
-provides a flexible mechanism for representing some kinds of complex
-structures in netCDF datasets.
-
-\section nc4_user_defined_types NetCDF-4 User Defined Data Types
-
-NetCDF supported six data types through version 3.6.0 (char, byte,
-short, int, float, and double). Starting with version 4.0, many new
-data types are supported (unsigned int types, strings, compound types,
-variable length arrays, enums, opaque).
-
-In addition to the new atomic types the user may define types.
-
-Types are defined in define mode, and must be fully defined before
-they are used. New types may be added to a file by re-entering define
-mode.
-
-Once defined the type may be used to create a variable or attribute.
-
-Types may be nested in complex ways. For example, a compound type
-containing an array of VLEN types, each containing variable length
-arrays of some other compound type, etc. Users are cautioned to keep
-types simple. Reading data of complex types can be challenging for
-Fortran users.
-
-Types may be defined in any group in the data file, but they are
-always available globally in the file.
-
-Types cannot have attributes (but variables of the type may have
-attributes).
-
-Only files created with the netCDF-4/HDF5 mode flag (::NC_NETCDF4) but
-without the classic model flag (::NC_CLASSIC_MODEL) may use
-user-defined types or the new atomic data types.
-
-Once types are defined, use their ID like any other type ID when
-defining variables or attributes. Use functions
-
-- nc_put_att() / nc_get_att()
-- nc_put_var() / nc_get_var()
-- nc_put_var1() / nc_get_var1()
-- nc_put_vara() / nc_get_vara()
-- nc_put_vars() / nc_get_vars()
-
-functions to access attribute and variable data of user defined type.
-
-\subsection types_compound_types Compound Types
-
-Compound types allow the user to combine atomic and user-defined types
-into C-like structs. Since users defined types may be used within a
-compound type, they can contain nested compound types.
-
-Users define a compound type, and (in their C code) a corresponding C
-struct. They can then use nc_put_vara() and related functions to write
-multi-dimensional arrays of these structs, and nc_get_vara() calls
-to read them.
-
-While structs, in general, are not portable from platform to platform,
-the HDF5 layer (when installed) performs the magic required to figure
-out your platform's idiosyncrasies, and adjust to them. The end result
-is that HDF5 compound types (and therefore, netCDF-4 compound types),
-are portable.
-
-For more information on creating and using compound types, see
-Compound Types in The NetCDF C Interface Guide.
-
-\subsection vlen_types VLEN Types
-
-Variable length arrays can be used to create a ragged array of data,
-in which one of the dimensions varies in size from point to point.
-
-An example of VLEN use would the to store a 1-D array of dropsonde
-data, in which the data at each drop point is of variable length.
-
-There is no special restriction on the dimensionality of VLEN
-variables. It's possible to have 2D, 3D, 4D, etc. data, in which each
-point contains a VLEN.
-
-A VLEN has a base type (that is, the type that it is a VLEN of). This
-may be one of the atomic types (forming, for example, a variable
-length array of ::NC_INT), or it can be another user defined type,
-like a compound type.
-
-With VLEN data, special memory allocation and deallocation procedures
-must be followed, or memory leaks may occur.
-
-Compression is permitted but may not be effective for VLEN data,
-because the compression is applied to structures containing lengths
-and pointers to the data, rather than the actual data.
-
-For more information on creating and using variable length arrays, see
-Variable Length Arrays in The NetCDF C Interface Guide.
-
-\subsection types_opaque_types Opaque Types
-
-Opaque types allow the user to store arrays of data blobs of a fixed size.
-
-For more information on creating and using opaque types, see Opaque
-Type in The NetCDF C Interface Guide.
-
-\subsection enum_types Enum Types
-
-Enum types allow the user to specify an enumeration.
-
-For more information on creating and using enum types, see Enum Type
-in The NetCDF C Interface Guide.
-
-\section type_conversion Type Conversion
-
-Each netCDF variable has an external type, specified when the variable
-is first defined. This external type determines whether the data is
-intended for text or numeric values, and if numeric, the range and
-precision of numeric values.
-
-If the netCDF external type for a variable is char, only character
-data representing text strings can be written to or read from the
-variable. No automatic conversion of text data to a different
-representation is supported.
-
-If the type is numeric, however, the netCDF library allows you to
-access the variable data as a different type and provides automatic
-conversion between the numeric data in memory and the data in the
-netCDF variable. For example, if you write a program that deals with
-all numeric data as double-precision floating point values, you can
-read netCDF data into double-precision arrays without knowing or
-caring what the external type of the netCDF variables are. On reading
-netCDF data, integers of various sizes and single-precision
-floating-point values will all be converted to double-precision, if
-you use the data access interface for double-precision values. Of
-course, you can avoid automatic numeric conversion by using the netCDF
-interface for a value type that corresponds to the external data type
-of each netCDF variable, where such value types exist.
-
-The automatic numeric conversions performed by netCDF are easy to
-understand, because they behave just like assignment of data of one
-type to a variable of a different type. For example, if you read
-floating-point netCDF data as integers, the result is truncated
-towards zero, just as it would be if you assigned a floating-point
-value to an integer variable. Such truncation is an example of the
-loss of precision that can occur in numeric conversions.
-
-Converting from one numeric type to another may result in an error if
-the target type is not capable of representing the converted
-value. For example, an integer may not be able to hold data stored
-externally as an IEEE floating-point number. When accessing an array
-of values, a range error is returned if one or more values are out of
-the range of representable values, but other values are converted
-properly.
-
-Note that mere loss of precision in type conversion does not result in
-an error. For example, if you read double precision values into an
-integer, no error results unless the magnitude of the double precision
-value exceeds the representable range of integers on your
-platform. Similarly, if you read a large integer into a float
-incapable of representing all the bits of the integer in its mantissa,
-this loss of precision will not result in an error. If you want to
-avoid such precision loss, check the external types of the variables
-you access to make sure you use an internal type that has a compatible
-precision.
-
-Whether a range error occurs in writing a large floating-point value
-near the boundary of representable values may be depend on the
-platform. The largest floating-point value you can write to a netCDF
-float variable is the largest floating-point number representable on
-your system that is less than 2 to the 128th power. The largest double
-precision value you can write to a double variable is the largest
-double-precision number representable on your system that is less than
-2 to the 1024th power.
-
-The _uchar and _schar functions were introduced in netCDF-3 to
-eliminate an ambiguity, and support both signed and unsigned byte data.
-In netCDF-2, whether the external NC_BYTE type represented signed or
-unsigned values was left up to the user. In netcdf-3, we treat NC_BYTE
-as signed for the purposes of conversion to short, int, long, float, or
-double. (Of course, no conversion takes place when the internal type is
-signed char.) In the _uchar functions, we treat NC_BYTE as if it were
-unsigned. Thus, no NC_ERANGE error can occur converting between NC_BYTE
-and unsigned char.
-
-*/
diff -Nru netcdf-parallel-4.7.3/docs/user_defined_formats.md netcdf-parallel-4.7.4/docs/user_defined_formats.md
--- netcdf-parallel-4.7.3/docs/user_defined_formats.md 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/docs/user_defined_formats.md 1970-01-01 00:00:00.000000000 +0000
@@ -1,113 +0,0 @@
-User-Defined Formats for NetCDF {#user_defined_formats}
-===============================
-
-[TOC]
-
-User-Defined Formats {#udf_user_defined_formats}
-=====================================
-
-## Introduction {#udf_Introduction}
-
-User-defined formats allow users to write their own adaptors for the
-netCDF C library, so that it can read and (optionally) write a
-proprietary format through the netCDF API.
-
-This capability is currently experimental. It involves the exposing of internal
-netcdf interfaces and data structures that were previously invisible to users.
-This means that it is unstable and the exposed interfaces are subject to change.
-Use with caution.
-
-User-defined format code is packaged into a separate library, the
-user-defined format dispatch library. This library, when linked with
-the netCDF library, will allow user programs to read their proprietary
-format through the netCDF API. The proprietary format is treated as if
-it were one of the netCDF C library native binary formats.
-
-Coding the user-defined format dispatch library requires knowledge of
-the netCDF library internals. User-defined format dispatch libraries
-must be written in C.
-
-### Magic Numbers
-
-Some file formats use the first few bytes of the file as an identifier
-for format. For example, HDF5 files have "HDF5" as the fist 4 bytes,
-and netCDF classic files have "CDF1" as the first four bytes. This is
-called the "magic number" of the file.
-
-User-defined formats can optionally support magic numbers. If the
-user-defined format uses a magic number, and that magic number is
-associated with the user-defined format, then netCDF will be able to
-correctly identify those files from nc_open(). It will not be
-necessary for the user to know or specify the underlying format.
-
-## Using User-Defined Formats from C Programs {#udf_With_C}
-
-A user-defined format can be added dynamically in the case of C programs.
-
-```
- /* Add our test user defined format. */
- if (nc_def_user_format(NC_UDF0, &tst_dispatcher, NULL)) ERR;
-```
-
-The file can now be opened by netCDF:
-
-```
- if (nc_open(FILE_NAME, NC_UDF0, &ncid)) ERR;
-```
-
-If a magic number is used in the file, that may be passed to
-nc_def_user_format(). In that case, specifying the NC_UDF0 mode flag
-to nc_open() is optional. The nc_open() will check the file and find
-the magic number, and automatically associate the file with
-NC_UDF0. The user will not need to know the format in order to open
-the file with nc_open().
-
-## Building NetCDF C Library with a User-Defined Format Library {#udf_Build_NetCDF_With_UDF}
-
-Once a user-defined format library is created, it may built into a
-netCDF install. This allows the netCDF Fortran APIs, and the netCDF
-utilities (ncdump, ncgen, nccopy) to natively use the user-defined
-format.
-
-First the user-defined dispatch library must be built and installed.
-
-Then the netcdf-c package must be (re-)built. When building netcdf-c,
-add the location of the user-defined format dispatch library include
-file to the CPPFLAGS, and the location of the user-defined format
-dispatch library in LDFLAGS.
-
-Configure netcdf-c with the option ````--with-udf0=````.
-
-If a magic number is associated with the user-defined format, it can
-be specified with the --with-udf0-magic-number= argument.
-
-## Creating a User-Defined Format {#udf_Create_UDF}
-
-Creators of user-defined format libraries will have to become familiar
-with the internals of the netCDF-4 code.
-
-### Read-Only User-Defined Formats
-
-Many users will find that a read-only user-defined formats meets most
-of their needs. With a read-only user-defined format, netCDF will be
-able to read files of the user-defined format. Tools like ncdump and
-nccopy can work on the files.
-
-A read-only user-defined format can be implemented with only 6
-functions. The code in libhdf4 is an excellent example of a read-only
-dispatch layer.
-
-## Examples {#udf_Examples}
-
-The most simple-case example of a user-defined format is provided in
-test nc_test4/tst_udf.c.
-
-A slightly more complex example, including the required
-autoconf/automake files to build a user-defined format library, can be
-found at the [sample user-defined format
-library](https://github.com/NOAA-GSD/sample-netcdf-dispatch). In this
-example, the HDF4 SD reader is re-implemented as an external
-user-defined format. (This is unnecessary if you just want to read
-HDF4 SD files, since the netCDF C library already includes an HDF4 SD
-file reader. This user-defined format library uses the same code. It
-is repackaged as a user-defined library to provide a working sample.)
diff -Nru netcdf-parallel-4.7.3/docs/windows-binaries.md netcdf-parallel-4.7.4/docs/windows-binaries.md
--- netcdf-parallel-4.7.3/docs/windows-binaries.md 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/docs/windows-binaries.md 2020-08-31 10:33:26.000000000 +0000
@@ -32,14 +32,14 @@
* `libcurl`: 7.55.1
* `zlib`: 1.2.8
-## Latest Release (netCDF-C 4.7.3) {#msvc-latest-release}
+## Latest Release (netCDF-C 4.7.4) {#msvc-latest-release}
Configuration | 32-bit | 64-bit |
:-------------------|:-------- |:-------|
-netCDF 3 | [netCDF4.7.3-NC3-32.exe][r1] | [netCDF4.7.3-NC3-64.exe][r5]
-netCDF3+DAP | [netCDF4.7.3-NC3-DAP-32.exe][r2] | [netCDF4.7.3-NC3-DAP-64.exe][r6]
-netCDF4 | [netCDF4.7.3-NC4-32.exe][r3] | [netCDF4.7.3-NC4-64.exe][r7]
-netCDF4+DAP | [netCDF4.7.3-NC4-DAP-32.exe][r4] | [netCDF4.7.3-NC4-DAP-64.exe][r8]
+netCDF 3 | [netCDF4.7.4-NC3-32.exe][r1] | [netCDF4.7.4-NC3-64.exe][r5]
+netCDF3+DAP | [netCDF4.7.4-NC3-DAP-32.exe][r2] | [netCDF4.7.4-NC3-DAP-64.exe][r6]
+netCDF4 | [netCDF4.7.4-NC4-32.exe][r3] | [netCDF4.7.4-NC4-64.exe][r7]
+netCDF4+DAP | [netCDF4.7.4-NC4-DAP-32.exe][r4] | [netCDF4.7.4-NC4-DAP-64.exe][r8]
# Using the netCDF-C Libraries with Visual Studio {#msvc-using}
@@ -60,11 +60,11 @@
1. When building the netCDF-C libraries with netCDF4 support, using the `Debug` libraries may cause extraneous warnings. These warnings are related to cross-dll memory management, and appear to be harmless. You can safely ignore them by using the `Release` libraries. [NCF-220]
-[r1]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC3-32.exe
-[r2]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC3-DAP-32.exe
-[r3]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC4-32.exe
-[r4]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC4-DAP-32.exe
-[r5]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC3-64.exe
-[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC3-DAP-64.exe
-[r7]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC4-64.exe
-[r8]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.3-NC4-DAP-64.exe
+[r1]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC3-32.exe
+[r2]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC3-DAP-32.exe
+[r3]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC4-32.exe
+[r4]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC4-DAP-32.exe
+[r5]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC3-64.exe
+[r6]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC3-DAP-64.exe
+[r7]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC4-64.exe
+[r8]: http://www.unidata.ucar.edu/downloads/netcdf/ftp/netCDF4.7.4-NC4-DAP-64.exe
diff -Nru netcdf-parallel-4.7.3/examples/C/filter_example.c netcdf-parallel-4.7.4/examples/C/filter_example.c
--- netcdf-parallel-4.7.3/examples/C/filter_example.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/examples/C/filter_example.c 2020-08-31 10:33:26.000000000 +0000
@@ -48,6 +48,7 @@
#include
#include "netcdf.h"
+#include "netcdf_filter.h"
/* The HDF assigned id for bzip compression */
#define BZIP2_ID 307
@@ -169,7 +170,6 @@
{
int i;
unsigned int level = BZIP2_LEVEL;
- unsigned int id=0;
size_t nparams = 0;
printf("\n*** Testing API: bzip2 compression.\n");
@@ -204,8 +204,8 @@
/* Read back the compression info and verify it */
level = 0;
- CHECK(nc_inq_var_filter(ncid,varid,&id,&nparams,&level));
- if(id != BZIP2_ID || nparams != 1 || level != BZIP2_LEVEL) {
+ CHECK(nc_inq_var_filter_info(ncid,varid,BZIP2_ID,&nparams,&level));
+ if(nparams != 1 || level != BZIP2_LEVEL) {
printf("test_filter: filter def/inq mismatch\n");
return NC_EFILTER;
}
diff -Nru netcdf-parallel-4.7.3/examples/C/Makefile.in netcdf-parallel-4.7.4/examples/C/Makefile.in
--- netcdf-parallel-4.7.3/examples/C/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/examples/C/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -572,8 +572,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -613,11 +615,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/examples/CDL/Makefile.in netcdf-parallel-4.7.4/examples/CDL/Makefile.in
--- netcdf-parallel-4.7.3/examples/CDL/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/examples/CDL/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -396,8 +396,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -437,11 +439,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/examples/Makefile.in netcdf-parallel-4.7.4/examples/Makefile.in
--- netcdf-parallel-4.7.3/examples/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/examples/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -255,8 +255,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -296,11 +298,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/.gitignore netcdf-parallel-4.7.4/.gitignore
--- netcdf-parallel-4.7.3/.gitignore 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/.gitignore 2020-08-31 10:33:26.000000000 +0000
@@ -1,3 +1,6 @@
+### 'Normal' gitignore files.
+nug.tag
+netcdf-c.tag
autom4te.cache
debug.txt
CTestConfig.cmake
diff -Nru netcdf-parallel-4.7.3/h5_test/CMakeLists.txt netcdf-parallel-4.7.4/h5_test/CMakeLists.txt
--- netcdf-parallel-4.7.3/h5_test/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -19,3 +19,8 @@
)
ADD_TEST(${CTEST} ${EXECUTABLE_OUTPUT_PATH}/${CTEST})
ENDFOREACH()
+
+IF(TEST_PARALLEL4)
+ build_bin_test(tst_h_par)
+ add_sh_test(h5_test run_par_tests)
+ENDIF()
diff -Nru netcdf-parallel-4.7.3/h5_test/Makefile.am netcdf-parallel-4.7.4/h5_test/Makefile.am
--- netcdf-parallel-4.7.3/h5_test/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -39,9 +39,11 @@
endif
# We must include these files in the distribution.
-EXTRA_DIST = run_par_tests.sh ref_tst_h_compounds.h5 \
+EXTRA_DIST = run_par_tests.sh.in ref_tst_h_compounds.h5 \
ref_tst_h_compounds2.h5 run_par_tests.sh ref_tst_compounds.nc \
h5_err_macros.h CMakeLists.txt
# Clean up test results.
CLEANFILES = tst_h_*.h5
+
+DISTCLEANFILES = run_par_test.sh
diff -Nru netcdf-parallel-4.7.3/h5_test/Makefile.in netcdf-parallel-4.7.4/h5_test/Makefile.in
--- netcdf-parallel-4.7.3/h5_test/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -128,7 +128,7 @@
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = run_par_tests.sh
CONFIG_CLEAN_VPATH_FILES =
@BUILD_BENCHMARKS_TRUE@am__EXEEXT_1 = tst_h_mem$(EXEEXT)
am__EXEEXT_2 = tst_h_files$(EXEEXT) tst_h_files2$(EXEEXT) \
@@ -531,8 +531,9 @@
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
- $(top_srcdir)/lib_flags.am $(top_srcdir)/test-driver
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/run_par_tests.sh.in \
+ $(top_srcdir)/depcomp $(top_srcdir)/lib_flags.am \
+ $(top_srcdir)/test-driver
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
@@ -595,8 +596,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -636,11 +639,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -746,13 +749,14 @@
$(am__append_2)
# We must include these files in the distribution.
-EXTRA_DIST = run_par_tests.sh ref_tst_h_compounds.h5 \
+EXTRA_DIST = run_par_tests.sh.in ref_tst_h_compounds.h5 \
ref_tst_h_compounds2.h5 run_par_tests.sh ref_tst_compounds.nc \
h5_err_macros.h CMakeLists.txt
# Clean up test results.
CLEANFILES = tst_h_*.h5
+DISTCLEANFILES = run_par_test.sh
all: all-am
.SUFFIXES:
@@ -787,6 +791,8 @@
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+run_par_tests.sh: $(top_builddir)/config.status $(srcdir)/run_par_tests.sh.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -1458,6 +1464,7 @@
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
diff -Nru netcdf-parallel-4.7.3/h5_test/run_par_tests.sh netcdf-parallel-4.7.4/h5_test/run_par_tests.sh
--- netcdf-parallel-4.7.3/h5_test/run_par_tests.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/run_par_tests.sh 1970-01-01 00:00:00.000000000 +0000
@@ -1,27 +0,0 @@
-#!/bin/sh
-# Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
-# 2015, 2016, 2017, 2018
-# University Corporation for Atmospheric Research/Unidata.
-
-# See netcdf-c/COPYRIGHT file for more info.
-
-if test "x$srcdir" = x ; then srcdir=`pwd`; fi
-. ../test_common.sh
-
-# This shell runs some parallel tests.
-
-# $Id: run_par_tests.sh,v 1.2 2007/12/20 16:25:26 ed Exp $
-
-# Even for successful runs, mpiexec seems to set a non-zero return
-# code!
-set -e
-echo ""
-echo "Testing parallel I/O with HDF5..."
-
-mpiexec -n 1 ./tst_h_par
-mpiexec -n 2 ./tst_h_par
-mpiexec -n 4 ./tst_h_par
-echo "SUCCESS!!!"
-
-exit 0
diff -Nru netcdf-parallel-4.7.3/h5_test/run_par_tests.sh.in netcdf-parallel-4.7.4/h5_test/run_par_tests.sh.in
--- netcdf-parallel-4.7.3/h5_test/run_par_tests.sh.in 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/run_par_tests.sh.in 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,20 @@
+#!/bin/sh
+# Copyright 2020 University Corporation for Atmospheric
+# Research/Unidata. See netcdf-c/COPYRIGHT file for more info.
+
+# This shell runs some parallel HDF5 tests.
+
+# Ed Hartnett
+
+if test "x$srcdir" = x ; then srcdir=`pwd`; fi
+. ../test_common.sh
+
+echo ""
+echo "Testing parallel I/O with HDF5..."
+
+@MPIEXEC@ -n 1 ./tst_h_par
+@MPIEXEC@ -n 2 ./tst_h_par
+@MPIEXEC@ -n 4 ./tst_h_par
+echo "SUCCESS!!!"
+
+exit 0
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_atts3.c netcdf-parallel-4.7.4/h5_test/tst_h_atts3.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_atts3.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_atts3.c 2020-08-31 10:33:26.000000000 +0000
@@ -46,7 +46,11 @@
hid_t file_typeid1[NUM_OBJ], native_typeid1[NUM_OBJ];
hid_t file_typeid2, native_typeid2;
hsize_t num_obj;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
char obj_name[STR_LEN + 1];
hsize_t dims[1] = {ATT_LEN}; /* netcdf attributes always 1-D. */
struct s1
@@ -148,8 +152,14 @@
for (i = 0; i < num_obj; i++)
{
/* Get the name, and make sure this is a type. */
+
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_NAME, H5_ITER_INC, i,
obj_name, STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
if (obj_info.type != H5O_TYPE_NAMED_DATATYPE) ERR;
@@ -267,8 +277,13 @@
for (i = 0; i < num_obj; i++)
{
/* Get the name, and make sure this is a type. */
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_NAME, H5_ITER_INC, i,
obj_name, STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
if (obj_info.type != H5O_TYPE_NAMED_DATATYPE) ERR;
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_atts4.c netcdf-parallel-4.7.4/h5_test/tst_h_atts4.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_atts4.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_atts4.c 2020-08-31 10:33:26.000000000 +0000
@@ -49,7 +49,11 @@
hid_t file_typeid1[NUM_OBJ_2], native_typeid1[NUM_OBJ_2];
hid_t file_typeid2, native_typeid2;
hsize_t num_obj;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
char obj_name[STR_LEN + 1];
hsize_t dims[1] = {ATT_LEN}; /* netcdf attributes always 1-D. */
struct s1
@@ -139,8 +143,13 @@
for (i = 0; i < num_obj; i++)
{
/* Get the name, and make sure this is a type. */
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_NAME, H5_ITER_INC, i,
obj_name, STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
if (obj_info.type != H5O_TYPE_NAMED_DATATYPE) ERR;
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_compounds2.c netcdf-parallel-4.7.4/h5_test/tst_h_compounds2.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_compounds2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_compounds2.c 2020-08-31 10:33:26.000000000 +0000
@@ -48,7 +48,11 @@
hsize_t dims[1];
hsize_t num_obj, i_obj;
char obj_name[STR_LEN + 1];
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
hid_t fapl_id, fcpl_id;
htri_t equal;
char file_in[STR_LEN * 2];
@@ -131,8 +135,13 @@
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
for (i_obj = 0; i_obj < num_obj; i_obj++)
{
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i_obj, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i_obj, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i_obj, obj_name, STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
@@ -194,8 +203,13 @@
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
for (i_obj = 0; i_obj < num_obj; i_obj++)
{
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, &obj_info,
+ H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, &obj_info,
H5P_DEFAULT) < 0) ERR;
+#endif
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, obj_name,
STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_files4.c netcdf-parallel-4.7.4/h5_test/tst_h_files4.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_files4.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_files4.c 2020-08-31 10:33:26.000000000 +0000
@@ -44,14 +44,23 @@
*/
herr_t
-op_func (hid_t g_id, const char *name, const H5L_info_t *info,
+op_func (hid_t g_id, const char *name,
+#if H5_VERSION_GE(1,12,0)
+ const H5L_info2_t *info,
+#else
+ const H5L_info_t *info,
+#endif
void *op_data)
{
hid_t id;
H5I_type_t obj_type;
strcpy((char *)op_data, name);
+#if H5_VERSION_GE(1,12,0)
+ if ((id = H5Oopen_by_token(g_id, info->u.token)) < 0) ERR;
+#else
if ((id = H5Oopen_by_addr(g_id, info->u.address)) < 0) ERR;
+#endif
/* Using H5Ovisit is really slow. Use H5Iget_type for a fast
* answer. */
@@ -169,7 +178,11 @@
{
hid_t fapl_id, fileid, grpid;
H5_index_t idx_field = H5_INDEX_CRT_ORDER;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
hsize_t num_obj;
ssize_t size;
char obj_name[STR_LEN + 1];
@@ -186,8 +199,13 @@
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
for (i = 0; i < num_obj; i++)
{
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT)) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT)) ERR;
+#endif
if ((size = H5Lget_name_by_idx(grpid, ".", idx_field, H5_ITER_INC, i,
NULL, 0, H5P_DEFAULT)) < 0) ERR;
if (H5Lget_name_by_idx(grpid, ".", idx_field, H5_ITER_INC, i,
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_files.c netcdf-parallel-4.7.4/h5_test/tst_h_files.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_files.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_files.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,10 +1,12 @@
/* This is part of the netCDF package.
- Copyright 2018 University Corporation for Atmospheric Research/Unidata
+ Copyright 2020 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Test HDF5 file code. These are not intended to be exhaustive tests,
but they use HDF5 the same way that netCDF-4 does, so if these
tests don't work, than netCDF-4 won't work either.
+
+ Ed Hartnett
*/
#include "h5_err_macros.h"
@@ -18,357 +20,351 @@
int
main()
{
- printf("\n*** Checking HDF5 file functions.\n");
- printf("*** Checking HDF5 file creates and opens...");
+ printf("\n*** Checking HDF5 file functions.\n");
+ printf("*** Checking HDF5 file creates and opens...");
#define OPAQUE_SIZE 20
#define OPAQUE_NAME "type"
#define ATT_NAME "att_name"
#define DIM_LEN 3
- {
- hid_t fileid, access_plist, typeid, spaceid, attid, fapl_id, grpid;
- hsize_t dims[1]; /* netcdf attributes always 1-D. */
- unsigned char data[DIM_LEN][OPAQUE_SIZE];
- hsize_t num_obj, i;
- int obj_class;
- char obj_name[STR_LEN + 1];
- H5T_class_t class;
- int j, k;
- hid_t tmp1;
-
- H5open();
-
- /* Initialize some data. */
- for (j = 0; j < DIM_LEN; j++)
- for (k = 0; k < OPAQUE_SIZE; k++)
- data[j][k] = 42;
-
- /* Set the access list so that closes will fail if something is
- * still open in the file. */
- tmp1 = H5P_FILE_ACCESS;
- if ((access_plist = H5Pcreate(tmp1)) < 0) ERR;
- if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_SEMI)) ERR;
-
- /* Create file. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- access_plist)) < 0) ERR;
- /* Add an opaque type. */
- if ((typeid = H5Tcreate(H5T_OPAQUE, OPAQUE_SIZE)) < 0) ERR;
- if (H5Tcommit(fileid, OPAQUE_NAME, typeid) < 0) ERR;
-
- /* Add attribute of this type. */
- dims[0] = 3;
- if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
- if ((attid = H5Acreate(fileid, ATT_NAME, typeid, spaceid,
- H5P_DEFAULT)) < 0) ERR;
- if (H5Awrite(attid, typeid, data) < 0) ERR;
-
- if (H5Aclose(attid) < 0) ERR;
- if (H5Sclose(spaceid) < 0) ERR;
- if (H5Tclose(typeid) < 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
- if (H5Pclose(access_plist) < 0) ERR;
-
- if (H5Eset_auto(NULL, NULL) < 0) ERR;
-
- /* Reopen the file. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- /*if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI)) ERR;*/
- if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG)) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
-
- if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
- for (i = 0; i < num_obj; i++)
- {
- if ((obj_class = H5Gget_objtype_by_idx(grpid, i)) < 0) ERR;
- if (H5Gget_objname_by_idx(grpid, i, obj_name,
- STR_LEN) < 0) ERR;
- if (obj_class != H5G_TYPE) ERR;
- if ((typeid = H5Topen(grpid, obj_name)) < 0) ERR;
- if ((class = H5Tget_class(typeid)) < 0) ERR;
- if (class != H5T_OPAQUE) ERR;
- if (!(H5Tget_size(typeid))) ERR;
- }
-
- /* Close everything. */
- if (H5Pclose(fapl_id)) ERR;
- if (H5Gclose(grpid) < 0) ERR;
- /*if (H5Tclose(typeid) < 0) ERR;*/
- if (H5Fclose(fileid) < 0) ERR;
-
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI)) ERR;
- if ((fileid = H5Fopen(FILE_NAME, 0, fapl_id)) < 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
-
- }
- SUMMARIZE_ERR;
-
- printf("*** Checking HDF5 file creates and opens some more...");
- {
- int objs;
- hid_t fileid, fileid2, grpid, access_plist;
-
- /* Set the access list so that closes will fail if something is
- * still open in the file. */
- if ((access_plist = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_SEMI)) ERR;
-
- /* Create file and create group. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- access_plist)) < 0) ERR;
- if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-
- /* How many open objects are there? */
- if ((objs = H5Fget_obj_count(fileid, H5F_OBJ_ALL)) < 0) ERR;
- if (objs != 2) ERR;
- if ((objs = H5Fget_obj_count(fileid, H5F_OBJ_GROUP)) < 0) ERR;
- if (objs != 1) ERR;
-
- /* Turn off HDF5 error messages. */
- if (H5Eset_auto(NULL, NULL) < 0) ERR;
-
- /* This H5Fclose should fail, because I didn't close the group. */
- if (H5Fclose(fileid) >= 0) ERR;
-
- /* Now close the group first, and then the file. */
- if (H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0) ERR;
-
- /* Now create the file again, to make sure that it really is not
- * just nearly dead, but really most sincerely dead. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- access_plist)) < 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
-
- /* Confirm that the same file can be opened twice at the same time,
- * for read only access. */
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if ((fileid2 = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
- if (H5Fclose(fileid2) < 0) ERR;
-
- /* Once open for read only access, the file can't be opened again
- * for write access. */
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if (H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT) >= 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
-
- /* But you can open the file for read/write access, and then open
- * it again for read only access. */
- if ((fileid2 = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
- if (H5Fclose(fileid2) < 0) ERR;
- }
- SUMMARIZE_ERR;
+ {
+ hid_t fileid, access_plist, typeid, spaceid, attid, fapl_id, grpid;
+ hsize_t dims[1]; /* netcdf attributes always 1-D. */
+ unsigned char data[DIM_LEN][OPAQUE_SIZE];
+ hsize_t num_obj, i;
+ int obj_class;
+ char obj_name[STR_LEN + 1];
+ H5T_class_t class;
+ int j, k;
+ hid_t tmp1;
+
+ H5open();
+
+ /* Initialize some data. */
+ for (j = 0; j < DIM_LEN; j++)
+ for (k = 0; k < OPAQUE_SIZE; k++)
+ data[j][k] = 42;
+
+ /* Set the access list so that closes will fail if something is
+ * still open in the file. */
+ tmp1 = H5P_FILE_ACCESS;
+ if ((access_plist = H5Pcreate(tmp1)) < 0) ERR;
+ if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_SEMI)) ERR;
+
+ /* Create file. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ access_plist)) < 0) ERR;
+ /* Add an opaque type. */
+ if ((typeid = H5Tcreate(H5T_OPAQUE, OPAQUE_SIZE)) < 0) ERR;
+ if (H5Tcommit(fileid, OPAQUE_NAME, typeid) < 0) ERR;
+
+ /* Add attribute of this type. */
+ dims[0] = 3;
+ if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
+ if ((attid = H5Acreate(fileid, ATT_NAME, typeid, spaceid,
+ H5P_DEFAULT)) < 0) ERR;
+ if (H5Awrite(attid, typeid, data) < 0) ERR;
+
+ if (H5Aclose(attid) < 0) ERR;
+ if (H5Sclose(spaceid) < 0) ERR;
+ if (H5Tclose(typeid) < 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+ if (H5Pclose(access_plist) < 0) ERR;
+
+ if (H5Eset_auto(NULL, NULL) < 0) ERR;
+
+ /* Reopen the file. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ /*if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI)) ERR;*/
+ if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG)) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
+ for (i = 0; i < num_obj; i++)
+ {
+ if ((obj_class = H5Gget_objtype_by_idx(grpid, i)) < 0) ERR;
+ if (H5Gget_objname_by_idx(grpid, i, obj_name,
+ STR_LEN) < 0) ERR;
+ if (obj_class != H5G_TYPE) ERR;
+ if ((typeid = H5Topen(grpid, obj_name)) < 0) ERR;
+ if ((class = H5Tget_class(typeid)) < 0) ERR;
+ if (class != H5T_OPAQUE) ERR;
+ if (!(H5Tget_size(typeid))) ERR;
+ }
+
+ /* Close everything. */
+ if (H5Pclose(fapl_id)) ERR;
+ if (H5Gclose(grpid) < 0) ERR;
+ /*if (H5Tclose(typeid) < 0) ERR;*/
+ if (H5Fclose(fileid) < 0) ERR;
+
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI)) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, 0, fapl_id)) < 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+
+ }
+ SUMMARIZE_ERR;
+
+ printf("*** Checking HDF5 file creates and opens some more...");
+ {
+ int objs;
+ hid_t fileid, fileid2, grpid, access_plist;
+
+ /* Set the access list so that closes will fail if something is
+ * still open in the file. */
+ if ((access_plist = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_SEMI)) ERR;
+
+ /* Create file and create group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ access_plist)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* How many open objects are there? */
+ if ((objs = H5Fget_obj_count(fileid, H5F_OBJ_ALL)) < 0) ERR;
+ if (objs != 2) ERR;
+ if ((objs = H5Fget_obj_count(fileid, H5F_OBJ_GROUP)) < 0) ERR;
+ if (objs != 1) ERR;
+
+ /* Turn off HDF5 error messages. */
+ if (H5Eset_auto(NULL, NULL) < 0) ERR;
+
+ /* This H5Fclose should fail, because I didn't close the group. */
+ if (H5Fclose(fileid) >= 0) ERR;
+
+ /* Now close the group first, and then the file. */
+ if (H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0) ERR;
+
+ /* Now create the file again, to make sure that it really is not
+ * just nearly dead, but really most sincerely dead. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ access_plist)) < 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+
+ /* Confirm that the same file can be opened twice at the same time,
+ * for read only access. */
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((fileid2 = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+ if (H5Fclose(fileid2) < 0) ERR;
+
+ /* Once open for read only access, the file can't be opened again
+ * for write access. */
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if (H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT) >= 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+
+ /* But you can open the file for read/write access, and then open
+ * it again for read only access. */
+ if ((fileid2 = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+ if (H5Fclose(fileid2) < 0) ERR;
+ }
+ SUMMARIZE_ERR;
- printf("*** Creating file...");
- {
+ printf("*** Creating file...");
+ {
#define VAR_NAME "HALs_memory"
#define NDIMS 1
#define DIM1_LEN 40000
#define SC 10000 /* slice count. */
#define MILLION 1000000
- hid_t fileid, write_spaceid, datasetid, mem_spaceid;
- hsize_t start[NDIMS], count[NDIMS];
- hsize_t dims[1];
- int *data;
- int num_steps;
- int i, s;
-
- /* We will write the same slice of random data over and over to
- * fill the file. */
- if (!(data = malloc(SC * sizeof(int))))
- ERR_RET;
- for (i = 0; i < SC; i++)
- data[i] = rand();
-
- /* Create file. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT)) < 0) ERR;
-
- /* Create a space to deal with one slice in memory. */
- dims[0] = SC;
- if ((mem_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Create a space to write all slices. */
- dims[0] = DIM1_LEN;
- if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Create dataset. */
- if ((datasetid = H5Dcreate1(fileid, VAR_NAME, H5T_NATIVE_INT,
- write_spaceid, H5P_DEFAULT)) < 0) ERR;
-
- /* Write the data in num_step steps. */
- num_steps = DIM1_LEN/SC;
- count[0] = SC;
- for (s = 0; s < num_steps; s++)
- {
- /* Select hyperslab for write of one slice. */
- start[0] = s * SC;
- if (H5Sselect_hyperslab(write_spaceid, H5S_SELECT_SET,
- start, NULL, count, NULL) < 0) ERR;
-
- if (H5Dwrite(datasetid, H5T_NATIVE_INT, mem_spaceid, write_spaceid,
- H5P_DEFAULT, data) < 0) ERR;
- }
-
- /* Close. */
- free(data);
- if (H5Dclose(datasetid) < 0 ||
- H5Sclose(write_spaceid) < 0 ||
- H5Sclose(mem_spaceid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- SUMMARIZE_ERR;
+ hid_t fileid, write_spaceid, datasetid, mem_spaceid;
+ hsize_t start[NDIMS], count[NDIMS];
+ hsize_t dims[1];
+ int *data;
+ int num_steps;
+ int i, s;
+
+ /* We will write the same slice of random data over and over to
+ * fill the file. */
+ if (!(data = malloc(SC * sizeof(int))))
+ ERR_RET;
+ for (i = 0; i < SC; i++)
+ data[i] = rand();
+
+ /* Create file. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+
+ /* Create a space to deal with one slice in memory. */
+ dims[0] = SC;
+ if ((mem_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Create a space to write all slices. */
+ dims[0] = DIM1_LEN;
+ if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Create dataset. */
+ if ((datasetid = H5Dcreate1(fileid, VAR_NAME, H5T_NATIVE_INT,
+ write_spaceid, H5P_DEFAULT)) < 0) ERR;
+
+ /* Write the data in num_step steps. */
+ num_steps = DIM1_LEN/SC;
+ count[0] = SC;
+ for (s = 0; s < num_steps; s++)
+ {
+ /* Select hyperslab for write of one slice. */
+ start[0] = s * SC;
+ if (H5Sselect_hyperslab(write_spaceid, H5S_SELECT_SET,
+ start, NULL, count, NULL) < 0) ERR;
+
+ if (H5Dwrite(datasetid, H5T_NATIVE_INT, mem_spaceid, write_spaceid,
+ H5P_DEFAULT, data) < 0) ERR;
+ }
+
+ /* Close. */
+ free(data);
+ if (H5Dclose(datasetid) < 0 ||
+ H5Sclose(write_spaceid) < 0 ||
+ H5Sclose(mem_spaceid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ SUMMARIZE_ERR;
#ifdef LARGE_FILE_TESTS
#define NDIMS2 2
#define DIM1 2048
-#define DIM2 2097153 /* DIM1*DIM2*sizeof(char) > 2**32 */
+#define DIM2 2097153 /* DIM1*DIM2*sizeof(char) > 2**32 */
#define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable."
#define VAR_NAME2 "var"
#define MAX_DIMS 255
- printf("*** large file test for HDF5...");
- {
- hid_t fapl_id, fcpl_id, fileid, grpid, spaceid, datasetid;
- hid_t dim1_dimscaleid, dim2_dimscaleid, plistid, file_spaceid;
- hid_t mem_spaceid, xfer_plistid, native_typeid;
- hsize_t *chunksize, dims[1], maxdims[1], *dimsize, *maxdimsize;
- hsize_t fdims[MAX_DIMS], fmaxdims[MAX_DIMS];
- hsize_t start[MAX_DIMS], count[MAX_DIMS];
- char file_name[STR_LEN + 1];
- char dimscale_wo_var[STR_LEN];
- void *bufr;
- void *fillp = NULL;
-
- sprintf(file_name, "%s/%s", TEMP_LARGE, FILE_NAME);
-
- /* Create file access and create property lists. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
-
- /* Set latest_format in access propertly list. This ensures that
- * the latest, greatest, HDF5 versions are used in the file. */
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
-
- /* Set H5P_CRT_ORDER_TRACKED in the creation property list. This
- * turns on HDF5 creation ordering in the file. */
- if (H5Pset_link_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
- H5P_CRT_ORDER_INDEXED)) < 0) ERR;
- if (H5Pset_attr_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
- H5P_CRT_ORDER_INDEXED)) < 0) ERR;
+ printf("*** large file test for HDF5...");
+ {
+ hid_t fapl_id, fcpl_id, fileid, grpid, spaceid, datasetid;
+ hid_t dim1_dimscaleid, dim2_dimscaleid, plistid, file_spaceid;
+ hid_t mem_spaceid, xfer_plistid, native_typeid;
+ hsize_t *chunksize, dims[1], maxdims[1], *dimsize, *maxdimsize;
+ hsize_t fdims[MAX_DIMS], fmaxdims[MAX_DIMS];
+ hsize_t start[MAX_DIMS], count[MAX_DIMS];
+ char file_name[STR_LEN + 1];
+ char dimscale_wo_var[STR_LEN];
+ void *bufr;
+ void *fillp = NULL;
+
+ sprintf(file_name, "%s/%s", TEMP_LARGE, FILE_NAME);
+
+ /* Create file access and create property lists. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+
+ /* Set latest_format in access propertly list. This ensures that
+ * the latest, greatest, HDF5 versions are used in the file. */
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+
+ /* Set H5P_CRT_ORDER_TRACKED in the creation property list. This
+ * turns on HDF5 creation ordering in the file. */
+ if (H5Pset_link_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
+ H5P_CRT_ORDER_INDEXED)) < 0) ERR;
+ if (H5Pset_attr_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
+ H5P_CRT_ORDER_INDEXED)) < 0) ERR;
- /* Create the file. */
- if ((fileid = H5Fcreate(file_name, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+ /* Create the file. */
+ if ((fileid = H5Fcreate(file_name, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
- /* Open the root group. */
- if ((grpid = H5Gopen2(fileid, "/", H5P_DEFAULT)) < 0) ERR;
+ /* Open the root group. */
+ if ((grpid = H5Gopen2(fileid, "/", H5P_DEFAULT)) < 0) ERR;
- /* Set up the dataset creation property list for the two dimensions. */
+ /* Set up the dataset creation property list for the two dimensions. */
/* if (H5Pset_chunk(plistid, 1, chunksize) < 0) ERR;*/
- /* Create the dim1 dimscale. */
- if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
- dims[0] = DIM1;
- maxdims[0] = DIM1;
- if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
- if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
- H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((dim1_dimscaleid = H5Dcreate(grpid, "dim1", H5T_IEEE_F32BE,
- spaceid, plistid)) < 0) ERR;
- if (H5Sclose(spaceid) < 0) ERR;
- if (H5Pclose(plistid) < 0) ERR;
- sprintf(dimscale_wo_var, "%s%10d", DIM_WITHOUT_VARIABLE, DIM1);
- if (H5DSset_scale(dim1_dimscaleid, dimscale_wo_var) < 0) ERR;
-
- /* Create the dim2 dimscale. */
- if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
- dims[0] = DIM2;
- maxdims[0] = DIM2;
- if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
- if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
- H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((dim2_dimscaleid = H5Dcreate(grpid, "dim2", H5T_IEEE_F32BE,
- spaceid, plistid)) < 0) ERR;
- if (H5Sclose(spaceid) < 0) ERR;
- if (H5Pclose(plistid) < 0) ERR;
- sprintf(dimscale_wo_var, "%s%10d", DIM_WITHOUT_VARIABLE, DIM2);
- if (H5DSset_scale(dim2_dimscaleid, dimscale_wo_var) < 0) ERR;
-
- /* Now create the 2D dataset. */
- if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
- if (!(fillp = malloc(1))) ERR;
+ /* Create the dim1 dimscale. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+ dims[0] = DIM1;
+ maxdims[0] = DIM1;
+ if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
+ if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
+ H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((dim1_dimscaleid = H5Dcreate(grpid, "dim1", H5T_IEEE_F32BE,
+ spaceid, plistid)) < 0) ERR;
+ if (H5Sclose(spaceid) < 0) ERR;
+ if (H5Pclose(plistid) < 0) ERR;
+ sprintf(dimscale_wo_var, "%s%10d", DIM_WITHOUT_VARIABLE, DIM1);
+ if (H5DSset_scale(dim1_dimscaleid, dimscale_wo_var) < 0) ERR;
+
+ /* Create the dim2 dimscale. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+ dims[0] = DIM2;
+ maxdims[0] = DIM2;
+ if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
+ if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
+ H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((dim2_dimscaleid = H5Dcreate(grpid, "dim2", H5T_IEEE_F32BE,
+ spaceid, plistid)) < 0) ERR;
+ if (H5Sclose(spaceid) < 0) ERR;
+ if (H5Pclose(plistid) < 0) ERR;
+ sprintf(dimscale_wo_var, "%s%10d", DIM_WITHOUT_VARIABLE, DIM2);
+ if (H5DSset_scale(dim2_dimscaleid, dimscale_wo_var) < 0) ERR;
+
+ /* Now create the 2D dataset. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+ if (!(fillp = malloc(1))) ERR;
#define FILL_BYTE 255
- *(signed char *)fillp = FILL_BYTE;
- if(H5Pset_fill_value(plistid, H5T_NATIVE_SCHAR, fillp) < 0) ERR;
- if (!(chunksize = malloc(NDIMS2 * sizeof(hsize_t)))) ERR;
- chunksize[0] = 1024;
- chunksize[1] = 1048576;
- if (H5Pset_chunk(plistid, NDIMS2, chunksize) < 0) ERR;
- if (!(dimsize = malloc(NDIMS2 * sizeof(hsize_t)))) ERR;
- if (!(maxdimsize = malloc(NDIMS2 * sizeof(hsize_t)))) ERR;
- dimsize[0] = 2048;
- dimsize[1] = 2097153;
- maxdimsize[0] = 2048;
- maxdimsize[1] = 2097153;
- if ((spaceid = H5Screate_simple(NDIMS2, dimsize, maxdimsize)) < 0) ERR;
- if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
- H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((datasetid = H5Dcreate(grpid, VAR_NAME2, H5T_NATIVE_SCHAR, spaceid, plistid)) < 0) ERR;
-
- free(fillp);
- free(chunksize);
- free(dimsize);
- free(maxdimsize);
- if (H5Pclose(plistid) < 0) ERR;
- if (H5Sclose(spaceid) < 0) ERR;
-
- if (H5DSattach_scale(datasetid, dim1_dimscaleid, 0) < 0) ERR;
- if (H5DSattach_scale(datasetid, dim2_dimscaleid, 1) < 0) ERR;
- H5Fflush(fileid, H5F_SCOPE_GLOBAL);
-
- /* Read a slice of data. */
- if ((file_spaceid = H5Dget_space(datasetid)) < 0) ERR;
- if (H5Sget_simple_extent_dims(file_spaceid, fdims, fmaxdims) < 0) ERR;
- if (H5Sget_simple_extent_type(file_spaceid) == H5S_SCALAR) ERR;
- start[0] = 0;
- start[1] = 0;
- count[0] = 1;
- count[1] = 2097153;
- if (H5Sselect_hyperslab(file_spaceid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) ERR;
- if ((mem_spaceid = H5Screate_simple(NDIMS2, count, NULL)) < 0) ERR;
- if ((xfer_plistid = H5Pcreate(H5P_DATASET_XFER)) < 0) ERR;
- if ((native_typeid = H5Tget_native_type(H5T_NATIVE_SCHAR, H5T_DIR_DEFAULT)) < 0) ERR;
- if (!(bufr = malloc(DIM2))) ERR;
- if (H5Dwrite(datasetid, native_typeid, mem_spaceid, file_spaceid, xfer_plistid, bufr) < 0) ERR;
- free(bufr);
- if (H5Tclose(native_typeid) < 0) ERR;
-
- /* Close down the show. */
- if (H5Pclose(fapl_id) < 0) ERR;
- if (H5Pclose(fcpl_id) < 0) ERR;
- if (H5Dclose(dim1_dimscaleid) < 0) ERR;
- if (H5Dclose(dim2_dimscaleid) < 0) ERR;
- if (H5Dclose(datasetid) < 0) ERR;
- if (H5Gclose(grpid) < 0) ERR;
- if (H5Fclose(fileid) < 0) ERR;
-
-/* /\* Reopen the file and check it. *\/ */
-/* if ((fileid = H5Fopen(file_name, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR; */
-/* if (H5Gget_num_objs(fileid, &num_obj) < 0) ERR; */
-/* if (num_obj) ERR; */
-/* if (H5Fclose(fileid) < 0) ERR; */
-
- /* Delete the huge data file we created. */
- (void) remove(file_name);
- }
- SUMMARIZE_ERR;
+ *(signed char *)fillp = FILL_BYTE;
+ if(H5Pset_fill_value(plistid, H5T_NATIVE_SCHAR, fillp) < 0) ERR;
+ if (!(chunksize = malloc(NDIMS2 * sizeof(hsize_t)))) ERR;
+ chunksize[0] = 1024;
+ chunksize[1] = 1048576;
+ if (H5Pset_chunk(plistid, NDIMS2, chunksize) < 0) ERR;
+ if (!(dimsize = malloc(NDIMS2 * sizeof(hsize_t)))) ERR;
+ if (!(maxdimsize = malloc(NDIMS2 * sizeof(hsize_t)))) ERR;
+ dimsize[0] = 2048;
+ dimsize[1] = 2097153;
+ maxdimsize[0] = 2048;
+ maxdimsize[1] = 2097153;
+ if ((spaceid = H5Screate_simple(NDIMS2, dimsize, maxdimsize)) < 0) ERR;
+ if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
+ H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((datasetid = H5Dcreate(grpid, VAR_NAME2, H5T_NATIVE_SCHAR, spaceid, plistid)) < 0) ERR;
+
+ free(fillp);
+ free(chunksize);
+ free(dimsize);
+ free(maxdimsize);
+ if (H5Pclose(plistid) < 0) ERR;
+ if (H5Sclose(spaceid) < 0) ERR;
+
+ if (H5DSattach_scale(datasetid, dim1_dimscaleid, 0) < 0) ERR;
+ if (H5DSattach_scale(datasetid, dim2_dimscaleid, 1) < 0) ERR;
+ H5Fflush(fileid, H5F_SCOPE_GLOBAL);
+
+ /* Read a slice of data. */
+ if ((file_spaceid = H5Dget_space(datasetid)) < 0) ERR;
+ if (H5Sget_simple_extent_dims(file_spaceid, fdims, fmaxdims) < 0) ERR;
+ if (H5Sget_simple_extent_type(file_spaceid) == H5S_SCALAR) ERR;
+ start[0] = 0;
+ start[1] = 0;
+ count[0] = 1;
+ count[1] = 2097153;
+ if (H5Sselect_hyperslab(file_spaceid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) ERR;
+ if ((mem_spaceid = H5Screate_simple(NDIMS2, count, NULL)) < 0) ERR;
+ if ((xfer_plistid = H5Pcreate(H5P_DATASET_XFER)) < 0) ERR;
+ if ((native_typeid = H5Tget_native_type(H5T_NATIVE_SCHAR, H5T_DIR_DEFAULT)) < 0) ERR;
+ if (!(bufr = malloc(DIM2))) ERR;
+ if (H5Dwrite(datasetid, native_typeid, mem_spaceid, file_spaceid, xfer_plistid, bufr) < 0) ERR;
+ free(bufr);
+ if (H5Tclose(native_typeid) < 0) ERR;
+
+ /* Close down the show. */
+ if (H5Pclose(fapl_id) < 0) ERR;
+ if (H5Pclose(fcpl_id) < 0) ERR;
+ if (H5Dclose(dim1_dimscaleid) < 0) ERR;
+ if (H5Dclose(dim2_dimscaleid) < 0) ERR;
+ if (H5Dclose(datasetid) < 0) ERR;
+ if (H5Gclose(grpid) < 0) ERR;
+ if (H5Fclose(fileid) < 0) ERR;
+
+ /* Delete the huge data file we created. */
+ (void) remove(file_name);
+ }
+ SUMMARIZE_ERR;
#endif /* LARGE_FILE_TESTS */
- FINAL_RESULTS;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_par.c netcdf-parallel-4.7.4/h5_test/tst_h_par.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_par.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_par.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,6 +1,6 @@
-/* This is part of the netCDF package.
- Copyright 2018 University Corporation for Atmospheric Research/Unidata
- See COPYRIGHT file for conditions of use.
+/* This is part of the netCDF package. Copyright 2020 University
+ Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
+ conditions of use.
Test HDF5 file code. These are not intended to be exhaustive tests,
but they use HDF5 the same way that netCDF-4 does, so if these
@@ -8,7 +8,7 @@
This files tests parallel I/O.
- $Id: tst_h_par.c,v 1.15 2010/05/25 13:53:04 ed Exp $
+ Ed Hartnett
*/
#include
#include "err_macros.h"
@@ -34,201 +34,201 @@
int
main(int argc, char **argv)
{
- int p, my_rank;
+ int p, my_rank;
#ifdef USE_MPE
- int s_init, e_init, s_define, e_define, s_write, e_write, s_close, e_close;
+ int s_init, e_init, s_define, e_define, s_write, e_write, s_close, e_close;
#endif /* USE_MPE */
- MPI_Init(&argc, &argv);
- MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
- MPI_Comm_size(MPI_COMM_WORLD, &p);
-
-#ifdef USE_MPE
- MPE_Init_log();
- s_init = MPE_Log_get_event_number();
- e_init = MPE_Log_get_event_number();
- s_define = MPE_Log_get_event_number();
- e_define = MPE_Log_get_event_number();
- s_write = MPE_Log_get_event_number();
- e_write = MPE_Log_get_event_number();
- s_close = MPE_Log_get_event_number();
- e_close = MPE_Log_get_event_number();
- MPE_Describe_state(s_init, e_init, "Init", "red");
- MPE_Describe_state(s_define, e_define, "Define", "yellow");
- MPE_Describe_state(s_write, e_write, "Write", "green");
- MPE_Describe_state(s_close, e_close, "Close", "purple");
- MPE_Start_log();
- MPE_Log_event(s_init, 0, "start init");
-#endif /* USE_MPE */
-
- if (!my_rank)
- printf("*** Creating file for parallel I/O read, and rereading it...");
- {
- hid_t fapl_id, fileid, whole_spaceid, dsid, slice_spaceid, whole_spaceid1, xferid;
- hsize_t start[NDIMS], count[NDIMS];
- hsize_t dims[1];
- int data[SC1], data_in[SC1];
- int num_steps;
- double ftime;
- int write_us, read_us;
- int max_write_us, max_read_us;
- float write_rate, read_rate;
- int i, s;
-
- /* We will write the same slice of random data over and over to
- * fill the file. */
- for (i = 0; i < SC1; i++)
- data[i] = rand();
-
-#ifdef USE_MPE
- MPE_Log_event(e_init, 0, "end init");
- MPE_Log_event(s_define, 0, "start define file");
-#endif /* USE_MPE */
-
- /* Create file. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) ERR;
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- fapl_id)) < 0) ERR;
-
- /* Create a space to deal with one slice in memory. */
- dims[0] = SC1;
- if ((slice_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Create a space to write all slices. */
- dims[0] = DIM2_LEN;
- if ((whole_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Create dataset. */
- if ((dsid = H5Dcreate1(fileid, VAR_NAME, H5T_NATIVE_INT,
- whole_spaceid, H5P_DEFAULT)) < 0) ERR;
-
- /* Use collective write operations. */
- if ((xferid = H5Pcreate(H5P_DATASET_XFER)) < 0) ERR;
- if (H5Pset_dxpl_mpio(xferid, H5FD_MPIO_COLLECTIVE) < 0) ERR;
-
-#ifdef USE_MPE
- MPE_Log_event(e_define, 0, "end define file");
- if (my_rank)
- sleep(my_rank);
-#endif /* USE_MPE */
-
- /* Write the data in num_step steps. */
- ftime = MPI_Wtime();
- num_steps = (DIM2_LEN/SC1) / p;
- for (s = 0; s < num_steps; s++)
- {
-#ifdef USE_MPE
- MPE_Log_event(s_write, 0, "start write slab");
-#endif /* USE_MPE */
-
- /* Select hyperslab for write of one slice. */
- start[0] = s * SC1 * p + my_rank * SC1;
- count[0] = SC1;
- if (H5Sselect_hyperslab(whole_spaceid, H5S_SELECT_SET,
- start, NULL, count, NULL) < 0) ERR;
-
- if (H5Dwrite(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid,
- xferid, data) < 0) ERR;
-
-#ifdef USE_MPE
- MPE_Log_event(e_write, 0, "end write file");
-#endif /* USE_MPE */
- }
- write_us = (MPI_Wtime() - ftime) * MILLION;
- MPI_Reduce(&write_us, &max_write_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
- if (!my_rank)
- {
- write_rate = (float)(DIM2_LEN * sizeof(int))/(float)max_write_us;
- printf("\np=%d, write_rate=%g", p, write_rate);
- }
-
-#ifdef USE_MPE
- MPE_Log_event(s_close, 0, "start close file");
-#endif /* USE_MPE */
-
- /* Close. These collective operations will allow every process
- * to catch up. */
- if (H5Dclose(dsid) < 0 ||
- H5Sclose(whole_spaceid) < 0 ||
- H5Sclose(slice_spaceid) < 0 ||
- H5Pclose(fapl_id) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
-#ifdef USE_MPE
- MPE_Log_event(e_close, 0, "end close file");
-#endif /* USE_MPE */
-
- /* Open the file. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) ERR;
-
-
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
-
- /* Create a space to deal with one slice in memory. */
- dims[0] = SC1;
- if ((slice_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Open the dataset. */
- if ((dsid = H5Dopen(fileid, VAR_NAME)) < 0) ERR;
- if ((whole_spaceid1 = H5Dget_space(dsid)) < 0) ERR;
-
- ftime = MPI_Wtime();
-
- /* Read the data, a slice at a time. */
- for (s = 0; s < num_steps; s++)
- {
- /* Select hyperslab for read of one slice. */
- start[0] = s * SC1 * p + my_rank * SC1;
- count[0] = SC1;
- if (H5Sselect_hyperslab(whole_spaceid1, H5S_SELECT_SET,
- start, NULL, count, NULL) < 0)
- {
- ERR;
- return 2;
- }
-
- if (H5Dread(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid1,
- H5P_DEFAULT, data_in) < 0)
- {
- ERR;
- return 2;
- }
-
-/* /\* Check the slice of data. *\/ */
-/* for (i = 0; i < SC1; i++) */
-/* if (data[i] != data_in[i]) */
-/* { */
-/* ERR; */
-/* return 2; */
-/* } */
- }
- read_us = (MPI_Wtime() - ftime) * MILLION;
- MPI_Reduce(&read_us, &max_read_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
- if (!my_rank)
- {
- read_rate = (float)(DIM2_LEN * sizeof(int))/(float)max_read_us;
- printf(", read_rate=%g\n", read_rate);
- }
-
- /* Close down. */
- if (H5Dclose(dsid) < 0 ||
- H5Sclose(slice_spaceid) < 0 ||
- H5Sclose(whole_spaceid1) < 0 ||
- H5Pclose(fapl_id) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- if (!my_rank)
- SUMMARIZE_ERR;
-
- MPI_Finalize();
-
- if (!my_rank)
- FINAL_RESULTS;
- return 0;
+ MPI_Init(&argc, &argv);
+ MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &p);
+
+#ifdef USE_MPE
+ MPE_Init_log();
+ s_init = MPE_Log_get_event_number();
+ e_init = MPE_Log_get_event_number();
+ s_define = MPE_Log_get_event_number();
+ e_define = MPE_Log_get_event_number();
+ s_write = MPE_Log_get_event_number();
+ e_write = MPE_Log_get_event_number();
+ s_close = MPE_Log_get_event_number();
+ e_close = MPE_Log_get_event_number();
+ MPE_Describe_state(s_init, e_init, "Init", "red");
+ MPE_Describe_state(s_define, e_define, "Define", "yellow");
+ MPE_Describe_state(s_write, e_write, "Write", "green");
+ MPE_Describe_state(s_close, e_close, "Close", "purple");
+ MPE_Start_log();
+ MPE_Log_event(s_init, 0, "start init");
+#endif /* USE_MPE */
+
+ if (!my_rank)
+ printf("*** Creating file for parallel I/O read, and rereading it...");
+ {
+ hid_t fapl_id, fileid, whole_spaceid, dsid, slice_spaceid, whole_spaceid1, xferid;
+ hsize_t start[NDIMS], count[NDIMS];
+ hsize_t dims[1];
+ int data[SC1], data_in[SC1];
+ int num_steps;
+ double ftime;
+ int write_us, read_us;
+ int max_write_us, max_read_us;
+ float write_rate, read_rate;
+ int i, s;
+
+ /* We will write the same slice of random data over and over to
+ * fill the file. */
+ for (i = 0; i < SC1; i++)
+ data[i] = rand();
+
+#ifdef USE_MPE
+ MPE_Log_event(e_init, 0, "end init");
+ MPE_Log_event(s_define, 0, "start define file");
+#endif /* USE_MPE */
+
+ /* Create file. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ fapl_id)) < 0) ERR;
+
+ /* Create a space to deal with one slice in memory. */
+ dims[0] = SC1;
+ if ((slice_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Create a space to write all slices. */
+ dims[0] = DIM2_LEN;
+ if ((whole_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Create dataset. */
+ if ((dsid = H5Dcreate1(fileid, VAR_NAME, H5T_NATIVE_INT,
+ whole_spaceid, H5P_DEFAULT)) < 0) ERR;
+
+ /* Use collective write operations. */
+ if ((xferid = H5Pcreate(H5P_DATASET_XFER)) < 0) ERR;
+ if (H5Pset_dxpl_mpio(xferid, H5FD_MPIO_COLLECTIVE) < 0) ERR;
+
+#ifdef USE_MPE
+ MPE_Log_event(e_define, 0, "end define file");
+ if (my_rank)
+ sleep(my_rank);
+#endif /* USE_MPE */
+
+ /* Write the data in num_step steps. */
+ ftime = MPI_Wtime();
+ num_steps = (DIM2_LEN/SC1) / p;
+ for (s = 0; s < num_steps; s++)
+ {
+#ifdef USE_MPE
+ MPE_Log_event(s_write, 0, "start write slab");
+#endif /* USE_MPE */
+
+ /* Select hyperslab for write of one slice. */
+ start[0] = s * SC1 * p + my_rank * SC1;
+ count[0] = SC1;
+ if (H5Sselect_hyperslab(whole_spaceid, H5S_SELECT_SET,
+ start, NULL, count, NULL) < 0) ERR;
+
+ if (H5Dwrite(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid,
+ xferid, data) < 0) ERR;
+
+#ifdef USE_MPE
+ MPE_Log_event(e_write, 0, "end write file");
+#endif /* USE_MPE */
+ }
+ write_us = (MPI_Wtime() - ftime) * MILLION;
+ MPI_Reduce(&write_us, &max_write_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
+ if (!my_rank)
+ {
+ write_rate = (float)(DIM2_LEN * sizeof(int))/(float)max_write_us;
+ printf("\np=%d, write_rate=%g", p, write_rate);
+ }
+
+#ifdef USE_MPE
+ MPE_Log_event(s_close, 0, "start close file");
+#endif /* USE_MPE */
+
+ /* Close. These collective operations will allow every process
+ * to catch up. */
+ if (H5Dclose(dsid) < 0 ||
+ H5Sclose(whole_spaceid) < 0 ||
+ H5Sclose(slice_spaceid) < 0 ||
+ H5Pclose(fapl_id) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+#ifdef USE_MPE
+ MPE_Log_event(e_close, 0, "end close file");
+#endif /* USE_MPE */
+
+ /* Open the file. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_fapl_mpio(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL) < 0) ERR;
+
+
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+
+ /* Create a space to deal with one slice in memory. */
+ dims[0] = SC1;
+ if ((slice_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Open the dataset. */
+ if ((dsid = H5Dopen(fileid, VAR_NAME)) < 0) ERR;
+ if ((whole_spaceid1 = H5Dget_space(dsid)) < 0) ERR;
+
+ ftime = MPI_Wtime();
+
+ /* Read the data, a slice at a time. */
+ for (s = 0; s < num_steps; s++)
+ {
+ /* Select hyperslab for read of one slice. */
+ start[0] = s * SC1 * p + my_rank * SC1;
+ count[0] = SC1;
+ if (H5Sselect_hyperslab(whole_spaceid1, H5S_SELECT_SET,
+ start, NULL, count, NULL) < 0)
+ {
+ ERR;
+ return 2;
+ }
+
+ if (H5Dread(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid1,
+ H5P_DEFAULT, data_in) < 0)
+ {
+ ERR;
+ return 2;
+ }
+
+ /* Check the slice of data. */
+ for (i = 0; i < SC1; i++)
+ if (data[i] != data_in[i])
+ {
+ ERR;
+ return 2;
+ }
+ }
+ read_us = (MPI_Wtime() - ftime) * MILLION;
+ MPI_Reduce(&read_us, &max_read_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
+ if (!my_rank)
+ {
+ read_rate = (float)(DIM2_LEN * sizeof(int))/(float)max_read_us;
+ printf(", read_rate=%g\n", read_rate);
+ }
+
+ /* Close down. */
+ if (H5Dclose(dsid) < 0 ||
+ H5Sclose(slice_spaceid) < 0 ||
+ H5Sclose(whole_spaceid1) < 0 ||
+ H5Pclose(fapl_id) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ if (!my_rank)
+ SUMMARIZE_ERR;
+
+ MPI_Finalize();
+
+ if (!my_rank)
+ FINAL_RESULTS;
+ return 0;
}
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_rename.c netcdf-parallel-4.7.4/h5_test/tst_h_rename.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_rename.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_rename.c 2020-08-31 10:33:26.000000000 +0000
@@ -33,7 +33,11 @@
hsize_t num_obj;
hid_t fileid, grpid, spaceid;
int i;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
char names[NUM_ELEMENTS][MAX_SYMBOL_LEN + 1] = {"H", "He", "Li", "Be", "B", "C"};
char names2[NUM_ELEMENTS][MAX_SYMBOL_LEN + 1] = {"h", "He", "Li", "Be", "B", "C"};
char name[MAX_SYMBOL_LEN + 1];
@@ -83,8 +87,13 @@
printf("Original order:\n");
for (i = 0; i < num_obj; i++)
{
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
if (obj_info.type != H5O_TYPE_DATASET) ERR;
if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
NULL, 0, H5P_DEFAULT)) < 0) ERR;
@@ -114,8 +123,13 @@
printf("New order:\n");
for (i = 0; i < num_obj; i++)
{
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
if (obj_info.type != H5O_TYPE_DATASET) ERR;
if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
NULL, 0, H5P_DEFAULT)) < 0) ERR;
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_vars2.c netcdf-parallel-4.7.4/h5_test/tst_h_vars2.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_vars2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_vars2.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,11 +1,13 @@
-/* This is part of the netCDF package. Copyright 2018 University
- Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
- conditions of use.
+/* This is part of the netCDF package. Copyright 2020 University
+ Corporation for Atmospheric Research/Unidata. See COPYRIGHT file
+ for conditions of use.
- Test HDF5 dataset code, even more. These are not intended to be
+ More tests for HDF5 datasets. These are not intended to be
exhaustive tests, but they use HDF5 the same way that netCDF-4
does, so if these tests don't work, than netCDF-4 won't work
either.
+
+ Ed Hartnett
*/
#include "h5_err_macros.h"
@@ -18,242 +20,273 @@
int
main()
{
- printf("\n*** Checking HDF5 variable functions some more.\n");
- /* If HDF5 has working ordering of variables, then the following
- * test will work.*/
- printf("*** Checking HDF5 variable ordering...");
+ printf("\n*** Checking HDF5 variable functions some more.\n");
+ /* If HDF5 has working ordering of variables, then the following
+ * test will work.*/
+ printf("*** Checking HDF5 variable ordering...");
#define NUM_ELEMENTS 6
#define MAX_SYMBOL_LEN 2
#define ELEMENTS_NAME "Elements"
- {
- hid_t did[NUM_ELEMENTS], fapl_id, fcpl_id, gcpl_id;
- hsize_t num_obj;
- hid_t fileid, grpid, spaceid;
- int i;
- H5O_info_t obj_info;
- char names[NUM_ELEMENTS][MAX_SYMBOL_LEN + 1] = {"H", "He", "Li", "Be", "B", "C"};
- char name[MAX_SYMBOL_LEN + 1];
- ssize_t size;
-
- /* Create file, setting latest_format in access propertly list
- * and H5P_CRT_ORDER_TRACKED in the creation property list. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
-
- /* Create group, with link_creation_order set in the group
- * creation property list. */
- if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((grpid = H5Gcreate_anon(fileid, gcpl_id, H5P_DEFAULT)) < 0) ERR;
- if ((H5Olink(grpid, fileid, ELEMENTS_NAME, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
-
- /* Create a scalar space. */
- if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
-
- /* Create the variables, one per element. */
- for (i = 0; i < NUM_ELEMENTS; i++)
- {
- if ((did[i] = H5Dcreate(grpid, names[i], H5T_NATIVE_INT,
- spaceid, H5P_DEFAULT)) < 0) ERR;
- if (H5Dclose(did[i]) < 0) ERR;
- }
-
- if (H5Pclose(fapl_id) < 0 ||
- H5Pclose(gcpl_id) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check the order. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
-
- if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
- if (num_obj != NUM_ELEMENTS) ERR;
- for (i = 0; i < num_obj; i++)
- {
- if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
- i, &obj_info, H5P_DEFAULT) < 0) ERR;
- if (obj_info.type != H5O_TYPE_DATASET) ERR;
- if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
- NULL, 0, H5P_DEFAULT)) < 0) ERR;
- H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
- name, size+1, H5P_DEFAULT);
- if (strcmp(name, names[i])) ERR;
- }
- if (H5Pclose(fapl_id) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 variable ordering in root group...");
+ {
+ hid_t did[NUM_ELEMENTS], fapl_id, fcpl_id, gcpl_id;
+ hsize_t num_obj;
+ hid_t fileid, grpid, spaceid;
+ int i;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
+ H5O_info_t obj_info;
+#endif
+ char names[NUM_ELEMENTS][MAX_SYMBOL_LEN + 1] = {"H", "He", "Li", "Be", "B", "C"};
+ char name[MAX_SYMBOL_LEN + 1];
+ ssize_t size;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ /* Create group, with link_creation_order set in the group
+ * creation property list. */
+ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((grpid = H5Gcreate_anon(fileid, gcpl_id, H5P_DEFAULT)) < 0) ERR;
+ if ((H5Olink(grpid, fileid, ELEMENTS_NAME, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
+
+ /* Create a scalar space. */
+ if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
+
+ /* Create the variables, one per element. */
+ for (i = 0; i < NUM_ELEMENTS; i++)
+ {
+ if ((did[i] = H5Dcreate(grpid, names[i], H5T_NATIVE_INT,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+ if (H5Dclose(did[i]) < 0) ERR;
+ }
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Pclose(gcpl_id) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check the order. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
+
+ if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
+ if (num_obj != NUM_ELEMENTS) ERR;
+ for (i = 0; i < num_obj; i++)
+ {
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
+ if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
+ if (obj_info.type != H5O_TYPE_DATASET) ERR;
+ if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
+ NULL, 0, H5P_DEFAULT)) < 0) ERR;
+ H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
+ name, size+1, H5P_DEFAULT);
+ if (strcmp(name, names[i])) ERR;
+ }
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 variable ordering in root group...");
#define NUM_DIMSCALES 2
#define MAX_SYMBOL_LEN 2
#define DIM1_LEN 3
#define DIMSCALE_NAME "Joe"
#define NAME_ATTRIBUTE "short"
- {
- hid_t fapl_id, fcpl_id;
- hid_t fileid, grpid;
- hsize_t num_obj;
- int i;
- H5O_info_t obj_info;
- char names[NUM_DIMSCALES][MAX_SYMBOL_LEN + 1] = {"b", "a"};
- char name[MAX_SYMBOL_LEN + 1];
- hid_t dimscaleid;
- hid_t dimscale_spaceid;
- hsize_t dimscale_dims[1] = {DIM1_LEN};
- ssize_t size;
-
- /* Create file, setting latest_format in access propertly list
- * and H5P_CRT_ORDER_TRACKED in the creation property list. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
-
- if ((dimscale_spaceid = H5Screate_simple(1, dimscale_dims,
- dimscale_dims)) < 0) ERR;
- /* Create the variables, one per element. */
- for (i = 0; i < NUM_DIMSCALES; i++)
- {
- /* Create our dimension scale. Use the built-in NAME attribute
- * on the dimscale. */
- if ((dimscaleid = H5Dcreate(fileid, names[i], H5T_NATIVE_INT,
- dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
- if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
-
- if (H5Dclose(dimscaleid) < 0) ERR;
- }
-
- if (H5Pclose(fapl_id) < 0 ||
- H5Pclose(fcpl_id) < 0 ||
- H5Sclose(dimscale_spaceid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check the order. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
-
- if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
- if (num_obj != NUM_DIMSCALES) ERR;
- for (i = 0; i < num_obj; i++)
- {
- if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
- i, &obj_info, H5P_DEFAULT) < 0) ERR;
- if (obj_info.type != H5O_TYPE_DATASET) ERR;
- if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
- NULL, 0, H5P_DEFAULT)) < 0) ERR;
- if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
- name, size+1, H5P_DEFAULT) < 0) ERR;
- if (strcmp(name, names[i])) ERR;
- }
- if (H5Pclose(fapl_id) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 variable ordering flags with redef-type situations...");
+ {
+ hid_t fapl_id, fcpl_id;
+ hid_t fileid, grpid;
+ hsize_t num_obj;
+ int i;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
+ H5O_info_t obj_info;
+#endif
+ char names[NUM_DIMSCALES][MAX_SYMBOL_LEN + 1] = {"b", "a"};
+ char name[MAX_SYMBOL_LEN + 1];
+ hid_t dimscaleid;
+ hid_t dimscale_spaceid;
+ hsize_t dimscale_dims[1] = {DIM1_LEN};
+ ssize_t size;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ if ((dimscale_spaceid = H5Screate_simple(1, dimscale_dims,
+ dimscale_dims)) < 0) ERR;
+ /* Create the variables, one per element. */
+ for (i = 0; i < NUM_DIMSCALES; i++)
+ {
+ /* Create our dimension scale. Use the built-in NAME attribute
+ * on the dimscale. */
+ if ((dimscaleid = H5Dcreate(fileid, names[i], H5T_NATIVE_INT,
+ dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
+ if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
+
+ if (H5Dclose(dimscaleid) < 0) ERR;
+ }
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Pclose(fcpl_id) < 0 ||
+ H5Sclose(dimscale_spaceid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check the order. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
+ if (num_obj != NUM_DIMSCALES) ERR;
+ for (i = 0; i < num_obj; i++)
+ {
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
+ if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
+ if (obj_info.type != H5O_TYPE_DATASET) ERR;
+ if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
+ NULL, 0, H5P_DEFAULT)) < 0) ERR;
+ if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
+ name, size+1, H5P_DEFAULT) < 0) ERR;
+ if (strcmp(name, names[i])) ERR;
+ }
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 variable ordering flags with redef-type situations...");
#define NUM_ELEMENTS 6
#define MAX_NAME_LEN 50
#define ELEMENTS_NAME "Elements"
#define VAR_NAME "Sears_Zemansky_and_Young"
- {
- hid_t did, fapl_id, fcpl_id, gcpl_id, attid;
- hsize_t num_obj;
- hid_t fileid, grpid, spaceid;
- float val = 3.1495;
- H5O_info_t obj_info;
- char name[MAX_NAME_LEN + 1];
- ssize_t size;
-
- /* Create file, setting latest_format in access propertly list
- * and H5P_CRT_ORDER_TRACKED in the creation property list. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
-
- /* Create group, with link_creation_order set in the group
- * creation property list. */
- if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((grpid = H5Gcreate_anon(fileid, gcpl_id, H5P_DEFAULT)) < 0) ERR;
- if ((H5Olink(grpid, fileid, ELEMENTS_NAME, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
-
- /* Create a scalar space. */
- if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
-
- /* Create a scalar variable. */
- if ((did = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_INT,
- spaceid, H5P_DEFAULT)) < 0) ERR;
- if (H5Dclose(did) < 0) ERR;
-
- /* Flush the HDF5 buffers. */
- H5Fflush(fileid, H5F_SCOPE_GLOBAL);
-
- /* Delete the variable. Just to be mean. */
- if (H5Gunlink(grpid, VAR_NAME) < 0) ERR;
-
- /* Re-reate the scalar variable. */
- if ((did = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_INT,
- spaceid, H5P_DEFAULT)) < 0) ERR;
-
- /* Add an attribute. */
- if ((attid = H5Acreate(did, "Some_Attribute", H5T_NATIVE_FLOAT, spaceid,
- H5P_DEFAULT)) < 0) ERR;
- if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
-
- if (H5Aclose(attid) < 0) ERR;
- if (H5Dclose(did) < 0) ERR;
-
- if (H5Pclose(fapl_id) < 0 ||
- H5Pclose(gcpl_id) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check the order. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
-
- if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
- if (num_obj != 1) ERR;
- if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
- 0, &obj_info, H5P_DEFAULT) < 0) ERR;
- if (obj_info.type != H5O_TYPE_DATASET) ERR;
- if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, 0,
- NULL, 0, H5P_DEFAULT)) < 0) ERR;
- H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, 0,
- name, size+1, H5P_DEFAULT);
- if (strcmp(name, VAR_NAME)) ERR;
- if (H5Pclose(fapl_id) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 variable compession and filters...");
- {
+ {
+ hid_t did, fapl_id, fcpl_id, gcpl_id, attid;
+ hsize_t num_obj;
+ hid_t fileid, grpid, spaceid;
+ float val = 3.1495;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
+ H5O_info_t obj_info;
+#endif
+ char name[MAX_NAME_LEN + 1];
+ ssize_t size;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ /* Create group, with link_creation_order set in the group
+ * creation property list. */
+ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(gcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((grpid = H5Gcreate_anon(fileid, gcpl_id, H5P_DEFAULT)) < 0) ERR;
+ if ((H5Olink(grpid, fileid, ELEMENTS_NAME, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
+
+ /* Create a scalar space. */
+ if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
+
+ /* Create a scalar variable. */
+ if ((did = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_INT,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+ if (H5Dclose(did) < 0) ERR;
+
+ /* Flush the HDF5 buffers. */
+ H5Fflush(fileid, H5F_SCOPE_GLOBAL);
+
+ /* Delete the variable. Just to be mean. */
+ if (H5Gunlink(grpid, VAR_NAME) < 0) ERR;
+
+ /* Re-reate the scalar variable. */
+ if ((did = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_INT,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+
+ /* Add an attribute. */
+ if ((attid = H5Acreate(did, "Some_Attribute", H5T_NATIVE_FLOAT, spaceid,
+ H5P_DEFAULT)) < 0) ERR;
+ if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
+
+ if (H5Aclose(attid) < 0) ERR;
+ if (H5Dclose(did) < 0) ERR;
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Pclose(gcpl_id) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check the order. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
+
+ if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
+ if (num_obj != 1) ERR;
+
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ 0, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR;
+#else
+ if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ 0, &obj_info, H5P_DEFAULT) < 0) ERR;
+#endif
+ if (obj_info.type != H5O_TYPE_DATASET) ERR;
+ if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, 0,
+ NULL, 0, H5P_DEFAULT)) < 0) ERR;
+ H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, 0,
+ name, size+1, H5P_DEFAULT);
+ if (strcmp(name, VAR_NAME)) ERR;
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 variable compession and filters...");
+ {
#define NUM_ELEMENTS 6
#define MAX_NAME_LEN 50
#define ELEMENTS_NAME "Elements"
@@ -264,298 +297,382 @@
#define DEFLATE_LEVEL 3
#define SIMPLE_VAR_NAME "data"
- hid_t fapl_id, fcpl_id;
- hid_t datasetid;
- hid_t fileid, grpid, spaceid, plistid;
- int data_in[NX][NY], data_out[NX][NY];
- hsize_t fdims[NDIMS], fmaxdims[NDIMS];
- hsize_t chunksize[NDIMS], dimsize[NDIMS], maxdimsize[NDIMS];
- int x, y;
-
- /* Create some data to write. */
- for (x = 0; x < NX; x++)
- for (y = 0; y < NY; y++)
- data_out[x][y] = x * NY + y;
-
- /* Create file, setting latest_format in access propertly list
- * and H5P_CRT_ORDER_TRACKED in the creation property list. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
-
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
-
- dimsize[0] = maxdimsize[0] = NX;
- dimsize[1] = maxdimsize[1] = NY;
- if ((spaceid = H5Screate_simple(NDIMS, dimsize, maxdimsize)) < 0) ERR;
-
- /* Create property lust. */
- if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
-
- /* Set up chunksizes. */
- chunksize[0] = NX;
- chunksize[1] = NY;
- if (H5Pset_chunk(plistid, NDIMS, chunksize) < 0)ERR;
-
- /* Set up compression. */
- if (H5Pset_deflate(plistid, DEFLATE_LEVEL) < 0) ERR;
-
- /* Create the variable. */
- if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME, H5T_NATIVE_INT,
- spaceid, plistid)) < 0) ERR;
-
- /* Write the data. */
- if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, data_out) < 0) ERR;
-
- if (H5Dclose(datasetid) < 0) ERR;
- if (H5Pclose(fapl_id) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check the order. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
-
- if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME)) < 0) ERR;
- if ((spaceid = H5Dget_space(datasetid)) < 0)
- if (H5Sget_simple_extent_dims(spaceid, fdims, fmaxdims) > 0) ERR;
- if (H5Dread(datasetid, H5T_NATIVE_INT, H5S_ALL,
- spaceid, H5P_DEFAULT, data_in) < 0) ERR;
-
- /* Check the data. */
- for (x = 0; x < NX; x++)
- for (y = 0; y < NY; y++)
- if (data_in[x][y] != data_out[x][y]) ERR_RET;
-
- if (H5Pclose(fapl_id) < 0 ||
- H5Dclose(datasetid) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- SUMMARIZE_ERR;
-/* I can't get this to work, I don't think it's allowed in HDF5. - Ed 7/12/7 */
-/* printf("*** Checking HDF5 scalar variable compession..."); */
-
-/* #define MAX_NAME_LEN 50 */
-/* #define DEFLATE_LEVEL 3 */
-/* #define SIMPLE_VAR_NAME1 "punches" */
-/* { */
-/* hid_t fapl_id, fcpl_id; */
-/* hid_t datasetid; */
-/* hid_t fileid, grpid, spaceid, plistid; */
-/* int data_in, data_out = 42; */
-/* hsize_t chunksize = 1; */
-
-/* /\* Create file, setting latest_format in access propertly list */
-/* * and H5P_CRT_ORDER_TRACKED in the creation property list. *\/ */
-/* if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR; */
-/* if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;*/
-/* if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR; */
-/* if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR; */
-/* if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR; */
-
-/* if ((grpid = H5Gopen(fileid, "/")) < 0) ERR; */
-
-/* if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR; */
-
-/* /\* Create property lust. *\/ */
-/* if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR; */
-
-/* if (H5Pset_chunk(plistid, 1, &chunksize) < 0)ERR; */
-
-/* /\* Set up compression. *\/ */
-/* if (H5Pset_deflate(plistid, DEFLATE_LEVEL) < 0) ERR; */
-
-/* /\* Create the variable. *\/ */
-/* if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT, */
-/* spaceid, plistid)) < 0) ERR; */
-
-/* /\* Write the data. *\/ */
-/* if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, */
-/* H5P_DEFAULT, &data_out) < 0) ERR; */
-
-/* if (H5Dclose(datasetid) < 0) ERR; */
-/* if (H5Pclose(fapl_id) < 0 || */
-/* H5Sclose(spaceid) < 0 || */
-/* H5Gclose(grpid) < 0 || */
-/* H5Fclose(fileid) < 0) */
-/* ERR; */
-
-/* /\* Now reopen the file and check. *\/ */
-/* if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR; */
-/* if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;*/
-/* if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR; */
-/* if ((grpid = H5Gopen(fileid, "/")) < 0) ERR; */
-
-/* if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME1)) < 0) ERR; */
-/* if ((spaceid = H5Dget_space(datasetid)) < 0) */
-/* if (H5Dread(datasetid, H5T_NATIVE_INT, H5S_ALL, */
-/* spaceid, H5P_DEFAULT, &data_in) < 0) ERR; */
-
-/* /\* Check the data. *\/ */
-/* if (data_in != data_out) ERR; */
-
-/* if (H5Pclose(fapl_id) < 0 || */
-/* H5Dclose(datasetid) < 0 || */
-/* H5Gclose(grpid) < 0 || */
-/* H5Fclose(fileid) < 0) */
-/* ERR; */
-/* } */
-/* SUMMARIZE_ERR; */
-
- printf("*** Checking fill value of compound type...");
+ hid_t fapl_id, fcpl_id;
+ hid_t datasetid;
+ hid_t fileid, grpid, spaceid, plistid;
+ int data_in[NX][NY], data_out[NX][NY];
+ hsize_t fdims[NDIMS], fmaxdims[NDIMS];
+ hsize_t chunksize[NDIMS], dimsize[NDIMS], maxdimsize[NDIMS];
+ int x, y;
+
+ /* Create some data to write. */
+ for (x = 0; x < NX; x++)
+ for (y = 0; y < NY; y++)
+ data_out[x][y] = x * NY + y;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ dimsize[0] = maxdimsize[0] = NX;
+ dimsize[1] = maxdimsize[1] = NY;
+ if ((spaceid = H5Screate_simple(NDIMS, dimsize, maxdimsize)) < 0) ERR;
+
+ /* Create property lust. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ /* Set up chunksizes. */
+ chunksize[0] = NX;
+ chunksize[1] = NY;
+ if (H5Pset_chunk(plistid, NDIMS, chunksize) < 0)ERR;
+
+ /* Set up compression. */
+ if (H5Pset_deflate(plistid, DEFLATE_LEVEL) < 0) ERR;
+
+ /* Create the variable. */
+ if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME, H5T_NATIVE_INT,
+ spaceid, plistid)) < 0) ERR;
+
+ /* Write the data. */
+ if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, data_out) < 0) ERR;
+
+ if (H5Dclose(datasetid) < 0) ERR;
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check the order. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME)) < 0) ERR;
+ if ((spaceid = H5Dget_space(datasetid)) < 0)
+ if (H5Sget_simple_extent_dims(spaceid, fdims, fmaxdims) > 0) ERR;
+ if (H5Dread(datasetid, H5T_NATIVE_INT, H5S_ALL,
+ spaceid, H5P_DEFAULT, data_in) < 0) ERR;
+
+ /* Check the data. */
+ for (x = 0; x < NX; x++)
+ for (y = 0; y < NY; y++)
+ if (data_in[x][y] != data_out[x][y]) ERR_RET;
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Dclose(datasetid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking fill value of compound type...");
- {
+ {
#define VAR_NAME2 "obs"
#define REF_FILE "ref_tst_compounds.nc"
#define ATT_NAME "_FillValue"
- typedef struct obs_t {
+ typedef struct obs_t {
char day ;
short elev;
int count;
float relhum;
double time;
- } obs_t ;
+ } obs_t ;
- obs_t f1, f2;
- obs_t m = {-99, -99, -99, -99, -99};
- hid_t fileid, grpid, attid, typeid, datasetid, native_typeid, propid;
- H5D_fill_value_t fill_status;
- char file_in[STR_LEN * 2];
- size_t type_size;
-
- if (getenv("srcdir"))
- {
- strcpy(file_in, getenv("srcdir"));
- strcat(file_in, "/");
- strcat(file_in, REF_FILE);
- }
- else
- strcpy(file_in, REF_FILE);
-
- /* Open file and read fill value of the variable. */
- if ((fileid = H5Fopen(file_in, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
- if ((datasetid = H5Dopen1(grpid, VAR_NAME2)) < 0) ERR;
- if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
- if (H5Pfill_value_defined(propid, &fill_status) < 0) ERR;
- if (fill_status != H5D_FILL_VALUE_USER_DEFINED) ERR;
- if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
- if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;
- if (!(type_size = H5Tget_size(native_typeid))) ERR;
- if (type_size != sizeof(obs_t)) ERR;
- if (H5Pget_fill_value(propid, native_typeid, &f1) < 0) ERR;
- if (f1.day != m.day || f1.elev != m.elev || f1.count != m.count ||
- f1.relhum != m.relhum || f1.time != m.time) ERR;
-
- /* It's also in an attribute, netCDF style. */
- if ((attid = H5Aopen_name(datasetid, ATT_NAME)) < 0) ERR;
- if ((typeid = H5Aget_type(attid)) < 0) ERR;
- if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;
- if (H5Aread(attid, native_typeid, &f2) < 0) ERR;
- if (f2.day != m.day || f2.elev != m.elev || f2.count != m.count ||
- f2.relhum != m.relhum || f2.time != m.time) ERR;
-
- if (H5Dclose(datasetid) < 0 ||
- H5Aclose(attid) < 0 ||
- H5Tclose(native_typeid) < 0 ||
- H5Tclose(typeid) < 0 ||
- H5Pclose(propid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0) ERR;
-
- }
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 lots of datasets...");
- {
+ obs_t f1, f2;
+ obs_t m = {-99, -99, -99, -99, -99};
+ hid_t fileid, grpid, attid, typeid, datasetid, native_typeid, propid;
+ H5D_fill_value_t fill_status;
+ char file_in[STR_LEN * 2];
+ size_t type_size;
+
+ if (getenv("srcdir"))
+ {
+ strcpy(file_in, getenv("srcdir"));
+ strcat(file_in, "/");
+ strcat(file_in, REF_FILE);
+ }
+ else
+ strcpy(file_in, REF_FILE);
+
+ /* Open file and read fill value of the variable. */
+ if ((fileid = H5Fopen(file_in, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+ if ((datasetid = H5Dopen1(grpid, VAR_NAME2)) < 0) ERR;
+ if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
+ if (H5Pfill_value_defined(propid, &fill_status) < 0) ERR;
+ if (fill_status != H5D_FILL_VALUE_USER_DEFINED) ERR;
+ if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
+ if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;
+ if (!(type_size = H5Tget_size(native_typeid))) ERR;
+ if (type_size != sizeof(obs_t)) ERR;
+ if (H5Pget_fill_value(propid, native_typeid, &f1) < 0) ERR;
+ if (f1.day != m.day || f1.elev != m.elev || f1.count != m.count ||
+ f1.relhum != m.relhum || f1.time != m.time) ERR;
+
+ /* It's also in an attribute, netCDF style. */
+ if ((attid = H5Aopen_name(datasetid, ATT_NAME)) < 0) ERR;
+ if ((typeid = H5Aget_type(attid)) < 0) ERR;
+ if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;
+ if (H5Aread(attid, native_typeid, &f2) < 0) ERR;
+ if (f2.day != m.day || f2.elev != m.elev || f2.count != m.count ||
+ f2.relhum != m.relhum || f2.time != m.time) ERR;
+
+ if (H5Dclose(datasetid) < 0 ||
+ H5Aclose(attid) < 0 ||
+ H5Tclose(native_typeid) < 0 ||
+ H5Tclose(typeid) < 0 ||
+ H5Pclose(propid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0) ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 lots of datasets...");
+ {
#define NDIMS1 1
#define NUM_DATASETS 10000
#define CHUNKSIZE 1
- hid_t fapl_id, fcpl_id;
- hid_t datasetid[NUM_DATASETS];
- hid_t fileid, grpid, spaceid, plistid;
- hsize_t chunksize[NDIMS1], dimsize[NDIMS1], maxdimsize[NDIMS1];
- char var_name[STR_LEN + 1];
- int v;
-
- /* Create file, setting latest_format in access propertly list
- * and H5P_CRT_ORDER_TRACKED in the creation property list. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
- if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
-
- /* Open root group. */
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
-
- /* Create 1 D data space with unlimited dimension. */
- dimsize[0] = 0;
- maxdimsize[0] = H5S_UNLIMITED;
- if ((spaceid = H5Screate_simple(NDIMS1, dimsize, maxdimsize)) < 0) ERR;
-
- /* Create property list. */
- if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
-
- /* Set up chunksizes. */
- chunksize[0] = CHUNKSIZE;
- if (H5Pset_chunk(plistid, NDIMS1, chunksize) < 0)ERR;
-
- /* Create the variables. */
- for (v = 0; v < NUM_DATASETS; v++)
- {
- sprintf(var_name, "var_%d", v);
-/* printf("creating var %s\n", var_name);*/
- if ((datasetid[v] = H5Dcreate(grpid, var_name, H5T_NATIVE_INT,
- spaceid, plistid)) < 0) ERR_RET;
- }
-
- /* Close the datasets. */
- for (v = 0; v < NUM_DATASETS; v++)
- if (H5Dclose(datasetid[v]) < 0) ERR_RET;
-
- /* Close everything. */
- if (H5Pclose(fapl_id) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check. */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
- if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
-
-/* if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME)) < 0) ERR; */
-/* if ((spaceid = H5Dget_space(datasetid)) < 0) */
-/* if (H5Sget_simple_extent_dims(spaceid, fdims, fmaxdims) > 0) ERR; */
-/* if (H5Dread(datasetid, H5T_NATIVE_INT, H5S_ALL, */
-/* spaceid, H5P_DEFAULT, data_in) < 0) ERR; */
-
-/* /\* Check the data. *\/ */
-/* for (x = 0; x < NX; x++) */
-/* for (y = 0; y < NY; y++) */
-/* if (data_in[x][y] != data_out[x][y]) ERR_RET; */
-
- if (H5Pclose(fapl_id) < 0 ||
-/* H5Dclose(datasetid) < 0 ||
- H5Sclose(spaceid) < 0 ||*/
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ hid_t fapl_id, fcpl_id;
+ hid_t datasetid[NUM_DATASETS];
+ hid_t fileid, grpid, spaceid, plistid;
+ hsize_t chunksize[NDIMS1], dimsize[NDIMS1], maxdimsize[NDIMS1];
+ char var_name[STR_LEN + 1];
+ int v;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ /* Open root group. */
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ /* Create 1 D data space with unlimited dimension. */
+ dimsize[0] = 0;
+ maxdimsize[0] = H5S_UNLIMITED;
+ if ((spaceid = H5Screate_simple(NDIMS1, dimsize, maxdimsize)) < 0) ERR;
+
+ /* Create property list. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ /* Set up chunksizes. */
+ chunksize[0] = CHUNKSIZE;
+ if (H5Pset_chunk(plistid, NDIMS1, chunksize) < 0)ERR;
+
+ /* Create the variables. */
+ for (v = 0; v < NUM_DATASETS; v++)
+ {
+ sprintf(var_name, "var_%d", v);
+ /* printf("creating var %s\n", var_name);*/
+ if ((datasetid[v] = H5Dcreate(grpid, var_name, H5T_NATIVE_INT,
+ spaceid, plistid)) < 0) ERR_RET;
+ }
+
+ /* Close the datasets. */
+ for (v = 0; v < NUM_DATASETS; v++)
+ if (H5Dclose(datasetid[v]) < 0) ERR_RET;
+
+ /* Close everything. */
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking that HDF5 does not allow scalar variable compession...");
+#define MAX_NAME_LEN 50
+#define DEFLATE_LEVEL 3
+#define SIMPLE_VAR_NAME1 "punches"
+ {
+ hid_t fapl_id, fcpl_id;
+ hid_t datasetid;
+ hid_t fileid, grpid, spaceid, plistid;
+ hsize_t chunksize = 1;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
+
+ /* Create property list. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ /* Set chunking. */
+ if (H5Pset_chunk(plistid, 1, &chunksize) < 0)ERR;
+
+ /* Set up compression. */
+ if (H5Pset_deflate(plistid, DEFLATE_LEVEL) < 0) ERR;
+
+ /* Turn off error messages. The next call will generate a
+ * bunch of error messages on the console. */
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+
+ /* Create the variable. This will not work, because only
+ * chunked datasets can use filters, and scalars can't be
+ * chunked. The H5Dcreate() call will fail. */
+ if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
+ spaceid, plistid)) > 0) ERR;
+
+ /* Turn on error messages back on. */
+ H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)&H5Eprint, stderr);
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 scalar compact dataset...");
+ {
+ hid_t fapl_id, fcpl_id;
+ hid_t datasetid;
+ hid_t fileid, grpid, spaceid, plistid;
+ hid_t propid;
+ int data_in, data_out = 42;
+ H5D_layout_t layout;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
+
+ /* Create property lust. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ if (H5Pset_layout(plistid, H5D_COMPACT) < 0)ERR;
+
+ /* Create the variable. */
+ if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
+ spaceid, plistid)) < 0) ERR;
+
+ /* Write the data. */
+ if (H5Dwrite(datasetid, H5T_NATIVE_INT, spaceid, spaceid,
+ H5P_DEFAULT, &data_out) < 0) ERR;
+
+ if ((layout = H5Pget_layout(plistid)) < 0) ERR;
+ if (layout != H5D_COMPACT) ERR;
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Dclose(datasetid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME1)) < 0) ERR;
+ if ((spaceid = H5Dget_space(datasetid)) < 0) ERR;
+ if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
+ if ((layout = H5Pget_layout(propid)) < 0) ERR;
+ if (layout != H5D_COMPACT) ERR;
+ if (H5Dread(datasetid, H5T_NATIVE_INT, H5S_ALL,
+ spaceid, H5P_DEFAULT, &data_in) < 0) ERR;
+
+ /* Check the data. */
+ if (data_in != data_out) ERR;
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Dclose(datasetid) < 0 ||
+ H5Pclose(propid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking that HDF5 does not allow chunked, scalar datasets...");
+ {
+ hid_t fapl_id, fcpl_id;
+ hid_t datasetid;
+ hid_t fileid, grpid, spaceid, plistid;
+ hsize_t chunksize = 1;
+
+ /* Create file, setting latest_format in access propertly list
+ * and H5P_CRT_ORDER_TRACKED in the creation property list. */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
+ if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
+ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
+ if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
+
+ if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
+
+ if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
+
+ /* Create property list. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ /* Set chunking. */
+ if (H5Pset_chunk(plistid, 1, &chunksize) < 0)ERR;
+
+ /* Turn off error messages. The next call will generate a
+ * bunch of error messages on the console. */
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+
+ /* Create the variable. This will not work, because only
+ * chunked datasets can use filters, and scalars can't be
+ * chunked. The H5Dcreate() call will fail. */
+ if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
+ spaceid, plistid)) > 0) ERR;
+
+ /* Turn on error messages back on. */
+ H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)&H5Eprint, stderr);
+
+ if (H5Pclose(fapl_id) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/h5_test/tst_h_vars.c netcdf-parallel-4.7.4/h5_test/tst_h_vars.c
--- netcdf-parallel-4.7.3/h5_test/tst_h_vars.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/h5_test/tst_h_vars.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,56 +1,60 @@
-/* This is part of the netCDF package.
- Copyright 2018 University Corporation for Atmospheric Research/Unidata
- See COPYRIGHT file for conditions of use.
+/* This is part of the netCDF package. Copyright 2020 University
+ Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
+ conditions of use.
Test HDF5 file code. These are not intended to be exhaustive tests,
but they use HDF5 the same way that netCDF-4 does, so if these
tests don't work, than netCDF-4 won't work either.
This files tests dataset creation and writing.
+
+ Ed Hartnett
*/
#include "h5_err_macros.h"
#include
#define FILE_NAME "tst_h_vars.h5"
+#define TEST_NAME "tst_h_vars"
#define GRP_NAME "Henry_V"
#define VAR_BOOL_NAME "Southhamptons_Battle_Record"
#define GRP2_NAME "Some_3D_Met_Data"
#define DIM1_LEN 3
#define MAX_DIMS 255
+#define NDIM1 1
int
main()
{
- hid_t fileid, grpid, spaceid, datasetid;
- int bool_out[DIM1_LEN] = {0, 1, 0};
- hsize_t dims[1];
-
- printf("\n*** Checking HDF5 variable functions.\n");
- printf("*** Checking HDF5 boolean variables...");
-
- /* Open file and create group. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-
- /* Write an array of bools. */
- dims[0] = DIM1_LEN;
- if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
- if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
- spaceid, H5P_DEFAULT)) < 0) ERR;
- if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- bool_out) < 0) ERR;
- if (H5Dclose(datasetid) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
+ hid_t fileid, grpid, spaceid, datasetid;
+ int bool_out[DIM1_LEN] = {0, 1, 0};
+ hsize_t dims[1];
+
+ printf("\n*** Checking HDF5 variable functions.\n");
+ printf("*** Checking HDF5 boolean variables...");
+
+ /* Open file and create group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* Write an array of bools. */
+ dims[0] = DIM1_LEN;
+ if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
+ if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+ if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ bool_out) < 0) ERR;
+ if (H5Dclose(datasetid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
- SUMMARIZE_ERR;
+ SUMMARIZE_ERR;
- printf("*** Checking HDF5 variable with unlimited dimension...");
- {
+ printf("*** Checking HDF5 variable with unlimited dimension...");
+ {
#define LAT_LEN 2
#define LON_LEN 3
#define NDIMS 3
@@ -60,350 +64,538 @@
#define PRES_NAME "Pressure"
#define TEMP_NAME "Temperature"
- hid_t fileid, grpid, spaceid, write_spaceid, spaceid_in, mem_spaceid;
- hid_t pres_dsid, temp_dsid, cparmsid;
- float float_data_out[LAT_LEN][LON_LEN];
- hsize_t dims[NDIMS], max_dims[NDIMS];
- hsize_t dims_in[NDIMS], max_dims_in[NDIMS];
- hsize_t start[MAX_DIMS], count[MAX_DIMS];
- int lat, lon;
-
- /* Set up some phoney data, 1 record's worth. In C, first
- * dimension varies most slowly. */
- for (lat = 0; lat < LAT_LEN; lat++)
- for (lon = 0; lon < LON_LEN; lon++)
- float_data_out[lat][lon] = -666.666;
-
- /* Create file and group. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gcreate(fileid, GRP2_NAME, 0)) < 0) ERR;
-
- /* Create a space corresponding to these three dimensions. */
- dims[0] = 0;
- dims[1] = LAT_LEN;
- dims[2] = LON_LEN;
- max_dims[0] = H5S_UNLIMITED;
- max_dims[1] = LAT_LEN;
- max_dims[2] = LON_LEN;
- if ((spaceid = H5Screate_simple(NDIMS, dims, max_dims)) < 0) ERR;
-
- /* Enable chunking for unlimited datasets. */
- if ((cparmsid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
- dims[0] = 1;
- dims[1] = 1;
- dims[2] = 1;
- if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
-
- /* Create two variables which use this space. */
- if ((pres_dsid = H5Dcreate(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
- spaceid, cparmsid)) < 0) ERR;
- if ((temp_dsid = H5Dcreate(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
- spaceid, cparmsid)) < 0) ERR;
-
- /* Get the spaceid and check various things. */
- if ((spaceid_in = H5Dget_space(pres_dsid)) < 0) ERR;
- if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
- max_dims_in) < 0) ERR;
- if (dims_in[0] != 0 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
- if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
-
- /* Extend each of them to hold one record. */
- dims[0] = 1;
- dims[1] = LAT_LEN;
- dims[2] = LON_LEN;
- if (H5Dextend(pres_dsid, dims) < 0) ERR;
- if (H5Dextend(temp_dsid, dims) < 0) ERR;
-
- /* Create a space to deal with one record at a time in memory. */
- if ((mem_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Create a space to write one record. */
- if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
-
- /* Write one record of data to each dataset. */
- if (H5Dwrite(pres_dsid, H5T_IEEE_F32BE, mem_spaceid, write_spaceid,
- H5P_DEFAULT, float_data_out) < 0) ERR;
- if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
- H5P_DEFAULT, float_data_out) < 0) ERR;
-
- /* Get the spaceid and check various things. */
- if ((spaceid_in = H5Dget_space(temp_dsid)) < 0) ERR;
- if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
- max_dims_in) < 0) ERR;
- if (dims_in[0] != 1 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
- if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
-
- /* Extend each of them to hold a second record. */
- dims[0] = 2;
- dims[1] = LAT_LEN;
- dims[2] = LON_LEN;
- if (H5Dextend(pres_dsid, dims) < 0) ERR;
- if (H5Dextend(temp_dsid, dims) < 0) ERR;
-
- /* Create a space to write second record. */
- if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
- count[0] = 1;
- count[1] = LAT_LEN;
- count[2] = LON_LEN;
- start[0] = 1;
- start[1] = 0;
- start[2] = 0;
- if (H5Sselect_hyperslab(write_spaceid, H5S_SELECT_SET,
- start, NULL, count, NULL) < 0) ERR;
-
- /* Write second record of data to each dataset. */
- if (H5Dwrite(pres_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
- H5P_DEFAULT, float_data_out) < 0) ERR;
- if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
- H5P_DEFAULT, float_data_out) < 0) ERR;
-
- /* Get the spaceid and check various things. */
- if ((spaceid_in = H5Dget_space(pres_dsid)) < 0) ERR;
- if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
- max_dims_in) < 0) ERR;
- if (dims_in[0] != 2 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
- if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
-
- /* Close up the shop. */
- if (H5Dclose(pres_dsid) < 0 ||
- H5Dclose(temp_dsid) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0) ERR;
+ hid_t fileid, grpid, spaceid, write_spaceid, spaceid_in, mem_spaceid;
+ hid_t pres_dsid, temp_dsid, cparmsid;
+ float float_data_out[LAT_LEN][LON_LEN];
+ hsize_t dims[NDIMS], max_dims[NDIMS];
+ hsize_t dims_in[NDIMS], max_dims_in[NDIMS];
+ hsize_t start[MAX_DIMS], count[MAX_DIMS];
+ int lat, lon;
+
+ /* Set up some phoney data, 1 record's worth. In C, first
+ * dimension varies most slowly. */
+ for (lat = 0; lat < LAT_LEN; lat++)
+ for (lon = 0; lon < LON_LEN; lon++)
+ float_data_out[lat][lon] = -666.666;
+
+ /* Create file and group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP2_NAME, 0)) < 0) ERR;
+
+ /* Create a space corresponding to these three dimensions. */
+ dims[0] = 0;
+ dims[1] = LAT_LEN;
+ dims[2] = LON_LEN;
+ max_dims[0] = H5S_UNLIMITED;
+ max_dims[1] = LAT_LEN;
+ max_dims[2] = LON_LEN;
+ if ((spaceid = H5Screate_simple(NDIMS, dims, max_dims)) < 0) ERR;
+
+ /* Enable chunking for unlimited datasets. */
+ if ((cparmsid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+ dims[0] = 1;
+ dims[1] = 1;
+ dims[2] = 1;
+ if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
+
+ /* Create two variables which use this space. */
+ if ((pres_dsid = H5Dcreate(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
+ spaceid, cparmsid)) < 0) ERR;
+ if ((temp_dsid = H5Dcreate(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
+ spaceid, cparmsid)) < 0) ERR;
+
+ /* Get the spaceid and check various things. */
+ if ((spaceid_in = H5Dget_space(pres_dsid)) < 0) ERR;
+ if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
+ max_dims_in) < 0) ERR;
+ if (dims_in[0] != 0 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
+ if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
+
+ /* Extend each of them to hold one record. */
+ dims[0] = 1;
+ dims[1] = LAT_LEN;
+ dims[2] = LON_LEN;
+ if (H5Dextend(pres_dsid, dims) < 0) ERR;
+ if (H5Dextend(temp_dsid, dims) < 0) ERR;
+
+ /* Create a space to deal with one record at a time in memory. */
+ if ((mem_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Create a space to write one record. */
+ if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+
+ /* Write one record of data to each dataset. */
+ if (H5Dwrite(pres_dsid, H5T_IEEE_F32BE, mem_spaceid, write_spaceid,
+ H5P_DEFAULT, float_data_out) < 0) ERR;
+ if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
+ H5P_DEFAULT, float_data_out) < 0) ERR;
+
+ /* Get the spaceid and check various things. */
+ if ((spaceid_in = H5Dget_space(temp_dsid)) < 0) ERR;
+ if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
+ max_dims_in) < 0) ERR;
+ if (dims_in[0] != 1 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
+ if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
+
+ /* Extend each of them to hold a second record. */
+ dims[0] = 2;
+ dims[1] = LAT_LEN;
+ dims[2] = LON_LEN;
+ if (H5Dextend(pres_dsid, dims) < 0) ERR;
+ if (H5Dextend(temp_dsid, dims) < 0) ERR;
+
+ /* Create a space to write second record. */
+ if ((write_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
+ count[0] = 1;
+ count[1] = LAT_LEN;
+ count[2] = LON_LEN;
+ start[0] = 1;
+ start[1] = 0;
+ start[2] = 0;
+ if (H5Sselect_hyperslab(write_spaceid, H5S_SELECT_SET,
+ start, NULL, count, NULL) < 0) ERR;
+
+ /* Write second record of data to each dataset. */
+ if (H5Dwrite(pres_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
+ H5P_DEFAULT, float_data_out) < 0) ERR;
+ if (H5Dwrite(temp_dsid, H5T_IEEE_F32LE, mem_spaceid, write_spaceid,
+ H5P_DEFAULT, float_data_out) < 0) ERR;
+
+ /* Get the spaceid and check various things. */
+ if ((spaceid_in = H5Dget_space(pres_dsid)) < 0) ERR;
+ if (H5Sget_simple_extent_dims(spaceid_in, dims_in,
+ max_dims_in) < 0) ERR;
+ if (dims_in[0] != 2 || dims_in[1] != LAT_LEN || dims_in[2] != LON_LEN) ERR;
+ if (max_dims_in[0] != H5S_UNLIMITED || max_dims_in[1] != LAT_LEN || max_dims_in[2] != LON_LEN) ERR;
+
+ /* Close up the shop. */
+ if (H5Dclose(pres_dsid) < 0 ||
+ H5Dclose(temp_dsid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0) ERR;
- }
+ }
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 deflate filter setting and getting...");
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 deflate filter setting and getting...");
#define DEFLATE_LEVEL 9
#define MAX_NAME 100
#define NUM_CD_ELEM 10
/* HDF5 defines this... */
#define DEFLATE_NAME "deflate"
- {
- H5Z_filter_t filter;
- int num_filters;
- hid_t propid;
- unsigned int flags, cd_values[NUM_CD_ELEM], filter_config;
- size_t cd_nelems = NUM_CD_ELEM;
- size_t namelen = MAX_NAME;
- char name[MAX_NAME + 1];
-
-
- /* Open file and create group. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-
- /* Write an array of bools, with compression. */
- dims[0] = DIM1_LEN;
- if ((propid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
- if (H5Pset_layout(propid, H5D_CHUNKED)) ERR;
- if (H5Pset_chunk(propid, 1, dims)) ERR;
- if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
- if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
- if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
- spaceid, propid)) < 0) ERR;
- if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- bool_out) < 0) ERR;
- if (H5Dclose(datasetid) < 0 ||
- H5Pclose(propid) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check. */
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
- if ((datasetid = H5Dopen1(grpid, VAR_BOOL_NAME)) < 0) ERR;
- if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
-
- /* The possible values of filter (which is just an int) can be
- * found in H5Zpublic.h. */
- if ((num_filters = H5Pget_nfilters(propid)) < 0) ERR;
- if (num_filters != 1) ERR;
- if ((filter = H5Pget_filter2(propid, 0, &flags, &cd_nelems, cd_values,
- namelen, name, &filter_config)) < 0) ERR;
- if (filter != H5Z_FILTER_DEFLATE || cd_nelems != 1 ||
- cd_values[0] != DEFLATE_LEVEL || strcmp(name, DEFLATE_NAME)) ERR;
-
- if (H5Dclose(datasetid) < 0 ||
- H5Pclose(propid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
-
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 deflate, fletcher32, shuffle filter setting and getting...");
- {
- H5Z_filter_t filter;
- int num_filters;
- hid_t propid;
- unsigned int flags, cd_values[NUM_CD_ELEM], filter_config;
- size_t cd_nelems = NUM_CD_ELEM;
- size_t namelen = MAX_NAME;
- char name[MAX_NAME + 1];
- int found_shuffle = 0, found_fletcher32 = 0, found_deflate = 0;
- int f;
-
- /* Open file and create group. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-
- /* Write an array of bools, with compression, fletcher32
- * checksum, shuffle filters. Like a hoogie with "the works." */
- dims[0] = DIM1_LEN;
- if ((propid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
- if (H5Pset_layout(propid, H5D_CHUNKED)) ERR;
- if (H5Pset_chunk(propid, 1, dims)) ERR;
- if (H5Pset_shuffle(propid)) ERR;
- if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
- if (H5Pset_fletcher32(propid)) ERR;
- if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
- if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
- spaceid, propid)) < 0) ERR;
- if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- bool_out) < 0) ERR;
- if (H5Dclose(datasetid) < 0 ||
- H5Pclose(propid) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check. */
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
- if ((datasetid = H5Dopen1(grpid, VAR_BOOL_NAME)) < 0) ERR;
- if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
-
- /* The possible values of filter (which is just an int) can be
- * found in H5Zpublic.h. */
- if ((num_filters = H5Pget_nfilters(propid)) < 0) ERR;
- if (num_filters != 3) ERR;
- for (f = 0; f < num_filters; f++)
- {
- if ((filter = H5Pget_filter2(propid, f, &flags, &cd_nelems, cd_values,
- namelen, name, &filter_config)) < 0) ERR;
- switch (filter)
- {
- case H5Z_FILTER_SHUFFLE:
- found_shuffle++;
- break;
- case H5Z_FILTER_FLETCHER32:
- found_fletcher32++;
- break;
- case H5Z_FILTER_DEFLATE:
- found_deflate++;
- if (cd_nelems != 1 || cd_values[0] != DEFLATE_LEVEL ||
- strcmp(name, DEFLATE_NAME)) ERR;
- break;
- default:
- break;
- }
- }
- if (!found_fletcher32 || !found_deflate || !found_shuffle) ERR;
-
- if (H5Dclose(datasetid) < 0 ||
- H5Pclose(propid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
+ {
+ H5Z_filter_t filter;
+ int num_filters;
+ hid_t propid;
+ unsigned int flags, cd_values[NUM_CD_ELEM], filter_config;
+ size_t cd_nelems = NUM_CD_ELEM;
+ size_t namelen = MAX_NAME;
+ char name[MAX_NAME + 1];
+
+
+ /* Open file and create group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* Write an array of bools, with compression. */
+ dims[0] = DIM1_LEN;
+ if ((propid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+ if (H5Pset_layout(propid, H5D_CHUNKED)) ERR;
+ if (H5Pset_chunk(propid, 1, dims)) ERR;
+ if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
+ if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
+ if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
+ spaceid, propid)) < 0) ERR;
+ if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ bool_out) < 0) ERR;
+ if (H5Dclose(datasetid) < 0 ||
+ H5Pclose(propid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check. */
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
+ if ((datasetid = H5Dopen1(grpid, VAR_BOOL_NAME)) < 0) ERR;
+ if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
+
+ /* The possible values of filter (which is just an int) can be
+ * found in H5Zpublic.h. */
+ if ((num_filters = H5Pget_nfilters(propid)) < 0) ERR;
+ if (num_filters != 1) ERR;
+ if ((filter = H5Pget_filter2(propid, 0, &flags, &cd_nelems, cd_values,
+ namelen, name, &filter_config)) < 0) ERR;
+ if (filter != H5Z_FILTER_DEFLATE || cd_nelems != 1 ||
+ cd_values[0] != DEFLATE_LEVEL || strcmp(name, DEFLATE_NAME)) ERR;
+
+ if (H5Dclose(datasetid) < 0 ||
+ H5Pclose(propid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 deflate, fletcher32, shuffle filter setting and getting...");
+ {
+ H5Z_filter_t filter;
+ int num_filters;
+ hid_t propid;
+ unsigned int flags, cd_values[NUM_CD_ELEM], filter_config;
+ size_t cd_nelems = NUM_CD_ELEM;
+ size_t namelen = MAX_NAME;
+ char name[MAX_NAME + 1];
+ int found_shuffle = 0, found_fletcher32 = 0, found_deflate = 0;
+ int f;
+
+ /* Open file and create group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* Write an array of bools, with compression, fletcher32
+ * checksum, shuffle filters. Like a hoogie with "the works." */
+ dims[0] = DIM1_LEN;
+ if ((propid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+ if (H5Pset_layout(propid, H5D_CHUNKED)) ERR;
+ if (H5Pset_chunk(propid, 1, dims)) ERR;
+ if (H5Pset_shuffle(propid)) ERR;
+ if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
+ if (H5Pset_fletcher32(propid)) ERR;
+ if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
+ if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
+ spaceid, propid)) < 0) ERR;
+ if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ bool_out) < 0) ERR;
+ if (H5Dclose(datasetid) < 0 ||
+ H5Pclose(propid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check. */
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
+ if ((datasetid = H5Dopen1(grpid, VAR_BOOL_NAME)) < 0) ERR;
+ if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
+
+ /* The possible values of filter (which is just an int) can be
+ * found in H5Zpublic.h. */
+ if ((num_filters = H5Pget_nfilters(propid)) < 0) ERR;
+ if (num_filters != 3) ERR;
+ for (f = 0; f < num_filters; f++)
+ {
+ if ((filter = H5Pget_filter2(propid, f, &flags, &cd_nelems, cd_values,
+ namelen, name, &filter_config)) < 0) ERR;
+ switch (filter)
+ {
+ case H5Z_FILTER_SHUFFLE:
+ found_shuffle++;
+ break;
+ case H5Z_FILTER_FLETCHER32:
+ found_fletcher32++;
+ break;
+ case H5Z_FILTER_DEFLATE:
+ found_deflate++;
+ if (cd_nelems != 1 || cd_values[0] != DEFLATE_LEVEL ||
+ strcmp(name, DEFLATE_NAME)) ERR;
+ break;
+ default:
+ break;
+ }
+ }
+ if (!found_fletcher32 || !found_deflate || !found_shuffle) ERR;
+
+ if (H5Dclose(datasetid) < 0 ||
+ H5Pclose(propid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
- SUMMARIZE_ERR;
- printf("*** Checking HDF5 endianness control...");
+ SUMMARIZE_ERR;
+ printf("*** Checking HDF5 endianness control...");
#define NATIVE_VAR_NAME "native_var"
#define LE_VAR_NAME "le_var"
#define BE_VAR_NAME "be_var"
- {
- int data[DIM1_LEN], data_in[DIM1_LEN];
- hid_t typeid, native_typeid;
- hid_t native_did, le_did, be_did;
- H5T_order_t order;
- htri_t equal;
- int i;
-
- for (i = 0; i < DIM1_LEN; i++)
- data[i] = i;
-
- /* Open file and create group. */
- if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
- H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
-
- /* Create a dataset of native endian. */
- dims[0] = DIM1_LEN;
- if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
- if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_NATIVE_INT,
- spaceid, H5P_DEFAULT)) < 0) ERR;
- if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_STD_I32LE,
- spaceid, H5P_DEFAULT)) < 0) ERR;
- if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_STD_I32BE,
- spaceid, H5P_DEFAULT)) < 0) ERR;
- if (H5Dwrite(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- data) < 0) ERR;
- if (H5Dwrite(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- data) < 0) ERR;
- if (H5Dwrite(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- data) < 0) ERR;
- if (H5Dclose(native_did) < 0 ||
- H5Dclose(le_did) < 0 ||
- H5Dclose(be_did) < 0 ||
- H5Sclose(spaceid) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
-
- /* Now reopen the file and check. */
- if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
- if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
-
- if ((native_did = H5Dopen1(grpid, NATIVE_VAR_NAME)) < 0) ERR;
- if ((typeid = H5Dget_type(native_did)) < 0) ERR;
- if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DESCEND)) < 0) ERR;
- if ((order = H5Tget_order(typeid)) < 0) ERR;
- if ((equal = H5Tequal(typeid, native_typeid)) < 0) ERR;
- if (!equal) ERR;
-
- if (H5Dread(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- data_in) < 0) ERR;
- for (i = 0; i < DIM1_LEN; i++)
- if (data[i] != data_in[i]) ERR;
-
- if ((le_did = H5Dopen1(grpid, LE_VAR_NAME)) < 0) ERR;
- if ((typeid = H5Dget_type(le_did)) < 0) ERR;
- if ((order = H5Tget_order(typeid)) < 0) ERR;
- if (order != H5T_ORDER_LE) ERR;
-
- if (H5Dread(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- data_in) < 0) ERR;
- for (i = 0; i < DIM1_LEN; i++)
- if (data[i] != data_in[i]) ERR;
-
- if ((be_did = H5Dopen1(grpid, BE_VAR_NAME)) < 0) ERR;
- if ((typeid = H5Dget_type(be_did)) < 0) ERR;
- if ((order = H5Tget_order(typeid)) < 0) ERR;
- if (order != H5T_ORDER_BE) ERR;
-
- if (H5Dread(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- data_in) < 0) ERR;
- for (i = 0; i < DIM1_LEN; i++)
- if (data[i] != data_in[i]) ERR;
-
- if (H5Dclose(native_did) < 0 ||
- H5Dclose(le_did) < 0 ||
- H5Dclose(be_did) < 0 ||
- H5Gclose(grpid) < 0 ||
- H5Fclose(fileid) < 0)
- ERR;
- }
-
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ {
+ int data[DIM1_LEN], data_in[DIM1_LEN];
+ hid_t typeid, native_typeid;
+ hid_t native_did, le_did, be_did;
+ H5T_order_t order;
+ htri_t equal;
+ int i;
+
+ for (i = 0; i < DIM1_LEN; i++)
+ data[i] = i;
+
+ /* Open file and create group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* Create a dataset of native endian. */
+ dims[0] = DIM1_LEN;
+ if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
+ if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_NATIVE_INT,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+ if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_STD_I32LE,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+ if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_STD_I32BE,
+ spaceid, H5P_DEFAULT)) < 0) ERR;
+ if (H5Dwrite(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data) < 0) ERR;
+ if (H5Dwrite(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data) < 0) ERR;
+ if (H5Dwrite(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data) < 0) ERR;
+ if (H5Dclose(native_did) < 0 ||
+ H5Dclose(le_did) < 0 ||
+ H5Dclose(be_did) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ /* Now reopen the file and check. */
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
+
+ if ((native_did = H5Dopen1(grpid, NATIVE_VAR_NAME)) < 0) ERR;
+ if ((typeid = H5Dget_type(native_did)) < 0) ERR;
+ if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DESCEND)) < 0) ERR;
+ if ((order = H5Tget_order(typeid)) < 0) ERR;
+ if ((equal = H5Tequal(typeid, native_typeid)) < 0) ERR;
+ if (!equal) ERR;
+
+ if (H5Dread(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data_in) < 0) ERR;
+ for (i = 0; i < DIM1_LEN; i++)
+ if (data[i] != data_in[i]) ERR;
+
+ if ((le_did = H5Dopen1(grpid, LE_VAR_NAME)) < 0) ERR;
+ if ((typeid = H5Dget_type(le_did)) < 0) ERR;
+ if ((order = H5Tget_order(typeid)) < 0) ERR;
+ if (order != H5T_ORDER_LE) ERR;
+
+ if (H5Dread(le_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data_in) < 0) ERR;
+ for (i = 0; i < DIM1_LEN; i++)
+ if (data[i] != data_in[i]) ERR;
+
+ if ((be_did = H5Dopen1(grpid, BE_VAR_NAME)) < 0) ERR;
+ if ((typeid = H5Dget_type(be_did)) < 0) ERR;
+ if ((order = H5Tget_order(typeid)) < 0) ERR;
+ if (order != H5T_ORDER_BE) ERR;
+
+ if (H5Dread(be_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data_in) < 0) ERR;
+ for (i = 0; i < DIM1_LEN; i++)
+ if (data[i] != data_in[i]) ERR;
+
+ if (H5Dclose(native_did) < 0 ||
+ H5Dclose(le_did) < 0 ||
+ H5Dclose(be_did) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+
+ SUMMARIZE_ERR;
+#ifdef USE_SZIP
+ printf("*** Checking szip functionality...");
+#define SZIP_VAR_NAME "szip_var"
+#define SZIP_DIM1_LEN 32
+ {
+ int data[SZIP_DIM1_LEN];
+ hid_t plistid;
+ hsize_t chunksize[NDIM1] = {SZIP_DIM1_LEN};
+ int options_mask = 32, pixels_per_block = 4;
+ hsize_t my_dims[NDIM1];
+ int i;
+
+ /* For info about HDF5 and szip, see
+ * https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip
+ * and
+ * https://support.hdfgroup.org/doc_resource/SZIP/index.html. */
+
+ for (i = 0; i < SZIP_DIM1_LEN; i++)
+ data[i] = i;
+
+ /* Open file and create group. */
+ if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* Create dataset creation property list. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ /* Turn on chunking. */
+ if (H5Pset_chunk(plistid, NDIM1, chunksize) < 0) ERR;
+
+ /* Turn off object tracking times in HDF5 (as netcdf-4 does). */
+ if (H5Pset_obj_track_times(plistid, 0) < 0) ERR;
+
+ /* Turn on szip compression. */
+ if (H5Pset_szip(plistid, options_mask, pixels_per_block) < 0) ERR;
+
+ /* Create a space. */
+ my_dims[0] = SZIP_DIM1_LEN;
+ if ((spaceid = H5Screate_simple(1, my_dims, my_dims)) < 0) ERR;
+
+ /* Create a dataset. */
+ if ((datasetid = H5Dcreate2(grpid, SZIP_VAR_NAME, H5T_NATIVE_INT,
+ spaceid, H5P_DEFAULT, plistid,
+ H5P_DEFAULT)) < 0) ERR;
+
+ /* Write data. */
+ if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data) < 0) ERR;
+
+ /* Release resources. */
+ if (H5Dclose(datasetid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Pclose(plistid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ {
+ /* Now reopen the file and check. */
+ int data_in[SZIP_DIM1_LEN];
+ hid_t native_did;
+ int i;
+
+ if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
+
+ if ((native_did = H5Dopen1(grpid, SZIP_VAR_NAME)) < 0) ERR;
+
+ if (H5Dread(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data_in) < 0) ERR;
+ for (i = 0; i < SZIP_DIM1_LEN; i++)
+ if (data[i] != data_in[i]) ERR;
+
+ if (H5Dclose(native_did) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ }
+ SUMMARIZE_ERR;
+ printf("*** Checking using szip and zlib on same var...");
+#define BOTH_VAR_NAME "szip_var"
+#define BOTH_DIM1_LEN 50
+#define NUM_FILE 5
+#define MAX_STR 80
+ {
+ int data[BOTH_DIM1_LEN];
+ hid_t plistid;
+ hsize_t chunksize[NDIM1] = {BOTH_DIM1_LEN};
+ int options_mask = 32, pixels_per_block = 4;
+ int deflate_level = 3;
+ hsize_t my_dims[NDIM1];
+ int i, f;
+
+ /* Create data. */
+ for (i = 0; i < BOTH_DIM1_LEN; i++)
+ data[i] = i;
+
+ /* Run test 4 times. */
+ for (f = 0; f < NUM_FILE; f++)
+ {
+ char file_name[MAX_STR + 1];
+ char desc[NUM_FILE][MAX_STR + 1] = {"uncompressed", "zlib",
+ "szip", "zlib_and_szip",
+ "szip_and_zlib"};
+
+ /* Open file and create group. */
+ sprintf(file_name, "%s_%s.h5", TEST_NAME, desc[f]);
+ if ((fileid = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
+
+ /* Create dataset creation property list. */
+ if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
+
+ /* Turn on chunking. */
+ if (H5Pset_chunk(plistid, NDIM1, chunksize) < 0) ERR;
+
+ /* Turn off object tracking times in HDF5 (as netcdf-4 does). */
+ if (H5Pset_obj_track_times(plistid, 0) < 0) ERR;
+
+ /* Turn on compression for some files. */
+ switch (f)
+ {
+ case 1:
+ if (H5Pset_deflate(plistid, deflate_level) < 0)
+ break;
+ case 2:
+ if (H5Pset_szip(plistid, options_mask, pixels_per_block) < 0) ERR;
+ break;
+ case 3:
+ if (H5Pset_deflate(plistid, deflate_level) < 0)
+ if (H5Pset_szip(plistid, options_mask, pixels_per_block) < 0) ERR;
+ break;
+ case 4:
+ if (H5Pset_szip(plistid, options_mask, pixels_per_block) < 0) ERR;
+ if (H5Pset_deflate(plistid, deflate_level) < 0)
+ break;
+ }
+
+
+ /* Create a space. */
+ my_dims[0] = BOTH_DIM1_LEN;
+ if ((spaceid = H5Screate_simple(1, my_dims, my_dims)) < 0) ERR;
+
+ /* Create a dataset. */
+ if ((datasetid = H5Dcreate2(grpid, BOTH_VAR_NAME, H5T_NATIVE_INT,
+ spaceid, H5P_DEFAULT, plistid,
+ H5P_DEFAULT)) < 0) ERR;
+
+ /* Write data. */
+ if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data) < 0) ERR;
+
+ /* Release resources. */
+ if (H5Dclose(datasetid) < 0 ||
+ H5Sclose(spaceid) < 0 ||
+ H5Pclose(plistid) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+
+ {
+ /* Now reopen the file and check. */
+ int data_in[BOTH_DIM1_LEN];
+ hid_t native_did;
+ int i;
+
+ if ((fileid = H5Fopen(file_name, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
+ if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
+
+ if ((native_did = H5Dopen1(grpid, BOTH_VAR_NAME)) < 0) ERR;
+
+ if (H5Dread(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ data_in) < 0) ERR;
+ for (i = 0; i < BOTH_DIM1_LEN; i++)
+ if (data[i] != data_in[i]) ERR;
+
+ if (H5Dclose(native_did) < 0 ||
+ H5Gclose(grpid) < 0 ||
+ H5Fclose(fileid) < 0)
+ ERR;
+ }
+ } /* next file */
+ }
+ SUMMARIZE_ERR;
+#endif /* USE_SZIP */
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/hdf4_test/Makefile.in netcdf-parallel-4.7.4/hdf4_test/Makefile.in
--- netcdf-parallel-4.7.3/hdf4_test/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/hdf4_test/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -498,8 +498,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -539,11 +541,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/include/hdf4dispatch.h netcdf-parallel-4.7.4/include/hdf4dispatch.h
--- netcdf-parallel-4.7.3/include/hdf4dispatch.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/hdf4dispatch.h 2020-08-31 10:33:26.000000000 +0000
@@ -14,10 +14,6 @@
#include "config.h"
#include "ncdispatch.h"
-/** This is the max size of an SD dataset name in HDF4 (from HDF4
- * documentation).*/
-#define NC_MAX_HDF4_NAME 64
-
/** This is the max number of dimensions for a HDF4 SD dataset (from
* HDF4 documentation). */
#define NC_MAX_HDF4_DIMS 32
diff -Nru netcdf-parallel-4.7.3/include/hdf5internal.h netcdf-parallel-4.7.4/include/hdf5internal.h
--- netcdf-parallel-4.7.3/include/hdf5internal.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/hdf5internal.h 2020-08-31 10:33:26.000000000 +0000
@@ -108,6 +108,9 @@
hid_t native_hdf_typeid;
} NC_HDF5_TYPE_INFO_T;
+/* Forward */
+struct NC_FILTER_OBJ_HDF5;
+
/* Logging and debugging. */
void reportopenobjects(int log, hid_t);
int hdf5_set_log_level();
@@ -171,11 +174,15 @@
/* Define Filter API Function */
-int nc4_filter_action(int action, int formatx, int id, NC_FILTER_INFO* info);
+int nc4_global_filter_action(int action, unsigned int id, struct NC_FILTER_OBJ_HDF5* infop);
+int NC4_hdf5_addfilter(NC_VAR_INFO_T* var, int active, unsigned int id, size_t nparams, unsigned int* params);
+int NC4_hdf5_remove_filter(NC_VAR_INFO_T* var, unsigned int filterid);
+
/* Support functions for provenance info (defined in nc4hdf.c) */
extern int NC4_hdf5get_libversion(unsigned*,unsigned*,unsigned*);/*libsrc4/nc4hdf.c*/
extern int NC4_hdf5get_superblock(struct NC_FILE_INFO*, int*);/*libsrc4/nc4hdf.c*/
extern int NC4_isnetcdf4(struct NC_FILE_INFO*); /*libsrc4/nc4hdf.c*/
+extern int nc4_find_default_chunksizes2(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var);
#endif /* _HDF5INTERNAL_ */
diff -Nru netcdf-parallel-4.7.3/include/Makefile.in netcdf-parallel-4.7.4/include/Makefile.in
--- netcdf-parallel-4.7.3/include/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -257,8 +257,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -298,11 +300,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/include/nc4dispatch.h netcdf-parallel-4.7.4/include/nc4dispatch.h
--- netcdf-parallel-4.7.3/include/nc4dispatch.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/nc4dispatch.h 2020-08-31 10:33:26.000000000 +0000
@@ -256,6 +256,9 @@
EXTERNL int
NC4_show_metadata(int);
+ EXTERNL int
+ NC4_filter_actions(int, int, int, struct NC_Filterobject*);
+
#if defined(__cplusplus)
}
#endif
diff -Nru netcdf-parallel-4.7.3/include/nc4internal.h netcdf-parallel-4.7.4/include/nc4internal.h
--- netcdf-parallel-4.7.3/include/nc4internal.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/nc4internal.h 2020-08-31 10:33:26.000000000 +0000
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include "ncdimscale.h"
@@ -27,6 +26,7 @@
#include "netcdf_f.h"
#include "netcdf_mem.h"
+#include "netcdf_filter.h"
#ifdef USE_PARALLEL
#include "netcdf_par.h"
#endif /* USE_PARALLEL */
@@ -56,6 +56,9 @@
/** One mega-byte. */
#define MEGABYTE 1048576
+/** The HDF5 ID for the szip filter. */
+#define HDF5_FILTER_SZIP 4
+
#define X_SCHAR_MIN (-128) /**< Minimum signed char value. */
#define X_SCHAR_MAX 127 /**< Maximum signed char value. */
#define X_UCHAR_MAX 255U /**< Maximum unsigned char value. */
@@ -73,11 +76,11 @@
#define X_INT64_MIN (-9223372036854775807LL-1LL) /**< Minimum int64 value. */
#define X_INT64_MAX 9223372036854775807LL /**< Maximum int64 value. */
#define X_UINT64_MAX 18446744073709551615ULL /**< Maximum unsigned int64 value. */
-#ifdef WIN32 /* Windows, of course, has to be a *little* different. */
+#ifdef _WIN32 /* Windows, of course, has to be a *little* different. */
#define X_FLOAT_MAX 3.402823466e+38f
#else
#define X_FLOAT_MAX 3.40282347e+38f /**< Maximum float value. */
-#endif /* WIN32 */
+#endif /* _WIN32 */
#define X_FLOAT_MIN (-X_FLOAT_MAX) /**< Minimum float value. */
#define X_DOUBLE_MAX 1.7976931348623157e+308 /**< Maximum double value. */
#define X_DOUBLE_MIN (-X_DOUBLE_MAX) /**< Minimum double value. */
@@ -123,6 +126,7 @@
/* Forward declarations. */
struct NC_GRP_INFO;
struct NC_TYPE_INFO;
+struct NC_FIlterobject;
/**
* This struct provides indexed Access to Meta-data objects. See the
@@ -183,41 +187,38 @@
/** This is a struct to handle the var metadata. */
typedef struct NC_VAR_INFO
{
- NC_OBJ hdr; /**< The hdr contains the name and ID. */
- char *hdf5_name; /**< Used if name in HDF5 must be different from name. */
+ NC_OBJ hdr; /**< The hdr contains the name and ID. */
+ char *hdf5_name; /**< Used if name in HDF5 must be different from name. */
struct NC_GRP_INFO *container; /**< Pointer to containing group. */
- size_t ndims; /**< Number of dims. */
- int *dimids; /**< Dim IDs. */
- NC_DIM_INFO_T **dim; /**< Pointer to dim. */
- nc_bool_t is_new_var; /**< True if variable is newly created */
- nc_bool_t was_coord_var; /**< True if variable was a coordinate var, but either the dim or var has been renamed */
- nc_bool_t became_coord_var; /**< True if variable _became_ a coordinate var, because either the dim or var has been renamed */
- nc_bool_t fill_val_changed; /**< True if variable's fill value changes after it has been created */
- nc_bool_t attr_dirty; /**< True if variable's attributes are dirty and should be rewritten */
- nc_bool_t created; /**< Variable has already been created (_not_ that it was just created) */
- nc_bool_t written_to; /**< True if variable has data written to it */
- struct NC_TYPE_INFO *type_info;
+ size_t ndims; /**< Number of dims. */
+ int *dimids; /**< Dim IDs. */
+ NC_DIM_INFO_T **dim; /**< Pointer to array of NC_DIM_INFO_T. */
+ nc_bool_t is_new_var; /**< True if variable is newly created. */
+ nc_bool_t was_coord_var; /**< True if variable was a coordinate var, but either the dim or var has been renamed. */
+ nc_bool_t became_coord_var; /**< True if variable _became_ a coordinate var, because either the dim or var has been renamed. */
+ nc_bool_t fill_val_changed; /**< True if variable's fill value changes after it has been created. */
+ nc_bool_t attr_dirty; /**< True if variable's attributes are dirty and should be rewritten. */
+ nc_bool_t created; /**< Variable has already been created (_not_ that it was just created). */
+ nc_bool_t written_to; /**< True if variable has data written to it. */
+ struct NC_TYPE_INFO *type_info; /**< Contains info about the variable type. */
int atts_read; /**< If true, the atts have been read. */
nc_bool_t meta_read; /**< True if this vars metadata has been completely read. */
nc_bool_t coords_read; /**< True if this var has hidden coordinates att, and it has been read. */
- NCindex *att; /**< NCindex */
- nc_bool_t no_fill; /**< True if no fill value is defined for var */
- void *fill_value;
- size_t *chunksizes;
- nc_bool_t contiguous; /**< True if variable is stored contiguously in HDF5 file */
- int parallel_access; /**< Type of parallel access for I/O on variable (collective or independent) */
- nc_bool_t dimscale; /**< True if var is a dimscale */
- nc_bool_t *dimscale_attached; /**< Array of flags that are true if dimscale is attached for that dim index */
- nc_bool_t deflate; /**< True if var has deflate filter applied */
- int deflate_level;
- nc_bool_t shuffle; /**< True if var has shuffle filter applied */
- nc_bool_t fletcher32; /**< True if var has fletcher32 filter applied */
- size_t chunk_cache_size, chunk_cache_nelems;
- float chunk_cache_preemption;
+ NCindex *att; /**< List of NC_ATT_INFO_T. */
+ nc_bool_t no_fill; /**< True if no fill value is defined for var. */
+ void *fill_value; /**< Pointer to fill value, or NULL. */
+ size_t *chunksizes; /**< For chunked storage, an array (size ndims) of chunksizes. */
+ int storage; /**< Storage of this var, compact, contiguous, or chunked. */
+ int parallel_access; /**< Type of parallel access for I/O on variable (collective or independent). */
+ nc_bool_t dimscale; /**< True if var is a dimscale. */
+ nc_bool_t *dimscale_attached; /**< Array of flags that are true if dimscale is attached for that dim index. */
+ nc_bool_t shuffle; /**< True if var has shuffle filter applied. */
+ nc_bool_t fletcher32; /**< True if var has fletcher32 filter applied. */
+ size_t chunk_cache_size; /**< Size in bytes of the var chunk chache. */
+ size_t chunk_cache_nelems; /**< Number of slots in var chunk cache. */
+ float chunk_cache_preemption; /**< Chunk cache preemtion policy. */
void *format_var_info; /**< Pointer to any binary format info. */
- unsigned int filterid; /**< ID for arbitrary filter. */
- size_t nparams; /**< nparams for arbitrary filter. */
- unsigned int *params; /**< Params for arbitrary filter. */
+ NClist* filters; /**< List of filters to be applied to var data. */
} NC_VAR_INFO_T;
/** This is a struct to handle the field metadata from a user-defined
@@ -448,4 +449,57 @@
/* Binary searcher for reserved attributes */
extern const NC_reservedatt *NC_findreserved(const char *name);
+/**************************************************/
+/* Internal filter related structures */
+
+/* Internal filter actions */
+#define NCFILTER_DEF 1
+#define NCFILTER_REMOVE 2
+#define NCFILTER_INQ 3
+#define NCFILTER_FILTERIDS 4
+#define NCFILTER_INFO 5
+#define NCFILTER_FREESPEC 6
+#define NCFILTER_CLIENT_REG 10
+#define NCFILTER_CLIENT_UNREG 11
+#define NCFILTER_CLIENT_INQ 12
+
+typedef enum NC_FILTER_SORT {
+ NC_FILTER_SORT_SPEC=((int)1),
+ NC_FILTER_SORT_IDS=((int)2),
+ NC_FILTER_SORT_CLIENT=((int)3),
+} NC_FILTER_SORT;
+
+/* Provide structs to pass args to filter_actions function for HDF5*/
+
+typedef struct NC_FILTER_SPEC_HDF5 {
+ int active; /**< true iff HDF5 library was told to activate filter */
+ unsigned int filterid; /**< ID for arbitrary filter. */
+ size_t nparams; /**< nparams for arbitrary filter. */
+ unsigned int* params; /**< Params for arbitrary filter. */
+} NC_FILTER_SPEC_HDF5;
+
+typedef struct NC_FILTERIDS_HDF5 {
+ size_t nfilters; /**< number of filters */
+ unsigned int* filterids; /**< Filter ids. */
+} NC_FILTERIDS_HDF5;
+
+typedef struct NC_FILTER_CLIENT_HDF5 {
+ unsigned int id;
+ /* The filter info for hdf5 */
+ /* Avoid needing hdf.h by using void* */
+ void* info;
+} NC_FILTER_CLIENT_HDF5;
+
+typedef struct NC_FILTER_OBJ_HDF5 {
+ NC_Filterobject hdr; /* So we can cast it */
+ NC_FILTER_SORT sort; /* discriminate union */
+ union {
+ NC_FILTER_SPEC_HDF5 spec;
+ NC_FILTERIDS_HDF5 ids;
+ NC_FILTER_CLIENT_HDF5 client;
+ } u;
+} NC_FILTER_OBJ_HDF5;
+
+extern void NC4_freefilterspec(NC_FILTER_SPEC_HDF5* f);
+
#endif /* _NC4INTERNAL_ */
diff -Nru netcdf-parallel-4.7.3/include/ncauth.h netcdf-parallel-4.7.4/include/ncauth.h
--- netcdf-parallel-4.7.3/include/ncauth.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/ncauth.h 2020-08-31 10:33:26.000000000 +0000
@@ -21,6 +21,7 @@
int compress; /*CURLOPT_ENCODING*/
int verbose; /*CURLOPT_ENCODING*/
int timeout; /*CURLOPT_TIMEOUT*/
+ int connecttimeout; /*CURLOPT_CONNECTTIMEOUT*/
int maxredirs; /*CURLOPT_MAXREDIRS*/
char* useragent; /*CURLOPT_USERAGENT*/
int cookiejarcreated;
diff -Nru netcdf-parallel-4.7.3/include/ncconfigure.h netcdf-parallel-4.7.4/include/ncconfigure.h
--- netcdf-parallel-4.7.3/include/ncconfigure.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/ncconfigure.h 2020-08-31 10:33:26.000000000 +0000
@@ -62,7 +62,7 @@
#endif
#endif /*STDC*/
-#endif /*!WIN32*/
+#endif /*!_WIN32*/
#ifdef _WIN32
#ifndef HAVE_STRLCAT
diff -Nru netcdf-parallel-4.7.3/include/ncdispatch.h netcdf-parallel-4.7.4/include/ncdispatch.h
--- netcdf-parallel-4.7.3/include/ncdispatch.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/ncdispatch.h 2020-08-31 10:33:26.000000000 +0000
@@ -165,7 +165,6 @@
struct NC;
-
int NC_create(const char *path, int cmode,
size_t initialsz, int basepe, size_t *chunksizehintp,
int useparallel, void *parameters, int *ncidp);
diff -Nru netcdf-parallel-4.7.3/include/nctestserver.h netcdf-parallel-4.7.4/include/nctestserver.h
--- netcdf-parallel-4.7.3/include/nctestserver.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/nctestserver.h 2020-08-31 10:33:26.000000000 +0000
@@ -9,6 +9,9 @@
*/
+#ifndef NCTESTSERVER_H
+#define NCTESTSERVER_H 1
+
#include "config.h"
#include
#include
@@ -18,6 +21,8 @@
#undef FINDTESTSERVER_DEBUG
+enum KIND {NOKIND, DAP2KIND, DAP4KIND, THREDDSKIND};
+
#define MAXSERVERURL 4096
#define TIMEOUT 10 /*seconds*/
#define BUFSIZE 8192 /*bytes*/
@@ -28,6 +33,7 @@
#endif
static int ping(const char* url);
+static int timedping(const char* url, long timeout);
static char**
parseServers(const char* remotetestservers)
@@ -73,8 +79,8 @@
Return the complete url for the server plus the path.
*/
-static char*
-nc_findtestserver(const char* path, int isdap4, const char* serverlist)
+char*
+nc_findtestserver(const char* path, const char* serverlist)
{
char** svclist;
char** svc;
@@ -153,9 +159,16 @@
See if a server is responding.
Return NC_ECURL if the ping fails, NC_NOERR otherwise
*/
+
static int
ping(const char* url)
{
+ return timedping(url,TIMEOUT);
+}
+
+static int
+timedping(const char* url, long timeout)
+{
int stat = NC_NOERR;
CURLcode cstat = CURLE_OK;
CURL* curl = NULL;
@@ -171,8 +184,9 @@
CERR((curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 10L)));
CERR((curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L)));
- /* use a very short timeout: 10 seconds */
- CERR((curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)TIMEOUT)));
+ /* use very short timeouts: 10 seconds */
+ CERR((curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, (long)timeout)));
+ CERR((curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)timeout)));
/* fail on HTTP 400 code errors */
CERR((curl_easy_setopt(curl, CURLOPT_FAILONERROR, (long)1)));
@@ -210,3 +224,4 @@
curl_easy_cleanup(curl);
return stat;
}
+#endif /*NCTESTSERVER_H*/
diff -Nru netcdf-parallel-4.7.3/include/nc_tests.h netcdf-parallel-4.7.4/include/nc_tests.h
--- netcdf-parallel-4.7.3/include/nc_tests.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/nc_tests.h 2020-08-31 10:33:26.000000000 +0000
@@ -18,12 +18,12 @@
#include
#include
#include "netcdf.h"
+#include "netcdf_filter.h"
#include "nc_logging.h"
#ifdef USE_PARALLEL
#include "netcdf_par.h"
#endif
-
/** NC_MAX_DIMS for tests. Allows different NC_MAX_DIMS values
* without breaking this test with a heap or stack overflow. */
#define NC_TESTS_MAX_DIMS 1024
diff -Nru netcdf-parallel-4.7.3/include/netcdf_dispatch.h netcdf-parallel-4.7.4/include/netcdf_dispatch.h
--- netcdf-parallel-4.7.3/include/netcdf_dispatch.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/netcdf_dispatch.h 2020-08-31 10:33:26.000000000 +0000
@@ -23,11 +23,19 @@
#ifndef NETCDF_DISPATCH_H
#define NETCDF_DISPATCH_H
+/* This is the version of the dispatch table. It should be changed
+ * when new functions are added to the dispatch table. */
+#define NC_DISPATCH_VERSION 2
+
+/* Forward */
+struct NC_Filterobject;
+
/* This is the dispatch table, with a pointer to each netCDF
* function. */
struct NC_Dispatch
{
int model; /* one of the NC_FORMATX #'s */
+ int dispatch_version;
int (*create)(const char *path, int cmode, size_t initialsz,
int basepe, size_t *chunksizehintp, void *parameters,
@@ -137,6 +145,10 @@
int (*set_var_chunk_cache)(int, int, size_t, size_t, float);
int (*get_var_chunk_cache)(int ncid, int varid, size_t *sizep,
size_t *nelemsp, float *preemptionp);
+
+ /* Dispatch table Version 2 or later */
+ /* Handle all filter related actions. */
+ int (*filter_actions)(int ncid, int varid, int action, struct NC_Filterobject*);
};
#if defined(__cplusplus)
@@ -219,6 +231,8 @@
EXTERNL int NC_NOTNC4_inq_user_type(int, nc_type, char *, size_t *,
nc_type *, size_t *, int *);
EXTERNL int NC_NOTNC4_inq_typeid(int, const char *, nc_type *);
+ EXTERNL int NC_NOTNC4_filter_actions(int, int, int, struct NC_Filterobject*);
+
#if defined(__cplusplus)
}
#endif
diff -Nru netcdf-parallel-4.7.3/include/netcdf_filter.h netcdf-parallel-4.7.4/include/netcdf_filter.h
--- netcdf-parallel-4.7.3/include/netcdf_filter.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/netcdf_filter.h 2020-08-31 10:33:26.000000000 +0000
@@ -14,42 +14,95 @@
/* API for libdispatch/dfilter.c */
/* Must match values in */
+#ifndef H5Z_FILTER_DEFLATE
+#define H5Z_FILTER_DEFLATE 1
+#endif
#ifndef H5Z_FILTER_SZIP
#define H5Z_FILTER_SZIP 4
+#define H5_SZIP_ALLOW_K13_OPTION_MASK 1
+#define H5_SZIP_CHIP_OPTION_MASK 2
+#define H5_SZIP_EC_OPTION_MASK 4
+#define H5_SZIP_NN_OPTION_MASK 32
+#define H5_SZIP_MAX_PIXELS_PER_BLOCK 32
#endif
-/* Define the known filter formats */
-#define NC_FILTER_FORMAT_HDF5 1 /* Use the H5Z_class2_t format */
+#define H5_SZIP_ALL_MASKS (H5_SZIP_CHIP_OPTION_MASK|H5_SZIP_EC_OPTION_MASK|H5_SZIP_NN_OPTION_MASK)
-/* Note that this structure can be extended
- in the usual C way if the first field of the extended
- struct is of type NC_FILTER_INFO
-*/
-typedef struct NC_FILTER_INFO {
- int version; /* Of this structure */
-# define NC_FILTER_INFO_VERSION 1
- int format; /* Controls actual type of this structure */
- int id; /* Must be unique WRT format */
- void* info; /* The filter info as defined by the format.
- For format == NC_FILTER_FORMAT_HDF5,
- this must conform to H5Z_class2_t in H5Zpublic.h;
- Defined as void* to avoid specifics.
- */
-} NC_FILTER_INFO;
+/** The maximum allowed setting for pixels_per_block when calling nc_def_var_szip(). */
+#define NC_MAX_PIXELS_PER_BLOCK 32
#if defined(__cplusplus)
extern "C" {
#endif
-/* Provide consistent filter spec parser */
-EXTERNL int NC_parsefilterspec(const char* spec, unsigned int* idp, size_t* nparamsp, unsigned int** paramsp);
+/* Define the formats for NC_FILTER classes */
+#define NC_FILTER_FORMAT_HDF5 (NC_FORMATX_NC_HDF5)
+
+/* Define the sort for NC_FILTER classes */
+//#define NC_FILTER_SORT_SPEC ((int)1) /* Use for NC_Filterspec; Must match nc4internal.h */
+
+/* Define a Header Object for all filter-related objects */
+
+/* provide a common generic struct field */
+/*
+ format indicates e.g. HDF5
+ sort indicates the "subclass" of the superclass
+*/
+typedef struct NC_Filterobject {int format;} NC_Filterobject;
+
+/* Generic version of Filterspec */
+typedef struct NC_Filterspec {
+ NC_Filterobject hdr; /**< e.g. NC_FILTER_FORMAT_HDF5 */
+} NC_Filterspec;
+
+/**************************************************/
+/* HDF5 Specific filter functions */
+
+/*Define a filter for a variable */
+EXTERNL int
+nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int* parms);
+
+/* Learn about the first defined filter filter on a variable */
+EXTERNL int
+nc_inq_var_filter(int ncid, int varid, unsigned int* idp, size_t* nparams, unsigned int* params);
+
+/* Support inquiry about all the filters associated with a variable */
+/* As is usual, it is expected that this will be called twice:
+ once to get the number of filters, and then a second time to read the ids */
+EXTERNL int nc_inq_var_filterids(int ncid, int varid, size_t* nfilters, unsigned int* filterids);
+
+/* Learn about the filter with specified id wrt a variable */
+EXTERNL int
+nc_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params);
+
+/* Remove filter from variable*/
+EXTERNL int nc_var_filter_remove(int ncid, int varid, unsigned int id);
+
+/* Support direct user defined filters;
+ last arg is void*, but is actually H5Z_class2_t*.
+ It is void* to avoid having to reference hdf.h.
+*/
+EXTERNL int nc_filter_client_register(unsigned int id, void*/*H5Z_class2_t* */);
+EXTERNL int nc_filter_client_unregister(unsigned int id);
+EXTERNL int nc_filter_client_inq(unsigned int id, void*/*H5Z_class2_t* */);
+
+/* HDF5 specific filter info */
+typedef struct NC4_Filterspec {
+ NC_Filterspec hdr;
+ /* HDF5 specific extensions */
+ unsigned int filterid; /**< ID for arbitrary filter. */
+ size_t nparams; /**< nparams for arbitrary filter. */
+ unsigned int* params; /**< Params for arbitrary filter. */
+} NC4_Filterspec;
+
+EXTERNL void NC4_filterfix8(unsigned char* mem, int decode);
+
+EXTERNL int NC_parsefilterlist(const char* listspec, int* formatp, size_t* nfilters, NC_Filterspec*** filtersp);
+EXTERNL int NC_parsefilterspec(const char* txt, int format, NC_Filterspec** specp);
-EXTERNL void NC_filterfix8(unsigned char* mem, int decode);
+/* End HDF5 Specific Declarations */
-/* Support direct user defined filters */
-EXTERNL int nc_filter_register(NC_FILTER_INFO* filter_info);
-EXTERNL int nc_filter_unregister(int format, int id);
-EXTERNL int nc_filter_inq(int format, int id, NC_FILTER_INFO* filter_info);
+/**************************************************/
#if defined(__cplusplus)
}
diff -Nru netcdf-parallel-4.7.3/include/netcdf.h netcdf-parallel-4.7.4/include/netcdf.h
--- netcdf-parallel-4.7.3/include/netcdf.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/netcdf.h 2020-08-31 10:33:26.000000000 +0000
@@ -276,8 +276,11 @@
#define NC_MAX_VAR_DIMS 1024 /**< max per variable dimensions */
/**@}*/
-/** This is the max size of an SD dataset name in HDF4 (from HDF4 documentation).*/
-#define NC_MAX_HDF4_NAME 64
+/** The max size of an SD dataset name in HDF4 (from HDF4
+ * documentation) is 64. But in in the wild we have encountered longer
+ * names. As long as the HDF4 name is not greater than NC_MAX_NAME,
+ * our code will be OK. */
+#define NC_MAX_HDF4_NAME NC_MAX_NAME
/** In HDF5 files you can set the endianness of variables with
nc_def_var_endian(). This define is used there. */
@@ -293,6 +296,7 @@
/**@{*/
#define NC_CHUNKED 0
#define NC_CONTIGUOUS 1
+#define NC_COMPACT 2
/**@}*/
/** In HDF5 files you can set check-summing for each variable.
@@ -471,7 +475,13 @@
#define NC_ERCFILE (-133) /**< RC file failure */
#define NC_ENULLPAD (-134) /**< Header Bytes not Null-Byte padded */
#define NC_EINMEMORY (-135) /**< In-memory file error */
-#define NC4_LAST_ERROR (-136) /**< @internal All netCDF errors > this. */
+#define NC_ENOFILTER (-136) /**< Filter not defined on variable. */
+
+#define NC4_LAST_ERROR (-137) /**< @internal All netCDF errors > this. */
+
+/* Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/
+#define NC_EURL (NC_EDAPURL) /**< Malformed URL */
+#define NC_ECONSTRAINT (NC_EDAPCONSTRAINT) /**< Malformed Constraint*/
/** @internal This is used in netCDF-4 files for dimensions without
* coordinate vars. */
@@ -482,10 +492,6 @@
* size_t. Doh! */
#define NC_HAVE_NEW_CHUNKING_API 1
-/* Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/
-#define NC_EURL (NC_EDAPURL) /**< Malformed URL */
-#define NC_ECONSTRAINT (NC_EDAPCONSTRAINT) /**< Malformed Constraint*/
-
/*
* The Interface
*/
@@ -849,6 +855,10 @@
nc_inq_var_deflate(int ncid, int varid, int *shufflep,
int *deflatep, int *deflate_levelp);
+/* Set szip compression for a variable. */
+EXTERNL int nc_def_var_szip(int ncid, int varid, int options_mask,
+ int pixels_per_block);
+
/* Find out szip settings of a var. */
EXTERNL int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
@@ -892,7 +902,7 @@
EXTERNL int
nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int* parms);
-/* Learn about the filter on a variable */
+/* Learn about the first filter on a variable */
EXTERNL int
nc_inq_var_filter(int ncid, int varid, unsigned int* idp, size_t* nparams, unsigned int* params);
diff -Nru netcdf-parallel-4.7.3/include/netcdf_meta.h.in netcdf-parallel-4.7.4/include/netcdf_meta.h.in
--- netcdf-parallel-4.7.3/include/netcdf_meta.h.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/netcdf_meta.h.in 2020-08-31 10:33:26.000000000 +0000
@@ -44,6 +44,7 @@
#define NC_HAS_HDF4 @NC_HAS_HDF4@ /*!< HDF4 support. */
#define NC_HAS_HDF5 @NC_HAS_HDF5@ /*!< HDF5 support. */
#define NC_HAS_SZIP @NC_HAS_SZIP@ /*!< szip support (HDF5 only) */
+#define NC_HAS_SZIP_WRITE @NC_HAS_SZIP@ /*!< szip write support (HDF5 only) */
#define NC_HAS_DAP2 @NC_HAS_DAP2@ /*!< DAP2 support. */
#define NC_HAS_DAP4 @NC_HAS_DAP4@ /*!< DAP4 support. */
#define NC_HAS_BYTERANGE @HAS_BYTERANGE@
@@ -56,7 +57,7 @@
#define NC_HAS_CDF5 @NC_HAS_CDF5@ /*!< CDF5 support. */
#define NC_HAS_ERANGE_FILL @NC_HAS_ERANGE_FILL@ /*!< ERANGE_FILL Support */
-#define NC_RELAX_COORD_BOUND @NC_RELAX_COORD_BOUND@ /*!< RELAX_COORD_BOUND */
+#define NC_RELAX_COORD_BOUND 1 /*!< RELAX_COORD_BOUND */
#define NC_DISPATCH_VERSION @NC_DISPATCH_VERSION@ /*!< Dispatch table version */
-
+#define NC_HAS_PAR_FILTERS @NC_HAS_PAR_FILTERS@ /* Parallel I/O with filter support. */
#endif
diff -Nru netcdf-parallel-4.7.3/include/netcdf_par.h netcdf-parallel-4.7.4/include/netcdf_par.h
--- netcdf-parallel-4.7.3/include/netcdf_par.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/include/netcdf_par.h 2020-08-31 10:33:26.000000000 +0000
@@ -22,15 +22,15 @@
#include
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
/** Use with nc_var_par_access() to set parallel access to independent. */
#define NC_INDEPENDENT 0
/** Use with nc_var_par_access() to set parallel access to collective. */
#define NC_COLLECTIVE 1
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
/* Create a file and enable parallel I/O. */
EXTERNL int
nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,
diff -Nru netcdf-parallel-4.7.3/install-sh netcdf-parallel-4.7.4/install-sh
--- netcdf-parallel-4.7.3/install-sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/install-sh 2020-08-31 10:33:26.000000000 +0000
@@ -451,7 +451,18 @@
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
diff -Nru netcdf-parallel-4.7.3/libdap2/dceparselex.h netcdf-parallel-4.7.4/libdap2/dceparselex.h
--- netcdf-parallel-4.7.3/libdap2/dceparselex.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap2/dceparselex.h 2020-08-31 10:33:26.000000000 +0000
@@ -12,7 +12,7 @@
#include "dcetab.h"
-#ifdef WIN32
+#ifdef _WIN32
#endif
diff -Nru netcdf-parallel-4.7.3/libdap2/Makefile.in netcdf-parallel-4.7.4/libdap2/Makefile.in
--- netcdf-parallel-4.7.3/libdap2/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap2/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -289,8 +289,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -330,11 +332,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/libdap2/ncd2dispatch.c netcdf-parallel-4.7.4/libdap2/ncd2dispatch.c
--- netcdf-parallel-4.7.3/libdap2/ncd2dispatch.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap2/ncd2dispatch.c 2020-08-31 10:33:26.000000000 +0000
@@ -91,6 +91,7 @@
static const NC_Dispatch NCD2_dispatch_base = {
NC_FORMATX_DAP2,
+NC_DISPATCH_VERSION,
NCD2_create,
NCD2_open,
@@ -174,6 +175,8 @@
NCD2_set_var_chunk_cache,
NCD2_get_var_chunk_cache,
+NC_NOTNC4_filter_actions,
+
};
const NC_Dispatch* NCD2_dispatch_table = NULL; /* moved here from ddispatch.c */
diff -Nru netcdf-parallel-4.7.3/libdap4/d4chunk.c netcdf-parallel-4.7.4/libdap4/d4chunk.c
--- netcdf-parallel-4.7.3/libdap4/d4chunk.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap4/d4chunk.c 2020-08-31 10:33:26.000000000 +0000
@@ -28,7 +28,7 @@
*/
/* Define a local struct for convenience */
-struct HDR {unsigned int flags; unsigned int count;};
+struct HDR {unsigned int flags; unsigned int count;};
/* Forward */
static void* getheader(void* p, struct HDR* hdr, int hostlittleendian);
@@ -60,15 +60,18 @@
q = metadata->serial.rawdata;
if(memcmp(q,"mode != NCD4_DMR)
- return THROW(NC_EDMR);
- /* setup as dmr only */
- metadata->serial.dmr = (char*)metadata->serial.rawdata; /* temp */
- metadata->serial.dmr[metadata->serial.rawsize-1] = '\0';
- metadata->serial.dmr = strdup((char *)q);
- if(metadata->serial.dmr == NULL)
- return THROW(NC_ENOMEM);
- return THROW(NC_NOERR);
+ if(metadata->mode != NCD4_DMR)
+ return THROW(NC_EDMR);
+ /* setup as dmr only */
+ metadata->serial.dmr = (char*)metadata->serial.rawdata; /* temp */
+ /* Avoid strdup since rawdata might contain nul chars */
+ if((metadata->serial.dmr = malloc(metadata->serial.rawsize+1)) == NULL)
+ return THROW(NC_ENOMEM);
+ memcpy(metadata->serial.dmr,metadata->serial.rawdata,metadata->serial.rawsize);
+ metadata->serial.dmr[metadata->serial.rawsize-1] = '\0';
+ /* Suppress nuls */
+ (void)NCD4_elidenuls(metadata->serial.dmr,metadata->serial.rawsize);
+ return THROW(NC_NOERR);
}
/* We must be processing a DAP mode packet */
@@ -82,7 +85,7 @@
/* Get the DMR chunk header*/
p = getheader(p,&hdr,metadata->serial.hostlittleendian);
if(hdr.count == 0)
- return THROW(NC_EDMR);
+ return THROW(NC_EDMR);
if(hdr.flags & ERR_CHUNK) {
return processerrchunk(metadata, (void*)p, hdr.count);
}
@@ -91,31 +94,40 @@
metadata->localchecksumming = metadata->serial.remotechecksumming;
metadata->serial.remotelittleendian = ((hdr.flags & LITTLE_ENDIAN_CHUNK) ? 1 : 0);
- metadata->serial.dmr = (char*)p;
+ /* Again, avoid strxxx operations on dmr */
+ if((metadata->serial.dmr = malloc(hdr.count+1)) == NULL)
+ return THROW(NC_ENOMEM);
+ memcpy(metadata->serial.dmr,p,hdr.count);
metadata->serial.dmr[hdr.count-1] = '\0';
- metadata->serial.dmr = strdup(metadata->serial.dmr);
- if(metadata->serial.dmr == NULL)
- return THROW(NC_ENOMEM);
- p += hdr.count;
+ /* Suppress nuls */
+ (void)NCD4_elidenuls(metadata->serial.dmr,hdr.count);
if(hdr.flags & LAST_CHUNK)
return THROW(NC_ENODATA);
/* Read and compress the data chunks */
- q = metadata->serial.dap;
+ p = p + hdr.count; /* point to data chunk header */
+ /* Do a sanity check in case the server has shorted us with no data */
+ if((hdr.count + CHUNKHDRSIZE) >= metadata->serial.rawsize) {
+ /* Server only sent the DMR part */
+ metadata->serial.dapsize = 0;
+ return THROW(NC_EDATADDS);
+ }
+ q = metadata->serial.dap;
for(;;) {
- p = getheader(p,&hdr,metadata->serial.hostlittleendian);
- if(hdr.flags & ERR_CHUNK) {
+ p = getheader(p,&hdr,metadata->serial.hostlittleendian);
+ if(hdr.flags & ERR_CHUNK) {
return processerrchunk(metadata, (void*)p, hdr.count);
- }
- /* data chunk; possibly last; possibly empty */
- if(hdr.count > 0) {
- d4memmove(q,p,hdr.count); /* will overwrite the header */
- p += hdr.count;
- q += hdr.count;
- }
- if(hdr.flags & LAST_CHUNK) break;
+ }
+ /* data chunk; possibly last; possibly empty */
+ if(hdr.count > 0) {
+ d4memmove(q,p,hdr.count); /* will overwrite the header */
+ p += hdr.count;
+ q += hdr.count;
+ }
+ if(hdr.flags & LAST_CHUNK) break;
}
metadata->serial.dapsize = (size_t)DELTA(q,metadata->serial.dap);
+
#ifdef D4DUMPDMR
fprintf(stderr,"%s\n",metadata->serial.dmr);
fflush(stderr);
@@ -169,8 +181,8 @@
hyrax.count = *(unsigned int*)bytes; /* get count */
/* See which makes more sense */
if(hyrax.flags <= ALL_CHUNK_FLAGS && hyrax.count >= 0 && hyrax.count < hdr->count) {
- /* Use hyrax version */
- *hdr = hyrax;
+ /* Use hyrax version */
+ *hdr = hyrax;
}
#endif
return p;
@@ -187,17 +199,17 @@
char* raw = meta->serial.rawdata;
if(size < 16)
- return THROW(NC_EDAP); /* must have at least this to hold a hdr + partial dmr*/
+ return THROW(NC_EDAP); /* must have at least this to hold a hdr + partial dmr*/
if(memcmp(raw,"mode = NCD4_DMR;
- goto done;
+ meta->mode = NCD4_DMR;
+ goto done;
}
raw += 4; /* Pretend we have a DAP hdr */
if(memcmp(raw,"mode = NCD4_DAP;
- goto done;
+ meta->mode = NCD4_DAP;
+ goto done;
}
/* Default to DSR */
meta->mode = NCD4_DSR;
diff -Nru netcdf-parallel-4.7.3/libdap4/d4curlfunctions.c netcdf-parallel-4.7.4/libdap4/d4curlfunctions.c
--- netcdf-parallel-4.7.3/libdap4/d4curlfunctions.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap4/d4curlfunctions.c 2020-08-31 10:33:26.000000000 +0000
@@ -90,6 +90,10 @@
if(state->auth.curlflags.timeout)
CHECK(state, CURLOPT_TIMEOUT, (OPTARG)((long)state->auth.curlflags.timeout));
break;
+ case CURLOPT_CONNECTTIMEOUT:
+ if(state->auth.curlflags.connecttimeout)
+ CHECK(state, CURLOPT_CONNECTTIMEOUT, (OPTARG)((long)state->auth.curlflags.connecttimeout));
+ break;
case CURLOPT_USERAGENT:
if(state->auth.curlflags.useragent)
CHECK(state, CURLOPT_USERAGENT, state->auth.curlflags.useragent);
@@ -374,6 +378,9 @@
case CURLOPT_TIMEOUT:
info->curlflags.timeout = (long)value;
break;
+ case CURLOPT_CONNECTTIMEOUT:
+ info->curlflags.connecttimeout = (long)value;
+ break;
case CURLOPT_USERAGENT:
if(info->curlflags.useragent != NULL) free(info->curlflags.useragent);
info->curlflags.useragent = strdup((char*)value);
diff -Nru netcdf-parallel-4.7.3/libdap4/d4parser.c netcdf-parallel-4.7.4/libdap4/d4parser.c
--- netcdf-parallel-4.7.3/libdap4/d4parser.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap4/d4parser.c 2020-08-31 10:33:26.000000000 +0000
@@ -211,6 +211,12 @@
/* See if we have an or */
if(strcmp(dom->name,"Error")==0) {
ret=parseError(parser,dom);
+ /* Report the error */
+ fprintf(stderr,"DAP4 Error: http-code=%d message=\"%s\" context=\"%s\"\n",
+ parser->metadata->error.httpcode,
+ parser->metadata->error.message,
+ parser->metadata->error.context);
+ fflush(stderr);
ret=NC_EDMR;
goto done;
} else if(strcmp(dom->name,"Dataset")==0) {
diff -Nru netcdf-parallel-4.7.3/libdap4/d4util.c netcdf-parallel-4.7.4/libdap4/d4util.c
--- netcdf-parallel-4.7.3/libdap4/d4util.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdap4/d4util.c 2020-08-31 10:33:26.000000000 +0000
@@ -330,6 +330,22 @@
return escaped;
}
+/* Elide all nul characters from an XML document as a precaution*/
+size_t
+NCD4_elidenuls(char* s, size_t slen)
+{
+ size_t i,j;
+ for(j=0,i=0;icurlflags.timeout);
#endif
}
+ if(strcmp(flag,"HTTP.CONNECTTIMEOUT")==0) {
+ if(atoi(value)) auth->curlflags.connecttimeout = atoi(value);
+#ifdef D4DEBUG
+ nclog(NCLOGNOTE,"HTTP.CONNECTTIMEOUT: %ld", auth->curlflags.connecttimeout);
+#endif
+ }
if(strcmp(flag,"HTTP.USERAGENT")==0) {
if(atoi(value)) auth->curlflags.useragent = strdup(value);
MEMCHECK(auth->curlflags.useragent);
diff -Nru netcdf-parallel-4.7.3/libdispatch/derror.c netcdf-parallel-4.7.4/libdispatch/derror.c
--- netcdf-parallel-4.7.3/libdispatch/derror.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/derror.c 2020-08-31 10:33:26.000000000 +0000
@@ -177,9 +177,9 @@
case NC_EDAS:
return "NetCDF: Malformed or inaccessible DAP DAS";
case NC_EDDS:
- return "NetCDF: Malformed or inaccessible DAP DDS";
+ return "NetCDF: Malformed or inaccessible DAP2 DDS or DAP4 DMR response";
case NC_EDATADDS:
- return "NetCDF: Malformed or inaccessible DAP DATADDS";
+ return "NetCDF: Malformed or inaccessible DAP2 DATADDS or DAP4 DAP response";
case NC_EDAPURL:
return "NetCDF: Malformed URL";
case NC_EDAPCONSTRAINT:
@@ -258,7 +258,9 @@
case NC_EDISKLESS:
return "NetCDF: Error in using diskless access";
case NC_EFILTER:
- return "NetCDF: Filter error: bad id or parameters or filter library non-existent";
+ return "NetCDF: Filter error: bad id or parameters";
+ case NC_ENOFILTER:
+ return "NetCDF: Filter error: filter not defined for variable";
case NC_ECANTEXTEND:
return "NetCDF: Attempt to extend dataset during NC_INDEPENDENT I/O operation. Use nc_var_par_access to set mode NC_COLLECTIVE before extending variable.";
case NC_EMPI: return "NetCDF: MPI operation failed.";
diff -Nru netcdf-parallel-4.7.3/libdispatch/dfile.c netcdf-parallel-4.7.4/libdispatch/dfile.c
--- netcdf-parallel-4.7.3/libdispatch/dfile.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dfile.c 2020-08-31 10:33:26.000000000 +0000
@@ -8,7 +8,7 @@
*
* Copyright 2018 University Corporation for Atmospheric
* Research/Unidata. See COPYRIGHT file for more info.
-*/
+ */
#include "config.h"
#include
@@ -53,43 +53,59 @@
/** \defgroup datasets NetCDF File and Data I/O
-NetCDF opens datasets as files or remote access URLs.
+ NetCDF opens datasets as files or remote access URLs.
-A netCDF dataset that has not yet been opened can only be referred to
-by its dataset name. Once a netCDF dataset is opened, it is referred
-to by a netCDF ID, which is a small non-negative integer returned when
-you create or open the dataset. A netCDF ID is much like a file
-descriptor in C or a logical unit number in FORTRAN. In any single
-program, the netCDF IDs of distinct open netCDF datasets are
-distinct. A single netCDF dataset may be opened multiple times and
-will then have multiple distinct netCDF IDs; however at most one of
-the open instances of a single netCDF dataset should permit
-writing. When an open netCDF dataset is closed, the ID is no longer
-associated with a netCDF dataset.
-
-Functions that deal with the netCDF library include:
-- Get version of library.
-- Get error message corresponding to a returned error code.
-
-The operations supported on a netCDF dataset as a single object are:
-- Create, given dataset name and whether to overwrite or not.
-- Open for access, given dataset name and read or write intent.
-- Put into define mode, to add dimensions, variables, or attributes.
-- Take out of define mode, checking consistency of additions.
-- Close, writing to disk if required.
-- Inquire about the number of dimensions, number of variables,
-number of global attributes, and ID of the unlimited dimension, if
-any.
-- Synchronize to disk to make sure it is current.
-- Set and unset nofill mode for optimized sequential writes.
-- After a summary of conventions used in describing the netCDF
-interfaces, the rest of this chapter presents a detailed description
-of the interfaces for these operations.
+ A netCDF dataset that has not yet been opened can only be referred to
+ by its dataset name. Once a netCDF dataset is opened, it is referred
+ to by a netCDF ID, which is a small non-negative integer returned when
+ you create or open the dataset. A netCDF ID is much like a file
+ descriptor in C or a logical unit number in FORTRAN. In any single
+ program, the netCDF IDs of distinct open netCDF datasets are
+ distinct. A single netCDF dataset may be opened multiple times and
+ will then have multiple distinct netCDF IDs; however at most one of
+ the open instances of a single netCDF dataset should permit
+ writing. When an open netCDF dataset is closed, the ID is no longer
+ associated with a netCDF dataset.
+
+ Functions that deal with the netCDF library include:
+ - Get version of library.
+ - Get error message corresponding to a returned error code.
+
+ The operations supported on a netCDF dataset as a single object are:
+ - Create, given dataset name and whether to overwrite or not.
+ - Open for access, given dataset name and read or write intent.
+ - Put into define mode, to add dimensions, variables, or attributes.
+ - Take out of define mode, checking consistency of additions.
+ - Close, writing to disk if required.
+ - Inquire about the number of dimensions, number of variables,
+ number of global attributes, and ID of the unlimited dimension, if
+ any.
+ - Synchronize to disk to make sure it is current.
+ - Set and unset nofill mode for optimized sequential writes.
+ - After a summary of conventions used in describing the netCDF
+ interfaces, the rest of this chapter presents a detailed description
+ of the interfaces for these operations.
*/
/**
* Add handling of user-defined format.
*
+ * User-defined formats allow users to write a library which can read
+ * their own proprietary format as if it were netCDF. This allows
+ * existing netCDF codes to work on non-netCDF data formats.
+ *
+ * User-defined formats work by specifying a netCDF dispatch
+ * table. The dispatch table is a struct of (mostly) C function
+ * pointers. It contains pointers to the key functions of the netCDF
+ * API. Once these functions are provided, and the dispatch table is
+ * specified, the netcdf-c library can read any format.
+ *
+ * @note Unlike the public netCDF API, the dispatch table may not be
+ * backward compatible between netCDF releases. Instead, it contains a
+ * dispatch version number. If this number is not correct (i.e. does
+ * not match the current dispatch table version), then ::NC_EINVAL
+ * will be returned.
+ *
* @param mode_flag NC_UDF0 or NC_UDF1
* @param dispatch_table Pointer to dispatch table to use for this user format.
* @param magic_number Magic number used to identify file. Ignored if
@@ -103,31 +119,35 @@
int
nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number)
{
- /* Check inputs. */
- if (mode_flag != NC_UDF0 && mode_flag != NC_UDF1)
- return NC_EINVAL;
- if (!dispatch_table)
- return NC_EINVAL;
- if (magic_number && strlen(magic_number) > NC_MAX_MAGIC_NUMBER_LEN)
- return NC_EINVAL;
-
- /* Retain a pointer to the dispatch_table and a copy of the magic
- * number, if one was provided. */
- switch(mode_flag)
- {
- case NC_UDF0:
- UDF0_dispatch_table = dispatch_table;
- if (magic_number)
- strncpy(UDF0_magic_number, magic_number, NC_MAX_MAGIC_NUMBER_LEN);
- break;
- case NC_UDF1:
- UDF1_dispatch_table = dispatch_table;
- if (magic_number)
- strncpy(UDF1_magic_number, magic_number, NC_MAX_MAGIC_NUMBER_LEN);
- break;
- }
+ /* Check inputs. */
+ if (mode_flag != NC_UDF0 && mode_flag != NC_UDF1)
+ return NC_EINVAL;
+ if (!dispatch_table)
+ return NC_EINVAL;
+ if (magic_number && strlen(magic_number) > NC_MAX_MAGIC_NUMBER_LEN)
+ return NC_EINVAL;
+
+ /* Check the version of the dispatch table provided. */
+ if (dispatch_table->dispatch_version != NC_DISPATCH_VERSION)
+ return NC_EINVAL;
+
+ /* Retain a pointer to the dispatch_table and a copy of the magic
+ * number, if one was provided. */
+ switch(mode_flag)
+ {
+ case NC_UDF0:
+ UDF0_dispatch_table = dispatch_table;
+ if (magic_number)
+ strncpy(UDF0_magic_number, magic_number, NC_MAX_MAGIC_NUMBER_LEN);
+ break;
+ case NC_UDF1:
+ UDF1_dispatch_table = dispatch_table;
+ if (magic_number)
+ strncpy(UDF1_magic_number, magic_number, NC_MAX_MAGIC_NUMBER_LEN);
+ break;
+ }
- return NC_NOERR;
+ return NC_NOERR;
}
/**
@@ -149,226 +169,226 @@
int
nc_inq_user_format(int mode_flag, NC_Dispatch **dispatch_table, char *magic_number)
{
- /* Check inputs. */
- if (mode_flag != NC_UDF0 && mode_flag != NC_UDF1)
- return NC_EINVAL;
+ /* Check inputs. */
+ if (mode_flag != NC_UDF0 && mode_flag != NC_UDF1)
+ return NC_EINVAL;
- switch(mode_flag)
- {
- case NC_UDF0:
- if (dispatch_table)
- *dispatch_table = UDF0_dispatch_table;
- if (magic_number)
- strncpy(magic_number, UDF0_magic_number, NC_MAX_MAGIC_NUMBER_LEN);
- break;
- case NC_UDF1:
- if (dispatch_table)
- *dispatch_table = UDF1_dispatch_table;
- if (magic_number)
- strncpy(magic_number, UDF1_magic_number, NC_MAX_MAGIC_NUMBER_LEN);
- break;
- }
+ switch(mode_flag)
+ {
+ case NC_UDF0:
+ if (dispatch_table)
+ *dispatch_table = UDF0_dispatch_table;
+ if (magic_number)
+ strncpy(magic_number, UDF0_magic_number, NC_MAX_MAGIC_NUMBER_LEN);
+ break;
+ case NC_UDF1:
+ if (dispatch_table)
+ *dispatch_table = UDF1_dispatch_table;
+ if (magic_number)
+ strncpy(magic_number, UDF1_magic_number, NC_MAX_MAGIC_NUMBER_LEN);
+ break;
+ }
- return NC_NOERR;
+ return NC_NOERR;
}
/** \ingroup datasets
-Create a new netCDF file.
+ Create a new netCDF file.
-This function creates a new netCDF dataset, returning a netCDF ID that
-can subsequently be used to refer to the netCDF dataset in other
-netCDF function calls. The new netCDF dataset opened for write access
-and placed in define mode, ready for you to add dimensions, variables,
-and attributes.
-
-\param path The file name of the new netCDF dataset.
-
-\param cmode The creation mode flag. The following flags are available:
- NC_CLOBBER (overwrite existing file),
- NC_NOCLOBBER (do not overwrite existing file),
- NC_SHARE (limit write caching - netcdf classic files only),
- NC_64BIT_OFFSET (create 64-bit offset file),
- NC_64BIT_DATA (alias NC_CDF5) (create CDF-5 file),
- NC_NETCDF4 (create netCDF-4/HDF5 file),
- NC_CLASSIC_MODEL (enforce netCDF classic mode on netCDF-4/HDF5 files),
- NC_DISKLESS (store data in memory), and
- NC_PERSIST (force the NC_DISKLESS data from memory to a file),
- NC_MMAP (use MMAP for NC_DISKLESS instead of NC_INMEMORY -- deprecated).
- See discussion below.
-
-\param ncidp Pointer to location where returned netCDF ID is to be
-stored.
-
-
The cmode Flag
-
-The cmode flag is used to control the type of file created, and some
-aspects of how it may be used.
-
-Setting NC_NOCLOBBER means you do not want to clobber (overwrite) an
-existing dataset; an error (NC_EEXIST) is returned if the specified
-dataset already exists.
-
-The NC_SHARE flag is appropriate when one process may be writing the
-dataset and one or more other processes reading the dataset
-concurrently; it means that dataset accesses are not buffered and
-caching is limited. Since the buffering scheme is optimized for
-sequential access, programs that do not access data sequentially may
-see some performance improvement by setting the NC_SHARE flag. This
-flag is ignored for netCDF-4 files.
-
-Setting NC_64BIT_OFFSET causes netCDF to create a 64-bit offset format
-file, instead of a netCDF classic format file. The 64-bit offset
-format imposes far fewer restrictions on very large (i.e. over 2 GB)
-data files. See Large File Support.
-
-Setting NC_64BIT_DATA (alias NC_CDF5) causes netCDF to create a CDF-5
-file format that supports large files (i.e. over 2GB) and large
-variables (over 2B array elements.). See Large File Support.
-
-A zero value (defined for convenience as NC_CLOBBER) specifies the
-default behavior: overwrite any existing dataset with the same file
-name and buffer and cache accesses for efficiency. The dataset will be
-in netCDF classic format. See NetCDF Classic Format Limitations.
-
-Setting NC_NETCDF4 causes netCDF to create a HDF5/NetCDF-4 file.
-
-Setting NC_CLASSIC_MODEL causes netCDF to enforce the classic data
-model in this file. (This only has effect for netCDF-4/HDF5 files, as
-CDF-1, 2 and 5 files always use the classic model.) When
-used with NC_NETCDF4, this flag ensures that the resulting
-netCDF-4/HDF5 file may never contain any new constructs from the
-enhanced data model. That is, it cannot contain groups, user defined
-types, multiple unlimited dimensions, or new atomic types. The
-advantage of this restriction is that such files are guaranteed to
-work with existing netCDF software.
-
-Setting NC_DISKLESS causes netCDF to create the file only in
-memory and to optionally write the final contents to the
-correspondingly named disk file. This allows for the use of
-files that have no long term purpose. Operating on an existing file
-in memory may also be faster. The decision on whether
-or not to "persist" the memory contents to a disk file is
-described in detail in the file docs/inmemory.md, which is
-definitive. By default, closing a diskless fill will cause it's
-contents to be lost.
-
-If NC_DISKLESS is going to be used for creating a large classic
-file, it behooves one to use nc__create and specify an
-appropriately large value of the initialsz parameter to avoid to
-many extensions to the in-memory space for the file. This flag
-applies to files in classic format and to file in extended
-format (netcdf-4).
-
-Note that nc_create(path,cmode,ncidp) is equivalent to the invocation of
-nc__create(path,cmode,NC_SIZEHINT_DEFAULT,NULL,ncidp).
-
-\returns ::NC_NOERR No error.
-\returns ::NC_EEXIST Specifying a file name of a file that exists and also specifying NC_NOCLOBBER.
-\returns ::NC_EPERM Attempting to create a netCDF file in a directory where you do not have permission to create files.
-\returns ::NC_ENOMEM System out of memory.
-\returns ::NC_ENFILE Too many files open.
-\returns ::NC_EHDFERR HDF5 error (netCDF-4 files only).
-\returns ::NC_EFILEMETA Error writing netCDF-4 file-level metadata in
-HDF5 file. (netCDF-4 files only).
-\returns ::NC_EDISKLESS if there was an error in creating the
-in-memory file.
-
-\note When creating a netCDF-4 file HDF5 error reporting is turned
-off, if it is on. This doesn't stop the HDF5 error stack from
-recording the errors, it simply stops their display to the user
-through stderr.
-
-
Examples
-
-In this example we create a netCDF dataset named foo.nc; we want the
-dataset to be created in the current directory only if a dataset with
-that name does not already exist:
+ This function creates a new netCDF dataset, returning a netCDF ID that
+ can subsequently be used to refer to the netCDF dataset in other
+ netCDF function calls. The new netCDF dataset opened for write access
+ and placed in define mode, ready for you to add dimensions, variables,
+ and attributes.
+
+ \param path The file name of the new netCDF dataset.
+
+ \param cmode The creation mode flag. The following flags are available:
+ NC_CLOBBER (overwrite existing file),
+ NC_NOCLOBBER (do not overwrite existing file),
+ NC_SHARE (limit write caching - netcdf classic files only),
+ NC_64BIT_OFFSET (create 64-bit offset file),
+ NC_64BIT_DATA (alias NC_CDF5) (create CDF-5 file),
+ NC_NETCDF4 (create netCDF-4/HDF5 file),
+ NC_CLASSIC_MODEL (enforce netCDF classic mode on netCDF-4/HDF5 files),
+ NC_DISKLESS (store data in memory), and
+ NC_PERSIST (force the NC_DISKLESS data from memory to a file),
+ NC_MMAP (use MMAP for NC_DISKLESS instead of NC_INMEMORY -- deprecated).
+ See discussion below.
+
+ \param ncidp Pointer to location where returned netCDF ID is to be
+ stored.
+
+
The cmode Flag
+
+ The cmode flag is used to control the type of file created, and some
+ aspects of how it may be used.
+
+ Setting NC_NOCLOBBER means you do not want to clobber (overwrite) an
+ existing dataset; an error (NC_EEXIST) is returned if the specified
+ dataset already exists.
+
+ The NC_SHARE flag is appropriate when one process may be writing the
+ dataset and one or more other processes reading the dataset
+ concurrently; it means that dataset accesses are not buffered and
+ caching is limited. Since the buffering scheme is optimized for
+ sequential access, programs that do not access data sequentially may
+ see some performance improvement by setting the NC_SHARE flag. This
+ flag is ignored for netCDF-4 files.
+
+ Setting NC_64BIT_OFFSET causes netCDF to create a 64-bit offset format
+ file, instead of a netCDF classic format file. The 64-bit offset
+ format imposes far fewer restrictions on very large (i.e. over 2 GB)
+ data files. See Large File Support.
+
+ Setting NC_64BIT_DATA (alias NC_CDF5) causes netCDF to create a CDF-5
+ file format that supports large files (i.e. over 2GB) and large
+ variables (over 2B array elements.). See Large File Support.
+
+ A zero value (defined for convenience as NC_CLOBBER) specifies the
+ default behavior: overwrite any existing dataset with the same file
+ name and buffer and cache accesses for efficiency. The dataset will be
+ in netCDF classic format. See NetCDF Classic Format Limitations.
+
+ Setting NC_NETCDF4 causes netCDF to create a HDF5/NetCDF-4 file.
+
+ Setting NC_CLASSIC_MODEL causes netCDF to enforce the classic data
+ model in this file. (This only has effect for netCDF-4/HDF5 files, as
+ CDF-1, 2 and 5 files always use the classic model.) When
+ used with NC_NETCDF4, this flag ensures that the resulting
+ netCDF-4/HDF5 file may never contain any new constructs from the
+ enhanced data model. That is, it cannot contain groups, user defined
+ types, multiple unlimited dimensions, or new atomic types. The
+ advantage of this restriction is that such files are guaranteed to
+ work with existing netCDF software.
+
+ Setting NC_DISKLESS causes netCDF to create the file only in
+ memory and to optionally write the final contents to the
+ correspondingly named disk file. This allows for the use of
+ files that have no long term purpose. Operating on an existing file
+ in memory may also be faster. The decision on whether
+ or not to "persist" the memory contents to a disk file is
+ described in detail in the file docs/inmemory.md, which is
+ definitive. By default, closing a diskless fill will cause it's
+ contents to be lost.
+
+ If NC_DISKLESS is going to be used for creating a large classic
+ file, it behooves one to use nc__create and specify an
+ appropriately large value of the initialsz parameter to avoid to
+ many extensions to the in-memory space for the file. This flag
+ applies to files in classic format and to file in extended
+ format (netcdf-4).
+
+ Note that nc_create(path,cmode,ncidp) is equivalent to the invocation of
+ nc__create(path,cmode,NC_SIZEHINT_DEFAULT,NULL,ncidp).
+
+ \returns ::NC_NOERR No error.
+ \returns ::NC_EEXIST Specifying a file name of a file that exists and also specifying NC_NOCLOBBER.
+ \returns ::NC_EPERM Attempting to create a netCDF file in a directory where you do not have permission to create files.
+ \returns ::NC_ENOMEM System out of memory.
+ \returns ::NC_ENFILE Too many files open.
+ \returns ::NC_EHDFERR HDF5 error (netCDF-4 files only).
+ \returns ::NC_EFILEMETA Error writing netCDF-4 file-level metadata in
+ HDF5 file. (netCDF-4 files only).
+ \returns ::NC_EDISKLESS if there was an error in creating the
+ in-memory file.
+
+ \note When creating a netCDF-4 file HDF5 error reporting is turned
+ off, if it is on. This doesn't stop the HDF5 error stack from
+ recording the errors, it simply stops their display to the user
+ through stderr.
+
+
Examples
+
+ In this example we create a netCDF dataset named foo.nc; we want the
+ dataset to be created in the current directory only if a dataset with
+ that name does not already exist:
-@code
+ @code
#include
- ...
+ ...
int status = NC_NOERR;
int ncid;
- ...
+ ...
status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
if (status != NC_NOERR) handle_error(status);
-@endcode
+ @endcode
-In this example we create a netCDF dataset named foo_large.nc. It will
-be in the 64-bit offset format.
+ In this example we create a netCDF dataset named foo_large.nc. It will
+ be in the 64-bit offset format.
-@code
+ @code
#include
- ...
+ ...
int status = NC_NOERR;
int ncid;
- ...
+ ...
status = nc_create("foo_large.nc", NC_NOCLOBBER|NC_64BIT_OFFSET, &ncid);
if (status != NC_NOERR) handle_error(status);
-@endcode
+ @endcode
-In this example we create a netCDF dataset named foo_HDF5.nc. It will
-be in the HDF5 format.
+ In this example we create a netCDF dataset named foo_HDF5.nc. It will
+ be in the HDF5 format.
-@code
+ @code
#include
- ...
+ ...
int status = NC_NOERR;
int ncid;
- ...
+ ...
status = nc_create("foo_HDF5.nc", NC_NOCLOBBER|NC_NETCDF4, &ncid);
if (status != NC_NOERR) handle_error(status);
-@endcode
+ @endcode
-In this example we create a netCDF dataset named
-foo_HDF5_classic.nc. It will be in the HDF5 format, but will not allow
-the use of any netCDF-4 advanced features. That is, it will conform to
-the classic netCDF-3 data model.
+ In this example we create a netCDF dataset named
+ foo_HDF5_classic.nc. It will be in the HDF5 format, but will not allow
+ the use of any netCDF-4 advanced features. That is, it will conform to
+ the classic netCDF-3 data model.
-@code
+ @code
#include
- ...
+ ...
int status = NC_NOERR;
int ncid;
- ...
+ ...
status = nc_create("foo_HDF5_classic.nc", NC_NOCLOBBER|NC_NETCDF4|NC_CLASSIC_MODEL, &ncid);
if (status != NC_NOERR) handle_error(status);
-@endcode
+ @endcode
-In this example we create an in-memory netCDF classic dataset named
-diskless.nc whose content will be lost when nc_close() is called.
+ In this example we create an in-memory netCDF classic dataset named
+ diskless.nc whose content will be lost when nc_close() is called.
-@code
+ @code
#include
- ...
+ ...
int status = NC_NOERR;
int ncid;
- ...
+ ...
status = nc_create("diskless.nc", NC_DISKLESS, &ncid);
if (status != NC_NOERR) handle_error(status);
-@endcode
+ @endcode
-In this example we create a in-memory netCDF classic dataset named
-diskless.nc and specify that it should be made persistent
-in a file named diskless.nc when nc_close() is called.
+ In this example we create a in-memory netCDF classic dataset named
+ diskless.nc and specify that it should be made persistent
+ in a file named diskless.nc when nc_close() is called.
-@code
+ @code
#include
- ...
+ ...
int status = NC_NOERR;
int ncid;
- ...
+ ...
status = nc_create("diskless.nc", NC_DISKLESS|NC_PERSIST, &ncid);
if (status != NC_NOERR) handle_error(status);
-@endcode
+ @endcode
-A variant of nc_create(), nc__create() (note the double underscore) allows
-users to specify two tuning parameters for the file that it is
-creating. */
+ A variant of nc_create(), nc__create() (note the double underscore) allows
+ users to specify two tuning parameters for the file that it is
+ creating. */
int
nc_create(const char *path, int cmode, int *ncidp)
{
- return nc__create(path,cmode,NC_SIZEHINT_DEFAULT,NULL,ncidp);
+ return nc__create(path,cmode,NC_SIZEHINT_DEFAULT,NULL,ncidp);
}
/**
@@ -422,65 +442,65 @@
* bufrsize and initial size for the file.
*
* @code
-#include
- ...
- int status = NC_NOERR;
- int ncid;
- int intialsz = 2048;
- int *bufrsize;
- ...
- *bufrsize = 1024;
- status = nc__create("foo.nc", NC_NOCLOBBER, initialsz, bufrsize, &ncid);
- if (status != NC_NOERR) handle_error(status);
-@endcode
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ int intialsz = 2048;
+ int *bufrsize;
+ ...
+ *bufrsize = 1024;
+ status = nc__create("foo.nc", NC_NOCLOBBER, initialsz, bufrsize, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ @endcode
*
* @ingroup datasets
* @author Glenn Davis
-*/
+ */
int
nc__create(const char *path, int cmode, size_t initialsz,
- size_t *chunksizehintp, int *ncidp)
+ size_t *chunksizehintp, int *ncidp)
{
- return NC_create(path, cmode, initialsz, 0,
- chunksizehintp, 0, NULL, ncidp);
+ return NC_create(path, cmode, initialsz, 0,
+ chunksizehintp, 0, NULL, ncidp);
}
/** \ingroup datasets
-Create a netCDF file with the contents stored in memory.
+ Create a netCDF file with the contents stored in memory.
-\param path Must be non-null, but otherwise only used to set the dataset name.
+ \param path Must be non-null, but otherwise only used to set the dataset name.
-\param mode the mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_INMEMORY.
+ \param mode the mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_INMEMORY.
-\param initialsize (advisory) size to allocate for the created file
+ \param initialsize (advisory) size to allocate for the created file
-\param ncidp Pointer to location where returned netCDF ID is to be
-stored.
+ \param ncidp Pointer to location where returned netCDF ID is to be
+ stored.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_ENOMEM Out of memory.
+ \returns ::NC_ENOMEM Out of memory.
-\returns ::NC_EDISKLESS diskless io is not enabled for fails.
+ \returns ::NC_EDISKLESS diskless io is not enabled for fails.
-\returns ::NC_EINVAL, etc. other errors also returned by nc_open.
+ \returns ::NC_EINVAL, etc. other errors also returned by nc_open.
-
Examples
+
Examples
-In this example we use nc_create_mem() to create a classic netCDF dataset
-named foo.nc. The initial size is set to 4096.
+ In this example we use nc_create_mem() to create a classic netCDF dataset
+ named foo.nc. The initial size is set to 4096.
-@code
- #include
- ...
- int status = NC_NOERR;
- int ncid;
- int mode = 0;
- size_t initialsize = 4096;
- ...
- status = nc_create_mem("foo.nc", mode, initialsize, &ncid);
- if (status != NC_NOERR) handle_error(status);
-@endcode
+ @code
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ int mode = 0;
+ size_t initialsize = 4096;
+ ...
+ status = nc_create_mem("foo.nc", mode, initialsize, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ @endcode
*/
int
@@ -512,10 +532,10 @@
*/
int
nc__create_mp(const char *path, int cmode, size_t initialsz,
- int basepe, size_t *chunksizehintp, int *ncidp)
+ int basepe, size_t *chunksizehintp, int *ncidp)
{
- return NC_create(path, cmode, initialsz, basepe,
- chunksizehintp, 0, NULL, ncidp);
+ return NC_create(path, cmode, initialsz, basepe,
+ chunksizehintp, 0, NULL, ncidp);
}
/**
@@ -630,118 +650,118 @@
* @endcode
* @ingroup datasets
* @author Glenn Davis, Ed Hartnett, Dennis Heimbigner
-*/
+ */
int
nc_open(const char *path, int omode, int *ncidp)
{
- return NC_open(path, omode, 0, NULL, 0, NULL, ncidp);
+ return NC_open(path, omode, 0, NULL, 0, NULL, ncidp);
}
/** \ingroup datasets
-Open a netCDF file with extra performance parameters for the classic
-library.
+ Open a netCDF file with extra performance parameters for the classic
+ library.
-\param path File name for netCDF dataset to be opened. When DAP
-support is enabled, then the path may be an OPeNDAP URL rather than a
-file path.
+ \param path File name for netCDF dataset to be opened. When DAP
+ support is enabled, then the path may be an OPeNDAP URL rather than a
+ file path.
-\param omode The open mode flag may include NC_WRITE (for read/write
-access) and NC_SHARE as in nc_open().
+ \param omode The open mode flag may include NC_WRITE (for read/write
+ access) and NC_SHARE as in nc_open().
-\param chunksizehintp A size hint for the classic library. Only
-applies to classic files. See below for more
-information.
+ \param chunksizehintp A size hint for the classic library. Only
+ applies to classic files. See below for more
+ information.
-\param ncidp Pointer to location where returned netCDF ID is to be
-stored.
+ \param ncidp Pointer to location where returned netCDF ID is to be
+ stored.
-
The chunksizehintp Parameter
+
The chunksizehintp Parameter
-The argument referenced by bufrsizehintp controls a space versus time
-tradeoff, memory allocated in the netcdf library versus number of
-system calls.
+ The argument referenced by bufrsizehintp controls a space versus time
+ tradeoff, memory allocated in the netcdf library versus number of
+ system calls.
-Because of internal requirements, the value may not be set to exactly
-the value requested. The actual value chosen is returned by reference.
+ Because of internal requirements, the value may not be set to exactly
+ the value requested. The actual value chosen is returned by reference.
-Using a NULL pointer or having the pointer point to the value
-NC_SIZEHINT_DEFAULT causes the library to choose a default.
-How the system chooses the default depends on the system. On
-many systems, the "preferred I/O block size" is available from the
-stat() system call, struct stat member st_blksize. If this is
-available it is used. Lacking that, twice the system pagesize is used.
+ Using a NULL pointer or having the pointer point to the value
+ NC_SIZEHINT_DEFAULT causes the library to choose a default.
+ How the system chooses the default depends on the system. On
+ many systems, the "preferred I/O block size" is available from the
+ stat() system call, struct stat member st_blksize. If this is
+ available it is used. Lacking that, twice the system pagesize is used.
-Lacking a call to discover the system pagesize, we just set default
-bufrsize to 8192.
+ Lacking a call to discover the system pagesize, we just set default
+ bufrsize to 8192.
-The bufrsize is a property of a given open netcdf descriptor ncid, it
-is not a persistent property of the netcdf dataset.
+ The bufrsize is a property of a given open netcdf descriptor ncid, it
+ is not a persistent property of the netcdf dataset.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_ENOMEM Out of memory.
+ \returns ::NC_ENOMEM Out of memory.
-\returns ::NC_EHDFERR HDF5 error. (NetCDF-4 files only.)
+ \returns ::NC_EHDFERR HDF5 error. (NetCDF-4 files only.)
-\returns ::NC_EDIMMETA Error in netCDF-4 dimension metadata. (NetCDF-4
-files only.)
+ \returns ::NC_EDIMMETA Error in netCDF-4 dimension metadata. (NetCDF-4
+ files only.)
*/
int
nc__open(const char *path, int omode,
- size_t *chunksizehintp, int *ncidp)
+ size_t *chunksizehintp, int *ncidp)
{
- /* this API is for non-parallel access.
- * Note nc_open_par() also calls NC_open().
- */
- return NC_open(path, omode, 0, chunksizehintp, 0, NULL, ncidp);
+ /* this API is for non-parallel access.
+ * Note nc_open_par() also calls NC_open().
+ */
+ return NC_open(path, omode, 0, chunksizehintp, 0, NULL, ncidp);
}
/** \ingroup datasets
-Open a netCDF file with the contents taken from a block of memory.
+ Open a netCDF file with the contents taken from a block of memory.
-\param path Must be non-null, but otherwise only used to set the dataset name.
+ \param path Must be non-null, but otherwise only used to set the dataset name.
-\param omode the open mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_INMEMORY.
+ \param omode the open mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_INMEMORY.
-\param size The length of the block of memory being passed.
+ \param size The length of the block of memory being passed.
-\param memory Pointer to the block of memory containing the contents
-of a netcdf file.
+ \param memory Pointer to the block of memory containing the contents
+ of a netcdf file.
-\param ncidp Pointer to location where returned netCDF ID is to be
-stored.
+ \param ncidp Pointer to location where returned netCDF ID is to be
+ stored.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_ENOMEM Out of memory.
+ \returns ::NC_ENOMEM Out of memory.
-\returns ::NC_EDISKLESS diskless io is not enabled for fails.
+ \returns ::NC_EDISKLESS diskless io is not enabled for fails.
-\returns ::NC_EINVAL, etc. other errors also returned by nc_open.
+ \returns ::NC_EINVAL, etc. other errors also returned by nc_open.
-
Examples
+
Examples
-Here is an example using nc_open_mem() to open an existing netCDF dataset
-named foo.nc for read-only, non-shared access. It differs from the nc_open()
-example in that it assumes the contents of foo.nc have been read into memory.
+ Here is an example using nc_open_mem() to open an existing netCDF dataset
+ named foo.nc for read-only, non-shared access. It differs from the nc_open()
+ example in that it assumes the contents of foo.nc have been read into memory.
-@code
-#include
-#include
- ...
-int status = NC_NOERR;
-int ncid;
-size_t size;
-void* memory;
- ...
-size = ;
-memory = malloc(size);
- ...
-status = nc_open_mem("foo.nc", 0, size, memory, &ncid);
-if (status != NC_NOERR) handle_error(status);
-@endcode
+ @code
+ #include
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ size_t size;
+ void* memory;
+ ...
+ size = ;
+ memory = malloc(size);
+ ...
+ status = nc_open_mem("foo.nc", 0, size, memory, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ @endcode
*/
int
nc_open_mem(const char* path, int omode, size_t size, void* memory, int* ncidp)
@@ -750,9 +770,9 @@
/* Sanity checks */
if(memory == NULL || size < MAGIC_NUMBER_LEN || path == NULL)
- return NC_EINVAL;
+ return NC_EINVAL;
if(omode & (NC_WRITE|NC_MMAP))
- return NC_EINVAL;
+ return NC_EINVAL;
omode |= (NC_INMEMORY); /* Note: NC_INMEMORY and NC_DISKLESS are mutually exclusive*/
meminfo.size = size;
meminfo.memory = memory;
@@ -761,64 +781,64 @@
}
/** \ingroup datasets
-Open a netCDF file with the contents taken from a block of memory.
-Similar to nc_open_mem, but with parameters. Warning: if you do
-specify that the provided memory is locked, then never
-pass in non-heap allocated memory. Additionally, if not locked,
-then do not assume that the memory returned by nc_close_mem
-is the same as passed to nc_open_memio. You must check
-before attempting to free the original memory.
-
-\param path Must be non-null, but otherwise only used to set the dataset name.
-
-\param omode the open mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_INMEMORY.
-
-\param params controlling parameters
-
-\param ncidp Pointer to location where returned netCDF ID is to be
-stored.
-
-\returns ::NC_NOERR No error.
-
-\returns ::NC_ENOMEM Out of memory.
-
-\returns ::NC_EDISKLESS diskless io is not enabled for fails.
-
-\returns ::NC_EINVAL, etc. other errors also returned by nc_open.
-
-
Examples
-
-Here is an example using nc_open_memio() to open an existing netCDF dataset
-named foo.nc for read-only, non-shared access. It differs from the nc_open_mem()
-example in that it uses a parameter block.
-
-@code
-#include
-#include
- ...
-int status = NC_NOERR;
-int ncid;
-NC_memio params;
- ...
-params.size = ;
-params.memory = malloc(size);
-params.flags =
- ...
-status = nc_open_memio("foo.nc", 0, ¶ms, &ncid);
-if (status != NC_NOERR) handle_error(status);
-@endcode
+ Open a netCDF file with the contents taken from a block of memory.
+ Similar to nc_open_mem, but with parameters. Warning: if you do
+ specify that the provided memory is locked, then never
+ pass in non-heap allocated memory. Additionally, if not locked,
+ then do not assume that the memory returned by nc_close_mem
+ is the same as passed to nc_open_memio. You must check
+ before attempting to free the original memory.
+
+ \param path Must be non-null, but otherwise only used to set the dataset name.
+
+ \param omode the open mode flags; Note that this procedure uses a limited set of flags because it forcibly sets NC_INMEMORY.
+
+ \param params controlling parameters
+
+ \param ncidp Pointer to location where returned netCDF ID is to be
+ stored.
+
+ \returns ::NC_NOERR No error.
+
+ \returns ::NC_ENOMEM Out of memory.
+
+ \returns ::NC_EDISKLESS diskless io is not enabled for fails.
+
+ \returns ::NC_EINVAL, etc. other errors also returned by nc_open.
+
+
Examples
+
+ Here is an example using nc_open_memio() to open an existing netCDF dataset
+ named foo.nc for read-only, non-shared access. It differs from the nc_open_mem()
+ example in that it uses a parameter block.
+
+ @code
+ #include
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ NC_memio params;
+ ...
+ params.size = ;
+ params.memory = malloc(size);
+ params.flags =
+ ...
+ status = nc_open_memio("foo.nc", 0, ¶ms, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ @endcode
*/
int
nc_open_memio(const char* path, int omode, NC_memio* params, int* ncidp)
{
/* Sanity checks */
if(path == NULL || params == NULL)
- return NC_EINVAL;
+ return NC_EINVAL;
if(params->memory == NULL || params->size < MAGIC_NUMBER_LEN)
- return NC_EINVAL;
+ return NC_EINVAL;
if(omode & NC_MMAP)
- return NC_EINVAL;
+ return NC_EINVAL;
omode |= (NC_INMEMORY);
return NC_open(path, omode, 0, NULL, 0, params, ncidp);
}
@@ -843,611 +863,611 @@
*/
int
nc__open_mp(const char *path, int omode, int basepe,
- size_t *chunksizehintp, int *ncidp)
+ size_t *chunksizehintp, int *ncidp)
{
- return NC_open(path, omode, basepe, chunksizehintp, 0, NULL, ncidp);
+ return NC_open(path, omode, basepe, chunksizehintp, 0, NULL, ncidp);
}
/** \ingroup datasets
-Get the file pathname (or the opendap URL) which was used to
-open/create the ncid's file.
+ Get the file pathname (or the opendap URL) which was used to
+ open/create the ncid's file.
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
-\param pathlen Pointer where length of path will be returned. Ignored
-if NULL.
+ \param pathlen Pointer where length of path will be returned. Ignored
+ if NULL.
-\param path Pointer where path name will be copied. Space must already
-be allocated. Ignored if NULL.
+ \param path Pointer where path name will be copied. Space must already
+ be allocated. Ignored if NULL.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid ncid passed.
+ \returns ::NC_EBADID Invalid ncid passed.
*/
int
nc_inq_path(int ncid, size_t *pathlen, char *path)
{
- NC* ncp;
- int stat = NC_NOERR;
- if ((stat = NC_check_id(ncid, &ncp)))
- return stat;
- if(ncp->path == NULL) {
- if(pathlen) *pathlen = 0;
- if(path) path[0] = '\0';
- } else {
- if (pathlen) *pathlen = strlen(ncp->path);
- if (path) strcpy(path, ncp->path);
- }
- return stat;
+ NC* ncp;
+ int stat = NC_NOERR;
+ if ((stat = NC_check_id(ncid, &ncp)))
+ return stat;
+ if(ncp->path == NULL) {
+ if(pathlen) *pathlen = 0;
+ if(path) path[0] = '\0';
+ } else {
+ if (pathlen) *pathlen = strlen(ncp->path);
+ if (path) strcpy(path, ncp->path);
+ }
+ return stat;
}
/** \ingroup datasets
-Put open netcdf dataset into define mode
+ Put open netcdf dataset into define mode
-The function nc_redef puts an open netCDF dataset into define mode, so
-dimensions, variables, and attributes can be added or renamed and
-attributes can be deleted.
+ The function nc_redef puts an open netCDF dataset into define mode, so
+ dimensions, variables, and attributes can be added or renamed and
+ attributes can be deleted.
-For netCDF-4 files (i.e. files created with NC_NETCDF4 in the cmode in
-their call to nc_create()), it is not necessary to call nc_redef()
-unless the file was also created with NC_STRICT_NC3. For straight-up
-netCDF-4 files, nc_redef() is called automatically, as needed.
+ For netCDF-4 files (i.e. files created with NC_NETCDF4 in the cmode in
+ their call to nc_create()), it is not necessary to call nc_redef()
+ unless the file was also created with NC_STRICT_NC3. For straight-up
+ netCDF-4 files, nc_redef() is called automatically, as needed.
-For all netCDF-4 files, the root ncid must be used. This is the ncid
-returned by nc_open() and nc_create(), and points to the root of the
-hierarchy tree for netCDF-4 files.
+ For all netCDF-4 files, the root ncid must be used. This is the ncid
+ returned by nc_open() and nc_create(), and points to the root of the
+ hierarchy tree for netCDF-4 files.
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Bad ncid.
+ \returns ::NC_EBADID Bad ncid.
-\returns ::NC_EBADGRPID The ncid must refer to the root group of the
-file, that is, the group returned by nc_open() or nc_create().
+ \returns ::NC_EBADGRPID The ncid must refer to the root group of the
+ file, that is, the group returned by nc_open() or nc_create().
-\returns ::NC_EINDEFINE Already in define mode.
+ \returns ::NC_EINDEFINE Already in define mode.
-\returns ::NC_EPERM File is read-only.
+ \returns ::NC_EPERM File is read-only.
-
Example
+
Example
-Here is an example using nc_redef to open an existing netCDF dataset
-named foo.nc and put it into define mode:
+ Here is an example using nc_redef to open an existing netCDF dataset
+ named foo.nc and put it into define mode:
-\code
-#include
- ...
-int status = NC_NOERR;
-int ncid;
- ...
-status = nc_open("foo.nc", NC_WRITE, &ncid);
-if (status != NC_NOERR) handle_error(status);
- ...
-status = nc_redef(ncid);
-if (status != NC_NOERR) handle_error(status);
-\endcode
- */
+ \code
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ ...
+ status = nc_open("foo.nc", NC_WRITE, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ ...
+ status = nc_redef(ncid);
+ if (status != NC_NOERR) handle_error(status);
+ \endcode
+*/
int
nc_redef(int ncid)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->redef(ncid);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->redef(ncid);
}
/** \ingroup datasets
-Leave define mode
-
-The function nc_enddef() takes an open netCDF dataset out of define
-mode. The changes made to the netCDF dataset while it was in define
-mode are checked and committed to disk if no problems
-occurred. Non-record variables may be initialized to a "fill value" as
-well with nc_set_fill(). The netCDF dataset is then placed in data
-mode, so variable data can be read or written.
-
-It's not necessary to call nc_enddef() for netCDF-4 files. With netCDF-4
-files, nc_enddef() is called when needed by the netcdf-4 library. User
-calls to nc_enddef() for netCDF-4 files still flush the metadata to
-disk.
-
-This call may involve copying data under some circumstances. For a
-more extensive discussion see File Structure and Performance.
+ Leave define mode
-For netCDF-4/HDF5 format files there are some variable settings (the
-compression, endianness, fletcher32 error correction, and fill value)
-which must be set (if they are going to be set at all) between the
-nc_def_var() and the next nc_enddef(). Once the nc_enddef() is called,
-these settings can no longer be changed for a variable.
-
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
-
-If you use a group id (in a netCDF-4/HDF5 file), the enddef
-will apply to the entire file. That means the enddef will not just end
-define mode in one group, but in the entire file.
-
-\returns ::NC_NOERR no error
-
-\returns ::NC_EBADID Invalid ncid passed.
-
-
Example
-
-Here is an example using nc_enddef() to finish the definitions of a new
-netCDF dataset named foo.nc and put it into data mode:
-
-\code
- #include
- ...
- int status = NC_NOERR;
- int ncid;
- ...
- status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
- if (status != NC_NOERR) handle_error(status);
-
- ... create dimensions, variables, attributes
-
- status = nc_enddef(ncid);
- if (status != NC_NOERR) handle_error(status);
-\endcode
- */
+ The function nc_enddef() takes an open netCDF dataset out of define
+ mode. The changes made to the netCDF dataset while it was in define
+ mode are checked and committed to disk if no problems
+ occurred. Non-record variables may be initialized to a "fill value" as
+ well with nc_set_fill(). The netCDF dataset is then placed in data
+ mode, so variable data can be read or written.
+
+ It's not necessary to call nc_enddef() for netCDF-4 files. With netCDF-4
+ files, nc_enddef() is called when needed by the netcdf-4 library. User
+ calls to nc_enddef() for netCDF-4 files still flush the metadata to
+ disk.
+
+ This call may involve copying data under some circumstances. For a
+ more extensive discussion see File Structure and Performance.
+
+ For netCDF-4/HDF5 format files there are some variable settings (the
+ compression, endianness, fletcher32 error correction, and fill value)
+ which must be set (if they are going to be set at all) between the
+ nc_def_var() and the next nc_enddef(). Once the nc_enddef() is called,
+ these settings can no longer be changed for a variable.
+
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
+
+ If you use a group id (in a netCDF-4/HDF5 file), the enddef
+ will apply to the entire file. That means the enddef will not just end
+ define mode in one group, but in the entire file.
+
+ \returns ::NC_NOERR no error
+
+ \returns ::NC_EBADID Invalid ncid passed.
+
+
Example
+
+ Here is an example using nc_enddef() to finish the definitions of a new
+ netCDF dataset named foo.nc and put it into data mode:
+
+ \code
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ ...
+ status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+
+ ... create dimensions, variables, attributes
+
+ status = nc_enddef(ncid);
+ if (status != NC_NOERR) handle_error(status);
+ \endcode
+*/
int
nc_enddef(int ncid)
{
- int status = NC_NOERR;
- NC *ncp;
- status = NC_check_id(ncid, &ncp);
- if(status != NC_NOERR) return status;
- return ncp->dispatch->_enddef(ncid,0,1,0,1);
+ int status = NC_NOERR;
+ NC *ncp;
+ status = NC_check_id(ncid, &ncp);
+ if(status != NC_NOERR) return status;
+ return ncp->dispatch->_enddef(ncid,0,1,0,1);
}
/** \ingroup datasets
-Leave define mode with performance tuning
+ Leave define mode with performance tuning
-The function nc__enddef takes an open netCDF dataset out of define
-mode. The changes made to the netCDF dataset while it was in define
-mode are checked and committed to disk if no problems
-occurred. Non-record variables may be initialized to a "fill value" as
-well with nc_set_fill(). The netCDF dataset is then placed in data mode,
-so variable data can be read or written.
-
-This call may involve copying data under some circumstances. For a
-more extensive discussion see File Structure and Performance.
-
-\warning This function exposes internals of the netcdf version 1 file
-format. Users should use nc_enddef() in most circumstances. This
-function may not be available on future netcdf implementations.
-
-The classic netcdf file format has three sections, the "header"
-section, the data section for fixed size variables, and the data
-section for variables which have an unlimited dimension (record
-variables).
-
-The header begins at the beginning of the file. The index (offset) of
-the beginning of the other two sections is contained in the
-header. Typically, there is no space between the sections. This causes
-copying overhead to accrue if one wishes to change the size of the
-sections, as may happen when changing names of things, text attribute
-values, adding attributes or adding variables. Also, for buffered i/o,
-there may be advantages to aligning sections in certain ways.
-
-The minfree parameters allow one to control costs of future calls to
-nc_redef, nc_enddef() by requesting that minfree bytes be available at
-the end of the section.
-
-The align parameters allow one to set the alignment of the beginning
-of the corresponding sections. The beginning of the section is rounded
-up to an index which is a multiple of the align parameter. The flag
-value ALIGN_CHUNK tells the library to use the bufrsize (see above) as
-the align parameter. It has nothing to do with the chunking
-(multidimensional tiling) features of netCDF-4.
-
-The file format requires mod 4 alignment, so the align parameters are
-silently rounded up to multiples of 4. The usual call,
-
-\code
- nc_enddef(ncid);
-\endcode
-
-is equivalent to
-
-\code
- nc__enddef(ncid, 0, 4, 0, 4);
-\endcode
-
-The file format does not contain a "record size" value, this is
-calculated from the sizes of the record variables. This unfortunate
-fact prevents us from providing minfree and alignment control of the
-"records" in a netcdf file. If you add a variable which has an
-unlimited dimension, the third section will always be copied with the
-new variable added.
-
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
-
-\param h_minfree Sets the pad at the end of the "header" section.
-
-\param v_align Controls the alignment of the beginning of the data
-section for fixed size variables.
-
-\param v_minfree Sets the pad at the end of the data section for fixed
-size variables.
-
-\param r_align Controls the alignment of the beginning of the data
-section for variables which have an unlimited dimension (record
-variables).
+ The function nc__enddef takes an open netCDF dataset out of define
+ mode. The changes made to the netCDF dataset while it was in define
+ mode are checked and committed to disk if no problems
+ occurred. Non-record variables may be initialized to a "fill value" as
+ well with nc_set_fill(). The netCDF dataset is then placed in data mode,
+ so variable data can be read or written.
+
+ This call may involve copying data under some circumstances. For a
+ more extensive discussion see File Structure and Performance.
+
+ \warning This function exposes internals of the netcdf version 1 file
+ format. Users should use nc_enddef() in most circumstances. This
+ function may not be available on future netcdf implementations.
+
+ The classic netcdf file format has three sections, the "header"
+ section, the data section for fixed size variables, and the data
+ section for variables which have an unlimited dimension (record
+ variables).
+
+ The header begins at the beginning of the file. The index (offset) of
+ the beginning of the other two sections is contained in the
+ header. Typically, there is no space between the sections. This causes
+ copying overhead to accrue if one wishes to change the size of the
+ sections, as may happen when changing names of things, text attribute
+ values, adding attributes or adding variables. Also, for buffered i/o,
+ there may be advantages to aligning sections in certain ways.
+
+ The minfree parameters allow one to control costs of future calls to
+ nc_redef, nc_enddef() by requesting that minfree bytes be available at
+ the end of the section.
+
+ The align parameters allow one to set the alignment of the beginning
+ of the corresponding sections. The beginning of the section is rounded
+ up to an index which is a multiple of the align parameter. The flag
+ value ALIGN_CHUNK tells the library to use the bufrsize (see above) as
+ the align parameter. It has nothing to do with the chunking
+ (multidimensional tiling) features of netCDF-4.
+
+ The file format requires mod 4 alignment, so the align parameters are
+ silently rounded up to multiples of 4. The usual call,
+
+ \code
+ nc_enddef(ncid);
+ \endcode
+
+ is equivalent to
+
+ \code
+ nc__enddef(ncid, 0, 4, 0, 4);
+ \endcode
+
+ The file format does not contain a "record size" value, this is
+ calculated from the sizes of the record variables. This unfortunate
+ fact prevents us from providing minfree and alignment control of the
+ "records" in a netcdf file. If you add a variable which has an
+ unlimited dimension, the third section will always be copied with the
+ new variable added.
+
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
+
+ \param h_minfree Sets the pad at the end of the "header" section.
+
+ \param v_align Controls the alignment of the beginning of the data
+ section for fixed size variables.
+
+ \param v_minfree Sets the pad at the end of the data section for fixed
+ size variables.
+
+ \param r_align Controls the alignment of the beginning of the data
+ section for variables which have an unlimited dimension (record
+ variables).
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid ncid passed.
+ \returns ::NC_EBADID Invalid ncid passed.
- */
+*/
int
nc__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree,
- size_t r_align)
+ size_t r_align)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->_enddef(ncid,h_minfree,v_align,v_minfree,r_align);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->_enddef(ncid,h_minfree,v_align,v_minfree,r_align);
}
/** \ingroup datasets
-Synchronize an open netcdf dataset to disk
+ Synchronize an open netcdf dataset to disk
-The function nc_sync() offers a way to synchronize the disk copy of a
-netCDF dataset with in-memory buffers. There are two reasons you might
-want to synchronize after writes:
-- To minimize data loss in case of abnormal termination, or
-- To make data available to other processes for reading immediately
- after it is written. But note that a process that already had the
- dataset open for reading would not see the number of records
- increase when the writing process calls nc_sync(); to accomplish this,
- the reading process must call nc_sync.
-
-This function is backward-compatible with previous versions of the
-netCDF library. The intent was to allow sharing of a netCDF dataset
-among multiple readers and one writer, by having the writer call
-nc_sync() after writing and the readers call nc_sync() before each
-read. For a writer, this flushes buffers to disk. For a reader, it
-makes sure that the next read will be from disk rather than from
-previously cached buffers, so that the reader will see changes made by
-the writing process (e.g., the number of records written) without
-having to close and reopen the dataset. If you are only accessing a
-small amount of data, it can be expensive in computer resources to
-always synchronize to disk after every write, since you are giving up
-the benefits of buffering.
-
-An easier way to accomplish sharing (and what is now recommended) is
-to have the writer and readers open the dataset with the NC_SHARE
-flag, and then it will not be necessary to call nc_sync() at
-all. However, the nc_sync() function still provides finer granularity
-than the NC_SHARE flag, if only a few netCDF accesses need to be
-synchronized among processes.
-
-It is important to note that changes to the ancillary data, such as
-attribute values, are not propagated automatically by use of the
-NC_SHARE flag. Use of the nc_sync() function is still required for this
-purpose.
-
-Sharing datasets when the writer enters define mode to change the data
-schema requires extra care. In previous releases, after the writer
-left define mode, the readers were left looking at an old copy of the
-dataset, since the changes were made to a new copy. The only way
-readers could see the changes was by closing and reopening the
-dataset. Now the changes are made in place, but readers have no
-knowledge that their internal tables are now inconsistent with the new
-dataset schema. If netCDF datasets are shared across redefinition,
-some mechanism external to the netCDF library must be provided that
-prevents access by readers during redefinition and causes the readers
-to call nc_sync before any subsequent access.
-
-When calling nc_sync(), the netCDF dataset must be in data mode. A
-netCDF dataset in define mode is synchronized to disk only when
-nc_enddef() is called. A process that is reading a netCDF dataset that
-another process is writing may call nc_sync to get updated with the
-changes made to the data by the writing process (e.g., the number of
-records written), without having to close and reopen the dataset.
-
-Data is automatically synchronized to disk when a netCDF dataset is
-closed, or whenever you leave define mode.
+ The function nc_sync() offers a way to synchronize the disk copy of a
+ netCDF dataset with in-memory buffers. There are two reasons you might
+ want to synchronize after writes:
+ - To minimize data loss in case of abnormal termination, or
+ - To make data available to other processes for reading immediately
+ after it is written. But note that a process that already had the
+ dataset open for reading would not see the number of records
+ increase when the writing process calls nc_sync(); to accomplish this,
+ the reading process must call nc_sync.
+
+ This function is backward-compatible with previous versions of the
+ netCDF library. The intent was to allow sharing of a netCDF dataset
+ among multiple readers and one writer, by having the writer call
+ nc_sync() after writing and the readers call nc_sync() before each
+ read. For a writer, this flushes buffers to disk. For a reader, it
+ makes sure that the next read will be from disk rather than from
+ previously cached buffers, so that the reader will see changes made by
+ the writing process (e.g., the number of records written) without
+ having to close and reopen the dataset. If you are only accessing a
+ small amount of data, it can be expensive in computer resources to
+ always synchronize to disk after every write, since you are giving up
+ the benefits of buffering.
+
+ An easier way to accomplish sharing (and what is now recommended) is
+ to have the writer and readers open the dataset with the NC_SHARE
+ flag, and then it will not be necessary to call nc_sync() at
+ all. However, the nc_sync() function still provides finer granularity
+ than the NC_SHARE flag, if only a few netCDF accesses need to be
+ synchronized among processes.
+
+ It is important to note that changes to the ancillary data, such as
+ attribute values, are not propagated automatically by use of the
+ NC_SHARE flag. Use of the nc_sync() function is still required for this
+ purpose.
+
+ Sharing datasets when the writer enters define mode to change the data
+ schema requires extra care. In previous releases, after the writer
+ left define mode, the readers were left looking at an old copy of the
+ dataset, since the changes were made to a new copy. The only way
+ readers could see the changes was by closing and reopening the
+ dataset. Now the changes are made in place, but readers have no
+ knowledge that their internal tables are now inconsistent with the new
+ dataset schema. If netCDF datasets are shared across redefinition,
+ some mechanism external to the netCDF library must be provided that
+ prevents access by readers during redefinition and causes the readers
+ to call nc_sync before any subsequent access.
+
+ When calling nc_sync(), the netCDF dataset must be in data mode. A
+ netCDF dataset in define mode is synchronized to disk only when
+ nc_enddef() is called. A process that is reading a netCDF dataset that
+ another process is writing may call nc_sync to get updated with the
+ changes made to the data by the writing process (e.g., the number of
+ records written), without having to close and reopen the dataset.
+
+ Data is automatically synchronized to disk when a netCDF dataset is
+ closed, or whenever you leave define mode.
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid ncid passed.
- */
+ \returns ::NC_EBADID Invalid ncid passed.
+*/
int
nc_sync(int ncid)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->sync(ncid);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->sync(ncid);
}
/** \ingroup datasets
-No longer necessary for user to invoke manually.
-
-
-\warning Users no longer need to call this function since it is called
-automatically by nc_close() in case the dataset is in define mode and
-something goes wrong with committing the changes. The function
-nc_abort() just closes the netCDF dataset, if not in define mode. If
-the dataset is being created and is still in define mode, the dataset
-is deleted. If define mode was entered by a call to nc_redef(), the
-netCDF dataset is restored to its state before definition mode was
-entered and the dataset is closed.
+ No longer necessary for user to invoke manually.
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
-\returns ::NC_NOERR No error.
-
-
Example
-
-Here is an example using nc_abort to back out of redefinitions of a
-dataset named foo.nc:
-
-\code
- #include
- ...
- int ncid, status, latid;
- ...
- status = nc_open("foo.nc", NC_WRITE, &ncid);
- if (status != NC_NOERR) handle_error(status);
- ...
- status = nc_redef(ncid);
- if (status != NC_NOERR) handle_error(status);
- ...
- status = nc_def_dim(ncid, "lat", 18L, &latid);
- if (status != NC_NOERR) {
- handle_error(status);
- status = nc_abort(ncid);
- if (status != NC_NOERR) handle_error(status);
- }
-\endcode
+ \warning Users no longer need to call this function since it is called
+ automatically by nc_close() in case the dataset is in define mode and
+ something goes wrong with committing the changes. The function
+ nc_abort() just closes the netCDF dataset, if not in define mode. If
+ the dataset is being created and is still in define mode, the dataset
+ is deleted. If define mode was entered by a call to nc_redef(), the
+ netCDF dataset is restored to its state before definition mode was
+ entered and the dataset is closed.
+
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
+
+ \returns ::NC_NOERR No error.
+
+
Example
+
+ Here is an example using nc_abort to back out of redefinitions of a
+ dataset named foo.nc:
+
+ \code
+ #include
+ ...
+ int ncid, status, latid;
+ ...
+ status = nc_open("foo.nc", NC_WRITE, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ ...
+ status = nc_redef(ncid);
+ if (status != NC_NOERR) handle_error(status);
+ ...
+ status = nc_def_dim(ncid, "lat", 18L, &latid);
+ if (status != NC_NOERR) {
+ handle_error(status);
+ status = nc_abort(ncid);
+ if (status != NC_NOERR) handle_error(status);
+ }
+ \endcode
- */
+*/
int
nc_abort(int ncid)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
-
- stat = ncp->dispatch->abort(ncid);
- del_from_NCList(ncp);
- free_NC(ncp);
- return stat;
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+
+ stat = ncp->dispatch->abort(ncid);
+ del_from_NCList(ncp);
+ free_NC(ncp);
+ return stat;
}
/** \ingroup datasets
-Close an open netCDF dataset
+ Close an open netCDF dataset
-If the dataset in define mode, nc_enddef() will be called before
-closing. (In this case, if nc_enddef() returns an error, nc_abort() will
-automatically be called to restore the dataset to the consistent state
-before define mode was last entered.) After an open netCDF dataset is
-closed, its netCDF ID may be reassigned to the next netCDF dataset
-that is opened or created.
+ If the dataset in define mode, nc_enddef() will be called before
+ closing. (In this case, if nc_enddef() returns an error, nc_abort() will
+ automatically be called to restore the dataset to the consistent state
+ before define mode was last entered.) After an open netCDF dataset is
+ closed, its netCDF ID may be reassigned to the next netCDF dataset
+ that is opened or created.
-\param ncid NetCDF ID, from a previous call to nc_open() or nc_create().
+ \param ncid NetCDF ID, from a previous call to nc_open() or nc_create().
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid id passed.
+ \returns ::NC_EBADID Invalid id passed.
-\returns ::NC_EBADGRPID ncid did not contain the root group id of this
-file. (NetCDF-4 only).
+ \returns ::NC_EBADGRPID ncid did not contain the root group id of this
+ file. (NetCDF-4 only).
-
Example
+
Example
-Here is an example using nc_close to finish the definitions of a new
-netCDF dataset named foo.nc and release its netCDF ID:
+ Here is an example using nc_close to finish the definitions of a new
+ netCDF dataset named foo.nc and release its netCDF ID:
-\code
- #include
- ...
- int status = NC_NOERR;
- int ncid;
- ...
- status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
- if (status != NC_NOERR) handle_error(status);
+ \code
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ ...
+ status = nc_create("foo.nc", NC_NOCLOBBER, &ncid);
+ if (status != NC_NOERR) handle_error(status);
- ... create dimensions, variables, attributes
+ ... create dimensions, variables, attributes
- status = nc_close(ncid);
- if (status != NC_NOERR) handle_error(status);
-\endcode
+ status = nc_close(ncid);
+ if (status != NC_NOERR) handle_error(status);
+ \endcode
- */
+*/
int
nc_close(int ncid)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
-
- stat = ncp->dispatch->close(ncid,NULL);
- /* Remove from the nc list */
- if (!stat)
- {
- del_from_NCList(ncp);
- free_NC(ncp);
- }
- return stat;
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+
+ stat = ncp->dispatch->close(ncid,NULL);
+ /* Remove from the nc list */
+ if (!stat)
+ {
+ del_from_NCList(ncp);
+ free_NC(ncp);
+ }
+ return stat;
}
/** \ingroup datasets
-Do a normal close (see nc_close()) on an in-memory dataset,
-then return a copy of the final memory contents of the dataset.
+ Do a normal close (see nc_close()) on an in-memory dataset,
+ then return a copy of the final memory contents of the dataset.
-\param ncid NetCDF ID, from a previous call to nc_open() or nc_create().
+ \param ncid NetCDF ID, from a previous call to nc_open() or nc_create().
-\param memio a pointer to an NC_memio object into which the final valid memory
-size and memory will be returned.
+ \param memio a pointer to an NC_memio object into which the final valid memory
+ size and memory will be returned.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid id passed.
+ \returns ::NC_EBADID Invalid id passed.
-\returns ::NC_ENOMEM Out of memory.
+ \returns ::NC_ENOMEM Out of memory.
-\returns ::NC_EDISKLESS if the file was not created as an inmemory file.
+ \returns ::NC_EDISKLESS if the file was not created as an inmemory file.
-\returns ::NC_EBADGRPID ncid did not contain the root group id of this
-file. (NetCDF-4 only).
+ \returns ::NC_EBADGRPID ncid did not contain the root group id of this
+ file. (NetCDF-4 only).
-
Example
+
Example
-Here is an example using nc_close_mem to finish the definitions of a new
-netCDF dataset named foo.nc, return the final memory,
-and release its netCDF ID:
+ Here is an example using nc_close_mem to finish the definitions of a new
+ netCDF dataset named foo.nc, return the final memory,
+ and release its netCDF ID:
-\code
- #include
- ...
- int status = NC_NOERR;
- int ncid;
- NC_memio finalmem;
- size_t initialsize = 65000;
- ...
- status = nc_create_mem("foo.nc", NC_NOCLOBBER, initialsize, &ncid);
- if (status != NC_NOERR) handle_error(status);
- ... create dimensions, variables, attributes
- status = nc_close_memio(ncid,&finalmem);
- if (status != NC_NOERR) handle_error(status);
-\endcode
+ \code
+ #include
+ ...
+ int status = NC_NOERR;
+ int ncid;
+ NC_memio finalmem;
+ size_t initialsize = 65000;
+ ...
+ status = nc_create_mem("foo.nc", NC_NOCLOBBER, initialsize, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ ... create dimensions, variables, attributes
+ status = nc_close_memio(ncid,&finalmem);
+ if (status != NC_NOERR) handle_error(status);
+ \endcode
- */
+*/
int
nc_close_memio(int ncid, NC_memio* memio)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
-
- stat = ncp->dispatch->close(ncid,memio);
- /* Remove from the nc list */
- if (!stat)
- {
- del_from_NCList(ncp);
- free_NC(ncp);
- }
- return stat;
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+
+ stat = ncp->dispatch->close(ncid,memio);
+ /* Remove from the nc list */
+ if (!stat)
+ {
+ del_from_NCList(ncp);
+ free_NC(ncp);
+ }
+ return stat;
}
/** \ingroup datasets
-Change the fill-value mode to improve write performance.
-
-This function is intended for advanced usage, to optimize writes under
-some circumstances described below. The function nc_set_fill() sets the
-fill mode for a netCDF dataset open for writing and returns the
-current fill mode in a return parameter. The fill mode can be
-specified as either ::NC_FILL or ::NC_NOFILL. The default behavior
-corresponding to ::NC_FILL is that data is pre-filled with fill values,
-that is fill values are written when you create non-record variables
-or when you write a value beyond data that has not yet been
-written. This makes it possible to detect attempts to read data before
-it was written. For more information on the use of fill values see
-Fill Values. For information about how to define your own fill values
-see Attribute Conventions.
-
-The behavior corresponding to ::NC_NOFILL overrides the default behavior
-of prefilling data with fill values. This can be used to enhance
-performance, because it avoids the duplicate writes that occur when
-the netCDF library writes fill values that are later overwritten with
-data.
-
-A value indicating which mode the netCDF dataset was already in is
-returned. You can use this value to temporarily change the fill mode
-of an open netCDF dataset and then restore it to the previous mode.
-
-After you turn on ::NC_NOFILL mode for an open netCDF dataset, you must
-be certain to write valid data in all the positions that will later be
-read. Note that nofill mode is only a transient property of a netCDF
-dataset open for writing: if you close and reopen the dataset, it will
-revert to the default behavior. You can also revert to the default
-behavior by calling nc_set_fill() again to explicitly set the fill mode
-to ::NC_FILL.
-
-There are three situations where it is advantageous to set nofill
-mode:
-- Creating and initializing a netCDF dataset. In this case, you should
- set nofill mode before calling nc_enddef() and then write completely
- all non-record variables and the initial records of all the record
- variables you want to initialize.
-- Extending an existing record-oriented netCDF dataset. Set nofill
- mode after opening the dataset for writing, then append the
- additional records to the dataset completely, leaving no intervening
- unwritten records.
-- Adding new variables that you are going to initialize to an existing
- netCDF dataset. Set nofill mode before calling nc_enddef() then write
- all the new variables completely.
-
-If the netCDF dataset has an unlimited dimension and the last record
-was written while in nofill mode, then the dataset may be shorter than
-if nofill mode was not set, but this will be completely transparent if
-you access the data only through the netCDF interfaces.
-
-The use of this feature may not be available (or even needed) in
-future releases. Programmers are cautioned against heavy reliance upon
-this feature.
-
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
-
-\param fillmode Desired fill mode for the dataset, either ::NC_NOFILL or
-::NC_FILL.
-
-\param old_modep Pointer to location for returned current fill mode of
-the dataset before this call, either ::NC_NOFILL or ::NC_FILL.
-
-\returns ::NC_NOERR No error.
-
-\returns ::NC_EBADID The specified netCDF ID does not refer to an open
-netCDF dataset.
-
-\returns ::NC_EPERM The specified netCDF ID refers to a dataset open for
-read-only access.
-
-\returns ::NC_EINVAL The fill mode argument is neither ::NC_NOFILL nor
-::NC_FILL.
-
-
Example
+ Change the fill-value mode to improve write performance.
-Here is an example using nc_set_fill() to set nofill mode for subsequent
-writes of a netCDF dataset named foo.nc:
+ This function is intended for advanced usage, to optimize writes under
+ some circumstances described below. The function nc_set_fill() sets the
+ fill mode for a netCDF dataset open for writing and returns the
+ current fill mode in a return parameter. The fill mode can be
+ specified as either ::NC_FILL or ::NC_NOFILL. The default behavior
+ corresponding to ::NC_FILL is that data is pre-filled with fill values,
+ that is fill values are written when you create non-record variables
+ or when you write a value beyond data that has not yet been
+ written. This makes it possible to detect attempts to read data before
+ it was written. For more information on the use of fill values see
+ Fill Values. For information about how to define your own fill values
+ see Attribute Conventions.
+
+ The behavior corresponding to ::NC_NOFILL overrides the default behavior
+ of prefilling data with fill values. This can be used to enhance
+ performance, because it avoids the duplicate writes that occur when
+ the netCDF library writes fill values that are later overwritten with
+ data.
+
+ A value indicating which mode the netCDF dataset was already in is
+ returned. You can use this value to temporarily change the fill mode
+ of an open netCDF dataset and then restore it to the previous mode.
+
+ After you turn on ::NC_NOFILL mode for an open netCDF dataset, you must
+ be certain to write valid data in all the positions that will later be
+ read. Note that nofill mode is only a transient property of a netCDF
+ dataset open for writing: if you close and reopen the dataset, it will
+ revert to the default behavior. You can also revert to the default
+ behavior by calling nc_set_fill() again to explicitly set the fill mode
+ to ::NC_FILL.
+
+ There are three situations where it is advantageous to set nofill
+ mode:
+ - Creating and initializing a netCDF dataset. In this case, you should
+ set nofill mode before calling nc_enddef() and then write completely
+ all non-record variables and the initial records of all the record
+ variables you want to initialize.
+ - Extending an existing record-oriented netCDF dataset. Set nofill
+ mode after opening the dataset for writing, then append the
+ additional records to the dataset completely, leaving no intervening
+ unwritten records.
+ - Adding new variables that you are going to initialize to an existing
+ netCDF dataset. Set nofill mode before calling nc_enddef() then write
+ all the new variables completely.
+
+ If the netCDF dataset has an unlimited dimension and the last record
+ was written while in nofill mode, then the dataset may be shorter than
+ if nofill mode was not set, but this will be completely transparent if
+ you access the data only through the netCDF interfaces.
+
+ The use of this feature may not be available (or even needed) in
+ future releases. Programmers are cautioned against heavy reliance upon
+ this feature.
+
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
+
+ \param fillmode Desired fill mode for the dataset, either ::NC_NOFILL or
+ ::NC_FILL.
+
+ \param old_modep Pointer to location for returned current fill mode of
+ the dataset before this call, either ::NC_NOFILL or ::NC_FILL.
+
+ \returns ::NC_NOERR No error.
+
+ \returns ::NC_EBADID The specified netCDF ID does not refer to an open
+ netCDF dataset.
+
+ \returns ::NC_EPERM The specified netCDF ID refers to a dataset open for
+ read-only access.
+
+ \returns ::NC_EINVAL The fill mode argument is neither ::NC_NOFILL nor
+ ::NC_FILL.
+
+
Example
+
+ Here is an example using nc_set_fill() to set nofill mode for subsequent
+ writes of a netCDF dataset named foo.nc:
+
+ \code
+ #include
+ ...
+ int ncid, status, old_fill_mode;
+ ...
+ status = nc_open("foo.nc", NC_WRITE, &ncid);
+ if (status != NC_NOERR) handle_error(status);
-\code
- #include
- ...
- int ncid, status, old_fill_mode;
- ...
- status = nc_open("foo.nc", NC_WRITE, &ncid);
- if (status != NC_NOERR) handle_error(status);
+ ... write data with default prefilling behavior
- ... write data with default prefilling behavior
+ status = nc_set_fill(ncid, ::NC_NOFILL, &old_fill_mode);
+ if (status != NC_NOERR) handle_error(status);
- status = nc_set_fill(ncid, ::NC_NOFILL, &old_fill_mode);
- if (status != NC_NOERR) handle_error(status);
-
- ... write data with no prefilling
-\endcode
- */
+ ... write data with no prefilling
+ \endcode
+*/
int
nc_set_fill(int ncid, int fillmode, int *old_modep)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->set_fill(ncid,fillmode,old_modep);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->set_fill(ncid,fillmode,old_modep);
}
/**
@@ -1467,11 +1487,11 @@
int
nc_inq_base_pe(int ncid, int *pe)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- if (pe) *pe = 0;
- return NC_NOERR;
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ if (pe) *pe = 0;
+ return NC_NOERR;
}
/**
@@ -1491,10 +1511,10 @@
int
nc_set_base_pe(int ncid, int pe)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return NC_NOERR;
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return NC_NOERR;
}
/**
@@ -1517,98 +1537,98 @@
int
nc_inq_format(int ncid, int *formatp)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->inq_format(ncid,formatp);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->inq_format(ncid,formatp);
}
/** \ingroup datasets
-Obtain more detailed (vis-a-vis nc_inq_format)
-format information about an open dataset.
+ Obtain more detailed (vis-a-vis nc_inq_format)
+ format information about an open dataset.
-Note that the netcdf API will present the file
-as if it had the format specified by nc_inq_format.
-The true file format, however, may not even be
-a netcdf file; it might be DAP, HDF4, or PNETCDF,
-for example. This function returns that true file type.
-It also returns the effective mode for the file.
+ Note that the netcdf API will present the file
+ as if it had the format specified by nc_inq_format.
+ The true file format, however, may not even be
+ a netcdf file; it might be DAP, HDF4, or PNETCDF,
+ for example. This function returns that true file type.
+ It also returns the effective mode for the file.
-\param ncid NetCDF ID, from a previous call to nc_open() or
-nc_create().
+ \param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
-\param formatp Pointer to location for returned true format.
+ \param formatp Pointer to location for returned true format.
-\param modep Pointer to location for returned mode flags.
+ \param modep Pointer to location for returned mode flags.
-Refer to the actual list in the file netcdf.h to see the
-currently defined set.
+ Refer to the actual list in the file netcdf.h to see the
+ currently defined set.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid ncid passed.
+ \returns ::NC_EBADID Invalid ncid passed.
- */
+*/
int
nc_inq_format_extended(int ncid, int *formatp, int *modep)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->inq_format_extended(ncid,formatp,modep);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->inq_format_extended(ncid,formatp,modep);
}
/**\ingroup datasets
-Inquire about a file or group.
+ Inquire about a file or group.
-\param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as
-nc_inq_ncid().
+ \param ncid NetCDF or group ID, from a previous call to nc_open(),
+ nc_create(), nc_def_grp(), or associated inquiry functions such as
+ nc_inq_ncid().
-\param ndimsp Pointer to location for returned number of dimensions
-defined for this netCDF dataset. Ignored if NULL.
+ \param ndimsp Pointer to location for returned number of dimensions
+ defined for this netCDF dataset. Ignored if NULL.
-\param nvarsp Pointer to location for returned number of variables
-defined for this netCDF dataset. Ignored if NULL.
+ \param nvarsp Pointer to location for returned number of variables
+ defined for this netCDF dataset. Ignored if NULL.
-\param nattsp Pointer to location for returned number of global
-attributes defined for this netCDF dataset. Ignored if NULL.
+ \param nattsp Pointer to location for returned number of global
+ attributes defined for this netCDF dataset. Ignored if NULL.
-\param unlimdimidp Pointer to location for returned ID of the
-unlimited dimension, if there is one for this netCDF dataset. If no
-unlimited length dimension has been defined, -1 is returned. Ignored
-if NULL. If there are multiple unlimited dimensions (possible only
-for netCDF-4 files), only a pointer to the first is returned, for
-backward compatibility. If you want them all, use nc_inq_unlimids().
+ \param unlimdimidp Pointer to location for returned ID of the
+ unlimited dimension, if there is one for this netCDF dataset. If no
+ unlimited length dimension has been defined, -1 is returned. Ignored
+ if NULL. If there are multiple unlimited dimensions (possible only
+ for netCDF-4 files), only a pointer to the first is returned, for
+ backward compatibility. If you want them all, use nc_inq_unlimids().
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid ncid passed.
+ \returns ::NC_EBADID Invalid ncid passed.
-
Example
+
Example
-Here is an example using nc_inq to find out about a netCDF dataset
-named foo.nc:
+ Here is an example using nc_inq to find out about a netCDF dataset
+ named foo.nc:
-\code
- #include
- ...
- int status, ncid, ndims, nvars, ngatts, unlimdimid;
- ...
- status = nc_open("foo.nc", NC_NOWRITE, &ncid);
- if (status != NC_NOERR) handle_error(status);
- ...
- status = nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid);
- if (status != NC_NOERR) handle_error(status);
-\endcode
- */
+ \code
+ #include
+ ...
+ int status, ncid, ndims, nvars, ngatts, unlimdimid;
+ ...
+ status = nc_open("foo.nc", NC_NOWRITE, &ncid);
+ if (status != NC_NOERR) handle_error(status);
+ ...
+ status = nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid);
+ if (status != NC_NOERR) handle_error(status);
+ \endcode
+*/
int
nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->inq(ncid,ndimsp,nvarsp,nattsp,unlimdimidp);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->inq(ncid,ndimsp,nvarsp,nattsp,unlimdimidp);
}
/**
@@ -1624,116 +1644,116 @@
int
nc_inq_nvars(int ncid, int *nvarsp)
{
- NC* ncp;
- int stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->inq(ncid, NULL, nvarsp, NULL, NULL);
+ NC* ncp;
+ int stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) return stat;
+ return ncp->dispatch->inq(ncid, NULL, nvarsp, NULL, NULL);
}
/**\ingroup datasets
-Inquire about a type.
+ Inquire about a type.
-Given an ncid and a typeid, get the information about a type. This
-function will work on any type, including atomic and any user defined
-type, whether compound, opaque, enumeration, or variable length array.
+ Given an ncid and a typeid, get the information about a type. This
+ function will work on any type, including atomic and any user defined
+ type, whether compound, opaque, enumeration, or variable length array.
-For even more information about a user defined type nc_inq_user_type().
+ For even more information about a user defined type nc_inq_user_type().
-\param ncid The ncid for the group containing the type (ignored for
-atomic types).
+ \param ncid The ncid for the group containing the type (ignored for
+ atomic types).
-\param xtype The typeid for this type, as returned by nc_def_compound,
-nc_def_opaque, nc_def_enum, nc_def_vlen, or nc_inq_var, or as found in
-netcdf.h in the list of atomic types (NC_CHAR, NC_INT, etc.).
+ \param xtype The typeid for this type, as returned by nc_def_compound,
+ nc_def_opaque, nc_def_enum, nc_def_vlen, or nc_inq_var, or as found in
+ netcdf.h in the list of atomic types (NC_CHAR, NC_INT, etc.).
-\param name If non-NULL, the name of the user defined type will be
-copied here. It will be NC_MAX_NAME bytes or less. For atomic types,
-the type name from CDL will be given.
+ \param name If non-NULL, the name of the user defined type will be
+ copied here. It will be NC_MAX_NAME bytes or less. For atomic types,
+ the type name from CDL will be given.
-\param size If non-NULL, the (in-memory) size of the type in bytes
-will be copied here. VLEN type size is the size of nc_vlen_t. String
-size is returned as the size of a character pointer. The size may be
-used to malloc space for the data, no matter what the type.
+ \param size If non-NULL, the (in-memory) size of the type in bytes
+ will be copied here. VLEN type size is the size of nc_vlen_t. String
+ size is returned as the size of a character pointer. The size may be
+ used to malloc space for the data, no matter what the type.
-\returns ::NC_NOERR No error.
+ \returns ::NC_NOERR No error.
-\returns ::NC_EBADTYPE Bad typeid.
+ \returns ::NC_EBADTYPE Bad typeid.
-\returns ::NC_ENOTNC4 Seeking a user-defined type in a netCDF-3 file.
+ \returns ::NC_ENOTNC4 Seeking a user-defined type in a netCDF-3 file.
-\returns ::NC_ESTRICTNC3 Seeking a user-defined type in a netCDF-4 file
-for which classic model has been turned on.
+ \returns ::NC_ESTRICTNC3 Seeking a user-defined type in a netCDF-4 file
+ for which classic model has been turned on.
-\returns ::NC_EBADGRPID Bad group ID in ncid.
+ \returns ::NC_EBADGRPID Bad group ID in ncid.
-\returns ::NC_EBADID Type ID not found.
+ \returns ::NC_EBADID Type ID not found.
-\returns ::NC_EHDFERR An error was reported by the HDF5 layer.
+ \returns ::NC_EHDFERR An error was reported by the HDF5 layer.
-
Example
+
Example
-This example is from the test program tst_enums.c, and it uses all the
-possible inquiry functions on an enum type.
+ This example is from the test program tst_enums.c, and it uses all the
+ possible inquiry functions on an enum type.
-\code
- if (nc_inq_user_type(ncid, typeids[0], name_in, &base_size_in, &base_nc_type_in,
- &nfields_in, &class_in)) ERR;
- if (strcmp(name_in, TYPE_NAME) || base_size_in != sizeof(int) ||
- base_nc_type_in != NC_INT || nfields_in != NUM_MEMBERS || class_in != NC_ENUM) ERR;
- if (nc_inq_type(ncid, typeids[0], name_in, &base_size_in)) ERR;
- if (strcmp(name_in, TYPE_NAME) || base_size_in != sizeof(int)) ERR;
- if (nc_inq_enum(ncid, typeids[0], name_in, &base_nc_type, &base_size_in, &num_members)) ERR;
- if (strcmp(name_in, TYPE_NAME) || base_nc_type != NC_INT || num_members != NUM_MEMBERS) ERR;
- for (i = 0; i < NUM_MEMBERS; i++)
- {
- if (nc_inq_enum_member(ncid, typeid, i, name_in, &value_in)) ERR;
- if (strcmp(name_in, member_name[i]) || value_in != member_value[i]) ERR;
- if (nc_inq_enum_ident(ncid, typeid, member_value[i], name_in)) ERR;
- if (strcmp(name_in, member_name[i])) ERR;
- }
+ \code
+ if (nc_inq_user_type(ncid, typeids[0], name_in, &base_size_in, &base_nc_type_in,
+ &nfields_in, &class_in)) ERR;
+ if (strcmp(name_in, TYPE_NAME) || base_size_in != sizeof(int) ||
+ base_nc_type_in != NC_INT || nfields_in != NUM_MEMBERS || class_in != NC_ENUM) ERR;
+ if (nc_inq_type(ncid, typeids[0], name_in, &base_size_in)) ERR;
+ if (strcmp(name_in, TYPE_NAME) || base_size_in != sizeof(int)) ERR;
+ if (nc_inq_enum(ncid, typeids[0], name_in, &base_nc_type, &base_size_in, &num_members)) ERR;
+ if (strcmp(name_in, TYPE_NAME) || base_nc_type != NC_INT || num_members != NUM_MEMBERS) ERR;
+ for (i = 0; i < NUM_MEMBERS; i++)
+ {
+ if (nc_inq_enum_member(ncid, typeid, i, name_in, &value_in)) ERR;
+ if (strcmp(name_in, member_name[i]) || value_in != member_value[i]) ERR;
+ if (nc_inq_enum_ident(ncid, typeid, member_value[i], name_in)) ERR;
+ if (strcmp(name_in, member_name[i])) ERR;
+ }
- if (nc_close(ncid)) ERR;
-\endcode
- */
+ if (nc_close(ncid)) ERR;
+ \endcode
+*/
int
nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size)
{
- NC* ncp;
- int stat;
+ NC* ncp;
+ int stat;
- /* Do a quick triage on xtype */
- if(xtype <= NC_NAT) return NC_EBADTYPE;
- /* For compatibility, we need to allow inq about
- atomic types, even if ncid is ill-defined */
- if(xtype <= ATOMICTYPEMAX4) {
- if(name) strncpy(name,NC_atomictypename(xtype),NC_MAX_NAME);
- if(size) *size = NC_atomictypelen(xtype);
- return NC_NOERR;
- }
- /* Apparently asking about a user defined type, so we need
- a valid ncid */
- stat = NC_check_id(ncid, &ncp);
- if(stat != NC_NOERR) /* bad ncid */
- return NC_EBADTYPE;
- /* have good ncid */
- return ncp->dispatch->inq_type(ncid,xtype,name,size);
+ /* Do a quick triage on xtype */
+ if(xtype <= NC_NAT) return NC_EBADTYPE;
+ /* For compatibility, we need to allow inq about
+ atomic types, even if ncid is ill-defined */
+ if(xtype <= ATOMICTYPEMAX4) {
+ if(name) strncpy(name,NC_atomictypename(xtype),NC_MAX_NAME);
+ if(size) *size = NC_atomictypelen(xtype);
+ return NC_NOERR;
+ }
+ /* Apparently asking about a user defined type, so we need
+ a valid ncid */
+ stat = NC_check_id(ncid, &ncp);
+ if(stat != NC_NOERR) /* bad ncid */
+ return NC_EBADTYPE;
+ /* have good ncid */
+ return ncp->dispatch->inq_type(ncid,xtype,name,size);
}
/**
-Check the create mode parameter for sanity.
+ Check the create mode parameter for sanity.
-Some create flags cannot be used if corresponding library features are
-enabled during the build. This function does a pre-check of the mode
-flag before calling the dispatch layer nc_create functions.
-
-\param mode The creation mode flag.
-
-\returns ::NC_NOERR No error.
-\returns ::NC_ENOTBUILT Requested feature not built into library
-\returns ::NC_EINVAL Invalid combination of modes.
-\internal
-\ingroup dispatch
-\author Ed Hartnett
+ Some create flags cannot be used if corresponding library features are
+ enabled during the build. This function does a pre-check of the mode
+ flag before calling the dispatch layer nc_create functions.
+
+ \param mode The creation mode flag.
+
+ \returns ::NC_NOERR No error.
+ \returns ::NC_ENOTBUILT Requested feature not built into library
+ \returns ::NC_EINVAL Invalid combination of modes.
+ \internal
+ \ingroup dispatch
+ \author Ed Hartnett
*/
static int
check_create_mode(int mode)
@@ -1746,9 +1766,9 @@
/* This is a clever check to see if more than one format bit is
* set. */
mode_format = (mode & NC_NETCDF4) | (mode & NC_64BIT_OFFSET) |
- (mode & NC_CDF5);
+ (mode & NC_CDF5);
if (mode_format && (mode_format & (mode_format - 1)))
- return NC_EINVAL;
+ return NC_EINVAL;
mmap = ((mode & NC_MMAP) == NC_MMAP);
inmemory = ((mode & NC_INMEMORY) == NC_INMEMORY);
@@ -1763,14 +1783,14 @@
if(mmap && (mode & NC_NETCDF4)) return NC_EINVAL;
#ifndef USE_NETCDF4
- /* If the user asks for a netCDF-4 file, and the library was built
- * without netCDF-4, then return an error.*/
- if (mode & NC_NETCDF4)
- return NC_ENOTBUILT;
+ /* If the user asks for a netCDF-4 file, and the library was built
+ * without netCDF-4, then return an error.*/
+ if (mode & NC_NETCDF4)
+ return NC_ENOTBUILT;
#endif /* USE_NETCDF4 undefined */
- /* Well I guess there is some sanity in the world after all. */
- return NC_NOERR;
+ /* Well I guess there is some sanity in the world after all. */
+ return NC_NOERR;
}
/**
@@ -1799,55 +1819,55 @@
* @returns ::NC_NOERR No error.
* @ingroup dispatch
* @author Dennis Heimbigner, Ed Hartnett, Ward Fisher
-*/
+ */
int
NC_create(const char *path0, int cmode, size_t initialsz,
- int basepe, size_t *chunksizehintp, int useparallel,
- void* parameters, int *ncidp)
+ int basepe, size_t *chunksizehintp, int useparallel,
+ void* parameters, int *ncidp)
{
- int stat = NC_NOERR;
- NC* ncp = NULL;
- const NC_Dispatch* dispatcher = NULL;
- char* path = NULL;
- NCmodel model;
- char* newpath = NULL;
-
- TRACE(nc_create);
- if(path0 == NULL)
- return NC_EINVAL;
-
- /* Check mode flag for sanity. */
- if ((stat = check_create_mode(cmode)))
- return stat;
-
- /* Initialize the library. The available dispatch tables
- * will depend on how netCDF was built
- * (with/without netCDF-4, DAP, CDMREMOTE). */
- if(!NC_initialized)
- {
- if ((stat = nc_initialize()))
- return stat;
- }
+ int stat = NC_NOERR;
+ NC* ncp = NULL;
+ const NC_Dispatch* dispatcher = NULL;
+ char* path = NULL;
+ NCmodel model;
+ char* newpath = NULL;
- {
+ TRACE(nc_create);
+ if(path0 == NULL)
+ return NC_EINVAL;
+
+ /* Check mode flag for sanity. */
+ if ((stat = check_create_mode(cmode)))
+ return stat;
+
+ /* Initialize the library. The available dispatch tables
+ * will depend on how netCDF was built
+ * (with/without netCDF-4, DAP, CDMREMOTE). */
+ if(!NC_initialized)
+ {
+ if ((stat = nc_initialize()))
+ return stat;
+ }
+
+ {
/* Skip past any leading whitespace in path */
- const char* p;
- for(p=(char*)path0;*p;p++) {if(*p > ' ') break;}
+ const unsigned char* p;
+ for(p=(const unsigned char*)path0;*p;p++) {if(*p > ' ') break;}
#ifdef WINPATH
/* Need to do path conversion */
path = NCpathcvt(p);
#else
- path = nulldup(p);
+ path = nulldup(p);
#endif
- }
+ }
memset(&model,0,sizeof(model));
if((stat = NC_infermodel(path,&cmode,1,useparallel,NULL,&model,&newpath)))
- goto done;
+ goto done;
if(newpath) {
- nullfree(path);
- path = newpath;
- newpath = NULL;
+ nullfree(path);
+ path = newpath;
+ newpath = NULL;
}
assert(model.format != 0 && model.impl != 0);
@@ -1855,15 +1875,15 @@
/* Now, check for NC_ENOTBUILT cases limited to create (so e.g. HDF4 is not listed) */
#ifndef USE_HDF5
if (model.impl == NC_FORMATX_NC4)
- {stat = NC_ENOTBUILT; goto done;}
+ {stat = NC_ENOTBUILT; goto done;}
#endif
#ifndef USE_PNETCDF
if (model.impl == NC_FORMATX_PNETCDF)
- {stat = NC_ENOTBUILT; goto done;}
+ {stat = NC_ENOTBUILT; goto done;}
#endif
#ifndef ENABLE_CDF5
if (model.impl == NC_FORMATX_NC3 && (cmode & NC_64BIT_DATA))
- {stat = NC_ENOTBUILT; goto done;}
+ {stat = NC_ENOTBUILT; goto done;}
#endif
/* Figure out what dispatcher to use */
@@ -1871,12 +1891,12 @@
#ifdef USE_HDF5
case NC_FORMATX_NC4:
dispatcher = HDF5_dispatch_table;
- break;
+ break;
#endif
#ifdef USE_PNETCDF
case NC_FORMATX_PNETCDF:
dispatcher = NCP_dispatch_table;
- break;
+ break;
#endif
#ifdef USE_NETCDF4
case NC_FORMATX_UDF0:
@@ -1888,7 +1908,7 @@
#endif /* USE_NETCDF4 */
case NC_FORMATX_NC3:
dispatcher = NC3_dispatch_table;
- break;
+ break;
default:
return NC_ENOTNC;
}
@@ -1901,11 +1921,11 @@
/* Assume create will fill in remaining ncp fields */
if ((stat = dispatcher->create(ncp->path, cmode, initialsz, basepe, chunksizehintp,
- parameters, dispatcher, ncp->ext_ncid))) {
- del_from_NCList(ncp); /* oh well */
- free_NC(ncp);
+ parameters, dispatcher, ncp->ext_ncid))) {
+ del_from_NCList(ncp); /* oh well */
+ free_NC(ncp);
} else {
- if(ncidp)*ncidp = ncp->ext_ncid;
+ if(ncidp)*ncidp = ncp->ext_ncid;
}
done:
nullfree(path);
@@ -1934,7 +1954,7 @@
* @returns ::NC_NOERR No error.
* @ingroup dispatch
* @author Dennis Heimbigner
-*/
+ */
int
NC_open(const char *path0, int omode, int basepe, size_t *chunksizehintp,
int useparallel, void* parameters, int *ncidp)
@@ -1951,8 +1971,8 @@
TRACE(nc_open);
if(!NC_initialized) {
- stat = nc_initialize();
- if(stat) return stat;
+ stat = nc_initialize();
+ if(stat) return stat;
}
/* Check inputs. */
@@ -1977,110 +1997,110 @@
repeated in protocol code (e.g. libdap2, libdap4, etc).
*/
- {
+ {
/* Skip past any leading whitespace in path */
- const char* p;
- for(p=(char*)path0;*p;p++) {if(*p > ' ') break;}
+ const unsigned char* p;
+ for(p=(const unsigned char*)path0;*p;p++) {if(*p > ' ') break;}
#ifdef WINPATH
/* Need to do path conversion */
path = NCpathcvt(p);
#else
- path = nulldup(p);
+ path = nulldup(p);
#endif
- }
+ }
memset(&model,0,sizeof(model));
/* Infer model implementation and format, possibly by reading the file */
if((stat = NC_infermodel(path,&omode,0,useparallel,parameters,&model,&newpath)))
- goto done;
+ goto done;
if(newpath) {
- nullfree(path);
- path = newpath;
+ nullfree(path);
+ path = newpath;
}
/* Still no implementation, give up */
if(model.impl == 0) {
#ifdef DEBUG
- fprintf(stderr,"implementation == 0\n");
+ fprintf(stderr,"implementation == 0\n");
#endif
- {stat = NC_ENOTNC; goto done;}
+ {stat = NC_ENOTNC; goto done;}
}
/* Suppress unsupported formats */
{
- int hdf5built = 0;
- int hdf4built = 0;
- int cdf5built = 0;
- int udf0built = 0;
- int udf1built = 0;
+ int hdf5built = 0;
+ int hdf4built = 0;
+ int cdf5built = 0;
+ int udf0built = 0;
+ int udf1built = 0;
#ifdef USE_NETCDF4
- hdf5built = 1;
+ hdf5built = 1;
#ifdef USE_HDF4
- hdf4built = 1;
+ hdf4built = 1;
#endif
#endif
#ifdef ENABLE_CDF5
- cdf5built = 1;
+ cdf5built = 1;
#endif
if(UDF0_dispatch_table != NULL)
- udf0built = 1;
+ udf0built = 1;
if(UDF1_dispatch_table != NULL)
- udf1built = 1;
+ udf1built = 1;
- if(!hdf5built && model.impl == NC_FORMATX_NC4)
- {stat = NC_ENOTBUILT; goto done;}
- if(!hdf4built && model.impl == NC_FORMATX_NC_HDF4)
- {stat = NC_ENOTBUILT; goto done;}
- if(!cdf5built && model.impl == NC_FORMATX_NC3 && model.format == NC_FORMAT_CDF5)
- {stat = NC_ENOTBUILT; goto done;}
- if(!udf0built && model.impl == NC_FORMATX_UDF0)
- {stat = NC_ENOTBUILT; goto done;}
- if(!udf1built && model.impl == NC_FORMATX_UDF1)
- {stat = NC_ENOTBUILT; goto done;}
+ if(!hdf5built && model.impl == NC_FORMATX_NC4)
+ {stat = NC_ENOTBUILT; goto done;}
+ if(!hdf4built && model.impl == NC_FORMATX_NC_HDF4)
+ {stat = NC_ENOTBUILT; goto done;}
+ if(!cdf5built && model.impl == NC_FORMATX_NC3 && model.format == NC_FORMAT_CDF5)
+ {stat = NC_ENOTBUILT; goto done;}
+ if(!udf0built && model.impl == NC_FORMATX_UDF0)
+ {stat = NC_ENOTBUILT; goto done;}
+ if(!udf1built && model.impl == NC_FORMATX_UDF1)
+ {stat = NC_ENOTBUILT; goto done;}
}
/* Figure out what dispatcher to use */
if (!dispatcher) {
- switch (model.impl) {
+ switch (model.impl) {
#ifdef ENABLE_DAP
- case NC_FORMATX_DAP2:
- dispatcher = NCD2_dispatch_table;
- break;
+ case NC_FORMATX_DAP2:
+ dispatcher = NCD2_dispatch_table;
+ break;
#endif
#ifdef ENABLE_DAP4
- case NC_FORMATX_DAP4:
- dispatcher = NCD4_dispatch_table;
- break;
+ case NC_FORMATX_DAP4:
+ dispatcher = NCD4_dispatch_table;
+ break;
#endif
#ifdef USE_PNETCDF
- case NC_FORMATX_PNETCDF:
- dispatcher = NCP_dispatch_table;
- break;
+ case NC_FORMATX_PNETCDF:
+ dispatcher = NCP_dispatch_table;
+ break;
#endif
#ifdef USE_HDF5
- case NC_FORMATX_NC4:
- dispatcher = HDF5_dispatch_table;
- break;
+ case NC_FORMATX_NC4:
+ dispatcher = HDF5_dispatch_table;
+ break;
#endif
#ifdef USE_HDF4
- case NC_FORMATX_NC_HDF4:
- dispatcher = HDF4_dispatch_table;
- break;
+ case NC_FORMATX_NC_HDF4:
+ dispatcher = HDF4_dispatch_table;
+ break;
#endif
#ifdef USE_NETCDF4
- case NC_FORMATX_UDF0:
- dispatcher = UDF0_dispatch_table;
- break;
- case NC_FORMATX_UDF1:
- dispatcher = UDF1_dispatch_table;
- break;
+ case NC_FORMATX_UDF0:
+ dispatcher = UDF0_dispatch_table;
+ break;
+ case NC_FORMATX_UDF1:
+ dispatcher = UDF1_dispatch_table;
+ break;
#endif /* USE_NETCDF4 */
- case NC_FORMATX_NC3:
- dispatcher = NC3_dispatch_table;
- break;
- default:
- nullfree(path);
- return NC_ENOTNC;
- }
+ case NC_FORMATX_NC3:
+ dispatcher = NC3_dispatch_table;
+ break;
+ default:
+ nullfree(path);
+ return NC_ENOTNC;
+ }
}
@@ -2095,11 +2115,11 @@
/* Assume open will fill in remaining ncp fields */
stat = dispatcher->open(ncp->path, omode, basepe, chunksizehintp,
- parameters, dispatcher, ncp->ext_ncid);
+ parameters, dispatcher, ncp->ext_ncid);
if(stat == NC_NOERR) {
- if(ncidp) *ncidp = ncp->ext_ncid;
+ if(ncidp) *ncidp = ncp->ext_ncid;
} else {
- del_from_NCList(ncp);
+ del_from_NCList(ncp);
free_NC(ncp);
}
@@ -2121,7 +2141,7 @@
*
* @return pseudo file number
* @author Dennis Heimbigner
-*/
+ */
int
nc__pseudofd(void)
{
@@ -2130,12 +2150,12 @@
#ifdef HAVE_GETRLIMIT
struct rlimit rl;
if(getrlimit(RLIMIT_NOFILE,&rl) == 0) {
- if(rl.rlim_max != RLIM_INFINITY)
- maxfd = (int)rl.rlim_max;
- if(rl.rlim_cur != RLIM_INFINITY)
- maxfd = (int)rl.rlim_cur;
- }
- pseudofd = maxfd+1;
+ if(rl.rlim_max != RLIM_INFINITY)
+ maxfd = (int)rl.rlim_max;
+ if(rl.rlim_cur != RLIM_INFINITY)
+ maxfd = (int)rl.rlim_cur;
+ }
+ pseudofd = maxfd+1;
#endif
}
return pseudofd++;
diff -Nru netcdf-parallel-4.7.3/libdispatch/dfilter.c netcdf-parallel-4.7.4/libdispatch/dfilter.c
--- netcdf-parallel-4.7.3/libdispatch/dfilter.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dfilter.c 2020-08-31 10:33:26.000000000 +0000
@@ -13,39 +13,93 @@
#include "netcdf.h"
#include "netcdf_filter.h"
+#include "ncdispatch.h"
+#include "nc4internal.h"
#ifdef USE_HDF5
#include "hdf5internal.h"
#endif
/*
-Common utilities related to filters.
+Unified filter related code
*/
+#ifndef H5Z_FILTER_SZIP
+/** ID of HDF SZIP filter. */
+#define H5Z_FILTER_SZIP 4
+#endif
+
+#define LPAREN '('
+#define RPAREN ')'
+#define LBRACK '['
+#define RBRACK ']'
+
+#define NUMCHAR "0123456789"
+#define NAMECHAR1 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+#define NAMECHARN (NAMECHAR1 NUMCHAR "_-")
/* Forward */
static int gettype(const int q0, const int q1, int* unsignedp);
+const struct LegalFormat {
+ const char* tag;
+ int format;
+} legalformats[] = {
+ {"hdf5", NC_FILTER_FORMAT_HDF5},
+ {NULL, 0},
+};
+
+const struct FilterName {
+ const char* name; /* name or alias as assigned by HDF group*/
+ unsigned int id; /* id as assigned by HDF group*/
+} known_filters[] = {
+{"zip", 2}, /* Standard zlib compression */
+{"zlib", 2}, /* alias */
+{"deflate", 2}, /* alias */
+{"szip", 4}, /* Standard szip compression */
+{"bzip2", 307}, /* BZIP2 lossless compression used by PyTables */
+{"lzf", 32000}, /* LZF lossless compression used by H5Py project */
+{"blosc", 32001}, /* Blosc lossless compression used by PyTables */
+{"mafisc", 32002}, /* Modified LZMA compression filter, MAFISC (Multidimensional Adaptive Filtering Improved Scientific data Compression) */
+{"snappy", 32003}, /* Snappy lossless compression. */
+{"lz4", 32004}, /* LZ4 fast lossless compression algorithm */
+{"apax", 32005}, /* Samplify's APAX Numerical Encoding Technology */
+{"cbf", 32006}, /* All imgCIF/CBF compressions and decompressions, including Canonical, Packed, Packed Vesrsion 2, Byte Offset and Nibble Offset. */
+{"jpeg-xr", 32007}, /* Enables images to be compressed/decompressed with JPEG-XR compression */
+{"bitshuffle", 32008}, /* Extreme version of shuffle filter that shuffles data at bit level instead of byte level. */
+{"spdp", 32009}, /* SPDP fast lossless compression algorithm for single- and double-precision floating-point data. */
+{"lpc-rice", 32010}, /* LPC-Rice multi-threaded lossless compression */
+{"ccsds-123", 32011}, /* ESA CCSDS-123 multi-threaded compression filter */
+{"jpeg-ls", 32012}, /* CharLS JPEG-LS multi-threaded compression filter */
+{"zfp", 32013}, /* Rate, accuracy or precision bounded compression for floating-point arrays */
+{"fpzip", 32014}, /* Fast and Efficient Lossy or Lossless Compressor for Floating-Point Data */
+{"zstandard", 32015}, /* Real-time compression algorithm with wide range of compression / speed trade-off and fast decoder */
+{"b3d", 32016}, /* GPU based image compression method developed for light-microscopy applications */
+{"sz", 32017}, /* An error-bounded lossy compressor for scientific floating-point data */
+{"fcidecomp", 32018}, /* EUMETSAT CharLS compression filter for use with netCDF */
+{"user-defined", 32768}, /* First user-defined filter */
+{NULL,0}
+};
+
/**************************************************/
/*
-Parse a filter spec string into a filter id + a vector
-of unsigned ints.
+Parse a filter spec string into a NC_FILTER_SPEC*
-@param spec0 - a string containing the spec as a sequence of
+@param txt - a string containing the spec as a sequence of
constants separated by commas.
-@param idp - store the parsed filter id here
-@param nparamsp - store number of parsed filter params here
-@param paramsp - store the vector of parsed filter params here
-@return 1 if parse succeeded, 0 otherwise.
+@param specp - store the parsed filter here -- caller frees
+@return NC_NOERR if parse succeeded
+@return NC_EINVAL otherwise
*/
EXTERNL int
-NC_parsefilterspec(const char* spec, unsigned int* idp, size_t* nparamsp, unsigned int** paramsp)
+NC_parsefilterspec(const char* txt, int format, NC_Filterspec** specp)
{
int stat = NC_NOERR;
int sstat; /* for scanf */
char* p;
- char* sdata = NULL;
+ char* sdata0 = NULL; /* what to free */
+ char* sdata = NULL; /* sdata0 with leading prefix skipped */
unsigned int id;
size_t count; /* no. of comma delimited params */
size_t nparams; /* final no. of unsigned ints */
@@ -54,8 +108,14 @@
unsigned int* ulist = NULL;
unsigned char mem[8];
- if(spec == NULL || strlen(spec) == 0) goto fail;
- sdata = strdup(spec);
+ if(txt == NULL) goto fail;
+ len = strlen(txt);
+ if(len == 0) goto fail;
+
+ sdata0 = (char*)calloc(1,len+1+1);
+ if(sdata0 == NULL) return 0;
+ memcpy(sdata0,txt,len);
+ sdata = sdata0;
/* Count number of parameters + id and delimit */
p=sdata;
@@ -72,11 +132,27 @@
/* Extract the filter id */
p = sdata;
- sstat = sscanf(p,"%u",&id);
- if(sstat != 1) goto fail;
+ if(strchr(NAMECHAR1,*p) != NULL) {
+ const struct FilterName* candidate = known_filters;
+ char* q = p+1;
+ while(*q && strchr(NAMECHARN,*q) != NULL) {
+ q++;
+ }
+ if(*q) goto fail; /*name has bad char*/
+ /* Lookup name */
+ id = 0; /* => not found */
+ for(;candidate->name;candidate++) {
+ if(strcasecmp(candidate->name,p)==0) {id = candidate->id; break;}
+ }
+ if(id == 0) goto fail; /* unknown name */
+ } else if(strchr(NUMCHAR,*p) != NULL) {
+ sstat = sscanf(p,"%u",&id);
+ if(sstat != 1) goto fail;
+ } else goto fail; /* unparseable id */
+ count--;
+
/* skip past the filter id */
p = p + strlen(p) + 1;
- count--;
/* Allocate the max needed space; *2 in case the params are all doubles */
ulist = (unsigned int*)malloc(sizeof(unsigned int)*(count)*2);
@@ -146,7 +222,7 @@
sstat = sscanf(p,"%lf",&vald);
if(sstat != 1) goto fail;
memcpy(mem,&vald,sizeof(mem));
- NC_filterfix8(mem,0);
+ NC4_filterfix8(mem,0);
vector = (unsigned int*)mem;
ulist[nparams++] = vector[0];
ulist[nparams++] = vector[1];
@@ -158,7 +234,7 @@
sstat = sscanf(p,"%lld",(long long*)&val64u);
if(sstat != 1) goto fail;
memcpy(mem,&val64u,sizeof(mem));
- NC_filterfix8(mem,0);
+ NC4_filterfix8(mem,0);
vector = (unsigned int*)&mem;
ulist[nparams++] = vector[0];
ulist[nparams++] = vector[1];
@@ -169,21 +245,405 @@
p = p + strlen(p) + 1; /* move to next param */
}
/* Now return results */
- if(idp) *idp = id;
- if(nparamsp) *nparamsp = nparams;
- if(paramsp) {
- *paramsp = ulist;
- ulist = NULL; /* avoid duplicate free */
+ if(specp != NULL) {
+ NC4_Filterspec* pfs = calloc(1,sizeof(NC4_Filterspec));
+ if(pfs == NULL) {stat = NC_ENOMEM; goto done;}
+ pfs->hdr.hdr.format = format;
+ pfs->filterid = id;
+ pfs->nparams = nparams;
+ pfs->params = ulist; ulist = NULL;
+ *specp = (NC_Filterspec*)pfs;
}
+
done:
if(sdata) free(sdata);
if(ulist) free(ulist);
return stat;
fail:
- stat = NC_EFILTER;
+ stat = NC_EINVAL;
goto done;
}
+/*
+Parse a string containing multiple '|' separated filter specs.
+
+@param spec0 - a string containing the list of filter specs.
+@param nspecsp - # of parsed specs
+@param specsp - pointer to hold vector of parsed specs. Caller frees
+@return NC_NOERR if parse succeeded
+@return NC_EINVAL if bad parameters or parse failed
+*/
+
+EXTERNL int
+NC_parsefilterlist(const char* txt0, int* formatp, size_t* nspecsp, NC_Filterspec*** vectorp)
+{
+ int stat = NC_NOERR;
+ int format = NC_FILTER_FORMAT_HDF5; /* default */
+ size_t len = 0;
+ size_t nspecs = 0;
+ NC4_Filterspec** vector = NULL;
+ char* spec0 = NULL; /* with prefix */
+ char* spec = NULL; /* without prefix */
+ char* p = NULL;
+ char* q = NULL;
+
+ if(txt0 == NULL) return NC_EINVAL;
+ /* Duplicate txt0 so we can modify it */
+ len = strlen(txt0);
+ if((spec = calloc(1,len+1+1)) == NULL) return NC_ENOMEM;
+ memcpy(spec,txt0,len); /* Note double ending nul */
+ spec0 = spec; /* Save for later free */
+
+ /* See if there is a prefix '[format]' tag */
+ if(spec[0] == LBRACK) {
+ int found = 0;
+ const struct LegalFormat* candidates = legalformats;
+ p = spec + 1;
+ q = strchr(p,RBRACK);
+ if(q == NULL) {stat = NC_EINVAL; goto done;}
+ *q++ = '\0'; /* delimit tag */
+ while(candidates->tag != NULL) {
+ if(strcasecmp(p,candidates->tag) == 0) {
+ found = 1;
+ format = candidates->format;
+ }
+ }
+ if(found == 0) {stat = NC_EINVAL; goto done;}
+ spec = q; /* skip tag wrt later processing */
+ }
+ if(formatp) *formatp = format;
+
+ if(format != NC_FILTER_FORMAT_HDF5) {stat = NC_EINVAL; goto done;} /* for now */
+
+ /* pass 1: count number of specs */
+ p = spec;
+ nspecs = 0;
+ while(*p) {
+ q = strchr(p,'|');
+ if(q == NULL) q = p + strlen(p); /* fake it */
+ nspecs++;
+ p = q + 1;
+ }
+ if(nspecs > 0) {
+ int count = 0;
+ if((vector = (NC4_Filterspec**)malloc(sizeof(NC4_Filterspec*)*nspecs)) == NULL)
+ {stat = NC_ENOMEM; goto done;}
+ /* pass 2: parse */
+ p = spec;
+ for(count=0;countparams) free(nfs->params);
+ nullfree(nfs);
+ }
+ free(vector);
+ }
+ return stat;
+}
+
+EXTERNL void
+NC4_filterfix8(unsigned char* mem, int decode)
+{
+#ifdef WORDS_BIGENDIAN
+ if(decode) { /* Apply inverse of the encode case */
+ byteswap4(mem); /* step 1: byte-swap each piece */
+ byteswap4(mem+4);
+ byteswap8(mem); /* step 2: convert to little endian format */
+ } else { /* encode */
+ byteswap8(mem); /* step 1: convert to little endian format */
+ byteswap4(mem); /* step 2: byte-swap each piece */
+ byteswap4(mem+4);
+ }
+#else /* Little endian */
+ /* No action is necessary */
+#endif
+}
+
+
+/* Support direct user defined filters */
+
+/* Use void* to avoid having to include hdf.h*/
+EXTERNL int
+nc_filter_client_register(unsigned int id, void* info)
+{
+ int stat = NC_NOERR;
+ if(id == 0 ||info == NULL)
+ return NC_EINVAL;
+#ifdef USE_HDF5
+ NC_FILTER_OBJ_HDF5 client;
+ memset(&client,0,sizeof(client));
+ client.hdr.format = NC_FILTER_FORMAT_HDF5;
+ client.sort = NC_FILTER_SORT_CLIENT;
+ client.u.client.id = id;
+ client.u.client.info = info;
+ /* Note use of a global function, not part of the dispatch table */
+ stat = nc4_global_filter_action(NCFILTER_CLIENT_REG, id, &client);
+#else
+ stat = NC_ENOTBUILT;
+#endif
+ return stat;
+}
+
+EXTERNL int
+nc_filter_client_unregister(unsigned int id)
+{
+ int stat = NC_NOERR;
+#ifdef USE_HDF5
+ stat = nc4_global_filter_action(NCFILTER_CLIENT_UNREG, id, NULL);
+#else
+ stat = NC_ENOTBUILT;
+#endif
+ return stat;
+}
+
+/* Use void* to avoid having to include hdf.h*/
+EXTERNL int
+nc_filter_client_inq(unsigned int id, void* infop)
+{
+ int stat = NC_NOERR;
+#ifdef USE_HDF5
+ H5Z_class2_t* hct = (H5Z_class2_t*)infop;
+ NC_FILTER_OBJ_HDF5 client;
+ if(id == 0 ||infop == NULL)
+ return NC_EINVAL;
+ memset(&client,0,sizeof(client));
+ client.hdr.format = NC_FILTER_FORMAT_HDF5;
+ client.sort = NC_FILTER_SORT_CLIENT;
+ client.u.client.id = id;
+ client.u.client.info = hct;
+ /* Note use of a global function, not part of the dispatch table */
+ stat = nc4_global_filter_action(NCFILTER_CLIENT_INQ, id, &client);
+ if(stat == NC_NOERR) {
+ *hct = *(H5Z_class2_t*)client.u.client.info;
+ }
+#else
+ stat = NC_ENOTBUILT;
+#endif
+ return stat;
+}
+
+/**
+Find the set of filters (if any) associated with a variable.
+
+\param ncid NetCDF or group ID, from a previous call to nc_open(),
+nc_create(), nc_def_grp(), or associated inquiry functions such as
+nc_inq_ncid().
+
+\param varid Variable ID
+\param nfilters return no. of filters
+\param ids return the filter ids (caller allocates)
+
+\returns ::NC_NOERR No error.
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
+\returns ::NC_EBADID Bad ncid.
+\returns ::NC_ENOTVAR Invalid variable ID.
+\returns ::NC_EINVAL Invalid arguments
+\ingroup variables
+\author Dennis Heimbigner
+*/
+EXTERNL int
+nc_inq_var_filterids(int ncid, int varid, size_t* nfiltersp, unsigned int* ids)
+{
+ NC* ncp;
+ int stat = NC_check_id(ncid,&ncp);
+ NC_FILTER_OBJ_HDF5 ncids;
+
+ if(stat != NC_NOERR) return stat;
+ TRACE(nc_inq_var_filterids);
+
+ memset(&ncids,0,sizeof(ncids));
+ ncids.hdr.format = NC_FILTER_FORMAT_HDF5;
+ ncids.sort = NC_FILTER_SORT_IDS;
+ ncids.u.ids.nfilters = (nfiltersp?*nfiltersp:0);
+ ncids.u.ids.filterids = ids;
+
+ if((stat = ncp->dispatch->filter_actions(ncid,varid, NCFILTER_FILTERIDS, (NC_Filterobject*)&ncids)) == NC_NOERR) {
+ if(nfiltersp) *nfiltersp = ncids.u.ids.nfilters;
+ }
+ return stat;
+ }
+
+/**
+Find the the param info about filter (if any)
+associated with a variable and with specified id.
+
+This is a wrapper for nc_inq_var_all().
+
+\param ncid NetCDF or group ID, from a previous call to nc_open(),
+nc_create(), nc_def_grp(), or associated inquiry functions such as
+nc_inq_ncid().
+
+\param varid Variable ID
+\param id The filter id of interest
+\param formatp (Out) Storage for the filter format
+\param nparamsp (Out) Storage which will get the number of parameters to the filter
+\param params (Out) Storage which will get associated parameters.
+Note: the caller must allocate and free.
+
+\returns ::NC_NOERR No error.
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
+\returns ::NC_EBADID Bad ncid.
+\returns ::NC_ENOTVAR Invalid variable ID.
+\returns ::NC_ENOFILTER No filter defined.
+\ingroup variables
+\author Dennis Heimbigner
+*/
+EXTERNL int
+nc_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparamsp, unsigned int* params)
+{
+ NC* ncp;
+ int stat = NC_check_id(ncid,&ncp);
+ NC_FILTER_OBJ_HDF5 spec;
+
+ if(stat != NC_NOERR) return stat;
+ TRACE(nc_inq_var_filter_info_hdf5);
+
+ memset(&spec,0,sizeof(spec));
+ spec.hdr.format = NC_FILTER_FORMAT_HDF5;
+ spec.sort = NC_FILTER_SORT_SPEC;
+ spec.u.spec.filterid = id;
+ spec.u.spec.nparams = (nparamsp?*nparamsp:0);
+ spec.u.spec.params = params;
+
+ if((stat = ncp->dispatch->filter_actions(ncid,varid,NCFILTER_INFO,(NC_Filterobject*)&spec)) == NC_NOERR) {
+ if(nparamsp) *nparamsp = spec.u.spec.nparams;
+ }
+ return stat;
+}
+
+/**
+Find the first filter (if any) associated with a variable.
+
+\param ncid NetCDF or group ID, from a previous call to nc_open(),
+nc_create(), nc_def_grp(), or associated inquiry functions such as
+nc_inq_ncid().
+
+\param varid Variable ID
+
+\param idp Storage which will get the filter id; a return value of zero means no filter
+
+\param nparamsp Storage which will get the number of parameters to the
+filter
+
+\param params Storage which will get associated parameters.
+Note: the caller must allocate and free.
+
+\returns ::NC_NOERR No error.
+\returns ::NC_ENOTNC4 Not a netCDF-4 file.
+\returns ::NC_EBADID Bad ncid.
+\returns ::NC_ENOTVAR Invalid variable ID.
+\returns ::NC_ENOFILTER No filter defined.
+\ingroup variables
+\author Dennis Heimbigner
+*/
+EXTERNL int
+nc_inq_var_filter(int ncid, int varid, unsigned int* idp, size_t* nparamsp, unsigned int* params)
+{
+ NC* ncp;
+ NC_FILTER_OBJ_HDF5 spec;
+ int stat = NC_check_id(ncid,&ncp);
+
+ if(stat != NC_NOERR) return stat;
+ TRACE(nc_inq_var_filter);
+
+ memset(&spec,0,sizeof(spec));
+ spec.hdr.format = NC_FILTER_FORMAT_HDF5;
+ spec.sort = NC_FILTER_SORT_SPEC;
+ spec.u.spec.filterid = (idp?*idp:0);
+ spec.u.spec.nparams = (nparamsp?*nparamsp:0);
+ spec.u.spec.params = params;
+
+ if((stat=ncp->dispatch->filter_actions(ncid,varid,NCFILTER_INQ,(NC_Filterobject*)&spec)))
+ return stat;
+ if(idp) *idp = spec.u.spec.filterid;
+ if(nparamsp) *nparamsp = spec.u.spec.nparams;
+ return stat;
+}
+
+/**
+ Define a new variable hdf5 filter.
+
+ Only variables with chunked storage can use filters.
+
+ @param ncid File and group ID.
+ @param varid Variable ID.
+ @param id Filter ID.
+ @param nparams Number of filter parameters.
+ @param parms Filter parameters.
+
+ @return ::NC_NOERR No error.
+ @return ::NC_EINVAL Variable must be chunked.
+ @return ::NC_EBADID Bad ID.
+ @author Dennis Heimbigner
+*/
+
+EXTERNL int
+nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int* params)
+{
+ NC* ncp;
+ NC_FILTER_OBJ_HDF5 spec;
+ int stat = NC_check_id(ncid,&ncp);
+
+ if(stat != NC_NOERR) return stat;
+ TRACE(nc_def_var_filter_hdf5);
+
+ memset(&spec,0,sizeof(spec));
+ spec.hdr.format = NC_FILTER_FORMAT_HDF5;
+ spec.sort = NC_FILTER_SORT_SPEC;
+ spec.u.spec.filterid = id;
+ spec.u.spec.nparams = nparams;
+ spec.u.spec.params = (unsigned int*)params; /* discard const */
+ return ncp->dispatch->filter_actions(ncid,varid,NCFILTER_DEF,(NC_Filterobject*)&spec);
+}
+
+/**
+ Remove all filters with specified id from a variable
+
+ @param ncid File and group ID.
+ @param varid Variable ID.
+ @param id filter to remove
+
+ @return ::NC_NOERR No error.
+ @return ::NC_EBADID Bad ID.
+ @author Dennis Heimbigner
+*/
+EXTERNL int
+nc_var_filter_remove(int ncid, int varid, unsigned int id)
+{
+ NC* ncp;
+ int stat = NC_check_id(ncid,&ncp);
+ NC_FILTER_OBJ_HDF5 spec;
+
+ if(stat != NC_NOERR) return stat;
+ TRACE(nc_var_filter_hdf5_remove);
+
+ memset(&spec,0,sizeof(spec));
+ spec.hdr.format = NC_FILTER_FORMAT_HDF5;
+ spec.sort = NC_FILTER_SORT_SPEC;
+ spec.u.spec.filterid = id;
+ return ncp->dispatch->filter_actions(ncid,varid,NCFILTER_REMOVE,(NC_Filterobject*)&spec);
+}
+
+/**************************************************/
+/* Utilities */
+
/* Look at q0 and q1) to determine type */
static int
gettype(const int q0, const int q1, int* isunsignedp)
@@ -249,79 +709,4 @@
}
#endif
-EXTERNL void
-NC_filterfix8(unsigned char* mem, int decode)
-{
-#ifdef WORDS_BIGENDIAN
- if(decode) { /* Apply inverse of the encode case */
- byteswap4(mem); /* step 1: byte-swap each piece */
- byteswap4(mem+4);
- byteswap8(mem); /* step 2: convert to little endian format */
- } else { /* encode */
- byteswap8(mem); /* step 1: convert to little endian format */
- byteswap4(mem); /* step 2: byte-swap each piece */
- byteswap4(mem+4);
- }
-#else /* Little endian */
- /* No action is necessary */
-#endif
-}
-
-/**************************************************/
-/* Support direct user defined filters */
-
-EXTERNL int
-nc_filter_register(NC_FILTER_INFO* filter)
-{
- int stat = NC_NOERR;
- if(filter == NULL)
- return NC_EINVAL;
- switch (filter->format) {
- case NC_FILTER_FORMAT_HDF5:
-#ifdef USE_HDF5
- stat = nc4_filter_action(FILTER_REG, filter->format, filter->id, filter);
-#else
- stat = NC_ENOTBUILT;
-#endif
- break;
- default:
- stat = NC_EINVAL;
- }
- return stat;
-}
-
-EXTERNL int
-nc_filter_unregister(int fformat, int id)
-{
- int stat = NC_NOERR;
- switch (fformat) {
- case NC_FILTER_FORMAT_HDF5:
-#ifdef USE_HDF5
- stat = nc4_filter_action(FILTER_UNREG, fformat, id, NULL);
-#else
- stat = NC_ENOTBUILT;
-#endif
- break;
- default:
- stat = NC_EINVAL;
- }
- return stat;
-}
-EXTERNL int
-nc_filter_inq(int fformat, int id, NC_FILTER_INFO* filter_info)
-{
- int stat = NC_NOERR;
- switch (fformat) {
- case NC_FILTER_FORMAT_HDF5:
-#ifdef USE_HDF5
- stat = nc4_filter_action(FILTER_INQ, fformat, id, filter_info);
-#else
- stat = NC_ENOTBUILT;
-#endif
- break;
- default:
- stat = NC_EINVAL;
- }
- return stat;
-}
diff -Nru netcdf-parallel-4.7.3/libdispatch/dhttp.c netcdf-parallel-4.7.4/libdispatch/dhttp.c
--- netcdf-parallel-4.7.3/libdispatch/dhttp.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dhttp.c 2020-08-31 10:33:26.000000000 +0000
@@ -263,6 +263,8 @@
if (cstat != CURLE_OK) goto fail;
cstat = CURLERR(curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1));
if (cstat != CURLE_OK) goto fail;
+ cstat = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
+ if (cstat != CURLE_OK) goto fail;
if(buf != NULL) {
/* send all data to this function */
diff -Nru netcdf-parallel-4.7.3/libdispatch/dnotnc4.c netcdf-parallel-4.7.4/libdispatch/dnotnc4.c
--- netcdf-parallel-4.7.3/libdispatch/dnotnc4.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dnotnc4.c 2020-08-31 10:33:26.000000000 +0000
@@ -8,7 +8,10 @@
* @author Ed Hartnett
*/
+#include "netcdf.h"
+#include "netcdf_filter.h"
#include "ncdispatch.h"
+#include "nc4internal.h"
/**
* @internal Not allowed for classic model.
@@ -610,3 +613,19 @@
{
return NC_ENOTNC4;
}
+
+/**
+ * @internal Carry out one of several filter actions
+ *
+ * @param ncid Containing group id
+ * @param varid Containing variable id
+ * @param action Action to perform
+ *
+ * @return ::NC_ENOTNC4 Not allowed for classic model.
+ * @author D. Heimbigner
+ */
+int
+NC_NOTNC4_filter_actions(int ncid, int varid, int action, struct NC_Filterobject* spec)
+{
+ return NC_ENOTNC4;
+}
diff -Nru netcdf-parallel-4.7.3/libdispatch/dparallel.c netcdf-parallel-4.7.4/libdispatch/dparallel.c
--- netcdf-parallel-4.7.3/libdispatch/dparallel.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dparallel.c 2020-08-31 10:33:26.000000000 +0000
@@ -289,42 +289,58 @@
#endif
}
-/**\ingroup datasets
+/**
+ @ingroup datasets
-This function will change the parallel access of a variable from independent to
-collective and vice versa. Note when file is opened/created to use PnetCDF
-library to perform parallel I/O underneath, argument varid is ignored and the
-mode changed by this function applies to all variables. This is because PnetCDF
-does not support access mode change for individual variables. In this case,
-users may use NC_GLOBAL in varid argument for better program readability. This
-function is collective, i.e. must be called by all MPI processes defined in the
-MPI communicator used in nc_create_par() or nc_open_par(). In addition, values
-of arguments of this function must be the same among all MPI processes.
-
-To obtain a good I/O performance, users are recommended to use collective mode.
-In addition, switching between collective and independent I/O mode can be
-expensive.
-
-\param ncid NetCDF or group ID, from a previous call to nc_open_par(),
-nc_create_par(), nc_def_grp(), or associated inquiry functions such as
-nc_inq_ncid().
-
-\param varid Variable ID
-
-\param par_access NC_COLLECTIVE or NC_INDEPENDENT.
-
-\returns ::NC_NOERR No error.
-\returns ::NC_EBADID Invalid ncid passed.
-\returns ::NC_ENOTVAR Invalid varid passed.
-\returns ::NC_ENOPAR File was not opened with nc_open_par/nc_create_var.
-\returns ::NC_EINVAL Invalid par_access specified.
+ This function will change the parallel access of a variable from
+ independent to collective and vice versa.
-
Example
+ This function is collective, i.e. must be called by all MPI
+ processes defined in the MPI communicator used in nc_create_par()
+ or nc_open_par(). In addition, values of arguments of this function
+ must be the same among all MPI processes.
+
+ To obtain a good I/O performance, users are recommended to use
+ collective mode. In addition, switching between collective and
+ independent I/O mode can be expensive.
+
+ In netcdf-c-4.7.4 or later, using hdf5-1.10.2 or later, the zlib,
+ szip, fletcher32, and other filters may be used when writing data
+ with parallel I/O. The use of these filters require collective
+ access. Turning on the zlib (deflate) or fletcher32 filter for a
+ variable will automatically set its access to collective if the
+ file has been opened for parallel I/O. Attempts to set access to
+ independent will return ::NC_EINVAL.
+
+ @note When the library is build with --enable-pnetcdf, and when
+ file is opened/created to use PnetCDF library to perform parallel
+ I/O underneath, argument varid is ignored and the mode changed by
+ this function applies to all variables. This is because PnetCDF
+ does not support access mode change for individual variables. In
+ this case, users may use NC_GLOBAL in varid argument for better
+ program readability.
+
+ @param ncid NetCDF or group ID, from a previous call to
+ nc_open_par(), nc_create_par(), nc_def_grp(), or associated inquiry
+ functions such as nc_inq_ncid().
+
+ @param varid Variable ID
+
+ @param par_access NC_COLLECTIVE or NC_INDEPENDENT.
+
+ @return ::NC_NOERR No error.
+ @return ::NC_EBADID Invalid ncid passed.
+ @return ::NC_ENOTVAR Invalid varid passed.
+ @return ::NC_ENOPAR File was not opened with nc_open_par/nc_create_var.
+ @return ::NC_EINVAL Invalid par_access specified, or attempt to set
+ filtered variable to independent access.
-Here is an example from examples/C/parallel_vara.c which changes the
-parallel access of a variable and then writes to it.
+
Example
-\code
+ Here is an example from examples/C/parallel_vara.c which changes
+ the parallel access of a variable and then writes to it.
+
+@code
#define NY 10
#define NX 4
@@ -358,10 +374,9 @@
err = nc_put_vara_int(ncid, varid, start, count, &buf[0][0]); ERR
-\endcode
-\author Ed Hartnett, Dennis Heimbigner
-\ingroup datasets
- */
+@endcode
+@author Ed Hartnett, Dennis Heimbigner
+*/
int
nc_var_par_access(int ncid, int varid, int par_access)
{
diff -Nru netcdf-parallel-4.7.3/libdispatch/dutil.c netcdf-parallel-4.7.4/libdispatch/dutil.c
--- netcdf-parallel-4.7.3/libdispatch/dutil.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dutil.c 2020-08-31 10:33:26.000000000 +0000
@@ -348,6 +348,6 @@
}
done:
- nclistfree(modelist);
+ nclistfreeall(modelist);
return found;
}
diff -Nru netcdf-parallel-4.7.3/libdispatch/dvar.c netcdf-parallel-4.7.4/libdispatch/dvar.c
--- netcdf-parallel-4.7.3/libdispatch/dvar.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dvar.c 2020-08-31 10:33:26.000000000 +0000
@@ -6,8 +6,13 @@
* order of functions in this file affects the doxygen documentation.
*/
+#include "config.h"
+#include "netcdf.h"
+#include "netcdf_filter.h"
#include "ncdispatch.h"
+#include "nc4internal.h"
#include "netcdf_f.h"
+#include "nc4internal.h"
/**
@defgroup variables Variables
@@ -312,7 +317,7 @@
}
/**
- Set the compression settings for a netCDF-4/HDF5 variable.
+ Set the zlib compression settings for a netCDF-4/HDF5 variable.
This function must be called after nc_def_var and before nc_enddef
or any functions which writes data to the file.
@@ -322,17 +327,28 @@
to chunked data, with default chunksizes. Use nc_def_var_chunking()
to tune performance with user-defined chunksizes.
- If this function is called on a scalar variable, it is ignored.
+ If this function is called on a scalar variable, ::NC_EINVAL is
+ returned. Only chunked variables may use filters.
+
+ If this function is called on a variable which already has szip
+ compression turned on, ::NC_EINVAL is returned.
+
+ @note Parallel I/O reads work with compressed data. Parallel I/O
+ writes work with compressed data in netcdf-c-4.7.4 and later
+ releases, using hdf5-1.10.3 and later releases. Using the zlib,
+ shuffle (or any other) filter requires that collective access be
+ used with the variable. Turning on deflate and/or shuffle for a
+ variable in a file opened for parallel I/O will automatically
+ switch the access for that variable to collective access.
@param ncid NetCDF or group ID, from a previous call to nc_open(),
nc_create(), nc_def_grp(), or associated inquiry functions such as
nc_inq_ncid().
@param varid Variable ID
@param shuffle True to turn on the shuffle filter. The shuffle
- filter can assist with the compression of integer data by changing
- the byte order in the data stream. It makes no sense to use the
- shuffle filter without setting a deflate level, or to use shuffle
- on non-integer data.
+ filter can assist with the compression of data by changing the byte
+ order in the data stream. It makes no sense to use the shuffle
+ filter without setting a deflate level.
@param deflate True to turn on deflation for this variable.
@param deflate_level A number between 0 (no compression) and 9
(maximum compression).
@@ -347,11 +363,8 @@
@return ::NC_ELATEDEF Too late to change settings for this variable.
@return ::NC_ENOTINDEFINE Not in define mode.
@return ::NC_EPERM File is read only.
- @return ::NC_EMAXDIMS Classic model file exceeds ::NC_MAX_VAR_DIMS.
@return ::NC_ESTRICTNC3 Attempting to create netCDF-4 type var in
classic model file
- @return ::NC_EBADTYPE Bad type.
- @return ::NC_ENOMEM Out of memory.
@return ::NC_EHDFERR Error returned by HDF5 layer.
@return ::NC_EINVAL Invalid input. Deflate can't be set unless
variable storage is NC_CHUNK.
@@ -422,6 +435,14 @@
data, with default chunksizes. Use nc_def_var_chunking() to tune
performance with user-defined chunksizes.
+ @note Parallel I/O reads work with fletcher32 encoded
+ data. Parallel I/O writes work with fletcher32 in netcdf-c-4.7.4
+ and later releases, using hdf5-1.10.2 and later releases. Using the
+ fletcher32 (or any) filter requires that collective access be used
+ with the variable. Turning on fletcher32 for a variable in a file
+ opened for parallel I/O will automatically switch the access for
+ that variable to collective access.
+
@param ncid NetCDF or group ID, from a previous call to nc_open(),
nc_create(), nc_def_grp(), or associated inquiry functions such as
nc_inq_ncid().
@@ -450,11 +471,25 @@
}
/**
- Define chunking parameters for a variable
+ Define storage and, if chunked storage is used, chunking parameters
+ for a variable
- The function nc_def_var_chunking sets the chunking parameters for a
- variable in a netCDF-4 file. It can set the chunk sizes to get chunked
- storage, or it can set the contiguous flag to get contiguous storage.
+ The storage may be set to NC_CONTIGUOUS, NC_COMPACT, or NC_CHUNKED.
+
+ Contiguous storage means the variable is stored as one block of
+ data in the file. This is the default storage.
+
+ Compact storage means the variable is stored in the header record
+ of the file. This can have large performance benefits on HPC system
+ running many processors. Compact storage is only available for
+ variables whose data are 64 KB or less. Attempting to turn on
+ compact storage for a variable that is too large will result in the
+ ::NC_EVARSIZE error.
+
+ Chunked storage means the data are stored as chunks, of
+ user-configurable size. Chunked storage is required for variable
+ with one or more unlimted dimensions, or variable which use
+ compression, or any other filter.
The total size of a chunk must be less than 4 GiB. That is, the
product of all chunksizes and the size of the data (or the size of
@@ -464,35 +499,35 @@
before nc_enddef is called. Once the chunking parameters are set for a
variable, they cannot be changed.
- Note that this does not work for scalar variables. Only non-scalar
- variables can have chunking.
-
- @param[in] ncid NetCDF ID, from a previous call to nc_open or
- nc_create.
-
- @param[in] varid Variable ID.
+ @note Scalar variables may have a storage of NC_CONTIGUOUS or
+ NC_COMPACT. Attempts to set chunking on a scalare variable will
+ cause ::NC_EINVEL to be returned. Only non-scalar variables can
+ have chunking.
- @param[in] storage If ::NC_CONTIGUOUS, then contiguous storage is used
- for this variable. Variables with one or more unlimited dimensions
- cannot use contiguous storage. If contiguous storage is turned on, the
- chunksizes parameter is ignored. If ::NC_CHUNKED, then chunked storage
- is used for this variable. Chunk sizes may be specified with the
- chunksizes parameter or default sizes will be used if that parameter
- is NULL.
-
- @param[in] chunksizesp A pointer to an array list of chunk sizes. The
+ @param ncid NetCDF ID, from a previous call to nc_open() or
+ nc_create().
+ @param varid Variable ID.
+ @param storage If ::NC_CONTIGUOUS or ::NC_COMPACT, then contiguous
+ or compact storage is used for this variable. Variables with one or
+ more unlimited dimensions cannot use contiguous or compact
+ storage. If contiguous or compact storage is turned on, the
+ chunksizes parameter is ignored. If ::NC_CHUNKED, then chunked
+ storage is used for this variable. Chunk sizes may be specified
+ with the chunksizes parameter or default sizes will be used if that
+ parameter is NULL.
+ @param chunksizesp A pointer to an array list of chunk sizes. The
array must have one chunksize for each dimension of the variable. If
::NC_CONTIGUOUS storage is set, then the chunksizes parameter is
- ignored.
+ ignored. Ignored if NULL.
@return ::NC_NOERR No error.
@return ::NC_EBADID Bad ID.
@return ::NC_ENOTNC4 Not a netCDF-4 file.
- @return ::NC_ELATEDEF This variable has already been the subject of a
- nc_enddef call. In netCDF-4 files nc_enddef will be called
+ @return ::NC_ELATEDEF This variable has already been the subject of
+ a nc_enddef call. In netCDF-4 files nc_enddef will be called
automatically for any data read or write. Once nc_enddef has been
- called after the nc_def_var call for a variable, it is impossible to
- set the chunking for that variable.
+ called after the nc_def_var call for a variable, it is impossible
+ to set the chunking for that variable.
@return ::NC_ENOTINDEFINE Not in define mode. This is returned for
netCDF classic or 64-bit offset files, or for netCDF-4 files, when
they wwere created with ::NC_CLASSIC_MODEL flag by nc_create().
@@ -500,6 +535,11 @@
@return ::NC_EBADCHUNK Returns if the chunk size specified for a
variable is larger than the length of the dimensions associated with
variable.
+ @return ::NC_EVARSIZE Compact storage attempted for variable bigger
+ than 64 KB.
+ @return ::NC_EINVAL Attempt to set contiguous or compact storage
+ for var with one or more unlimited dimensions, or chunking for a
+ scalar var.
@section nc_def_var_chunking_example Example
@@ -539,10 +579,10 @@
if (chunksize[d] != chunksize_in[d]) ERR;
if (storage_in != NC_CHUNKED) ERR;
@endcode
+ @author Ed Hartnett, Dennis Heimbigner
*/
int
-nc_def_var_chunking(int ncid, int varid, int storage,
- const size_t *chunksizesp)
+nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp)
{
NC* ncp;
int stat = NC_check_id(ncid, &ncp);
@@ -629,26 +669,67 @@
}
/**
- Define a new variable filter.
-
- @param ncid File and group ID.
- @param varid Variable ID.
- @param id
- @param nparams Number of filter parameters.
- @param parms Filter parameters.
-
- @return ::NC_NOERR No error.
- @return ::NC_EBADID Bad ID.
- @author Dennis Heimbigner
-*/
+ * Set szip compression settings on a variable. Szip is an
+ * implementation of the extended-Rice lossless compression algorithm;
+ * it is reported to provide fast and effective compression. Szip is
+ * only available to netCDF if HDF5 was built with szip support.
+ *
+ * SZIP compression cannot be applied to variables with any
+ * user-defined type.
+ *
+ * If zlib compression has already be turned on for a variable, then
+ * this function will return ::NC_EINVAL.
+ *
+ * To learn the szip settings for a variable, use nc_inq_var_szip().
+ *
+ * @note The options_mask parameter may be either NC_SZIP_EC (entropy
+ * coding) or NC_SZIP_NN (nearest neighbor):
+ * * The entropy coding method is best suited for data that has been
+ * processed. The EC method works best for small numbers.
+ * * The nearest neighbor coding method preprocesses the data then the
+ * applies EC method as above.
+ *
+ * For more information about HDF5 and szip, see
+ * https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip
+ * and
+ * https://support.hdfgroup.org/doc_resource/SZIP/index.html.
+ *
+ * @param ncid File ID.
+ * @param varid Variable ID.
+ * @param options_mask The options mask. Can be NC_SZIP_EC or
+ * NC_SZIP_NN.
+ * @param pixels_per_block Pixels per block. Must be even and not
+ * greater than 32, with typical values being 8, 10, 16, or 32. This
+ * parameter affects compression ratio; the more pixel values vary,
+ * the smaller this number should be to achieve better performance. If
+ * pixels_per_block is bigger than the total number of elements in a
+ * dataset chunk, ::NC_EINVAL will be returned.
+ *
+ * @returns ::NC_NOERR No error.
+ * @returns ::NC_EBADID Bad ncid.
+ * @returns ::NC_ENOTVAR Invalid variable ID.
+ * @returns ::NC_ENOTNC4 Attempting netcdf-4 operation on file that is
+ * not netCDF-4/HDF5.
+ * @returns ::NC_ELATEDEF Too late to change settings for this variable.
+ * @returns ::NC_ENOTINDEFINE Not in define mode.
+ * @returns ::NC_EINVAL Invalid input, or zlib filter already applied
+ * to this var.
+ * @author Ed Hartnett
+ */
int
-nc_def_var_filter(int ncid, int varid, unsigned int id,
- size_t nparams, const unsigned int* parms)
+nc_def_var_szip(int ncid, int varid, int options_mask, int pixels_per_block)
{
- NC* ncp;
- int stat = NC_check_id(ncid,&ncp);
- if(stat != NC_NOERR) return stat;
- return ncp->dispatch->def_var_filter(ncid,varid,id,nparams,parms);
+ int ret;
+
+ /* This will cause H5Pset_szip to be called when the var is
+ * created. */
+ unsigned int params[2];
+ params[0] = options_mask;
+ params[1] = pixels_per_block;
+ if ((ret = nc_def_var_filter(ncid, varid, HDF5_FILTER_SZIP, 2, params)))
+ return ret;
+
+ return NC_NOERR;
}
/** @} */
@@ -1107,6 +1188,12 @@
until the file is closed. Once re-opened, the variable chunk cache
returns to its default value.
+ Current cache settings for each var may be obtained with
+ nc_get_var_chunk_cache().
+
+ Default values for these settings may be changed for the whole file
+ with nc_set_chunk_cache().
+
@param ncid NetCDF or group ID, from a previous call to nc_open(),
nc_create(), nc_def_grp(), or associated inquiry functions such as
nc_inq_ncid().
@@ -1168,7 +1255,10 @@
}
/**
- Get the per-variable chunk cache settings from the HDF5 layer.
+ Get the per-variable chunk cache settings from the HDF5
+ layer. These settings may be changed with nc_set_var_chunk_cache().
+
+ See nc_set_chunk_cache() for a full discussion of these settings.
@param ncid NetCDF or group ID, from a previous call to nc_open(),
nc_create(), nc_def_grp(), or associated inquiry functions such as
diff -Nru netcdf-parallel-4.7.3/libdispatch/dvarget.c netcdf-parallel-4.7.4/libdispatch/dvarget.c
--- netcdf-parallel-4.7.3/libdispatch/dvarget.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dvarget.c 2020-08-31 10:33:26.000000000 +0000
@@ -226,11 +226,8 @@
/* illegal value checks */
dimlen = (i == 0 && isrecvar ? numrecs : varshape[i]);
/* mystart is unsigned, never < 0 */
-#ifdef RELAX_COORD_BOUND
if (mystart[i] > dimlen) return NC_EINVALCOORDS;
-#else
- if (mystart[i] >= dimlen) return NC_EINVALCOORDS;
-#endif
+
if(edges == NULL) {
if(i == 0 && isrecvar)
myedges[i] = numrecs - start[i];
@@ -238,9 +235,9 @@
myedges[i] = varshape[i] - mystart[i];
} else
myedges[i] = edges[i];
-#ifdef RELAX_COORD_BOUND
+
if (mystart[i] == dimlen && myedges[i] > 0) return NC_EINVALCOORDS;
-#endif
+
/* myedges is unsigned, never < 0 */
if(mystart[i] + myedges[i] > dimlen)
return NC_EEDGE;
@@ -416,11 +413,7 @@
? start[idim]
: 0;
-#ifdef RELAX_COORD_BOUND
if (mystart[idim] > dimlen)
-#else
- if (mystart[idim] >= dimlen)
-#endif
{
status = NC_EINVALCOORDS;
goto done;
@@ -441,13 +434,11 @@
myedges[idim] = varshape[idim] - mystart[idim];
#endif
-#ifdef RELAX_COORD_BOUND
if (mystart[idim] == dimlen && myedges[idim] > 0)
{
status = NC_EINVALCOORDS;
goto done;
}
-#endif
if (mystart[idim] + myedges[idim] > dimlen)
{
diff -Nru netcdf-parallel-4.7.3/libdispatch/dvarinq.c netcdf-parallel-4.7.4/libdispatch/dvarinq.c
--- netcdf-parallel-4.7.3/libdispatch/dvarinq.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dvarinq.c 2020-08-31 10:33:26.000000000 +0000
@@ -6,16 +6,14 @@
*/
#include "config.h"
+#include "netcdf.h"
+#include "netcdf_filter.h"
#include "ncdispatch.h"
+#include "nc4internal.h"
#ifdef USE_HDF5
#include
#endif /* USE_HDF5 */
-#ifndef H5Z_FILTER_SZIP
-/** ID of HDF SZIP filter. */
-#define H5Z_FILTER_SZIP 4
-#endif
-
/** \name Learning about Variables
Functions to learn about the variables in a file. */
@@ -260,8 +258,6 @@
/** \ingroup variables
Learn the storage and deflate settings for a variable.
-This is a wrapper for nc_inq_var_all().
-
\param ncid NetCDF or group ID, from a previous call to nc_open(),
nc_create(), nc_def_grp(), or associated inquiry functions such as
nc_inq_ncid().
@@ -276,21 +272,46 @@
variable, and a 0 otherwise. \ref ignored_if_null.
\param deflate_levelp If the deflate filter is in use for this
-variable, the deflate_level will be written here. \ref ignored_if_null.
+variable, the deflate_level will be written here. If deflate is not in
+use, and deflate_levelp is provided, it will get a zero. (This
+behavior is expected by the Fortran APIs). \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTVAR Invalid variable ID.
+\author Ed Hartnett, Dennis Heimbigner
*/
int
-nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep,
- int *deflate_levelp)
+nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp)
{
NC* ncp;
+ size_t nparams;
+ unsigned int params[4];
+ int deflating = 0;
+
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
TRACE(nc_inq_var_deflate);
+
+ /* Verify id and nparams */
+ stat = nc_inq_var_filter_info(ncid,varid,H5Z_FILTER_DEFLATE,&nparams,params);
+ switch (stat) {
+ case NC_ENOFILTER: deflating = 0; stat = NC_NOERR; break;
+ case NC_NOERR: deflating = 1; break;
+ default: return stat;
+ }
+ if(deflatep) *deflatep = deflating;
+ if(deflating) {
+ if(nparams != 1)
+ return NC_EFILTER; /* bad # params */
+ /* Param[0] should be level */
+ if(deflate_levelp) *deflate_levelp = (int)params[0];
+ } else if (deflate_levelp)
+ *deflate_levelp = 0;
+ /* also get the shuffle state */
+ if(!shufflep)
+ return NC_NOERR;
return ncp->dispatch->inq_var_all(
ncid, varid,
NULL, /*name*/
@@ -299,15 +320,15 @@
NULL, /*dimidsp*/
NULL, /*nattsp*/
shufflep, /*shufflep*/
- deflatep, /*deflatep*/
- deflate_levelp, /*deflatelevelp*/
+ NULL, /*deflatep*/
+ NULL, /*deflatelevelp*/
NULL, /*fletcher32p*/
NULL, /*contiguousp*/
NULL, /*chunksizep*/
NULL, /*nofillp*/
NULL, /*fillvaluep*/
NULL, /*endianp*/
- NULL,NULL,NULL
+ NULL, NULL, NULL
);
}
@@ -358,32 +379,33 @@
);
}
-/** \ingroup variables
-
-This is a wrapper for nc_inq_var_all().
-
-\param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as
-nc_inq_ncid().
-
-\param varid Variable ID
-
-\param storagep Address of returned storage property, returned as
-::NC_CONTIGUOUS if this variable uses contiguous storage, or
-::NC_CHUNKED if it uses chunked storage. \ref ignored_if_null.
-
-\param chunksizesp The chunksizes will be copied here. \ref
-ignored_if_null.
-
-\returns ::NC_NOERR No error.
-\returns ::NC_EBADID Bad ncid.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file.
-\returns ::NC_ENOTVAR Invalid variable ID.
-
-
-\section nc_inq_var_chunking_example Example
-
-\code
+/**
+ * @ingroup variables
+ *
+ * Get the storage and (for chunked variables) the chunksizes of a
+ * variable. See nc_def_var_chunking() for explanation of storage.
+ *
+ * @param ncid NetCDF or group ID, from a previous call to nc_open(),
+ * nc_create(), nc_def_grp(), or associated inquiry functions such as
+ * nc_inq_ncid().
+ * @param varid Variable ID
+ * @param storagep Address of returned storage property, returned as
+ * ::NC_CONTIGUOUS if this variable uses contiguous storage,
+ * ::NC_CHUNKED if it uses chunked storage, or ::NC_COMPACT for
+ * compact storage. \ref ignored_if_null.
+ * @param chunksizesp The chunksizes will be copied here. \ref
+ * ignored_if_null.
+ *
+ * @return ::NC_NOERR No error.
+ * @return ::NC_EBADID Bad ncid.
+ * @return ::NC_ENOTNC4 Not a netCDF-4 file.
+ * @return ::NC_ENOTVAR Invalid variable ID.
+ *
+ * @author Ed Hartnett
+ *
+ * @section nc_inq_var_chunking_example Example
+ *
+ * @code
printf("**** testing contiguous storage...");
{
#define NDIMS6 1
@@ -415,8 +437,8 @@
if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
if (storage_in != NC_CONTIGUOUS) ERR;
-\endcode
-
+@endcode
+*
*/
int
nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp)
@@ -459,10 +481,12 @@
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
+
if(stat != NC_NOERR) return stat;
TRACE(nc_inq_var_fill);
+
return ncp->dispatch->inq_var_all(
- ncid, varid,
+ ncid,varid,
NULL, /*name*/
NULL, /*xtypep*/
NULL, /*ndimsp*/
@@ -608,67 +632,20 @@
}
/**
-Find the filter (if any) associated with a variable.
-
-This is a wrapper for nc_inq_var_all().
-
-\param ncid NetCDF or group ID, from a previous call to nc_open(),
-nc_create(), nc_def_grp(), or associated inquiry functions such as
-nc_inq_ncid().
-
-\param varid Variable ID
-
-\param idp Storage which will get the filter id; a return value of zero means no filter
-
-\param nparamsp Storage which will get the number of parameters to the
-filter
-
-\param params Storage which will get associated parameters.
-Note: the caller must allocate and free.
-
-\returns ::NC_NOERR No error.
-\returns ::NC_ENOTNC4 Not a netCDF-4 file.
-\returns ::NC_EBADID Bad ncid.
-\returns ::NC_ENOTVAR Invalid variable ID.
-\returns ::NC_EFILTER No filter defined.
\ingroup variables
-\author Dennis Heimbigner
-*/
-int
-nc_inq_var_filter(int ncid, int varid, unsigned int* idp, size_t* nparamsp, unsigned int* params)
-{
- NC* ncp;
- int stat = NC_check_id(ncid,&ncp);
- if(stat != NC_NOERR) return stat;
- TRACE(nc_inq_var_filter);
- return ncp->dispatch->inq_var_all(
- ncid, varid,
- NULL, /*name*/
- NULL, /*xtypep*/
- NULL, /*ndimsp*/
- NULL, /*dimidsp*/
- NULL, /*nattsp*/
- NULL, /*shufflep*/
- NULL, /*deflatep*/
- NULL, /*deflatelevelp*/
- NULL, /*fletcher32p*/
- NULL, /*contiguousp*/
- NULL, /*chunksizep*/
- NULL, /*nofillp*/
- NULL, /*fillvaluep*/
- NULL, /*endianp*/
- idp, nparamsp, params);
-}
-
-/** \ingroup variables
Learn the szip settings of a variable.
-Similar to nc_inq_var_deflate.
-
-This function returns the szip settings for a variable.
-With the introduction of general filter support,
-szip inquiry is converted to use the filter interface.
-This is a wrapper for nc_inq_var_filter().
+This function returns the szip settings for a variable. To turn on
+szip compression, use nc_def_var_szip(). Szip compression is only
+available if HDF5 was built with szip support. The nc_def_var_filter
+function may also be used to set szip compression.
+
+If a variable is not using szip, then a zero will be passed back
+for both options_maskp and pixels_per_blockp.
+
+For more information on HDF5 and szip see
+https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSzip
+and https://support.hdfgroup.org/doc_resource/SZIP/index.html.
\param ncid NetCDF or group ID, from a previous call to nc_open(),
nc_create(), nc_def_grp(), or associated inquiry functions such as
@@ -677,22 +654,30 @@
\param varid Variable ID
\param options_maskp The szip options mask will be copied to this
-pointer. \ref ignored_if_null.
+pointer. Note that the HDF5 layer adds to the options_mask, so this
+value may be different from the value used when setting szip
+compression, however the bit set when setting szip compression will
+still be set in the options_maskp and can be checked for. If zero is
+returned, szip is not in use for this variable.\ref ignored_if_null.
\param pixels_per_blockp The szip pixels per block will be copied
-here. \ref ignored_if_null.
+here. The HDF5 layer may change this value, so this may not match the
+value passed in when setting szip compression. If zero is returned,
+szip is not in use for this variable. \ref ignored_if_null.
\returns ::NC_NOERR No error.
\returns ::NC_EBADID Bad ncid.
\returns ::NC_ENOTNC4 Not a netCDF-4 file.
\returns ::NC_ENOTVAR Invalid variable ID.
-\returns ::NC_EFILTER Variable is not szip encoded
+\returns ::NC_EFILTER Filter error.
+
+\author Ed Hartnett, Dennis Heimbigner
+
*/
int
nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp)
{
NC* ncp;
- unsigned int id;
size_t nparams;
unsigned int params[4];
@@ -700,58 +685,28 @@
if(stat != NC_NOERR) return stat;
TRACE(nc_inq_var_szip);
- /* Verify id and nparams */
- stat = ncp->dispatch->inq_var_all(
- ncid, varid,
- NULL, /*name*/
- NULL, /*xtypep*/
- NULL, /*ndimsp*/
- NULL, /*dimidsp*/
- NULL, /*nattsp*/
- NULL, /*shufflep*/
- NULL, /*deflatep*/
- NULL, /*deflatelevelp*/
- NULL, /*fletcher32p*/
- NULL, /*contiguousp*/
- NULL, /*chunksizep*/
- NULL, /*nofillp*/
- NULL, /*fillvaluep*/
- NULL, /*endianp*/
- &id,
- &nparams,
- NULL
- );
- if(stat != NC_NOERR) return stat;
- /* Warning: the szip filter internally expands the set of parameters */
- if(id != H5Z_FILTER_SZIP || nparams != 4)
- return NC_EFILTER; /* not szip or bad # params */
- /* Get params */
- stat = ncp->dispatch->inq_var_all(
- ncid, varid,
- NULL, /*name*/
- NULL, /*xtypep*/
- NULL, /*ndimsp*/
- NULL, /*dimidsp*/
- NULL, /*nattsp*/
- NULL, /*shufflep*/
- NULL, /*deflatep*/
- NULL, /*deflatelevelp*/
- NULL, /*fletcher32p*/
- NULL, /*contiguousp*/
- NULL, /*chunksizep*/
- NULL, /*nofillp*/
- NULL, /*fillvaluep*/
- NULL, /*endianp*/
- &id,
- &nparams,
- params
- );
- if(stat != NC_NOERR) return stat;
- /* Param[0] should be options_mask with possibly some other flags set,
+ /* Verify id and nparams */
+ stat = nc_inq_var_filter_info(ncid,varid,H5Z_FILTER_SZIP,&nparams,params);
+ switch (stat) {
+ case NC_NOERR:
+ if(nparams != 2)
+ return NC_EFILTER; /* bad # params */
+ break;
+ case NC_ENOFILTER:
+ /* If the szip filter is not in use, return 0 for both parameters. */
+ params[0] = 0;
+ params[1] = 0;
+ stat = NC_NOERR;
+ break;
+ default:
+ return stat;
+ }
+
+ /* Param[0] should be options_mask
Param[1] should be pixels_per_block */
if(options_maskp) *options_maskp = (int)params[0];
if(pixels_per_blockp) *pixels_per_blockp = (int)params[1];
- return NC_NOERR;
+ return stat;
}
/*!
@@ -802,13 +757,14 @@
\internal
\ingroup variables
*/
+#if 0
int
NC_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep,
int *ndimsp, int *dimidsp, int *nattsp,
int *shufflep, int *deflatep, int *deflate_levelp,
int *fletcher32p, int *contiguousp, size_t *chunksizesp,
int *no_fill, void *fill_valuep, int *endiannessp,
- unsigned int* idp, size_t* nparamsp, unsigned int* params
+ unsigned int* unused1, size_t* unused2, unsigned int* unused3
)
{
NC* ncp;
@@ -821,7 +777,8 @@
contiguousp, chunksizesp,
no_fill, fill_valuep,
endiannessp,
- idp,nparamsp,params);
+ NULL, NULL, NULL);
}
+#endif
/*! \} */ /* End of named group ...*/
diff -Nru netcdf-parallel-4.7.3/libdispatch/dvarput.c netcdf-parallel-4.7.4/libdispatch/dvarput.c
--- netcdf-parallel-4.7.3/libdispatch/dvarput.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/dvarput.c 2020-08-31 10:33:26.000000000 +0000
@@ -221,11 +221,7 @@
#endif
else {
/* mystart is unsigned, will never be < 0 */
-#ifdef RELAX_COORD_BOUND
if (mystart[i] > dimlen) return NC_EINVALCOORDS;
-#else
- if (mystart[i] >= dimlen) return NC_EINVALCOORDS;
-#endif
}
if(edges == NULL) {
#if 0
@@ -239,12 +235,12 @@
myedges[i] = varshape[i] - mystart[i];
} else
myedges[i] = edges[i];
-#ifdef RELAX_COORD_BOUND
+
if(!is_recdim[i]) {
if (mystart[i] == dimlen && myedges[i] > 0)
return NC_EINVALCOORDS;
}
-#endif
+
if(!is_recdim[i]) {
/* myediges is unsigned, will never be < 0 */
if(mystart[i] + myedges[i] > dimlen)
@@ -434,12 +430,8 @@
for (idim = isrecvar; idim <= maxidim; ++idim)
{
-#ifdef RELAX_COORD_BOUND
if (mystart[idim] > varshape[idim] ||
(mystart[idim] == varshape[idim] && myedges[idim] > 0))
-#else
- if (mystart[idim] >= varshape[idim])
-#endif
{
status = NC_EINVALCOORDS;
goto done;
diff -Nru netcdf-parallel-4.7.3/libdispatch/Makefile.in netcdf-parallel-4.7.4/libdispatch/Makefile.in
--- netcdf-parallel-4.7.3/libdispatch/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libdispatch/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -342,8 +342,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -383,11 +385,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/libhdf4/hdf4dispatch.c netcdf-parallel-4.7.4/libhdf4/hdf4dispatch.c
--- netcdf-parallel-4.7.3/libhdf4/hdf4dispatch.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf4/hdf4dispatch.c 2020-08-31 10:33:26.000000000 +0000
@@ -18,6 +18,7 @@
static const NC_Dispatch HDF4_dispatcher = {
NC_FORMATX_NC_HDF4,
+ NC_DISPATCH_VERSION,
NC_RO_create,
NC_HDF4_open,
@@ -100,7 +101,9 @@
NC_NOTNC4_def_var_endian,
NC_NOTNC4_def_var_filter,
NC_NOTNC4_set_var_chunk_cache,
- NC_NOTNC4_get_var_chunk_cache
+ NC_NOTNC4_get_var_chunk_cache,
+
+ NC_NOTNC4_filter_actions,
};
const NC_Dispatch *HDF4_dispatch_table = NULL;
diff -Nru netcdf-parallel-4.7.3/libhdf4/hdf4file.c netcdf-parallel-4.7.4/libhdf4/hdf4file.c
--- netcdf-parallel-4.7.3/libhdf4/hdf4file.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf4/hdf4file.c 2020-08-31 10:33:26.000000000 +0000
@@ -435,7 +435,10 @@
}
/* Var contiguous or chunked? */
- (*var)->contiguous = contiguous;
+ if (contiguous)
+ (*var)->storage = NC_CONTIGUOUS;
+ else
+ (*var)->storage = NC_CHUNKED;
/* Were chunksizes provided? */
if (chunksizes)
diff -Nru netcdf-parallel-4.7.3/libhdf4/Makefile.in netcdf-parallel-4.7.4/libhdf4/Makefile.in
--- netcdf-parallel-4.7.3/libhdf4/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf4/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -258,8 +258,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -299,11 +301,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/libhdf5/CMakeLists.txt netcdf-parallel-4.7.4/libhdf5/CMakeLists.txt
--- netcdf-parallel-4.7.3/libhdf5/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -8,7 +8,8 @@
# The source files for the HDF5 dispatch layer.
SET(libnchdf5_SOURCES nc4hdf.c nc4info.c hdf5file.c hdf5attr.c
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c hdf5open.c
-hdf5var.c nc4mem.c nc4memcb.c hdf5cache.c hdf5dispatch.c)
+hdf5var.c nc4mem.c nc4memcb.c hdf5cache.c hdf5dispatch.c hdf5filter.c
+hdf5debug.c)
IF(ENABLE_BYTERANGE)
SET(libnchdf5_SOURCES ${libnchdf5_SOURCES} H5FDhttp.c)
diff -Nru netcdf-parallel-4.7.3/libhdf5/hdf5cache.c netcdf-parallel-4.7.4/libhdf5/hdf5cache.c
--- netcdf-parallel-4.7.3/libhdf5/hdf5cache.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/hdf5cache.c 2020-08-31 10:33:26.000000000 +0000
@@ -2,9 +2,10 @@
* Research. See COPYRIGHT file for copying and redistribution
* conditions. */
/**
- * @file @internal The netCDF-4 functions which control HDF5
- * caching. These caching controls allow the user to change the cache
- * sizes of HDF5 before opening files.
+ * @file
+ * The netCDF-4 functions which control HDF5 caching. These caching
+ * controls allow the user to change the cache sizes of HDF5 before
+ * opening files.
*
* @author Ed Hartnett
*/
@@ -19,16 +20,53 @@
extern float nc4_chunk_cache_preemption;
/**
- * Set chunk cache size. Only affects files opened/created *after* it
- * is called.
+ * Set chunk cache size. Only affects netCDF-4/HDF5 files
+ * opened/created *after* it is called.
*
- * @param size Size in bytes to set cache.
- * @param nelems Number of elements to hold in cache.
- * @param preemption Preemption stragety (between 0 and 1).
+ * The HDF5 chunk cache for each dataset is used by HDF5 when reading
+ * and writing files. The size of the chunk cache can be set with this
+ * function (for all variables in the file) or on a variable basis
+ * with nc_set_var_chunk_cache().
+ *
+ * Increasing the size of the cache only helps if data access patterns
+ * support it. If data is read in one sequential pass through the
+ * file, then the cache will not help much. If data are read from the
+ * same file multiple times, the chunk cache can improve performance.
+ *
+ * The current settings for the file level chunk cache can be obtained
+ * with nc_get_chunk_cache().
+ *
+ * For more information on HDF5 caching, see
+ * https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetCache.
+ *
+ * @param size Size in bytes to set cache. The default value is 64 MB;
+ * the default may be changed with configure option
+ * --with-chunk-cache-size.
+ *
+ * @param nelems Number of elements to hold in cache. This is passed
+ * to the nslots parameter of the HDF5 function H5Pset_cache(). This
+ * should be a prime number at least ten times larger than the maximum
+ * number of chunks that are set in the cache. The default value is
+ * 4133; the default may be set with configure option
+ * --with-chunk-cache-nelems.
+ *
+ * @param preemption Preemption stragety, a float between 0 and 1
+ * inclusive and indicates the weighting according to which chunks
+ * which have been fully read or written are penalized when
+ * determining which chunks to flush from cache. A value of 0 means
+ * fully read or written chunks are treated no differently than other
+ * chunks (the preemption is strictly LRU) while a value of 1 means
+ * fully read or written chunks are always preempted before other
+ * chunks. If your application only reads or writes data once, this
+ * can be safely set to 1. Otherwise, this should be set lower
+ * depending on how often you re-read or re-write the same data. The
+ * default value is 0.75; the default may be set with configure option
+ * --with-chunk-cache-preemption.
*
* @return ::NC_NOERR No error.
* @return ::NC_EINVAL Bad preemption.
* @author Ed Hartnett
+ * @ingroup datasets
*/
int
nc_set_chunk_cache(size_t size, size_t nelems, float preemption)
@@ -42,15 +80,19 @@
}
/**
- * Get chunk cache size. Only affects files opened/created *after* it
- * is called.
+ * Get current chunk cache settings. These settings may be changed
+ * with nc_set_chunk_cache().
*
- * @param sizep Pointer that gets size in bytes to set cache.
- * @param nelemsp Pointer that gets number of elements to hold in cache.
- * @param preemptionp Pointer that gets preemption stragety (between 0 and 1).
+ * @param sizep Pointer that gets size in bytes to set cache. Ignored
+ * if NULL.
+ * @param nelemsp Pointer that gets number of elements to hold in
+ * cache. Ignored if NULL.
+ * @param preemptionp Pointer that gets preemption stragety (between 0
+ * and 1). Ignored if NULL.
*
* @return ::NC_NOERR No error.
* @author Ed Hartnett
+ * @ingroup datasets
*/
int
nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp)
@@ -67,8 +109,10 @@
}
/**
- * @internal Set the chunk cache. Required for fortran to avoid size_t
- * issues.
+ * @internal Set the chunk cache. This is like nc_set_chunk_cache()
+ * but with integers instead of size_t, and with an integer preemption
+ * (which is the float preemtion * 100). This was required for fortran
+ * to avoid size_t issues.
*
* @param size Cache size.
* @param nelems Number of elements.
@@ -89,8 +133,10 @@
}
/**
- * @internal Get the chunk cache settings. Required for fortran to
- * avoid size_t issues.
+ * @internal Get the chunk cache settings. This is like
+ * nc_get_chunk_cache() but with integers instead of size_t, and with
+ * an integer preemption (which is the float preemtion * 100). This
+ * was required for fortran to avoid size_t issues.
*
* @param sizep Pointer that gets cache size.
* @param nelemsp Pointer that gets number of elements.
diff -Nru netcdf-parallel-4.7.3/libhdf5/hdf5debug.c netcdf-parallel-4.7.4/libhdf5/hdf5debug.c
--- netcdf-parallel-4.7.3/libhdf5/hdf5debug.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/hdf5debug.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,47 @@
+/*********************************************************************
+ * Copyright 2018, UCAR/Unidata
+ * See netcdf/COPYRIGHT file for copying and redistribution conditions.
+ *********************************************************************/
+#include "config.h"
+#include
+#include
+#if !defined _WIN32 && !defined __CYGWIN__
+#include
+#endif
+
+#include "hdf5debug.h"
+
+#ifdef H5CATCH
+
+#define STSIZE 1000
+
+static void* stacktrace[STSIZE];
+
+int
+nch5breakpoint(int err)
+{
+#if !defined _WIN32 && !defined __CYGWIN__
+ int count = 0;
+ char** trace = NULL;
+ int i;
+
+ count = backtrace(stacktrace,STSIZE);
+ trace = backtrace_symbols(stacktrace, STSIZE);
+ fprintf(stderr,"backtrace:\n");
+ for(i=0;i
+#include "hdf5internal.h"
+#include "hdf5debug.h"
+
+#define HAVE_H5_DEFLATE
+
+/* Mnemonic */
+#define FILTERACTIVE 1
+
+
+/* WARNING: GLOBAL VARIABLE */
+
+/* Define list of registered filters */
+static NClist* NC4_registeredfilters = NULL; /** List */
+
+/**************************************************/
+/* Filter registration support */
+
+static int
+filterlookup(unsigned int id)
+{
+ int i;
+ if(NC4_registeredfilters == NULL)
+ NC4_registeredfilters = nclistnew();
+ for(i=0;iid == id) return i; /* return position */
+ }
+ return -1;
+}
+
+static void
+reclaiminfo(NC_FILTER_CLIENT_HDF5* info)
+{
+ nullfree(info);
+}
+
+static int
+filterremove(int pos)
+{
+ NC_FILTER_CLIENT_HDF5* info = NULL;
+ if(NC4_registeredfilters == NULL)
+ return THROW(NC_EINVAL);
+ if(pos < 0 || pos >= nclistlength(NC4_registeredfilters))
+ return THROW(NC_EINVAL);
+ info = nclistget(NC4_registeredfilters,pos);
+ reclaiminfo(info);
+ nclistremove(NC4_registeredfilters,pos);
+ return NC_NOERR;
+}
+
+static NC_FILTER_CLIENT_HDF5*
+dupfilterinfo(NC_FILTER_CLIENT_HDF5* info)
+{
+ NC_FILTER_CLIENT_HDF5* dup = NULL;
+ if(info == NULL) goto fail;
+ if((dup = calloc(1,sizeof(NC_FILTER_CLIENT_HDF5))) == NULL) goto fail;
+ *dup = *info;
+ return dup;
+fail:
+ reclaiminfo(dup);
+ return NULL;
+}
+
+int
+NC4_hdf5_addfilter(NC_VAR_INFO_T* var, int active, unsigned int id, size_t nparams, unsigned int* inparams)
+{
+ int stat = NC_NOERR;
+ NC_FILTER_SPEC_HDF5* fi = NULL;
+ unsigned int* params = NULL;
+
+ if(var->filters == NULL) {
+ if((var->filters = nclistnew())==NULL) return THROW(NC_ENOMEM);
+ }
+
+ if(nparams > 0 && inparams == NULL)
+ return THROW(NC_EINVAL);
+ if(inparams != NULL) {
+ if((params = malloc(sizeof(unsigned int)*nparams)) == NULL)
+ return THROW(NC_ENOMEM);
+ memcpy(params,inparams,sizeof(unsigned int)*nparams);
+ }
+
+ if((fi = calloc(1,sizeof(NC_FILTER_SPEC_HDF5))) == NULL)
+ {nullfree(params); return THROW(NC_ENOMEM);}
+
+ fi->active = active;
+ fi->filterid = id;
+ fi->nparams = nparams;
+ fi->params = params;
+ nclistpush(var->filters,fi);
+ return THROW(stat);
+}
+
+int
+nc4_global_filter_action(int op, unsigned int id, NC_FILTER_OBJ_HDF5* infop)
+{
+ int stat = NC_NOERR;
+ H5Z_class2_t* h5filterinfo = NULL;
+ herr_t herr;
+ int pos = -1;
+ NC_FILTER_CLIENT_HDF5* dup = NULL;
+ NC_FILTER_CLIENT_HDF5* elem = NULL;
+ NC_FILTER_CLIENT_HDF5 ncf;
+
+ switch (op) {
+ case NCFILTER_CLIENT_REG: /* Ignore id argument */
+ if(infop == NULL) {stat = NC_EINVAL; goto done;}
+ assert(NC_FILTER_FORMAT_HDF5 == infop->hdr.format);
+ assert(NC_FILTER_SORT_CLIENT == infop->sort);
+ elem = (NC_FILTER_CLIENT_HDF5*)&infop->u.client;
+ h5filterinfo = elem->info;
+ /* Another sanity check */
+ if(id != h5filterinfo->id)
+ {stat = NC_EINVAL; goto done;}
+ /* See if this filter is already defined */
+ if((pos = filterlookup(id)) >= 0)
+ {stat = NC_ENAMEINUSE; goto done;} /* Already defined */
+ if((herr = H5Zregister(h5filterinfo)) < 0)
+ {stat = NC_EFILTER; goto done;}
+ /* Save a copy of the passed in info */
+ ncf.id = id;
+ ncf.info = elem->info;
+ if((dup=dupfilterinfo(&ncf)) == NULL)
+ {stat = NC_ENOMEM; goto done;}
+ nclistpush(NC4_registeredfilters,dup);
+ break;
+ case NCFILTER_CLIENT_UNREG:
+ if(id <= 0)
+ {stat = NC_ENOTNC4; goto done;}
+ /* See if this filter is already defined */
+ if((pos = filterlookup(id)) < 0)
+ {stat = NC_ENOFILTER; goto done;} /* Not defined */
+ if((herr = H5Zunregister(id)) < 0)
+ {stat = NC_EFILTER; goto done;}
+ if((stat=filterremove(pos))) goto done;
+ break;
+ case NCFILTER_CLIENT_INQ:
+ if(infop == NULL) goto done;
+ /* Look up the id in our local table */
+ if((pos = filterlookup(id)) < 0)
+ {stat = NC_ENOFILTER; goto done;} /* Not defined */
+ elem = (NC_FILTER_CLIENT_HDF5*)nclistget(NC4_registeredfilters,pos);
+ if(elem == NULL) {stat = NC_EINTERNAL; goto done;}
+ if(infop != NULL) {
+ infop->u.client = *elem;
+ }
+ break;
+ default:
+ {stat = NC_EINTERNAL; goto done;}
+ }
+done:
+ return THROW(stat);
+}
+
+/**
+ * @internal Define filter settings. Called by nc_def_var_filter().
+ *
+ * @param ncid File ID.
+ * @param varid Variable ID.
+ * @param id Filter ID
+ * @param nparams Number of parameters for filter.
+ * @param parms Filter parameters.
+ *
+ * @returns ::NC_NOERR for success
+ * @returns ::NC_EBADID Bad ncid.
+ * @returns ::NC_ENOTVAR Invalid variable ID.
+ * @returns ::NC_ENOTNC4 Attempting netcdf-4 operation on file that is
+ * not netCDF-4/HDF5.
+ * @returns ::NC_ELATEDEF Too late to change settings for this variable.
+ * @returns ::NC_EFILTER Filter error.
+ * @returns ::NC_EINVAL Invalid input
+ * @author Dennis Heimbigner
+ */
+int
+NC4_filter_actions(int ncid, int varid, int op, NC_Filterobject* args)
+{
+ int stat = NC_NOERR;
+ NC_GRP_INFO_T *grp = NULL;
+ NC_FILE_INFO_T *h5 = NULL;
+ NC_VAR_INFO_T *var = NULL;
+ NC_FILTER_OBJ_HDF5* obj = (NC_FILTER_OBJ_HDF5*)args;
+ unsigned int id = 0;
+ size_t nparams = 0;
+ unsigned int* idp = NULL;
+ size_t* nparamsp = NULL;
+ size_t* nfiltersp = NULL;
+ unsigned int* params = NULL;
+ size_t nfilters = 0;
+ unsigned int* filterids = NULL;
+
+ LOG((2, "%s: ncid 0x%x varid %d op=%d", __func__, ncid, varid, op));
+
+ if(args == NULL) return THROW(NC_EINVAL);
+ if(args->format != NC_FILTER_FORMAT_HDF5) return THROW(NC_EFILTER);
+
+ /* Find info for this file and group and var, and set pointer to each. */
+ if ((stat = nc4_hdf5_find_grp_h5_var(ncid, varid, &h5, &grp, &var)))
+ return THROW(stat);
+
+ assert(h5 && var && var->hdr.id == varid);
+
+ nfilters = nclistlength(var->filters);
+
+ switch (op) {
+ case NCFILTER_DEF: {
+ if(obj->sort != NC_FILTER_SORT_SPEC) return THROW(NC_EFILTER);
+ /* If the HDF5 dataset has already been created, then it is too
+ * late to set all the extra stuff. */
+ if (!(h5->flags & NC_INDEF)) return THROW(NC_EINDEFINE);
+ if (!var->ndims) return NC_EINVAL; /* For scalars, complain */
+ if (var->created)
+ return THROW(NC_ELATEDEF);
+ /* Can't turn on parallel and szip before HDF5 1.10.2. */
+#ifdef USE_PARALLEL
+#ifndef HDF5_SUPPORTS_PAR_FILTERS
+ if (h5->parallel == NC_TRUE)
+ return THROW(NC_EINVAL);
+#endif /* HDF5_SUPPORTS_PAR_FILTERS */
+#endif /* USE_PARALLEL */
+ id = obj->u.spec.filterid;
+ nparams = obj->u.spec.nparams;
+ params = obj->u.spec.params;
+#ifdef HAVE_H5_DEFLATE
+ if(id == H5Z_FILTER_DEFLATE) {
+ int k;
+ int level;
+ if(nparams != 1)
+ return THROW(NC_EFILTER); /* incorrect no. of parameters */
+ level = (int)params[0];
+ if (level < NC_MIN_DEFLATE_LEVEL ||
+ level > NC_MAX_DEFLATE_LEVEL)
+ return THROW(NC_EINVAL);
+ /* If szip compression is already applied, return error. */
+ for(k=0;kfilters);k++) {
+ NC_FILTER_SPEC_HDF5* f = nclistget(var->filters,k);
+ if (f->filterid == H5Z_FILTER_SZIP)
+ return THROW(NC_EINVAL);
+ }
+ }
+#else /*!HAVE_H5_DEFLATE*/
+ if(id == H5Z_FILTER_DEFLATE)
+ return THROW(NC_EFILTER); /* Not allowed */
+#endif
+#ifdef HAVE_H5Z_SZIP
+ if(id == H5Z_FILTER_SZIP) { /* Do error checking */
+ int k;
+ if(nparams != 2)
+ return THROW(NC_EFILTER); /* incorrect no. of parameters */
+ /* Pixels per block must be an even number, < 32. */
+ if (params[1] % 2 || params[1] > NC_MAX_PIXELS_PER_BLOCK)
+ return THROW(NC_EINVAL);
+ /* If zlib compression is already applied, return error. */
+ for(k=0;kfilters);k++) {
+ NC_FILTER_SPEC_HDF5* f = nclistget(var->filters,k);
+ if (f->filterid == H5Z_FILTER_DEFLATE)
+ return THROW(NC_EINVAL);
+ }
+ }
+#else /*!HAVE_H5Z_SZIP*/
+ if(id == H5Z_FILTER_SZIP)
+ return THROW(NC_EFILTER); /* Not allowed */
+#endif
+ /* Filter => chunking */
+ var->storage = NC_CHUNKED;
+ /* Determine default chunksizes for this variable unless already specified */
+ if(var->chunksizes && !var->chunksizes[0]) {
+ /* Should this throw error? */
+ if((stat = nc4_find_default_chunksizes2(grp, var)))
+ goto done;
+ /* Adjust the cache. */
+ if ((stat = nc4_adjust_var_cache(grp, var)))
+ goto done;
+ }
+#ifdef HAVE_H5Z_SZIP
+ if(id == H5Z_FILTER_SZIP) { /* szip X chunking error checking */
+ /* For szip, the pixels_per_block parameter must not be greater
+ * than the number of elements in a chunk of data. */
+ size_t num_elem = 1;
+ int d;
+ for (d = 0; d < var->ndims; d++)
+ num_elem *= var->dim[d]->len;
+ /* Pixels per block must be <= number of elements. */
+ if (params[1] > num_elem)
+ return THROW(NC_EINVAL);
+ }
+#endif
+ if((stat = NC4_hdf5_addfilter(var,!FILTERACTIVE,id,nparams,params)))
+ goto done;
+#ifdef USE_PARALLEL
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+ /* Switch to collective access. HDF5 requires collevtive access
+ * for filter use with parallel I/O. */
+ if (h5->parallel)
+ var->parallel_access = NC_COLLECTIVE;
+#else
+ if (h5->parallel)
+ return NC_EINVAL;
+#endif /* HDF5_SUPPORTS_PAR_FILTERS */
+#endif /* USE_PARALLEL */
+ } break;
+ case NCFILTER_INQ: {
+ if (!var->ndims) return THROW(NC_EINVAL); /* For scalars, fail */
+ if(obj->sort != NC_FILTER_SORT_SPEC) return THROW(NC_EFILTER);
+ idp = &obj->u.spec.filterid;
+ nparamsp = &obj->u.spec.nparams;
+ params = obj->u.spec.params;
+ if(nfilters > 0) {
+ /* Return info about var->filters[0] */
+ NC_FILTER_SPEC_HDF5* f = (NC_FILTER_SPEC_HDF5*)nclistget(var->filters,0);
+ if(idp) *idp = f->filterid;
+ if(nparamsp) {
+ *nparamsp = (f->params == NULL ? 0 : f->nparams);
+ if(params && f->params != NULL && f->nparams > 0)
+ memcpy(params,f->params,f->nparams*sizeof(unsigned int));
+ }
+ } else {stat = NC_ENOFILTER; goto done;}
+ } break;
+ case NCFILTER_FILTERIDS: {
+ if(obj->sort != NC_FILTER_SORT_IDS) return THROW(NC_EFILTER);
+ nfiltersp = &obj->u.ids.nfilters;
+ filterids = obj->u.ids.filterids;
+ if(nfiltersp) *nfiltersp = nfilters;
+ if(filterids) filterids[0] = 0;
+ if(nfilters > 0 && filterids != NULL) {
+ int k;
+ for(k=0;kfilters,k);
+ filterids[k] = f->filterid;
+ }
+ }
+ } break;
+ case NCFILTER_INFO: {
+ int k,found;
+ if(obj->sort != NC_FILTER_SORT_SPEC) return THROW(NC_EFILTER);
+ id = obj->u.spec.filterid;
+ for(found=0,k=0;kfilters,k);
+ if(f->filterid == id) {
+ obj->u.spec.nparams = f->nparams;
+ if(obj->u.spec.params != NULL && f->params != NULL && f->nparams > 0)
+ memcpy(obj->u.spec.params,f->params,f->nparams*sizeof(unsigned int));
+ found = 1;
+ break;
+ }
+ }
+ if(!found) {stat = NC_ENOFILTER; goto done;}
+ } break;
+ case NCFILTER_REMOVE: {
+ int k;
+ if (!(h5->flags & NC_INDEF)) return THROW(NC_EINDEFINE);
+ if(obj->sort != NC_FILTER_SORT_SPEC) return THROW(NC_EFILTER);
+ id = obj->u.spec.filterid;
+ /* Walk backwards */
+ for(k=nfilters-1;k>=0;k--) {
+ NC_FILTER_SPEC_HDF5* f = (NC_FILTER_SPEC_HDF5*)nclistget(var->filters,k);
+ if(f->filterid == id) {
+ if(f->active) {
+ /* Remove from variable */
+ if((stat = NC4_hdf5_remove_filter(var,id))) {stat = NC_ENOFILTER; goto done;}
+ }
+ nclistremove(var->filters,k);
+ NC4_freefilterspec(f);
+ }
+ }
+ } break;
+ default:
+ {stat = NC_EINTERNAL; goto done;}
+ }
+
+done:
+ return THROW(stat);
+}
+
+void
+NC4_freefilterspec(NC_FILTER_SPEC_HDF5* f)
+{
+ if(f) {
+ if(f->params != NULL) {free(f->params);}
+ free(f);
+ }
+}
diff -Nru netcdf-parallel-4.7.3/libhdf5/hdf5internal.c netcdf-parallel-4.7.4/libhdf5/hdf5internal.c
--- netcdf-parallel-4.7.3/libhdf5/hdf5internal.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/hdf5internal.c 2020-08-31 10:33:26.000000000 +0000
@@ -582,6 +582,17 @@
}
}
+ /* Free the HDF5 typeids. */
+ if (var->type_info->rc == 1)
+ {
+ if (((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->hdf_typeid &&
+ H5Tclose(((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->hdf_typeid) < 0)
+ return NC_EHDFERR;
+ if (((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->native_hdf_typeid &&
+ H5Tclose(((NC_HDF5_TYPE_INFO_T *)(var->type_info->format_type_info))->native_hdf_typeid) < 0)
+ return NC_EHDFERR;
+ }
+
/* Delete any HDF5 dimscale objid information. */
if (hdf5_var->dimscale_hdf5_objids)
free(hdf5_var->dimscale_hdf5_objids);
diff -Nru netcdf-parallel-4.7.3/libhdf5/hdf5open.c netcdf-parallel-4.7.4/libhdf5/hdf5open.c
--- netcdf-parallel-4.7.3/libhdf5/hdf5open.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/hdf5open.c 2020-08-31 10:33:26.000000000 +0000
@@ -18,6 +18,9 @@
#include "H5FDhttp.h"
#endif
+/*Nemonic */
+#define FILTERACTIVE 1
+
#define NUM_TYPES 12 /**< Number of netCDF atomic types. */
#define CD_NELEMS_ZLIB 1 /**< Number of parameters needed for ZLIB filter. */
@@ -915,8 +918,8 @@
/**
* @internal Find out what filters are applied to this HDF5 dataset,
- * fletcher32, deflate, and/or shuffle. All other filters are just
- * dumped The possible values of
+ * fletcher32, deflate, and/or shuffle. All other filters are
+ * captured.
*
* @param propid ID of HDF5 var creation properties list.
* @param var Pointer to NC_VAR_INFO_T for this variable.
@@ -933,6 +936,7 @@
unsigned int cd_values_zip[CD_NELEMS_ZLIB];
size_t cd_nelems = CD_NELEMS_ZLIB;
int f;
+ int stat = NC_NOERR;
assert(var);
@@ -955,46 +959,56 @@
break;
case H5Z_FILTER_DEFLATE:
- var->deflate = NC_TRUE;
if (cd_nelems != CD_NELEMS_ZLIB ||
cd_values_zip[0] > NC_MAX_DEFLATE_LEVEL)
return NC_EHDFERR;
- var->deflate_level = cd_values_zip[0];
+ if((stat = NC4_hdf5_addfilter(var,FILTERACTIVE,filter,cd_nelems,cd_values_zip)))
+ return stat;
break;
- case H5Z_FILTER_SZIP:
+ case H5Z_FILTER_SZIP: {
/* Szip is tricky because the filter code expands the set of parameters from 2 to 4
- and changes some of the parameter values */
- var->filterid = filter;
- if(cd_nelems == 0)
- var->params = NULL;
- else {
+ and changes some of the parameter values; try to compensate */
+ if(cd_nelems == 0) {
+ if((stat = NC4_hdf5_addfilter(var,FILTERACTIVE,filter,0,NULL)))
+ return stat;
+ } else {
/* We have to re-read the parameters based on actual nparams,
which in the case of szip, differs from users original nparams */
- var->params = (unsigned int*)calloc(1,sizeof(unsigned int)*cd_nelems);
- if(var->params == NULL)
+ unsigned int* realparams = (unsigned int*)calloc(1,sizeof(unsigned int)*cd_nelems);
+ if(realparams == NULL)
return NC_ENOMEM;
if((filter = H5Pget_filter2(propid, f, NULL, &cd_nelems,
- var->params, 0, NULL, NULL)) < 0)
+ realparams, 0, NULL, NULL)) < 0)
return NC_EHDFERR;
/* fix up the parameters and the #params */
- var->nparams = cd_nelems;
+ if(cd_nelems != 4)
+ return NC_EHDFERR;
+ cd_nelems = 2; /* ignore last two */
+ /* Fix up changed params */
+ realparams[0] &= (H5_SZIP_ALL_MASKS);
+ /* Save info */
+ stat = NC4_hdf5_addfilter(var,FILTERACTIVE,filter,cd_nelems,realparams);
+ nullfree(realparams);
+ if(stat) return stat;
+
}
- break;
+ } break;
default:
- var->filterid = filter;
- var->nparams = cd_nelems;
- if(cd_nelems == 0)
- var->params = NULL;
- else {
+ if(cd_nelems == 0) {
+ if((stat = NC4_hdf5_addfilter(var,FILTERACTIVE,filter,0,NULL))) return stat;
+ } else {
/* We have to re-read the parameters based on actual nparams */
- var->params = (unsigned int*)calloc(1,sizeof(unsigned int)*var->nparams);
- if(var->params == NULL)
+ unsigned int* realparams = (unsigned int*)calloc(1,sizeof(unsigned int)*cd_nelems);
+ if(realparams == NULL)
return NC_ENOMEM;
if((filter = H5Pget_filter2(propid, f, NULL, &cd_nelems,
- var->params, 0, NULL, NULL)) < 0)
+ realparams, 0, NULL, NULL)) < 0)
return NC_EHDFERR;
+ stat = NC4_hdf5_addfilter(var,FILTERACTIVE,filter,cd_nelems,realparams);
+ nullfree(realparams);
+ if(stat) return stat;
}
break;
}
@@ -1058,7 +1072,7 @@
}
/**
- * @internal Learn the chunking settings of a var.
+ * @internal Learn the storage and (if chunked) chunksizes of a var.
*
* @param propid ID of HDF5 var creation properties list.
* @param var Pointer to NC_VAR_INFO_T for this variable.
@@ -1068,7 +1082,8 @@
* @return ::NC_EHDFERR HDF5 returned error.
* @author Dennis Heimbigner, Ed Hartnett
*/
-static int get_chunking_info(hid_t propid, NC_VAR_INFO_T *var)
+static int
+get_chunking_info(hid_t propid, NC_VAR_INFO_T *var)
{
H5D_layout_t layout;
hsize_t chunksize[H5S_MAX_RANK] = {0};
@@ -1081,6 +1096,7 @@
/* Remember the layout and, if chunked, the chunksizes. */
if (layout == H5D_CHUNKED)
{
+ var->storage = NC_CHUNKED;
if (H5Pget_chunk(propid, H5S_MAX_RANK, chunksize) < 0)
return NC_EHDFERR;
if (!(var->chunksizes = malloc(var->ndims * sizeof(size_t))))
@@ -1088,8 +1104,14 @@
for (d = 0; d < var->ndims; d++)
var->chunksizes[d] = chunksize[d];
}
- else if (layout == H5D_CONTIGUOUS || layout == H5D_COMPACT)
- var->contiguous = NC_TRUE;
+ else if (layout == H5D_CONTIGUOUS)
+ {
+ var->storage = NC_CONTIGUOUS;
+ }
+ else if (layout == H5D_COMPACT)
+ {
+ var->storage = NC_COMPACT;
+ }
return NC_NOERR;
}
@@ -2532,6 +2554,10 @@
/* Get HDF5-specific group info. */
hdf5_grp = (NC_HDF5_GRP_INFO_T *)grp->format_grp_info;
+ /* Set user data for iteration over any child groups. */
+ udata.grp = grp;
+ udata.grps = nclistnew();
+
/* Open this HDF5 group and retain its grpid. It will remain open
* with HDF5 until this file is nc_closed. */
if (!hdf5_grp->hdf_grpid)
@@ -2579,10 +2605,6 @@
iter_index = H5_INDEX_NAME;
}
- /* Set user data for iteration over any child groups. */
- udata.grp = grp;
- udata.grps = nclistnew();
-
/* Iterate over links in this group, building lists for the types,
* datasets and groups encountered. A pointer to udata will be
* passed as a parameter to the callback function
diff -Nru netcdf-parallel-4.7.3/libhdf5/hdf5type.c netcdf-parallel-4.7.4/libhdf5/hdf5type.c
--- netcdf-parallel-4.7.3/libhdf5/hdf5type.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/hdf5type.c 2020-08-31 10:33:26.000000000 +0000
@@ -108,7 +108,7 @@
* @return ::NC_EBADTYPE Type not found.
* @author Ed Hartnett
*/
-extern int
+EXTERNL int
NC4_inq_typeid(int ncid, const char *name, nc_type *typeidp)
{
NC_GRP_INFO_T *grp;
diff -Nru netcdf-parallel-4.7.3/libhdf5/hdf5var.c netcdf-parallel-4.7.4/libhdf5/hdf5var.c
--- netcdf-parallel-4.7.3/libhdf5/hdf5var.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/hdf5var.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,4 +1,3 @@
-
/* Copyright 2003-2019, University Corporation for Atmospheric
* Research. See COPYRIGHT file for copying and redistribution
* conditions.*/
@@ -15,6 +14,9 @@
#endif
#include /* For pow() used below. */
+#include "netcdf.h"
+#include "netcdf_filter.h"
+
/** @internal Default size for unlimited dim chunksize. */
#define DEFAULT_1D_UNLIM_SIZE (4096)
@@ -22,6 +24,9 @@
* order. */
#define NC_TEMP_NAME "_netcdf4_temporary_variable_name_for_rename"
+/** Number of bytes in 64 KB. */
+#define SIXTY_FOUR_KB (65536)
+
#ifdef LOGGING
/**
* Report the chunksizes selected for a variable.
@@ -46,7 +51,7 @@
char digits[64];
if(i > 0) strlcat(buf,",",sizeof(buf));
snprintf(digits,sizeof(digits),"%ld",(unsigned long)var->chunksizes[i]);
- strlcat(buf,digits,sizeof(buf));
+ strlcat(buf,digits,sizeof(buf));
}
LOG((3,"%s",buf));
}
@@ -145,7 +150,7 @@
* @returns ::NC_ENOTVAR Invalid variable ID.
* @author Ed Hartnett, Dennis Heimbigner
*/
-static int
+int
nc4_find_default_chunksizes2(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var)
{
int d;
@@ -168,6 +173,11 @@
total_chunk_size = (double) type_size;
#endif
+ if(var->chunksizes == NULL) {
+ if((var->chunksizes = calloc(1,sizeof(size_t)*var->ndims)) == NULL)
+ return NC_ENOMEM;
+ }
+
/* How many values in the variable (or one record, if there are
* unlimited dimensions). */
for (d = 0; d < var->ndims; d++)
@@ -499,7 +509,7 @@
* same name as one of its dimensions. If it is a coordinate var,
* is it a coordinate var in the same group as the dim? Also, check
* whether we should use contiguous or chunked storage. */
- var->contiguous = NC_TRUE;
+ var->storage = NC_CONTIGUOUS;
for (d = 0; d < ndims; d++)
{
NC_GRP_INFO_T *dim_grp;
@@ -539,9 +549,12 @@
}
}
- /* Check for unlimited dimension and turn off contiguous storage. */
+ /* Check for unlimited dimension. If present, we must use
+ * chunked storage. */
if (dim->unlimited)
- var->contiguous = NC_FALSE;
+ {
+ var->storage = NC_CHUNKED;
+ }
/* Track dimensions for variable */
var->dimids[d] = dimidsp[d];
@@ -552,17 +565,16 @@
* variables which may be contiguous.) */
LOG((4, "allocating array of %d size_t to hold chunksizes for var %s",
var->ndims, var->hdr.name));
- if (var->ndims)
+ if (var->ndims) {
if (!(var->chunksizes = calloc(var->ndims, sizeof(size_t))))
BAIL(NC_ENOMEM);
-
- if ((retval = nc4_find_default_chunksizes2(grp, var)))
- BAIL(retval);
-
- /* Is this a variable with a chunksize greater than the current
- * cache size? */
- if ((retval = nc4_adjust_var_cache(grp, var)))
- BAIL(retval);
+ if ((retval = nc4_find_default_chunksizes2(grp, var)))
+ BAIL(retval);
+ /* Is this a variable with a chunksize greater than the current
+ * cache size? */
+ if ((retval = nc4_adjust_var_cache(grp, var)))
+ BAIL(retval);
+ }
/* If the user names this variable the same as a dimension, but
* doesn't use that dimension first in its list of dimension ids,
@@ -606,7 +618,7 @@
* @param deflate Pointer to deflate setting.
* @param deflate_level Pointer to deflate level.
* @param fletcher32 Pointer to fletcher32 setting.
- * @param contiguous Pointer to contiguous setting.
+ * @param storage Pointer to storage setting.
* @param chunksizes Array of chunksizes.
* @param no_fill Pointer to no_fill setting.
* @param fill_value Pointer to fill value.
@@ -627,8 +639,8 @@
* @author Ed Hartnett
*/
static int
-nc_def_var_extra(int ncid, int varid, int *shuffle, int *deflate,
- int *deflate_level, int *fletcher32, int *contiguous,
+nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1,
+ int *unused2, int *fletcher32, int *storage,
const size_t *chunksizes, int *no_fill,
const void *fill_value, int *endianness)
{
@@ -638,10 +650,6 @@
int d;
int retval;
- /* All or none of these will be provided. */
- assert((deflate && deflate_level && shuffle) ||
- (!deflate && !deflate_level && !shuffle));
-
LOG((2, "%s: ncid 0x%x varid %d", __func__, ncid, varid));
/* Find info for this file and group, and set pointer to each. */
@@ -658,100 +666,126 @@
return NC_ENOTVAR;
assert(var && var->hdr.id == varid);
- /* Can't turn on parallel and deflate/fletcher32/szip/shuffle (for now). */
+ /* Can't turn on parallel and deflate/fletcher32/szip/shuffle
+ * before HDF5 1.10.3. */
+#ifndef HDF5_SUPPORTS_PAR_FILTERS
if (h5->parallel == NC_TRUE)
- if (deflate || fletcher32 || shuffle)
+ if (nclistlength(var->filters) > 0 || fletcher32 || shuffle)
return NC_EINVAL;
+#endif
/* If the HDF5 dataset has already been created, then it is too
* late to set all the extra stuff. */
if (var->created)
return NC_ELATEDEF;
- /* Check compression options. */
- if (deflate && !deflate_level)
- return NC_EINVAL;
-
- /* Valid deflate level? */
- if (deflate)
- {
- if (*deflate)
- if (*deflate_level < NC_MIN_DEFLATE_LEVEL ||
- *deflate_level > NC_MAX_DEFLATE_LEVEL)
- return NC_EINVAL;
-
- /* For scalars, just ignore attempt to deflate. */
- if (!var->ndims)
- return NC_NOERR;
-
- /* Well, if we couldn't find any errors, I guess we have to take
- * the users settings. Darn! */
- var->contiguous = NC_FALSE;
- var->deflate = *deflate;
- if (*deflate)
- var->deflate_level = *deflate_level;
- LOG((3, "%s: *deflate_level %d", __func__, *deflate_level));
+ /* Cannot set filters of any sort on scalars */
+ if(var->ndims == 0) {
+ if(shuffle && *shuffle)
+ return NC_EINVAL;
+ if(fletcher32 && *fletcher32)
+ return NC_EINVAL;
}
/* Shuffle filter? */
if (shuffle)
{
var->shuffle = *shuffle;
- var->contiguous = NC_FALSE;
+ var->storage = NC_CHUNKED;
}
/* Fletcher32 checksum error protection? */
if (fletcher32)
{
var->fletcher32 = *fletcher32;
- var->contiguous = NC_FALSE;
+ var->storage = NC_CHUNKED;
}
- /* Does the user want a contiguous dataset? Not so fast! Make sure
- * that there are no unlimited dimensions, and no filters in use
- * for this data. */
- if (contiguous && *contiguous)
+#ifdef USE_PARALLEL
+ /* If deflate, shuffle, or fletcher32 was turned on with
+ * parallel I/O writes, then switch to collective access. HDF5
+ * requires collevtive access for filter use with parallel
+ * I/O. */
+ if (shuffle || fletcher32)
{
- if (var->deflate || var->fletcher32 || var->shuffle)
- return NC_EINVAL;
-
- for (d = 0; d < var->ndims; d++)
- if (var->dim[d]->unlimited)
- return NC_EINVAL;
- var->contiguous = NC_TRUE;
+ if (h5->parallel && (nclistlength(var->filters) > 0 || var->shuffle || var->fletcher32))
+ var->parallel_access = NC_COLLECTIVE;
}
+#endif /* USE_PARALLEL */
- /* Chunksizes anyone? */
- if (contiguous && *contiguous == NC_CHUNKED)
+ /* Handle storage settings. */
+ if (storage)
{
- var->contiguous = NC_FALSE;
+ /* Does the user want a contiguous or compact dataset? Not so
+ * fast! Make sure that there are no unlimited dimensions, and
+ * no filters in use for this data. */
+ if (*storage != NC_CHUNKED)
+ {
+ if (nclistlength(var->filters) > 0 || var->fletcher32 || var->shuffle)
+ return NC_EINVAL;
- /* If the user provided chunksizes, check that they are not too
- * big, and that their total size of chunk is less than 4 GB. */
- if (chunksizes)
+ for (d = 0; d < var->ndims; d++)
+ if (var->dim[d]->unlimited)
+ return NC_EINVAL;
+ }
+
+ /* Handle chunked storage settings. */
+ if (*storage == NC_CHUNKED && var->ndims == 0)
{
+ /* Chunked not allowed for scalar vars. */
+ return NC_EINVAL;
+ }
+ else if (*storage == NC_CHUNKED)
+ {
+ var->storage = NC_CHUNKED;
- if ((retval = check_chunksizes(grp, var, chunksizes)))
- return retval;
+ /* If the user provided chunksizes, check that they are not too
+ * big, and that their total size of chunk is less than 4 GB. */
+ if (chunksizes)
+ {
+ /* Check the chunksizes for validity. */
+ if ((retval = check_chunksizes(grp, var, chunksizes)))
+ return retval;
- /* Ensure chunksize is smaller than dimension size */
- for (d = 0; d < var->ndims; d++)
- if(!var->dim[d]->unlimited && var->dim[d]->len > 0 && chunksizes[d] > var->dim[d]->len)
- return NC_EBADCHUNK;
+ /* Ensure chunksize is smaller than dimension size */
+ for (d = 0; d < var->ndims; d++)
+ if (!var->dim[d]->unlimited && var->dim[d]->len > 0 &&
+ chunksizes[d] > var->dim[d]->len)
+ return NC_EBADCHUNK;
+
+ /* Set the chunksizes for this variable. */
+ for (d = 0; d < var->ndims; d++)
+ var->chunksizes[d] = chunksizes[d];
+ }
+ }
+ else if (*storage == NC_CONTIGUOUS)
+ {
+ var->storage = NC_CONTIGUOUS;
+ }
+ else if (*storage == NC_COMPACT)
+ {
+ size_t ndata = 1;
- /* Set the chunksizes for this variable. */
+ /* Find the number of elements in the data. */
for (d = 0; d < var->ndims; d++)
- var->chunksizes[d] = chunksizes[d];
+ ndata *= var->dim[d]->len;
+
+ /* Ensure var is small enough to fit in compact
+ * storage. It must be <= 64 KB. */
+ if (ndata * var->type_info->size > SIXTY_FOUR_KB)
+ return NC_EVARSIZE;
+
+ var->storage = NC_COMPACT;
}
}
/* Is this a variable with a chunksize greater than the current
* cache size? */
- if (!var->contiguous && (deflate || contiguous))
+ if (var->storage == NC_CHUNKED)
{
/* Determine default chunksizes for this variable (do nothing
* for scalar vars). */
- if (var->chunksizes && !var->chunksizes[0])
+ if (var->chunksizes == NULL || var->chunksizes[0] == 0)
if ((retval = nc4_find_default_chunksizes2(grp, var)))
return retval;
@@ -831,8 +865,8 @@
}
/**
- * @internal Set compression settings on a variable. This is called by
- * nc_def_var_deflate().
+ * @internal Set zlib compression settings on a variable. This is
+ * called by nc_def_var_deflate().
*
* @param ncid File ID.
* @param varid Variable ID.
@@ -855,8 +889,17 @@
NC4_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
int deflate_level)
{
- return nc_def_var_extra(ncid, varid, &shuffle, &deflate,
- &deflate_level, NULL, NULL, NULL, NULL, NULL, NULL);
+ int stat = NC_NOERR;
+ unsigned int level = (unsigned int)deflate_level;
+ /* Set shuffle first */
+ if((stat = nc_def_var_extra(ncid, varid, &shuffle, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL))) goto done;
+ if(deflate)
+ stat = nc_def_var_filter(ncid, varid, H5Z_FILTER_DEFLATE,1,&level);
+ else
+ stat = nc_var_filter_remove(ncid, varid, H5Z_FILTER_DEFLATE);
+ if(stat) goto done;
+done:
+ return stat;
}
/**
@@ -892,7 +935,7 @@
*
* @param ncid File ID.
* @param varid Variable ID.
- * @param contiguous Pointer to contiguous setting.
+ * @param storage Pointer to storage setting.
* @param chunksizesp Array of chunksizes.
*
* @returns ::NC_NOERR No error.
@@ -907,10 +950,10 @@
* @author Ed Hartnett, Dennis Heimbigner
*/
int
-NC4_def_var_chunking(int ncid, int varid, int contiguous, const size_t *chunksizesp)
+NC4_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp)
{
return nc_def_var_extra(ncid, varid, NULL, NULL, NULL, NULL,
- &contiguous, chunksizesp, NULL, NULL, NULL);
+ &storage, chunksizesp, NULL, NULL, NULL);
}
/**
@@ -919,7 +962,7 @@
*
* @param ncid File ID.
* @param varid Variable ID.
- * @param contiguous Pointer to contiguous setting.
+ * @param storage Pointer to storage setting.
* @param chunksizesp Array of chunksizes.
*
* @returns ::NC_NOERR No error.
@@ -934,10 +977,10 @@
* @author Ed Hartnett
*/
int
-nc_def_var_chunking_ints(int ncid, int varid, int contiguous, int *chunksizesp)
+nc_def_var_chunking_ints(int ncid, int varid, int storage, int *chunksizesp)
{
- NC_VAR_INFO_T *var;
- size_t *cs;
+ NC_VAR_INFO_T *var = NULL;
+ size_t *cs = NULL;
int i, retval;
/* Get pointer to the var. */
@@ -955,7 +998,7 @@
cs[i] = chunksizesp[i];
retval = nc_def_var_extra(ncid, varid, NULL, NULL, NULL, NULL,
- &contiguous, cs, NULL, NULL, NULL);
+ &storage, cs, NULL, NULL, NULL);
if (var->ndims)
free(cs);
@@ -1021,100 +1064,27 @@
NULL, NULL, NULL, &endianness);
}
-/**
- * @internal Define filter settings. Called by nc_def_var_filter().
- *
- * @param ncid File ID.
- * @param varid Variable ID.
- * @param id Filter ID
- * @param nparams Number of parameters for filter.
- * @param parms Filter parameters.
- *
- * @returns ::NC_NOERR for success
- * @returns ::NC_EBADID Bad ncid.
- * @returns ::NC_ENOTVAR Invalid variable ID.
- * @returns ::NC_ENOTNC4 Attempting netcdf-4 operation on file that is
- * not netCDF-4/HDF5.
- * @returns ::NC_ELATEDEF Too late to change settings for this variable.
- * @returns ::NC_EFILTER Filter error.
- * @returns ::NC_EINVAL Invalid input
- * @author Dennis Heimbigner
- */
int
NC4_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams,
- const unsigned int* parms)
+ const unsigned int* params)
{
int retval = NC_NOERR;
NC *nc;
- NC_GRP_INFO_T *grp;
- NC_FILE_INFO_T *h5;
- NC_VAR_INFO_T *var;
+ NC_FILTER_OBJ_HDF5 spec;
LOG((2, "%s: ncid 0x%x varid %d", __func__, ncid, varid));
- /* Find info for this file and group, and set pointer to each. */
- if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
- return retval;
-
- assert(nc && grp && h5);
+ if((retval = NC_check_id(ncid,&nc))) return retval;
+ assert(nc);
- /* Find the var. */
- var = (NC_VAR_INFO_T*)ncindexith(grp->vars,varid);
- if(!var)
- return NC_ENOTVAR;
- assert(var->hdr.id == varid);
+ memset(&spec,0,sizeof(spec));
+ spec.hdr.format = NC_FILTER_FORMAT_HDF5;
+ spec.sort = NC_FILTER_SORT_SPEC;
+ spec.u.spec.filterid = id;
+ spec.u.spec.nparams = nparams;
+ spec.u.spec.params = (unsigned int*)params; /* Need to remove const */
- /* If the HDF5 dataset has already been created, then it is too
- * late to set all the extra stuff. */
- if (var->created)
- return NC_ELATEDEF;
-
- /* Can't turn on parallel and filter (for now). */
- if (h5->parallel == NC_TRUE)
- return NC_EINVAL;
-
-#ifdef HAVE_H5Z_SZIP
- if(id == H5Z_FILTER_SZIP) {
- if(nparams != 2)
- return NC_EFILTER; /* incorrect no. of parameters */
- }
-#else /*!HAVE_H5Z_SZIP*/
- if(id == H5Z_FILTER_SZIP)
- return NC_EFILTER; /* Not allowed */
-#endif
-
-#if 0
- {
- unsigned int fcfg = 0;
- herr_t herr = H5Zget_filter_info(id,&fcfg);
- if(herr < 0)
- return NC_EFILTER;
- if((H5Z_FILTER_CONFIG_ENCODE_ENABLED & fcfg) == 0
- || (H5Z_FILTER_CONFIG_DECODE_ENABLED & fcfg) == 0)
- return NC_EFILTER;
- }
-#endif /*0*/
-
- var->filterid = id;
- var->nparams = nparams;
- var->params = NULL;
- if(parms != NULL) {
- var->params = (unsigned int*)calloc(nparams,sizeof(unsigned int));
- if(var->params == NULL) return NC_ENOMEM;
- memcpy(var->params,parms,sizeof(unsigned int)*var->nparams);
- }
- /* Filter => chunking */
- var->contiguous = NC_FALSE;
- /* Determine default chunksizes for this variable unless already specified */
- if(var->chunksizes && !var->chunksizes[0]) {
- if((retval = nc4_find_default_chunksizes2(grp, var)))
- return retval;
- /* Adjust the cache. */
- if ((retval = nc4_adjust_var_cache(grp, var)))
- return retval;
- }
-
- return NC_NOERR;
+ return nc->dispatch->filter_actions(ncid,varid,NCFILTER_DEF,(NC_Filterobject*)&spec);
}
/**
@@ -1586,19 +1556,12 @@
endindex = start[d2]; /* fixup for zero read count */
if (!dim->unlimited)
{
-#ifdef RELAX_COORD_BOUND
/* Allow start to equal dim size if count is zero. */
if (start[d2] > (hssize_t)fdims[d2] ||
(start[d2] == (hssize_t)fdims[d2] && count[d2] > 0))
BAIL_QUIET(NC_EINVALCOORDS);
if (!zero_count && endindex >= fdims[d2])
BAIL_QUIET(NC_EEDGE);
-#else
- if (start[d2] >= (hssize_t)fdims[d2])
- BAIL_QUIET(NC_EINVALCOORDS);
- if (endindex >= fdims[d2])
- BAIL_QUIET(NC_EEDGE);
-#endif
}
}
@@ -1902,7 +1865,8 @@
#endif
/* Check dimension bounds. Remember that unlimited dimensions can
- * put data beyond their current length. */
+ * get data beyond the length of the dataset, but within the
+ * lengths of the unlimited dimension(s). */
for (d2 = 0; d2 < var->ndims; d2++)
{
hsize_t endindex = start[d2] + stride[d2] * (count[d2] - 1); /* last index read */
@@ -1920,45 +1884,41 @@
BAIL(retval);
/* Check for out of bound requests. */
-#ifdef RELAX_COORD_BOUND
/* Allow start to equal dim size if count is zero. */
if (start[d2] > (hssize_t)ulen ||
(start[d2] == (hssize_t)ulen && count[d2] > 0))
BAIL_QUIET(NC_EINVALCOORDS);
-#else
- if (start[d2] >= (hssize_t)ulen && ulen > 0)
- BAIL_QUIET(NC_EINVALCOORDS);
-#endif
if (count[d2] && endindex >= ulen)
BAIL_QUIET(NC_EEDGE);
- /* Things get a little tricky here. If we're getting
- a GET request beyond the end of this var's
- current length in an unlimited dimension, we'll
- later need to return the fill value for the
- variable. */
- if (start[d2] >= (hssize_t)fdims[d2])
- fill_value_size[d2] = count[d2];
- else if (endindex >= fdims[d2])
- fill_value_size[d2] = count[d2] - ((fdims[d2] - start[d2])/stride[d2]);
+ /* Things get a little tricky here. If we're getting a GET
+ request beyond the end of this var's current length in
+ an unlimited dimension, we'll later need to return the
+ fill value for the variable. */
+ if (!no_read)
+ {
+ if (start[d2] >= (hssize_t)fdims[d2])
+ fill_value_size[d2] = count[d2];
+ else if (endindex >= fdims[d2])
+ fill_value_size[d2] = count[d2] - ((fdims[d2] - start[d2])/stride[d2]);
+ else
+ fill_value_size[d2] = 0;
+ count[d2] -= fill_value_size[d2];
+ if (count[d2] == 0)
+ no_read++;
+ if (fill_value_size[d2])
+ provide_fill++;
+ }
else
- fill_value_size[d2] = 0;
- count[d2] -= fill_value_size[d2];
- if (fill_value_size[d2])
- provide_fill++;
+ fill_value_size[d2] = count[d2];
}
else /* Dim is not unlimited. */
{
/* Check for out of bound requests. */
-#ifdef RELAX_COORD_BOUND
/* Allow start to equal dim size if count is zero. */
if (start[d2] > (hssize_t)fdims[d2] ||
(start[d2] == (hssize_t)fdims[d2] && count[d2] > 0))
BAIL_QUIET(NC_EINVALCOORDS);
-#else
- if (start[d2] >= (hssize_t)fdims[d2])
- BAIL_QUIET(NC_EINVALCOORDS);
-#endif
if (count[d2] && endindex >= fdims[d2])
BAIL_QUIET(NC_EEDGE);
@@ -2207,7 +2167,7 @@
* @param deflatep Gets deflate setting.
* @param deflate_levelp Gets deflate level.
* @param fletcher32p Gets fletcher32 setting.
- * @param contiguousp Gets contiguous setting.
+ * @param storagep Gets storage setting.
* @param chunksizesp Gets chunksizes.
* @param no_fill Gets fill mode.
* @param fill_valuep Gets fill value.
@@ -2228,10 +2188,10 @@
int
NC4_HDF5_inq_var_all(int ncid, int varid, char *name, nc_type *xtypep,
int *ndimsp, int *dimidsp, int *nattsp,
- int *shufflep, int *deflatep, int *deflate_levelp,
- int *fletcher32p, int *contiguousp, size_t *chunksizesp,
+ int *shufflep, int *unused4, int *unused5,
+ int *fletcher32p, int *storagep, size_t *chunksizesp,
int *no_fill, void *fill_valuep, int *endiannessp,
- unsigned int *idp, size_t *nparamsp, unsigned int *params)
+ unsigned int *unused1, size_t *unused2, unsigned int *unused3)
{
NC_FILE_INFO_T *h5;
NC_GRP_INFO_T *grp;
@@ -2250,9 +2210,9 @@
/* Now that lazy atts have been read, use the libsrc4 function to
* get the answers. */
return NC4_inq_var_all(ncid, varid, name, xtypep, ndimsp, dimidsp, nattsp,
- shufflep, deflatep, deflate_levelp, fletcher32p,
- contiguousp, chunksizesp, no_fill, fill_valuep,
- endiannessp, idp, nparamsp, params);
+ shufflep, unused4, unused5, fletcher32p,
+ storagep, chunksizesp, no_fill, fill_valuep,
+ endiannessp, unused1, unused2, unused3);
}
/**
@@ -2314,7 +2274,7 @@
*
* @param ncid File ID.
* @param varid Variable ID.
- * @param size Size in bytes to set cache.
+ * @param size Size in MB to set cache.
* @param nelems Number of elements in cache.
* @param preemption Controls cache swapping.
*
@@ -2329,6 +2289,9 @@
size_t real_nelems = H5D_CHUNK_CACHE_NSLOTS_DEFAULT;
float real_preemption = CHUNK_CACHE_PREEMPTION;
+ LOG((1, "%s: ncid 0x%x varid %d size %d nelems %d preemption %d",
+ __func__, ncid, varid, size, nelems, preemptions));
+
if (size >= 0)
real_size = ((size_t) size) * MEGABYTE;
diff -Nru netcdf-parallel-4.7.3/libhdf5/Makefile.am netcdf-parallel-4.7.4/libhdf5/Makefile.am
--- netcdf-parallel-4.7.3/libhdf5/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -15,7 +15,8 @@
# The source files.
libnchdf5_la_SOURCES = nc4hdf.c nc4info.c hdf5file.c hdf5attr.c \
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c hdf5open.c \
-hdf5var.c nc4mem.c nc4memcb.c hdf5cache.c hdf5dispatch.c
+hdf5var.c nc4mem.c nc4memcb.c hdf5cache.c hdf5dispatch.c hdf5filter.c \
+hdf5debug.c hdf5debug.h
if ENABLE_BYTERANGE
libnchdf5_la_SOURCES += H5FDhttp.c H5FDhttp.h
diff -Nru netcdf-parallel-4.7.3/libhdf5/Makefile.in netcdf-parallel-4.7.4/libhdf5/Makefile.in
--- netcdf-parallel-4.7.3/libhdf5/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,7 +124,8 @@
am__libnchdf5_la_SOURCES_DIST = nc4hdf.c nc4info.c hdf5file.c \
hdf5attr.c hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c \
hdf5create.c hdf5open.c hdf5var.c nc4mem.c nc4memcb.c \
- hdf5cache.c hdf5dispatch.c H5FDhttp.c H5FDhttp.h
+ hdf5cache.c hdf5dispatch.c hdf5filter.c hdf5debug.c \
+ hdf5debug.h H5FDhttp.c H5FDhttp.h
@ENABLE_BYTERANGE_TRUE@am__objects_1 = libnchdf5_la-H5FDhttp.lo
am_libnchdf5_la_OBJECTS = libnchdf5_la-nc4hdf.lo \
libnchdf5_la-nc4info.lo libnchdf5_la-hdf5file.lo \
@@ -134,6 +135,7 @@
libnchdf5_la-hdf5open.lo libnchdf5_la-hdf5var.lo \
libnchdf5_la-nc4mem.lo libnchdf5_la-nc4memcb.lo \
libnchdf5_la-hdf5cache.lo libnchdf5_la-hdf5dispatch.lo \
+ libnchdf5_la-hdf5filter.lo libnchdf5_la-hdf5debug.lo \
$(am__objects_1)
libnchdf5_la_OBJECTS = $(am_libnchdf5_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -159,9 +161,11 @@
./$(DEPDIR)/libnchdf5_la-hdf5attr.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5cache.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5create.Plo \
+ ./$(DEPDIR)/libnchdf5_la-hdf5debug.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5dim.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5dispatch.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5file.Plo \
+ ./$(DEPDIR)/libnchdf5_la-hdf5filter.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5grp.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5internal.Plo \
./$(DEPDIR)/libnchdf5_la-hdf5open.Plo \
@@ -284,8 +288,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -325,11 +331,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -432,7 +438,8 @@
libnchdf5_la_SOURCES = nc4hdf.c nc4info.c hdf5file.c hdf5attr.c \
hdf5dim.c hdf5grp.c hdf5type.c hdf5internal.c hdf5create.c \
hdf5open.c hdf5var.c nc4mem.c nc4memcb.c hdf5cache.c \
- hdf5dispatch.c $(am__append_2)
+ hdf5dispatch.c hdf5filter.c hdf5debug.c hdf5debug.h \
+ $(am__append_2)
# Package this for cmake build.
EXTRA_DIST = CMakeLists.txt
@@ -495,9 +502,11 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5attr.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5cache.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5create.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5debug.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5dim.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5dispatch.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5file.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5filter.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5grp.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5internal.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnchdf5_la-hdf5open.Plo@am__quote@ # am--include-marker
@@ -643,6 +652,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnchdf5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnchdf5_la-hdf5dispatch.lo `test -f 'hdf5dispatch.c' || echo '$(srcdir)/'`hdf5dispatch.c
+libnchdf5_la-hdf5filter.lo: hdf5filter.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnchdf5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnchdf5_la-hdf5filter.lo -MD -MP -MF $(DEPDIR)/libnchdf5_la-hdf5filter.Tpo -c -o libnchdf5_la-hdf5filter.lo `test -f 'hdf5filter.c' || echo '$(srcdir)/'`hdf5filter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnchdf5_la-hdf5filter.Tpo $(DEPDIR)/libnchdf5_la-hdf5filter.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdf5filter.c' object='libnchdf5_la-hdf5filter.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnchdf5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnchdf5_la-hdf5filter.lo `test -f 'hdf5filter.c' || echo '$(srcdir)/'`hdf5filter.c
+
+libnchdf5_la-hdf5debug.lo: hdf5debug.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnchdf5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnchdf5_la-hdf5debug.lo -MD -MP -MF $(DEPDIR)/libnchdf5_la-hdf5debug.Tpo -c -o libnchdf5_la-hdf5debug.lo `test -f 'hdf5debug.c' || echo '$(srcdir)/'`hdf5debug.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnchdf5_la-hdf5debug.Tpo $(DEPDIR)/libnchdf5_la-hdf5debug.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hdf5debug.c' object='libnchdf5_la-hdf5debug.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnchdf5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnchdf5_la-hdf5debug.lo `test -f 'hdf5debug.c' || echo '$(srcdir)/'`hdf5debug.c
+
libnchdf5_la-H5FDhttp.lo: H5FDhttp.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnchdf5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnchdf5_la-H5FDhttp.lo -MD -MP -MF $(DEPDIR)/libnchdf5_la-H5FDhttp.Tpo -c -o libnchdf5_la-H5FDhttp.lo `test -f 'H5FDhttp.c' || echo '$(srcdir)/'`H5FDhttp.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libnchdf5_la-H5FDhttp.Tpo $(DEPDIR)/libnchdf5_la-H5FDhttp.Plo
@@ -810,9 +833,11 @@
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5attr.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5cache.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5create.Plo
+ -rm -f ./$(DEPDIR)/libnchdf5_la-hdf5debug.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5dim.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5dispatch.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5file.Plo
+ -rm -f ./$(DEPDIR)/libnchdf5_la-hdf5filter.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5grp.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5internal.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5open.Plo
@@ -871,9 +896,11 @@
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5attr.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5cache.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5create.Plo
+ -rm -f ./$(DEPDIR)/libnchdf5_la-hdf5debug.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5dim.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5dispatch.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5file.Plo
+ -rm -f ./$(DEPDIR)/libnchdf5_la-hdf5filter.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5grp.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5internal.Plo
-rm -f ./$(DEPDIR)/libnchdf5_la-hdf5open.Plo
diff -Nru netcdf-parallel-4.7.3/libhdf5/nc4hdf.c netcdf-parallel-4.7.4/libhdf5/nc4hdf.c
--- netcdf-parallel-4.7.3/libhdf5/nc4hdf.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/nc4hdf.c 2020-08-31 10:33:26.000000000 +0000
@@ -15,6 +15,9 @@
*/
#include "config.h"
+#include "netcdf.h"
+#include "nc4internal.h"
+#include "ncdispatch.h"
#include "hdf5internal.h"
#include
@@ -25,11 +28,6 @@
#define NC_HDF5_MAX_NAME 1024 /**< @internal Max size of HDF5 name. */
-/* WARNING: GLOBAL VARIABLE */
-
-/* Define list of registered filters */
-static NClist* filters = NULL;
-
/**
* @internal Flag attributes in a linked list as dirty.
*
@@ -907,27 +905,43 @@
BAIL(NC_EHDFERR);
}
- /* If the user wants to deflate the data, set that up now. */
- if (var->deflate) {
- if (H5Pset_deflate(plistid, var->deflate_level) < 0)
- BAIL(NC_EHDFERR);
- } else if(var->filterid) {
- /* Handle szip case here */
- if(var->filterid == H5Z_FILTER_SZIP) {
- int options_mask;
- int bits_per_pixel;
- if(var->nparams != 2)
- BAIL(NC_EFILTER);
- options_mask = (int)var->params[0];
- bits_per_pixel = (int)var->params[1];
- if(H5Pset_szip(plistid, options_mask, bits_per_pixel) < 0)
- BAIL(NC_EFILTER);
- } else {
- herr_t code = H5Pset_filter(plistid, var->filterid, H5Z_FLAG_MANDATORY, var->nparams, var->params);
- if(code < 0) {
- BAIL(NC_EFILTER);
+ /* If the user wants to compress the data, using either zlib
+ * (a.k.a deflate) or szip, or another filter, set that up now.
+ * Szip and zip can be turned on
+ * either directly with nc_def_var_szip/deflate(), or using
+ * nc_def_var_filter(). If the user
+ * has specified a filter, it will be applied here. */
+ if(var->filters != NULL) {
+ int j;
+ for(j=0;jfilters);j++) {
+ NC_FILTER_SPEC_HDF5* fi = (NC_FILTER_SPEC_HDF5*)nclistget(var->filters,j);
+ size_t nparams;
+ unsigned int* params;
+ nparams = fi->nparams;
+ params = fi->params;
+ if(fi->filterid == H5Z_FILTER_DEFLATE) {/* Handle zip case here */
+ unsigned level;
+ if(nparams != 1)
+ BAIL(NC_EFILTER);
+ level = (int)params[0];
+ if(H5Pset_deflate(plistid, level) < 0)
+ BAIL(NC_EFILTER);
+ } else if(fi->filterid == H5Z_FILTER_SZIP) {/* Handle szip case here */
+ int options_mask;
+ int bits_per_pixel;
+ if(nparams != 2)
+ BAIL(NC_EFILTER);
+ options_mask = (int)params[0];
+ bits_per_pixel = (int)params[1];
+ if(H5Pset_szip(plistid, options_mask, bits_per_pixel) < 0)
+ BAIL(NC_EFILTER);
+ } else {
+ herr_t code = H5Pset_filter(plistid, (unsigned int)fi->filterid, H5Z_FLAG_MANDATORY, nparams, params);
+ if(code < 0) {
+ BAIL(NC_EFILTER);
+ }
}
- }
+ }
}
/* If the user wants to fletcher error correction, set that up now. */
@@ -954,18 +968,20 @@
/* If there are no unlimited dims, and no filters, and the user
* has not specified chunksizes, use contiguous variable for
* better performance. */
- if (!var->shuffle && !var->deflate && !var->fletcher32 &&
+ if (!var->shuffle && !var->fletcher32 && nclistlength(var->filters) == 0 &&
(var->chunksizes == NULL || !var->chunksizes[0]) && !unlimdim)
- var->contiguous = NC_TRUE;
+ var->storage = NC_CONTIGUOUS;
- /* Gather current & maximum dimension sizes, along with chunk sizes */
+ /* Gather current & maximum dimension sizes, along with chunk
+ * sizes. */
for (d = 0; d < var->ndims; d++)
{
dim = var->dim[d];
assert(dim && dim->hdr.id == var->dimids[d]);
dimsize[d] = dim->unlimited ? NC_HDF5_UNLIMITED_DIMSIZE : dim->len;
maxdimsize[d] = dim->unlimited ? H5S_UNLIMITED : (hsize_t)dim->len;
- if (!var->contiguous) {
+ if (var->storage == NC_CHUNKED)
+ {
if (var->chunksizes[d])
chunksize[d] = var->chunksizes[d];
else
@@ -994,17 +1010,6 @@
}
}
- if (var->contiguous)
- {
- if (H5Pset_layout(plistid, H5D_CONTIGUOUS) < 0)
- BAIL(NC_EHDFERR);
- }
- else
- {
- if (H5Pset_chunk(plistid, var->ndims, chunksize) < 0)
- BAIL(NC_EHDFERR);
- }
-
/* Create the dataspace. */
if ((spaceid = H5Screate_simple(var->ndims, dimsize, maxdimsize)) < 0)
BAIL(NC_EHDFERR);
@@ -1015,13 +1020,32 @@
BAIL(NC_EHDFERR);
}
+ /* Set the var storage to contiguous, compact, or chunked. Don't
+ * try to set chunking for scalar vars, they will default to
+ * contiguous if not set to compact. */
+ if (var->storage == NC_CONTIGUOUS)
+ {
+ if (H5Pset_layout(plistid, H5D_CONTIGUOUS) < 0)
+ BAIL(NC_EHDFERR);
+ }
+ else if (var->storage == NC_COMPACT)
+ {
+ if (H5Pset_layout(plistid, H5D_COMPACT) < 0)
+ BAIL(NC_EHDFERR);
+ }
+ else if (var->ndims)
+ {
+ if (H5Pset_chunk(plistid, var->ndims, chunksize) < 0)
+ BAIL(NC_EHDFERR);
+ }
+
/* Turn on creation order tracking. */
if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
H5P_CRT_ORDER_INDEXED) < 0)
BAIL(NC_EHDFERR);
/* Set per-var chunk cache, for chunked datasets. */
- if (!var->contiguous && var->chunk_cache_size)
+ if (var->storage == NC_CHUNKED && var->chunk_cache_size)
if (H5Pset_chunk_cache(access_plistid, var->chunk_cache_nelems,
var->chunk_cache_size, var->chunk_cache_preemption) < 0)
BAIL(NC_EHDFERR);
@@ -1093,10 +1117,13 @@
* @internal Adjust the chunk cache of a var for better
* performance.
*
+ * @note For contiguous and compact storage vars, or when parallel I/O
+ * is in use, this function will do nothing and return ::NC_NOERR;
+ *
* @param grp Pointer to group info struct.
* @param var Pointer to var info struct.
*
- * @return NC_NOERR No error.
+ * @return ::NC_NOERR No error.
* @author Ed Hartnett
*/
int
@@ -1106,11 +1133,14 @@
int d;
int retval;
- /* Nothing to be done. */
- if (var->contiguous)
+ /* Nothing to be done for contiguous or compact data. */
+ if (var->storage != NC_CHUNKED)
return NC_NOERR;
+
#ifdef USE_PARALLEL4
- return NC_NOERR;
+ /* Don't set cache for files using parallel I/O. */
+ if (grp->nc4_info->parallel)
+ return NC_NOERR;
#endif
/* How many bytes in the chunk? */
@@ -2525,7 +2555,7 @@
return stat;
}
-static int NC4_get_strict_att(NC_FILE_INFO_T*);
+static int NC4_strict_att_exists(NC_FILE_INFO_T*);
static int NC4_walk(hid_t, int*);
/**
@@ -2557,11 +2587,12 @@
{
int stat;
int isnc4 = 0;
+ int exists;
int count;
/* Look for NC3_STRICT_ATT_NAME */
- isnc4 = NC4_get_strict_att(h5);
- if(isnc4 > 0)
+ exists = NC4_strict_att_exists(h5);
+ if(exists)
goto done;
/* attribute did not exist */
/* => last resort: walk the HDF5 file looking for markers */
@@ -2578,26 +2609,26 @@
}
/**
- * @internal Get the NC3 strict attribute.
+ * @internal See if the NC3 strict attribute exists.
*
* @param h5 Pointer to HDF5 file info struct.
*
- * @returns NC_NOERR No error.
+ * @returns 1 if error || exists; 0 otherwise
* @author Dennis Heimbigner.
*/
static int
-NC4_get_strict_att(NC_FILE_INFO_T *h5)
+NC4_strict_att_exists(NC_FILE_INFO_T *h5)
{
hid_t grpid = -1;
- hid_t attid = -1;
-
+ htri_t attr_exists;
+
/* Get root group ID. */
grpid = ((NC_HDF5_GRP_INFO_T *)(h5->root_grp->format_grp_info))->hdf_grpid;
- /* Try to extract the NC3_STRICT_ATT_NAME attribute */
- attid = H5Aopen_name(grpid, NC3_STRICT_ATT_NAME);
- H5Aclose(attid);
- return attid;
+ /* See if the NC3_STRICT_ATT_NAME attribute exists */
+ if ((attr_exists = H5Aexists(grpid, NC3_STRICT_ATT_NAME)) < 0)
+ return 1;
+ return (attr_exists?1:0);
}
/**
@@ -2666,121 +2697,22 @@
return ncstat;
}
-
-/**************************************************/
-/* Filter registration support */
-
-static int
-filterlookup(int id)
-{
- int i;
- if(filters == NULL)
- filters = nclistnew();
- for(i=0;iid == id) return i; /* return position */
- }
- return -1;
-}
-
-static void
-reclaiminfo(NC_FILTER_INFO* info)
-{
- if(info != NULL)
- nullfree(info->info);
- nullfree(info);
-}
-
-static int
-filterremove(int pos)
-{
- NC_FILTER_INFO* info = NULL;
- if(filters == NULL)
- filters = nclistnew();
- if(pos < 0 || pos >= nclistlength(filters))
- return NC_EINVAL;
- info = nclistget(filters,pos);
- reclaiminfo(info);
- nclistremove(filters,pos);
- return NC_NOERR;
-}
-
-static NC_FILTER_INFO*
-dupfilterinfo(NC_FILTER_INFO* info)
-{
- NC_FILTER_INFO* dup = NULL;
- if(info == NULL) goto fail;
- if(info->info == NULL) goto fail;
- if((dup = calloc(1,sizeof(NC_FILTER_INFO))) == NULL) goto fail;
- *dup = *info;
- if((dup->info = calloc(1,sizeof(H5Z_class2_t))) == NULL) goto fail;
- {
- H5Z_class2_t* h5dup = (H5Z_class2_t*)dup->info;
- H5Z_class2_t* h5info = (H5Z_class2_t*)info->info;
- *h5dup = *h5info;
- }
- return dup;
-fail:
- reclaiminfo(dup);
- return NULL;
-}
-
int
-nc4_filter_action(int op, int format, int id, NC_FILTER_INFO* info)
+NC4_hdf5_remove_filter(NC_VAR_INFO_T* var, unsigned int filterid)
{
int stat = NC_NOERR;
- H5Z_class2_t* h5filterinfo = NULL;
- herr_t herr;
- int pos = -1;
- NC_FILTER_INFO* dup = NULL;
-
- if(format != NC_FILTER_FORMAT_HDF5)
- {stat = NC_ENOTNC4; goto done;}
-
- switch (op) {
- case FILTER_REG: /* Ignore id argument */
- if(info == NULL || info->info == NULL)
- {stat = NC_EINVAL; goto done;}
- if(info->version != NC_FILTER_INFO_VERSION
- || info->format != NC_FILTER_FORMAT_HDF5)
- {stat = NC_ENOTNC4; goto done;}
- h5filterinfo = info->info;
- /* Another sanity check */
- if(info->id != h5filterinfo->id)
- {stat = NC_EINVAL; goto done;}
- /* See if this filter is already defined */
- if((pos = filterlookup(id)) >= 0)
- {stat = NC_ENAMEINUSE; goto done;} /* Already defined */
- if((herr = H5Zregister(h5filterinfo)) < 0)
- {stat = NC_EFILTER; goto done;}
- /* Save a copy of the passed in info */
- if((dup = dupfilterinfo(info)) == NULL)
- {stat = NC_ENOMEM; goto done;}
- nclistpush(filters,dup);
- break;
- case FILTER_UNREG:
- if(id <= 0)
- {stat = NC_ENOTNC4; goto done;}
- /* See if this filter is already defined */
- if((pos = filterlookup(id)) < 0)
- {stat = NC_EFILTER; goto done;} /* Not defined */
- if((herr = H5Zunregister(id)) < 0)
- {stat = NC_EFILTER; goto done;}
- if((stat=filterremove(pos))) goto done;
- break;
- case FILTER_INQ:
- if(id <= 0)
- {stat = NC_ENOTNC4; goto done;}
- /* Look up the id in our local table */
- if((pos = filterlookup(id)) < 0)
- {stat = NC_EFILTER; goto done;} /* Not defined */
- if(info != NULL) {
- *info = *((NC_FILTER_INFO*)nclistget(filters,pos));
- }
- break;
- default:
- {stat = NC_EINTERNAL; goto done;}
- }
+ NC_HDF5_VAR_INFO_T *hdf5_var;
+ hid_t propid = -1;
+ herr_t herr = -1;
+ H5Z_filter_t hft;
+
+ hdf5_var = (NC_HDF5_VAR_INFO_T *)var->format_var_info;
+ if ((propid = H5Dget_create_plist(hdf5_var->hdf_datasetid)) < 0)
+ {stat = NC_EHDFERR; goto done;}
+
+ hft = filterid;
+ if((herr = H5Premove_filter(propid,hft)) < 0)
+ {stat = NC_EHDFERR; goto done;}
done:
return stat;
-}
+}
diff -Nru netcdf-parallel-4.7.3/libhdf5/nc4info.c netcdf-parallel-4.7.4/libhdf5/nc4info.c
--- netcdf-parallel-4.7.3/libhdf5/nc4info.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libhdf5/nc4info.c 2020-08-31 10:33:26.000000000 +0000
@@ -198,6 +198,8 @@
provenance->superblockversion = superblock;
/* Read the _NCProperties value from the file */
+ /* We do not return a size and assume the size is that upto the
+ first nul character */
if((ncstat = NC4_read_ncproperties(file,&propstring))) goto done;
provenance->ncproperties = propstring;
propstring = NULL;
diff -Nru netcdf-parallel-4.7.3/liblib/Makefile.am netcdf-parallel-4.7.4/liblib/Makefile.am
--- netcdf-parallel-4.7.3/liblib/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/liblib/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -18,7 +18,7 @@
# for information regarding incrementing `-version-info`.
##
-libnetcdf_la_LDFLAGS = -version-info 17:1:2
+libnetcdf_la_LDFLAGS = -version-info 18:0:0
libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS}
libnetcdf_la_LIBADD =
diff -Nru netcdf-parallel-4.7.3/liblib/Makefile.in netcdf-parallel-4.7.4/liblib/Makefile.in
--- netcdf-parallel-4.7.3/liblib/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/liblib/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -321,8 +321,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -362,11 +364,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -467,7 +469,7 @@
# These linker flags specify libtool version info.
# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
# for information regarding incrementing `-version-info`.
-libnetcdf_la_LDFLAGS = -version-info 17:1:2
+libnetcdf_la_LDFLAGS = -version-info 18:0:0
libnetcdf_la_CPPFLAGS = ${AM_CPPFLAGS}
# The output library will always include netcdf3 and dispatch
diff -Nru netcdf-parallel-4.7.3/libnetcdf.settings.in netcdf-parallel-4.7.4/libnetcdf.settings.in
--- netcdf-parallel-4.7.3/libnetcdf.settings.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libnetcdf.settings.in 2020-08-31 10:33:26.000000000 +0000
@@ -40,3 +40,6 @@
CDF5 Support: @HAS_CDF5@
ERANGE Fill Support: @HAS_ERANGE_FILL@
Relaxed Boundary Check: @RELAX_COORD_BOUND@
+SZIP Support: @HAS_SZLIB@
+SZIP Write Support: @HAS_SZLIB_WRITE@
+Parallel Filters: @HAS_PAR_FILTERS@
diff -Nru netcdf-parallel-4.7.3/libsrc/Makefile.in netcdf-parallel-4.7.4/libsrc/Makefile.in
--- netcdf-parallel-4.7.3/libsrc/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -327,8 +327,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -368,11 +370,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/libsrc/nc3dispatch.c netcdf-parallel-4.7.4/libsrc/nc3dispatch.c
--- netcdf-parallel-4.7.3/libsrc/nc3dispatch.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/nc3dispatch.c 2020-08-31 10:33:26.000000000 +0000
@@ -81,7 +81,7 @@
static const NC_Dispatch NC3_dispatcher = {
NC_FORMATX_NC3,
-
+NC_DISPATCH_VERSION,
NC3_create,
NC3_open,
@@ -164,6 +164,7 @@
NC3_set_var_chunk_cache,
NC3_get_var_chunk_cache,
+NC_NOTNC4_filter_actions,
};
const NC_Dispatch* NC3_dispatch_table = NULL; /*!< NC3 Dispatch table, moved here from ddispatch.c */
diff -Nru netcdf-parallel-4.7.3/libsrc/nc3internal.c netcdf-parallel-4.7.4/libsrc/nc3internal.c
--- netcdf-parallel-4.7.3/libsrc/nc3internal.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/nc3internal.c 2020-08-31 10:33:26.000000000 +0000
@@ -1471,11 +1471,11 @@
#ifdef USE_FSYNC
/* may improve concurrent access, but slows performance if
* called frequently */
-#ifndef WIN32
+#ifndef _WIN32
status = fsync(nc3->nciop->fd);
#else
status = _commit(nc3->nciop->fd);
-#endif /* WIN32 */
+#endif /* _WIN32 */
#endif /* USE_FSYNC */
return status;
diff -Nru netcdf-parallel-4.7.3/libsrc/ncFile.c netcdf-parallel-4.7.4/libsrc/ncFile.c
--- netcdf-parallel-4.7.3/libsrc/ncFile.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/ncFile.c 2020-08-31 10:33:26.000000000 +0000
@@ -159,11 +159,11 @@
#ifdef HAVE_FSYNC
#ifdef USE_FSYNC
fd = fileno(state->file);
-#ifndef WIN32
+#ifndef _WIN32
fsync(fd);
#else
_commit(fd);
-#endif /* WIN32 */
+#endif /* _WIN32 */
#endif
#endif
return NC_NOERR;
diff -Nru netcdf-parallel-4.7.3/libsrc/pstdint.h netcdf-parallel-4.7.4/libsrc/pstdint.h
--- netcdf-parallel-4.7.3/libsrc/pstdint.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/pstdint.h 2020-08-31 10:33:26.000000000 +0000
@@ -674,7 +674,7 @@
# else
# define stdint_intptr_bits 32
# endif
-# elif defined (__i386__) || defined (_WIN32) || defined (WIN32)
+# elif defined (__i386__) || defined (_WIN32)
# define stdint_intptr_bits 32
# elif defined (__INTEL_COMPILER)
/* TODO -- what will Intel do about x86-64? */
diff -Nru netcdf-parallel-4.7.3/libsrc/putget.c netcdf-parallel-4.7.4/libsrc/putget.c
--- netcdf-parallel-4.7.3/libsrc/putget.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/putget.c 2020-08-31 10:33:26.000000000 +0000
@@ -923,11 +923,7 @@
{
if(*coord > X_UINT_MAX) /* rkr: bug fix from previous X_INT_MAX */
return NC_EINVALCOORDS; /* sanity check */
-#ifdef RELAX_COORD_BOUND
if(NC_readonly(ncp) && *coord > NC_get_numrecs(ncp))
-#else
- if(NC_readonly(ncp) && *coord >= NC_get_numrecs(ncp))
-#endif
{
if(!NC_doNsync(ncp))
return NC_EINVALCOORDS;
@@ -937,11 +933,7 @@
const int status = read_numrecs(ncp);
if(status != NC_NOERR)
return status;
-#ifdef RELAX_COORD_BOUND
if(*coord > NC_get_numrecs(ncp))
-#else
- if(*coord >= NC_get_numrecs(ncp))
-#endif
return NC_EINVALCOORDS;
}
}
@@ -968,11 +960,7 @@
#endif /* CDEBUG */
/* cast needed for braindead systems with signed size_t */
-#ifdef RELAX_COORD_BOUND
if((unsigned long) *ip > (unsigned long) *up )
-#else
- if((unsigned long) *ip >= (unsigned long) *up )
-#endif
return NC_EINVALCOORDS;
}
@@ -996,11 +984,9 @@
if(IS_RECVAR(varp))
{
-#ifdef RELAX_COORD_BOUND
if (NC_readonly(ncp) &&
(start[0] == NC_get_numrecs(ncp) && edges[0] > 0))
return(NC_EINVALCOORDS);
-#endif
start++;
edges++;
shp++;
@@ -1008,10 +994,8 @@
for(; start < end; start++, edges++, shp++)
{
-#ifdef RELAX_COORD_BOUND
if ((unsigned long) *start == *shp && *edges > 0)
return(NC_EINVALCOORDS);
-#endif
/* cast needed for braindead systems with signed size_t */
if((unsigned long) *edges > *shp ||
(unsigned long) *start + (unsigned long) *edges > *shp)
@@ -1065,18898 +1049,18898 @@
}
-#line 707
+#line 691
static int
-#line 708
+#line 692
putNCvx_char_char(NC3_INFO* ncp, const NC_var *varp,
-#line 708
+#line 692
const size_t *start, size_t nelems, const char *value)
-#line 708
+#line 692
{
-#line 708
+#line 692
off_t offset = NC_varoffset(ncp, varp, start);
-#line 708
+#line 692
size_t remaining = varp->xsz * nelems;
-#line 708
+#line 692
int status = NC_NOERR;
-#line 708
+#line 692
void *xp;
-#line 708
+#line 692
void *fillp=NULL;
-#line 708
+#line 692
-#line 708
+#line 692
if(nelems == 0)
-#line 708
+#line 692
return NC_NOERR;
-#line 708
+#line 692
-#line 708
+#line 692
assert(value != NULL);
-#line 708
+#line 692
-#line 708
+#line 692
#ifdef ERANGE_FILL
-#line 708
+#line 692
fillp = malloc(varp->xsz);
-#line 708
+#line 692
status = NC3_inq_var_fill(varp, fillp);
-#line 708
+#line 692
#endif
-#line 708
+#line 692
-#line 708
+#line 692
for(;;)
-#line 708
+#line 692
{
-#line 708
+#line 692
size_t extent = MIN(remaining, ncp->chunk);
-#line 708
+#line 692
size_t nput = ncx_howmany(varp->type, extent);
-#line 708
+#line 692
-#line 708
+#line 692
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 708
+#line 692
RGN_WRITE, &xp);
-#line 708
+#line 692
if(lstatus != NC_NOERR)
-#line 708
+#line 692
return lstatus;
-#line 708
+#line 692
-#line 708
+#line 692
lstatus = ncx_putn_char_char(&xp, nput, value );
-#line 708
+#line 692
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 708
+#line 692
{
-#line 708
+#line 692
/* not fatal to the loop */
-#line 708
+#line 692
status = lstatus;
-#line 708
+#line 692
}
-#line 708
+#line 692
-#line 708
+#line 692
(void) ncio_rel(ncp->nciop, offset,
-#line 708
+#line 692
RGN_MODIFIED);
-#line 708
+#line 692
-#line 708
+#line 692
remaining -= extent;
-#line 708
+#line 692
if(remaining == 0)
-#line 708
+#line 692
break; /* normal loop exit */
-#line 708
+#line 692
offset += (off_t)extent;
-#line 708
+#line 692
value += nput;
-#line 708
+#line 692
-#line 708
+#line 692
}
-#line 708
+#line 692
#ifdef ERANGE_FILL
-#line 708
+#line 692
free(fillp);
-#line 708
+#line 692
#endif
-#line 708
+#line 692
-#line 708
+#line 692
return status;
-#line 708
+#line 692
}
-#line 708
+#line 692
static int
-#line 710
+#line 694
putNCvx_schar_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 710
+#line 694
const size_t *start, size_t nelems, const schar *value)
-#line 710
+#line 694
{
-#line 710
+#line 694
off_t offset = NC_varoffset(ncp, varp, start);
-#line 710
+#line 694
size_t remaining = varp->xsz * nelems;
-#line 710
+#line 694
int status = NC_NOERR;
-#line 710
+#line 694
void *xp;
-#line 710
+#line 694
void *fillp=NULL;
-#line 710
+#line 694
-#line 710
+#line 694
if(nelems == 0)
-#line 710
+#line 694
return NC_NOERR;
-#line 710
+#line 694
-#line 710
+#line 694
assert(value != NULL);
-#line 710
+#line 694
-#line 710
+#line 694
#ifdef ERANGE_FILL
-#line 710
+#line 694
fillp = malloc(varp->xsz);
-#line 710
+#line 694
status = NC3_inq_var_fill(varp, fillp);
-#line 710
+#line 694
#endif
-#line 710
+#line 694
-#line 710
+#line 694
for(;;)
-#line 710
+#line 694
{
-#line 710
+#line 694
size_t extent = MIN(remaining, ncp->chunk);
-#line 710
+#line 694
size_t nput = ncx_howmany(varp->type, extent);
-#line 710
+#line 694
-#line 710
+#line 694
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 710
+#line 694
RGN_WRITE, &xp);
-#line 710
+#line 694
if(lstatus != NC_NOERR)
-#line 710
+#line 694
return lstatus;
-#line 710
+#line 694
-#line 710
+#line 694
lstatus = ncx_putn_schar_schar(&xp, nput, value ,fillp);
-#line 710
+#line 694
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 710
+#line 694
{
-#line 710
+#line 694
/* not fatal to the loop */
-#line 710
+#line 694
status = lstatus;
-#line 710
+#line 694
}
-#line 710
+#line 694
-#line 710
+#line 694
(void) ncio_rel(ncp->nciop, offset,
-#line 710
+#line 694
RGN_MODIFIED);
-#line 710
+#line 694
-#line 710
+#line 694
remaining -= extent;
-#line 710
+#line 694
if(remaining == 0)
-#line 710
+#line 694
break; /* normal loop exit */
-#line 710
+#line 694
offset += (off_t)extent;
-#line 710
+#line 694
value += nput;
-#line 710
+#line 694
-#line 710
+#line 694
}
-#line 710
+#line 694
#ifdef ERANGE_FILL
-#line 710
+#line 694
free(fillp);
-#line 710
+#line 694
#endif
-#line 710
+#line 694
-#line 710
+#line 694
return status;
-#line 710
+#line 694
}
-#line 710
+#line 694
static int
-#line 711
+#line 695
putNCvx_schar_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 711
+#line 695
const size_t *start, size_t nelems, const uchar *value)
-#line 711
+#line 695
{
-#line 711
+#line 695
off_t offset = NC_varoffset(ncp, varp, start);
-#line 711
+#line 695
size_t remaining = varp->xsz * nelems;
-#line 711
+#line 695
int status = NC_NOERR;
-#line 711
+#line 695
void *xp;
-#line 711
+#line 695
void *fillp=NULL;
-#line 711
+#line 695
-#line 711
+#line 695
if(nelems == 0)
-#line 711
+#line 695
return NC_NOERR;
-#line 711
+#line 695
-#line 711
+#line 695
assert(value != NULL);
-#line 711
+#line 695
-#line 711
+#line 695
#ifdef ERANGE_FILL
-#line 711
+#line 695
fillp = malloc(varp->xsz);
-#line 711
+#line 695
status = NC3_inq_var_fill(varp, fillp);
-#line 711
+#line 695
#endif
-#line 711
+#line 695
-#line 711
+#line 695
for(;;)
-#line 711
+#line 695
{
-#line 711
+#line 695
size_t extent = MIN(remaining, ncp->chunk);
-#line 711
+#line 695
size_t nput = ncx_howmany(varp->type, extent);
-#line 711
+#line 695
-#line 711
+#line 695
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 711
+#line 695
RGN_WRITE, &xp);
-#line 711
+#line 695
if(lstatus != NC_NOERR)
-#line 711
+#line 695
return lstatus;
-#line 711
+#line 695
-#line 711
+#line 695
lstatus = ncx_putn_schar_uchar(&xp, nput, value ,fillp);
-#line 711
+#line 695
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 711
+#line 695
{
-#line 711
+#line 695
/* not fatal to the loop */
-#line 711
+#line 695
status = lstatus;
-#line 711
+#line 695
}
-#line 711
+#line 695
-#line 711
+#line 695
(void) ncio_rel(ncp->nciop, offset,
-#line 711
+#line 695
RGN_MODIFIED);
-#line 711
+#line 695
-#line 711
+#line 695
remaining -= extent;
-#line 711
+#line 695
if(remaining == 0)
-#line 711
+#line 695
break; /* normal loop exit */
-#line 711
+#line 695
offset += (off_t)extent;
-#line 711
+#line 695
value += nput;
-#line 711
+#line 695
-#line 711
+#line 695
}
-#line 711
+#line 695
#ifdef ERANGE_FILL
-#line 711
+#line 695
free(fillp);
-#line 711
+#line 695
#endif
-#line 711
+#line 695
-#line 711
+#line 695
return status;
-#line 711
+#line 695
}
-#line 711
+#line 695
static int
-#line 712
+#line 696
putNCvx_schar_short(NC3_INFO* ncp, const NC_var *varp,
-#line 712
+#line 696
const size_t *start, size_t nelems, const short *value)
-#line 712
+#line 696
{
-#line 712
+#line 696
off_t offset = NC_varoffset(ncp, varp, start);
-#line 712
+#line 696
size_t remaining = varp->xsz * nelems;
-#line 712
+#line 696
int status = NC_NOERR;
-#line 712
+#line 696
void *xp;
-#line 712
+#line 696
void *fillp=NULL;
-#line 712
+#line 696
-#line 712
+#line 696
if(nelems == 0)
-#line 712
+#line 696
return NC_NOERR;
-#line 712
+#line 696
-#line 712
+#line 696
assert(value != NULL);
-#line 712
+#line 696
-#line 712
+#line 696
#ifdef ERANGE_FILL
-#line 712
+#line 696
fillp = malloc(varp->xsz);
-#line 712
+#line 696
status = NC3_inq_var_fill(varp, fillp);
-#line 712
+#line 696
#endif
-#line 712
+#line 696
-#line 712
+#line 696
for(;;)
-#line 712
+#line 696
{
-#line 712
+#line 696
size_t extent = MIN(remaining, ncp->chunk);
-#line 712
+#line 696
size_t nput = ncx_howmany(varp->type, extent);
-#line 712
+#line 696
-#line 712
+#line 696
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 712
+#line 696
RGN_WRITE, &xp);
-#line 712
+#line 696
if(lstatus != NC_NOERR)
-#line 712
+#line 696
return lstatus;
-#line 712
+#line 696
-#line 712
+#line 696
lstatus = ncx_putn_schar_short(&xp, nput, value ,fillp);
-#line 712
+#line 696
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 712
+#line 696
{
-#line 712
+#line 696
/* not fatal to the loop */
-#line 712
+#line 696
status = lstatus;
-#line 712
+#line 696
}
-#line 712
+#line 696
-#line 712
+#line 696
(void) ncio_rel(ncp->nciop, offset,
-#line 712
+#line 696
RGN_MODIFIED);
-#line 712
+#line 696
-#line 712
+#line 696
remaining -= extent;
-#line 712
+#line 696
if(remaining == 0)
-#line 712
+#line 696
break; /* normal loop exit */
-#line 712
+#line 696
offset += (off_t)extent;
-#line 712
+#line 696
value += nput;
-#line 712
+#line 696
-#line 712
+#line 696
}
-#line 712
+#line 696
#ifdef ERANGE_FILL
-#line 712
+#line 696
free(fillp);
-#line 712
+#line 696
#endif
-#line 712
+#line 696
-#line 712
+#line 696
return status;
-#line 712
+#line 696
}
-#line 712
+#line 696
static int
-#line 713
+#line 697
putNCvx_schar_int(NC3_INFO* ncp, const NC_var *varp,
-#line 713
+#line 697
const size_t *start, size_t nelems, const int *value)
-#line 713
+#line 697
{
-#line 713
+#line 697
off_t offset = NC_varoffset(ncp, varp, start);
-#line 713
+#line 697
size_t remaining = varp->xsz * nelems;
-#line 713
+#line 697
int status = NC_NOERR;
-#line 713
+#line 697
void *xp;
-#line 713
+#line 697
void *fillp=NULL;
-#line 713
+#line 697
-#line 713
+#line 697
if(nelems == 0)
-#line 713
+#line 697
return NC_NOERR;
-#line 713
+#line 697
-#line 713
+#line 697
assert(value != NULL);
-#line 713
+#line 697
-#line 713
+#line 697
#ifdef ERANGE_FILL
-#line 713
+#line 697
fillp = malloc(varp->xsz);
-#line 713
+#line 697
status = NC3_inq_var_fill(varp, fillp);
-#line 713
+#line 697
#endif
-#line 713
+#line 697
-#line 713
+#line 697
for(;;)
-#line 713
+#line 697
{
-#line 713
+#line 697
size_t extent = MIN(remaining, ncp->chunk);
-#line 713
+#line 697
size_t nput = ncx_howmany(varp->type, extent);
-#line 713
+#line 697
-#line 713
+#line 697
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 713
+#line 697
RGN_WRITE, &xp);
-#line 713
+#line 697
if(lstatus != NC_NOERR)
-#line 713
+#line 697
return lstatus;
-#line 713
+#line 697
-#line 713
+#line 697
lstatus = ncx_putn_schar_int(&xp, nput, value ,fillp);
-#line 713
+#line 697
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 713
+#line 697
{
-#line 713
+#line 697
/* not fatal to the loop */
-#line 713
+#line 697
status = lstatus;
-#line 713
+#line 697
}
-#line 713
+#line 697
-#line 713
+#line 697
(void) ncio_rel(ncp->nciop, offset,
-#line 713
+#line 697
RGN_MODIFIED);
-#line 713
+#line 697
-#line 713
+#line 697
remaining -= extent;
-#line 713
+#line 697
if(remaining == 0)
-#line 713
+#line 697
break; /* normal loop exit */
-#line 713
+#line 697
offset += (off_t)extent;
-#line 713
+#line 697
value += nput;
-#line 713
+#line 697
-#line 713
+#line 697
}
-#line 713
+#line 697
#ifdef ERANGE_FILL
-#line 713
+#line 697
free(fillp);
-#line 713
+#line 697
#endif
-#line 713
+#line 697
-#line 713
+#line 697
return status;
-#line 713
+#line 697
}
-#line 713
+#line 697
static int
-#line 714
+#line 698
putNCvx_schar_float(NC3_INFO* ncp, const NC_var *varp,
-#line 714
+#line 698
const size_t *start, size_t nelems, const float *value)
-#line 714
+#line 698
{
-#line 714
+#line 698
off_t offset = NC_varoffset(ncp, varp, start);
-#line 714
+#line 698
size_t remaining = varp->xsz * nelems;
-#line 714
+#line 698
int status = NC_NOERR;
-#line 714
+#line 698
void *xp;
-#line 714
+#line 698
void *fillp=NULL;
-#line 714
+#line 698
-#line 714
+#line 698
if(nelems == 0)
-#line 714
+#line 698
return NC_NOERR;
-#line 714
+#line 698
-#line 714
+#line 698
assert(value != NULL);
-#line 714
+#line 698
-#line 714
+#line 698
#ifdef ERANGE_FILL
-#line 714
+#line 698
fillp = malloc(varp->xsz);
-#line 714
+#line 698
status = NC3_inq_var_fill(varp, fillp);
-#line 714
+#line 698
#endif
-#line 714
+#line 698
-#line 714
+#line 698
for(;;)
-#line 714
+#line 698
{
-#line 714
+#line 698
size_t extent = MIN(remaining, ncp->chunk);
-#line 714
+#line 698
size_t nput = ncx_howmany(varp->type, extent);
-#line 714
+#line 698
-#line 714
+#line 698
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 714
+#line 698
RGN_WRITE, &xp);
-#line 714
+#line 698
if(lstatus != NC_NOERR)
-#line 714
+#line 698
return lstatus;
-#line 714
+#line 698
-#line 714
+#line 698
lstatus = ncx_putn_schar_float(&xp, nput, value ,fillp);
-#line 714
+#line 698
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 714
+#line 698
{
-#line 714
+#line 698
/* not fatal to the loop */
-#line 714
+#line 698
status = lstatus;
-#line 714
+#line 698
}
-#line 714
+#line 698
-#line 714
+#line 698
(void) ncio_rel(ncp->nciop, offset,
-#line 714
+#line 698
RGN_MODIFIED);
-#line 714
+#line 698
-#line 714
+#line 698
remaining -= extent;
-#line 714
+#line 698
if(remaining == 0)
-#line 714
+#line 698
break; /* normal loop exit */
-#line 714
+#line 698
offset += (off_t)extent;
-#line 714
+#line 698
value += nput;
-#line 714
+#line 698
-#line 714
+#line 698
}
-#line 714
+#line 698
#ifdef ERANGE_FILL
-#line 714
+#line 698
free(fillp);
-#line 714
+#line 698
#endif
-#line 714
+#line 698
-#line 714
+#line 698
return status;
-#line 714
+#line 698
}
-#line 714
+#line 698
static int
-#line 715
+#line 699
putNCvx_schar_double(NC3_INFO* ncp, const NC_var *varp,
-#line 715
+#line 699
const size_t *start, size_t nelems, const double *value)
-#line 715
+#line 699
{
-#line 715
+#line 699
off_t offset = NC_varoffset(ncp, varp, start);
-#line 715
+#line 699
size_t remaining = varp->xsz * nelems;
-#line 715
+#line 699
int status = NC_NOERR;
-#line 715
+#line 699
void *xp;
-#line 715
+#line 699
void *fillp=NULL;
-#line 715
+#line 699
-#line 715
+#line 699
if(nelems == 0)
-#line 715
+#line 699
return NC_NOERR;
-#line 715
+#line 699
-#line 715
+#line 699
assert(value != NULL);
-#line 715
+#line 699
-#line 715
+#line 699
#ifdef ERANGE_FILL
-#line 715
+#line 699
fillp = malloc(varp->xsz);
-#line 715
+#line 699
status = NC3_inq_var_fill(varp, fillp);
-#line 715
+#line 699
#endif
-#line 715
+#line 699
-#line 715
+#line 699
for(;;)
-#line 715
+#line 699
{
-#line 715
+#line 699
size_t extent = MIN(remaining, ncp->chunk);
-#line 715
+#line 699
size_t nput = ncx_howmany(varp->type, extent);
-#line 715
+#line 699
-#line 715
+#line 699
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 715
+#line 699
RGN_WRITE, &xp);
-#line 715
+#line 699
if(lstatus != NC_NOERR)
-#line 715
+#line 699
return lstatus;
-#line 715
+#line 699
-#line 715
+#line 699
lstatus = ncx_putn_schar_double(&xp, nput, value ,fillp);
-#line 715
+#line 699
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 715
+#line 699
{
-#line 715
+#line 699
/* not fatal to the loop */
-#line 715
+#line 699
status = lstatus;
-#line 715
+#line 699
}
-#line 715
+#line 699
-#line 715
+#line 699
(void) ncio_rel(ncp->nciop, offset,
-#line 715
+#line 699
RGN_MODIFIED);
-#line 715
+#line 699
-#line 715
+#line 699
remaining -= extent;
-#line 715
+#line 699
if(remaining == 0)
-#line 715
+#line 699
break; /* normal loop exit */
-#line 715
+#line 699
offset += (off_t)extent;
-#line 715
+#line 699
value += nput;
-#line 715
+#line 699
-#line 715
+#line 699
}
-#line 715
+#line 699
#ifdef ERANGE_FILL
-#line 715
+#line 699
free(fillp);
-#line 715
+#line 699
#endif
-#line 715
+#line 699
-#line 715
+#line 699
return status;
-#line 715
+#line 699
}
-#line 715
+#line 699
static int
-#line 716
+#line 700
putNCvx_schar_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 716
+#line 700
const size_t *start, size_t nelems, const longlong *value)
-#line 716
+#line 700
{
-#line 716
+#line 700
off_t offset = NC_varoffset(ncp, varp, start);
-#line 716
+#line 700
size_t remaining = varp->xsz * nelems;
-#line 716
+#line 700
int status = NC_NOERR;
-#line 716
+#line 700
void *xp;
-#line 716
+#line 700
void *fillp=NULL;
-#line 716
+#line 700
-#line 716
+#line 700
if(nelems == 0)
-#line 716
+#line 700
return NC_NOERR;
-#line 716
+#line 700
-#line 716
+#line 700
assert(value != NULL);
-#line 716
+#line 700
-#line 716
+#line 700
#ifdef ERANGE_FILL
-#line 716
+#line 700
fillp = malloc(varp->xsz);
-#line 716
+#line 700
status = NC3_inq_var_fill(varp, fillp);
-#line 716
+#line 700
#endif
-#line 716
+#line 700
-#line 716
+#line 700
for(;;)
-#line 716
+#line 700
{
-#line 716
+#line 700
size_t extent = MIN(remaining, ncp->chunk);
-#line 716
+#line 700
size_t nput = ncx_howmany(varp->type, extent);
-#line 716
+#line 700
-#line 716
+#line 700
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 716
+#line 700
RGN_WRITE, &xp);
-#line 716
+#line 700
if(lstatus != NC_NOERR)
-#line 716
+#line 700
return lstatus;
-#line 716
+#line 700
-#line 716
+#line 700
lstatus = ncx_putn_schar_longlong(&xp, nput, value ,fillp);
-#line 716
+#line 700
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 716
+#line 700
{
-#line 716
+#line 700
/* not fatal to the loop */
-#line 716
+#line 700
status = lstatus;
-#line 716
+#line 700
}
-#line 716
+#line 700
-#line 716
+#line 700
(void) ncio_rel(ncp->nciop, offset,
-#line 716
+#line 700
RGN_MODIFIED);
-#line 716
+#line 700
-#line 716
+#line 700
remaining -= extent;
-#line 716
+#line 700
if(remaining == 0)
-#line 716
+#line 700
break; /* normal loop exit */
-#line 716
+#line 700
offset += (off_t)extent;
-#line 716
+#line 700
value += nput;
-#line 716
+#line 700
-#line 716
+#line 700
}
-#line 716
+#line 700
#ifdef ERANGE_FILL
-#line 716
+#line 700
free(fillp);
-#line 716
+#line 700
#endif
-#line 716
+#line 700
-#line 716
+#line 700
return status;
-#line 716
+#line 700
}
-#line 716
+#line 700
static int
-#line 717
+#line 701
putNCvx_schar_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 717
+#line 701
const size_t *start, size_t nelems, const ushort *value)
-#line 717
+#line 701
{
-#line 717
+#line 701
off_t offset = NC_varoffset(ncp, varp, start);
-#line 717
+#line 701
size_t remaining = varp->xsz * nelems;
-#line 717
+#line 701
int status = NC_NOERR;
-#line 717
+#line 701
void *xp;
-#line 717
+#line 701
void *fillp=NULL;
-#line 717
+#line 701
-#line 717
+#line 701
if(nelems == 0)
-#line 717
+#line 701
return NC_NOERR;
-#line 717
+#line 701
-#line 717
+#line 701
assert(value != NULL);
-#line 717
+#line 701
-#line 717
+#line 701
#ifdef ERANGE_FILL
-#line 717
+#line 701
fillp = malloc(varp->xsz);
-#line 717
+#line 701
status = NC3_inq_var_fill(varp, fillp);
-#line 717
+#line 701
#endif
-#line 717
+#line 701
-#line 717
+#line 701
for(;;)
-#line 717
+#line 701
{
-#line 717
+#line 701
size_t extent = MIN(remaining, ncp->chunk);
-#line 717
+#line 701
size_t nput = ncx_howmany(varp->type, extent);
-#line 717
+#line 701
-#line 717
+#line 701
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 717
+#line 701
RGN_WRITE, &xp);
-#line 717
+#line 701
if(lstatus != NC_NOERR)
-#line 717
+#line 701
return lstatus;
-#line 717
+#line 701
-#line 717
+#line 701
lstatus = ncx_putn_schar_ushort(&xp, nput, value ,fillp);
-#line 717
+#line 701
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 717
+#line 701
{
-#line 717
+#line 701
/* not fatal to the loop */
-#line 717
+#line 701
status = lstatus;
-#line 717
+#line 701
}
-#line 717
+#line 701
-#line 717
+#line 701
(void) ncio_rel(ncp->nciop, offset,
-#line 717
+#line 701
RGN_MODIFIED);
-#line 717
+#line 701
-#line 717
+#line 701
remaining -= extent;
-#line 717
+#line 701
if(remaining == 0)
-#line 717
+#line 701
break; /* normal loop exit */
-#line 717
+#line 701
offset += (off_t)extent;
-#line 717
+#line 701
value += nput;
-#line 717
+#line 701
-#line 717
+#line 701
}
-#line 717
+#line 701
#ifdef ERANGE_FILL
-#line 717
+#line 701
free(fillp);
-#line 717
+#line 701
#endif
-#line 717
+#line 701
-#line 717
+#line 701
return status;
-#line 717
+#line 701
}
-#line 717
+#line 701
static int
-#line 718
+#line 702
putNCvx_schar_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 718
+#line 702
const size_t *start, size_t nelems, const uint *value)
-#line 718
+#line 702
{
-#line 718
+#line 702
off_t offset = NC_varoffset(ncp, varp, start);
-#line 718
+#line 702
size_t remaining = varp->xsz * nelems;
-#line 718
+#line 702
int status = NC_NOERR;
-#line 718
+#line 702
void *xp;
-#line 718
+#line 702
void *fillp=NULL;
-#line 718
+#line 702
-#line 718
+#line 702
if(nelems == 0)
-#line 718
+#line 702
return NC_NOERR;
-#line 718
+#line 702
-#line 718
+#line 702
assert(value != NULL);
-#line 718
+#line 702
-#line 718
+#line 702
#ifdef ERANGE_FILL
-#line 718
+#line 702
fillp = malloc(varp->xsz);
-#line 718
+#line 702
status = NC3_inq_var_fill(varp, fillp);
-#line 718
+#line 702
#endif
-#line 718
+#line 702
-#line 718
+#line 702
for(;;)
-#line 718
+#line 702
{
-#line 718
+#line 702
size_t extent = MIN(remaining, ncp->chunk);
-#line 718
+#line 702
size_t nput = ncx_howmany(varp->type, extent);
-#line 718
+#line 702
-#line 718
+#line 702
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 718
+#line 702
RGN_WRITE, &xp);
-#line 718
+#line 702
if(lstatus != NC_NOERR)
-#line 718
+#line 702
return lstatus;
-#line 718
+#line 702
-#line 718
+#line 702
lstatus = ncx_putn_schar_uint(&xp, nput, value ,fillp);
-#line 718
+#line 702
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 718
+#line 702
{
-#line 718
+#line 702
/* not fatal to the loop */
-#line 718
+#line 702
status = lstatus;
-#line 718
+#line 702
}
-#line 718
+#line 702
-#line 718
+#line 702
(void) ncio_rel(ncp->nciop, offset,
-#line 718
+#line 702
RGN_MODIFIED);
-#line 718
+#line 702
-#line 718
+#line 702
remaining -= extent;
-#line 718
+#line 702
if(remaining == 0)
-#line 718
+#line 702
break; /* normal loop exit */
-#line 718
+#line 702
offset += (off_t)extent;
-#line 718
+#line 702
value += nput;
-#line 718
+#line 702
-#line 718
+#line 702
}
-#line 718
+#line 702
#ifdef ERANGE_FILL
-#line 718
+#line 702
free(fillp);
-#line 718
+#line 702
#endif
-#line 718
+#line 702
-#line 718
+#line 702
return status;
-#line 718
+#line 702
}
-#line 718
+#line 702
static int
-#line 719
+#line 703
putNCvx_schar_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 719
+#line 703
const size_t *start, size_t nelems, const ulonglong *value)
-#line 719
+#line 703
{
-#line 719
+#line 703
off_t offset = NC_varoffset(ncp, varp, start);
-#line 719
+#line 703
size_t remaining = varp->xsz * nelems;
-#line 719
+#line 703
int status = NC_NOERR;
-#line 719
+#line 703
void *xp;
-#line 719
+#line 703
void *fillp=NULL;
-#line 719
+#line 703
-#line 719
+#line 703
if(nelems == 0)
-#line 719
+#line 703
return NC_NOERR;
-#line 719
+#line 703
-#line 719
+#line 703
assert(value != NULL);
-#line 719
+#line 703
-#line 719
+#line 703
#ifdef ERANGE_FILL
-#line 719
+#line 703
fillp = malloc(varp->xsz);
-#line 719
+#line 703
status = NC3_inq_var_fill(varp, fillp);
-#line 719
+#line 703
#endif
-#line 719
+#line 703
-#line 719
+#line 703
for(;;)
-#line 719
+#line 703
{
-#line 719
+#line 703
size_t extent = MIN(remaining, ncp->chunk);
-#line 719
+#line 703
size_t nput = ncx_howmany(varp->type, extent);
-#line 719
+#line 703
-#line 719
+#line 703
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 719
+#line 703
RGN_WRITE, &xp);
-#line 719
+#line 703
if(lstatus != NC_NOERR)
-#line 719
+#line 703
return lstatus;
-#line 719
+#line 703
-#line 719
+#line 703
lstatus = ncx_putn_schar_ulonglong(&xp, nput, value ,fillp);
-#line 719
+#line 703
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 719
+#line 703
{
-#line 719
+#line 703
/* not fatal to the loop */
-#line 719
+#line 703
status = lstatus;
-#line 719
+#line 703
}
-#line 719
+#line 703
-#line 719
+#line 703
(void) ncio_rel(ncp->nciop, offset,
-#line 719
+#line 703
RGN_MODIFIED);
-#line 719
+#line 703
-#line 719
+#line 703
remaining -= extent;
-#line 719
+#line 703
if(remaining == 0)
-#line 719
+#line 703
break; /* normal loop exit */
-#line 719
+#line 703
offset += (off_t)extent;
-#line 719
+#line 703
value += nput;
-#line 719
+#line 703
-#line 719
+#line 703
}
-#line 719
+#line 703
#ifdef ERANGE_FILL
-#line 719
+#line 703
free(fillp);
-#line 719
+#line 703
#endif
-#line 719
+#line 703
-#line 719
+#line 703
return status;
-#line 719
+#line 703
}
-#line 719
+#line 703
static int
-#line 721
+#line 705
putNCvx_short_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 721
+#line 705
const size_t *start, size_t nelems, const schar *value)
-#line 721
+#line 705
{
-#line 721
+#line 705
off_t offset = NC_varoffset(ncp, varp, start);
-#line 721
+#line 705
size_t remaining = varp->xsz * nelems;
-#line 721
+#line 705
int status = NC_NOERR;
-#line 721
+#line 705
void *xp;
-#line 721
+#line 705
void *fillp=NULL;
-#line 721
+#line 705
-#line 721
+#line 705
if(nelems == 0)
-#line 721
+#line 705
return NC_NOERR;
-#line 721
+#line 705
-#line 721
+#line 705
assert(value != NULL);
-#line 721
+#line 705
-#line 721
+#line 705
#ifdef ERANGE_FILL
-#line 721
+#line 705
fillp = malloc(varp->xsz);
-#line 721
+#line 705
status = NC3_inq_var_fill(varp, fillp);
-#line 721
+#line 705
#endif
-#line 721
+#line 705
-#line 721
+#line 705
for(;;)
-#line 721
+#line 705
{
-#line 721
+#line 705
size_t extent = MIN(remaining, ncp->chunk);
-#line 721
+#line 705
size_t nput = ncx_howmany(varp->type, extent);
-#line 721
+#line 705
-#line 721
+#line 705
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 721
+#line 705
RGN_WRITE, &xp);
-#line 721
+#line 705
if(lstatus != NC_NOERR)
-#line 721
+#line 705
return lstatus;
-#line 721
+#line 705
-#line 721
+#line 705
lstatus = ncx_putn_short_schar(&xp, nput, value ,fillp);
-#line 721
+#line 705
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 721
+#line 705
{
-#line 721
+#line 705
/* not fatal to the loop */
-#line 721
+#line 705
status = lstatus;
-#line 721
+#line 705
}
-#line 721
+#line 705
-#line 721
+#line 705
(void) ncio_rel(ncp->nciop, offset,
-#line 721
+#line 705
RGN_MODIFIED);
-#line 721
+#line 705
-#line 721
+#line 705
remaining -= extent;
-#line 721
+#line 705
if(remaining == 0)
-#line 721
+#line 705
break; /* normal loop exit */
-#line 721
+#line 705
offset += (off_t)extent;
-#line 721
+#line 705
value += nput;
-#line 721
+#line 705
-#line 721
+#line 705
}
-#line 721
+#line 705
#ifdef ERANGE_FILL
-#line 721
+#line 705
free(fillp);
-#line 721
+#line 705
#endif
-#line 721
+#line 705
-#line 721
+#line 705
return status;
-#line 721
+#line 705
}
-#line 721
+#line 705
static int
-#line 722
+#line 706
putNCvx_short_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 722
+#line 706
const size_t *start, size_t nelems, const uchar *value)
-#line 722
+#line 706
{
-#line 722
+#line 706
off_t offset = NC_varoffset(ncp, varp, start);
-#line 722
+#line 706
size_t remaining = varp->xsz * nelems;
-#line 722
+#line 706
int status = NC_NOERR;
-#line 722
+#line 706
void *xp;
-#line 722
+#line 706
void *fillp=NULL;
-#line 722
+#line 706
-#line 722
+#line 706
if(nelems == 0)
-#line 722
+#line 706
return NC_NOERR;
-#line 722
+#line 706
-#line 722
+#line 706
assert(value != NULL);
-#line 722
+#line 706
-#line 722
+#line 706
#ifdef ERANGE_FILL
-#line 722
+#line 706
fillp = malloc(varp->xsz);
-#line 722
+#line 706
status = NC3_inq_var_fill(varp, fillp);
-#line 722
+#line 706
#endif
-#line 722
+#line 706
-#line 722
+#line 706
for(;;)
-#line 722
+#line 706
{
-#line 722
+#line 706
size_t extent = MIN(remaining, ncp->chunk);
-#line 722
+#line 706
size_t nput = ncx_howmany(varp->type, extent);
-#line 722
+#line 706
-#line 722
+#line 706
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 722
+#line 706
RGN_WRITE, &xp);
-#line 722
+#line 706
if(lstatus != NC_NOERR)
-#line 722
+#line 706
return lstatus;
-#line 722
+#line 706
-#line 722
+#line 706
lstatus = ncx_putn_short_uchar(&xp, nput, value ,fillp);
-#line 722
+#line 706
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 722
+#line 706
{
-#line 722
+#line 706
/* not fatal to the loop */
-#line 722
+#line 706
status = lstatus;
-#line 722
+#line 706
}
-#line 722
+#line 706
-#line 722
+#line 706
(void) ncio_rel(ncp->nciop, offset,
-#line 722
+#line 706
RGN_MODIFIED);
-#line 722
+#line 706
-#line 722
+#line 706
remaining -= extent;
-#line 722
+#line 706
if(remaining == 0)
-#line 722
+#line 706
break; /* normal loop exit */
-#line 722
+#line 706
offset += (off_t)extent;
-#line 722
+#line 706
value += nput;
-#line 722
+#line 706
-#line 722
+#line 706
}
-#line 722
+#line 706
#ifdef ERANGE_FILL
-#line 722
+#line 706
free(fillp);
-#line 722
+#line 706
#endif
-#line 722
+#line 706
-#line 722
+#line 706
return status;
-#line 722
+#line 706
}
-#line 722
+#line 706
static int
-#line 723
+#line 707
putNCvx_short_short(NC3_INFO* ncp, const NC_var *varp,
-#line 723
+#line 707
const size_t *start, size_t nelems, const short *value)
-#line 723
+#line 707
{
-#line 723
+#line 707
off_t offset = NC_varoffset(ncp, varp, start);
-#line 723
+#line 707
size_t remaining = varp->xsz * nelems;
-#line 723
+#line 707
int status = NC_NOERR;
-#line 723
+#line 707
void *xp;
-#line 723
+#line 707
void *fillp=NULL;
-#line 723
+#line 707
-#line 723
+#line 707
if(nelems == 0)
-#line 723
+#line 707
return NC_NOERR;
-#line 723
+#line 707
-#line 723
+#line 707
assert(value != NULL);
-#line 723
+#line 707
-#line 723
+#line 707
#ifdef ERANGE_FILL
-#line 723
+#line 707
fillp = malloc(varp->xsz);
-#line 723
+#line 707
status = NC3_inq_var_fill(varp, fillp);
-#line 723
+#line 707
#endif
-#line 723
+#line 707
-#line 723
+#line 707
for(;;)
-#line 723
+#line 707
{
-#line 723
+#line 707
size_t extent = MIN(remaining, ncp->chunk);
-#line 723
+#line 707
size_t nput = ncx_howmany(varp->type, extent);
-#line 723
+#line 707
-#line 723
+#line 707
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 723
+#line 707
RGN_WRITE, &xp);
-#line 723
+#line 707
if(lstatus != NC_NOERR)
-#line 723
+#line 707
return lstatus;
-#line 723
+#line 707
-#line 723
+#line 707
lstatus = ncx_putn_short_short(&xp, nput, value ,fillp);
-#line 723
+#line 707
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 723
+#line 707
{
-#line 723
+#line 707
/* not fatal to the loop */
-#line 723
+#line 707
status = lstatus;
-#line 723
+#line 707
}
-#line 723
+#line 707
-#line 723
+#line 707
(void) ncio_rel(ncp->nciop, offset,
-#line 723
+#line 707
RGN_MODIFIED);
-#line 723
+#line 707
-#line 723
+#line 707
remaining -= extent;
-#line 723
+#line 707
if(remaining == 0)
-#line 723
+#line 707
break; /* normal loop exit */
-#line 723
+#line 707
offset += (off_t)extent;
-#line 723
+#line 707
value += nput;
-#line 723
+#line 707
-#line 723
+#line 707
}
-#line 723
+#line 707
#ifdef ERANGE_FILL
-#line 723
+#line 707
free(fillp);
-#line 723
+#line 707
#endif
-#line 723
+#line 707
-#line 723
+#line 707
return status;
-#line 723
+#line 707
}
-#line 723
+#line 707
static int
-#line 724
+#line 708
putNCvx_short_int(NC3_INFO* ncp, const NC_var *varp,
-#line 724
+#line 708
const size_t *start, size_t nelems, const int *value)
-#line 724
+#line 708
{
-#line 724
+#line 708
off_t offset = NC_varoffset(ncp, varp, start);
-#line 724
+#line 708
size_t remaining = varp->xsz * nelems;
-#line 724
+#line 708
int status = NC_NOERR;
-#line 724
+#line 708
void *xp;
-#line 724
+#line 708
void *fillp=NULL;
-#line 724
+#line 708
-#line 724
+#line 708
if(nelems == 0)
-#line 724
+#line 708
return NC_NOERR;
-#line 724
+#line 708
-#line 724
+#line 708
assert(value != NULL);
-#line 724
+#line 708
-#line 724
+#line 708
#ifdef ERANGE_FILL
-#line 724
+#line 708
fillp = malloc(varp->xsz);
-#line 724
+#line 708
status = NC3_inq_var_fill(varp, fillp);
-#line 724
+#line 708
#endif
-#line 724
+#line 708
-#line 724
+#line 708
for(;;)
-#line 724
+#line 708
{
-#line 724
+#line 708
size_t extent = MIN(remaining, ncp->chunk);
-#line 724
+#line 708
size_t nput = ncx_howmany(varp->type, extent);
-#line 724
+#line 708
-#line 724
+#line 708
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 724
+#line 708
RGN_WRITE, &xp);
-#line 724
+#line 708
if(lstatus != NC_NOERR)
-#line 724
+#line 708
return lstatus;
-#line 724
+#line 708
-#line 724
+#line 708
lstatus = ncx_putn_short_int(&xp, nput, value ,fillp);
-#line 724
+#line 708
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 724
+#line 708
{
-#line 724
+#line 708
/* not fatal to the loop */
-#line 724
+#line 708
status = lstatus;
-#line 724
+#line 708
}
-#line 724
+#line 708
-#line 724
+#line 708
(void) ncio_rel(ncp->nciop, offset,
-#line 724
+#line 708
RGN_MODIFIED);
-#line 724
+#line 708
-#line 724
+#line 708
remaining -= extent;
-#line 724
+#line 708
if(remaining == 0)
-#line 724
+#line 708
break; /* normal loop exit */
-#line 724
+#line 708
offset += (off_t)extent;
-#line 724
+#line 708
value += nput;
-#line 724
+#line 708
-#line 724
+#line 708
}
-#line 724
+#line 708
#ifdef ERANGE_FILL
-#line 724
+#line 708
free(fillp);
-#line 724
+#line 708
#endif
-#line 724
+#line 708
-#line 724
+#line 708
return status;
-#line 724
+#line 708
}
-#line 724
+#line 708
static int
-#line 725
+#line 709
putNCvx_short_float(NC3_INFO* ncp, const NC_var *varp,
-#line 725
+#line 709
const size_t *start, size_t nelems, const float *value)
-#line 725
+#line 709
{
-#line 725
+#line 709
off_t offset = NC_varoffset(ncp, varp, start);
-#line 725
+#line 709
size_t remaining = varp->xsz * nelems;
-#line 725
+#line 709
int status = NC_NOERR;
-#line 725
+#line 709
void *xp;
-#line 725
+#line 709
void *fillp=NULL;
-#line 725
+#line 709
-#line 725
+#line 709
if(nelems == 0)
-#line 725
+#line 709
return NC_NOERR;
-#line 725
+#line 709
-#line 725
+#line 709
assert(value != NULL);
-#line 725
+#line 709
-#line 725
+#line 709
#ifdef ERANGE_FILL
-#line 725
+#line 709
fillp = malloc(varp->xsz);
-#line 725
+#line 709
status = NC3_inq_var_fill(varp, fillp);
-#line 725
+#line 709
#endif
-#line 725
+#line 709
-#line 725
+#line 709
for(;;)
-#line 725
+#line 709
{
-#line 725
+#line 709
size_t extent = MIN(remaining, ncp->chunk);
-#line 725
+#line 709
size_t nput = ncx_howmany(varp->type, extent);
-#line 725
+#line 709
-#line 725
+#line 709
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 725
+#line 709
RGN_WRITE, &xp);
-#line 725
+#line 709
if(lstatus != NC_NOERR)
-#line 725
+#line 709
return lstatus;
-#line 725
+#line 709
-#line 725
+#line 709
lstatus = ncx_putn_short_float(&xp, nput, value ,fillp);
-#line 725
+#line 709
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 725
+#line 709
{
-#line 725
+#line 709
/* not fatal to the loop */
-#line 725
+#line 709
status = lstatus;
-#line 725
+#line 709
}
-#line 725
+#line 709
-#line 725
+#line 709
(void) ncio_rel(ncp->nciop, offset,
-#line 725
+#line 709
RGN_MODIFIED);
-#line 725
+#line 709
-#line 725
+#line 709
remaining -= extent;
-#line 725
+#line 709
if(remaining == 0)
-#line 725
+#line 709
break; /* normal loop exit */
-#line 725
+#line 709
offset += (off_t)extent;
-#line 725
+#line 709
value += nput;
-#line 725
+#line 709
-#line 725
+#line 709
}
-#line 725
+#line 709
#ifdef ERANGE_FILL
-#line 725
+#line 709
free(fillp);
-#line 725
+#line 709
#endif
-#line 725
+#line 709
-#line 725
+#line 709
return status;
-#line 725
+#line 709
}
-#line 725
+#line 709
static int
-#line 726
+#line 710
putNCvx_short_double(NC3_INFO* ncp, const NC_var *varp,
-#line 726
+#line 710
const size_t *start, size_t nelems, const double *value)
-#line 726
+#line 710
{
-#line 726
+#line 710
off_t offset = NC_varoffset(ncp, varp, start);
-#line 726
+#line 710
size_t remaining = varp->xsz * nelems;
-#line 726
+#line 710
int status = NC_NOERR;
-#line 726
+#line 710
void *xp;
-#line 726
+#line 710
void *fillp=NULL;
-#line 726
+#line 710
-#line 726
+#line 710
if(nelems == 0)
-#line 726
+#line 710
return NC_NOERR;
-#line 726
+#line 710
-#line 726
+#line 710
assert(value != NULL);
-#line 726
+#line 710
-#line 726
+#line 710
#ifdef ERANGE_FILL
-#line 726
+#line 710
fillp = malloc(varp->xsz);
-#line 726
+#line 710
status = NC3_inq_var_fill(varp, fillp);
-#line 726
+#line 710
#endif
-#line 726
+#line 710
-#line 726
+#line 710
for(;;)
-#line 726
+#line 710
{
-#line 726
+#line 710
size_t extent = MIN(remaining, ncp->chunk);
-#line 726
+#line 710
size_t nput = ncx_howmany(varp->type, extent);
-#line 726
+#line 710
-#line 726
+#line 710
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 726
+#line 710
RGN_WRITE, &xp);
-#line 726
+#line 710
if(lstatus != NC_NOERR)
-#line 726
+#line 710
return lstatus;
-#line 726
+#line 710
-#line 726
+#line 710
lstatus = ncx_putn_short_double(&xp, nput, value ,fillp);
-#line 726
+#line 710
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 726
+#line 710
{
-#line 726
+#line 710
/* not fatal to the loop */
-#line 726
+#line 710
status = lstatus;
-#line 726
+#line 710
}
-#line 726
+#line 710
-#line 726
+#line 710
(void) ncio_rel(ncp->nciop, offset,
-#line 726
+#line 710
RGN_MODIFIED);
-#line 726
+#line 710
-#line 726
+#line 710
remaining -= extent;
-#line 726
+#line 710
if(remaining == 0)
-#line 726
+#line 710
break; /* normal loop exit */
-#line 726
+#line 710
offset += (off_t)extent;
-#line 726
+#line 710
value += nput;
-#line 726
+#line 710
-#line 726
+#line 710
}
-#line 726
+#line 710
#ifdef ERANGE_FILL
-#line 726
+#line 710
free(fillp);
-#line 726
+#line 710
#endif
-#line 726
+#line 710
-#line 726
+#line 710
return status;
-#line 726
+#line 710
}
-#line 726
+#line 710
static int
-#line 727
+#line 711
putNCvx_short_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 727
+#line 711
const size_t *start, size_t nelems, const longlong *value)
-#line 727
+#line 711
{
-#line 727
+#line 711
off_t offset = NC_varoffset(ncp, varp, start);
-#line 727
+#line 711
size_t remaining = varp->xsz * nelems;
-#line 727
+#line 711
int status = NC_NOERR;
-#line 727
+#line 711
void *xp;
-#line 727
+#line 711
void *fillp=NULL;
-#line 727
+#line 711
-#line 727
+#line 711
if(nelems == 0)
-#line 727
+#line 711
return NC_NOERR;
-#line 727
+#line 711
-#line 727
+#line 711
assert(value != NULL);
-#line 727
+#line 711
-#line 727
+#line 711
#ifdef ERANGE_FILL
-#line 727
+#line 711
fillp = malloc(varp->xsz);
-#line 727
+#line 711
status = NC3_inq_var_fill(varp, fillp);
-#line 727
+#line 711
#endif
-#line 727
+#line 711
-#line 727
+#line 711
for(;;)
-#line 727
+#line 711
{
-#line 727
+#line 711
size_t extent = MIN(remaining, ncp->chunk);
-#line 727
+#line 711
size_t nput = ncx_howmany(varp->type, extent);
-#line 727
+#line 711
-#line 727
+#line 711
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 727
+#line 711
RGN_WRITE, &xp);
-#line 727
+#line 711
if(lstatus != NC_NOERR)
-#line 727
+#line 711
return lstatus;
-#line 727
+#line 711
-#line 727
+#line 711
lstatus = ncx_putn_short_longlong(&xp, nput, value ,fillp);
-#line 727
+#line 711
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 727
+#line 711
{
-#line 727
+#line 711
/* not fatal to the loop */
-#line 727
+#line 711
status = lstatus;
-#line 727
+#line 711
}
-#line 727
+#line 711
-#line 727
+#line 711
(void) ncio_rel(ncp->nciop, offset,
-#line 727
+#line 711
RGN_MODIFIED);
-#line 727
+#line 711
-#line 727
+#line 711
remaining -= extent;
-#line 727
+#line 711
if(remaining == 0)
-#line 727
+#line 711
break; /* normal loop exit */
-#line 727
+#line 711
offset += (off_t)extent;
-#line 727
+#line 711
value += nput;
-#line 727
+#line 711
-#line 727
+#line 711
}
-#line 727
+#line 711
#ifdef ERANGE_FILL
-#line 727
+#line 711
free(fillp);
-#line 727
+#line 711
#endif
-#line 727
+#line 711
-#line 727
+#line 711
return status;
-#line 727
+#line 711
}
-#line 727
+#line 711
static int
-#line 728
+#line 712
putNCvx_short_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 728
+#line 712
const size_t *start, size_t nelems, const ushort *value)
-#line 728
+#line 712
{
-#line 728
+#line 712
off_t offset = NC_varoffset(ncp, varp, start);
-#line 728
+#line 712
size_t remaining = varp->xsz * nelems;
-#line 728
+#line 712
int status = NC_NOERR;
-#line 728
+#line 712
void *xp;
-#line 728
+#line 712
void *fillp=NULL;
-#line 728
+#line 712
-#line 728
+#line 712
if(nelems == 0)
-#line 728
+#line 712
return NC_NOERR;
-#line 728
+#line 712
-#line 728
+#line 712
assert(value != NULL);
-#line 728
+#line 712
-#line 728
+#line 712
#ifdef ERANGE_FILL
-#line 728
+#line 712
fillp = malloc(varp->xsz);
-#line 728
+#line 712
status = NC3_inq_var_fill(varp, fillp);
-#line 728
+#line 712
#endif
-#line 728
+#line 712
-#line 728
+#line 712
for(;;)
-#line 728
+#line 712
{
-#line 728
+#line 712
size_t extent = MIN(remaining, ncp->chunk);
-#line 728
+#line 712
size_t nput = ncx_howmany(varp->type, extent);
-#line 728
+#line 712
-#line 728
+#line 712
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 728
+#line 712
RGN_WRITE, &xp);
-#line 728
+#line 712
if(lstatus != NC_NOERR)
-#line 728
+#line 712
return lstatus;
-#line 728
+#line 712
-#line 728
+#line 712
lstatus = ncx_putn_short_ushort(&xp, nput, value ,fillp);
-#line 728
+#line 712
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 728
+#line 712
{
-#line 728
+#line 712
/* not fatal to the loop */
-#line 728
+#line 712
status = lstatus;
-#line 728
+#line 712
}
-#line 728
+#line 712
-#line 728
+#line 712
(void) ncio_rel(ncp->nciop, offset,
-#line 728
+#line 712
RGN_MODIFIED);
-#line 728
+#line 712
-#line 728
+#line 712
remaining -= extent;
-#line 728
+#line 712
if(remaining == 0)
-#line 728
+#line 712
break; /* normal loop exit */
-#line 728
+#line 712
offset += (off_t)extent;
-#line 728
+#line 712
value += nput;
-#line 728
+#line 712
-#line 728
+#line 712
}
-#line 728
+#line 712
#ifdef ERANGE_FILL
-#line 728
+#line 712
free(fillp);
-#line 728
+#line 712
#endif
-#line 728
+#line 712
-#line 728
+#line 712
return status;
-#line 728
+#line 712
}
-#line 728
+#line 712
static int
-#line 729
+#line 713
putNCvx_short_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 729
+#line 713
const size_t *start, size_t nelems, const uint *value)
-#line 729
+#line 713
{
-#line 729
+#line 713
off_t offset = NC_varoffset(ncp, varp, start);
-#line 729
+#line 713
size_t remaining = varp->xsz * nelems;
-#line 729
+#line 713
int status = NC_NOERR;
-#line 729
+#line 713
void *xp;
-#line 729
+#line 713
void *fillp=NULL;
-#line 729
+#line 713
-#line 729
+#line 713
if(nelems == 0)
-#line 729
+#line 713
return NC_NOERR;
-#line 729
+#line 713
-#line 729
+#line 713
assert(value != NULL);
-#line 729
+#line 713
-#line 729
+#line 713
#ifdef ERANGE_FILL
-#line 729
+#line 713
fillp = malloc(varp->xsz);
-#line 729
+#line 713
status = NC3_inq_var_fill(varp, fillp);
-#line 729
+#line 713
#endif
-#line 729
+#line 713
-#line 729
+#line 713
for(;;)
-#line 729
+#line 713
{
-#line 729
+#line 713
size_t extent = MIN(remaining, ncp->chunk);
-#line 729
+#line 713
size_t nput = ncx_howmany(varp->type, extent);
-#line 729
+#line 713
-#line 729
+#line 713
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 729
+#line 713
RGN_WRITE, &xp);
-#line 729
+#line 713
if(lstatus != NC_NOERR)
-#line 729
+#line 713
return lstatus;
-#line 729
+#line 713
-#line 729
+#line 713
lstatus = ncx_putn_short_uint(&xp, nput, value ,fillp);
-#line 729
+#line 713
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 729
+#line 713
{
-#line 729
+#line 713
/* not fatal to the loop */
-#line 729
+#line 713
status = lstatus;
-#line 729
+#line 713
}
-#line 729
+#line 713
-#line 729
+#line 713
(void) ncio_rel(ncp->nciop, offset,
-#line 729
+#line 713
RGN_MODIFIED);
-#line 729
+#line 713
-#line 729
+#line 713
remaining -= extent;
-#line 729
+#line 713
if(remaining == 0)
-#line 729
+#line 713
break; /* normal loop exit */
-#line 729
+#line 713
offset += (off_t)extent;
-#line 729
+#line 713
value += nput;
-#line 729
+#line 713
-#line 729
+#line 713
}
-#line 729
+#line 713
#ifdef ERANGE_FILL
-#line 729
+#line 713
free(fillp);
-#line 729
+#line 713
#endif
-#line 729
+#line 713
-#line 729
+#line 713
return status;
-#line 729
+#line 713
}
-#line 729
+#line 713
static int
-#line 730
+#line 714
putNCvx_short_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 730
+#line 714
const size_t *start, size_t nelems, const ulonglong *value)
-#line 730
+#line 714
{
-#line 730
+#line 714
off_t offset = NC_varoffset(ncp, varp, start);
-#line 730
+#line 714
size_t remaining = varp->xsz * nelems;
-#line 730
+#line 714
int status = NC_NOERR;
-#line 730
+#line 714
void *xp;
-#line 730
+#line 714
void *fillp=NULL;
-#line 730
+#line 714
-#line 730
+#line 714
if(nelems == 0)
-#line 730
+#line 714
return NC_NOERR;
-#line 730
+#line 714
-#line 730
+#line 714
assert(value != NULL);
-#line 730
+#line 714
-#line 730
+#line 714
#ifdef ERANGE_FILL
-#line 730
+#line 714
fillp = malloc(varp->xsz);
-#line 730
+#line 714
status = NC3_inq_var_fill(varp, fillp);
-#line 730
+#line 714
#endif
-#line 730
+#line 714
-#line 730
+#line 714
for(;;)
-#line 730
+#line 714
{
-#line 730
+#line 714
size_t extent = MIN(remaining, ncp->chunk);
-#line 730
+#line 714
size_t nput = ncx_howmany(varp->type, extent);
-#line 730
+#line 714
-#line 730
+#line 714
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 730
+#line 714
RGN_WRITE, &xp);
-#line 730
+#line 714
if(lstatus != NC_NOERR)
-#line 730
+#line 714
return lstatus;
-#line 730
+#line 714
-#line 730
+#line 714
lstatus = ncx_putn_short_ulonglong(&xp, nput, value ,fillp);
-#line 730
+#line 714
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 730
+#line 714
{
-#line 730
+#line 714
/* not fatal to the loop */
-#line 730
+#line 714
status = lstatus;
-#line 730
+#line 714
}
-#line 730
+#line 714
-#line 730
+#line 714
(void) ncio_rel(ncp->nciop, offset,
-#line 730
+#line 714
RGN_MODIFIED);
-#line 730
+#line 714
-#line 730
+#line 714
remaining -= extent;
-#line 730
+#line 714
if(remaining == 0)
-#line 730
+#line 714
break; /* normal loop exit */
-#line 730
+#line 714
offset += (off_t)extent;
-#line 730
+#line 714
value += nput;
-#line 730
+#line 714
-#line 730
+#line 714
}
-#line 730
+#line 714
#ifdef ERANGE_FILL
-#line 730
+#line 714
free(fillp);
-#line 730
+#line 714
#endif
-#line 730
+#line 714
-#line 730
+#line 714
return status;
-#line 730
+#line 714
}
-#line 730
+#line 714
static int
-#line 732
+#line 716
putNCvx_int_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 732
+#line 716
const size_t *start, size_t nelems, const schar *value)
-#line 732
+#line 716
{
-#line 732
+#line 716
off_t offset = NC_varoffset(ncp, varp, start);
-#line 732
+#line 716
size_t remaining = varp->xsz * nelems;
-#line 732
+#line 716
int status = NC_NOERR;
-#line 732
+#line 716
void *xp;
-#line 732
+#line 716
void *fillp=NULL;
-#line 732
+#line 716
-#line 732
+#line 716
if(nelems == 0)
-#line 732
+#line 716
return NC_NOERR;
-#line 732
+#line 716
-#line 732
+#line 716
assert(value != NULL);
-#line 732
+#line 716
-#line 732
+#line 716
#ifdef ERANGE_FILL
-#line 732
+#line 716
fillp = malloc(varp->xsz);
-#line 732
+#line 716
status = NC3_inq_var_fill(varp, fillp);
-#line 732
+#line 716
#endif
-#line 732
+#line 716
-#line 732
+#line 716
for(;;)
-#line 732
+#line 716
{
-#line 732
+#line 716
size_t extent = MIN(remaining, ncp->chunk);
-#line 732
+#line 716
size_t nput = ncx_howmany(varp->type, extent);
-#line 732
+#line 716
-#line 732
+#line 716
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 732
+#line 716
RGN_WRITE, &xp);
-#line 732
+#line 716
if(lstatus != NC_NOERR)
-#line 732
+#line 716
return lstatus;
-#line 732
+#line 716
-#line 732
+#line 716
lstatus = ncx_putn_int_schar(&xp, nput, value ,fillp);
-#line 732
+#line 716
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 732
+#line 716
{
-#line 732
+#line 716
/* not fatal to the loop */
-#line 732
+#line 716
status = lstatus;
-#line 732
+#line 716
}
-#line 732
+#line 716
-#line 732
+#line 716
(void) ncio_rel(ncp->nciop, offset,
-#line 732
+#line 716
RGN_MODIFIED);
-#line 732
+#line 716
-#line 732
+#line 716
remaining -= extent;
-#line 732
+#line 716
if(remaining == 0)
-#line 732
+#line 716
break; /* normal loop exit */
-#line 732
+#line 716
offset += (off_t)extent;
-#line 732
+#line 716
value += nput;
-#line 732
+#line 716
-#line 732
+#line 716
}
-#line 732
+#line 716
#ifdef ERANGE_FILL
-#line 732
+#line 716
free(fillp);
-#line 732
+#line 716
#endif
-#line 732
+#line 716
-#line 732
+#line 716
return status;
-#line 732
+#line 716
}
-#line 732
+#line 716
static int
-#line 733
+#line 717
putNCvx_int_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 733
+#line 717
const size_t *start, size_t nelems, const uchar *value)
-#line 733
+#line 717
{
-#line 733
+#line 717
off_t offset = NC_varoffset(ncp, varp, start);
-#line 733
+#line 717
size_t remaining = varp->xsz * nelems;
-#line 733
+#line 717
int status = NC_NOERR;
-#line 733
+#line 717
void *xp;
-#line 733
+#line 717
void *fillp=NULL;
-#line 733
+#line 717
-#line 733
+#line 717
if(nelems == 0)
-#line 733
+#line 717
return NC_NOERR;
-#line 733
+#line 717
-#line 733
+#line 717
assert(value != NULL);
-#line 733
+#line 717
-#line 733
+#line 717
#ifdef ERANGE_FILL
-#line 733
+#line 717
fillp = malloc(varp->xsz);
-#line 733
+#line 717
status = NC3_inq_var_fill(varp, fillp);
-#line 733
+#line 717
#endif
-#line 733
+#line 717
-#line 733
+#line 717
for(;;)
-#line 733
+#line 717
{
-#line 733
+#line 717
size_t extent = MIN(remaining, ncp->chunk);
-#line 733
+#line 717
size_t nput = ncx_howmany(varp->type, extent);
-#line 733
+#line 717
-#line 733
+#line 717
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 733
+#line 717
RGN_WRITE, &xp);
-#line 733
+#line 717
if(lstatus != NC_NOERR)
-#line 733
+#line 717
return lstatus;
-#line 733
+#line 717
-#line 733
+#line 717
lstatus = ncx_putn_int_uchar(&xp, nput, value ,fillp);
-#line 733
+#line 717
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 733
+#line 717
{
-#line 733
+#line 717
/* not fatal to the loop */
-#line 733
+#line 717
status = lstatus;
-#line 733
+#line 717
}
-#line 733
+#line 717
-#line 733
+#line 717
(void) ncio_rel(ncp->nciop, offset,
-#line 733
+#line 717
RGN_MODIFIED);
-#line 733
+#line 717
-#line 733
+#line 717
remaining -= extent;
-#line 733
+#line 717
if(remaining == 0)
-#line 733
+#line 717
break; /* normal loop exit */
-#line 733
+#line 717
offset += (off_t)extent;
-#line 733
+#line 717
value += nput;
-#line 733
+#line 717
-#line 733
+#line 717
}
-#line 733
+#line 717
#ifdef ERANGE_FILL
-#line 733
+#line 717
free(fillp);
-#line 733
+#line 717
#endif
-#line 733
+#line 717
-#line 733
+#line 717
return status;
-#line 733
+#line 717
}
-#line 733
+#line 717
static int
-#line 734
+#line 718
putNCvx_int_short(NC3_INFO* ncp, const NC_var *varp,
-#line 734
+#line 718
const size_t *start, size_t nelems, const short *value)
-#line 734
+#line 718
{
-#line 734
+#line 718
off_t offset = NC_varoffset(ncp, varp, start);
-#line 734
+#line 718
size_t remaining = varp->xsz * nelems;
-#line 734
+#line 718
int status = NC_NOERR;
-#line 734
+#line 718
void *xp;
-#line 734
+#line 718
void *fillp=NULL;
-#line 734
+#line 718
-#line 734
+#line 718
if(nelems == 0)
-#line 734
+#line 718
return NC_NOERR;
-#line 734
+#line 718
-#line 734
+#line 718
assert(value != NULL);
-#line 734
+#line 718
-#line 734
+#line 718
#ifdef ERANGE_FILL
-#line 734
+#line 718
fillp = malloc(varp->xsz);
-#line 734
+#line 718
status = NC3_inq_var_fill(varp, fillp);
-#line 734
+#line 718
#endif
-#line 734
+#line 718
-#line 734
+#line 718
for(;;)
-#line 734
+#line 718
{
-#line 734
+#line 718
size_t extent = MIN(remaining, ncp->chunk);
-#line 734
+#line 718
size_t nput = ncx_howmany(varp->type, extent);
-#line 734
+#line 718
-#line 734
+#line 718
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 734
+#line 718
RGN_WRITE, &xp);
-#line 734
+#line 718
if(lstatus != NC_NOERR)
-#line 734
+#line 718
return lstatus;
-#line 734
+#line 718
-#line 734
+#line 718
lstatus = ncx_putn_int_short(&xp, nput, value ,fillp);
-#line 734
+#line 718
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 734
+#line 718
{
-#line 734
+#line 718
/* not fatal to the loop */
-#line 734
+#line 718
status = lstatus;
-#line 734
+#line 718
}
-#line 734
+#line 718
-#line 734
+#line 718
(void) ncio_rel(ncp->nciop, offset,
-#line 734
+#line 718
RGN_MODIFIED);
-#line 734
+#line 718
-#line 734
+#line 718
remaining -= extent;
-#line 734
+#line 718
if(remaining == 0)
-#line 734
+#line 718
break; /* normal loop exit */
-#line 734
+#line 718
offset += (off_t)extent;
-#line 734
+#line 718
value += nput;
-#line 734
+#line 718
-#line 734
+#line 718
}
-#line 734
+#line 718
#ifdef ERANGE_FILL
-#line 734
+#line 718
free(fillp);
-#line 734
+#line 718
#endif
-#line 734
+#line 718
-#line 734
+#line 718
return status;
-#line 734
+#line 718
}
-#line 734
+#line 718
static int
-#line 735
+#line 719
putNCvx_int_int(NC3_INFO* ncp, const NC_var *varp,
-#line 735
+#line 719
const size_t *start, size_t nelems, const int *value)
-#line 735
+#line 719
{
-#line 735
+#line 719
off_t offset = NC_varoffset(ncp, varp, start);
-#line 735
+#line 719
size_t remaining = varp->xsz * nelems;
-#line 735
+#line 719
int status = NC_NOERR;
-#line 735
+#line 719
void *xp;
-#line 735
+#line 719
void *fillp=NULL;
-#line 735
+#line 719
-#line 735
+#line 719
if(nelems == 0)
-#line 735
+#line 719
return NC_NOERR;
-#line 735
+#line 719
-#line 735
+#line 719
assert(value != NULL);
-#line 735
+#line 719
-#line 735
+#line 719
#ifdef ERANGE_FILL
-#line 735
+#line 719
fillp = malloc(varp->xsz);
-#line 735
+#line 719
status = NC3_inq_var_fill(varp, fillp);
-#line 735
+#line 719
#endif
-#line 735
+#line 719
-#line 735
+#line 719
for(;;)
-#line 735
+#line 719
{
-#line 735
+#line 719
size_t extent = MIN(remaining, ncp->chunk);
-#line 735
+#line 719
size_t nput = ncx_howmany(varp->type, extent);
-#line 735
+#line 719
-#line 735
+#line 719
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 735
+#line 719
RGN_WRITE, &xp);
-#line 735
+#line 719
if(lstatus != NC_NOERR)
-#line 735
+#line 719
return lstatus;
-#line 735
+#line 719
-#line 735
+#line 719
lstatus = ncx_putn_int_int(&xp, nput, value ,fillp);
-#line 735
+#line 719
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 735
+#line 719
{
-#line 735
+#line 719
/* not fatal to the loop */
-#line 735
+#line 719
status = lstatus;
-#line 735
+#line 719
}
-#line 735
+#line 719
-#line 735
+#line 719
(void) ncio_rel(ncp->nciop, offset,
-#line 735
+#line 719
RGN_MODIFIED);
-#line 735
+#line 719
-#line 735
+#line 719
remaining -= extent;
-#line 735
+#line 719
if(remaining == 0)
-#line 735
+#line 719
break; /* normal loop exit */
-#line 735
+#line 719
offset += (off_t)extent;
-#line 735
+#line 719
value += nput;
-#line 735
+#line 719
-#line 735
+#line 719
}
-#line 735
+#line 719
#ifdef ERANGE_FILL
-#line 735
+#line 719
free(fillp);
-#line 735
+#line 719
#endif
-#line 735
+#line 719
-#line 735
+#line 719
return status;
-#line 735
+#line 719
}
-#line 735
+#line 719
static int
-#line 736
+#line 720
putNCvx_int_float(NC3_INFO* ncp, const NC_var *varp,
-#line 736
+#line 720
const size_t *start, size_t nelems, const float *value)
-#line 736
+#line 720
{
-#line 736
+#line 720
off_t offset = NC_varoffset(ncp, varp, start);
-#line 736
+#line 720
size_t remaining = varp->xsz * nelems;
-#line 736
+#line 720
int status = NC_NOERR;
-#line 736
+#line 720
void *xp;
-#line 736
+#line 720
void *fillp=NULL;
-#line 736
+#line 720
-#line 736
+#line 720
if(nelems == 0)
-#line 736
+#line 720
return NC_NOERR;
-#line 736
+#line 720
-#line 736
+#line 720
assert(value != NULL);
-#line 736
+#line 720
-#line 736
+#line 720
#ifdef ERANGE_FILL
-#line 736
+#line 720
fillp = malloc(varp->xsz);
-#line 736
+#line 720
status = NC3_inq_var_fill(varp, fillp);
-#line 736
+#line 720
#endif
-#line 736
+#line 720
-#line 736
+#line 720
for(;;)
-#line 736
+#line 720
{
-#line 736
+#line 720
size_t extent = MIN(remaining, ncp->chunk);
-#line 736
+#line 720
size_t nput = ncx_howmany(varp->type, extent);
-#line 736
+#line 720
-#line 736
+#line 720
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 736
+#line 720
RGN_WRITE, &xp);
-#line 736
+#line 720
if(lstatus != NC_NOERR)
-#line 736
+#line 720
return lstatus;
-#line 736
+#line 720
-#line 736
+#line 720
lstatus = ncx_putn_int_float(&xp, nput, value ,fillp);
-#line 736
+#line 720
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 736
+#line 720
{
-#line 736
+#line 720
/* not fatal to the loop */
-#line 736
+#line 720
status = lstatus;
-#line 736
+#line 720
}
-#line 736
+#line 720
-#line 736
+#line 720
(void) ncio_rel(ncp->nciop, offset,
-#line 736
+#line 720
RGN_MODIFIED);
-#line 736
+#line 720
-#line 736
+#line 720
remaining -= extent;
-#line 736
+#line 720
if(remaining == 0)
-#line 736
+#line 720
break; /* normal loop exit */
-#line 736
+#line 720
offset += (off_t)extent;
-#line 736
+#line 720
value += nput;
-#line 736
+#line 720
-#line 736
+#line 720
}
-#line 736
+#line 720
#ifdef ERANGE_FILL
-#line 736
+#line 720
free(fillp);
-#line 736
+#line 720
#endif
-#line 736
+#line 720
-#line 736
+#line 720
return status;
-#line 736
+#line 720
}
-#line 736
+#line 720
static int
-#line 737
+#line 721
putNCvx_int_double(NC3_INFO* ncp, const NC_var *varp,
-#line 737
+#line 721
const size_t *start, size_t nelems, const double *value)
-#line 737
+#line 721
{
-#line 737
+#line 721
off_t offset = NC_varoffset(ncp, varp, start);
-#line 737
+#line 721
size_t remaining = varp->xsz * nelems;
-#line 737
+#line 721
int status = NC_NOERR;
-#line 737
+#line 721
void *xp;
-#line 737
+#line 721
void *fillp=NULL;
-#line 737
+#line 721
-#line 737
+#line 721
if(nelems == 0)
-#line 737
+#line 721
return NC_NOERR;
-#line 737
+#line 721
-#line 737
+#line 721
assert(value != NULL);
-#line 737
+#line 721
-#line 737
+#line 721
#ifdef ERANGE_FILL
-#line 737
+#line 721
fillp = malloc(varp->xsz);
-#line 737
+#line 721
status = NC3_inq_var_fill(varp, fillp);
-#line 737
+#line 721
#endif
-#line 737
+#line 721
-#line 737
+#line 721
for(;;)
-#line 737
+#line 721
{
-#line 737
+#line 721
size_t extent = MIN(remaining, ncp->chunk);
-#line 737
+#line 721
size_t nput = ncx_howmany(varp->type, extent);
-#line 737
+#line 721
-#line 737
+#line 721
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 737
+#line 721
RGN_WRITE, &xp);
-#line 737
+#line 721
if(lstatus != NC_NOERR)
-#line 737
+#line 721
return lstatus;
-#line 737
+#line 721
-#line 737
+#line 721
lstatus = ncx_putn_int_double(&xp, nput, value ,fillp);
-#line 737
+#line 721
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 737
+#line 721
{
-#line 737
+#line 721
/* not fatal to the loop */
-#line 737
+#line 721
status = lstatus;
-#line 737
+#line 721
}
-#line 737
+#line 721
-#line 737
+#line 721
(void) ncio_rel(ncp->nciop, offset,
-#line 737
+#line 721
RGN_MODIFIED);
-#line 737
+#line 721
-#line 737
+#line 721
remaining -= extent;
-#line 737
+#line 721
if(remaining == 0)
-#line 737
+#line 721
break; /* normal loop exit */
-#line 737
+#line 721
offset += (off_t)extent;
-#line 737
+#line 721
value += nput;
-#line 737
+#line 721
-#line 737
+#line 721
}
-#line 737
+#line 721
#ifdef ERANGE_FILL
-#line 737
+#line 721
free(fillp);
-#line 737
+#line 721
#endif
-#line 737
+#line 721
-#line 737
+#line 721
return status;
-#line 737
+#line 721
}
-#line 737
+#line 721
static int
-#line 738
+#line 722
putNCvx_int_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 738
+#line 722
const size_t *start, size_t nelems, const longlong *value)
-#line 738
+#line 722
{
-#line 738
+#line 722
off_t offset = NC_varoffset(ncp, varp, start);
-#line 738
+#line 722
size_t remaining = varp->xsz * nelems;
-#line 738
+#line 722
int status = NC_NOERR;
-#line 738
+#line 722
void *xp;
-#line 738
+#line 722
void *fillp=NULL;
-#line 738
+#line 722
-#line 738
+#line 722
if(nelems == 0)
-#line 738
+#line 722
return NC_NOERR;
-#line 738
+#line 722
-#line 738
+#line 722
assert(value != NULL);
-#line 738
+#line 722
-#line 738
+#line 722
#ifdef ERANGE_FILL
-#line 738
+#line 722
fillp = malloc(varp->xsz);
-#line 738
+#line 722
status = NC3_inq_var_fill(varp, fillp);
-#line 738
+#line 722
#endif
-#line 738
+#line 722
-#line 738
+#line 722
for(;;)
-#line 738
+#line 722
{
-#line 738
+#line 722
size_t extent = MIN(remaining, ncp->chunk);
-#line 738
+#line 722
size_t nput = ncx_howmany(varp->type, extent);
-#line 738
+#line 722
-#line 738
+#line 722
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 738
+#line 722
RGN_WRITE, &xp);
-#line 738
+#line 722
if(lstatus != NC_NOERR)
-#line 738
+#line 722
return lstatus;
-#line 738
+#line 722
-#line 738
+#line 722
lstatus = ncx_putn_int_longlong(&xp, nput, value ,fillp);
-#line 738
+#line 722
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 738
+#line 722
{
-#line 738
+#line 722
/* not fatal to the loop */
-#line 738
+#line 722
status = lstatus;
-#line 738
+#line 722
}
-#line 738
+#line 722
-#line 738
+#line 722
(void) ncio_rel(ncp->nciop, offset,
-#line 738
+#line 722
RGN_MODIFIED);
-#line 738
+#line 722
-#line 738
+#line 722
remaining -= extent;
-#line 738
+#line 722
if(remaining == 0)
-#line 738
+#line 722
break; /* normal loop exit */
-#line 738
+#line 722
offset += (off_t)extent;
-#line 738
+#line 722
value += nput;
-#line 738
+#line 722
-#line 738
+#line 722
}
-#line 738
+#line 722
#ifdef ERANGE_FILL
-#line 738
+#line 722
free(fillp);
-#line 738
+#line 722
#endif
-#line 738
+#line 722
-#line 738
+#line 722
return status;
-#line 738
+#line 722
}
-#line 738
+#line 722
static int
-#line 739
+#line 723
putNCvx_int_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 739
+#line 723
const size_t *start, size_t nelems, const ushort *value)
-#line 739
+#line 723
{
-#line 739
+#line 723
off_t offset = NC_varoffset(ncp, varp, start);
-#line 739
+#line 723
size_t remaining = varp->xsz * nelems;
-#line 739
+#line 723
int status = NC_NOERR;
-#line 739
+#line 723
void *xp;
-#line 739
+#line 723
void *fillp=NULL;
-#line 739
+#line 723
-#line 739
+#line 723
if(nelems == 0)
-#line 739
+#line 723
return NC_NOERR;
-#line 739
+#line 723
-#line 739
+#line 723
assert(value != NULL);
-#line 739
+#line 723
-#line 739
+#line 723
#ifdef ERANGE_FILL
-#line 739
+#line 723
fillp = malloc(varp->xsz);
-#line 739
+#line 723
status = NC3_inq_var_fill(varp, fillp);
-#line 739
+#line 723
#endif
-#line 739
+#line 723
-#line 739
+#line 723
for(;;)
-#line 739
+#line 723
{
-#line 739
+#line 723
size_t extent = MIN(remaining, ncp->chunk);
-#line 739
+#line 723
size_t nput = ncx_howmany(varp->type, extent);
-#line 739
+#line 723
-#line 739
+#line 723
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 739
+#line 723
RGN_WRITE, &xp);
-#line 739
+#line 723
if(lstatus != NC_NOERR)
-#line 739
+#line 723
return lstatus;
-#line 739
+#line 723
-#line 739
+#line 723
lstatus = ncx_putn_int_ushort(&xp, nput, value ,fillp);
-#line 739
+#line 723
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 739
+#line 723
{
-#line 739
+#line 723
/* not fatal to the loop */
-#line 739
+#line 723
status = lstatus;
-#line 739
+#line 723
}
-#line 739
+#line 723
-#line 739
+#line 723
(void) ncio_rel(ncp->nciop, offset,
-#line 739
+#line 723
RGN_MODIFIED);
-#line 739
+#line 723
-#line 739
+#line 723
remaining -= extent;
-#line 739
+#line 723
if(remaining == 0)
-#line 739
+#line 723
break; /* normal loop exit */
-#line 739
+#line 723
offset += (off_t)extent;
-#line 739
+#line 723
value += nput;
-#line 739
+#line 723
-#line 739
+#line 723
}
-#line 739
+#line 723
#ifdef ERANGE_FILL
-#line 739
+#line 723
free(fillp);
-#line 739
+#line 723
#endif
-#line 739
+#line 723
-#line 739
+#line 723
return status;
-#line 739
+#line 723
}
-#line 739
+#line 723
static int
-#line 740
+#line 724
putNCvx_int_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 740
+#line 724
const size_t *start, size_t nelems, const uint *value)
-#line 740
+#line 724
{
-#line 740
+#line 724
off_t offset = NC_varoffset(ncp, varp, start);
-#line 740
+#line 724
size_t remaining = varp->xsz * nelems;
-#line 740
+#line 724
int status = NC_NOERR;
-#line 740
+#line 724
void *xp;
-#line 740
+#line 724
void *fillp=NULL;
-#line 740
+#line 724
-#line 740
+#line 724
if(nelems == 0)
-#line 740
+#line 724
return NC_NOERR;
-#line 740
+#line 724
-#line 740
+#line 724
assert(value != NULL);
-#line 740
+#line 724
-#line 740
+#line 724
#ifdef ERANGE_FILL
-#line 740
+#line 724
fillp = malloc(varp->xsz);
-#line 740
+#line 724
status = NC3_inq_var_fill(varp, fillp);
-#line 740
+#line 724
#endif
-#line 740
+#line 724
-#line 740
+#line 724
for(;;)
-#line 740
+#line 724
{
-#line 740
+#line 724
size_t extent = MIN(remaining, ncp->chunk);
-#line 740
+#line 724
size_t nput = ncx_howmany(varp->type, extent);
-#line 740
+#line 724
-#line 740
+#line 724
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 740
+#line 724
RGN_WRITE, &xp);
-#line 740
+#line 724
if(lstatus != NC_NOERR)
-#line 740
+#line 724
return lstatus;
-#line 740
+#line 724
-#line 740
+#line 724
lstatus = ncx_putn_int_uint(&xp, nput, value ,fillp);
-#line 740
+#line 724
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 740
+#line 724
{
-#line 740
+#line 724
/* not fatal to the loop */
-#line 740
+#line 724
status = lstatus;
-#line 740
+#line 724
}
-#line 740
+#line 724
-#line 740
+#line 724
(void) ncio_rel(ncp->nciop, offset,
-#line 740
+#line 724
RGN_MODIFIED);
-#line 740
+#line 724
-#line 740
+#line 724
remaining -= extent;
-#line 740
+#line 724
if(remaining == 0)
-#line 740
+#line 724
break; /* normal loop exit */
-#line 740
+#line 724
offset += (off_t)extent;
-#line 740
+#line 724
value += nput;
-#line 740
+#line 724
-#line 740
+#line 724
}
-#line 740
+#line 724
#ifdef ERANGE_FILL
-#line 740
+#line 724
free(fillp);
-#line 740
+#line 724
#endif
-#line 740
+#line 724
-#line 740
+#line 724
return status;
-#line 740
+#line 724
}
-#line 740
+#line 724
static int
-#line 741
+#line 725
putNCvx_int_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 741
+#line 725
const size_t *start, size_t nelems, const ulonglong *value)
-#line 741
+#line 725
{
-#line 741
+#line 725
off_t offset = NC_varoffset(ncp, varp, start);
-#line 741
+#line 725
size_t remaining = varp->xsz * nelems;
-#line 741
+#line 725
int status = NC_NOERR;
-#line 741
+#line 725
void *xp;
-#line 741
+#line 725
void *fillp=NULL;
-#line 741
+#line 725
-#line 741
+#line 725
if(nelems == 0)
-#line 741
+#line 725
return NC_NOERR;
-#line 741
+#line 725
-#line 741
+#line 725
assert(value != NULL);
-#line 741
+#line 725
-#line 741
+#line 725
#ifdef ERANGE_FILL
-#line 741
+#line 725
fillp = malloc(varp->xsz);
-#line 741
+#line 725
status = NC3_inq_var_fill(varp, fillp);
-#line 741
+#line 725
#endif
-#line 741
+#line 725
-#line 741
+#line 725
for(;;)
-#line 741
+#line 725
{
-#line 741
+#line 725
size_t extent = MIN(remaining, ncp->chunk);
-#line 741
+#line 725
size_t nput = ncx_howmany(varp->type, extent);
-#line 741
+#line 725
-#line 741
+#line 725
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 741
+#line 725
RGN_WRITE, &xp);
-#line 741
+#line 725
if(lstatus != NC_NOERR)
-#line 741
+#line 725
return lstatus;
-#line 741
+#line 725
-#line 741
+#line 725
lstatus = ncx_putn_int_ulonglong(&xp, nput, value ,fillp);
-#line 741
+#line 725
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 741
+#line 725
{
-#line 741
+#line 725
/* not fatal to the loop */
-#line 741
+#line 725
status = lstatus;
-#line 741
+#line 725
}
-#line 741
+#line 725
-#line 741
+#line 725
(void) ncio_rel(ncp->nciop, offset,
-#line 741
+#line 725
RGN_MODIFIED);
-#line 741
+#line 725
-#line 741
+#line 725
remaining -= extent;
-#line 741
+#line 725
if(remaining == 0)
-#line 741
+#line 725
break; /* normal loop exit */
-#line 741
+#line 725
offset += (off_t)extent;
-#line 741
+#line 725
value += nput;
-#line 741
+#line 725
-#line 741
+#line 725
}
-#line 741
+#line 725
#ifdef ERANGE_FILL
-#line 741
+#line 725
free(fillp);
-#line 741
+#line 725
#endif
-#line 741
+#line 725
-#line 741
+#line 725
return status;
-#line 741
+#line 725
}
-#line 741
+#line 725
static int
-#line 743
+#line 727
putNCvx_float_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 743
+#line 727
const size_t *start, size_t nelems, const schar *value)
-#line 743
+#line 727
{
-#line 743
+#line 727
off_t offset = NC_varoffset(ncp, varp, start);
-#line 743
+#line 727
size_t remaining = varp->xsz * nelems;
-#line 743
+#line 727
int status = NC_NOERR;
-#line 743
+#line 727
void *xp;
-#line 743
+#line 727
void *fillp=NULL;
-#line 743
+#line 727
-#line 743
+#line 727
if(nelems == 0)
-#line 743
+#line 727
return NC_NOERR;
-#line 743
+#line 727
-#line 743
+#line 727
assert(value != NULL);
-#line 743
+#line 727
-#line 743
+#line 727
#ifdef ERANGE_FILL
-#line 743
+#line 727
fillp = malloc(varp->xsz);
-#line 743
+#line 727
status = NC3_inq_var_fill(varp, fillp);
-#line 743
+#line 727
#endif
-#line 743
+#line 727
-#line 743
+#line 727
for(;;)
-#line 743
+#line 727
{
-#line 743
+#line 727
size_t extent = MIN(remaining, ncp->chunk);
-#line 743
+#line 727
size_t nput = ncx_howmany(varp->type, extent);
-#line 743
+#line 727
-#line 743
+#line 727
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 743
+#line 727
RGN_WRITE, &xp);
-#line 743
+#line 727
if(lstatus != NC_NOERR)
-#line 743
+#line 727
return lstatus;
-#line 743
+#line 727
-#line 743
+#line 727
lstatus = ncx_putn_float_schar(&xp, nput, value ,fillp);
-#line 743
+#line 727
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 743
+#line 727
{
-#line 743
+#line 727
/* not fatal to the loop */
-#line 743
+#line 727
status = lstatus;
-#line 743
+#line 727
}
-#line 743
+#line 727
-#line 743
+#line 727
(void) ncio_rel(ncp->nciop, offset,
-#line 743
+#line 727
RGN_MODIFIED);
-#line 743
+#line 727
-#line 743
+#line 727
remaining -= extent;
-#line 743
+#line 727
if(remaining == 0)
-#line 743
+#line 727
break; /* normal loop exit */
-#line 743
+#line 727
offset += (off_t)extent;
-#line 743
+#line 727
value += nput;
-#line 743
+#line 727
-#line 743
+#line 727
}
-#line 743
+#line 727
#ifdef ERANGE_FILL
-#line 743
+#line 727
free(fillp);
-#line 743
+#line 727
#endif
-#line 743
+#line 727
-#line 743
+#line 727
return status;
-#line 743
+#line 727
}
-#line 743
+#line 727
static int
-#line 744
+#line 728
putNCvx_float_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 744
+#line 728
const size_t *start, size_t nelems, const uchar *value)
-#line 744
+#line 728
{
-#line 744
+#line 728
off_t offset = NC_varoffset(ncp, varp, start);
-#line 744
+#line 728
size_t remaining = varp->xsz * nelems;
-#line 744
+#line 728
int status = NC_NOERR;
-#line 744
+#line 728
void *xp;
-#line 744
+#line 728
void *fillp=NULL;
-#line 744
+#line 728
-#line 744
+#line 728
if(nelems == 0)
-#line 744
+#line 728
return NC_NOERR;
-#line 744
+#line 728
-#line 744
+#line 728
assert(value != NULL);
-#line 744
+#line 728
-#line 744
+#line 728
#ifdef ERANGE_FILL
-#line 744
+#line 728
fillp = malloc(varp->xsz);
-#line 744
+#line 728
status = NC3_inq_var_fill(varp, fillp);
-#line 744
+#line 728
#endif
-#line 744
+#line 728
-#line 744
+#line 728
for(;;)
-#line 744
+#line 728
{
-#line 744
+#line 728
size_t extent = MIN(remaining, ncp->chunk);
-#line 744
+#line 728
size_t nput = ncx_howmany(varp->type, extent);
-#line 744
+#line 728
-#line 744
+#line 728
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 744
+#line 728
RGN_WRITE, &xp);
-#line 744
+#line 728
if(lstatus != NC_NOERR)
-#line 744
+#line 728
return lstatus;
-#line 744
+#line 728
-#line 744
+#line 728
lstatus = ncx_putn_float_uchar(&xp, nput, value ,fillp);
-#line 744
+#line 728
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 744
+#line 728
{
-#line 744
+#line 728
/* not fatal to the loop */
-#line 744
+#line 728
status = lstatus;
-#line 744
+#line 728
}
-#line 744
+#line 728
-#line 744
+#line 728
(void) ncio_rel(ncp->nciop, offset,
-#line 744
+#line 728
RGN_MODIFIED);
-#line 744
+#line 728
-#line 744
+#line 728
remaining -= extent;
-#line 744
+#line 728
if(remaining == 0)
-#line 744
+#line 728
break; /* normal loop exit */
-#line 744
+#line 728
offset += (off_t)extent;
-#line 744
+#line 728
value += nput;
-#line 744
+#line 728
-#line 744
+#line 728
}
-#line 744
+#line 728
#ifdef ERANGE_FILL
-#line 744
+#line 728
free(fillp);
-#line 744
+#line 728
#endif
-#line 744
+#line 728
-#line 744
+#line 728
return status;
-#line 744
+#line 728
}
-#line 744
+#line 728
static int
-#line 745
+#line 729
putNCvx_float_short(NC3_INFO* ncp, const NC_var *varp,
-#line 745
+#line 729
const size_t *start, size_t nelems, const short *value)
-#line 745
+#line 729
{
-#line 745
+#line 729
off_t offset = NC_varoffset(ncp, varp, start);
-#line 745
+#line 729
size_t remaining = varp->xsz * nelems;
-#line 745
+#line 729
int status = NC_NOERR;
-#line 745
+#line 729
void *xp;
-#line 745
+#line 729
void *fillp=NULL;
-#line 745
+#line 729
-#line 745
+#line 729
if(nelems == 0)
-#line 745
+#line 729
return NC_NOERR;
-#line 745
+#line 729
-#line 745
+#line 729
assert(value != NULL);
-#line 745
+#line 729
-#line 745
+#line 729
#ifdef ERANGE_FILL
-#line 745
+#line 729
fillp = malloc(varp->xsz);
-#line 745
+#line 729
status = NC3_inq_var_fill(varp, fillp);
-#line 745
+#line 729
#endif
-#line 745
+#line 729
-#line 745
+#line 729
for(;;)
-#line 745
+#line 729
{
-#line 745
+#line 729
size_t extent = MIN(remaining, ncp->chunk);
-#line 745
+#line 729
size_t nput = ncx_howmany(varp->type, extent);
-#line 745
+#line 729
-#line 745
+#line 729
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 745
+#line 729
RGN_WRITE, &xp);
-#line 745
+#line 729
if(lstatus != NC_NOERR)
-#line 745
+#line 729
return lstatus;
-#line 745
+#line 729
-#line 745
+#line 729
lstatus = ncx_putn_float_short(&xp, nput, value ,fillp);
-#line 745
+#line 729
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 745
+#line 729
{
-#line 745
+#line 729
/* not fatal to the loop */
-#line 745
+#line 729
status = lstatus;
-#line 745
+#line 729
}
-#line 745
+#line 729
-#line 745
+#line 729
(void) ncio_rel(ncp->nciop, offset,
-#line 745
+#line 729
RGN_MODIFIED);
-#line 745
+#line 729
-#line 745
+#line 729
remaining -= extent;
-#line 745
+#line 729
if(remaining == 0)
-#line 745
+#line 729
break; /* normal loop exit */
-#line 745
+#line 729
offset += (off_t)extent;
-#line 745
+#line 729
value += nput;
-#line 745
+#line 729
-#line 745
+#line 729
}
-#line 745
+#line 729
#ifdef ERANGE_FILL
-#line 745
+#line 729
free(fillp);
-#line 745
+#line 729
#endif
-#line 745
+#line 729
-#line 745
+#line 729
return status;
-#line 745
+#line 729
}
-#line 745
+#line 729
static int
-#line 746
+#line 730
putNCvx_float_int(NC3_INFO* ncp, const NC_var *varp,
-#line 746
+#line 730
const size_t *start, size_t nelems, const int *value)
-#line 746
+#line 730
{
-#line 746
+#line 730
off_t offset = NC_varoffset(ncp, varp, start);
-#line 746
+#line 730
size_t remaining = varp->xsz * nelems;
-#line 746
+#line 730
int status = NC_NOERR;
-#line 746
+#line 730
void *xp;
-#line 746
+#line 730
void *fillp=NULL;
-#line 746
+#line 730
-#line 746
+#line 730
if(nelems == 0)
-#line 746
+#line 730
return NC_NOERR;
-#line 746
+#line 730
-#line 746
+#line 730
assert(value != NULL);
-#line 746
+#line 730
-#line 746
+#line 730
#ifdef ERANGE_FILL
-#line 746
+#line 730
fillp = malloc(varp->xsz);
-#line 746
+#line 730
status = NC3_inq_var_fill(varp, fillp);
-#line 746
+#line 730
#endif
-#line 746
+#line 730
-#line 746
+#line 730
for(;;)
-#line 746
+#line 730
{
-#line 746
+#line 730
size_t extent = MIN(remaining, ncp->chunk);
-#line 746
+#line 730
size_t nput = ncx_howmany(varp->type, extent);
-#line 746
+#line 730
-#line 746
+#line 730
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 746
+#line 730
RGN_WRITE, &xp);
-#line 746
+#line 730
if(lstatus != NC_NOERR)
-#line 746
+#line 730
return lstatus;
-#line 746
+#line 730
-#line 746
+#line 730
lstatus = ncx_putn_float_int(&xp, nput, value ,fillp);
-#line 746
+#line 730
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 746
+#line 730
{
-#line 746
+#line 730
/* not fatal to the loop */
-#line 746
+#line 730
status = lstatus;
-#line 746
+#line 730
}
-#line 746
+#line 730
-#line 746
+#line 730
(void) ncio_rel(ncp->nciop, offset,
-#line 746
+#line 730
RGN_MODIFIED);
-#line 746
+#line 730
-#line 746
+#line 730
remaining -= extent;
-#line 746
+#line 730
if(remaining == 0)
-#line 746
+#line 730
break; /* normal loop exit */
-#line 746
+#line 730
offset += (off_t)extent;
-#line 746
+#line 730
value += nput;
-#line 746
+#line 730
-#line 746
+#line 730
}
-#line 746
+#line 730
#ifdef ERANGE_FILL
-#line 746
+#line 730
free(fillp);
-#line 746
+#line 730
#endif
-#line 746
+#line 730
-#line 746
+#line 730
return status;
-#line 746
+#line 730
}
-#line 746
+#line 730
static int
-#line 747
+#line 731
putNCvx_float_float(NC3_INFO* ncp, const NC_var *varp,
-#line 747
+#line 731
const size_t *start, size_t nelems, const float *value)
-#line 747
+#line 731
{
-#line 747
+#line 731
off_t offset = NC_varoffset(ncp, varp, start);
-#line 747
+#line 731
size_t remaining = varp->xsz * nelems;
-#line 747
+#line 731
int status = NC_NOERR;
-#line 747
+#line 731
void *xp;
-#line 747
+#line 731
void *fillp=NULL;
-#line 747
+#line 731
-#line 747
+#line 731
if(nelems == 0)
-#line 747
+#line 731
return NC_NOERR;
-#line 747
+#line 731
-#line 747
+#line 731
assert(value != NULL);
-#line 747
+#line 731
-#line 747
+#line 731
#ifdef ERANGE_FILL
-#line 747
+#line 731
fillp = malloc(varp->xsz);
-#line 747
+#line 731
status = NC3_inq_var_fill(varp, fillp);
-#line 747
+#line 731
#endif
-#line 747
+#line 731
-#line 747
+#line 731
for(;;)
-#line 747
+#line 731
{
-#line 747
+#line 731
size_t extent = MIN(remaining, ncp->chunk);
-#line 747
+#line 731
size_t nput = ncx_howmany(varp->type, extent);
-#line 747
+#line 731
-#line 747
+#line 731
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 747
+#line 731
RGN_WRITE, &xp);
-#line 747
+#line 731
if(lstatus != NC_NOERR)
-#line 747
+#line 731
return lstatus;
-#line 747
+#line 731
-#line 747
+#line 731
lstatus = ncx_putn_float_float(&xp, nput, value ,fillp);
-#line 747
+#line 731
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 747
+#line 731
{
-#line 747
+#line 731
/* not fatal to the loop */
-#line 747
+#line 731
status = lstatus;
-#line 747
+#line 731
}
-#line 747
+#line 731
-#line 747
+#line 731
(void) ncio_rel(ncp->nciop, offset,
-#line 747
+#line 731
RGN_MODIFIED);
-#line 747
+#line 731
-#line 747
+#line 731
remaining -= extent;
-#line 747
+#line 731
if(remaining == 0)
-#line 747
+#line 731
break; /* normal loop exit */
-#line 747
+#line 731
offset += (off_t)extent;
-#line 747
+#line 731
value += nput;
-#line 747
+#line 731
-#line 747
+#line 731
}
-#line 747
+#line 731
#ifdef ERANGE_FILL
-#line 747
+#line 731
free(fillp);
-#line 747
+#line 731
#endif
-#line 747
+#line 731
-#line 747
+#line 731
return status;
-#line 747
+#line 731
}
-#line 747
+#line 731
static int
-#line 748
+#line 732
putNCvx_float_double(NC3_INFO* ncp, const NC_var *varp,
-#line 748
+#line 732
const size_t *start, size_t nelems, const double *value)
-#line 748
+#line 732
{
-#line 748
+#line 732
off_t offset = NC_varoffset(ncp, varp, start);
-#line 748
+#line 732
size_t remaining = varp->xsz * nelems;
-#line 748
+#line 732
int status = NC_NOERR;
-#line 748
+#line 732
void *xp;
-#line 748
+#line 732
void *fillp=NULL;
-#line 748
+#line 732
-#line 748
+#line 732
if(nelems == 0)
-#line 748
+#line 732
return NC_NOERR;
-#line 748
+#line 732
-#line 748
+#line 732
assert(value != NULL);
-#line 748
+#line 732
-#line 748
+#line 732
#ifdef ERANGE_FILL
-#line 748
+#line 732
fillp = malloc(varp->xsz);
-#line 748
+#line 732
status = NC3_inq_var_fill(varp, fillp);
-#line 748
+#line 732
#endif
-#line 748
+#line 732
-#line 748
+#line 732
for(;;)
-#line 748
+#line 732
{
-#line 748
+#line 732
size_t extent = MIN(remaining, ncp->chunk);
-#line 748
+#line 732
size_t nput = ncx_howmany(varp->type, extent);
-#line 748
+#line 732
-#line 748
+#line 732
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 748
+#line 732
RGN_WRITE, &xp);
-#line 748
+#line 732
if(lstatus != NC_NOERR)
-#line 748
+#line 732
return lstatus;
-#line 748
+#line 732
-#line 748
+#line 732
lstatus = ncx_putn_float_double(&xp, nput, value ,fillp);
-#line 748
+#line 732
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 748
+#line 732
{
-#line 748
+#line 732
/* not fatal to the loop */
-#line 748
+#line 732
status = lstatus;
-#line 748
+#line 732
}
-#line 748
+#line 732
-#line 748
+#line 732
(void) ncio_rel(ncp->nciop, offset,
-#line 748
+#line 732
RGN_MODIFIED);
-#line 748
+#line 732
-#line 748
+#line 732
remaining -= extent;
-#line 748
+#line 732
if(remaining == 0)
-#line 748
+#line 732
break; /* normal loop exit */
-#line 748
+#line 732
offset += (off_t)extent;
-#line 748
+#line 732
value += nput;
-#line 748
+#line 732
-#line 748
+#line 732
}
-#line 748
+#line 732
#ifdef ERANGE_FILL
-#line 748
+#line 732
free(fillp);
-#line 748
+#line 732
#endif
-#line 748
+#line 732
-#line 748
+#line 732
return status;
-#line 748
+#line 732
}
-#line 748
+#line 732
static int
-#line 749
+#line 733
putNCvx_float_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 749
+#line 733
const size_t *start, size_t nelems, const longlong *value)
-#line 749
+#line 733
{
-#line 749
+#line 733
off_t offset = NC_varoffset(ncp, varp, start);
-#line 749
+#line 733
size_t remaining = varp->xsz * nelems;
-#line 749
+#line 733
int status = NC_NOERR;
-#line 749
+#line 733
void *xp;
-#line 749
+#line 733
void *fillp=NULL;
-#line 749
+#line 733
-#line 749
+#line 733
if(nelems == 0)
-#line 749
+#line 733
return NC_NOERR;
-#line 749
+#line 733
-#line 749
+#line 733
assert(value != NULL);
-#line 749
+#line 733
-#line 749
+#line 733
#ifdef ERANGE_FILL
-#line 749
+#line 733
fillp = malloc(varp->xsz);
-#line 749
+#line 733
status = NC3_inq_var_fill(varp, fillp);
-#line 749
+#line 733
#endif
-#line 749
+#line 733
-#line 749
+#line 733
for(;;)
-#line 749
+#line 733
{
-#line 749
+#line 733
size_t extent = MIN(remaining, ncp->chunk);
-#line 749
+#line 733
size_t nput = ncx_howmany(varp->type, extent);
-#line 749
+#line 733
-#line 749
+#line 733
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 749
+#line 733
RGN_WRITE, &xp);
-#line 749
+#line 733
if(lstatus != NC_NOERR)
-#line 749
+#line 733
return lstatus;
-#line 749
+#line 733
-#line 749
+#line 733
lstatus = ncx_putn_float_longlong(&xp, nput, value ,fillp);
-#line 749
+#line 733
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 749
+#line 733
{
-#line 749
+#line 733
/* not fatal to the loop */
-#line 749
+#line 733
status = lstatus;
-#line 749
+#line 733
}
-#line 749
+#line 733
-#line 749
+#line 733
(void) ncio_rel(ncp->nciop, offset,
-#line 749
+#line 733
RGN_MODIFIED);
-#line 749
+#line 733
-#line 749
+#line 733
remaining -= extent;
-#line 749
+#line 733
if(remaining == 0)
-#line 749
+#line 733
break; /* normal loop exit */
-#line 749
+#line 733
offset += (off_t)extent;
-#line 749
+#line 733
value += nput;
-#line 749
+#line 733
-#line 749
+#line 733
}
-#line 749
+#line 733
#ifdef ERANGE_FILL
-#line 749
+#line 733
free(fillp);
-#line 749
+#line 733
#endif
-#line 749
+#line 733
-#line 749
+#line 733
return status;
-#line 749
+#line 733
}
-#line 749
+#line 733
static int
-#line 750
+#line 734
putNCvx_float_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 750
+#line 734
const size_t *start, size_t nelems, const ushort *value)
-#line 750
+#line 734
{
-#line 750
+#line 734
off_t offset = NC_varoffset(ncp, varp, start);
-#line 750
+#line 734
size_t remaining = varp->xsz * nelems;
-#line 750
+#line 734
int status = NC_NOERR;
-#line 750
+#line 734
void *xp;
-#line 750
+#line 734
void *fillp=NULL;
-#line 750
+#line 734
-#line 750
+#line 734
if(nelems == 0)
-#line 750
+#line 734
return NC_NOERR;
-#line 750
+#line 734
-#line 750
+#line 734
assert(value != NULL);
-#line 750
+#line 734
-#line 750
+#line 734
#ifdef ERANGE_FILL
-#line 750
+#line 734
fillp = malloc(varp->xsz);
-#line 750
+#line 734
status = NC3_inq_var_fill(varp, fillp);
-#line 750
+#line 734
#endif
-#line 750
+#line 734
-#line 750
+#line 734
for(;;)
-#line 750
+#line 734
{
-#line 750
+#line 734
size_t extent = MIN(remaining, ncp->chunk);
-#line 750
+#line 734
size_t nput = ncx_howmany(varp->type, extent);
-#line 750
+#line 734
-#line 750
+#line 734
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 750
+#line 734
RGN_WRITE, &xp);
-#line 750
+#line 734
if(lstatus != NC_NOERR)
-#line 750
+#line 734
return lstatus;
-#line 750
+#line 734
-#line 750
+#line 734
lstatus = ncx_putn_float_ushort(&xp, nput, value ,fillp);
-#line 750
+#line 734
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 750
+#line 734
{
-#line 750
+#line 734
/* not fatal to the loop */
-#line 750
+#line 734
status = lstatus;
-#line 750
+#line 734
}
-#line 750
+#line 734
-#line 750
+#line 734
(void) ncio_rel(ncp->nciop, offset,
-#line 750
+#line 734
RGN_MODIFIED);
-#line 750
+#line 734
-#line 750
+#line 734
remaining -= extent;
-#line 750
+#line 734
if(remaining == 0)
-#line 750
+#line 734
break; /* normal loop exit */
-#line 750
+#line 734
offset += (off_t)extent;
-#line 750
+#line 734
value += nput;
-#line 750
+#line 734
-#line 750
+#line 734
}
-#line 750
+#line 734
#ifdef ERANGE_FILL
-#line 750
+#line 734
free(fillp);
-#line 750
+#line 734
#endif
-#line 750
+#line 734
-#line 750
+#line 734
return status;
-#line 750
+#line 734
}
-#line 750
+#line 734
static int
-#line 751
+#line 735
putNCvx_float_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 751
+#line 735
const size_t *start, size_t nelems, const uint *value)
-#line 751
+#line 735
{
-#line 751
+#line 735
off_t offset = NC_varoffset(ncp, varp, start);
-#line 751
+#line 735
size_t remaining = varp->xsz * nelems;
-#line 751
+#line 735
int status = NC_NOERR;
-#line 751
+#line 735
void *xp;
-#line 751
+#line 735
void *fillp=NULL;
-#line 751
+#line 735
-#line 751
+#line 735
if(nelems == 0)
-#line 751
+#line 735
return NC_NOERR;
-#line 751
+#line 735
-#line 751
+#line 735
assert(value != NULL);
-#line 751
+#line 735
-#line 751
+#line 735
#ifdef ERANGE_FILL
-#line 751
+#line 735
fillp = malloc(varp->xsz);
-#line 751
+#line 735
status = NC3_inq_var_fill(varp, fillp);
-#line 751
+#line 735
#endif
-#line 751
+#line 735
-#line 751
+#line 735
for(;;)
-#line 751
+#line 735
{
-#line 751
+#line 735
size_t extent = MIN(remaining, ncp->chunk);
-#line 751
+#line 735
size_t nput = ncx_howmany(varp->type, extent);
-#line 751
+#line 735
-#line 751
+#line 735
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 751
+#line 735
RGN_WRITE, &xp);
-#line 751
+#line 735
if(lstatus != NC_NOERR)
-#line 751
+#line 735
return lstatus;
-#line 751
+#line 735
-#line 751
+#line 735
lstatus = ncx_putn_float_uint(&xp, nput, value ,fillp);
-#line 751
+#line 735
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 751
+#line 735
{
-#line 751
+#line 735
/* not fatal to the loop */
-#line 751
+#line 735
status = lstatus;
-#line 751
+#line 735
}
-#line 751
+#line 735
-#line 751
+#line 735
(void) ncio_rel(ncp->nciop, offset,
-#line 751
+#line 735
RGN_MODIFIED);
-#line 751
+#line 735
-#line 751
+#line 735
remaining -= extent;
-#line 751
+#line 735
if(remaining == 0)
-#line 751
+#line 735
break; /* normal loop exit */
-#line 751
+#line 735
offset += (off_t)extent;
-#line 751
+#line 735
value += nput;
-#line 751
+#line 735
-#line 751
+#line 735
}
-#line 751
+#line 735
#ifdef ERANGE_FILL
-#line 751
+#line 735
free(fillp);
-#line 751
+#line 735
#endif
-#line 751
+#line 735
-#line 751
+#line 735
return status;
-#line 751
+#line 735
}
-#line 751
+#line 735
static int
-#line 752
+#line 736
putNCvx_float_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 752
+#line 736
const size_t *start, size_t nelems, const ulonglong *value)
-#line 752
+#line 736
{
-#line 752
+#line 736
off_t offset = NC_varoffset(ncp, varp, start);
-#line 752
+#line 736
size_t remaining = varp->xsz * nelems;
-#line 752
+#line 736
int status = NC_NOERR;
-#line 752
+#line 736
void *xp;
-#line 752
+#line 736
void *fillp=NULL;
-#line 752
+#line 736
-#line 752
+#line 736
if(nelems == 0)
-#line 752
+#line 736
return NC_NOERR;
-#line 752
+#line 736
-#line 752
+#line 736
assert(value != NULL);
-#line 752
+#line 736
-#line 752
+#line 736
#ifdef ERANGE_FILL
-#line 752
+#line 736
fillp = malloc(varp->xsz);
-#line 752
+#line 736
status = NC3_inq_var_fill(varp, fillp);
-#line 752
+#line 736
#endif
-#line 752
+#line 736
-#line 752
+#line 736
for(;;)
-#line 752
+#line 736
{
-#line 752
+#line 736
size_t extent = MIN(remaining, ncp->chunk);
-#line 752
+#line 736
size_t nput = ncx_howmany(varp->type, extent);
-#line 752
+#line 736
-#line 752
+#line 736
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 752
+#line 736
RGN_WRITE, &xp);
-#line 752
+#line 736
if(lstatus != NC_NOERR)
-#line 752
+#line 736
return lstatus;
-#line 752
+#line 736
-#line 752
+#line 736
lstatus = ncx_putn_float_ulonglong(&xp, nput, value ,fillp);
-#line 752
+#line 736
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 752
+#line 736
{
-#line 752
+#line 736
/* not fatal to the loop */
-#line 752
+#line 736
status = lstatus;
-#line 752
+#line 736
}
-#line 752
+#line 736
-#line 752
+#line 736
(void) ncio_rel(ncp->nciop, offset,
-#line 752
+#line 736
RGN_MODIFIED);
-#line 752
+#line 736
-#line 752
+#line 736
remaining -= extent;
-#line 752
+#line 736
if(remaining == 0)
-#line 752
+#line 736
break; /* normal loop exit */
-#line 752
+#line 736
offset += (off_t)extent;
-#line 752
+#line 736
value += nput;
-#line 752
+#line 736
-#line 752
+#line 736
}
-#line 752
+#line 736
#ifdef ERANGE_FILL
-#line 752
+#line 736
free(fillp);
-#line 752
+#line 736
#endif
-#line 752
+#line 736
-#line 752
+#line 736
return status;
-#line 752
+#line 736
}
-#line 752
+#line 736
static int
-#line 754
+#line 738
putNCvx_double_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 754
+#line 738
const size_t *start, size_t nelems, const schar *value)
-#line 754
+#line 738
{
-#line 754
+#line 738
off_t offset = NC_varoffset(ncp, varp, start);
-#line 754
+#line 738
size_t remaining = varp->xsz * nelems;
-#line 754
+#line 738
int status = NC_NOERR;
-#line 754
+#line 738
void *xp;
-#line 754
+#line 738
void *fillp=NULL;
-#line 754
+#line 738
-#line 754
+#line 738
if(nelems == 0)
-#line 754
+#line 738
return NC_NOERR;
-#line 754
+#line 738
-#line 754
+#line 738
assert(value != NULL);
-#line 754
+#line 738
-#line 754
+#line 738
#ifdef ERANGE_FILL
-#line 754
+#line 738
fillp = malloc(varp->xsz);
-#line 754
+#line 738
status = NC3_inq_var_fill(varp, fillp);
-#line 754
+#line 738
#endif
-#line 754
+#line 738
-#line 754
+#line 738
for(;;)
-#line 754
+#line 738
{
-#line 754
+#line 738
size_t extent = MIN(remaining, ncp->chunk);
-#line 754
+#line 738
size_t nput = ncx_howmany(varp->type, extent);
-#line 754
+#line 738
-#line 754
+#line 738
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 754
+#line 738
RGN_WRITE, &xp);
-#line 754
+#line 738
if(lstatus != NC_NOERR)
-#line 754
+#line 738
return lstatus;
-#line 754
+#line 738
-#line 754
+#line 738
lstatus = ncx_putn_double_schar(&xp, nput, value ,fillp);
-#line 754
+#line 738
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 754
+#line 738
{
-#line 754
+#line 738
/* not fatal to the loop */
-#line 754
+#line 738
status = lstatus;
-#line 754
+#line 738
}
-#line 754
+#line 738
-#line 754
+#line 738
(void) ncio_rel(ncp->nciop, offset,
-#line 754
+#line 738
RGN_MODIFIED);
-#line 754
+#line 738
-#line 754
+#line 738
remaining -= extent;
-#line 754
+#line 738
if(remaining == 0)
-#line 754
+#line 738
break; /* normal loop exit */
-#line 754
+#line 738
offset += (off_t)extent;
-#line 754
+#line 738
value += nput;
-#line 754
+#line 738
-#line 754
+#line 738
}
-#line 754
+#line 738
#ifdef ERANGE_FILL
-#line 754
+#line 738
free(fillp);
-#line 754
+#line 738
#endif
-#line 754
+#line 738
-#line 754
+#line 738
return status;
-#line 754
+#line 738
}
-#line 754
+#line 738
static int
-#line 755
+#line 739
putNCvx_double_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 755
+#line 739
const size_t *start, size_t nelems, const uchar *value)
-#line 755
+#line 739
{
-#line 755
+#line 739
off_t offset = NC_varoffset(ncp, varp, start);
-#line 755
+#line 739
size_t remaining = varp->xsz * nelems;
-#line 755
+#line 739
int status = NC_NOERR;
-#line 755
+#line 739
void *xp;
-#line 755
+#line 739
void *fillp=NULL;
-#line 755
+#line 739
-#line 755
+#line 739
if(nelems == 0)
-#line 755
+#line 739
return NC_NOERR;
-#line 755
+#line 739
-#line 755
+#line 739
assert(value != NULL);
-#line 755
+#line 739
-#line 755
+#line 739
#ifdef ERANGE_FILL
-#line 755
+#line 739
fillp = malloc(varp->xsz);
-#line 755
+#line 739
status = NC3_inq_var_fill(varp, fillp);
-#line 755
+#line 739
#endif
-#line 755
+#line 739
-#line 755
+#line 739
for(;;)
-#line 755
+#line 739
{
-#line 755
+#line 739
size_t extent = MIN(remaining, ncp->chunk);
-#line 755
+#line 739
size_t nput = ncx_howmany(varp->type, extent);
-#line 755
+#line 739
-#line 755
+#line 739
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 755
+#line 739
RGN_WRITE, &xp);
-#line 755
+#line 739
if(lstatus != NC_NOERR)
-#line 755
+#line 739
return lstatus;
-#line 755
+#line 739
-#line 755
+#line 739
lstatus = ncx_putn_double_uchar(&xp, nput, value ,fillp);
-#line 755
+#line 739
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 755
+#line 739
{
-#line 755
+#line 739
/* not fatal to the loop */
-#line 755
+#line 739
status = lstatus;
-#line 755
+#line 739
}
-#line 755
+#line 739
-#line 755
+#line 739
(void) ncio_rel(ncp->nciop, offset,
-#line 755
+#line 739
RGN_MODIFIED);
-#line 755
+#line 739
-#line 755
+#line 739
remaining -= extent;
-#line 755
+#line 739
if(remaining == 0)
-#line 755
+#line 739
break; /* normal loop exit */
-#line 755
+#line 739
offset += (off_t)extent;
-#line 755
+#line 739
value += nput;
-#line 755
+#line 739
-#line 755
+#line 739
}
-#line 755
+#line 739
#ifdef ERANGE_FILL
-#line 755
+#line 739
free(fillp);
-#line 755
+#line 739
#endif
-#line 755
+#line 739
-#line 755
+#line 739
return status;
-#line 755
+#line 739
}
-#line 755
+#line 739
static int
-#line 756
+#line 740
putNCvx_double_short(NC3_INFO* ncp, const NC_var *varp,
-#line 756
+#line 740
const size_t *start, size_t nelems, const short *value)
-#line 756
+#line 740
{
-#line 756
+#line 740
off_t offset = NC_varoffset(ncp, varp, start);
-#line 756
+#line 740
size_t remaining = varp->xsz * nelems;
-#line 756
+#line 740
int status = NC_NOERR;
-#line 756
+#line 740
void *xp;
-#line 756
+#line 740
void *fillp=NULL;
-#line 756
+#line 740
-#line 756
+#line 740
if(nelems == 0)
-#line 756
+#line 740
return NC_NOERR;
-#line 756
+#line 740
-#line 756
+#line 740
assert(value != NULL);
-#line 756
+#line 740
-#line 756
+#line 740
#ifdef ERANGE_FILL
-#line 756
+#line 740
fillp = malloc(varp->xsz);
-#line 756
+#line 740
status = NC3_inq_var_fill(varp, fillp);
-#line 756
+#line 740
#endif
-#line 756
+#line 740
-#line 756
+#line 740
for(;;)
-#line 756
+#line 740
{
-#line 756
+#line 740
size_t extent = MIN(remaining, ncp->chunk);
-#line 756
+#line 740
size_t nput = ncx_howmany(varp->type, extent);
-#line 756
+#line 740
-#line 756
+#line 740
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 756
+#line 740
RGN_WRITE, &xp);
-#line 756
+#line 740
if(lstatus != NC_NOERR)
-#line 756
+#line 740
return lstatus;
-#line 756
+#line 740
-#line 756
+#line 740
lstatus = ncx_putn_double_short(&xp, nput, value ,fillp);
-#line 756
+#line 740
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 756
+#line 740
{
-#line 756
+#line 740
/* not fatal to the loop */
-#line 756
+#line 740
status = lstatus;
-#line 756
+#line 740
}
-#line 756
+#line 740
-#line 756
+#line 740
(void) ncio_rel(ncp->nciop, offset,
-#line 756
+#line 740
RGN_MODIFIED);
-#line 756
+#line 740
-#line 756
+#line 740
remaining -= extent;
-#line 756
+#line 740
if(remaining == 0)
-#line 756
+#line 740
break; /* normal loop exit */
-#line 756
+#line 740
offset += (off_t)extent;
-#line 756
+#line 740
value += nput;
-#line 756
+#line 740
-#line 756
+#line 740
}
-#line 756
+#line 740
#ifdef ERANGE_FILL
-#line 756
+#line 740
free(fillp);
-#line 756
+#line 740
#endif
-#line 756
+#line 740
-#line 756
+#line 740
return status;
-#line 756
+#line 740
}
-#line 756
+#line 740
static int
-#line 757
+#line 741
putNCvx_double_int(NC3_INFO* ncp, const NC_var *varp,
-#line 757
+#line 741
const size_t *start, size_t nelems, const int *value)
-#line 757
+#line 741
{
-#line 757
+#line 741
off_t offset = NC_varoffset(ncp, varp, start);
-#line 757
+#line 741
size_t remaining = varp->xsz * nelems;
-#line 757
+#line 741
int status = NC_NOERR;
-#line 757
+#line 741
void *xp;
-#line 757
+#line 741
void *fillp=NULL;
-#line 757
+#line 741
-#line 757
+#line 741
if(nelems == 0)
-#line 757
+#line 741
return NC_NOERR;
-#line 757
+#line 741
-#line 757
+#line 741
assert(value != NULL);
-#line 757
+#line 741
-#line 757
+#line 741
#ifdef ERANGE_FILL
-#line 757
+#line 741
fillp = malloc(varp->xsz);
-#line 757
+#line 741
status = NC3_inq_var_fill(varp, fillp);
-#line 757
+#line 741
#endif
-#line 757
+#line 741
-#line 757
+#line 741
for(;;)
-#line 757
+#line 741
{
-#line 757
+#line 741
size_t extent = MIN(remaining, ncp->chunk);
-#line 757
+#line 741
size_t nput = ncx_howmany(varp->type, extent);
-#line 757
+#line 741
-#line 757
+#line 741
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 757
+#line 741
RGN_WRITE, &xp);
-#line 757
+#line 741
if(lstatus != NC_NOERR)
-#line 757
+#line 741
return lstatus;
-#line 757
+#line 741
-#line 757
+#line 741
lstatus = ncx_putn_double_int(&xp, nput, value ,fillp);
-#line 757
+#line 741
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 757
+#line 741
{
-#line 757
+#line 741
/* not fatal to the loop */
-#line 757
+#line 741
status = lstatus;
-#line 757
+#line 741
}
-#line 757
+#line 741
-#line 757
+#line 741
(void) ncio_rel(ncp->nciop, offset,
-#line 757
+#line 741
RGN_MODIFIED);
-#line 757
+#line 741
-#line 757
+#line 741
remaining -= extent;
-#line 757
+#line 741
if(remaining == 0)
-#line 757
+#line 741
break; /* normal loop exit */
-#line 757
+#line 741
offset += (off_t)extent;
-#line 757
+#line 741
value += nput;
-#line 757
+#line 741
-#line 757
+#line 741
}
-#line 757
+#line 741
#ifdef ERANGE_FILL
-#line 757
+#line 741
free(fillp);
-#line 757
+#line 741
#endif
-#line 757
+#line 741
-#line 757
+#line 741
return status;
-#line 757
+#line 741
}
-#line 757
+#line 741
static int
-#line 758
+#line 742
putNCvx_double_float(NC3_INFO* ncp, const NC_var *varp,
-#line 758
+#line 742
const size_t *start, size_t nelems, const float *value)
-#line 758
+#line 742
{
-#line 758
+#line 742
off_t offset = NC_varoffset(ncp, varp, start);
-#line 758
+#line 742
size_t remaining = varp->xsz * nelems;
-#line 758
+#line 742
int status = NC_NOERR;
-#line 758
+#line 742
void *xp;
-#line 758
+#line 742
void *fillp=NULL;
-#line 758
+#line 742
-#line 758
+#line 742
if(nelems == 0)
-#line 758
+#line 742
return NC_NOERR;
-#line 758
+#line 742
-#line 758
+#line 742
assert(value != NULL);
-#line 758
+#line 742
-#line 758
+#line 742
#ifdef ERANGE_FILL
-#line 758
+#line 742
fillp = malloc(varp->xsz);
-#line 758
+#line 742
status = NC3_inq_var_fill(varp, fillp);
-#line 758
+#line 742
#endif
-#line 758
+#line 742
-#line 758
+#line 742
for(;;)
-#line 758
+#line 742
{
-#line 758
+#line 742
size_t extent = MIN(remaining, ncp->chunk);
-#line 758
+#line 742
size_t nput = ncx_howmany(varp->type, extent);
-#line 758
+#line 742
-#line 758
+#line 742
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 758
+#line 742
RGN_WRITE, &xp);
-#line 758
+#line 742
if(lstatus != NC_NOERR)
-#line 758
+#line 742
return lstatus;
-#line 758
+#line 742
-#line 758
+#line 742
lstatus = ncx_putn_double_float(&xp, nput, value ,fillp);
-#line 758
+#line 742
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 758
+#line 742
{
-#line 758
+#line 742
/* not fatal to the loop */
-#line 758
+#line 742
status = lstatus;
-#line 758
+#line 742
}
-#line 758
+#line 742
-#line 758
+#line 742
(void) ncio_rel(ncp->nciop, offset,
-#line 758
+#line 742
RGN_MODIFIED);
-#line 758
+#line 742
-#line 758
+#line 742
remaining -= extent;
-#line 758
+#line 742
if(remaining == 0)
-#line 758
+#line 742
break; /* normal loop exit */
-#line 758
+#line 742
offset += (off_t)extent;
-#line 758
+#line 742
value += nput;
-#line 758
+#line 742
-#line 758
+#line 742
}
-#line 758
+#line 742
#ifdef ERANGE_FILL
-#line 758
+#line 742
free(fillp);
-#line 758
+#line 742
#endif
-#line 758
+#line 742
-#line 758
+#line 742
return status;
-#line 758
+#line 742
}
-#line 758
+#line 742
static int
-#line 759
+#line 743
putNCvx_double_double(NC3_INFO* ncp, const NC_var *varp,
-#line 759
+#line 743
const size_t *start, size_t nelems, const double *value)
-#line 759
+#line 743
{
-#line 759
+#line 743
off_t offset = NC_varoffset(ncp, varp, start);
-#line 759
+#line 743
size_t remaining = varp->xsz * nelems;
-#line 759
+#line 743
int status = NC_NOERR;
-#line 759
+#line 743
void *xp;
-#line 759
+#line 743
void *fillp=NULL;
-#line 759
+#line 743
-#line 759
+#line 743
if(nelems == 0)
-#line 759
+#line 743
return NC_NOERR;
-#line 759
+#line 743
-#line 759
+#line 743
assert(value != NULL);
-#line 759
+#line 743
-#line 759
+#line 743
#ifdef ERANGE_FILL
-#line 759
+#line 743
fillp = malloc(varp->xsz);
-#line 759
+#line 743
status = NC3_inq_var_fill(varp, fillp);
-#line 759
+#line 743
#endif
-#line 759
+#line 743
-#line 759
+#line 743
for(;;)
-#line 759
+#line 743
{
-#line 759
+#line 743
size_t extent = MIN(remaining, ncp->chunk);
-#line 759
+#line 743
size_t nput = ncx_howmany(varp->type, extent);
-#line 759
+#line 743
-#line 759
+#line 743
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 759
+#line 743
RGN_WRITE, &xp);
-#line 759
+#line 743
if(lstatus != NC_NOERR)
-#line 759
+#line 743
return lstatus;
-#line 759
+#line 743
-#line 759
+#line 743
lstatus = ncx_putn_double_double(&xp, nput, value ,fillp);
-#line 759
+#line 743
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 759
+#line 743
{
-#line 759
+#line 743
/* not fatal to the loop */
-#line 759
+#line 743
status = lstatus;
-#line 759
+#line 743
}
-#line 759
+#line 743
-#line 759
+#line 743
(void) ncio_rel(ncp->nciop, offset,
-#line 759
+#line 743
RGN_MODIFIED);
-#line 759
+#line 743
-#line 759
+#line 743
remaining -= extent;
-#line 759
+#line 743
if(remaining == 0)
-#line 759
+#line 743
break; /* normal loop exit */
-#line 759
+#line 743
offset += (off_t)extent;
-#line 759
+#line 743
value += nput;
-#line 759
+#line 743
-#line 759
+#line 743
}
-#line 759
+#line 743
#ifdef ERANGE_FILL
-#line 759
+#line 743
free(fillp);
-#line 759
+#line 743
#endif
-#line 759
+#line 743
-#line 759
+#line 743
return status;
-#line 759
+#line 743
}
-#line 759
+#line 743
static int
-#line 760
+#line 744
putNCvx_double_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 760
+#line 744
const size_t *start, size_t nelems, const longlong *value)
-#line 760
+#line 744
{
-#line 760
+#line 744
off_t offset = NC_varoffset(ncp, varp, start);
-#line 760
+#line 744
size_t remaining = varp->xsz * nelems;
-#line 760
+#line 744
int status = NC_NOERR;
-#line 760
+#line 744
void *xp;
-#line 760
+#line 744
void *fillp=NULL;
-#line 760
+#line 744
-#line 760
+#line 744
if(nelems == 0)
-#line 760
+#line 744
return NC_NOERR;
-#line 760
+#line 744
-#line 760
+#line 744
assert(value != NULL);
-#line 760
+#line 744
-#line 760
+#line 744
#ifdef ERANGE_FILL
-#line 760
+#line 744
fillp = malloc(varp->xsz);
-#line 760
+#line 744
status = NC3_inq_var_fill(varp, fillp);
-#line 760
+#line 744
#endif
-#line 760
+#line 744
-#line 760
+#line 744
for(;;)
-#line 760
+#line 744
{
-#line 760
+#line 744
size_t extent = MIN(remaining, ncp->chunk);
-#line 760
+#line 744
size_t nput = ncx_howmany(varp->type, extent);
-#line 760
+#line 744
-#line 760
+#line 744
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 760
+#line 744
RGN_WRITE, &xp);
-#line 760
+#line 744
if(lstatus != NC_NOERR)
-#line 760
+#line 744
return lstatus;
-#line 760
+#line 744
-#line 760
+#line 744
lstatus = ncx_putn_double_longlong(&xp, nput, value ,fillp);
-#line 760
+#line 744
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 760
+#line 744
{
-#line 760
+#line 744
/* not fatal to the loop */
-#line 760
+#line 744
status = lstatus;
-#line 760
+#line 744
}
-#line 760
+#line 744
-#line 760
+#line 744
(void) ncio_rel(ncp->nciop, offset,
-#line 760
+#line 744
RGN_MODIFIED);
-#line 760
+#line 744
-#line 760
+#line 744
remaining -= extent;
-#line 760
+#line 744
if(remaining == 0)
-#line 760
+#line 744
break; /* normal loop exit */
-#line 760
+#line 744
offset += (off_t)extent;
-#line 760
+#line 744
value += nput;
-#line 760
+#line 744
-#line 760
+#line 744
}
-#line 760
+#line 744
#ifdef ERANGE_FILL
-#line 760
+#line 744
free(fillp);
-#line 760
+#line 744
#endif
-#line 760
+#line 744
-#line 760
+#line 744
return status;
-#line 760
+#line 744
}
-#line 760
+#line 744
static int
-#line 761
+#line 745
putNCvx_double_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 761
+#line 745
const size_t *start, size_t nelems, const ushort *value)
-#line 761
+#line 745
{
-#line 761
+#line 745
off_t offset = NC_varoffset(ncp, varp, start);
-#line 761
+#line 745
size_t remaining = varp->xsz * nelems;
-#line 761
+#line 745
int status = NC_NOERR;
-#line 761
+#line 745
void *xp;
-#line 761
+#line 745
void *fillp=NULL;
-#line 761
+#line 745
-#line 761
+#line 745
if(nelems == 0)
-#line 761
+#line 745
return NC_NOERR;
-#line 761
+#line 745
-#line 761
+#line 745
assert(value != NULL);
-#line 761
+#line 745
-#line 761
+#line 745
#ifdef ERANGE_FILL
-#line 761
+#line 745
fillp = malloc(varp->xsz);
-#line 761
+#line 745
status = NC3_inq_var_fill(varp, fillp);
-#line 761
+#line 745
#endif
-#line 761
+#line 745
-#line 761
+#line 745
for(;;)
-#line 761
+#line 745
{
-#line 761
+#line 745
size_t extent = MIN(remaining, ncp->chunk);
-#line 761
+#line 745
size_t nput = ncx_howmany(varp->type, extent);
-#line 761
+#line 745
-#line 761
+#line 745
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 761
+#line 745
RGN_WRITE, &xp);
-#line 761
+#line 745
if(lstatus != NC_NOERR)
-#line 761
+#line 745
return lstatus;
-#line 761
+#line 745
-#line 761
+#line 745
lstatus = ncx_putn_double_ushort(&xp, nput, value ,fillp);
-#line 761
+#line 745
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 761
+#line 745
{
-#line 761
+#line 745
/* not fatal to the loop */
-#line 761
+#line 745
status = lstatus;
-#line 761
+#line 745
}
-#line 761
+#line 745
-#line 761
+#line 745
(void) ncio_rel(ncp->nciop, offset,
-#line 761
+#line 745
RGN_MODIFIED);
-#line 761
+#line 745
-#line 761
+#line 745
remaining -= extent;
-#line 761
+#line 745
if(remaining == 0)
-#line 761
+#line 745
break; /* normal loop exit */
-#line 761
+#line 745
offset += (off_t)extent;
-#line 761
+#line 745
value += nput;
-#line 761
+#line 745
-#line 761
+#line 745
}
-#line 761
+#line 745
#ifdef ERANGE_FILL
-#line 761
+#line 745
free(fillp);
-#line 761
+#line 745
#endif
-#line 761
+#line 745
-#line 761
+#line 745
return status;
-#line 761
+#line 745
}
-#line 761
+#line 745
static int
-#line 762
+#line 746
putNCvx_double_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 762
+#line 746
const size_t *start, size_t nelems, const uint *value)
-#line 762
+#line 746
{
-#line 762
+#line 746
off_t offset = NC_varoffset(ncp, varp, start);
-#line 762
+#line 746
size_t remaining = varp->xsz * nelems;
-#line 762
+#line 746
int status = NC_NOERR;
-#line 762
+#line 746
void *xp;
-#line 762
+#line 746
void *fillp=NULL;
-#line 762
+#line 746
-#line 762
+#line 746
if(nelems == 0)
-#line 762
+#line 746
return NC_NOERR;
-#line 762
+#line 746
-#line 762
+#line 746
assert(value != NULL);
-#line 762
+#line 746
-#line 762
+#line 746
#ifdef ERANGE_FILL
-#line 762
+#line 746
fillp = malloc(varp->xsz);
-#line 762
+#line 746
status = NC3_inq_var_fill(varp, fillp);
-#line 762
+#line 746
#endif
-#line 762
+#line 746
-#line 762
+#line 746
for(;;)
-#line 762
+#line 746
{
-#line 762
+#line 746
size_t extent = MIN(remaining, ncp->chunk);
-#line 762
+#line 746
size_t nput = ncx_howmany(varp->type, extent);
-#line 762
+#line 746
-#line 762
+#line 746
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 762
+#line 746
RGN_WRITE, &xp);
-#line 762
+#line 746
if(lstatus != NC_NOERR)
-#line 762
+#line 746
return lstatus;
-#line 762
+#line 746
-#line 762
+#line 746
lstatus = ncx_putn_double_uint(&xp, nput, value ,fillp);
-#line 762
+#line 746
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 762
+#line 746
{
-#line 762
+#line 746
/* not fatal to the loop */
-#line 762
+#line 746
status = lstatus;
-#line 762
+#line 746
}
-#line 762
+#line 746
-#line 762
+#line 746
(void) ncio_rel(ncp->nciop, offset,
-#line 762
+#line 746
RGN_MODIFIED);
-#line 762
+#line 746
-#line 762
+#line 746
remaining -= extent;
-#line 762
+#line 746
if(remaining == 0)
-#line 762
+#line 746
break; /* normal loop exit */
-#line 762
+#line 746
offset += (off_t)extent;
-#line 762
+#line 746
value += nput;
-#line 762
+#line 746
-#line 762
+#line 746
}
-#line 762
+#line 746
#ifdef ERANGE_FILL
-#line 762
+#line 746
free(fillp);
-#line 762
+#line 746
#endif
-#line 762
+#line 746
-#line 762
+#line 746
return status;
-#line 762
+#line 746
}
-#line 762
+#line 746
static int
-#line 763
+#line 747
putNCvx_double_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 763
+#line 747
const size_t *start, size_t nelems, const ulonglong *value)
-#line 763
+#line 747
{
-#line 763
+#line 747
off_t offset = NC_varoffset(ncp, varp, start);
-#line 763
+#line 747
size_t remaining = varp->xsz * nelems;
-#line 763
+#line 747
int status = NC_NOERR;
-#line 763
+#line 747
void *xp;
-#line 763
+#line 747
void *fillp=NULL;
-#line 763
+#line 747
-#line 763
+#line 747
if(nelems == 0)
-#line 763
+#line 747
return NC_NOERR;
-#line 763
+#line 747
-#line 763
+#line 747
assert(value != NULL);
-#line 763
+#line 747
-#line 763
+#line 747
#ifdef ERANGE_FILL
-#line 763
+#line 747
fillp = malloc(varp->xsz);
-#line 763
+#line 747
status = NC3_inq_var_fill(varp, fillp);
-#line 763
+#line 747
#endif
-#line 763
+#line 747
-#line 763
+#line 747
for(;;)
-#line 763
+#line 747
{
-#line 763
+#line 747
size_t extent = MIN(remaining, ncp->chunk);
-#line 763
+#line 747
size_t nput = ncx_howmany(varp->type, extent);
-#line 763
+#line 747
-#line 763
+#line 747
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 763
+#line 747
RGN_WRITE, &xp);
-#line 763
+#line 747
if(lstatus != NC_NOERR)
-#line 763
+#line 747
return lstatus;
-#line 763
+#line 747
-#line 763
+#line 747
lstatus = ncx_putn_double_ulonglong(&xp, nput, value ,fillp);
-#line 763
+#line 747
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 763
+#line 747
{
-#line 763
+#line 747
/* not fatal to the loop */
-#line 763
+#line 747
status = lstatus;
-#line 763
+#line 747
}
-#line 763
+#line 747
-#line 763
+#line 747
(void) ncio_rel(ncp->nciop, offset,
-#line 763
+#line 747
RGN_MODIFIED);
-#line 763
+#line 747
-#line 763
+#line 747
remaining -= extent;
-#line 763
+#line 747
if(remaining == 0)
-#line 763
+#line 747
break; /* normal loop exit */
-#line 763
+#line 747
offset += (off_t)extent;
-#line 763
+#line 747
value += nput;
-#line 763
+#line 747
-#line 763
+#line 747
}
-#line 763
+#line 747
#ifdef ERANGE_FILL
-#line 763
+#line 747
free(fillp);
-#line 763
+#line 747
#endif
-#line 763
+#line 747
-#line 763
+#line 747
return status;
-#line 763
+#line 747
}
-#line 763
+#line 747
static int
-#line 765
+#line 749
putNCvx_uchar_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 765
+#line 749
const size_t *start, size_t nelems, const schar *value)
-#line 765
+#line 749
{
-#line 765
+#line 749
off_t offset = NC_varoffset(ncp, varp, start);
-#line 765
+#line 749
size_t remaining = varp->xsz * nelems;
-#line 765
+#line 749
int status = NC_NOERR;
-#line 765
+#line 749
void *xp;
-#line 765
+#line 749
void *fillp=NULL;
-#line 765
+#line 749
-#line 765
+#line 749
if(nelems == 0)
-#line 765
+#line 749
return NC_NOERR;
-#line 765
+#line 749
-#line 765
+#line 749
assert(value != NULL);
-#line 765
+#line 749
-#line 765
+#line 749
#ifdef ERANGE_FILL
-#line 765
+#line 749
fillp = malloc(varp->xsz);
-#line 765
+#line 749
status = NC3_inq_var_fill(varp, fillp);
-#line 765
+#line 749
#endif
-#line 765
+#line 749
-#line 765
+#line 749
for(;;)
-#line 765
+#line 749
{
-#line 765
+#line 749
size_t extent = MIN(remaining, ncp->chunk);
-#line 765
+#line 749
size_t nput = ncx_howmany(varp->type, extent);
-#line 765
+#line 749
-#line 765
+#line 749
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 765
+#line 749
RGN_WRITE, &xp);
-#line 765
+#line 749
if(lstatus != NC_NOERR)
-#line 765
+#line 749
return lstatus;
-#line 765
+#line 749
-#line 765
+#line 749
lstatus = ncx_putn_uchar_schar(&xp, nput, value ,fillp);
-#line 765
+#line 749
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 765
+#line 749
{
-#line 765
+#line 749
/* not fatal to the loop */
-#line 765
+#line 749
status = lstatus;
-#line 765
+#line 749
}
-#line 765
+#line 749
-#line 765
+#line 749
(void) ncio_rel(ncp->nciop, offset,
-#line 765
+#line 749
RGN_MODIFIED);
-#line 765
+#line 749
-#line 765
+#line 749
remaining -= extent;
-#line 765
+#line 749
if(remaining == 0)
-#line 765
+#line 749
break; /* normal loop exit */
-#line 765
+#line 749
offset += (off_t)extent;
-#line 765
+#line 749
value += nput;
-#line 765
+#line 749
-#line 765
+#line 749
}
-#line 765
+#line 749
#ifdef ERANGE_FILL
-#line 765
+#line 749
free(fillp);
-#line 765
+#line 749
#endif
-#line 765
+#line 749
-#line 765
+#line 749
return status;
-#line 765
+#line 749
}
-#line 765
+#line 749
static int
-#line 766
+#line 750
putNCvx_uchar_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 766
+#line 750
const size_t *start, size_t nelems, const uchar *value)
-#line 766
+#line 750
{
-#line 766
+#line 750
off_t offset = NC_varoffset(ncp, varp, start);
-#line 766
+#line 750
size_t remaining = varp->xsz * nelems;
-#line 766
+#line 750
int status = NC_NOERR;
-#line 766
+#line 750
void *xp;
-#line 766
+#line 750
void *fillp=NULL;
-#line 766
+#line 750
-#line 766
+#line 750
if(nelems == 0)
-#line 766
+#line 750
return NC_NOERR;
-#line 766
+#line 750
-#line 766
+#line 750
assert(value != NULL);
-#line 766
+#line 750
-#line 766
+#line 750
#ifdef ERANGE_FILL
-#line 766
+#line 750
fillp = malloc(varp->xsz);
-#line 766
+#line 750
status = NC3_inq_var_fill(varp, fillp);
-#line 766
+#line 750
#endif
-#line 766
+#line 750
-#line 766
+#line 750
for(;;)
-#line 766
+#line 750
{
-#line 766
+#line 750
size_t extent = MIN(remaining, ncp->chunk);
-#line 766
+#line 750
size_t nput = ncx_howmany(varp->type, extent);
-#line 766
+#line 750
-#line 766
+#line 750
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 766
+#line 750
RGN_WRITE, &xp);
-#line 766
+#line 750
if(lstatus != NC_NOERR)
-#line 766
+#line 750
return lstatus;
-#line 766
+#line 750
-#line 766
+#line 750
lstatus = ncx_putn_uchar_uchar(&xp, nput, value ,fillp);
-#line 766
+#line 750
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 766
+#line 750
{
-#line 766
+#line 750
/* not fatal to the loop */
-#line 766
+#line 750
status = lstatus;
-#line 766
+#line 750
}
-#line 766
+#line 750
-#line 766
+#line 750
(void) ncio_rel(ncp->nciop, offset,
-#line 766
+#line 750
RGN_MODIFIED);
-#line 766
+#line 750
-#line 766
+#line 750
remaining -= extent;
-#line 766
+#line 750
if(remaining == 0)
-#line 766
+#line 750
break; /* normal loop exit */
-#line 766
+#line 750
offset += (off_t)extent;
-#line 766
+#line 750
value += nput;
-#line 766
+#line 750
-#line 766
+#line 750
}
-#line 766
+#line 750
#ifdef ERANGE_FILL
-#line 766
+#line 750
free(fillp);
-#line 766
+#line 750
#endif
-#line 766
+#line 750
-#line 766
+#line 750
return status;
-#line 766
+#line 750
}
-#line 766
+#line 750
static int
-#line 767
+#line 751
putNCvx_uchar_short(NC3_INFO* ncp, const NC_var *varp,
-#line 767
+#line 751
const size_t *start, size_t nelems, const short *value)
-#line 767
+#line 751
{
-#line 767
+#line 751
off_t offset = NC_varoffset(ncp, varp, start);
-#line 767
+#line 751
size_t remaining = varp->xsz * nelems;
-#line 767
+#line 751
int status = NC_NOERR;
-#line 767
+#line 751
void *xp;
-#line 767
+#line 751
void *fillp=NULL;
-#line 767
+#line 751
-#line 767
+#line 751
if(nelems == 0)
-#line 767
+#line 751
return NC_NOERR;
-#line 767
+#line 751
-#line 767
+#line 751
assert(value != NULL);
-#line 767
+#line 751
-#line 767
+#line 751
#ifdef ERANGE_FILL
-#line 767
+#line 751
fillp = malloc(varp->xsz);
-#line 767
+#line 751
status = NC3_inq_var_fill(varp, fillp);
-#line 767
+#line 751
#endif
-#line 767
+#line 751
-#line 767
+#line 751
for(;;)
-#line 767
+#line 751
{
-#line 767
+#line 751
size_t extent = MIN(remaining, ncp->chunk);
-#line 767
+#line 751
size_t nput = ncx_howmany(varp->type, extent);
-#line 767
+#line 751
-#line 767
+#line 751
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 767
+#line 751
RGN_WRITE, &xp);
-#line 767
+#line 751
if(lstatus != NC_NOERR)
-#line 767
+#line 751
return lstatus;
-#line 767
+#line 751
-#line 767
+#line 751
lstatus = ncx_putn_uchar_short(&xp, nput, value ,fillp);
-#line 767
+#line 751
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 767
+#line 751
{
-#line 767
+#line 751
/* not fatal to the loop */
-#line 767
+#line 751
status = lstatus;
-#line 767
+#line 751
}
-#line 767
+#line 751
-#line 767
+#line 751
(void) ncio_rel(ncp->nciop, offset,
-#line 767
+#line 751
RGN_MODIFIED);
-#line 767
+#line 751
-#line 767
+#line 751
remaining -= extent;
-#line 767
+#line 751
if(remaining == 0)
-#line 767
+#line 751
break; /* normal loop exit */
-#line 767
+#line 751
offset += (off_t)extent;
-#line 767
+#line 751
value += nput;
-#line 767
+#line 751
-#line 767
+#line 751
}
-#line 767
+#line 751
#ifdef ERANGE_FILL
-#line 767
+#line 751
free(fillp);
-#line 767
+#line 751
#endif
-#line 767
+#line 751
-#line 767
+#line 751
return status;
-#line 767
+#line 751
}
-#line 767
+#line 751
static int
-#line 768
+#line 752
putNCvx_uchar_int(NC3_INFO* ncp, const NC_var *varp,
-#line 768
+#line 752
const size_t *start, size_t nelems, const int *value)
-#line 768
+#line 752
{
-#line 768
+#line 752
off_t offset = NC_varoffset(ncp, varp, start);
-#line 768
+#line 752
size_t remaining = varp->xsz * nelems;
-#line 768
+#line 752
int status = NC_NOERR;
-#line 768
+#line 752
void *xp;
-#line 768
+#line 752
void *fillp=NULL;
-#line 768
+#line 752
-#line 768
+#line 752
if(nelems == 0)
-#line 768
+#line 752
return NC_NOERR;
-#line 768
+#line 752
-#line 768
+#line 752
assert(value != NULL);
-#line 768
+#line 752
-#line 768
+#line 752
#ifdef ERANGE_FILL
-#line 768
+#line 752
fillp = malloc(varp->xsz);
-#line 768
+#line 752
status = NC3_inq_var_fill(varp, fillp);
-#line 768
+#line 752
#endif
-#line 768
+#line 752
-#line 768
+#line 752
for(;;)
-#line 768
+#line 752
{
-#line 768
+#line 752
size_t extent = MIN(remaining, ncp->chunk);
-#line 768
+#line 752
size_t nput = ncx_howmany(varp->type, extent);
-#line 768
+#line 752
-#line 768
+#line 752
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 768
+#line 752
RGN_WRITE, &xp);
-#line 768
+#line 752
if(lstatus != NC_NOERR)
-#line 768
+#line 752
return lstatus;
-#line 768
+#line 752
-#line 768
+#line 752
lstatus = ncx_putn_uchar_int(&xp, nput, value ,fillp);
-#line 768
+#line 752
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 768
+#line 752
{
-#line 768
+#line 752
/* not fatal to the loop */
-#line 768
+#line 752
status = lstatus;
-#line 768
+#line 752
}
-#line 768
+#line 752
-#line 768
+#line 752
(void) ncio_rel(ncp->nciop, offset,
-#line 768
+#line 752
RGN_MODIFIED);
-#line 768
+#line 752
-#line 768
+#line 752
remaining -= extent;
-#line 768
+#line 752
if(remaining == 0)
-#line 768
+#line 752
break; /* normal loop exit */
-#line 768
+#line 752
offset += (off_t)extent;
-#line 768
+#line 752
value += nput;
-#line 768
+#line 752
-#line 768
+#line 752
}
-#line 768
+#line 752
#ifdef ERANGE_FILL
-#line 768
+#line 752
free(fillp);
-#line 768
+#line 752
#endif
-#line 768
+#line 752
-#line 768
+#line 752
return status;
-#line 768
+#line 752
}
-#line 768
+#line 752
static int
-#line 769
+#line 753
putNCvx_uchar_float(NC3_INFO* ncp, const NC_var *varp,
-#line 769
+#line 753
const size_t *start, size_t nelems, const float *value)
-#line 769
+#line 753
{
-#line 769
+#line 753
off_t offset = NC_varoffset(ncp, varp, start);
-#line 769
+#line 753
size_t remaining = varp->xsz * nelems;
-#line 769
+#line 753
int status = NC_NOERR;
-#line 769
+#line 753
void *xp;
-#line 769
+#line 753
void *fillp=NULL;
-#line 769
+#line 753
-#line 769
+#line 753
if(nelems == 0)
-#line 769
+#line 753
return NC_NOERR;
-#line 769
+#line 753
-#line 769
+#line 753
assert(value != NULL);
-#line 769
+#line 753
-#line 769
+#line 753
#ifdef ERANGE_FILL
-#line 769
+#line 753
fillp = malloc(varp->xsz);
-#line 769
+#line 753
status = NC3_inq_var_fill(varp, fillp);
-#line 769
+#line 753
#endif
-#line 769
+#line 753
-#line 769
+#line 753
for(;;)
-#line 769
+#line 753
{
-#line 769
+#line 753
size_t extent = MIN(remaining, ncp->chunk);
-#line 769
+#line 753
size_t nput = ncx_howmany(varp->type, extent);
-#line 769
+#line 753
-#line 769
+#line 753
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 769
+#line 753
RGN_WRITE, &xp);
-#line 769
+#line 753
if(lstatus != NC_NOERR)
-#line 769
+#line 753
return lstatus;
-#line 769
+#line 753
-#line 769
+#line 753
lstatus = ncx_putn_uchar_float(&xp, nput, value ,fillp);
-#line 769
+#line 753
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 769
+#line 753
{
-#line 769
+#line 753
/* not fatal to the loop */
-#line 769
+#line 753
status = lstatus;
-#line 769
+#line 753
}
-#line 769
+#line 753
-#line 769
+#line 753
(void) ncio_rel(ncp->nciop, offset,
-#line 769
+#line 753
RGN_MODIFIED);
-#line 769
+#line 753
-#line 769
+#line 753
remaining -= extent;
-#line 769
+#line 753
if(remaining == 0)
-#line 769
+#line 753
break; /* normal loop exit */
-#line 769
+#line 753
offset += (off_t)extent;
-#line 769
+#line 753
value += nput;
-#line 769
+#line 753
-#line 769
+#line 753
}
-#line 769
+#line 753
#ifdef ERANGE_FILL
-#line 769
+#line 753
free(fillp);
-#line 769
+#line 753
#endif
-#line 769
+#line 753
-#line 769
+#line 753
return status;
-#line 769
+#line 753
}
-#line 769
+#line 753
static int
-#line 770
+#line 754
putNCvx_uchar_double(NC3_INFO* ncp, const NC_var *varp,
-#line 770
+#line 754
const size_t *start, size_t nelems, const double *value)
-#line 770
+#line 754
{
-#line 770
+#line 754
off_t offset = NC_varoffset(ncp, varp, start);
-#line 770
+#line 754
size_t remaining = varp->xsz * nelems;
-#line 770
+#line 754
int status = NC_NOERR;
-#line 770
+#line 754
void *xp;
-#line 770
+#line 754
void *fillp=NULL;
-#line 770
+#line 754
-#line 770
+#line 754
if(nelems == 0)
-#line 770
+#line 754
return NC_NOERR;
-#line 770
+#line 754
-#line 770
+#line 754
assert(value != NULL);
-#line 770
+#line 754
-#line 770
+#line 754
#ifdef ERANGE_FILL
-#line 770
+#line 754
fillp = malloc(varp->xsz);
-#line 770
+#line 754
status = NC3_inq_var_fill(varp, fillp);
-#line 770
+#line 754
#endif
-#line 770
+#line 754
-#line 770
+#line 754
for(;;)
-#line 770
+#line 754
{
-#line 770
+#line 754
size_t extent = MIN(remaining, ncp->chunk);
-#line 770
+#line 754
size_t nput = ncx_howmany(varp->type, extent);
-#line 770
+#line 754
-#line 770
+#line 754
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 770
+#line 754
RGN_WRITE, &xp);
-#line 770
+#line 754
if(lstatus != NC_NOERR)
-#line 770
+#line 754
return lstatus;
-#line 770
+#line 754
-#line 770
+#line 754
lstatus = ncx_putn_uchar_double(&xp, nput, value ,fillp);
-#line 770
+#line 754
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 770
+#line 754
{
-#line 770
+#line 754
/* not fatal to the loop */
-#line 770
+#line 754
status = lstatus;
-#line 770
+#line 754
}
-#line 770
+#line 754
-#line 770
+#line 754
(void) ncio_rel(ncp->nciop, offset,
-#line 770
+#line 754
RGN_MODIFIED);
-#line 770
+#line 754
-#line 770
+#line 754
remaining -= extent;
-#line 770
+#line 754
if(remaining == 0)
-#line 770
+#line 754
break; /* normal loop exit */
-#line 770
+#line 754
offset += (off_t)extent;
-#line 770
+#line 754
value += nput;
-#line 770
+#line 754
-#line 770
+#line 754
}
-#line 770
+#line 754
#ifdef ERANGE_FILL
-#line 770
+#line 754
free(fillp);
-#line 770
+#line 754
#endif
-#line 770
+#line 754
-#line 770
+#line 754
return status;
-#line 770
+#line 754
}
-#line 770
+#line 754
static int
-#line 771
+#line 755
putNCvx_uchar_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 771
+#line 755
const size_t *start, size_t nelems, const longlong *value)
-#line 771
+#line 755
{
-#line 771
+#line 755
off_t offset = NC_varoffset(ncp, varp, start);
-#line 771
+#line 755
size_t remaining = varp->xsz * nelems;
-#line 771
+#line 755
int status = NC_NOERR;
-#line 771
+#line 755
void *xp;
-#line 771
+#line 755
void *fillp=NULL;
-#line 771
+#line 755
-#line 771
+#line 755
if(nelems == 0)
-#line 771
+#line 755
return NC_NOERR;
-#line 771
+#line 755
-#line 771
+#line 755
assert(value != NULL);
-#line 771
+#line 755
-#line 771
+#line 755
#ifdef ERANGE_FILL
-#line 771
+#line 755
fillp = malloc(varp->xsz);
-#line 771
+#line 755
status = NC3_inq_var_fill(varp, fillp);
-#line 771
+#line 755
#endif
-#line 771
+#line 755
-#line 771
+#line 755
for(;;)
-#line 771
+#line 755
{
-#line 771
+#line 755
size_t extent = MIN(remaining, ncp->chunk);
-#line 771
+#line 755
size_t nput = ncx_howmany(varp->type, extent);
-#line 771
+#line 755
-#line 771
+#line 755
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 771
+#line 755
RGN_WRITE, &xp);
-#line 771
+#line 755
if(lstatus != NC_NOERR)
-#line 771
+#line 755
return lstatus;
-#line 771
+#line 755
-#line 771
+#line 755
lstatus = ncx_putn_uchar_longlong(&xp, nput, value ,fillp);
-#line 771
+#line 755
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 771
+#line 755
{
-#line 771
+#line 755
/* not fatal to the loop */
-#line 771
+#line 755
status = lstatus;
-#line 771
+#line 755
}
-#line 771
+#line 755
-#line 771
+#line 755
(void) ncio_rel(ncp->nciop, offset,
-#line 771
+#line 755
RGN_MODIFIED);
-#line 771
+#line 755
-#line 771
+#line 755
remaining -= extent;
-#line 771
+#line 755
if(remaining == 0)
-#line 771
+#line 755
break; /* normal loop exit */
-#line 771
+#line 755
offset += (off_t)extent;
-#line 771
+#line 755
value += nput;
-#line 771
+#line 755
-#line 771
+#line 755
}
-#line 771
+#line 755
#ifdef ERANGE_FILL
-#line 771
+#line 755
free(fillp);
-#line 771
+#line 755
#endif
-#line 771
+#line 755
-#line 771
+#line 755
return status;
-#line 771
+#line 755
}
-#line 771
+#line 755
static int
-#line 772
+#line 756
putNCvx_uchar_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 772
+#line 756
const size_t *start, size_t nelems, const ushort *value)
-#line 772
+#line 756
{
-#line 772
+#line 756
off_t offset = NC_varoffset(ncp, varp, start);
-#line 772
+#line 756
size_t remaining = varp->xsz * nelems;
-#line 772
+#line 756
int status = NC_NOERR;
-#line 772
+#line 756
void *xp;
-#line 772
+#line 756
void *fillp=NULL;
-#line 772
+#line 756
-#line 772
+#line 756
if(nelems == 0)
-#line 772
+#line 756
return NC_NOERR;
-#line 772
+#line 756
-#line 772
+#line 756
assert(value != NULL);
-#line 772
+#line 756
-#line 772
+#line 756
#ifdef ERANGE_FILL
-#line 772
+#line 756
fillp = malloc(varp->xsz);
-#line 772
+#line 756
status = NC3_inq_var_fill(varp, fillp);
-#line 772
+#line 756
#endif
-#line 772
+#line 756
-#line 772
+#line 756
for(;;)
-#line 772
+#line 756
{
-#line 772
+#line 756
size_t extent = MIN(remaining, ncp->chunk);
-#line 772
+#line 756
size_t nput = ncx_howmany(varp->type, extent);
-#line 772
+#line 756
-#line 772
+#line 756
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 772
+#line 756
RGN_WRITE, &xp);
-#line 772
+#line 756
if(lstatus != NC_NOERR)
-#line 772
+#line 756
return lstatus;
-#line 772
+#line 756
-#line 772
+#line 756
lstatus = ncx_putn_uchar_ushort(&xp, nput, value ,fillp);
-#line 772
+#line 756
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 772
+#line 756
{
-#line 772
+#line 756
/* not fatal to the loop */
-#line 772
+#line 756
status = lstatus;
-#line 772
+#line 756
}
-#line 772
+#line 756
-#line 772
+#line 756
(void) ncio_rel(ncp->nciop, offset,
-#line 772
+#line 756
RGN_MODIFIED);
-#line 772
+#line 756
-#line 772
+#line 756
remaining -= extent;
-#line 772
+#line 756
if(remaining == 0)
-#line 772
+#line 756
break; /* normal loop exit */
-#line 772
+#line 756
offset += (off_t)extent;
-#line 772
+#line 756
value += nput;
-#line 772
+#line 756
-#line 772
+#line 756
}
-#line 772
+#line 756
#ifdef ERANGE_FILL
-#line 772
+#line 756
free(fillp);
-#line 772
+#line 756
#endif
-#line 772
+#line 756
-#line 772
+#line 756
return status;
-#line 772
+#line 756
}
-#line 772
+#line 756
static int
-#line 773
+#line 757
putNCvx_uchar_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 773
+#line 757
const size_t *start, size_t nelems, const uint *value)
-#line 773
+#line 757
{
-#line 773
+#line 757
off_t offset = NC_varoffset(ncp, varp, start);
-#line 773
+#line 757
size_t remaining = varp->xsz * nelems;
-#line 773
+#line 757
int status = NC_NOERR;
-#line 773
+#line 757
void *xp;
-#line 773
+#line 757
void *fillp=NULL;
-#line 773
+#line 757
-#line 773
+#line 757
if(nelems == 0)
-#line 773
+#line 757
return NC_NOERR;
-#line 773
+#line 757
-#line 773
+#line 757
assert(value != NULL);
-#line 773
+#line 757
-#line 773
+#line 757
#ifdef ERANGE_FILL
-#line 773
+#line 757
fillp = malloc(varp->xsz);
-#line 773
+#line 757
status = NC3_inq_var_fill(varp, fillp);
-#line 773
+#line 757
#endif
-#line 773
+#line 757
-#line 773
+#line 757
for(;;)
-#line 773
+#line 757
{
-#line 773
+#line 757
size_t extent = MIN(remaining, ncp->chunk);
-#line 773
+#line 757
size_t nput = ncx_howmany(varp->type, extent);
-#line 773
+#line 757
-#line 773
+#line 757
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 773
+#line 757
RGN_WRITE, &xp);
-#line 773
+#line 757
if(lstatus != NC_NOERR)
-#line 773
+#line 757
return lstatus;
-#line 773
+#line 757
-#line 773
+#line 757
lstatus = ncx_putn_uchar_uint(&xp, nput, value ,fillp);
-#line 773
+#line 757
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 773
+#line 757
{
-#line 773
+#line 757
/* not fatal to the loop */
-#line 773
+#line 757
status = lstatus;
-#line 773
+#line 757
}
-#line 773
+#line 757
-#line 773
+#line 757
(void) ncio_rel(ncp->nciop, offset,
-#line 773
+#line 757
RGN_MODIFIED);
-#line 773
+#line 757
-#line 773
+#line 757
remaining -= extent;
-#line 773
+#line 757
if(remaining == 0)
-#line 773
+#line 757
break; /* normal loop exit */
-#line 773
+#line 757
offset += (off_t)extent;
-#line 773
+#line 757
value += nput;
-#line 773
+#line 757
-#line 773
+#line 757
}
-#line 773
+#line 757
#ifdef ERANGE_FILL
-#line 773
+#line 757
free(fillp);
-#line 773
+#line 757
#endif
-#line 773
+#line 757
-#line 773
+#line 757
return status;
-#line 773
+#line 757
}
-#line 773
+#line 757
static int
-#line 774
+#line 758
putNCvx_uchar_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 774
+#line 758
const size_t *start, size_t nelems, const ulonglong *value)
-#line 774
+#line 758
{
-#line 774
+#line 758
off_t offset = NC_varoffset(ncp, varp, start);
-#line 774
+#line 758
size_t remaining = varp->xsz * nelems;
-#line 774
+#line 758
int status = NC_NOERR;
-#line 774
+#line 758
void *xp;
-#line 774
+#line 758
void *fillp=NULL;
-#line 774
+#line 758
-#line 774
+#line 758
if(nelems == 0)
-#line 774
+#line 758
return NC_NOERR;
-#line 774
+#line 758
-#line 774
+#line 758
assert(value != NULL);
-#line 774
+#line 758
-#line 774
+#line 758
#ifdef ERANGE_FILL
-#line 774
+#line 758
fillp = malloc(varp->xsz);
-#line 774
+#line 758
status = NC3_inq_var_fill(varp, fillp);
-#line 774
+#line 758
#endif
-#line 774
+#line 758
-#line 774
+#line 758
for(;;)
-#line 774
+#line 758
{
-#line 774
+#line 758
size_t extent = MIN(remaining, ncp->chunk);
-#line 774
+#line 758
size_t nput = ncx_howmany(varp->type, extent);
-#line 774
+#line 758
-#line 774
+#line 758
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 774
+#line 758
RGN_WRITE, &xp);
-#line 774
+#line 758
if(lstatus != NC_NOERR)
-#line 774
+#line 758
return lstatus;
-#line 774
+#line 758
-#line 774
+#line 758
lstatus = ncx_putn_uchar_ulonglong(&xp, nput, value ,fillp);
-#line 774
+#line 758
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 774
+#line 758
{
-#line 774
+#line 758
/* not fatal to the loop */
-#line 774
+#line 758
status = lstatus;
-#line 774
+#line 758
}
-#line 774
+#line 758
-#line 774
+#line 758
(void) ncio_rel(ncp->nciop, offset,
-#line 774
+#line 758
RGN_MODIFIED);
-#line 774
+#line 758
-#line 774
+#line 758
remaining -= extent;
-#line 774
+#line 758
if(remaining == 0)
-#line 774
+#line 758
break; /* normal loop exit */
-#line 774
+#line 758
offset += (off_t)extent;
-#line 774
+#line 758
value += nput;
-#line 774
+#line 758
-#line 774
+#line 758
}
-#line 774
+#line 758
#ifdef ERANGE_FILL
-#line 774
+#line 758
free(fillp);
-#line 774
+#line 758
#endif
-#line 774
+#line 758
-#line 774
+#line 758
return status;
-#line 774
+#line 758
}
-#line 774
+#line 758
static int
-#line 776
+#line 760
putNCvx_ushort_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 776
+#line 760
const size_t *start, size_t nelems, const schar *value)
-#line 776
+#line 760
{
-#line 776
+#line 760
off_t offset = NC_varoffset(ncp, varp, start);
-#line 776
+#line 760
size_t remaining = varp->xsz * nelems;
-#line 776
+#line 760
int status = NC_NOERR;
-#line 776
+#line 760
void *xp;
-#line 776
+#line 760
void *fillp=NULL;
-#line 776
+#line 760
-#line 776
+#line 760
if(nelems == 0)
-#line 776
+#line 760
return NC_NOERR;
-#line 776
+#line 760
-#line 776
+#line 760
assert(value != NULL);
-#line 776
+#line 760
-#line 776
+#line 760
#ifdef ERANGE_FILL
-#line 776
+#line 760
fillp = malloc(varp->xsz);
-#line 776
+#line 760
status = NC3_inq_var_fill(varp, fillp);
-#line 776
+#line 760
#endif
-#line 776
+#line 760
-#line 776
+#line 760
for(;;)
-#line 776
+#line 760
{
-#line 776
+#line 760
size_t extent = MIN(remaining, ncp->chunk);
-#line 776
+#line 760
size_t nput = ncx_howmany(varp->type, extent);
-#line 776
+#line 760
-#line 776
+#line 760
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 776
+#line 760
RGN_WRITE, &xp);
-#line 776
+#line 760
if(lstatus != NC_NOERR)
-#line 776
+#line 760
return lstatus;
-#line 776
+#line 760
-#line 776
+#line 760
lstatus = ncx_putn_ushort_schar(&xp, nput, value ,fillp);
-#line 776
+#line 760
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 776
+#line 760
{
-#line 776
+#line 760
/* not fatal to the loop */
-#line 776
+#line 760
status = lstatus;
-#line 776
+#line 760
}
-#line 776
+#line 760
-#line 776
+#line 760
(void) ncio_rel(ncp->nciop, offset,
-#line 776
+#line 760
RGN_MODIFIED);
-#line 776
+#line 760
-#line 776
+#line 760
remaining -= extent;
-#line 776
+#line 760
if(remaining == 0)
-#line 776
+#line 760
break; /* normal loop exit */
-#line 776
+#line 760
offset += (off_t)extent;
-#line 776
+#line 760
value += nput;
-#line 776
+#line 760
-#line 776
+#line 760
}
-#line 776
+#line 760
#ifdef ERANGE_FILL
-#line 776
+#line 760
free(fillp);
-#line 776
+#line 760
#endif
-#line 776
+#line 760
-#line 776
+#line 760
return status;
-#line 776
+#line 760
}
-#line 776
+#line 760
static int
-#line 777
+#line 761
putNCvx_ushort_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 777
+#line 761
const size_t *start, size_t nelems, const uchar *value)
-#line 777
+#line 761
{
-#line 777
+#line 761
off_t offset = NC_varoffset(ncp, varp, start);
-#line 777
+#line 761
size_t remaining = varp->xsz * nelems;
-#line 777
+#line 761
int status = NC_NOERR;
-#line 777
+#line 761
void *xp;
-#line 777
+#line 761
void *fillp=NULL;
-#line 777
+#line 761
-#line 777
+#line 761
if(nelems == 0)
-#line 777
+#line 761
return NC_NOERR;
-#line 777
+#line 761
-#line 777
+#line 761
assert(value != NULL);
-#line 777
+#line 761
-#line 777
+#line 761
#ifdef ERANGE_FILL
-#line 777
+#line 761
fillp = malloc(varp->xsz);
-#line 777
+#line 761
status = NC3_inq_var_fill(varp, fillp);
-#line 777
+#line 761
#endif
-#line 777
+#line 761
-#line 777
+#line 761
for(;;)
-#line 777
+#line 761
{
-#line 777
+#line 761
size_t extent = MIN(remaining, ncp->chunk);
-#line 777
+#line 761
size_t nput = ncx_howmany(varp->type, extent);
-#line 777
+#line 761
-#line 777
+#line 761
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 777
+#line 761
RGN_WRITE, &xp);
-#line 777
+#line 761
if(lstatus != NC_NOERR)
-#line 777
+#line 761
return lstatus;
-#line 777
+#line 761
-#line 777
+#line 761
lstatus = ncx_putn_ushort_uchar(&xp, nput, value ,fillp);
-#line 777
+#line 761
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 777
+#line 761
{
-#line 777
+#line 761
/* not fatal to the loop */
-#line 777
+#line 761
status = lstatus;
-#line 777
+#line 761
}
-#line 777
+#line 761
-#line 777
+#line 761
(void) ncio_rel(ncp->nciop, offset,
-#line 777
+#line 761
RGN_MODIFIED);
-#line 777
+#line 761
-#line 777
+#line 761
remaining -= extent;
-#line 777
+#line 761
if(remaining == 0)
-#line 777
+#line 761
break; /* normal loop exit */
-#line 777
+#line 761
offset += (off_t)extent;
-#line 777
+#line 761
value += nput;
-#line 777
+#line 761
-#line 777
+#line 761
}
-#line 777
+#line 761
#ifdef ERANGE_FILL
-#line 777
+#line 761
free(fillp);
-#line 777
+#line 761
#endif
-#line 777
+#line 761
-#line 777
+#line 761
return status;
-#line 777
+#line 761
}
-#line 777
+#line 761
static int
-#line 778
+#line 762
putNCvx_ushort_short(NC3_INFO* ncp, const NC_var *varp,
-#line 778
+#line 762
const size_t *start, size_t nelems, const short *value)
-#line 778
+#line 762
{
-#line 778
+#line 762
off_t offset = NC_varoffset(ncp, varp, start);
-#line 778
+#line 762
size_t remaining = varp->xsz * nelems;
-#line 778
+#line 762
int status = NC_NOERR;
-#line 778
+#line 762
void *xp;
-#line 778
+#line 762
void *fillp=NULL;
-#line 778
+#line 762
-#line 778
+#line 762
if(nelems == 0)
-#line 778
+#line 762
return NC_NOERR;
-#line 778
+#line 762
-#line 778
+#line 762
assert(value != NULL);
-#line 778
+#line 762
-#line 778
+#line 762
#ifdef ERANGE_FILL
-#line 778
+#line 762
fillp = malloc(varp->xsz);
-#line 778
+#line 762
status = NC3_inq_var_fill(varp, fillp);
-#line 778
+#line 762
#endif
-#line 778
+#line 762
-#line 778
+#line 762
for(;;)
-#line 778
+#line 762
{
-#line 778
+#line 762
size_t extent = MIN(remaining, ncp->chunk);
-#line 778
+#line 762
size_t nput = ncx_howmany(varp->type, extent);
-#line 778
+#line 762
-#line 778
+#line 762
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 778
+#line 762
RGN_WRITE, &xp);
-#line 778
+#line 762
if(lstatus != NC_NOERR)
-#line 778
+#line 762
return lstatus;
-#line 778
+#line 762
-#line 778
+#line 762
lstatus = ncx_putn_ushort_short(&xp, nput, value ,fillp);
-#line 778
+#line 762
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 778
+#line 762
{
-#line 778
+#line 762
/* not fatal to the loop */
-#line 778
+#line 762
status = lstatus;
-#line 778
+#line 762
}
-#line 778
+#line 762
-#line 778
+#line 762
(void) ncio_rel(ncp->nciop, offset,
-#line 778
+#line 762
RGN_MODIFIED);
-#line 778
+#line 762
-#line 778
+#line 762
remaining -= extent;
-#line 778
+#line 762
if(remaining == 0)
-#line 778
+#line 762
break; /* normal loop exit */
-#line 778
+#line 762
offset += (off_t)extent;
-#line 778
+#line 762
value += nput;
-#line 778
+#line 762
-#line 778
+#line 762
}
-#line 778
+#line 762
#ifdef ERANGE_FILL
-#line 778
+#line 762
free(fillp);
-#line 778
+#line 762
#endif
-#line 778
+#line 762
-#line 778
+#line 762
return status;
-#line 778
+#line 762
}
-#line 778
+#line 762
static int
-#line 779
+#line 763
putNCvx_ushort_int(NC3_INFO* ncp, const NC_var *varp,
-#line 779
+#line 763
const size_t *start, size_t nelems, const int *value)
-#line 779
+#line 763
{
-#line 779
+#line 763
off_t offset = NC_varoffset(ncp, varp, start);
-#line 779
+#line 763
size_t remaining = varp->xsz * nelems;
-#line 779
+#line 763
int status = NC_NOERR;
-#line 779
+#line 763
void *xp;
-#line 779
+#line 763
void *fillp=NULL;
-#line 779
+#line 763
-#line 779
+#line 763
if(nelems == 0)
-#line 779
+#line 763
return NC_NOERR;
-#line 779
+#line 763
-#line 779
+#line 763
assert(value != NULL);
-#line 779
+#line 763
-#line 779
+#line 763
#ifdef ERANGE_FILL
-#line 779
+#line 763
fillp = malloc(varp->xsz);
-#line 779
+#line 763
status = NC3_inq_var_fill(varp, fillp);
-#line 779
+#line 763
#endif
-#line 779
+#line 763
-#line 779
+#line 763
for(;;)
-#line 779
+#line 763
{
-#line 779
+#line 763
size_t extent = MIN(remaining, ncp->chunk);
-#line 779
+#line 763
size_t nput = ncx_howmany(varp->type, extent);
-#line 779
+#line 763
-#line 779
+#line 763
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 779
+#line 763
RGN_WRITE, &xp);
-#line 779
+#line 763
if(lstatus != NC_NOERR)
-#line 779
+#line 763
return lstatus;
-#line 779
+#line 763
-#line 779
+#line 763
lstatus = ncx_putn_ushort_int(&xp, nput, value ,fillp);
-#line 779
+#line 763
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 779
+#line 763
{
-#line 779
+#line 763
/* not fatal to the loop */
-#line 779
+#line 763
status = lstatus;
-#line 779
+#line 763
}
-#line 779
+#line 763
-#line 779
+#line 763
(void) ncio_rel(ncp->nciop, offset,
-#line 779
+#line 763
RGN_MODIFIED);
-#line 779
+#line 763
-#line 779
+#line 763
remaining -= extent;
-#line 779
+#line 763
if(remaining == 0)
-#line 779
+#line 763
break; /* normal loop exit */
-#line 779
+#line 763
offset += (off_t)extent;
-#line 779
+#line 763
value += nput;
-#line 779
+#line 763
-#line 779
+#line 763
}
-#line 779
+#line 763
#ifdef ERANGE_FILL
-#line 779
+#line 763
free(fillp);
-#line 779
+#line 763
#endif
-#line 779
+#line 763
-#line 779
+#line 763
return status;
-#line 779
+#line 763
}
-#line 779
+#line 763
static int
-#line 780
+#line 764
putNCvx_ushort_float(NC3_INFO* ncp, const NC_var *varp,
-#line 780
+#line 764
const size_t *start, size_t nelems, const float *value)
-#line 780
+#line 764
{
-#line 780
+#line 764
off_t offset = NC_varoffset(ncp, varp, start);
-#line 780
+#line 764
size_t remaining = varp->xsz * nelems;
-#line 780
+#line 764
int status = NC_NOERR;
-#line 780
+#line 764
void *xp;
-#line 780
+#line 764
void *fillp=NULL;
-#line 780
+#line 764
-#line 780
+#line 764
if(nelems == 0)
-#line 780
+#line 764
return NC_NOERR;
-#line 780
+#line 764
-#line 780
+#line 764
assert(value != NULL);
-#line 780
+#line 764
-#line 780
+#line 764
#ifdef ERANGE_FILL
-#line 780
+#line 764
fillp = malloc(varp->xsz);
-#line 780
+#line 764
status = NC3_inq_var_fill(varp, fillp);
-#line 780
+#line 764
#endif
-#line 780
+#line 764
-#line 780
+#line 764
for(;;)
-#line 780
+#line 764
{
-#line 780
+#line 764
size_t extent = MIN(remaining, ncp->chunk);
-#line 780
+#line 764
size_t nput = ncx_howmany(varp->type, extent);
-#line 780
+#line 764
-#line 780
+#line 764
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 780
+#line 764
RGN_WRITE, &xp);
-#line 780
+#line 764
if(lstatus != NC_NOERR)
-#line 780
+#line 764
return lstatus;
-#line 780
+#line 764
-#line 780
+#line 764
lstatus = ncx_putn_ushort_float(&xp, nput, value ,fillp);
-#line 780
+#line 764
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 780
+#line 764
{
-#line 780
+#line 764
/* not fatal to the loop */
-#line 780
+#line 764
status = lstatus;
-#line 780
+#line 764
}
-#line 780
+#line 764
-#line 780
+#line 764
(void) ncio_rel(ncp->nciop, offset,
-#line 780
+#line 764
RGN_MODIFIED);
-#line 780
+#line 764
-#line 780
+#line 764
remaining -= extent;
-#line 780
+#line 764
if(remaining == 0)
-#line 780
+#line 764
break; /* normal loop exit */
-#line 780
+#line 764
offset += (off_t)extent;
-#line 780
+#line 764
value += nput;
-#line 780
+#line 764
-#line 780
+#line 764
}
-#line 780
+#line 764
#ifdef ERANGE_FILL
-#line 780
+#line 764
free(fillp);
-#line 780
+#line 764
#endif
-#line 780
+#line 764
-#line 780
+#line 764
return status;
-#line 780
+#line 764
}
-#line 780
+#line 764
static int
-#line 781
+#line 765
putNCvx_ushort_double(NC3_INFO* ncp, const NC_var *varp,
-#line 781
+#line 765
const size_t *start, size_t nelems, const double *value)
-#line 781
+#line 765
{
-#line 781
+#line 765
off_t offset = NC_varoffset(ncp, varp, start);
-#line 781
+#line 765
size_t remaining = varp->xsz * nelems;
-#line 781
+#line 765
int status = NC_NOERR;
-#line 781
+#line 765
void *xp;
-#line 781
+#line 765
void *fillp=NULL;
-#line 781
+#line 765
-#line 781
+#line 765
if(nelems == 0)
-#line 781
+#line 765
return NC_NOERR;
-#line 781
+#line 765
-#line 781
+#line 765
assert(value != NULL);
-#line 781
+#line 765
-#line 781
+#line 765
#ifdef ERANGE_FILL
-#line 781
+#line 765
fillp = malloc(varp->xsz);
-#line 781
+#line 765
status = NC3_inq_var_fill(varp, fillp);
-#line 781
+#line 765
#endif
-#line 781
+#line 765
-#line 781
+#line 765
for(;;)
-#line 781
+#line 765
{
-#line 781
+#line 765
size_t extent = MIN(remaining, ncp->chunk);
-#line 781
+#line 765
size_t nput = ncx_howmany(varp->type, extent);
-#line 781
+#line 765
-#line 781
+#line 765
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 781
+#line 765
RGN_WRITE, &xp);
-#line 781
+#line 765
if(lstatus != NC_NOERR)
-#line 781
+#line 765
return lstatus;
-#line 781
+#line 765
-#line 781
+#line 765
lstatus = ncx_putn_ushort_double(&xp, nput, value ,fillp);
-#line 781
+#line 765
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 781
+#line 765
{
-#line 781
+#line 765
/* not fatal to the loop */
-#line 781
+#line 765
status = lstatus;
-#line 781
+#line 765
}
-#line 781
+#line 765
-#line 781
+#line 765
(void) ncio_rel(ncp->nciop, offset,
-#line 781
+#line 765
RGN_MODIFIED);
-#line 781
+#line 765
-#line 781
+#line 765
remaining -= extent;
-#line 781
+#line 765
if(remaining == 0)
-#line 781
+#line 765
break; /* normal loop exit */
-#line 781
+#line 765
offset += (off_t)extent;
-#line 781
+#line 765
value += nput;
-#line 781
+#line 765
-#line 781
+#line 765
}
-#line 781
+#line 765
#ifdef ERANGE_FILL
-#line 781
+#line 765
free(fillp);
-#line 781
+#line 765
#endif
-#line 781
+#line 765
-#line 781
+#line 765
return status;
-#line 781
+#line 765
}
-#line 781
+#line 765
static int
-#line 782
+#line 766
putNCvx_ushort_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 782
+#line 766
const size_t *start, size_t nelems, const longlong *value)
-#line 782
+#line 766
{
-#line 782
+#line 766
off_t offset = NC_varoffset(ncp, varp, start);
-#line 782
+#line 766
size_t remaining = varp->xsz * nelems;
-#line 782
+#line 766
int status = NC_NOERR;
-#line 782
+#line 766
void *xp;
-#line 782
+#line 766
void *fillp=NULL;
-#line 782
+#line 766
-#line 782
+#line 766
if(nelems == 0)
-#line 782
+#line 766
return NC_NOERR;
-#line 782
+#line 766
-#line 782
+#line 766
assert(value != NULL);
-#line 782
+#line 766
-#line 782
+#line 766
#ifdef ERANGE_FILL
-#line 782
+#line 766
fillp = malloc(varp->xsz);
-#line 782
+#line 766
status = NC3_inq_var_fill(varp, fillp);
-#line 782
+#line 766
#endif
-#line 782
+#line 766
-#line 782
+#line 766
for(;;)
-#line 782
+#line 766
{
-#line 782
+#line 766
size_t extent = MIN(remaining, ncp->chunk);
-#line 782
+#line 766
size_t nput = ncx_howmany(varp->type, extent);
-#line 782
+#line 766
-#line 782
+#line 766
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 782
+#line 766
RGN_WRITE, &xp);
-#line 782
+#line 766
if(lstatus != NC_NOERR)
-#line 782
+#line 766
return lstatus;
-#line 782
+#line 766
-#line 782
+#line 766
lstatus = ncx_putn_ushort_longlong(&xp, nput, value ,fillp);
-#line 782
+#line 766
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 782
+#line 766
{
-#line 782
+#line 766
/* not fatal to the loop */
-#line 782
+#line 766
status = lstatus;
-#line 782
+#line 766
}
-#line 782
+#line 766
-#line 782
+#line 766
(void) ncio_rel(ncp->nciop, offset,
-#line 782
+#line 766
RGN_MODIFIED);
-#line 782
+#line 766
-#line 782
+#line 766
remaining -= extent;
-#line 782
+#line 766
if(remaining == 0)
-#line 782
+#line 766
break; /* normal loop exit */
-#line 782
+#line 766
offset += (off_t)extent;
-#line 782
+#line 766
value += nput;
-#line 782
+#line 766
-#line 782
+#line 766
}
-#line 782
+#line 766
#ifdef ERANGE_FILL
-#line 782
+#line 766
free(fillp);
-#line 782
+#line 766
#endif
-#line 782
+#line 766
-#line 782
+#line 766
return status;
-#line 782
+#line 766
}
-#line 782
+#line 766
static int
-#line 783
+#line 767
putNCvx_ushort_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 783
+#line 767
const size_t *start, size_t nelems, const ushort *value)
-#line 783
+#line 767
{
-#line 783
+#line 767
off_t offset = NC_varoffset(ncp, varp, start);
-#line 783
+#line 767
size_t remaining = varp->xsz * nelems;
-#line 783
+#line 767
int status = NC_NOERR;
-#line 783
+#line 767
void *xp;
-#line 783
+#line 767
void *fillp=NULL;
-#line 783
+#line 767
-#line 783
+#line 767
if(nelems == 0)
-#line 783
+#line 767
return NC_NOERR;
-#line 783
+#line 767
-#line 783
+#line 767
assert(value != NULL);
-#line 783
+#line 767
-#line 783
+#line 767
#ifdef ERANGE_FILL
-#line 783
+#line 767
fillp = malloc(varp->xsz);
-#line 783
+#line 767
status = NC3_inq_var_fill(varp, fillp);
-#line 783
+#line 767
#endif
-#line 783
+#line 767
-#line 783
+#line 767
for(;;)
-#line 783
+#line 767
{
-#line 783
+#line 767
size_t extent = MIN(remaining, ncp->chunk);
-#line 783
+#line 767
size_t nput = ncx_howmany(varp->type, extent);
-#line 783
+#line 767
-#line 783
+#line 767
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 783
+#line 767
RGN_WRITE, &xp);
-#line 783
+#line 767
if(lstatus != NC_NOERR)
-#line 783
+#line 767
return lstatus;
-#line 783
+#line 767
-#line 783
+#line 767
lstatus = ncx_putn_ushort_ushort(&xp, nput, value ,fillp);
-#line 783
+#line 767
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 783
+#line 767
{
-#line 783
+#line 767
/* not fatal to the loop */
-#line 783
+#line 767
status = lstatus;
-#line 783
+#line 767
}
-#line 783
+#line 767
-#line 783
+#line 767
(void) ncio_rel(ncp->nciop, offset,
-#line 783
+#line 767
RGN_MODIFIED);
-#line 783
+#line 767
-#line 783
+#line 767
remaining -= extent;
-#line 783
+#line 767
if(remaining == 0)
-#line 783
+#line 767
break; /* normal loop exit */
-#line 783
+#line 767
offset += (off_t)extent;
-#line 783
+#line 767
value += nput;
-#line 783
+#line 767
-#line 783
+#line 767
}
-#line 783
+#line 767
#ifdef ERANGE_FILL
-#line 783
+#line 767
free(fillp);
-#line 783
+#line 767
#endif
-#line 783
+#line 767
-#line 783
+#line 767
return status;
-#line 783
+#line 767
}
-#line 783
+#line 767
static int
-#line 784
+#line 768
putNCvx_ushort_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 784
+#line 768
const size_t *start, size_t nelems, const uint *value)
-#line 784
+#line 768
{
-#line 784
+#line 768
off_t offset = NC_varoffset(ncp, varp, start);
-#line 784
+#line 768
size_t remaining = varp->xsz * nelems;
-#line 784
+#line 768
int status = NC_NOERR;
-#line 784
+#line 768
void *xp;
-#line 784
+#line 768
void *fillp=NULL;
-#line 784
+#line 768
-#line 784
+#line 768
if(nelems == 0)
-#line 784
+#line 768
return NC_NOERR;
-#line 784
+#line 768
-#line 784
+#line 768
assert(value != NULL);
-#line 784
+#line 768
-#line 784
+#line 768
#ifdef ERANGE_FILL
-#line 784
+#line 768
fillp = malloc(varp->xsz);
-#line 784
+#line 768
status = NC3_inq_var_fill(varp, fillp);
-#line 784
+#line 768
#endif
-#line 784
+#line 768
-#line 784
+#line 768
for(;;)
-#line 784
+#line 768
{
-#line 784
+#line 768
size_t extent = MIN(remaining, ncp->chunk);
-#line 784
+#line 768
size_t nput = ncx_howmany(varp->type, extent);
-#line 784
+#line 768
-#line 784
+#line 768
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 784
+#line 768
RGN_WRITE, &xp);
-#line 784
+#line 768
if(lstatus != NC_NOERR)
-#line 784
+#line 768
return lstatus;
-#line 784
+#line 768
-#line 784
+#line 768
lstatus = ncx_putn_ushort_uint(&xp, nput, value ,fillp);
-#line 784
+#line 768
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 784
+#line 768
{
-#line 784
+#line 768
/* not fatal to the loop */
-#line 784
+#line 768
status = lstatus;
-#line 784
+#line 768
}
-#line 784
+#line 768
-#line 784
+#line 768
(void) ncio_rel(ncp->nciop, offset,
-#line 784
+#line 768
RGN_MODIFIED);
-#line 784
+#line 768
-#line 784
+#line 768
remaining -= extent;
-#line 784
+#line 768
if(remaining == 0)
-#line 784
+#line 768
break; /* normal loop exit */
-#line 784
+#line 768
offset += (off_t)extent;
-#line 784
+#line 768
value += nput;
-#line 784
+#line 768
-#line 784
+#line 768
}
-#line 784
+#line 768
#ifdef ERANGE_FILL
-#line 784
+#line 768
free(fillp);
-#line 784
+#line 768
#endif
-#line 784
+#line 768
-#line 784
+#line 768
return status;
-#line 784
+#line 768
}
-#line 784
+#line 768
static int
-#line 785
+#line 769
putNCvx_ushort_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 785
+#line 769
const size_t *start, size_t nelems, const ulonglong *value)
-#line 785
+#line 769
{
-#line 785
+#line 769
off_t offset = NC_varoffset(ncp, varp, start);
-#line 785
+#line 769
size_t remaining = varp->xsz * nelems;
-#line 785
+#line 769
int status = NC_NOERR;
-#line 785
+#line 769
void *xp;
-#line 785
+#line 769
void *fillp=NULL;
-#line 785
+#line 769
-#line 785
+#line 769
if(nelems == 0)
-#line 785
+#line 769
return NC_NOERR;
-#line 785
+#line 769
-#line 785
+#line 769
assert(value != NULL);
-#line 785
+#line 769
-#line 785
+#line 769
#ifdef ERANGE_FILL
-#line 785
+#line 769
fillp = malloc(varp->xsz);
-#line 785
+#line 769
status = NC3_inq_var_fill(varp, fillp);
-#line 785
+#line 769
#endif
-#line 785
+#line 769
-#line 785
+#line 769
for(;;)
-#line 785
+#line 769
{
-#line 785
+#line 769
size_t extent = MIN(remaining, ncp->chunk);
-#line 785
+#line 769
size_t nput = ncx_howmany(varp->type, extent);
-#line 785
+#line 769
-#line 785
+#line 769
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 785
+#line 769
RGN_WRITE, &xp);
-#line 785
+#line 769
if(lstatus != NC_NOERR)
-#line 785
+#line 769
return lstatus;
-#line 785
+#line 769
-#line 785
+#line 769
lstatus = ncx_putn_ushort_ulonglong(&xp, nput, value ,fillp);
-#line 785
+#line 769
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 785
+#line 769
{
-#line 785
+#line 769
/* not fatal to the loop */
-#line 785
+#line 769
status = lstatus;
-#line 785
+#line 769
}
-#line 785
+#line 769
-#line 785
+#line 769
(void) ncio_rel(ncp->nciop, offset,
-#line 785
+#line 769
RGN_MODIFIED);
-#line 785
+#line 769
-#line 785
+#line 769
remaining -= extent;
-#line 785
+#line 769
if(remaining == 0)
-#line 785
+#line 769
break; /* normal loop exit */
-#line 785
+#line 769
offset += (off_t)extent;
-#line 785
+#line 769
value += nput;
-#line 785
+#line 769
-#line 785
+#line 769
}
-#line 785
+#line 769
#ifdef ERANGE_FILL
-#line 785
+#line 769
free(fillp);
-#line 785
+#line 769
#endif
-#line 785
+#line 769
-#line 785
+#line 769
return status;
-#line 785
+#line 769
}
-#line 785
+#line 769
static int
-#line 787
+#line 771
putNCvx_uint_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 787
+#line 771
const size_t *start, size_t nelems, const schar *value)
-#line 787
+#line 771
{
-#line 787
+#line 771
off_t offset = NC_varoffset(ncp, varp, start);
-#line 787
+#line 771
size_t remaining = varp->xsz * nelems;
-#line 787
+#line 771
int status = NC_NOERR;
-#line 787
+#line 771
void *xp;
-#line 787
+#line 771
void *fillp=NULL;
-#line 787
+#line 771
-#line 787
+#line 771
if(nelems == 0)
-#line 787
+#line 771
return NC_NOERR;
-#line 787
+#line 771
-#line 787
+#line 771
assert(value != NULL);
-#line 787
+#line 771
-#line 787
+#line 771
#ifdef ERANGE_FILL
-#line 787
+#line 771
fillp = malloc(varp->xsz);
-#line 787
+#line 771
status = NC3_inq_var_fill(varp, fillp);
-#line 787
+#line 771
#endif
-#line 787
+#line 771
-#line 787
+#line 771
for(;;)
-#line 787
+#line 771
{
-#line 787
+#line 771
size_t extent = MIN(remaining, ncp->chunk);
-#line 787
+#line 771
size_t nput = ncx_howmany(varp->type, extent);
-#line 787
+#line 771
-#line 787
+#line 771
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 787
+#line 771
RGN_WRITE, &xp);
-#line 787
+#line 771
if(lstatus != NC_NOERR)
-#line 787
+#line 771
return lstatus;
-#line 787
+#line 771
-#line 787
+#line 771
lstatus = ncx_putn_uint_schar(&xp, nput, value ,fillp);
-#line 787
+#line 771
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 787
+#line 771
{
-#line 787
+#line 771
/* not fatal to the loop */
-#line 787
+#line 771
status = lstatus;
-#line 787
+#line 771
}
-#line 787
+#line 771
-#line 787
+#line 771
(void) ncio_rel(ncp->nciop, offset,
-#line 787
+#line 771
RGN_MODIFIED);
-#line 787
+#line 771
-#line 787
+#line 771
remaining -= extent;
-#line 787
+#line 771
if(remaining == 0)
-#line 787
+#line 771
break; /* normal loop exit */
-#line 787
+#line 771
offset += (off_t)extent;
-#line 787
+#line 771
value += nput;
-#line 787
+#line 771
-#line 787
+#line 771
}
-#line 787
+#line 771
#ifdef ERANGE_FILL
-#line 787
+#line 771
free(fillp);
-#line 787
+#line 771
#endif
-#line 787
+#line 771
-#line 787
+#line 771
return status;
-#line 787
+#line 771
}
-#line 787
+#line 771
static int
-#line 788
+#line 772
putNCvx_uint_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 788
+#line 772
const size_t *start, size_t nelems, const uchar *value)
-#line 788
+#line 772
{
-#line 788
+#line 772
off_t offset = NC_varoffset(ncp, varp, start);
-#line 788
+#line 772
size_t remaining = varp->xsz * nelems;
-#line 788
+#line 772
int status = NC_NOERR;
-#line 788
+#line 772
void *xp;
-#line 788
+#line 772
void *fillp=NULL;
-#line 788
+#line 772
-#line 788
+#line 772
if(nelems == 0)
-#line 788
+#line 772
return NC_NOERR;
-#line 788
+#line 772
-#line 788
+#line 772
assert(value != NULL);
-#line 788
+#line 772
-#line 788
+#line 772
#ifdef ERANGE_FILL
-#line 788
+#line 772
fillp = malloc(varp->xsz);
-#line 788
+#line 772
status = NC3_inq_var_fill(varp, fillp);
-#line 788
+#line 772
#endif
-#line 788
+#line 772
-#line 788
+#line 772
for(;;)
-#line 788
+#line 772
{
-#line 788
+#line 772
size_t extent = MIN(remaining, ncp->chunk);
-#line 788
+#line 772
size_t nput = ncx_howmany(varp->type, extent);
-#line 788
+#line 772
-#line 788
+#line 772
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 788
+#line 772
RGN_WRITE, &xp);
-#line 788
+#line 772
if(lstatus != NC_NOERR)
-#line 788
+#line 772
return lstatus;
-#line 788
+#line 772
-#line 788
+#line 772
lstatus = ncx_putn_uint_uchar(&xp, nput, value ,fillp);
-#line 788
+#line 772
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 788
+#line 772
{
-#line 788
+#line 772
/* not fatal to the loop */
-#line 788
+#line 772
status = lstatus;
-#line 788
+#line 772
}
-#line 788
+#line 772
-#line 788
+#line 772
(void) ncio_rel(ncp->nciop, offset,
-#line 788
+#line 772
RGN_MODIFIED);
-#line 788
+#line 772
-#line 788
+#line 772
remaining -= extent;
-#line 788
+#line 772
if(remaining == 0)
-#line 788
+#line 772
break; /* normal loop exit */
-#line 788
+#line 772
offset += (off_t)extent;
-#line 788
+#line 772
value += nput;
-#line 788
+#line 772
-#line 788
+#line 772
}
-#line 788
+#line 772
#ifdef ERANGE_FILL
-#line 788
+#line 772
free(fillp);
-#line 788
+#line 772
#endif
-#line 788
+#line 772
-#line 788
+#line 772
return status;
-#line 788
+#line 772
}
-#line 788
+#line 772
static int
-#line 789
+#line 773
putNCvx_uint_short(NC3_INFO* ncp, const NC_var *varp,
-#line 789
+#line 773
const size_t *start, size_t nelems, const short *value)
-#line 789
+#line 773
{
-#line 789
+#line 773
off_t offset = NC_varoffset(ncp, varp, start);
-#line 789
+#line 773
size_t remaining = varp->xsz * nelems;
-#line 789
+#line 773
int status = NC_NOERR;
-#line 789
+#line 773
void *xp;
-#line 789
+#line 773
void *fillp=NULL;
-#line 789
+#line 773
-#line 789
+#line 773
if(nelems == 0)
-#line 789
+#line 773
return NC_NOERR;
-#line 789
+#line 773
-#line 789
+#line 773
assert(value != NULL);
-#line 789
+#line 773
-#line 789
+#line 773
#ifdef ERANGE_FILL
-#line 789
+#line 773
fillp = malloc(varp->xsz);
-#line 789
+#line 773
status = NC3_inq_var_fill(varp, fillp);
-#line 789
+#line 773
#endif
-#line 789
+#line 773
-#line 789
+#line 773
for(;;)
-#line 789
+#line 773
{
-#line 789
+#line 773
size_t extent = MIN(remaining, ncp->chunk);
-#line 789
+#line 773
size_t nput = ncx_howmany(varp->type, extent);
-#line 789
+#line 773
-#line 789
+#line 773
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 789
+#line 773
RGN_WRITE, &xp);
-#line 789
+#line 773
if(lstatus != NC_NOERR)
-#line 789
+#line 773
return lstatus;
-#line 789
+#line 773
-#line 789
+#line 773
lstatus = ncx_putn_uint_short(&xp, nput, value ,fillp);
-#line 789
+#line 773
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 789
+#line 773
{
-#line 789
+#line 773
/* not fatal to the loop */
-#line 789
+#line 773
status = lstatus;
-#line 789
+#line 773
}
-#line 789
+#line 773
-#line 789
+#line 773
(void) ncio_rel(ncp->nciop, offset,
-#line 789
+#line 773
RGN_MODIFIED);
-#line 789
+#line 773
-#line 789
+#line 773
remaining -= extent;
-#line 789
+#line 773
if(remaining == 0)
-#line 789
+#line 773
break; /* normal loop exit */
-#line 789
+#line 773
offset += (off_t)extent;
-#line 789
+#line 773
value += nput;
-#line 789
+#line 773
-#line 789
+#line 773
}
-#line 789
+#line 773
#ifdef ERANGE_FILL
-#line 789
+#line 773
free(fillp);
-#line 789
+#line 773
#endif
-#line 789
+#line 773
-#line 789
+#line 773
return status;
-#line 789
+#line 773
}
-#line 789
+#line 773
static int
-#line 790
+#line 774
putNCvx_uint_int(NC3_INFO* ncp, const NC_var *varp,
-#line 790
+#line 774
const size_t *start, size_t nelems, const int *value)
-#line 790
+#line 774
{
-#line 790
+#line 774
off_t offset = NC_varoffset(ncp, varp, start);
-#line 790
+#line 774
size_t remaining = varp->xsz * nelems;
-#line 790
+#line 774
int status = NC_NOERR;
-#line 790
+#line 774
void *xp;
-#line 790
+#line 774
void *fillp=NULL;
-#line 790
+#line 774
-#line 790
+#line 774
if(nelems == 0)
-#line 790
+#line 774
return NC_NOERR;
-#line 790
+#line 774
-#line 790
+#line 774
assert(value != NULL);
-#line 790
+#line 774
-#line 790
+#line 774
#ifdef ERANGE_FILL
-#line 790
+#line 774
fillp = malloc(varp->xsz);
-#line 790
+#line 774
status = NC3_inq_var_fill(varp, fillp);
-#line 790
+#line 774
#endif
-#line 790
+#line 774
-#line 790
+#line 774
for(;;)
-#line 790
+#line 774
{
-#line 790
+#line 774
size_t extent = MIN(remaining, ncp->chunk);
-#line 790
+#line 774
size_t nput = ncx_howmany(varp->type, extent);
-#line 790
+#line 774
-#line 790
+#line 774
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 790
+#line 774
RGN_WRITE, &xp);
-#line 790
+#line 774
if(lstatus != NC_NOERR)
-#line 790
+#line 774
return lstatus;
-#line 790
+#line 774
-#line 790
+#line 774
lstatus = ncx_putn_uint_int(&xp, nput, value ,fillp);
-#line 790
+#line 774
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 790
+#line 774
{
-#line 790
+#line 774
/* not fatal to the loop */
-#line 790
+#line 774
status = lstatus;
-#line 790
+#line 774
}
-#line 790
+#line 774
-#line 790
+#line 774
(void) ncio_rel(ncp->nciop, offset,
-#line 790
+#line 774
RGN_MODIFIED);
-#line 790
+#line 774
-#line 790
+#line 774
remaining -= extent;
-#line 790
+#line 774
if(remaining == 0)
-#line 790
+#line 774
break; /* normal loop exit */
-#line 790
+#line 774
offset += (off_t)extent;
-#line 790
+#line 774
value += nput;
-#line 790
+#line 774
-#line 790
+#line 774
}
-#line 790
+#line 774
#ifdef ERANGE_FILL
-#line 790
+#line 774
free(fillp);
-#line 790
+#line 774
#endif
-#line 790
+#line 774
-#line 790
+#line 774
return status;
-#line 790
+#line 774
}
-#line 790
+#line 774
static int
-#line 791
+#line 775
putNCvx_uint_float(NC3_INFO* ncp, const NC_var *varp,
-#line 791
+#line 775
const size_t *start, size_t nelems, const float *value)
-#line 791
+#line 775
{
-#line 791
+#line 775
off_t offset = NC_varoffset(ncp, varp, start);
-#line 791
+#line 775
size_t remaining = varp->xsz * nelems;
-#line 791
+#line 775
int status = NC_NOERR;
-#line 791
+#line 775
void *xp;
-#line 791
+#line 775
void *fillp=NULL;
-#line 791
+#line 775
-#line 791
+#line 775
if(nelems == 0)
-#line 791
+#line 775
return NC_NOERR;
-#line 791
+#line 775
-#line 791
+#line 775
assert(value != NULL);
-#line 791
+#line 775
-#line 791
+#line 775
#ifdef ERANGE_FILL
-#line 791
+#line 775
fillp = malloc(varp->xsz);
-#line 791
+#line 775
status = NC3_inq_var_fill(varp, fillp);
-#line 791
+#line 775
#endif
-#line 791
+#line 775
-#line 791
+#line 775
for(;;)
-#line 791
+#line 775
{
-#line 791
+#line 775
size_t extent = MIN(remaining, ncp->chunk);
-#line 791
+#line 775
size_t nput = ncx_howmany(varp->type, extent);
-#line 791
+#line 775
-#line 791
+#line 775
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 791
+#line 775
RGN_WRITE, &xp);
-#line 791
+#line 775
if(lstatus != NC_NOERR)
-#line 791
+#line 775
return lstatus;
-#line 791
+#line 775
-#line 791
+#line 775
lstatus = ncx_putn_uint_float(&xp, nput, value ,fillp);
-#line 791
+#line 775
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 791
+#line 775
{
-#line 791
+#line 775
/* not fatal to the loop */
-#line 791
+#line 775
status = lstatus;
-#line 791
+#line 775
}
-#line 791
+#line 775
-#line 791
+#line 775
(void) ncio_rel(ncp->nciop, offset,
-#line 791
+#line 775
RGN_MODIFIED);
-#line 791
+#line 775
-#line 791
+#line 775
remaining -= extent;
-#line 791
+#line 775
if(remaining == 0)
-#line 791
+#line 775
break; /* normal loop exit */
-#line 791
+#line 775
offset += (off_t)extent;
-#line 791
+#line 775
value += nput;
-#line 791
+#line 775
-#line 791
+#line 775
}
-#line 791
+#line 775
#ifdef ERANGE_FILL
-#line 791
+#line 775
free(fillp);
-#line 791
+#line 775
#endif
-#line 791
+#line 775
-#line 791
+#line 775
return status;
-#line 791
+#line 775
}
-#line 791
+#line 775
static int
-#line 792
+#line 776
putNCvx_uint_double(NC3_INFO* ncp, const NC_var *varp,
-#line 792
+#line 776
const size_t *start, size_t nelems, const double *value)
-#line 792
+#line 776
{
-#line 792
+#line 776
off_t offset = NC_varoffset(ncp, varp, start);
-#line 792
+#line 776
size_t remaining = varp->xsz * nelems;
-#line 792
+#line 776
int status = NC_NOERR;
-#line 792
+#line 776
void *xp;
-#line 792
+#line 776
void *fillp=NULL;
-#line 792
+#line 776
-#line 792
+#line 776
if(nelems == 0)
-#line 792
+#line 776
return NC_NOERR;
-#line 792
+#line 776
-#line 792
+#line 776
assert(value != NULL);
-#line 792
+#line 776
-#line 792
+#line 776
#ifdef ERANGE_FILL
-#line 792
+#line 776
fillp = malloc(varp->xsz);
-#line 792
+#line 776
status = NC3_inq_var_fill(varp, fillp);
-#line 792
+#line 776
#endif
-#line 792
+#line 776
-#line 792
+#line 776
for(;;)
-#line 792
+#line 776
{
-#line 792
+#line 776
size_t extent = MIN(remaining, ncp->chunk);
-#line 792
+#line 776
size_t nput = ncx_howmany(varp->type, extent);
-#line 792
+#line 776
-#line 792
+#line 776
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 792
+#line 776
RGN_WRITE, &xp);
-#line 792
+#line 776
if(lstatus != NC_NOERR)
-#line 792
+#line 776
return lstatus;
-#line 792
+#line 776
-#line 792
+#line 776
lstatus = ncx_putn_uint_double(&xp, nput, value ,fillp);
-#line 792
+#line 776
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 792
+#line 776
{
-#line 792
+#line 776
/* not fatal to the loop */
-#line 792
+#line 776
status = lstatus;
-#line 792
+#line 776
}
-#line 792
+#line 776
-#line 792
+#line 776
(void) ncio_rel(ncp->nciop, offset,
-#line 792
+#line 776
RGN_MODIFIED);
-#line 792
+#line 776
-#line 792
+#line 776
remaining -= extent;
-#line 792
+#line 776
if(remaining == 0)
-#line 792
+#line 776
break; /* normal loop exit */
-#line 792
+#line 776
offset += (off_t)extent;
-#line 792
+#line 776
value += nput;
-#line 792
+#line 776
-#line 792
+#line 776
}
-#line 792
+#line 776
#ifdef ERANGE_FILL
-#line 792
+#line 776
free(fillp);
-#line 792
+#line 776
#endif
-#line 792
+#line 776
-#line 792
+#line 776
return status;
-#line 792
+#line 776
}
-#line 792
+#line 776
static int
-#line 793
+#line 777
putNCvx_uint_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 793
+#line 777
const size_t *start, size_t nelems, const longlong *value)
-#line 793
+#line 777
{
-#line 793
+#line 777
off_t offset = NC_varoffset(ncp, varp, start);
-#line 793
+#line 777
size_t remaining = varp->xsz * nelems;
-#line 793
+#line 777
int status = NC_NOERR;
-#line 793
+#line 777
void *xp;
-#line 793
+#line 777
void *fillp=NULL;
-#line 793
+#line 777
-#line 793
+#line 777
if(nelems == 0)
-#line 793
+#line 777
return NC_NOERR;
-#line 793
+#line 777
-#line 793
+#line 777
assert(value != NULL);
-#line 793
+#line 777
-#line 793
+#line 777
#ifdef ERANGE_FILL
-#line 793
+#line 777
fillp = malloc(varp->xsz);
-#line 793
+#line 777
status = NC3_inq_var_fill(varp, fillp);
-#line 793
+#line 777
#endif
-#line 793
+#line 777
-#line 793
+#line 777
for(;;)
-#line 793
+#line 777
{
-#line 793
+#line 777
size_t extent = MIN(remaining, ncp->chunk);
-#line 793
+#line 777
size_t nput = ncx_howmany(varp->type, extent);
-#line 793
+#line 777
-#line 793
+#line 777
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 793
+#line 777
RGN_WRITE, &xp);
-#line 793
+#line 777
if(lstatus != NC_NOERR)
-#line 793
+#line 777
return lstatus;
-#line 793
+#line 777
-#line 793
+#line 777
lstatus = ncx_putn_uint_longlong(&xp, nput, value ,fillp);
-#line 793
+#line 777
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 793
+#line 777
{
-#line 793
+#line 777
/* not fatal to the loop */
-#line 793
+#line 777
status = lstatus;
-#line 793
+#line 777
}
-#line 793
+#line 777
-#line 793
+#line 777
(void) ncio_rel(ncp->nciop, offset,
-#line 793
+#line 777
RGN_MODIFIED);
-#line 793
+#line 777
-#line 793
+#line 777
remaining -= extent;
-#line 793
+#line 777
if(remaining == 0)
-#line 793
+#line 777
break; /* normal loop exit */
-#line 793
+#line 777
offset += (off_t)extent;
-#line 793
+#line 777
value += nput;
-#line 793
+#line 777
-#line 793
+#line 777
}
-#line 793
+#line 777
#ifdef ERANGE_FILL
-#line 793
+#line 777
free(fillp);
-#line 793
+#line 777
#endif
-#line 793
+#line 777
-#line 793
+#line 777
return status;
-#line 793
+#line 777
}
-#line 793
+#line 777
static int
-#line 794
+#line 778
putNCvx_uint_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 794
+#line 778
const size_t *start, size_t nelems, const ushort *value)
-#line 794
+#line 778
{
-#line 794
+#line 778
off_t offset = NC_varoffset(ncp, varp, start);
-#line 794
+#line 778
size_t remaining = varp->xsz * nelems;
-#line 794
+#line 778
int status = NC_NOERR;
-#line 794
+#line 778
void *xp;
-#line 794
+#line 778
void *fillp=NULL;
-#line 794
+#line 778
-#line 794
+#line 778
if(nelems == 0)
-#line 794
+#line 778
return NC_NOERR;
-#line 794
+#line 778
-#line 794
+#line 778
assert(value != NULL);
-#line 794
+#line 778
-#line 794
+#line 778
#ifdef ERANGE_FILL
-#line 794
+#line 778
fillp = malloc(varp->xsz);
-#line 794
+#line 778
status = NC3_inq_var_fill(varp, fillp);
-#line 794
+#line 778
#endif
-#line 794
+#line 778
-#line 794
+#line 778
for(;;)
-#line 794
+#line 778
{
-#line 794
+#line 778
size_t extent = MIN(remaining, ncp->chunk);
-#line 794
+#line 778
size_t nput = ncx_howmany(varp->type, extent);
-#line 794
+#line 778
-#line 794
+#line 778
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 794
+#line 778
RGN_WRITE, &xp);
-#line 794
+#line 778
if(lstatus != NC_NOERR)
-#line 794
+#line 778
return lstatus;
-#line 794
+#line 778
-#line 794
+#line 778
lstatus = ncx_putn_uint_ushort(&xp, nput, value ,fillp);
-#line 794
+#line 778
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 794
+#line 778
{
-#line 794
+#line 778
/* not fatal to the loop */
-#line 794
+#line 778
status = lstatus;
-#line 794
+#line 778
}
-#line 794
+#line 778
-#line 794
+#line 778
(void) ncio_rel(ncp->nciop, offset,
-#line 794
+#line 778
RGN_MODIFIED);
-#line 794
+#line 778
-#line 794
+#line 778
remaining -= extent;
-#line 794
+#line 778
if(remaining == 0)
-#line 794
+#line 778
break; /* normal loop exit */
-#line 794
+#line 778
offset += (off_t)extent;
-#line 794
+#line 778
value += nput;
-#line 794
+#line 778
-#line 794
+#line 778
}
-#line 794
+#line 778
#ifdef ERANGE_FILL
-#line 794
+#line 778
free(fillp);
-#line 794
+#line 778
#endif
-#line 794
+#line 778
-#line 794
+#line 778
return status;
-#line 794
+#line 778
}
-#line 794
+#line 778
static int
-#line 795
+#line 779
putNCvx_uint_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 795
+#line 779
const size_t *start, size_t nelems, const uint *value)
-#line 795
+#line 779
{
-#line 795
+#line 779
off_t offset = NC_varoffset(ncp, varp, start);
-#line 795
+#line 779
size_t remaining = varp->xsz * nelems;
-#line 795
+#line 779
int status = NC_NOERR;
-#line 795
+#line 779
void *xp;
-#line 795
+#line 779
void *fillp=NULL;
-#line 795
+#line 779
-#line 795
+#line 779
if(nelems == 0)
-#line 795
+#line 779
return NC_NOERR;
-#line 795
+#line 779
-#line 795
+#line 779
assert(value != NULL);
-#line 795
+#line 779
-#line 795
+#line 779
#ifdef ERANGE_FILL
-#line 795
+#line 779
fillp = malloc(varp->xsz);
-#line 795
+#line 779
status = NC3_inq_var_fill(varp, fillp);
-#line 795
+#line 779
#endif
-#line 795
+#line 779
-#line 795
+#line 779
for(;;)
-#line 795
+#line 779
{
-#line 795
+#line 779
size_t extent = MIN(remaining, ncp->chunk);
-#line 795
+#line 779
size_t nput = ncx_howmany(varp->type, extent);
-#line 795
+#line 779
-#line 795
+#line 779
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 795
+#line 779
RGN_WRITE, &xp);
-#line 795
+#line 779
if(lstatus != NC_NOERR)
-#line 795
+#line 779
return lstatus;
-#line 795
+#line 779
-#line 795
+#line 779
lstatus = ncx_putn_uint_uint(&xp, nput, value ,fillp);
-#line 795
+#line 779
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 795
+#line 779
{
-#line 795
+#line 779
/* not fatal to the loop */
-#line 795
+#line 779
status = lstatus;
-#line 795
+#line 779
}
-#line 795
+#line 779
-#line 795
+#line 779
(void) ncio_rel(ncp->nciop, offset,
-#line 795
+#line 779
RGN_MODIFIED);
-#line 795
+#line 779
-#line 795
+#line 779
remaining -= extent;
-#line 795
+#line 779
if(remaining == 0)
-#line 795
+#line 779
break; /* normal loop exit */
-#line 795
+#line 779
offset += (off_t)extent;
-#line 795
+#line 779
value += nput;
-#line 795
+#line 779
-#line 795
+#line 779
}
-#line 795
+#line 779
#ifdef ERANGE_FILL
-#line 795
+#line 779
free(fillp);
-#line 795
+#line 779
#endif
-#line 795
+#line 779
-#line 795
+#line 779
return status;
-#line 795
+#line 779
}
-#line 795
+#line 779
static int
-#line 796
+#line 780
putNCvx_uint_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 796
+#line 780
const size_t *start, size_t nelems, const ulonglong *value)
-#line 796
+#line 780
{
-#line 796
+#line 780
off_t offset = NC_varoffset(ncp, varp, start);
-#line 796
+#line 780
size_t remaining = varp->xsz * nelems;
-#line 796
+#line 780
int status = NC_NOERR;
-#line 796
+#line 780
void *xp;
-#line 796
+#line 780
void *fillp=NULL;
-#line 796
+#line 780
-#line 796
+#line 780
if(nelems == 0)
-#line 796
+#line 780
return NC_NOERR;
-#line 796
+#line 780
-#line 796
+#line 780
assert(value != NULL);
-#line 796
+#line 780
-#line 796
+#line 780
#ifdef ERANGE_FILL
-#line 796
+#line 780
fillp = malloc(varp->xsz);
-#line 796
+#line 780
status = NC3_inq_var_fill(varp, fillp);
-#line 796
+#line 780
#endif
-#line 796
+#line 780
-#line 796
+#line 780
for(;;)
-#line 796
+#line 780
{
-#line 796
+#line 780
size_t extent = MIN(remaining, ncp->chunk);
-#line 796
+#line 780
size_t nput = ncx_howmany(varp->type, extent);
-#line 796
+#line 780
-#line 796
+#line 780
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 796
+#line 780
RGN_WRITE, &xp);
-#line 796
+#line 780
if(lstatus != NC_NOERR)
-#line 796
+#line 780
return lstatus;
-#line 796
+#line 780
-#line 796
+#line 780
lstatus = ncx_putn_uint_ulonglong(&xp, nput, value ,fillp);
-#line 796
+#line 780
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 796
+#line 780
{
-#line 796
+#line 780
/* not fatal to the loop */
-#line 796
+#line 780
status = lstatus;
-#line 796
+#line 780
}
-#line 796
+#line 780
-#line 796
+#line 780
(void) ncio_rel(ncp->nciop, offset,
-#line 796
+#line 780
RGN_MODIFIED);
-#line 796
+#line 780
-#line 796
+#line 780
remaining -= extent;
-#line 796
+#line 780
if(remaining == 0)
-#line 796
+#line 780
break; /* normal loop exit */
-#line 796
+#line 780
offset += (off_t)extent;
-#line 796
+#line 780
value += nput;
-#line 796
+#line 780
-#line 796
+#line 780
}
-#line 796
+#line 780
#ifdef ERANGE_FILL
-#line 796
+#line 780
free(fillp);
-#line 796
+#line 780
#endif
-#line 796
+#line 780
-#line 796
+#line 780
return status;
-#line 796
+#line 780
}
-#line 796
+#line 780
static int
-#line 798
+#line 782
putNCvx_longlong_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 798
+#line 782
const size_t *start, size_t nelems, const schar *value)
-#line 798
+#line 782
{
-#line 798
+#line 782
off_t offset = NC_varoffset(ncp, varp, start);
-#line 798
+#line 782
size_t remaining = varp->xsz * nelems;
-#line 798
+#line 782
int status = NC_NOERR;
-#line 798
+#line 782
void *xp;
-#line 798
+#line 782
void *fillp=NULL;
-#line 798
+#line 782
-#line 798
+#line 782
if(nelems == 0)
-#line 798
+#line 782
return NC_NOERR;
-#line 798
+#line 782
-#line 798
+#line 782
assert(value != NULL);
-#line 798
+#line 782
-#line 798
+#line 782
#ifdef ERANGE_FILL
-#line 798
+#line 782
fillp = malloc(varp->xsz);
-#line 798
+#line 782
status = NC3_inq_var_fill(varp, fillp);
-#line 798
+#line 782
#endif
-#line 798
+#line 782
-#line 798
+#line 782
for(;;)
-#line 798
+#line 782
{
-#line 798
+#line 782
size_t extent = MIN(remaining, ncp->chunk);
-#line 798
+#line 782
size_t nput = ncx_howmany(varp->type, extent);
-#line 798
+#line 782
-#line 798
+#line 782
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 798
+#line 782
RGN_WRITE, &xp);
-#line 798
+#line 782
if(lstatus != NC_NOERR)
-#line 798
+#line 782
return lstatus;
-#line 798
+#line 782
-#line 798
+#line 782
lstatus = ncx_putn_longlong_schar(&xp, nput, value ,fillp);
-#line 798
+#line 782
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 798
+#line 782
{
-#line 798
+#line 782
/* not fatal to the loop */
-#line 798
+#line 782
status = lstatus;
-#line 798
+#line 782
}
-#line 798
+#line 782
-#line 798
+#line 782
(void) ncio_rel(ncp->nciop, offset,
-#line 798
+#line 782
RGN_MODIFIED);
-#line 798
+#line 782
-#line 798
+#line 782
remaining -= extent;
-#line 798
+#line 782
if(remaining == 0)
-#line 798
+#line 782
break; /* normal loop exit */
-#line 798
+#line 782
offset += (off_t)extent;
-#line 798
+#line 782
value += nput;
-#line 798
+#line 782
-#line 798
+#line 782
}
-#line 798
+#line 782
#ifdef ERANGE_FILL
-#line 798
+#line 782
free(fillp);
-#line 798
+#line 782
#endif
-#line 798
+#line 782
-#line 798
+#line 782
return status;
-#line 798
+#line 782
}
-#line 798
+#line 782
static int
-#line 799
+#line 783
putNCvx_longlong_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 799
+#line 783
const size_t *start, size_t nelems, const uchar *value)
-#line 799
+#line 783
{
-#line 799
+#line 783
off_t offset = NC_varoffset(ncp, varp, start);
-#line 799
+#line 783
size_t remaining = varp->xsz * nelems;
-#line 799
+#line 783
int status = NC_NOERR;
-#line 799
+#line 783
void *xp;
-#line 799
+#line 783
void *fillp=NULL;
-#line 799
+#line 783
-#line 799
+#line 783
if(nelems == 0)
-#line 799
+#line 783
return NC_NOERR;
-#line 799
+#line 783
-#line 799
+#line 783
assert(value != NULL);
-#line 799
+#line 783
-#line 799
+#line 783
#ifdef ERANGE_FILL
-#line 799
+#line 783
fillp = malloc(varp->xsz);
-#line 799
+#line 783
status = NC3_inq_var_fill(varp, fillp);
-#line 799
+#line 783
#endif
-#line 799
+#line 783
-#line 799
+#line 783
for(;;)
-#line 799
+#line 783
{
-#line 799
+#line 783
size_t extent = MIN(remaining, ncp->chunk);
-#line 799
+#line 783
size_t nput = ncx_howmany(varp->type, extent);
-#line 799
+#line 783
-#line 799
+#line 783
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 799
+#line 783
RGN_WRITE, &xp);
-#line 799
+#line 783
if(lstatus != NC_NOERR)
-#line 799
+#line 783
return lstatus;
-#line 799
+#line 783
-#line 799
+#line 783
lstatus = ncx_putn_longlong_uchar(&xp, nput, value ,fillp);
-#line 799
+#line 783
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 799
+#line 783
{
-#line 799
+#line 783
/* not fatal to the loop */
-#line 799
+#line 783
status = lstatus;
-#line 799
+#line 783
}
-#line 799
+#line 783
-#line 799
+#line 783
(void) ncio_rel(ncp->nciop, offset,
-#line 799
+#line 783
RGN_MODIFIED);
-#line 799
+#line 783
-#line 799
+#line 783
remaining -= extent;
-#line 799
+#line 783
if(remaining == 0)
-#line 799
+#line 783
break; /* normal loop exit */
-#line 799
+#line 783
offset += (off_t)extent;
-#line 799
+#line 783
value += nput;
-#line 799
+#line 783
-#line 799
+#line 783
}
-#line 799
+#line 783
#ifdef ERANGE_FILL
-#line 799
+#line 783
free(fillp);
-#line 799
+#line 783
#endif
-#line 799
+#line 783
-#line 799
+#line 783
return status;
-#line 799
+#line 783
}
-#line 799
+#line 783
static int
-#line 800
+#line 784
putNCvx_longlong_short(NC3_INFO* ncp, const NC_var *varp,
-#line 800
+#line 784
const size_t *start, size_t nelems, const short *value)
-#line 800
+#line 784
{
-#line 800
+#line 784
off_t offset = NC_varoffset(ncp, varp, start);
-#line 800
+#line 784
size_t remaining = varp->xsz * nelems;
-#line 800
+#line 784
int status = NC_NOERR;
-#line 800
+#line 784
void *xp;
-#line 800
+#line 784
void *fillp=NULL;
-#line 800
+#line 784
-#line 800
+#line 784
if(nelems == 0)
-#line 800
+#line 784
return NC_NOERR;
-#line 800
+#line 784
-#line 800
+#line 784
assert(value != NULL);
-#line 800
+#line 784
-#line 800
+#line 784
#ifdef ERANGE_FILL
-#line 800
+#line 784
fillp = malloc(varp->xsz);
-#line 800
+#line 784
status = NC3_inq_var_fill(varp, fillp);
-#line 800
+#line 784
#endif
-#line 800
+#line 784
-#line 800
+#line 784
for(;;)
-#line 800
+#line 784
{
-#line 800
+#line 784
size_t extent = MIN(remaining, ncp->chunk);
-#line 800
+#line 784
size_t nput = ncx_howmany(varp->type, extent);
-#line 800
+#line 784
-#line 800
+#line 784
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 800
+#line 784
RGN_WRITE, &xp);
-#line 800
+#line 784
if(lstatus != NC_NOERR)
-#line 800
+#line 784
return lstatus;
-#line 800
+#line 784
-#line 800
+#line 784
lstatus = ncx_putn_longlong_short(&xp, nput, value ,fillp);
-#line 800
+#line 784
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 800
+#line 784
{
-#line 800
+#line 784
/* not fatal to the loop */
-#line 800
+#line 784
status = lstatus;
-#line 800
+#line 784
}
-#line 800
+#line 784
-#line 800
+#line 784
(void) ncio_rel(ncp->nciop, offset,
-#line 800
+#line 784
RGN_MODIFIED);
-#line 800
+#line 784
-#line 800
+#line 784
remaining -= extent;
-#line 800
+#line 784
if(remaining == 0)
-#line 800
+#line 784
break; /* normal loop exit */
-#line 800
+#line 784
offset += (off_t)extent;
-#line 800
+#line 784
value += nput;
-#line 800
+#line 784
-#line 800
+#line 784
}
-#line 800
+#line 784
#ifdef ERANGE_FILL
-#line 800
+#line 784
free(fillp);
-#line 800
+#line 784
#endif
-#line 800
+#line 784
-#line 800
+#line 784
return status;
-#line 800
+#line 784
}
-#line 800
+#line 784
static int
-#line 801
+#line 785
putNCvx_longlong_int(NC3_INFO* ncp, const NC_var *varp,
-#line 801
+#line 785
const size_t *start, size_t nelems, const int *value)
-#line 801
+#line 785
{
-#line 801
+#line 785
off_t offset = NC_varoffset(ncp, varp, start);
-#line 801
+#line 785
size_t remaining = varp->xsz * nelems;
-#line 801
+#line 785
int status = NC_NOERR;
-#line 801
+#line 785
void *xp;
-#line 801
+#line 785
void *fillp=NULL;
-#line 801
+#line 785
-#line 801
+#line 785
if(nelems == 0)
-#line 801
+#line 785
return NC_NOERR;
-#line 801
+#line 785
-#line 801
+#line 785
assert(value != NULL);
-#line 801
+#line 785
-#line 801
+#line 785
#ifdef ERANGE_FILL
-#line 801
+#line 785
fillp = malloc(varp->xsz);
-#line 801
+#line 785
status = NC3_inq_var_fill(varp, fillp);
-#line 801
+#line 785
#endif
-#line 801
+#line 785
-#line 801
+#line 785
for(;;)
-#line 801
+#line 785
{
-#line 801
+#line 785
size_t extent = MIN(remaining, ncp->chunk);
-#line 801
+#line 785
size_t nput = ncx_howmany(varp->type, extent);
-#line 801
+#line 785
-#line 801
+#line 785
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 801
+#line 785
RGN_WRITE, &xp);
-#line 801
+#line 785
if(lstatus != NC_NOERR)
-#line 801
+#line 785
return lstatus;
-#line 801
+#line 785
-#line 801
+#line 785
lstatus = ncx_putn_longlong_int(&xp, nput, value ,fillp);
-#line 801
+#line 785
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 801
+#line 785
{
-#line 801
+#line 785
/* not fatal to the loop */
-#line 801
+#line 785
status = lstatus;
-#line 801
+#line 785
}
-#line 801
+#line 785
-#line 801
+#line 785
(void) ncio_rel(ncp->nciop, offset,
-#line 801
+#line 785
RGN_MODIFIED);
-#line 801
+#line 785
-#line 801
+#line 785
remaining -= extent;
-#line 801
+#line 785
if(remaining == 0)
-#line 801
+#line 785
break; /* normal loop exit */
-#line 801
+#line 785
offset += (off_t)extent;
-#line 801
+#line 785
value += nput;
-#line 801
+#line 785
-#line 801
+#line 785
}
-#line 801
+#line 785
#ifdef ERANGE_FILL
-#line 801
+#line 785
free(fillp);
-#line 801
+#line 785
#endif
-#line 801
+#line 785
-#line 801
+#line 785
return status;
-#line 801
+#line 785
}
-#line 801
+#line 785
static int
-#line 802
+#line 786
putNCvx_longlong_float(NC3_INFO* ncp, const NC_var *varp,
-#line 802
+#line 786
const size_t *start, size_t nelems, const float *value)
-#line 802
+#line 786
{
-#line 802
+#line 786
off_t offset = NC_varoffset(ncp, varp, start);
-#line 802
+#line 786
size_t remaining = varp->xsz * nelems;
-#line 802
+#line 786
int status = NC_NOERR;
-#line 802
+#line 786
void *xp;
-#line 802
+#line 786
void *fillp=NULL;
-#line 802
+#line 786
-#line 802
+#line 786
if(nelems == 0)
-#line 802
+#line 786
return NC_NOERR;
-#line 802
+#line 786
-#line 802
+#line 786
assert(value != NULL);
-#line 802
+#line 786
-#line 802
+#line 786
#ifdef ERANGE_FILL
-#line 802
+#line 786
fillp = malloc(varp->xsz);
-#line 802
+#line 786
status = NC3_inq_var_fill(varp, fillp);
-#line 802
+#line 786
#endif
-#line 802
+#line 786
-#line 802
+#line 786
for(;;)
-#line 802
+#line 786
{
-#line 802
+#line 786
size_t extent = MIN(remaining, ncp->chunk);
-#line 802
+#line 786
size_t nput = ncx_howmany(varp->type, extent);
-#line 802
+#line 786
-#line 802
+#line 786
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 802
+#line 786
RGN_WRITE, &xp);
-#line 802
+#line 786
if(lstatus != NC_NOERR)
-#line 802
+#line 786
return lstatus;
-#line 802
+#line 786
-#line 802
+#line 786
lstatus = ncx_putn_longlong_float(&xp, nput, value ,fillp);
-#line 802
+#line 786
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 802
+#line 786
{
-#line 802
+#line 786
/* not fatal to the loop */
-#line 802
+#line 786
status = lstatus;
-#line 802
+#line 786
}
-#line 802
+#line 786
-#line 802
+#line 786
(void) ncio_rel(ncp->nciop, offset,
-#line 802
+#line 786
RGN_MODIFIED);
-#line 802
+#line 786
-#line 802
+#line 786
remaining -= extent;
-#line 802
+#line 786
if(remaining == 0)
-#line 802
+#line 786
break; /* normal loop exit */
-#line 802
+#line 786
offset += (off_t)extent;
-#line 802
+#line 786
value += nput;
-#line 802
+#line 786
-#line 802
+#line 786
}
-#line 802
+#line 786
#ifdef ERANGE_FILL
-#line 802
+#line 786
free(fillp);
-#line 802
+#line 786
#endif
-#line 802
+#line 786
-#line 802
+#line 786
return status;
-#line 802
+#line 786
}
-#line 802
+#line 786
static int
-#line 803
+#line 787
putNCvx_longlong_double(NC3_INFO* ncp, const NC_var *varp,
-#line 803
+#line 787
const size_t *start, size_t nelems, const double *value)
-#line 803
+#line 787
{
-#line 803
+#line 787
off_t offset = NC_varoffset(ncp, varp, start);
-#line 803
+#line 787
size_t remaining = varp->xsz * nelems;
-#line 803
+#line 787
int status = NC_NOERR;
-#line 803
+#line 787
void *xp;
-#line 803
+#line 787
void *fillp=NULL;
-#line 803
+#line 787
-#line 803
+#line 787
if(nelems == 0)
-#line 803
+#line 787
return NC_NOERR;
-#line 803
+#line 787
-#line 803
+#line 787
assert(value != NULL);
-#line 803
+#line 787
-#line 803
+#line 787
#ifdef ERANGE_FILL
-#line 803
+#line 787
fillp = malloc(varp->xsz);
-#line 803
+#line 787
status = NC3_inq_var_fill(varp, fillp);
-#line 803
+#line 787
#endif
-#line 803
+#line 787
-#line 803
+#line 787
for(;;)
-#line 803
+#line 787
{
-#line 803
+#line 787
size_t extent = MIN(remaining, ncp->chunk);
-#line 803
+#line 787
size_t nput = ncx_howmany(varp->type, extent);
-#line 803
+#line 787
-#line 803
+#line 787
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 803
+#line 787
RGN_WRITE, &xp);
-#line 803
+#line 787
if(lstatus != NC_NOERR)
-#line 803
+#line 787
return lstatus;
-#line 803
+#line 787
-#line 803
+#line 787
lstatus = ncx_putn_longlong_double(&xp, nput, value ,fillp);
-#line 803
+#line 787
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 803
+#line 787
{
-#line 803
+#line 787
/* not fatal to the loop */
-#line 803
+#line 787
status = lstatus;
-#line 803
+#line 787
}
-#line 803
+#line 787
-#line 803
+#line 787
(void) ncio_rel(ncp->nciop, offset,
-#line 803
+#line 787
RGN_MODIFIED);
-#line 803
+#line 787
-#line 803
+#line 787
remaining -= extent;
-#line 803
+#line 787
if(remaining == 0)
-#line 803
+#line 787
break; /* normal loop exit */
-#line 803
+#line 787
offset += (off_t)extent;
-#line 803
+#line 787
value += nput;
-#line 803
+#line 787
-#line 803
+#line 787
}
-#line 803
+#line 787
#ifdef ERANGE_FILL
-#line 803
+#line 787
free(fillp);
-#line 803
+#line 787
#endif
-#line 803
+#line 787
-#line 803
+#line 787
return status;
-#line 803
+#line 787
}
-#line 803
+#line 787
static int
-#line 804
+#line 788
putNCvx_longlong_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 804
+#line 788
const size_t *start, size_t nelems, const longlong *value)
-#line 804
+#line 788
{
-#line 804
+#line 788
off_t offset = NC_varoffset(ncp, varp, start);
-#line 804
+#line 788
size_t remaining = varp->xsz * nelems;
-#line 804
+#line 788
int status = NC_NOERR;
-#line 804
+#line 788
void *xp;
-#line 804
+#line 788
void *fillp=NULL;
-#line 804
+#line 788
-#line 804
+#line 788
if(nelems == 0)
-#line 804
+#line 788
return NC_NOERR;
-#line 804
+#line 788
-#line 804
+#line 788
assert(value != NULL);
-#line 804
+#line 788
-#line 804
+#line 788
#ifdef ERANGE_FILL
-#line 804
+#line 788
fillp = malloc(varp->xsz);
-#line 804
+#line 788
status = NC3_inq_var_fill(varp, fillp);
-#line 804
+#line 788
#endif
-#line 804
+#line 788
-#line 804
+#line 788
for(;;)
-#line 804
+#line 788
{
-#line 804
+#line 788
size_t extent = MIN(remaining, ncp->chunk);
-#line 804
+#line 788
size_t nput = ncx_howmany(varp->type, extent);
-#line 804
+#line 788
-#line 804
+#line 788
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 804
+#line 788
RGN_WRITE, &xp);
-#line 804
+#line 788
if(lstatus != NC_NOERR)
-#line 804
+#line 788
return lstatus;
-#line 804
+#line 788
-#line 804
+#line 788
lstatus = ncx_putn_longlong_longlong(&xp, nput, value ,fillp);
-#line 804
+#line 788
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 804
+#line 788
{
-#line 804
+#line 788
/* not fatal to the loop */
-#line 804
+#line 788
status = lstatus;
-#line 804
+#line 788
}
-#line 804
+#line 788
-#line 804
+#line 788
(void) ncio_rel(ncp->nciop, offset,
-#line 804
+#line 788
RGN_MODIFIED);
-#line 804
+#line 788
-#line 804
+#line 788
remaining -= extent;
-#line 804
+#line 788
if(remaining == 0)
-#line 804
+#line 788
break; /* normal loop exit */
-#line 804
+#line 788
offset += (off_t)extent;
-#line 804
+#line 788
value += nput;
-#line 804
+#line 788
-#line 804
+#line 788
}
-#line 804
+#line 788
#ifdef ERANGE_FILL
-#line 804
+#line 788
free(fillp);
-#line 804
+#line 788
#endif
-#line 804
+#line 788
-#line 804
+#line 788
return status;
-#line 804
+#line 788
}
-#line 804
+#line 788
static int
-#line 805
+#line 789
putNCvx_longlong_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 805
+#line 789
const size_t *start, size_t nelems, const ushort *value)
-#line 805
+#line 789
{
-#line 805
+#line 789
off_t offset = NC_varoffset(ncp, varp, start);
-#line 805
+#line 789
size_t remaining = varp->xsz * nelems;
-#line 805
+#line 789
int status = NC_NOERR;
-#line 805
+#line 789
void *xp;
-#line 805
+#line 789
void *fillp=NULL;
-#line 805
+#line 789
-#line 805
+#line 789
if(nelems == 0)
-#line 805
+#line 789
return NC_NOERR;
-#line 805
+#line 789
-#line 805
+#line 789
assert(value != NULL);
-#line 805
+#line 789
-#line 805
+#line 789
#ifdef ERANGE_FILL
-#line 805
+#line 789
fillp = malloc(varp->xsz);
-#line 805
+#line 789
status = NC3_inq_var_fill(varp, fillp);
-#line 805
+#line 789
#endif
-#line 805
+#line 789
-#line 805
+#line 789
for(;;)
-#line 805
+#line 789
{
-#line 805
+#line 789
size_t extent = MIN(remaining, ncp->chunk);
-#line 805
+#line 789
size_t nput = ncx_howmany(varp->type, extent);
-#line 805
+#line 789
-#line 805
+#line 789
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 805
+#line 789
RGN_WRITE, &xp);
-#line 805
+#line 789
if(lstatus != NC_NOERR)
-#line 805
+#line 789
return lstatus;
-#line 805
+#line 789
-#line 805
+#line 789
lstatus = ncx_putn_longlong_ushort(&xp, nput, value ,fillp);
-#line 805
+#line 789
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 805
+#line 789
{
-#line 805
+#line 789
/* not fatal to the loop */
-#line 805
+#line 789
status = lstatus;
-#line 805
+#line 789
}
-#line 805
+#line 789
-#line 805
+#line 789
(void) ncio_rel(ncp->nciop, offset,
-#line 805
+#line 789
RGN_MODIFIED);
-#line 805
+#line 789
-#line 805
+#line 789
remaining -= extent;
-#line 805
+#line 789
if(remaining == 0)
-#line 805
+#line 789
break; /* normal loop exit */
-#line 805
+#line 789
offset += (off_t)extent;
-#line 805
+#line 789
value += nput;
-#line 805
+#line 789
-#line 805
+#line 789
}
-#line 805
+#line 789
#ifdef ERANGE_FILL
-#line 805
+#line 789
free(fillp);
-#line 805
+#line 789
#endif
-#line 805
+#line 789
-#line 805
+#line 789
return status;
-#line 805
+#line 789
}
-#line 805
+#line 789
static int
-#line 806
+#line 790
putNCvx_longlong_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 806
+#line 790
const size_t *start, size_t nelems, const uint *value)
-#line 806
+#line 790
{
-#line 806
+#line 790
off_t offset = NC_varoffset(ncp, varp, start);
-#line 806
+#line 790
size_t remaining = varp->xsz * nelems;
-#line 806
+#line 790
int status = NC_NOERR;
-#line 806
+#line 790
void *xp;
-#line 806
+#line 790
void *fillp=NULL;
-#line 806
+#line 790
-#line 806
+#line 790
if(nelems == 0)
-#line 806
+#line 790
return NC_NOERR;
-#line 806
+#line 790
-#line 806
+#line 790
assert(value != NULL);
-#line 806
+#line 790
-#line 806
+#line 790
#ifdef ERANGE_FILL
-#line 806
+#line 790
fillp = malloc(varp->xsz);
-#line 806
+#line 790
status = NC3_inq_var_fill(varp, fillp);
-#line 806
+#line 790
#endif
-#line 806
+#line 790
-#line 806
+#line 790
for(;;)
-#line 806
+#line 790
{
-#line 806
+#line 790
size_t extent = MIN(remaining, ncp->chunk);
-#line 806
+#line 790
size_t nput = ncx_howmany(varp->type, extent);
-#line 806
+#line 790
-#line 806
+#line 790
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 806
+#line 790
RGN_WRITE, &xp);
-#line 806
+#line 790
if(lstatus != NC_NOERR)
-#line 806
+#line 790
return lstatus;
-#line 806
+#line 790
-#line 806
+#line 790
lstatus = ncx_putn_longlong_uint(&xp, nput, value ,fillp);
-#line 806
+#line 790
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 806
+#line 790
{
-#line 806
+#line 790
/* not fatal to the loop */
-#line 806
+#line 790
status = lstatus;
-#line 806
+#line 790
}
-#line 806
+#line 790
-#line 806
+#line 790
(void) ncio_rel(ncp->nciop, offset,
-#line 806
+#line 790
RGN_MODIFIED);
-#line 806
+#line 790
-#line 806
+#line 790
remaining -= extent;
-#line 806
+#line 790
if(remaining == 0)
-#line 806
+#line 790
break; /* normal loop exit */
-#line 806
+#line 790
offset += (off_t)extent;
-#line 806
+#line 790
value += nput;
-#line 806
+#line 790
-#line 806
+#line 790
}
-#line 806
+#line 790
#ifdef ERANGE_FILL
-#line 806
+#line 790
free(fillp);
-#line 806
+#line 790
#endif
-#line 806
+#line 790
-#line 806
+#line 790
return status;
-#line 806
+#line 790
}
-#line 806
+#line 790
static int
-#line 807
+#line 791
putNCvx_longlong_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 807
+#line 791
const size_t *start, size_t nelems, const ulonglong *value)
-#line 807
+#line 791
{
-#line 807
+#line 791
off_t offset = NC_varoffset(ncp, varp, start);
-#line 807
+#line 791
size_t remaining = varp->xsz * nelems;
-#line 807
+#line 791
int status = NC_NOERR;
-#line 807
+#line 791
void *xp;
-#line 807
+#line 791
void *fillp=NULL;
-#line 807
+#line 791
-#line 807
+#line 791
if(nelems == 0)
-#line 807
+#line 791
return NC_NOERR;
-#line 807
+#line 791
-#line 807
+#line 791
assert(value != NULL);
-#line 807
+#line 791
-#line 807
+#line 791
#ifdef ERANGE_FILL
-#line 807
+#line 791
fillp = malloc(varp->xsz);
-#line 807
+#line 791
status = NC3_inq_var_fill(varp, fillp);
-#line 807
+#line 791
#endif
-#line 807
+#line 791
-#line 807
+#line 791
for(;;)
-#line 807
+#line 791
{
-#line 807
+#line 791
size_t extent = MIN(remaining, ncp->chunk);
-#line 807
+#line 791
size_t nput = ncx_howmany(varp->type, extent);
-#line 807
+#line 791
-#line 807
+#line 791
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 807
+#line 791
RGN_WRITE, &xp);
-#line 807
+#line 791
if(lstatus != NC_NOERR)
-#line 807
+#line 791
return lstatus;
-#line 807
+#line 791
-#line 807
+#line 791
lstatus = ncx_putn_longlong_ulonglong(&xp, nput, value ,fillp);
-#line 807
+#line 791
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 807
+#line 791
{
-#line 807
+#line 791
/* not fatal to the loop */
-#line 807
+#line 791
status = lstatus;
-#line 807
+#line 791
}
-#line 807
+#line 791
-#line 807
+#line 791
(void) ncio_rel(ncp->nciop, offset,
-#line 807
+#line 791
RGN_MODIFIED);
-#line 807
+#line 791
-#line 807
+#line 791
remaining -= extent;
-#line 807
+#line 791
if(remaining == 0)
-#line 807
+#line 791
break; /* normal loop exit */
-#line 807
+#line 791
offset += (off_t)extent;
-#line 807
+#line 791
value += nput;
-#line 807
+#line 791
-#line 807
+#line 791
}
-#line 807
+#line 791
#ifdef ERANGE_FILL
-#line 807
+#line 791
free(fillp);
-#line 807
+#line 791
#endif
-#line 807
+#line 791
-#line 807
+#line 791
return status;
-#line 807
+#line 791
}
-#line 807
+#line 791
static int
-#line 809
+#line 793
putNCvx_ulonglong_schar(NC3_INFO* ncp, const NC_var *varp,
-#line 809
+#line 793
const size_t *start, size_t nelems, const schar *value)
-#line 809
+#line 793
{
-#line 809
+#line 793
off_t offset = NC_varoffset(ncp, varp, start);
-#line 809
+#line 793
size_t remaining = varp->xsz * nelems;
-#line 809
+#line 793
int status = NC_NOERR;
-#line 809
+#line 793
void *xp;
-#line 809
+#line 793
void *fillp=NULL;
-#line 809
+#line 793
-#line 809
+#line 793
if(nelems == 0)
-#line 809
+#line 793
return NC_NOERR;
-#line 809
+#line 793
-#line 809
+#line 793
assert(value != NULL);
-#line 809
+#line 793
-#line 809
+#line 793
#ifdef ERANGE_FILL
-#line 809
+#line 793
fillp = malloc(varp->xsz);
-#line 809
+#line 793
status = NC3_inq_var_fill(varp, fillp);
-#line 809
+#line 793
#endif
-#line 809
+#line 793
-#line 809
+#line 793
for(;;)
-#line 809
+#line 793
{
-#line 809
+#line 793
size_t extent = MIN(remaining, ncp->chunk);
-#line 809
+#line 793
size_t nput = ncx_howmany(varp->type, extent);
-#line 809
+#line 793
-#line 809
+#line 793
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 809
+#line 793
RGN_WRITE, &xp);
-#line 809
+#line 793
if(lstatus != NC_NOERR)
-#line 809
+#line 793
return lstatus;
-#line 809
+#line 793
-#line 809
+#line 793
lstatus = ncx_putn_ulonglong_schar(&xp, nput, value ,fillp);
-#line 809
+#line 793
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 809
+#line 793
{
-#line 809
+#line 793
/* not fatal to the loop */
-#line 809
+#line 793
status = lstatus;
-#line 809
+#line 793
}
-#line 809
+#line 793
-#line 809
+#line 793
(void) ncio_rel(ncp->nciop, offset,
-#line 809
+#line 793
RGN_MODIFIED);
-#line 809
+#line 793
-#line 809
+#line 793
remaining -= extent;
-#line 809
+#line 793
if(remaining == 0)
-#line 809
+#line 793
break; /* normal loop exit */
-#line 809
+#line 793
offset += (off_t)extent;
-#line 809
+#line 793
value += nput;
-#line 809
+#line 793
-#line 809
+#line 793
}
-#line 809
+#line 793
#ifdef ERANGE_FILL
-#line 809
+#line 793
free(fillp);
-#line 809
+#line 793
#endif
-#line 809
+#line 793
-#line 809
+#line 793
return status;
-#line 809
+#line 793
}
-#line 809
+#line 793
static int
-#line 810
+#line 794
putNCvx_ulonglong_uchar(NC3_INFO* ncp, const NC_var *varp,
-#line 810
+#line 794
const size_t *start, size_t nelems, const uchar *value)
-#line 810
+#line 794
{
-#line 810
+#line 794
off_t offset = NC_varoffset(ncp, varp, start);
-#line 810
+#line 794
size_t remaining = varp->xsz * nelems;
-#line 810
+#line 794
int status = NC_NOERR;
-#line 810
+#line 794
void *xp;
-#line 810
+#line 794
void *fillp=NULL;
-#line 810
+#line 794
-#line 810
+#line 794
if(nelems == 0)
-#line 810
+#line 794
return NC_NOERR;
-#line 810
+#line 794
-#line 810
+#line 794
assert(value != NULL);
-#line 810
+#line 794
-#line 810
+#line 794
#ifdef ERANGE_FILL
-#line 810
+#line 794
fillp = malloc(varp->xsz);
-#line 810
+#line 794
status = NC3_inq_var_fill(varp, fillp);
-#line 810
+#line 794
#endif
-#line 810
+#line 794
-#line 810
+#line 794
for(;;)
-#line 810
+#line 794
{
-#line 810
+#line 794
size_t extent = MIN(remaining, ncp->chunk);
-#line 810
+#line 794
size_t nput = ncx_howmany(varp->type, extent);
-#line 810
+#line 794
-#line 810
+#line 794
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 810
+#line 794
RGN_WRITE, &xp);
-#line 810
+#line 794
if(lstatus != NC_NOERR)
-#line 810
+#line 794
return lstatus;
-#line 810
+#line 794
-#line 810
+#line 794
lstatus = ncx_putn_ulonglong_uchar(&xp, nput, value ,fillp);
-#line 810
+#line 794
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 810
+#line 794
{
-#line 810
+#line 794
/* not fatal to the loop */
-#line 810
+#line 794
status = lstatus;
-#line 810
+#line 794
}
-#line 810
+#line 794
-#line 810
+#line 794
(void) ncio_rel(ncp->nciop, offset,
-#line 810
+#line 794
RGN_MODIFIED);
-#line 810
+#line 794
-#line 810
+#line 794
remaining -= extent;
-#line 810
+#line 794
if(remaining == 0)
-#line 810
+#line 794
break; /* normal loop exit */
-#line 810
+#line 794
offset += (off_t)extent;
-#line 810
+#line 794
value += nput;
-#line 810
+#line 794
-#line 810
+#line 794
}
-#line 810
+#line 794
#ifdef ERANGE_FILL
-#line 810
+#line 794
free(fillp);
-#line 810
+#line 794
#endif
-#line 810
+#line 794
-#line 810
+#line 794
return status;
-#line 810
+#line 794
}
-#line 810
+#line 794
static int
-#line 811
+#line 795
putNCvx_ulonglong_short(NC3_INFO* ncp, const NC_var *varp,
-#line 811
+#line 795
const size_t *start, size_t nelems, const short *value)
-#line 811
+#line 795
{
-#line 811
+#line 795
off_t offset = NC_varoffset(ncp, varp, start);
-#line 811
+#line 795
size_t remaining = varp->xsz * nelems;
-#line 811
+#line 795
int status = NC_NOERR;
-#line 811
+#line 795
void *xp;
-#line 811
+#line 795
void *fillp=NULL;
-#line 811
+#line 795
-#line 811
+#line 795
if(nelems == 0)
-#line 811
+#line 795
return NC_NOERR;
-#line 811
+#line 795
-#line 811
+#line 795
assert(value != NULL);
-#line 811
+#line 795
-#line 811
+#line 795
#ifdef ERANGE_FILL
-#line 811
+#line 795
fillp = malloc(varp->xsz);
-#line 811
+#line 795
status = NC3_inq_var_fill(varp, fillp);
-#line 811
+#line 795
#endif
-#line 811
+#line 795
-#line 811
+#line 795
for(;;)
-#line 811
+#line 795
{
-#line 811
+#line 795
size_t extent = MIN(remaining, ncp->chunk);
-#line 811
+#line 795
size_t nput = ncx_howmany(varp->type, extent);
-#line 811
+#line 795
-#line 811
+#line 795
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 811
+#line 795
RGN_WRITE, &xp);
-#line 811
+#line 795
if(lstatus != NC_NOERR)
-#line 811
+#line 795
return lstatus;
-#line 811
+#line 795
-#line 811
+#line 795
lstatus = ncx_putn_ulonglong_short(&xp, nput, value ,fillp);
-#line 811
+#line 795
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 811
+#line 795
{
-#line 811
+#line 795
/* not fatal to the loop */
-#line 811
+#line 795
status = lstatus;
-#line 811
+#line 795
}
-#line 811
+#line 795
-#line 811
+#line 795
(void) ncio_rel(ncp->nciop, offset,
-#line 811
+#line 795
RGN_MODIFIED);
-#line 811
+#line 795
-#line 811
+#line 795
remaining -= extent;
-#line 811
+#line 795
if(remaining == 0)
-#line 811
+#line 795
break; /* normal loop exit */
-#line 811
+#line 795
offset += (off_t)extent;
-#line 811
+#line 795
value += nput;
-#line 811
+#line 795
-#line 811
+#line 795
}
-#line 811
+#line 795
#ifdef ERANGE_FILL
-#line 811
+#line 795
free(fillp);
-#line 811
+#line 795
#endif
-#line 811
+#line 795
-#line 811
+#line 795
return status;
-#line 811
+#line 795
}
-#line 811
+#line 795
static int
-#line 812
+#line 796
putNCvx_ulonglong_int(NC3_INFO* ncp, const NC_var *varp,
-#line 812
+#line 796
const size_t *start, size_t nelems, const int *value)
-#line 812
+#line 796
{
-#line 812
+#line 796
off_t offset = NC_varoffset(ncp, varp, start);
-#line 812
+#line 796
size_t remaining = varp->xsz * nelems;
-#line 812
+#line 796
int status = NC_NOERR;
-#line 812
+#line 796
void *xp;
-#line 812
+#line 796
void *fillp=NULL;
-#line 812
+#line 796
-#line 812
+#line 796
if(nelems == 0)
-#line 812
+#line 796
return NC_NOERR;
-#line 812
+#line 796
-#line 812
+#line 796
assert(value != NULL);
-#line 812
+#line 796
-#line 812
+#line 796
#ifdef ERANGE_FILL
-#line 812
+#line 796
fillp = malloc(varp->xsz);
-#line 812
+#line 796
status = NC3_inq_var_fill(varp, fillp);
-#line 812
+#line 796
#endif
-#line 812
+#line 796
-#line 812
+#line 796
for(;;)
-#line 812
+#line 796
{
-#line 812
+#line 796
size_t extent = MIN(remaining, ncp->chunk);
-#line 812
+#line 796
size_t nput = ncx_howmany(varp->type, extent);
-#line 812
+#line 796
-#line 812
+#line 796
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 812
+#line 796
RGN_WRITE, &xp);
-#line 812
+#line 796
if(lstatus != NC_NOERR)
-#line 812
+#line 796
return lstatus;
-#line 812
+#line 796
-#line 812
+#line 796
lstatus = ncx_putn_ulonglong_int(&xp, nput, value ,fillp);
-#line 812
+#line 796
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 812
+#line 796
{
-#line 812
+#line 796
/* not fatal to the loop */
-#line 812
+#line 796
status = lstatus;
-#line 812
+#line 796
}
-#line 812
+#line 796
-#line 812
+#line 796
(void) ncio_rel(ncp->nciop, offset,
-#line 812
+#line 796
RGN_MODIFIED);
-#line 812
+#line 796
-#line 812
+#line 796
remaining -= extent;
-#line 812
+#line 796
if(remaining == 0)
-#line 812
+#line 796
break; /* normal loop exit */
-#line 812
+#line 796
offset += (off_t)extent;
-#line 812
+#line 796
value += nput;
-#line 812
+#line 796
-#line 812
+#line 796
}
-#line 812
+#line 796
#ifdef ERANGE_FILL
-#line 812
+#line 796
free(fillp);
-#line 812
+#line 796
#endif
-#line 812
+#line 796
-#line 812
+#line 796
return status;
-#line 812
+#line 796
}
-#line 812
+#line 796
static int
-#line 813
+#line 797
putNCvx_ulonglong_float(NC3_INFO* ncp, const NC_var *varp,
-#line 813
+#line 797
const size_t *start, size_t nelems, const float *value)
-#line 813
+#line 797
{
-#line 813
+#line 797
off_t offset = NC_varoffset(ncp, varp, start);
-#line 813
+#line 797
size_t remaining = varp->xsz * nelems;
-#line 813
+#line 797
int status = NC_NOERR;
-#line 813
+#line 797
void *xp;
-#line 813
+#line 797
void *fillp=NULL;
-#line 813
+#line 797
-#line 813
+#line 797
if(nelems == 0)
-#line 813
+#line 797
return NC_NOERR;
-#line 813
+#line 797
-#line 813
+#line 797
assert(value != NULL);
-#line 813
+#line 797
-#line 813
+#line 797
#ifdef ERANGE_FILL
-#line 813
+#line 797
fillp = malloc(varp->xsz);
-#line 813
+#line 797
status = NC3_inq_var_fill(varp, fillp);
-#line 813
+#line 797
#endif
-#line 813
+#line 797
-#line 813
+#line 797
for(;;)
-#line 813
+#line 797
{
-#line 813
+#line 797
size_t extent = MIN(remaining, ncp->chunk);
-#line 813
+#line 797
size_t nput = ncx_howmany(varp->type, extent);
-#line 813
+#line 797
-#line 813
+#line 797
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 813
+#line 797
RGN_WRITE, &xp);
-#line 813
+#line 797
if(lstatus != NC_NOERR)
-#line 813
+#line 797
return lstatus;
-#line 813
+#line 797
-#line 813
+#line 797
lstatus = ncx_putn_ulonglong_float(&xp, nput, value ,fillp);
-#line 813
+#line 797
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 813
+#line 797
{
-#line 813
+#line 797
/* not fatal to the loop */
-#line 813
+#line 797
status = lstatus;
-#line 813
+#line 797
}
-#line 813
+#line 797
-#line 813
+#line 797
(void) ncio_rel(ncp->nciop, offset,
-#line 813
+#line 797
RGN_MODIFIED);
-#line 813
+#line 797
-#line 813
+#line 797
remaining -= extent;
-#line 813
+#line 797
if(remaining == 0)
-#line 813
+#line 797
break; /* normal loop exit */
-#line 813
+#line 797
offset += (off_t)extent;
-#line 813
+#line 797
value += nput;
-#line 813
+#line 797
-#line 813
+#line 797
}
-#line 813
+#line 797
#ifdef ERANGE_FILL
-#line 813
+#line 797
free(fillp);
-#line 813
+#line 797
#endif
-#line 813
+#line 797
-#line 813
+#line 797
return status;
-#line 813
+#line 797
}
-#line 813
+#line 797
static int
-#line 814
+#line 798
putNCvx_ulonglong_double(NC3_INFO* ncp, const NC_var *varp,
-#line 814
+#line 798
const size_t *start, size_t nelems, const double *value)
-#line 814
+#line 798
{
-#line 814
+#line 798
off_t offset = NC_varoffset(ncp, varp, start);
-#line 814
+#line 798
size_t remaining = varp->xsz * nelems;
-#line 814
+#line 798
int status = NC_NOERR;
-#line 814
+#line 798
void *xp;
-#line 814
+#line 798
void *fillp=NULL;
-#line 814
+#line 798
-#line 814
+#line 798
if(nelems == 0)
-#line 814
+#line 798
return NC_NOERR;
-#line 814
+#line 798
-#line 814
+#line 798
assert(value != NULL);
-#line 814
+#line 798
-#line 814
+#line 798
#ifdef ERANGE_FILL
-#line 814
+#line 798
fillp = malloc(varp->xsz);
-#line 814
+#line 798
status = NC3_inq_var_fill(varp, fillp);
-#line 814
+#line 798
#endif
-#line 814
+#line 798
-#line 814
+#line 798
for(;;)
-#line 814
+#line 798
{
-#line 814
+#line 798
size_t extent = MIN(remaining, ncp->chunk);
-#line 814
+#line 798
size_t nput = ncx_howmany(varp->type, extent);
-#line 814
+#line 798
-#line 814
+#line 798
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 814
+#line 798
RGN_WRITE, &xp);
-#line 814
+#line 798
if(lstatus != NC_NOERR)
-#line 814
+#line 798
return lstatus;
-#line 814
+#line 798
-#line 814
+#line 798
lstatus = ncx_putn_ulonglong_double(&xp, nput, value ,fillp);
-#line 814
+#line 798
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 814
+#line 798
{
-#line 814
+#line 798
/* not fatal to the loop */
-#line 814
+#line 798
status = lstatus;
-#line 814
+#line 798
}
-#line 814
+#line 798
-#line 814
+#line 798
(void) ncio_rel(ncp->nciop, offset,
-#line 814
+#line 798
RGN_MODIFIED);
-#line 814
+#line 798
-#line 814
+#line 798
remaining -= extent;
-#line 814
+#line 798
if(remaining == 0)
-#line 814
+#line 798
break; /* normal loop exit */
-#line 814
+#line 798
offset += (off_t)extent;
-#line 814
+#line 798
value += nput;
-#line 814
+#line 798
-#line 814
+#line 798
}
-#line 814
+#line 798
#ifdef ERANGE_FILL
-#line 814
+#line 798
free(fillp);
-#line 814
+#line 798
#endif
-#line 814
+#line 798
-#line 814
+#line 798
return status;
-#line 814
+#line 798
}
-#line 814
+#line 798
static int
-#line 815
+#line 799
putNCvx_ulonglong_longlong(NC3_INFO* ncp, const NC_var *varp,
-#line 815
+#line 799
const size_t *start, size_t nelems, const longlong *value)
-#line 815
+#line 799
{
-#line 815
+#line 799
off_t offset = NC_varoffset(ncp, varp, start);
-#line 815
+#line 799
size_t remaining = varp->xsz * nelems;
-#line 815
+#line 799
int status = NC_NOERR;
-#line 815
+#line 799
void *xp;
-#line 815
+#line 799
void *fillp=NULL;
-#line 815
+#line 799
-#line 815
+#line 799
if(nelems == 0)
-#line 815
+#line 799
return NC_NOERR;
-#line 815
+#line 799
-#line 815
+#line 799
assert(value != NULL);
-#line 815
+#line 799
-#line 815
+#line 799
#ifdef ERANGE_FILL
-#line 815
+#line 799
fillp = malloc(varp->xsz);
-#line 815
+#line 799
status = NC3_inq_var_fill(varp, fillp);
-#line 815
+#line 799
#endif
-#line 815
+#line 799
-#line 815
+#line 799
for(;;)
-#line 815
+#line 799
{
-#line 815
+#line 799
size_t extent = MIN(remaining, ncp->chunk);
-#line 815
+#line 799
size_t nput = ncx_howmany(varp->type, extent);
-#line 815
+#line 799
-#line 815
+#line 799
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 815
+#line 799
RGN_WRITE, &xp);
-#line 815
+#line 799
if(lstatus != NC_NOERR)
-#line 815
+#line 799
return lstatus;
-#line 815
+#line 799
-#line 815
+#line 799
lstatus = ncx_putn_ulonglong_longlong(&xp, nput, value ,fillp);
-#line 815
+#line 799
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 815
+#line 799
{
-#line 815
+#line 799
/* not fatal to the loop */
-#line 815
+#line 799
status = lstatus;
-#line 815
+#line 799
}
-#line 815
+#line 799
-#line 815
+#line 799
(void) ncio_rel(ncp->nciop, offset,
-#line 815
+#line 799
RGN_MODIFIED);
-#line 815
+#line 799
-#line 815
+#line 799
remaining -= extent;
-#line 815
+#line 799
if(remaining == 0)
-#line 815
+#line 799
break; /* normal loop exit */
-#line 815
+#line 799
offset += (off_t)extent;
-#line 815
+#line 799
value += nput;
-#line 815
+#line 799
-#line 815
+#line 799
}
-#line 815
+#line 799
#ifdef ERANGE_FILL
-#line 815
+#line 799
free(fillp);
-#line 815
+#line 799
#endif
-#line 815
+#line 799
-#line 815
+#line 799
return status;
-#line 815
+#line 799
}
-#line 815
+#line 799
static int
-#line 816
+#line 800
putNCvx_ulonglong_ushort(NC3_INFO* ncp, const NC_var *varp,
-#line 816
+#line 800
const size_t *start, size_t nelems, const ushort *value)
-#line 816
+#line 800
{
-#line 816
+#line 800
off_t offset = NC_varoffset(ncp, varp, start);
-#line 816
+#line 800
size_t remaining = varp->xsz * nelems;
-#line 816
+#line 800
int status = NC_NOERR;
-#line 816
+#line 800
void *xp;
-#line 816
+#line 800
void *fillp=NULL;
-#line 816
+#line 800
-#line 816
+#line 800
if(nelems == 0)
-#line 816
+#line 800
return NC_NOERR;
-#line 816
+#line 800
-#line 816
+#line 800
assert(value != NULL);
-#line 816
+#line 800
-#line 816
+#line 800
#ifdef ERANGE_FILL
-#line 816
+#line 800
fillp = malloc(varp->xsz);
-#line 816
+#line 800
status = NC3_inq_var_fill(varp, fillp);
-#line 816
+#line 800
#endif
-#line 816
+#line 800
-#line 816
+#line 800
for(;;)
-#line 816
+#line 800
{
-#line 816
+#line 800
size_t extent = MIN(remaining, ncp->chunk);
-#line 816
+#line 800
size_t nput = ncx_howmany(varp->type, extent);
-#line 816
+#line 800
-#line 816
+#line 800
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 816
+#line 800
RGN_WRITE, &xp);
-#line 816
+#line 800
if(lstatus != NC_NOERR)
-#line 816
+#line 800
return lstatus;
-#line 816
+#line 800
-#line 816
+#line 800
lstatus = ncx_putn_ulonglong_ushort(&xp, nput, value ,fillp);
-#line 816
+#line 800
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 816
+#line 800
{
-#line 816
+#line 800
/* not fatal to the loop */
-#line 816
+#line 800
status = lstatus;
-#line 816
+#line 800
}
-#line 816
+#line 800
-#line 816
+#line 800
(void) ncio_rel(ncp->nciop, offset,
-#line 816
+#line 800
RGN_MODIFIED);
-#line 816
+#line 800
-#line 816
+#line 800
remaining -= extent;
-#line 816
+#line 800
if(remaining == 0)
-#line 816
+#line 800
break; /* normal loop exit */
-#line 816
+#line 800
offset += (off_t)extent;
-#line 816
+#line 800
value += nput;
-#line 816
+#line 800
-#line 816
+#line 800
}
-#line 816
+#line 800
#ifdef ERANGE_FILL
-#line 816
+#line 800
free(fillp);
-#line 816
+#line 800
#endif
-#line 816
+#line 800
-#line 816
+#line 800
return status;
-#line 816
+#line 800
}
-#line 816
+#line 800
static int
-#line 817
+#line 801
putNCvx_ulonglong_uint(NC3_INFO* ncp, const NC_var *varp,
-#line 817
+#line 801
const size_t *start, size_t nelems, const uint *value)
-#line 817
+#line 801
{
-#line 817
+#line 801
off_t offset = NC_varoffset(ncp, varp, start);
-#line 817
+#line 801
size_t remaining = varp->xsz * nelems;
-#line 817
+#line 801
int status = NC_NOERR;
-#line 817
+#line 801
void *xp;
-#line 817
+#line 801
void *fillp=NULL;
-#line 817
+#line 801
-#line 817
+#line 801
if(nelems == 0)
-#line 817
+#line 801
return NC_NOERR;
-#line 817
+#line 801
-#line 817
+#line 801
assert(value != NULL);
-#line 817
+#line 801
-#line 817
+#line 801
#ifdef ERANGE_FILL
-#line 817
+#line 801
fillp = malloc(varp->xsz);
-#line 817
+#line 801
status = NC3_inq_var_fill(varp, fillp);
-#line 817
+#line 801
#endif
-#line 817
+#line 801
-#line 817
+#line 801
for(;;)
-#line 817
+#line 801
{
-#line 817
+#line 801
size_t extent = MIN(remaining, ncp->chunk);
-#line 817
+#line 801
size_t nput = ncx_howmany(varp->type, extent);
-#line 817
+#line 801
-#line 817
+#line 801
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 817
+#line 801
RGN_WRITE, &xp);
-#line 817
+#line 801
if(lstatus != NC_NOERR)
-#line 817
+#line 801
return lstatus;
-#line 817
+#line 801
-#line 817
+#line 801
lstatus = ncx_putn_ulonglong_uint(&xp, nput, value ,fillp);
-#line 817
+#line 801
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 817
+#line 801
{
-#line 817
+#line 801
/* not fatal to the loop */
-#line 817
+#line 801
status = lstatus;
-#line 817
+#line 801
}
-#line 817
+#line 801
-#line 817
+#line 801
(void) ncio_rel(ncp->nciop, offset,
-#line 817
+#line 801
RGN_MODIFIED);
-#line 817
+#line 801
-#line 817
+#line 801
remaining -= extent;
-#line 817
+#line 801
if(remaining == 0)
-#line 817
+#line 801
break; /* normal loop exit */
-#line 817
+#line 801
offset += (off_t)extent;
-#line 817
+#line 801
value += nput;
-#line 817
+#line 801
-#line 817
+#line 801
}
-#line 817
+#line 801
#ifdef ERANGE_FILL
-#line 817
+#line 801
free(fillp);
-#line 817
+#line 801
#endif
-#line 817
+#line 801
-#line 817
+#line 801
return status;
-#line 817
+#line 801
}
-#line 817
+#line 801
static int
-#line 818
+#line 802
putNCvx_ulonglong_ulonglong(NC3_INFO* ncp, const NC_var *varp,
-#line 818
+#line 802
const size_t *start, size_t nelems, const ulonglong *value)
-#line 818
+#line 802
{
-#line 818
+#line 802
off_t offset = NC_varoffset(ncp, varp, start);
-#line 818
+#line 802
size_t remaining = varp->xsz * nelems;
-#line 818
+#line 802
int status = NC_NOERR;
-#line 818
+#line 802
void *xp;
-#line 818
+#line 802
void *fillp=NULL;
-#line 818
+#line 802
-#line 818
+#line 802
if(nelems == 0)
-#line 818
+#line 802
return NC_NOERR;
-#line 818
+#line 802
-#line 818
+#line 802
assert(value != NULL);
-#line 818
+#line 802
-#line 818
+#line 802
#ifdef ERANGE_FILL
-#line 818
+#line 802
fillp = malloc(varp->xsz);
-#line 818
+#line 802
status = NC3_inq_var_fill(varp, fillp);
-#line 818
+#line 802
#endif
-#line 818
+#line 802
-#line 818
+#line 802
for(;;)
-#line 818
+#line 802
{
-#line 818
+#line 802
size_t extent = MIN(remaining, ncp->chunk);
-#line 818
+#line 802
size_t nput = ncx_howmany(varp->type, extent);
-#line 818
+#line 802
-#line 818
+#line 802
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 818
+#line 802
RGN_WRITE, &xp);
-#line 818
+#line 802
if(lstatus != NC_NOERR)
-#line 818
+#line 802
return lstatus;
-#line 818
+#line 802
-#line 818
+#line 802
lstatus = ncx_putn_ulonglong_ulonglong(&xp, nput, value ,fillp);
-#line 818
+#line 802
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 818
+#line 802
{
-#line 818
+#line 802
/* not fatal to the loop */
-#line 818
+#line 802
status = lstatus;
-#line 818
+#line 802
}
-#line 818
+#line 802
-#line 818
+#line 802
(void) ncio_rel(ncp->nciop, offset,
-#line 818
+#line 802
RGN_MODIFIED);
-#line 818
+#line 802
-#line 818
+#line 802
remaining -= extent;
-#line 818
+#line 802
if(remaining == 0)
-#line 818
+#line 802
break; /* normal loop exit */
-#line 818
+#line 802
offset += (off_t)extent;
-#line 818
+#line 802
value += nput;
-#line 818
+#line 802
-#line 818
+#line 802
}
-#line 818
+#line 802
#ifdef ERANGE_FILL
-#line 818
+#line 802
free(fillp);
-#line 818
+#line 802
#endif
-#line 818
+#line 802
-#line 818
+#line 802
return status;
-#line 818
+#line 802
}
-#line 818
+#line 802
-#line 865
+#line 849
static int
-#line 866
+#line 850
getNCvx_char_char(const NC3_INFO* ncp, const NC_var *varp,
-#line 866
+#line 850
const size_t *start, size_t nelems, char *value)
-#line 866
+#line 850
{
-#line 866
+#line 850
off_t offset = NC_varoffset(ncp, varp, start);
-#line 866
+#line 850
size_t remaining = varp->xsz * nelems;
-#line 866
+#line 850
int status = NC_NOERR;
-#line 866
+#line 850
const void *xp;
-#line 866
+#line 850
-#line 866
+#line 850
if(nelems == 0)
-#line 866
+#line 850
return NC_NOERR;
-#line 866
+#line 850
-#line 866
+#line 850
assert(value != NULL);
-#line 866
+#line 850
-#line 866
+#line 850
for(;;)
-#line 866
+#line 850
{
-#line 866
+#line 850
size_t extent = MIN(remaining, ncp->chunk);
-#line 866
+#line 850
size_t nget = ncx_howmany(varp->type, extent);
-#line 866
+#line 850
-#line 866
+#line 850
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 866
+#line 850
0, (void **)&xp); /* cast away const */
-#line 866
+#line 850
if(lstatus != NC_NOERR)
-#line 866
+#line 850
return lstatus;
-#line 866
+#line 850
-#line 866
+#line 850
lstatus = ncx_getn_char_char(&xp, nget, value);
-#line 866
+#line 850
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 866
+#line 850
status = lstatus;
-#line 866
+#line 850
-#line 866
+#line 850
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 866
+#line 850
-#line 866
+#line 850
remaining -= extent;
-#line 866
+#line 850
if(remaining == 0)
-#line 866
+#line 850
break; /* normal loop exit */
-#line 866
+#line 850
offset += (off_t)extent;
-#line 866
+#line 850
value += nget;
-#line 866
+#line 850
}
-#line 866
+#line 850
-#line 866
+#line 850
return status;
-#line 866
+#line 850
}
-#line 866
+#line 850
static int
-#line 868
+#line 852
getNCvx_schar_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 868
+#line 852
const size_t *start, size_t nelems, schar *value)
-#line 868
+#line 852
{
-#line 868
+#line 852
off_t offset = NC_varoffset(ncp, varp, start);
-#line 868
+#line 852
size_t remaining = varp->xsz * nelems;
-#line 868
+#line 852
int status = NC_NOERR;
-#line 868
+#line 852
const void *xp;
-#line 868
+#line 852
-#line 868
+#line 852
if(nelems == 0)
-#line 868
+#line 852
return NC_NOERR;
-#line 868
+#line 852
-#line 868
+#line 852
assert(value != NULL);
-#line 868
+#line 852
-#line 868
+#line 852
for(;;)
-#line 868
+#line 852
{
-#line 868
+#line 852
size_t extent = MIN(remaining, ncp->chunk);
-#line 868
+#line 852
size_t nget = ncx_howmany(varp->type, extent);
-#line 868
+#line 852
-#line 868
+#line 852
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 868
+#line 852
0, (void **)&xp); /* cast away const */
-#line 868
+#line 852
if(lstatus != NC_NOERR)
-#line 868
+#line 852
return lstatus;
-#line 868
+#line 852
-#line 868
+#line 852
lstatus = ncx_getn_schar_schar(&xp, nget, value);
-#line 868
+#line 852
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 868
+#line 852
status = lstatus;
-#line 868
+#line 852
-#line 868
+#line 852
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 868
+#line 852
-#line 868
+#line 852
remaining -= extent;
-#line 868
+#line 852
if(remaining == 0)
-#line 868
+#line 852
break; /* normal loop exit */
-#line 868
+#line 852
offset += (off_t)extent;
-#line 868
+#line 852
value += nget;
-#line 868
+#line 852
}
-#line 868
+#line 852
-#line 868
+#line 852
return status;
-#line 868
+#line 852
}
-#line 868
+#line 852
static int
-#line 869
+#line 853
getNCvx_schar_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 869
+#line 853
const size_t *start, size_t nelems, short *value)
-#line 869
+#line 853
{
-#line 869
+#line 853
off_t offset = NC_varoffset(ncp, varp, start);
-#line 869
+#line 853
size_t remaining = varp->xsz * nelems;
-#line 869
+#line 853
int status = NC_NOERR;
-#line 869
+#line 853
const void *xp;
-#line 869
+#line 853
-#line 869
+#line 853
if(nelems == 0)
-#line 869
+#line 853
return NC_NOERR;
-#line 869
+#line 853
-#line 869
+#line 853
assert(value != NULL);
-#line 869
+#line 853
-#line 869
+#line 853
for(;;)
-#line 869
+#line 853
{
-#line 869
+#line 853
size_t extent = MIN(remaining, ncp->chunk);
-#line 869
+#line 853
size_t nget = ncx_howmany(varp->type, extent);
-#line 869
+#line 853
-#line 869
+#line 853
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 869
+#line 853
0, (void **)&xp); /* cast away const */
-#line 869
+#line 853
if(lstatus != NC_NOERR)
-#line 869
+#line 853
return lstatus;
-#line 869
+#line 853
-#line 869
+#line 853
lstatus = ncx_getn_schar_short(&xp, nget, value);
-#line 869
+#line 853
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 869
+#line 853
status = lstatus;
-#line 869
+#line 853
-#line 869
+#line 853
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 869
+#line 853
-#line 869
+#line 853
remaining -= extent;
-#line 869
+#line 853
if(remaining == 0)
-#line 869
+#line 853
break; /* normal loop exit */
-#line 869
+#line 853
offset += (off_t)extent;
-#line 869
+#line 853
value += nget;
-#line 869
+#line 853
}
-#line 869
+#line 853
-#line 869
+#line 853
return status;
-#line 869
+#line 853
}
-#line 869
+#line 853
static int
-#line 870
+#line 854
getNCvx_schar_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 870
+#line 854
const size_t *start, size_t nelems, int *value)
-#line 870
+#line 854
{
-#line 870
+#line 854
off_t offset = NC_varoffset(ncp, varp, start);
-#line 870
+#line 854
size_t remaining = varp->xsz * nelems;
-#line 870
+#line 854
int status = NC_NOERR;
-#line 870
+#line 854
const void *xp;
-#line 870
+#line 854
-#line 870
+#line 854
if(nelems == 0)
-#line 870
+#line 854
return NC_NOERR;
-#line 870
+#line 854
-#line 870
+#line 854
assert(value != NULL);
-#line 870
+#line 854
-#line 870
+#line 854
for(;;)
-#line 870
+#line 854
{
-#line 870
+#line 854
size_t extent = MIN(remaining, ncp->chunk);
-#line 870
+#line 854
size_t nget = ncx_howmany(varp->type, extent);
-#line 870
+#line 854
-#line 870
+#line 854
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 870
+#line 854
0, (void **)&xp); /* cast away const */
-#line 870
+#line 854
if(lstatus != NC_NOERR)
-#line 870
+#line 854
return lstatus;
-#line 870
+#line 854
-#line 870
+#line 854
lstatus = ncx_getn_schar_int(&xp, nget, value);
-#line 870
+#line 854
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 870
+#line 854
status = lstatus;
-#line 870
+#line 854
-#line 870
+#line 854
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 870
+#line 854
-#line 870
+#line 854
remaining -= extent;
-#line 870
+#line 854
if(remaining == 0)
-#line 870
+#line 854
break; /* normal loop exit */
-#line 870
+#line 854
offset += (off_t)extent;
-#line 870
+#line 854
value += nget;
-#line 870
+#line 854
}
-#line 870
+#line 854
-#line 870
+#line 854
return status;
-#line 870
+#line 854
}
-#line 870
+#line 854
static int
-#line 871
+#line 855
getNCvx_schar_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 871
+#line 855
const size_t *start, size_t nelems, float *value)
-#line 871
+#line 855
{
-#line 871
+#line 855
off_t offset = NC_varoffset(ncp, varp, start);
-#line 871
+#line 855
size_t remaining = varp->xsz * nelems;
-#line 871
+#line 855
int status = NC_NOERR;
-#line 871
+#line 855
const void *xp;
-#line 871
+#line 855
-#line 871
+#line 855
if(nelems == 0)
-#line 871
+#line 855
return NC_NOERR;
-#line 871
+#line 855
-#line 871
+#line 855
assert(value != NULL);
-#line 871
+#line 855
-#line 871
+#line 855
for(;;)
-#line 871
+#line 855
{
-#line 871
+#line 855
size_t extent = MIN(remaining, ncp->chunk);
-#line 871
+#line 855
size_t nget = ncx_howmany(varp->type, extent);
-#line 871
+#line 855
-#line 871
+#line 855
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 871
+#line 855
0, (void **)&xp); /* cast away const */
-#line 871
+#line 855
if(lstatus != NC_NOERR)
-#line 871
+#line 855
return lstatus;
-#line 871
+#line 855
-#line 871
+#line 855
lstatus = ncx_getn_schar_float(&xp, nget, value);
-#line 871
+#line 855
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 871
+#line 855
status = lstatus;
-#line 871
+#line 855
-#line 871
+#line 855
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 871
+#line 855
-#line 871
+#line 855
remaining -= extent;
-#line 871
+#line 855
if(remaining == 0)
-#line 871
+#line 855
break; /* normal loop exit */
-#line 871
+#line 855
offset += (off_t)extent;
-#line 871
+#line 855
value += nget;
-#line 871
+#line 855
}
-#line 871
+#line 855
-#line 871
+#line 855
return status;
-#line 871
+#line 855
}
-#line 871
+#line 855
static int
-#line 872
+#line 856
getNCvx_schar_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 872
+#line 856
const size_t *start, size_t nelems, double *value)
-#line 872
+#line 856
{
-#line 872
+#line 856
off_t offset = NC_varoffset(ncp, varp, start);
-#line 872
+#line 856
size_t remaining = varp->xsz * nelems;
-#line 872
+#line 856
int status = NC_NOERR;
-#line 872
+#line 856
const void *xp;
-#line 872
+#line 856
-#line 872
+#line 856
if(nelems == 0)
-#line 872
+#line 856
return NC_NOERR;
-#line 872
+#line 856
-#line 872
+#line 856
assert(value != NULL);
-#line 872
+#line 856
-#line 872
+#line 856
for(;;)
-#line 872
+#line 856
{
-#line 872
+#line 856
size_t extent = MIN(remaining, ncp->chunk);
-#line 872
+#line 856
size_t nget = ncx_howmany(varp->type, extent);
-#line 872
+#line 856
-#line 872
+#line 856
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 872
+#line 856
0, (void **)&xp); /* cast away const */
-#line 872
+#line 856
if(lstatus != NC_NOERR)
-#line 872
+#line 856
return lstatus;
-#line 872
+#line 856
-#line 872
+#line 856
lstatus = ncx_getn_schar_double(&xp, nget, value);
-#line 872
+#line 856
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 872
+#line 856
status = lstatus;
-#line 872
+#line 856
-#line 872
+#line 856
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 872
+#line 856
-#line 872
+#line 856
remaining -= extent;
-#line 872
+#line 856
if(remaining == 0)
-#line 872
+#line 856
break; /* normal loop exit */
-#line 872
+#line 856
offset += (off_t)extent;
-#line 872
+#line 856
value += nget;
-#line 872
+#line 856
}
-#line 872
+#line 856
-#line 872
+#line 856
return status;
-#line 872
+#line 856
}
-#line 872
+#line 856
static int
-#line 873
+#line 857
getNCvx_schar_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 873
+#line 857
const size_t *start, size_t nelems, longlong *value)
-#line 873
+#line 857
{
-#line 873
+#line 857
off_t offset = NC_varoffset(ncp, varp, start);
-#line 873
+#line 857
size_t remaining = varp->xsz * nelems;
-#line 873
+#line 857
int status = NC_NOERR;
-#line 873
+#line 857
const void *xp;
-#line 873
+#line 857
-#line 873
+#line 857
if(nelems == 0)
-#line 873
+#line 857
return NC_NOERR;
-#line 873
+#line 857
-#line 873
+#line 857
assert(value != NULL);
-#line 873
+#line 857
-#line 873
+#line 857
for(;;)
-#line 873
+#line 857
{
-#line 873
+#line 857
size_t extent = MIN(remaining, ncp->chunk);
-#line 873
+#line 857
size_t nget = ncx_howmany(varp->type, extent);
-#line 873
+#line 857
-#line 873
+#line 857
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 873
+#line 857
0, (void **)&xp); /* cast away const */
-#line 873
+#line 857
if(lstatus != NC_NOERR)
-#line 873
+#line 857
return lstatus;
-#line 873
+#line 857
-#line 873
+#line 857
lstatus = ncx_getn_schar_longlong(&xp, nget, value);
-#line 873
+#line 857
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 873
+#line 857
status = lstatus;
-#line 873
+#line 857
-#line 873
+#line 857
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 873
+#line 857
-#line 873
+#line 857
remaining -= extent;
-#line 873
+#line 857
if(remaining == 0)
-#line 873
+#line 857
break; /* normal loop exit */
-#line 873
+#line 857
offset += (off_t)extent;
-#line 873
+#line 857
value += nget;
-#line 873
+#line 857
}
-#line 873
+#line 857
-#line 873
+#line 857
return status;
-#line 873
+#line 857
}
-#line 873
+#line 857
static int
-#line 874
+#line 858
getNCvx_schar_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 874
+#line 858
const size_t *start, size_t nelems, uint *value)
-#line 874
+#line 858
{
-#line 874
+#line 858
off_t offset = NC_varoffset(ncp, varp, start);
-#line 874
+#line 858
size_t remaining = varp->xsz * nelems;
-#line 874
+#line 858
int status = NC_NOERR;
-#line 874
+#line 858
const void *xp;
-#line 874
+#line 858
-#line 874
+#line 858
if(nelems == 0)
-#line 874
+#line 858
return NC_NOERR;
-#line 874
+#line 858
-#line 874
+#line 858
assert(value != NULL);
-#line 874
+#line 858
-#line 874
+#line 858
for(;;)
-#line 874
+#line 858
{
-#line 874
+#line 858
size_t extent = MIN(remaining, ncp->chunk);
-#line 874
+#line 858
size_t nget = ncx_howmany(varp->type, extent);
-#line 874
+#line 858
-#line 874
+#line 858
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 874
+#line 858
0, (void **)&xp); /* cast away const */
-#line 874
+#line 858
if(lstatus != NC_NOERR)
-#line 874
+#line 858
return lstatus;
-#line 874
+#line 858
-#line 874
+#line 858
lstatus = ncx_getn_schar_uint(&xp, nget, value);
-#line 874
+#line 858
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 874
+#line 858
status = lstatus;
-#line 874
+#line 858
-#line 874
+#line 858
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 874
+#line 858
-#line 874
+#line 858
remaining -= extent;
-#line 874
+#line 858
if(remaining == 0)
-#line 874
+#line 858
break; /* normal loop exit */
-#line 874
+#line 858
offset += (off_t)extent;
-#line 874
+#line 858
value += nget;
-#line 874
+#line 858
}
-#line 874
+#line 858
-#line 874
+#line 858
return status;
-#line 874
+#line 858
}
-#line 874
+#line 858
static int
-#line 875
+#line 859
getNCvx_schar_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 875
+#line 859
const size_t *start, size_t nelems, ulonglong *value)
-#line 875
+#line 859
{
-#line 875
+#line 859
off_t offset = NC_varoffset(ncp, varp, start);
-#line 875
+#line 859
size_t remaining = varp->xsz * nelems;
-#line 875
+#line 859
int status = NC_NOERR;
-#line 875
+#line 859
const void *xp;
-#line 875
+#line 859
-#line 875
+#line 859
if(nelems == 0)
-#line 875
+#line 859
return NC_NOERR;
-#line 875
+#line 859
-#line 875
+#line 859
assert(value != NULL);
-#line 875
+#line 859
-#line 875
+#line 859
for(;;)
-#line 875
+#line 859
{
-#line 875
+#line 859
size_t extent = MIN(remaining, ncp->chunk);
-#line 875
+#line 859
size_t nget = ncx_howmany(varp->type, extent);
-#line 875
+#line 859
-#line 875
+#line 859
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 875
+#line 859
0, (void **)&xp); /* cast away const */
-#line 875
+#line 859
if(lstatus != NC_NOERR)
-#line 875
+#line 859
return lstatus;
-#line 875
+#line 859
-#line 875
+#line 859
lstatus = ncx_getn_schar_ulonglong(&xp, nget, value);
-#line 875
+#line 859
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 875
+#line 859
status = lstatus;
-#line 875
+#line 859
-#line 875
+#line 859
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 875
+#line 859
-#line 875
+#line 859
remaining -= extent;
-#line 875
+#line 859
if(remaining == 0)
-#line 875
+#line 859
break; /* normal loop exit */
-#line 875
+#line 859
offset += (off_t)extent;
-#line 875
+#line 859
value += nget;
-#line 875
+#line 859
}
-#line 875
+#line 859
-#line 875
+#line 859
return status;
-#line 875
+#line 859
}
-#line 875
+#line 859
static int
-#line 876
+#line 860
getNCvx_schar_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 876
+#line 860
const size_t *start, size_t nelems, uchar *value)
-#line 876
+#line 860
{
-#line 876
+#line 860
off_t offset = NC_varoffset(ncp, varp, start);
-#line 876
+#line 860
size_t remaining = varp->xsz * nelems;
-#line 876
+#line 860
int status = NC_NOERR;
-#line 876
+#line 860
const void *xp;
-#line 876
+#line 860
-#line 876
+#line 860
if(nelems == 0)
-#line 876
+#line 860
return NC_NOERR;
-#line 876
+#line 860
-#line 876
+#line 860
assert(value != NULL);
-#line 876
+#line 860
-#line 876
+#line 860
for(;;)
-#line 876
+#line 860
{
-#line 876
+#line 860
size_t extent = MIN(remaining, ncp->chunk);
-#line 876
+#line 860
size_t nget = ncx_howmany(varp->type, extent);
-#line 876
+#line 860
-#line 876
+#line 860
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 876
+#line 860
0, (void **)&xp); /* cast away const */
-#line 876
+#line 860
if(lstatus != NC_NOERR)
-#line 876
+#line 860
return lstatus;
-#line 876
+#line 860
-#line 876
+#line 860
lstatus = ncx_getn_schar_uchar(&xp, nget, value);
-#line 876
+#line 860
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 876
+#line 860
status = lstatus;
-#line 876
+#line 860
-#line 876
+#line 860
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 876
+#line 860
-#line 876
+#line 860
remaining -= extent;
-#line 876
+#line 860
if(remaining == 0)
-#line 876
+#line 860
break; /* normal loop exit */
-#line 876
+#line 860
offset += (off_t)extent;
-#line 876
+#line 860
value += nget;
-#line 876
+#line 860
}
-#line 876
+#line 860
-#line 876
+#line 860
return status;
-#line 876
+#line 860
}
-#line 876
+#line 860
static int
-#line 877
+#line 861
getNCvx_schar_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 877
+#line 861
const size_t *start, size_t nelems, ushort *value)
-#line 877
+#line 861
{
-#line 877
+#line 861
off_t offset = NC_varoffset(ncp, varp, start);
-#line 877
+#line 861
size_t remaining = varp->xsz * nelems;
-#line 877
+#line 861
int status = NC_NOERR;
-#line 877
+#line 861
const void *xp;
-#line 877
+#line 861
-#line 877
+#line 861
if(nelems == 0)
-#line 877
+#line 861
return NC_NOERR;
-#line 877
+#line 861
-#line 877
+#line 861
assert(value != NULL);
-#line 877
+#line 861
-#line 877
+#line 861
for(;;)
-#line 877
+#line 861
{
-#line 877
+#line 861
size_t extent = MIN(remaining, ncp->chunk);
-#line 877
+#line 861
size_t nget = ncx_howmany(varp->type, extent);
-#line 877
+#line 861
-#line 877
+#line 861
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 877
+#line 861
0, (void **)&xp); /* cast away const */
-#line 877
+#line 861
if(lstatus != NC_NOERR)
-#line 877
+#line 861
return lstatus;
-#line 877
+#line 861
-#line 877
+#line 861
lstatus = ncx_getn_schar_ushort(&xp, nget, value);
-#line 877
+#line 861
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 877
+#line 861
status = lstatus;
-#line 877
+#line 861
-#line 877
+#line 861
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 877
+#line 861
-#line 877
+#line 861
remaining -= extent;
-#line 877
+#line 861
if(remaining == 0)
-#line 877
+#line 861
break; /* normal loop exit */
-#line 877
+#line 861
offset += (off_t)extent;
-#line 877
+#line 861
value += nget;
-#line 877
+#line 861
}
-#line 877
+#line 861
-#line 877
+#line 861
return status;
-#line 877
+#line 861
}
-#line 877
+#line 861
static int
-#line 879
+#line 863
getNCvx_short_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 879
+#line 863
const size_t *start, size_t nelems, schar *value)
-#line 879
+#line 863
{
-#line 879
+#line 863
off_t offset = NC_varoffset(ncp, varp, start);
-#line 879
+#line 863
size_t remaining = varp->xsz * nelems;
-#line 879
+#line 863
int status = NC_NOERR;
-#line 879
+#line 863
const void *xp;
-#line 879
+#line 863
-#line 879
+#line 863
if(nelems == 0)
-#line 879
+#line 863
return NC_NOERR;
-#line 879
+#line 863
-#line 879
+#line 863
assert(value != NULL);
-#line 879
+#line 863
-#line 879
+#line 863
for(;;)
-#line 879
+#line 863
{
-#line 879
+#line 863
size_t extent = MIN(remaining, ncp->chunk);
-#line 879
+#line 863
size_t nget = ncx_howmany(varp->type, extent);
-#line 879
+#line 863
-#line 879
+#line 863
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 879
+#line 863
0, (void **)&xp); /* cast away const */
-#line 879
+#line 863
if(lstatus != NC_NOERR)
-#line 879
+#line 863
return lstatus;
-#line 879
+#line 863
-#line 879
+#line 863
lstatus = ncx_getn_short_schar(&xp, nget, value);
-#line 879
+#line 863
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 879
+#line 863
status = lstatus;
-#line 879
+#line 863
-#line 879
+#line 863
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 879
+#line 863
-#line 879
+#line 863
remaining -= extent;
-#line 879
+#line 863
if(remaining == 0)
-#line 879
+#line 863
break; /* normal loop exit */
-#line 879
+#line 863
offset += (off_t)extent;
-#line 879
+#line 863
value += nget;
-#line 879
+#line 863
}
-#line 879
+#line 863
-#line 879
+#line 863
return status;
-#line 879
+#line 863
}
-#line 879
+#line 863
static int
-#line 880
+#line 864
getNCvx_short_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 880
+#line 864
const size_t *start, size_t nelems, uchar *value)
-#line 880
+#line 864
{
-#line 880
+#line 864
off_t offset = NC_varoffset(ncp, varp, start);
-#line 880
+#line 864
size_t remaining = varp->xsz * nelems;
-#line 880
+#line 864
int status = NC_NOERR;
-#line 880
+#line 864
const void *xp;
-#line 880
+#line 864
-#line 880
+#line 864
if(nelems == 0)
-#line 880
+#line 864
return NC_NOERR;
-#line 880
+#line 864
-#line 880
+#line 864
assert(value != NULL);
-#line 880
+#line 864
-#line 880
+#line 864
for(;;)
-#line 880
+#line 864
{
-#line 880
+#line 864
size_t extent = MIN(remaining, ncp->chunk);
-#line 880
+#line 864
size_t nget = ncx_howmany(varp->type, extent);
-#line 880
+#line 864
-#line 880
+#line 864
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 880
+#line 864
0, (void **)&xp); /* cast away const */
-#line 880
+#line 864
if(lstatus != NC_NOERR)
-#line 880
+#line 864
return lstatus;
-#line 880
+#line 864
-#line 880
+#line 864
lstatus = ncx_getn_short_uchar(&xp, nget, value);
-#line 880
+#line 864
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 880
+#line 864
status = lstatus;
-#line 880
+#line 864
-#line 880
+#line 864
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 880
+#line 864
-#line 880
+#line 864
remaining -= extent;
-#line 880
+#line 864
if(remaining == 0)
-#line 880
+#line 864
break; /* normal loop exit */
-#line 880
+#line 864
offset += (off_t)extent;
-#line 880
+#line 864
value += nget;
-#line 880
+#line 864
}
-#line 880
+#line 864
-#line 880
+#line 864
return status;
-#line 880
+#line 864
}
-#line 880
+#line 864
static int
-#line 881
+#line 865
getNCvx_short_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 881
+#line 865
const size_t *start, size_t nelems, short *value)
-#line 881
+#line 865
{
-#line 881
+#line 865
off_t offset = NC_varoffset(ncp, varp, start);
-#line 881
+#line 865
size_t remaining = varp->xsz * nelems;
-#line 881
+#line 865
int status = NC_NOERR;
-#line 881
+#line 865
const void *xp;
-#line 881
+#line 865
-#line 881
+#line 865
if(nelems == 0)
-#line 881
+#line 865
return NC_NOERR;
-#line 881
+#line 865
-#line 881
+#line 865
assert(value != NULL);
-#line 881
+#line 865
-#line 881
+#line 865
for(;;)
-#line 881
+#line 865
{
-#line 881
+#line 865
size_t extent = MIN(remaining, ncp->chunk);
-#line 881
+#line 865
size_t nget = ncx_howmany(varp->type, extent);
-#line 881
+#line 865
-#line 881
+#line 865
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 881
+#line 865
0, (void **)&xp); /* cast away const */
-#line 881
+#line 865
if(lstatus != NC_NOERR)
-#line 881
+#line 865
return lstatus;
-#line 881
+#line 865
-#line 881
+#line 865
lstatus = ncx_getn_short_short(&xp, nget, value);
-#line 881
+#line 865
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 881
+#line 865
status = lstatus;
-#line 881
+#line 865
-#line 881
+#line 865
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 881
+#line 865
-#line 881
+#line 865
remaining -= extent;
-#line 881
+#line 865
if(remaining == 0)
-#line 881
+#line 865
break; /* normal loop exit */
-#line 881
+#line 865
offset += (off_t)extent;
-#line 881
+#line 865
value += nget;
-#line 881
+#line 865
}
-#line 881
+#line 865
-#line 881
+#line 865
return status;
-#line 881
+#line 865
}
-#line 881
+#line 865
static int
-#line 882
+#line 866
getNCvx_short_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 882
+#line 866
const size_t *start, size_t nelems, int *value)
-#line 882
+#line 866
{
-#line 882
+#line 866
off_t offset = NC_varoffset(ncp, varp, start);
-#line 882
+#line 866
size_t remaining = varp->xsz * nelems;
-#line 882
+#line 866
int status = NC_NOERR;
-#line 882
+#line 866
const void *xp;
-#line 882
+#line 866
-#line 882
+#line 866
if(nelems == 0)
-#line 882
+#line 866
return NC_NOERR;
-#line 882
+#line 866
-#line 882
+#line 866
assert(value != NULL);
-#line 882
+#line 866
-#line 882
+#line 866
for(;;)
-#line 882
+#line 866
{
-#line 882
+#line 866
size_t extent = MIN(remaining, ncp->chunk);
-#line 882
+#line 866
size_t nget = ncx_howmany(varp->type, extent);
-#line 882
+#line 866
-#line 882
+#line 866
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 882
+#line 866
0, (void **)&xp); /* cast away const */
-#line 882
+#line 866
if(lstatus != NC_NOERR)
-#line 882
+#line 866
return lstatus;
-#line 882
+#line 866
-#line 882
+#line 866
lstatus = ncx_getn_short_int(&xp, nget, value);
-#line 882
+#line 866
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 882
+#line 866
status = lstatus;
-#line 882
+#line 866
-#line 882
+#line 866
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 882
+#line 866
-#line 882
+#line 866
remaining -= extent;
-#line 882
+#line 866
if(remaining == 0)
-#line 882
+#line 866
break; /* normal loop exit */
-#line 882
+#line 866
offset += (off_t)extent;
-#line 882
+#line 866
value += nget;
-#line 882
+#line 866
}
-#line 882
+#line 866
-#line 882
+#line 866
return status;
-#line 882
+#line 866
}
-#line 882
+#line 866
static int
-#line 883
+#line 867
getNCvx_short_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 883
+#line 867
const size_t *start, size_t nelems, float *value)
-#line 883
+#line 867
{
-#line 883
+#line 867
off_t offset = NC_varoffset(ncp, varp, start);
-#line 883
+#line 867
size_t remaining = varp->xsz * nelems;
-#line 883
+#line 867
int status = NC_NOERR;
-#line 883
+#line 867
const void *xp;
-#line 883
+#line 867
-#line 883
+#line 867
if(nelems == 0)
-#line 883
+#line 867
return NC_NOERR;
-#line 883
+#line 867
-#line 883
+#line 867
assert(value != NULL);
-#line 883
+#line 867
-#line 883
+#line 867
for(;;)
-#line 883
+#line 867
{
-#line 883
+#line 867
size_t extent = MIN(remaining, ncp->chunk);
-#line 883
+#line 867
size_t nget = ncx_howmany(varp->type, extent);
-#line 883
+#line 867
-#line 883
+#line 867
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 883
+#line 867
0, (void **)&xp); /* cast away const */
-#line 883
+#line 867
if(lstatus != NC_NOERR)
-#line 883
+#line 867
return lstatus;
-#line 883
+#line 867
-#line 883
+#line 867
lstatus = ncx_getn_short_float(&xp, nget, value);
-#line 883
+#line 867
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 883
+#line 867
status = lstatus;
-#line 883
+#line 867
-#line 883
+#line 867
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 883
+#line 867
-#line 883
+#line 867
remaining -= extent;
-#line 883
+#line 867
if(remaining == 0)
-#line 883
+#line 867
break; /* normal loop exit */
-#line 883
+#line 867
offset += (off_t)extent;
-#line 883
+#line 867
value += nget;
-#line 883
+#line 867
}
-#line 883
+#line 867
-#line 883
+#line 867
return status;
-#line 883
+#line 867
}
-#line 883
+#line 867
static int
-#line 884
+#line 868
getNCvx_short_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 884
+#line 868
const size_t *start, size_t nelems, double *value)
-#line 884
+#line 868
{
-#line 884
+#line 868
off_t offset = NC_varoffset(ncp, varp, start);
-#line 884
+#line 868
size_t remaining = varp->xsz * nelems;
-#line 884
+#line 868
int status = NC_NOERR;
-#line 884
+#line 868
const void *xp;
-#line 884
+#line 868
-#line 884
+#line 868
if(nelems == 0)
-#line 884
+#line 868
return NC_NOERR;
-#line 884
+#line 868
-#line 884
+#line 868
assert(value != NULL);
-#line 884
+#line 868
-#line 884
+#line 868
for(;;)
-#line 884
+#line 868
{
-#line 884
+#line 868
size_t extent = MIN(remaining, ncp->chunk);
-#line 884
+#line 868
size_t nget = ncx_howmany(varp->type, extent);
-#line 884
+#line 868
-#line 884
+#line 868
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 884
+#line 868
0, (void **)&xp); /* cast away const */
-#line 884
+#line 868
if(lstatus != NC_NOERR)
-#line 884
+#line 868
return lstatus;
-#line 884
+#line 868
-#line 884
+#line 868
lstatus = ncx_getn_short_double(&xp, nget, value);
-#line 884
+#line 868
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 884
+#line 868
status = lstatus;
-#line 884
+#line 868
-#line 884
+#line 868
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 884
+#line 868
-#line 884
+#line 868
remaining -= extent;
-#line 884
+#line 868
if(remaining == 0)
-#line 884
+#line 868
break; /* normal loop exit */
-#line 884
+#line 868
offset += (off_t)extent;
-#line 884
+#line 868
value += nget;
-#line 884
+#line 868
}
-#line 884
+#line 868
-#line 884
+#line 868
return status;
-#line 884
+#line 868
}
-#line 884
+#line 868
static int
-#line 885
+#line 869
getNCvx_short_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 885
+#line 869
const size_t *start, size_t nelems, longlong *value)
-#line 885
+#line 869
{
-#line 885
+#line 869
off_t offset = NC_varoffset(ncp, varp, start);
-#line 885
+#line 869
size_t remaining = varp->xsz * nelems;
-#line 885
+#line 869
int status = NC_NOERR;
-#line 885
+#line 869
const void *xp;
-#line 885
+#line 869
-#line 885
+#line 869
if(nelems == 0)
-#line 885
+#line 869
return NC_NOERR;
-#line 885
+#line 869
-#line 885
+#line 869
assert(value != NULL);
-#line 885
+#line 869
-#line 885
+#line 869
for(;;)
-#line 885
+#line 869
{
-#line 885
+#line 869
size_t extent = MIN(remaining, ncp->chunk);
-#line 885
+#line 869
size_t nget = ncx_howmany(varp->type, extent);
-#line 885
+#line 869
-#line 885
+#line 869
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 885
+#line 869
0, (void **)&xp); /* cast away const */
-#line 885
+#line 869
if(lstatus != NC_NOERR)
-#line 885
+#line 869
return lstatus;
-#line 885
+#line 869
-#line 885
+#line 869
lstatus = ncx_getn_short_longlong(&xp, nget, value);
-#line 885
+#line 869
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 885
+#line 869
status = lstatus;
-#line 885
+#line 869
-#line 885
+#line 869
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 885
+#line 869
-#line 885
+#line 869
remaining -= extent;
-#line 885
+#line 869
if(remaining == 0)
-#line 885
+#line 869
break; /* normal loop exit */
-#line 885
+#line 869
offset += (off_t)extent;
-#line 885
+#line 869
value += nget;
-#line 885
+#line 869
}
-#line 885
+#line 869
-#line 885
+#line 869
return status;
-#line 885
+#line 869
}
-#line 885
+#line 869
static int
-#line 886
+#line 870
getNCvx_short_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 886
+#line 870
const size_t *start, size_t nelems, uint *value)
-#line 886
+#line 870
{
-#line 886
+#line 870
off_t offset = NC_varoffset(ncp, varp, start);
-#line 886
+#line 870
size_t remaining = varp->xsz * nelems;
-#line 886
+#line 870
int status = NC_NOERR;
-#line 886
+#line 870
const void *xp;
-#line 886
+#line 870
-#line 886
+#line 870
if(nelems == 0)
-#line 886
+#line 870
return NC_NOERR;
-#line 886
+#line 870
-#line 886
+#line 870
assert(value != NULL);
-#line 886
+#line 870
-#line 886
+#line 870
for(;;)
-#line 886
+#line 870
{
-#line 886
+#line 870
size_t extent = MIN(remaining, ncp->chunk);
-#line 886
+#line 870
size_t nget = ncx_howmany(varp->type, extent);
-#line 886
+#line 870
-#line 886
+#line 870
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 886
+#line 870
0, (void **)&xp); /* cast away const */
-#line 886
+#line 870
if(lstatus != NC_NOERR)
-#line 886
+#line 870
return lstatus;
-#line 886
+#line 870
-#line 886
+#line 870
lstatus = ncx_getn_short_uint(&xp, nget, value);
-#line 886
+#line 870
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 886
+#line 870
status = lstatus;
-#line 886
+#line 870
-#line 886
+#line 870
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 886
+#line 870
-#line 886
+#line 870
remaining -= extent;
-#line 886
+#line 870
if(remaining == 0)
-#line 886
+#line 870
break; /* normal loop exit */
-#line 886
+#line 870
offset += (off_t)extent;
-#line 886
+#line 870
value += nget;
-#line 886
+#line 870
}
-#line 886
+#line 870
-#line 886
+#line 870
return status;
-#line 886
+#line 870
}
-#line 886
+#line 870
static int
-#line 887
+#line 871
getNCvx_short_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 887
+#line 871
const size_t *start, size_t nelems, ulonglong *value)
-#line 887
+#line 871
{
-#line 887
+#line 871
off_t offset = NC_varoffset(ncp, varp, start);
-#line 887
+#line 871
size_t remaining = varp->xsz * nelems;
-#line 887
+#line 871
int status = NC_NOERR;
-#line 887
+#line 871
const void *xp;
-#line 887
+#line 871
-#line 887
+#line 871
if(nelems == 0)
-#line 887
+#line 871
return NC_NOERR;
-#line 887
+#line 871
-#line 887
+#line 871
assert(value != NULL);
-#line 887
+#line 871
-#line 887
+#line 871
for(;;)
-#line 887
+#line 871
{
-#line 887
+#line 871
size_t extent = MIN(remaining, ncp->chunk);
-#line 887
+#line 871
size_t nget = ncx_howmany(varp->type, extent);
-#line 887
+#line 871
-#line 887
+#line 871
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 887
+#line 871
0, (void **)&xp); /* cast away const */
-#line 887
+#line 871
if(lstatus != NC_NOERR)
-#line 887
+#line 871
return lstatus;
-#line 887
+#line 871
-#line 887
+#line 871
lstatus = ncx_getn_short_ulonglong(&xp, nget, value);
-#line 887
+#line 871
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 887
+#line 871
status = lstatus;
-#line 887
+#line 871
-#line 887
+#line 871
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 887
+#line 871
-#line 887
+#line 871
remaining -= extent;
-#line 887
+#line 871
if(remaining == 0)
-#line 887
+#line 871
break; /* normal loop exit */
-#line 887
+#line 871
offset += (off_t)extent;
-#line 887
+#line 871
value += nget;
-#line 887
+#line 871
}
-#line 887
+#line 871
-#line 887
+#line 871
return status;
-#line 887
+#line 871
}
-#line 887
+#line 871
static int
-#line 888
+#line 872
getNCvx_short_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 888
+#line 872
const size_t *start, size_t nelems, ushort *value)
-#line 888
+#line 872
{
-#line 888
+#line 872
off_t offset = NC_varoffset(ncp, varp, start);
-#line 888
+#line 872
size_t remaining = varp->xsz * nelems;
-#line 888
+#line 872
int status = NC_NOERR;
-#line 888
+#line 872
const void *xp;
-#line 888
+#line 872
-#line 888
+#line 872
if(nelems == 0)
-#line 888
+#line 872
return NC_NOERR;
-#line 888
+#line 872
-#line 888
+#line 872
assert(value != NULL);
-#line 888
+#line 872
-#line 888
+#line 872
for(;;)
-#line 888
+#line 872
{
-#line 888
+#line 872
size_t extent = MIN(remaining, ncp->chunk);
-#line 888
+#line 872
size_t nget = ncx_howmany(varp->type, extent);
-#line 888
+#line 872
-#line 888
+#line 872
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 888
+#line 872
0, (void **)&xp); /* cast away const */
-#line 888
+#line 872
if(lstatus != NC_NOERR)
-#line 888
+#line 872
return lstatus;
-#line 888
+#line 872
-#line 888
+#line 872
lstatus = ncx_getn_short_ushort(&xp, nget, value);
-#line 888
+#line 872
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 888
+#line 872
status = lstatus;
-#line 888
+#line 872
-#line 888
+#line 872
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 888
+#line 872
-#line 888
+#line 872
remaining -= extent;
-#line 888
+#line 872
if(remaining == 0)
-#line 888
+#line 872
break; /* normal loop exit */
-#line 888
+#line 872
offset += (off_t)extent;
-#line 888
+#line 872
value += nget;
-#line 888
+#line 872
}
-#line 888
+#line 872
-#line 888
+#line 872
return status;
-#line 888
+#line 872
}
-#line 888
+#line 872
static int
-#line 890
+#line 874
getNCvx_int_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 890
+#line 874
const size_t *start, size_t nelems, schar *value)
-#line 890
+#line 874
{
-#line 890
+#line 874
off_t offset = NC_varoffset(ncp, varp, start);
-#line 890
+#line 874
size_t remaining = varp->xsz * nelems;
-#line 890
+#line 874
int status = NC_NOERR;
-#line 890
+#line 874
const void *xp;
-#line 890
+#line 874
-#line 890
+#line 874
if(nelems == 0)
-#line 890
+#line 874
return NC_NOERR;
-#line 890
+#line 874
-#line 890
+#line 874
assert(value != NULL);
-#line 890
+#line 874
-#line 890
+#line 874
for(;;)
-#line 890
+#line 874
{
-#line 890
+#line 874
size_t extent = MIN(remaining, ncp->chunk);
-#line 890
+#line 874
size_t nget = ncx_howmany(varp->type, extent);
-#line 890
+#line 874
-#line 890
+#line 874
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 890
+#line 874
0, (void **)&xp); /* cast away const */
-#line 890
+#line 874
if(lstatus != NC_NOERR)
-#line 890
+#line 874
return lstatus;
-#line 890
+#line 874
-#line 890
+#line 874
lstatus = ncx_getn_int_schar(&xp, nget, value);
-#line 890
+#line 874
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 890
+#line 874
status = lstatus;
-#line 890
+#line 874
-#line 890
+#line 874
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 890
+#line 874
-#line 890
+#line 874
remaining -= extent;
-#line 890
+#line 874
if(remaining == 0)
-#line 890
+#line 874
break; /* normal loop exit */
-#line 890
+#line 874
offset += (off_t)extent;
-#line 890
+#line 874
value += nget;
-#line 890
+#line 874
}
-#line 890
+#line 874
-#line 890
+#line 874
return status;
-#line 890
+#line 874
}
-#line 890
+#line 874
static int
-#line 891
+#line 875
getNCvx_int_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 891
+#line 875
const size_t *start, size_t nelems, uchar *value)
-#line 891
+#line 875
{
-#line 891
+#line 875
off_t offset = NC_varoffset(ncp, varp, start);
-#line 891
+#line 875
size_t remaining = varp->xsz * nelems;
-#line 891
+#line 875
int status = NC_NOERR;
-#line 891
+#line 875
const void *xp;
-#line 891
+#line 875
-#line 891
+#line 875
if(nelems == 0)
-#line 891
+#line 875
return NC_NOERR;
-#line 891
+#line 875
-#line 891
+#line 875
assert(value != NULL);
-#line 891
+#line 875
-#line 891
+#line 875
for(;;)
-#line 891
+#line 875
{
-#line 891
+#line 875
size_t extent = MIN(remaining, ncp->chunk);
-#line 891
+#line 875
size_t nget = ncx_howmany(varp->type, extent);
-#line 891
+#line 875
-#line 891
+#line 875
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 891
+#line 875
0, (void **)&xp); /* cast away const */
-#line 891
+#line 875
if(lstatus != NC_NOERR)
-#line 891
+#line 875
return lstatus;
-#line 891
+#line 875
-#line 891
+#line 875
lstatus = ncx_getn_int_uchar(&xp, nget, value);
-#line 891
+#line 875
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 891
+#line 875
status = lstatus;
-#line 891
+#line 875
-#line 891
+#line 875
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 891
+#line 875
-#line 891
+#line 875
remaining -= extent;
-#line 891
+#line 875
if(remaining == 0)
-#line 891
+#line 875
break; /* normal loop exit */
-#line 891
+#line 875
offset += (off_t)extent;
-#line 891
+#line 875
value += nget;
-#line 891
+#line 875
}
-#line 891
+#line 875
-#line 891
+#line 875
return status;
-#line 891
+#line 875
}
-#line 891
+#line 875
static int
-#line 892
+#line 876
getNCvx_int_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 892
+#line 876
const size_t *start, size_t nelems, short *value)
-#line 892
+#line 876
{
-#line 892
+#line 876
off_t offset = NC_varoffset(ncp, varp, start);
-#line 892
+#line 876
size_t remaining = varp->xsz * nelems;
-#line 892
+#line 876
int status = NC_NOERR;
-#line 892
+#line 876
const void *xp;
-#line 892
+#line 876
-#line 892
+#line 876
if(nelems == 0)
-#line 892
+#line 876
return NC_NOERR;
-#line 892
+#line 876
-#line 892
+#line 876
assert(value != NULL);
-#line 892
+#line 876
-#line 892
+#line 876
for(;;)
-#line 892
+#line 876
{
-#line 892
+#line 876
size_t extent = MIN(remaining, ncp->chunk);
-#line 892
+#line 876
size_t nget = ncx_howmany(varp->type, extent);
-#line 892
+#line 876
-#line 892
+#line 876
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 892
+#line 876
0, (void **)&xp); /* cast away const */
-#line 892
+#line 876
if(lstatus != NC_NOERR)
-#line 892
+#line 876
return lstatus;
-#line 892
+#line 876
-#line 892
+#line 876
lstatus = ncx_getn_int_short(&xp, nget, value);
-#line 892
+#line 876
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 892
+#line 876
status = lstatus;
-#line 892
+#line 876
-#line 892
+#line 876
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 892
+#line 876
-#line 892
+#line 876
remaining -= extent;
-#line 892
+#line 876
if(remaining == 0)
-#line 892
+#line 876
break; /* normal loop exit */
-#line 892
+#line 876
offset += (off_t)extent;
-#line 892
+#line 876
value += nget;
-#line 892
+#line 876
}
-#line 892
+#line 876
-#line 892
+#line 876
return status;
-#line 892
+#line 876
}
-#line 892
+#line 876
static int
-#line 893
+#line 877
getNCvx_int_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 893
+#line 877
const size_t *start, size_t nelems, int *value)
-#line 893
+#line 877
{
-#line 893
+#line 877
off_t offset = NC_varoffset(ncp, varp, start);
-#line 893
+#line 877
size_t remaining = varp->xsz * nelems;
-#line 893
+#line 877
int status = NC_NOERR;
-#line 893
+#line 877
const void *xp;
-#line 893
+#line 877
-#line 893
+#line 877
if(nelems == 0)
-#line 893
+#line 877
return NC_NOERR;
-#line 893
+#line 877
-#line 893
+#line 877
assert(value != NULL);
-#line 893
+#line 877
-#line 893
+#line 877
for(;;)
-#line 893
+#line 877
{
-#line 893
+#line 877
size_t extent = MIN(remaining, ncp->chunk);
-#line 893
+#line 877
size_t nget = ncx_howmany(varp->type, extent);
-#line 893
+#line 877
-#line 893
+#line 877
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 893
+#line 877
0, (void **)&xp); /* cast away const */
-#line 893
+#line 877
if(lstatus != NC_NOERR)
-#line 893
+#line 877
return lstatus;
-#line 893
+#line 877
-#line 893
+#line 877
lstatus = ncx_getn_int_int(&xp, nget, value);
-#line 893
+#line 877
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 893
+#line 877
status = lstatus;
-#line 893
+#line 877
-#line 893
+#line 877
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 893
+#line 877
-#line 893
+#line 877
remaining -= extent;
-#line 893
+#line 877
if(remaining == 0)
-#line 893
+#line 877
break; /* normal loop exit */
-#line 893
+#line 877
offset += (off_t)extent;
-#line 893
+#line 877
value += nget;
-#line 893
+#line 877
}
-#line 893
+#line 877
-#line 893
+#line 877
return status;
-#line 893
+#line 877
}
-#line 893
+#line 877
static int
-#line 894
+#line 878
getNCvx_int_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 894
+#line 878
const size_t *start, size_t nelems, float *value)
-#line 894
+#line 878
{
-#line 894
+#line 878
off_t offset = NC_varoffset(ncp, varp, start);
-#line 894
+#line 878
size_t remaining = varp->xsz * nelems;
-#line 894
+#line 878
int status = NC_NOERR;
-#line 894
+#line 878
const void *xp;
-#line 894
+#line 878
-#line 894
+#line 878
if(nelems == 0)
-#line 894
+#line 878
return NC_NOERR;
-#line 894
+#line 878
-#line 894
+#line 878
assert(value != NULL);
-#line 894
+#line 878
-#line 894
+#line 878
for(;;)
-#line 894
+#line 878
{
-#line 894
+#line 878
size_t extent = MIN(remaining, ncp->chunk);
-#line 894
+#line 878
size_t nget = ncx_howmany(varp->type, extent);
-#line 894
+#line 878
-#line 894
+#line 878
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 894
+#line 878
0, (void **)&xp); /* cast away const */
-#line 894
+#line 878
if(lstatus != NC_NOERR)
-#line 894
+#line 878
return lstatus;
-#line 894
+#line 878
-#line 894
+#line 878
lstatus = ncx_getn_int_float(&xp, nget, value);
-#line 894
+#line 878
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 894
+#line 878
status = lstatus;
-#line 894
+#line 878
-#line 894
+#line 878
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 894
+#line 878
-#line 894
+#line 878
remaining -= extent;
-#line 894
+#line 878
if(remaining == 0)
-#line 894
+#line 878
break; /* normal loop exit */
-#line 894
+#line 878
offset += (off_t)extent;
-#line 894
+#line 878
value += nget;
-#line 894
+#line 878
}
-#line 894
+#line 878
-#line 894
+#line 878
return status;
-#line 894
+#line 878
}
-#line 894
+#line 878
static int
-#line 895
+#line 879
getNCvx_int_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 895
+#line 879
const size_t *start, size_t nelems, double *value)
-#line 895
+#line 879
{
-#line 895
+#line 879
off_t offset = NC_varoffset(ncp, varp, start);
-#line 895
+#line 879
size_t remaining = varp->xsz * nelems;
-#line 895
+#line 879
int status = NC_NOERR;
-#line 895
+#line 879
const void *xp;
-#line 895
+#line 879
-#line 895
+#line 879
if(nelems == 0)
-#line 895
+#line 879
return NC_NOERR;
-#line 895
+#line 879
-#line 895
+#line 879
assert(value != NULL);
-#line 895
+#line 879
-#line 895
+#line 879
for(;;)
-#line 895
+#line 879
{
-#line 895
+#line 879
size_t extent = MIN(remaining, ncp->chunk);
-#line 895
+#line 879
size_t nget = ncx_howmany(varp->type, extent);
-#line 895
+#line 879
-#line 895
+#line 879
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 895
+#line 879
0, (void **)&xp); /* cast away const */
-#line 895
+#line 879
if(lstatus != NC_NOERR)
-#line 895
+#line 879
return lstatus;
-#line 895
+#line 879
-#line 895
+#line 879
lstatus = ncx_getn_int_double(&xp, nget, value);
-#line 895
+#line 879
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 895
+#line 879
status = lstatus;
-#line 895
+#line 879
-#line 895
+#line 879
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 895
+#line 879
-#line 895
+#line 879
remaining -= extent;
-#line 895
+#line 879
if(remaining == 0)
-#line 895
+#line 879
break; /* normal loop exit */
-#line 895
+#line 879
offset += (off_t)extent;
-#line 895
+#line 879
value += nget;
-#line 895
+#line 879
}
-#line 895
+#line 879
-#line 895
+#line 879
return status;
-#line 895
+#line 879
}
-#line 895
+#line 879
static int
-#line 896
+#line 880
getNCvx_int_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 896
+#line 880
const size_t *start, size_t nelems, longlong *value)
-#line 896
+#line 880
{
-#line 896
+#line 880
off_t offset = NC_varoffset(ncp, varp, start);
-#line 896
+#line 880
size_t remaining = varp->xsz * nelems;
-#line 896
+#line 880
int status = NC_NOERR;
-#line 896
+#line 880
const void *xp;
-#line 896
+#line 880
-#line 896
+#line 880
if(nelems == 0)
-#line 896
+#line 880
return NC_NOERR;
-#line 896
+#line 880
-#line 896
+#line 880
assert(value != NULL);
-#line 896
+#line 880
-#line 896
+#line 880
for(;;)
-#line 896
+#line 880
{
-#line 896
+#line 880
size_t extent = MIN(remaining, ncp->chunk);
-#line 896
+#line 880
size_t nget = ncx_howmany(varp->type, extent);
-#line 896
+#line 880
-#line 896
+#line 880
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 896
+#line 880
0, (void **)&xp); /* cast away const */
-#line 896
+#line 880
if(lstatus != NC_NOERR)
-#line 896
+#line 880
return lstatus;
-#line 896
+#line 880
-#line 896
+#line 880
lstatus = ncx_getn_int_longlong(&xp, nget, value);
-#line 896
+#line 880
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 896
+#line 880
status = lstatus;
-#line 896
+#line 880
-#line 896
+#line 880
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 896
+#line 880
-#line 896
+#line 880
remaining -= extent;
-#line 896
+#line 880
if(remaining == 0)
-#line 896
+#line 880
break; /* normal loop exit */
-#line 896
+#line 880
offset += (off_t)extent;
-#line 896
+#line 880
value += nget;
-#line 896
+#line 880
}
-#line 896
+#line 880
-#line 896
+#line 880
return status;
-#line 896
+#line 880
}
-#line 896
+#line 880
static int
-#line 897
+#line 881
getNCvx_int_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 897
+#line 881
const size_t *start, size_t nelems, uint *value)
-#line 897
+#line 881
{
-#line 897
+#line 881
off_t offset = NC_varoffset(ncp, varp, start);
-#line 897
+#line 881
size_t remaining = varp->xsz * nelems;
-#line 897
+#line 881
int status = NC_NOERR;
-#line 897
+#line 881
const void *xp;
-#line 897
+#line 881
-#line 897
+#line 881
if(nelems == 0)
-#line 897
+#line 881
return NC_NOERR;
-#line 897
+#line 881
-#line 897
+#line 881
assert(value != NULL);
-#line 897
+#line 881
-#line 897
+#line 881
for(;;)
-#line 897
+#line 881
{
-#line 897
+#line 881
size_t extent = MIN(remaining, ncp->chunk);
-#line 897
+#line 881
size_t nget = ncx_howmany(varp->type, extent);
-#line 897
+#line 881
-#line 897
+#line 881
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 897
+#line 881
0, (void **)&xp); /* cast away const */
-#line 897
+#line 881
if(lstatus != NC_NOERR)
-#line 897
+#line 881
return lstatus;
-#line 897
+#line 881
-#line 897
+#line 881
lstatus = ncx_getn_int_uint(&xp, nget, value);
-#line 897
+#line 881
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 897
+#line 881
status = lstatus;
-#line 897
+#line 881
-#line 897
+#line 881
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 897
+#line 881
-#line 897
+#line 881
remaining -= extent;
-#line 897
+#line 881
if(remaining == 0)
-#line 897
+#line 881
break; /* normal loop exit */
-#line 897
+#line 881
offset += (off_t)extent;
-#line 897
+#line 881
value += nget;
-#line 897
+#line 881
}
-#line 897
+#line 881
-#line 897
+#line 881
return status;
-#line 897
+#line 881
}
-#line 897
+#line 881
static int
-#line 898
+#line 882
getNCvx_int_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 898
+#line 882
const size_t *start, size_t nelems, ulonglong *value)
-#line 898
+#line 882
{
-#line 898
+#line 882
off_t offset = NC_varoffset(ncp, varp, start);
-#line 898
+#line 882
size_t remaining = varp->xsz * nelems;
-#line 898
+#line 882
int status = NC_NOERR;
-#line 898
+#line 882
const void *xp;
-#line 898
+#line 882
-#line 898
+#line 882
if(nelems == 0)
-#line 898
+#line 882
return NC_NOERR;
-#line 898
+#line 882
-#line 898
+#line 882
assert(value != NULL);
-#line 898
+#line 882
-#line 898
+#line 882
for(;;)
-#line 898
+#line 882
{
-#line 898
+#line 882
size_t extent = MIN(remaining, ncp->chunk);
-#line 898
+#line 882
size_t nget = ncx_howmany(varp->type, extent);
-#line 898
+#line 882
-#line 898
+#line 882
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 898
+#line 882
0, (void **)&xp); /* cast away const */
-#line 898
+#line 882
if(lstatus != NC_NOERR)
-#line 898
+#line 882
return lstatus;
-#line 898
+#line 882
-#line 898
+#line 882
lstatus = ncx_getn_int_ulonglong(&xp, nget, value);
-#line 898
+#line 882
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 898
+#line 882
status = lstatus;
-#line 898
+#line 882
-#line 898
+#line 882
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 898
+#line 882
-#line 898
+#line 882
remaining -= extent;
-#line 898
+#line 882
if(remaining == 0)
-#line 898
+#line 882
break; /* normal loop exit */
-#line 898
+#line 882
offset += (off_t)extent;
-#line 898
+#line 882
value += nget;
-#line 898
+#line 882
}
-#line 898
+#line 882
-#line 898
+#line 882
return status;
-#line 898
+#line 882
}
-#line 898
+#line 882
static int
-#line 899
+#line 883
getNCvx_int_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 899
+#line 883
const size_t *start, size_t nelems, ushort *value)
-#line 899
+#line 883
{
-#line 899
+#line 883
off_t offset = NC_varoffset(ncp, varp, start);
-#line 899
+#line 883
size_t remaining = varp->xsz * nelems;
-#line 899
+#line 883
int status = NC_NOERR;
-#line 899
+#line 883
const void *xp;
-#line 899
+#line 883
-#line 899
+#line 883
if(nelems == 0)
-#line 899
+#line 883
return NC_NOERR;
-#line 899
+#line 883
-#line 899
+#line 883
assert(value != NULL);
-#line 899
+#line 883
-#line 899
+#line 883
for(;;)
-#line 899
+#line 883
{
-#line 899
+#line 883
size_t extent = MIN(remaining, ncp->chunk);
-#line 899
+#line 883
size_t nget = ncx_howmany(varp->type, extent);
-#line 899
+#line 883
-#line 899
+#line 883
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 899
+#line 883
0, (void **)&xp); /* cast away const */
-#line 899
+#line 883
if(lstatus != NC_NOERR)
-#line 899
+#line 883
return lstatus;
-#line 899
+#line 883
-#line 899
+#line 883
lstatus = ncx_getn_int_ushort(&xp, nget, value);
-#line 899
+#line 883
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 899
+#line 883
status = lstatus;
-#line 899
+#line 883
-#line 899
+#line 883
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 899
+#line 883
-#line 899
+#line 883
remaining -= extent;
-#line 899
+#line 883
if(remaining == 0)
-#line 899
+#line 883
break; /* normal loop exit */
-#line 899
+#line 883
offset += (off_t)extent;
-#line 899
+#line 883
value += nget;
-#line 899
+#line 883
}
-#line 899
+#line 883
-#line 899
+#line 883
return status;
-#line 899
+#line 883
}
-#line 899
+#line 883
static int
-#line 901
+#line 885
getNCvx_float_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 901
+#line 885
const size_t *start, size_t nelems, schar *value)
-#line 901
+#line 885
{
-#line 901
+#line 885
off_t offset = NC_varoffset(ncp, varp, start);
-#line 901
+#line 885
size_t remaining = varp->xsz * nelems;
-#line 901
+#line 885
int status = NC_NOERR;
-#line 901
+#line 885
const void *xp;
-#line 901
+#line 885
-#line 901
+#line 885
if(nelems == 0)
-#line 901
+#line 885
return NC_NOERR;
-#line 901
+#line 885
-#line 901
+#line 885
assert(value != NULL);
-#line 901
+#line 885
-#line 901
+#line 885
for(;;)
-#line 901
+#line 885
{
-#line 901
+#line 885
size_t extent = MIN(remaining, ncp->chunk);
-#line 901
+#line 885
size_t nget = ncx_howmany(varp->type, extent);
-#line 901
+#line 885
-#line 901
+#line 885
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 901
+#line 885
0, (void **)&xp); /* cast away const */
-#line 901
+#line 885
if(lstatus != NC_NOERR)
-#line 901
+#line 885
return lstatus;
-#line 901
+#line 885
-#line 901
+#line 885
lstatus = ncx_getn_float_schar(&xp, nget, value);
-#line 901
+#line 885
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 901
+#line 885
status = lstatus;
-#line 901
+#line 885
-#line 901
+#line 885
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 901
+#line 885
-#line 901
+#line 885
remaining -= extent;
-#line 901
+#line 885
if(remaining == 0)
-#line 901
+#line 885
break; /* normal loop exit */
-#line 901
+#line 885
offset += (off_t)extent;
-#line 901
+#line 885
value += nget;
-#line 901
+#line 885
}
-#line 901
+#line 885
-#line 901
+#line 885
return status;
-#line 901
+#line 885
}
-#line 901
+#line 885
static int
-#line 902
+#line 886
getNCvx_float_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 902
+#line 886
const size_t *start, size_t nelems, uchar *value)
-#line 902
+#line 886
{
-#line 902
+#line 886
off_t offset = NC_varoffset(ncp, varp, start);
-#line 902
+#line 886
size_t remaining = varp->xsz * nelems;
-#line 902
+#line 886
int status = NC_NOERR;
-#line 902
+#line 886
const void *xp;
-#line 902
+#line 886
-#line 902
+#line 886
if(nelems == 0)
-#line 902
+#line 886
return NC_NOERR;
-#line 902
+#line 886
-#line 902
+#line 886
assert(value != NULL);
-#line 902
+#line 886
-#line 902
+#line 886
for(;;)
-#line 902
+#line 886
{
-#line 902
+#line 886
size_t extent = MIN(remaining, ncp->chunk);
-#line 902
+#line 886
size_t nget = ncx_howmany(varp->type, extent);
-#line 902
+#line 886
-#line 902
+#line 886
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 902
+#line 886
0, (void **)&xp); /* cast away const */
-#line 902
+#line 886
if(lstatus != NC_NOERR)
-#line 902
+#line 886
return lstatus;
-#line 902
+#line 886
-#line 902
+#line 886
lstatus = ncx_getn_float_uchar(&xp, nget, value);
-#line 902
+#line 886
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 902
+#line 886
status = lstatus;
-#line 902
+#line 886
-#line 902
+#line 886
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 902
+#line 886
-#line 902
+#line 886
remaining -= extent;
-#line 902
+#line 886
if(remaining == 0)
-#line 902
+#line 886
break; /* normal loop exit */
-#line 902
+#line 886
offset += (off_t)extent;
-#line 902
+#line 886
value += nget;
-#line 902
+#line 886
}
-#line 902
+#line 886
-#line 902
+#line 886
return status;
-#line 902
+#line 886
}
-#line 902
+#line 886
static int
-#line 903
+#line 887
getNCvx_float_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 903
+#line 887
const size_t *start, size_t nelems, short *value)
-#line 903
+#line 887
{
-#line 903
+#line 887
off_t offset = NC_varoffset(ncp, varp, start);
-#line 903
+#line 887
size_t remaining = varp->xsz * nelems;
-#line 903
+#line 887
int status = NC_NOERR;
-#line 903
+#line 887
const void *xp;
-#line 903
+#line 887
-#line 903
+#line 887
if(nelems == 0)
-#line 903
+#line 887
return NC_NOERR;
-#line 903
+#line 887
-#line 903
+#line 887
assert(value != NULL);
-#line 903
+#line 887
-#line 903
+#line 887
for(;;)
-#line 903
+#line 887
{
-#line 903
+#line 887
size_t extent = MIN(remaining, ncp->chunk);
-#line 903
+#line 887
size_t nget = ncx_howmany(varp->type, extent);
-#line 903
+#line 887
-#line 903
+#line 887
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 903
+#line 887
0, (void **)&xp); /* cast away const */
-#line 903
+#line 887
if(lstatus != NC_NOERR)
-#line 903
+#line 887
return lstatus;
-#line 903
+#line 887
-#line 903
+#line 887
lstatus = ncx_getn_float_short(&xp, nget, value);
-#line 903
+#line 887
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 903
+#line 887
status = lstatus;
-#line 903
+#line 887
-#line 903
+#line 887
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 903
+#line 887
-#line 903
+#line 887
remaining -= extent;
-#line 903
+#line 887
if(remaining == 0)
-#line 903
+#line 887
break; /* normal loop exit */
-#line 903
+#line 887
offset += (off_t)extent;
-#line 903
+#line 887
value += nget;
-#line 903
+#line 887
}
-#line 903
+#line 887
-#line 903
+#line 887
return status;
-#line 903
+#line 887
}
-#line 903
+#line 887
static int
-#line 904
+#line 888
getNCvx_float_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 904
+#line 888
const size_t *start, size_t nelems, int *value)
-#line 904
+#line 888
{
-#line 904
+#line 888
off_t offset = NC_varoffset(ncp, varp, start);
-#line 904
+#line 888
size_t remaining = varp->xsz * nelems;
-#line 904
+#line 888
int status = NC_NOERR;
-#line 904
+#line 888
const void *xp;
-#line 904
+#line 888
-#line 904
+#line 888
if(nelems == 0)
-#line 904
+#line 888
return NC_NOERR;
-#line 904
+#line 888
-#line 904
+#line 888
assert(value != NULL);
-#line 904
+#line 888
-#line 904
+#line 888
for(;;)
-#line 904
+#line 888
{
-#line 904
+#line 888
size_t extent = MIN(remaining, ncp->chunk);
-#line 904
+#line 888
size_t nget = ncx_howmany(varp->type, extent);
-#line 904
+#line 888
-#line 904
+#line 888
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 904
+#line 888
0, (void **)&xp); /* cast away const */
-#line 904
+#line 888
if(lstatus != NC_NOERR)
-#line 904
+#line 888
return lstatus;
-#line 904
+#line 888
-#line 904
+#line 888
lstatus = ncx_getn_float_int(&xp, nget, value);
-#line 904
+#line 888
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 904
+#line 888
status = lstatus;
-#line 904
+#line 888
-#line 904
+#line 888
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 904
+#line 888
-#line 904
+#line 888
remaining -= extent;
-#line 904
+#line 888
if(remaining == 0)
-#line 904
+#line 888
break; /* normal loop exit */
-#line 904
+#line 888
offset += (off_t)extent;
-#line 904
+#line 888
value += nget;
-#line 904
+#line 888
}
-#line 904
+#line 888
-#line 904
+#line 888
return status;
-#line 904
+#line 888
}
-#line 904
+#line 888
static int
-#line 905
+#line 889
getNCvx_float_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 905
+#line 889
const size_t *start, size_t nelems, float *value)
-#line 905
+#line 889
{
-#line 905
+#line 889
off_t offset = NC_varoffset(ncp, varp, start);
-#line 905
+#line 889
size_t remaining = varp->xsz * nelems;
-#line 905
+#line 889
int status = NC_NOERR;
-#line 905
+#line 889
const void *xp;
-#line 905
+#line 889
-#line 905
+#line 889
if(nelems == 0)
-#line 905
+#line 889
return NC_NOERR;
-#line 905
+#line 889
-#line 905
+#line 889
assert(value != NULL);
-#line 905
+#line 889
-#line 905
+#line 889
for(;;)
-#line 905
+#line 889
{
-#line 905
+#line 889
size_t extent = MIN(remaining, ncp->chunk);
-#line 905
+#line 889
size_t nget = ncx_howmany(varp->type, extent);
-#line 905
+#line 889
-#line 905
+#line 889
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 905
+#line 889
0, (void **)&xp); /* cast away const */
-#line 905
+#line 889
if(lstatus != NC_NOERR)
-#line 905
+#line 889
return lstatus;
-#line 905
+#line 889
-#line 905
+#line 889
lstatus = ncx_getn_float_float(&xp, nget, value);
-#line 905
+#line 889
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 905
+#line 889
status = lstatus;
-#line 905
+#line 889
-#line 905
+#line 889
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 905
+#line 889
-#line 905
+#line 889
remaining -= extent;
-#line 905
+#line 889
if(remaining == 0)
-#line 905
+#line 889
break; /* normal loop exit */
-#line 905
+#line 889
offset += (off_t)extent;
-#line 905
+#line 889
value += nget;
-#line 905
+#line 889
}
-#line 905
+#line 889
-#line 905
+#line 889
return status;
-#line 905
+#line 889
}
-#line 905
+#line 889
static int
-#line 906
+#line 890
getNCvx_float_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 906
+#line 890
const size_t *start, size_t nelems, double *value)
-#line 906
+#line 890
{
-#line 906
+#line 890
off_t offset = NC_varoffset(ncp, varp, start);
-#line 906
+#line 890
size_t remaining = varp->xsz * nelems;
-#line 906
+#line 890
int status = NC_NOERR;
-#line 906
+#line 890
const void *xp;
-#line 906
+#line 890
-#line 906
+#line 890
if(nelems == 0)
-#line 906
+#line 890
return NC_NOERR;
-#line 906
+#line 890
-#line 906
+#line 890
assert(value != NULL);
-#line 906
+#line 890
-#line 906
+#line 890
for(;;)
-#line 906
+#line 890
{
-#line 906
+#line 890
size_t extent = MIN(remaining, ncp->chunk);
-#line 906
+#line 890
size_t nget = ncx_howmany(varp->type, extent);
-#line 906
+#line 890
-#line 906
+#line 890
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 906
+#line 890
0, (void **)&xp); /* cast away const */
-#line 906
+#line 890
if(lstatus != NC_NOERR)
-#line 906
+#line 890
return lstatus;
-#line 906
+#line 890
-#line 906
+#line 890
lstatus = ncx_getn_float_double(&xp, nget, value);
-#line 906
+#line 890
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 906
+#line 890
status = lstatus;
-#line 906
+#line 890
-#line 906
+#line 890
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 906
+#line 890
-#line 906
+#line 890
remaining -= extent;
-#line 906
+#line 890
if(remaining == 0)
-#line 906
+#line 890
break; /* normal loop exit */
-#line 906
+#line 890
offset += (off_t)extent;
-#line 906
+#line 890
value += nget;
-#line 906
+#line 890
}
-#line 906
+#line 890
-#line 906
+#line 890
return status;
-#line 906
+#line 890
}
-#line 906
+#line 890
static int
-#line 907
+#line 891
getNCvx_float_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 907
+#line 891
const size_t *start, size_t nelems, longlong *value)
-#line 907
+#line 891
{
-#line 907
+#line 891
off_t offset = NC_varoffset(ncp, varp, start);
-#line 907
+#line 891
size_t remaining = varp->xsz * nelems;
-#line 907
+#line 891
int status = NC_NOERR;
-#line 907
+#line 891
const void *xp;
-#line 907
+#line 891
-#line 907
+#line 891
if(nelems == 0)
-#line 907
+#line 891
return NC_NOERR;
-#line 907
+#line 891
-#line 907
+#line 891
assert(value != NULL);
-#line 907
+#line 891
-#line 907
+#line 891
for(;;)
-#line 907
+#line 891
{
-#line 907
+#line 891
size_t extent = MIN(remaining, ncp->chunk);
-#line 907
+#line 891
size_t nget = ncx_howmany(varp->type, extent);
-#line 907
+#line 891
-#line 907
+#line 891
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 907
+#line 891
0, (void **)&xp); /* cast away const */
-#line 907
+#line 891
if(lstatus != NC_NOERR)
-#line 907
+#line 891
return lstatus;
-#line 907
+#line 891
-#line 907
+#line 891
lstatus = ncx_getn_float_longlong(&xp, nget, value);
-#line 907
+#line 891
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 907
+#line 891
status = lstatus;
-#line 907
+#line 891
-#line 907
+#line 891
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 907
+#line 891
-#line 907
+#line 891
remaining -= extent;
-#line 907
+#line 891
if(remaining == 0)
-#line 907
+#line 891
break; /* normal loop exit */
-#line 907
+#line 891
offset += (off_t)extent;
-#line 907
+#line 891
value += nget;
-#line 907
+#line 891
}
-#line 907
+#line 891
-#line 907
+#line 891
return status;
-#line 907
+#line 891
}
-#line 907
+#line 891
static int
-#line 908
+#line 892
getNCvx_float_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 908
+#line 892
const size_t *start, size_t nelems, uint *value)
-#line 908
+#line 892
{
-#line 908
+#line 892
off_t offset = NC_varoffset(ncp, varp, start);
-#line 908
+#line 892
size_t remaining = varp->xsz * nelems;
-#line 908
+#line 892
int status = NC_NOERR;
-#line 908
+#line 892
const void *xp;
-#line 908
+#line 892
-#line 908
+#line 892
if(nelems == 0)
-#line 908
+#line 892
return NC_NOERR;
-#line 908
+#line 892
-#line 908
+#line 892
assert(value != NULL);
-#line 908
+#line 892
-#line 908
+#line 892
for(;;)
-#line 908
+#line 892
{
-#line 908
+#line 892
size_t extent = MIN(remaining, ncp->chunk);
-#line 908
+#line 892
size_t nget = ncx_howmany(varp->type, extent);
-#line 908
+#line 892
-#line 908
+#line 892
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 908
+#line 892
0, (void **)&xp); /* cast away const */
-#line 908
+#line 892
if(lstatus != NC_NOERR)
-#line 908
+#line 892
return lstatus;
-#line 908
+#line 892
-#line 908
+#line 892
lstatus = ncx_getn_float_uint(&xp, nget, value);
-#line 908
+#line 892
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 908
+#line 892
status = lstatus;
-#line 908
+#line 892
-#line 908
+#line 892
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 908
+#line 892
-#line 908
+#line 892
remaining -= extent;
-#line 908
+#line 892
if(remaining == 0)
-#line 908
+#line 892
break; /* normal loop exit */
-#line 908
+#line 892
offset += (off_t)extent;
-#line 908
+#line 892
value += nget;
-#line 908
+#line 892
}
-#line 908
+#line 892
-#line 908
+#line 892
return status;
-#line 908
+#line 892
}
-#line 908
+#line 892
static int
-#line 909
+#line 893
getNCvx_float_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 909
+#line 893
const size_t *start, size_t nelems, ulonglong *value)
-#line 909
+#line 893
{
-#line 909
+#line 893
off_t offset = NC_varoffset(ncp, varp, start);
-#line 909
+#line 893
size_t remaining = varp->xsz * nelems;
-#line 909
+#line 893
int status = NC_NOERR;
-#line 909
+#line 893
const void *xp;
-#line 909
+#line 893
-#line 909
+#line 893
if(nelems == 0)
-#line 909
+#line 893
return NC_NOERR;
-#line 909
+#line 893
-#line 909
+#line 893
assert(value != NULL);
-#line 909
+#line 893
-#line 909
+#line 893
for(;;)
-#line 909
+#line 893
{
-#line 909
+#line 893
size_t extent = MIN(remaining, ncp->chunk);
-#line 909
+#line 893
size_t nget = ncx_howmany(varp->type, extent);
-#line 909
+#line 893
-#line 909
+#line 893
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 909
+#line 893
0, (void **)&xp); /* cast away const */
-#line 909
+#line 893
if(lstatus != NC_NOERR)
-#line 909
+#line 893
return lstatus;
-#line 909
+#line 893
-#line 909
+#line 893
lstatus = ncx_getn_float_ulonglong(&xp, nget, value);
-#line 909
+#line 893
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 909
+#line 893
status = lstatus;
-#line 909
+#line 893
-#line 909
+#line 893
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 909
+#line 893
-#line 909
+#line 893
remaining -= extent;
-#line 909
+#line 893
if(remaining == 0)
-#line 909
+#line 893
break; /* normal loop exit */
-#line 909
+#line 893
offset += (off_t)extent;
-#line 909
+#line 893
value += nget;
-#line 909
+#line 893
}
-#line 909
+#line 893
-#line 909
+#line 893
return status;
-#line 909
+#line 893
}
-#line 909
+#line 893
static int
-#line 910
+#line 894
getNCvx_float_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 910
+#line 894
const size_t *start, size_t nelems, ushort *value)
-#line 910
+#line 894
{
-#line 910
+#line 894
off_t offset = NC_varoffset(ncp, varp, start);
-#line 910
+#line 894
size_t remaining = varp->xsz * nelems;
-#line 910
+#line 894
int status = NC_NOERR;
-#line 910
+#line 894
const void *xp;
-#line 910
+#line 894
-#line 910
+#line 894
if(nelems == 0)
-#line 910
+#line 894
return NC_NOERR;
-#line 910
+#line 894
-#line 910
+#line 894
assert(value != NULL);
-#line 910
+#line 894
-#line 910
+#line 894
for(;;)
-#line 910
+#line 894
{
-#line 910
+#line 894
size_t extent = MIN(remaining, ncp->chunk);
-#line 910
+#line 894
size_t nget = ncx_howmany(varp->type, extent);
-#line 910
+#line 894
-#line 910
+#line 894
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 910
+#line 894
0, (void **)&xp); /* cast away const */
-#line 910
+#line 894
if(lstatus != NC_NOERR)
-#line 910
+#line 894
return lstatus;
-#line 910
+#line 894
-#line 910
+#line 894
lstatus = ncx_getn_float_ushort(&xp, nget, value);
-#line 910
+#line 894
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 910
+#line 894
status = lstatus;
-#line 910
+#line 894
-#line 910
+#line 894
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 910
+#line 894
-#line 910
+#line 894
remaining -= extent;
-#line 910
+#line 894
if(remaining == 0)
-#line 910
+#line 894
break; /* normal loop exit */
-#line 910
+#line 894
offset += (off_t)extent;
-#line 910
+#line 894
value += nget;
-#line 910
+#line 894
}
-#line 910
+#line 894
-#line 910
+#line 894
return status;
-#line 910
+#line 894
}
-#line 910
+#line 894
static int
-#line 912
+#line 896
getNCvx_double_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 912
+#line 896
const size_t *start, size_t nelems, schar *value)
-#line 912
+#line 896
{
-#line 912
+#line 896
off_t offset = NC_varoffset(ncp, varp, start);
-#line 912
+#line 896
size_t remaining = varp->xsz * nelems;
-#line 912
+#line 896
int status = NC_NOERR;
-#line 912
+#line 896
const void *xp;
-#line 912
+#line 896
-#line 912
+#line 896
if(nelems == 0)
-#line 912
+#line 896
return NC_NOERR;
-#line 912
+#line 896
-#line 912
+#line 896
assert(value != NULL);
-#line 912
+#line 896
-#line 912
+#line 896
for(;;)
-#line 912
+#line 896
{
-#line 912
+#line 896
size_t extent = MIN(remaining, ncp->chunk);
-#line 912
+#line 896
size_t nget = ncx_howmany(varp->type, extent);
-#line 912
+#line 896
-#line 912
+#line 896
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 912
+#line 896
0, (void **)&xp); /* cast away const */
-#line 912
+#line 896
if(lstatus != NC_NOERR)
-#line 912
+#line 896
return lstatus;
-#line 912
+#line 896
-#line 912
+#line 896
lstatus = ncx_getn_double_schar(&xp, nget, value);
-#line 912
+#line 896
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 912
+#line 896
status = lstatus;
-#line 912
+#line 896
-#line 912
+#line 896
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 912
+#line 896
-#line 912
+#line 896
remaining -= extent;
-#line 912
+#line 896
if(remaining == 0)
-#line 912
+#line 896
break; /* normal loop exit */
-#line 912
+#line 896
offset += (off_t)extent;
-#line 912
+#line 896
value += nget;
-#line 912
+#line 896
}
-#line 912
+#line 896
-#line 912
+#line 896
return status;
-#line 912
+#line 896
}
-#line 912
+#line 896
static int
-#line 913
+#line 897
getNCvx_double_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 913
+#line 897
const size_t *start, size_t nelems, uchar *value)
-#line 913
+#line 897
{
-#line 913
+#line 897
off_t offset = NC_varoffset(ncp, varp, start);
-#line 913
+#line 897
size_t remaining = varp->xsz * nelems;
-#line 913
+#line 897
int status = NC_NOERR;
-#line 913
+#line 897
const void *xp;
-#line 913
+#line 897
-#line 913
+#line 897
if(nelems == 0)
-#line 913
+#line 897
return NC_NOERR;
-#line 913
+#line 897
-#line 913
+#line 897
assert(value != NULL);
-#line 913
+#line 897
-#line 913
+#line 897
for(;;)
-#line 913
+#line 897
{
-#line 913
+#line 897
size_t extent = MIN(remaining, ncp->chunk);
-#line 913
+#line 897
size_t nget = ncx_howmany(varp->type, extent);
-#line 913
+#line 897
-#line 913
+#line 897
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 913
+#line 897
0, (void **)&xp); /* cast away const */
-#line 913
+#line 897
if(lstatus != NC_NOERR)
-#line 913
+#line 897
return lstatus;
-#line 913
+#line 897
-#line 913
+#line 897
lstatus = ncx_getn_double_uchar(&xp, nget, value);
-#line 913
+#line 897
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 913
+#line 897
status = lstatus;
-#line 913
+#line 897
-#line 913
+#line 897
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 913
+#line 897
-#line 913
+#line 897
remaining -= extent;
-#line 913
+#line 897
if(remaining == 0)
-#line 913
+#line 897
break; /* normal loop exit */
-#line 913
+#line 897
offset += (off_t)extent;
-#line 913
+#line 897
value += nget;
-#line 913
+#line 897
}
-#line 913
+#line 897
-#line 913
+#line 897
return status;
-#line 913
+#line 897
}
-#line 913
+#line 897
static int
-#line 914
+#line 898
getNCvx_double_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 914
+#line 898
const size_t *start, size_t nelems, short *value)
-#line 914
+#line 898
{
-#line 914
+#line 898
off_t offset = NC_varoffset(ncp, varp, start);
-#line 914
+#line 898
size_t remaining = varp->xsz * nelems;
-#line 914
+#line 898
int status = NC_NOERR;
-#line 914
+#line 898
const void *xp;
-#line 914
+#line 898
-#line 914
+#line 898
if(nelems == 0)
-#line 914
+#line 898
return NC_NOERR;
-#line 914
+#line 898
-#line 914
+#line 898
assert(value != NULL);
-#line 914
+#line 898
-#line 914
+#line 898
for(;;)
-#line 914
+#line 898
{
-#line 914
+#line 898
size_t extent = MIN(remaining, ncp->chunk);
-#line 914
+#line 898
size_t nget = ncx_howmany(varp->type, extent);
-#line 914
+#line 898
-#line 914
+#line 898
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 914
+#line 898
0, (void **)&xp); /* cast away const */
-#line 914
+#line 898
if(lstatus != NC_NOERR)
-#line 914
+#line 898
return lstatus;
-#line 914
+#line 898
-#line 914
+#line 898
lstatus = ncx_getn_double_short(&xp, nget, value);
-#line 914
+#line 898
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 914
+#line 898
status = lstatus;
-#line 914
+#line 898
-#line 914
+#line 898
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 914
+#line 898
-#line 914
+#line 898
remaining -= extent;
-#line 914
+#line 898
if(remaining == 0)
-#line 914
+#line 898
break; /* normal loop exit */
-#line 914
+#line 898
offset += (off_t)extent;
-#line 914
+#line 898
value += nget;
-#line 914
+#line 898
}
-#line 914
+#line 898
-#line 914
+#line 898
return status;
-#line 914
+#line 898
}
-#line 914
+#line 898
static int
-#line 915
+#line 899
getNCvx_double_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 915
+#line 899
const size_t *start, size_t nelems, int *value)
-#line 915
+#line 899
{
-#line 915
+#line 899
off_t offset = NC_varoffset(ncp, varp, start);
-#line 915
+#line 899
size_t remaining = varp->xsz * nelems;
-#line 915
+#line 899
int status = NC_NOERR;
-#line 915
+#line 899
const void *xp;
-#line 915
+#line 899
-#line 915
+#line 899
if(nelems == 0)
-#line 915
+#line 899
return NC_NOERR;
-#line 915
+#line 899
-#line 915
+#line 899
assert(value != NULL);
-#line 915
+#line 899
-#line 915
+#line 899
for(;;)
-#line 915
+#line 899
{
-#line 915
+#line 899
size_t extent = MIN(remaining, ncp->chunk);
-#line 915
+#line 899
size_t nget = ncx_howmany(varp->type, extent);
-#line 915
+#line 899
-#line 915
+#line 899
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 915
+#line 899
0, (void **)&xp); /* cast away const */
-#line 915
+#line 899
if(lstatus != NC_NOERR)
-#line 915
+#line 899
return lstatus;
-#line 915
+#line 899
-#line 915
+#line 899
lstatus = ncx_getn_double_int(&xp, nget, value);
-#line 915
+#line 899
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 915
+#line 899
status = lstatus;
-#line 915
+#line 899
-#line 915
+#line 899
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 915
+#line 899
-#line 915
+#line 899
remaining -= extent;
-#line 915
+#line 899
if(remaining == 0)
-#line 915
+#line 899
break; /* normal loop exit */
-#line 915
+#line 899
offset += (off_t)extent;
-#line 915
+#line 899
value += nget;
-#line 915
+#line 899
}
-#line 915
+#line 899
-#line 915
+#line 899
return status;
-#line 915
+#line 899
}
-#line 915
+#line 899
static int
-#line 916
+#line 900
getNCvx_double_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 916
+#line 900
const size_t *start, size_t nelems, float *value)
-#line 916
+#line 900
{
-#line 916
+#line 900
off_t offset = NC_varoffset(ncp, varp, start);
-#line 916
+#line 900
size_t remaining = varp->xsz * nelems;
-#line 916
+#line 900
int status = NC_NOERR;
-#line 916
+#line 900
const void *xp;
-#line 916
+#line 900
-#line 916
+#line 900
if(nelems == 0)
-#line 916
+#line 900
return NC_NOERR;
-#line 916
+#line 900
-#line 916
+#line 900
assert(value != NULL);
-#line 916
+#line 900
-#line 916
+#line 900
for(;;)
-#line 916
+#line 900
{
-#line 916
+#line 900
size_t extent = MIN(remaining, ncp->chunk);
-#line 916
+#line 900
size_t nget = ncx_howmany(varp->type, extent);
-#line 916
+#line 900
-#line 916
+#line 900
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 916
+#line 900
0, (void **)&xp); /* cast away const */
-#line 916
+#line 900
if(lstatus != NC_NOERR)
-#line 916
+#line 900
return lstatus;
-#line 916
+#line 900
-#line 916
+#line 900
lstatus = ncx_getn_double_float(&xp, nget, value);
-#line 916
+#line 900
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 916
+#line 900
status = lstatus;
-#line 916
+#line 900
-#line 916
+#line 900
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 916
+#line 900
-#line 916
+#line 900
remaining -= extent;
-#line 916
+#line 900
if(remaining == 0)
-#line 916
+#line 900
break; /* normal loop exit */
-#line 916
+#line 900
offset += (off_t)extent;
-#line 916
+#line 900
value += nget;
-#line 916
+#line 900
}
-#line 916
+#line 900
-#line 916
+#line 900
return status;
-#line 916
+#line 900
}
-#line 916
+#line 900
static int
-#line 917
+#line 901
getNCvx_double_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 917
+#line 901
const size_t *start, size_t nelems, double *value)
-#line 917
+#line 901
{
-#line 917
+#line 901
off_t offset = NC_varoffset(ncp, varp, start);
-#line 917
+#line 901
size_t remaining = varp->xsz * nelems;
-#line 917
+#line 901
int status = NC_NOERR;
-#line 917
+#line 901
const void *xp;
-#line 917
+#line 901
-#line 917
+#line 901
if(nelems == 0)
-#line 917
+#line 901
return NC_NOERR;
-#line 917
+#line 901
-#line 917
+#line 901
assert(value != NULL);
-#line 917
+#line 901
-#line 917
+#line 901
for(;;)
-#line 917
+#line 901
{
-#line 917
+#line 901
size_t extent = MIN(remaining, ncp->chunk);
-#line 917
+#line 901
size_t nget = ncx_howmany(varp->type, extent);
-#line 917
+#line 901
-#line 917
+#line 901
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 917
+#line 901
0, (void **)&xp); /* cast away const */
-#line 917
+#line 901
if(lstatus != NC_NOERR)
-#line 917
+#line 901
return lstatus;
-#line 917
+#line 901
-#line 917
+#line 901
lstatus = ncx_getn_double_double(&xp, nget, value);
-#line 917
+#line 901
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 917
+#line 901
status = lstatus;
-#line 917
+#line 901
-#line 917
+#line 901
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 917
+#line 901
-#line 917
+#line 901
remaining -= extent;
-#line 917
+#line 901
if(remaining == 0)
-#line 917
+#line 901
break; /* normal loop exit */
-#line 917
+#line 901
offset += (off_t)extent;
-#line 917
+#line 901
value += nget;
-#line 917
+#line 901
}
-#line 917
+#line 901
-#line 917
+#line 901
return status;
-#line 917
+#line 901
}
-#line 917
+#line 901
static int
-#line 918
+#line 902
getNCvx_double_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 918
+#line 902
const size_t *start, size_t nelems, longlong *value)
-#line 918
+#line 902
{
-#line 918
+#line 902
off_t offset = NC_varoffset(ncp, varp, start);
-#line 918
+#line 902
size_t remaining = varp->xsz * nelems;
-#line 918
+#line 902
int status = NC_NOERR;
-#line 918
+#line 902
const void *xp;
-#line 918
+#line 902
-#line 918
+#line 902
if(nelems == 0)
-#line 918
+#line 902
return NC_NOERR;
-#line 918
+#line 902
-#line 918
+#line 902
assert(value != NULL);
-#line 918
+#line 902
-#line 918
+#line 902
for(;;)
-#line 918
+#line 902
{
-#line 918
+#line 902
size_t extent = MIN(remaining, ncp->chunk);
-#line 918
+#line 902
size_t nget = ncx_howmany(varp->type, extent);
-#line 918
+#line 902
-#line 918
+#line 902
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 918
+#line 902
0, (void **)&xp); /* cast away const */
-#line 918
+#line 902
if(lstatus != NC_NOERR)
-#line 918
+#line 902
return lstatus;
-#line 918
+#line 902
-#line 918
+#line 902
lstatus = ncx_getn_double_longlong(&xp, nget, value);
-#line 918
+#line 902
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 918
+#line 902
status = lstatus;
-#line 918
+#line 902
-#line 918
+#line 902
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 918
+#line 902
-#line 918
+#line 902
remaining -= extent;
-#line 918
+#line 902
if(remaining == 0)
-#line 918
+#line 902
break; /* normal loop exit */
-#line 918
+#line 902
offset += (off_t)extent;
-#line 918
+#line 902
value += nget;
-#line 918
+#line 902
}
-#line 918
+#line 902
-#line 918
+#line 902
return status;
-#line 918
+#line 902
}
-#line 918
+#line 902
static int
-#line 919
+#line 903
getNCvx_double_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 919
+#line 903
const size_t *start, size_t nelems, uint *value)
-#line 919
+#line 903
{
-#line 919
+#line 903
off_t offset = NC_varoffset(ncp, varp, start);
-#line 919
+#line 903
size_t remaining = varp->xsz * nelems;
-#line 919
+#line 903
int status = NC_NOERR;
-#line 919
+#line 903
const void *xp;
-#line 919
+#line 903
-#line 919
+#line 903
if(nelems == 0)
-#line 919
+#line 903
return NC_NOERR;
-#line 919
+#line 903
-#line 919
+#line 903
assert(value != NULL);
-#line 919
+#line 903
-#line 919
+#line 903
for(;;)
-#line 919
+#line 903
{
-#line 919
+#line 903
size_t extent = MIN(remaining, ncp->chunk);
-#line 919
+#line 903
size_t nget = ncx_howmany(varp->type, extent);
-#line 919
+#line 903
-#line 919
+#line 903
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 919
+#line 903
0, (void **)&xp); /* cast away const */
-#line 919
+#line 903
if(lstatus != NC_NOERR)
-#line 919
+#line 903
return lstatus;
-#line 919
+#line 903
-#line 919
+#line 903
lstatus = ncx_getn_double_uint(&xp, nget, value);
-#line 919
+#line 903
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 919
+#line 903
status = lstatus;
-#line 919
+#line 903
-#line 919
+#line 903
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 919
+#line 903
-#line 919
+#line 903
remaining -= extent;
-#line 919
+#line 903
if(remaining == 0)
-#line 919
+#line 903
break; /* normal loop exit */
-#line 919
+#line 903
offset += (off_t)extent;
-#line 919
+#line 903
value += nget;
-#line 919
+#line 903
}
-#line 919
+#line 903
-#line 919
+#line 903
return status;
-#line 919
+#line 903
}
-#line 919
+#line 903
static int
-#line 920
+#line 904
getNCvx_double_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 920
+#line 904
const size_t *start, size_t nelems, ulonglong *value)
-#line 920
+#line 904
{
-#line 920
+#line 904
off_t offset = NC_varoffset(ncp, varp, start);
-#line 920
+#line 904
size_t remaining = varp->xsz * nelems;
-#line 920
+#line 904
int status = NC_NOERR;
-#line 920
+#line 904
const void *xp;
-#line 920
+#line 904
-#line 920
+#line 904
if(nelems == 0)
-#line 920
+#line 904
return NC_NOERR;
-#line 920
+#line 904
-#line 920
+#line 904
assert(value != NULL);
-#line 920
+#line 904
-#line 920
+#line 904
for(;;)
-#line 920
+#line 904
{
-#line 920
+#line 904
size_t extent = MIN(remaining, ncp->chunk);
-#line 920
+#line 904
size_t nget = ncx_howmany(varp->type, extent);
-#line 920
+#line 904
-#line 920
+#line 904
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 920
+#line 904
0, (void **)&xp); /* cast away const */
-#line 920
+#line 904
if(lstatus != NC_NOERR)
-#line 920
+#line 904
return lstatus;
-#line 920
+#line 904
-#line 920
+#line 904
lstatus = ncx_getn_double_ulonglong(&xp, nget, value);
-#line 920
+#line 904
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 920
+#line 904
status = lstatus;
-#line 920
+#line 904
-#line 920
+#line 904
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 920
+#line 904
-#line 920
+#line 904
remaining -= extent;
-#line 920
+#line 904
if(remaining == 0)
-#line 920
+#line 904
break; /* normal loop exit */
-#line 920
+#line 904
offset += (off_t)extent;
-#line 920
+#line 904
value += nget;
-#line 920
+#line 904
}
-#line 920
+#line 904
-#line 920
+#line 904
return status;
-#line 920
+#line 904
}
-#line 920
+#line 904
static int
-#line 921
+#line 905
getNCvx_double_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 921
+#line 905
const size_t *start, size_t nelems, ushort *value)
-#line 921
+#line 905
{
-#line 921
+#line 905
off_t offset = NC_varoffset(ncp, varp, start);
-#line 921
+#line 905
size_t remaining = varp->xsz * nelems;
-#line 921
+#line 905
int status = NC_NOERR;
-#line 921
+#line 905
const void *xp;
-#line 921
+#line 905
-#line 921
+#line 905
if(nelems == 0)
-#line 921
+#line 905
return NC_NOERR;
-#line 921
+#line 905
-#line 921
+#line 905
assert(value != NULL);
-#line 921
+#line 905
-#line 921
+#line 905
for(;;)
-#line 921
+#line 905
{
-#line 921
+#line 905
size_t extent = MIN(remaining, ncp->chunk);
-#line 921
+#line 905
size_t nget = ncx_howmany(varp->type, extent);
-#line 921
+#line 905
-#line 921
+#line 905
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 921
+#line 905
0, (void **)&xp); /* cast away const */
-#line 921
+#line 905
if(lstatus != NC_NOERR)
-#line 921
+#line 905
return lstatus;
-#line 921
+#line 905
-#line 921
+#line 905
lstatus = ncx_getn_double_ushort(&xp, nget, value);
-#line 921
+#line 905
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 921
+#line 905
status = lstatus;
-#line 921
+#line 905
-#line 921
+#line 905
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 921
+#line 905
-#line 921
+#line 905
remaining -= extent;
-#line 921
+#line 905
if(remaining == 0)
-#line 921
+#line 905
break; /* normal loop exit */
-#line 921
+#line 905
offset += (off_t)extent;
-#line 921
+#line 905
value += nget;
-#line 921
+#line 905
}
-#line 921
+#line 905
-#line 921
+#line 905
return status;
-#line 921
+#line 905
}
-#line 921
+#line 905
static int
-#line 923
+#line 907
getNCvx_uchar_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 923
+#line 907
const size_t *start, size_t nelems, schar *value)
-#line 923
+#line 907
{
-#line 923
+#line 907
off_t offset = NC_varoffset(ncp, varp, start);
-#line 923
+#line 907
size_t remaining = varp->xsz * nelems;
-#line 923
+#line 907
int status = NC_NOERR;
-#line 923
+#line 907
const void *xp;
-#line 923
+#line 907
-#line 923
+#line 907
if(nelems == 0)
-#line 923
+#line 907
return NC_NOERR;
-#line 923
+#line 907
-#line 923
+#line 907
assert(value != NULL);
-#line 923
+#line 907
-#line 923
+#line 907
for(;;)
-#line 923
+#line 907
{
-#line 923
+#line 907
size_t extent = MIN(remaining, ncp->chunk);
-#line 923
+#line 907
size_t nget = ncx_howmany(varp->type, extent);
-#line 923
+#line 907
-#line 923
+#line 907
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 923
+#line 907
0, (void **)&xp); /* cast away const */
-#line 923
+#line 907
if(lstatus != NC_NOERR)
-#line 923
+#line 907
return lstatus;
-#line 923
+#line 907
-#line 923
+#line 907
lstatus = ncx_getn_uchar_schar(&xp, nget, value);
-#line 923
+#line 907
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 923
+#line 907
status = lstatus;
-#line 923
+#line 907
-#line 923
+#line 907
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 923
+#line 907
-#line 923
+#line 907
remaining -= extent;
-#line 923
+#line 907
if(remaining == 0)
-#line 923
+#line 907
break; /* normal loop exit */
-#line 923
+#line 907
offset += (off_t)extent;
-#line 923
+#line 907
value += nget;
-#line 923
+#line 907
}
-#line 923
+#line 907
-#line 923
+#line 907
return status;
-#line 923
+#line 907
}
-#line 923
+#line 907
static int
-#line 924
+#line 908
getNCvx_uchar_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 924
+#line 908
const size_t *start, size_t nelems, uchar *value)
-#line 924
+#line 908
{
-#line 924
+#line 908
off_t offset = NC_varoffset(ncp, varp, start);
-#line 924
+#line 908
size_t remaining = varp->xsz * nelems;
-#line 924
+#line 908
int status = NC_NOERR;
-#line 924
+#line 908
const void *xp;
-#line 924
+#line 908
-#line 924
+#line 908
if(nelems == 0)
-#line 924
+#line 908
return NC_NOERR;
-#line 924
+#line 908
-#line 924
+#line 908
assert(value != NULL);
-#line 924
+#line 908
-#line 924
+#line 908
for(;;)
-#line 924
+#line 908
{
-#line 924
+#line 908
size_t extent = MIN(remaining, ncp->chunk);
-#line 924
+#line 908
size_t nget = ncx_howmany(varp->type, extent);
-#line 924
+#line 908
-#line 924
+#line 908
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 924
+#line 908
0, (void **)&xp); /* cast away const */
-#line 924
+#line 908
if(lstatus != NC_NOERR)
-#line 924
+#line 908
return lstatus;
-#line 924
+#line 908
-#line 924
+#line 908
lstatus = ncx_getn_uchar_uchar(&xp, nget, value);
-#line 924
+#line 908
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 924
+#line 908
status = lstatus;
-#line 924
+#line 908
-#line 924
+#line 908
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 924
+#line 908
-#line 924
+#line 908
remaining -= extent;
-#line 924
+#line 908
if(remaining == 0)
-#line 924
+#line 908
break; /* normal loop exit */
-#line 924
+#line 908
offset += (off_t)extent;
-#line 924
+#line 908
value += nget;
-#line 924
+#line 908
}
-#line 924
+#line 908
-#line 924
+#line 908
return status;
-#line 924
+#line 908
}
-#line 924
+#line 908
static int
-#line 925
+#line 909
getNCvx_uchar_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 925
+#line 909
const size_t *start, size_t nelems, short *value)
-#line 925
+#line 909
{
-#line 925
+#line 909
off_t offset = NC_varoffset(ncp, varp, start);
-#line 925
+#line 909
size_t remaining = varp->xsz * nelems;
-#line 925
+#line 909
int status = NC_NOERR;
-#line 925
+#line 909
const void *xp;
-#line 925
+#line 909
-#line 925
+#line 909
if(nelems == 0)
-#line 925
+#line 909
return NC_NOERR;
-#line 925
+#line 909
-#line 925
+#line 909
assert(value != NULL);
-#line 925
+#line 909
-#line 925
+#line 909
for(;;)
-#line 925
+#line 909
{
-#line 925
+#line 909
size_t extent = MIN(remaining, ncp->chunk);
-#line 925
+#line 909
size_t nget = ncx_howmany(varp->type, extent);
-#line 925
+#line 909
-#line 925
+#line 909
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 925
+#line 909
0, (void **)&xp); /* cast away const */
-#line 925
+#line 909
if(lstatus != NC_NOERR)
-#line 925
+#line 909
return lstatus;
-#line 925
+#line 909
-#line 925
+#line 909
lstatus = ncx_getn_uchar_short(&xp, nget, value);
-#line 925
+#line 909
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 925
+#line 909
status = lstatus;
-#line 925
+#line 909
-#line 925
+#line 909
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 925
+#line 909
-#line 925
+#line 909
remaining -= extent;
-#line 925
+#line 909
if(remaining == 0)
-#line 925
+#line 909
break; /* normal loop exit */
-#line 925
+#line 909
offset += (off_t)extent;
-#line 925
+#line 909
value += nget;
-#line 925
+#line 909
}
-#line 925
+#line 909
-#line 925
+#line 909
return status;
-#line 925
+#line 909
}
-#line 925
+#line 909
static int
-#line 926
+#line 910
getNCvx_uchar_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 926
+#line 910
const size_t *start, size_t nelems, int *value)
-#line 926
+#line 910
{
-#line 926
+#line 910
off_t offset = NC_varoffset(ncp, varp, start);
-#line 926
+#line 910
size_t remaining = varp->xsz * nelems;
-#line 926
+#line 910
int status = NC_NOERR;
-#line 926
+#line 910
const void *xp;
-#line 926
+#line 910
-#line 926
+#line 910
if(nelems == 0)
-#line 926
+#line 910
return NC_NOERR;
-#line 926
+#line 910
-#line 926
+#line 910
assert(value != NULL);
-#line 926
+#line 910
-#line 926
+#line 910
for(;;)
-#line 926
+#line 910
{
-#line 926
+#line 910
size_t extent = MIN(remaining, ncp->chunk);
-#line 926
+#line 910
size_t nget = ncx_howmany(varp->type, extent);
-#line 926
+#line 910
-#line 926
+#line 910
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 926
+#line 910
0, (void **)&xp); /* cast away const */
-#line 926
+#line 910
if(lstatus != NC_NOERR)
-#line 926
+#line 910
return lstatus;
-#line 926
+#line 910
-#line 926
+#line 910
lstatus = ncx_getn_uchar_int(&xp, nget, value);
-#line 926
+#line 910
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 926
+#line 910
status = lstatus;
-#line 926
+#line 910
-#line 926
+#line 910
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 926
+#line 910
-#line 926
+#line 910
remaining -= extent;
-#line 926
+#line 910
if(remaining == 0)
-#line 926
+#line 910
break; /* normal loop exit */
-#line 926
+#line 910
offset += (off_t)extent;
-#line 926
+#line 910
value += nget;
-#line 926
+#line 910
}
-#line 926
+#line 910
-#line 926
+#line 910
return status;
-#line 926
+#line 910
}
-#line 926
+#line 910
static int
-#line 927
+#line 911
getNCvx_uchar_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 927
+#line 911
const size_t *start, size_t nelems, float *value)
-#line 927
+#line 911
{
-#line 927
+#line 911
off_t offset = NC_varoffset(ncp, varp, start);
-#line 927
+#line 911
size_t remaining = varp->xsz * nelems;
-#line 927
+#line 911
int status = NC_NOERR;
-#line 927
+#line 911
const void *xp;
-#line 927
+#line 911
-#line 927
+#line 911
if(nelems == 0)
-#line 927
+#line 911
return NC_NOERR;
-#line 927
+#line 911
-#line 927
+#line 911
assert(value != NULL);
-#line 927
+#line 911
-#line 927
+#line 911
for(;;)
-#line 927
+#line 911
{
-#line 927
+#line 911
size_t extent = MIN(remaining, ncp->chunk);
-#line 927
+#line 911
size_t nget = ncx_howmany(varp->type, extent);
-#line 927
+#line 911
-#line 927
+#line 911
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 927
+#line 911
0, (void **)&xp); /* cast away const */
-#line 927
+#line 911
if(lstatus != NC_NOERR)
-#line 927
+#line 911
return lstatus;
-#line 927
+#line 911
-#line 927
+#line 911
lstatus = ncx_getn_uchar_float(&xp, nget, value);
-#line 927
+#line 911
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 927
+#line 911
status = lstatus;
-#line 927
+#line 911
-#line 927
+#line 911
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 927
+#line 911
-#line 927
+#line 911
remaining -= extent;
-#line 927
+#line 911
if(remaining == 0)
-#line 927
+#line 911
break; /* normal loop exit */
-#line 927
+#line 911
offset += (off_t)extent;
-#line 927
+#line 911
value += nget;
-#line 927
+#line 911
}
-#line 927
+#line 911
-#line 927
+#line 911
return status;
-#line 927
+#line 911
}
-#line 927
+#line 911
static int
-#line 928
+#line 912
getNCvx_uchar_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 928
+#line 912
const size_t *start, size_t nelems, double *value)
-#line 928
+#line 912
{
-#line 928
+#line 912
off_t offset = NC_varoffset(ncp, varp, start);
-#line 928
+#line 912
size_t remaining = varp->xsz * nelems;
-#line 928
+#line 912
int status = NC_NOERR;
-#line 928
+#line 912
const void *xp;
-#line 928
+#line 912
-#line 928
+#line 912
if(nelems == 0)
-#line 928
+#line 912
return NC_NOERR;
-#line 928
+#line 912
-#line 928
+#line 912
assert(value != NULL);
-#line 928
+#line 912
-#line 928
+#line 912
for(;;)
-#line 928
+#line 912
{
-#line 928
+#line 912
size_t extent = MIN(remaining, ncp->chunk);
-#line 928
+#line 912
size_t nget = ncx_howmany(varp->type, extent);
-#line 928
+#line 912
-#line 928
+#line 912
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 928
+#line 912
0, (void **)&xp); /* cast away const */
-#line 928
+#line 912
if(lstatus != NC_NOERR)
-#line 928
+#line 912
return lstatus;
-#line 928
+#line 912
-#line 928
+#line 912
lstatus = ncx_getn_uchar_double(&xp, nget, value);
-#line 928
+#line 912
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 928
+#line 912
status = lstatus;
-#line 928
+#line 912
-#line 928
+#line 912
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 928
+#line 912
-#line 928
+#line 912
remaining -= extent;
-#line 928
+#line 912
if(remaining == 0)
-#line 928
+#line 912
break; /* normal loop exit */
-#line 928
+#line 912
offset += (off_t)extent;
-#line 928
+#line 912
value += nget;
-#line 928
+#line 912
}
-#line 928
+#line 912
-#line 928
+#line 912
return status;
-#line 928
+#line 912
}
-#line 928
+#line 912
static int
-#line 929
+#line 913
getNCvx_uchar_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 929
+#line 913
const size_t *start, size_t nelems, longlong *value)
-#line 929
+#line 913
{
-#line 929
+#line 913
off_t offset = NC_varoffset(ncp, varp, start);
-#line 929
+#line 913
size_t remaining = varp->xsz * nelems;
-#line 929
+#line 913
int status = NC_NOERR;
-#line 929
+#line 913
const void *xp;
-#line 929
+#line 913
-#line 929
+#line 913
if(nelems == 0)
-#line 929
+#line 913
return NC_NOERR;
-#line 929
+#line 913
-#line 929
+#line 913
assert(value != NULL);
-#line 929
+#line 913
-#line 929
+#line 913
for(;;)
-#line 929
+#line 913
{
-#line 929
+#line 913
size_t extent = MIN(remaining, ncp->chunk);
-#line 929
+#line 913
size_t nget = ncx_howmany(varp->type, extent);
-#line 929
+#line 913
-#line 929
+#line 913
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 929
+#line 913
0, (void **)&xp); /* cast away const */
-#line 929
+#line 913
if(lstatus != NC_NOERR)
-#line 929
+#line 913
return lstatus;
-#line 929
+#line 913
-#line 929
+#line 913
lstatus = ncx_getn_uchar_longlong(&xp, nget, value);
-#line 929
+#line 913
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 929
+#line 913
status = lstatus;
-#line 929
+#line 913
-#line 929
+#line 913
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 929
+#line 913
-#line 929
+#line 913
remaining -= extent;
-#line 929
+#line 913
if(remaining == 0)
-#line 929
+#line 913
break; /* normal loop exit */
-#line 929
+#line 913
offset += (off_t)extent;
-#line 929
+#line 913
value += nget;
-#line 929
+#line 913
}
-#line 929
+#line 913
-#line 929
+#line 913
return status;
-#line 929
+#line 913
}
-#line 929
+#line 913
static int
-#line 930
+#line 914
getNCvx_uchar_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 930
+#line 914
const size_t *start, size_t nelems, uint *value)
-#line 930
+#line 914
{
-#line 930
+#line 914
off_t offset = NC_varoffset(ncp, varp, start);
-#line 930
+#line 914
size_t remaining = varp->xsz * nelems;
-#line 930
+#line 914
int status = NC_NOERR;
-#line 930
+#line 914
const void *xp;
-#line 930
+#line 914
-#line 930
+#line 914
if(nelems == 0)
-#line 930
+#line 914
return NC_NOERR;
-#line 930
+#line 914
-#line 930
+#line 914
assert(value != NULL);
-#line 930
+#line 914
-#line 930
+#line 914
for(;;)
-#line 930
+#line 914
{
-#line 930
+#line 914
size_t extent = MIN(remaining, ncp->chunk);
-#line 930
+#line 914
size_t nget = ncx_howmany(varp->type, extent);
-#line 930
+#line 914
-#line 930
+#line 914
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 930
+#line 914
0, (void **)&xp); /* cast away const */
-#line 930
+#line 914
if(lstatus != NC_NOERR)
-#line 930
+#line 914
return lstatus;
-#line 930
+#line 914
-#line 930
+#line 914
lstatus = ncx_getn_uchar_uint(&xp, nget, value);
-#line 930
+#line 914
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 930
+#line 914
status = lstatus;
-#line 930
+#line 914
-#line 930
+#line 914
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 930
+#line 914
-#line 930
+#line 914
remaining -= extent;
-#line 930
+#line 914
if(remaining == 0)
-#line 930
+#line 914
break; /* normal loop exit */
-#line 930
+#line 914
offset += (off_t)extent;
-#line 930
+#line 914
value += nget;
-#line 930
+#line 914
}
-#line 930
+#line 914
-#line 930
+#line 914
return status;
-#line 930
+#line 914
}
-#line 930
+#line 914
static int
-#line 931
+#line 915
getNCvx_uchar_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 931
+#line 915
const size_t *start, size_t nelems, ulonglong *value)
-#line 931
+#line 915
{
-#line 931
+#line 915
off_t offset = NC_varoffset(ncp, varp, start);
-#line 931
+#line 915
size_t remaining = varp->xsz * nelems;
-#line 931
+#line 915
int status = NC_NOERR;
-#line 931
+#line 915
const void *xp;
-#line 931
+#line 915
-#line 931
+#line 915
if(nelems == 0)
-#line 931
+#line 915
return NC_NOERR;
-#line 931
+#line 915
-#line 931
+#line 915
assert(value != NULL);
-#line 931
+#line 915
-#line 931
+#line 915
for(;;)
-#line 931
+#line 915
{
-#line 931
+#line 915
size_t extent = MIN(remaining, ncp->chunk);
-#line 931
+#line 915
size_t nget = ncx_howmany(varp->type, extent);
-#line 931
+#line 915
-#line 931
+#line 915
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 931
+#line 915
0, (void **)&xp); /* cast away const */
-#line 931
+#line 915
if(lstatus != NC_NOERR)
-#line 931
+#line 915
return lstatus;
-#line 931
+#line 915
-#line 931
+#line 915
lstatus = ncx_getn_uchar_ulonglong(&xp, nget, value);
-#line 931
+#line 915
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 931
+#line 915
status = lstatus;
-#line 931
+#line 915
-#line 931
+#line 915
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 931
+#line 915
-#line 931
+#line 915
remaining -= extent;
-#line 931
+#line 915
if(remaining == 0)
-#line 931
+#line 915
break; /* normal loop exit */
-#line 931
+#line 915
offset += (off_t)extent;
-#line 931
+#line 915
value += nget;
-#line 931
+#line 915
}
-#line 931
+#line 915
-#line 931
+#line 915
return status;
-#line 931
+#line 915
}
-#line 931
+#line 915
static int
-#line 932
+#line 916
getNCvx_uchar_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 932
+#line 916
const size_t *start, size_t nelems, ushort *value)
-#line 932
+#line 916
{
-#line 932
+#line 916
off_t offset = NC_varoffset(ncp, varp, start);
-#line 932
+#line 916
size_t remaining = varp->xsz * nelems;
-#line 932
+#line 916
int status = NC_NOERR;
-#line 932
+#line 916
const void *xp;
-#line 932
+#line 916
-#line 932
+#line 916
if(nelems == 0)
-#line 932
+#line 916
return NC_NOERR;
-#line 932
+#line 916
-#line 932
+#line 916
assert(value != NULL);
-#line 932
+#line 916
-#line 932
+#line 916
for(;;)
-#line 932
+#line 916
{
-#line 932
+#line 916
size_t extent = MIN(remaining, ncp->chunk);
-#line 932
+#line 916
size_t nget = ncx_howmany(varp->type, extent);
-#line 932
+#line 916
-#line 932
+#line 916
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 932
+#line 916
0, (void **)&xp); /* cast away const */
-#line 932
+#line 916
if(lstatus != NC_NOERR)
-#line 932
+#line 916
return lstatus;
-#line 932
+#line 916
-#line 932
+#line 916
lstatus = ncx_getn_uchar_ushort(&xp, nget, value);
-#line 932
+#line 916
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 932
+#line 916
status = lstatus;
-#line 932
+#line 916
-#line 932
+#line 916
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 932
+#line 916
-#line 932
+#line 916
remaining -= extent;
-#line 932
+#line 916
if(remaining == 0)
-#line 932
+#line 916
break; /* normal loop exit */
-#line 932
+#line 916
offset += (off_t)extent;
-#line 932
+#line 916
value += nget;
-#line 932
+#line 916
}
-#line 932
+#line 916
-#line 932
+#line 916
return status;
-#line 932
+#line 916
}
-#line 932
+#line 916
static int
-#line 934
+#line 918
getNCvx_ushort_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 934
+#line 918
const size_t *start, size_t nelems, schar *value)
-#line 934
+#line 918
{
-#line 934
+#line 918
off_t offset = NC_varoffset(ncp, varp, start);
-#line 934
+#line 918
size_t remaining = varp->xsz * nelems;
-#line 934
+#line 918
int status = NC_NOERR;
-#line 934
+#line 918
const void *xp;
-#line 934
+#line 918
-#line 934
+#line 918
if(nelems == 0)
-#line 934
+#line 918
return NC_NOERR;
-#line 934
+#line 918
-#line 934
+#line 918
assert(value != NULL);
-#line 934
+#line 918
-#line 934
+#line 918
for(;;)
-#line 934
+#line 918
{
-#line 934
+#line 918
size_t extent = MIN(remaining, ncp->chunk);
-#line 934
+#line 918
size_t nget = ncx_howmany(varp->type, extent);
-#line 934
+#line 918
-#line 934
+#line 918
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 934
+#line 918
0, (void **)&xp); /* cast away const */
-#line 934
+#line 918
if(lstatus != NC_NOERR)
-#line 934
+#line 918
return lstatus;
-#line 934
+#line 918
-#line 934
+#line 918
lstatus = ncx_getn_ushort_schar(&xp, nget, value);
-#line 934
+#line 918
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 934
+#line 918
status = lstatus;
-#line 934
+#line 918
-#line 934
+#line 918
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 934
+#line 918
-#line 934
+#line 918
remaining -= extent;
-#line 934
+#line 918
if(remaining == 0)
-#line 934
+#line 918
break; /* normal loop exit */
-#line 934
+#line 918
offset += (off_t)extent;
-#line 934
+#line 918
value += nget;
-#line 934
+#line 918
}
-#line 934
+#line 918
-#line 934
+#line 918
return status;
-#line 934
+#line 918
}
-#line 934
+#line 918
static int
-#line 935
+#line 919
getNCvx_ushort_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 935
+#line 919
const size_t *start, size_t nelems, uchar *value)
-#line 935
+#line 919
{
-#line 935
+#line 919
off_t offset = NC_varoffset(ncp, varp, start);
-#line 935
+#line 919
size_t remaining = varp->xsz * nelems;
-#line 935
+#line 919
int status = NC_NOERR;
-#line 935
+#line 919
const void *xp;
-#line 935
+#line 919
-#line 935
+#line 919
if(nelems == 0)
-#line 935
+#line 919
return NC_NOERR;
-#line 935
+#line 919
-#line 935
+#line 919
assert(value != NULL);
-#line 935
+#line 919
-#line 935
+#line 919
for(;;)
-#line 935
+#line 919
{
-#line 935
+#line 919
size_t extent = MIN(remaining, ncp->chunk);
-#line 935
+#line 919
size_t nget = ncx_howmany(varp->type, extent);
-#line 935
+#line 919
-#line 935
+#line 919
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 935
+#line 919
0, (void **)&xp); /* cast away const */
-#line 935
+#line 919
if(lstatus != NC_NOERR)
-#line 935
+#line 919
return lstatus;
-#line 935
+#line 919
-#line 935
+#line 919
lstatus = ncx_getn_ushort_uchar(&xp, nget, value);
-#line 935
+#line 919
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 935
+#line 919
status = lstatus;
-#line 935
+#line 919
-#line 935
+#line 919
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 935
+#line 919
-#line 935
+#line 919
remaining -= extent;
-#line 935
+#line 919
if(remaining == 0)
-#line 935
+#line 919
break; /* normal loop exit */
-#line 935
+#line 919
offset += (off_t)extent;
-#line 935
+#line 919
value += nget;
-#line 935
+#line 919
}
-#line 935
+#line 919
-#line 935
+#line 919
return status;
-#line 935
+#line 919
}
-#line 935
+#line 919
static int
-#line 936
+#line 920
getNCvx_ushort_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 936
+#line 920
const size_t *start, size_t nelems, short *value)
-#line 936
+#line 920
{
-#line 936
+#line 920
off_t offset = NC_varoffset(ncp, varp, start);
-#line 936
+#line 920
size_t remaining = varp->xsz * nelems;
-#line 936
+#line 920
int status = NC_NOERR;
-#line 936
+#line 920
const void *xp;
-#line 936
+#line 920
-#line 936
+#line 920
if(nelems == 0)
-#line 936
+#line 920
return NC_NOERR;
-#line 936
+#line 920
-#line 936
+#line 920
assert(value != NULL);
-#line 936
+#line 920
-#line 936
+#line 920
for(;;)
-#line 936
+#line 920
{
-#line 936
+#line 920
size_t extent = MIN(remaining, ncp->chunk);
-#line 936
+#line 920
size_t nget = ncx_howmany(varp->type, extent);
-#line 936
+#line 920
-#line 936
+#line 920
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 936
+#line 920
0, (void **)&xp); /* cast away const */
-#line 936
+#line 920
if(lstatus != NC_NOERR)
-#line 936
+#line 920
return lstatus;
-#line 936
+#line 920
-#line 936
+#line 920
lstatus = ncx_getn_ushort_short(&xp, nget, value);
-#line 936
+#line 920
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 936
+#line 920
status = lstatus;
-#line 936
+#line 920
-#line 936
+#line 920
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 936
+#line 920
-#line 936
+#line 920
remaining -= extent;
-#line 936
+#line 920
if(remaining == 0)
-#line 936
+#line 920
break; /* normal loop exit */
-#line 936
+#line 920
offset += (off_t)extent;
-#line 936
+#line 920
value += nget;
-#line 936
+#line 920
}
-#line 936
+#line 920
-#line 936
+#line 920
return status;
-#line 936
+#line 920
}
-#line 936
+#line 920
static int
-#line 937
+#line 921
getNCvx_ushort_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 937
+#line 921
const size_t *start, size_t nelems, int *value)
-#line 937
+#line 921
{
-#line 937
+#line 921
off_t offset = NC_varoffset(ncp, varp, start);
-#line 937
+#line 921
size_t remaining = varp->xsz * nelems;
-#line 937
+#line 921
int status = NC_NOERR;
-#line 937
+#line 921
const void *xp;
-#line 937
+#line 921
-#line 937
+#line 921
if(nelems == 0)
-#line 937
+#line 921
return NC_NOERR;
-#line 937
+#line 921
-#line 937
+#line 921
assert(value != NULL);
-#line 937
+#line 921
-#line 937
+#line 921
for(;;)
-#line 937
+#line 921
{
-#line 937
+#line 921
size_t extent = MIN(remaining, ncp->chunk);
-#line 937
+#line 921
size_t nget = ncx_howmany(varp->type, extent);
-#line 937
+#line 921
-#line 937
+#line 921
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 937
+#line 921
0, (void **)&xp); /* cast away const */
-#line 937
+#line 921
if(lstatus != NC_NOERR)
-#line 937
+#line 921
return lstatus;
-#line 937
+#line 921
-#line 937
+#line 921
lstatus = ncx_getn_ushort_int(&xp, nget, value);
-#line 937
+#line 921
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 937
+#line 921
status = lstatus;
-#line 937
+#line 921
-#line 937
+#line 921
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 937
+#line 921
-#line 937
+#line 921
remaining -= extent;
-#line 937
+#line 921
if(remaining == 0)
-#line 937
+#line 921
break; /* normal loop exit */
-#line 937
+#line 921
offset += (off_t)extent;
-#line 937
+#line 921
value += nget;
-#line 937
+#line 921
}
-#line 937
+#line 921
-#line 937
+#line 921
return status;
-#line 937
+#line 921
}
-#line 937
+#line 921
static int
-#line 938
+#line 922
getNCvx_ushort_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 938
+#line 922
const size_t *start, size_t nelems, float *value)
-#line 938
+#line 922
{
-#line 938
+#line 922
off_t offset = NC_varoffset(ncp, varp, start);
-#line 938
+#line 922
size_t remaining = varp->xsz * nelems;
-#line 938
+#line 922
int status = NC_NOERR;
-#line 938
+#line 922
const void *xp;
-#line 938
+#line 922
-#line 938
+#line 922
if(nelems == 0)
-#line 938
+#line 922
return NC_NOERR;
-#line 938
+#line 922
-#line 938
+#line 922
assert(value != NULL);
-#line 938
+#line 922
-#line 938
+#line 922
for(;;)
-#line 938
+#line 922
{
-#line 938
+#line 922
size_t extent = MIN(remaining, ncp->chunk);
-#line 938
+#line 922
size_t nget = ncx_howmany(varp->type, extent);
-#line 938
+#line 922
-#line 938
+#line 922
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 938
+#line 922
0, (void **)&xp); /* cast away const */
-#line 938
+#line 922
if(lstatus != NC_NOERR)
-#line 938
+#line 922
return lstatus;
-#line 938
+#line 922
-#line 938
+#line 922
lstatus = ncx_getn_ushort_float(&xp, nget, value);
-#line 938
+#line 922
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 938
+#line 922
status = lstatus;
-#line 938
+#line 922
-#line 938
+#line 922
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 938
+#line 922
-#line 938
+#line 922
remaining -= extent;
-#line 938
+#line 922
if(remaining == 0)
-#line 938
+#line 922
break; /* normal loop exit */
-#line 938
+#line 922
offset += (off_t)extent;
-#line 938
+#line 922
value += nget;
-#line 938
+#line 922
}
-#line 938
+#line 922
-#line 938
+#line 922
return status;
-#line 938
+#line 922
}
-#line 938
+#line 922
static int
-#line 939
+#line 923
getNCvx_ushort_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 939
+#line 923
const size_t *start, size_t nelems, double *value)
-#line 939
+#line 923
{
-#line 939
+#line 923
off_t offset = NC_varoffset(ncp, varp, start);
-#line 939
+#line 923
size_t remaining = varp->xsz * nelems;
-#line 939
+#line 923
int status = NC_NOERR;
-#line 939
+#line 923
const void *xp;
-#line 939
+#line 923
-#line 939
+#line 923
if(nelems == 0)
-#line 939
+#line 923
return NC_NOERR;
-#line 939
+#line 923
-#line 939
+#line 923
assert(value != NULL);
-#line 939
+#line 923
-#line 939
+#line 923
for(;;)
-#line 939
+#line 923
{
-#line 939
+#line 923
size_t extent = MIN(remaining, ncp->chunk);
-#line 939
+#line 923
size_t nget = ncx_howmany(varp->type, extent);
-#line 939
+#line 923
-#line 939
+#line 923
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 939
+#line 923
0, (void **)&xp); /* cast away const */
-#line 939
+#line 923
if(lstatus != NC_NOERR)
-#line 939
+#line 923
return lstatus;
-#line 939
+#line 923
-#line 939
+#line 923
lstatus = ncx_getn_ushort_double(&xp, nget, value);
-#line 939
+#line 923
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 939
+#line 923
status = lstatus;
-#line 939
+#line 923
-#line 939
+#line 923
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 939
+#line 923
-#line 939
+#line 923
remaining -= extent;
-#line 939
+#line 923
if(remaining == 0)
-#line 939
+#line 923
break; /* normal loop exit */
-#line 939
+#line 923
offset += (off_t)extent;
-#line 939
+#line 923
value += nget;
-#line 939
+#line 923
}
-#line 939
+#line 923
-#line 939
+#line 923
return status;
-#line 939
+#line 923
}
-#line 939
+#line 923
static int
-#line 940
+#line 924
getNCvx_ushort_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 940
+#line 924
const size_t *start, size_t nelems, longlong *value)
-#line 940
+#line 924
{
-#line 940
+#line 924
off_t offset = NC_varoffset(ncp, varp, start);
-#line 940
+#line 924
size_t remaining = varp->xsz * nelems;
-#line 940
+#line 924
int status = NC_NOERR;
-#line 940
+#line 924
const void *xp;
-#line 940
+#line 924
-#line 940
+#line 924
if(nelems == 0)
-#line 940
+#line 924
return NC_NOERR;
-#line 940
+#line 924
-#line 940
+#line 924
assert(value != NULL);
-#line 940
+#line 924
-#line 940
+#line 924
for(;;)
-#line 940
+#line 924
{
-#line 940
+#line 924
size_t extent = MIN(remaining, ncp->chunk);
-#line 940
+#line 924
size_t nget = ncx_howmany(varp->type, extent);
-#line 940
+#line 924
-#line 940
+#line 924
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 940
+#line 924
0, (void **)&xp); /* cast away const */
-#line 940
+#line 924
if(lstatus != NC_NOERR)
-#line 940
+#line 924
return lstatus;
-#line 940
+#line 924
-#line 940
+#line 924
lstatus = ncx_getn_ushort_longlong(&xp, nget, value);
-#line 940
+#line 924
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 940
+#line 924
status = lstatus;
-#line 940
+#line 924
-#line 940
+#line 924
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 940
+#line 924
-#line 940
+#line 924
remaining -= extent;
-#line 940
+#line 924
if(remaining == 0)
-#line 940
+#line 924
break; /* normal loop exit */
-#line 940
+#line 924
offset += (off_t)extent;
-#line 940
+#line 924
value += nget;
-#line 940
+#line 924
}
-#line 940
+#line 924
-#line 940
+#line 924
return status;
-#line 940
+#line 924
}
-#line 940
+#line 924
static int
-#line 941
+#line 925
getNCvx_ushort_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 941
+#line 925
const size_t *start, size_t nelems, uint *value)
-#line 941
+#line 925
{
-#line 941
+#line 925
off_t offset = NC_varoffset(ncp, varp, start);
-#line 941
+#line 925
size_t remaining = varp->xsz * nelems;
-#line 941
+#line 925
int status = NC_NOERR;
-#line 941
+#line 925
const void *xp;
-#line 941
+#line 925
-#line 941
+#line 925
if(nelems == 0)
-#line 941
+#line 925
return NC_NOERR;
-#line 941
+#line 925
-#line 941
+#line 925
assert(value != NULL);
-#line 941
+#line 925
-#line 941
+#line 925
for(;;)
-#line 941
+#line 925
{
-#line 941
+#line 925
size_t extent = MIN(remaining, ncp->chunk);
-#line 941
+#line 925
size_t nget = ncx_howmany(varp->type, extent);
-#line 941
+#line 925
-#line 941
+#line 925
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 941
+#line 925
0, (void **)&xp); /* cast away const */
-#line 941
+#line 925
if(lstatus != NC_NOERR)
-#line 941
+#line 925
return lstatus;
-#line 941
+#line 925
-#line 941
+#line 925
lstatus = ncx_getn_ushort_uint(&xp, nget, value);
-#line 941
+#line 925
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 941
+#line 925
status = lstatus;
-#line 941
+#line 925
-#line 941
+#line 925
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 941
+#line 925
-#line 941
+#line 925
remaining -= extent;
-#line 941
+#line 925
if(remaining == 0)
-#line 941
+#line 925
break; /* normal loop exit */
-#line 941
+#line 925
offset += (off_t)extent;
-#line 941
+#line 925
value += nget;
-#line 941
+#line 925
}
-#line 941
+#line 925
-#line 941
+#line 925
return status;
-#line 941
+#line 925
}
-#line 941
+#line 925
static int
-#line 942
+#line 926
getNCvx_ushort_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 942
+#line 926
const size_t *start, size_t nelems, ulonglong *value)
-#line 942
+#line 926
{
-#line 942
+#line 926
off_t offset = NC_varoffset(ncp, varp, start);
-#line 942
+#line 926
size_t remaining = varp->xsz * nelems;
-#line 942
+#line 926
int status = NC_NOERR;
-#line 942
+#line 926
const void *xp;
-#line 942
+#line 926
-#line 942
+#line 926
if(nelems == 0)
-#line 942
+#line 926
return NC_NOERR;
-#line 942
+#line 926
-#line 942
+#line 926
assert(value != NULL);
-#line 942
+#line 926
-#line 942
+#line 926
for(;;)
-#line 942
+#line 926
{
-#line 942
+#line 926
size_t extent = MIN(remaining, ncp->chunk);
-#line 942
+#line 926
size_t nget = ncx_howmany(varp->type, extent);
-#line 942
+#line 926
-#line 942
+#line 926
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 942
+#line 926
0, (void **)&xp); /* cast away const */
-#line 942
+#line 926
if(lstatus != NC_NOERR)
-#line 942
+#line 926
return lstatus;
-#line 942
+#line 926
-#line 942
+#line 926
lstatus = ncx_getn_ushort_ulonglong(&xp, nget, value);
-#line 942
+#line 926
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 942
+#line 926
status = lstatus;
-#line 942
+#line 926
-#line 942
+#line 926
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 942
+#line 926
-#line 942
+#line 926
remaining -= extent;
-#line 942
+#line 926
if(remaining == 0)
-#line 942
+#line 926
break; /* normal loop exit */
-#line 942
+#line 926
offset += (off_t)extent;
-#line 942
+#line 926
value += nget;
-#line 942
+#line 926
}
-#line 942
+#line 926
-#line 942
+#line 926
return status;
-#line 942
+#line 926
}
-#line 942
+#line 926
static int
-#line 943
+#line 927
getNCvx_ushort_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 943
+#line 927
const size_t *start, size_t nelems, ushort *value)
-#line 943
+#line 927
{
-#line 943
+#line 927
off_t offset = NC_varoffset(ncp, varp, start);
-#line 943
+#line 927
size_t remaining = varp->xsz * nelems;
-#line 943
+#line 927
int status = NC_NOERR;
-#line 943
+#line 927
const void *xp;
-#line 943
+#line 927
-#line 943
+#line 927
if(nelems == 0)
-#line 943
+#line 927
return NC_NOERR;
-#line 943
+#line 927
-#line 943
+#line 927
assert(value != NULL);
-#line 943
+#line 927
-#line 943
+#line 927
for(;;)
-#line 943
+#line 927
{
-#line 943
+#line 927
size_t extent = MIN(remaining, ncp->chunk);
-#line 943
+#line 927
size_t nget = ncx_howmany(varp->type, extent);
-#line 943
+#line 927
-#line 943
+#line 927
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 943
+#line 927
0, (void **)&xp); /* cast away const */
-#line 943
+#line 927
if(lstatus != NC_NOERR)
-#line 943
+#line 927
return lstatus;
-#line 943
+#line 927
-#line 943
+#line 927
lstatus = ncx_getn_ushort_ushort(&xp, nget, value);
-#line 943
+#line 927
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 943
+#line 927
status = lstatus;
-#line 943
+#line 927
-#line 943
+#line 927
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 943
+#line 927
-#line 943
+#line 927
remaining -= extent;
-#line 943
+#line 927
if(remaining == 0)
-#line 943
+#line 927
break; /* normal loop exit */
-#line 943
+#line 927
offset += (off_t)extent;
-#line 943
+#line 927
value += nget;
-#line 943
+#line 927
}
-#line 943
+#line 927
-#line 943
+#line 927
return status;
-#line 943
+#line 927
}
-#line 943
+#line 927
static int
-#line 945
+#line 929
getNCvx_uint_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 945
+#line 929
const size_t *start, size_t nelems, schar *value)
-#line 945
+#line 929
{
-#line 945
+#line 929
off_t offset = NC_varoffset(ncp, varp, start);
-#line 945
+#line 929
size_t remaining = varp->xsz * nelems;
-#line 945
+#line 929
int status = NC_NOERR;
-#line 945
+#line 929
const void *xp;
-#line 945
+#line 929
-#line 945
+#line 929
if(nelems == 0)
-#line 945
+#line 929
return NC_NOERR;
-#line 945
+#line 929
-#line 945
+#line 929
assert(value != NULL);
-#line 945
+#line 929
-#line 945
+#line 929
for(;;)
-#line 945
+#line 929
{
-#line 945
+#line 929
size_t extent = MIN(remaining, ncp->chunk);
-#line 945
+#line 929
size_t nget = ncx_howmany(varp->type, extent);
-#line 945
+#line 929
-#line 945
+#line 929
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 945
+#line 929
0, (void **)&xp); /* cast away const */
-#line 945
+#line 929
if(lstatus != NC_NOERR)
-#line 945
+#line 929
return lstatus;
-#line 945
+#line 929
-#line 945
+#line 929
lstatus = ncx_getn_uint_schar(&xp, nget, value);
-#line 945
+#line 929
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 945
+#line 929
status = lstatus;
-#line 945
+#line 929
-#line 945
+#line 929
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 945
+#line 929
-#line 945
+#line 929
remaining -= extent;
-#line 945
+#line 929
if(remaining == 0)
-#line 945
+#line 929
break; /* normal loop exit */
-#line 945
+#line 929
offset += (off_t)extent;
-#line 945
+#line 929
value += nget;
-#line 945
+#line 929
}
-#line 945
+#line 929
-#line 945
+#line 929
return status;
-#line 945
+#line 929
}
-#line 945
+#line 929
static int
-#line 946
+#line 930
getNCvx_uint_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 946
+#line 930
const size_t *start, size_t nelems, uchar *value)
-#line 946
+#line 930
{
-#line 946
+#line 930
off_t offset = NC_varoffset(ncp, varp, start);
-#line 946
+#line 930
size_t remaining = varp->xsz * nelems;
-#line 946
+#line 930
int status = NC_NOERR;
-#line 946
+#line 930
const void *xp;
-#line 946
+#line 930
-#line 946
+#line 930
if(nelems == 0)
-#line 946
+#line 930
return NC_NOERR;
-#line 946
+#line 930
-#line 946
+#line 930
assert(value != NULL);
-#line 946
+#line 930
-#line 946
+#line 930
for(;;)
-#line 946
+#line 930
{
-#line 946
+#line 930
size_t extent = MIN(remaining, ncp->chunk);
-#line 946
+#line 930
size_t nget = ncx_howmany(varp->type, extent);
-#line 946
+#line 930
-#line 946
+#line 930
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 946
+#line 930
0, (void **)&xp); /* cast away const */
-#line 946
+#line 930
if(lstatus != NC_NOERR)
-#line 946
+#line 930
return lstatus;
-#line 946
+#line 930
-#line 946
+#line 930
lstatus = ncx_getn_uint_uchar(&xp, nget, value);
-#line 946
+#line 930
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 946
+#line 930
status = lstatus;
-#line 946
+#line 930
-#line 946
+#line 930
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 946
+#line 930
-#line 946
+#line 930
remaining -= extent;
-#line 946
+#line 930
if(remaining == 0)
-#line 946
+#line 930
break; /* normal loop exit */
-#line 946
+#line 930
offset += (off_t)extent;
-#line 946
+#line 930
value += nget;
-#line 946
+#line 930
}
-#line 946
+#line 930
-#line 946
+#line 930
return status;
-#line 946
+#line 930
}
-#line 946
+#line 930
static int
-#line 947
+#line 931
getNCvx_uint_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 947
+#line 931
const size_t *start, size_t nelems, short *value)
-#line 947
+#line 931
{
-#line 947
+#line 931
off_t offset = NC_varoffset(ncp, varp, start);
-#line 947
+#line 931
size_t remaining = varp->xsz * nelems;
-#line 947
+#line 931
int status = NC_NOERR;
-#line 947
+#line 931
const void *xp;
-#line 947
+#line 931
-#line 947
+#line 931
if(nelems == 0)
-#line 947
+#line 931
return NC_NOERR;
-#line 947
+#line 931
-#line 947
+#line 931
assert(value != NULL);
-#line 947
+#line 931
-#line 947
+#line 931
for(;;)
-#line 947
+#line 931
{
-#line 947
+#line 931
size_t extent = MIN(remaining, ncp->chunk);
-#line 947
+#line 931
size_t nget = ncx_howmany(varp->type, extent);
-#line 947
+#line 931
-#line 947
+#line 931
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 947
+#line 931
0, (void **)&xp); /* cast away const */
-#line 947
+#line 931
if(lstatus != NC_NOERR)
-#line 947
+#line 931
return lstatus;
-#line 947
+#line 931
-#line 947
+#line 931
lstatus = ncx_getn_uint_short(&xp, nget, value);
-#line 947
+#line 931
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 947
+#line 931
status = lstatus;
-#line 947
+#line 931
-#line 947
+#line 931
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 947
+#line 931
-#line 947
+#line 931
remaining -= extent;
-#line 947
+#line 931
if(remaining == 0)
-#line 947
+#line 931
break; /* normal loop exit */
-#line 947
+#line 931
offset += (off_t)extent;
-#line 947
+#line 931
value += nget;
-#line 947
+#line 931
}
-#line 947
+#line 931
-#line 947
+#line 931
return status;
-#line 947
+#line 931
}
-#line 947
+#line 931
static int
-#line 948
+#line 932
getNCvx_uint_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 948
+#line 932
const size_t *start, size_t nelems, int *value)
-#line 948
+#line 932
{
-#line 948
+#line 932
off_t offset = NC_varoffset(ncp, varp, start);
-#line 948
+#line 932
size_t remaining = varp->xsz * nelems;
-#line 948
+#line 932
int status = NC_NOERR;
-#line 948
+#line 932
const void *xp;
-#line 948
+#line 932
-#line 948
+#line 932
if(nelems == 0)
-#line 948
+#line 932
return NC_NOERR;
-#line 948
+#line 932
-#line 948
+#line 932
assert(value != NULL);
-#line 948
+#line 932
-#line 948
+#line 932
for(;;)
-#line 948
+#line 932
{
-#line 948
+#line 932
size_t extent = MIN(remaining, ncp->chunk);
-#line 948
+#line 932
size_t nget = ncx_howmany(varp->type, extent);
-#line 948
+#line 932
-#line 948
+#line 932
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 948
+#line 932
0, (void **)&xp); /* cast away const */
-#line 948
+#line 932
if(lstatus != NC_NOERR)
-#line 948
+#line 932
return lstatus;
-#line 948
+#line 932
-#line 948
+#line 932
lstatus = ncx_getn_uint_int(&xp, nget, value);
-#line 948
+#line 932
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 948
+#line 932
status = lstatus;
-#line 948
+#line 932
-#line 948
+#line 932
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 948
+#line 932
-#line 948
+#line 932
remaining -= extent;
-#line 948
+#line 932
if(remaining == 0)
-#line 948
+#line 932
break; /* normal loop exit */
-#line 948
+#line 932
offset += (off_t)extent;
-#line 948
+#line 932
value += nget;
-#line 948
+#line 932
}
-#line 948
+#line 932
-#line 948
+#line 932
return status;
-#line 948
+#line 932
}
-#line 948
+#line 932
static int
-#line 949
+#line 933
getNCvx_uint_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 949
+#line 933
const size_t *start, size_t nelems, float *value)
-#line 949
+#line 933
{
-#line 949
+#line 933
off_t offset = NC_varoffset(ncp, varp, start);
-#line 949
+#line 933
size_t remaining = varp->xsz * nelems;
-#line 949
+#line 933
int status = NC_NOERR;
-#line 949
+#line 933
const void *xp;
-#line 949
+#line 933
-#line 949
+#line 933
if(nelems == 0)
-#line 949
+#line 933
return NC_NOERR;
-#line 949
+#line 933
-#line 949
+#line 933
assert(value != NULL);
-#line 949
+#line 933
-#line 949
+#line 933
for(;;)
-#line 949
+#line 933
{
-#line 949
+#line 933
size_t extent = MIN(remaining, ncp->chunk);
-#line 949
+#line 933
size_t nget = ncx_howmany(varp->type, extent);
-#line 949
+#line 933
-#line 949
+#line 933
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 949
+#line 933
0, (void **)&xp); /* cast away const */
-#line 949
+#line 933
if(lstatus != NC_NOERR)
-#line 949
+#line 933
return lstatus;
-#line 949
+#line 933
-#line 949
+#line 933
lstatus = ncx_getn_uint_float(&xp, nget, value);
-#line 949
+#line 933
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 949
+#line 933
status = lstatus;
-#line 949
+#line 933
-#line 949
+#line 933
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 949
+#line 933
-#line 949
+#line 933
remaining -= extent;
-#line 949
+#line 933
if(remaining == 0)
-#line 949
+#line 933
break; /* normal loop exit */
-#line 949
+#line 933
offset += (off_t)extent;
-#line 949
+#line 933
value += nget;
-#line 949
+#line 933
}
-#line 949
+#line 933
-#line 949
+#line 933
return status;
-#line 949
+#line 933
}
-#line 949
+#line 933
static int
-#line 950
+#line 934
getNCvx_uint_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 950
+#line 934
const size_t *start, size_t nelems, double *value)
-#line 950
+#line 934
{
-#line 950
+#line 934
off_t offset = NC_varoffset(ncp, varp, start);
-#line 950
+#line 934
size_t remaining = varp->xsz * nelems;
-#line 950
+#line 934
int status = NC_NOERR;
-#line 950
+#line 934
const void *xp;
-#line 950
+#line 934
-#line 950
+#line 934
if(nelems == 0)
-#line 950
+#line 934
return NC_NOERR;
-#line 950
+#line 934
-#line 950
+#line 934
assert(value != NULL);
-#line 950
+#line 934
-#line 950
+#line 934
for(;;)
-#line 950
+#line 934
{
-#line 950
+#line 934
size_t extent = MIN(remaining, ncp->chunk);
-#line 950
+#line 934
size_t nget = ncx_howmany(varp->type, extent);
-#line 950
+#line 934
-#line 950
+#line 934
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 950
+#line 934
0, (void **)&xp); /* cast away const */
-#line 950
+#line 934
if(lstatus != NC_NOERR)
-#line 950
+#line 934
return lstatus;
-#line 950
+#line 934
-#line 950
+#line 934
lstatus = ncx_getn_uint_double(&xp, nget, value);
-#line 950
+#line 934
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 950
+#line 934
status = lstatus;
-#line 950
+#line 934
-#line 950
+#line 934
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 950
+#line 934
-#line 950
+#line 934
remaining -= extent;
-#line 950
+#line 934
if(remaining == 0)
-#line 950
+#line 934
break; /* normal loop exit */
-#line 950
+#line 934
offset += (off_t)extent;
-#line 950
+#line 934
value += nget;
-#line 950
+#line 934
}
-#line 950
+#line 934
-#line 950
+#line 934
return status;
-#line 950
+#line 934
}
-#line 950
+#line 934
static int
-#line 951
+#line 935
getNCvx_uint_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 951
+#line 935
const size_t *start, size_t nelems, longlong *value)
-#line 951
+#line 935
{
-#line 951
+#line 935
off_t offset = NC_varoffset(ncp, varp, start);
-#line 951
+#line 935
size_t remaining = varp->xsz * nelems;
-#line 951
+#line 935
int status = NC_NOERR;
-#line 951
+#line 935
const void *xp;
-#line 951
+#line 935
-#line 951
+#line 935
if(nelems == 0)
-#line 951
+#line 935
return NC_NOERR;
-#line 951
+#line 935
-#line 951
+#line 935
assert(value != NULL);
-#line 951
+#line 935
-#line 951
+#line 935
for(;;)
-#line 951
+#line 935
{
-#line 951
+#line 935
size_t extent = MIN(remaining, ncp->chunk);
-#line 951
+#line 935
size_t nget = ncx_howmany(varp->type, extent);
-#line 951
+#line 935
-#line 951
+#line 935
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 951
+#line 935
0, (void **)&xp); /* cast away const */
-#line 951
+#line 935
if(lstatus != NC_NOERR)
-#line 951
+#line 935
return lstatus;
-#line 951
+#line 935
-#line 951
+#line 935
lstatus = ncx_getn_uint_longlong(&xp, nget, value);
-#line 951
+#line 935
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 951
+#line 935
status = lstatus;
-#line 951
+#line 935
-#line 951
+#line 935
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 951
+#line 935
-#line 951
+#line 935
remaining -= extent;
-#line 951
+#line 935
if(remaining == 0)
-#line 951
+#line 935
break; /* normal loop exit */
-#line 951
+#line 935
offset += (off_t)extent;
-#line 951
+#line 935
value += nget;
-#line 951
+#line 935
}
-#line 951
+#line 935
-#line 951
+#line 935
return status;
-#line 951
+#line 935
}
-#line 951
+#line 935
static int
-#line 952
+#line 936
getNCvx_uint_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 952
+#line 936
const size_t *start, size_t nelems, uint *value)
-#line 952
+#line 936
{
-#line 952
+#line 936
off_t offset = NC_varoffset(ncp, varp, start);
-#line 952
+#line 936
size_t remaining = varp->xsz * nelems;
-#line 952
+#line 936
int status = NC_NOERR;
-#line 952
+#line 936
const void *xp;
-#line 952
+#line 936
-#line 952
+#line 936
if(nelems == 0)
-#line 952
+#line 936
return NC_NOERR;
-#line 952
+#line 936
-#line 952
+#line 936
assert(value != NULL);
-#line 952
+#line 936
-#line 952
+#line 936
for(;;)
-#line 952
+#line 936
{
-#line 952
+#line 936
size_t extent = MIN(remaining, ncp->chunk);
-#line 952
+#line 936
size_t nget = ncx_howmany(varp->type, extent);
-#line 952
+#line 936
-#line 952
+#line 936
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 952
+#line 936
0, (void **)&xp); /* cast away const */
-#line 952
+#line 936
if(lstatus != NC_NOERR)
-#line 952
+#line 936
return lstatus;
-#line 952
+#line 936
-#line 952
+#line 936
lstatus = ncx_getn_uint_uint(&xp, nget, value);
-#line 952
+#line 936
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 952
+#line 936
status = lstatus;
-#line 952
+#line 936
-#line 952
+#line 936
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 952
+#line 936
-#line 952
+#line 936
remaining -= extent;
-#line 952
+#line 936
if(remaining == 0)
-#line 952
+#line 936
break; /* normal loop exit */
-#line 952
+#line 936
offset += (off_t)extent;
-#line 952
+#line 936
value += nget;
-#line 952
+#line 936
}
-#line 952
+#line 936
-#line 952
+#line 936
return status;
-#line 952
+#line 936
}
-#line 952
+#line 936
static int
-#line 953
+#line 937
getNCvx_uint_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 953
+#line 937
const size_t *start, size_t nelems, ulonglong *value)
-#line 953
+#line 937
{
-#line 953
+#line 937
off_t offset = NC_varoffset(ncp, varp, start);
-#line 953
+#line 937
size_t remaining = varp->xsz * nelems;
-#line 953
+#line 937
int status = NC_NOERR;
-#line 953
+#line 937
const void *xp;
-#line 953
+#line 937
-#line 953
+#line 937
if(nelems == 0)
-#line 953
+#line 937
return NC_NOERR;
-#line 953
+#line 937
-#line 953
+#line 937
assert(value != NULL);
-#line 953
+#line 937
-#line 953
+#line 937
for(;;)
-#line 953
+#line 937
{
-#line 953
+#line 937
size_t extent = MIN(remaining, ncp->chunk);
-#line 953
+#line 937
size_t nget = ncx_howmany(varp->type, extent);
-#line 953
+#line 937
-#line 953
+#line 937
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 953
+#line 937
0, (void **)&xp); /* cast away const */
-#line 953
+#line 937
if(lstatus != NC_NOERR)
-#line 953
+#line 937
return lstatus;
-#line 953
+#line 937
-#line 953
+#line 937
lstatus = ncx_getn_uint_ulonglong(&xp, nget, value);
-#line 953
+#line 937
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 953
+#line 937
status = lstatus;
-#line 953
+#line 937
-#line 953
+#line 937
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 953
+#line 937
-#line 953
+#line 937
remaining -= extent;
-#line 953
+#line 937
if(remaining == 0)
-#line 953
+#line 937
break; /* normal loop exit */
-#line 953
+#line 937
offset += (off_t)extent;
-#line 953
+#line 937
value += nget;
-#line 953
+#line 937
}
-#line 953
+#line 937
-#line 953
+#line 937
return status;
-#line 953
+#line 937
}
-#line 953
+#line 937
static int
-#line 954
+#line 938
getNCvx_uint_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 954
+#line 938
const size_t *start, size_t nelems, ushort *value)
-#line 954
+#line 938
{
-#line 954
+#line 938
off_t offset = NC_varoffset(ncp, varp, start);
-#line 954
+#line 938
size_t remaining = varp->xsz * nelems;
-#line 954
+#line 938
int status = NC_NOERR;
-#line 954
+#line 938
const void *xp;
-#line 954
+#line 938
-#line 954
+#line 938
if(nelems == 0)
-#line 954
+#line 938
return NC_NOERR;
-#line 954
+#line 938
-#line 954
+#line 938
assert(value != NULL);
-#line 954
+#line 938
-#line 954
+#line 938
for(;;)
-#line 954
+#line 938
{
-#line 954
+#line 938
size_t extent = MIN(remaining, ncp->chunk);
-#line 954
+#line 938
size_t nget = ncx_howmany(varp->type, extent);
-#line 954
+#line 938
-#line 954
+#line 938
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 954
+#line 938
0, (void **)&xp); /* cast away const */
-#line 954
+#line 938
if(lstatus != NC_NOERR)
-#line 954
+#line 938
return lstatus;
-#line 954
+#line 938
-#line 954
+#line 938
lstatus = ncx_getn_uint_ushort(&xp, nget, value);
-#line 954
+#line 938
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 954
+#line 938
status = lstatus;
-#line 954
+#line 938
-#line 954
+#line 938
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 954
+#line 938
-#line 954
+#line 938
remaining -= extent;
-#line 954
+#line 938
if(remaining == 0)
-#line 954
+#line 938
break; /* normal loop exit */
-#line 954
+#line 938
offset += (off_t)extent;
-#line 954
+#line 938
value += nget;
-#line 954
+#line 938
}
-#line 954
+#line 938
-#line 954
+#line 938
return status;
-#line 954
+#line 938
}
-#line 954
+#line 938
static int
-#line 956
+#line 940
getNCvx_longlong_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 956
+#line 940
const size_t *start, size_t nelems, schar *value)
-#line 956
+#line 940
{
-#line 956
+#line 940
off_t offset = NC_varoffset(ncp, varp, start);
-#line 956
+#line 940
size_t remaining = varp->xsz * nelems;
-#line 956
+#line 940
int status = NC_NOERR;
-#line 956
+#line 940
const void *xp;
-#line 956
+#line 940
-#line 956
+#line 940
if(nelems == 0)
-#line 956
+#line 940
return NC_NOERR;
-#line 956
+#line 940
-#line 956
+#line 940
assert(value != NULL);
-#line 956
+#line 940
-#line 956
+#line 940
for(;;)
-#line 956
+#line 940
{
-#line 956
+#line 940
size_t extent = MIN(remaining, ncp->chunk);
-#line 956
+#line 940
size_t nget = ncx_howmany(varp->type, extent);
-#line 956
+#line 940
-#line 956
+#line 940
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 956
+#line 940
0, (void **)&xp); /* cast away const */
-#line 956
+#line 940
if(lstatus != NC_NOERR)
-#line 956
+#line 940
return lstatus;
-#line 956
+#line 940
-#line 956
+#line 940
lstatus = ncx_getn_longlong_schar(&xp, nget, value);
-#line 956
+#line 940
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 956
+#line 940
status = lstatus;
-#line 956
+#line 940
-#line 956
+#line 940
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 956
+#line 940
-#line 956
+#line 940
remaining -= extent;
-#line 956
+#line 940
if(remaining == 0)
-#line 956
+#line 940
break; /* normal loop exit */
-#line 956
+#line 940
offset += (off_t)extent;
-#line 956
+#line 940
value += nget;
-#line 956
+#line 940
}
-#line 956
+#line 940
-#line 956
+#line 940
return status;
-#line 956
+#line 940
}
-#line 956
+#line 940
static int
-#line 957
+#line 941
getNCvx_longlong_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 957
+#line 941
const size_t *start, size_t nelems, uchar *value)
-#line 957
+#line 941
{
-#line 957
+#line 941
off_t offset = NC_varoffset(ncp, varp, start);
-#line 957
+#line 941
size_t remaining = varp->xsz * nelems;
-#line 957
+#line 941
int status = NC_NOERR;
-#line 957
+#line 941
const void *xp;
-#line 957
+#line 941
-#line 957
+#line 941
if(nelems == 0)
-#line 957
+#line 941
return NC_NOERR;
-#line 957
+#line 941
-#line 957
+#line 941
assert(value != NULL);
-#line 957
+#line 941
-#line 957
+#line 941
for(;;)
-#line 957
+#line 941
{
-#line 957
+#line 941
size_t extent = MIN(remaining, ncp->chunk);
-#line 957
+#line 941
size_t nget = ncx_howmany(varp->type, extent);
-#line 957
+#line 941
-#line 957
+#line 941
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 957
+#line 941
0, (void **)&xp); /* cast away const */
-#line 957
+#line 941
if(lstatus != NC_NOERR)
-#line 957
+#line 941
return lstatus;
-#line 957
+#line 941
-#line 957
+#line 941
lstatus = ncx_getn_longlong_uchar(&xp, nget, value);
-#line 957
+#line 941
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 957
+#line 941
status = lstatus;
-#line 957
+#line 941
-#line 957
+#line 941
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 957
+#line 941
-#line 957
+#line 941
remaining -= extent;
-#line 957
+#line 941
if(remaining == 0)
-#line 957
+#line 941
break; /* normal loop exit */
-#line 957
+#line 941
offset += (off_t)extent;
-#line 957
+#line 941
value += nget;
-#line 957
+#line 941
}
-#line 957
+#line 941
-#line 957
+#line 941
return status;
-#line 957
+#line 941
}
-#line 957
+#line 941
static int
-#line 958
+#line 942
getNCvx_longlong_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 958
+#line 942
const size_t *start, size_t nelems, short *value)
-#line 958
+#line 942
{
-#line 958
+#line 942
off_t offset = NC_varoffset(ncp, varp, start);
-#line 958
+#line 942
size_t remaining = varp->xsz * nelems;
-#line 958
+#line 942
int status = NC_NOERR;
-#line 958
+#line 942
const void *xp;
-#line 958
+#line 942
-#line 958
+#line 942
if(nelems == 0)
-#line 958
+#line 942
return NC_NOERR;
-#line 958
+#line 942
-#line 958
+#line 942
assert(value != NULL);
-#line 958
+#line 942
-#line 958
+#line 942
for(;;)
-#line 958
+#line 942
{
-#line 958
+#line 942
size_t extent = MIN(remaining, ncp->chunk);
-#line 958
+#line 942
size_t nget = ncx_howmany(varp->type, extent);
-#line 958
+#line 942
-#line 958
+#line 942
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 958
+#line 942
0, (void **)&xp); /* cast away const */
-#line 958
+#line 942
if(lstatus != NC_NOERR)
-#line 958
+#line 942
return lstatus;
-#line 958
+#line 942
-#line 958
+#line 942
lstatus = ncx_getn_longlong_short(&xp, nget, value);
-#line 958
+#line 942
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 958
+#line 942
status = lstatus;
-#line 958
+#line 942
-#line 958
+#line 942
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 958
+#line 942
-#line 958
+#line 942
remaining -= extent;
-#line 958
+#line 942
if(remaining == 0)
-#line 958
+#line 942
break; /* normal loop exit */
-#line 958
+#line 942
offset += (off_t)extent;
-#line 958
+#line 942
value += nget;
-#line 958
+#line 942
}
-#line 958
+#line 942
-#line 958
+#line 942
return status;
-#line 958
+#line 942
}
-#line 958
+#line 942
static int
-#line 959
+#line 943
getNCvx_longlong_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 959
+#line 943
const size_t *start, size_t nelems, int *value)
-#line 959
+#line 943
{
-#line 959
+#line 943
off_t offset = NC_varoffset(ncp, varp, start);
-#line 959
+#line 943
size_t remaining = varp->xsz * nelems;
-#line 959
+#line 943
int status = NC_NOERR;
-#line 959
+#line 943
const void *xp;
-#line 959
+#line 943
-#line 959
+#line 943
if(nelems == 0)
-#line 959
+#line 943
return NC_NOERR;
-#line 959
+#line 943
-#line 959
+#line 943
assert(value != NULL);
-#line 959
+#line 943
-#line 959
+#line 943
for(;;)
-#line 959
+#line 943
{
-#line 959
+#line 943
size_t extent = MIN(remaining, ncp->chunk);
-#line 959
+#line 943
size_t nget = ncx_howmany(varp->type, extent);
-#line 959
+#line 943
-#line 959
+#line 943
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 959
+#line 943
0, (void **)&xp); /* cast away const */
-#line 959
+#line 943
if(lstatus != NC_NOERR)
-#line 959
+#line 943
return lstatus;
-#line 959
+#line 943
-#line 959
+#line 943
lstatus = ncx_getn_longlong_int(&xp, nget, value);
-#line 959
+#line 943
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 959
+#line 943
status = lstatus;
-#line 959
+#line 943
-#line 959
+#line 943
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 959
+#line 943
-#line 959
+#line 943
remaining -= extent;
-#line 959
+#line 943
if(remaining == 0)
-#line 959
+#line 943
break; /* normal loop exit */
-#line 959
+#line 943
offset += (off_t)extent;
-#line 959
+#line 943
value += nget;
-#line 959
+#line 943
}
-#line 959
+#line 943
-#line 959
+#line 943
return status;
-#line 959
+#line 943
}
-#line 959
+#line 943
static int
-#line 960
+#line 944
getNCvx_longlong_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 960
+#line 944
const size_t *start, size_t nelems, float *value)
-#line 960
+#line 944
{
-#line 960
+#line 944
off_t offset = NC_varoffset(ncp, varp, start);
-#line 960
+#line 944
size_t remaining = varp->xsz * nelems;
-#line 960
+#line 944
int status = NC_NOERR;
-#line 960
+#line 944
const void *xp;
-#line 960
+#line 944
-#line 960
+#line 944
if(nelems == 0)
-#line 960
+#line 944
return NC_NOERR;
-#line 960
+#line 944
-#line 960
+#line 944
assert(value != NULL);
-#line 960
+#line 944
-#line 960
+#line 944
for(;;)
-#line 960
+#line 944
{
-#line 960
+#line 944
size_t extent = MIN(remaining, ncp->chunk);
-#line 960
+#line 944
size_t nget = ncx_howmany(varp->type, extent);
-#line 960
+#line 944
-#line 960
+#line 944
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 960
+#line 944
0, (void **)&xp); /* cast away const */
-#line 960
+#line 944
if(lstatus != NC_NOERR)
-#line 960
+#line 944
return lstatus;
-#line 960
+#line 944
-#line 960
+#line 944
lstatus = ncx_getn_longlong_float(&xp, nget, value);
-#line 960
+#line 944
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 960
+#line 944
status = lstatus;
-#line 960
+#line 944
-#line 960
+#line 944
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 960
+#line 944
-#line 960
+#line 944
remaining -= extent;
-#line 960
+#line 944
if(remaining == 0)
-#line 960
+#line 944
break; /* normal loop exit */
-#line 960
+#line 944
offset += (off_t)extent;
-#line 960
+#line 944
value += nget;
-#line 960
+#line 944
}
-#line 960
+#line 944
-#line 960
+#line 944
return status;
-#line 960
+#line 944
}
-#line 960
+#line 944
static int
-#line 961
+#line 945
getNCvx_longlong_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 961
+#line 945
const size_t *start, size_t nelems, double *value)
-#line 961
+#line 945
{
-#line 961
+#line 945
off_t offset = NC_varoffset(ncp, varp, start);
-#line 961
+#line 945
size_t remaining = varp->xsz * nelems;
-#line 961
+#line 945
int status = NC_NOERR;
-#line 961
+#line 945
const void *xp;
-#line 961
+#line 945
-#line 961
+#line 945
if(nelems == 0)
-#line 961
+#line 945
return NC_NOERR;
-#line 961
+#line 945
-#line 961
+#line 945
assert(value != NULL);
-#line 961
+#line 945
-#line 961
+#line 945
for(;;)
-#line 961
+#line 945
{
-#line 961
+#line 945
size_t extent = MIN(remaining, ncp->chunk);
-#line 961
+#line 945
size_t nget = ncx_howmany(varp->type, extent);
-#line 961
+#line 945
-#line 961
+#line 945
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 961
+#line 945
0, (void **)&xp); /* cast away const */
-#line 961
+#line 945
if(lstatus != NC_NOERR)
-#line 961
+#line 945
return lstatus;
-#line 961
+#line 945
-#line 961
+#line 945
lstatus = ncx_getn_longlong_double(&xp, nget, value);
-#line 961
+#line 945
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 961
+#line 945
status = lstatus;
-#line 961
+#line 945
-#line 961
+#line 945
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 961
+#line 945
-#line 961
+#line 945
remaining -= extent;
-#line 961
+#line 945
if(remaining == 0)
-#line 961
+#line 945
break; /* normal loop exit */
-#line 961
+#line 945
offset += (off_t)extent;
-#line 961
+#line 945
value += nget;
-#line 961
+#line 945
}
-#line 961
+#line 945
-#line 961
+#line 945
return status;
-#line 961
+#line 945
}
-#line 961
+#line 945
static int
-#line 962
+#line 946
getNCvx_longlong_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 962
+#line 946
const size_t *start, size_t nelems, longlong *value)
-#line 962
+#line 946
{
-#line 962
+#line 946
off_t offset = NC_varoffset(ncp, varp, start);
-#line 962
+#line 946
size_t remaining = varp->xsz * nelems;
-#line 962
+#line 946
int status = NC_NOERR;
-#line 962
+#line 946
const void *xp;
-#line 962
+#line 946
-#line 962
+#line 946
if(nelems == 0)
-#line 962
+#line 946
return NC_NOERR;
-#line 962
+#line 946
-#line 962
+#line 946
assert(value != NULL);
-#line 962
+#line 946
-#line 962
+#line 946
for(;;)
-#line 962
+#line 946
{
-#line 962
+#line 946
size_t extent = MIN(remaining, ncp->chunk);
-#line 962
+#line 946
size_t nget = ncx_howmany(varp->type, extent);
-#line 962
+#line 946
-#line 962
+#line 946
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 962
+#line 946
0, (void **)&xp); /* cast away const */
-#line 962
+#line 946
if(lstatus != NC_NOERR)
-#line 962
+#line 946
return lstatus;
-#line 962
+#line 946
-#line 962
+#line 946
lstatus = ncx_getn_longlong_longlong(&xp, nget, value);
-#line 962
+#line 946
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 962
+#line 946
status = lstatus;
-#line 962
+#line 946
-#line 962
+#line 946
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 962
+#line 946
-#line 962
+#line 946
remaining -= extent;
-#line 962
+#line 946
if(remaining == 0)
-#line 962
+#line 946
break; /* normal loop exit */
-#line 962
+#line 946
offset += (off_t)extent;
-#line 962
+#line 946
value += nget;
-#line 962
+#line 946
}
-#line 962
+#line 946
-#line 962
+#line 946
return status;
-#line 962
+#line 946
}
-#line 962
+#line 946
static int
-#line 963
+#line 947
getNCvx_longlong_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 963
+#line 947
const size_t *start, size_t nelems, uint *value)
-#line 963
+#line 947
{
-#line 963
+#line 947
off_t offset = NC_varoffset(ncp, varp, start);
-#line 963
+#line 947
size_t remaining = varp->xsz * nelems;
-#line 963
+#line 947
int status = NC_NOERR;
-#line 963
+#line 947
const void *xp;
-#line 963
+#line 947
-#line 963
+#line 947
if(nelems == 0)
-#line 963
+#line 947
return NC_NOERR;
-#line 963
+#line 947
-#line 963
+#line 947
assert(value != NULL);
-#line 963
+#line 947
-#line 963
+#line 947
for(;;)
-#line 963
+#line 947
{
-#line 963
+#line 947
size_t extent = MIN(remaining, ncp->chunk);
-#line 963
+#line 947
size_t nget = ncx_howmany(varp->type, extent);
-#line 963
+#line 947
-#line 963
+#line 947
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 963
+#line 947
0, (void **)&xp); /* cast away const */
-#line 963
+#line 947
if(lstatus != NC_NOERR)
-#line 963
+#line 947
return lstatus;
-#line 963
+#line 947
-#line 963
+#line 947
lstatus = ncx_getn_longlong_uint(&xp, nget, value);
-#line 963
+#line 947
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 963
+#line 947
status = lstatus;
-#line 963
+#line 947
-#line 963
+#line 947
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 963
+#line 947
-#line 963
+#line 947
remaining -= extent;
-#line 963
+#line 947
if(remaining == 0)
-#line 963
+#line 947
break; /* normal loop exit */
-#line 963
+#line 947
offset += (off_t)extent;
-#line 963
+#line 947
value += nget;
-#line 963
+#line 947
}
-#line 963
+#line 947
-#line 963
+#line 947
return status;
-#line 963
+#line 947
}
-#line 963
+#line 947
static int
-#line 964
+#line 948
getNCvx_longlong_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 964
+#line 948
const size_t *start, size_t nelems, ulonglong *value)
-#line 964
+#line 948
{
-#line 964
+#line 948
off_t offset = NC_varoffset(ncp, varp, start);
-#line 964
+#line 948
size_t remaining = varp->xsz * nelems;
-#line 964
+#line 948
int status = NC_NOERR;
-#line 964
+#line 948
const void *xp;
-#line 964
+#line 948
-#line 964
+#line 948
if(nelems == 0)
-#line 964
+#line 948
return NC_NOERR;
-#line 964
+#line 948
-#line 964
+#line 948
assert(value != NULL);
-#line 964
+#line 948
-#line 964
+#line 948
for(;;)
-#line 964
+#line 948
{
-#line 964
+#line 948
size_t extent = MIN(remaining, ncp->chunk);
-#line 964
+#line 948
size_t nget = ncx_howmany(varp->type, extent);
-#line 964
+#line 948
-#line 964
+#line 948
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 964
+#line 948
0, (void **)&xp); /* cast away const */
-#line 964
+#line 948
if(lstatus != NC_NOERR)
-#line 964
+#line 948
return lstatus;
-#line 964
+#line 948
-#line 964
+#line 948
lstatus = ncx_getn_longlong_ulonglong(&xp, nget, value);
-#line 964
+#line 948
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 964
+#line 948
status = lstatus;
-#line 964
+#line 948
-#line 964
+#line 948
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 964
+#line 948
-#line 964
+#line 948
remaining -= extent;
-#line 964
+#line 948
if(remaining == 0)
-#line 964
+#line 948
break; /* normal loop exit */
-#line 964
+#line 948
offset += (off_t)extent;
-#line 964
+#line 948
value += nget;
-#line 964
+#line 948
}
-#line 964
+#line 948
-#line 964
+#line 948
return status;
-#line 964
+#line 948
}
-#line 964
+#line 948
static int
-#line 965
+#line 949
getNCvx_longlong_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 965
+#line 949
const size_t *start, size_t nelems, ushort *value)
-#line 965
+#line 949
{
-#line 965
+#line 949
off_t offset = NC_varoffset(ncp, varp, start);
-#line 965
+#line 949
size_t remaining = varp->xsz * nelems;
-#line 965
+#line 949
int status = NC_NOERR;
-#line 965
+#line 949
const void *xp;
-#line 965
+#line 949
-#line 965
+#line 949
if(nelems == 0)
-#line 965
+#line 949
return NC_NOERR;
-#line 965
+#line 949
-#line 965
+#line 949
assert(value != NULL);
-#line 965
+#line 949
-#line 965
+#line 949
for(;;)
-#line 965
+#line 949
{
-#line 965
+#line 949
size_t extent = MIN(remaining, ncp->chunk);
-#line 965
+#line 949
size_t nget = ncx_howmany(varp->type, extent);
-#line 965
+#line 949
-#line 965
+#line 949
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 965
+#line 949
0, (void **)&xp); /* cast away const */
-#line 965
+#line 949
if(lstatus != NC_NOERR)
-#line 965
+#line 949
return lstatus;
-#line 965
+#line 949
-#line 965
+#line 949
lstatus = ncx_getn_longlong_ushort(&xp, nget, value);
-#line 965
+#line 949
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 965
+#line 949
status = lstatus;
-#line 965
+#line 949
-#line 965
+#line 949
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 965
+#line 949
-#line 965
+#line 949
remaining -= extent;
-#line 965
+#line 949
if(remaining == 0)
-#line 965
+#line 949
break; /* normal loop exit */
-#line 965
+#line 949
offset += (off_t)extent;
-#line 965
+#line 949
value += nget;
-#line 965
+#line 949
}
-#line 965
+#line 949
-#line 965
+#line 949
return status;
-#line 965
+#line 949
}
-#line 965
+#line 949
static int
-#line 967
+#line 951
getNCvx_ulonglong_schar(const NC3_INFO* ncp, const NC_var *varp,
-#line 967
+#line 951
const size_t *start, size_t nelems, schar *value)
-#line 967
+#line 951
{
-#line 967
+#line 951
off_t offset = NC_varoffset(ncp, varp, start);
-#line 967
+#line 951
size_t remaining = varp->xsz * nelems;
-#line 967
+#line 951
int status = NC_NOERR;
-#line 967
+#line 951
const void *xp;
-#line 967
+#line 951
-#line 967
+#line 951
if(nelems == 0)
-#line 967
+#line 951
return NC_NOERR;
-#line 967
+#line 951
-#line 967
+#line 951
assert(value != NULL);
-#line 967
+#line 951
-#line 967
+#line 951
for(;;)
-#line 967
+#line 951
{
-#line 967
+#line 951
size_t extent = MIN(remaining, ncp->chunk);
-#line 967
+#line 951
size_t nget = ncx_howmany(varp->type, extent);
-#line 967
+#line 951
-#line 967
+#line 951
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 967
+#line 951
0, (void **)&xp); /* cast away const */
-#line 967
+#line 951
if(lstatus != NC_NOERR)
-#line 967
+#line 951
return lstatus;
-#line 967
+#line 951
-#line 967
+#line 951
lstatus = ncx_getn_ulonglong_schar(&xp, nget, value);
-#line 967
+#line 951
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 967
+#line 951
status = lstatus;
-#line 967
+#line 951
-#line 967
+#line 951
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 967
+#line 951
-#line 967
+#line 951
remaining -= extent;
-#line 967
+#line 951
if(remaining == 0)
-#line 967
+#line 951
break; /* normal loop exit */
-#line 967
+#line 951
offset += (off_t)extent;
-#line 967
+#line 951
value += nget;
-#line 967
+#line 951
}
-#line 967
+#line 951
-#line 967
+#line 951
return status;
-#line 967
+#line 951
}
-#line 967
+#line 951
static int
-#line 968
+#line 952
getNCvx_ulonglong_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 968
+#line 952
const size_t *start, size_t nelems, uchar *value)
-#line 968
+#line 952
{
-#line 968
+#line 952
off_t offset = NC_varoffset(ncp, varp, start);
-#line 968
+#line 952
size_t remaining = varp->xsz * nelems;
-#line 968
+#line 952
int status = NC_NOERR;
-#line 968
+#line 952
const void *xp;
-#line 968
+#line 952
-#line 968
+#line 952
if(nelems == 0)
-#line 968
+#line 952
return NC_NOERR;
-#line 968
+#line 952
-#line 968
+#line 952
assert(value != NULL);
-#line 968
+#line 952
-#line 968
+#line 952
for(;;)
-#line 968
+#line 952
{
-#line 968
+#line 952
size_t extent = MIN(remaining, ncp->chunk);
-#line 968
+#line 952
size_t nget = ncx_howmany(varp->type, extent);
-#line 968
+#line 952
-#line 968
+#line 952
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 968
+#line 952
0, (void **)&xp); /* cast away const */
-#line 968
+#line 952
if(lstatus != NC_NOERR)
-#line 968
+#line 952
return lstatus;
-#line 968
+#line 952
-#line 968
+#line 952
lstatus = ncx_getn_ulonglong_uchar(&xp, nget, value);
-#line 968
+#line 952
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 968
+#line 952
status = lstatus;
-#line 968
+#line 952
-#line 968
+#line 952
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 968
+#line 952
-#line 968
+#line 952
remaining -= extent;
-#line 968
+#line 952
if(remaining == 0)
-#line 968
+#line 952
break; /* normal loop exit */
-#line 968
+#line 952
offset += (off_t)extent;
-#line 968
+#line 952
value += nget;
-#line 968
+#line 952
}
-#line 968
+#line 952
-#line 968
+#line 952
return status;
-#line 968
+#line 952
}
-#line 968
+#line 952
static int
-#line 969
+#line 953
getNCvx_ulonglong_short(const NC3_INFO* ncp, const NC_var *varp,
-#line 969
+#line 953
const size_t *start, size_t nelems, short *value)
-#line 969
+#line 953
{
-#line 969
+#line 953
off_t offset = NC_varoffset(ncp, varp, start);
-#line 969
+#line 953
size_t remaining = varp->xsz * nelems;
-#line 969
+#line 953
int status = NC_NOERR;
-#line 969
+#line 953
const void *xp;
-#line 969
+#line 953
-#line 969
+#line 953
if(nelems == 0)
-#line 969
+#line 953
return NC_NOERR;
-#line 969
+#line 953
-#line 969
+#line 953
assert(value != NULL);
-#line 969
+#line 953
-#line 969
+#line 953
for(;;)
-#line 969
+#line 953
{
-#line 969
+#line 953
size_t extent = MIN(remaining, ncp->chunk);
-#line 969
+#line 953
size_t nget = ncx_howmany(varp->type, extent);
-#line 969
+#line 953
-#line 969
+#line 953
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 969
+#line 953
0, (void **)&xp); /* cast away const */
-#line 969
+#line 953
if(lstatus != NC_NOERR)
-#line 969
+#line 953
return lstatus;
-#line 969
+#line 953
-#line 969
+#line 953
lstatus = ncx_getn_ulonglong_short(&xp, nget, value);
-#line 969
+#line 953
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 969
+#line 953
status = lstatus;
-#line 969
+#line 953
-#line 969
+#line 953
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 969
+#line 953
-#line 969
+#line 953
remaining -= extent;
-#line 969
+#line 953
if(remaining == 0)
-#line 969
+#line 953
break; /* normal loop exit */
-#line 969
+#line 953
offset += (off_t)extent;
-#line 969
+#line 953
value += nget;
-#line 969
+#line 953
}
-#line 969
+#line 953
-#line 969
+#line 953
return status;
-#line 969
+#line 953
}
-#line 969
+#line 953
static int
-#line 970
+#line 954
getNCvx_ulonglong_int(const NC3_INFO* ncp, const NC_var *varp,
-#line 970
+#line 954
const size_t *start, size_t nelems, int *value)
-#line 970
+#line 954
{
-#line 970
+#line 954
off_t offset = NC_varoffset(ncp, varp, start);
-#line 970
+#line 954
size_t remaining = varp->xsz * nelems;
-#line 970
+#line 954
int status = NC_NOERR;
-#line 970
+#line 954
const void *xp;
-#line 970
+#line 954
-#line 970
+#line 954
if(nelems == 0)
-#line 970
+#line 954
return NC_NOERR;
-#line 970
+#line 954
-#line 970
+#line 954
assert(value != NULL);
-#line 970
+#line 954
-#line 970
+#line 954
for(;;)
-#line 970
+#line 954
{
-#line 970
+#line 954
size_t extent = MIN(remaining, ncp->chunk);
-#line 970
+#line 954
size_t nget = ncx_howmany(varp->type, extent);
-#line 970
+#line 954
-#line 970
+#line 954
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 970
+#line 954
0, (void **)&xp); /* cast away const */
-#line 970
+#line 954
if(lstatus != NC_NOERR)
-#line 970
+#line 954
return lstatus;
-#line 970
+#line 954
-#line 970
+#line 954
lstatus = ncx_getn_ulonglong_int(&xp, nget, value);
-#line 970
+#line 954
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 970
+#line 954
status = lstatus;
-#line 970
+#line 954
-#line 970
+#line 954
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 970
+#line 954
-#line 970
+#line 954
remaining -= extent;
-#line 970
+#line 954
if(remaining == 0)
-#line 970
+#line 954
break; /* normal loop exit */
-#line 970
+#line 954
offset += (off_t)extent;
-#line 970
+#line 954
value += nget;
-#line 970
+#line 954
}
-#line 970
+#line 954
-#line 970
+#line 954
return status;
-#line 970
+#line 954
}
-#line 970
+#line 954
static int
-#line 971
+#line 955
getNCvx_ulonglong_float(const NC3_INFO* ncp, const NC_var *varp,
-#line 971
+#line 955
const size_t *start, size_t nelems, float *value)
-#line 971
+#line 955
{
-#line 971
+#line 955
off_t offset = NC_varoffset(ncp, varp, start);
-#line 971
+#line 955
size_t remaining = varp->xsz * nelems;
-#line 971
+#line 955
int status = NC_NOERR;
-#line 971
+#line 955
const void *xp;
-#line 971
+#line 955
-#line 971
+#line 955
if(nelems == 0)
-#line 971
+#line 955
return NC_NOERR;
-#line 971
+#line 955
-#line 971
+#line 955
assert(value != NULL);
-#line 971
+#line 955
-#line 971
+#line 955
for(;;)
-#line 971
+#line 955
{
-#line 971
+#line 955
size_t extent = MIN(remaining, ncp->chunk);
-#line 971
+#line 955
size_t nget = ncx_howmany(varp->type, extent);
-#line 971
+#line 955
-#line 971
+#line 955
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 971
+#line 955
0, (void **)&xp); /* cast away const */
-#line 971
+#line 955
if(lstatus != NC_NOERR)
-#line 971
+#line 955
return lstatus;
-#line 971
+#line 955
-#line 971
+#line 955
lstatus = ncx_getn_ulonglong_float(&xp, nget, value);
-#line 971
+#line 955
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 971
+#line 955
status = lstatus;
-#line 971
+#line 955
-#line 971
+#line 955
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 971
+#line 955
-#line 971
+#line 955
remaining -= extent;
-#line 971
+#line 955
if(remaining == 0)
-#line 971
+#line 955
break; /* normal loop exit */
-#line 971
+#line 955
offset += (off_t)extent;
-#line 971
+#line 955
value += nget;
-#line 971
+#line 955
}
-#line 971
+#line 955
-#line 971
+#line 955
return status;
-#line 971
+#line 955
}
-#line 971
+#line 955
static int
-#line 972
+#line 956
getNCvx_ulonglong_double(const NC3_INFO* ncp, const NC_var *varp,
-#line 972
+#line 956
const size_t *start, size_t nelems, double *value)
-#line 972
+#line 956
{
-#line 972
+#line 956
off_t offset = NC_varoffset(ncp, varp, start);
-#line 972
+#line 956
size_t remaining = varp->xsz * nelems;
-#line 972
+#line 956
int status = NC_NOERR;
-#line 972
+#line 956
const void *xp;
-#line 972
+#line 956
-#line 972
+#line 956
if(nelems == 0)
-#line 972
+#line 956
return NC_NOERR;
-#line 972
+#line 956
-#line 972
+#line 956
assert(value != NULL);
-#line 972
+#line 956
-#line 972
+#line 956
for(;;)
-#line 972
+#line 956
{
-#line 972
+#line 956
size_t extent = MIN(remaining, ncp->chunk);
-#line 972
+#line 956
size_t nget = ncx_howmany(varp->type, extent);
-#line 972
+#line 956
-#line 972
+#line 956
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 972
+#line 956
0, (void **)&xp); /* cast away const */
-#line 972
+#line 956
if(lstatus != NC_NOERR)
-#line 972
+#line 956
return lstatus;
-#line 972
+#line 956
-#line 972
+#line 956
lstatus = ncx_getn_ulonglong_double(&xp, nget, value);
-#line 972
+#line 956
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 972
+#line 956
status = lstatus;
-#line 972
+#line 956
-#line 972
+#line 956
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 972
+#line 956
-#line 972
+#line 956
remaining -= extent;
-#line 972
+#line 956
if(remaining == 0)
-#line 972
+#line 956
break; /* normal loop exit */
-#line 972
+#line 956
offset += (off_t)extent;
-#line 972
+#line 956
value += nget;
-#line 972
+#line 956
}
-#line 972
+#line 956
-#line 972
+#line 956
return status;
-#line 972
+#line 956
}
-#line 972
+#line 956
static int
-#line 973
+#line 957
getNCvx_ulonglong_longlong(const NC3_INFO* ncp, const NC_var *varp,
-#line 973
+#line 957
const size_t *start, size_t nelems, longlong *value)
-#line 973
+#line 957
{
-#line 973
+#line 957
off_t offset = NC_varoffset(ncp, varp, start);
-#line 973
+#line 957
size_t remaining = varp->xsz * nelems;
-#line 973
+#line 957
int status = NC_NOERR;
-#line 973
+#line 957
const void *xp;
-#line 973
+#line 957
-#line 973
+#line 957
if(nelems == 0)
-#line 973
+#line 957
return NC_NOERR;
-#line 973
+#line 957
-#line 973
+#line 957
assert(value != NULL);
-#line 973
+#line 957
-#line 973
+#line 957
for(;;)
-#line 973
+#line 957
{
-#line 973
+#line 957
size_t extent = MIN(remaining, ncp->chunk);
-#line 973
+#line 957
size_t nget = ncx_howmany(varp->type, extent);
-#line 973
+#line 957
-#line 973
+#line 957
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 973
+#line 957
0, (void **)&xp); /* cast away const */
-#line 973
+#line 957
if(lstatus != NC_NOERR)
-#line 973
+#line 957
return lstatus;
-#line 973
+#line 957
-#line 973
+#line 957
lstatus = ncx_getn_ulonglong_longlong(&xp, nget, value);
-#line 973
+#line 957
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 973
+#line 957
status = lstatus;
-#line 973
+#line 957
-#line 973
+#line 957
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 973
+#line 957
-#line 973
+#line 957
remaining -= extent;
-#line 973
+#line 957
if(remaining == 0)
-#line 973
+#line 957
break; /* normal loop exit */
-#line 973
+#line 957
offset += (off_t)extent;
-#line 973
+#line 957
value += nget;
-#line 973
+#line 957
}
-#line 973
+#line 957
-#line 973
+#line 957
return status;
-#line 973
+#line 957
}
-#line 973
+#line 957
static int
-#line 974
+#line 958
getNCvx_ulonglong_uint(const NC3_INFO* ncp, const NC_var *varp,
-#line 974
+#line 958
const size_t *start, size_t nelems, uint *value)
-#line 974
+#line 958
{
-#line 974
+#line 958
off_t offset = NC_varoffset(ncp, varp, start);
-#line 974
+#line 958
size_t remaining = varp->xsz * nelems;
-#line 974
+#line 958
int status = NC_NOERR;
-#line 974
+#line 958
const void *xp;
-#line 974
+#line 958
-#line 974
+#line 958
if(nelems == 0)
-#line 974
+#line 958
return NC_NOERR;
-#line 974
+#line 958
-#line 974
+#line 958
assert(value != NULL);
-#line 974
+#line 958
-#line 974
+#line 958
for(;;)
-#line 974
+#line 958
{
-#line 974
+#line 958
size_t extent = MIN(remaining, ncp->chunk);
-#line 974
+#line 958
size_t nget = ncx_howmany(varp->type, extent);
-#line 974
+#line 958
-#line 974
+#line 958
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 974
+#line 958
0, (void **)&xp); /* cast away const */
-#line 974
+#line 958
if(lstatus != NC_NOERR)
-#line 974
+#line 958
return lstatus;
-#line 974
+#line 958
-#line 974
+#line 958
lstatus = ncx_getn_ulonglong_uint(&xp, nget, value);
-#line 974
+#line 958
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 974
+#line 958
status = lstatus;
-#line 974
+#line 958
-#line 974
+#line 958
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 974
+#line 958
-#line 974
+#line 958
remaining -= extent;
-#line 974
+#line 958
if(remaining == 0)
-#line 974
+#line 958
break; /* normal loop exit */
-#line 974
+#line 958
offset += (off_t)extent;
-#line 974
+#line 958
value += nget;
-#line 974
+#line 958
}
-#line 974
+#line 958
-#line 974
+#line 958
return status;
-#line 974
+#line 958
}
-#line 974
+#line 958
static int
-#line 975
+#line 959
getNCvx_ulonglong_ulonglong(const NC3_INFO* ncp, const NC_var *varp,
-#line 975
+#line 959
const size_t *start, size_t nelems, ulonglong *value)
-#line 975
+#line 959
{
-#line 975
+#line 959
off_t offset = NC_varoffset(ncp, varp, start);
-#line 975
+#line 959
size_t remaining = varp->xsz * nelems;
-#line 975
+#line 959
int status = NC_NOERR;
-#line 975
+#line 959
const void *xp;
-#line 975
+#line 959
-#line 975
+#line 959
if(nelems == 0)
-#line 975
+#line 959
return NC_NOERR;
-#line 975
+#line 959
-#line 975
+#line 959
assert(value != NULL);
-#line 975
+#line 959
-#line 975
+#line 959
for(;;)
-#line 975
+#line 959
{
-#line 975
+#line 959
size_t extent = MIN(remaining, ncp->chunk);
-#line 975
+#line 959
size_t nget = ncx_howmany(varp->type, extent);
-#line 975
+#line 959
-#line 975
+#line 959
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 975
+#line 959
0, (void **)&xp); /* cast away const */
-#line 975
+#line 959
if(lstatus != NC_NOERR)
-#line 975
+#line 959
return lstatus;
-#line 975
+#line 959
-#line 975
+#line 959
lstatus = ncx_getn_ulonglong_ulonglong(&xp, nget, value);
-#line 975
+#line 959
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 975
+#line 959
status = lstatus;
-#line 975
+#line 959
-#line 975
+#line 959
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 975
+#line 959
-#line 975
+#line 959
remaining -= extent;
-#line 975
+#line 959
if(remaining == 0)
-#line 975
+#line 959
break; /* normal loop exit */
-#line 975
+#line 959
offset += (off_t)extent;
-#line 975
+#line 959
value += nget;
-#line 975
+#line 959
}
-#line 975
+#line 959
-#line 975
+#line 959
return status;
-#line 975
+#line 959
}
-#line 975
+#line 959
static int
-#line 976
+#line 960
getNCvx_ulonglong_ushort(const NC3_INFO* ncp, const NC_var *varp,
-#line 976
+#line 960
const size_t *start, size_t nelems, ushort *value)
-#line 976
+#line 960
{
-#line 976
+#line 960
off_t offset = NC_varoffset(ncp, varp, start);
-#line 976
+#line 960
size_t remaining = varp->xsz * nelems;
-#line 976
+#line 960
int status = NC_NOERR;
-#line 976
+#line 960
const void *xp;
-#line 976
+#line 960
-#line 976
+#line 960
if(nelems == 0)
-#line 976
+#line 960
return NC_NOERR;
-#line 976
+#line 960
-#line 976
+#line 960
assert(value != NULL);
-#line 976
+#line 960
-#line 976
+#line 960
for(;;)
-#line 976
+#line 960
{
-#line 976
+#line 960
size_t extent = MIN(remaining, ncp->chunk);
-#line 976
+#line 960
size_t nget = ncx_howmany(varp->type, extent);
-#line 976
+#line 960
-#line 976
+#line 960
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 976
+#line 960
0, (void **)&xp); /* cast away const */
-#line 976
+#line 960
if(lstatus != NC_NOERR)
-#line 976
+#line 960
return lstatus;
-#line 976
+#line 960
-#line 976
+#line 960
lstatus = ncx_getn_ulonglong_ushort(&xp, nget, value);
-#line 976
+#line 960
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 976
+#line 960
status = lstatus;
-#line 976
+#line 960
-#line 976
+#line 960
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 976
+#line 960
-#line 976
+#line 960
remaining -= extent;
-#line 976
+#line 960
if(remaining == 0)
-#line 976
+#line 960
break; /* normal loop exit */
-#line 976
+#line 960
offset += (off_t)extent;
-#line 976
+#line 960
value += nget;
-#line 976
+#line 960
}
-#line 976
+#line 960
-#line 976
+#line 960
return status;
-#line 976
+#line 960
}
-#line 976
+#line 960
-#line 979
+#line 963
#ifdef NOTUSED
static int
-#line 980
+#line 964
getNCvx_schar_uchar(const NC3_INFO* ncp, const NC_var *varp,
-#line 980
+#line 964
const size_t *start, size_t nelems, uchar *value)
-#line 980
+#line 964
{
-#line 980
+#line 964
off_t offset = NC_varoffset(ncp, varp, start);
-#line 980
+#line 964
size_t remaining = varp->xsz * nelems;
-#line 980
+#line 964
int status = NC_NOERR;
-#line 980
+#line 964
const void *xp;
-#line 980
+#line 964
-#line 980
+#line 964
if(nelems == 0)
-#line 980
+#line 964
return NC_NOERR;
-#line 980
+#line 964
-#line 980
+#line 964
assert(value != NULL);
-#line 980
+#line 964
-#line 980
+#line 964
for(;;)
-#line 980
+#line 964
{
-#line 980
+#line 964
size_t extent = MIN(remaining, ncp->chunk);
-#line 980
+#line 964
size_t nget = ncx_howmany(varp->type, extent);
-#line 980
+#line 964
-#line 980
+#line 964
int lstatus = ncio_get(ncp->nciop, offset, extent,
-#line 980
+#line 964
0, (void **)&xp); /* cast away const */
-#line 980
+#line 964
if(lstatus != NC_NOERR)
-#line 980
+#line 964
return lstatus;
-#line 980
+#line 964
-#line 980
+#line 964
lstatus = ncx_getn_schar_uchar(&xp, nget, value);
-#line 980
+#line 964
if(lstatus != NC_NOERR && status == NC_NOERR)
-#line 980
+#line 964
status = lstatus;
-#line 980
+#line 964
-#line 980
+#line 964
(void) ncio_rel(ncp->nciop, offset, 0);
-#line 980
+#line 964
-#line 980
+#line 964
remaining -= extent;
-#line 980
+#line 964
if(remaining == 0)
-#line 980
+#line 964
break; /* normal loop exit */
-#line 980
+#line 964
offset += (off_t)extent;
-#line 980
+#line 964
value += nget;
-#line 980
+#line 964
}
-#line 980
+#line 964
-#line 980
+#line 964
return status;
-#line 980
+#line 964
}
-#line 980
+#line 964
#endif /*NOTUSED*/
@@ -20103,7 +20087,7 @@
#endif
-#line 1142
+#line 1126
/* Define a macro to allow hash on two type values */
#define CASE(nc1,nc2) (nc1*256+nc2)
diff -Nru netcdf-parallel-4.7.3/libsrc/putget.m4 netcdf-parallel-4.7.4/libsrc/putget.m4
--- netcdf-parallel-4.7.3/libsrc/putget.m4 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc/putget.m4 2020-08-31 10:33:26.000000000 +0000
@@ -498,11 +498,7 @@
{
if(*coord > X_UINT_MAX) /* rkr: bug fix from previous X_INT_MAX */
return NC_EINVALCOORDS; /* sanity check */
-#ifdef RELAX_COORD_BOUND
if(NC_readonly(ncp) && *coord > NC_get_numrecs(ncp))
-#else
- if(NC_readonly(ncp) && *coord >= NC_get_numrecs(ncp))
-#endif
{
if(!NC_doNsync(ncp))
return NC_EINVALCOORDS;
@@ -512,11 +508,7 @@
const int status = read_numrecs(ncp);
if(status != NC_NOERR)
return status;
-#ifdef RELAX_COORD_BOUND
if(*coord > NC_get_numrecs(ncp))
-#else
- if(*coord >= NC_get_numrecs(ncp))
-#endif
return NC_EINVALCOORDS;
}
}
@@ -543,11 +535,7 @@
#endif /* CDEBUG */
/* cast needed for braindead systems with signed size_t */
-#ifdef RELAX_COORD_BOUND
if((unsigned long) *ip > (unsigned long) *up )
-#else
- if((unsigned long) *ip >= (unsigned long) *up )
-#endif
return NC_EINVALCOORDS;
}
@@ -571,11 +559,9 @@
if(IS_RECVAR(varp))
{
-#ifdef RELAX_COORD_BOUND
if (NC_readonly(ncp) &&
(start[0] == NC_get_numrecs(ncp) && edges[0] > 0))
return(NC_EINVALCOORDS);
-#endif
start++;
edges++;
shp++;
@@ -583,10 +569,8 @@
for(; start < end; start++, edges++, shp++)
{
-#ifdef RELAX_COORD_BOUND
if ((unsigned long) *start == *shp && *edges > 0)
return(NC_EINVALCOORDS);
-#endif
/* cast needed for braindead systems with signed size_t */
if((unsigned long) *edges > *shp ||
(unsigned long) *start + (unsigned long) *edges > *shp)
diff -Nru netcdf-parallel-4.7.3/libsrc4/CMakeLists.txt netcdf-parallel-4.7.4/libsrc4/CMakeLists.txt
--- netcdf-parallel-4.7.3/libsrc4/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc4/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -6,7 +6,9 @@
# See netcdf-c/COPYRIGHT file for more info.
# Process these files with m4.
-SET(libsrc4_SOURCES nc4dispatch.c nc4attr.c nc4dim.c nc4grp.c nc4type.c nc4var.c ncfunc.c nc4internal.c ncindex.c )
+SET(libsrc4_SOURCES nc4dispatch.c nc4attr.c nc4dim.c nc4grp.c
+nc4internal.c nc4type.c nc4var.c ncfunc.c error4.c nc4printer.c
+ncindex.c)
IF(LOGGING)
SET(libsrc4_SOURCES ${libsrc4_SOURCES} error4.c)
diff -Nru netcdf-parallel-4.7.3/libsrc4/Makefile.am netcdf-parallel-4.7.4/libsrc4/Makefile.am
--- netcdf-parallel-4.7.3/libsrc4/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc4/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -14,4 +14,5 @@
nc4internal.c nc4type.c nc4var.c ncfunc.c error4.c nc4printer.c \
ncindex.c
+
EXTRA_DIST = CMakeLists.txt
diff -Nru netcdf-parallel-4.7.3/libsrc4/Makefile.in netcdf-parallel-4.7.4/libsrc4/Makefile.in
--- netcdf-parallel-4.7.3/libsrc4/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc4/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -269,8 +269,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -310,11 +312,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/libsrc4/nc4dispatch.c netcdf-parallel-4.7.4/libsrc4/nc4dispatch.c
--- netcdf-parallel-4.7.3/libsrc4/nc4dispatch.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc4/nc4dispatch.c 2020-08-31 10:33:26.000000000 +0000
@@ -11,6 +11,7 @@
#include "config.h"
#include
+#include "netcdf.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include "nc.h"
diff -Nru netcdf-parallel-4.7.3/libsrc4/nc4internal.c netcdf-parallel-4.7.4/libsrc4/nc4internal.c
--- netcdf-parallel-4.7.3/libsrc4/nc4internal.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrc4/nc4internal.c 2020-08-31 10:33:26.000000000 +0000
@@ -16,6 +16,8 @@
* @author Ed Hartnett, Dennis Heimbigner, Ward Fisher
*/
#include "config.h"
+#include "netcdf.h"
+#include "netcdf_filter.h"
#include "nc4internal.h"
#include "nc.h" /* from libsrc */
#include "ncdispatch.h" /* from libdispatch */
@@ -26,6 +28,8 @@
size_t nc4_chunk_cache_nelems = CHUNK_CACHE_NELEMS; /**< Default chunk cache number of elements. */
float nc4_chunk_cache_preemption = CHUNK_CACHE_PREEMPTION; /**< Default chunk cache preemption. */
+static void freefilterlist(NClist* filters);
+
#ifdef LOGGING
/* This is the severity level of messages which will be logged. Use
severity 0 for errors, 1 for important log messages, 2 for less
@@ -1335,9 +1339,8 @@
if (var->dimscale_attached)
free(var->dimscale_attached);
- /* Release parameter information. */
- if (var->params)
- free(var->params);
+ /* Release filter information. */
+ freefilterlist(var->filters);
/* Delete any format-specific info. */
if (var->format_var_info)
@@ -1454,9 +1457,11 @@
ncindexfree(grp->att);
/* Delete all vars. */
- for (i = 0; i < ncindexsize(grp->vars); i++)
- if ((retval = var_free((NC_VAR_INFO_T *)ncindexith(grp->vars, i))))
+ for (i = 0; i < ncindexsize(grp->vars); i++) {
+ NC_VAR_INFO_T* v = (NC_VAR_INFO_T *)ncindexith(grp->vars, i);
+ if ((retval = var_free(v)))
return retval;
+ }
ncindexfree(grp->vars);
/* Delete all dims, and free the list of dims. */
@@ -1643,7 +1648,6 @@
NC_TYPE_INFO_T *type;
NC_FIELD_INFO_T *field;
char tabs[MAX_NESTS+1] = "";
- char *dims_string = NULL;
char temp_string[10];
int t, retval, d, i;
@@ -1674,6 +1678,9 @@
for (i = 0; i < ncindexsize(grp->vars); i++)
{
int j;
+ char storage_str[NC_MAX_NAME] = "";
+ char *dims_string = NULL;
+
var = (NC_VAR_INFO_T*)ncindexith(grp->vars,i);
assert(var);
if (var->ndims > 0)
@@ -1687,9 +1694,18 @@
strcat(dims_string, temp_string);
}
}
- LOG((2, "%s VARIABLE - varid: %d name: %s ndims: %d dimscale: %d dimids:%s",
- tabs, var->hdr.id, var->hdr.name, var->ndims, (int)var->dimscale,
- (dims_string ? dims_string : " -")));
+ if (!var->meta_read)
+ strcat(storage_str, "unknown");
+ else if (var->storage == NC_CONTIGUOUS)
+ strcat(storage_str, "contiguous");
+ else if (var->storage == NC_COMPACT)
+ strcat(storage_str, "compact");
+ else
+ strcat(storage_str, "chunked");
+ LOG((2, "%s VARIABLE - varid: %d name: %s ndims: %d dimscale: %d "
+ "dimids:%s storage: %s", tabs, var->hdr.id, var->hdr.name,
+ var->ndims, (int)var->dimscale,
+ (dims_string ? dims_string : " -"), storage_str));
for (j = 0; j < ncindexsize(var->att); j++)
{
att = (NC_ATT_INFO_T *)ncindexith(var->att, j);
@@ -1809,3 +1825,15 @@
#endif /*LOGGING*/
return retval;
}
+
+static void
+freefilterlist(NClist* filters)
+{
+ int i;
+ if(filters == NULL) return;
+ for(i=0;iatt);
- /* Chunking stuff. */
- if (!var->contiguous && chunksizesp)
+ /* Did the user want the chunksizes? */
+ if (var->storage == NC_CHUNKED && chunksizesp)
+ {
for (d = 0; d < var->ndims; d++)
{
chunksizesp[d] = var->chunksizes[d];
LOG((4, "chunksizesp[%d]=%d", d, chunksizesp[d]));
}
+ }
- if (contiguousp)
- *contiguousp = var->contiguous ? NC_CONTIGUOUS : NC_CHUNKED;
+ /* Did the user inquire about the storage? */
+ if (storagep)
+ *storagep = var->storage;
/* Filter stuff. */
- if (deflatep)
- *deflatep = (int)var->deflate;
- if (deflate_levelp)
- *deflate_levelp = var->deflate_level;
if (shufflep)
*shufflep = (int)var->shuffle;
if (fletcher32p)
*fletcher32p = (int)var->fletcher32;
- if (idp)
- *idp = var->filterid;
- if (nparamsp)
- *nparamsp = (var->params == NULL ? 0 : var->nparams);
- if (params && var->params != NULL)
- memcpy(params,var->params,var->nparams*sizeof(unsigned int));
+ if (deflatep)
+ return NC_EFILTER;
+
+ if (idp) {
+#if 0
+ NC* nc = h5->controller;
+ NC_FILTER_ACTION action;
+ action.action = NCFILTER_INQ_FILTER;
+ action.format = NC_FORMATX_NC_HDF5;
+ action.id = (idp)?*idp:0;
+ action.nelems = (nparamsp)?*nparamsp:0;
+ action.elems = params;
+ if((retval = nc->dispatch->filter_actions(ncid,varid,&action)) == NC_NOERR) {
+ if(idp) *idp = action.id;
+ if(nparamsp) *nparamsp = action.nelems;
+ }
+ return retval;
+#else
+ return NC_EFILTER;
+#endif
+ }
/* Fill value stuff. */
if (no_fill)
@@ -276,7 +290,7 @@
*
* @param ncid File ID.
* @param varid Variable ID.
- * @param contiguousp Gets contiguous setting.
+ * @param storagep Gets contiguous setting.
* @param chunksizesp Gets chunksizes.
*
* @returns ::NC_NOERR No error.
@@ -287,7 +301,7 @@
* @author Ed Hartnett
*/
int
-nc_inq_var_chunking_ints(int ncid, int varid, int *contiguousp, int *chunksizesp)
+nc_inq_var_chunking_ints(int ncid, int varid, int *storagep, int *chunksizesp)
{
NC_VAR_INFO_T *var;
size_t *cs = NULL;
@@ -305,11 +319,11 @@
/* Call the netcdf-4 version directly. */
retval = NC4_inq_var_all(ncid, varid, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, contiguousp, cs, NULL,
+ NULL, NULL, NULL, NULL, storagep, cs, NULL,
NULL, NULL, NULL, NULL, NULL);
/* Copy from size_t array. */
- if (!retval && chunksizesp && var->contiguous == NC_CHUNKED)
+ if (!retval && chunksizesp && var->storage == NC_CHUNKED)
{
for (i = 0; i < var->ndims; i++)
{
@@ -422,6 +436,13 @@
if (!var) return NC_ENOTVAR;
assert(var->hdr.id == varid);
+ /* If zlib, shuffle, or fletcher32 filters are in use, then access
+ * must be collective. Fail an attempt to set such a variable to
+ * independent access. */
+ if ((nclistlength(var->filters) > 0 || var->shuffle || var->fletcher32) &&
+ par_access == NC_INDEPENDENT)
+ return NC_EINVAL;
+
if (par_access)
var->parallel_access = NC_COLLECTIVE;
else
diff -Nru netcdf-parallel-4.7.3/libsrcp/Makefile.in netcdf-parallel-4.7.4/libsrcp/Makefile.in
--- netcdf-parallel-4.7.3/libsrcp/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrcp/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -253,8 +253,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -294,11 +296,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/libsrcp/ncpdispatch.c netcdf-parallel-4.7.4/libsrcp/ncpdispatch.c
--- netcdf-parallel-4.7.3/libsrcp/ncpdispatch.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/libsrcp/ncpdispatch.c 2020-08-31 10:33:26.000000000 +0000
@@ -1376,6 +1376,7 @@
static const NC_Dispatch NCP_dispatcher = {
NC_FORMATX_PNETCDF,
+NC_DISPATCH_VERSION,
NCP_create,
NCP_open,
@@ -1460,6 +1461,7 @@
NC_NOTNC4_set_var_chunk_cache,
NC_NOTNC4_get_var_chunk_cache,
+NC_NOTNC4_filter_actions,
};
const NC_Dispatch *NCP_dispatch_table = NULL; /* moved here from ddispatch.c */
diff -Nru netcdf-parallel-4.7.3/Makefile.am netcdf-parallel-4.7.4/Makefile.am
--- netcdf-parallel-4.7.3/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -49,11 +49,14 @@
endif
# Is the user building with HDF5?
+# Note that USE_HDF5 does not imply USE_NETCDF4
if USE_HDF5
H5_TEST_DIR = h5_test
LIBHDF5 = libhdf5
+if USE_NETCDF4
NC_TEST4 = nc_test4
endif
+endif
# Build the dap2 client
if ENABLE_DAP
diff -Nru netcdf-parallel-4.7.3/Makefile.in netcdf-parallel-4.7.4/Makefile.in
--- netcdf-parallel-4.7.3/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -185,8 +185,8 @@
check-valgrind-memcheck-recursive \
check-valgrind-helgrind-recursive check-valgrind-drd-recursive \
check-valgrind-sgcheck-recursive
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+ config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@@ -318,8 +318,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -359,11 +361,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -487,9 +489,10 @@
@USE_NETCDF4_TRUE@LIBSRC4_DIR = libsrc4
# Is the user building with HDF5?
+# Note that USE_HDF5 does not imply USE_NETCDF4
@USE_HDF5_TRUE@H5_TEST_DIR = h5_test
@USE_HDF5_TRUE@LIBHDF5 = libhdf5
-@USE_HDF5_TRUE@NC_TEST4 = nc_test4
+@USE_HDF5_TRUE@@USE_NETCDF4_TRUE@NC_TEST4 = nc_test4
# Build the dap2 client
@ENABLE_DAP_TRUE@OCLIB = oc2
@@ -888,6 +891,10 @@
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@@ -929,6 +936,8 @@
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
@@ -1138,14 +1147,15 @@
check-valgrind-sgcheck-local clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
- dist-xz dist-zip distcheck distclean distclean-generic \
- distclean-hdr distclean-libtool distclean-tags distcleancheck \
- distdir distuninstallcheck dvi dvi-am html html-am info \
- info-am install install-am install-binSCRIPTS install-data \
- install-data-am install-data-hook install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
+ dist-xz dist-zip dist-zstd distcheck distclean \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binSCRIPTS install-data install-data-am \
+ install-data-hook install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pkgconfigDATA install-ps install-ps-am \
install-settingsDATA install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
diff -Nru netcdf-parallel-4.7.3/missing netcdf-parallel-4.7.4/missing
--- netcdf-parallel-4.7.3/missing 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/missing 2020-08-31 10:33:26.000000000 +0000
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
diff -Nru netcdf-parallel-4.7.3/ncdap_test/CMakeLists.txt netcdf-parallel-4.7.4/ncdap_test/CMakeLists.txt
--- netcdf-parallel-4.7.3/ncdap_test/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -17,6 +17,7 @@
IF(ENABLE_DAP_REMOTE_TESTS)
BUILD_BIN_TEST(findtestserver)
+ BUILD_BIN_TEST(pingurl)
ENDIF()
IF(ENABLE_TESTS)
@@ -54,6 +55,7 @@
ENDIF()
add_bin_test(ncdap test_varm3)
+ add_bin_test(ncdap test_nstride_cached)
###
# This test relates to NCF-330 in
diff -Nru netcdf-parallel-4.7.3/ncdap_test/expected3/Makefile.in netcdf-parallel-4.7.4/ncdap_test/expected3/Makefile.in
--- netcdf-parallel-4.7.3/ncdap_test/expected3/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/expected3/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -194,8 +194,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -235,11 +237,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/ncdap_test/expectremote3/Makefile.in netcdf-parallel-4.7.4/ncdap_test/expectremote3/Makefile.in
--- netcdf-parallel-4.7.3/ncdap_test/expectremote3/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/expectremote3/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -194,8 +194,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -235,11 +237,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/ncdap_test/findtestserver.c.in netcdf-parallel-4.7.4/ncdap_test/findtestserver.c.in
--- netcdf-parallel-4.7.3/ncdap_test/findtestserver.c.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/findtestserver.c.in 2020-08-31 10:33:26.000000000 +0000
@@ -48,7 +48,10 @@
const char* servlet = NULL;
const char* proto = NULL;
char* serverlist = NULL;
- int isdap4 = 0; /* 1 => dap4 */
+ enum KIND kind = NOKIND;
+
+ kind = kind;
+ proto = proto;
argc--; argv++;
if(argc < 2)
@@ -59,13 +62,16 @@
serverlist = strdup(argv[2]);
#ifdef ENABLE_DAP
+ if(strcasecmp(proto,"thredds")==0)
+ kind = THREDDSKIND;
+ else
if(strcasecmp(proto,"dap2")==0)
- isdap4 = 0;
+ kind = DAP2KIND;
else
#endif
#ifdef ENABLE_DAP4
if(strcasecmp(proto,"dap4")==0)
- isdap4 = 1;
+ kind = DAP4KIND;
else
#endif
usage();
@@ -75,13 +81,14 @@
serverlist = strdup(REMOTETESTSERVERS);
#endif
}
- if(serverlist == NULL || strlen(serverlist) == 0)
- fprintf(stderr,"Cannot determine a server list");
-
- url = nc_findtestserver(servlet,isdap4,serverlist);
+ if(serverlist == NULL || strlen(serverlist) == 0) {
+ fprintf(stderr,"WARNING: Cannot determine a server list\n");
+ exit(0);
+ }
+ url = nc_findtestserver(servlet,serverlist);
if(url == NULL) {
url = "";
- fprintf(stderr,"not found: %s\n",servlet);
+ fprintf(stderr,"not found: %s\n",servlet);
}
printf("%s",url);
fflush(stdout);
diff -Nru netcdf-parallel-4.7.3/ncdap_test/Makefile.am netcdf-parallel-4.7.4/ncdap_test/Makefile.am
--- netcdf-parallel-4.7.3/ncdap_test/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -38,8 +38,9 @@
# because the server may be down or inaccessible
if ENABLE_DAP_REMOTE_TESTS
-noinst_PROGRAMS = findtestserver
+noinst_PROGRAMS = findtestserver pingurl
findtestserver_SOURCES = findtestserver.c
+pingurl_SOURCES = pingurl.c
endif
if ENABLE_DAP_REMOTE_TESTS
@@ -54,20 +55,22 @@
endif
test_partvar_SOURCES = test_partvar.c
-test_varm3_SOURCES = test_varm3.c
-test_nstride_cached_SOURCES = test_nstride_cached.c
t_misc_SOURCES = t_misc.c
-TESTS += test_varm3
+
#TESTS += t_ncf330
-TESTS += test_nstride_cached
TESTS += t_misc
-check_PROGRAMS += test_partvar
+test_nstride_cached_SOURCES = test_nstride_cached.c
+TESTS += test_nstride_cached
check_PROGRAMS += test_nstride_cached
-check_PROGRAMS += t_misc
+test_varm3_SOURCES = test_varm3.c
+TESTS += test_varm3
check_PROGRAMS += test_varm3
+
+check_PROGRAMS += test_partvar
+check_PROGRAMS += t_misc
check_PROGRAMS += t_ncf330
if ENABLE_DAP_AUTH_TESTS
diff -Nru netcdf-parallel-4.7.3/ncdap_test/Makefile.in netcdf-parallel-4.7.4/ncdap_test/Makefile.in
--- netcdf-parallel-4.7.3/ncdap_test/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -109,21 +109,20 @@
@ENABLE_DAP_TRUE@am__append_2 = t_dap3a test_cvt3 test_vara
@ENABLE_DAP_TRUE@am__append_3 = t_dap3a test_cvt3 test_vara
@BUILD_UTILITIES_TRUE@@ENABLE_DAP_TRUE@am__append_4 = tst_ncdap3.sh
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@noinst_PROGRAMS = findtestserver$(EXEEXT)
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@noinst_PROGRAMS = findtestserver$(EXEEXT) \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ pingurl$(EXEEXT)
@BUILD_UTILITIES_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_5 = tst_ber.sh tst_remote3.sh tst_formatx.sh testurl.sh tst_fillmismatch.sh tst_zero_len_var.sh
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_6 = test_partvar
@ENABLE_DAP_LONG_TESTS_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_7 = tst_longremote3.sh
+
#TESTS += t_ncf330
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_8 = \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_varm3 \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_nstride_cached \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_misc
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_9 = \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_partvar \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_8 = t_misc \
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_nstride_cached \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_misc \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_varm3
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_9 = test_nstride_cached \
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_varm3 \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_ncf330
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_partvar \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_misc t_ncf330
@ENABLE_DAP_AUTH_TESTS_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__append_10 = testbasicauth.sh \
@ENABLE_DAP_AUTH_TESTS_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ testcontainerauth.sh
subdir = ncdap_test
@@ -141,10 +140,10 @@
CONFIG_CLEAN_VPATH_FILES =
@ENABLE_DAP_TRUE@am__EXEEXT_1 = t_dap3a$(EXEEXT) test_cvt3$(EXEEXT) \
@ENABLE_DAP_TRUE@ test_vara$(EXEEXT)
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__EXEEXT_2 = test_partvar$(EXEEXT) \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_nstride_cached$(EXEEXT) \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_misc$(EXEEXT) \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__EXEEXT_2 = test_nstride_cached$(EXEEXT) \
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_varm3$(EXEEXT) \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_partvar$(EXEEXT) \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_misc$(EXEEXT) \
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_ncf330$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
am__findtestserver_SOURCES_DIST = findtestserver.c
@@ -156,6 +155,11 @@
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+am__pingurl_SOURCES_DIST = pingurl.c
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am_pingurl_OBJECTS = pingurl.$(OBJEXT)
+pingurl_OBJECTS = $(am_pingurl_OBJECTS)
+pingurl_LDADD = $(LDADD)
+pingurl_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
am_t_dap3a_OBJECTS = t_dap3a.$(OBJEXT)
t_dap3a_OBJECTS = $(am_t_dap3a_OBJECTS)
t_dap3a_LDADD = $(LDADD)
@@ -209,10 +213,11 @@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/findtestserver.Po \
- ./$(DEPDIR)/t_dap3a.Po ./$(DEPDIR)/t_misc.Po \
- ./$(DEPDIR)/t_ncf330.Po ./$(DEPDIR)/test_cvt.Po \
- ./$(DEPDIR)/test_nstride_cached.Po ./$(DEPDIR)/test_partvar.Po \
- ./$(DEPDIR)/test_vara.Po ./$(DEPDIR)/test_varm3.Po
+ ./$(DEPDIR)/pingurl.Po ./$(DEPDIR)/t_dap3a.Po \
+ ./$(DEPDIR)/t_misc.Po ./$(DEPDIR)/t_ncf330.Po \
+ ./$(DEPDIR)/test_cvt.Po ./$(DEPDIR)/test_nstride_cached.Po \
+ ./$(DEPDIR)/test_partvar.Po ./$(DEPDIR)/test_vara.Po \
+ ./$(DEPDIR)/test_varm3.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -232,11 +237,13 @@
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(findtestserver_SOURCES) $(t_dap3a_SOURCES) \
- $(t_misc_SOURCES) t_ncf330.c $(test_cvt3_SOURCES) \
- $(test_nstride_cached_SOURCES) $(test_partvar_SOURCES) \
- $(test_vara_SOURCES) $(test_varm3_SOURCES)
-DIST_SOURCES = $(am__findtestserver_SOURCES_DIST) $(t_dap3a_SOURCES) \
+SOURCES = $(findtestserver_SOURCES) $(pingurl_SOURCES) \
+ $(t_dap3a_SOURCES) $(t_misc_SOURCES) t_ncf330.c \
+ $(test_cvt3_SOURCES) $(test_nstride_cached_SOURCES) \
+ $(test_partvar_SOURCES) $(test_vara_SOURCES) \
+ $(test_varm3_SOURCES)
+DIST_SOURCES = $(am__findtestserver_SOURCES_DIST) \
+ $(am__pingurl_SOURCES_DIST) $(t_dap3a_SOURCES) \
$(am__t_misc_SOURCES_DIST) t_ncf330.c $(test_cvt3_SOURCES) \
$(am__test_nstride_cached_SOURCES_DIST) \
$(am__test_partvar_SOURCES_DIST) $(test_vara_SOURCES) \
@@ -469,9 +476,9 @@
bases=`echo $$bases`
RECHECK_LOGS = $(TEST_LOGS)
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__EXEEXT_3 = test_partvar$(EXEEXT)
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__EXEEXT_4 = test_varm3$(EXEEXT) \
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@am__EXEEXT_4 = t_misc$(EXEEXT) \
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_nstride_cached$(EXEEXT) \
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ t_misc$(EXEEXT)
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@ test_varm3$(EXEEXT)
TEST_SUITE_LOG = test-suite.log
LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
@@ -583,8 +590,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -624,11 +633,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -735,10 +744,11 @@
test_cvt3_SOURCES = test_cvt.c t_srcdir.h
test_vara_SOURCES = test_vara.c t_srcdir.h
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@findtestserver_SOURCES = findtestserver.c
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@pingurl_SOURCES = pingurl.c
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@test_partvar_SOURCES = test_partvar.c
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@test_varm3_SOURCES = test_varm3.c
-@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@test_nstride_cached_SOURCES = test_nstride_cached.c
@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@t_misc_SOURCES = t_misc.c
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@test_nstride_cached_SOURCES = test_nstride_cached.c
+@ENABLE_DAP_REMOTE_TESTS_TRUE@@ENABLE_DAP_TRUE@test_varm3_SOURCES = test_varm3.c
# Need to add subdirs
SUBDIRS = testdata3 expected3 expectremote3
@@ -818,6 +828,10 @@
@rm -f findtestserver$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(findtestserver_OBJECTS) $(findtestserver_LDADD) $(LIBS)
+pingurl$(EXEEXT): $(pingurl_OBJECTS) $(pingurl_DEPENDENCIES) $(EXTRA_pingurl_DEPENDENCIES)
+ @rm -f pingurl$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(pingurl_OBJECTS) $(pingurl_LDADD) $(LIBS)
+
t_dap3a$(EXEEXT): $(t_dap3a_OBJECTS) $(t_dap3a_DEPENDENCIES) $(EXTRA_t_dap3a_DEPENDENCIES)
@rm -f t_dap3a$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(t_dap3a_OBJECTS) $(t_dap3a_LDADD) $(LIBS)
@@ -857,6 +871,7 @@
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findtestserver.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pingurl.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_dap3a.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_misc.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_ncf330.Po@am__quote@ # am--include-marker
@@ -1175,9 +1190,9 @@
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-test_varm3.log: test_varm3$(EXEEXT)
- @p='test_varm3$(EXEEXT)'; \
- b='test_varm3'; \
+t_misc.log: t_misc$(EXEEXT)
+ @p='t_misc$(EXEEXT)'; \
+ b='t_misc'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -1189,9 +1204,9 @@
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-t_misc.log: t_misc$(EXEEXT)
- @p='t_misc$(EXEEXT)'; \
- b='t_misc'; \
+test_varm3.log: test_varm3$(EXEEXT)
+ @p='test_varm3$(EXEEXT)'; \
+ b='test_varm3'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -1341,6 +1356,7 @@
distclean: distclean-recursive
-rm -f ./$(DEPDIR)/findtestserver.Po
+ -rm -f ./$(DEPDIR)/pingurl.Po
-rm -f ./$(DEPDIR)/t_dap3a.Po
-rm -f ./$(DEPDIR)/t_misc.Po
-rm -f ./$(DEPDIR)/t_ncf330.Po
@@ -1395,6 +1411,7 @@
maintainer-clean: maintainer-clean-recursive
-rm -f ./$(DEPDIR)/findtestserver.Po
+ -rm -f ./$(DEPDIR)/pingurl.Po
-rm -f ./$(DEPDIR)/t_dap3a.Po
-rm -f ./$(DEPDIR)/t_misc.Po
-rm -f ./$(DEPDIR)/t_ncf330.Po
diff -Nru netcdf-parallel-4.7.3/ncdap_test/pingurl.c netcdf-parallel-4.7.4/ncdap_test/pingurl.c
--- netcdf-parallel-4.7.3/ncdap_test/pingurl.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/pingurl.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,60 @@
+/*! \file
+
+Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
+2015, 2016, 2017, 2018
+University Corporation for Atmospheric Research/Unidata.
+
+See \ref copyright file for more info.
+
+*/
+#include "config.h"
+#include
+#include
+#include
+#include "nctestserver.h"
+
+#define PINGTIME 25
+
+/**
+usage: pingurl
+See if a specific server at a given url appears to be up.
+*/
+
+static void
+usage()
+{
+ fprintf(stderr,"usage: pingurl \n");
+ exit(1);
+}
+
+
+int
+main(int argc, char** argv)
+{
+ char url[MAXSERVERURL+1];
+ int found = 0;
+ int ishttps = 0;
+
+ argc--; argv++;
+ if(argc < 1)
+ usage();
+
+ /* Try http: first */
+ snprintf(url,MAXSERVERURL,"http://%s",argv[0]);
+ if(timedping(url,PINGTIME) == NC_NOERR)
+ found = 1;
+ else {
+ /* Try https: next */
+ snprintf(url,MAXSERVERURL,"https://%s",argv[0]);
+ if(timedping(url,PINGTIME) == NC_NOERR) {
+ found = 1;
+ ishttps = 1;
+ }
+ }
+ if(found)
+ printf((ishttps?"https\n":"http\n"));
+ else
+ printf("no\n");
+ exit(0);
+}
diff -Nru netcdf-parallel-4.7.3/ncdap_test/t_auth.c netcdf-parallel-4.7.4/ncdap_test/t_auth.c
--- netcdf-parallel-4.7.3/ncdap_test/t_auth.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/t_auth.c 2020-08-31 10:33:26.000000000 +0000
@@ -73,7 +73,12 @@
fprintf(stderr,"Testing: Authorization\n");
- dfaltsvc = nc_findtestserver("thredds",0,REMOTETESTSERVERS);
+ dfaltsvc = nc_findtestserver("thredds",REMOTETESTSERVERS);
+ if(svc == NULL) {
+ fprintf(stderr,"WARNING: Cannot locate test server\n");
+ exit(0);
+ }
+
snprintf(url1,sizeof(url1),URL1,USERPWD,dfaltsvc); /* embedded */
snprintf(url2,sizeof(url2),URL2,dfaltsvc); /* using rc file */
diff -Nru netcdf-parallel-4.7.3/ncdap_test/testdata3/Makefile.in netcdf-parallel-4.7.4/ncdap_test/testdata3/Makefile.in
--- netcdf-parallel-4.7.3/ncdap_test/testdata3/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/testdata3/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -194,8 +194,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -235,11 +237,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/ncdap_test/test_nstride_cached.c netcdf-parallel-4.7.4/ncdap_test/test_nstride_cached.c
--- netcdf-parallel-4.7.3/ncdap_test/test_nstride_cached.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/test_nstride_cached.c 2020-08-31 10:33:26.000000000 +0000
@@ -104,10 +104,10 @@
char* svc;
/* Find Test Server */
- svc = nc_findtestserver("thredds",0,REMOTETESTSERVERS);
+ svc = nc_findtestserver("thredds",REMOTETESTSERVERS);
if(svc == NULL) {
- fprintf(stderr,"Cannot locate test server\n");
+ fprintf(stderr,"WARNING: Cannot locate test server\n");
exit(0);
}
diff -Nru netcdf-parallel-4.7.3/ncdap_test/test_partvar2.c netcdf-parallel-4.7.4/ncdap_test/test_partvar2.c
--- netcdf-parallel-4.7.3/ncdap_test/test_partvar2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/test_partvar2.c 2020-08-31 10:33:26.000000000 +0000
@@ -99,10 +99,10 @@
char url[4096];
/* Find Test Server */
- svc = nc_findtestserver("dts",0, REMOTETESTSERVER);
+ svc = nc_findtestserver("dts",REMOTETESTSERVER);
if(svc == NULL) {
- fprintf(stderr,"Cannot locate test server\n");
+ fprintf(stderr,"WARNING: Cannot locate test server\n");
exit(1);
}
strncpy(url,PARAMS,sizeo(url));
diff -Nru netcdf-parallel-4.7.3/ncdap_test/test_partvar.c netcdf-parallel-4.7.4/ncdap_test/test_partvar.c
--- netcdf-parallel-4.7.3/ncdap_test/test_partvar.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/test_partvar.c 2020-08-31 10:33:26.000000000 +0000
@@ -110,10 +110,10 @@
char* svc = NULL;
/* Find Test Server */
- svc = nc_findtestserver("dts",0,REMOTETESTSERVERS);
+ svc = nc_findtestserver("dts",REMOTETESTSERVERS);
if(svc == NULL) {
- fprintf(stderr,"Cannot locate test server\n");
+ fprintf(stderr,"WARNING: Cannot locate test server\n");
exit(0);
}
strncpy(url,PARAMS,sizeof(url));
diff -Nru netcdf-parallel-4.7.3/ncdap_test/testurl.sh netcdf-parallel-4.7.4/ncdap_test/testurl.sh
--- netcdf-parallel-4.7.3/ncdap_test/testurl.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/testurl.sh 2020-08-31 10:33:26.000000000 +0000
@@ -23,7 +23,7 @@
DTS=`${execdir}/findtestserver dap2 dts`
if test "x$DTS" = "x" ; then
echo "WARNING: Cannot locate test server for dts"
-exit 1
+exit 0
fi
OCLOGFILE=stderr
diff -Nru netcdf-parallel-4.7.3/ncdap_test/test_varm3.c netcdf-parallel-4.7.4/ncdap_test/test_varm3.c
--- netcdf-parallel-4.7.3/ncdap_test/test_varm3.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/test_varm3.c 2020-08-31 10:33:26.000000000 +0000
@@ -95,10 +95,10 @@
#endif
/* Find Test Server */
- svc = nc_findtestserver("thredds",0,REMOTETESTSERVERS);
+ svc = nc_findtestserver("thredds",REMOTETESTSERVERS);
if(svc == NULL) {
- fprintf(stderr,"Cannot locate test server\n");
+ fprintf(stderr,"WARNING: Cannot locate test server\n");
exit(0);
}
strncpy(url,svc,sizeof(url));
diff -Nru netcdf-parallel-4.7.3/ncdap_test/t_misc.c netcdf-parallel-4.7.4/ncdap_test/t_misc.c
--- netcdf-parallel-4.7.3/ncdap_test/t_misc.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/t_misc.c 2020-08-31 10:33:26.000000000 +0000
@@ -50,12 +50,12 @@
#endif
if(serverlist == NULL || strlen(serverlist) == 0) {
- fprintf(stderr,"Cannot determine a server list");
- exit(1);
+ fprintf(stderr,"WARNING: Cannot determine a server list");
+ exit(0);
}
- svcurl = nc_findtestserver(servlet,0,serverlist);
+ svcurl = nc_findtestserver(servlet,serverlist);
if(svcurl == NULL) {
- fprintf(stderr,"not found: %s\n",servlet);
+ fprintf(stderr,"WARNING: Server not found: %s\n",servlet);
exit(1);
}
diff -Nru netcdf-parallel-4.7.3/ncdap_test/tst_formatx.sh netcdf-parallel-4.7.4/ncdap_test/tst_formatx.sh
--- netcdf-parallel-4.7.3/ncdap_test/tst_formatx.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/tst_formatx.sh 2020-08-31 10:33:26.000000000 +0000
@@ -12,7 +12,7 @@
# Figure our dst server
DTS=`./findtestserver dap2 dts`
if test "x$DTS" = "x" ; then
-echo "cannot locate test server for dts"
+echo "WARNING: cannot locate test server for dts"
exit
fi
URL="$DTS/test.03"
diff -Nru netcdf-parallel-4.7.3/ncdap_test/tst_remote.sh netcdf-parallel-4.7.4/ncdap_test/tst_remote.sh
--- netcdf-parallel-4.7.3/ncdap_test/tst_remote.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/tst_remote.sh 2020-08-31 10:33:26.000000000 +0000
@@ -10,8 +10,8 @@
# Figure our dst server; if none, then just stop
TESTSERVER=`${execdir}/findtestserver dap2 dts`
if test "x$TESTSERVER" = "x" ; then
-echo "***XFAIL: Cannot locate test server for dts"
-exit 1
+echo "***WARNING: Cannot locate test server for dts"
+exit 0
fi
PARAMS="[log]"
diff -Nru netcdf-parallel-4.7.3/ncdap_test/tst_urls.sh netcdf-parallel-4.7.4/ncdap_test/tst_urls.sh
--- netcdf-parallel-4.7.3/ncdap_test/tst_urls.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/tst_urls.sh 2020-08-31 10:33:26.000000000 +0000
@@ -1,3 +1,4 @@
+
##################################################
# Remote test info
##################################################
@@ -11,7 +12,7 @@
DTS=`${execdir}/findtestserver dap2 dts`
if test "x$DTS" = "x" ; then
echo "WARNING: Cannot locate test server for dts"
-exit 1
+exit 0
fi
if test "x$timing" = "x1" ; then TIMECMD="time"; else TIMECMD=""; fi
diff -Nru netcdf-parallel-4.7.3/ncdap_test/tst_zero_len_var.sh netcdf-parallel-4.7.4/ncdap_test/tst_zero_len_var.sh
--- netcdf-parallel-4.7.3/ncdap_test/tst_zero_len_var.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdap_test/tst_zero_len_var.sh 2020-08-31 10:33:26.000000000 +0000
@@ -10,7 +10,22 @@
# If the bug referenced in https://github.com/Unidata/netcdf-c/issues/1300
# reoccurs, then the following command would fail.
-${NCDUMP} http://test.opendap.org/opendap/data/nc/zero_length_array.nc > tst_zero_len_var.cdl
+# Figure our server; if none, then just stop
+SVCP=`${execdir}/pingurl test.opendap.org/opendap`
+if test "x$SVCP" = xno ; then
+ echo "WARNING: test.opendap.org is not accessible";
+ exit 0;
+fi
+
+if test "x$SVCP" = xhttp ; then
+URL="http://test.opendap.org/opendap"
+else
+URL="https://test.opendap.org/opendap"
+fi
+
+URL="${URL}/data/nc/zero_length_array.nc"
+
+${NCDUMP} "$URL" > tst_zero_len_var.cdl
RES=$?
diff -Nru netcdf-parallel-4.7.3/ncdump/cdl/Makefile.in netcdf-parallel-4.7.4/ncdump/cdl/Makefile.in
--- netcdf-parallel-4.7.3/ncdump/cdl/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/cdl/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -194,8 +194,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -235,11 +237,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/ncdump/cdl/ref_tst_special_atts3.cdl netcdf-parallel-4.7.4/ncdump/cdl/ref_tst_special_atts3.cdl
--- netcdf-parallel-4.7.3/ncdump/cdl/ref_tst_special_atts3.cdl 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/cdl/ref_tst_special_atts3.cdl 2020-08-31 10:33:26.000000000 +0000
@@ -27,6 +27,10 @@
var4:_Shuffle = "true" ;
var4:_Endianness = "little" ;
var4:_NoFill = "true" ;
+ int var5(dim1, dim2, dim3) ;
+ var5:_Storage = "compact" ;
+ int var6;
+ var6:_Storage = "compact" ;
float slp(time, lat, lon) ;
slp:_FillValue = 1.e+15f ;
slp:_DeflateLevel = 1 ;
diff -Nru netcdf-parallel-4.7.3/ncdump/chunkspec.c netcdf-parallel-4.7.4/ncdump/chunkspec.c
--- netcdf-parallel-4.7.3/ncdump/chunkspec.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/chunkspec.c 2020-08-31 10:33:26.000000000 +0000
@@ -24,6 +24,7 @@
size_t rank; /* number of dimensions in chunkspec string */
size_t chunksizes[NC_MAX_VAR_DIMS]; /* corresponding chunk sizes */
bool_t omit; /* true if chunking to be turned off */
+ int kind;
int igrpid; /* container of the (input) variable */
int ivarid; /* (input) Variable whose chunks are specified */
};
@@ -208,6 +209,20 @@
}
+/* Return whether chunking should be omitted, due to explicit
+ * command-line specification. */
+bool_t
+dimchunkspec_exists(int indimid) {
+ int idim;
+ for(idim = 0; idim < dimchunkspecs.ndims; idim++) {
+ if(indimid == dimchunkspecs.idimids[idim]) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+
/*
* Parse per-variable chunkspec string and convert into varchunkspec structure.
* ncid: location ID of open netCDF file or group in an open file
@@ -260,6 +275,16 @@
goto done;
}
+ /* See if the remainder matches 'compact' or 'contiguous' */
+ if(strcasecmp(p,"compact")==0) {
+ chunkspec->kind = NC_COMPACT;
+ goto notchunked;
+ } if(strcasecmp(p,"contiguous")==0) {
+ chunkspec->kind = NC_CONTIGUOUS;
+ goto notchunked;
+ } else
+ chunkspec->kind = NC_CHUNKED;
+
/* Iterate over dimension sizes */
while(*p) {
unsigned long dimsize;
@@ -293,6 +318,7 @@
if(chunkspec->chunksizes[i] > len) {ret = NC_EBADCHUNK; goto done;}
}
+notchunked:
/* add the chunkspec to our list */
listpush(varchunkspecs,chunkspec);
chunkspec = NULL;
@@ -307,6 +333,19 @@
/* Accessors */
+/* Return NC_CHUNKED || NC_CONTIGUOUS || NC_COMPACT */
+int
+varchunkspec_kind(int grpid, int varid)
+{
+ int i;
+ for(i=0;iigrpid == grpid && spec->ivarid == varid)
+ return spec->kind;
+ }
+ return NC_CONTIGUOUS; /* default */
+}
+
bool_t
varchunkspec_exists(int igrpid, int ivarid)
{
diff -Nru netcdf-parallel-4.7.3/ncdump/chunkspec.h netcdf-parallel-4.7.4/ncdump/chunkspec.h
--- netcdf-parallel-4.7.3/ncdump/chunkspec.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/chunkspec.h 2020-08-31 10:33:26.000000000 +0000
@@ -17,6 +17,11 @@
extern size_t
dimchunkspec_size(int dimid);
+/* Return 1 if a dimension spec is defined
+ * corresponding to dimid, 0 if not found */
+extern bool_t
+dimchunkspec_exists(int indimid);
+
/* Return number of dimensions for which chunking was specified in
* chunkspec string on command line, 0 if no chunkspec string was
* specified. */
@@ -36,6 +41,8 @@
extern bool_t varchunkspec_exists(int grpid, int varid);
+extern int varchunkspec_kind(int grpid, int varid);
+
extern void chunkspecinit(void);
diff -Nru netcdf-parallel-4.7.3/ncdump/CMakeLists.txt netcdf-parallel-4.7.4/ncdump/CMakeLists.txt
--- netcdf-parallel-4.7.3/ncdump/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -151,6 +151,7 @@
add_sh_test(ncdump tst_fileinfo)
add_sh_test(ncdump tst_hdf5_offset)
ENDIF(USE_NETCDF4)
+ add_sh_test(ncdump test_unicode_directory)
add_sh_test(ncdump tst_null_byte_padding)
IF(USE_STRICT_NULL_BYTE_HEADER_PADDING)
diff -Nru netcdf-parallel-4.7.3/ncdump/expected/Makefile.in netcdf-parallel-4.7.4/ncdump/expected/Makefile.in
--- netcdf-parallel-4.7.3/ncdump/expected/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/expected/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -192,8 +192,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -233,11 +235,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/ncdump/Makefile.am netcdf-parallel-4.7.4/ncdump/Makefile.am
--- netcdf-parallel-4.7.3/ncdump/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -34,7 +34,7 @@
# netcdf-3 validator program
# (https://github.com/Parallel-NetCDF/PnetCDF/blob/master/src/utils/ncvalidator/ncvalidator.c)
# that prints out the structure of a netcdf-3 file.
-# This program is built but not installed.
+# This program is built but not installed.
noinst_PROGRAMS += ncvalidator
ncvalidator_SOURCES = ncvalidator.c
@@ -61,7 +61,7 @@
# Tests for classic and 64-bit offset files.
TESTS = tst_inttags.sh run_tests.sh tst_64bit.sh ref_ctest \
ref_ctest64 tst_output.sh tst_lengths.sh tst_calendars.sh \
-run_utf8_tests.sh tst_nccopy3.sh tst_nccopy3_subset.sh \
+run_utf8_tests.sh test_unicode_directory.sh tst_nccopy3.sh tst_nccopy3_subset.sh \
tst_charfill.sh tst_iter.sh tst_formatx3.sh tst_bom.sh \
tst_dimsizes.sh run_ncgen_tests.sh tst_ncgen4_classic.sh test_radix.sh
@@ -149,7 +149,9 @@
tst_ncgen4_cycle.sh tst_null_byte_padding.sh \
ref_null_byte_padding_test.nc ref_tst_irish_rover.nc ref_provenance_v1.nc \
ref_tst_radix.cdl tst_radix.cdl test_radix.sh \
-ref_nccopy_w.cdl tst_nccopy_w3.sh tst_nccopy_w4.sh ref_no_ncproperty.nc
+ref_nccopy_w.cdl tst_nccopy_w3.sh tst_nccopy_w4.sh ref_no_ncproperty.nc \
+test_unicode_directory.sh
+
# The L512.bin file is file containing exactly 512 bytes each of value 0.
# It is used for creating hdf5 files with varying offsets for testing.
diff -Nru netcdf-parallel-4.7.3/ncdump/Makefile.in netcdf-parallel-4.7.4/ncdump/Makefile.in
--- netcdf-parallel-4.7.3/ncdump/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,9 +125,9 @@
@BUILD_TESTSETS_TRUE@ ref_ctest$(EXEEXT) ref_ctest64$(EXEEXT) \
@BUILD_TESTSETS_TRUE@ tst_output.sh tst_lengths.sh \
@BUILD_TESTSETS_TRUE@ tst_calendars.sh run_utf8_tests.sh \
-@BUILD_TESTSETS_TRUE@ tst_nccopy3.sh tst_nccopy3_subset.sh \
-@BUILD_TESTSETS_TRUE@ tst_charfill.sh tst_iter.sh \
-@BUILD_TESTSETS_TRUE@ tst_formatx3.sh tst_bom.sh \
+@BUILD_TESTSETS_TRUE@ test_unicode_directory.sh tst_nccopy3.sh \
+@BUILD_TESTSETS_TRUE@ tst_nccopy3_subset.sh tst_charfill.sh \
+@BUILD_TESTSETS_TRUE@ tst_iter.sh tst_formatx3.sh tst_bom.sh \
@BUILD_TESTSETS_TRUE@ tst_dimsizes.sh run_ncgen_tests.sh \
@BUILD_TESTSETS_TRUE@ tst_ncgen4_classic.sh test_radix.sh \
@BUILD_TESTSETS_TRUE@ tst_null_byte_padding.sh $(am__append_5) \
@@ -740,8 +740,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -781,11 +783,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -941,7 +943,8 @@
tst_null_byte_padding.sh ref_null_byte_padding_test.nc \
ref_tst_irish_rover.nc ref_provenance_v1.nc ref_tst_radix.cdl \
tst_radix.cdl test_radix.sh ref_nccopy_w.cdl tst_nccopy_w3.sh \
- tst_nccopy_w4.sh ref_no_ncproperty.nc L512.bin tst_ctests.sh \
+ tst_nccopy_w4.sh ref_no_ncproperty.nc \
+ test_unicode_directory.sh L512.bin tst_ctests.sh \
ref_ctest_small_3.c ref_ctest_small_4.c \
ref_ctest_special_atts_4.c
diff -Nru netcdf-parallel-4.7.3/ncdump/nccopy.1 netcdf-parallel-4.7.4/ncdump/nccopy.1
--- netcdf-parallel-4.7.3/ncdump/nccopy.1 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/nccopy.1 2020-08-31 10:33:26.000000000 +0000
@@ -142,7 +142,7 @@
file can also greatly speedup access, by choosing chunk shapes that
are appropriate for the most common access patterns.
.IP
-The \fIchunkspec\fP argument has two forms. The first form is the
+The \fIchunkspec\fP argument has several forms. The first form is the
original, deprecated form and is a string of comma-separated associations,
each specifying a dimension name, a '/' character, and optionally the
corresponding chunk length for that dimension. No blanks should
@@ -186,6 +186,12 @@
more than once, the second and later specifications are ignored.
Also, this second form, per-variable chunking, takes precedence over any
per-dimension chunking except the bare "/" case.
+.IP
+The third form of the \fIchunkspec\fP has the
+syntax: \fI var:compact\fP or \fI var:contiguous\fP.
+This explicitly attempts to set the variable storage type as
+compact or contiguous, respectively. These may be overridden
+if other flags require the variable to be chunked.
.IP "\fB \-v \fP \fI var1,... \fP"
The output will include data values for the specified variables, in
addition to the declarations of all dimensions, variables, and
diff -Nru netcdf-parallel-4.7.3/ncdump/nccopy.c netcdf-parallel-4.7.4/ncdump/nccopy.c
--- netcdf-parallel-4.7.3/ncdump/nccopy.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/nccopy.c 2020-08-31 10:33:26.000000000 +0000
@@ -63,16 +63,19 @@
#define MAX_FILTER_PARAMS 256
struct FilterSpec {
- char* fqn;
+ char* fqn; /* Of variable */
int nofilter; /* 1=> do not apply any filters to this variable */
- unsigned int filterid;
- size_t nparams;
- unsigned int* params;
+ NC4_Filterspec pfs;
};
static List* filterspecs = NULL;
static int suppressfilters = 0; /* 1 => do not apply any output filters unless specified */
+/* Forward declaration, because copy_type, copy_vlen_type call each other */
+static int copy_type(int igrp, nc_type typeid, int ogrp);
+static void freespeclist(List* specs);
+static void freefilterlist(size_t,NC4_Filterspec**);
+
#endif
/* table of formats for legal -k values */
@@ -259,10 +262,10 @@
goto done;
}
- /* Walk delimitng on '|' separators */
+ /* Walk delimitng on '&' separators */
for(q=vars;*q;q++) {
if(*q == '\\') q++;
- else if(*q == '|') {*q = '\0'; nvars++;}
+ else if(*q == '&') {*q = '\0'; nvars++;}
/* else continue */
}
nvars++; /*for last var*/
@@ -281,14 +284,13 @@
{
int stat = NC_NOERR;
char* optarg = NULL;
- unsigned int* params = NULL;
- size_t nparams;
- unsigned int id;
char* p = NULL;
char* remainder = NULL;
List* vlist = NULL;
int i;
int isnone = 0;
+ size_t nfilters = 0;
+ NC4_Filterspec** filters = NULL;
if(optarg0 == NULL || strlen(optarg0) == 0 || speclist == NULL) return 0;
optarg = strdup(optarg0);
@@ -301,84 +303,111 @@
else if(*p == '\\') p++;
/* else continue */
}
-
/* Parse the variable list */
if((vlist = listnew()) == NULL) {stat = NC_ENOMEM; goto done;}
if((stat=parsevarlist(optarg,vlist))) goto done;
if(strcasecmp(remainder,"none") != 0) {
+ int format;
/* Collect the id+parameters */
- if((stat=NC_parsefilterspec(remainder,&id,&nparams,¶ms))) goto done;
- } else
+ if((stat=NC_parsefilterlist(remainder,&format,&nfilters,(NC_Filterspec***)&filters))) goto done;
+ if(format != NC_FILTER_FORMAT_HDF5)
+ {stat = NC_EFILTER; goto done;}
+ } else {
isnone = 1;
+ if(nfilters == 0) {
+ /* Add a fake filter */
+ NC4_Filterspec* nilspec = (NC4_Filterspec*)calloc(1,sizeof(NC4_Filterspec));
+ if(nilspec == NULL) {stat = NC_ENOMEM; goto done;}
+ nfilters = 1;
+ filters = calloc(1,sizeof(NC4_Filterspec**));
+ if(filters == NULL) {free(nilspec); stat = NC_ENOMEM; goto done;}
+ filters[0] = nilspec; nilspec = NULL;
+ }
+ }
/* Construct a spec entry for each element in vlist */
for(i=0;ifqn = malloc(vlen+1+1); /* make room for nul and possible prefix '/' */
- if(spec->fqn == NULL) {stat = NC_ENOMEM; goto done;}
- spec->fqn[0] = '\0'; /* for strlcat */
- if(strcmp(var,"*") != 0 && var[0] != '/') strlcat(spec->fqn,"/",vlen+2);
- strlcat(spec->fqn,var,vlen+2);
- if(isnone)
- spec->nofilter = 1;
- else {
- spec->filterid = id;
- spec->nparams = nparams;
- /* Duplicate the params */
- spec->params = malloc(nparams*sizeof(unsigned int));
- if(spec->params == NULL) {stat = NC_ENOMEM; goto done;}
- memcpy(spec->params,params,nparams*sizeof(unsigned int));
+ for(k=0;kfqn = malloc(vlen+1+1); /* make room for nul and possible prefix '/' */
+ if(spec->fqn == NULL) {stat = NC_ENOMEM; goto done;}
+ spec->fqn[0] = '\0'; /* for strlcat */
+ if(strcmp(var,"*") != 0 && var[0] != '/') strlcat(spec->fqn,"/",vlen+2);
+ strlcat(spec->fqn,var,vlen+2);
+ if(isnone)
+ spec->nofilter = 1;
+ else {
+ spec->pfs = *nsf;
+ if(nsf->nparams != 0) {
+ /* Duplicate the params */
+ spec->pfs.params = malloc(spec->pfs.nparams*sizeof(unsigned int));
+ if(spec->pfs.params == NULL) {stat = NC_ENOMEM; goto done;}
+ memcpy(spec->pfs.params,nsf->params,spec->pfs.nparams*sizeof(unsigned int));
+ } else
+ spec->pfs.params = NULL;
+ }
+ listpush(speclist,spec);
+ spec = NULL;
}
- listpush(speclist,spec);
- spec = NULL;
}
-
+
done:
- if(params) free(params);
+ freefilterlist(nfilters,filters);
if(vlist) listfreeall(vlist);
if(optarg) free(optarg);
return stat;
}
-static struct FilterSpec*
-filterspecforvar(const char* ofqn)
+static int
+hasfilterspecforvar(const char* ofqn)
{
int i;
- struct FilterSpec* star = NULL;
- struct FilterSpec* match = NULL;
- /* See if any output filter spec is defined for this output variable */
- /* Name specific overrides '*' */
+ /* See which output filter specs are defined for this output variable */
for(i=0;ifqn,"*")==0)
- star = spec; /* save */
- if(strcmp(spec->fqn,ofqn)==0) {
- match = spec;
- break;;
- }
+ if(strcmp(spec->fqn,"*")==0) return 1;
+ if(strcmp(spec->fqn,ofqn)==0) return 1;
}
- if(match) return match;
- if(star) return star;
- return NULL;
+ return 0;
}
+static List*
+filterspecsforvar(const char* ofqn)
+{
+ int i;
+ List* list = listnew();
+ /* See which output filter specs are defined for this output variable */
+ for(i=0;ifqn,"*")==0) {
+ /* Add to the list */
+ listpush(list,spec);
+ } else if(strcmp(spec->fqn,ofqn)==0) {
+ /* Add to the list */
+ listpush(list,spec);
+ }
+ }
+ return list;
+}
/* Return size of chunk in bytes for a variable varid in a group igrp, or 0 if
- * layout is contiguous */
+ * layout is contiguous|compact */
static int
inq_var_chunksize(int igrp, int varid, size_t* chunksizep) {
int stat = NC_NOERR;
int ndims;
size_t *chunksizes;
int dim;
- int contig = 1;
+ int contig = NC_CONTIGUOUS;
nc_type vartype;
size_t value_size;
size_t prod;
@@ -389,10 +418,9 @@
prod = value_size;
NC_CHECK(nc_inq_varndims(igrp, varid, &ndims));
chunksizes = (size_t *) emalloc((ndims + 1) * sizeof(size_t));
- if(ndims > 0) {
- NC_CHECK(nc_inq_var_chunking(igrp, varid, &contig, NULL));
- }
- if(contig == 1) {
+ contig = NC_CHUNKED;
+ NC_CHECK(nc_inq_var_chunking(igrp, varid, &contig, NULL));
+ if(contig != NC_CHUNKED) {
*chunksizep = 0;
} else {
NC_CHECK(nc_inq_var_chunking(igrp, varid, &contig, chunksizes));
@@ -419,7 +447,7 @@
int ndims;
size_t *ichunksizes, *ochunksizes;
int dim;
- int icontig = 1, ocontig = 1;
+ int icontig = NC_CONTIGUOUS, ocontig = NC_CONTIGUOUS;
nc_type vartype;
size_t value_size;
size_t prod, iprod, oprod;
@@ -429,11 +457,10 @@
*chunkcache_preemptionp = COPY_CHUNKCACHE_PREEMPTION;
NC_CHECK(nc_inq_varndims(igrp, ivarid, &ndims));
- if(ndims > 0) {
- NC_CHECK(nc_inq_var_chunking(igrp, ivarid, &icontig, NULL));
- NC_CHECK(nc_inq_var_chunking(ogrp, ovarid, &ocontig, NULL));
- }
- if(icontig == 1 && ocontig == 1) { /* no chunking in input or output */
+ icontig = (ocontig = NC_CHUNKED);
+ NC_CHECK(nc_inq_var_chunking(igrp, ivarid, &icontig, NULL));
+ NC_CHECK(nc_inq_var_chunking(ogrp, ovarid, &ocontig, NULL));
+ if(icontig != NC_CHUNKED && ocontig != NC_CHUNKED) { /* no chunking in input or output */
*chunkcache_nelemsp = 0;
*chunkcache_sizep = 0;
*chunkcache_preemptionp = 0;
@@ -444,7 +471,7 @@
NC_CHECK(nc_inq_type(igrp, vartype, NULL, &value_size));
iprod = value_size;
- if(icontig == 0 && ocontig == 1) { /* chunking only in input */
+ if(icontig == NC_CHUNKED && ocontig != NC_CHUNKED) { /* chunking only in input */
*chunkcache_nelemsp = 1; /* read one input chunk at a time */
*chunkcache_sizep = iprod;
*chunkcache_preemptionp = 1.0f;
@@ -452,7 +479,7 @@
}
ichunksizes = (size_t *) emalloc((ndims + 1) * sizeof(size_t));
- if(icontig == 1) { /* if input contiguous, treat as if chunked on
+ if(icontig != NC_CHUNKED) { /* if input contiguous|compact, treat as if chunked on
* first dimension */
ichunksizes[0] = 1;
for(dim = 1; dim < ndims; dim++) {
@@ -462,7 +489,7 @@
NC_CHECK(nc_inq_var_chunking(igrp, ivarid, &icontig, ichunksizes));
}
- /* now can assume chunking in both input and output */
+ /* now can pretend chunking in both input and output */
ochunksizes = (size_t *) emalloc((ndims + 1) * sizeof(size_t));
NC_CHECK(nc_inq_var_chunking(ogrp, ovarid, &ocontig, ochunksizes));
@@ -481,9 +508,6 @@
return stat;
}
-/* Forward declaration, because copy_type, copy_vlen_type call each other */
-static int copy_type(int igrp, nc_type typeid, int ogrp);
-
/*
* copy a user-defined variable length type in the group igrp to the
* group ogrp
@@ -739,10 +763,11 @@
VarID vid = {igrp,varid};
VarID ovid = {ogrp,o_varid};
/* handle filter parameters, copying from input, overriding with command-line options */
- struct FilterSpec* ospec = NULL;
+ List* ospecs = NULL;
+ List* inspecs = NULL;
+ List* actualspecs = NULL;
struct FilterSpec inspec;
- struct FilterSpec nospec;
- struct FilterSpec* actualspec = NULL;
+ struct FilterSpec* tmp = NULL;
char* ofqn = NULL;
int inputdefined, outputdefined, unfiltered;
int innc4 = (inkind == NC_FORMAT_NETCDF4 || inkind == NC_FORMAT_NETCDF4_CLASSIC);
@@ -755,81 +780,112 @@
if((stat = computeFQN(ovid,&ofqn))) goto done;
/* Clear the in and out specs */
- memset(&inspec,0,sizeof(inspec));
- memset(&nospec,0,sizeof(nospec));
- nospec.nofilter = 1;
- actualspec = NULL;
- ospec = NULL;
+ inspecs = listnew();
+ ospecs = NULL;
+ actualspecs = NULL;
- /* Is there a filter on the output variable */
+ /* Is there one or more filters on the output variable */
outputdefined = 0; /* default is no filter defined */
/* Only bother to look if output is netcdf-4 variant */
if(outnc4) {
/* See if any output filter spec is defined for this output variable */
- ospec = filterspecforvar(ofqn);
- if(ospec != NULL)
+ ospecs = filterspecsforvar(ofqn);
+ if(listlength(ospecs) > 0)
outputdefined = 1;
}
- /* Is there a filter on the input variable */
+ /* Is there already a filter on the input variable */
inputdefined = 0; /* default is no filter defined */
/* Only bother to look if input is netcdf-4 variant */
if(innc4) {
- stat=nc_inq_var_filter(vid.grpid,vid.varid,&inspec.filterid,&inspec.nparams,NULL);
- if(stat && stat != NC_EFILTER)
+ size_t nfilters;
+ unsigned int* ids = NULL;
+ int k;
+ if((stat = nc_inq_var_filterids(vid.grpid,vid.varid,&nfilters,NULL)))
+ goto done;
+ if(nfilters > 0) ids = malloc(nfilters*sizeof(unsigned int));
+ if((stat = nc_inq_var_filterids(vid.grpid,vid.varid,&nfilters,ids)))
+ goto done;
+ memset(&inspec,0,sizeof(inspec));
+ for(k=0;k 0) {/* input has a filter */
- inspec.params = (unsigned int*)malloc(sizeof(unsigned int)*inspec.nparams);
- if((stat=nc_inq_var_filter(vid.grpid,vid.varid,&inspec.filterid,&inspec.nparams,inspec.params)))
- goto done;
- inputdefined = 1;
- }
+ if(inspec.pfs.nparams > 0) {
+ inspec.pfs.params = (unsigned int*)malloc(sizeof(unsigned int)*inspec.pfs.nparams);
+ if((stat=nc_inq_var_filter_info(vid.grpid,vid.varid,inspec.pfs.filterid,NULL,inspec.pfs.params)))
+ goto done;
+ }
+ tmp = malloc(sizeof(struct FilterSpec));
+ *tmp = inspec;
+ memset(&inspec,0,sizeof(inspec)); /*reset*/
+ listpush(inspecs,tmp);
+ inputdefined = 1;
+ }
+ nullfree(ids);
}
/* Rules for choosing output filter are as follows:
- global output input Actual Output
- suppress filter filter filter
+ global output input Actual Output
+ suppress filter(s) filter(s) filter
-----------------------------------------------------------
1 true undefined NA unfiltered
2 true 'none' NA unfiltered
- 3 true defined NA use output filter
- 4 false undefined defined use input filter
+ 3 true defined NA use output filter(s)
+ 4 false undefined defined use input filter(s)
5 false 'none' NA unfiltered
- 6 false defined NA use output filter
+ 6 false defined NA use output filter(s)
7 false undefined undefined unfiltered
+ 8 false defined defined use output filter(s)
*/
unfiltered = 0;
-
if(suppressfilters && !outputdefined) /* row 1 */
unfiltered = 1;
- else if(suppressfilters && outputdefined && ospec->nofilter) /* row 2 */
- unfiltered = 1;
- else if(suppressfilters && outputdefined) /* row 3 */
- actualspec = ospec;
+ else if(suppressfilters && outputdefined) { /* row 2 */
+ int k;
+ /* Walk the set of filters to apply to see if "none" was specified */
+ for(k=0;knofilter) {unfiltered = 1; break;}
+ }
+ } else if(suppressfilters && outputdefined) /* row 3 */
+ actualspecs = ospecs;
else if(!suppressfilters && !outputdefined && inputdefined) /* row 4 */
- actualspec = &inspec;
- else if(!suppressfilters && outputdefined && ospec->nofilter) /* row 5 */
- unfiltered = 1;
- else if(!suppressfilters && outputdefined) /* row 6 */
- actualspec = ospec;
- else if(!suppressfilters && !outputdefined && !inputdefined) /* row 7 */
+ actualspecs = inspecs;
+ else if(!suppressfilters && outputdefined) { /* row 5 & 6*/
+ int k;
+ /* Walk the set of filters to apply to see if "none" was specified */
+ for(k=0;knofilter) {unfiltered = 1; break;}
+ }
+ if(!unfiltered) actualspecs = ospecs;
+ } else if(!suppressfilters && !outputdefined && !inputdefined) /* row 7 */
unfiltered = 1;
+ else if(!suppressfilters && outputdefined && inputdefined) /* row 8 */
+ actualspecs = ospecs;
/* Apply actual filter spec if any */
if(!unfiltered) {
- if((stat=nc_def_var_filter(ovid.grpid,ovid.varid,
- actualspec->filterid,
- actualspec->nparams,
- actualspec->params)))
+ /* add all the actual filters */
+ int k;
+ for(k=0;kpfs.filterid,
+ actual->pfs.nparams,
+ actual->pfs.params)))
goto done;
+ }
}
done:
/* Cleanup */
if(ofqn != NULL) free(ofqn);
- if(inspec.fqn) free(inspec.fqn);
- if(inspec.params) free(inspec.params);
+ freespeclist(inspecs); inspecs = NULL;
+ listfree(ospecs); ospecs = NULL; /* Contents are also in filterspecs */
/* Note we do not clean actualspec because it is a copy of in|out spec */
return stat;
}
@@ -845,148 +901,136 @@
int outnc4 = (outkind == NC_FORMAT_NETCDF4 || outkind == NC_FORMAT_NETCDF4_CLASSIC);
VarID ovid;
char* ofqn = NULL;
- int nochunkspec = 1 ; /* 1 => no -c option applies to this variable */
+ int icontig = NC_CONTIGUOUS;
+ int ocontig = NC_CONTIGUOUS;
+ size_t ichunkp[NC_MAX_VAR_DIMS];
+ size_t ochunkp[NC_MAX_VAR_DIMS];
+ size_t dimlens[NC_MAX_VAR_DIMS];
+ int is_unlimited = 0;
/* First, check the file kinds */
if(!outnc4)
return stat; /* no chunking */
- /* See if a scalar */
- if(ndims == 0)
- return stat; /* scalars cannot be chunked */
+ memset(ichunkp,0,sizeof(ichunkp));
+ memset(ochunkp,0,sizeof(ochunkp));
+ memset(dimlens,0,sizeof(dimlens));
+
+ /* Get the chunking, if any, on the current input variable */
+ if(innc4) {
+ NC_CHECK(nc_inq_var_chunking(igrp, i_varid, &icontig, ichunkp));
+ /* pretend that this is same as a -c option */
+ } else { /* !innc4 */
+ icontig = NC_CONTIGUOUS;
+ ichunkp[0] = 0;
+ }
/* If var specific chunking was specified for this output variable
then it overrides all else.
*/
+
/* Note, using goto done instead of nested if-then-else */
- if(varchunkspec_exists(igrp,i_varid)) {
- if(varchunkspec_omit(igrp,i_varid)) {
- NC_CHECK(nc_def_var_chunking(ogrp, o_varid, NC_CONTIGUOUS, NULL));
- } else {
- size_t* ochunkp = varchunkspec_chunksizes(igrp,i_varid);
- NC_CHECK(nc_def_var_chunking(ogrp, o_varid, NC_CHUNKED, ochunkp));
- }
- goto done;
- }
+ /* First check on output contiguous'ness */
+ /* Note: the chunkspecs are defined in terms of input variable+grp ids.
+ The grp may differ if !innc4 && outnc4 */
+ if(varchunkspec_omit(igrp,i_varid))
+ ocontig = NC_CONTIGUOUS;
+ else if(varchunkspec_exists(igrp,i_varid))
+ ocontig = varchunkspec_kind(igrp,i_varid);
+ else
+ ocontig = icontig;
+
+ /* Figure out the chunking even if we do not decide to do so*/
+ if(varchunkspec_exists(igrp,i_varid)
+ && varchunkspec_kind(igrp,i_varid) == NC_CHUNKED)
+ memcpy(ochunkp,varchunkspec_chunksizes(igrp,i_varid),ndims*sizeof(size_t));
+
+ /* If any kind of output filter was specified, then not contiguous */
+ ovid.grpid = ogrp;
+ ovid.varid = o_varid;
+ if((stat=computeFQN(ovid,&ofqn))) goto done;
+ if(option_deflate_level >= 0 || hasfilterspecforvar(ofqn))
+ ocontig = NC_CHUNKED;
- /* See about dim-specific chunking */
+ /* See about dim-specific chunking; does not override -c spec*/
{
int idim;
/* size of a chunk: product of dimension chunksizes and size of value */
size_t csprod;
- int is_unlimited = 0;
size_t typesize;
- size_t ichunkp[NC_MAX_VAR_DIMS];
- size_t ochunkp[NC_MAX_VAR_DIMS];
int dimids[NC_MAX_VAR_DIMS];
- int icontig = 1;
- int ocontig = 1; /* until proven otherwise */
/* See if dim-specific chunking was suppressed */
- if(dimchunkspec_omit())
- goto next2;
+ if(dimchunkspec_omit()) /* use input chunksizes */
+ goto next2;
- /* Setup for output chunking */
- typesize = val_size(ogrp, o_varid);
+ /* Setup for possible output chunking */
+ typesize = val_size(igrp, i_varid);
csprod = typesize;
memset(&dimids,0,sizeof(dimids));
- memset(&ichunkp,0,sizeof(ichunkp));
- memset(&ochunkp,0,sizeof(ochunkp));
-
- /* Get the chunking, if any, on the current input variable */
- if(innc4) {
- NC_CHECK(nc_inq_var_chunking(igrp, i_varid, &icontig, ichunkp));
- /* pretend that this is same as a -c option */
- nochunkspec = 0;
- } else {
- icontig = 1;
- ichunkp[0] = 0;
- }
- if(!icontig)
- ocontig = 0; /* If input is chunked, then so is output */
/* Prepare to iterate over the dimids of this input variable */
NC_CHECK(nc_inq_vardimid(igrp, i_varid, dimids));
- /* Assign chunk sizes for all dimensions of variable;
+ /* Capture dimension lengts for all dimensions of variable;
even if we decide to not chunk */
for(idim = 0; idim < ndims; idim++) {
int idimid = dimids[idim];
int odimid = dimmap_odimid(idimid);
- size_t chunksize;
- size_t dimlen;
/* Get input dimension length */
- NC_CHECK(nc_inq_dimlen(igrp, idimid, &dimlen));
+ NC_CHECK(nc_inq_dimlen(igrp, idimid, &dimlens[idim]));
/* Check for unlimited */
if(dimmap_ounlim(odimid)) {
is_unlimited = 1;
- ocontig = 0; /* force chunking */
- }
-
- /* If the -c set a chunk size for this dimension, use it */
- chunksize = dimchunkspec_size(idimid);
- if(chunksize > 0) { /* found in chunkspec */
- ochunkp[idim] = chunksize;
- ocontig = 0; /* cannot use contiguous */
- nochunkspec = 0; /* form of explicit chunking */
- goto next;
- }
-
- /* Not specified in -c; Apply defaulting rules as defined in nccopy.1 */
-
- /* If input is chunked, then use that chunk size */
- if(!icontig) {
- ochunkp[idim] = ichunkp[idim];
- ocontig = 0;
- goto next;
+ ocontig = NC_CHUNKED; /* force chunking */
}
- /* If input is not netcdf-4 then use the input size as the chunk size;
- but do not force chunking.
- */
- if(!innc4) {
- ochunkp[idim] = dimlen;
- goto next;
- }
+ if(dimchunkspec_exists(idimid)) {
+ /* If the -c set a chunk size for this dimension, use it */
+ dimlens[idim] = dimchunkspec_size(idimid); /* Save it */
+ ocontig = NC_CHUNKED; /* force chunking */
+ }
/* Default for unlimited is max(4 megabytes, current dim size) */
if(is_unlimited) {
size_t mb4dimsize = DFALTUNLIMSIZE / typesize;
- ochunkp[idim] = (dimlen > mb4dimsize ? mb4dimsize : dimlen);
- } else {
- /* final default is the current dimension size */
- ochunkp[idim] = dimlen;
+ if(dimlens[idim] > mb4dimsize)
+ dimlens[idim] = mb4dimsize;
}
-
-next:
+ }
+ /* compute the final ochunksizes: precedence is output, input, dimeln */
+ for(idim = 0; idim < ndims; idim++) {
+ if(ochunkp[idim] == 0) {
+ if(ichunkp[idim] != 0)
+ ochunkp[idim] = ichunkp[idim];
+ }
+ if(ochunkp[idim] == 0) {
+ if(dimlens[idim] != 0)
+ ochunkp[idim] = dimlens[idim];
+ }
+ if(ochunkp[idim] == 0) {stat = NC_EINTERNAL; goto done;}
/* compute on-going dimension product */
csprod *= ochunkp[idim];
}
-
- /* Finally, if total chunksize is too small (and dim is not unlimited) => do not chunk */
- if(csprod < option_min_chunk_bytes && !is_unlimited) {
- ocontig = 1; /* Force contiguous */
- }
+ /* if total chunksize is too small (and dim is not unlimited) => do not chunk */
+ if(csprod < option_min_chunk_bytes && !is_unlimited)
+ ocontig = NC_CONTIGUOUS; /* Force contiguous */
+ }
next2:
- /* If any kind of output filter was specified, then not contiguous */
- ovid.grpid = ogrp;
- ovid.varid = o_varid;
- if((stat=computeFQN(ovid,&ofqn))) goto done;
- if(option_deflate_level >= 0 || filterspecforvar(ofqn) != NULL)
- ocontig = 0;
-
- /* Apply the chunking, if any */
- if(!nochunkspec) {/* explicitly set chunking */
- if(ocontig) { /* We can use contiguous output */
- NC_CHECK(nc_def_var_chunking(ogrp, o_varid, NC_CONTIGUOUS, NULL));
- } else {
- NC_CHECK(nc_def_var_chunking(ogrp, o_varid, NC_CHUNKED, ochunkp));
- }
- } /* else no chunk spec at all, let defaults set at nc_def_var() be used */
+ /* Apply the chunking, if any */
+ switch (ocontig) {
+ case NC_CHUNKED:
+ NC_CHECK(nc_def_var_chunking(ogrp, o_varid, NC_CHUNKED, ochunkp));
+ break;
+ case NC_CONTIGUOUS:
+ case NC_COMPACT:
+ NC_CHECK(nc_def_var_chunking(ogrp, o_varid, ocontig, NULL));
+ break;
+ default: stat = NC_EINVAL; goto done;
}
#ifdef USE_NETCDF4
@@ -994,18 +1038,15 @@
{ int d;
size_t chunksizes[NC_MAX_VAR_DIMS];
char name[NC_MAX_NAME];
- int contig = 0;
- unsigned long long totalsize = 1;
- NC_CHECK(nc_inq_var(ogrp,o_varid,name,NULL,NULL,NULL,NULL));
- NC_CHECK(nc_inq_var_chunking(ogrp, o_varid, &contig, chunksizes));
- fprintf(stderr,"xxx: chunk sizes: %s[",name);
- if(contig) {
+ if(ocontig == NC_CONTIGUOUS) {
fprintf(stderr,"contig]\n");
+ } else if(ocontig == NC_COMPACT) {
+ fprintf(stderr,"compact]\n");
} else {
for(d=0;d 0) fprintf(stderr,",");
- fprintf(stderr,"%lu",(unsigned long)chunksizes[d]);
+ fprintf(stderr,"%lu",(unsigned long)ochunkp[d]);
}
fprintf(stderr,"]=%llu\n",totalsize);
}
@@ -1028,18 +1069,19 @@
int innc4 = (inkind == NC_FORMAT_NETCDF4 || inkind == NC_FORMAT_NETCDF4_CLASSIC);
int outnc4 = (outkind == NC_FORMAT_NETCDF4 || outkind == NC_FORMAT_NETCDF4_CLASSIC);
int deflated = 0; /* true iff deflation is applied */
+ int ndims;
if(!outnc4)
return stat; /* Ignore non-netcdf4 files */
{ /* handle chunking parameters */
- int ndims;
NC_CHECK(nc_inq_varndims(igrp, varid, &ndims));
if (ndims > 0) { /* no chunking for scalar variables */
NC_CHECK(copy_chunking(igrp, varid, ogrp, o_varid, ndims, inkind, outkind));
}
}
+ if(ndims > 0)
{ /* handle compression parameters, copying from input, overriding
* with command-line options */
int shuffle_in=0, deflate_in=0, deflate_level_in=0;
@@ -1071,7 +1113,7 @@
}
}
- if(innc4 && outnc4)
+ if(innc4 && outnc4 && ndims > 0)
{ /* handle checksum parameters */
int fletcher32 = 0;
NC_CHECK(nc_inq_var_fletcher32(igrp, varid, &fletcher32));
@@ -1089,7 +1131,7 @@
}
}
- if(!deflated) {
+ if(!deflated && ndims > 0) {
/* handle other general filters */
NC_CHECK(copy_var_filter(igrp, varid, ogrp, o_varid, inkind, outkind));
}
@@ -1209,9 +1251,9 @@
int kind;
NC_CHECK(nc_inq_format(grp, &kind));
if(kind == NC_FORMAT_NETCDF4 || kind == NC_FORMAT_NETCDF4_CLASSIC) {
- int contig = 1;
+ int contig = NC_CONTIGUOUS
NC_CHECK(nc_inq_var_chunking(grp, varid, &contig, NULL));
- if(contig == 0) { /* chunked */
+ if(contig == NC_CHUNKED) { /* chunked */
NC_CHECK(nc_set_var_chunk_cache(grp, varid, chunk_cache_size, cache_nelems, cache_preemp));
}
}
@@ -1518,9 +1560,9 @@
NC_CHECK(nc_inq_format(ogrp, &okind));
if(okind == NC_FORMAT_NETCDF4 || okind == NC_FORMAT_NETCDF4_CLASSIC) {
/* if this variable chunked, set variable chunk cache size */
- int contig = 1;
+ int contig = NC_CONTIGUOUS;
NC_CHECK(nc_inq_var_chunking(ogrp, ovarid, &contig, NULL));
- if(contig == 0) { /* chunked */
+ if(contig == NC_CHUNKED) { /* chunked */
if(option_compute_chunkcaches) {
/* Try to estimate variable-specific chunk cache,
* depending on specific size and shape of this
@@ -2100,7 +2142,7 @@
[-h n] set size in bytes of chunk_cache for chunked variables\n\
[-e n] set number of elements that chunk_cache can hold\n\
[-r] read whole input file into diskless file on open (classic or 64-bit offset or cdf5 formats only)\n\
- [-F filterspec] specify the compression algorithm to apply to an output variable.\n\
+ [-F filterspec] specify a compression algorithm to apply to an output variable (may be repeated).\n\
[-Ln] set log level to n (>= 0); ignored if logging isn't enabled.\n\
[-Mn] set minimum chunk size to n bytes (n >= 0)\n\
infile name of netCDF input file\n\
@@ -2328,15 +2370,39 @@
exitcode = EXIT_FAILURE;
#ifdef USE_NETCDF4
- { int i;
- /* Clean up */
- for(i=0;ifqn) free(spec->fqn);
- if(spec->params) free(spec->params);
- }
- }
+ /* Clean up */
+ freespeclist(filterspecs);
+ filterspecs = NULL;
#endif /*USE_NETCDF4*/
exit(exitcode);
}
+
+#ifdef USE_NETCDF4
+static void
+freespeclist(List* specs)
+{
+ int i;
+ for(i=0;ifqn) free(spec->fqn);
+ if(spec->pfs.params) free(spec->pfs.params);
+ free(spec);
+ }
+ listfree(specs);
+}
+
+static void
+freefilterlist(size_t nfilters, NC4_Filterspec** filters)
+{
+ int i;
+ if(filters == NULL) return;
+ for(i=0;iparams) free(pfs->params);
+ free(pfs);
+ }
+ free(filters);
+}
+#endif
+
diff -Nru netcdf-parallel-4.7.3/ncdump/ncdump.1 netcdf-parallel-4.7.4/ncdump/ncdump.1
--- netcdf-parallel-4.7.3/ncdump/ncdump.1 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/ncdump.1 2020-08-31 10:33:26.000000000 +0000
@@ -195,7 +195,7 @@
`_NoFill' is `true' if the persistent NoFill property was set for the
variable when it was defined.
`_Shuffle' is `true' if use of the shuffle filter was specified for the variable.
-`_Storage' is `contiguous' or `chunked', depending on how the
+`_Storage' is `contiguous' or `compact' or `chunked', depending on how the
variable's data is stored.
.IP "\fB-t\fP"
Controls display of time data, if stored in a variable that uses
diff -Nru netcdf-parallel-4.7.3/ncdump/ncdump.c netcdf-parallel-4.7.4/ncdump/ncdump.c
--- netcdf-parallel-4.7.3/ncdump/ncdump.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/ncdump.c 2020-08-31 10:33:26.000000000 +0000
@@ -9,6 +9,7 @@
#include
#endif
#ifdef _MSC_VER /* Microsoft Compilers */
+
#include
#endif
#ifdef HAVE_UNISTD_H
@@ -36,6 +37,7 @@
#include "netcdf.h"
#include "netcdf_mem.h"
+#include "netcdf_filter.h"
#include "netcdf_aux.h"
#include "utils.h"
#include "nccomps.h"
@@ -48,7 +50,6 @@
#include "cdl.h"
#include "nclog.h"
#include "ncwinpath.h"
-#include "netcdf_aux.h"
#include "nclist.h"
#include "nc_provenance.h"
@@ -158,7 +159,7 @@
#ifdef vms
#define FILE_DELIMITER ']'
#endif
-#if defined(WIN32) || defined(msdos)
+#if defined(_WIN32) || defined(msdos)
#define FILE_DELIMITER '\\'
#endif
#ifndef FILE_DELIMITER /* default to unix */
@@ -982,17 +983,19 @@
const ncvar_t *varp
)
{
+ int contig = NC_CHUNKED;
/* No special variable attributes for classic or 64-bit offset data */
if(kind == 1 || kind == 2)
return;
- /* _Chunking */
- if (varp->ndims > 0) { /* no chunking for scalar variables */
- int contig = 0;
- NC_CHECK( nc_inq_var_chunking(ncid, varid, &contig, NULL ) );
- if(contig == 1) {
- pr_att_name(ncid, varp->name, NC_ATT_STORAGE);
+ /* _Chunking tests */
+ NC_CHECK( nc_inq_var_chunking(ncid, varid, &contig, NULL ) );
+ if(contig == NC_CONTIGUOUS) {
+ pr_att_name(ncid, varp->name, NC_ATT_STORAGE);
printf(" = \"contiguous\" ;\n");
- } else {
+ } else if(contig == NC_COMPACT) {
+ pr_att_name(ncid, varp->name, NC_ATT_STORAGE);
+ printf(" = \"compact\" ;\n");
+ } else {
size_t *chunkp;
int i;
pr_att_name(ncid, varp->name, NC_ATT_STORAGE);
@@ -1006,18 +1009,64 @@
printf("%lu%s", (unsigned long)chunkp[i], i+1 < varp->ndims ? ", " : " ;\n");
}
free(chunkp);
- }
}
- /*_Deflate, _Shuffle */
+ /* _Filter (including deflate and shuffle) */
{
- int shuffle=NC_NOSHUFFLE, deflate=0, deflate_level=0;
- NC_CHECK( nc_inq_var_deflate(ncid, varid, &shuffle,
- &deflate, &deflate_level) );
- if(deflate != 0) {
- pr_att_name(ncid, varp->name, NC_ATT_DEFLATE);
- printf(" = %d ;\n", deflate_level);
+ size_t nparams, nfilters, nbytes;
+ int shuffle=NC_NOSHUFFLE;
+ unsigned int* filterids = NULL;
+ unsigned int* params = NULL;
+ int usedeflateatt = 0;
+
+ /* Get applicable filter ids */
+ NC_CHECK(nc_inq_var_filterids(ncid, varid, &nfilters, NULL));
+ /* Get set of filters for this variable */
+ if(nfilters > 0) {
+ filterids = (unsigned int*)malloc(sizeof(unsigned int)*nfilters);
+ if(filterids == NULL) NC_CHECK(NC_ENOMEM);
+ } else
+ filterids = NULL;
+ NC_CHECK(nc_inq_var_filterids(ncid, varid, &nfilters, filterids));
+ if(nfilters > 0) {
+ int k;
+ int pratt = 0;
+ for(k=0;k 0) {
+ params = (unsigned int*)calloc(1,sizeof(unsigned int)*nparams);
+ NC_CHECK(nc_inq_var_filter_info(ncid, varid, filterids[k], &nbytes, params));
+ } else
+ params = NULL;
+ /* Use _Deflate if the first filter is zip */
+ if(k == 0 && filterids[k] == H5Z_FILTER_DEFLATE) {
+ pr_att_name(ncid, varp->name, NC_ATT_DEFLATE);
+ printf(" = %d", (int)params[0]);
+ pratt = 1;
+ usedeflateatt = 1;
+ nullfree(params); params = NULL;
+ continue;
+ }
+ if(pratt || k == 0) {
+ pr_att_name(ncid,varp->name,NC_ATT_FILTER);
+ printf(" = \"");
+ pratt = 0;
+ }
+ if(k > 0) printf("|");
+ printf("%u",filterids[k]);
+ if(nparams > 0) {
+ int i;
+ for(i=0;iname, NC_ATT_SHUFFLE);
printf(" = \"true\" ;\n");
@@ -1054,28 +1103,6 @@
printf(" ;\n");
}
}
- /* _Filter */
- {
- unsigned int id;
- size_t nparams;
- unsigned int* params = NULL;
- if(nc_inq_var_filter(ncid, varid, &id, &nparams, NULL) == NC_NOERR
- && id > 0) {
- if(nparams > 0) {
- params = (unsigned int*)calloc(1,sizeof(unsigned int)*nparams);
- NC_CHECK(nc_inq_var_filter(ncid, varid, &id, &nparams, params));
- }
- pr_att_name(ncid,varp->name,NC_ATT_FILTER);
- printf(" = \"%u",id);
- if(nparams > 0) {
- int i;
- for(i=0;ienhanced"
# This should produce same as -c dim0/,dim1/1,dim2/,dim3/1,dim4/,dim5/1,dim6/
-${NCCOPY} -c ivar:7,1,2,1,5,1,9 tst_nc5.nc tmp_nc5.nc
+# But note that the chunk product is less than default, so we need to reduce it (-M)
+${NCCOPY} -M1000 -c ivar:7,1,2,1,5,1,9 tst_nc5.nc tmp_nc5.nc
${NCDUMP} -n tst_nc5 tmp_nc5.nc > tmp_nc5.cdl
# Verify that the core cdl is the same
diff tst_nc5.cdl tmp_nc5.cdl
@@ -109,7 +110,8 @@
reset
./tst_chunking tst_nc5.nc deflate
${NCDUMP} -n tst_nc5 tst_nc5.nc > tst_nc5.cdl
-${NCCOPY} -c ivar:4,1,2,1,5,2,3 tst_nc5.nc tmp_nc5.nc
+# Use -M to ensure that chunking takes effect
+${NCCOPY} -M500 -c ivar:4,1,2,1,5,2,3 tst_nc5.nc tmp_nc5.nc
${NCDUMP} -n tst_nc5 tmp_nc5.nc > tmp_nc5.cdl
diff tst_nc5.cdl tmp_nc5.cdl
@@ -121,7 +123,6 @@
# track line to match
BASELINE='ivar:_ChunkSizes = 4, 1, 2, 1, 5, 2, 3 ;'
verifychunkline "$TESTLINE" "$BASELINE"
-
# Make sure that fvar was not chunked
checkfvar tmp_nc5.cdl
@@ -133,7 +134,7 @@
reset
./tst_chunking tst_nc5.nc group
${NCDUMP} -n tst_nc5 tst_nc5.nc > tst_nc5.cdl
-${NCCOPY} -c /g/ivar:4,1,2,1,5,2,3 tst_nc5.nc tmp_nc5.nc
+${NCCOPY} -M500 -c /g/ivar:4,1,2,1,5,2,3 tst_nc5.nc tmp_nc5.nc
${NCDUMP} -n tst_nc5 tmp_nc5.nc > tmp_nc5.cdl
diff tst_nc5.cdl tmp_nc5.cdl
@@ -153,7 +154,7 @@
reset
./tst_chunking tst_nc5.nc unlimited # should produce modified tmp_nc5.nc with ivar of rank 2
${NCDUMP} -n tst_nc5 tst_nc5.nc > tst_nc5.cdl
-${NCCOPY} -c ivar:5,3 tst_nc5.nc tmp_nc5.nc
+${NCCOPY} -M500 -c ivar:5,3 tst_nc5.nc tmp_nc5.nc
${NCDUMP} -n tst_nc5 tmp_nc5.nc > tmp_nc5.cdl
diff tst_nc5.cdl tmp_nc5.cdl
@@ -176,7 +177,7 @@
reset
./tst_chunking tst_nc5_omit.nc
${NCDUMP} -n tst_nc5_omit tst_nc5_omit.nc > tst_nc5_omit.cdl
-${NCCOPY} -c ivar:7,1,2,1,5,1,9 -c fvar: tst_nc5_omit.nc tmp_nc5_omit.nc
+${NCCOPY} -M500 -c ivar:7,1,2,1,5,1,9 -c fvar: tst_nc5_omit.nc tmp_nc5_omit.nc
${NCDUMP} -n tst_nc5_omit tmp_nc5_omit.nc > tmp_nc5_omit.cdl
diff tst_nc5_omit.cdl tmp_nc5_omit.cdl
diff -Nru netcdf-parallel-4.7.3/ncdump/tst_special_atts.c netcdf-parallel-4.7.4/ncdump/tst_special_atts.c
--- netcdf-parallel-4.7.3/ncdump/tst_special_atts.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncdump/tst_special_atts.c 2020-08-31 10:33:26.000000000 +0000
@@ -28,6 +28,11 @@
#define VAR3_RANK 3
#define VAR4_NAME "var4"
#define VAR4_RANK 3
+#define VAR5_NAME "var5"
+#define VAR5_RANK VAR1_RANK
+#define VAR6_NAME "var6"
+#define VAR6_RANK 1
+#define VAR7_NAME "var7"
#define CHUNK1 (DIM1_LEN/2 + 1)
#define CHUNK2 (DIM2_LEN/3 + 1)
#define CHUNK3 (DIM3_LEN/4 + 1)
@@ -42,7 +47,7 @@
int i, j, k, m;
int dimids[VAR3_RANK];
- int var1id, var2id, var3id, var4id, var5id;
+ int var1id, var2id, var3id, var4id, var5id, var6id, var7id;
size_t chunksizes[] = {CHUNK1, CHUNK2, CHUNK3};
int data1[DIM1_LEN];
int data1_in[DIM1_LEN];
@@ -105,9 +110,11 @@
NC_COMPOUND_OFFSET(struct obs_t, attention_span),
NC_INT64)) ERR;
/* create a variable of that compound type */
- if (nc_def_var(ncid, "var5", typeid, VAR1_RANK, dimids, &var5id))
+ if (nc_def_var(ncid, VAR5_NAME, typeid, VAR5_RANK, dimids, &var5id))
ERR;
}
+ if (nc_def_var(ncid, VAR6_NAME, NC_INT, VAR6_RANK, dimids, &var6id)) ERR;
+ if (nc_def_var(ncid, VAR7_NAME, NC_INT, 0, NULL, &var7id)) ERR;
/* Specify contiguous storage and endianness explicitly for var1. */
if (nc_def_var_chunking(ncid, var1id, NC_CONTIGUOUS, NULL)) ERR;
@@ -135,6 +142,10 @@
if (nc_def_var_fletcher32(ncid, var5id, NC_FLETCHER32)) ERR;
if (nc_def_var_deflate(ncid, var5id, NC_SHUFFLE, COMPRESS, DEFLATE_LEVEL)) ERR;
+ /* Set _Storage as compact */
+ if (nc_def_var_chunking(ncid, var6id, NC_COMPACT, NULL)) ERR;
+ if (nc_def_var_chunking(ncid, var7id, NC_COMPACT, NULL)) ERR;
+
if (nc_enddef(ncid)) ERR;
/* Some artificial data */
@@ -154,6 +165,8 @@
if(nc_put_var(ncid, var2id, &data2[0][0])) ERR;
if(nc_put_var(ncid, var3id, &data3[0][0][0])) ERR;
if(nc_put_var(ncid, var4id, &data3[0][0][0])) ERR;
+ if(nc_put_var(ncid, var6id, &data3[0][0][0])) ERR;
+ if(nc_put_var(ncid, var7id, &data3[0][0][0])) ERR;
if (nc_close(ncid)) ERR;
diff -Nru netcdf-parallel-4.7.3/ncgen/genbin.c netcdf-parallel-4.7.4/ncgen/genbin.c
--- netcdf-parallel-4.7.3/ncgen/genbin.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/genbin.c 2020-08-31 10:33:26.000000000 +0000
@@ -199,8 +199,9 @@
int stat = NC_NOERR;
Specialdata* special = var->var.special;
if(special->flags & _STORAGE_FLAG) {
- if(special->_Storage == NC_CONTIGUOUS) {
- stat = nc_def_var_chunking(var->container->nc_id, var->nc_id, NC_CONTIGUOUS, NULL);
+ if(special->_Storage == NC_CONTIGUOUS
+ || special->_Storage == NC_COMPACT) {
+ stat = nc_def_var_chunking(var->container->nc_id, var->nc_id, special->_Storage, NULL);
} else { /* chunked */
if(special->nchunks == 0 || special->_ChunkSizes == NULL)
derror("NC_CHUNKED requested, but no chunksizes specified");
@@ -239,28 +240,14 @@
check_err(stat,__LINE__,"ncgen");
}
if(special->flags & _FILTER_FLAG) {
- /* Special check for alternate way to specify _Deflate */
- if(special->_FilterID == ZIP_ID) {
- unsigned int level;
- if(special->nparams == 0 || special->_FilterParams == NULL)
- level = 9; /* default */
- else
- level = special->_FilterParams[0];
- if(level > 9)
- derror("Illegal deflate level");
- else {
- stat = nc_def_var_deflate(var->container->nc_id,
- var->nc_id,
- (special->_Shuffle == 1?1:0),
- (level > 0?1:0),
- level);
- }
- } else {
+ int k;
+ for(k=0;knfilters;k++) {
+ NC4_Filterspec* nfs = special->_Filters[k];
stat = nc_def_var_filter(var->container->nc_id,
var->nc_id,
- special->_FilterID,
- special->nparams,
- special->_FilterParams
+ nfs->filterid,
+ nfs->nparams,
+ nfs->params
);
}
check_err(stat,__LINE__,"ncgen");
diff -Nru netcdf-parallel-4.7.3/ncgen/genc.c netcdf-parallel-4.7.4/ncgen/genc.c
--- netcdf-parallel-4.7.3/ncgen/genc.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/genc.c 2020-08-31 10:33:26.000000000 +0000
@@ -113,21 +113,28 @@
codeline("} ;");
}
if(special->flags & _FILTER_FLAG) {
- int i;
- unsigned int* params = special->_FilterParams;
- if(special->nparams == 0 || params == NULL) continue;
- bbClear(tmp);
- for(i=0;inparams;i++) {
- bbprintf(tmp,"%s%luU",
+ int k;
+ for(k=0;knfilters;k++) {
+ int i;
+ size_t nparams;
+ unsigned int* params;
+ NC4_Filterspec* nfs = (NC4_Filterspec*)special->_Filters[k];
+ if(nfs->nparams == 0 || nfs->params == NULL) continue;
+ bbClear(tmp);
+ nparams = nfs->nparams;
+ params = nfs->params;
+ for(i=0;inparams);
- codedump(stmt);
- codedump(tmp);
- codeline("} ;");
- }
- bbFree(tmp);
+ }
+ bbFree(tmp);
}
codeline("");
}
@@ -446,13 +453,18 @@
Specialdata* special = vsym->var.special;
if(usingclassic) return;
if(special->flags & _STORAGE_FLAG) {
- int storage = special->_Storage;
+ const char* storage = NULL;
size_t* chunks = special->_ChunkSizes;
+ switch (special->_Storage) {
+ case NC_CONTIGUOUS: storage = "NC_CONTIGUOUS"; break;
+ case NC_COMPACT: storage = "NC_COMPACT"; break;
+ case NC_CHUNKED: storage = "NC_CHUNKED"; break;
+ }
bbprintf0(stmt,
" stat = nc_def_var_chunking(%s, %s, %s, ",
groupncid(vsym->container),
varncid(vsym),
- (storage == NC_CONTIGUOUS?"NC_CONTIGUOUS":"NC_CHUNKED"));
+ storage);
codedump(stmt);
if(special->nchunks == 0 || chunks == NULL)
codepartial("NULL");
@@ -505,46 +517,27 @@
codelined(1,"check_err(stat,__LINE__,__FILE__);");
}
if(special->flags & _FILTER_FLAG) {
- /* Special check for alternate way to specify _Deflate */
- if(special->_FilterID == ZIP_ID) {
- unsigned int level;
- if(special->nparams == 0 || special->_FilterParams == NULL)
- level = 9; /* default */
- else
- level = special->_FilterParams[0];
- if(level > 9)
- derror("Illegal deflate level");
- else {
- bbprintf0(stmt,
- " stat = nc_def_var_deflate(%s, %s, %s, %d, %d);\n",
- groupncid(vsym->container),
- varncid(vsym),
- (special->_Shuffle == 1?"NC_SHUFFLE":"NC_NOSHUFFLE"),
- 1,
- level);
- codedump(stmt);
- }
- } else {
- bbprintf0(stmt,
- " stat = nc_def_var_filter(%s, %s, %u, %lu, ",
+ int k;
+ for(k=0;knfilters;k++) {
+ NC4_Filterspec* nfs = (NC4_Filterspec*)special->_Filters[k];
+ bbprintf0(stmt,
+ " stat = nc_def_var_filter(%s, %s, %u, %u, ",
groupncid(vsym->container),
varncid(vsym),
- special->_FilterID,
- special->nparams
+ nfs->filterid,
+ nfs->nparams
);
+ codedump(stmt);
+ if(nfs->nparams == 0 || nfs->params == NULL)
+ codepartial("NULL");
+ else {
+ bbprintf0(stmt,"%s_%d_filterparams",cname(vsym),k);
codedump(stmt);
- if(special->nparams == 0 || special->_FilterParams == NULL)
- codepartial("NULL");
- else {
- bbprintf0(stmt,"%s_filterparams",cname(vsym));
- codedump(stmt);
- }
- codeline(");");
+ }
+ codeline(");");
+ codelined(1,"check_err(stat,__LINE__,__FILE__);");
}
- codelined(1,"check_err(stat,__LINE__,__FILE__);");
}
-
-
}
#endif /*USE_NETCDF4*/
diff -Nru netcdf-parallel-4.7.3/ncgen/includes.h netcdf-parallel-4.7.4/ncgen/includes.h
--- netcdf-parallel-4.7.3/ncgen/includes.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/includes.h 2020-08-31 10:33:26.000000000 +0000
@@ -40,15 +40,14 @@
#define ENABLE_JAVA
#include "netcdf.h"
+#include "netcdf_filter.h"
+#include "nc4internal.h"
#include "data.h"
#include "ncgen.h"
#include "genlib.h"
#include "util.h"
#include "debug.h"
#include "nc.h"
-#ifdef USE_NETCDF4
-#include "nc4internal.h"
-#endif
extern int specialconstants;
diff -Nru netcdf-parallel-4.7.3/ncgen/Makefile.in netcdf-parallel-4.7.4/ncgen/Makefile.in
--- netcdf-parallel-4.7.3/ncgen/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -303,8 +303,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -344,11 +346,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/ncgen/ncgen.1 netcdf-parallel-4.7.4/ncgen/ncgen.1
--- netcdf-parallel-4.7.3/ncgen/ncgen.1 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/ncgen.1 2020-08-31 10:33:26.000000000 +0000
@@ -808,7 +808,7 @@
.IP 4. 3
`_Shuffle' specifies if the the shuffle filter should be used.
.IP 5. 3
-`_Storage' is `contiguous' or `chunked'.
+`_Storage' is `contiguous' or `compact` or `chunked'.
.IP 6. 3
`_ChunkSizes' is a list of chunk sizes for each dimension of
the variable
diff -Nru netcdf-parallel-4.7.3/ncgen/ncgen.h netcdf-parallel-4.7.4/ncgen/ncgen.h
--- netcdf-parallel-4.7.3/ncgen/ncgen.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/ncgen.h 2020-08-31 10:33:26.000000000 +0000
@@ -6,7 +6,7 @@
* $Header: /upc/share/CVS/netcdf-3/ncgen/ncgen.h,v 1.18 2010/06/01 15:34:53 ed Exp $
*********************************************************************/
-#ifdef _MSC_VER
+#ifdef _WIN32
#include
#include "../ncdump/isnan.h"
#define strcasecmp _stricmp
@@ -117,11 +117,6 @@
extern struct Kvalues legalkinds[];
-struct FilterID {
-char* name;
-unsigned int id;
-};
-
#define ZIP_ID 0xFFFFFFFF
#define SZIP_ID 0xFFFFFFFE
#define BZIP2_ID 307U
@@ -140,9 +135,8 @@
int _Shuffle; /* 0 => false, 1 => true*/
int _Endianness; /* 1 =>little, 2 => big*/
int _Fill ; /* 0 => false, 1 => true WATCHOUT: this is inverse of NOFILL*/
- unsigned int _FilterID;
- size_t nparams; /* |_FilterParms| ; 0 => not specified*/
- unsigned int* _FilterParams; /* NULL => defaults*/
+ NC4_Filterspec** _Filters;
+ size_t nfilters; /* |filters| */
} Specialdata;
typedef struct GlobalSpecialdata {
diff -Nru netcdf-parallel-4.7.3/ncgen/ncgenl.c netcdf-parallel-4.7.4/ncgen/ncgenl.c
--- netcdf-parallel-4.7.3/ncgen/ncgenl.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/ncgenl.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,5 +1,5 @@
-#line 2 "ncgenl.c"
+#line 3 "ncgenl.c"
#define YY_INT_ALIGNED short int
@@ -7,17 +7,11 @@
#define yy_create_buffer ncg_create_buffer
#define yy_delete_buffer ncg_delete_buffer
-#define yy_scan_buffer ncg_scan_buffer
-#define yy_scan_string ncg_scan_string
-#define yy_scan_bytes ncg_scan_bytes
+#define yy_flex_debug ncg_flex_debug
#define yy_init_buffer ncg_init_buffer
#define yy_flush_buffer ncg_flush_buffer
#define yy_load_buffer_state ncg_load_buffer_state
#define yy_switch_to_buffer ncg_switch_to_buffer
-#define yypush_buffer_state ncgpush_buffer_state
-#define yypop_buffer_state ncgpop_buffer_state
-#define yyensure_buffer_stack ncgensure_buffer_stack
-#define yy_flex_debug ncg_flex_debug
#define yyin ncgin
#define yyleng ncgleng
#define yylex ncglex
@@ -33,245 +27,11 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 4
+#define YY_FLEX_SUBMINOR_VERSION 0
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
-#ifdef yy_create_buffer
-#define ncg_create_buffer_ALREADY_DEFINED
-#else
-#define yy_create_buffer ncg_create_buffer
-#endif
-
-#ifdef yy_delete_buffer
-#define ncg_delete_buffer_ALREADY_DEFINED
-#else
-#define yy_delete_buffer ncg_delete_buffer
-#endif
-
-#ifdef yy_scan_buffer
-#define ncg_scan_buffer_ALREADY_DEFINED
-#else
-#define yy_scan_buffer ncg_scan_buffer
-#endif
-
-#ifdef yy_scan_string
-#define ncg_scan_string_ALREADY_DEFINED
-#else
-#define yy_scan_string ncg_scan_string
-#endif
-
-#ifdef yy_scan_bytes
-#define ncg_scan_bytes_ALREADY_DEFINED
-#else
-#define yy_scan_bytes ncg_scan_bytes
-#endif
-
-#ifdef yy_init_buffer
-#define ncg_init_buffer_ALREADY_DEFINED
-#else
-#define yy_init_buffer ncg_init_buffer
-#endif
-
-#ifdef yy_flush_buffer
-#define ncg_flush_buffer_ALREADY_DEFINED
-#else
-#define yy_flush_buffer ncg_flush_buffer
-#endif
-
-#ifdef yy_load_buffer_state
-#define ncg_load_buffer_state_ALREADY_DEFINED
-#else
-#define yy_load_buffer_state ncg_load_buffer_state
-#endif
-
-#ifdef yy_switch_to_buffer
-#define ncg_switch_to_buffer_ALREADY_DEFINED
-#else
-#define yy_switch_to_buffer ncg_switch_to_buffer
-#endif
-
-#ifdef yypush_buffer_state
-#define ncgpush_buffer_state_ALREADY_DEFINED
-#else
-#define yypush_buffer_state ncgpush_buffer_state
-#endif
-
-#ifdef yypop_buffer_state
-#define ncgpop_buffer_state_ALREADY_DEFINED
-#else
-#define yypop_buffer_state ncgpop_buffer_state
-#endif
-
-#ifdef yyensure_buffer_stack
-#define ncgensure_buffer_stack_ALREADY_DEFINED
-#else
-#define yyensure_buffer_stack ncgensure_buffer_stack
-#endif
-
-#ifdef yylex
-#define ncglex_ALREADY_DEFINED
-#else
-#define yylex ncglex
-#endif
-
-#ifdef yyrestart
-#define ncgrestart_ALREADY_DEFINED
-#else
-#define yyrestart ncgrestart
-#endif
-
-#ifdef yylex_init
-#define ncglex_init_ALREADY_DEFINED
-#else
-#define yylex_init ncglex_init
-#endif
-
-#ifdef yylex_init_extra
-#define ncglex_init_extra_ALREADY_DEFINED
-#else
-#define yylex_init_extra ncglex_init_extra
-#endif
-
-#ifdef yylex_destroy
-#define ncglex_destroy_ALREADY_DEFINED
-#else
-#define yylex_destroy ncglex_destroy
-#endif
-
-#ifdef yyget_debug
-#define ncgget_debug_ALREADY_DEFINED
-#else
-#define yyget_debug ncgget_debug
-#endif
-
-#ifdef yyset_debug
-#define ncgset_debug_ALREADY_DEFINED
-#else
-#define yyset_debug ncgset_debug
-#endif
-
-#ifdef yyget_extra
-#define ncgget_extra_ALREADY_DEFINED
-#else
-#define yyget_extra ncgget_extra
-#endif
-
-#ifdef yyset_extra
-#define ncgset_extra_ALREADY_DEFINED
-#else
-#define yyset_extra ncgset_extra
-#endif
-
-#ifdef yyget_in
-#define ncgget_in_ALREADY_DEFINED
-#else
-#define yyget_in ncgget_in
-#endif
-
-#ifdef yyset_in
-#define ncgset_in_ALREADY_DEFINED
-#else
-#define yyset_in ncgset_in
-#endif
-
-#ifdef yyget_out
-#define ncgget_out_ALREADY_DEFINED
-#else
-#define yyget_out ncgget_out
-#endif
-
-#ifdef yyset_out
-#define ncgset_out_ALREADY_DEFINED
-#else
-#define yyset_out ncgset_out
-#endif
-
-#ifdef yyget_leng
-#define ncgget_leng_ALREADY_DEFINED
-#else
-#define yyget_leng ncgget_leng
-#endif
-
-#ifdef yyget_text
-#define ncgget_text_ALREADY_DEFINED
-#else
-#define yyget_text ncgget_text
-#endif
-
-#ifdef yyget_lineno
-#define ncgget_lineno_ALREADY_DEFINED
-#else
-#define yyget_lineno ncgget_lineno
-#endif
-
-#ifdef yyset_lineno
-#define ncgset_lineno_ALREADY_DEFINED
-#else
-#define yyset_lineno ncgset_lineno
-#endif
-
-#ifdef yywrap
-#define ncgwrap_ALREADY_DEFINED
-#else
-#define yywrap ncgwrap
-#endif
-
-#ifdef yyalloc
-#define ncgalloc_ALREADY_DEFINED
-#else
-#define yyalloc ncgalloc
-#endif
-
-#ifdef yyrealloc
-#define ncgrealloc_ALREADY_DEFINED
-#else
-#define yyrealloc ncgrealloc
-#endif
-
-#ifdef yyfree
-#define ncgfree_ALREADY_DEFINED
-#else
-#define yyfree ncgfree
-#endif
-
-#ifdef yytext
-#define ncgtext_ALREADY_DEFINED
-#else
-#define yytext ncgtext
-#endif
-
-#ifdef yyleng
-#define ncgleng_ALREADY_DEFINED
-#else
-#define yyleng ncgleng
-#endif
-
-#ifdef yyin
-#define ncgin_ALREADY_DEFINED
-#else
-#define yyin ncgin
-#endif
-
-#ifdef yyout
-#define ncgout_ALREADY_DEFINED
-#else
-#define yyout ncgout
-#endif
-
-#ifdef yy_flex_debug
-#define ncg_flex_debug_ALREADY_DEFINED
-#else
-#define yy_flex_debug ncg_flex_debug
-#endif
-
-#ifdef yylineno
-#define ncglineno_ALREADY_DEFINED
-#else
-#define yylineno ncglineno
-#endif
-
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -342,48 +102,60 @@
#define UINT32_MAX (4294967295U)
#endif
-#ifndef SIZE_MAX
-#define SIZE_MAX (~(size_t)0)
-#endif
-
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
-/* begin standard C++ headers. */
+#ifdef __cplusplus
-/* TODO: this is always defined, so inline it */
-#define yyconst const
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
-#if defined(__GNUC__) && __GNUC__ >= 3
-#define yynoreturn __attribute__((__noreturn__))
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
#else
-#define yynoreturn
+#define yyconst
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an
- * integer in range [0..255] for use as an array index.
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
*/
-#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
+
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
+
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
+#define YY_NEW_FILE ncgrestart(ncgin )
+
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -413,14 +185,14 @@
typedef size_t yy_size_t;
#endif
-extern int yyleng;
+extern yy_size_t ncgleng;
-extern FILE *yyin, *yyout;
+extern FILE *ncgin, *ncgout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-
+
#define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)
@@ -428,15 +200,16 @@
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up yytext. */ \
+ /* Undo effects of setting up ncgtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ YY_DO_BEFORE_ACTION; /* set up ncgtext again */ \
} \
while ( 0 )
+
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -451,7 +224,7 @@
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- int yy_buf_size;
+ yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -479,7 +252,7 @@
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -496,8 +269,8 @@
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via yyrestart()), so that the user can continue scanning by
- * just pointing yyin at a new input file.
+ * (via ncgrestart()), so that the user can continue scanning by
+ * just pointing ncgin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -507,7 +280,7 @@
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
@@ -518,98 +291,109 @@
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
+
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-/* yy_hold_char holds the character lost when yytext is formed. */
+/* yy_hold_char holds the character lost when ncgtext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+yy_size_t ncgleng;
/* Points to current character in buffer. */
-static char *yy_c_buf_p = NULL;
+static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin. A bit of a hack ...
+/* Flag which is used to allow ncgwrap()'s to do buffer switches
+ * instead of setting up a fresh ncgin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
-void yyrestart ( FILE *input_file );
-void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer );
-YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
-void yy_delete_buffer ( YY_BUFFER_STATE b );
-void yy_flush_buffer ( YY_BUFFER_STATE b );
-void yypush_buffer_state ( YY_BUFFER_STATE new_buffer );
-void yypop_buffer_state ( void );
-
-static void yyensure_buffer_stack ( void );
-static void yy_load_buffer_state ( void );
-static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
-#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size );
-YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
-
-void *yyalloc ( yy_size_t );
-void *yyrealloc ( void *, yy_size_t );
-void yyfree ( void * );
+void ncgrestart (FILE *input_file );
+void ncg_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE ncg_create_buffer (FILE *file,int size );
+void ncg_delete_buffer (YY_BUFFER_STATE b );
+void ncg_flush_buffer (YY_BUFFER_STATE b );
+void ncgpush_buffer_state (YY_BUFFER_STATE new_buffer );
+void ncgpop_buffer_state (void );
+
+static void ncgensure_buffer_stack (void );
+static void ncg_load_buffer_state (void );
+static void ncg_init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER ncg_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE ncg_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE ncg_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE ncg_scan_bytes (yyconst char *bytes,yy_size_t len );
+
+void *ncgalloc (yy_size_t );
+void *ncgrealloc (void *,yy_size_t );
+void ncgfree (void * );
+
+#define yy_new_buffer ncg_create_buffer
-#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- yyensure_buffer_stack (); \
+ ncgensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ ncg_create_buffer(ncgin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
+
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- yyensure_buffer_stack (); \
+ ncgensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
- yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ ncg_create_buffer(ncgin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
+
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
-typedef flex_uint8_t YY_CHAR;
-FILE *yyin = NULL, *yyout = NULL;
+typedef unsigned char YY_CHAR;
+
+FILE *ncgin = (FILE *) 0, *ncgout = (FILE *) 0;
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
+extern int ncglineno;
+
+int ncglineno = 1;
-extern char *yytext;
+extern char *ncgtext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
-#define yytext_ptr yytext
+#define yytext_ptr ncgtext
-static yy_state_type yy_get_previous_state ( void );
-static yy_state_type yy_try_NUL_trans ( yy_state_type current_state );
-static int yy_get_next_buffer ( void );
-static void yynoreturn yy_fatal_error ( const char* msg );
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+#if defined(__GNUC__) && __GNUC__ >= 3
+__attribute__((__noreturn__))
+#endif
+static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
+ * corresponding action - sets up ncgtext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
- yyleng = (int) (yy_cp - yy_bp); \
+ ncgleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
+
#define YY_NUM_RULES 49
#define YY_END_OF_BUFFER 50
/* This struct is not used in this scanner,
@@ -619,7 +403,7 @@
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static const flex_int16_t yy_accept[422] =
+static yyconst flex_int16_t yy_accept[422] =
{ 0,
0, 0, 46, 46, 0, 0, 50, 48, 1, 44,
48, 48, 48, 48, 38, 32, 36, 36, 35, 35,
@@ -670,7 +454,7 @@
0
} ;
-static const YY_CHAR yy_ec[256] =
+static yyconst YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 2, 2, 1, 1, 1, 1, 1, 1, 1,
@@ -702,7 +486,7 @@
1, 1, 1, 1, 1
} ;
-static const YY_CHAR yy_meta[69] =
+static yyconst YY_CHAR yy_meta[69] =
{ 0,
1, 1, 2, 1, 1, 1, 3, 4, 5, 5,
6, 7, 8, 8, 8, 8, 8, 8, 8, 1,
@@ -713,7 +497,7 @@
11, 11, 11, 14, 1, 11, 11, 11
} ;
-static const flex_int16_t yy_base[440] =
+static yyconst flex_uint16_t yy_base[440] =
{ 0,
0, 0, 325, 321, 264, 255, 318, 2387, 67, 2387,
64, 269, 61, 62, 95, 77, 136, 259, 51, 61,
@@ -765,7 +549,7 @@
2315, 2329, 2339, 2345, 2353, 2355, 2361, 2367, 2373
} ;
-static const flex_int16_t yy_def[440] =
+static yyconst flex_int16_t yy_def[440] =
{ 0,
421, 1, 422, 422, 423, 423, 421, 421, 421, 421,
424, 425, 421, 426, 421, 427, 421, 17, 428, 428,
@@ -817,7 +601,7 @@
421, 421, 421, 421, 421, 421, 421, 421, 421
} ;
-static const flex_int16_t yy_nxt[2456] =
+static yyconst flex_uint16_t yy_nxt[2456] =
{ 0,
8, 9, 10, 9, 8, 11, 12, 8, 13, 14,
15, 16, 17, 18, 18, 18, 18, 18, 18, 8,
@@ -1091,7 +875,7 @@
421, 421, 421, 421, 421
} ;
-static const flex_int16_t yy_chk[2456] =
+static yyconst flex_int16_t yy_chk[2456] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -1368,8 +1152,8 @@
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern int ncg_flex_debug;
+int ncg_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -1378,7 +1162,7 @@
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+char *ncgtext;
#line 1 "ncgen.l"
#line 2 "ncgen.l"
/*********************************************************************
@@ -1521,7 +1305,7 @@
{NULL,0} /* null terminate */
};
-#line 1524 "ncgenl.c"
+
/* The most correct (validating) version of UTF8 character set
(Taken from: http://www.w3.org/2005/03/23-lex-U)
@@ -1564,7 +1348,7 @@
/* Note: this definition of string will work for utf8 as well,
although it is a very relaxed definition
*/
-#line 1567 "ncgenl.c"
+#line 1352 "ncgenl.c"
#define INITIAL 0
#define ST_C_COMMENT 1
@@ -1582,36 +1366,36 @@
#define YY_EXTRA_TYPE void *
#endif
-static int yy_init_globals ( void );
+static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int yylex_destroy ( void );
+int ncglex_destroy (void );
-int yyget_debug ( void );
+int ncgget_debug (void );
-void yyset_debug ( int debug_flag );
+void ncgset_debug (int debug_flag );
-YY_EXTRA_TYPE yyget_extra ( void );
+YY_EXTRA_TYPE ncgget_extra (void );
-void yyset_extra ( YY_EXTRA_TYPE user_defined );
+void ncgset_extra (YY_EXTRA_TYPE user_defined );
-FILE *yyget_in ( void );
+FILE *ncgget_in (void );
-void yyset_in ( FILE * _in_str );
+void ncgset_in (FILE * _in_str );
-FILE *yyget_out ( void );
+FILE *ncgget_out (void );
-void yyset_out ( FILE * _out_str );
+void ncgset_out (FILE * _out_str );
- int yyget_leng ( void );
+yy_size_t ncgget_leng (void );
-char *yyget_text ( void );
+char *ncgget_text (void );
-int yyget_lineno ( void );
+int ncgget_lineno (void );
-void yyset_lineno ( int _line_number );
+void ncgset_lineno (int _line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1619,31 +1403,32 @@
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int yywrap ( void );
+extern "C" int ncgwrap (void );
#else
-extern int yywrap ( void );
+extern int ncgwrap (void );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput ( int c, char *buf_ptr );
+ static void yyunput (int c,char *buf_ptr );
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy ( char *, const char *, int );
+static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen ( const char * );
+static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
+
#ifdef __cplusplus
-static int yyinput ( void );
+static int yyinput (void );
#else
-static int input ( void );
+static int input (void );
#endif
#endif
@@ -1663,7 +1448,7 @@
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
+#define ECHO do { if (fwrite( ncgtext, ncgleng, 1, ncgout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1674,20 +1459,20 @@
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- int n; \
+ size_t n; \
for ( n = 0; n < max_size && \
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ (c = getc( ncgin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
- if ( c == EOF && ferror( yyin ) ) \
+ if ( c == EOF && ferror( ncgin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
- while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
+ while ( (result = fread(buf, 1, max_size, ncgin))==0 && ferror(ncgin)) \
{ \
if( errno != EINTR) \
{ \
@@ -1695,7 +1480,7 @@
break; \
} \
errno=0; \
- clearerr(yyin); \
+ clearerr(ncgin); \
} \
}\
\
@@ -1728,12 +1513,12 @@
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int yylex (void);
+extern int ncglex (void);
-#define YY_DECL int yylex (void)
+#define YY_DECL int ncglex (void)
#endif /* !YY_DECL */
-/* Code executed at the beginning of each rule, after yytext and yyleng
+/* Code executed at the beginning of each rule, after ncgtext and ncgleng
* have been set up.
*/
#ifndef YY_USER_ACTION
@@ -1767,31 +1552,31 @@
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
- if ( ! yyin )
- yyin = stdin;
+ if ( ! ncgin )
+ ncgin = stdin;
- if ( ! yyout )
- yyout = stdout;
+ if ( ! ncgout )
+ ncgout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- yyensure_buffer_stack ();
+ ncgensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ ncg_create_buffer(ncgin,YY_BUF_SIZE );
}
- yy_load_buffer_state( );
+ ncg_load_buffer_state( );
}
{
#line 221 "ncgen.l"
-#line 1788 "ncgenl.c"
+#line 1574 "ncgenl.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
- /* Support of yytext. */
+ /* Support of ncgtext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
@@ -1813,9 +1598,9 @@
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 422 )
- yy_c = yy_meta[yy_c];
+ yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 2387 );
@@ -1864,14 +1649,14 @@
/* In netcdf4, this will be used in a variety
of places, so only remove escapes */
/*
-if(yyleng > MAXTRST) {
+if(ncgleng > MAXTRST) {
yyerror("string too long, truncated\n");
-yytext[MAXTRST-1] = '\0';
+ncgtext[MAXTRST-1] = '\0';
}
*/
- len = unescape((char *)yytext+1,yyleng-2,!ISIDENT,&s);
+ len = unescape((char *)ncgtext+1,ncgleng-2,!ISIDENT,&s);
if(len < 0) {
- sprintf(errstr,"Illegal character: %s",yytext);
+ sprintf(errstr,"Illegal character: %s",ncgtext);
yyerror(errstr);
}
bbClear(lextext);
@@ -1885,8 +1670,8 @@
YY_RULE_SETUP
#line 251 "ncgen.l"
{ /* drop leading 0x; pad to even number of chars */
- char* p = yytext+2;
- int len = yyleng - 2;
+ char* p = ncgtext+2;
+ int len = ncgleng - 2;
bbClear(lextext);
bbAppendn(lextext,p,len);
if((len % 2) == 1) bbAppend(lextext,'0');
@@ -2011,7 +1796,7 @@
YY_RULE_SETUP
#line 291 "ncgen.l"
{ /* missing value (pre-2.4 backward compatibility) */
- if (yytext[0] == '-') {
+ if (ncgtext[0] == '-') {
double_val = NEGNC_INFINITE;
} else {
double_val = NC_INFINITE;
@@ -2033,7 +1818,7 @@
YY_RULE_SETUP
#line 306 "ncgen.l"
{/* missing value (pre-2.4 backward compatibility)*/
- if (yytext[0] == '-') {
+ if (ncgtext[0] == '-') {
float_val = NEGNC_INFINITEF;
} else {
float_val = NC_INFINITEF;
@@ -2069,7 +1854,7 @@
#line 331 "ncgen.l"
{
bbClear(lextext);
- bbAppendn(lextext,(char*)yytext,yyleng+1); /* include null */
+ bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */
bbNull(lextext);
yylval.sym = makepath(bbContents(lextext));
return lexdebug(PATH);
@@ -2080,7 +1865,7 @@
#line 340 "ncgen.l"
{struct Specialtoken* st;
bbClear(lextext);
- bbAppendn(lextext,(char*)yytext,yyleng+1); /* include null */
+ bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */
bbNull(lextext);
for(st=specials;st->name;st++) {
if(strcmp(bbContents(lextext),st->name)==0) {return lexdebug(st->token);}
@@ -2097,7 +1882,7 @@
char* p; char* q;
/* copy the trimmed name */
bbClear(lextext);
- bbAppendn(lextext,(char*)yytext,yyleng+1); /* include null */
+ bbAppendn(lextext,(char*)ncgtext,ncgleng+1); /* include null */
bbNull(lextext);
p = bbContents(lextext);
q = p;
@@ -2113,8 +1898,8 @@
YY_RULE_SETUP
#line 367 "ncgen.l"
{ char* id = NULL; int len;
- len = strlen(yytext);
- len = unescape(yytext,len,ISIDENT,&id);
+ len = strlen(ncgtext);
+ len = unescape(ncgtext,len,ISIDENT,&id);
if(NCSTREQ(id, FILL_STRING)) {
efree(id);
return lexdebug(FILLMARKER);
@@ -2211,21 +1996,21 @@
{
int c;
int token = 0;
- int slen = strlen(yytext);
+ int slen = strlen(ncgtext);
char* stag = NULL;
int tag = NC_NAT;
- char* hex = yytext+2; /* point to first true hex digit */
+ char* hex = ncgtext+2; /* point to first true hex digit */
int xlen = (slen - 3); /* true hex length */
- yytext[slen-1] = '\0';
+ ncgtext[slen-1] = '\0';
/* capture the tag string */
- tag = collecttag(yytext,&stag);
+ tag = collecttag(ncgtext,&stag);
if(tag == NC_NAT) {
sprintf(errstr,"Illegal integer suffix: %s",stag);
yyerror(errstr);
goto done;
}
- yytext[slen - strlen(stag)] = '\0';
+ ncgtext[slen - strlen(stag)] = '\0';
if(xlen > 16) { /* truncate hi order digits */
hex += (xlen - 16);
}
@@ -2247,8 +2032,8 @@
token = UINT64_CONST;
break;
default: /* should never happen */
- if (sscanf((char*)yytext, "%i", &uint32_val) != 1) {
- sprintf(errstr,"bad unsigned int constant: %s",(char*)yytext);
+ if (sscanf((char*)ncgtext, "%i", &uint32_val) != 1) {
+ sprintf(errstr,"bad unsigned int constant: %s",(char*)ncgtext);
yyerror(errstr);
}
token = UINT_CONST;
@@ -2260,8 +2045,8 @@
YY_RULE_SETUP
#line 504 "ncgen.l"
{
- if (sscanf((char*)yytext, "%le", &double_val) != 1) {
- sprintf(errstr,"bad long or double constant: %s",(char*)yytext);
+ if (sscanf((char*)ncgtext, "%le", &double_val) != 1) {
+ sprintf(errstr,"bad long or double constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return lexdebug(DOUBLE_CONST);
@@ -2271,8 +2056,8 @@
YY_RULE_SETUP
#line 511 "ncgen.l"
{
- if (sscanf((char*)yytext, "%e", &float_val) != 1) {
- sprintf(errstr,"bad float constant: %s",(char*)yytext);
+ if (sscanf((char*)ncgtext, "%e", &float_val) != 1) {
+ sprintf(errstr,"bad float constant: %s",(char*)ncgtext);
yyerror(errstr);
}
return lexdebug(FLOAT_CONST);
@@ -2283,7 +2068,7 @@
YY_RULE_SETUP
#line 518 "ncgen.l"
{
- (void) sscanf((char*)&yytext[1],"%c",&byte_val);
+ (void) sscanf((char*)&ncgtext[1],"%c",&byte_val);
return lexdebug(BYTE_CONST);
}
YY_BREAK
@@ -2291,9 +2076,9 @@
YY_RULE_SETUP
#line 522 "ncgen.l"
{
- int oct = unescapeoct(&yytext[2]);
+ int oct = unescapeoct(&ncgtext[2]);
if(oct < 0) {
- sprintf(errstr,"bad octal character constant: %s",(char*)yytext);
+ sprintf(errstr,"bad octal character constant: %s",(char*)ncgtext);
yyerror(errstr);
}
byte_val = (unsigned int)oct;
@@ -2304,9 +2089,9 @@
YY_RULE_SETUP
#line 531 "ncgen.l"
{
- int hex = unescapehex(&yytext[3]);
+ int hex = unescapehex(&ncgtext[3]);
if(byte_val < 0) {
- sprintf(errstr,"bad hex character constant: %s",(char*)yytext);
+ sprintf(errstr,"bad hex character constant: %s",(char*)ncgtext);
yyerror(errstr);
}
byte_val = (unsigned int)hex;
@@ -2317,7 +2102,7 @@
YY_RULE_SETUP
#line 540 "ncgen.l"
{
- switch ((char)yytext[2]) {
+ switch ((char)ncgtext[2]) {
case 'a': byte_val = '\007'; break; /* not everyone under-
* stands '\a' yet */
case 'b': byte_val = '\b'; break;
@@ -2329,7 +2114,7 @@
case '\\': byte_val = '\\'; break;
case '?': byte_val = '\177'; break;
case '\'': byte_val = '\''; break;
- default: byte_val = (char)yytext[2];
+ default: byte_val = (char)ncgtext[2];
}
return lexdebug(BYTE_CONST);
}
@@ -2379,7 +2164,7 @@
YY_RULE_SETUP
#line 583 "ncgen.l"
{/* Note: this next rule will not work for UTF8 characters */
- return lexdebug(yytext[0]) ;
+ return lexdebug(ncgtext[0]) ;
}
YY_BREAK
case 49:
@@ -2387,7 +2172,7 @@
#line 586 "ncgen.l"
ECHO;
YY_BREAK
-#line 2390 "ncgenl.c"
+#line 2176 "ncgenl.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(TEXT):
yyterminate();
@@ -2405,15 +2190,15 @@
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
- * just pointed yyin at a new source and called
- * yylex(). If so, then we have to assure
+ * just pointed ncgin at a new source and called
+ * ncglex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = ncgin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
@@ -2466,11 +2251,11 @@
{
(yy_did_buffer_switch_on_eof) = 0;
- if ( yywrap( ) )
+ if ( ncgwrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
- * yytext, we can now set up
+ * ncgtext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
@@ -2520,7 +2305,7 @@
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of yylex */
+} /* end of ncglex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -2533,7 +2318,7 @@
{
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = (yytext_ptr);
- int number_to_move, i;
+ yy_size_t number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@@ -2562,7 +2347,7 @@
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
+ number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -2575,7 +2360,7 @@
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -2589,7 +2374,7 @@
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -2598,12 +2383,11 @@
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- yyrealloc( (void *) b->yy_ch_buf,
- (yy_size_t) (b->yy_buf_size + 2) );
+ ncgrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = NULL;
+ b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@@ -2631,7 +2415,7 @@
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- yyrestart( yyin );
+ ncgrestart(ncgin );
}
else
@@ -2645,15 +2429,12 @@
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
- (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ncgrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- /* "- 2" to take care of EOB's */
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
(yy_n_chars) += number_to_move;
@@ -2686,9 +2467,9 @@
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 422 )
- yy_c = yy_meta[yy_c];
+ yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
@@ -2714,9 +2495,9 @@
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 422 )
- yy_c = yy_meta[yy_c];
+ yy_c = yy_meta[(unsigned int) yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 421);
return yy_is_jam ? 0 : yy_current_state;
@@ -2730,13 +2511,13 @@
yy_cp = (yy_c_buf_p);
- /* undo effects of setting up yytext */
+ /* undo effects of setting up ncgtext */
*yy_cp = (yy_hold_char);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- int number_to_move = (yy_n_chars) + 2;
+ yy_size_t number_to_move = (yy_n_chars) + 2;
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
char *source =
@@ -2748,7 +2529,7 @@
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -2787,7 +2568,7 @@
else
{ /* need more input */
- int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
+ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -2804,14 +2585,14 @@
*/
/* Reset buffer status. */
- yyrestart( yyin );
+ ncgrestart(ncgin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( yywrap( ) )
- return 0;
+ if ( ncgwrap( ) )
+ return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@@ -2830,7 +2611,7 @@
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
- *(yy_c_buf_p) = '\0'; /* preserve yytext */
+ *(yy_c_buf_p) = '\0'; /* preserve ncgtext */
(yy_hold_char) = *++(yy_c_buf_p);
return c;
@@ -2842,32 +2623,32 @@
*
* @note This function does not reset the start condition to @c INITIAL .
*/
- void yyrestart (FILE * input_file )
+ void ncgrestart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
- yyensure_buffer_stack ();
+ ncgensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
- yy_create_buffer( yyin, YY_BUF_SIZE );
+ ncg_create_buffer(ncgin,YY_BUF_SIZE );
}
- yy_init_buffer( YY_CURRENT_BUFFER, input_file );
- yy_load_buffer_state( );
+ ncg_init_buffer(YY_CURRENT_BUFFER,input_file );
+ ncg_load_buffer_state( );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+ void ncg_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
- * yypop_buffer_state();
- * yypush_buffer_state(new_buffer);
+ * ncgpop_buffer_state();
+ * ncgpush_buffer_state(new_buffer);
*/
- yyensure_buffer_stack ();
+ ncgensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -2880,21 +2661,21 @@
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- yy_load_buffer_state( );
+ ncg_load_buffer_state( );
/* We don't actually know whether we did this switch during
- * EOF (yywrap()) processing, but the only time this flag
- * is looked at is after yywrap() is called, so it's safe
+ * EOF (ncgwrap()) processing, but the only time this flag
+ * is looked at is after ncgwrap() is called, so it's safe
* to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
-static void yy_load_buffer_state (void)
+static void ncg_load_buffer_state (void)
{
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ ncgin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
(yy_hold_char) = *(yy_c_buf_p);
}
@@ -2904,35 +2685,35 @@
*
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
+ YY_BUFFER_STATE ncg_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) ncgalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ncg_create_buffer()" );
- b->yy_buf_size = size;
+ b->yy_buf_size = (yy_size_t)size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
+ b->yy_ch_buf = (char *) ncgalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ncg_create_buffer()" );
b->yy_is_our_buffer = 1;
- yy_init_buffer( b, file );
+ ncg_init_buffer(b,file );
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
+ * @param b a buffer created with ncg_create_buffer()
*
*/
- void yy_delete_buffer (YY_BUFFER_STATE b )
+ void ncg_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
@@ -2942,27 +2723,27 @@
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- yyfree( (void *) b->yy_ch_buf );
+ ncgfree((void *) b->yy_ch_buf );
- yyfree( (void *) b );
+ ncgfree((void *) b );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
+ * such as during a ncgrestart() or at EOF.
*/
- static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+ static void ncg_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
int oerrno = errno;
- yy_flush_buffer( b );
+ ncg_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then yy_init_buffer was _probably_
- * called from yyrestart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then ncg_init_buffer was _probably_
+ * called from ncgrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -2979,7 +2760,7 @@
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
- void yy_flush_buffer (YY_BUFFER_STATE b )
+ void ncg_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
@@ -2999,7 +2780,7 @@
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- yy_load_buffer_state( );
+ ncg_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -3008,14 +2789,14 @@
* @param new_buffer The new state.
*
*/
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+void ncgpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
if (new_buffer == NULL)
return;
- yyensure_buffer_stack();
+ ncgensure_buffer_stack();
- /* This block is copied from yy_switch_to_buffer. */
+ /* This block is copied from ncg_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -3029,8 +2810,8 @@
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from yy_switch_to_buffer. */
- yy_load_buffer_state( );
+ /* copied from ncg_switch_to_buffer. */
+ ncg_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
@@ -3038,18 +2819,18 @@
* The next element becomes the new top.
*
*/
-void yypop_buffer_state (void)
+void ncgpop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
- yy_delete_buffer(YY_CURRENT_BUFFER );
+ ncg_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
- yy_load_buffer_state( );
+ ncg_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
@@ -3057,7 +2838,7 @@
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void yyensure_buffer_stack (void)
+static void ncgensure_buffer_stack (void)
{
yy_size_t num_to_alloc;
@@ -3067,15 +2848,15 @@
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ (yy_buffer_stack) = (struct yy_buffer_state**)ncgalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
+ YY_FATAL_ERROR( "out of dynamic memory in ncgensure_buffer_stack()" );
+
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@@ -3087,12 +2868,12 @@
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
- (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+ (yy_buffer_stack) = (struct yy_buffer_state**)ncgrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ncgensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -3104,9 +2885,9 @@
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
+YY_BUFFER_STATE ncg_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
@@ -3114,69 +2895,69 @@
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
- return NULL;
+ return 0;
- b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
+ b = (YY_BUFFER_STATE) ncgalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ncg_scan_buffer()" );
- b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
- b->yy_input_file = NULL;
+ b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- yy_switch_to_buffer( b );
+ ncg_switch_to_buffer(b );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to yylex() will
+/** Setup the input buffer state to scan a string. The next call to ncglex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * yy_scan_bytes() instead.
+ * ncg_scan_bytes() instead.
*/
-YY_BUFFER_STATE yy_scan_string (const char * yystr )
+YY_BUFFER_STATE ncg_scan_string (yyconst char * yystr )
{
- return yy_scan_bytes( yystr, (int) strlen(yystr) );
+ return ncg_scan_bytes(yystr,strlen(yystr) );
}
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+/** Setup the input buffer state to scan the given bytes. The next call to ncglex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
+YY_BUFFER_STATE ncg_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- int i;
+ yy_size_t i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) (_yybytes_len + 2);
- buf = (char *) yyalloc( n );
+ n = _yybytes_len + 2;
+ buf = (char *) ncgalloc(n );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in ncg_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = yy_scan_buffer( buf, n );
+ b = ncg_scan_buffer(buf,n );
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in ncg_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -3190,9 +2971,9 @@
#define YY_EXIT_FAILURE 2
#endif
-static void yynoreturn yy_fatal_error (const char* msg )
+static void yy_fatal_error (yyconst char* msg )
{
- fprintf( stderr, "%s\n", msg );
+ (void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -3202,14 +2983,14 @@
#define yyless(n) \
do \
{ \
- /* Undo effects of setting up yytext. */ \
+ /* Undo effects of setting up ncgtext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
- yytext[yyleng] = (yy_hold_char); \
- (yy_c_buf_p) = yytext + yyless_macro_arg; \
+ ncgtext[ncgleng] = (yy_hold_char); \
+ (yy_c_buf_p) = ncgtext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
- yyleng = yyless_macro_arg; \
+ ncgleng = yyless_macro_arg; \
} \
while ( 0 )
@@ -3218,126 +2999,126 @@
/** Get the current line number.
*
*/
-int yyget_lineno (void)
+int ncgget_lineno (void)
{
-
- return yylineno;
+
+ return ncglineno;
}
/** Get the input stream.
*
*/
-FILE *yyget_in (void)
+FILE *ncgget_in (void)
{
- return yyin;
+ return ncgin;
}
/** Get the output stream.
*
*/
-FILE *yyget_out (void)
+FILE *ncgget_out (void)
{
- return yyout;
+ return ncgout;
}
/** Get the length of the current token.
*
*/
-int yyget_leng (void)
+yy_size_t ncgget_leng (void)
{
- return yyleng;
+ return ncgleng;
}
/** Get the current token.
*
*/
-char *yyget_text (void)
+char *ncgget_text (void)
{
- return yytext;
+ return ncgtext;
}
/** Set the current line number.
* @param _line_number line number
*
*/
-void yyset_lineno (int _line_number )
+void ncgset_lineno (int _line_number )
{
- yylineno = _line_number;
+ ncglineno = _line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param _in_str A readable stream.
*
- * @see yy_switch_to_buffer
+ * @see ncg_switch_to_buffer
*/
-void yyset_in (FILE * _in_str )
+void ncgset_in (FILE * _in_str )
{
- yyin = _in_str ;
+ ncgin = _in_str ;
}
-void yyset_out (FILE * _out_str )
+void ncgset_out (FILE * _out_str )
{
- yyout = _out_str ;
+ ncgout = _out_str ;
}
-int yyget_debug (void)
+int ncgget_debug (void)
{
- return yy_flex_debug;
+ return ncg_flex_debug;
}
-void yyset_debug (int _bdebug )
+void ncgset_debug (int _bdebug )
{
- yy_flex_debug = _bdebug ;
+ ncg_flex_debug = _bdebug ;
}
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from yylex_destroy(), so don't allocate here.
+ * This function is called from ncglex_destroy(), so don't allocate here.
*/
- (yy_buffer_stack) = NULL;
+ (yy_buffer_stack) = 0;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
- (yy_c_buf_p) = NULL;
+ (yy_c_buf_p) = (char *) 0;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
- yyin = stdin;
- yyout = stdout;
+ ncgin = stdin;
+ ncgout = stdout;
#else
- yyin = NULL;
- yyout = NULL;
+ ncgin = (FILE *) 0;
+ ncgout = (FILE *) 0;
#endif
/* For future reference: Set errno on error, since we are called by
- * yylex_init()
+ * ncglex_init()
*/
return 0;
}
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy (void)
+/* ncglex_destroy is for both reentrant and non-reentrant scanners. */
+int ncglex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- yy_delete_buffer( YY_CURRENT_BUFFER );
+ ncg_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
- yypop_buffer_state();
+ ncgpop_buffer_state();
}
/* Destroy the stack itself. */
- yyfree((yy_buffer_stack) );
+ ncgfree((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * yylex() is called, initialization will occur. */
+ * ncglex() is called, initialization will occur. */
yy_init_globals( );
return 0;
@@ -3348,7 +3129,7 @@
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, const char * s2, int n )
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
int i;
@@ -3358,7 +3139,7 @@
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (const char * s )
+static int yy_flex_strlen (yyconst char * s )
{
int n;
for ( n = 0; s[n]; ++n )
@@ -3368,12 +3149,12 @@
}
#endif
-void *yyalloc (yy_size_t size )
+void *ncgalloc (yy_size_t size )
{
- return malloc(size);
+ return (void *) malloc( size );
}
-void *yyrealloc (void * ptr, yy_size_t size )
+void *ncgrealloc (void * ptr, yy_size_t size )
{
/* The cast to (char *) in the following accommodates both
@@ -3383,25 +3164,26 @@
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return realloc(ptr, size);
+ return (void *) realloc( (char *) ptr, size );
}
-void yyfree (void * ptr )
+void ncgfree (void * ptr )
{
- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+ free( (char *) ptr ); /* see ncgrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
#line 586 "ncgen.l"
+
static int
lexdebug(int token)
{
if(debug >= 2)
{
- char* text = yytext;
- text[yyleng] = 0;
+ char* text = ncgtext;
+ text[ncgleng] = 0;
fprintf(stderr,"Token=%d |%s| line=%d\n",token,text,lineno);
}
return token;
diff -Nru netcdf-parallel-4.7.3/ncgen/ncgen.y netcdf-parallel-4.7.4/ncgen/ncgen.y
--- netcdf-parallel-4.7.3/ncgen/ncgen.y 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/ncgen.y 2020-08-31 10:33:26.000000000 +0000
@@ -129,6 +129,9 @@
static long long extractint(NCConstant* con);
#ifdef USE_NETCDF4
static int parsefilterflag(const char* sdata0, Specialdata* special);
+#ifdef GENDEBUG1
+static void printfilters(size_t nfilters, NC_ParsedFilterSpec** filters);
+#endif
#endif
int yylex(void);
@@ -1302,6 +1305,8 @@
derror("_Storage: illegal NULL value");
else if(strcmp(sdata,"contiguous") == 0)
special->_Storage = NC_CONTIGUOUS;
+ else if(strcmp(sdata,"compact") == 0)
+ special->_Storage = NC_COMPACT;
else if(strcmp(sdata,"chunked") == 0)
special->_Storage = NC_CHUNKED;
else
@@ -1363,7 +1368,6 @@
if(parsefilterflag(sdata,special) == NC_NOERR)
special->flags |= _FILTER_FLAG;
else {
- efree(special->_FilterParams);
derror("_Filter: unparsable filter spec: %s",sdata);
}
#else
@@ -1485,12 +1489,18 @@
parsefilterflag(const char* sdata, Specialdata* special)
{
int stat = NC_NOERR;
+ int format;
if(sdata == NULL || strlen(sdata) == 0) return NC_EINVAL;
- stat = NC_parsefilterspec(sdata, &special->_FilterID, &special->nparams, &special->_FilterParams);
+ stat = NC_parsefilterlist(sdata, &format, &special->nfilters, (NC_Filterspec***)&special->_Filters);
if(stat)
derror("Malformed filter spec: %s",sdata);
+ if(format != NC_FILTER_FORMAT_HDF5)
+ derror("Non HDF5 filter format encountered");
+#ifdef GENDEBUG1
+printfilters(special->nfilters,special->_Filters);
+#endif
return stat;
}
#endif
@@ -1566,3 +1576,31 @@
done:
return result;
}
+
+#ifdef GENDEBUG1
+static void
+printfilters(size_t nfilters, NC_ParsedFilterSpec** filters)
+{
+ int i;
+ fprintf(stderr,"xxx: nfilters=%lu: ",(unsigned long)nfilters);
+ for(i=0;ifilterid,sp->format,(unsigned long)sp->nparams,sp->params);
+ if(sp->nparams == 0 || sp->params != NULL) {
+ fprintf(stderr," params={");
+ for(k=0;knparams;k++) {
+ if(i==0) fprintf(stderr,",");
+ fprintf(stderr,"%u",sp->params[i]);
+ }
+ fprintf(stderr,"}");
+ } else
+ fprintf(stderr,"params=NULL");
+ fprintf(stderr,"}");
+ }
+ fprintf(stderr,"\n");
+ fflush(stderr);
+}
+#endif
diff -Nru netcdf-parallel-4.7.3/ncgen/ncgeny.c netcdf-parallel-4.7.4/ncgen/ncgeny.c
--- netcdf-parallel-4.7.3/ncgen/ncgeny.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/ncgeny.c 2020-08-31 10:33:26.000000000 +0000
@@ -192,6 +192,9 @@
static long long extractint(NCConstant* con);
#ifdef USE_NETCDF4
static int parsefilterflag(const char* sdata0, Specialdata* special);
+#ifdef GENDEBUG1
+static void printfilters(size_t nfilters, NC_ParsedFilterSpec** filters);
+#endif
#endif
int yylex(void);
@@ -206,7 +209,7 @@
extern int lex_init(void);
-#line 210 "ncgeny.c" /* yacc.c:339 */
+#line 213 "ncgeny.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -302,7 +305,7 @@
union YYSTYPE
{
-#line 149 "ncgen.y" /* yacc.c:355 */
+#line 152 "ncgen.y" /* yacc.c:355 */
Symbol* sym;
unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/
@@ -311,7 +314,7 @@
Datalist* datalist;
NCConstant* constant;
-#line 315 "ncgeny.c" /* yacc.c:355 */
+#line 318 "ncgeny.c" /* yacc.c:355 */
};
typedef union YYSTYPE YYSTYPE;
@@ -328,7 +331,7 @@
/* Copy the second part of user declarations. */
-#line 332 "ncgeny.c" /* yacc.c:358 */
+#line 335 "ncgeny.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -631,22 +634,22 @@
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 231, 231, 237, 239, 246, 253, 253, 256, 265,
- 255, 270, 271, 272, 276, 276, 278, 288, 288, 291,
- 292, 293, 294, 297, 297, 300, 330, 332, 349, 358,
- 370, 384, 417, 418, 421, 435, 436, 437, 438, 439,
- 440, 441, 442, 443, 444, 445, 446, 449, 450, 451,
- 454, 455, 458, 458, 460, 461, 465, 473, 483, 495,
- 496, 497, 500, 501, 504, 504, 506, 531, 535, 539,
- 568, 569, 572, 573, 577, 591, 595, 600, 629, 630,
- 634, 635, 640, 650, 670, 681, 692, 711, 718, 718,
- 721, 723, 725, 727, 729, 738, 749, 751, 753, 755,
- 757, 759, 761, 763, 765, 767, 769, 774, 781, 790,
- 791, 792, 795, 796, 799, 803, 804, 808, 812, 813,
- 818, 819, 823, 824, 825, 826, 827, 828, 832, 836,
- 840, 842, 847, 848, 849, 850, 851, 852, 853, 854,
- 855, 856, 857, 858, 862, 863, 867, 869, 871, 873,
- 878, 882, 883, 889
+ 0, 234, 234, 240, 242, 249, 256, 256, 259, 268,
+ 258, 273, 274, 275, 279, 279, 281, 291, 291, 294,
+ 295, 296, 297, 300, 300, 303, 333, 335, 352, 361,
+ 373, 387, 420, 421, 424, 438, 439, 440, 441, 442,
+ 443, 444, 445, 446, 447, 448, 449, 452, 453, 454,
+ 457, 458, 461, 461, 463, 464, 468, 476, 486, 498,
+ 499, 500, 503, 504, 507, 507, 509, 534, 538, 542,
+ 571, 572, 575, 576, 580, 594, 598, 603, 632, 633,
+ 637, 638, 643, 653, 673, 684, 695, 714, 721, 721,
+ 724, 726, 728, 730, 732, 741, 752, 754, 756, 758,
+ 760, 762, 764, 766, 768, 770, 772, 777, 784, 793,
+ 794, 795, 798, 799, 802, 806, 807, 811, 815, 816,
+ 821, 822, 826, 827, 828, 829, 830, 831, 835, 839,
+ 843, 845, 850, 851, 852, 853, 854, 855, 856, 857,
+ 858, 859, 860, 861, 865, 866, 870, 872, 874, 876,
+ 881, 885, 886, 892
};
#endif
@@ -1638,19 +1641,19 @@
switch (yyn)
{
case 2:
-#line 234 "ncgen.y" /* yacc.c:1646 */
+#line 237 "ncgen.y" /* yacc.c:1646 */
{if (error_count > 0) YYABORT;}
-#line 1644 "ncgeny.c" /* yacc.c:1646 */
+#line 1647 "ncgeny.c" /* yacc.c:1646 */
break;
case 3:
-#line 237 "ncgen.y" /* yacc.c:1646 */
+#line 240 "ncgen.y" /* yacc.c:1646 */
{createrootgroup(datasetname);}
-#line 1650 "ncgeny.c" /* yacc.c:1646 */
+#line 1653 "ncgeny.c" /* yacc.c:1646 */
break;
case 8:
-#line 256 "ncgen.y" /* yacc.c:1646 */
+#line 259 "ncgen.y" /* yacc.c:1646 */
{
Symbol* id = (yyvsp[-1].sym);
markcdf4("Group specification");
@@ -1658,29 +1661,29 @@
yyerror("duplicate group declaration within parent group for %s",
id->name);
}
-#line 1662 "ncgeny.c" /* yacc.c:1646 */
+#line 1665 "ncgeny.c" /* yacc.c:1646 */
break;
case 9:
-#line 265 "ncgen.y" /* yacc.c:1646 */
+#line 268 "ncgen.y" /* yacc.c:1646 */
{listpop(groupstack);}
-#line 1668 "ncgeny.c" /* yacc.c:1646 */
+#line 1671 "ncgeny.c" /* yacc.c:1646 */
break;
case 12:
-#line 271 "ncgen.y" /* yacc.c:1646 */
+#line 274 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1674 "ncgeny.c" /* yacc.c:1646 */
+#line 1677 "ncgeny.c" /* yacc.c:1646 */
break;
case 13:
-#line 273 "ncgen.y" /* yacc.c:1646 */
+#line 276 "ncgen.y" /* yacc.c:1646 */
{markcdf4("Type specification");}
-#line 1680 "ncgeny.c" /* yacc.c:1646 */
+#line 1683 "ncgeny.c" /* yacc.c:1646 */
break;
case 16:
-#line 279 "ncgen.y" /* yacc.c:1646 */
+#line 282 "ncgen.y" /* yacc.c:1646 */
{ /* Use when defining a type */
(yyvsp[0].sym)->objectclass = NC_TYPE;
if(dupobjectcheck(NC_TYPE,(yyvsp[0].sym)))
@@ -1688,23 +1691,23 @@
(yyvsp[0].sym)->name);
listpush(typdefs,(void*)(yyvsp[0].sym));
}
-#line 1692 "ncgeny.c" /* yacc.c:1646 */
+#line 1695 "ncgeny.c" /* yacc.c:1646 */
break;
case 17:
-#line 288 "ncgen.y" /* yacc.c:1646 */
+#line 291 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1698 "ncgeny.c" /* yacc.c:1646 */
+#line 1701 "ncgeny.c" /* yacc.c:1646 */
break;
case 18:
-#line 288 "ncgen.y" /* yacc.c:1646 */
+#line 291 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1704 "ncgeny.c" /* yacc.c:1646 */
+#line 1707 "ncgeny.c" /* yacc.c:1646 */
break;
case 25:
-#line 302 "ncgen.y" /* yacc.c:1646 */
+#line 305 "ncgen.y" /* yacc.c:1646 */
{
int i;
addtogroup((yyvsp[-3].sym)); /* sets prefix*/
@@ -1731,17 +1734,17 @@
}
listsetlength(stack,stackbase);/* remove stack nodes*/
}
-#line 1735 "ncgeny.c" /* yacc.c:1646 */
+#line 1738 "ncgeny.c" /* yacc.c:1646 */
break;
case 26:
-#line 331 "ncgen.y" /* yacc.c:1646 */
+#line 334 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 1741 "ncgeny.c" /* yacc.c:1646 */
+#line 1744 "ncgeny.c" /* yacc.c:1646 */
break;
case 27:
-#line 333 "ncgen.y" /* yacc.c:1646 */
+#line 336 "ncgen.y" /* yacc.c:1646 */
{
int i;
(yyval.mark)=(yyvsp[-2].mark);
@@ -1756,22 +1759,22 @@
}
listpush(stack,(void*)(yyvsp[0].sym));
}
-#line 1760 "ncgeny.c" /* yacc.c:1646 */
+#line 1763 "ncgeny.c" /* yacc.c:1646 */
break;
case 28:
-#line 350 "ncgen.y" /* yacc.c:1646 */
+#line 353 "ncgen.y" /* yacc.c:1646 */
{
(yyvsp[-2].sym)->objectclass=NC_TYPE;
(yyvsp[-2].sym)->subclass=NC_ECONST;
(yyvsp[-2].sym)->typ.econst=(yyvsp[0].constant);
(yyval.sym)=(yyvsp[-2].sym);
}
-#line 1771 "ncgeny.c" /* yacc.c:1646 */
+#line 1774 "ncgeny.c" /* yacc.c:1646 */
break;
case 29:
-#line 359 "ncgen.y" /* yacc.c:1646 */
+#line 362 "ncgen.y" /* yacc.c:1646 */
{
vercheck(NC_OPAQUE);
addtogroup((yyvsp[0].sym)); /*sets prefix*/
@@ -1781,11 +1784,11 @@
(yyvsp[0].sym)->typ.size=int32_val;
(yyvsp[0].sym)->typ.alignment=ncaux_class_alignment(NC_OPAQUE);
}
-#line 1785 "ncgeny.c" /* yacc.c:1646 */
+#line 1788 "ncgeny.c" /* yacc.c:1646 */
break;
case 30:
-#line 371 "ncgen.y" /* yacc.c:1646 */
+#line 374 "ncgen.y" /* yacc.c:1646 */
{
Symbol* basetype = (yyvsp[-4].sym);
vercheck(NC_VLEN);
@@ -1797,11 +1800,11 @@
(yyvsp[0].sym)->typ.size=VLENSIZE;
(yyvsp[0].sym)->typ.alignment=ncaux_class_alignment(NC_VLEN);
}
-#line 1801 "ncgeny.c" /* yacc.c:1646 */
+#line 1804 "ncgeny.c" /* yacc.c:1646 */
break;
case 31:
-#line 385 "ncgen.y" /* yacc.c:1646 */
+#line 388 "ncgen.y" /* yacc.c:1646 */
{
int i,j;
vercheck(NC_COMPOUND);
@@ -1831,23 +1834,23 @@
}
listsetlength(stack,stackbase);/* remove stack nodes*/
}
-#line 1835 "ncgeny.c" /* yacc.c:1646 */
+#line 1838 "ncgeny.c" /* yacc.c:1646 */
break;
case 32:
-#line 417 "ncgen.y" /* yacc.c:1646 */
+#line 420 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-1].mark);}
-#line 1841 "ncgeny.c" /* yacc.c:1646 */
+#line 1844 "ncgeny.c" /* yacc.c:1646 */
break;
case 33:
-#line 418 "ncgen.y" /* yacc.c:1646 */
+#line 421 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-2].mark);}
-#line 1847 "ncgeny.c" /* yacc.c:1646 */
+#line 1850 "ncgeny.c" /* yacc.c:1646 */
break;
case 34:
-#line 422 "ncgen.y" /* yacc.c:1646 */
+#line 425 "ncgen.y" /* yacc.c:1646 */
{
int i;
(yyval.mark)=(yyvsp[0].mark);
@@ -1859,107 +1862,107 @@
f->typ.basetype = (yyvsp[-1].sym);
}
}
-#line 1863 "ncgeny.c" /* yacc.c:1646 */
+#line 1866 "ncgeny.c" /* yacc.c:1646 */
break;
case 35:
-#line 435 "ncgen.y" /* yacc.c:1646 */
+#line 438 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym) = primsymbols[NC_CHAR]; }
-#line 1869 "ncgeny.c" /* yacc.c:1646 */
+#line 1872 "ncgeny.c" /* yacc.c:1646 */
break;
case 36:
-#line 436 "ncgen.y" /* yacc.c:1646 */
+#line 439 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym) = primsymbols[NC_BYTE]; }
-#line 1875 "ncgeny.c" /* yacc.c:1646 */
+#line 1878 "ncgeny.c" /* yacc.c:1646 */
break;
case 37:
-#line 437 "ncgen.y" /* yacc.c:1646 */
+#line 440 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym) = primsymbols[NC_SHORT]; }
-#line 1881 "ncgeny.c" /* yacc.c:1646 */
+#line 1884 "ncgeny.c" /* yacc.c:1646 */
break;
case 38:
-#line 438 "ncgen.y" /* yacc.c:1646 */
+#line 441 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym) = primsymbols[NC_INT]; }
-#line 1887 "ncgeny.c" /* yacc.c:1646 */
+#line 1890 "ncgeny.c" /* yacc.c:1646 */
break;
case 39:
-#line 439 "ncgen.y" /* yacc.c:1646 */
+#line 442 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym) = primsymbols[NC_FLOAT]; }
-#line 1893 "ncgeny.c" /* yacc.c:1646 */
+#line 1896 "ncgeny.c" /* yacc.c:1646 */
break;
case 40:
-#line 440 "ncgen.y" /* yacc.c:1646 */
+#line 443 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym) = primsymbols[NC_DOUBLE]; }
-#line 1899 "ncgeny.c" /* yacc.c:1646 */
+#line 1902 "ncgeny.c" /* yacc.c:1646 */
break;
case 41:
-#line 441 "ncgen.y" /* yacc.c:1646 */
+#line 444 "ncgen.y" /* yacc.c:1646 */
{ vercheck(NC_UBYTE); (yyval.sym) = primsymbols[NC_UBYTE]; }
-#line 1905 "ncgeny.c" /* yacc.c:1646 */
+#line 1908 "ncgeny.c" /* yacc.c:1646 */
break;
case 42:
-#line 442 "ncgen.y" /* yacc.c:1646 */
+#line 445 "ncgen.y" /* yacc.c:1646 */
{ vercheck(NC_USHORT); (yyval.sym) = primsymbols[NC_USHORT]; }
-#line 1911 "ncgeny.c" /* yacc.c:1646 */
+#line 1914 "ncgeny.c" /* yacc.c:1646 */
break;
case 43:
-#line 443 "ncgen.y" /* yacc.c:1646 */
+#line 446 "ncgen.y" /* yacc.c:1646 */
{ vercheck(NC_UINT); (yyval.sym) = primsymbols[NC_UINT]; }
-#line 1917 "ncgeny.c" /* yacc.c:1646 */
+#line 1920 "ncgeny.c" /* yacc.c:1646 */
break;
case 44:
-#line 444 "ncgen.y" /* yacc.c:1646 */
+#line 447 "ncgen.y" /* yacc.c:1646 */
{ vercheck(NC_INT64); (yyval.sym) = primsymbols[NC_INT64]; }
-#line 1923 "ncgeny.c" /* yacc.c:1646 */
+#line 1926 "ncgeny.c" /* yacc.c:1646 */
break;
case 45:
-#line 445 "ncgen.y" /* yacc.c:1646 */
+#line 448 "ncgen.y" /* yacc.c:1646 */
{ vercheck(NC_UINT64); (yyval.sym) = primsymbols[NC_UINT64]; }
-#line 1929 "ncgeny.c" /* yacc.c:1646 */
+#line 1932 "ncgeny.c" /* yacc.c:1646 */
break;
case 46:
-#line 446 "ncgen.y" /* yacc.c:1646 */
+#line 449 "ncgen.y" /* yacc.c:1646 */
{ vercheck(NC_STRING); (yyval.sym) = primsymbols[NC_STRING]; }
-#line 1935 "ncgeny.c" /* yacc.c:1646 */
+#line 1938 "ncgeny.c" /* yacc.c:1646 */
break;
case 48:
-#line 450 "ncgen.y" /* yacc.c:1646 */
+#line 453 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1941 "ncgeny.c" /* yacc.c:1646 */
+#line 1944 "ncgeny.c" /* yacc.c:1646 */
break;
case 49:
-#line 451 "ncgen.y" /* yacc.c:1646 */
+#line 454 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1947 "ncgeny.c" /* yacc.c:1646 */
+#line 1950 "ncgeny.c" /* yacc.c:1646 */
break;
case 52:
-#line 458 "ncgen.y" /* yacc.c:1646 */
+#line 461 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1953 "ncgeny.c" /* yacc.c:1646 */
+#line 1956 "ncgeny.c" /* yacc.c:1646 */
break;
case 53:
-#line 458 "ncgen.y" /* yacc.c:1646 */
+#line 461 "ncgen.y" /* yacc.c:1646 */
{}
-#line 1959 "ncgeny.c" /* yacc.c:1646 */
+#line 1962 "ncgeny.c" /* yacc.c:1646 */
break;
case 56:
-#line 466 "ncgen.y" /* yacc.c:1646 */
+#line 469 "ncgen.y" /* yacc.c:1646 */
{
(yyvsp[-2].sym)->dim.declsize = (size_t)extractint((yyvsp[0].constant));
#ifdef GENDEBUG1
@@ -1967,11 +1970,11 @@
#endif
reclaimconstant((yyvsp[0].constant));
}
-#line 1971 "ncgeny.c" /* yacc.c:1646 */
+#line 1974 "ncgeny.c" /* yacc.c:1646 */
break;
case 57:
-#line 474 "ncgen.y" /* yacc.c:1646 */
+#line 477 "ncgen.y" /* yacc.c:1646 */
{
(yyvsp[-2].sym)->dim.declsize = NC_UNLIMITED;
(yyvsp[-2].sym)->dim.isunlimited = 1;
@@ -1979,11 +1982,11 @@
fprintf(stderr,"dimension: %s = UNLIMITED\n",(yyvsp[-2].sym)->name);
#endif
}
-#line 1983 "ncgeny.c" /* yacc.c:1646 */
+#line 1986 "ncgeny.c" /* yacc.c:1646 */
break;
case 58:
-#line 484 "ncgen.y" /* yacc.c:1646 */
+#line 487 "ncgen.y" /* yacc.c:1646 */
{
(yyvsp[0].sym)->objectclass=NC_DIM;
if(dupobjectcheck(NC_DIM,(yyvsp[0].sym)))
@@ -1993,35 +1996,35 @@
(yyval.sym)=(yyvsp[0].sym);
listpush(dimdefs,(void*)(yyvsp[0].sym));
}
-#line 1997 "ncgeny.c" /* yacc.c:1646 */
+#line 2000 "ncgeny.c" /* yacc.c:1646 */
break;
case 60:
-#line 496 "ncgen.y" /* yacc.c:1646 */
+#line 499 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2003 "ncgeny.c" /* yacc.c:1646 */
+#line 2006 "ncgeny.c" /* yacc.c:1646 */
break;
case 61:
-#line 497 "ncgen.y" /* yacc.c:1646 */
+#line 500 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2009 "ncgeny.c" /* yacc.c:1646 */
+#line 2012 "ncgeny.c" /* yacc.c:1646 */
break;
case 64:
-#line 504 "ncgen.y" /* yacc.c:1646 */
+#line 507 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2015 "ncgeny.c" /* yacc.c:1646 */
+#line 2018 "ncgeny.c" /* yacc.c:1646 */
break;
case 65:
-#line 504 "ncgen.y" /* yacc.c:1646 */
+#line 507 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2021 "ncgeny.c" /* yacc.c:1646 */
+#line 2024 "ncgeny.c" /* yacc.c:1646 */
break;
case 66:
-#line 507 "ncgen.y" /* yacc.c:1646 */
+#line 510 "ncgen.y" /* yacc.c:1646 */
{
int i;
stackbase=(yyvsp[0].mark);
@@ -2044,25 +2047,25 @@
}
listsetlength(stack,stackbase);/* remove stack nodes*/
}
-#line 2048 "ncgeny.c" /* yacc.c:1646 */
+#line 2051 "ncgeny.c" /* yacc.c:1646 */
break;
case 67:
-#line 532 "ncgen.y" /* yacc.c:1646 */
+#line 535 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack);
listpush(stack,(void*)(yyvsp[0].sym));
}
-#line 2056 "ncgeny.c" /* yacc.c:1646 */
+#line 2059 "ncgeny.c" /* yacc.c:1646 */
break;
case 68:
-#line 536 "ncgen.y" /* yacc.c:1646 */
+#line 539 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 2062 "ncgeny.c" /* yacc.c:1646 */
+#line 2065 "ncgeny.c" /* yacc.c:1646 */
break;
case 69:
-#line 540 "ncgen.y" /* yacc.c:1646 */
+#line 543 "ncgen.y" /* yacc.c:1646 */
{
int i;
Dimset dimset;
@@ -2089,35 +2092,35 @@
listsetlength(stack,stackbase);/* remove stack nodes*/
(yyval.sym) = var;
}
-#line 2093 "ncgeny.c" /* yacc.c:1646 */
+#line 2096 "ncgeny.c" /* yacc.c:1646 */
break;
case 70:
-#line 568 "ncgen.y" /* yacc.c:1646 */
+#line 571 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack);}
-#line 2099 "ncgeny.c" /* yacc.c:1646 */
+#line 2102 "ncgeny.c" /* yacc.c:1646 */
break;
case 71:
-#line 569 "ncgen.y" /* yacc.c:1646 */
+#line 572 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-1].mark);}
-#line 2105 "ncgeny.c" /* yacc.c:1646 */
+#line 2108 "ncgeny.c" /* yacc.c:1646 */
break;
case 72:
-#line 572 "ncgen.y" /* yacc.c:1646 */
+#line 575 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 2111 "ncgeny.c" /* yacc.c:1646 */
+#line 2114 "ncgeny.c" /* yacc.c:1646 */
break;
case 73:
-#line 574 "ncgen.y" /* yacc.c:1646 */
+#line 577 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 2117 "ncgeny.c" /* yacc.c:1646 */
+#line 2120 "ncgeny.c" /* yacc.c:1646 */
break;
case 74:
-#line 578 "ncgen.y" /* yacc.c:1646 */
+#line 581 "ncgen.y" /* yacc.c:1646 */
{Symbol* dimsym = (yyvsp[0].sym);
dimsym->objectclass = NC_DIM;
/* Find the actual dimension*/
@@ -2128,25 +2131,25 @@
}
(yyval.sym)=dimsym;
}
-#line 2132 "ncgeny.c" /* yacc.c:1646 */
+#line 2135 "ncgeny.c" /* yacc.c:1646 */
break;
case 75:
-#line 592 "ncgen.y" /* yacc.c:1646 */
+#line 595 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack);
listpush(stack,(void*)(yyvsp[0].sym));
}
-#line 2140 "ncgeny.c" /* yacc.c:1646 */
+#line 2143 "ncgeny.c" /* yacc.c:1646 */
break;
case 76:
-#line 596 "ncgen.y" /* yacc.c:1646 */
+#line 599 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 2146 "ncgeny.c" /* yacc.c:1646 */
+#line 2149 "ncgeny.c" /* yacc.c:1646 */
break;
case 77:
-#line 601 "ncgen.y" /* yacc.c:1646 */
+#line 604 "ncgen.y" /* yacc.c:1646 */
{
int i;
Dimset dimset;
@@ -2173,35 +2176,35 @@
listsetlength(stack,stackbase);/* remove stack nodes*/
(yyval.sym) = (yyvsp[-1].sym);
}
-#line 2177 "ncgeny.c" /* yacc.c:1646 */
+#line 2180 "ncgeny.c" /* yacc.c:1646 */
break;
case 78:
-#line 629 "ncgen.y" /* yacc.c:1646 */
+#line 632 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack);}
-#line 2183 "ncgeny.c" /* yacc.c:1646 */
+#line 2186 "ncgeny.c" /* yacc.c:1646 */
break;
case 79:
-#line 630 "ncgen.y" /* yacc.c:1646 */
+#line 633 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-1].mark);}
-#line 2189 "ncgeny.c" /* yacc.c:1646 */
+#line 2192 "ncgeny.c" /* yacc.c:1646 */
break;
case 80:
-#line 634 "ncgen.y" /* yacc.c:1646 */
+#line 637 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=listlength(stack); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 2195 "ncgeny.c" /* yacc.c:1646 */
+#line 2198 "ncgeny.c" /* yacc.c:1646 */
break;
case 81:
-#line 636 "ncgen.y" /* yacc.c:1646 */
+#line 639 "ncgen.y" /* yacc.c:1646 */
{(yyval.mark)=(yyvsp[-2].mark); listpush(stack,(void*)(yyvsp[0].sym));}
-#line 2201 "ncgeny.c" /* yacc.c:1646 */
+#line 2204 "ncgeny.c" /* yacc.c:1646 */
break;
case 82:
-#line 641 "ncgen.y" /* yacc.c:1646 */
+#line 644 "ncgen.y" /* yacc.c:1646 */
{ /* Anonymous integer dimension.
Can only occur in type definitions*/
char anon[32];
@@ -2211,11 +2214,11 @@
(yyval.sym)->dim.isconstant = 1;
(yyval.sym)->dim.declsize = uint32_val;
}
-#line 2215 "ncgeny.c" /* yacc.c:1646 */
+#line 2218 "ncgeny.c" /* yacc.c:1646 */
break;
case 83:
-#line 651 "ncgen.y" /* yacc.c:1646 */
+#line 654 "ncgen.y" /* yacc.c:1646 */
{ /* Anonymous integer dimension.
Can only occur in type definitions*/
char anon[32];
@@ -2229,11 +2232,11 @@
(yyval.sym)->dim.isconstant = 1;
(yyval.sym)->dim.declsize = int32_val;
}
-#line 2233 "ncgeny.c" /* yacc.c:1646 */
+#line 2236 "ncgeny.c" /* yacc.c:1646 */
break;
case 84:
-#line 671 "ncgen.y" /* yacc.c:1646 */
+#line 674 "ncgen.y" /* yacc.c:1646 */
{Symbol* vsym = (yyvsp[0].sym);
if(vsym->objectclass != NC_VAR) {
derror("Undefined or forward referenced variable: %s",vsym->name);
@@ -2241,11 +2244,11 @@
}
(yyval.sym)=vsym;
}
-#line 2245 "ncgeny.c" /* yacc.c:1646 */
+#line 2248 "ncgeny.c" /* yacc.c:1646 */
break;
case 85:
-#line 682 "ncgen.y" /* yacc.c:1646 */
+#line 685 "ncgen.y" /* yacc.c:1646 */
{Symbol* tsym = (yyvsp[0].sym);
if(tsym->objectclass != NC_TYPE) {
derror("Undefined or forward referenced type: %s",tsym->name);
@@ -2253,11 +2256,11 @@
}
(yyval.sym)=tsym;
}
-#line 2257 "ncgeny.c" /* yacc.c:1646 */
+#line 2260 "ncgeny.c" /* yacc.c:1646 */
break;
case 86:
-#line 693 "ncgen.y" /* yacc.c:1646 */
+#line 696 "ncgen.y" /* yacc.c:1646 */
{Symbol* tvsym = (yyvsp[0].sym); Symbol* sym;
/* disambiguate*/
tvsym->objectclass = NC_VAR;
@@ -2276,53 +2279,53 @@
}
(yyval.sym)=tvsym;
}
-#line 2280 "ncgeny.c" /* yacc.c:1646 */
+#line 2283 "ncgeny.c" /* yacc.c:1646 */
break;
case 87:
-#line 711 "ncgen.y" /* yacc.c:1646 */
+#line 714 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym)=(yyvsp[0].sym);}
-#line 2286 "ncgeny.c" /* yacc.c:1646 */
+#line 2289 "ncgeny.c" /* yacc.c:1646 */
break;
case 88:
-#line 718 "ncgen.y" /* yacc.c:1646 */
+#line 721 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2292 "ncgeny.c" /* yacc.c:1646 */
+#line 2295 "ncgeny.c" /* yacc.c:1646 */
break;
case 89:
-#line 718 "ncgen.y" /* yacc.c:1646 */
+#line 721 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2298 "ncgeny.c" /* yacc.c:1646 */
+#line 2301 "ncgeny.c" /* yacc.c:1646 */
break;
case 90:
-#line 722 "ncgen.y" /* yacc.c:1646 */
+#line 725 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_NCPROPS_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2304 "ncgeny.c" /* yacc.c:1646 */
+#line 2307 "ncgeny.c" /* yacc.c:1646 */
break;
case 91:
-#line 724 "ncgen.y" /* yacc.c:1646 */
+#line 727 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_ISNETCDF4_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2310 "ncgeny.c" /* yacc.c:1646 */
+#line 2313 "ncgeny.c" /* yacc.c:1646 */
break;
case 92:
-#line 726 "ncgen.y" /* yacc.c:1646 */
+#line 729 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_SUPERBLOCK_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2316 "ncgeny.c" /* yacc.c:1646 */
+#line 2319 "ncgeny.c" /* yacc.c:1646 */
break;
case 93:
-#line 728 "ncgen.y" /* yacc.c:1646 */
+#line 731 "ncgen.y" /* yacc.c:1646 */
{ (yyval.sym)=makeattribute((yyvsp[-2].sym),NULL,NULL,(yyvsp[0].datalist),ATTRGLOBAL);}
-#line 2322 "ncgeny.c" /* yacc.c:1646 */
+#line 2325 "ncgeny.c" /* yacc.c:1646 */
break;
case 94:
-#line 730 "ncgen.y" /* yacc.c:1646 */
+#line 733 "ncgen.y" /* yacc.c:1646 */
{Symbol* tsym = (yyvsp[-5].sym); Symbol* vsym = (yyvsp[-4].sym); Symbol* asym = (yyvsp[-2].sym);
if(vsym->objectclass == NC_VAR) {
(yyval.sym)=makeattribute(asym,vsym,tsym,(yyvsp[0].datalist),ATTRVAR);
@@ -2331,11 +2334,11 @@
YYABORT;
}
}
-#line 2335 "ncgeny.c" /* yacc.c:1646 */
+#line 2338 "ncgeny.c" /* yacc.c:1646 */
break;
case 95:
-#line 739 "ncgen.y" /* yacc.c:1646 */
+#line 742 "ncgen.y" /* yacc.c:1646 */
{Symbol* sym = (yyvsp[-4].sym); Symbol* asym = (yyvsp[-2].sym);
if(sym->objectclass == NC_VAR) {
(yyval.sym)=makeattribute(asym,sym,NULL,(yyvsp[0].datalist),ATTRVAR);
@@ -2346,345 +2349,345 @@
YYABORT;
}
}
-#line 2350 "ncgeny.c" /* yacc.c:1646 */
+#line 2353 "ncgeny.c" /* yacc.c:1646 */
break;
case 96:
-#line 750 "ncgen.y" /* yacc.c:1646 */
+#line 753 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),ISLIST);}
-#line 2356 "ncgeny.c" /* yacc.c:1646 */
+#line 2359 "ncgeny.c" /* yacc.c:1646 */
break;
case 97:
-#line 752 "ncgen.y" /* yacc.c:1646 */
+#line 755 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_FILLVALUE_FLAG,(yyvsp[-4].sym),(yyvsp[-5].sym),(void*)(yyvsp[0].datalist),ISLIST);}
-#line 2362 "ncgeny.c" /* yacc.c:1646 */
+#line 2365 "ncgeny.c" /* yacc.c:1646 */
break;
case 98:
-#line 754 "ncgen.y" /* yacc.c:1646 */
+#line 757 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_STORAGE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2368 "ncgeny.c" /* yacc.c:1646 */
+#line 2371 "ncgeny.c" /* yacc.c:1646 */
break;
case 99:
-#line 756 "ncgen.y" /* yacc.c:1646 */
+#line 759 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_CHUNKSIZES_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].datalist),ISLIST);}
-#line 2374 "ncgeny.c" /* yacc.c:1646 */
+#line 2377 "ncgeny.c" /* yacc.c:1646 */
break;
case 100:
-#line 758 "ncgen.y" /* yacc.c:1646 */
+#line 761 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_FLETCHER32_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2380 "ncgeny.c" /* yacc.c:1646 */
+#line 2383 "ncgeny.c" /* yacc.c:1646 */
break;
case 101:
-#line 760 "ncgen.y" /* yacc.c:1646 */
+#line 763 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_DEFLATE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2386 "ncgeny.c" /* yacc.c:1646 */
+#line 2389 "ncgeny.c" /* yacc.c:1646 */
break;
case 102:
-#line 762 "ncgen.y" /* yacc.c:1646 */
+#line 765 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_SHUFFLE_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2392 "ncgeny.c" /* yacc.c:1646 */
+#line 2395 "ncgeny.c" /* yacc.c:1646 */
break;
case 103:
-#line 764 "ncgen.y" /* yacc.c:1646 */
+#line 767 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_ENDIAN_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2398 "ncgeny.c" /* yacc.c:1646 */
+#line 2401 "ncgeny.c" /* yacc.c:1646 */
break;
case 104:
-#line 766 "ncgen.y" /* yacc.c:1646 */
+#line 769 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_FILTER_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2404 "ncgeny.c" /* yacc.c:1646 */
+#line 2407 "ncgeny.c" /* yacc.c:1646 */
break;
case 105:
-#line 768 "ncgen.y" /* yacc.c:1646 */
+#line 771 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_NOFILL_FLAG,(yyvsp[-4].sym),NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2410 "ncgeny.c" /* yacc.c:1646 */
+#line 2413 "ncgeny.c" /* yacc.c:1646 */
break;
case 106:
-#line 770 "ncgen.y" /* yacc.c:1646 */
+#line 773 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym) = makespecial(_FORMAT_FLAG,NULL,NULL,(void*)(yyvsp[0].constant),ISCONST);}
-#line 2416 "ncgeny.c" /* yacc.c:1646 */
+#line 2419 "ncgeny.c" /* yacc.c:1646 */
break;
case 107:
-#line 775 "ncgen.y" /* yacc.c:1646 */
+#line 778 "ncgen.y" /* yacc.c:1646 */
{
(yyval.sym)=(yyvsp[0].sym);
(yyvsp[0].sym)->ref.is_ref=1;
(yyvsp[0].sym)->is_prefixed=0;
setpathcurrent((yyvsp[0].sym));
}
-#line 2427 "ncgeny.c" /* yacc.c:1646 */
+#line 2430 "ncgeny.c" /* yacc.c:1646 */
break;
case 108:
-#line 782 "ncgen.y" /* yacc.c:1646 */
+#line 785 "ncgen.y" /* yacc.c:1646 */
{
(yyval.sym)=(yyvsp[0].sym);
(yyvsp[0].sym)->ref.is_ref=1;
(yyvsp[0].sym)->is_prefixed=1;
/* path is set in ncgen.l*/
}
-#line 2438 "ncgeny.c" /* yacc.c:1646 */
+#line 2441 "ncgeny.c" /* yacc.c:1646 */
break;
case 110:
-#line 791 "ncgen.y" /* yacc.c:1646 */
+#line 794 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2444 "ncgeny.c" /* yacc.c:1646 */
+#line 2447 "ncgeny.c" /* yacc.c:1646 */
break;
case 111:
-#line 792 "ncgen.y" /* yacc.c:1646 */
+#line 795 "ncgen.y" /* yacc.c:1646 */
{}
-#line 2450 "ncgeny.c" /* yacc.c:1646 */
+#line 2453 "ncgeny.c" /* yacc.c:1646 */
break;
case 114:
-#line 800 "ncgen.y" /* yacc.c:1646 */
+#line 803 "ncgen.y" /* yacc.c:1646 */
{(yyvsp[-2].sym)->data = (yyvsp[0].datalist);}
-#line 2456 "ncgeny.c" /* yacc.c:1646 */
+#line 2459 "ncgeny.c" /* yacc.c:1646 */
break;
case 115:
-#line 803 "ncgen.y" /* yacc.c:1646 */
+#line 806 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist) = (yyvsp[0].datalist);}
-#line 2462 "ncgeny.c" /* yacc.c:1646 */
+#line 2465 "ncgeny.c" /* yacc.c:1646 */
break;
case 116:
-#line 804 "ncgen.y" /* yacc.c:1646 */
+#line 807 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist) = (yyvsp[0].datalist);}
-#line 2468 "ncgeny.c" /* yacc.c:1646 */
+#line 2471 "ncgeny.c" /* yacc.c:1646 */
break;
case 117:
-#line 808 "ncgen.y" /* yacc.c:1646 */
+#line 811 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist) = builddatalist(0);}
-#line 2474 "ncgeny.c" /* yacc.c:1646 */
+#line 2477 "ncgeny.c" /* yacc.c:1646 */
break;
case 118:
-#line 812 "ncgen.y" /* yacc.c:1646 */
+#line 815 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist) = const2list((yyvsp[0].constant));}
-#line 2480 "ncgeny.c" /* yacc.c:1646 */
+#line 2483 "ncgeny.c" /* yacc.c:1646 */
break;
case 119:
-#line 814 "ncgen.y" /* yacc.c:1646 */
+#line 817 "ncgen.y" /* yacc.c:1646 */
{dlappend((yyvsp[-2].datalist),((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist); }
-#line 2486 "ncgeny.c" /* yacc.c:1646 */
+#line 2489 "ncgeny.c" /* yacc.c:1646 */
break;
case 120:
-#line 818 "ncgen.y" /* yacc.c:1646 */
+#line 821 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=(yyvsp[0].constant);}
-#line 2492 "ncgeny.c" /* yacc.c:1646 */
+#line 2495 "ncgeny.c" /* yacc.c:1646 */
break;
case 121:
-#line 819 "ncgen.y" /* yacc.c:1646 */
+#line 822 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=builddatasublist((yyvsp[-1].datalist));}
-#line 2498 "ncgeny.c" /* yacc.c:1646 */
+#line 2501 "ncgeny.c" /* yacc.c:1646 */
break;
case 122:
-#line 823 "ncgen.y" /* yacc.c:1646 */
+#line 826 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=(yyvsp[0].constant);}
-#line 2504 "ncgeny.c" /* yacc.c:1646 */
+#line 2507 "ncgeny.c" /* yacc.c:1646 */
break;
case 123:
-#line 824 "ncgen.y" /* yacc.c:1646 */
+#line 827 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_OPAQUE);}
-#line 2510 "ncgeny.c" /* yacc.c:1646 */
+#line 2513 "ncgeny.c" /* yacc.c:1646 */
break;
case 124:
-#line 825 "ncgen.y" /* yacc.c:1646 */
+#line 828 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_FILLVALUE);}
-#line 2516 "ncgeny.c" /* yacc.c:1646 */
+#line 2519 "ncgeny.c" /* yacc.c:1646 */
break;
case 125:
-#line 826 "ncgen.y" /* yacc.c:1646 */
+#line 829 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_NIL);}
-#line 2522 "ncgeny.c" /* yacc.c:1646 */
+#line 2525 "ncgeny.c" /* yacc.c:1646 */
break;
case 126:
-#line 827 "ncgen.y" /* yacc.c:1646 */
+#line 830 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=(yyvsp[0].constant);}
-#line 2528 "ncgeny.c" /* yacc.c:1646 */
+#line 2531 "ncgeny.c" /* yacc.c:1646 */
break;
case 128:
-#line 832 "ncgen.y" /* yacc.c:1646 */
+#line 835 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant) = makeenumconstref((yyvsp[0].sym));}
-#line 2534 "ncgeny.c" /* yacc.c:1646 */
+#line 2537 "ncgeny.c" /* yacc.c:1646 */
break;
case 129:
-#line 836 "ncgen.y" /* yacc.c:1646 */
+#line 839 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=evaluate((yyvsp[-3].sym),(yyvsp[-1].datalist));}
-#line 2540 "ncgeny.c" /* yacc.c:1646 */
+#line 2543 "ncgeny.c" /* yacc.c:1646 */
break;
case 130:
-#line 841 "ncgen.y" /* yacc.c:1646 */
+#line 844 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist) = const2list((yyvsp[0].constant));}
-#line 2546 "ncgeny.c" /* yacc.c:1646 */
+#line 2549 "ncgeny.c" /* yacc.c:1646 */
break;
case 131:
-#line 843 "ncgen.y" /* yacc.c:1646 */
+#line 846 "ncgen.y" /* yacc.c:1646 */
{dlappend((yyvsp[-2].datalist),((yyvsp[0].constant))); (yyval.datalist)=(yyvsp[-2].datalist);}
-#line 2552 "ncgeny.c" /* yacc.c:1646 */
+#line 2555 "ncgeny.c" /* yacc.c:1646 */
break;
case 132:
-#line 847 "ncgen.y" /* yacc.c:1646 */
+#line 850 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_CHAR);}
-#line 2558 "ncgeny.c" /* yacc.c:1646 */
+#line 2561 "ncgeny.c" /* yacc.c:1646 */
break;
case 133:
-#line 848 "ncgen.y" /* yacc.c:1646 */
+#line 851 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_BYTE);}
-#line 2564 "ncgeny.c" /* yacc.c:1646 */
+#line 2567 "ncgeny.c" /* yacc.c:1646 */
break;
case 134:
-#line 849 "ncgen.y" /* yacc.c:1646 */
+#line 852 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_SHORT);}
-#line 2570 "ncgeny.c" /* yacc.c:1646 */
+#line 2573 "ncgeny.c" /* yacc.c:1646 */
break;
case 135:
-#line 850 "ncgen.y" /* yacc.c:1646 */
+#line 853 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_INT);}
-#line 2576 "ncgeny.c" /* yacc.c:1646 */
+#line 2579 "ncgeny.c" /* yacc.c:1646 */
break;
case 136:
-#line 851 "ncgen.y" /* yacc.c:1646 */
+#line 854 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_INT64);}
-#line 2582 "ncgeny.c" /* yacc.c:1646 */
+#line 2585 "ncgeny.c" /* yacc.c:1646 */
break;
case 137:
-#line 852 "ncgen.y" /* yacc.c:1646 */
+#line 855 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_UBYTE);}
-#line 2588 "ncgeny.c" /* yacc.c:1646 */
+#line 2591 "ncgeny.c" /* yacc.c:1646 */
break;
case 138:
-#line 853 "ncgen.y" /* yacc.c:1646 */
+#line 856 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_USHORT);}
-#line 2594 "ncgeny.c" /* yacc.c:1646 */
+#line 2597 "ncgeny.c" /* yacc.c:1646 */
break;
case 139:
-#line 854 "ncgen.y" /* yacc.c:1646 */
+#line 857 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_UINT);}
-#line 2600 "ncgeny.c" /* yacc.c:1646 */
+#line 2603 "ncgeny.c" /* yacc.c:1646 */
break;
case 140:
-#line 855 "ncgen.y" /* yacc.c:1646 */
+#line 858 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_UINT64);}
-#line 2606 "ncgeny.c" /* yacc.c:1646 */
+#line 2609 "ncgeny.c" /* yacc.c:1646 */
break;
case 141:
-#line 856 "ncgen.y" /* yacc.c:1646 */
+#line 859 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_FLOAT);}
-#line 2612 "ncgeny.c" /* yacc.c:1646 */
+#line 2615 "ncgeny.c" /* yacc.c:1646 */
break;
case 142:
-#line 857 "ncgen.y" /* yacc.c:1646 */
+#line 860 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_DOUBLE);}
-#line 2618 "ncgeny.c" /* yacc.c:1646 */
+#line 2621 "ncgeny.c" /* yacc.c:1646 */
break;
case 143:
-#line 858 "ncgen.y" /* yacc.c:1646 */
+#line 861 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_STRING);}
-#line 2624 "ncgeny.c" /* yacc.c:1646 */
+#line 2627 "ncgeny.c" /* yacc.c:1646 */
break;
case 144:
-#line 862 "ncgen.y" /* yacc.c:1646 */
+#line 865 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist) = const2list((yyvsp[0].constant));}
-#line 2630 "ncgeny.c" /* yacc.c:1646 */
+#line 2633 "ncgeny.c" /* yacc.c:1646 */
break;
case 145:
-#line 863 "ncgen.y" /* yacc.c:1646 */
+#line 866 "ncgen.y" /* yacc.c:1646 */
{(yyval.datalist)=(yyvsp[-2].datalist); dlappend((yyvsp[-2].datalist),((yyvsp[0].constant)));}
-#line 2636 "ncgeny.c" /* yacc.c:1646 */
+#line 2639 "ncgeny.c" /* yacc.c:1646 */
break;
case 146:
-#line 868 "ncgen.y" /* yacc.c:1646 */
+#line 871 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_INT);}
-#line 2642 "ncgeny.c" /* yacc.c:1646 */
+#line 2645 "ncgeny.c" /* yacc.c:1646 */
break;
case 147:
-#line 870 "ncgen.y" /* yacc.c:1646 */
+#line 873 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_UINT);}
-#line 2648 "ncgeny.c" /* yacc.c:1646 */
+#line 2651 "ncgeny.c" /* yacc.c:1646 */
break;
case 148:
-#line 872 "ncgen.y" /* yacc.c:1646 */
+#line 875 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_INT64);}
-#line 2654 "ncgeny.c" /* yacc.c:1646 */
+#line 2657 "ncgeny.c" /* yacc.c:1646 */
break;
case 149:
-#line 874 "ncgen.y" /* yacc.c:1646 */
+#line 877 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_UINT64);}
-#line 2660 "ncgeny.c" /* yacc.c:1646 */
+#line 2663 "ncgeny.c" /* yacc.c:1646 */
break;
case 150:
-#line 878 "ncgen.y" /* yacc.c:1646 */
+#line 881 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=makeconstdata(NC_STRING);}
-#line 2666 "ncgeny.c" /* yacc.c:1646 */
+#line 2669 "ncgeny.c" /* yacc.c:1646 */
break;
case 151:
-#line 882 "ncgen.y" /* yacc.c:1646 */
+#line 885 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=(yyvsp[0].constant);}
-#line 2672 "ncgeny.c" /* yacc.c:1646 */
+#line 2675 "ncgeny.c" /* yacc.c:1646 */
break;
case 152:
-#line 883 "ncgen.y" /* yacc.c:1646 */
+#line 886 "ncgen.y" /* yacc.c:1646 */
{(yyval.constant)=(yyvsp[0].constant);}
-#line 2678 "ncgeny.c" /* yacc.c:1646 */
+#line 2681 "ncgeny.c" /* yacc.c:1646 */
break;
case 153:
-#line 889 "ncgen.y" /* yacc.c:1646 */
+#line 892 "ncgen.y" /* yacc.c:1646 */
{(yyval.sym)=(yyvsp[0].sym);}
-#line 2684 "ncgeny.c" /* yacc.c:1646 */
+#line 2687 "ncgeny.c" /* yacc.c:1646 */
break;
-#line 2688 "ncgeny.c" /* yacc.c:1646 */
+#line 2691 "ncgeny.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -2912,7 +2915,7 @@
#endif
return yyresult;
}
-#line 892 "ncgen.y" /* yacc.c:1906 */
+#line 895 "ncgen.y" /* yacc.c:1906 */
#ifndef NO_STDARG
@@ -3326,6 +3329,8 @@
derror("_Storage: illegal NULL value");
else if(strcmp(sdata,"contiguous") == 0)
special->_Storage = NC_CONTIGUOUS;
+ else if(strcmp(sdata,"compact") == 0)
+ special->_Storage = NC_COMPACT;
else if(strcmp(sdata,"chunked") == 0)
special->_Storage = NC_CHUNKED;
else
@@ -3387,7 +3392,6 @@
if(parsefilterflag(sdata,special) == NC_NOERR)
special->flags |= _FILTER_FLAG;
else {
- efree(special->_FilterParams);
derror("_Filter: unparsable filter spec: %s",sdata);
}
#else
@@ -3509,12 +3513,18 @@
parsefilterflag(const char* sdata, Specialdata* special)
{
int stat = NC_NOERR;
+ int format;
if(sdata == NULL || strlen(sdata) == 0) return NC_EINVAL;
- stat = NC_parsefilterspec(sdata, &special->_FilterID, &special->nparams, &special->_FilterParams);
+ stat = NC_parsefilterlist(sdata, &format, &special->nfilters, (NC_Filterspec***)&special->_Filters);
if(stat)
derror("Malformed filter spec: %s",sdata);
+ if(format != NC_FILTER_FORMAT_HDF5)
+ derror("Non HDF5 filter format encountered");
+#ifdef GENDEBUG1
+printfilters(special->nfilters,special->_Filters);
+#endif
return stat;
}
#endif
@@ -3590,3 +3600,31 @@
done:
return result;
}
+
+#ifdef GENDEBUG1
+static void
+printfilters(size_t nfilters, NC_ParsedFilterSpec** filters)
+{
+ int i;
+ fprintf(stderr,"xxx: nfilters=%lu: ",(unsigned long)nfilters);
+ for(i=0;ifilterid,sp->format,(unsigned long)sp->nparams,sp->params);
+ if(sp->nparams == 0 || sp->params != NULL) {
+ fprintf(stderr," params={");
+ for(k=0;knparams;k++) {
+ if(i==0) fprintf(stderr,",");
+ fprintf(stderr,"%u",sp->params[i]);
+ }
+ fprintf(stderr,"}");
+ } else
+ fprintf(stderr,"params=NULL");
+ fprintf(stderr,"}");
+ }
+ fprintf(stderr,"\n");
+ fflush(stderr);
+}
+#endif
diff -Nru netcdf-parallel-4.7.3/ncgen/ncgeny.h netcdf-parallel-4.7.4/ncgen/ncgeny.h
--- netcdf-parallel-4.7.3/ncgen/ncgeny.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/ncgeny.h 2020-08-31 10:33:26.000000000 +0000
@@ -106,7 +106,7 @@
union YYSTYPE
{
-#line 149 "ncgen.y" /* yacc.c:1909 */
+#line 152 "ncgen.y" /* yacc.c:1909 */
Symbol* sym;
unsigned long size; /* allow for zero size to indicate e.g. UNLIMITED*/
diff -Nru netcdf-parallel-4.7.3/ncgen/util.c netcdf-parallel-4.7.4/ncgen/util.c
--- netcdf-parallel-4.7.3/ncgen/util.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen/util.c 2020-08-31 10:33:26.000000000 +0000
@@ -117,8 +117,15 @@
reclaimdatalist(data->_Fillvalue);
if(data->_ChunkSizes)
efree(data->_ChunkSizes);
- if(data->_FilterParams)
- efree(data->_FilterParams);
+ if(data->_Filters) {
+ int i;
+ for(i=0;infilters;i++) {
+ NC4_Filterspec* f = (NC4_Filterspec*)data->_Filters[i];
+ efree(f->params);
+ efree(f);
+ }
+ efree(data->_Filters);
+ }
efree(data);
}
diff -Nru netcdf-parallel-4.7.3/ncgen3/Makefile.in netcdf-parallel-4.7.4/ncgen3/Makefile.in
--- netcdf-parallel-4.7.3/ncgen3/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/ncgen3/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -468,8 +468,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -509,11 +511,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/nc_perf/bm_file.c netcdf-parallel-4.7.4/nc_perf/bm_file.c
--- netcdf-parallel-4.7.3/nc_perf/bm_file.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_perf/bm_file.c 2020-08-31 10:33:26.000000000 +0000
@@ -28,38 +28,39 @@
#define MILLION 1000000
#define BAD -99
#define NOMEM -98
-#define MAX_VO 50 /* Max number of var options on command line. */
+#define MAX_VO 255 /* Max number of var options on command line. */
+#define MAX_VO_PRINTED 3
#define MAX_DIMS 7 /* Max dim for variables in input file. */
/* This struct holds data about what options we want to apply to
* variable in the created file. (Chunking, compression, etc.) */
typedef struct {
- int varid;
- int ndims;
- int deflate_num;
- int shuffle;
- size_t chunksize[MAX_DIMS];
- int endian;
- size_t start[MAX_DIMS], count[MAX_DIMS], inc[MAX_DIMS];
+ int varid;
+ int ndims;
+ int deflate_num;
+ int shuffle;
+ size_t chunksize[MAX_DIMS];
+ int endian;
+ size_t start[MAX_DIMS], count[MAX_DIMS], inc[MAX_DIMS];
} VAR_OPTS_T;
/* This macro prints an error message with line number and name of
* test program. */
-#define ERR1(n) do { \
-fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
-fprintf(stderr, "Sorry! Unexpected result, %s, line: %d - %s\n", \
- __FILE__, __LINE__, nc_strerror(n)); \
-return n; \
-} while (0)
+#define ERR1(n) do { \
+ fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
+ fprintf(stderr, "Sorry! Unexpected result, %s, line: %d - %s\n", \
+ __FILE__, __LINE__, nc_strerror(n)); \
+ return n; \
+ } while (0)
#ifdef USE_PARALLEL
/* Error handling code for MPI calls. */
-#define MPIERR(e) do { \
-MPI_Error_string(e, err_buffer, &resultlen); \
-printf("MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
-MPI_Finalize(); \
-return 2; \
-} while (0)
+#define MPIERR(e) do { \
+ MPI_Error_string(e, err_buffer, &resultlen); \
+ printf("MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \
+ MPI_Finalize(); \
+ return 2; \
+ } while (0)
#endif
/* Prototype from tst_utils.c. */
@@ -74,120 +75,120 @@
int *num_steps, int *start_inc, int *slice_len,
size_t *last_count, size_t *start, size_t *count)
{
- int extra_step = 0;
- int total[NC_MAX_VAR_DIMS];
- int total_len;
- int s, d;
-
- /* User has specified start/count/inc for this var. Parallel runs
- * not allowed yet. */
- if (use_scs)
- {
- /* Set the starts and counts for each dim, the len of the slice,
- * the total len of the data, and the total extent of the
- * dataset in each dimension. */
- for (d = 0, *slice_len = 1, total_len = 1; d < vo->ndims; d++)
- {
- start[d] = vo->start[d];
- count[d] = vo->count[d];
- (*slice_len) *= count[d];
- total_len *= dimlen[d];
- }
-
- /* The start increment is provided by the user. */
- *start_inc = vo->inc[0];
-
- /* How many steps to write/read these data? */
- *num_steps = total_len / (*slice_len);
-
- /* Init this for the total extent in each dim. */
- for (d = 0; d < vo->ndims; d++)
- total[d] = 0;
-
- /* Check our numbers if we apply increments to start, and read
- * count, for this many steps. */
- for (s = 0; s < *num_steps; s++)
- {
- for (d = 0; d < vo->ndims; d++)
- {
- total[d] += count[d];
- if (total[d] >= dimlen[d])
- break;
- }
- if (d != vo->ndims)
- break;
- }
-
- /* If the numbers didn't come out clean, then figure out the
- * last set of counts needed to completely read the data. */
- if (s == (*num_steps) - 1)
- *last_count = count[0];
- else
- {
- (*num_steps)++;
- *last_count = dimlen[0] - total[0];
- }
- }
- else
- {
- *start_inc = dimlen[0]/slow_count;
- while (*start_inc * slow_count < dimlen[0])
- (*start_inc)++;
- *slice_len = *start_inc;
- start[0] = *start_inc * my_rank;
- if (start[0] > dimlen[0])
- {
- fprintf(stderr, "slow_count too large for this many processors, "
- "start_inc=%d, slow_count=%d, p=%d, my_rank=%d start[0]=%ld\n",
- *start_inc, slow_count, p, my_rank, start[0]);
- return 2;
- }
- count[0] = *start_inc;
- for (d = 1; d < ndims; d++)
- {
- start[d] = 0;
- count[d] = dimlen[d];
- *slice_len *= dimlen[d];
- }
- *num_steps = (float)dimlen[0] / (*start_inc * p);
- if ((float)dimlen[0] / (*start_inc * p) != dimlen[0] / (*start_inc * p))
- {
- extra_step++;
- (*num_steps)++;
- }
-
- if (p > 1)
- {
- if (!extra_step)
- *last_count = 0;
- else
- {
- int left;
- left = dimlen[0] - (*num_steps - 1) * *start_inc * p;
- if (left > (my_rank + 1) * *start_inc)
- *last_count = *start_inc;
- else
- {
- if (left - my_rank * *start_inc < 0)
- *last_count = 0;
- else
- *last_count = left - my_rank * *start_inc;
- }
- }
- }
- else
- *last_count = dimlen[0] - (*num_steps - 1) * *start_inc;
- }
- return 0;
+ int extra_step = 0;
+ int total[NC_MAX_VAR_DIMS];
+ int total_len;
+ int s, d;
+
+ /* User has specified start/count/inc for this var. Parallel runs
+ * not allowed yet. */
+ if (use_scs)
+ {
+ /* Set the starts and counts for each dim, the len of the slice,
+ * the total len of the data, and the total extent of the
+ * dataset in each dimension. */
+ for (d = 0, *slice_len = 1, total_len = 1; d < vo->ndims; d++)
+ {
+ start[d] = vo->start[d];
+ count[d] = vo->count[d];
+ (*slice_len) *= count[d];
+ total_len *= dimlen[d];
+ }
+
+ /* The start increment is provided by the user. */
+ *start_inc = vo->inc[0];
+
+ /* How many steps to write/read these data? */
+ *num_steps = total_len / (*slice_len);
+
+ /* Init this for the total extent in each dim. */
+ for (d = 0; d < vo->ndims; d++)
+ total[d] = 0;
+
+ /* Check our numbers if we apply increments to start, and read
+ * count, for this many steps. */
+ for (s = 0; s < *num_steps; s++)
+ {
+ for (d = 0; d < vo->ndims; d++)
+ {
+ total[d] += count[d];
+ if (total[d] >= dimlen[d])
+ break;
+ }
+ if (d != vo->ndims)
+ break;
+ }
+
+ /* If the numbers didn't come out clean, then figure out the
+ * last set of counts needed to completely read the data. */
+ if (s == (*num_steps) - 1)
+ *last_count = count[0];
+ else
+ {
+ (*num_steps)++;
+ *last_count = dimlen[0] - total[0];
+ }
+ }
+ else
+ {
+ *start_inc = dimlen[0]/slow_count;
+ while (*start_inc * slow_count < dimlen[0])
+ (*start_inc)++;
+ *slice_len = *start_inc;
+ start[0] = *start_inc * my_rank;
+ if (start[0] > dimlen[0])
+ {
+ fprintf(stderr, "slow_count too large for this many processors, "
+ "start_inc=%d, slow_count=%d, p=%d, my_rank=%d start[0]=%ld\n",
+ *start_inc, slow_count, p, my_rank, start[0]);
+ return 2;
+ }
+ count[0] = *start_inc;
+ for (d = 1; d < ndims; d++)
+ {
+ start[d] = 0;
+ count[d] = dimlen[d];
+ *slice_len *= dimlen[d];
+ }
+ *num_steps = (float)dimlen[0] / (*start_inc * p);
+ if ((float)dimlen[0] / (*start_inc * p) != dimlen[0] / (*start_inc * p))
+ {
+ extra_step++;
+ (*num_steps)++;
+ }
+
+ if (p > 1)
+ {
+ if (!extra_step)
+ *last_count = 0;
+ else
+ {
+ int left;
+ left = dimlen[0] - (*num_steps - 1) * *start_inc * p;
+ if (left > (my_rank + 1) * *start_inc)
+ *last_count = *start_inc;
+ else
+ {
+ if (left - my_rank * *start_inc < 0)
+ *last_count = 0;
+ else
+ *last_count = left - my_rank * *start_inc;
+ }
+ }
+ }
+ else
+ *last_count = dimlen[0] - (*num_steps - 1) * *start_inc;
+ }
+ return 0;
}
/* This function finds the size of a file. */
static size_t
file_size(char* name)
{
- struct stat stbuf;
- stat(name, &stbuf);
- return stbuf.st_size;
+ struct stat stbuf;
+ stat(name, &stbuf);
+ return stbuf.st_size;
}
@@ -196,261 +197,261 @@
static int
check_att(int ncid1, int ncid2, int varid, int a)
{
- int typeid, typeid2;
- size_t len, len2, typelen;
- char name[NC_MAX_NAME + 1];
- void *d = NULL, *d2 = NULL;
- int ret = 0;
-
- /* Check the metadata about the metadata - name, type, length. */
- if ((ret = nc_inq_attname(ncid1, varid, a, name)))
- return ret;
- if ((ret = nc_inq_att(ncid1, varid, name, &typeid, &len)))
- return ret;
- if ((ret = nc_inq_att(ncid2, varid, name, &typeid2, &len2)))
- return ret;
- if (len != len2 || typeid != typeid2)
- return BAD;
- if ((ret = nc_inq_type(ncid1, typeid, NULL, &typelen)))
- return ret;
-
- /* Get the two attributes, if they are non-zero. */
- if (len)
- {
- if(!(d = malloc(typelen * len)))
- return NOMEM;
- if(!(d2 = malloc(typelen * len)))
- {
- ret = NOMEM;
- goto exit;
- }
- if ((ret = nc_get_att(ncid1, varid, name, d)))
- goto exit;
- if ((ret = nc_get_att(ncid2, varid, name, d2)))
- goto exit;
-
- /* Are they the same? */
- if (memcmp(d, d2, typelen * len))
- ret = BAD;
- }
-
- exit:
- /* Free up our resources. */
- if (d)
- free(d);
- if (d2)
- free(d2);
+ int typeid, typeid2;
+ size_t len, len2, typelen;
+ char name[NC_MAX_NAME + 1];
+ void *d = NULL, *d2 = NULL;
+ int ret = 0;
+
+ /* Check the metadata about the metadata - name, type, length. */
+ if ((ret = nc_inq_attname(ncid1, varid, a, name)))
+ return ret;
+ if ((ret = nc_inq_att(ncid1, varid, name, &typeid, &len)))
+ return ret;
+ if ((ret = nc_inq_att(ncid2, varid, name, &typeid2, &len2)))
+ return ret;
+ if (len != len2 || typeid != typeid2)
+ return BAD;
+ if ((ret = nc_inq_type(ncid1, typeid, NULL, &typelen)))
+ return ret;
+
+ /* Get the two attributes, if they are non-zero. */
+ if (len)
+ {
+ if(!(d = malloc(typelen * len)))
+ return NOMEM;
+ if(!(d2 = malloc(typelen * len)))
+ {
+ ret = NOMEM;
+ goto exit;
+ }
+ if ((ret = nc_get_att(ncid1, varid, name, d)))
+ goto exit;
+ if ((ret = nc_get_att(ncid2, varid, name, d2)))
+ goto exit;
+
+ /* Are they the same? */
+ if (memcmp(d, d2, typelen * len))
+ ret = BAD;
+ }
+
+exit:
+ /* Free up our resources. */
+ if (d)
+ free(d);
+ if (d2)
+ free(d2);
- return ret;
+ return ret;
}
/* Do two files contain the same data and metadata? */
static int
-cmp_file(char *file1, char *file2, int *meta_read_us, int *data_read_us,
+cmp_file(char *file1, char *file2, int *meta_read_us, size_t *data_read_us,
int use_par, int par_access, int do_cmp, int p, int my_rank,
int slow_count, int verbose, int num_vo, VAR_OPTS_T *vo, int use_scs)
{
- int ncid1, ncid2;
- int unlimdimid, unlimdimid2;
- char name[NC_MAX_NAME + 1], name2[NC_MAX_NAME + 1];
- size_t len, len2;
+ int ncid1, ncid2;
+ int unlimdimid, unlimdimid2;
+ char name[NC_MAX_NAME + 1], name2[NC_MAX_NAME + 1];
+ size_t len, len2;
#ifdef USE_PARALLEL
- double ftime;
+ double ftime;
#endif
- struct timeval start_time, end_time, diff_time;
- void *data = NULL, *data2 = NULL;
- int a, v, d;
- nc_type xtype, xtype2;
- int nvars, ndims, dimids[NC_MAX_VAR_DIMS], natts, real_ndims;
- int nvars2, ndims2, dimids2[NC_MAX_VAR_DIMS], natts2;
- size_t *count = NULL, *start = NULL;
- int slice_len = 1;
- size_t *dimlen = NULL, type_size = 0;
- size_t last_count;
- int start_inc;
- int num_steps, step;
- int ret = NC_NOERR;
-
- /* Note in the code below I only want to time stuff for file2. */
-
- /* Read the metadata for both files. */
- if (use_par)
- {
+ struct timeval start_time, end_time, diff_time;
+ void *data = NULL, *data2 = NULL;
+ int a, v, d;
+ nc_type xtype, xtype2;
+ int nvars, ndims, dimids[NC_MAX_VAR_DIMS], natts, real_ndims;
+ int nvars2, ndims2, dimids2[NC_MAX_VAR_DIMS], natts2;
+ size_t *count = NULL, *start = NULL;
+ int slice_len = 1;
+ size_t *dimlen = NULL, type_size = 0;
+ size_t last_count;
+ int start_inc;
+ int num_steps, step;
+ int ret = NC_NOERR;
+
+ /* Note in the code below I only want to time stuff for file2. */
+
+ /* Read the metadata for both files. */
+ if (use_par)
+ {
#ifdef USE_PARALLEL
- if ((ret = nc_open_par(file1, 0, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid1)))
- ERR1(ret);
- MPI_Barrier(MPI_COMM_WORLD);
- ftime = MPI_Wtime();
- if ((ret = nc_open_par(file2, 0, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid2)))
- ERR1(ret);
- *meta_read_us += (MPI_Wtime() - ftime) * MILLION;
+ if ((ret = nc_open_par(file1, 0, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid1)))
+ ERR1(ret);
+ MPI_Barrier(MPI_COMM_WORLD);
+ ftime = MPI_Wtime();
+ if ((ret = nc_open_par(file2, 0, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid2)))
+ ERR1(ret);
+ *meta_read_us += (MPI_Wtime() - ftime) * MILLION;
#else
- return NC_EPARINIT;
+ return NC_EPARINIT;
#endif
- }
- else
- {
- if ((ret = nc_open(file1, 0, &ncid1)))
- ERR1(ret);
- if (gettimeofday(&start_time, NULL)) ERR;
- if ((ret = nc_open(file2, 0, &ncid2)))
- ERR1(ret);
- if (gettimeofday(&end_time, NULL)) ERR;
- if (nc4_timeval_subtract(&diff_time, &end_time, &start_time)) ERR;
- *meta_read_us += (int)diff_time.tv_sec * MILLION + (int)diff_time.tv_usec;
- }
- if (verbose)
- printf("%d: reading metadata took %d micro-seconds\n",
- my_rank, *meta_read_us);
-
- /* Check the counts of dims, vars, and atts. */
- if ((ret = nc_inq(ncid1, &ndims, &nvars, &natts, &unlimdimid)))
- ERR1(ret);
- if ((ret = nc_inq(ncid1, &ndims2, &nvars2, &natts2, &unlimdimid2)))
- ERR1(ret);
- if (ndims != ndims2 || nvars != nvars2 || natts != natts2 ||
- unlimdimid != unlimdimid2)
- ERR1(BAD);
-
- /* Check dims. */
- for (d = 0; d < ndims; d++)
- {
- if ((ret = nc_inq_dim(ncid1, d, name, &len)))
- ERR1(ret);
- if ((ret = nc_inq_dim(ncid2, d, name2, &len2)))
- ERR1(ret);
- if (len != len2 || strcmp(name, name2))
- ERR1(BAD);
- }
-
- /* Check global atts. */
- for (a = 0; a < natts; a++)
- if ((ret = check_att(ncid1, ncid2, NC_GLOBAL, a)))
- ERR1(ret);
-
- /* Check the variables. */
- for (v = 0; v < nvars; v++)
- {
- /* Learn about this var in both files. */
- if ((ret = nc_inq_var(ncid1, v, name, &xtype, &ndims, dimids, &natts)))
- return ret;
- if ((ret = nc_inq_var(ncid2, v, name2, &xtype2, &ndims2, dimids2, &natts2)))
- return ret;
-
- /* Check var metadata. */
- if (strcmp(name, name2) || xtype != xtype2 || ndims != ndims2 || natts != natts2)
- return BAD;
- for (d = 0; d < ndims; d++)
- if (dimids[d] != dimids2[d])
- return BAD;
-
- /* Check the attributes. */
- for (a = 0; a < natts; a++)
- if ((ret = check_att(ncid1, ncid2, v, a)))
- ERR1(ret);
-
- /* Check the data, one slice at a time. (slicing along slowest
- * varying dimension.) */
-
- /* Allocate memory for our start and count arrays. If ndims = 0
- this is a scalar, which I will treat as a 1-D array with one
- element. */
- real_ndims = ndims ? ndims : 1;
- if (!(start = malloc(real_ndims * sizeof(size_t))))
- ERR1(NC_ENOMEM);
- if (!(count = malloc(real_ndims * sizeof(size_t))))
- ERR1(NC_ENOMEM);
-
- /* The start array will be all zeros, except the first element,
- which will be the slice number. Count will be the dimension
- size, except for the first element, which will be one, because
- we will copy one slice at a time. For this we need the var
- shape. */
- if (!(dimlen = malloc(real_ndims * sizeof(size_t))))
- ERR1(NC_ENOMEM);
- for (d=0; d MAX_VO)
- return 1;
- if (!(token = strtok_r(str1, COMMA, &saveptr1)))
- break;
- for (ndims = 0, str2 = token; ; str2 = NULL)
- {
- int tmp_int;
- if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
- break;
- if (str2)
- sscanf(subtoken, "%d", &(vo[num_vo].varid));
- else if (!got_z++)
- sscanf(subtoken, "%d", &(vo[num_vo].deflate_num));
- else if (!got_s++)
- sscanf(subtoken, "%d", &(vo[num_vo].shuffle));
- else
- {
- sscanf(subtoken, "%d", &tmp_int);
- vo[num_vo].chunksize[ndims++] = tmp_int;
- }
- }
- vo[num_vo].ndims = ndims;
+ int got_z = 0, got_s = 0;
+ if (num_vo > MAX_VO)
+ return 1;
+ if (!(token = strtok_r(str1, COMMA, &saveptr1)))
+ break;
+ for (ndims = 0, str2 = token; ; str2 = NULL)
+ {
+ int tmp_int;
+ if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
+ break;
+ if (str2)
+ sscanf(subtoken, "%d", &(vo[num_vo].varid));
+ else if (!got_z++)
+ sscanf(subtoken, "%d", &(vo[num_vo].deflate_num));
+ else if (!got_s++)
+ sscanf(subtoken, "%d", &(vo[num_vo].shuffle));
+ else
+ {
+ sscanf(subtoken, "%d", &tmp_int);
+ vo[num_vo].chunksize[ndims++] = tmp_int;
+ }
+ }
+ vo[num_vo].ndims = ndims;
}
break;
- case 't':
+ case 't':
for (num_vo = 0, str1 = optarg; ; num_vo++, str1 = NULL)
{
- if (num_vo > MAX_VO)
- return 1;
- if (!(token = strtok_r(str1, COMMA, &saveptr1)))
- break;
- for (ndims = 0, str2 = token; ; str2 = NULL)
- {
- if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
- break;
- if (str2)
- sscanf(subtoken, "%d", &(vo[num_vo].varid));
- else
- sscanf(subtoken, "%ld", &(vo[num_vo].start[ndims++]));
- }
- vo[num_vo].ndims = ndims;
+ if (num_vo > MAX_VO)
+ return 1;
+ if (!(token = strtok_r(str1, COMMA, &saveptr1)))
+ break;
+ for (ndims = 0, str2 = token; ; str2 = NULL)
+ {
+ if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
+ break;
+ if (str2)
+ sscanf(subtoken, "%d", &(vo[num_vo].varid));
+ else
+ sscanf(subtoken, "%ld", &(vo[num_vo].start[ndims++]));
+ }
+ vo[num_vo].ndims = ndims;
}
use_scs++;
break;
- case 'u':
+ case 'u':
for (num_vo = 0, str1 = optarg; ; num_vo++, str1 = NULL)
{
- if (num_vo > MAX_VO)
- return 1;
- if (!(token = strtok_r(str1, COMMA, &saveptr1)))
- break;
- for (ndims = 0, str2 = token; ; str2 = NULL)
- {
- if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
- break;
- if (str2)
- sscanf(subtoken, "%d", &(vo[num_vo].varid));
- else
- sscanf(subtoken, "%ld", &(vo[num_vo].count[ndims++]));
- }
- vo[num_vo].ndims = ndims;
+ if (num_vo > MAX_VO)
+ return 1;
+ if (!(token = strtok_r(str1, COMMA, &saveptr1)))
+ break;
+ for (ndims = 0, str2 = token; ; str2 = NULL)
+ {
+ if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
+ break;
+ if (str2)
+ sscanf(subtoken, "%d", &(vo[num_vo].varid));
+ else
+ sscanf(subtoken, "%ld", &(vo[num_vo].count[ndims++]));
+ }
+ vo[num_vo].ndims = ndims;
}
break;
- case 'r':
+ case 'r':
for (num_vo = 0, str1 = optarg; ; num_vo++, str1 = NULL)
{
- if (num_vo > MAX_VO)
- return 1;
- if (!(token = strtok_r(str1, COMMA, &saveptr1)))
- break;
- for (ndims = 0, str2 = token; ; str2 = NULL)
- {
- if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
- break;
- if (str2)
- sscanf(subtoken, "%d", &(vo[num_vo].varid));
- else
- sscanf(subtoken, "%ld", &(vo[num_vo].inc[ndims++]));
- }
- vo[num_vo].ndims = ndims;
+ if (num_vo > MAX_VO)
+ return 1;
+ if (!(token = strtok_r(str1, COMMA, &saveptr1)))
+ break;
+ for (ndims = 0, str2 = token; ; str2 = NULL)
+ {
+ if (!(subtoken = strtok_r(str2, COLON, &saveptr2)))
+ break;
+ if (str2)
+ sscanf(subtoken, "%d", &(vo[num_vo].varid));
+ else
+ sscanf(subtoken, "%ld", &(vo[num_vo].inc[ndims++]));
+ }
+ vo[num_vo].ndims = ndims;
}
break;
- case 'd':
+ case 'd':
doublecheck++;
break;
- case 'm':
+ case 'm':
do_cmp++;
doublecheck++;
break;
- case 'p':
+ case 'p':
use_par++;
break;
- case 'i':
+ case 'i':
mpiio++;
break;
- case 's':
+ case 's':
sscanf(optarg, "%d", &slow_count);
break;
- case 'e':
+ case 'e':
sscanf(optarg, "%d", &endianness);
break;
- case 'l':
+ case 'l':
convert_unlim++;
break;
- case '?':
+ case '?':
usage();
return 1;
- }
+ }
+
+ if (use_scs)
+ {
+ if (use_par)
+ {
+ printf("Can't use start/count/slice for parallel runs yet!\n");
+ return 2;
+ }
+ }
+ else
+ {
+ if (slow_count < p)
+ slow_count = p;
+ if (slow_count % p)
+ {
+ printf("slow_count must be even multiple of p\n");
+ return 2;
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ /* If no file arguments left, report and exit */
+ if (argc < 1)
+ {
+ printf("no file specified\n");
+ return 0;
+ }
+
+ /* Get the name of the file to copy. */
+ strcpy(file_in, argv[0]);
+
+ /* Verbose mode seems a bit stupid, but it's really useful when you
+ * are running in batch mode on a supercomputer, and can't use
+ * anything else to figure out what the heck is going on. */
+ if (verbose && !my_rank)
+ {
+ printf("copying %s to %s on %d processors with endianness %d and...\n",
+ file_in, file_out, p, endianness);
+ if (use_scs)
+ for (v = 0; v < num_vo; v++)
+ {
+ printf("options for var %d:\n", vo[v].varid);
+ for (d = 0; d < vo[v].ndims; d++)
+ printf("start[%d]=%ld, count[%d]=%ld, inc[%d]=%ld\n",
+ d, vo[v].start[d], d, vo[v].count[d], d, vo[v].inc[d]);
+ }
+ else
+ printf("slow_count=%d, doublecheck=%d\n", slow_count, doublecheck);
+ }
+
+ /* Copy the file, keeping track of the read and write times for metadata and data. */
+ if ((ret = copy_file(file_in, file_out, cmode, num_vo, vo, &meta_read_us, &meta_write_us,
+ &data_read_us, &data_write_us, &in_format, use_par, par_access,
+ &num_bytes, p, my_rank, slow_count, verbose, use_scs, endianness,
+ convert_unlim)))
+ return ret;
+
+ /* If the user wants a double check, make sure the data in the new
+ * file is exactly the same. */
+ if (doublecheck)
+ {
+ /* We need a string long enough for the copy command. */
+ char cmd[NC_MAX_NAME * 2 + 5];
- if (use_scs)
- {
- if (use_par)
- {
- printf("Can't use start/count/slice for parallel runs yet!\n");
- return 2;
- }
- }
- else
- {
- if (slow_count < p)
- slow_count = p;
- if (slow_count % p)
- {
- printf("slow_count must be even multiple of p\n");
- return 2;
- }
- }
-
- argc -= optind;
- argv += optind;
-
- /* If no file arguments left, report and exit */
- if (argc < 1)
- {
- printf("no file specified\n");
- return 0;
- }
-
- /* Get the name of the file to copy. */
- strcpy(file_in, argv[0]);
-
- /* Verbose mode seems a bit stupid, but it's really useful when you
- * are running in batch mode on a supercomputer, and can't use
- * anything else to figure out what the heck is going on. */
- if (verbose && !my_rank)
- {
- printf("copying %s to %s on %d processors with endianness %d and...\n",
- file_in, file_out, p, endianness);
- if (use_scs)
- for (v = 0; v < num_vo; v++)
- {
- printf("options for var %d:\n", vo[v].varid);
- for (d = 0; d < vo[v].ndims; d++)
- printf("start[%d]=%ld, count[%d]=%ld, inc[%d]=%ld\n",
- d, vo[v].start[d], d, vo[v].count[d], d, vo[v].inc[d]);
- }
- else
- printf("slow_count=%d, doublecheck=%d\n", slow_count, doublecheck);
- }
-
- /* Copy the file, keeping track of the read and write times for metadata and data. */
- if ((ret = copy_file(file_in, file_out, cmode, num_vo, vo, &meta_read_us, &meta_write_us,
- &data_read_us, &data_write_us, &in_format, use_par, par_access,
- &num_bytes, p, my_rank, slow_count, verbose, use_scs, endianness,
- convert_unlim)))
- return ret;
-
- /* If the user wants a double check, make sure the data in the new
- * file is exactly the same. */
- if (doublecheck)
- {
#ifdef USE_PARALLEL
- MPI_Barrier(MPI_COMM_WORLD);
+ MPI_Barrier(MPI_COMM_WORLD);
#endif
- if ((ret = cmp_file(file_in, file_out, &meta_read2_us, &data_read2_us,
- use_par, par_access, do_cmp, p, my_rank, slow_count,
- verbose, num_vo, vo, use_scs)))
- return ret;
- }
+ /* Create a copy of file_out. This will defeat any buffering
+ * that may exist from the fact that we just wrote file_out. */
+ sprintf(file_out_2, "tst_copy_%s", file_out);
+ sprintf(cmd, "cp %s %s\n", file_out, file_out_2);
+ system(cmd);
+
+ if ((ret = cmp_file(file_in, file_out_2, &meta_read2_us, &data_read2_us,
+ use_par, par_access, do_cmp, p, my_rank, slow_count,
+ verbose, num_vo, vo, use_scs)))
+ return ret;
+ }
- if (use_par)
- {
+ if (use_par)
+ {
#ifdef USE_PARALLEL
- MPI_Reduce(&meta_read_us, &tmeta_read_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
- MPI_Reduce(&meta_write_us, &tmeta_write_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
- MPI_Reduce(&data_read_us, &tdata_read_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
- MPI_Reduce(&data_write_us, &tdata_write_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
- MPI_Reduce(&data_read2_us, &tdata_read2_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
+ MPI_Reduce(&meta_read_us, &tmeta_read_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
+ MPI_Reduce(&meta_write_us, &tmeta_write_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
+ MPI_Reduce(&data_read_us, &tdata_read_us, 1, MPI_OFFSET, MPI_MAX, 0, MPI_COMM_WORLD);
+ MPI_Reduce(&data_write_us, &tdata_write_us, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);
+ MPI_Reduce(&data_read2_us, &tdata_read2_us, 1, MPI_OFFSET, MPI_MAX, 0, MPI_COMM_WORLD);
#else
- return NC_EPARINIT;
+ return NC_EPARINIT;
#endif
- }
- else
- {
- tmeta_read_us = meta_read_us;
- tmeta_write_us = meta_write_us;
- tdata_read_us = data_read_us;
- tdata_write_us = data_write_us;
- tmeta_read2_us = meta_read2_us;
- tdata_read2_us = data_read2_us;
- }
-
- if (verbose)
- printf("num_bytes=%lld tdata_read_us=%d\n", num_bytes, tdata_read_us);
-
- read_rate = (float)num_bytes/((float)tdata_read_us/p);
- write_rate = (float)num_bytes/((float)tdata_write_us/p);
- reread_rate = (float)num_bytes/((float)tdata_read2_us/p);
- if (verbose)
- printf("%d: read rate %g, write rate %g, reread_rate %g\n", my_rank, read_rate,
- write_rate, reread_rate);
-
- /* Print some output. */
- if (!my_rank)
- {
- /* Does the user want a text header for the data? */
- if (header)
- {
- printf("input format, output_format, input size, output size, meta read time, "
- "meta write time, data read time, data write time, enddianness, ");
- if (doublecheck)
- printf("metadata reread time, data reread time, read rate, "
- "write rate, reread rate, ");
- else
- printf("read rate, write rate, ");
- if (use_par)
- printf("num_proc, ");
- printf("deflate, shuffle, chunksize[0], chunksize[1], chunksize[2], "
- "chunksize[3]\n");
- }
-
- printf("%d, %d, %ld, %ld, %d, %d, %d, %d, %d, ", in_format, out_format, file_size(file_in),
- file_size(file_out), tmeta_read_us, tmeta_write_us, tdata_read_us, tdata_write_us,
- endianness);
- if (doublecheck)
- printf("%d, %d, %g, %g, %g, ", tmeta_read2_us, tdata_read2_us, read_rate, write_rate,
- reread_rate);
- else
- printf("%g, %g, ", read_rate, write_rate);
- if (use_par)
- printf("%d, ", p);
- for (o1 = 0; o1 < num_vo; o1++)
- {
- printf("%d, %d, %d, %d, %d, %d ", vo[o1].deflate_num, vo[o1].shuffle,
- (int)vo[o1].chunksize[0], (int)vo[o1].chunksize[1], (int)vo[o1].chunksize[2], (int)vo[o1].chunksize[3]);
- if (o1 != num_vo - 1)
- printf(", ");
- }
- printf("\n");
- }
+ }
+ else
+ {
+ tmeta_read_us = meta_read_us;
+ tmeta_write_us = meta_write_us;
+ tdata_read_us = data_read_us;
+ tdata_write_us = data_write_us;
+ tmeta_read2_us = meta_read2_us;
+ tdata_read2_us = data_read2_us;
+ }
+
+ if (verbose)
+ printf("num_bytes=%g tdata_read_us=%ld\n", num_bytes, tdata_read_us);
+
+ read_rate = num_bytes/((float)tdata_read_us/p);
+ write_rate = num_bytes/((float)tdata_write_us/p);
+ reread_rate = num_bytes/((float)tdata_read2_us/p);
+ if (verbose)
+ printf("%d: read rate %g, write rate %g, reread_rate %g\n", my_rank, read_rate,
+ write_rate, reread_rate);
+
+ /* Print some output. */
+ if (!my_rank)
+ {
+ /* Does the user want a text header for the data? */
+ if (header)
+ {
+ printf("input format, output_format, input size, output size, meta read time, "
+ "meta write time, data read time, data write time, enddianness, ");
+ if (doublecheck)
+ printf("metadata reread time, data reread time, read rate, "
+ "write rate, reread rate, ");
+ else
+ printf("read rate, write rate, ");
+ if (use_par)
+ printf("num_proc, ");
+ printf("deflate, shuffle, chunksize[0], chunksize[1], chunksize[2], "
+ "chunksize[3]\n");
+ }
+
+ printf("%d, %d, %ld, %ld, %d, %d, %ld, %d, %d, ", in_format, out_format, file_size(file_in),
+ file_size(file_out), tmeta_read_us, tmeta_write_us, tdata_read_us, tdata_write_us,
+ endianness);
+ if (doublecheck)
+ printf("%d, %ld, %g, %g, %g, ", tmeta_read2_us, tdata_read2_us, read_rate, write_rate,
+ reread_rate);
+ else
+ printf("%g, %g, ", read_rate, write_rate);
+ if (use_par)
+ printf("%d, ", p);
+ for (o1 = 0; o1 < num_vo; o1++)
+ {
+ printf("%d, %d, %d, %d, %d, %d ", vo[o1].deflate_num, vo[o1].shuffle,
+ (int)vo[o1].chunksize[0], (int)vo[o1].chunksize[1], (int)vo[o1].chunksize[2], (int)vo[o1].chunksize[3]);
+ if (o1 >= MAX_VO_PRINTED)
+ break;
+ if (o1 != num_vo - 1)
+ printf(", ");
+ }
+ printf("\n");
+ }
#ifdef USE_PARALLEL
- MPI_Finalize();
+ MPI_Finalize();
#endif
- FINAL_RESULTS_QUIET;
+ FINAL_RESULTS_QUIET;
}
diff -Nru netcdf-parallel-4.7.3/nc_perf/Makefile.am netcdf-parallel-4.7.4/nc_perf/Makefile.am
--- netcdf-parallel-4.7.3/nc_perf/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_perf/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -17,10 +17,10 @@
AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la
LDADD = ${top_builddir}/liblib/libnetcdf.la
-check_PROGRAMS = tst_create_files bm_file tst_chunks3 tst_ar4 \
-tst_ar4_3d tst_ar4_4d bm_many_objs tst_h_many_atts bm_many_atts \
-tst_files2 tst_files3 tst_mem tst_knmi bm_netcdf4_recs tst_wrf_reads \
-tst_attsperf bigmeta openbigmeta
+check_PROGRAMS = tst_create_files bm_file tst_chunks3 tst_ar4 \
+tst_ar4_3d tst_ar4_4d bm_many_objs tst_h_many_atts bm_many_atts \
+tst_files2 tst_files3 tst_mem tst_mem1 tst_knmi bm_netcdf4_recs \
+tst_wrf_reads tst_attsperf bigmeta openbigmeta tst_bm_rando
bm_file_SOURCES = bm_file.c tst_utils.c
bm_netcdf4_recs_SOURCES = bm_netcdf4_recs.c tst_utils.c
@@ -33,10 +33,11 @@
tst_h_many_atts_SOURCES = tst_h_many_atts.c tst_utils.c
tst_knmi_SOURCES = tst_knmi.c tst_utils.c
tst_wrf_reads_SOURCES = tst_wrf_reads.c tst_utils.c
+tst_bm_rando_SOURCES = tst_bm_rando.c tst_utils.c
-TESTS = tst_ar4_3d tst_create_files tst_files3 tst_mem run_knmi_bm.sh \
-tst_wrf_reads tst_attsperf perftest.sh run_tst_chunks.sh \
-run_bm_elena.sh
+TESTS = tst_ar4_3d tst_create_files tst_files3 tst_mem tst_mem1 \
+run_knmi_bm.sh tst_wrf_reads tst_attsperf perftest.sh \
+run_tst_chunks.sh run_bm_elena.sh tst_bm_rando
run_bm_elena.log: tst_create_files.log
diff -Nru netcdf-parallel-4.7.3/nc_perf/Makefile.in netcdf-parallel-4.7.4/nc_perf/Makefile.in
--- netcdf-parallel-4.7.3/nc_perf/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_perf/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -112,14 +112,14 @@
tst_ar4_4d$(EXEEXT) bm_many_objs$(EXEEXT) \
tst_h_many_atts$(EXEEXT) bm_many_atts$(EXEEXT) \
tst_files2$(EXEEXT) tst_files3$(EXEEXT) tst_mem$(EXEEXT) \
- tst_knmi$(EXEEXT) bm_netcdf4_recs$(EXEEXT) \
+ tst_mem1$(EXEEXT) tst_knmi$(EXEEXT) bm_netcdf4_recs$(EXEEXT) \
tst_wrf_reads$(EXEEXT) tst_attsperf$(EXEEXT) bigmeta$(EXEEXT) \
- openbigmeta$(EXEEXT)
+ openbigmeta$(EXEEXT) tst_bm_rando$(EXEEXT)
TESTS = tst_ar4_3d$(EXEEXT) tst_create_files$(EXEEXT) \
- tst_files3$(EXEEXT) tst_mem$(EXEEXT) run_knmi_bm.sh \
- tst_wrf_reads$(EXEEXT) tst_attsperf$(EXEEXT) perftest.sh \
- run_tst_chunks.sh run_bm_elena.sh $(am__append_2) \
- $(am__append_3)
+ tst_files3$(EXEEXT) tst_mem$(EXEEXT) tst_mem1$(EXEEXT) \
+ run_knmi_bm.sh tst_wrf_reads$(EXEEXT) tst_attsperf$(EXEEXT) \
+ perftest.sh run_tst_chunks.sh run_bm_elena.sh \
+ tst_bm_rando$(EXEEXT) $(am__append_2) $(am__append_3)
@BUILD_UTILITIES_TRUE@am__append_2 = run_bm_test1.sh run_bm_test2.sh
# This will run a parallel I/O benchmark for parallel builds.
@@ -182,6 +182,10 @@
tst_attsperf_OBJECTS = tst_attsperf.$(OBJEXT)
tst_attsperf_LDADD = $(LDADD)
tst_attsperf_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+am_tst_bm_rando_OBJECTS = tst_bm_rando.$(OBJEXT) tst_utils.$(OBJEXT)
+tst_bm_rando_OBJECTS = $(am_tst_bm_rando_OBJECTS)
+tst_bm_rando_LDADD = $(LDADD)
+tst_bm_rando_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
tst_chunks3_SOURCES = tst_chunks3.c
tst_chunks3_OBJECTS = tst_chunks3.$(OBJEXT)
tst_chunks3_LDADD = $(LDADD)
@@ -211,6 +215,10 @@
tst_mem_OBJECTS = tst_mem.$(OBJEXT)
tst_mem_LDADD = $(LDADD)
tst_mem_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+tst_mem1_SOURCES = tst_mem1.c
+tst_mem1_OBJECTS = tst_mem1.$(OBJEXT)
+tst_mem1_LDADD = $(LDADD)
+tst_mem1_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
am_tst_wrf_reads_OBJECTS = tst_wrf_reads.$(OBJEXT) tst_utils.$(OBJEXT)
tst_wrf_reads_OBJECTS = $(am_tst_wrf_reads_OBJECTS)
tst_wrf_reads_LDADD = $(LDADD)
@@ -235,10 +243,11 @@
./$(DEPDIR)/bm_netcdf4_recs.Po ./$(DEPDIR)/openbigmeta.Po \
./$(DEPDIR)/tst_ar4.Po ./$(DEPDIR)/tst_ar4_3d.Po \
./$(DEPDIR)/tst_ar4_4d.Po ./$(DEPDIR)/tst_attsperf.Po \
- ./$(DEPDIR)/tst_chunks3.Po ./$(DEPDIR)/tst_create_files.Po \
- ./$(DEPDIR)/tst_files2.Po ./$(DEPDIR)/tst_files3.Po \
- ./$(DEPDIR)/tst_h_many_atts.Po ./$(DEPDIR)/tst_knmi.Po \
- ./$(DEPDIR)/tst_mem.Po ./$(DEPDIR)/tst_utils.Po \
+ ./$(DEPDIR)/tst_bm_rando.Po ./$(DEPDIR)/tst_chunks3.Po \
+ ./$(DEPDIR)/tst_create_files.Po ./$(DEPDIR)/tst_files2.Po \
+ ./$(DEPDIR)/tst_files3.Po ./$(DEPDIR)/tst_h_many_atts.Po \
+ ./$(DEPDIR)/tst_knmi.Po ./$(DEPDIR)/tst_mem.Po \
+ ./$(DEPDIR)/tst_mem1.Po ./$(DEPDIR)/tst_utils.Po \
./$(DEPDIR)/tst_wrf_reads.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -262,17 +271,17 @@
SOURCES = bigmeta.c $(bm_file_SOURCES) $(bm_many_atts_SOURCES) \
$(bm_many_objs_SOURCES) $(bm_netcdf4_recs_SOURCES) \
openbigmeta.c $(tst_ar4_SOURCES) $(tst_ar4_3d_SOURCES) \
- $(tst_ar4_4d_SOURCES) tst_attsperf.c tst_chunks3.c \
- tst_create_files.c $(tst_files2_SOURCES) tst_files3.c \
- $(tst_h_many_atts_SOURCES) $(tst_knmi_SOURCES) tst_mem.c \
- $(tst_wrf_reads_SOURCES)
+ $(tst_ar4_4d_SOURCES) tst_attsperf.c $(tst_bm_rando_SOURCES) \
+ tst_chunks3.c tst_create_files.c $(tst_files2_SOURCES) \
+ tst_files3.c $(tst_h_many_atts_SOURCES) $(tst_knmi_SOURCES) \
+ tst_mem.c tst_mem1.c $(tst_wrf_reads_SOURCES)
DIST_SOURCES = bigmeta.c $(bm_file_SOURCES) $(bm_many_atts_SOURCES) \
$(bm_many_objs_SOURCES) $(bm_netcdf4_recs_SOURCES) \
openbigmeta.c $(tst_ar4_SOURCES) $(tst_ar4_3d_SOURCES) \
- $(tst_ar4_4d_SOURCES) tst_attsperf.c tst_chunks3.c \
- tst_create_files.c $(tst_files2_SOURCES) tst_files3.c \
- $(tst_h_many_atts_SOURCES) $(tst_knmi_SOURCES) tst_mem.c \
- $(tst_wrf_reads_SOURCES)
+ $(tst_ar4_4d_SOURCES) tst_attsperf.c $(tst_bm_rando_SOURCES) \
+ tst_chunks3.c tst_create_files.c $(tst_files2_SOURCES) \
+ tst_files3.c $(tst_h_many_atts_SOURCES) $(tst_knmi_SOURCES) \
+ tst_mem.c tst_mem1.c $(tst_wrf_reads_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -570,8 +579,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -611,11 +622,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -722,8 +733,9 @@
tst_h_many_atts_SOURCES = tst_h_many_atts.c tst_utils.c
tst_knmi_SOURCES = tst_knmi.c tst_utils.c
tst_wrf_reads_SOURCES = tst_wrf_reads.c tst_utils.c
-EXTRA_DIST = run_par_bm_test.sh.in run_knmi_bm.sh \
-perftest.sh run_bm_test1.sh run_bm_test2.sh \
+tst_bm_rando_SOURCES = tst_bm_rando.c tst_utils.c
+EXTRA_DIST = run_par_bm_test.sh.in run_knmi_bm.sh perftest.sh \
+run_bm_test1.sh run_bm_test2.sh run_tst_chunks.sh run_bm_elena.sh \
CMakeLists.txt
CLEANFILES = tst_*.nc bigmeta.nc bigvars.nc floats*.nc \
@@ -816,6 +828,10 @@
@rm -f tst_attsperf$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_attsperf_OBJECTS) $(tst_attsperf_LDADD) $(LIBS)
+tst_bm_rando$(EXEEXT): $(tst_bm_rando_OBJECTS) $(tst_bm_rando_DEPENDENCIES) $(EXTRA_tst_bm_rando_DEPENDENCIES)
+ @rm -f tst_bm_rando$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_bm_rando_OBJECTS) $(tst_bm_rando_LDADD) $(LIBS)
+
tst_chunks3$(EXEEXT): $(tst_chunks3_OBJECTS) $(tst_chunks3_DEPENDENCIES) $(EXTRA_tst_chunks3_DEPENDENCIES)
@rm -f tst_chunks3$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_chunks3_OBJECTS) $(tst_chunks3_LDADD) $(LIBS)
@@ -844,6 +860,10 @@
@rm -f tst_mem$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_mem_OBJECTS) $(tst_mem_LDADD) $(LIBS)
+tst_mem1$(EXEEXT): $(tst_mem1_OBJECTS) $(tst_mem1_DEPENDENCIES) $(EXTRA_tst_mem1_DEPENDENCIES)
+ @rm -f tst_mem1$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_mem1_OBJECTS) $(tst_mem1_LDADD) $(LIBS)
+
tst_wrf_reads$(EXEEXT): $(tst_wrf_reads_OBJECTS) $(tst_wrf_reads_DEPENDENCIES) $(EXTRA_tst_wrf_reads_DEPENDENCIES)
@rm -f tst_wrf_reads$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_wrf_reads_OBJECTS) $(tst_wrf_reads_LDADD) $(LIBS)
@@ -864,6 +884,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_ar4_3d.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_ar4_4d.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_attsperf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_bm_rando.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_chunks3.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_create_files.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_files2.Po@am__quote@ # am--include-marker
@@ -871,6 +892,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_h_many_atts.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_knmi.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_mem.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_mem1.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_utils.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_wrf_reads.Po@am__quote@ # am--include-marker
@@ -1136,6 +1158,13 @@
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst_mem1.log: tst_mem1$(EXEEXT)
+ @p='tst_mem1$(EXEEXT)'; \
+ b='tst_mem1'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
tst_wrf_reads.log: tst_wrf_reads$(EXEEXT)
@p='tst_wrf_reads$(EXEEXT)'; \
b='tst_wrf_reads'; \
@@ -1150,6 +1179,13 @@
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+tst_bm_rando.log: tst_bm_rando$(EXEEXT)
+ @p='tst_bm_rando$(EXEEXT)'; \
+ b='tst_bm_rando'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
.sh.log:
@p='$<'; \
$(am__set_b); \
@@ -1275,6 +1311,7 @@
-rm -f ./$(DEPDIR)/tst_ar4_3d.Po
-rm -f ./$(DEPDIR)/tst_ar4_4d.Po
-rm -f ./$(DEPDIR)/tst_attsperf.Po
+ -rm -f ./$(DEPDIR)/tst_bm_rando.Po
-rm -f ./$(DEPDIR)/tst_chunks3.Po
-rm -f ./$(DEPDIR)/tst_create_files.Po
-rm -f ./$(DEPDIR)/tst_files2.Po
@@ -1282,6 +1319,7 @@
-rm -f ./$(DEPDIR)/tst_h_many_atts.Po
-rm -f ./$(DEPDIR)/tst_knmi.Po
-rm -f ./$(DEPDIR)/tst_mem.Po
+ -rm -f ./$(DEPDIR)/tst_mem1.Po
-rm -f ./$(DEPDIR)/tst_utils.Po
-rm -f ./$(DEPDIR)/tst_wrf_reads.Po
-rm -f Makefile
@@ -1339,6 +1377,7 @@
-rm -f ./$(DEPDIR)/tst_ar4_3d.Po
-rm -f ./$(DEPDIR)/tst_ar4_4d.Po
-rm -f ./$(DEPDIR)/tst_attsperf.Po
+ -rm -f ./$(DEPDIR)/tst_bm_rando.Po
-rm -f ./$(DEPDIR)/tst_chunks3.Po
-rm -f ./$(DEPDIR)/tst_create_files.Po
-rm -f ./$(DEPDIR)/tst_files2.Po
@@ -1346,6 +1385,7 @@
-rm -f ./$(DEPDIR)/tst_h_many_atts.Po
-rm -f ./$(DEPDIR)/tst_knmi.Po
-rm -f ./$(DEPDIR)/tst_mem.Po
+ -rm -f ./$(DEPDIR)/tst_mem1.Po
-rm -f ./$(DEPDIR)/tst_utils.Po
-rm -f ./$(DEPDIR)/tst_wrf_reads.Po
-rm -f Makefile
diff -Nru netcdf-parallel-4.7.3/nc_perf/tst_bm_rando.c netcdf-parallel-4.7.4/nc_perf/tst_bm_rando.c
--- netcdf-parallel-4.7.3/nc_perf/tst_bm_rando.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_perf/tst_bm_rando.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,146 @@
+/*
+ Copyright 2019, UCAR/Unidata
+ See COPYRIGHT file for copying and redistribution conditions.
+
+ This program benchmarks random access to chunked data.
+
+ Ed Hartnett 11/25/19
+*/
+
+#include
+#include
+#include
+#include /* Extra high precision time info. */
+#include
+#include
+#include
+#include
+
+/* #define FILE_NAME "gfs.t00z.sfcf024.nc" */
+#define FILE_NAME "tst_bm_rando.nc"
+#define MILLION 1000000
+#define NDIM3 3
+
+/* These dim lengths taken from the current NOAA GFS surface data. */
+/* #define DIM1_LEN 3072 */
+/* #define DIM2_LEN 1536 */
+#define DIM1_LEN 512
+#define DIM2_LEN 512
+
+#define DIM0_NAME "unlimited"
+#define DIM1_NAME "x"
+#define DIM2_NAME "y"
+#define NUM_VAR 10
+#define NUM_REC 100
+#define NUM_TRY 10000
+#define NUM_CACHE_SETTING 3
+
+/* Prototype from tst_utils.c. */
+int nc4_timeval_subtract(struct timeval *result, struct timeval *x,
+ struct timeval *y);
+int
+main(int argc, char **argv)
+{
+ printf("Benchmarking random access to file.\n");
+ printf("Reading a file randomly...\n");
+ {
+ int ncid;
+ int dimid[NDIM3];
+ int varid[NUM_VAR];
+ size_t chunksize[NDIM3] = {1, 512, 512};
+ char name[NC_MAX_NAME + 1];
+ size_t start[NDIM3] = {0, 0, 0};
+ size_t count[NDIM3] = {1, DIM1_LEN, DIM2_LEN};
+ float *data;
+ float *data_in;
+ size_t size[NUM_CACHE_SETTING] = {4194304, (4194304), (4194304)};
+ /* size_t size[NUM_CACHE_SETTING] = {4194304, (4194304 * 4), (4194304 * 16)}; */
+ size_t nelems[NUM_CACHE_SETTING] = {1009, 4133, 16141};
+ /* size_t nelems[NUM_CACHE_SETTING] = {1009, 1009, 1009}; */
+ float preemption[NUM_CACHE_SETTING] = {0.75f, 0.75f, 0.75f};
+
+ struct timeval start_time, end_time, diff_time;
+ float read_us;
+
+ int v, d, t, c;
+
+ /* Set random number seed. */
+ srand(time(NULL));
+
+ /* Create the file. */
+ if (nc_create(FILE_NAME, NC_CLOBBER|NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM0_NAME, NC_UNLIMITED, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimid[1])) ERR;
+ if (nc_def_dim(ncid, DIM2_NAME, DIM2_LEN, &dimid[2])) ERR;
+ for (v = 0; v < NUM_VAR; v++)
+ {
+ sprintf(name, "var_%d", v);
+ if (nc_def_var(ncid, name, NC_FLOAT, NDIM3, dimid, &varid[v])) ERR;
+ if (nc_def_var_chunking(ncid, v, NC_CHUNKED, chunksize)) ERR;
+ }
+ if (!(data = malloc(DIM1_LEN * DIM2_LEN * sizeof(float)))) ERR;
+ for (d = 0; d < DIM1_LEN * DIM2_LEN; d++)
+ data[d] = d + 1.0f/(float)(rand()%1000);
+ for (v = 0; v < NUM_VAR; v++)
+ {
+ for (start[0] = 0; start[0] < NUM_REC; start[0]++)
+ {
+ if (nc_put_vara_float(ncid, v, start, count, data)) ERR;
+ }
+ }
+ if (nc_close(ncid)) ERR;
+ free(data);
+ if (!(data_in = malloc(DIM1_LEN * DIM2_LEN * sizeof(float)))) ERR;
+
+ /* nc_set_log_level(3); */
+ printf("size\tnelems\tpreemption\tread time(s)\n");
+ for (c = 0; c < NUM_CACHE_SETTING; c++)
+ {
+ char cmd[NC_MAX_NAME * 2 + 20];
+ char file_2[NC_MAX_NAME + 1];
+
+ if (c)
+ {
+ /* Create a copy of file_out. This will defeat any OS
+ * buffering. */
+ sprintf(file_2, "tst_copy_%d_%s", c, FILE_NAME);
+ sprintf(cmd, "cp %s %s\n", FILE_NAME, file_2);
+ system(cmd);
+ }
+ else
+ strcpy(file_2, FILE_NAME);
+
+ /* Start timer. */
+ if (gettimeofday(&start_time, NULL)) ERR;
+
+ /* Set cache settings. */
+ if (nc_set_chunk_cache(size[c], nelems[c], preemption[c])) ERR;
+
+ /* Open the file. */
+ if (nc_open(file_2, NC_NOWRITE, &ncid)) ERR;
+
+ /* Read a random record of a random var. */
+ for (t = 0; t < NUM_TRY; t++)
+ {
+ int var = rand() % NUM_VAR;
+ start[0] = rand() % NUM_REC;
+ if (nc_get_vara_float(ncid, var, start, count, data_in)) ERR;
+ }
+
+ /* Close the file. */
+ if (nc_close(ncid)) ERR;
+
+ /* Stop timer. */
+ if (gettimeofday(&end_time, NULL)) ERR;
+ if (nc4_timeval_subtract(&diff_time, &end_time, &start_time)) ERR;
+ read_us = (int)diff_time.tv_sec + (float)diff_time.tv_usec / MILLION ;
+ printf("%zu, %ld, %g, %g\n", size[c], nelems[c], preemption[c], read_us);
+ }
+ /* Free data storage. */
+ free(data_in);
+
+
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
+}
diff -Nru netcdf-parallel-4.7.3/nc_perf/tst_mem1.c netcdf-parallel-4.7.4/nc_perf/tst_mem1.c
--- netcdf-parallel-4.7.3/nc_perf/tst_mem1.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_perf/tst_mem1.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,54 @@
+/* This is part of the netCDF package. Copyright 2020 University
+ Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
+ conditions of use.
+
+ Test internal netcdf-4 file code for memory leaks. This test was
+ suggest by Jeff Whitaker. See
+ https://github.com/Unidata/netcdf-c/issues/1575.
+
+ Ed Hartnett 2/9/20
+*/
+
+#include
+#include
+#include
+#include
+
+#define FILE_NAME "tst_mem1.nc"
+#define NUM_FILE_OPENS 10000
+
+int main()
+{
+ int ncid, varid, idx;
+ struct rusage r_usage;
+
+ printf("\n*** Testing netcdf-4 memory use.\n");
+ printf("*** testing mem use opening/closing file...");
+ {
+ long my_rss = 0;
+
+ if (nc_create(FILE_NAME, NC_CLOBBER | NC_NETCDF4, &ncid)) ERR;
+ /* if (nc_create(FILE_NAME, NC_CLOBBER, &ncid)) ERR; */
+ if (nc_def_var(ncid, "dummy", NC_DOUBLE, 0, NULL, &varid)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ for (idx = 0; idx < NUM_FILE_OPENS; idx++)
+ {
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_close(ncid)) ERR;
+ getrusage(RUSAGE_SELF, &r_usage);
+ /* if (!(idx % 100)) */
+ /* printf("Memory usage: %ld kilobytes\n",r_usage.ru_maxrss); */
+
+ /* Memory usage goes up in the first couple of opens, but
+ * should then remain steady. Check that it does not
+ * change after the first 10 iterations. */
+ if (!my_rss || idx < 10)
+ my_rss = r_usage.ru_maxrss;
+ else
+ if (my_rss != r_usage.ru_maxrss) ERR;
+ };
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
+}
diff -Nru netcdf-parallel-4.7.3/nctest/Makefile.in netcdf-parallel-4.7.4/nctest/Makefile.in
--- netcdf-parallel-4.7.3/nctest/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nctest/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -476,8 +476,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -517,11 +519,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
diff -Nru netcdf-parallel-4.7.3/nc_test/CMakeLists.txt netcdf-parallel-4.7.4/nc_test/CMakeLists.txt
--- netcdf-parallel-4.7.3/nc_test/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -91,10 +91,12 @@
add_sh_test(nc_test run_diskless2)
ENDIF()
- IF(ENABLE_BYTERANGE)
- build_bin_test_no_prefix(tst_byterange)
- add_sh_test(nc_test test_byterange)
- ENDIF()
+ IF(ENABLE_DAP_REMOTE_TESTS)
+ IF(ENABLE_BYTERANGE)
+ build_bin_test_no_prefix(tst_byterange)
+ add_sh_test(nc_test test_byterange)
+ ENDIF()
+ ENDIF(ENABLE_DAP_REMOTE_TESTS)
IF(BUILD_MMAP)
add_sh_test(nc_test run_mmap)
diff -Nru netcdf-parallel-4.7.3/nc_test/Makefile.am netcdf-parallel-4.7.4/nc_test/Makefile.am
--- netcdf-parallel-4.7.3/nc_test/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -61,10 +61,12 @@
TESTPROGRAMS += tst_diskless6
endif
+if ENABLE_DAP_REMOTE_TESTS
if ENABLE_BYTERANGE
TESTPROGRAMS += tst_byterange
tst_byterange_SOURCES = tst_byterange.c
endif
+endif
# Set up the tests.
check_PROGRAMS += $(TESTPROGRAMS)
@@ -127,7 +129,7 @@
# Only clean these on maintainer-clean, because they require m4 to
# regenerate.
-#MAINTAINERCLEANFILES = test_get.c test_put.c
+MAINTAINERCLEANFILES = test_get.c test_put.c
# This rule tells make how to turn our .m4 files into .c files.
.m4.c:
diff -Nru netcdf-parallel-4.7.3/nc_test/Makefile.in netcdf-parallel-4.7.4/nc_test/Makefile.in
--- netcdf-parallel-4.7.3/nc_test/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,7 +122,7 @@
@BUILD_BENCHMARKS_TRUE@am__append_6 = testnc3perf
@USE_HDF5_TRUE@am__append_7 = tst_diskless6
-@ENABLE_BYTERANGE_TRUE@am__append_8 = tst_byterange
+@ENABLE_BYTERANGE_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@am__append_8 = tst_byterange
@USE_HDF5_TRUE@am__append_9 = tst_diskless2
TESTS = $(am__EXEEXT_9) $(am__append_10) $(am__append_11) \
$(am__append_12) $(am__append_13) $(am__append_14) \
@@ -161,7 +161,7 @@
@LARGE_FILE_TESTS_TRUE@ large_files$(EXEEXT)
@BUILD_BENCHMARKS_TRUE@am__EXEEXT_5 = testnc3perf$(EXEEXT)
@USE_HDF5_TRUE@am__EXEEXT_6 = tst_diskless6$(EXEEXT)
-@ENABLE_BYTERANGE_TRUE@am__EXEEXT_7 = tst_byterange$(EXEEXT)
+@ENABLE_BYTERANGE_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@am__EXEEXT_7 = tst_byterange$(EXEEXT)
@ENABLE_CDF5_TRUE@@LARGE_FILE_TESTS_TRUE@am__EXEEXT_8 = tst_large_cdf5$(EXEEXT) \
@ENABLE_CDF5_TRUE@@LARGE_FILE_TESTS_TRUE@ tst_cdf5_begin$(EXEEXT)
am__EXEEXT_9 = t_nc$(EXEEXT) tst_small$(EXEEXT) nc_test$(EXEEXT) \
@@ -228,8 +228,7 @@
tst_big_var6_LDADD = $(LDADD)
tst_big_var6_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
am__tst_byterange_SOURCES_DIST = tst_byterange.c
-@ENABLE_BYTERANGE_TRUE@am_tst_byterange_OBJECTS = \
-@ENABLE_BYTERANGE_TRUE@ tst_byterange.$(OBJEXT)
+@ENABLE_BYTERANGE_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@am_tst_byterange_OBJECTS = tst_byterange.$(OBJEXT)
tst_byterange_OBJECTS = $(am_tst_byterange_OBJECTS)
tst_byterange_LDADD = $(LDADD)
tst_byterange_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
@@ -761,8 +760,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -802,11 +803,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -916,7 +917,7 @@
nc_test_SOURCES = nc_test.c error.c test_get.c test_put.c test_read.c \
test_write.c util.c error.h tests.h
-@ENABLE_BYTERANGE_TRUE@tst_byterange_SOURCES = tst_byterange.c
+@ENABLE_BYTERANGE_TRUE@@ENABLE_DAP_REMOTE_TESTS_TRUE@tst_byterange_SOURCES = tst_byterange.c
# The .c files that are generated with m4 are already distributed, but
# we also include the original m4 files, plus test scripts data.
@@ -934,6 +935,10 @@
tst_diskless4.cdl ref_tst_diskless4.cdl benchmark.nc \
tst_http_nc3.cdl tst_http_nc4.cdl tmp*.cdl tmp*.nc
+
+# Only clean these on maintainer-clean, because they require m4 to
+# regenerate.
+MAINTAINERCLEANFILES = test_get.c test_put.c
all: all-am
.SUFFIXES:
@@ -1788,6 +1793,7 @@
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
check-valgrind: check-valgrind-am
check-valgrind-am: check-valgrind-local
@@ -2009,10 +2015,6 @@
@ENABLE_CDF5_TRUE@ # file offsets. It is to be used by tst_open_cdf5.c to check if it can
@ENABLE_CDF5_TRUE@ # detect and report error code NC_ENOTNC.
-# Only clean these on maintainer-clean, because they require m4 to
-# regenerate.
-#MAINTAINERCLEANFILES = test_get.c test_put.c
-
# This rule tells make how to turn our .m4 files into .c files.
.m4.c:
m4 $(AM_M4FLAGS) $(M4FLAGS) $< >$@
diff -Nru netcdf-parallel-4.7.3/nc_test/ref_tst_http_nc3.cdl netcdf-parallel-4.7.4/nc_test/ref_tst_http_nc3.cdl
--- netcdf-parallel-4.7.3/nc_test/ref_tst_http_nc3.cdl 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/ref_tst_http_nc3.cdl 2020-08-31 10:33:26.000000000 +0000
@@ -1,4 +1,4 @@
-netcdf \2004050300_eta_211 {
+netcdf \2004050412_eta_211 {
dimensions:
record = UNLIMITED ; // (1 currently)
x = 135 ;
diff -Nru netcdf-parallel-4.7.3/nc_test/test_byterange.sh netcdf-parallel-4.7.4/nc_test/test_byterange.sh
--- netcdf-parallel-4.7.3/nc_test/test_byterange.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_byterange.sh 2020-08-31 10:33:26.000000000 +0000
@@ -6,7 +6,7 @@
set -e
#Constants
-URL3="http://149.165.169.123:8080/thredds/fileServer/testdata/2004050300_eta_211.nc#bytes"
+URL3="https://remotetest.unidata.ucar.edu/thredds/fileServer/testdata/2004050412_eta_211.nc#bytes"
URL4="http://noaa-goes16.s3.amazonaws.com/ABI-L1b-RadC/2017/059/03/OR_ABI-L1b-RadC-M3C13_G16_s20170590337505_e20170590340289_c20170590340316.nc#mode=bytes"
# See if netcdf-4 support is enabled
diff -Nru netcdf-parallel-4.7.3/nc_test/test_get.c netcdf-parallel-4.7.4/nc_test/test_get.c
--- netcdf-parallel-4.7.3/nc_test/test_get.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_get.c 2020-08-31 10:33:26.000000000 +0000
@@ -2655,13 +2655,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_text(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -2853,13 +2848,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_uchar(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -3059,13 +3049,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_schar(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -3260,13 +3245,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_short(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -3458,13 +3438,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_int(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -3656,13 +3631,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_long(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -3854,13 +3824,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_float(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -4052,13 +4017,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_double(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -4250,13 +4210,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_ushort(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -4448,13 +4403,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_uint(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -4646,13 +4596,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_longlong(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -4844,13 +4789,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vara_ulonglong(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -5056,13 +4996,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_text(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -5294,13 +5229,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_uchar(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -5540,13 +5470,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_schar(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -5781,13 +5706,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_short(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -6019,13 +5939,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_int(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -6257,13 +6172,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_long(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -6495,13 +6405,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_float(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -6733,13 +6638,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_double(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -6971,13 +6871,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_ushort(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -7209,13 +7104,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_uint(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -7447,13 +7337,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_longlong(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -7685,13 +7570,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_vars_ulonglong(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -7926,13 +7806,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_text(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -8169,13 +8044,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_uchar(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -8420,13 +8290,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_schar(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -8666,13 +8531,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_short(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -8909,13 +8769,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_int(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -9152,13 +9007,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_long(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -9395,13 +9245,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_float(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -9638,13 +9483,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_double(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -9881,13 +9721,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_ushort(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -10124,13 +9959,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_uint(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -10367,13 +10197,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_longlong(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
@@ -10610,13 +10435,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = nc_get_varm_ulonglong(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
diff -Nru netcdf-parallel-4.7.3/nc_test/test_get.m4 netcdf-parallel-4.7.4/nc_test/test_get.m4
--- netcdf-parallel-4.7.3/nc_test/test_get.m4 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_get.m4 2020-08-31 10:33:26.000000000 +0000
@@ -487,13 +487,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = GetVara($1)(ncid, i, start, edge, value);
IF (err != NC_EINVALCOORDS)
@@ -756,13 +751,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = GetVars($1)(ncid, i, start, edge, stride, value);
IF (err != NC_EINVALCOORDS)
@@ -1054,13 +1044,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
start[j] = var_shape[i][j]+1; /* should cause NC_EINVALCOORDS */
err = GetVarm($1)(ncid, i, start, edge, stride, imap, value);
IF (err != NC_EINVALCOORDS)
diff -Nru netcdf-parallel-4.7.3/nc_test/test_put.c netcdf-parallel-4.7.4/nc_test/test_put.c
--- netcdf-parallel-4.7.3/nc_test/test_put.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_put.c 2020-08-31 10:33:26.000000000 +0000
@@ -5371,13 +5371,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_text(ncid, i, start, edge, value);
@@ -5554,13 +5549,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_uchar(ncid, i, start, edge, value);
@@ -5738,13 +5728,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_schar(ncid, i, start, edge, value);
@@ -5924,13 +5909,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_short(ncid, i, start, edge, value);
@@ -6107,13 +6087,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_int(ncid, i, start, edge, value);
@@ -6290,13 +6265,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_long(ncid, i, start, edge, value);
@@ -6473,13 +6443,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_float(ncid, i, start, edge, value);
@@ -6656,13 +6621,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_double(ncid, i, start, edge, value);
@@ -6839,13 +6799,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_ushort(ncid, i, start, edge, value);
@@ -7022,13 +6977,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_uint(ncid, i, start, edge, value);
@@ -7205,13 +7155,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_longlong(ncid, i, start, edge, value);
@@ -7388,13 +7333,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara_ulonglong(ncid, i, start, edge, value);
@@ -7582,13 +7522,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_text(ncid, i, start, edge, stride, value);
@@ -7794,13 +7729,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_uchar(ncid, i, start, edge, stride, value);
@@ -8007,13 +7937,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_schar(ncid, i, start, edge, stride, value);
@@ -8222,13 +8147,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_short(ncid, i, start, edge, stride, value);
@@ -8434,13 +8354,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_int(ncid, i, start, edge, stride, value);
@@ -8646,13 +8561,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_long(ncid, i, start, edge, stride, value);
@@ -8858,13 +8768,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_float(ncid, i, start, edge, stride, value);
@@ -9070,13 +8975,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_double(ncid, i, start, edge, stride, value);
@@ -9282,13 +9182,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_ushort(ncid, i, start, edge, stride, value);
@@ -9494,13 +9389,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_uint(ncid, i, start, edge, stride, value);
@@ -9706,13 +9596,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_longlong(ncid, i, start, edge, stride, value);
@@ -9918,13 +9803,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars_ulonglong(ncid, i, start, edge, stride, value);
@@ -10135,13 +10015,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_text(ncid, i, start, edge, stride, imap, value);
@@ -10355,13 +10230,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_uchar(ncid, i, start, edge, stride, imap, value);
@@ -10576,13 +10446,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_schar(ncid, i, start, edge, stride, imap, value);
@@ -10799,13 +10664,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_short(ncid, i, start, edge, stride, imap, value);
@@ -11019,13 +10879,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_int(ncid, i, start, edge, stride, imap, value);
@@ -11239,13 +11094,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_long(ncid, i, start, edge, stride, imap, value);
@@ -11459,13 +11309,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_float(ncid, i, start, edge, stride, imap, value);
@@ -11679,13 +11524,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_double(ncid, i, start, edge, stride, imap, value);
@@ -11899,13 +11739,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_ushort(ncid, i, start, edge, stride, imap, value);
@@ -12119,13 +11954,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_uint(ncid, i, start, edge, stride, imap, value);
@@ -12339,13 +12169,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_longlong(ncid, i, start, edge, stride, imap, value);
@@ -12559,13 +12384,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm_ulonglong(ncid, i, start, edge, stride, imap, value);
diff -Nru netcdf-parallel-4.7.3/nc_test/test_put.m4 netcdf-parallel-4.7.4/nc_test/test_put.m4
--- netcdf-parallel-4.7.3/nc_test/test_put.m4 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_put.m4 2020-08-31 10:33:26.000000000 +0000
@@ -778,13 +778,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = PutVara($1)(ncid, i, start, edge, value);
@@ -1007,13 +1002,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = PutVars($1)(ncid, i, start, edge, stride, value);
@@ -1259,13 +1249,8 @@
start[j] = 0;
continue;
}
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = PutVarm($1)(ncid, i, start, edge, stride, imap, value);
diff -Nru netcdf-parallel-4.7.3/nc_test/test_read.c netcdf-parallel-4.7.4/nc_test/test_read.c
--- netcdf-parallel-4.7.3/nc_test/test_read.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_read.c 2020-08-31 10:33:26.000000000 +0000
@@ -1139,13 +1139,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = nc_get_vara(ncid,i,start,edge,buf);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_get_vara(ncid,i,start,edge,buf);
@@ -1313,13 +1308,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = nc_get_vars(ncid,i,start,edge,stride,buf);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_get_vars(ncid,i,start,edge,stride,buf);
@@ -1524,13 +1514,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = nc_get_varm(ncid,i,start,edge,stride,imap,buf);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_get_varm(ncid,i,start,edge,stride,imap,buf);
diff -Nru netcdf-parallel-4.7.3/nc_test/test_read.m4 netcdf-parallel-4.7.4/nc_test/test_read.m4
--- netcdf-parallel-4.7.3/nc_test/test_read.m4 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_read.m4 2020-08-31 10:33:26.000000000 +0000
@@ -1207,13 +1207,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = GetVara(ncid, i, start, edge, buf, 0, datatype);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = GetVara(ncid, i, start, edge, buf, 1, datatype);
@@ -1399,13 +1394,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = GetVars(ncid, i, start, edge, stride, buf, 0, datatype);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = GetVars(ncid, i, start, edge, stride, buf, 1, datatype);
@@ -1628,13 +1618,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = GetVarm(ncid, i, start, edge, stride, imap, buf, 0, datatype);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = GetVarm(ncid, i, start, edge, stride, imap, buf, 1, datatype);
diff -Nru netcdf-parallel-4.7.3/nc_test/tests.h netcdf-parallel-4.7.4/nc_test/tests.h
--- netcdf-parallel-4.7.3/nc_test/tests.h 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/tests.h 2020-08-31 10:33:26.000000000 +0000
@@ -43,11 +43,11 @@
/* FLT_MAX < X_FLOAT_MAX */
#define X_FLOAT_MAX FLT_MAX
#else
-#ifdef WIN32 /* Windows, of course, has to be a *little* different. */
+#ifdef _WIN32 /* Windows, of course, has to be a *little* different. */
#define X_FLOAT_MAX 3.402823466e+38f
#else
#define X_FLOAT_MAX 3.40282347e+38f
-#endif /* WIN32 */
+#endif /* _WIN32 */
#endif
#define X_FLOAT_MIN (-X_FLOAT_MAX)
#if CRAYFLOAT
diff -Nru netcdf-parallel-4.7.3/nc_test/test_write.c netcdf-parallel-4.7.4/nc_test/test_write.c
--- netcdf-parallel-4.7.3/nc_test/test_write.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_write.c 2020-08-31 10:33:26.000000000 +0000
@@ -954,13 +954,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = nc_put_vara(ncid,i,start,edge,buf);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vara(ncid,i,start,edge,buf);
@@ -1126,13 +1121,8 @@
if (var_dimid[i][j] == 0) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = nc_put_vars(ncid,i,start,edge,stride,buf);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_vars(ncid,i,start,edge,stride,buf);
@@ -1328,13 +1318,8 @@
if (var_dimid[i][j] == 0) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = nc_put_varm(ncid,i,start,edge,stride,imap,buf);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
error("expecting NC_NOERR but got %s",nc_err_code_name(err));
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- error("expecting NC_EINVALCOORDS but got %s",nc_err_code_name(err));
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = nc_put_varm(ncid,i,start,edge,stride,imap,buf);
diff -Nru netcdf-parallel-4.7.3/nc_test/test_write.m4 netcdf-parallel-4.7.4/nc_test/test_write.m4
--- netcdf-parallel-4.7.3/nc_test/test_write.m4 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/test_write.m4 2020-08-31 10:33:26.000000000 +0000
@@ -1043,13 +1043,8 @@
if (var_dimid[i][j] == RECDIM) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = PutVara(ncid, i, start, edge, buf, 0, datatype);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = PutVara(ncid, i, start, edge, buf, 1, datatype);
@@ -1236,13 +1231,8 @@
if (var_dimid[i][j] == 0) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = PutVars(ncid, i, start, edge, stride, buf, 0, datatype);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = PutVars(ncid, i, start, edge, stride, buf, 1, datatype);
@@ -1459,13 +1449,8 @@
if (var_dimid[i][j] == 0) continue; /* skip record dim */
start[j] = var_shape[i][j];
err = PutVarm(ncid, i, start, edge, stride, imap, buf, 0, datatype);
-#ifdef RELAX_COORD_BOUND
IF (err != NC_NOERR) /* allowed when edge[j]==0 */
EXPECT_ERR(NC_NOERR, err)
-#else
- IF (err != NC_EINVALCOORDS) /* not allowed even when edge[j]==0 */
- EXPECT_ERR(NC_EINVALCOORDS, err)
-#endif
ELSE_NOK
start[j] = var_shape[i][j]+1; /* out of boundary check */
err = PutVarm(ncid, i, start, edge, stride, imap, buf, 1, datatype);
diff -Nru netcdf-parallel-4.7.3/nc_test/tst_byterange.c netcdf-parallel-4.7.4/nc_test/tst_byterange.c
--- netcdf-parallel-4.7.3/nc_test/tst_byterange.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test/tst_byterange.c 2020-08-31 10:33:26.000000000 +0000
@@ -33,7 +33,7 @@
int format; /* instance of NC_FORMATX_XXX */
const char* url;
} testurls[] = {
-{NC_FORMAT_CLASSIC,"http://149.165.169.123:8080/thredds/fileServer/testdata/2004050300_eta_211.nc#bytes"},
+{NC_FORMAT_CLASSIC,"http://remotetest.unidata.ucar.edu/thredds/fileServer/testdata/2004050300_eta_211.nc#bytes"},
#ifdef USE_NETCDF4
{NC_FORMAT_NETCDF4,"http://noaa-goes16.s3.amazonaws.com/ABI-L1b-RadC/2017/059/03/OR_ABI-L1b-RadC-M3C13_G16_s20170590337505_e20170590340289_c20170590340316.nc#mode=bytes"},
#endif
@@ -59,6 +59,7 @@
int ncid;
int format = -1;
+ fprintf(stderr,"Test: url=%s\n",test->url);
/* First, try to open the url */
if((ret = nc_open(test->url,0,&ncid))) return fail(ret);
diff -Nru netcdf-parallel-4.7.3/nc_test4/CMakeLists.txt netcdf-parallel-4.7.4/nc_test4/CMakeLists.txt
--- netcdf-parallel-4.7.3/nc_test4/CMakeLists.txt 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/CMakeLists.txt 2020-08-31 10:33:26.000000000 +0000
@@ -33,6 +33,8 @@
build_bin_test(test_filter)
build_bin_test(test_filter_misc)
build_bin_test(test_filter_reg)
+ build_bin_test(tst_multifilter)
+ build_bin_test(test_filter_order)
ADD_SH_TEST(nc_test4 tst_filter)
SET(NC4_TESTS ${NC4_TESTS} tst_filterparser test_filter_reg)
ENDIF(ENABLE_FILTER_TESTING)
@@ -85,6 +87,8 @@
build_bin_test(tst_parallel3)
build_bin_test(tst_parallel4)
build_bin_test(tst_parallel5)
+ build_bin_test(tst_parallel_zlib)
+ build_bin_test(tst_parallel_compress)
build_bin_test(tst_nc4perf)
build_bin_test(tst_mode)
build_bin_test(tst_simplerw_coll_r)
diff -Nru netcdf-parallel-4.7.3/nc_test4/Makefile.am netcdf-parallel-4.7.4/nc_test4/Makefile.am
--- netcdf-parallel-4.7.3/nc_test4/Makefile.am 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/Makefile.am 2020-08-31 10:33:26.000000000 +0000
@@ -19,7 +19,6 @@
TEST_EXTENSIONS = .sh
# Link to our assembled library.
-AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la
LDADD = ${top_builddir}/liblib/libnetcdf.la
# These are netCDF-4 C test programs which are built and run.
@@ -73,8 +72,9 @@
# Filter Tests (requires ncdump and ncgen)
if ENABLE_FILTER_TESTING
extradir =
-extra_PROGRAMS = test_filter test_filter_misc
+extra_PROGRAMS = test_filter test_filter_misc test_filter_order
check_PROGRAMS += test_filter_reg
+check_PROGRAMS += tst_multifilter
TESTS += tst_filter.sh test_filter_reg
endif
endif # BUILD_UTILITIES
@@ -84,9 +84,9 @@
if TEST_PARALLEL4
check_PROGRAMS += tst_mpi_parallel tst_parallel tst_parallel3 \
tst_parallel4 tst_parallel5 tst_nc4perf tst_mode tst_simplerw_coll_r \
-tst_mode
+tst_mode tst_parallel_zlib tst_parallel_compress
TESTS += run_par_test.sh
-endif
+endif # TEST_PARALLEL4
EXTRA_DIST = run_par_test.sh.in ref_tst_compounds.nc \
ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc \
@@ -95,7 +95,8 @@
ref_hdf5_compat3.nc tst_misc.sh tdset.h5 tst_szip.sh ref_szip.h5 \
ref_szip.cdl tst_filter.sh bzip2.cdl ref_filtered.cdl \
ref_unfiltered.cdl ref_bzip2.c findplugin.in ref_unfilteredvv.cdl \
-ref_filteredvv.cdl
+ref_filteredvv.cdl ref_multi.cdl ref_filter_order.txt \
+ref_ncgenF.cdl ref_nccopyF.cdl
CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \
tst_floats_1D.cdl floats_1D_3.nc floats_1D.cdl tst_*.nc \
diff -Nru netcdf-parallel-4.7.3/nc_test4/Makefile.in netcdf-parallel-4.7.4/nc_test4/Makefile.in
--- netcdf-parallel-4.7.3/nc_test4/Makefile.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/Makefile.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -133,15 +133,17 @@
@BUILD_UTILITIES_TRUE@@USE_SZIP_TRUE@am__append_9 = test_szip h5testszip
@BUILD_UTILITIES_TRUE@@USE_SZIP_TRUE@am__append_10 = tst_szip.sh
@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@extra_PROGRAMS = test_filter$(EXEEXT) \
-@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@ test_filter_misc$(EXEEXT)
-@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@am__append_11 = test_filter_reg
+@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@ test_filter_misc$(EXEEXT) \
+@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@ test_filter_order$(EXEEXT)
+@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@am__append_11 = test_filter_reg \
+@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@ tst_multifilter
@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@am__append_12 = tst_filter.sh test_filter_reg
# This are extra tests that will only be run if netcdf-4 is configured
# with --enable-parallel-tests.
@TEST_PARALLEL4_TRUE@am__append_13 = tst_mpi_parallel tst_parallel tst_parallel3 \
@TEST_PARALLEL4_TRUE@tst_parallel4 tst_parallel5 tst_nc4perf tst_mode tst_simplerw_coll_r \
-@TEST_PARALLEL4_TRUE@tst_mode
+@TEST_PARALLEL4_TRUE@tst_mode tst_parallel_zlib tst_parallel_compress
@TEST_PARALLEL4_TRUE@am__append_14 = run_par_test.sh
subdir = nc_test4
@@ -195,7 +197,8 @@
@BUILD_UTILITIES_TRUE@@USE_SZIP_TRUE@am__EXEEXT_6 = \
@BUILD_UTILITIES_TRUE@@USE_SZIP_TRUE@ test_szip$(EXEEXT) \
@BUILD_UTILITIES_TRUE@@USE_SZIP_TRUE@ h5testszip$(EXEEXT)
-@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@am__EXEEXT_7 = test_filter_reg$(EXEEXT)
+@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@am__EXEEXT_7 = test_filter_reg$(EXEEXT) \
+@BUILD_UTILITIES_TRUE@@ENABLE_FILTER_TESTING_TRUE@ tst_multifilter$(EXEEXT)
@TEST_PARALLEL4_TRUE@am__EXEEXT_8 = tst_mpi_parallel$(EXEEXT) \
@TEST_PARALLEL4_TRUE@ tst_parallel$(EXEEXT) \
@TEST_PARALLEL4_TRUE@ tst_parallel3$(EXEEXT) \
@@ -203,7 +206,9 @@
@TEST_PARALLEL4_TRUE@ tst_parallel5$(EXEEXT) \
@TEST_PARALLEL4_TRUE@ tst_nc4perf$(EXEEXT) tst_mode$(EXEEXT) \
@TEST_PARALLEL4_TRUE@ tst_simplerw_coll_r$(EXEEXT) \
-@TEST_PARALLEL4_TRUE@ tst_mode$(EXEEXT)
+@TEST_PARALLEL4_TRUE@ tst_mode$(EXEEXT) \
+@TEST_PARALLEL4_TRUE@ tst_parallel_zlib$(EXEEXT) \
+@TEST_PARALLEL4_TRUE@ tst_parallel_compress$(EXEEXT)
am__installdirs = "$(DESTDIR)$(extradir)"
PROGRAMS = $(extra_PROGRAMS)
cdm_sea_soundings_SOURCES = cdm_sea_soundings.c
@@ -234,6 +239,10 @@
test_filter_misc_OBJECTS = test_filter_misc.$(OBJEXT)
test_filter_misc_LDADD = $(LDADD)
test_filter_misc_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+test_filter_order_SOURCES = test_filter_order.c
+test_filter_order_OBJECTS = test_filter_order.$(OBJEXT)
+test_filter_order_LDADD = $(LDADD)
+test_filter_order_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
test_filter_reg_SOURCES = test_filter_reg.c
test_filter_reg_OBJECTS = test_filter_reg.$(OBJEXT)
test_filter_reg_LDADD = $(LDADD)
@@ -446,6 +455,10 @@
tst_mpi_parallel_OBJECTS = tst_mpi_parallel.$(OBJEXT)
tst_mpi_parallel_LDADD = $(LDADD)
tst_mpi_parallel_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+tst_multifilter_SOURCES = tst_multifilter.c
+tst_multifilter_OBJECTS = tst_multifilter.$(OBJEXT)
+tst_multifilter_LDADD = $(LDADD)
+tst_multifilter_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
tst_nc4perf_SOURCES = tst_nc4perf.c
tst_nc4perf_OBJECTS = tst_nc4perf.$(OBJEXT)
tst_nc4perf_LDADD = $(LDADD)
@@ -470,6 +483,15 @@
tst_parallel5_OBJECTS = tst_parallel5.$(OBJEXT)
tst_parallel5_LDADD = $(LDADD)
tst_parallel5_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
+tst_parallel_compress_SOURCES = tst_parallel_compress.c
+tst_parallel_compress_OBJECTS = tst_parallel_compress.$(OBJEXT)
+tst_parallel_compress_LDADD = $(LDADD)
+tst_parallel_compress_DEPENDENCIES = \
+ ${top_builddir}/liblib/libnetcdf.la
+tst_parallel_zlib_SOURCES = tst_parallel_zlib.c
+tst_parallel_zlib_OBJECTS = tst_parallel_zlib.$(OBJEXT)
+tst_parallel_zlib_LDADD = $(LDADD)
+tst_parallel_zlib_DEPENDENCIES = ${top_builddir}/liblib/libnetcdf.la
tst_put_vars_SOURCES = tst_put_vars.c
tst_put_vars_OBJECTS = tst_put_vars.$(OBJEXT)
tst_put_vars_LDADD = $(LDADD)
@@ -583,10 +605,11 @@
am__depfiles_remade = ./$(DEPDIR)/cdm_sea_soundings.Po \
./$(DEPDIR)/h5testszip.Po ./$(DEPDIR)/renamegroup.Po \
./$(DEPDIR)/t_type.Po ./$(DEPDIR)/test_filter.Po \
- ./$(DEPDIR)/test_filter_misc.Po ./$(DEPDIR)/test_filter_reg.Po \
- ./$(DEPDIR)/test_szip.Po ./$(DEPDIR)/tst_atts.Po \
- ./$(DEPDIR)/tst_atts1.Po ./$(DEPDIR)/tst_atts2.Po \
- ./$(DEPDIR)/tst_atts3.Po \
+ ./$(DEPDIR)/test_filter_misc.Po \
+ ./$(DEPDIR)/test_filter_order.Po \
+ ./$(DEPDIR)/test_filter_reg.Po ./$(DEPDIR)/test_szip.Po \
+ ./$(DEPDIR)/tst_atts.Po ./$(DEPDIR)/tst_atts1.Po \
+ ./$(DEPDIR)/tst_atts2.Po ./$(DEPDIR)/tst_atts3.Po \
./$(DEPDIR)/tst_atts_string_rewrite.Po \
./$(DEPDIR)/tst_bug1442.Po ./$(DEPDIR)/tst_bug324.Po \
./$(DEPDIR)/tst_camrun.Po ./$(DEPDIR)/tst_chunks.Po \
@@ -612,10 +635,12 @@
./$(DEPDIR)/tst_interops5.Po ./$(DEPDIR)/tst_interops6.Po \
./$(DEPDIR)/tst_interops_dims.Po ./$(DEPDIR)/tst_large.Po \
./$(DEPDIR)/tst_large2.Po ./$(DEPDIR)/tst_mode.Po \
- ./$(DEPDIR)/tst_mpi_parallel.Po ./$(DEPDIR)/tst_nc4perf.Po \
- ./$(DEPDIR)/tst_opaques.Po ./$(DEPDIR)/tst_parallel.Po \
- ./$(DEPDIR)/tst_parallel3.Po ./$(DEPDIR)/tst_parallel4.Po \
- ./$(DEPDIR)/tst_parallel5.Po ./$(DEPDIR)/tst_put_vars.Po \
+ ./$(DEPDIR)/tst_mpi_parallel.Po ./$(DEPDIR)/tst_multifilter.Po \
+ ./$(DEPDIR)/tst_nc4perf.Po ./$(DEPDIR)/tst_opaques.Po \
+ ./$(DEPDIR)/tst_parallel.Po ./$(DEPDIR)/tst_parallel3.Po \
+ ./$(DEPDIR)/tst_parallel4.Po ./$(DEPDIR)/tst_parallel5.Po \
+ ./$(DEPDIR)/tst_parallel_compress.Po \
+ ./$(DEPDIR)/tst_parallel_zlib.Po ./$(DEPDIR)/tst_put_vars.Po \
./$(DEPDIR)/tst_put_vars_two_unlim_dim.Po \
./$(DEPDIR)/tst_rehash.Po ./$(DEPDIR)/tst_rename.Po \
./$(DEPDIR)/tst_rename2.Po ./$(DEPDIR)/tst_rename3.Po \
@@ -648,23 +673,24 @@
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = cdm_sea_soundings.c h5testszip.c renamegroup.c t_type.c \
- test_filter.c test_filter_misc.c test_filter_reg.c test_szip.c \
- tst_atts.c tst_atts1.c tst_atts2.c tst_atts3.c \
- tst_atts_string_rewrite.c tst_bug1442.c tst_bug324.c \
- tst_camrun.c tst_chunks.c tst_chunks2.c tst_compounds.c \
- tst_compounds2.c tst_compounds3.c tst_converts.c \
- tst_converts2.c tst_coords.c tst_coords2.c tst_coords3.c \
- tst_dims.c tst_dims2.c tst_dims3.c tst_elatefill.c \
- tst_empty_vlen_unlim.c tst_endian_fill.c tst_enums.c \
- tst_files.c tst_files4.c tst_files5.c tst_files6.c \
+ test_filter.c test_filter_misc.c test_filter_order.c \
+ test_filter_reg.c test_szip.c tst_atts.c tst_atts1.c \
+ tst_atts2.c tst_atts3.c tst_atts_string_rewrite.c \
+ tst_bug1442.c tst_bug324.c tst_camrun.c tst_chunks.c \
+ tst_chunks2.c tst_compounds.c tst_compounds2.c \
+ tst_compounds3.c tst_converts.c tst_converts2.c tst_coords.c \
+ tst_coords2.c tst_coords3.c tst_dims.c tst_dims2.c tst_dims3.c \
+ tst_elatefill.c tst_empty_vlen_unlim.c tst_endian_fill.c \
+ tst_enums.c tst_files.c tst_files4.c tst_files5.c tst_files6.c \
tst_fill_attr_vanish.c tst_fillbug.c tst_fills.c tst_fills2.c \
tst_filterparser.c tst_grps.c tst_grps2.c tst_h5_endians.c \
tst_h_refs.c tst_h_scalar.c tst_h_strbug.c \
tst_hdf5_file_compat.c tst_interops.c tst_interops4.c \
tst_interops5.c tst_interops6.c tst_interops_dims.c \
tst_large.c tst_large2.c tst_mode.c tst_mpi_parallel.c \
- tst_nc4perf.c tst_opaques.c tst_parallel.c tst_parallel3.c \
- tst_parallel4.c tst_parallel5.c tst_put_vars.c \
+ tst_multifilter.c tst_nc4perf.c tst_opaques.c tst_parallel.c \
+ tst_parallel3.c tst_parallel4.c tst_parallel5.c \
+ tst_parallel_compress.c tst_parallel_zlib.c tst_put_vars.c \
tst_put_vars_two_unlim_dim.c tst_rehash.c tst_rename.c \
tst_rename2.c tst_rename3.c tst_simplerw_coll_r.c \
tst_strings.c tst_strings2.c tst_sync.c tst_types.c tst_udf.c \
@@ -672,23 +698,24 @@
tst_vars2.c tst_vars3.c tst_vars4.c tst_vl.c tst_xplatform.c \
tst_xplatform2.c
DIST_SOURCES = cdm_sea_soundings.c h5testszip.c renamegroup.c t_type.c \
- test_filter.c test_filter_misc.c test_filter_reg.c test_szip.c \
- tst_atts.c tst_atts1.c tst_atts2.c tst_atts3.c \
- tst_atts_string_rewrite.c tst_bug1442.c tst_bug324.c \
- tst_camrun.c tst_chunks.c tst_chunks2.c tst_compounds.c \
- tst_compounds2.c tst_compounds3.c tst_converts.c \
- tst_converts2.c tst_coords.c tst_coords2.c tst_coords3.c \
- tst_dims.c tst_dims2.c tst_dims3.c tst_elatefill.c \
- tst_empty_vlen_unlim.c tst_endian_fill.c tst_enums.c \
- tst_files.c tst_files4.c tst_files5.c tst_files6.c \
+ test_filter.c test_filter_misc.c test_filter_order.c \
+ test_filter_reg.c test_szip.c tst_atts.c tst_atts1.c \
+ tst_atts2.c tst_atts3.c tst_atts_string_rewrite.c \
+ tst_bug1442.c tst_bug324.c tst_camrun.c tst_chunks.c \
+ tst_chunks2.c tst_compounds.c tst_compounds2.c \
+ tst_compounds3.c tst_converts.c tst_converts2.c tst_coords.c \
+ tst_coords2.c tst_coords3.c tst_dims.c tst_dims2.c tst_dims3.c \
+ tst_elatefill.c tst_empty_vlen_unlim.c tst_endian_fill.c \
+ tst_enums.c tst_files.c tst_files4.c tst_files5.c tst_files6.c \
tst_fill_attr_vanish.c tst_fillbug.c tst_fills.c tst_fills2.c \
tst_filterparser.c tst_grps.c tst_grps2.c tst_h5_endians.c \
tst_h_refs.c tst_h_scalar.c tst_h_strbug.c \
tst_hdf5_file_compat.c tst_interops.c tst_interops4.c \
tst_interops5.c tst_interops6.c tst_interops_dims.c \
tst_large.c tst_large2.c tst_mode.c tst_mpi_parallel.c \
- tst_nc4perf.c tst_opaques.c tst_parallel.c tst_parallel3.c \
- tst_parallel4.c tst_parallel5.c tst_put_vars.c \
+ tst_multifilter.c tst_nc4perf.c tst_opaques.c tst_parallel.c \
+ tst_parallel3.c tst_parallel4.c tst_parallel5.c \
+ tst_parallel_compress.c tst_parallel_zlib.c tst_put_vars.c \
tst_put_vars_two_unlim_dim.c tst_rehash.c tst_rename.c \
tst_rename2.c tst_rename3.c tst_simplerw_coll_r.c \
tst_strings.c tst_strings2.c tst_sync.c tst_types.c tst_udf.c \
@@ -939,9 +966,7 @@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = -I$(top_srcdir)/include $(am__append_1)
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-
-# Link to our assembled library.
-AM_LDFLAGS = ${top_builddir}/liblib/libnetcdf.la
+AM_LDFLAGS =
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -996,8 +1021,10 @@
HAS_NC4 = @HAS_NC4@
HAS_PARALLEL = @HAS_PARALLEL@
HAS_PARALLEL4 = @HAS_PARALLEL4@
+HAS_PAR_FILTERS = @HAS_PAR_FILTERS@
HAS_PNETCDF = @HAS_PNETCDF@
HAS_SZLIB = @HAS_SZLIB@
+HAS_SZLIB_WRITE = @HAS_SZLIB_WRITE@
HAVE_DOT = @HAVE_DOT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
@@ -1037,11 +1064,11 @@
NC_HAS_NC4 = @NC_HAS_NC4@
NC_HAS_PARALLEL = @NC_HAS_PARALLEL@
NC_HAS_PARALLEL4 = @NC_HAS_PARALLEL4@
+NC_HAS_PAR_FILTERS = @NC_HAS_PAR_FILTERS@
NC_HAS_PNETCDF = @NC_HAS_PNETCDF@
NC_HAS_SZIP = @NC_HAS_SZIP@
NC_LIBS = @NC_LIBS@
NC_M4 = @NC_M4@
-NC_RELAX_COORD_BOUND = @NC_RELAX_COORD_BOUND@
NC_VERSION = @NC_VERSION@
NC_VERSION_MAJOR = @NC_VERSION_MAJOR@
NC_VERSION_MINOR = @NC_VERSION_MINOR@
@@ -1142,6 +1169,8 @@
#LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
#TESTS_ENVIRONMENT = export SETX=1;
TEST_EXTENSIONS = .sh
+
+# Link to our assembled library.
LDADD = ${top_builddir}/liblib/libnetcdf.la
# These are netCDF-4 C test programs which are built and run.
@@ -1170,7 +1199,8 @@
ref_hdf5_compat3.nc tst_misc.sh tdset.h5 tst_szip.sh ref_szip.h5 \
ref_szip.cdl tst_filter.sh bzip2.cdl ref_filtered.cdl \
ref_unfiltered.cdl ref_bzip2.c findplugin.in ref_unfilteredvv.cdl \
-ref_filteredvv.cdl
+ref_filteredvv.cdl ref_multi.cdl ref_filter_order.txt \
+ref_ncgenF.cdl ref_nccopyF.cdl
CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \
tst_floats_1D.cdl floats_1D_3.nc floats_1D.cdl tst_*.nc \
@@ -1304,6 +1334,10 @@
@rm -f test_filter_misc$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_filter_misc_OBJECTS) $(test_filter_misc_LDADD) $(LIBS)
+test_filter_order$(EXEEXT): $(test_filter_order_OBJECTS) $(test_filter_order_DEPENDENCIES) $(EXTRA_test_filter_order_DEPENDENCIES)
+ @rm -f test_filter_order$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_filter_order_OBJECTS) $(test_filter_order_LDADD) $(LIBS)
+
test_filter_reg$(EXEEXT): $(test_filter_reg_OBJECTS) $(test_filter_reg_DEPENDENCIES) $(EXTRA_test_filter_reg_DEPENDENCIES)
@rm -f test_filter_reg$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_filter_reg_OBJECTS) $(test_filter_reg_LDADD) $(LIBS)
@@ -1512,6 +1546,10 @@
@rm -f tst_mpi_parallel$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_mpi_parallel_OBJECTS) $(tst_mpi_parallel_LDADD) $(LIBS)
+tst_multifilter$(EXEEXT): $(tst_multifilter_OBJECTS) $(tst_multifilter_DEPENDENCIES) $(EXTRA_tst_multifilter_DEPENDENCIES)
+ @rm -f tst_multifilter$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_multifilter_OBJECTS) $(tst_multifilter_LDADD) $(LIBS)
+
tst_nc4perf$(EXEEXT): $(tst_nc4perf_OBJECTS) $(tst_nc4perf_DEPENDENCIES) $(EXTRA_tst_nc4perf_DEPENDENCIES)
@rm -f tst_nc4perf$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_nc4perf_OBJECTS) $(tst_nc4perf_LDADD) $(LIBS)
@@ -1536,6 +1574,14 @@
@rm -f tst_parallel5$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_parallel5_OBJECTS) $(tst_parallel5_LDADD) $(LIBS)
+tst_parallel_compress$(EXEEXT): $(tst_parallel_compress_OBJECTS) $(tst_parallel_compress_DEPENDENCIES) $(EXTRA_tst_parallel_compress_DEPENDENCIES)
+ @rm -f tst_parallel_compress$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_parallel_compress_OBJECTS) $(tst_parallel_compress_LDADD) $(LIBS)
+
+tst_parallel_zlib$(EXEEXT): $(tst_parallel_zlib_OBJECTS) $(tst_parallel_zlib_DEPENDENCIES) $(EXTRA_tst_parallel_zlib_DEPENDENCIES)
+ @rm -f tst_parallel_zlib$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(tst_parallel_zlib_OBJECTS) $(tst_parallel_zlib_LDADD) $(LIBS)
+
tst_put_vars$(EXEEXT): $(tst_put_vars_OBJECTS) $(tst_put_vars_DEPENDENCIES) $(EXTRA_tst_put_vars_DEPENDENCIES)
@rm -f tst_put_vars$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tst_put_vars_OBJECTS) $(tst_put_vars_LDADD) $(LIBS)
@@ -1640,6 +1686,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_type.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_filter.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_filter_misc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_filter_order.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_filter_reg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_szip.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_atts.Po@am__quote@ # am--include-marker
@@ -1692,12 +1739,15 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_large2.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_mode.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_mpi_parallel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_multifilter.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_nc4perf.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_opaques.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_parallel.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_parallel3.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_parallel4.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_parallel5.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_parallel_compress.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_parallel_zlib.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_put_vars.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_put_vars_two_unlim_dim.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_rehash.Po@am__quote@ # am--include-marker
@@ -2591,6 +2641,7 @@
-rm -f ./$(DEPDIR)/t_type.Po
-rm -f ./$(DEPDIR)/test_filter.Po
-rm -f ./$(DEPDIR)/test_filter_misc.Po
+ -rm -f ./$(DEPDIR)/test_filter_order.Po
-rm -f ./$(DEPDIR)/test_filter_reg.Po
-rm -f ./$(DEPDIR)/test_szip.Po
-rm -f ./$(DEPDIR)/tst_atts.Po
@@ -2643,12 +2694,15 @@
-rm -f ./$(DEPDIR)/tst_large2.Po
-rm -f ./$(DEPDIR)/tst_mode.Po
-rm -f ./$(DEPDIR)/tst_mpi_parallel.Po
+ -rm -f ./$(DEPDIR)/tst_multifilter.Po
-rm -f ./$(DEPDIR)/tst_nc4perf.Po
-rm -f ./$(DEPDIR)/tst_opaques.Po
-rm -f ./$(DEPDIR)/tst_parallel.Po
-rm -f ./$(DEPDIR)/tst_parallel3.Po
-rm -f ./$(DEPDIR)/tst_parallel4.Po
-rm -f ./$(DEPDIR)/tst_parallel5.Po
+ -rm -f ./$(DEPDIR)/tst_parallel_compress.Po
+ -rm -f ./$(DEPDIR)/tst_parallel_zlib.Po
-rm -f ./$(DEPDIR)/tst_put_vars.Po
-rm -f ./$(DEPDIR)/tst_put_vars_two_unlim_dim.Po
-rm -f ./$(DEPDIR)/tst_rehash.Po
@@ -2723,6 +2777,7 @@
-rm -f ./$(DEPDIR)/t_type.Po
-rm -f ./$(DEPDIR)/test_filter.Po
-rm -f ./$(DEPDIR)/test_filter_misc.Po
+ -rm -f ./$(DEPDIR)/test_filter_order.Po
-rm -f ./$(DEPDIR)/test_filter_reg.Po
-rm -f ./$(DEPDIR)/test_szip.Po
-rm -f ./$(DEPDIR)/tst_atts.Po
@@ -2775,12 +2830,15 @@
-rm -f ./$(DEPDIR)/tst_large2.Po
-rm -f ./$(DEPDIR)/tst_mode.Po
-rm -f ./$(DEPDIR)/tst_mpi_parallel.Po
+ -rm -f ./$(DEPDIR)/tst_multifilter.Po
-rm -f ./$(DEPDIR)/tst_nc4perf.Po
-rm -f ./$(DEPDIR)/tst_opaques.Po
-rm -f ./$(DEPDIR)/tst_parallel.Po
-rm -f ./$(DEPDIR)/tst_parallel3.Po
-rm -f ./$(DEPDIR)/tst_parallel4.Po
-rm -f ./$(DEPDIR)/tst_parallel5.Po
+ -rm -f ./$(DEPDIR)/tst_parallel_compress.Po
+ -rm -f ./$(DEPDIR)/tst_parallel_zlib.Po
-rm -f ./$(DEPDIR)/tst_put_vars.Po
-rm -f ./$(DEPDIR)/tst_put_vars_two_unlim_dim.Po
-rm -f ./$(DEPDIR)/tst_rehash.Po
diff -Nru netcdf-parallel-4.7.3/nc_test4/ref_bzip2.c netcdf-parallel-4.7.4/nc_test4/ref_bzip2.c
--- netcdf-parallel-4.7.3/nc_test4/ref_bzip2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/ref_bzip2.c 2020-08-31 10:33:26.000000000 +0000
@@ -4,7 +4,7 @@
static size_t var_chunksizes[4] = {4, 4, 4, 4} ;
-static unsigned int var_filterparams[1] = {9U} ;
+static unsigned int var_0_filterparams[1] = {9U} ;
void
check_err(const int stat, const int line, const char *file) {
@@ -72,7 +72,7 @@
check_err(stat,__LINE__,__FILE__);
stat = nc_def_var_fill(bzip2_grp, var_id, NC_NOFILL, NULL);
check_err(stat,__LINE__,__FILE__);
- stat = nc_def_var_filter(bzip2_grp, var_id, 307, 1, var_filterparams);
+ stat = nc_def_var_filter(bzip2_grp, var_id, 307, 1, var_0_filterparams);
check_err(stat,__LINE__,__FILE__);
/* leave define mode */
diff -Nru netcdf-parallel-4.7.3/nc_test4/ref_filter_order.txt netcdf-parallel-4.7.4/nc_test4/ref_filter_order.txt
--- netcdf-parallel-4.7.3/nc_test4/ref_filter_order.txt 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/ref_filter_order.txt 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,17 @@
+test1: filter order.
+set var filter 0
+test: nparams=1: params= 0
+dimsizes=4,4,4,4
+chunksizes=4,4,4,4
+set var filter 1
+test: nparams=1: params= 1
+dimsizes=4,4,4,4
+chunksizes=4,4,4,4
+test1: compression.
+Apply filter: 0
+Apply filter: 1
+test1: decompression.
+Apply filter: 1
+Apply filter: 0
+data comparison: |array|=256
+no data errors
diff -Nru netcdf-parallel-4.7.3/nc_test4/ref_multi.cdl netcdf-parallel-4.7.4/nc_test4/ref_multi.cdl
--- netcdf-parallel-4.7.3/nc_test4/ref_multi.cdl 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/ref_multi.cdl 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,16 @@
+netcdf multifilter {
+dimensions:
+ dim0 = 4 ;
+ dim1 = 4 ;
+ dim2 = 4 ;
+ dim3 = 4 ;
+variables:
+ float var(dim0, dim1, dim2, dim3) ;
+ var:_Storage = "chunked" ;
+ var:_ChunkSizes = 4, 4, 4, 4 ;
+ var:_Filter = "307,9|1,2|40000" ;
+ var:_NoFill = "true" ;
+
+// global attributes:
+ :_Format = "netCDF-4" ;
+}
diff -Nru netcdf-parallel-4.7.3/nc_test4/ref_nccopyF.cdl netcdf-parallel-4.7.4/nc_test4/ref_nccopyF.cdl
--- netcdf-parallel-4.7.3/nc_test4/ref_nccopyF.cdl 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/ref_nccopyF.cdl 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,21 @@
+netcdf nccopyF {
+dimensions:
+ dim0 = 4 ;
+ dim1 = 4 ;
+ dim2 = 4 ;
+ dim3 = 4 ;
+
+// global attributes:
+ :_Format = "netCDF-4" ;
+
+group: g {
+ variables:
+ float var(dim0, dim1, dim2, dim3) ;
+ var:_Storage = "chunked" ;
+ var:_ChunkSizes = 4, 4, 4, 4 ;
+ var:_Filter = "307,4|40000" ;
+ var:_NoFill = "true" ;
+
+ // group attributes:
+ } // group g
+}
diff -Nru netcdf-parallel-4.7.3/nc_test4/ref_ncgenF.cdl netcdf-parallel-4.7.4/nc_test4/ref_ncgenF.cdl
--- netcdf-parallel-4.7.3/nc_test4/ref_ncgenF.cdl 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/ref_ncgenF.cdl 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,21 @@
+netcdf multifiltered {
+dimensions:
+ dim0 = 4 ;
+ dim1 = 4 ;
+ dim2 = 4 ;
+ dim3 = 4 ;
+
+// global attributes:
+ :_Format = "netCDF-4" ;
+
+group: g {
+ variables:
+ float var(dim0, dim1, dim2, dim3) ;
+ var:_Storage = "chunked" ;
+ var:_ChunkSizes = 4, 4, 4, 4 ;
+ var:_Filter = "307,4|4,32,32" ;
+ var:_NoFill = "true" ;
+
+ // group attributes:
+ } // group g
+}
diff -Nru netcdf-parallel-4.7.3/nc_test4/run_par_test.sh.in netcdf-parallel-4.7.4/nc_test4/run_par_test.sh.in
--- netcdf-parallel-4.7.3/nc_test4/run_par_test.sh.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/run_par_test.sh.in 2020-08-31 10:33:26.000000000 +0000
@@ -1,12 +1,13 @@
#!/bin/sh
# This .in file is processed at build time into a shell that runs some
-# parallel I/O tests for HDF5 parallel I/O.
+# parallel I/O tests for netCDF/HDF5 parallel I/O.
# Ed Hartnett, Dennis Heimbigner, Ward Fisher
-set -x
-set -e
+if test "x$srcdir" = x ; then srcdir=`pwd`; fi
+. ../test_common.sh
+
echo
echo "Testing MPI parallel I/O with various other mode flags..."
@MPIEXEC@ -n 1 ./tst_mode
@@ -26,6 +27,7 @@
@MPIEXEC@ -n 4 ./tst_parallel4
@MPIEXEC@ -n 8 ./tst_parallel4
+# These work but are commented out to speed up the testing.
#@MPIEXEC@ -n 16 ./tst_parallel4
#@MPIEXEC@ -n 32 ./tst_parallel4
#@MPIEXEC@ -n 64 ./tst_parallel4
@@ -42,3 +44,17 @@
@MPIEXEC@ -n 1 ./tst_simplerw_coll_r
@MPIEXEC@ -n 2 ./tst_simplerw_coll_r
@MPIEXEC@ -n 4 ./tst_simplerw_coll_r
+
+# Only run these tests if HDF5 supports parallel filters (v1.10.2 and
+# later).
+if test "@HAS_PAR_FILTERS@" = "yes"; then
+ echo
+ echo "Parallel I/O test with zlib."
+ @MPIEXEC@ -n 1 ./tst_parallel_zlib
+ @MPIEXEC@ -n 4 ./tst_parallel_zlib
+
+ echo
+ echo "Parallel I/O more tests with zlib and szip (if present in HDF5)."
+ @MPIEXEC@ -n 1 ./tst_parallel_compress
+ @MPIEXEC@ -n 4 ./tst_parallel_compress
+fi
diff -Nru netcdf-parallel-4.7.3/nc_test4/test_filter_misc.c netcdf-parallel-4.7.4/nc_test4/test_filter_misc.c
--- netcdf-parallel-4.7.3/nc_test4/test_filter_misc.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/test_filter_misc.c 2020-08-31 10:33:26.000000000 +0000
@@ -309,7 +309,7 @@
void* dst = &baseline[index];
if(size == 8) {
memcpy(src8,src,size);
- NC_filterfix8(src8,0);
+ NC4_filterfix8(src8,0);
src = src8;
}
memcpy(dst,src,size);
diff -Nru netcdf-parallel-4.7.3/nc_test4/test_filter_order.c netcdf-parallel-4.7.4/nc_test4/test_filter_order.c
--- netcdf-parallel-4.7.3/nc_test4/test_filter_order.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/test_filter_order.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,609 @@
+/*
+ Copyright 2018, UCAR/Unidata
+ See COPYRIGHT file for copying and redistribution conditions.
+*/
+
+#include "config.h"
+#include
+#include
+#include
+#include
+#include
+
+#include
+/* Older versions of the hdf library may define H5PL_type_t here */
+#include
+
+#include "netcdf.h"
+#include "netcdf_filter.h"
+
+#undef TESTODDSIZE
+
+#undef DEBUG
+
+#define FILTER_ID 32768
+
+#define MAXERRS 8
+
+#define MAXPARAMS 32
+
+#define MAXDIMS 8
+
+#define TESTFILE "testfilter_reg.nc"
+
+#define NPARAMS 1
+#define PARAMVAL 17
+
+#define NDIMS 4
+static size_t dimsize[NDIMS] = {4,4,4,4};
+static size_t chunksize[NDIMS] = {4,4,4,4};
+
+static size_t ndims = NDIMS;
+
+static size_t totalproduct = 1; /* x-product over max dims */
+static size_t actualproduct = 1; /* x-product over actualdims */
+static size_t chunkproduct = 1; /* x-product over actual chunks */
+
+static int nerrs = 0;
+
+static int ncid, varid;
+static int dimids[MAXDIMS];
+static size_t odom[MAXDIMS];
+static float* array = NULL;
+static float* expected = NULL;
+
+static size_t nparams = 0;
+static unsigned int params[MAXPARAMS];
+static unsigned int baseline[2][NPARAMS] = {{0},{1}};
+
+static struct Base {
+ unsigned int id;
+ H5Z_class2_t* info;
+} baseinfo;
+
+static const H5Z_class2_t H5Z_REG[2];
+
+/* Forward */
+static int filter_test1(void);
+static void init(int argc, char** argv);
+static void reset(void);
+static void odom_reset(void);
+static int odom_more(void);
+static int odom_next(void);
+static int odom_offset(void);
+static float expectedvalue(void);
+static void verifyparams(int);
+
+#define ERRR do { \
+fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
+fprintf(stderr, "Sorry! Unexpected result, %s, line: %d\n", \
+ __FILE__, __LINE__); \
+nerrs++;\
+} while (0)
+
+static int
+check(int err,int line)
+{
+ if(err != NC_NOERR) {
+ fprintf(stderr,"fail (%d): %s\n",line,nc_strerror(err));
+ }
+ return NC_NOERR;
+}
+
+static void
+report(const char* msg, int lineno)
+{
+ fprintf(stderr,"fail: line=%d %s\n",lineno,msg);
+ exit(1);
+}
+
+#define CHECK(x) check(x,__LINE__)
+#define REPORT(x) report(x,__LINE__)
+
+static int
+verifychunks(void)
+{
+ int i;
+ int store = -1;
+ size_t localchunks[MAXDIMS];
+ memset(localchunks,0,sizeof(localchunks));
+ CHECK(nc_inq_var_chunking(ncid, varid, &store, localchunks));
+ if(store != NC_CHUNKED) {
+ fprintf(stderr,"bad chunk store\n");
+ return 0;
+ }
+ for(i=0;iid != base->id)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: id mismatch\n");}
+#ifdef USE_HDF5
+ H5Z_class2_t* h5info = info->info;
+ H5Z_class2_t* h5base = base->info;
+ if(info->id != base->id)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: id mismatch\n");}
+ if(h5info->encoder_present != h5base->encoder_present)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: encoder_present mismatch\n");}
+ if(h5info->decoder_present != h5base->decoder_present)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: decoder_present mismatch\n");}
+ if(h5info->decoder_present != h5base->decoder_present)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: decoder_present mismatch\n");}
+ if(strcmp(h5info->name,h5base->name) != 0)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: name mismatch\n");}
+ if(h5info->can_apply != h5base->can_apply)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: can_apply mismatch\n");}
+ if(h5info->set_local != h5base->set_local)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: set_local mismatch\n");}
+ if(h5info->filter != h5base->filter)
+ {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: filter mismatch\n");}
+#else
+ stat = NC_ENOTBUILT; fprintf(stderr,"Unknown format\n")}
+#endif
+ return stat;
+}
+
+static void
+registerfilters(void)
+{
+ struct Base inqinfo;
+
+ /* Register filter 0 */
+ baseinfo.id = FILTER_ID;
+ baseinfo.info = (H5Z_class2_t*)&H5Z_REG[0];
+ CHECK(nc_filter_client_register(baseinfo.id,baseinfo.info));
+ /* Verify by inquiry */
+ memset(&inqinfo,0,sizeof(struct Base));
+ inqinfo.id = FILTER_ID;
+ if((inqinfo.info = (H5Z_class2_t*)calloc(1,sizeof(H5Z_class2_t))) == NULL)
+ CHECK(NC_ENOMEM);
+ CHECK((nc_filter_client_inq(inqinfo.id,(void*)inqinfo.info)));
+ CHECK((verifyfilterinfo(&inqinfo,&baseinfo)));
+ nullfree(inqinfo.info);
+
+ /* Register filter 1 */
+ baseinfo.id = FILTER_ID+1;
+ baseinfo.info = (H5Z_class2_t*)&H5Z_REG[1];
+ CHECK(nc_filter_client_register(baseinfo.id,baseinfo.info));
+ /* Verify by inquiry */
+ memset(&inqinfo,0,sizeof(struct Base));
+ inqinfo.id = FILTER_ID+1;
+ if((inqinfo.info = (H5Z_class2_t*)calloc(1,sizeof(H5Z_class2_t))) == NULL)
+ CHECK(NC_ENOMEM);
+ CHECK((nc_filter_client_inq(inqinfo.id,(void*)inqinfo.info)));
+ CHECK((verifyfilterinfo(&inqinfo,&baseinfo)));
+ nullfree(inqinfo.info);
+}
+
+static void
+setvarfilter(int index)
+{
+ /* NOOP the params */
+ CHECK(nc_def_var_filter(ncid,varid,FILTER_ID+index,NPARAMS,baseline[index]));
+ verifyparams(index);
+}
+
+static void
+verifyparams(int index)
+{
+ int i;
+ CHECK(nc_inq_var_filter_info(ncid,varid,FILTER_ID+index,&nparams,params));
+ if(nparams != NPARAMS) REPORT("nparams mismatch");
+ for(i=0;i= MAXERRS)
+ break;
+ }
+ }
+ } else
+ {
+ odom_reset();
+ while(odom_more()) {
+ int offset = odom_offset();
+ float expect = expectedvalue();
+ if(array[offset] != expect) {
+ fprintf(stderr,"data mismatch: array[%d]=%f expected=%f\n",
+ offset,array[offset],expect);
+ errs++;
+ if(errs >= MAXERRS)
+ break;
+ }
+ odom_next();
+ }
+ }
+
+ if(errs == 0)
+ printf("no data errors\n");
+ return (errs == 0);
+}
+
+static void
+showparameters(void)
+{
+ int i;
+ printf("test: nparams=%ld: params=",(unsigned long)nparams);
+ for(i=0;i=0;i--) {
+ odom[i] += 1;
+ if(odom[i] < dimsize[i]) break;
+ if(i == 0) return 0; /* leave the 0th entry if it overflows*/
+ odom[i] = 0; /* reset this position*/
+ }
+ return 1;
+}
+
+static int
+odom_offset(void)
+{
+ int i;
+ int offset = 0;
+ for(i=0;i 0?1:0);
+}
+
+/**************************************************/
+/* In-line filter code */
+
+#define H5Z_FILTER_REG0 FILTER_ID
+#define H5Z_FILTER_REG1 (FILTER_ID+1)
+
+#ifndef DLL_EXPORT
+#define DLL_EXPORT
+#endif
+
+static int paramcheck(size_t nparams, const unsigned int* params);
+
+/* Forward */
+static int paramcheck(size_t nparams, const unsigned int* params);
+
+/* Make this explicit */
+/*
+ * The "can_apply" callback returns positive a valid combination, zero for an
+ * invalid combination and negative for an error.
+ */
+static htri_t
+H5Z_reg_can_apply(hid_t dcpl_id, hid_t type_id, hid_t space_id)
+{
+ return 1; /* Assume it can always apply */
+}
+
+/*
+As a filter, it is the identity function,
+passing input to output unchanged.
+*/
+
+size_t
+H5Z_filter_reg(unsigned int flags, size_t cd_nelmts,
+ const unsigned int cd_values[], size_t nbytes,
+ size_t *buf_size, void **buf)
+{
+ void* newbuf;
+
+ if(cd_nelmts == 0)
+ goto fail;
+
+ if(!paramcheck(cd_nelmts,cd_values))
+ goto fail;
+
+ printf("Apply filter: %u\n",cd_values[0]);
+
+ if (flags & H5Z_FLAG_REVERSE) {
+ /* Replace buffer */
+#ifdef HAVE_H5ALLOCATE_MEMORY
+ newbuf = H5allocate_memory(*buf_size,0);
+#else
+ newbuf = malloc(*buf_size);
+#endif
+ if(newbuf == NULL) abort();
+ if(*buf != NULL) {
+ memcpy(newbuf,*buf,*buf_size);
+ /* reclaim old buffer */
+#ifdef HAVE_H5FREE_MEMORY
+ H5free_memory(*buf);
+#else
+ free(*buf);
+#endif
+ }
+ *buf = newbuf;
+
+ } else {
+
+ /* Replace buffer */
+#ifdef HAVE_H5ALLOCATE_MEMORY
+ newbuf = H5allocate_memory(*buf_size,0);
+#else
+ newbuf = malloc(*buf_size);
+#endif
+ if(newbuf == NULL) abort();
+ if(*buf != NULL) {
+ memcpy(newbuf,*buf,*buf_size);
+ /* reclaim old buffer */
+#ifdef HAVE_H5FREE_MEMORY
+ H5free_memory(*buf);
+#else
+ free(*buf);
+#endif
+ }
+ *buf = newbuf;
+
+ }
+
+ return *buf_size;
+
+fail:
+ return 0;
+}
+
+static int
+paramcheck(size_t nparams, const unsigned int* params)
+{
+ if(nparams != 1) {
+ fprintf(stderr,"Incorrect parameter count: need=1 sent=%ld\n",(unsigned long)nparams);
+ goto fail;
+ }
+
+ return 1;
+
+fail:
+ return 0;
+}
+
+static const H5Z_class2_t H5Z_REG[2] = {
+{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ (H5Z_filter_t)(H5Z_FILTER_REG0), /* Filter id number */
+ 1, /* encoder_present flag (set to true) */
+ 1, /* decoder_present flag (set to true) */
+ "registered0", /* Filter name for debugging */
+ (H5Z_can_apply_func_t)H5Z_reg_can_apply, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)H5Z_filter_reg, /* The actual filter function */
+},
+{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ (H5Z_filter_t)(H5Z_FILTER_REG1), /* Filter id number */
+ 1, /* encoder_present flag (set to true) */
+ 1, /* decoder_present flag (set to true) */
+ "registered1", /* Filter name for debugging */
+ (H5Z_can_apply_func_t)H5Z_reg_can_apply, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)H5Z_filter_reg, /* The actual filter function */
+}
+};
diff -Nru netcdf-parallel-4.7.3/nc_test4/test_filter_reg.c netcdf-parallel-4.7.4/nc_test4/test_filter_reg.c
--- netcdf-parallel-4.7.3/nc_test4/test_filter_reg.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/test_filter_reg.c 2020-08-31 10:33:26.000000000 +0000
@@ -57,7 +57,10 @@
static unsigned int params[MAXPARAMS];
static unsigned int baseline[NPARAMS] = {PARAMVAL};
-static NC_FILTER_INFO baseinfo;
+static struct Base {
+ unsigned int id;
+ H5Z_class2_t* info;
+} baseinfo;
static const H5Z_class2_t H5Z_REG[1];
@@ -84,6 +87,7 @@
{
if(err != NC_NOERR) {
fprintf(stderr,"fail (%d): %s\n",line,nc_strerror(err));
+ nerrs++;
}
return NC_NOERR;
}
@@ -137,21 +141,14 @@
}
static int
-verifyfilterinfo(NC_FILTER_INFO* info, NC_FILTER_INFO* base)
+verifyfilterinfo(struct Base* info, struct Base* base)
{
int stat = NC_NOERR;
- if(info->version != base->version)
- {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: version mismatch\n");}
- if(info->format != base->format)
- {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: format mismatch\n");}
if(info->id != base->id)
{stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: id mismatch\n");}
- if(info->format == NC_FILTER_FORMAT_HDF5) {
#ifdef USE_HDF5
H5Z_class2_t* h5info = (H5Z_class2_t*)info->info;
H5Z_class2_t* h5base = (H5Z_class2_t*)base->info;
- if(h5info->version != h5base->version)
- {stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: version mismatch\n");}
if(h5info->id != h5base->id)
{stat = NC_EINVAL; fprintf(stderr,"verifyfilterinfo: H5Z_class_t: id mismatch\n");}
if(h5info->encoder_present != h5base->encoder_present)
@@ -171,46 +168,51 @@
#else
stat = NC_ENOTBUILT; fprintf(stderr,"Unknown format\n")}
#endif
- } else
- {stat = NC_EINVAL; fprintf(stderr,"Unknown format\n");}
-
return stat;
}
static void
registerfilter(void)
{
- NC_FILTER_INFO inqinfo;
+ struct Base inqinfo;
- baseinfo.version = NC_FILTER_INFO_VERSION;
- baseinfo.format = NC_FILTER_FORMAT_HDF5;
baseinfo.id = FILTER_ID;
- baseinfo.info = (void*)&H5Z_REG[0];
- CHECK(nc_filter_register(&baseinfo));
+ baseinfo.info = (H5Z_class2_t*)&H5Z_REG[0];
+ CHECK(nc_filter_client_register(baseinfo.id,baseinfo.info));
/* Verify by inquiry */
- memset(&inqinfo,0,sizeof(NC_FILTER_INFO));
- CHECK((nc_filter_inq(NC_FILTER_FORMAT_HDF5, FILTER_ID, &inqinfo)));
+ memset(&inqinfo,0,sizeof(struct Base));
+ inqinfo.id = FILTER_ID;
+ inqinfo.info = calloc(1,sizeof(H5Z_class2_t));
+ if(inqinfo.info == NULL) CHECK(NC_ENOMEM);
+ CHECK((nc_filter_client_inq(inqinfo.id,(void*)inqinfo.info)));
CHECK((verifyfilterinfo(&inqinfo,&baseinfo)));
+ nullfree(inqinfo.info);
}
static void
unregisterfilter(void)
{
int stat = NC_NOERR;
- NC_FILTER_INFO inqinfo;
+ struct Base inqinfo;
/* Verify that the filter info is still good */
- memset(&inqinfo,0,sizeof(NC_FILTER_INFO));
- CHECK((stat = nc_filter_inq(NC_FILTER_FORMAT_HDF5, FILTER_ID, &inqinfo)));
+ memset(&inqinfo,0,sizeof(struct Base));
+ inqinfo.id = FILTER_ID;
+ inqinfo.info = calloc(1,sizeof(H5Z_class2_t));
+ if(inqinfo.info == NULL) CHECK(NC_ENOMEM);
+ CHECK((stat=nc_filter_client_inq(inqinfo.id,(void*)inqinfo.info)));
CHECK((verifyfilterinfo(&inqinfo,&baseinfo)));
/* Unregister */
- CHECK((stat = nc_filter_unregister(NC_FILTER_FORMAT_HDF5, FILTER_ID)));
+ inqinfo.id = FILTER_ID;
+ CHECK((stat = nc_filter_client_unregister(inqinfo.id)));
/* Inq again to verify unregistered */
- stat = nc_filter_inq(NC_FILTER_FORMAT_HDF5, FILTER_ID, NULL);
- if(stat != NC_EFILTER) {
+ inqinfo.id = FILTER_ID;
+ stat=nc_filter_client_inq(inqinfo.id,(void*)inqinfo.info);
+ if(stat != NC_ENOFILTER) {
fprintf(stderr,"unregister: failed\n");
CHECK(NC_EFILTER);
}
+ nullfree(inqinfo.info);
}
static void
diff -Nru netcdf-parallel-4.7.3/nc_test4/test_szip.c netcdf-parallel-4.7.4/nc_test4/test_szip.c
--- netcdf-parallel-4.7.3/nc_test4/test_szip.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/test_szip.c 2020-08-31 10:33:26.000000000 +0000
@@ -47,6 +47,7 @@
int ncid, varid, dimids[2];
size_t dims[2], chunk_size[2];
unsigned int szip_params[2]; /* [0]=options_mask [1]=pixels_per_block */
+ int options_mask_in, pixels_per_block_in;
int errcnt = 0;
/* Create a new file using read/write access. */
@@ -79,12 +80,9 @@
*/
szip_params[0] = H5_SZIP_NN_OPTION_MASK;
szip_params[1] = H5_SZIP_MAX_PIXELS_PER_BLOCK_IN;
- { int stat = nc_def_var_filter(ncid, varid, HDF5_FILTER_SZIP, 2, szip_params);
- if(stat) {
- fprintf(stderr,"XXX: %d %s\b",stat,nc_strerror(stat));
- ERR;
- }
- }
+ if(nc_def_var_filter(ncid, varid, HDF5_FILTER_SZIP, 2, szip_params)) ERR;
+ if(nc_inq_var_szip(ncid, varid, &options_mask_in, &pixels_per_block_in)) ERR;
+ if(!(options_mask_in & H5_SZIP_NN_OPTION_MASK)) ERR;
#endif
if(nc_enddef(ncid)) ERR;
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_dims3.c netcdf-parallel-4.7.4/nc_test4/tst_dims3.c
--- netcdf-parallel-4.7.3/nc_test4/tst_dims3.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_dims3.c 2020-08-31 10:33:26.000000000 +0000
@@ -12,6 +12,14 @@
#include
#include "err_macros.h"
+#define NDIM2 2
+#define VAR_NAME "var"
+#define DIM_NAME1 "y"
+#define DIM_NAME2 "x"
+#define NY 3
+#define NX 3
+#define DIM_LEN 2
+
int
main(int argc, char **argv)
{
@@ -235,5 +243,152 @@
if (nc_close(ncid)) ERR;
}
SUMMARIZE_ERR;
+
+ printf("*** testing very simple case writing data with 2 unlim dims...");
+ {
+ /* This test code based on test code from Jeff Whitaker. See
+ * https://github.com/Unidata/netcdf4-python/issues/1413. This
+ * is a simplified version. */
+ int varid1, varid, ncid;
+ int dimids[NDIM2];
+ size_t start[1] = {0};
+ size_t count[1] = {NY};
+ int ydata[NY];
+ int y, i;
+ size_t len_in;
+
+ /* Fill Y data array. */
+ for (i = 0; i < NY; ++i)
+ ydata[i] = i;
+
+ /* Create a file. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+
+ /* Define two unlimited dims. */
+ if (nc_def_dim(ncid, DIM_NAME1, NC_UNLIMITED, &dimids[0])) ERR;
+ if (nc_def_dim(ncid, DIM_NAME2, NC_UNLIMITED, &dimids[1])) ERR;
+
+ /* Define coord var for first dim Y. */
+ if (nc_def_var(ncid, DIM_NAME1, NC_INT, 1, &dimids[0], &varid1)) ERR;
+
+ /* Define a data var with dims Y,X. */
+ if (nc_def_var(ncid, VAR_NAME, NC_INT, NDIM2, dimids, &varid)) ERR;
+
+ /* Write data to coordinate var to extend Y. */
+ if (nc_put_vara_int(ncid, varid1, start, count, ydata)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen the file and check. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_dimlen(ncid, 0, &len_in)) ERR;
+ if (len_in != NY) ERR;
+ if (nc_inq_dimlen(ncid, 1, &len_in)) ERR;
+ if (len_in != 0) ERR;
+
+ /* Read and check each value of the coordinate var. */
+ for (y = 0; y < NY; y++)
+ {
+ size_t index = y;
+ int data_in;
+
+ if (nc_get_var1_int(ncid, varid1, &index, &data_in)) ERR;
+ if (data_in != y) ERR;
+ }
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("*** testing simple case writing data with 2 unlim dims...");
+ {
+ /* This test code based on test code from Jeff Whitaker. See
+ * https://github.com/Unidata/netcdf4-python/issues/1413. This
+ * is a simplified version. */
+ int varid1, varid, ncid;
+ int dimids[NDIM2];
+ size_t start[1] = {0};
+ size_t count[1] = {NY};
+ size_t start2[NDIM2] = {0, 2};
+ size_t count2[NDIM2] = {1, 1};
+ int ydata[NY];
+ int data = TEST_VAL_42;
+ int x, y, i;
+
+ /* Fill Y data array. */
+ for (i = 0; i < NY; ++i)
+ ydata[i] = i;
+
+ /* Create a file. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+
+ /* Define two unlimited dims. */
+ if (nc_def_dim(ncid, DIM_NAME1, NC_UNLIMITED, &dimids[0])) ERR;
+ if (nc_def_dim(ncid, DIM_NAME2, NC_UNLIMITED, &dimids[1])) ERR;
+
+ /* Define coord var for first dim Y. */
+ if (nc_def_var(ncid, DIM_NAME1, NC_INT, 1, &dimids[0], &varid1)) ERR;
+
+ /* Define a data var with dims Y,X. */
+ if (nc_def_var(ncid, VAR_NAME, NC_INT, NDIM2, dimids, &varid)) ERR;
+
+ /* Write data to coordinate var to extend Y. */
+ if (nc_put_vara_int(ncid, varid1, start, count, ydata)) ERR;
+ if (nc_sync(ncid)) ERR;
+
+ /* write a single data point to the 2d variable */
+ if (nc_put_vara_int(ncid, varid, start2, count2, &data)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen the file and check. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* Read and check each value with nc_get_var1_int(). */
+ for (x = 0; x < NX; x++)
+ {
+ for (y = 0; y < NY; y++)
+ {
+ size_t index[NDIM2] = {y, x};
+ int data_in;
+
+ if (nc_get_var1_int(ncid, varid, index, &data_in)) ERR;
+ if (y == start2[0] && x == start2[1])
+ {
+ if (data_in != data) ERR;
+ }
+ else
+ {
+ if (data_in != NC_FILL_INT) ERR;
+ }
+ }
+ }
+
+ /* Read and check each row with nc_get_vara_int(). */
+ for (y = 0; y < NY; y++)
+ {
+ size_t start_row[NDIM2] = {y, 0};
+ size_t count_row[NDIM2] = {1, NX};
+ int data_in[NX];
+
+ if (nc_get_vara_int(ncid, varid, start_row, count_row,
+ data_in)) ERR;
+ if (y == start2[0])
+ {
+ /* This row has data. */
+ for (x = 0; x < NX; x++)
+ if (data_in[x] != (x == start2[1] ? TEST_VAL_42 : NC_FILL_INT)) ERR;
+ }
+ else
+ {
+ /* This row is all fill. */
+ for (x = 0; x < NX; x++)
+ {
+ printf("y %d x %d data %d\n", y, x, data_in[x]);
+ if (data_in[x] != NC_FILL_INT) ERR;
+ }
+ }
+ }
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_filterparser.c netcdf-parallel-4.7.4/nc_test4/tst_filterparser.c
--- netcdf-parallel-4.7.3/nc_test4/tst_filterparser.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_filterparser.c 2020-08-31 10:33:26.000000000 +0000
@@ -115,7 +115,7 @@
static unsigned int baseline[MAXPARAMS]; /* Expected */
static const char* spec =
-"32768, -17b, 23ub, -25S, 27US, 77, 93U, 2147483647, -2147483648, 4294967295U, 789f, -9223372036854775807L, 18446744073709551615UL, 12345678.12345678d";
+"user-defined, -17b, 23ub, -25S, 27US, 77, 93U, 2147483647, -2147483648, 4294967295U, 789f, -9223372036854775807L, 18446744073709551615UL, 12345678.12345678d";
/* Define the type strings for each spec entry */
static const char* spectype[] = {"i", "b", "ub", "s", "us", "i", "ui", "i", "i", "ui", "f", "ll", "ull", "d"};
@@ -187,67 +187,69 @@
main(int argc, char **argv)
{
int stat = 0;
- unsigned int id = 0;
- size_t i,nparams = 0;
- unsigned int* params = NULL;
+ size_t i;
/* Provide for 8-byte values */
long long basell;
unsigned long long baseull;
float basef;
double based;
+ NC4_Filterspec* pfs = NULL;
printf("\nTesting filter parser.\n");
buildbaseline(); /* Build our comparison vector */
- stat = NC_parsefilterspec(spec,&id,&nparams,¶ms);
+ stat = NC_parsefilterspec(spec,NC_FILTER_FORMAT_HDF5,(NC_Filterspec**)&pfs);
if(stat) {
fprintf(stderr,"NC_parsefilterspec failed\n");
exit(1);
}
- if(id != PARAMS_ID)
- fprintf(stderr,"mismatch: id: expected=%u actual=%u\n",PARAMS_ID,id);
+
+ if(pfs->filterid != PARAMS_ID)
+ fprintf(stderr,"mismatch: id: expected=%u actual=%u\n",(unsigned int)PARAMS_ID,pfs->filterid);
/* Do all the 32 bit tests */
for(i=0;i<=8;i++) {
- if(baseline[i] != params[i])
- mismatch(i,params,spectype[i]);
+ if(baseline[i] != pfs->params[i])
+ mismatch(i,pfs->params,spectype[i]);
}
/* float */
- uf.ui = params[9];
+ uf.ui = pfs->params[9];
memcpy(&basef,&baseline[9],4);
if(uf.f != basef)
- mismatch(9,params,"uf.f");
+ mismatch(9,pfs->params,"uf.f");
/* signed long long */
- ul.ui[0] = params[10];
- ul.ui[1] = params[11];
- NC_filterfix8((unsigned char*)&ul.ll,1);
+ ul.ui[0] = pfs->params[10];
+ ul.ui[1] = pfs->params[11];
+ NC4_filterfix8((unsigned char*)&ul.ll,1);
memcpy(&basell,&baseline[10],8);
if(ul.ll != basell)
- mismatch2(10,params,"ul.ll");
+ mismatch2(10,pfs->params,"ul.ll");
/* unsigned long long */
- ul.ui[0] = params[12];
- ul.ui[1] = params[13];
- NC_filterfix8((unsigned char*)&ul.ull,1);
+ ul.ui[0] = pfs->params[12];
+ ul.ui[1] = pfs->params[13];
+ NC4_filterfix8((unsigned char*)&ul.ull,1);
memcpy(&baseull,&baseline[12],8);
if(ul.ull != baseull)
- mismatch2(12,params,"ul.ull");
+ mismatch2(12,pfs->params,"ul.ull");
/* double */
- ud.ui[0] = params[14];
- ud.ui[1] = params[15];
- NC_filterfix8((unsigned char*)&ud.d,1);
+ ud.ui[0] = pfs->params[14];
+ ud.ui[1] = pfs->params[15];
+ NC4_filterfix8((unsigned char*)&ud.d,1);
memcpy(&based,&baseline[14],8);
if(ud.d != based)
- mismatch2(14,params,"ud.d");
+ mismatch2(14,pfs->params,"ud.d");
if (!nerrs)
printf("SUCCESS!!\n");
- if(params) free(params);
+ if(pfs && pfs->params) free(pfs->params);
+ if(pfs) free(pfs);
+
return (nerrs > 0 ? 1 : 0);
}
@@ -284,151 +286,6 @@
return type;
}
-static int
-parsefilterspec(const char* spec, unsigned int* idp, size_t* nparamsp, unsigned int** paramsp)
-{
- int stat = NC_NOERR;
- int sstat; /* for scanf */
- char* p;
- char* sdata = NULL;
- unsigned int id;
- size_t count; /* no. of comma delimited params */
- size_t nparams; /* final no. of unsigned ints */
- size_t len;
- int i;
- unsigned int* ulist = NULL;
- unsigned char mem[8];
-
- if(spec == NULL || strlen(spec) == 0) goto fail;
- sdata = strdup(spec);
-
- /* Count number of parameters + id and delimit */
- p=sdata;
- for(count=0;;count++) {
- char* q = strchr(p,',');
- if(q == NULL) break;
- *q++ = '\0';
- p = q;
- }
- count++; /* for final piece */
-
- if(count == 0)
- goto fail; /* no id and no parameters */
-
- /* Extract the filter id */
- p = sdata;
- sstat = sscanf(p,"%u",&id);
- if(sstat != 1) goto fail;
- /* skip past the filter id */
- p = p + strlen(p) + 1;
- count--;
-
- /* Allocate the max needed space; *2 in case the params are all doubles */
- ulist = (unsigned int*)malloc(sizeof(unsigned int)*(count)*2);
- if(ulist == NULL) goto fail;
-
- /* walk and convert */
- nparams = 0; /* actual count */
- for(i=0;i 2 => we might have a two letter tag */
- q = (p + len) - 2;
- type = gettype(*q,*(q+1),&isunsigned);
- break;
- }
-
- /* Now parse */
- switch (type) {
- case 'b':
- case 's':
- case 'i':
- /* special case for a positive integer;for back compatibility.*/
- if(!isnegative)
- sstat = sscanf(p,"%u",&val32u);
- else
- sstat = sscanf(p,"%d",(int*)&val32u);
- if(sstat != 1) goto fail;
- switch(type) {
- case 'b': val32u = (val32u & 0xFF); break;
- case 's': val32u = (val32u & 0xFFFF); break;
- }
- ulist[nparams++] = val32u;
- break;
-
- case 'f':
- sstat = sscanf(p,"%lf",&vald);
- if(sstat != 1) goto fail;
- valf = (float)vald;
- ulist[nparams++] = *(unsigned int*)&valf;
- break;
-
- /* The following are 8-byte values, so we must swap pieces if this
- is a little endian machine */
- case 'd':
- sstat = sscanf(p,"%lf",&vald);
- if(sstat != 1) goto fail;
- memcpy(mem,&vald,sizeof(mem));
- NC_filterfix8(mem,0);
- vector = (unsigned int*)mem;
- ulist[nparams++] = vector[0];
- ulist[nparams++] = vector[1];
- break;
- case 'l': /* long long */
- if(isunsigned)
- sstat = sscanf(p,"%llu",&val64u);
- else
- sstat = sscanf(p,"%lld",(long long*)&val64u);
- if(sstat != 1) goto fail;
- memcpy(mem,&val64u,sizeof(mem));
- NC_filterfix8(mem,0);
- vector = (unsigned int*)&mem;
- ulist[nparams++] = vector[0];
- ulist[nparams++] = vector[1];
- break;
- default:
- goto fail;
- }
- p = p + strlen(p) + 1; /* move to next param */
- }
- /* Now return results */
- if(idp) *idp = id;
- if(nparamsp) *nparamsp = nparams;
- if(paramsp) {
- *paramsp = ulist;
- ulist = NULL; /* avoid duplicate free */
- }
-done:
- if(sdata) free(sdata);
- if(ulist) free(ulist);
- return stat;
-fail:
- stat = NC_EFILTER;
- goto done;
-}
-
#ifdef WORDS_BIGENDIAN
/* Byte swap an 8-byte integer in place */
static void
@@ -464,8 +321,9 @@
#endif
+#if 0
static void
-NC_filterfix8(unsigned char* mem, int decode)
+NC4_filterfix8(unsigned char* mem, int decode)
{
#ifdef WORDS_BIGENDIAN
if(decode) { /* Apply inverse of the encode case */
@@ -481,6 +339,7 @@
/* No action is necessary */
#endif
}
+#endif
#endif /*DEBUG*/
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_filter.sh netcdf-parallel-4.7.4/nc_test4/tst_filter.sh
--- netcdf-parallel-4.7.3/nc_test4/tst_filter.sh 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_filter.sh 2020-08-31 10:33:26.000000000 +0000
@@ -10,6 +10,8 @@
UNK=1
NGC=1
MISC=1
+MULTI=1
+ORDER=1
# Load the findplugins function
. ${builddir}/findplugin.sh
@@ -19,10 +21,10 @@
# These attributes might be platform dependent
sclean() {
cat $1 \
+ | sed -e '/:_IsNetcdf4/d' \
| sed -e '/:_Endianness/d' \
| sed -e '/_NCProperties/d' \
| sed -e '/_SuperblockVersion/d' \
- | sed -e '/_IsNetcdf4/d' \
| cat > $2
}
@@ -51,6 +53,14 @@
if ! test -f ${BZIP2PATH} ; then echo "Unable to locate ${BZIP2PATH}"; exit 1; fi
if ! test -f ${MISCPATH} ; then echo "Unable to locate ${MISCPATH}"; exit 1; fi
+# See if we have szip
+HAVE_SZIP=0
+if test -f ${TOPBUILDDIR}/libnetcdf.settings ; then
+ if grep "SZIP Support:[ ]*yes" <${TOPBUILDDIR}/libnetcdf.settings ; then
+ HAVE_SZIP=1
+ fi
+fi
+
# Execute the specified tests
if test "x$API" = x1 ; then
@@ -117,8 +127,8 @@
diff -b -w ${srcdir}/ref_filteredvv.cdl ./filteredvv.dump
echo " *** Pass: nccopy '*' filter"
-echo " *** Testing 'v|v' filter application"
-${NCCOPY} -M0 -F "var1|/g/var2,307,9,4" unfilteredvv.nc filteredvbar.nc
+echo " *** Testing 'v&v' filter application"
+${NCCOPY} -M0 -F "var1&/g/var2,307,9,4" unfilteredvv.nc filteredvbar.nc
${NCDUMP} -n filteredvv -s filteredvbar.nc > ./tst_filtervbar.txt
# Remove irrelevant -s output
sclean ./tst_filtervbar.txt ./filteredvbar.dump
@@ -135,19 +145,19 @@
echo " *** Pass: pass-thru of filters"
echo " *** Testing -F none"
-rm -f ./tst_filter.txt ./tst_filter2.txt ./tst_filter.nc
-${NCCOPY} -M0 -F none ./filtered.nc ./tst_filter.nc
-${NCDUMP} -s tst_filter.nc > ./tst_filter.txt
-sed -e '/_Filter/p' -e d < ./tst_filter.txt >./tst_filter2.txt
-test ! -s tst_filter2.txt
+rm -f ./tst_none.txt ./tst_none2.txt ./tst_none.nc
+${NCCOPY} -M0 -F none ./filtered.nc ./tst_none.nc
+${NCDUMP} -hs tst_none.nc > ./tst_none.txt
+sed -e '/_Filter/p' -e d < ./tst_none.txt >./tst_none2.txt
+test ! -s tst_none2.txt
echo " *** Pass: -F none"
echo " *** Testing -F var,none "
-rm -f ./tst_filter.txt ./tst_filter.nc
-${NCCOPY} -M0 -F "/g/var,none" ./filtered.nc ./tst_filter.nc
-${NCDUMP} -s tst_filter.nc > ./tst_filter.txt
-sed -e '/_Filter/p' -e d < ./tst_filter.txt >tst_filter2.txt
-test ! -s tst_filter2.txt
+rm -f ./tst_vnone.txt ./tst_vnone.nc tst_vnone2.txt
+${NCCOPY} -M0 -F "/g/var,none" ./filtered.nc ./tst_vnone.nc
+${NCDUMP} -s tst_vnone.nc > ./tst_vnone.txt
+sed -e '/_Filter/p' -e d < ./tst_vnone.txt >tst_vnone2.txt
+test ! -s tst_vnone2.txt
echo " *** Pass: -F var,none"
echo "*** Pass: all nccopy filter tests"
@@ -183,13 +193,54 @@
echo "*** Pass: ncgen dynamic filter"
fi
-#cleanup
-rm -f ./bzip*.nc ./unfiltered.nc ./filtered.nc ./tst_filter.txt ./tst_filter2.txt *.dump bzip*hdr.*
-rm -f ./test_bzip2.c
-rm -f ./testmisc.nc
-rm -f ./tst_filter2.nc
-rm -f ./unfilteredvv.nc ./filteredvv.nc ./filteredvbar.nc
-rm -f ./tst_filtervv.txt ./tst_filtervbar.txt
+if test "x$MULTI" = x1 ; then
+echo "*** Testing multiple filters"
+rm -f ./multifilter.nc ./multi.txt ./smulti.cdl
+rm -f nccopyF.cdl nccopyF.nc ncgenF.cdl ncgenF.nc
+${execdir}/tst_multifilter
+${NCDUMP} -hs ./multifilter.nc >./multi.cdl
+# Remove irrelevant -s output
+sclean ./multi.cdl ./smulti.cdl
+diff -b -w ${srcdir}/ref_multi.cdl ./smulti.cdl
+echo "*** nccopy -F with multiple filters"
+if ! test -f unfiltered.nc ; then
+ ${NCGEN} -4 -lb -o unfiltered.nc ${srcdir}/ref_unfiltered.cdl
+fi
+${NCCOPY} "-F/g/var,307,4|40000" unfiltered.nc nccopyF.nc
+${NCDUMP} -hs nccopyF.nc > ./nccopyF.cdl
+sclean nccopyF.cdl nccopyFs.cdl
+diff -b -w ${srcdir}/ref_nccopyF.cdl ./nccopyFs.cdl
+echo "*** ncgen with multiple filters"
+${NCGEN} -4 -lb -o ncgenF.nc ${srcdir}/ref_nccopyF.cdl
+# Need to fix name using -n
+${NCDUMP} -hs -n nccopyF ncgenF.nc > ./ncgenF.cdl
+sclean ncgenF.cdl ncgenFs.cdl
+diff -b -w ${srcdir}/ref_nccopyF.cdl ./ncgenFs.cdl
+echo "*** Pass: multiple filters"
+fi
+
+if test "x$MULTI" = x1 ; then
+echo "*** Testing multiple filter order of invocation"
+rm -f filterorder.txt
+${execdir}/test_filter_order >filterorder.txt
+diff -b -w ${srcdir}/ref_filter_order.txt filterorder.txt
+fi
+
echo "*** Pass: all selected tests passed"
+#cleanup
+rm -f testmisc.nc
+rm -f unfiltered.nc unfilteredvv.nc filtered.nc filtered.dump
+rm -f filteredvv.nc tst_filtervv.txt filteredvv.dump
+rm -f filteredvbar.nc tst_filtervbar.txt filteredvbar.dump
+rm -f tst_filter2.nc tst_filter2.txt
+rm -f tst_none.nc tst_none.txt tst_none2.txt testfilter_reg.nc
+rm -f tst_vnone.nc tst_vnone.txt tst_vnone2.txt
+rm -f bzip2.nc bzip2.dump tst_filter.txt bzip2x.dump
+rm -f test_bzip2.c
+rm -f multifilter.nc multi.cdl smulti.cdl
+rm -f nccopyF.nc nccopyF.cdl ncgenF.nc ncgenF.cdl
+rm -f filterorder.txt
+rm -f ncgenFs.cdl nccopyFs.cdl
exit 0
+
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_h_vl2.c netcdf-parallel-4.7.4/nc_test4/tst_h_vl2.c
--- netcdf-parallel-4.7.3/nc_test4/tst_h_vl2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_h_vl2.c 2020-08-31 10:33:26.000000000 +0000
@@ -19,7 +19,11 @@
{
hid_t fileid, grpid, fapl_id, hdf_typeid = 0, base_hdf_typeid = 0, attid = 0;
hid_t file_typeid, spaceid, native_typeid;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
char obj_name[NC_MAX_NAME + 1];
hsize_t num_obj, i;
int obj_class;
@@ -41,8 +45,13 @@
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
for (i = 0; i < num_obj; i++)
{
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR_RET;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR_RET;
+#endif
obj_class = obj_info.type;
if ((size = H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i,
NULL, 0, H5P_DEFAULT)) < 0) ERR_RET;
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_interops5.c netcdf-parallel-4.7.4/nc_test4/tst_interops5.c
--- netcdf-parallel-4.7.3/nc_test4/tst_interops5.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_interops5.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,8 +1,10 @@
-/* This is part of the netCDF package. Copyright 2005-2018, University
- Corporation for Atmospheric Research/Unidata. See COPYRIGHT file
+/* This is part of the netCDF package. Copyright 2005-2019, University
+ Corporation for Atmospheric Research/Unidata. See COPYRIGHT file
for conditions of use.
Test that HDF5 and NetCDF-4 can read and write the same file.
+
+ Ed Hartnett
*/
#include
#include
@@ -253,5 +255,24 @@
}
SUMMARIZE_ERR;
#endif /* USE_SZIP */
+ /* This test suggested by user brentd42 to find a memory problem in
+ * function rec_read_metadata(). This test demonstrates the bug on
+ * address sanitizer runs. See
+ * https://github.com/Unidata/netcdf-c/issues/1558. */
+ printf("*** testing error when opening HDF5 file without creating ordering...");
+ {
+ hid_t file_hid;
+ int ncid;
+ char *filename = "tst_interops5.h5";
+
+ /* Create a HDF5 file, but don't set creation ordering on. */
+ file_hid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ H5Fclose(file_hid);
+
+ /* Open the file with netCDF. */
+ nc_set_log_level(3);
+ if (nc_open(filename, NC_WRITE, &ncid) != NC_ECANTWRITE) ERR;
+ }
+ SUMMARIZE_ERR;
FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_mode.c netcdf-parallel-4.7.4/nc_test4/tst_mode.c
--- netcdf-parallel-4.7.3/nc_test4/tst_mode.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_mode.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,16 +1,16 @@
/*! \file
-Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
-2015, 2016, 2017, 2018
-University Corporation for Atmospheric Research/Unidata.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
+ 2015, 2016, 2017, 2018
+ University Corporation for Atmospheric Research/Unidata.
-See \ref copyright file for more info.
+ See \ref copyright file for more info.
- * Test some illegal mode combinations
- *
- */
+ * Test some illegal mode combinations
+ *
+ */
#include "nc_tests.h"
#include "err_macros.h"
@@ -21,37 +21,47 @@
int
main(int argc, char** argv)
{
- int ncid,varid;
- int retval;
+ int ncid,varid,dimid;
+ int retval;
- printf("\n*** Testing illegal mode combinations\n");
+ printf("\n*** Testing illegal mode combinations\n");
- MPI_Init(&argc,&argv);
+ MPI_Init(&argc,&argv);
- printf("*** Testing create + MPIO + fletcher32\n");
- if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
- if ((retval = nc_def_var(ncid,"whatever",NC_INT,0,NULL,&varid))) ERR;
- retval = nc_def_var_fletcher32(ncid,varid,NC_FLETCHER32);
- if(retval != NC_EINVAL) ERR;
- if ((retval = nc_abort(ncid)))
-{
-fprintf(stderr,"XXX: err=%d\n",retval);
-fflush(stderr);
-ERR;
-}
-
- printf("*** Testing create + MPIO + deflation\n");
- if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
- if ((retval = nc_def_var(ncid,"whatever",NC_INT,0,NULL,&varid))) ERR;
- retval = nc_def_var_deflate(ncid,varid, NC_NOSHUFFLE, 1, 1);
- if(retval != NC_EINVAL) ERR;
- if ((retval = nc_abort(ncid))) {
- fprintf(stderr,"XXX: nc_abort: %d\n",retval); fflush(stderr);
- ERR;
- }
+ printf("*** Testing create + MPIO + fletcher32\n");
+ if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
+ if ((retval = nc_def_dim(ncid,"whatever",10,&dimid))) ERR;
+ if ((retval = nc_def_var(ncid,"whatever",NC_INT,1,&dimid,&varid))) ERR;
+ retval = nc_def_var_fletcher32(ncid,varid,NC_FLETCHER32);
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+ if(retval != NC_NOERR) ERR;
+#else
+ if(retval != NC_EINVAL) ERR;
+#endif
+ if ((retval = nc_abort(ncid)))
+ {
+ fprintf(stderr,"XXX: err=%d\n",retval);
+ fflush(stderr);
+ ERR;
+ }
+
+ printf("*** Testing create + MPIO + deflation\n");
+ if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
+ if ((retval = nc_def_dim(ncid,"whatever",10,&dimid))) ERR;
+ if ((retval = nc_def_var(ncid,"whatever",NC_INT,1,&dimid,&varid))) ERR;
+ retval = nc_def_var_deflate(ncid,varid, NC_NOSHUFFLE, 1, 1);
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+ if(retval != NC_NOERR) ERR;
+#else
+ if(retval != NC_EINVAL) ERR;
+#endif
+ if ((retval = nc_abort(ncid))) {
+ fprintf(stderr,"XXX: nc_abort: %d\n",retval); fflush(stderr);
+ ERR;
+ }
- MPI_Finalize();
+ MPI_Finalize();
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_multifilter.c netcdf-parallel-4.7.4/nc_test4/tst_multifilter.c
--- netcdf-parallel-4.7.3/nc_test4/tst_multifilter.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_multifilter.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,316 @@
+/*
+ Copyright 2018, UCAR/Unidata
+ See COPYRIGHT file for copying and redistribution conditions.
+*/
+
+/*! \file
+Test support for multiple filters per variable
+*/
+
+#include "config.h"
+#include
+#include
+#include
+
+#include
+#include "netcdf.h"
+#include "netcdf_filter.h"
+
+/* The HDF assigned id for bzip compression */
+#define BZIP2_ID 307
+/* The compression level used in this example */
+#define BZIP2_LEVEL 9
+
+#define DEFLATE_LEVEL 2
+
+#define NOOP_ID 40000
+
+#define NFILTERS 3
+
+#define TESTFILE "multifilter.nc"
+
+/* Point at which we give up */
+#define MAXERRS 8
+
+#define NDIMS 4
+#define DIMSIZE 4
+#define CHUNKSIZE 4 /* Note: not the total size of the chunk, but size wrt a dim*/
+
+static size_t dimsize = DIMSIZE;
+static size_t chunksize = CHUNKSIZE;
+static size_t actualdims = NDIMS;
+
+static size_t actualproduct = 1; /* x-product over dim sizes */
+static size_t chunkproduct = 1; /* x-product over chunksizes */
+
+static size_t dims[NDIMS];
+static size_t chunks[NDIMS];
+
+static int nerrs = 0;
+
+static int ncid, varid;
+static int dimids[NDIMS];
+static float* array = NULL;
+static float* expected = NULL;
+
+/* Forward */
+static void init(int argc, char** argv);
+static int test_multi(void);
+static int verifychunks(void);
+
+#define ERRR do { \
+fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
+fprintf(stderr, "Sorry! Unexpected result, %s, line: %d\n", \
+ __FILE__, __LINE__); \
+nerrs++;\
+} while (0)
+
+static int
+check(int err,int line)
+{
+ if(err != NC_NOERR) {
+ fprintf(stderr,"fail (%d): %s\n",line,nc_strerror(err));
+ fflush(stderr);
+ exit(1);
+ }
+ return NC_NOERR;
+}
+
+#define CHECK(x) check(x,__LINE__)
+
+/*
+Read the chunking information about the variable
+and verify that it is as expected.
+*/
+
+static int
+verifychunks(void)
+{
+ int i;
+ int store = -1;
+ size_t chunksizes[NDIMS];
+ memset(chunksizes,0,sizeof(chunksizes));
+ CHECK(nc_inq_var_chunking(ncid, varid, &store, chunksizes));
+ /* Storate must be chunked, not contiguous */
+ if(store != NC_CHUNKED) {
+ fprintf(stderr,"bad chunk store\n");
+ return NC_ESTORAGE;
+ }
+ /* Chunk sizes must match our predefined set */
+ for(i=0;i= MAXERRS)
+ break;
+ }
+ }
+ if(errs == 0)
+ printf("no data errors\n");
+ if(actualproduct <= 1)
+ return NC_EBADDIM;
+ return (errs == 0 ? NC_NOERR: NC_EINVAL);
+}
+
+int
+verifyfilters(int ncid, int varid)
+{
+ size_t nfilters, nparams;
+ unsigned int filterids[NFILTERS];
+ unsigned int params[2];
+
+ /* Read back the compression info and verify it */
+ CHECK(nc_inq_var_filterids(ncid,varid,&nfilters,filterids));
+ if(nfilters != NFILTERS) {
+ fprintf(stderr,"Fail: nfilters mismatch: expected=%d actual=%u\n",NFILTERS,(unsigned)nfilters);
+ return NC_EINVAL;
+ }
+ if(filterids[0] != BZIP2_ID
+ || filterids[1] != H5Z_FILTER_DEFLATE
+ || filterids[2] != NOOP_ID
+ ) {
+ fprintf(stderr,"Fail: filter id mismatch: actual/expected={%u/%u,%u/%u,%u/%u}\n",
+ filterids[0],BZIP2_ID,
+ filterids[1],H5Z_FILTER_DEFLATE,
+ filterids[2],NOOP_ID);
+ return NC_EINVAL;
+ }
+ /* Get level for each filter */
+ CHECK(nc_inq_var_filter_info(ncid,varid,BZIP2_ID,&nparams,params));
+ if(nparams != 1) {
+ fprintf(stderr,"Fail: nparams mismatch: id=%u expected=1 actual=%u\n",filterids[0],(unsigned)nparams);
+ return NC_EINVAL;
+ }
+ if(params[0] != BZIP2_LEVEL) {
+ fprintf(stderr,"Fail: parameter mismatch: expected=%u actual=%u\n",BZIP2_LEVEL,params[0]);
+ return NC_EINVAL;
+ }
+ CHECK(nc_inq_var_filter_info(ncid,varid,H5Z_FILTER_DEFLATE,&nparams,params));
+ if(nparams != 1) {
+ fprintf(stderr,"Fail: nparams mismatch: id=%u expected=1 actual=%u\n",filterids[1],(unsigned)nparams);
+ return NC_EINVAL;
+ }
+ if(params[0] != DEFLATE_LEVEL) {
+ fprintf(stderr,"Fail: parameter mismatch: expected=%u actual=%u\n",BZIP2_LEVEL,params[0]);
+ return NC_EINVAL;
+ }
+ CHECK(nc_inq_var_filter_info(ncid,varid,NOOP_ID,&nparams,params));
+ if(nparams != 0) {
+ fprintf(stderr,"Fail: parameter mismatch: id=%u nparams: expected=0 actual=%u\n",NOOP_ID,(unsigned)nparams);
+ return NC_EINVAL;
+ }
+ return NC_NOERR;
+}
+
+/*
+Create the file, write it, then re-read for comparison.
+*/
+static int
+test_multi(void)
+{
+ int i;
+ unsigned int params[2];
+
+ printf("\n*** Testing Multi-filter application: filter set = bzip2 deflate noop");
+ printf("\n");
+
+ /* Clear the data array */
+ memset(array,0,sizeof(float)*actualproduct);
+
+ /* Create a file */
+ CHECK(nc_create(TESTFILE, NC_NETCDF4|NC_CLOBBER, &ncid));
+
+ /* Do not use fill for this file */
+ CHECK(nc_set_fill(ncid, NC_NOFILL, NULL));
+
+ /* Define the dimensions */
+ for(i=0;i 0?1:0);
+}
+
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_parallel5.c netcdf-parallel-4.7.4/nc_test4/tst_parallel5.c
--- netcdf-parallel-4.7.3/nc_test4/tst_parallel5.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_parallel5.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,8 +1,7 @@
/* Copyright 2018, UCAR/Unidata See COPYRIGHT file for copying and
* redistribution conditions.
*
- * This program tests netcdf-4 parallel I/O. In this test I write data
- * on one task, while writing 0 items on others.
+ * This program tests netcdf-4 parallel I/O.
*
* Ed Hartnett
*/
@@ -300,17 +299,67 @@
&ncid)) ERR;
if (nc_def_var(ncid, "fred", NC_BYTE, 0, NULL, &varid)) ERR;
if (nc_enddef(ncid)) ERR;
- if (nc_put_var_schar(ncid, varid, &test_data));
+ if (nc_put_var_schar(ncid, varid, &test_data)) ERR;
if (nc_close(ncid)) ERR;
/* Reopen the file and check. */
if (nc_open_par(FILE, 0, comm, info, &ncid)) ERR;
- if (nc_get_var_schar(ncid, varid, &test_data_in));
+ if (nc_get_var_schar(ncid, varid, &test_data_in)) ERR;
if (test_data_in != test_data) ERR;
if (nc_close(ncid)) ERR;
}
if (!mpi_rank)
SUMMARIZE_ERR;
+#ifdef USE_SZIP
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+#define SZIP_DIM_LEN 256
+#define SZIP_DIM_NAME "Barrels"
+#define SZIP_VAR_NAME "Best_Sligo_Rags"
+#define SZIP_PIXELS_PER_BLOCK 32
+ if (!mpi_rank)
+ printf("*** testing szip compression with parallel I/O...");
+ {
+ int ncid, dimid, varid;
+ float *data;
+ float *data_in;
+ int elements_per_pe = SZIP_DIM_LEN/mpi_size;
+ size_t start[NDIMS1], count[NDIMS1];
+ int i;
+
+ /* Create test data. */
+ if (!(data = malloc(elements_per_pe * sizeof(float)))) ERR;
+ for (i = 0; i < elements_per_pe; i++)
+ data[i] = mpi_rank + i * 0.1;
+
+ /* Crate a file with a scalar NC_BYTE value. */
+ if (nc_create_par(FILE, NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL,
+ &ncid)) ERR;
+ if (nc_def_dim(ncid, SZIP_DIM_NAME, SZIP_DIM_LEN, &dimid)) ERR;
+ if (nc_def_var(ncid, SZIP_VAR_NAME, NC_FLOAT, NDIMS1, &dimid, &varid)) ERR;
+ if (nc_def_var_szip(ncid, varid, H5_SZIP_NN_OPTION_MASK,
+ SZIP_PIXELS_PER_BLOCK)) ERR;
+ if (nc_enddef(ncid)) ERR;
+ start[0] = mpi_rank * elements_per_pe;
+ count[0] = elements_per_pe;
+ if (nc_put_vara_float(ncid, varid, start, count, data)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen the file and check. */
+ if (nc_open_par(FILE, 0, comm, info, &ncid)) ERR;
+ if (!(data_in = malloc(elements_per_pe * sizeof(float)))) ERR;
+ if (nc_get_vara_float(ncid, varid, start, count, data_in)) ERR;
+ if (nc_close(ncid)) ERR;
+ for (i = 0; i < elements_per_pe; i++)
+ if (data_in[i] != data[i]) ERR;
+
+ /* Release resources. */
+ free(data_in);
+ free(data);
+ }
+ if (!mpi_rank)
+ SUMMARIZE_ERR;
+#endif /* HDF5_SUPPORTS_PAR_FILTERS */
+#endif /* USE_SZIP */
/* Shut down MPI. */
MPI_Finalize();
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_parallel_compress.c netcdf-parallel-4.7.4/nc_test4/tst_parallel_compress.c
--- netcdf-parallel-4.7.3/nc_test4/tst_parallel_compress.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_parallel_compress.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,190 @@
+/*
+ Copyright 2019, UCAR/Unidata See COPYRIGHT file for copying and
+ redistribution conditions.
+
+ This program tests netcdf-4 parallel I/O using zlib, shuffle, and
+ fletcher32 fliters while writing with parallel I/O. This works for
+ HDF5-1.10.3 and later. In this case HDF5_SUPPORTS_PAR_FILTERS will
+ be defined during configure.
+
+ If szip was built into HDF5, this test will also test parallel szip
+ writes. If szip is present, then HAVE_H5Z_SZIP will be defined in
+ config.h.
+
+ Ed Hartnett, 12/19/2019
+*/
+
+#include
+#include "err_macros.h"
+#include
+
+#define FILE_NAME "tst_parallel_zlib2.nc"
+#define NDIMS 3
+#define DIMSIZE 24
+#define QTR_DATA (DIMSIZE * DIMSIZE / 4)
+#define NUM_PROC 4
+#define NUM_SLABS 10
+#define NUM_SHUFFLE_SETTINGS 2
+#ifdef HAVE_H5Z_SZIP
+#define NUM_COMPRESSION_FILTERS 2
+#else
+#define NUM_COMPRESSION_FILTERS 1
+#endif
+
+int
+main(int argc, char **argv)
+{
+ /* MPI stuff. */
+ int mpi_size, mpi_rank;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+
+ /* Netcdf-4 stuff. */
+ int ncid, v1id, dimids[NDIMS];
+ size_t start[NDIMS], count[NDIMS];
+
+ int f, i, res;
+ int *slab_data; /* one slab */
+
+ /* Initialize MPI. */
+ MPI_Init(&argc, &argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ /* Allocate data. */
+ if (!(slab_data = malloc(sizeof(int) * DIMSIZE * DIMSIZE / mpi_size))) ERR;
+
+ /* Create phony data. We're going to write a 24x24 array of ints,
+ in 4 sets of 144. */
+ for (i = 0; i < DIMSIZE * DIMSIZE / mpi_size; i++)
+ slab_data[i] = mpi_rank;
+
+ if (!mpi_rank)
+ printf("\n*** Testing parallel writes with compression filters.\n");
+ {
+ int s;
+ for (f = 0; f < NUM_COMPRESSION_FILTERS; f++)
+ {
+ for (s = 0; s < NUM_SHUFFLE_SETTINGS; s++)
+ {
+ if (!mpi_rank)
+ {
+ printf("*** testing simple write with %s shuffle %d...",
+ (f ? "szip" : "zlib"), s);
+ }
+
+ /* nc_set_log_level(3); */
+ /* Create a parallel netcdf-4 file. */
+ if (nc_create_par(FILE_NAME, NC_NETCDF4, comm, info, &ncid)) ERR;
+
+ /* Create three dimensions. */
+ if (nc_def_dim(ncid, "d1", DIMSIZE, dimids)) ERR;
+ if (nc_def_dim(ncid, "d2", DIMSIZE, &dimids[1])) ERR;
+ if (nc_def_dim(ncid, "d3", NUM_SLABS, &dimids[2])) ERR;
+
+ /* Create one var. Turn on deflation. */
+ if ((res = nc_def_var(ncid, "v1", NC_INT, NDIMS, dimids, &v1id))) ERR;
+
+ /* Setting any filter only will work for HDF5-1.10.3 and later
+ * versions. */
+ if (!f)
+ res = nc_def_var_deflate(ncid, 0, s, 1, 1);
+ else
+ {
+ res = nc_def_var_deflate(ncid, 0, s, 0, 0);
+ if (!res)
+ res = nc_def_var_szip(ncid, 0, 32, 32);
+ }
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+ if (res) ERR;
+#else
+ if (res != NC_EINVAL) ERR;
+#endif
+
+ /* Setting fletcher32 only will work for HDF5-1.10.3 and later
+ * versions. */
+ res = nc_def_var_fletcher32(ncid, 0, 1);
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+ if (res) ERR;
+#else
+ if (res != NC_EINVAL) ERR;
+#endif
+
+ /* Write metadata to file. */
+ if (nc_enddef(ncid)) ERR;
+
+ /* Set up slab for this process. */
+ start[0] = mpi_rank * DIMSIZE/mpi_size;
+ start[1] = 0;
+ count[0] = DIMSIZE/mpi_size;
+ count[1] = DIMSIZE;
+ count[2] = 1;
+ /*printf("mpi_rank=%d start[0]=%d start[1]=%d count[0]=%d count[1]=%d\n",
+ mpi_rank, start[0], start[1], count[0], count[1]);*/
+
+ /* Should not be allowed to change access to independent,
+ * because filters are in use. */
+ if (nc_var_par_access(ncid, v1id, NC_INDEPENDENT) != NC_EINVAL) ERR;
+
+ /* Write slabs of data. */
+ for (start[2] = 0; start[2] < NUM_SLABS; start[2]++)
+ if (nc_put_vara_int(ncid, v1id, start, count, slab_data)) ERR;
+
+ /* Close the netcdf file. */
+ if (nc_close(ncid)) ERR;
+
+ /* Check file. */
+ {
+ int shuffle_in, deflate_in, deflate_level_in;
+ int options_mask_in, pixels_per_block_in;
+ int *slab_data_in;
+
+ /* Allocate data. */
+ if (!(slab_data_in = malloc(sizeof(int) * DIMSIZE * DIMSIZE / mpi_size))) ERR;
+
+ /* Reopen the file for parallel access. */
+ if (nc_open_par(FILE_NAME, NC_NOWRITE, comm, info, &ncid)) ERR;
+
+ /* Check state of compression. */
+ if (!f)
+ {
+ if (nc_inq_var_deflate(ncid, 0, &shuffle_in, &deflate_in, &deflate_level_in)) ERR;
+ if ((s && !shuffle_in) || (!s && shuffle_in)) ERR;
+ if (!deflate_in || deflate_level_in != 1) ERR;
+ }
+ else
+ {
+ if (nc_inq_var_deflate(ncid, 0, &shuffle_in, NULL, NULL)) ERR;
+ if ((s && !shuffle_in) || (!s && shuffle_in)) ERR;
+ if (nc_inq_var_szip(ncid, 0, &options_mask_in, &pixels_per_block_in)) ERR;
+ }
+
+ /* Use parallel I/O to read the data. */
+ for (start[2] = 0; start[2] < NUM_SLABS; start[2]++)
+ {
+ if (nc_get_vara_int(ncid, 0, start, count, slab_data_in)) ERR;
+ for (i = 0; i < DIMSIZE * DIMSIZE / mpi_size; i++)
+ if (slab_data_in[i] != mpi_rank) ERR;
+ }
+
+ /* Close the netcdf file. */
+ if (nc_close(ncid)) ERR;
+
+ free(slab_data_in);
+ }
+
+ if (!mpi_rank)
+ SUMMARIZE_ERR;
+ } /* next shuffle filter test */
+ } /* next compression filter (zlib and szip) */
+ free(slab_data);
+ }
+
+ /* Shut down MPI. */
+ MPI_Finalize();
+
+ if (!mpi_rank)
+ FINAL_RESULTS;
+
+ return 0;
+}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_parallel_zlib.c netcdf-parallel-4.7.4/nc_test4/tst_parallel_zlib.c
--- netcdf-parallel-4.7.3/nc_test4/tst_parallel_zlib.c 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_parallel_zlib.c 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,174 @@
+/*
+ Copyright 2019, UCAR/Unidata
+ See COPYRIGHT file for copying and redistribution conditions.
+
+ This program tests netcdf-4 parallel I/O using the zlib fliter while
+ writing with parallel I/O. This works for HDF5-1.10.2 and later. In
+ this case HDF5_SUPPORTS_PAR_FILTERS will be defined during
+ configure.
+
+ Ed Hartnett, 12/19/2019
+*/
+
+/* Defining USE_MPE causes the MPE trace library to be used (and you
+ * must also relink with -llmpe -lmpe). This causes clog2 output to be
+ * written, which can be converted to slog2 (by the program
+ * clog2TOslog2) and then used in the analysis program jumpshot. */
+/*#define USE_MPE 1*/
+
+#include
+#include "err_macros.h"
+#include
+#ifdef USE_MPE
+#include
+#endif /* USE_MPE */
+
+#define FILE "tst_parallel_zlib.nc"
+#define NDIMS 3
+#define DIMSIZE 24
+#define QTR_DATA (DIMSIZE * DIMSIZE / 4)
+#define NUM_PROC 4
+#define NUM_SLABS 10
+
+int
+main(int argc, char **argv)
+{
+ /* MPI stuff. */
+ int mpi_namelen;
+ char mpi_name[MPI_MAX_PROCESSOR_NAME];
+ int mpi_size, mpi_rank;
+ MPI_Comm comm = MPI_COMM_WORLD;
+ MPI_Info info = MPI_INFO_NULL;
+
+ /* Netcdf-4 stuff. */
+ int ncid, v1id, dimids[NDIMS];
+ size_t start[NDIMS], count[NDIMS];
+
+ int i, res;
+ int slab_data[DIMSIZE * DIMSIZE / 4]; /* one slab */
+ char file_name[NC_MAX_NAME + 1];
+
+#ifdef USE_MPE
+ int s_init, e_init, s_define, e_define, s_write, e_write, s_close, e_close;
+#endif /* USE_MPE */
+
+ /* Initialize MPI. */
+ MPI_Init(&argc, &argv);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Get_processor_name(mpi_name, &mpi_namelen);
+ /*printf("mpi_name: %s size: %d rank: %d\n", mpi_name,
+ mpi_size, mpi_rank);*/
+
+#ifdef USE_MPE
+ MPE_Init_log();
+ s_init = MPE_Log_get_event_number();
+ e_init = MPE_Log_get_event_number();
+ s_define = MPE_Log_get_event_number();
+ e_define = MPE_Log_get_event_number();
+ s_write = MPE_Log_get_event_number();
+ e_write = MPE_Log_get_event_number();
+ s_close = MPE_Log_get_event_number();
+ e_close = MPE_Log_get_event_number();
+ MPE_Describe_state(s_init, e_init, "Init", "red");
+ MPE_Describe_state(s_define, e_define, "Define", "yellow");
+ MPE_Describe_state(s_write, e_write, "Write", "green");
+ MPE_Describe_state(s_close, e_close, "Close", "purple");
+ MPE_Start_log();
+ MPE_Log_event(s_init, 0, "start init");
+#endif /* USE_MPE */
+
+ if (mpi_rank == 0)
+ {
+ printf("\n*** Testing parallel writes with zlib.\n");
+ printf("*** testing simple write with zlib...");
+ }
+
+ /* Create phony data. We're going to write a 24x24 array of ints,
+ in 4 sets of 144. */
+ for (i = 0; i < DIMSIZE * DIMSIZE / 4; i++)
+ slab_data[i] = mpi_rank;
+
+#ifdef USE_MPE
+ MPE_Log_event(e_init, 0, "end init");
+ MPE_Log_event(s_define, 0, "start define file");
+#endif /* USE_MPE */
+
+ /* Create a parallel netcdf-4 file. */
+ /*nc_set_log_level(3);*/
+ /* sprintf(file_name, "%s/%s", TEMP_LARGE, FILE); */
+ sprintf(file_name, "%s", FILE);
+ if ((res = nc_create_par(file_name, NC_NETCDF4, comm, info, &ncid))) ERR;
+
+ /* Create three dimensions. */
+ if (nc_def_dim(ncid, "d1", DIMSIZE, dimids)) ERR;
+ if (nc_def_dim(ncid, "d2", DIMSIZE, &dimids[1])) ERR;
+ if (nc_def_dim(ncid, "d3", NUM_SLABS, &dimids[2])) ERR;
+
+ /* Create one var. */
+ if ((res = nc_def_var(ncid, "v1", NC_INT, NDIMS, dimids, &v1id))) ERR;
+
+ /* Setting deflate only will work for HDF5-1.10.2 and later
+ * versions. */
+ res = nc_def_var_deflate(ncid, 0, 0, 1, 1);
+#ifdef HDF5_SUPPORTS_PAR_FILTERS
+ if (res) ERR;
+#else
+ if (res != NC_EINVAL) ERR;
+#endif
+
+ /* Write metadata to file. */
+ if ((res = nc_enddef(ncid))) ERR;
+
+#ifdef USE_MPE
+ MPE_Log_event(e_define, 0, "end define file");
+ if (mpi_rank)
+ sleep(mpi_rank);
+#endif /* USE_MPE */
+
+ /* Set up slab for this process. */
+ start[0] = mpi_rank * DIMSIZE/mpi_size;
+ start[1] = 0;
+ count[0] = DIMSIZE/mpi_size;
+ count[1] = DIMSIZE;
+ count[2] = 1;
+ /*printf("mpi_rank=%d start[0]=%d start[1]=%d count[0]=%d count[1]=%d\n",
+ mpi_rank, start[0], start[1], count[0], count[1]);*/
+
+ /* Not necessary, but harmless. */
+ if (nc_var_par_access(ncid, v1id, NC_COLLECTIVE)) ERR;
+
+ for (start[2] = 0; start[2] < NUM_SLABS; start[2]++)
+ {
+#ifdef USE_MPE
+ MPE_Log_event(s_write, 0, "start write slab");
+#endif /* USE_MPE */
+ nc_set_log_level(3);
+ /* Write slabs of phoney data. */
+ if (nc_put_vara_int(ncid, v1id, start, count, slab_data)) ERR;
+#ifdef USE_MPE
+ MPE_Log_event(e_write, 0, "end write file");
+#endif /* USE_MPE */
+ }
+
+#ifdef USE_MPE
+ MPE_Log_event(s_close, 0, "start close file");
+#endif /* USE_MPE */
+
+ /* Close the netcdf file. */
+ if ((res = nc_close(ncid))) ERR;
+
+#ifdef USE_MPE
+ MPE_Log_event(e_close, 0, "end close file");
+#endif /* USE_MPE */
+
+ /* Shut down MPI. */
+ MPI_Finalize();
+
+ if (mpi_rank == 0)
+ {
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
+ }
+ return 0;
+}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_udf.c netcdf-parallel-4.7.4/nc_test4/tst_udf.c
--- netcdf-parallel-4.7.3/nc_test4/tst_udf.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_udf.c 2020-08-31 10:33:26.000000000 +0000
@@ -20,136 +20,229 @@
int
NC4_show_metadata(int ncid)
{
- return 0;
+ return 0;
}
#endif
int
tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
- void *parameters, const NC_Dispatch *dispatch, int ncid)
+ void *parameters, const NC_Dispatch *dispatch, int ncid)
{
- return NC_NOERR;
+ return NC_NOERR;
}
int
tst_abort(int ncid)
{
- return TEST_VAL_42;
+ return TEST_VAL_42;
}
int
tst_close(int ncid, void *v)
{
- return NC_NOERR;
+ return NC_NOERR;
}
int
tst_inq_format(int ncid, int *formatp)
{
- return TEST_VAL_42;
+ return TEST_VAL_42;
}
int
tst_inq_format_extended(int ncid, int *formatp, int *modep)
{
- return TEST_VAL_42;
+ return TEST_VAL_42;
}
int
tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count,
void *value, nc_type t)
{
- return TEST_VAL_42;
+ return TEST_VAL_42;
}
/* This is the dispatch object that holds pointers to all the
- * functions that make up the HDF4 dispatch interface. */
+ * functions that make up the test dispatch interface. */
static NC_Dispatch tst_dispatcher = {
-NC_FORMATX_UDF0,
+ NC_FORMATX_UDF0,
+ NC_DISPATCH_VERSION,
-NC_RO_create,
-tst_open,
+ NC_RO_create,
+ tst_open,
-NC_RO_redef,
-NC_RO__enddef,
-NC_RO_sync,
-tst_abort,
-tst_close,
-NC_RO_set_fill,
-tst_inq_format,
-tst_inq_format_extended,
-
-NC4_inq,
-NC4_inq_type,
-
-NC_RO_def_dim,
-NC4_inq_dimid,
-NC4_inq_dim,
-NC4_inq_unlimdim,
-NC_RO_rename_dim,
-
-NC4_inq_att,
-NC4_inq_attid,
-NC4_inq_attname,
-NC_RO_rename_att,
-NC_RO_del_att,
-NC4_get_att,
-NC_RO_put_att,
-
-NC_RO_def_var,
-NC4_inq_varid,
-NC_RO_rename_var,
-tst_get_vara,
-NC_RO_put_vara,
-NCDEFAULT_get_vars,
-NCDEFAULT_put_vars,
-NCDEFAULT_get_varm,
-NCDEFAULT_put_varm,
-
-NC4_inq_var_all,
-
-NC_NOTNC4_var_par_access,
-NC_RO_def_var_fill,
-
-NC4_show_metadata,
-NC4_inq_unlimdims,
-
-NC4_inq_ncid,
-NC4_inq_grps,
-NC4_inq_grpname,
-NC4_inq_grpname_full,
-NC4_inq_grp_parent,
-NC4_inq_grp_full_ncid,
-NC4_inq_varids,
-NC4_inq_dimids,
-NC4_inq_typeids,
-NC4_inq_type_equal,
-NC_NOTNC4_def_grp,
-NC_NOTNC4_rename_grp,
-NC4_inq_user_type,
-NC4_inq_typeid,
-
-NC_NOTNC4_def_compound,
-NC_NOTNC4_insert_compound,
-NC_NOTNC4_insert_array_compound,
-NC_NOTNC4_inq_compound_field,
-NC_NOTNC4_inq_compound_fieldindex,
-NC_NOTNC4_def_vlen,
-NC_NOTNC4_put_vlen_element,
-NC_NOTNC4_get_vlen_element,
-NC_NOTNC4_def_enum,
-NC_NOTNC4_insert_enum,
-NC_NOTNC4_inq_enum_member,
-NC_NOTNC4_inq_enum_ident,
-NC_NOTNC4_def_opaque,
-NC_NOTNC4_def_var_deflate,
-NC_NOTNC4_def_var_fletcher32,
-NC_NOTNC4_def_var_chunking,
-NC_NOTNC4_def_var_endian,
-NC_NOTNC4_def_var_filter,
-NC_NOTNC4_set_var_chunk_cache,
-NC_NOTNC4_get_var_chunk_cache
+ NC_RO_redef,
+ NC_RO__enddef,
+ NC_RO_sync,
+ tst_abort,
+ tst_close,
+ NC_RO_set_fill,
+ tst_inq_format,
+ tst_inq_format_extended,
+
+ NC4_inq,
+ NC4_inq_type,
+
+ NC_RO_def_dim,
+ NC4_inq_dimid,
+ NC4_inq_dim,
+ NC4_inq_unlimdim,
+ NC_RO_rename_dim,
+
+ NC4_inq_att,
+ NC4_inq_attid,
+ NC4_inq_attname,
+ NC_RO_rename_att,
+ NC_RO_del_att,
+ NC4_get_att,
+ NC_RO_put_att,
+
+ NC_RO_def_var,
+ NC4_inq_varid,
+ NC_RO_rename_var,
+ tst_get_vara,
+ NC_RO_put_vara,
+ NCDEFAULT_get_vars,
+ NCDEFAULT_put_vars,
+ NCDEFAULT_get_varm,
+ NCDEFAULT_put_varm,
+
+ NC4_inq_var_all,
+
+ NC_NOTNC4_var_par_access,
+ NC_RO_def_var_fill,
+
+ NC4_show_metadata,
+ NC4_inq_unlimdims,
+
+ NC4_inq_ncid,
+ NC4_inq_grps,
+ NC4_inq_grpname,
+ NC4_inq_grpname_full,
+ NC4_inq_grp_parent,
+ NC4_inq_grp_full_ncid,
+ NC4_inq_varids,
+ NC4_inq_dimids,
+ NC4_inq_typeids,
+ NC4_inq_type_equal,
+ NC_NOTNC4_def_grp,
+ NC_NOTNC4_rename_grp,
+ NC4_inq_user_type,
+ NC4_inq_typeid,
+
+ NC_NOTNC4_def_compound,
+ NC_NOTNC4_insert_compound,
+ NC_NOTNC4_insert_array_compound,
+ NC_NOTNC4_inq_compound_field,
+ NC_NOTNC4_inq_compound_fieldindex,
+ NC_NOTNC4_def_vlen,
+ NC_NOTNC4_put_vlen_element,
+ NC_NOTNC4_get_vlen_element,
+ NC_NOTNC4_def_enum,
+ NC_NOTNC4_insert_enum,
+ NC_NOTNC4_inq_enum_member,
+ NC_NOTNC4_inq_enum_ident,
+ NC_NOTNC4_def_opaque,
+ NC_NOTNC4_def_var_deflate,
+ NC_NOTNC4_def_var_fletcher32,
+ NC_NOTNC4_def_var_chunking,
+ NC_NOTNC4_def_var_endian,
+ NC_NOTNC4_def_var_filter,
+ NC_NOTNC4_set_var_chunk_cache,
+ NC_NOTNC4_get_var_chunk_cache
+};
+
+/* This is the dispatch object that holds pointers to all the
+ * functions that make up the test dispatch interface with a bad
+ * version number. */
+static NC_Dispatch tst_dispatcher_bad_version = {
+
+ NC_FORMATX_UDF0,
+ NC_DISPATCH_VERSION - 1,
+
+ NC_RO_create,
+ tst_open,
+
+ NC_RO_redef,
+ NC_RO__enddef,
+ NC_RO_sync,
+ tst_abort,
+ tst_close,
+ NC_RO_set_fill,
+ tst_inq_format,
+ tst_inq_format_extended,
+
+ NC4_inq,
+ NC4_inq_type,
+
+ NC_RO_def_dim,
+ NC4_inq_dimid,
+ NC4_inq_dim,
+ NC4_inq_unlimdim,
+ NC_RO_rename_dim,
+
+ NC4_inq_att,
+ NC4_inq_attid,
+ NC4_inq_attname,
+ NC_RO_rename_att,
+ NC_RO_del_att,
+ NC4_get_att,
+ NC_RO_put_att,
+
+ NC_RO_def_var,
+ NC4_inq_varid,
+ NC_RO_rename_var,
+ tst_get_vara,
+ NC_RO_put_vara,
+ NCDEFAULT_get_vars,
+ NCDEFAULT_put_vars,
+ NCDEFAULT_get_varm,
+ NCDEFAULT_put_varm,
+
+ NC4_inq_var_all,
+
+ NC_NOTNC4_var_par_access,
+ NC_RO_def_var_fill,
+
+ NC4_show_metadata,
+ NC4_inq_unlimdims,
+
+ NC4_inq_ncid,
+ NC4_inq_grps,
+ NC4_inq_grpname,
+ NC4_inq_grpname_full,
+ NC4_inq_grp_parent,
+ NC4_inq_grp_full_ncid,
+ NC4_inq_varids,
+ NC4_inq_dimids,
+ NC4_inq_typeids,
+ NC4_inq_type_equal,
+ NC_NOTNC4_def_grp,
+ NC_NOTNC4_rename_grp,
+ NC4_inq_user_type,
+ NC4_inq_typeid,
+
+ NC_NOTNC4_def_compound,
+ NC_NOTNC4_insert_compound,
+ NC_NOTNC4_insert_array_compound,
+ NC_NOTNC4_inq_compound_field,
+ NC_NOTNC4_inq_compound_fieldindex,
+ NC_NOTNC4_def_vlen,
+ NC_NOTNC4_put_vlen_element,
+ NC_NOTNC4_get_vlen_element,
+ NC_NOTNC4_def_enum,
+ NC_NOTNC4_insert_enum,
+ NC_NOTNC4_inq_enum_member,
+ NC_NOTNC4_inq_enum_ident,
+ NC_NOTNC4_def_opaque,
+ NC_NOTNC4_def_var_deflate,
+ NC_NOTNC4_def_var_fletcher32,
+ NC_NOTNC4_def_var_chunking,
+ NC_NOTNC4_def_var_endian,
+ NC_NOTNC4_def_var_filter,
+ NC_NOTNC4_set_var_chunk_cache,
+ NC_NOTNC4_get_var_chunk_cache
};
#define NUM_UDFS 2
@@ -159,85 +252,98 @@
int
main(int argc, char **argv)
{
- printf("\n*** Testing user-defined formats.\n");
- printf("*** testing simple user-defined format...");
- {
- int ncid;
- NC_Dispatch *disp_in;
- int i;
-
- /* Create an empty file to play with. */
- if (nc_create(FILE_NAME, 0, &ncid)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Test all available user-defined format slots. */
- for (i = 0; i < NUM_UDFS; i++)
- {
- /* Add our user defined format. */
- if (nc_def_user_format(mode[i], &tst_dispatcher, NULL)) ERR;
-
- /* Check that our user-defined format has been added. */
- if (nc_inq_user_format(mode[i], &disp_in, NULL)) ERR;
- if (disp_in != &tst_dispatcher) ERR;
-
- /* Open file with our defined functions. */
- if (nc_open(FILE_NAME, mode[i], &ncid)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open file again and abort, which is the same as closing
- * it. This also tests that the UDF flags are given
- * priority. If NC_NETCDF4 flag were given priority, then
- * nc_abort() will not return TEST_VAL_42, but instead will
- * return 0. */
- if (nc_open(FILE_NAME, mode[i]|NC_NETCDF4, &ncid)) ERR;
- if (nc_inq_format(ncid, NULL) != TEST_VAL_42) ERR;
- if (nc_inq_format_extended(ncid, NULL, NULL) != TEST_VAL_42) ERR;
- if (nc_abort(ncid) != TEST_VAL_42) ERR;
- }
- }
- SUMMARIZE_ERR;
- printf("*** testing user-defined format with magic number...");
- {
- int ncid;
- NC_Dispatch *disp_in;
- char magic_number[5] = "1111";
- char dummy_data[11] = "0123456789";
- char magic_number_in[NC_MAX_MAGIC_NUMBER_LEN];
- FILE *FP;
- int i;
-
- /* Create a file with magic number at start. */
- if (!(FP = fopen(FILE_NAME, "w"))) ERR;
- if (fwrite(magic_number, sizeof(char), strlen(magic_number), FP)
- != strlen(magic_number)) ERR;
- if (fwrite(dummy_data, sizeof(char), strlen(dummy_data), FP)
- != strlen(dummy_data)) ERR;
- if (fclose(FP)) ERR;
-
- /* Test all available user-defined format slots. */
- for (i = 0; i < NUM_UDFS; i++)
- {
- /* Add our test user defined format. */
- if (nc_def_user_format(mode[i], &tst_dispatcher, magic_number)) ERR;
-
- /* Check that our user-defined format has been added. */
- if (nc_inq_user_format(mode[i], &disp_in, magic_number_in)) ERR;
- if (disp_in != &tst_dispatcher) ERR;
- if (strncmp(magic_number, magic_number_in, strlen(magic_number))) ERR;
-
- /* Open file with our defined functions. */
- if (nc_open(FILE_NAME, mode[i], &ncid)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open file again and abort, which is the same as closing
- * it. This time we don't specify a mode, because the magic
- * number is used to identify the file. */
- if (nc_open(FILE_NAME, 0, &ncid)) ERR;
- if (nc_inq_format(ncid, NULL) != TEST_VAL_42) ERR;
- if (nc_inq_format_extended(ncid, NULL, NULL) != TEST_VAL_42) ERR;
- if (nc_abort(ncid) != TEST_VAL_42) ERR;
- }
- }
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ printf("\n*** Testing user-defined formats.\n");
+ printf("*** testing simple user-defined format...");
+ {
+ int ncid;
+ NC_Dispatch *disp_in;
+ int i;
+
+ /* Create an empty file to play with. */
+ if (nc_create(FILE_NAME, 0, &ncid)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Test all available user-defined format slots. */
+ for (i = 0; i < NUM_UDFS; i++)
+ {
+ /* Add our user defined format. */
+ if (nc_def_user_format(mode[i], &tst_dispatcher, NULL)) ERR;
+
+ /* Check that our user-defined format has been added. */
+ if (nc_inq_user_format(mode[i], &disp_in, NULL)) ERR;
+ if (disp_in != &tst_dispatcher) ERR;
+
+ /* Open file with our defined functions. */
+ if (nc_open(FILE_NAME, mode[i], &ncid)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open file again and abort, which is the same as closing
+ * it. This also tests that the UDF flags are given
+ * priority. If NC_NETCDF4 flag were given priority, then
+ * nc_abort() will not return TEST_VAL_42, but instead will
+ * return 0. */
+ if (nc_open(FILE_NAME, mode[i]|NC_NETCDF4, &ncid)) ERR;
+ if (nc_inq_format(ncid, NULL) != TEST_VAL_42) ERR;
+ if (nc_inq_format_extended(ncid, NULL, NULL) != TEST_VAL_42) ERR;
+ if (nc_abort(ncid) != TEST_VAL_42) ERR;
+ }
+ }
+ SUMMARIZE_ERR;
+ printf("*** testing user-defined format with magic number...");
+ {
+ int ncid;
+ NC_Dispatch *disp_in;
+ char magic_number[5] = "1111";
+ char dummy_data[11] = "0123456789";
+ char magic_number_in[NC_MAX_MAGIC_NUMBER_LEN];
+ FILE *FP;
+ int i;
+
+ /* Create a file with magic number at start. */
+ if (!(FP = fopen(FILE_NAME, "w"))) ERR;
+ if (fwrite(magic_number, sizeof(char), strlen(magic_number), FP)
+ != strlen(magic_number)) ERR;
+ if (fwrite(dummy_data, sizeof(char), strlen(dummy_data), FP)
+ != strlen(dummy_data)) ERR;
+ if (fclose(FP)) ERR;
+
+ /* Test all available user-defined format slots. */
+ for (i = 0; i < NUM_UDFS; i++)
+ {
+ /* Add our test user defined format. */
+ if (nc_def_user_format(mode[i], &tst_dispatcher, magic_number)) ERR;
+
+ /* Check that our user-defined format has been added. */
+ if (nc_inq_user_format(mode[i], &disp_in, magic_number_in)) ERR;
+ if (disp_in != &tst_dispatcher) ERR;
+ if (strncmp(magic_number, magic_number_in, strlen(magic_number))) ERR;
+
+ /* Open file with our defined functions. */
+ if (nc_open(FILE_NAME, mode[i], &ncid)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open file again and abort, which is the same as closing
+ * it. This time we don't specify a mode, because the magic
+ * number is used to identify the file. */
+ if (nc_open(FILE_NAME, 0, &ncid)) ERR;
+ if (nc_inq_format(ncid, NULL) != TEST_VAL_42) ERR;
+ if (nc_inq_format_extended(ncid, NULL, NULL) != TEST_VAL_42) ERR;
+ if (nc_abort(ncid) != TEST_VAL_42) ERR;
+ }
+ }
+ SUMMARIZE_ERR;
+ printf("*** testing bad version causes dispatch table to be rejected...");
+ {
+ int i;
+
+ /* Test all available user-defined format slots. */
+ for (i = 0; i < NUM_UDFS; i++)
+ {
+ /* Make sure our bad version format is rejected. */
+ if (nc_def_user_format(mode[i], &tst_dispatcher_bad_version,
+ NULL) != NC_EINVAL) ERR;
+ }
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_unlim_vars.c netcdf-parallel-4.7.4/nc_test4/tst_unlim_vars.c
--- netcdf-parallel-4.7.3/nc_test4/tst_unlim_vars.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_unlim_vars.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,10 +1,10 @@
/* This is part of the netCDF package.
- Copyright 2018 University Corporation for Atmospheric Research/Unidata
+ Copyright 2020 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Test netcdf-4 variables with unlimited dimensions.
- $Id: tst_unlim_vars.c,v 1.9 2010/05/25 13:53:04 ed Exp $
+ Ed Hartnett
*/
#include
@@ -19,137 +19,251 @@
#define LON_LEN 3
#define TIME_NAME "time"
#define NUM_TIMESTEPS 4
-#define NDIMS 3
+#define NDIM3 3
+#define NDIM2 2
int
main(int argc, char **argv)
{
- int ncid, sfc_tempid;
- float data_out[NUM_TIMESTEPS][LAT_LEN][LON_LEN], data_in[NUM_TIMESTEPS][LAT_LEN][LON_LEN];
- int lat, lon, time;
- int dimids[NDIMS];
- nc_type xtype_in;
- int ndims_in, dimids_in[10], natts_in, nvars_in, unlimdimid_in;
- size_t len_in;
- char name_in[NC_MAX_NAME+1];
- size_t start[NDIMS], count[NDIMS];
- int d;
-
- /* Set up phony data. */
- for (time = 0; time < NUM_TIMESTEPS; time++)
- for (lat = 0; lat < LAT_LEN; lat++)
- for (lon = 0; lon < LON_LEN; lon++)
- data_out[time][lat][lon] = 25.5 + lat + lon + time;
-
- printf("\n*** Testing netcdf-4 variable with unlimited dimensions.\n");
- printf("*** Testing file with one var, one unlim dim...");
-
- /* Create a file with a 3D surface temp variable. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
-
- /* Create three dims, one unlimited. */
- if (nc_def_dim(ncid, TIME_NAME, NC_UNLIMITED, &dimids[0])) ERR;
- if (nc_def_dim(ncid, LAT_NAME, LAT_LEN, &dimids[1])) ERR;
- if (nc_def_dim(ncid, LON_NAME, LON_LEN, &dimids[2])) ERR;
-
- /* Define a var. */
- for (d = 0; d < NDIMS; d++)
- dimids[d] = d;
- if (nc_def_var(ncid, SFC_TEMP_NAME, NC_FLOAT, NDIMS, dimids, &sfc_tempid)) ERR;
-
- /* Check some metadata. */
- if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
- if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
- &natts_in)) ERR;
- if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
- ndims_in != 3 || natts_in != 0) ERR;
- for (d = 0; d < NDIMS; d++)
- if (dimids_in[d] != dimids[d]) ERR;
- if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
- if (len_in != 0 || strcmp(name_in, TIME_NAME)) ERR;
- if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
- if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
- if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
- if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
- if (nc_close(ncid)) ERR;
-
- if (nc_open(FILE_NAME, 0, &ncid)) ERR;
-
- /* Check metadata. */
- if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
- if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
- &natts_in)) ERR;
- if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
- ndims_in != 3 || natts_in != 0) ERR;
- for (d = 0; d < NDIMS; d++)
- if (dimids_in[d] != dimids[d]) ERR;
- if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
- if (len_in != 0 || strcmp(name_in, TIME_NAME)) ERR;
- if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
- if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
- if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
- if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
-
- if (nc_close(ncid)) ERR;
-
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
-
- /* Check metadata. */
- if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
- if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
- &natts_in)) ERR;
- if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
- ndims_in != 3 || natts_in != 0) ERR;
- for (d = 0; d < NDIMS; d++)
- if (dimids_in[d] != dimids[d]) ERR;
- if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
- if (len_in != 0 || strcmp(name_in, TIME_NAME)) ERR;
- if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
- if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
- if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
- if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Write some data to the var.*/
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- for (d = 0; d < NDIMS; d++)
- start[d] = 0;
- count[0] = NUM_TIMESTEPS;
- count[1] = LAT_LEN;
- count[2] = LON_LEN;
- if (nc_put_vara_float(ncid, 0, start, count, (float *)data_out)) ERR;
-
- /* Check metadata. */
- if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
- if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
- &natts_in)) ERR;
- if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
- ndims_in != 3 || natts_in != 0) ERR;
- for (d = 0; d < NDIMS; d++)
- if (dimids_in[d] != dimids[d]) ERR;
- if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
- if (len_in != NUM_TIMESTEPS || strcmp(name_in, TIME_NAME)) ERR;
- if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
- if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
- if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
- if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
-
- if (nc_close(ncid)) ERR;
-
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
-
- /* Check data. */
- if (nc_get_vara_float(ncid, 0, start, count, (float *)data_in)) ERR;
- for (time = 0; time < NUM_TIMESTEPS; time++)
- for (lat = 0; lat < LAT_LEN; lat++)
- for (lon = 0; lon < LON_LEN; lon++)
- if (data_in[time][lat][lon] != data_out[time][lat][lon]) ERR;
-
- if (nc_close(ncid)) ERR;
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ printf("\n*** Testing netcdf-4 variables with unlimited dimensions.\n");
+ printf("*** Testing file with one var, one unlim dim...");
+ {
+ int ncid, sfc_tempid;
+ float data_out[NUM_TIMESTEPS][LAT_LEN][LON_LEN], data_in[NUM_TIMESTEPS][LAT_LEN][LON_LEN];
+ int lat, lon, time;
+ int dimids[NDIM3];
+ nc_type xtype_in;
+ int ndims_in, dimids_in[10], natts_in, nvars_in, unlimdimid_in;
+ size_t len_in;
+ char name_in[NC_MAX_NAME+1];
+ size_t start[NDIM3], count[NDIM3];
+ int d;
+
+
+ /* Set up phony data. */
+ for (time = 0; time < NUM_TIMESTEPS; time++)
+ for (lat = 0; lat < LAT_LEN; lat++)
+ for (lon = 0; lon < LON_LEN; lon++)
+ data_out[time][lat][lon] = 25.5 + lat + lon + time;
+
+ /* Create a file with a 3D surface temp variable. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+
+ /* Create three dims, one unlimited. */
+ if (nc_def_dim(ncid, TIME_NAME, NC_UNLIMITED, &dimids[0])) ERR;
+ if (nc_def_dim(ncid, LAT_NAME, LAT_LEN, &dimids[1])) ERR;
+ if (nc_def_dim(ncid, LON_NAME, LON_LEN, &dimids[2])) ERR;
+
+ /* Define a var. */
+ for (d = 0; d < NDIM3; d++)
+ dimids[d] = d;
+ if (nc_def_var(ncid, SFC_TEMP_NAME, NC_FLOAT, NDIM3, dimids, &sfc_tempid)) ERR;
+
+ /* Check some metadata. */
+ if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
+ if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
+ &natts_in)) ERR;
+ if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
+ ndims_in != 3 || natts_in != 0) ERR;
+ for (d = 0; d < NDIM3; d++)
+ if (dimids_in[d] != dimids[d]) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (len_in != 0 || strcmp(name_in, TIME_NAME)) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
+ if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
+ if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ if (nc_open(FILE_NAME, 0, &ncid)) ERR;
+
+ /* Check metadata. */
+ if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
+ if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
+ &natts_in)) ERR;
+ if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
+ ndims_in != 3 || natts_in != 0) ERR;
+ for (d = 0; d < NDIM3; d++)
+ if (dimids_in[d] != dimids[d]) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (len_in != 0 || strcmp(name_in, TIME_NAME)) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
+ if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
+ if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+
+ /* Check metadata. */
+ if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
+ if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
+ &natts_in)) ERR;
+ if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
+ ndims_in != 3 || natts_in != 0) ERR;
+ for (d = 0; d < NDIM3; d++)
+ if (dimids_in[d] != dimids[d]) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (len_in != 0 || strcmp(name_in, TIME_NAME)) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
+ if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
+ if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Write some data to the var.*/
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ for (d = 0; d < NDIM3; d++)
+ start[d] = 0;
+ count[0] = NUM_TIMESTEPS;
+ count[1] = LAT_LEN;
+ count[2] = LON_LEN;
+ if (nc_put_vara_float(ncid, 0, start, count, (float *)data_out)) ERR;
+
+ /* Check metadata. */
+ if (nc_inq(ncid, &ndims_in, &nvars_in, &natts_in, &unlimdimid_in)) ERR;
+ if (ndims_in != 3 || nvars_in != 1 || natts_in != 0 || unlimdimid_in != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims_in, dimids_in,
+ &natts_in)) ERR;
+ if (strcmp(name_in, SFC_TEMP_NAME) || xtype_in != NC_FLOAT ||
+ ndims_in != 3 || natts_in != 0) ERR;
+ for (d = 0; d < NDIM3; d++)
+ if (dimids_in[d] != dimids[d]) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (len_in != NUM_TIMESTEPS || strcmp(name_in, TIME_NAME)) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (len_in != LAT_LEN || strcmp(name_in, LAT_NAME)) ERR;
+ if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
+ if (len_in != LON_LEN || strcmp(name_in, LON_NAME)) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+
+ /* Check data. */
+ if (nc_get_vara_float(ncid, 0, start, count, (float *)data_in)) ERR;
+ for (time = 0; time < NUM_TIMESTEPS; time++)
+ for (lat = 0; lat < LAT_LEN; lat++)
+ for (lon = 0; lon < LON_LEN; lon++)
+ if (data_in[time][lat][lon] != data_out[time][lat][lon]) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("*** Testing netcdf-4 variable 2 unlimited dimensions...");
+ {
+#define DIM0_NAME "Speed"
+#define DIM1_NAME "Height"
+#define VAR_NAME "Superman"
+#define VAR1_NAME "Black_Widow"
+ int ncid, varid, varid1, dimid[NDIM2];
+ int data = TEST_VAL_42;
+ int data_in;
+ size_t index[NDIM2] = {1, 1};
+ char name_in[NC_MAX_NAME + 1];
+ size_t len_in;
+
+ /* Create a file with 2 unlimited dims. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM0_NAME, NC_UNLIMITED, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, DIM1_NAME, NC_UNLIMITED, &dimid[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_INT, NDIM2, dimid, &varid)) ERR;
+ if (nc_def_var(ncid, VAR1_NAME, NC_INT, NDIM2, dimid, &varid1)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Check the file. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (strcmp(name_in, DIM0_NAME) || len_in != 0) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (strcmp(name_in, DIM1_NAME) || len_in != 0) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen the file and add data. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_put_var1_int(ncid, 0, index, &data)) ERR;
+ if (nc_inq_dim(ncid, 0, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_inq_dim(ncid, 1, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_get_var1_int(ncid, 0, index, &data_in)) ERR;
+ if (data_in != data) ERR;
+ if (nc_get_var1_int(ncid, 1, index, &data_in)) ERR;
+ if (data_in != NC_FILL_INT) ERR;
+ if (nc_close(ncid)) ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("*** Testing netcdf-4 variable 3 unlimited dimensions...");
+ {
+#define D3_DIM0_NAME "Gadgets"
+#define D3_DIM1_NAME "Brains"
+#define D3_DIM2_NAME "Money"
+#define D3_VAR_NAME "Batman"
+#define D3_VAR1_NAME "Aquaman"
+ int ncid, varid, dimid[NDIM3];
+ int data = TEST_VAL_42;
+ int data_in;
+ size_t start[NDIM3] = {1, 1, 1}, count[NDIM3] = {1, 1, 1};
+ size_t index[NDIM3] = {0, 0, 1};
+ char name_in[NC_MAX_NAME + 1];
+ size_t len_in;
+
+ /* Create a file with 2 unlimited dims. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, D3_DIM0_NAME, NC_UNLIMITED, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, D3_DIM1_NAME, NC_UNLIMITED, &dimid[1])) ERR;
+ if (nc_def_dim(ncid, D3_DIM2_NAME, NC_UNLIMITED, &dimid[2])) ERR;
+ if (nc_def_var(ncid, D3_VAR_NAME, NC_INT, NDIM3, dimid, &varid)) ERR;
+ if (nc_def_var(ncid, D3_VAR1_NAME, NC_INT, NDIM3, dimid, &varid)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Check the file. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (strcmp(name_in, D3_DIM0_NAME) || len_in != 0) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (strcmp(name_in, D3_DIM1_NAME) || len_in != 0) ERR;
+ if (nc_inq_dim(ncid, 2, name_in, &len_in)) ERR;
+ if (strcmp(name_in, D3_DIM2_NAME) || len_in != 0) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen the file and add data. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_put_vara_int(ncid, 0, start, count, &data)) ERR;
+ if (nc_put_var1_int(ncid, 1, index, &data)) ERR;
+ if (nc_inq_dim(ncid, 0, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_inq_dim(ncid, 1, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_inq_dim(ncid, 2, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_get_vara_int(ncid, 0, start, count, &data_in)) ERR;
+ if (data_in != data) ERR;
+ if (nc_get_vara_int(ncid, 1, start, count, &data_in)) ERR;
+ if (data_in != NC_FILL_INT) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen file and check again. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_dim(ncid, 0, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_inq_dim(ncid, 1, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_inq_dim(ncid, 2, NULL, &len_in)) ERR;
+ if (len_in != 2) ERR;
+ if (nc_get_vara_int(ncid, 0, start, count, &data_in)) ERR;
+ if (data_in != data) ERR;
+ if (nc_get_vara_int(ncid, 1, start, count, &data_in)) ERR;
+ if (data_in != NC_FILL_INT) ERR;
+ if (nc_get_var1_int(ncid, 1, index, &data_in)) ERR;
+ if (data_in != data) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_vars2.c netcdf-parallel-4.7.4/nc_test4/tst_vars2.c
--- netcdf-parallel-4.7.3/nc_test4/tst_vars2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_vars2.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,6 +1,6 @@
/* This is part of the netCDF package.
Copyright 2018 University Corporation for Atmospheric Research/Unidata
- See COPYRIGHT file for conditions of use.
+ See COPYRIGHT file for conditions of use.
Test netcdf-4 variables.
Ed Hartnett
@@ -24,234 +24,234 @@
int
main(int argc, char **argv)
{
- int ncid, dimids[NUM_DIMS];
- int varid;
- int nvars_in, varids_in[NUM_VARS] = {0};
- signed char fill_value = 42, fill_value_in;
- nc_type xtype_in;
- size_t len_in;
- char name_in[NC_MAX_NAME + 1];
- int attnum_in;
- int cnum;
- char too_long_name[NC_MAX_NAME + 2];
-
- /* Set up a name that is too long for netCDF. */
- memset(too_long_name, 'a', NC_MAX_NAME + 1);
- too_long_name[NC_MAX_NAME + 1] = 0;
-
- printf("\n*** Testing netcdf-4 variable functions, even more.\n");
- for (cnum = 0; cnum < MAX_CNUM; cnum++)
- {
- int cmode = 0;
-
- switch(cnum)
- {
- case 0:
+ int ncid, dimids[NUM_DIMS];
+ int varid;
+ int nvars_in, varids_in[NUM_VARS] = {0};
+ signed char fill_value = 42, fill_value_in;
+ nc_type xtype_in;
+ size_t len_in;
+ char name_in[NC_MAX_NAME + 1];
+ int attnum_in;
+ int cnum;
+ char too_long_name[NC_MAX_NAME + 2];
+
+ /* Set up a name that is too long for netCDF. */
+ memset(too_long_name, 'a', NC_MAX_NAME + 1);
+ too_long_name[NC_MAX_NAME + 1] = 0;
+
+ printf("\n*** Testing netcdf-4 variable functions, even more.\n");
+ for (cnum = 0; cnum < MAX_CNUM; cnum++)
+ {
+ int cmode = 0;
+
+ switch(cnum)
+ {
+ case 0:
printf("*** Testing with classic format:\n");
cmode = 0;
break;
- case 1:
+ case 1:
printf("*** Testing with 64-bit offset format:\n");
cmode = NC_64BIT_OFFSET;
break;
- case 2:
+ case 2:
printf("*** Testing with HDF5:\n");
cmode = NC_NETCDF4|NC_CLOBBER;
break;
- case 3:
+ case 3:
printf("*** Testing with HDF5, netCDF Classic Model:\n");
cmode = NC_CLASSIC_MODEL | NC_NETCDF4;
- break;
- default:
- return 1;
- }
+ break;
+ default:
+ return 1;
+ }
#define FILE_NAME2 "tst_vars2_latefill.nc"
- printf("**** testing simple fill value attribute creation...");
- {
- int schar_data = 0;
- size_t index[1] = {0};
- int expected_ret;
- int dimid;
-
- /* Determined the expected result of setting fill value
- * late. For historical reasons this is allowed for classic
- * and 64-bit offset formats, but should never be done. */
- if (cmode == 0 || cmode == NC_64BIT_OFFSET)
- expected_ret = NC_NOERR;
- else
- expected_ret = NC_ELATEFILL;
-
- /* Create a netcdf-4 file with one scalar var. Add fill
- * value. */
- if (nc_create(FILE_NAME2, cmode, &ncid)) ERR;
- if (nc_def_dim(ncid, VAR_NAME, TEST_VAL_42, &dimid)) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_BYTE, 1, &dimid, &varid)) ERR;
- if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
- if (nc_enddef(ncid)) ERR;
- if (nc_put_var1(ncid, varid, index, &schar_data)) ERR;
- if (nc_redef(ncid)) ERR;
- if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1,
- &fill_value) != expected_ret) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME2, NC_WRITE, &ncid)) ERR;
- if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
- if (nvars_in != 1 || varids_in[0] != 0) ERR;
- if (nc_inq_varname(ncid, 0, name_in)) ERR;
- if (strcmp(name_in, VAR_NAME)) ERR;
- if (nc_inq_att(ncid, varid, _FillValue, &xtype_in, &len_in)) ERR;
- if (xtype_in != NC_BYTE || len_in != 1) ERR;
- if (nc_get_att(ncid, varid, _FillValue, &fill_value_in)) ERR;
- if (fill_value_in != fill_value) ERR;
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing simple fill value with data read...");
- {
- size_t start[NUM_DIMS], count[NUM_DIMS];
- signed char data = 99, data_in;
-
- /* Create a netcdf-4 file with one unlimited dim and one
- * var. Add fill value. */
- if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
- if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
- if (nc_enddef(ncid)) ERR;
-
- /* Write the second record. */
- start[0] = 1;
- count[0] = 1;
- if (nc_put_vara_schar(ncid, varid, start, count, &data)) ERR;
-
- /* Read the first record, it should be the fill value. */
- start[0] = 0;
- if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
- if (data_in != fill_value) ERR;
-
- /* Read the second record, it should be the value we just wrote
- * there. */
- start[0] = 1;
- if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
- if (data_in != data) ERR;
-
- /* Close up. */
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* This will not work because file was opened read-only. */
- if (nc_rename_var(ncid, 0, "something_very_new") != NC_EPERM) ERR;
-
- /* Check metadata. */
- if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
- if (nvars_in != 1 || varids_in[0] != 0) ERR;
- if (nc_inq_varname(ncid, 0, name_in)) ERR;
- if (strcmp(name_in, VAR_NAME)) ERR;
-
- /* Check fill value att. */
- if (nc_inq_att(ncid, varid, _FillValue, &xtype_in, &len_in)) ERR;
- if (xtype_in != NC_BYTE || len_in != 1) ERR;
- if (nc_get_att(ncid, varid, _FillValue, &fill_value_in)) ERR;
- if (fill_value_in != fill_value) ERR;
-
- /* Read the first record, it should be the fill value. */
- start[0] = 0;
- if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
- if (data_in != fill_value) ERR;
-
- /* Read the second record, it should be the value we just wrote
- * there. */
- start[0] = 1;
- if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
- if (data_in != data) ERR;
-
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing fill value with one other attribute...");
-
- {
- int losses_value = 192, losses_value_in;
-
- /* Create a netcdf-4 file with one dim and one var. Add another
- * attribute, then fill value. */
- if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
- if (nc_put_att_int(ncid, varid, LOSSES_NAME, NC_INT, 1, &losses_value)) ERR;
- if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
- if (nc_inq_att(ncid, 0, LOSSES_NAME, &xtype_in, &len_in)) ERR;
- if (xtype_in != NC_INT || len_in != 1) ERR;
- if (nc_get_att(ncid, 0, LOSSES_NAME, &losses_value_in)) ERR;
- if (losses_value_in != losses_value) ERR;
- if (nc_inq_att(ncid, 0, _FillValue, &xtype_in, &len_in)) ERR;
- if (xtype_in != NC_BYTE || len_in != 1) ERR;
- if (nc_get_att(ncid, 0, _FillValue, &fill_value_in)) ERR;
- if (fill_value_in != fill_value) ERR;
- if (nc_inq_attid(ncid, 0, LOSSES_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing fill value with three other attributes...");
- {
+ printf("**** testing simple fill value attribute creation...");
+ {
+ int schar_data = 0;
+ size_t index[1] = {0};
+ int expected_ret;
+ int dimid;
+
+ /* Determined the expected result of setting fill value
+ * late. For historical reasons this is allowed for classic
+ * and 64-bit offset formats, but should never be done. */
+ if (cmode == 0 || cmode == NC_64BIT_OFFSET)
+ expected_ret = NC_NOERR;
+ else
+ expected_ret = NC_ELATEFILL;
+
+ /* Create a netcdf-4 file with one scalar var. Add fill
+ * value. */
+ if (nc_create(FILE_NAME2, cmode, &ncid)) ERR;
+ if (nc_def_dim(ncid, VAR_NAME, TEST_VAL_42, &dimid)) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_BYTE, 1, &dimid, &varid)) ERR;
+ if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
+ if (nc_enddef(ncid)) ERR;
+ if (nc_put_var1(ncid, varid, index, &schar_data)) ERR;
+ if (nc_redef(ncid)) ERR;
+ if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1,
+ &fill_value) != expected_ret) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME2, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
+ if (nvars_in != 1 || varids_in[0] != 0) ERR;
+ if (nc_inq_varname(ncid, 0, name_in)) ERR;
+ if (strcmp(name_in, VAR_NAME)) ERR;
+ if (nc_inq_att(ncid, varid, _FillValue, &xtype_in, &len_in)) ERR;
+ if (xtype_in != NC_BYTE || len_in != 1) ERR;
+ if (nc_get_att(ncid, varid, _FillValue, &fill_value_in)) ERR;
+ if (fill_value_in != fill_value) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing simple fill value with data read...");
+ {
+ size_t start[NUM_DIMS], count[NUM_DIMS];
+ signed char data = 99, data_in;
+
+ /* Create a netcdf-4 file with one unlimited dim and one
+ * var. Add fill value. */
+ if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
+ if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
+ if (nc_enddef(ncid)) ERR;
+
+ /* Write the second record. */
+ start[0] = 1;
+ count[0] = 1;
+ if (nc_put_vara_schar(ncid, varid, start, count, &data)) ERR;
+
+ /* Read the first record, it should be the fill value. */
+ start[0] = 0;
+ if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
+ if (data_in != fill_value) ERR;
+
+ /* Read the second record, it should be the value we just wrote
+ * there. */
+ start[0] = 1;
+ if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
+ if (data_in != data) ERR;
+
+ /* Close up. */
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* This will not work because file was opened read-only. */
+ if (nc_rename_var(ncid, 0, "something_very_new") != NC_EPERM) ERR;
+
+ /* Check metadata. */
+ if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
+ if (nvars_in != 1 || varids_in[0] != 0) ERR;
+ if (nc_inq_varname(ncid, 0, name_in)) ERR;
+ if (strcmp(name_in, VAR_NAME)) ERR;
+
+ /* Check fill value att. */
+ if (nc_inq_att(ncid, varid, _FillValue, &xtype_in, &len_in)) ERR;
+ if (xtype_in != NC_BYTE || len_in != 1) ERR;
+ if (nc_get_att(ncid, varid, _FillValue, &fill_value_in)) ERR;
+ if (fill_value_in != fill_value) ERR;
+
+ /* Read the first record, it should be the fill value. */
+ start[0] = 0;
+ if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
+ if (data_in != fill_value) ERR;
+
+ /* Read the second record, it should be the value we just wrote
+ * there. */
+ start[0] = 1;
+ if (nc_get_vara_schar(ncid, varid, start, count, &data_in)) ERR;
+ if (data_in != data) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing fill value with one other attribute...");
+
+ {
+ int losses_value = 192, losses_value_in;
+
+ /* Create a netcdf-4 file with one dim and one var. Add another
+ * attribute, then fill value. */
+ if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
+ if (nc_put_att_int(ncid, varid, LOSSES_NAME, NC_INT, 1, &losses_value)) ERR;
+ if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_att(ncid, 0, LOSSES_NAME, &xtype_in, &len_in)) ERR;
+ if (xtype_in != NC_INT || len_in != 1) ERR;
+ if (nc_get_att(ncid, 0, LOSSES_NAME, &losses_value_in)) ERR;
+ if (losses_value_in != losses_value) ERR;
+ if (nc_inq_att(ncid, 0, _FillValue, &xtype_in, &len_in)) ERR;
+ if (xtype_in != NC_BYTE || len_in != 1) ERR;
+ if (nc_get_att(ncid, 0, _FillValue, &fill_value_in)) ERR;
+ if (fill_value_in != fill_value) ERR;
+ if (nc_inq_attid(ncid, 0, LOSSES_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing fill value with three other attributes...");
+ {
#define NUM_LEADERS 3
- char leader[NUM_LEADERS][NC_MAX_NAME + 1] = {"hair_length_of_strategoi",
- "hair_length_of_Miltiades",
- "hair_length_of_Darius_I"};
- short hair_length[NUM_LEADERS] = {3, 11, 4};
- short short_in;
- int a;
-
- /* Create a netcdf file with one dim and one var. Add 3
- * attributes, then fill value. */
- if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
- for (a = 0; a < NUM_LEADERS; a++)
- if (nc_put_att_short(ncid, varid, leader[a], NC_SHORT, 1, &hair_length[a])) ERR;
- if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* Check our three hair-related attributes. */
- for (a = 0; a < NUM_LEADERS; a++)
- {
- if (nc_inq_att(ncid, 0, leader[a], &xtype_in, &len_in)) ERR;
- if (xtype_in != NC_SHORT || len_in != 1) ERR;
- if (nc_get_att(ncid, 0, leader[a], &short_in)) ERR;
- if (short_in != hair_length[a]) ERR;
- if (nc_inq_attid(ncid, 0, leader[a], &attnum_in)) ERR;
- if (attnum_in != a) ERR;
- }
-
- /* Check our fill value attribute. */
- if (nc_inq_att(ncid, 0, _FillValue, &xtype_in, &len_in)) ERR;
- if (xtype_in != NC_BYTE || len_in != 1) ERR;
- if (nc_get_att(ncid, 0, _FillValue, &fill_value_in)) ERR;
- if (fill_value_in != fill_value) ERR;
-
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing fill value with simple example...");
- {
+ char leader[NUM_LEADERS][NC_MAX_NAME + 1] = {"hair_length_of_strategoi",
+ "hair_length_of_Miltiades",
+ "hair_length_of_Darius_I"};
+ short hair_length[NUM_LEADERS] = {3, 11, 4};
+ short short_in;
+ int a;
+
+ /* Create a netcdf file with one dim and one var. Add 3
+ * attributes, then fill value. */
+ if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM1_NAME, DIM1_LEN, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_BYTE, NUM_DIMS, dimids, &varid)) ERR;
+ for (a = 0; a < NUM_LEADERS; a++)
+ if (nc_put_att_short(ncid, varid, leader[a], NC_SHORT, 1, &hair_length[a])) ERR;
+ if (nc_put_att_schar(ncid, varid, _FillValue, NC_BYTE, 1, &fill_value)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* Check our three hair-related attributes. */
+ for (a = 0; a < NUM_LEADERS; a++)
+ {
+ if (nc_inq_att(ncid, 0, leader[a], &xtype_in, &len_in)) ERR;
+ if (xtype_in != NC_SHORT || len_in != 1) ERR;
+ if (nc_get_att(ncid, 0, leader[a], &short_in)) ERR;
+ if (short_in != hair_length[a]) ERR;
+ if (nc_inq_attid(ncid, 0, leader[a], &attnum_in)) ERR;
+ if (attnum_in != a) ERR;
+ }
+
+ /* Check our fill value attribute. */
+ if (nc_inq_att(ncid, 0, _FillValue, &xtype_in, &len_in)) ERR;
+ if (xtype_in != NC_BYTE || len_in != 1) ERR;
+ if (nc_get_att(ncid, 0, _FillValue, &fill_value_in)) ERR;
+ if (fill_value_in != fill_value) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing fill value with simple example...");
+ {
/* Dims stuff. */
#define NDIMS 3
#define VAR_DIMS 3
@@ -272,65 +272,65 @@
#define UNITS "units"
#define HECTOPASCALS "hectopascals"
- int dimid[NDIMS], var_dimids[VAR_DIMS] = {2, 1, 0};
- float fill_value = -9999.0f;
- char long_name[] = PRES_MAX_WIND;
-
- if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
-
- /* Create dims. */
- if (nc_def_dim(ncid, DIM_A, DIM_A_LEN, &dimid[0])) ERR;
- if (nc_def_dim (ncid, DIM_B, DIM_B_LEN, &dimid[1])) ERR;
- if (nc_def_dim(ncid, DIM_C, DIM_C_LEN, &dimid[2])) ERR;
-
- /* Create var. */
- if (nc_def_var(ncid, CXX_VAR_NAME, NC_FLOAT, VAR_DIMS,
- var_dimids, &varid)) ERR;
- if (varid) ERR;
-
- if (nc_put_att(ncid, varid, LONG_NAME, NC_CHAR, strlen(long_name) + 1,
- long_name)) ERR;
- if (nc_put_att(ncid, varid, UNITS, NC_CHAR, strlen(UNITS) + 1,
- UNITS)) ERR;
-
- /* Check to ensure the atts have their expected attnums. */
- if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
-
- /* Now add a fill value. This will acutually cause HDF5 to
- * destroy the dataset and recreate it, recreating also the
- * three attributes that are attached to it. */
- if (nc_put_att(ncid, varid, _FillValue, NC_FLOAT,
- 1, &fill_value)) ERR;
-
- /* Check to ensure the atts have their expected attnums. */
- if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
-
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, 0, &ncid)) ERR;
- if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
- if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
- if (attnum_in != 2) ERR;
-
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+ int dimid[NDIMS], var_dimids[VAR_DIMS] = {2, 1, 0};
+ float fill_value = -9999.0f;
+ char long_name[] = PRES_MAX_WIND;
+
+ if (nc_create(FILE_NAME, cmode, &ncid)) ERR;
+
+ /* Create dims. */
+ if (nc_def_dim(ncid, DIM_A, DIM_A_LEN, &dimid[0])) ERR;
+ if (nc_def_dim (ncid, DIM_B, DIM_B_LEN, &dimid[1])) ERR;
+ if (nc_def_dim(ncid, DIM_C, DIM_C_LEN, &dimid[2])) ERR;
+
+ /* Create var. */
+ if (nc_def_var(ncid, CXX_VAR_NAME, NC_FLOAT, VAR_DIMS,
+ var_dimids, &varid)) ERR;
+ if (varid) ERR;
+
+ if (nc_put_att(ncid, varid, LONG_NAME, NC_CHAR, strlen(long_name) + 1,
+ long_name)) ERR;
+ if (nc_put_att(ncid, varid, UNITS, NC_CHAR, strlen(UNITS) + 1,
+ UNITS)) ERR;
+
+ /* Check to ensure the atts have their expected attnums. */
+ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+
+ /* Now add a fill value. This will acutually cause HDF5 to
+ * destroy the dataset and recreate it, recreating also the
+ * three attributes that are attached to it. */
+ if (nc_put_att(ncid, varid, _FillValue, NC_FLOAT,
+ 1, &fill_value)) ERR;
+
+ /* Check to ensure the atts have their expected attnums. */
+ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, 0, &ncid)) ERR;
+ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+ if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
+ if (attnum_in != 2) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
#ifndef NO_NETCDF_2
- /* The following test is an attempt to recreate a problem occurring
- in the cxx tests. The file is created in c++ in nctsts.cpp. */
- printf("**** testing fill value with example from cxx tests in v2 api...");
- {
+ /* The following test is an attempt to recreate a problem occurring
+ in the cxx tests. The file is created in c++ in nctsts.cpp. */
+ printf("**** testing fill value with example from cxx tests in v2 api...");
+ {
/* Dims stuff. */
#define NDIMS_1 4
#define VAR_DIMS 3
@@ -351,421 +351,421 @@
#define LONG_NAME "long_name"
#define UNITS "units"
- int dimid[NDIMS_1], var_dimids[VAR_DIMS] = {2, 0, 1};
- float fill_value = -9999.0f;
- char long_name[] = PRES_MAX_WIND;
- int i;
-
- ncid = nccreate(FILE_NAME, NC_NETCDF4);
-
- /* Create dims. */
- dimid[0] = ncdimdef(ncid, LAT, LAT_LEN);
- dimid[1] = ncdimdef(ncid, LON, LON_LEN);
- dimid[2] = ncdimdef(ncid, FRTIMED, FRTIMED_LEN);
- dimid[3] = ncdimdef(ncid, TIMELEN, TIMELEN_LEN);
-
- /* Just check our dimids to see that they are correct. */
- for (i = 0; i < NDIMS_1; i++)
- if (dimid[i] != i) ERR;
-
- /* Create var. */
- varid = ncvardef(ncid, CXX_VAR_NAME, NC_FLOAT, VAR_DIMS, var_dimids);
- if (varid) ERR;
-
- /* Add three atts to the var, long_name, units, and
- * valid_range. */
- if (nc_put_att(ncid, varid, LONG_NAME, NC_CHAR, strlen(long_name) + 1,
- long_name)) ERR;
- if (nc_put_att(ncid, varid, UNITS, NC_CHAR, strlen(UNITS) + 1,
- UNITS)) ERR;
-
- /* Check to ensure the atts have their expected attnums. */
- if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
-
- /* Now add a fill value. This will acutually cause HDF5 to
- * destroy the dataset and recreate it, recreating also the
- * three attributes that are attached to it. */
- ncattput(ncid, varid, _FillValue, NC_FLOAT, 1, &fill_value);
-
- /* Check to ensure the atts have their expected attnums. */
- if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
- if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
- if (attnum_in != 2) ERR;
-
- ncclose(ncid);
-
- /* Open the file and check. */
- ncid = ncopen(FILE_NAME, 0);
- if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
- if (attnum_in != 0) ERR;
- if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
- if (attnum_in != 1) ERR;
- if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
- if (attnum_in != 2) ERR;
- ncclose(ncid);
- }
- SUMMARIZE_ERR;
+ int dimid[NDIMS_1], var_dimids[VAR_DIMS] = {2, 0, 1};
+ float fill_value = -9999.0f;
+ char long_name[] = PRES_MAX_WIND;
+ int i;
+
+ ncid = nccreate(FILE_NAME, NC_NETCDF4);
+
+ /* Create dims. */
+ dimid[0] = ncdimdef(ncid, LAT, LAT_LEN);
+ dimid[1] = ncdimdef(ncid, LON, LON_LEN);
+ dimid[2] = ncdimdef(ncid, FRTIMED, FRTIMED_LEN);
+ dimid[3] = ncdimdef(ncid, TIMELEN, TIMELEN_LEN);
+
+ /* Just check our dimids to see that they are correct. */
+ for (i = 0; i < NDIMS_1; i++)
+ if (dimid[i] != i) ERR;
+
+ /* Create var. */
+ varid = ncvardef(ncid, CXX_VAR_NAME, NC_FLOAT, VAR_DIMS, var_dimids);
+ if (varid) ERR;
+
+ /* Add three atts to the var, long_name, units, and
+ * valid_range. */
+ if (nc_put_att(ncid, varid, LONG_NAME, NC_CHAR, strlen(long_name) + 1,
+ long_name)) ERR;
+ if (nc_put_att(ncid, varid, UNITS, NC_CHAR, strlen(UNITS) + 1,
+ UNITS)) ERR;
+
+ /* Check to ensure the atts have their expected attnums. */
+ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+
+ /* Now add a fill value. This will acutually cause HDF5 to
+ * destroy the dataset and recreate it, recreating also the
+ * three attributes that are attached to it. */
+ ncattput(ncid, varid, _FillValue, NC_FLOAT, 1, &fill_value);
+
+ /* Check to ensure the atts have their expected attnums. */
+ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+ if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
+ if (attnum_in != 2) ERR;
+
+ ncclose(ncid);
+
+ /* Open the file and check. */
+ ncid = ncopen(FILE_NAME, 0);
+ if (nc_inq_attid(ncid, 0, LONG_NAME, &attnum_in)) ERR;
+ if (attnum_in != 0) ERR;
+ if (nc_inq_attid(ncid, 0, UNITS, &attnum_in)) ERR;
+ if (attnum_in != 1) ERR;
+ if (nc_inq_attid(ncid, 0, _FillValue, &attnum_in)) ERR;
+ if (attnum_in != 2) ERR;
+ ncclose(ncid);
+ }
+ SUMMARIZE_ERR;
#endif /* NO_NETCDF_2 */
- }
+ }
- printf("**** testing create order varids...");
+ printf("**** testing create order varids...");
#define UNITS "units"
#define DIMNAME "x"
#define VARNAME "data"
- {
- /* This test contributed by Jeff Whitaker of NOAA - Thanks Jeff! */
- int ncid, dimid, varid, xvarid;
- char units[] = "zlotys";
-
- if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
- if (nc_def_dim(ncid, DIMNAME, 1, &dimid)) ERR;
- if (nc_enddef(ncid)) ERR;
- if (nc_redef(ncid)) ERR;
-
- /* Check that these netCDF-4 things will fail on this classic
- * model file. */
- if (nc_def_var(ncid, DIMNAME, NC_UINT, 1, &dimid, &xvarid) != NC_ESTRICTNC3) ERR;
- if (nc_def_var(ncid, DIMNAME, NC_INT, NC_MAX_VAR_DIMS + 1, &dimid,
- &xvarid) != NC_EMAXDIMS) ERR;
- if (nc_enddef(ncid)) ERR;
- if (nc_def_var(ncid, DIMNAME, NC_INT, 1, &dimid, &xvarid) != NC_ENOTINDEFINE) ERR;
- if (nc_redef(ncid)) ERR;
-
- /* Define the variable for the test. */
- if (nc_def_var(ncid, DIMNAME, NC_INT, 1, &dimid, &xvarid)) ERR;
- if (nc_put_att_text(ncid, xvarid, UNITS, strlen(units), units)) ERR;
- if (nc_def_var(ncid, VARNAME, NC_INT, 1, &dimid, &varid)) ERR;
- if (nc_close(ncid)) ERR;
-
- if (nc_open(FILE_NAME, 0, &ncid)) ERR;
- if (nc_close(ncid)) ERR;
- }
+ {
+ /* This test contributed by Jeff Whitaker of NOAA - Thanks Jeff! */
+ int ncid, dimid, varid, xvarid;
+ char units[] = "zlotys";
+
+ if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIMNAME, 1, &dimid)) ERR;
+ if (nc_enddef(ncid)) ERR;
+ if (nc_redef(ncid)) ERR;
+
+ /* Check that these netCDF-4 things will fail on this classic
+ * model file. */
+ if (nc_def_var(ncid, DIMNAME, NC_UINT, 1, &dimid, &xvarid) != NC_ESTRICTNC3) ERR;
+ if (nc_def_var(ncid, DIMNAME, NC_INT, NC_MAX_VAR_DIMS + 1, &dimid,
+ &xvarid) != NC_EMAXDIMS) ERR;
+ if (nc_enddef(ncid)) ERR;
+ if (nc_def_var(ncid, DIMNAME, NC_INT, 1, &dimid, &xvarid) != NC_ENOTINDEFINE) ERR;
+ if (nc_redef(ncid)) ERR;
+
+ /* Define the variable for the test. */
+ if (nc_def_var(ncid, DIMNAME, NC_INT, 1, &dimid, &xvarid)) ERR;
+ if (nc_put_att_text(ncid, xvarid, UNITS, strlen(units), units)) ERR;
+ if (nc_def_var(ncid, VARNAME, NC_INT, 1, &dimid, &varid)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ if (nc_open(FILE_NAME, 0, &ncid)) ERR;
+ if (nc_close(ncid)) ERR;
+ }
- SUMMARIZE_ERR;
+ SUMMARIZE_ERR;
#define RANK_wind 1
- printf("**** testing simple variable renaming...");
- {
- /* This test contributed by Jeff Whitaker of NOAA - Thanks Jeff! */
- int ncid, lat_dim, time_dim, lon_dim, wind_id;
- size_t lat_len = 73, time_len = 10, lon_len = 145;
- int cdf_goober[1];
+ printf("**** testing simple variable renaming...");
+ {
+ /* This test contributed by Jeff Whitaker of NOAA - Thanks Jeff! */
+ int ncid, lat_dim, time_dim, lon_dim, wind_id;
+ size_t lat_len = 73, time_len = 10, lon_len = 145;
+ int cdf_goober[1];
/* if (nc_set_default_format(NC_FORMAT_NETCDF4, NULL)) ERR;*/
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- /* define dimensions */
- if (nc_def_dim(ncid, "a", lon_len, &lon_dim)) ERR;
- if (nc_def_dim(ncid, "b", lat_len, &lat_dim)) ERR;
- if (nc_def_dim(ncid, "c", time_len, &time_dim)) ERR;
-
- if (nc_put_att_text(ncid, NC_GLOBAL, "a", 3, "bar")) ERR;
- cdf_goober[0] = 2;
- if (nc_put_att_int(ncid, NC_GLOBAL, "b", NC_INT, 1, cdf_goober)) ERR;
-
- /* define variables */
- if (nc_def_var(ncid, "aa", NC_FLOAT, RANK_wind, &lon_dim, &wind_id)) ERR;
- if (nc_close(ncid)) ERR;
-
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
-
- /* These won't work. */
- if (nc_rename_var(ncid + TEST_VAL_42, 0, "az") != NC_EBADID) ERR;
- if (nc_rename_var(ncid + MILLION, 0, "az") != NC_EBADID) ERR;
-
- /* Rename the var. */
- if (nc_rename_var(ncid, 0, "az")) ERR;
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing dimension and variable renaming...");
- {
- /* This test based on code contributed by Jeff Whitaker of NOAA
- * - Thanks Jeff! */
- int ncid, lat_dim, time_dim, lon_dim, wind_id, temp2_id;
- size_t lat_len = 73, time_len = 10, lon_len = 145;
- int wind_dims[RANK_wind], wind_slobber[1], cdf_goober[1];
-
- if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
-
- /* define dimensions */
- if (nc_def_dim(ncid, "lon", lon_len, &lon_dim)) ERR;
- if (nc_def_dim(ncid, "lat", lat_len, &lat_dim)) ERR;
- if (nc_def_dim(ncid, "time", time_len, &time_dim)) ERR;
-
- if (nc_put_att_text(ncid, NC_GLOBAL, "foo", 3, "bar")) ERR;
- cdf_goober[0] = 2;
- if (nc_put_att_int(ncid, NC_GLOBAL, "goober", NC_INT, 1, cdf_goober)) ERR;
-
- /* define variables */
- wind_dims[0] = lon_dim;
- if (nc_def_var(ncid, "temp", NC_FLOAT, RANK_wind, wind_dims, &wind_id)) ERR;
- if (nc_def_var(ncid, "temp2", NC_FLOAT, RANK_wind, wind_dims, &temp2_id)) ERR;
-
- if (nc_put_att_text(ncid, wind_id, "bar", 3, "foo")) ERR;
- wind_slobber[0] = 3;
- if (nc_put_att_int(ncid, wind_id, "slobber", NC_INT, 1, wind_slobber)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* re-open dataset*/
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_dimid(ncid, "lon", &lon_dim)) ERR;
-
- /* THese won't work due to bad params. */
- if (nc_rename_dim(ncid + MILLION, lon_dim, "longitude") != NC_EBADID) ERR;
- if (nc_rename_dim(ncid + TEST_VAL_42, lon_dim, "longitude") != NC_EBADID) ERR;
- if (nc_rename_dim(ncid, lon_dim, NULL) != NC_EINVAL) ERR;
-
- /* rename dimension */
- if (nc_rename_dim(ncid, lon_dim, "longitude")) ERR;
-
- /* These will fail due to bad params. */
- if (nc_inq_varid(ncid + MILLION, "temp", &wind_id) != NC_EBADID) ERR;
- if (nc_inq_varid(ncid + TEST_VAL_42, "temp", &wind_id) != NC_EBADID) ERR;
- if (nc_inq_varid(ncid, NULL, &wind_id) != NC_EINVAL) ERR;
- if (nc_inq_varid(ncid, "not_a_real_name", &wind_id) != NC_ENOTVAR) ERR;
- if (nc_inq_varid(ncid, BAD_NAME, &wind_id) != NC_ENOTVAR) ERR;
- if (nc_inq_varid(ncid, too_long_name, &wind_id) != NC_EMAXNAME) ERR;
-
- /* Now get the variable ID. */
- if (nc_inq_varid(ncid, "temp", &wind_id)) ERR;
-
- /* THis also works, pointlessly. */
- if (nc_inq_varid(ncid, "temp", NULL)) ERR;
-
- /* These won't work due to bad parameters. */
- if (nc_rename_var(ncid + MILLION, wind_id, "wind") != NC_EBADID) ERR;
- if (nc_rename_var(ncid, wind_id + TEST_VAL_42, "wind") != NC_ENOTVAR) ERR;
- if (nc_rename_var(ncid, -TEST_VAL_42, "wind") != NC_ENOTVAR) ERR;
- if (nc_rename_var(ncid, wind_id, BAD_NAME) != NC_EBADNAME) ERR;
- if (nc_rename_var(ncid, wind_id, too_long_name) != NC_EMAXNAME) ERR;
- if (nc_rename_var(ncid, wind_id, "temp2") != NC_ENAMEINUSE) ERR;
- if (nc_rename_var(ncid, wind_id, "windy") != NC_ENOTINDEFINE) ERR;
- if (nc_rename_var(ncid, wind_id, NULL) != NC_EINVAL) ERR;
-
- /* rename variable */
- if (nc_rename_var(ncid, wind_id, "wind")) ERR;
-
- /* Enter define mode and rename it to something longer. */
- if (nc_redef(ncid)) ERR;
- if (nc_rename_var(ncid, wind_id, "windy")) ERR;
- if (nc_inq_varid(ncid, "windy", &wind_id)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Try again without classic. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
-
- /* define dimension */
- if (nc_def_dim(ncid, "lon", lon_len, &lon_dim)) ERR;
-
- /* define variable */
- wind_dims[0] = lon_dim;
- if (nc_def_var(ncid, "temp", NC_FLOAT, RANK_wind, wind_dims, &wind_id)) ERR;
- if (nc_enddef(ncid)) ERR;
- if (nc_rename_var(ncid, wind_id, "windy")) ERR;
- if (nc_close(ncid)) ERR;
+ /* define dimensions */
+ if (nc_def_dim(ncid, "a", lon_len, &lon_dim)) ERR;
+ if (nc_def_dim(ncid, "b", lat_len, &lat_dim)) ERR;
+ if (nc_def_dim(ncid, "c", time_len, &time_dim)) ERR;
+
+ if (nc_put_att_text(ncid, NC_GLOBAL, "a", 3, "bar")) ERR;
+ cdf_goober[0] = 2;
+ if (nc_put_att_int(ncid, NC_GLOBAL, "b", NC_INT, 1, cdf_goober)) ERR;
+
+ /* define variables */
+ if (nc_def_var(ncid, "aa", NC_FLOAT, RANK_wind, &lon_dim, &wind_id)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+
+ /* These won't work. */
+ if (nc_rename_var(ncid + TEST_VAL_42, 0, "az") != NC_EBADID) ERR;
+ if (nc_rename_var(ncid + MILLION, 0, "az") != NC_EBADID) ERR;
+
+ /* Rename the var. */
+ if (nc_rename_var(ncid, 0, "az")) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing dimension and variable renaming...");
+ {
+ /* This test based on code contributed by Jeff Whitaker of NOAA
+ * - Thanks Jeff! */
+ int ncid, lat_dim, time_dim, lon_dim, wind_id, temp2_id;
+ size_t lat_len = 73, time_len = 10, lon_len = 145;
+ int wind_dims[RANK_wind], wind_slobber[1], cdf_goober[1];
+
+ if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLASSIC_MODEL, &ncid)) ERR;
+
+ /* define dimensions */
+ if (nc_def_dim(ncid, "lon", lon_len, &lon_dim)) ERR;
+ if (nc_def_dim(ncid, "lat", lat_len, &lat_dim)) ERR;
+ if (nc_def_dim(ncid, "time", time_len, &time_dim)) ERR;
+
+ if (nc_put_att_text(ncid, NC_GLOBAL, "foo", 3, "bar")) ERR;
+ cdf_goober[0] = 2;
+ if (nc_put_att_int(ncid, NC_GLOBAL, "goober", NC_INT, 1, cdf_goober)) ERR;
+
+ /* define variables */
+ wind_dims[0] = lon_dim;
+ if (nc_def_var(ncid, "temp", NC_FLOAT, RANK_wind, wind_dims, &wind_id)) ERR;
+ if (nc_def_var(ncid, "temp2", NC_FLOAT, RANK_wind, wind_dims, &temp2_id)) ERR;
+
+ if (nc_put_att_text(ncid, wind_id, "bar", 3, "foo")) ERR;
+ wind_slobber[0] = 3;
+ if (nc_put_att_int(ncid, wind_id, "slobber", NC_INT, 1, wind_slobber)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* re-open dataset*/
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_dimid(ncid, "lon", &lon_dim)) ERR;
+
+ /* THese won't work due to bad params. */
+ if (nc_rename_dim(ncid + MILLION, lon_dim, "longitude") != NC_EBADID) ERR;
+ if (nc_rename_dim(ncid + TEST_VAL_42, lon_dim, "longitude") != NC_EBADID) ERR;
+ if (nc_rename_dim(ncid, lon_dim, NULL) != NC_EINVAL) ERR;
+
+ /* rename dimension */
+ if (nc_rename_dim(ncid, lon_dim, "longitude")) ERR;
+
+ /* These will fail due to bad params. */
+ if (nc_inq_varid(ncid + MILLION, "temp", &wind_id) != NC_EBADID) ERR;
+ if (nc_inq_varid(ncid + TEST_VAL_42, "temp", &wind_id) != NC_EBADID) ERR;
+ if (nc_inq_varid(ncid, NULL, &wind_id) != NC_EINVAL) ERR;
+ if (nc_inq_varid(ncid, "not_a_real_name", &wind_id) != NC_ENOTVAR) ERR;
+ if (nc_inq_varid(ncid, BAD_NAME, &wind_id) != NC_ENOTVAR) ERR;
+ if (nc_inq_varid(ncid, too_long_name, &wind_id) != NC_EMAXNAME) ERR;
+
+ /* Now get the variable ID. */
+ if (nc_inq_varid(ncid, "temp", &wind_id)) ERR;
+
+ /* THis also works, pointlessly. */
+ if (nc_inq_varid(ncid, "temp", NULL)) ERR;
+
+ /* These won't work due to bad parameters. */
+ if (nc_rename_var(ncid + MILLION, wind_id, "wind") != NC_EBADID) ERR;
+ if (nc_rename_var(ncid, wind_id + TEST_VAL_42, "wind") != NC_ENOTVAR) ERR;
+ if (nc_rename_var(ncid, -TEST_VAL_42, "wind") != NC_ENOTVAR) ERR;
+ if (nc_rename_var(ncid, wind_id, BAD_NAME) != NC_EBADNAME) ERR;
+ if (nc_rename_var(ncid, wind_id, too_long_name) != NC_EMAXNAME) ERR;
+ if (nc_rename_var(ncid, wind_id, "temp2") != NC_ENAMEINUSE) ERR;
+ if (nc_rename_var(ncid, wind_id, "windy") != NC_ENOTINDEFINE) ERR;
+ if (nc_rename_var(ncid, wind_id, NULL) != NC_EINVAL) ERR;
+
+ /* rename variable */
+ if (nc_rename_var(ncid, wind_id, "wind")) ERR;
+
+ /* Enter define mode and rename it to something longer. */
+ if (nc_redef(ncid)) ERR;
+ if (nc_rename_var(ncid, wind_id, "windy")) ERR;
+ if (nc_inq_varid(ncid, "windy", &wind_id)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Try again without classic. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+
+ /* define dimension */
+ if (nc_def_dim(ncid, "lon", lon_len, &lon_dim)) ERR;
+
+ /* define variable */
+ wind_dims[0] = lon_dim;
+ if (nc_def_var(ncid, "temp", NC_FLOAT, RANK_wind, wind_dims, &wind_id)) ERR;
+ if (nc_enddef(ncid)) ERR;
+ if (nc_rename_var(ncid, wind_id, "windy")) ERR;
+ if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+ }
+ SUMMARIZE_ERR;
#ifndef NO_NETCDF_2
#define VAR_DIMS2 2
- printf("*** testing 2D array of NC_FLOAT with v2 API...");
- {
- int dimid[VAR_DIMS2];
- int ndims, nvars, natts, recdim;
-
- ncid = nccreate(FILE_NAME, NC_NETCDF4);
-
- /* Create dims. */
- dimid[0] = ncdimdef(ncid, LAT, LAT_LEN);
- dimid[1] = ncdimdef(ncid, LON, LON_LEN);
-
- /* Create var. */
- varid = ncvardef(ncid, CXX_VAR_NAME, NC_FLOAT, VAR_DIMS2, dimid);
- if (varid != 0) ERR;
-
- ncclose(ncid);
-
- /* Open the file and check. */
- ncid = ncopen(FILE_NAME, 0);
- ncinquire (ncid, &ndims, &nvars, &natts, &recdim);
- if (nvars != 1 || ndims != 2 || natts != 0 || recdim != -1) ERR;
- ncclose(ncid);
- }
- SUMMARIZE_ERR;
+ printf("*** testing 2D array of NC_FLOAT with v2 API...");
+ {
+ int dimid[VAR_DIMS2];
+ int ndims, nvars, natts, recdim;
+
+ ncid = nccreate(FILE_NAME, NC_NETCDF4);
+
+ /* Create dims. */
+ dimid[0] = ncdimdef(ncid, LAT, LAT_LEN);
+ dimid[1] = ncdimdef(ncid, LON, LON_LEN);
+
+ /* Create var. */
+ varid = ncvardef(ncid, CXX_VAR_NAME, NC_FLOAT, VAR_DIMS2, dimid);
+ if (varid != 0) ERR;
+
+ ncclose(ncid);
+
+ /* Open the file and check. */
+ ncid = ncopen(FILE_NAME, 0);
+ ncinquire (ncid, &ndims, &nvars, &natts, &recdim);
+ if (nvars != 1 || ndims != 2 || natts != 0 || recdim != -1) ERR;
+ ncclose(ncid);
+ }
+ SUMMARIZE_ERR;
#endif /* NO_NETCDF_2 */
#define NDIMS 3
#define NNAMES 4
#define NLINES 13
- printf("**** testing funny names for netCDF-4...");
- {
- int ncid, wind_id;
- size_t len[NDIMS] = {7, 3, 1};
- int dimids[NDIMS], dimids_in[NDIMS], ndims_in;
- char funny_name[NNAMES][NC_MAX_NAME] = {"\a\t", "\f\n", "\r\v", "\b"};
- char serious_name[NNAMES][NC_MAX_NAME] = {"name1", "name2", "name3", "name4"};
- char name_in[NC_MAX_NAME + 1];
- char *speech[NLINES] = {"who would fardels bear, ",
- "To grunt and sweat under a weary life, ",
- "But that the dread of something after death, ",
- "The undiscover'd country from whose bourn ",
- "No traveller returns, puzzles the will ",
- "And makes us rather bear those ills we have ",
- "Than fly to others that we know not of? ",
- "Thus conscience does make cowards of us all; ",
- "And thus the native hue of resolution ",
- "Is sicklied o'er with the pale cast of thought, ",
- "And enterprises of great pith and moment ",
- "With this regard their currents turn awry, ",
- "And lose the name of action."};
- char *speech_in[NLINES];
- int i;
- unsigned short nlines = NLINES;
- unsigned int nlines_in;
-
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
-
- /* Define dimensions. Funny names are rejected, serious names work. */
- for (i = 0; i < NDIMS; i++)
- if (nc_def_dim(ncid, funny_name[i], len[i], &dimids[i]) != NC_EBADNAME) ERR;
- for (i = 0; i < NDIMS; i++)
- if (nc_def_dim(ncid, serious_name[i], len[i], &dimids[i])) ERR;
-
- /* Write some global atts. Funny names are rejected, serious names work. */
- if (nc_put_att_string(ncid, NC_GLOBAL, funny_name[0], NLINES,
- (const char **)speech) != NC_EBADNAME) ERR;
- if (nc_put_att_ushort(ncid, NC_GLOBAL, funny_name[1], NC_UINT, 1, &nlines) != NC_EBADNAME) ERR;
- if (nc_put_att_string(ncid, NC_GLOBAL, serious_name[0], NLINES,
- (const char **)speech)) ERR;
- if (nc_put_att_ushort(ncid, NC_GLOBAL, serious_name[1], NC_UINT, 1, &nlines)) ERR;
-
- /* Define variables. Funny name fails, seriousness wins the day! */
- if (nc_def_var(ncid, funny_name[3], NC_INT64, NDIMS, dimids, &wind_id) != NC_EBADNAME) ERR;
- if (nc_def_var(ncid, serious_name[3], NC_INT64, NDIMS, dimids, &wind_id)) ERR;
-
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_dimids(ncid, &ndims_in, dimids_in, 0)) ERR;
- if (ndims_in != NDIMS) ERR;
- for (i = 0; i < NDIMS; i++)
- {
- if (dimids_in[i] != i) ERR;
- if (nc_inq_dimname(ncid, i, name_in)) ERR;
- if (strcmp(name_in, serious_name[i])) ERR;
- }
-
- if (nc_get_att_string(ncid, NC_GLOBAL, serious_name[0], (char **)speech_in)) ERR;
- for (i = 0; i < NLINES; i++)
- if (strcmp(speech_in[i], speech[i])) ERR;
- if (nc_get_att_uint(ncid, NC_GLOBAL, serious_name[1], &nlines_in)) ERR;
- if (nlines_in != NLINES) ERR;
- if (nc_free_string(NLINES, (char **)speech_in)) ERR;
- if (nc_inq_varname(ncid, 0, name_in)) ERR;
- if (strcmp(name_in, serious_name[3])) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing endianness...");
+ printf("**** testing funny names for netCDF-4...");
+ {
+ int ncid, wind_id;
+ size_t len[NDIMS] = {7, 3, 1};
+ int dimids[NDIMS], dimids_in[NDIMS], ndims_in;
+ char funny_name[NNAMES][NC_MAX_NAME] = {"\a\t", "\f\n", "\r\v", "\b"};
+ char serious_name[NNAMES][NC_MAX_NAME] = {"name1", "name2", "name3", "name4"};
+ char name_in[NC_MAX_NAME + 1];
+ char *speech[NLINES] = {"who would fardels bear, ",
+ "To grunt and sweat under a weary life, ",
+ "But that the dread of something after death, ",
+ "The undiscover'd country from whose bourn ",
+ "No traveller returns, puzzles the will ",
+ "And makes us rather bear those ills we have ",
+ "Than fly to others that we know not of? ",
+ "Thus conscience does make cowards of us all; ",
+ "And thus the native hue of resolution ",
+ "Is sicklied o'er with the pale cast of thought, ",
+ "And enterprises of great pith and moment ",
+ "With this regard their currents turn awry, ",
+ "And lose the name of action."};
+ char *speech_in[NLINES];
+ int i;
+ unsigned short nlines = NLINES;
+ unsigned int nlines_in;
+
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+
+ /* Define dimensions. Funny names are rejected, serious names work. */
+ for (i = 0; i < NDIMS; i++)
+ if (nc_def_dim(ncid, funny_name[i], len[i], &dimids[i]) != NC_EBADNAME) ERR;
+ for (i = 0; i < NDIMS; i++)
+ if (nc_def_dim(ncid, serious_name[i], len[i], &dimids[i])) ERR;
+
+ /* Write some global atts. Funny names are rejected, serious names work. */
+ if (nc_put_att_string(ncid, NC_GLOBAL, funny_name[0], NLINES,
+ (const char **)speech) != NC_EBADNAME) ERR;
+ if (nc_put_att_ushort(ncid, NC_GLOBAL, funny_name[1], NC_UINT, 1, &nlines) != NC_EBADNAME) ERR;
+ if (nc_put_att_string(ncid, NC_GLOBAL, serious_name[0], NLINES,
+ (const char **)speech)) ERR;
+ if (nc_put_att_ushort(ncid, NC_GLOBAL, serious_name[1], NC_UINT, 1, &nlines)) ERR;
+
+ /* Define variables. Funny name fails, seriousness wins the day! */
+ if (nc_def_var(ncid, funny_name[3], NC_INT64, NDIMS, dimids, &wind_id) != NC_EBADNAME) ERR;
+ if (nc_def_var(ncid, serious_name[3], NC_INT64, NDIMS, dimids, &wind_id)) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_dimids(ncid, &ndims_in, dimids_in, 0)) ERR;
+ if (ndims_in != NDIMS) ERR;
+ for (i = 0; i < NDIMS; i++)
+ {
+ if (dimids_in[i] != i) ERR;
+ if (nc_inq_dimname(ncid, i, name_in)) ERR;
+ if (strcmp(name_in, serious_name[i])) ERR;
+ }
+
+ if (nc_get_att_string(ncid, NC_GLOBAL, serious_name[0], (char **)speech_in)) ERR;
+ for (i = 0; i < NLINES; i++)
+ if (strcmp(speech_in[i], speech[i])) ERR;
+ if (nc_get_att_uint(ncid, NC_GLOBAL, serious_name[1], &nlines_in)) ERR;
+ if (nlines_in != NLINES) ERR;
+ if (nc_free_string(NLINES, (char **)speech_in)) ERR;
+ if (nc_inq_varname(ncid, 0, name_in)) ERR;
+ if (strcmp(name_in, serious_name[3])) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing endianness...");
#define NDIMS4 1
#define DIM4_NAME "Joe"
#define VAR_NAME4 "Ed"
#define DIM4_LEN 10
- {
- int dimids[NDIMS4], dimids_in[NDIMS4];
- int varid, varid1;
- int ndims, nvars, natts, unlimdimid;
- nc_type xtype_in;
- char name_in[NC_MAX_NAME + 1];
- int data[DIM4_LEN], data_in[DIM4_LEN];
- int endian_in;
- int i;
-
- for (i = 0; i < DIM4_LEN; i++)
- data[i] = i;
-
- /* Create a netcdf-4 file with one dim and one var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM4_NAME, DIM4_LEN, &dimids[0])) ERR;
- if (dimids[0] != 0) ERR;
- if (nc_def_var(ncid, VAR_NAME4, NC_INT, NDIMS4, dimids, &varid)) ERR;
- if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG)) ERR;
- if (varid != 0) ERR;
- if (nc_put_var_int(ncid, varid, data)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS4 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
-
- /* Test some bad parameter values. */
- if (nc_inq_var(ncid + MILLION, 0, name_in, &xtype_in, &ndims,
- dimids_in, &natts) != NC_EBADID) ERR;
- if (nc_inq_var(ncid + TEST_VAL_42, 0, name_in, &xtype_in, &ndims,
- dimids_in, &natts) != NC_EBADID) ERR;
- if (nc_inq_var(ncid, -TEST_VAL_42, name_in, &xtype_in, &ndims,
- dimids_in, &natts) != NC_ENOTVAR) ERR;
- if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims,
- dimids_in, &natts) != NC_ENOTVAR) ERR;
- if (nc_inq_var(ncid, TEST_VAL_42, name_in, &xtype_in, &ndims,
- dimids_in, &natts) != NC_ENOTVAR) ERR;
-
- /* Now pass correct parameters. */
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims,
- dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME4) || xtype_in != NC_INT ||
- ndims != 1 || natts != 0 || dimids_in[0] != 0) ERR;
- if (nc_inq_var_endian(ncid, 0, &endian_in)) ERR;
- if (endian_in != NC_ENDIAN_BIG) ERR;
-
- /* This also works, uselessly. */
- if (nc_inq_var(ncid, 0, name_in, NULL, NULL, NULL, NULL)) ERR;
-
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check the same stuff. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* This won't work. */
- if (nc_def_var(ncid, "this_wont_work", NC_BYTE, NDIMS4, dimids,
- &varid1) != NC_EPERM) ERR;
-
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS4 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims,
- dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME4) || xtype_in != NC_INT ||
- ndims != 1 || natts != 0 || dimids_in[0] != 0) ERR;
- if (nc_inq_var_endian(ncid, 0, &endian_in)) ERR;
- if (endian_in != NC_ENDIAN_BIG) ERR;
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM4_LEN; i++)
- if (data[i] != data_in[i]) ERR;
-
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing chunking and the chunk cache...");
- {
+ {
+ int dimids[NDIMS4], dimids_in[NDIMS4];
+ int varid, varid1;
+ int ndims, nvars, natts, unlimdimid;
+ nc_type xtype_in;
+ char name_in[NC_MAX_NAME + 1];
+ int data[DIM4_LEN], data_in[DIM4_LEN];
+ int endian_in;
+ int i;
+
+ for (i = 0; i < DIM4_LEN; i++)
+ data[i] = i;
+
+ /* Create a netcdf-4 file with one dim and one var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM4_NAME, DIM4_LEN, &dimids[0])) ERR;
+ if (dimids[0] != 0) ERR;
+ if (nc_def_var(ncid, VAR_NAME4, NC_INT, NDIMS4, dimids, &varid)) ERR;
+ if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG)) ERR;
+ if (varid != 0) ERR;
+ if (nc_put_var_int(ncid, varid, data)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS4 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+
+ /* Test some bad parameter values. */
+ if (nc_inq_var(ncid + MILLION, 0, name_in, &xtype_in, &ndims,
+ dimids_in, &natts) != NC_EBADID) ERR;
+ if (nc_inq_var(ncid + TEST_VAL_42, 0, name_in, &xtype_in, &ndims,
+ dimids_in, &natts) != NC_EBADID) ERR;
+ if (nc_inq_var(ncid, -TEST_VAL_42, name_in, &xtype_in, &ndims,
+ dimids_in, &natts) != NC_ENOTVAR) ERR;
+ if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims,
+ dimids_in, &natts) != NC_ENOTVAR) ERR;
+ if (nc_inq_var(ncid, TEST_VAL_42, name_in, &xtype_in, &ndims,
+ dimids_in, &natts) != NC_ENOTVAR) ERR;
+
+ /* Now pass correct parameters. */
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims,
+ dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME4) || xtype_in != NC_INT ||
+ ndims != 1 || natts != 0 || dimids_in[0] != 0) ERR;
+ if (nc_inq_var_endian(ncid, 0, &endian_in)) ERR;
+ if (endian_in != NC_ENDIAN_BIG) ERR;
+
+ /* This also works, uselessly. */
+ if (nc_inq_var(ncid, 0, name_in, NULL, NULL, NULL, NULL)) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check the same stuff. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* This won't work. */
+ if (nc_def_var(ncid, "this_wont_work", NC_BYTE, NDIMS4, dimids,
+ &varid1) != NC_EPERM) ERR;
+
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS4 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims,
+ dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME4) || xtype_in != NC_INT ||
+ ndims != 1 || natts != 0 || dimids_in[0] != 0) ERR;
+ if (nc_inq_var_endian(ncid, 0, &endian_in)) ERR;
+ if (endian_in != NC_ENDIAN_BIG) ERR;
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM4_LEN; i++)
+ if (data[i] != data_in[i]) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing chunking and the chunk cache...");
+ {
#define NDIMS5 1
#define DIM5_NAME "D5"
#define VAR_NAME5 "V5"
@@ -782,543 +782,543 @@
#define CACHE_PREEMPTION2 .50
#define NVAR4 5
- int dimids[NDIMS5], dimids_in[NDIMS5];
- int varid, varid1, varid2, varid3, varid4;
- int varids_in4[NVAR4];
- int ndims, nvars, natts, unlimdimid;
- nc_type xtype_in;
- char name_in[NC_MAX_NAME + 1];
- int data[DIM5_LEN], data_in[DIM5_LEN];
- size_t chunksize[NDIMS5] = {5};
- size_t bad_chunksize[NDIMS5] = {-5}; /* Converted to large pos number since size_t is unsigned. */
- size_t large_chunksize[NDIMS5] = {(size_t)NC_MAX_INT + (size_t)1}; /* Too big for inq_var_chunking_ints(). */
- size_t chunksize_in[NDIMS5];
- int chunksize_int[NDIMS5];
- int chunksize_int_in[NDIMS5];
- int storage_in;
- size_t cache_size_in, cache_nelems_in;
- float cache_preemption_in;
- int cache_size_int_in, cache_nelems_int_in;
- int cache_preemption_int_in;
- int cache_size_int_default, cache_nelems_int_default;
- int cache_preemption_int_default;
- int i, d;
-
- for (i = 0; i < DIM5_LEN; i++)
- data[i] = i;
-
- /* Create a netcdf-4 file with one dim and one var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR;
- if (dimids[0] != 0) ERR;
-
- /* Define the variable. */
- if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR;
-
- /* These will fail due to bad parameters. */
- if (nc_def_var_chunking(ncid + MILLION, varid, NC_CHUNKED,
- chunksize) != NC_EBADID) ERR;
- if (nc_def_var_chunking(ncid + TEST_VAL_42, varid, NC_CHUNKED,
- chunksize) != NC_EBADID) ERR;
- if (nc_def_var_chunking(ncid, varid + TEST_VAL_42, NC_CHUNKED,
- chunksize) != NC_ENOTVAR) ERR;
- if (nc_def_var_chunking(ncid, varid + 1, NC_CHUNKED,
- chunksize) != NC_ENOTVAR) ERR;
- if (nc_def_var_chunking(ncid, -1, NC_CHUNKED,
- chunksize) != NC_ENOTVAR) ERR;
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, bad_chunksize) !=
- NC_EBADCHUNK) ERR;
-
- /* Define the chunking. */
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
-
- /* Try to set var cache with bad parameters. They will be
- * rejected. */
- if (nc_set_var_chunk_cache(ncid + MILLION, varid, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION) != NC_EBADID) ERR;
- if (nc_set_var_chunk_cache(ncid + 1, varid, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION) != NC_EBADID) ERR;
- if (nc_set_var_chunk_cache(ncid, varid + TEST_VAL_42, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION) != NC_ENOTVAR) ERR;
- if (nc_set_var_chunk_cache(ncid, -TEST_VAL_42, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION) != NC_ENOTVAR) ERR;
- if (nc_set_var_chunk_cache(ncid, varid + 1, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION) != NC_ENOTVAR) ERR;
- if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION + TEST_VAL_42) != NC_EINVAL) ERR;
- if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION - TEST_VAL_42) != NC_EINVAL) ERR;
-
- /* Set the cache. */
- if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS, CACHE_PREEMPTION)) ERR;
- if (nc_put_var_int(ncid, varid, data)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS5 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in4)) ERR;
- if (nvars != 1) ERR;
- if (varids_in4[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
- dimids_in[0] != 0) ERR;
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
- for (d = 0; d < NDIMS5; d++)
- if (chunksize[d] != chunksize_in[d]) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM5_LEN; i++)
- if (data[i] != data_in[i])
- ERR_RET;
-
- /* These will not work due to bad parameters. */
- if (nc_inq_var_chunking_ints(ncid + MILLION, 0, &storage_in,
- chunksize_int_in) != NC_EBADID) ERR;
- if (nc_inq_var_chunking_ints(ncid + TEST_VAL_42, 0, &storage_in,
- chunksize_int_in) != NC_EBADID) ERR;
- if (nc_inq_var_chunking_ints(ncid, -1, &storage_in,
- chunksize_int_in) != NC_ENOTVAR) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid + 1, &storage_in,
- chunksize_int_in) != NC_ENOTVAR) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid + TEST_VAL_42, &storage_in,
- chunksize_int_in) != NC_ENOTVAR) ERR;
-
- /* Now check with the fortran versions of the var_chunking. */
- if (nc_inq_var_chunking_ints(ncid, 0, &storage_in, chunksize_int_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- for (d = 0; d < NDIMS5; d++)
- if (chunksize_int_in[d] != chunksize[d]) ERR;
- for (d = 0; d < NDIMS5; d++)
- chunksize_int[d] = chunksize[d] * 2;
- if (nc_inq_var_chunking_ints(ncid, 0, &storage_in, NULL)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
-
- /* Check that some bad parameter values are rejected properly. */
- if (nc_def_var_chunking_ints(ncid + MILLION, varid, NC_CHUNKED,
- chunksize_int) != NC_EBADID) ERR;
- if (nc_def_var_chunking_ints(ncid + TEST_VAL_42, varid, NC_CHUNKED,
- chunksize_int) != NC_EBADID) ERR;
- if (nc_def_var_chunking_ints(ncid, -1, NC_CHUNKED,
- chunksize_int) != NC_ENOTVAR) ERR;
- if (nc_def_var_chunking_ints(ncid, varid + 1, NC_CHUNKED,
- chunksize_int) != NC_ENOTVAR) ERR;
- if (nc_def_var_chunking_ints(ncid, varid + TEST_VAL_42, NC_CHUNKED,
- chunksize_int) != NC_ENOTVAR) ERR;
-
- if (nc_def_var_chunking_ints(ncid, varid, NC_CHUNKED, chunksize_int) != NC_ELATEDEF) ERR;
- if (nc_redef(ncid)) ERR;
- if (nc_def_var(ncid, VAR_NAME5_1, NC_INT, NDIMS5, dimids, &varid1)) ERR;
- if (nc_def_var(ncid, VAR_NAME5_2, NC_INT, 0, NULL, &varid2)) ERR;
- if (nc_def_var(ncid, VAR_NAME5_3, NC_INT, 0, NULL, &varid3)) ERR;
- if (nc_def_var(ncid, VAR_NAME5_4, NC_INT, NDIMS5, dimids, &varid4)) ERR;
- if (nc_def_var_chunking(ncid, varid2, NC_CHUNKED, chunksize)) ERR;
- if (nc_def_var_chunking(ncid, varid3, NC_CONTIGUOUS, NULL)) ERR;
- if (nc_def_var_chunking(ncid, varid4, NC_CHUNKED, large_chunksize) != NC_EBADCHUNK) ERR;
- if (nc_def_var_chunking_ints(ncid, varid2, NC_CHUNKED, chunksize_int)) ERR;
- if (nc_def_var_chunking_ints(ncid, varid1, NC_CHUNKED, chunksize_int)) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid2, NULL, chunksize_int_in)) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid1, NULL, chunksize_int_in)) ERR;
- for (d = 0; d < NDIMS5; d++)
- if (chunksize_int_in[d] != chunksize[d] * 2) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid1, &storage_in, NULL)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid2, NULL, chunksize_int_in)) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid3, &storage_in, NULL)) ERR;
- if (storage_in != NC_CONTIGUOUS) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid3, &storage_in, chunksize_int_in)) ERR;
- if (storage_in != NC_CONTIGUOUS) ERR;
-
- /* Check that some bad parameter values are rejected properly. */
- if (nc_get_var_chunk_cache(ncid + MILLION, varid, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_EBADID) ERR;
- if (nc_get_var_chunk_cache(ncid + 1, -TEST_VAL_42, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_EBADID) ERR;
- if (nc_get_var_chunk_cache(ncid, varid + TEST_VAL_42, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_ENOTVAR) ERR;
- if (nc_get_var_chunk_cache(ncid, varid4 + 1, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_ENOTVAR) ERR;
- if (nc_get_var_chunk_cache(ncid, -TEST_VAL_42, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_ENOTVAR) ERR;
-
- /* Get the var chunk cache settings. */
- if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in)) ERR;
- if (cache_size_in != CACHE_SIZE || cache_nelems_in != CACHE_NELEMS ||
- cache_preemption_in != CACHE_PREEMPTION) ERR;
- /* THis should also work, pointlessly. */
- if (nc_get_var_chunk_cache(ncid, varid, NULL, NULL, NULL)) ERR;
-
- /* Check the _int version of this function, used by the F77 API. */
- if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in)) ERR;
- if (cache_size_int_in != CACHE_SIZE / MEGABYTE) ERR;
- if (cache_nelems_int_in != CACHE_NELEMS) ERR;
- if (cache_preemption_int_in != (int)(CACHE_PREEMPTION * 100)) ERR;
- /* THis should also work, pointlessly. */
- if (nc_get_var_chunk_cache_ints(ncid, varid, NULL, NULL, NULL)) ERR;
-
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check the same stuff. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS5 || nvars != NVAR4 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in4)) ERR;
- if (nvars != NVAR4) ERR;
- if (varids_in4[0] != 0 || varids_in4[1] != 1) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
- dimids_in[0] != 0) ERR;
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
- for (d = 0; d < NDIMS5; d++)
- if (chunksize[d] != chunksize_in[d]) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM5_LEN; i++)
- if (data[i] != data_in[i])
- ERR_RET;
-
- /* Use the _int function to change the var chunk cache settings. */
- if (nc_set_var_chunk_cache_ints(ncid, varid, CACHE_SIZE2 / MEGABYTE, CACHE_NELEMS2,
- (int)(CACHE_PREEMPTION2 * 100))) ERR;
-
- /* These will fail due to bad ncid and group ID. */
- if (nc_get_var_chunk_cache_ints(ncid + MILLION, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in) != NC_EBADID) ERR;
- if (nc_get_var_chunk_cache_ints(ncid + TEST_VAL_42, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in) != NC_EBADID) ERR;
-
- /* Now get the settings. */
- if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in)) ERR;
- if (cache_size_int_in != CACHE_SIZE2 / MEGABYTE || cache_nelems_int_in != CACHE_NELEMS2 ||
- cache_preemption_int_in != (int)(CACHE_PREEMPTION2 * 100)) ERR;
-
- /* Passing negative values to the _int function causes them to
- * be ignored and a default setting used. Set all to negative to
- * get defaults.. */
- if (nc_set_var_chunk_cache_ints(ncid, varid, -CACHE_SIZE / MEGABYTE, -CACHE_NELEMS2,
- -(int)(CACHE_PREEMPTION2 * 100))) ERR;
- if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_default, &cache_nelems_int_default,
- &cache_preemption_int_default)) ERR;
-
- /* Now set the size only. */
- if (nc_set_var_chunk_cache_ints(ncid, varid, CACHE_SIZE / MEGABYTE, -CACHE_NELEMS2,
- -(int)(CACHE_PREEMPTION2 * 100))) ERR;
- if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in)) ERR;
- if (cache_size_int_in != CACHE_SIZE / MEGABYTE || cache_nelems_int_in != cache_nelems_int_default ||
- cache_preemption_int_in != cache_preemption_int_default) ERR;
- /* Now set the nelems only. */
- if (nc_set_var_chunk_cache_ints(ncid, varid, -CACHE_SIZE / MEGABYTE, CACHE_NELEMS,
- -(int)(CACHE_PREEMPTION2 * 100))) ERR;
- if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in)) ERR;
- if (cache_size_int_in != cache_size_int_default || cache_nelems_int_in != CACHE_NELEMS ||
- cache_preemption_int_in != cache_preemption_int_default) ERR;
- /* Now set the preemption only. */
- if (nc_set_var_chunk_cache_ints(ncid, varid, -CACHE_SIZE / MEGABYTE, -CACHE_NELEMS,
- (int)(CACHE_PREEMPTION2 * 100))) ERR;
- if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
- &cache_preemption_int_in)) ERR;
- if (cache_size_int_in != cache_size_int_default || cache_nelems_int_in != cache_nelems_int_default ||
- cache_preemption_int_in != (int)(CACHE_PREEMPTION2 * 100)) ERR;
-
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing netCDF-4 functions on netCDF-3 files...");
- {
- int dimids[NDIMS5], dimids_in[NDIMS5];
- int varid;
- int ndims, nvars, natts, unlimdimid;
- nc_type xtype_in;
- char name_in[NC_MAX_NAME + 1];
- int data[DIM5_LEN], data_in[DIM5_LEN];
- size_t chunksize[NDIMS5] = {5};
- size_t chunksize_in[NDIMS5];
- int storage_in;
- size_t cache_size_in, cache_nelems_in;
- float cache_preemption_in;
- int i;
-
- for (i = 0; i < DIM5_LEN; i++)
- data[i] = i;
-
- /* Create a netcdf classic file with one dim and one var. */
- if (nc_create(FILE_NAME, 0, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR;
- if (dimids[0] != 0) ERR;
- if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR;
-
- /* These will return error. */
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize) != NC_ENOTNC4) ERR;
- if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS,
- CACHE_PREEMPTION) != NC_ENOTNC4) ERR;
-
- if (nc_enddef(ncid)) ERR;
- if (nc_put_var_int(ncid, varid, data)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS5 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
- dimids_in[0] != 0) ERR;
-
- /* This call fails. */
- if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_ENOTNC4) ERR;
-
- /* This call passes but does nothing. */
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
-
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM5_LEN; i++)
- if (data[i] != data_in[i])
- ERR_RET;
-
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check the same stuff. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS5 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
- dimids_in[0] != 0) ERR;
-
- /* This call fails. */
- if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in,
- &cache_preemption_in) != NC_ENOTNC4) ERR;
-
- /* This call passes but does nothing. */
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
-
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM5_LEN; i++)
- if (data[i] != data_in[i])
- ERR_RET;
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing contiguous storage...");
- {
+ int dimids[NDIMS5], dimids_in[NDIMS5];
+ int varid, varid1, varid2, varid3, varid4;
+ int varids_in4[NVAR4];
+ int ndims, nvars, natts, unlimdimid;
+ nc_type xtype_in;
+ char name_in[NC_MAX_NAME + 1];
+ int data[DIM5_LEN], data_in[DIM5_LEN];
+ size_t chunksize[NDIMS5] = {5};
+ size_t bad_chunksize[NDIMS5] = {-5}; /* Converted to large pos number since size_t is unsigned. */
+ size_t large_chunksize[NDIMS5] = {(size_t)NC_MAX_INT + (size_t)1}; /* Too big for inq_var_chunking_ints(). */
+ size_t chunksize_in[NDIMS5];
+ int chunksize_int[NDIMS5];
+ int chunksize_int_in[NDIMS5];
+ int storage_in;
+ size_t cache_size_in, cache_nelems_in;
+ float cache_preemption_in;
+ int cache_size_int_in, cache_nelems_int_in;
+ int cache_preemption_int_in;
+ int cache_size_int_default, cache_nelems_int_default;
+ int cache_preemption_int_default;
+ int i, d;
+
+ for (i = 0; i < DIM5_LEN; i++)
+ data[i] = i;
+
+ /* Create a netcdf-4 file with one dim and one var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR;
+ if (dimids[0] != 0) ERR;
+
+ /* Define the variable. */
+ if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR;
+
+ /* These will fail due to bad parameters. */
+ if (nc_def_var_chunking(ncid + MILLION, varid, NC_CHUNKED,
+ chunksize) != NC_EBADID) ERR;
+ if (nc_def_var_chunking(ncid + TEST_VAL_42, varid, NC_CHUNKED,
+ chunksize) != NC_EBADID) ERR;
+ if (nc_def_var_chunking(ncid, varid + TEST_VAL_42, NC_CHUNKED,
+ chunksize) != NC_ENOTVAR) ERR;
+ if (nc_def_var_chunking(ncid, varid + 1, NC_CHUNKED,
+ chunksize) != NC_ENOTVAR) ERR;
+ if (nc_def_var_chunking(ncid, -1, NC_CHUNKED,
+ chunksize) != NC_ENOTVAR) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, bad_chunksize) !=
+ NC_EBADCHUNK) ERR;
+
+ /* Define the chunking. */
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
+
+ /* Try to set var cache with bad parameters. They will be
+ * rejected. */
+ if (nc_set_var_chunk_cache(ncid + MILLION, varid, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION) != NC_EBADID) ERR;
+ if (nc_set_var_chunk_cache(ncid + 1, varid, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION) != NC_EBADID) ERR;
+ if (nc_set_var_chunk_cache(ncid, varid + TEST_VAL_42, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION) != NC_ENOTVAR) ERR;
+ if (nc_set_var_chunk_cache(ncid, -TEST_VAL_42, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION) != NC_ENOTVAR) ERR;
+ if (nc_set_var_chunk_cache(ncid, varid + 1, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION) != NC_ENOTVAR) ERR;
+ if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION + TEST_VAL_42) != NC_EINVAL) ERR;
+ if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION - TEST_VAL_42) != NC_EINVAL) ERR;
+
+ /* Set the cache. */
+ if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS, CACHE_PREEMPTION)) ERR;
+ if (nc_put_var_int(ncid, varid, data)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS5 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in4)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in4[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
+ dimids_in[0] != 0) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+ for (d = 0; d < NDIMS5; d++)
+ if (chunksize[d] != chunksize_in[d]) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM5_LEN; i++)
+ if (data[i] != data_in[i])
+ ERR_RET;
+
+ /* These will not work due to bad parameters. */
+ if (nc_inq_var_chunking_ints(ncid + MILLION, 0, &storage_in,
+ chunksize_int_in) != NC_EBADID) ERR;
+ if (nc_inq_var_chunking_ints(ncid + TEST_VAL_42, 0, &storage_in,
+ chunksize_int_in) != NC_EBADID) ERR;
+ if (nc_inq_var_chunking_ints(ncid, -1, &storage_in,
+ chunksize_int_in) != NC_ENOTVAR) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid + 1, &storage_in,
+ chunksize_int_in) != NC_ENOTVAR) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid + TEST_VAL_42, &storage_in,
+ chunksize_int_in) != NC_ENOTVAR) ERR;
+
+ /* Now check with the fortran versions of the var_chunking. */
+ if (nc_inq_var_chunking_ints(ncid, 0, &storage_in, chunksize_int_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ for (d = 0; d < NDIMS5; d++)
+ if (chunksize_int_in[d] != chunksize[d]) ERR;
+ for (d = 0; d < NDIMS5; d++)
+ chunksize_int[d] = chunksize[d] * 2;
+ if (nc_inq_var_chunking_ints(ncid, 0, &storage_in, NULL)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+
+ /* Check that some bad parameter values are rejected properly. */
+ if (nc_def_var_chunking_ints(ncid + MILLION, varid, NC_CHUNKED,
+ chunksize_int) != NC_EBADID) ERR;
+ if (nc_def_var_chunking_ints(ncid + TEST_VAL_42, varid, NC_CHUNKED,
+ chunksize_int) != NC_EBADID) ERR;
+ if (nc_def_var_chunking_ints(ncid, -1, NC_CHUNKED,
+ chunksize_int) != NC_ENOTVAR) ERR;
+ if (nc_def_var_chunking_ints(ncid, varid + 1, NC_CHUNKED,
+ chunksize_int) != NC_ENOTVAR) ERR;
+ if (nc_def_var_chunking_ints(ncid, varid + TEST_VAL_42, NC_CHUNKED,
+ chunksize_int) != NC_ENOTVAR) ERR;
+
+ if (nc_def_var_chunking_ints(ncid, varid, NC_CHUNKED, chunksize_int) != NC_ELATEDEF) ERR;
+ if (nc_redef(ncid)) ERR;
+ if (nc_def_var(ncid, VAR_NAME5_1, NC_INT, NDIMS5, dimids, &varid1)) ERR;
+ if (nc_def_var(ncid, VAR_NAME5_2, NC_INT, 0, NULL, &varid2)) ERR;
+ if (nc_def_var(ncid, VAR_NAME5_3, NC_INT, 0, NULL, &varid3)) ERR;
+ if (nc_def_var(ncid, VAR_NAME5_4, NC_INT, NDIMS5, dimids, &varid4)) ERR;
+ if (nc_def_var_chunking(ncid, varid2, NC_CHUNKED, chunksize) != NC_EINVAL) ERR;
+ if (nc_def_var_chunking(ncid, varid3, NC_CONTIGUOUS, NULL)) ERR;
+ if (nc_def_var_chunking(ncid, varid4, NC_CHUNKED, large_chunksize) != NC_EBADCHUNK) ERR;
+ if (nc_def_var_chunking_ints(ncid, varid2, NC_CHUNKED, chunksize_int) != NC_EINVAL) ERR;
+ if (nc_def_var_chunking_ints(ncid, varid1, NC_CHUNKED, chunksize_int)) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid2, &storage_in, NULL)) ERR;
+ if (storage_in != NC_CONTIGUOUS) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid1, NULL, chunksize_int_in)) ERR;
+ for (d = 0; d < NDIMS5; d++)
+ if (chunksize_int_in[d] != chunksize[d] * 2) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid1, &storage_in, NULL)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid3, &storage_in, NULL)) ERR;
+ if (storage_in != NC_CONTIGUOUS) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid3, &storage_in, chunksize_int_in)) ERR;
+ if (storage_in != NC_CONTIGUOUS) ERR;
+
+ /* Check that some bad parameter values are rejected properly. */
+ if (nc_get_var_chunk_cache(ncid + MILLION, varid, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_EBADID) ERR;
+ if (nc_get_var_chunk_cache(ncid + 1, -TEST_VAL_42, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_EBADID) ERR;
+ if (nc_get_var_chunk_cache(ncid, varid + TEST_VAL_42, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_ENOTVAR) ERR;
+ if (nc_get_var_chunk_cache(ncid, varid4 + 1, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_ENOTVAR) ERR;
+ if (nc_get_var_chunk_cache(ncid, -TEST_VAL_42, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_ENOTVAR) ERR;
+
+ /* Get the var chunk cache settings. */
+ if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in)) ERR;
+ if (cache_size_in != CACHE_SIZE || cache_nelems_in != CACHE_NELEMS ||
+ cache_preemption_in != CACHE_PREEMPTION) ERR;
+ /* THis should also work, pointlessly. */
+ if (nc_get_var_chunk_cache(ncid, varid, NULL, NULL, NULL)) ERR;
+
+ /* Check the _int version of this function, used by the F77 API. */
+ if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in)) ERR;
+ if (cache_size_int_in != CACHE_SIZE / MEGABYTE) ERR;
+ if (cache_nelems_int_in != CACHE_NELEMS) ERR;
+ if (cache_preemption_int_in != (int)(CACHE_PREEMPTION * 100)) ERR;
+ /* THis should also work, pointlessly. */
+ if (nc_get_var_chunk_cache_ints(ncid, varid, NULL, NULL, NULL)) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check the same stuff. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS5 || nvars != NVAR4 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in4)) ERR;
+ if (nvars != NVAR4) ERR;
+ if (varids_in4[0] != 0 || varids_in4[1] != 1) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
+ dimids_in[0] != 0) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+ for (d = 0; d < NDIMS5; d++)
+ if (chunksize[d] != chunksize_in[d]) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM5_LEN; i++)
+ if (data[i] != data_in[i])
+ ERR_RET;
+
+ /* Use the _int function to change the var chunk cache settings. */
+ if (nc_set_var_chunk_cache_ints(ncid, varid, CACHE_SIZE2 / MEGABYTE, CACHE_NELEMS2,
+ (int)(CACHE_PREEMPTION2 * 100))) ERR;
+
+ /* These will fail due to bad ncid and group ID. */
+ if (nc_get_var_chunk_cache_ints(ncid + MILLION, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in) != NC_EBADID) ERR;
+ if (nc_get_var_chunk_cache_ints(ncid + TEST_VAL_42, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in) != NC_EBADID) ERR;
+
+ /* Now get the settings. */
+ if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in)) ERR;
+ if (cache_size_int_in != CACHE_SIZE2 / MEGABYTE || cache_nelems_int_in != CACHE_NELEMS2 ||
+ cache_preemption_int_in != (int)(CACHE_PREEMPTION2 * 100)) ERR;
+
+ /* Passing negative values to the _int function causes them to
+ * be ignored and a default setting used. Set all to negative to
+ * get defaults.. */
+ if (nc_set_var_chunk_cache_ints(ncid, varid, -CACHE_SIZE / MEGABYTE, -CACHE_NELEMS2,
+ -(int)(CACHE_PREEMPTION2 * 100))) ERR;
+ if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_default, &cache_nelems_int_default,
+ &cache_preemption_int_default)) ERR;
+
+ /* Now set the size only. */
+ if (nc_set_var_chunk_cache_ints(ncid, varid, CACHE_SIZE / MEGABYTE, -CACHE_NELEMS2,
+ -(int)(CACHE_PREEMPTION2 * 100))) ERR;
+ if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in)) ERR;
+ if (cache_size_int_in != CACHE_SIZE / MEGABYTE || cache_nelems_int_in != cache_nelems_int_default ||
+ cache_preemption_int_in != cache_preemption_int_default) ERR;
+ /* Now set the nelems only. */
+ if (nc_set_var_chunk_cache_ints(ncid, varid, -CACHE_SIZE / MEGABYTE, CACHE_NELEMS,
+ -(int)(CACHE_PREEMPTION2 * 100))) ERR;
+ if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in)) ERR;
+ if (cache_size_int_in != cache_size_int_default || cache_nelems_int_in != CACHE_NELEMS ||
+ cache_preemption_int_in != cache_preemption_int_default) ERR;
+ /* Now set the preemption only. */
+ if (nc_set_var_chunk_cache_ints(ncid, varid, -CACHE_SIZE / MEGABYTE, -CACHE_NELEMS,
+ (int)(CACHE_PREEMPTION2 * 100))) ERR;
+ if (nc_get_var_chunk_cache_ints(ncid, varid, &cache_size_int_in, &cache_nelems_int_in,
+ &cache_preemption_int_in)) ERR;
+ if (cache_size_int_in != cache_size_int_default || cache_nelems_int_in != cache_nelems_int_default ||
+ cache_preemption_int_in != (int)(CACHE_PREEMPTION2 * 100)) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing netCDF-4 functions on netCDF-3 files...");
+ {
+ int dimids[NDIMS5], dimids_in[NDIMS5];
+ int varid;
+ int ndims, nvars, natts, unlimdimid;
+ nc_type xtype_in;
+ char name_in[NC_MAX_NAME + 1];
+ int data[DIM5_LEN], data_in[DIM5_LEN];
+ size_t chunksize[NDIMS5] = {5};
+ size_t chunksize_in[NDIMS5];
+ int storage_in;
+ size_t cache_size_in, cache_nelems_in;
+ float cache_preemption_in;
+ int i;
+
+ for (i = 0; i < DIM5_LEN; i++)
+ data[i] = i;
+
+ /* Create a netcdf classic file with one dim and one var. */
+ if (nc_create(FILE_NAME, 0, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM5_NAME, DIM5_LEN, &dimids[0])) ERR;
+ if (dimids[0] != 0) ERR;
+ if (nc_def_var(ncid, VAR_NAME5, NC_INT, NDIMS5, dimids, &varid)) ERR;
+
+ /* These will return error. */
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize) != NC_ENOTNC4) ERR;
+ if (nc_set_var_chunk_cache(ncid, varid, CACHE_SIZE, CACHE_NELEMS,
+ CACHE_PREEMPTION) != NC_ENOTNC4) ERR;
+
+ if (nc_enddef(ncid)) ERR;
+ if (nc_put_var_int(ncid, varid, data)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS5 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
+ dimids_in[0] != 0) ERR;
+
+ /* This call fails. */
+ if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_ENOTNC4) ERR;
+
+ /* This call passes but does nothing. */
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM5_LEN; i++)
+ if (data[i] != data_in[i])
+ ERR_RET;
+
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check the same stuff. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS5 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
+ dimids_in[0] != 0) ERR;
+
+ /* This call fails. */
+ if (nc_get_var_chunk_cache(ncid, varid, &cache_size_in, &cache_nelems_in,
+ &cache_preemption_in) != NC_ENOTNC4) ERR;
+
+ /* This call passes but does nothing. */
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM5_LEN; i++)
+ if (data[i] != data_in[i])
+ ERR_RET;
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing contiguous storage...");
+ {
#define DIM6_NAME "D5"
#define VAR_NAME6 "V5"
#define DIM6_LEN 100
- int dimids[NDIMS1], dimids_in[NDIMS1];
- int varid;
- int ndims, nvars, natts, unlimdimid;
- nc_type xtype_in;
- char name_in[NC_MAX_NAME + 1];
- int data[DIM6_LEN], data_in[DIM6_LEN];
- size_t chunksize_in[NDIMS1];
- int storage_in;
- int i;
-
- for (i = 0; i < DIM6_LEN; i++)
- data[i] = i;
-
- /* Create a netcdf-4 file with one dim and one var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM6_NAME, DIM6_LEN, &dimids[0])) ERR;
- if (dimids[0] != 0) ERR;
- if (nc_def_var(ncid, VAR_NAME6, NC_INT, NDIMS1, dimids, &varid)) ERR;
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
- if (nc_put_var_int(ncid, varid, data)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS1 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME6) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
- dimids_in[0] != 0) ERR;
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CONTIGUOUS) ERR;
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM6_LEN; i++)
- if (data_in[i] != data[i])
- ERR_RET;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check the same stuff. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS1 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME6) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
- dimids_in[0] != 0) ERR;
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CONTIGUOUS) ERR;
- if (nc_get_var_int(ncid, varid, data_in)) ERR;
- for (i = 0; i < DIM6_LEN; i++)
- if (data[i] != data_in[i])
- ERR_RET;
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing extreme numbers dude...");
- {
+ int dimids[NDIMS1], dimids_in[NDIMS1];
+ int varid;
+ int ndims, nvars, natts, unlimdimid;
+ nc_type xtype_in;
+ char name_in[NC_MAX_NAME + 1];
+ int data[DIM6_LEN], data_in[DIM6_LEN];
+ size_t chunksize_in[NDIMS1];
+ int storage_in;
+ int i;
+
+ for (i = 0; i < DIM6_LEN; i++)
+ data[i] = i;
+
+ /* Create a netcdf-4 file with one dim and one var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM6_NAME, DIM6_LEN, &dimids[0])) ERR;
+ if (dimids[0] != 0) ERR;
+ if (nc_def_var(ncid, VAR_NAME6, NC_INT, NDIMS1, dimids, &varid)) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
+ if (nc_put_var_int(ncid, varid, data)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS1 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME6) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
+ dimids_in[0] != 0) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CONTIGUOUS) ERR;
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM6_LEN; i++)
+ if (data_in[i] != data[i])
+ ERR_RET;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check the same stuff. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS1 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME6) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
+ dimids_in[0] != 0) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CONTIGUOUS) ERR;
+ if (nc_get_var_int(ncid, varid, data_in)) ERR;
+ for (i = 0; i < DIM6_LEN; i++)
+ if (data[i] != data_in[i])
+ ERR_RET;
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing extreme numbers dude...");
+ {
#define VAR_NAME7 "V5"
#define DIM6_LEN 100
- int varid;
- int ndims, nvars, natts, unlimdimid;
- nc_type xtype_in;
- char name_in[NC_MAX_NAME + 1];
+ int varid;
+ int ndims, nvars, natts, unlimdimid;
+ nc_type xtype_in;
+ char name_in[NC_MAX_NAME + 1];
/* unsigned long long data = 9223372036854775807ull, data_in;*/
- unsigned long long data = 9223372036854775817ull, data_in;
+ unsigned long long data = 9223372036854775817ull, data_in;
- /* Create a netcdf-4 file with scalar var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_var(ncid, VAR_NAME7, NC_UINT64, 0, NULL, &varid)) ERR;
- if (nc_put_var_ulonglong(ncid, varid, &data)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != 0 || nvars != 1 || natts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1 || varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, NULL, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME7) || xtype_in != NC_UINT64 || ndims != 0 || natts != 0) ERR;
- if (nc_get_var_ulonglong(ncid, varid, &data_in)) ERR;
- if (data_in != data) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check the same stuff. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != 0 || nvars != 1 || natts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1 || varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, NULL, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME7) || xtype_in != NC_UINT64 || ndims != 0 || natts != 0) ERR;
- if (nc_get_var_ulonglong(ncid, varid, &data_in)) ERR;
- if (data_in != data) ERR;
- if (nc_close(ncid)) ERR;
- }
-
- SUMMARIZE_ERR;
- printf("**** testing error codes for name clashes...");
- {
+ /* Create a netcdf-4 file with scalar var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_var(ncid, VAR_NAME7, NC_UINT64, 0, NULL, &varid)) ERR;
+ if (nc_put_var_ulonglong(ncid, varid, &data)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != 0 || nvars != 1 || natts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1 || varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, NULL, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME7) || xtype_in != NC_UINT64 || ndims != 0 || natts != 0) ERR;
+ if (nc_get_var_ulonglong(ncid, varid, &data_in)) ERR;
+ if (data_in != data) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check the same stuff. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != 0 || nvars != 1 || natts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1 || varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, NULL, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME7) || xtype_in != NC_UINT64 || ndims != 0 || natts != 0) ERR;
+ if (nc_get_var_ulonglong(ncid, varid, &data_in)) ERR;
+ if (data_in != data) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+
+ SUMMARIZE_ERR;
+ printf("**** testing error codes for name clashes...");
+ {
#define GENERIC_NAME "bob"
- int ncid, varid, numgrps, ntypes;
+ int ncid, varid, numgrps, ntypes;
- /* Create a netcdf-4 file with one var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_var(ncid, GENERIC_NAME, NC_BYTE, 0, NULL, &varid)) ERR;
-
- /* These don'e work, because the name is already in use. Make
- * sure the correct error is returned. */
- if (nc_def_grp(ncid, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
- if (nc_def_opaque(ncid, 1, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
-
- /* Close it. */
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
- if (nvars_in != 1 || varids_in[0] != 0) ERR;
- if (nc_inq_varname(ncid, 0, name_in)) ERR;
- if (strcmp(name_in, GENERIC_NAME)) ERR;
- if (nc_inq_grps(ncid, &numgrps, NULL)) ERR;
- if (numgrps) ERR;
- if (nc_inq_typeids(ncid, &ntypes, NULL)) ERR;
- if (ntypes) ERR;
- if (nc_close(ncid)) ERR;
- }
+ /* Create a netcdf-4 file with one var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_var(ncid, GENERIC_NAME, NC_BYTE, 0, NULL, &varid)) ERR;
+
+ /* These don'e work, because the name is already in use. Make
+ * sure the correct error is returned. */
+ if (nc_def_grp(ncid, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
+ if (nc_def_opaque(ncid, 1, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
+
+ /* Close it. */
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
+ if (nvars_in != 1 || varids_in[0] != 0) ERR;
+ if (nc_inq_varname(ncid, 0, name_in)) ERR;
+ if (strcmp(name_in, GENERIC_NAME)) ERR;
+ if (nc_inq_grps(ncid, &numgrps, NULL)) ERR;
+ if (numgrps) ERR;
+ if (nc_inq_typeids(ncid, &ntypes, NULL)) ERR;
+ if (ntypes) ERR;
+ if (nc_close(ncid)) ERR;
+ }
- SUMMARIZE_ERR;
- printf("**** testing error codes for name clashes some more...");
+ SUMMARIZE_ERR;
+ printf("**** testing error codes for name clashes some more...");
- {
+ {
#define GENERIC_NAME "bob"
- int ncid, varid, numgrps, ntypes;
+ int ncid, varid, numgrps, ntypes;
- /* Create a netcdf-4 file with one type. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_opaque(ncid, 1, GENERIC_NAME, NULL)) ERR;
-
- /* These don'e work, because the name is already in use. Make
- * sure the correct error is returned. */
- if (nc_def_grp(ncid, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
- if (nc_def_var(ncid, GENERIC_NAME, NC_BYTE, 0, NULL, &varid) != NC_ENAMEINUSE) ERR;
-
- /* Close it. */
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
- if (nvars_in) ERR;
- if (nc_inq_grps(ncid, &numgrps, NULL)) ERR;
- if (numgrps) ERR;
- if (nc_inq_typeids(ncid, &ntypes, NULL)) ERR;
- if (ntypes != 1) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing error codes for name clashes even more...");
+ /* Create a netcdf-4 file with one type. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_opaque(ncid, 1, GENERIC_NAME, NULL)) ERR;
+
+ /* These don'e work, because the name is already in use. Make
+ * sure the correct error is returned. */
+ if (nc_def_grp(ncid, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
+ if (nc_def_var(ncid, GENERIC_NAME, NC_BYTE, 0, NULL, &varid) != NC_ENAMEINUSE) ERR;
+
+ /* Close it. */
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
+ if (nvars_in) ERR;
+ if (nc_inq_grps(ncid, &numgrps, NULL)) ERR;
+ if (numgrps) ERR;
+ if (nc_inq_typeids(ncid, &ntypes, NULL)) ERR;
+ if (ntypes != 1) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing error codes for name clashes even more...");
- {
+ {
#define GENERIC_NAME "bob"
- int ncid, varid, numgrps, ntypes;
+ int ncid, varid, numgrps, ntypes;
- /* Create a netcdf-4 file with one group. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_grp(ncid, GENERIC_NAME, NULL)) ERR;
-
- /* These don'e work, because the name is already in use. Make
- * sure the correct error is returned. */
- if (nc_def_opaque(ncid, 1, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
- if (nc_def_var(ncid, GENERIC_NAME, NC_BYTE, 0, NULL, &varid) != NC_ENAMEINUSE) ERR;
-
- /* Close it. */
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
- if (nvars_in) ERR;
- if (nc_inq_grps(ncid, &numgrps, NULL)) ERR;
- if (numgrps != 1) ERR;
- if (nc_inq_typeids(ncid, &ntypes, NULL)) ERR;
- if (ntypes) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing error code for too-large chunks...");
- {
+ /* Create a netcdf-4 file with one group. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_grp(ncid, GENERIC_NAME, NULL)) ERR;
+
+ /* These don'e work, because the name is already in use. Make
+ * sure the correct error is returned. */
+ if (nc_def_opaque(ncid, 1, GENERIC_NAME, NULL) != NC_ENAMEINUSE) ERR;
+ if (nc_def_var(ncid, GENERIC_NAME, NC_BYTE, 0, NULL, &varid) != NC_ENAMEINUSE) ERR;
+
+ /* Close it. */
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
+ if (nvars_in) ERR;
+ if (nc_inq_grps(ncid, &numgrps, NULL)) ERR;
+ if (numgrps != 1) ERR;
+ if (nc_inq_typeids(ncid, &ntypes, NULL)) ERR;
+ if (ntypes) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing error code for too-large chunks...");
+ {
#define NDIMS17 2
#define DIM17_NAME "personality"
#define DIM17_NAME_2 "good_looks"
@@ -1326,257 +1326,283 @@
#define DIM17_LEN 2147483644 /* max dimension size - 2GB - 4. */
#define DIM17_2_LEN 1000
- int dimids[NDIMS17], dimids_in[NDIMS17];
- int varid;
- int ndims, nvars, natts, unlimdimid;
- nc_type xtype_in;
- char name_in[NC_MAX_NAME + 1];
- size_t chunksize[NDIMS17] = {5, 5};
- size_t bad_chunksize[NDIMS17] = {5, DIM17_LEN};
- size_t chunksize_in[NDIMS17];
- int storage_in;
- int d;
-
- /* Create a netcdf-4 file with two dims and one var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM17_NAME, DIM17_LEN, &dimids[0])) ERR;
- if (nc_def_dim(ncid, DIM17_NAME_2, DIM17_2_LEN, &dimids[1])) ERR;
- if (dimids[0] != 0 || dimids[1] != 1) ERR;
- if (nc_def_var(ncid, VAR_NAME17, NC_UINT64, NDIMS17, dimids, &varid)) ERR;
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, bad_chunksize) != NC_EBADCHUNK) ERR;
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS17 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME17) || xtype_in != NC_UINT64 || ndims != 2 || natts != 0 ||
- dimids_in[0] != 0 || dimids_in[1] != 1) ERR;
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
- for (d = 0; d < NDIMS17; d++)
- if (chunksize[d] != chunksize_in[d]) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check the same stuff. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- /* Check stuff. */
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != NDIMS17 || nvars != 1 || natts != 0 ||
- unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
- if (nvars != 1) ERR;
- if (varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME17) || xtype_in != NC_UINT64 || ndims != 2 || natts != 0 ||
- dimids_in[0] != 0 || dimids_in[1] != 1) ERR;
- if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
- for (d = 0; d < NDIMS17; d++)
- if (chunksize[d] != chunksize_in[d]) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+ int dimids[NDIMS17], dimids_in[NDIMS17];
+ int varid;
+ int ndims, nvars, natts, unlimdimid;
+ nc_type xtype_in;
+ char name_in[NC_MAX_NAME + 1];
+ size_t chunksize[NDIMS17] = {5, 5};
+ size_t bad_chunksize[NDIMS17] = {5, DIM17_LEN};
+ size_t chunksize_in[NDIMS17];
+ int storage_in;
+ int d;
+
+ /* Create a netcdf-4 file with two dims and one var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM17_NAME, DIM17_LEN, &dimids[0])) ERR;
+ if (nc_def_dim(ncid, DIM17_NAME_2, DIM17_2_LEN, &dimids[1])) ERR;
+ if (dimids[0] != 0 || dimids[1] != 1) ERR;
+ if (nc_def_var(ncid, VAR_NAME17, NC_UINT64, NDIMS17, dimids, &varid)) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, bad_chunksize) != NC_EBADCHUNK) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS17 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME17) || xtype_in != NC_UINT64 || ndims != 2 || natts != 0 ||
+ dimids_in[0] != 0 || dimids_in[1] != 1) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+ for (d = 0; d < NDIMS17; d++)
+ if (chunksize[d] != chunksize_in[d]) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check the same stuff. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ /* Check stuff. */
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != NDIMS17 || nvars != 1 || natts != 0 ||
+ unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
+ if (nvars != 1) ERR;
+ if (varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME17) || xtype_in != NC_UINT64 || ndims != 2 || natts != 0 ||
+ dimids_in[0] != 0 || dimids_in[1] != 1) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, chunksize_in)) ERR;
+ for (d = 0; d < NDIMS17; d++)
+ if (chunksize[d] != chunksize_in[d]) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
#define DIM8_NAME "num_monkeys"
#define DIM9_NAME "num_coconuts"
#define DIM9_LEN 10
#define VAR_NAME8 "John_Clayton"
#define VAR_NAME9 "Lord_Greystoke"
#define VAR_NAME10 "Jane_Porter"
- printf("**** testing that contiguous storage can't be turned on for vars with unlimited dims or filters...");
- {
- int ncid;
- int dimids[NDIMS1];
- int varid, varid2;
- size_t chunksize_in[NDIMS1];
- int storage_in;
-
- /* Create a netcdf-4 file with one dim and some vars. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM8_NAME, NC_UNLIMITED, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, dimids, &varid)) ERR;
- if (nc_def_dim(ncid, DIM9_NAME, DIM9_LEN, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME9, NC_INT, NDIMS1, dimids, &varid2)) ERR;
-
- /* These will fail due to bad parameters. */
- if (nc_def_var_deflate(ncid, varid2, 0, 1,
- NC_MIN_DEFLATE_LEVEL - 1) != NC_EINVAL) ERR;
- if (nc_def_var_deflate(ncid, varid2, 0, 1,
- NC_MAX_DEFLATE_LEVEL + 1) != NC_EINVAL) ERR;
-
- /* This will work. */
- if (nc_def_var_deflate(ncid, varid2, 0, 1, 4)) ERR;
-
- /* This won't work because of the umlimited dimension. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* This won't work because of the deflate filter. */
- if (nc_def_var_chunking(ncid, varid2, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* Storage must be chunked because of unlimited dimension and
- * the deflate filter. */
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_inq_var_chunking(ncid, varid2, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_close(ncid)) ERR;
-
- }
- SUMMARIZE_ERR;
- printf("**** testing error conditions on nc_def_var functions...");
- {
- int ncid;
- int dimids[NDIMS1];
- int bad_dimids[NDIMS1] = {42};
- int varid;
- int varid_scalar;
- int num_models = 2;
- int m;
- int mode = NC_NETCDF4;
-
- /* Test without and with classic model. */
- for (m = 0; m < num_models; m++)
- {
- int contiguous_in;
- size_t chunksizes_in[NDIMS1];
- int shuffle_in, deflate_in, deflate_level_in;
-
- if (m)
- mode |= NC_CLASSIC_MODEL;
-
- /* Create a netcdf-4 file. */
- if (nc_create(FILE_NAME, mode, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM8_NAME, TEST_VAL_42, &dimids[0])) ERR;
-
- /* This won't work. */
- if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, bad_dimids,
- &varid) != NC_EBADDIM) ERR;
-
- /* This will work. */
- if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, dimids, &varid)) ERR;
- if (nc_def_var(ncid, VAR_NAME10, NC_INT, 0, NULL, &varid_scalar)) ERR;
-
- /* Set the var to contiguous. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
-
- /* Now defalte will change the var to chunked. */
- if (nc_def_var_deflate(ncid, varid, 0, 1, 4)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &contiguous_in, chunksizes_in)) ERR;
- if (contiguous_in) ERR;
-
- /* Now I can't turn contiguous on, because deflate is on. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* Turn off deflation. */
- if (nc_def_var_deflate(ncid, varid, 0, 0, 0)) ERR;
- if (nc_inq_var_deflate(ncid, varid, &shuffle_in, &deflate_in, &deflate_level_in)) ERR;
- if (shuffle_in || deflate_in) ERR;
- if (nc_inq_var_deflate(ncid, varid, NULL, NULL, NULL)) ERR;
-
- /* Deflate is ignored for scalar. */
- if (nc_def_var_deflate(ncid, varid_scalar, 0, 1, 4)) ERR;
- if (nc_inq_var_deflate(ncid, varid, &shuffle_in, &deflate_in, &deflate_level_in)) ERR;
- if (shuffle_in || deflate_in) ERR;
-
- /* Turn on shuffle. */
- if (nc_def_var_deflate(ncid, varid, 1, 0, 0)) ERR;
-
- /* Now I can't turn contiguous on, because shuffle is on. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* Turn off shuffle. */
- if (nc_def_var_deflate(ncid, varid, 0, 0, 0)) ERR;
-
- /* Turn on fletcher32. */
- if (nc_def_var_fletcher32(ncid, varid, 1)) ERR;
-
- /* Now I can't turn contiguous on, because fletcher32 is on. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* Turn off fletcher32. */
- if (nc_def_var_fletcher32(ncid, varid, 0)) ERR;
-
- /* Now I can make it contiguous again. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
- if (nc_close(ncid)) ERR;
- }
- }
- SUMMARIZE_ERR;
+ printf("**** testing that contiguous storage can't be turned on for vars with unlimited dims or filters...");
+ {
+ int ncid;
+ int dimids[NDIMS1];
+ int varid, varid2;
+ size_t chunksize_in[NDIMS1];
+ int storage_in;
+
+ /* Create a netcdf-4 file with one dim and some vars. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM8_NAME, NC_UNLIMITED, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, dimids, &varid)) ERR;
+ if (nc_def_dim(ncid, DIM9_NAME, DIM9_LEN, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME9, NC_INT, NDIMS1, dimids, &varid2)) ERR;
+
+ /* These will fail due to bad parameters. */
+ if (nc_def_var_deflate(ncid, varid2, 0, 1,
+ NC_MIN_DEFLATE_LEVEL - 1) != NC_EINVAL) ERR;
+ if (nc_def_var_deflate(ncid, varid2, 0, 1,
+ NC_MAX_DEFLATE_LEVEL + 1) != NC_EINVAL) ERR;
+
+ /* This will work. */
+ if (nc_def_var_deflate(ncid, varid2, 0, 1, 4)) ERR;
+
+ /* This won't work because of the umlimited dimension. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* This won't work because of the deflate filter. */
+ if (nc_def_var_chunking(ncid, varid2, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* Storage must be chunked because of unlimited dimension and
+ * the deflate filter. */
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_inq_var_chunking(ncid, varid2, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_close(ncid)) ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing error conditions on nc_def_var functions...");
+ {
+ int ncid;
+ int dimids[NDIMS1];
+ int bad_dimids[NDIMS1] = {42};
+ int varid;
+ int varid_scalar;
+ int num_models = 2;
+ int m;
+ int mode = NC_NETCDF4;
+
+ /* Test without and with classic model. */
+ for (m = 0; m < num_models; m++)
+ {
+ int contiguous_in;
+ size_t chunksizes_in[NDIMS1];
+ int shuffle_in, deflate_in, deflate_level_in;
+
+ if (m)
+ mode |= NC_CLASSIC_MODEL;
+
+ /* Create a netcdf-4 file. */
+ if (nc_create(FILE_NAME, mode, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM8_NAME, TEST_VAL_42, &dimids[0])) ERR;
+
+ /* This won't work. */
+ if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, bad_dimids,
+ &varid) != NC_EBADDIM) ERR;
+
+ /* This will work. */
+ if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, dimids, &varid)) ERR;
+ if (nc_def_var(ncid, VAR_NAME10, NC_INT, 0, NULL, &varid_scalar)) ERR;
+
+ /* Set the var to contiguous. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
+
+ /* Now defalte will change the var to chunked. */
+ if (nc_def_var_deflate(ncid, varid, 0, 1, 4)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &contiguous_in, chunksizes_in)) ERR;
+ if (contiguous_in) ERR;
+
+ /* Now I can't turn contiguous on, because deflate is on. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* Turn off deflation. */
+ if (nc_def_var_deflate(ncid, varid, 0, 0, 0)) ERR;
+ if (nc_inq_var_deflate(ncid, varid, &shuffle_in, &deflate_in, &deflate_level_in)) ERR;
+ if (shuffle_in || deflate_in) ERR;
+ if (nc_inq_var_deflate(ncid, varid, NULL, NULL, NULL)) ERR;
+
+ /* Deflate fails for scalar. */
+ if (nc_def_var_deflate(ncid, varid_scalar, 0, 1, 4) != NC_EINVAL) ERR;
+ if (nc_inq_var_deflate(ncid, varid, &shuffle_in, &deflate_in, &deflate_level_in)) ERR;
+ if (shuffle_in || deflate_in) ERR;
+
+ /* Turn on shuffle. */
+ if (nc_def_var_deflate(ncid, varid, 1, 0, 0)) ERR;
+
+ /* Now I can't turn contiguous on, because shuffle is on. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* Turn off shuffle. */
+ if (nc_def_var_deflate(ncid, varid, 0, 0, 0)) ERR;
+
+ /* Turn on fletcher32. */
+ if (nc_def_var_fletcher32(ncid, varid, 1)) ERR;
+
+ /* Now I can't turn contiguous on, because fletcher32 is on. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* Turn off fletcher32. */
+ if (nc_def_var_fletcher32(ncid, varid, 0)) ERR;
+
+ /* Now I can make it contiguous again. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL)) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ }
+ SUMMARIZE_ERR;
#define DIM8_NAME "num_monkeys"
#define DIM9_NAME "num_coconuts"
#define DIM9_LEN 10
#define VAR_NAME8 "John_Clayton"
#define VAR_NAME9 "Lord_Greystoke"
- printf("**** testing that contiguous storage can't be turned on for vars with unlimited dims or filters...");
- {
- int ncid;
- int dimids[NDIMS1];
- int varid, varid2;
- size_t chunksize_in[NDIMS1];
- int storage_in;
-
- /* Create a netcdf-4 file with one dim and some vars. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM8_NAME, NC_UNLIMITED, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, dimids, &varid)) ERR;
- if (nc_def_dim(ncid, DIM9_NAME, DIM9_LEN, &dimids[0])) ERR;
- if (nc_def_var(ncid, VAR_NAME9, NC_INT, NDIMS1, dimids, &varid2)) ERR;
- if (nc_def_var_deflate(ncid, varid2, 0, 1, 4)) ERR;
-
- /* This won't work because of the umlimited dimension. */
- if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* This won't work because of the deflate filter. */
- if (nc_def_var_chunking(ncid, varid2, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
-
- /* Storage must be chunked because of unlimited dimension and
- * the deflate filter. */
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_inq_var_chunking(ncid, varid2, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (nc_close(ncid)) ERR;
+ printf("**** testing that contiguous storage can't be turned on for vars with unlimited dims or filters...");
+ {
+ int ncid;
+ int dimids[NDIMS1];
+ int varid, varid2;
+ size_t chunksize_in[NDIMS1];
+ int storage_in;
+
+ /* Create a netcdf-4 file with one dim and some vars. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM8_NAME, NC_UNLIMITED, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME8, NC_INT, NDIMS1, dimids, &varid)) ERR;
+ if (nc_def_dim(ncid, DIM9_NAME, DIM9_LEN, &dimids[0])) ERR;
+ if (nc_def_var(ncid, VAR_NAME9, NC_INT, NDIMS1, dimids, &varid2)) ERR;
+ if (nc_def_var_deflate(ncid, varid2, 0, 1, 4)) ERR;
+
+ /* This won't work because of the umlimited dimension. */
+ if (nc_def_var_chunking(ncid, varid, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* This won't work because of the deflate filter. */
+ if (nc_def_var_chunking(ncid, varid2, NC_CONTIGUOUS, NULL) != NC_EINVAL) ERR;
+
+ /* Storage must be chunked because of unlimited dimension and
+ * the deflate filter. */
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_inq_var_chunking(ncid, varid2, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (nc_close(ncid)) ERR;
+
+ }
+ SUMMARIZE_ERR;
+#define DIM10_NAME "num_monkeys"
+#define DIM11_NAME "num_hats"
+#define VAR_NAME11 "Silly_Sally"
+#define NDIM2 2
+ printf("**** testing very large chunksizes...");
+ {
+ int ncid;
+ int dimid[NDIM2];
+ int varid;
+ size_t chunksize[NDIM2] = {1, (size_t)NC_MAX_INT + (size_t)1};
+ size_t chunksize_in[NDIM2];
+ int chunksize_int_in[NDIM2];
+ int storage_in;
+
+ /* Create a netcdf-4 file. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM10_NAME, NC_UNLIMITED, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, DIM11_NAME, NC_UNLIMITED, &dimid[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME11, NC_BYTE, NDIM2, dimid, &varid)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+
+ /* Set a large chunksize. */
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
+ if (storage_in != NC_CHUNKED) ERR;
+ if (chunksize_in[0] != chunksize[0] || chunksize_in[1] != chunksize[1]) ERR;
+ if (nc_inq_var_chunking_ints(ncid, varid, &storage_in, chunksize_int_in) != NC_ERANGE) ERR;
+
+ /* Close the file. */
+ if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+ }
+ SUMMARIZE_ERR;
#define DIM10_NAME "num_monkeys"
#define DIM11_NAME "num_hats"
#define VAR_NAME11 "Silly_Sally"
#define NDIM2 2
- printf("**** testing very large chunksizes...");
- {
- int ncid;
- int dimid[NDIM2];
- int varid;
- size_t chunksize[NDIM2] = {1, (size_t)NC_MAX_INT + (size_t)1};
- size_t chunksize_in[NDIM2];
- int chunksize_int_in[NDIM2];
- int storage_in;
-
- /* Create a netcdf-4 file. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM10_NAME, NC_UNLIMITED, &dimid[0])) ERR;
- if (nc_def_dim(ncid, DIM11_NAME, NC_UNLIMITED, &dimid[1])) ERR;
- if (nc_def_var(ncid, VAR_NAME11, NC_BYTE, NDIM2, dimid, &varid)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
-
- /* Set a large chunksize. */
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, chunksize)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksize_in)) ERR;
- if (storage_in != NC_CHUNKED) ERR;
- if (chunksize_in[0] != chunksize[0] || chunksize_in[1] != chunksize[1]) ERR;
- if (nc_inq_var_chunking_ints(ncid, varid, &storage_in, chunksize_int_in) != NC_ERANGE) ERR;
-
- /* Close the file. */
- if (nc_close(ncid)) ERR;
-
- }
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ printf("**** testing deflate_level value when deflate is not in use...");
+ {
+ int ncid;
+ int dimid[NDIM2];
+ int varid;
+ int deflate_in, deflate_level_in = 99;
+
+ /* Create a netcdf-4 file. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM10_NAME, NC_UNLIMITED, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, DIM11_NAME, NC_UNLIMITED, &dimid[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME11, NC_BYTE, NDIM2, dimid, &varid)) ERR;
+
+ /* Check the deflate_level. */
+ if (nc_inq_var_deflate(ncid, varid, NULL, &deflate_in, &deflate_level_in)) ERR;
+ if (deflate_in || deflate_level_in) ERR;
+
+ /* Close the file. */
+ if (nc_close(ncid)) ERR;
+
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_vars3.c netcdf-parallel-4.7.4/nc_test4/tst_vars3.c
--- netcdf-parallel-4.7.3/nc_test4/tst_vars3.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_vars3.c 2020-08-31 10:33:26.000000000 +0000
@@ -1,5 +1,5 @@
/* This is part of the netCDF package.
- Copyright 2018 University Corporation for Atmospheric Research/Unidata
+ Copyright 2020 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Test netcdf-4 variables.
@@ -9,6 +9,12 @@
#include
#include "err_macros.h"
#include "netcdf.h"
+#include "netcdf_filter.h"
+
+#define NC_SZIP_EC_BPP_IN 32 /**< @internal bits per pixel input. */
+#define NC_SZIP_EC_BPP_OUT 64 /**< @internal bits per pixel output. */
+#define NC_SZIP_NN 32 /**< @internal SZIP NN option mask. */
+#define NC_SZIP_EC 4 /**< @internal SZIP EC option mask. */
#define FILE_NAME "tst_vars3.nc"
#define NDIMS1 1
@@ -23,302 +29,308 @@
#define V_MEDIUM "medium_var"
#define V_LARGE "large_var"
#define D_MAX_ONE_D 16384
+#define DIM_NAME_1 "one_dim"
+#define DIM_LEN_1 100
+#define H5_FILTER_SZIP 4
+#define VAR_NAME "var1"
+#define NUM_PARAMS_IN 2
+#define NUM_PARAMS_OUT 4
int
main(int argc, char **argv)
{
- printf("\n*** Testing netcdf-4 variable functions, some more.\n");
- printf("**** testing definition of coordinate variable after endef/redef...");
- {
+ printf("\n*** Testing netcdf-4 variable functions, some more.\n");
+ printf("**** testing definition of coordinate variable after endef/redef...");
+ {
#define NX 6
#define NY 36
#define ZD1_NAME "zD1"
#define D2_NAME "D2"
- int ncid, x_dimid, y_dimid, varid2;
- char name_in[NC_MAX_NAME + 1];
+ int ncid, x_dimid, y_dimid, varid2;
+ char name_in[NC_MAX_NAME + 1];
- /* Create file with two dims, two 1D vars. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, ZD1_NAME, NX, &x_dimid)) ERR;
- if (nc_def_dim(ncid, D2_NAME, NY, &y_dimid)) ERR;
- if (nc_enddef(ncid)) ERR;
-
- /* Go back into define mode and add a coordinate variable. Now
- * dimensions will be out of order. Thanks for confusing my poor
- * library. Why can't you just make up your bloody mind? */
- if (nc_redef(ncid)) ERR;
- if (nc_def_var(ncid, ZD1_NAME, NC_DOUBLE, NDIMS1, &x_dimid, &varid2)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Reopen file and check the name of the first dimension. Even
- * though you've changed the order after doing a redef, you will
- * still expect to get D1_NAME. I sure hope you appreciate how
- * hard you are making life for a poor C library, just trying to
- * do its best in a demanding world. Next time, why don't you
- * try and be a little bit more considerate? Jerk. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
- if (nc_inq_dimname(ncid, 0, name_in)) ERR;
- if (strcmp(name_in, ZD1_NAME)) ERR;
- if (nc_inq_dimname(ncid, 1, name_in)) ERR;
- if (strcmp(name_in, D2_NAME)) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing definition of coordinate variable with some data...");
- {
+ /* Create file with two dims, two 1D vars. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, ZD1_NAME, NX, &x_dimid)) ERR;
+ if (nc_def_dim(ncid, D2_NAME, NY, &y_dimid)) ERR;
+ if (nc_enddef(ncid)) ERR;
+
+ /* Go back into define mode and add a coordinate variable. Now
+ * dimensions will be out of order. Thanks for confusing my poor
+ * library. Why can't you just make up your bloody mind? */
+ if (nc_redef(ncid)) ERR;
+ if (nc_def_var(ncid, ZD1_NAME, NC_DOUBLE, NDIMS1, &x_dimid, &varid2)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen file and check the name of the first dimension. Even
+ * though you've changed the order after doing a redef, you will
+ * still expect to get D1_NAME. I sure hope you appreciate how
+ * hard you are making life for a poor C library, just trying to
+ * do its best in a demanding world. Next time, why don't you
+ * try and be a little bit more considerate? Jerk. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_dimname(ncid, 0, name_in)) ERR;
+ if (strcmp(name_in, ZD1_NAME)) ERR;
+ if (nc_inq_dimname(ncid, 1, name_in)) ERR;
+ if (strcmp(name_in, D2_NAME)) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing definition of coordinate variable with some data...");
+ {
#define NX 6
#define NY 36
#define V1_NAME "V1"
#define D1_NAME "D1"
#define D2_NAME "D2"
- int ncid, x_dimid, y_dimid, varid1, varid2;
- int nvars, ndims, ngatts, unlimdimid, dimids_in[2], natts;
- size_t len_in;
- char name_in[NC_MAX_NAME + 1];
- nc_type xtype_in;
+ int ncid, x_dimid, y_dimid, varid1, varid2;
+ int nvars, ndims, ngatts, unlimdimid, dimids_in[2], natts;
+ size_t len_in;
+ char name_in[NC_MAX_NAME + 1];
+ nc_type xtype_in;
#if 0
- int x, y;
- double data_outx[NX], data_outy[NY];
- int retval;
+ int x, y;
+ double data_outx[NX], data_outy[NY];
+ int retval;
#endif
#if 0
- /* Create some pretend data. */
- for (x = 0; x < NX; x++)
- data_outx[x] = x;
- for (y = 0; y < NY; y++)
- data_outy[y] = y;
+ /* Create some pretend data. */
+ for (x = 0; x < NX; x++)
+ data_outx[x] = x;
+ for (y = 0; y < NY; y++)
+ data_outy[y] = y;
#endif
- /* Create file with two dims, two 1D vars. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, D1_NAME, NX, &x_dimid)) ERR;
- if (nc_def_dim(ncid, D2_NAME, NY, &y_dimid)) ERR;
- if (nc_def_var(ncid, V1_NAME, NC_DOUBLE, NDIMS1, &y_dimid, &varid1)) ERR;
- if (nc_enddef(ncid)) ERR;
- if (nc_redef(ncid)) ERR;
- if (nc_def_var(ncid, D1_NAME, NC_DOUBLE, NDIMS1, &x_dimid, &varid2)) ERR;
+ /* Create file with two dims, two 1D vars. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, D1_NAME, NX, &x_dimid)) ERR;
+ if (nc_def_dim(ncid, D2_NAME, NY, &y_dimid)) ERR;
+ if (nc_def_var(ncid, V1_NAME, NC_DOUBLE, NDIMS1, &y_dimid, &varid1)) ERR;
+ if (nc_enddef(ncid)) ERR;
+ if (nc_redef(ncid)) ERR;
+ if (nc_def_var(ncid, D1_NAME, NC_DOUBLE, NDIMS1, &x_dimid, &varid2)) ERR;
/* if (nc_put_var_double(ncid, varid1, &data_outy[0])) ERR; */
/* if (nc_put_var_double(ncid, varid2, &data_outx[0])) ERR; */
/* if (nc_sync(ncid)) ERR; */
- /* Check the file. */
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != 2 || ndims != 2 || ngatts != 0 || unlimdimid != -1) ERR;
-
- /* Check the dimensions. */
- if (nc_inq_dimids(ncid, &ndims, dimids_in, 1)) ERR;
- if (ndims != 2 || dimids_in[0] != x_dimid || dimids_in[1] != y_dimid) ERR;
- if (nc_inq_dim(ncid, dimids_in[0], name_in, &len_in)) ERR;
- if (strcmp(name_in, D1_NAME) || len_in != NX) ERR;
- if (nc_inq_dim(ncid, dimids_in[1], name_in, &len_in)) ERR;
- if (strcmp(name_in, D2_NAME) || len_in != NY) ERR;
-
- /* Check the variables. */
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, V1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
- natts != 0 || dimids_in[0] != y_dimid) ERR;
- if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, D1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
- natts != 0 || dimids_in[0] != x_dimid) ERR;
-
- /* Close the file. */
- if (nc_close(ncid)) ERR;
-
- /* Reopen and check the file. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != 2 || ndims != 2 || ngatts != 0 || unlimdimid != -1) ERR;
-
- /* Check the dimensions. */
- if (nc_inq_dimids(ncid, &ndims, dimids_in, 1)) ERR;
- if (ndims != 2 || dimids_in[0] != x_dimid || dimids_in[1] != y_dimid) ERR;
- if (nc_inq_dim(ncid, dimids_in[0], name_in, &len_in)) ERR;
- if (strcmp(name_in, D1_NAME) || len_in != NX) ERR;
- if (nc_inq_dim(ncid, dimids_in[1], name_in, &len_in)) ERR;
- if (strcmp(name_in, D2_NAME) || len_in != NY) ERR;
-
- /* Check the variables. */
- if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, V1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
- natts != 0 || dimids_in[0] != y_dimid) ERR;
- if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
- if (strcmp(name_in, D1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
- natts != 0 || dimids_in[0] != x_dimid) ERR;
-
- if (nc_close(ncid)) ERR;
-
- }
- SUMMARIZE_ERR;
- printf("**** testing endianness of compound type variable...");
- {
+ /* Check the file. */
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != 2 || ndims != 2 || ngatts != 0 || unlimdimid != -1) ERR;
+
+ /* Check the dimensions. */
+ if (nc_inq_dimids(ncid, &ndims, dimids_in, 1)) ERR;
+ if (ndims != 2 || dimids_in[0] != x_dimid || dimids_in[1] != y_dimid) ERR;
+ if (nc_inq_dim(ncid, dimids_in[0], name_in, &len_in)) ERR;
+ if (strcmp(name_in, D1_NAME) || len_in != NX) ERR;
+ if (nc_inq_dim(ncid, dimids_in[1], name_in, &len_in)) ERR;
+ if (strcmp(name_in, D2_NAME) || len_in != NY) ERR;
+
+ /* Check the variables. */
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, V1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
+ natts != 0 || dimids_in[0] != y_dimid) ERR;
+ if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, D1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
+ natts != 0 || dimids_in[0] != x_dimid) ERR;
+
+ /* Close the file. */
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen and check the file. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != 2 || ndims != 2 || ngatts != 0 || unlimdimid != -1) ERR;
+
+ /* Check the dimensions. */
+ if (nc_inq_dimids(ncid, &ndims, dimids_in, 1)) ERR;
+ if (ndims != 2 || dimids_in[0] != x_dimid || dimids_in[1] != y_dimid) ERR;
+ if (nc_inq_dim(ncid, dimids_in[0], name_in, &len_in)) ERR;
+ if (strcmp(name_in, D1_NAME) || len_in != NX) ERR;
+ if (nc_inq_dim(ncid, dimids_in[1], name_in, &len_in)) ERR;
+ if (strcmp(name_in, D2_NAME) || len_in != NY) ERR;
+
+ /* Check the variables. */
+ if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, V1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
+ natts != 0 || dimids_in[0] != y_dimid) ERR;
+ if (nc_inq_var(ncid, 1, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
+ if (strcmp(name_in, D1_NAME) || xtype_in != NC_DOUBLE || ndims != 1 ||
+ natts != 0 || dimids_in[0] != x_dimid) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing endianness of compound type variable...");
+ {
#define COMPOUND_NAME "Billy-Bob"
#define BILLY "Billy"
#define BOB "Bob"
#define VAR_NAME1 "Buddy-Joe"
#define NDIMS 2
#define TEXT_LEN 15
- int ncid, nvars_in, varids_in[1], typeid, varid;
- int nvars, ndims, ngatts, unlimdimid;
- int ndims_in, natts_in, dimids_in[NDIMS];
- char var_name_in[NC_MAX_NAME + 1];
- nc_type xtype_in;
- struct billy_bob
- {
- int billy;
- int bob;
- };
-
- /* Create a netcdf-4 file with scalar compound var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_compound(ncid, sizeof(struct billy_bob), COMPOUND_NAME, &typeid)) ERR;
- if (nc_insert_compound(ncid, typeid, BILLY, NC_COMPOUND_OFFSET(struct billy_bob, billy), NC_INT)) ERR;
- if (nc_insert_compound(ncid, typeid, BOB, NC_COMPOUND_OFFSET(struct billy_bob, bob), NC_INT)) ERR;
- if (nc_def_var(ncid, VAR_NAME1, typeid, 0, NULL, &varid)) ERR;
- if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG) != NC_EINVAL) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != 1 || ndims != 0 || ngatts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
- if (nvars_in != 1 || varids_in[0] != 0) ERR;
- if (nc_inq_var(ncid, 0, var_name_in, &xtype_in, &ndims_in, dimids_in, &natts_in)) ERR;
- if (strcmp(var_name_in, VAR_NAME1) || xtype_in <= NC_STRING || ndims_in != 0 ||
- natts_in != 0) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing that fixed vars with no filter end up being contiguous...");
- {
+ int ncid, nvars_in, varids_in[1], typeid, varid;
+ int nvars, ndims, ngatts, unlimdimid;
+ int ndims_in, natts_in, dimids_in[NDIMS];
+ char var_name_in[NC_MAX_NAME + 1];
+ nc_type xtype_in;
+ struct billy_bob
+ {
+ int billy;
+ int bob;
+ };
+
+ /* Create a netcdf-4 file with scalar compound var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_compound(ncid, sizeof(struct billy_bob), COMPOUND_NAME, &typeid)) ERR;
+ if (nc_insert_compound(ncid, typeid, BILLY, NC_COMPOUND_OFFSET(struct billy_bob, billy), NC_INT)) ERR;
+ if (nc_insert_compound(ncid, typeid, BOB, NC_COMPOUND_OFFSET(struct billy_bob, bob), NC_INT)) ERR;
+ if (nc_def_var(ncid, VAR_NAME1, typeid, 0, NULL, &varid)) ERR;
+ if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG) != NC_EINVAL) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != 1 || ndims != 0 || ngatts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_varids(ncid, &nvars_in, varids_in)) ERR;
+ if (nvars_in != 1 || varids_in[0] != 0) ERR;
+ if (nc_inq_var(ncid, 0, var_name_in, &xtype_in, &ndims_in, dimids_in, &natts_in)) ERR;
+ if (strcmp(var_name_in, VAR_NAME1) || xtype_in <= NC_STRING || ndims_in != 0 ||
+ natts_in != 0) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing that fixed vars with no filter end up being contiguous...");
+ {
#define VAR_NAME2 "Yoman_of_the_Guard"
#define NDIMS 2
#define D0_NAME1 "Tower_warders_under_orders"
#define D0_LEN 55
#define D1_NAME1 "When_our_gallent_Norman_Foes"
#define D1_LEN 99
- int ncid, varid;
- int nvars, ndims, ngatts, unlimdimid;
- int dimids[NDIMS], contig;
- int ndims_in, natts_in, dimids_in[NDIMS];
- char var_name_in[NC_MAX_NAME + 1];
- nc_type xtype_in;
-
- /* Create a netcdf-4 file with 2D fixed var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, D0_NAME1, D0_LEN, &dimids[0])) ERR;
- if (nc_def_dim(ncid, D1_NAME1, D1_LEN, &dimids[1])) ERR;
- if (nc_def_var(ncid, VAR_NAME2, NC_UINT64, NDIMS, dimids, &varid)) ERR;
- if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != 1 || ndims != 2 || ngatts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_var(ncid, 0, var_name_in, &xtype_in, &ndims_in, dimids_in, &natts_in)) ERR;
- if (strcmp(var_name_in, VAR_NAME2) || xtype_in != NC_UINT64 || ndims_in != 2 ||
- natts_in != 0) ERR;
- if (nc_inq_var_chunking(ncid, varid, &contig, NULL)) ERR;
- if (!contig) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing typeless access for classic model...");
- {
+ int ncid, varid;
+ int nvars, ndims, ngatts, unlimdimid;
+ int dimids[NDIMS], contig;
+ int ndims_in, natts_in, dimids_in[NDIMS];
+ char var_name_in[NC_MAX_NAME + 1];
+ nc_type xtype_in;
+
+ /* Create a netcdf-4 file with 2D fixed var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, D0_NAME1, D0_LEN, &dimids[0])) ERR;
+ if (nc_def_dim(ncid, D1_NAME1, D1_LEN, &dimids[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME2, NC_UINT64, NDIMS, dimids, &varid)) ERR;
+ if (nc_def_var_endian(ncid, varid, NC_ENDIAN_BIG)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != 1 || ndims != 2 || ngatts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_var(ncid, 0, var_name_in, &xtype_in, &ndims_in, dimids_in, &natts_in)) ERR;
+ if (strcmp(var_name_in, VAR_NAME2) || xtype_in != NC_UINT64 || ndims_in != 2 ||
+ natts_in != 0) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &contig, NULL)) ERR;
+ if (!contig) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing typeless access for classic model...");
+ {
#define RANK_P 3
#define LEN 4
- int ncid, dimids[RANK_P], time_id, p_id;
- int ndims, dimids_in[RANK_P];
+ int ncid, dimids[RANK_P], time_id, p_id;
+ int ndims, dimids_in[RANK_P];
- double data[1] = {3.14159};
- size_t start[1] = {0}, count[1] = {1};
- static float P_data[LEN];
- size_t cor[RANK_P] = {0, 1, 0};
- size_t edg[RANK_P] = {1, 1, LEN};
- int i;
-
- /* Create a 3D test file. */
- if (nc_create(FILE_NAME, NC_CLASSIC_MODEL|NC_NETCDF4, &ncid)) ERR;
-
- /* define dimensions */
- if (nc_def_dim(ncid, "Time", NC_UNLIMITED, &dimids[0])) ERR;
- if (nc_def_dim(ncid, "X", 4, &dimids[2])) ERR;
- if (nc_def_dim(ncid, "Y", 3, &dimids[1])) ERR;
-
- /* define variables */
- if (nc_def_var(ncid, "Time", NC_DOUBLE, 1, dimids, &time_id)) ERR;
- if (nc_def_var(ncid, "P", NC_FLOAT, RANK_P, dimids, &p_id)) ERR;
- if (nc_enddef(ncid)) ERR;
-
- /* Add one record in coordinate variable. */
- if (nc_put_vara(ncid, time_id, start, count, data)) ERR;
-
- /* The other variable should show an increase in size, since it
- * uses the unlimited dimension. */
- if (nc_inq_var(ncid, 1, NULL, NULL, &ndims, dimids_in, NULL)) ERR;
- if (ndims != 3 || dimids_in[0] != 0 || dimids_in[1] != 2 || dimids_in[2] != 1) ERR;
-
- /* These will not work due to bad parameters. */
- if (nc_get_vara(ncid + MILLION, 1, cor, edg, P_data) != NC_EBADID) ERR;
- if (nc_get_vara(ncid + TEST_VAL_42, 1, cor, edg, P_data) != NC_EBADID) ERR;
-
- /* Read the record of non-existent data. */
- if (nc_get_vara(ncid, 1, cor, edg, P_data)) ERR;
- for (i = 0; i < LEN; i++)
- if (P_data[i] != NC_FILL_FLOAT) ERR;
-
- /* That's it! */
- if (nc_close(ncid)) ERR;
-
- /* Reopen the file and read the second slice. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
-
- if (nc_inq_var(ncid, 1, NULL, NULL, &ndims, dimids_in, NULL)) ERR;
- if (ndims != 3 || dimids_in[0] != 0 || dimids_in[1] != 2 || dimids_in[2] != 1) ERR;
- if (nc_get_vara(ncid, 1, cor, edg, P_data)) ERR;
- for (i = 0; i < LEN; i++)
- if (P_data[i] != NC_FILL_FLOAT) ERR;
-
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing large number of vars with unlimited dimension...");
- {
+ double data[1] = {3.14159};
+ size_t start[1] = {0}, count[1] = {1};
+ static float P_data[LEN];
+ size_t cor[RANK_P] = {0, 1, 0};
+ size_t edg[RANK_P] = {1, 1, LEN};
+ int i;
+
+ /* Create a 3D test file. */
+ if (nc_create(FILE_NAME, NC_CLASSIC_MODEL|NC_NETCDF4, &ncid)) ERR;
+
+ /* define dimensions */
+ if (nc_def_dim(ncid, "Time", NC_UNLIMITED, &dimids[0])) ERR;
+ if (nc_def_dim(ncid, "X", 4, &dimids[2])) ERR;
+ if (nc_def_dim(ncid, "Y", 3, &dimids[1])) ERR;
+
+ /* define variables */
+ if (nc_def_var(ncid, "Time", NC_DOUBLE, 1, dimids, &time_id)) ERR;
+ if (nc_def_var(ncid, "P", NC_FLOAT, RANK_P, dimids, &p_id)) ERR;
+ if (nc_enddef(ncid)) ERR;
+
+ /* Add one record in coordinate variable. */
+ if (nc_put_vara(ncid, time_id, start, count, data)) ERR;
+
+ /* The other variable should show an increase in size, since it
+ * uses the unlimited dimension. */
+ if (nc_inq_var(ncid, 1, NULL, NULL, &ndims, dimids_in, NULL)) ERR;
+ if (ndims != 3 || dimids_in[0] != 0 || dimids_in[1] != 2 || dimids_in[2] != 1) ERR;
+
+ /* These will not work due to bad parameters. */
+ if (nc_get_vara(ncid + MILLION, 1, cor, edg, P_data) != NC_EBADID) ERR;
+ if (nc_get_vara(ncid + TEST_VAL_42, 1, cor, edg, P_data) != NC_EBADID) ERR;
+
+ /* Read the record of non-existent data. */
+ if (nc_get_vara(ncid, 1, cor, edg, P_data)) ERR;
+ for (i = 0; i < LEN; i++)
+ if (P_data[i] != NC_FILL_FLOAT) ERR;
+
+ /* That's it! */
+ if (nc_close(ncid)) ERR;
+
+ /* Reopen the file and read the second slice. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+
+ if (nc_inq_var(ncid, 1, NULL, NULL, &ndims, dimids_in, NULL)) ERR;
+ if (ndims != 3 || dimids_in[0] != 0 || dimids_in[1] != 2 || dimids_in[2] != 1) ERR;
+ if (nc_get_vara(ncid, 1, cor, edg, P_data)) ERR;
+ for (i = 0; i < LEN; i++)
+ if (P_data[i] != NC_FILL_FLOAT) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing large number of vars with unlimited dimension...");
+ {
#define D0_NAME3 "dim0"
#define NUM_VARS 1000
- int ncid, varid;
- int nvars, ndims, ngatts, unlimdimid;
- int dimid;
- char var_name[NC_MAX_NAME + 1];
- int v;
-
- /* Create a netcdf-4 file with lots of 1D unlim dim vars. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, D0_NAME3, NC_UNLIMITED, &dimid)) ERR;
- for (v = 0; v < NUM_VARS; v++)
- {
- sprintf(var_name, "var_%d", v);
- if (nc_def_var(ncid, var_name, NC_INT, 1, &dimid, &varid)) ERR_RET;
- if (nc_set_var_chunk_cache(ncid, varid, 0, 0, 0.75)) ERR_RET;
- }
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != NUM_VARS || ndims != 1 || ngatts != 0 || unlimdimid != 0) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing fix of bug in checking coordinate variables out of order...");
- {
+ int ncid, varid;
+ int nvars, ndims, ngatts, unlimdimid;
+ int dimid;
+ char var_name[NC_MAX_NAME + 1];
+ int v;
+
+ /* Create a netcdf-4 file with lots of 1D unlim dim vars. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, D0_NAME3, NC_UNLIMITED, &dimid)) ERR;
+ for (v = 0; v < NUM_VARS; v++)
+ {
+ sprintf(var_name, "var_%d", v);
+ if (nc_def_var(ncid, var_name, NC_INT, 1, &dimid, &varid)) ERR_RET;
+ if (nc_set_var_chunk_cache(ncid, varid, 0, 0, 0.75)) ERR_RET;
+ }
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != NUM_VARS || ndims != 1 || ngatts != 0 || unlimdimid != 0) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing fix of bug in checking coordinate variables out of order...");
+ {
#define GRP_NAME "group_G"
#define TIME_DIMNAME "time"
#define B_DIMNAME "bDim"
@@ -326,147 +338,186 @@
#define C_VARNAME "c"
#define D_VARNAME "dd"
#define E_VARNAME "ee"
- int ncid, grpid;
- int timeDimId, bDimId, cDimId, dimidIn;
- size_t timeDimSize = 2, bDimSize = 3, cDimSize = 1;
- int cNdims = 1, eeNdims = 1, ddNdims = 1 ;
- int cVarId, eeVarId, ddVarId ;
- size_t index = 0;
- double s1Data = 10;
- const double timeVar[] = {1.3, 4.6 };
-
- if ( nc_create(FILE_NAME, NC_NETCDF4, &ncid) ) ERR;
- if ( nc_def_grp(ncid, GRP_NAME, &grpid) ) ERR;
- if ( nc_def_dim(ncid, TIME_DIMNAME, timeDimSize, &timeDimId) ) ERR;
- if ( nc_def_dim(grpid, B_DIMNAME, bDimSize, &bDimId) ) ERR;
- if ( nc_def_dim(grpid, C_DIMNAME, cDimSize, &cDimId) ) ERR;
- if ( nc_def_var(grpid, C_VARNAME, NC_DOUBLE, cNdims, &cDimId, &cVarId) ) ERR;
- if ( nc_def_var(ncid, E_VARNAME, NC_DOUBLE, eeNdims, &timeDimId, &eeVarId) ) ERR;
- /* worked without this enddef, but in 4.2.1.1 and earlier, inserting this caused failure */
- if ( nc_enddef(ncid)) ERR;
- if ( nc_def_var(grpid, D_VARNAME, NC_DOUBLE, ddNdims, &timeDimId, &ddVarId)) ERR;
- if ( nc_put_var1(grpid, cVarId, &index, &s1Data) ) ERR;
- if ( nc_put_var_double(grpid, ddVarId, timeVar)) ERR;
- if ( nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_grp_ncid(ncid, GRP_NAME, &grpid)) ERR;
- if (nc_inq_varid(grpid, D_VARNAME, &ddVarId)) ERR;
- if (nc_inq_vardimid(grpid, ddVarId, &dimidIn)) ERR;
- if (nc_inq_dimid(ncid, TIME_DIMNAME, &timeDimId)) ERR;
- if (nc_inq_dimid(grpid, C_DIMNAME, &cDimId)) ERR;
- if (dimidIn == cDimId || cDimId == timeDimId) ERR; /* bug in 4.2.1.1 and earlier */
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing fix of bug in non-coordinate scalar variable with same name as dimension ...");
- {
+ int ncid, grpid;
+ int timeDimId, bDimId, cDimId, dimidIn;
+ size_t timeDimSize = 2, bDimSize = 3, cDimSize = 1;
+ int cNdims = 1, eeNdims = 1, ddNdims = 1 ;
+ int cVarId, eeVarId, ddVarId ;
+ size_t index = 0;
+ double s1Data = 10;
+ const double timeVar[] = {1.3, 4.6 };
+
+ if ( nc_create(FILE_NAME, NC_NETCDF4, &ncid) ) ERR;
+ if ( nc_def_grp(ncid, GRP_NAME, &grpid) ) ERR;
+ if ( nc_def_dim(ncid, TIME_DIMNAME, timeDimSize, &timeDimId) ) ERR;
+ if ( nc_def_dim(grpid, B_DIMNAME, bDimSize, &bDimId) ) ERR;
+ if ( nc_def_dim(grpid, C_DIMNAME, cDimSize, &cDimId) ) ERR;
+ if ( nc_def_var(grpid, C_VARNAME, NC_DOUBLE, cNdims, &cDimId, &cVarId) ) ERR;
+ if ( nc_def_var(ncid, E_VARNAME, NC_DOUBLE, eeNdims, &timeDimId, &eeVarId) ) ERR;
+ /* worked without this enddef, but in 4.2.1.1 and earlier, inserting this caused failure */
+ if ( nc_enddef(ncid)) ERR;
+ if ( nc_def_var(grpid, D_VARNAME, NC_DOUBLE, ddNdims, &timeDimId, &ddVarId)) ERR;
+ if ( nc_put_var1(grpid, cVarId, &index, &s1Data) ) ERR;
+ if ( nc_put_var_double(grpid, ddVarId, timeVar)) ERR;
+ if ( nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_grp_ncid(ncid, GRP_NAME, &grpid)) ERR;
+ if (nc_inq_varid(grpid, D_VARNAME, &ddVarId)) ERR;
+ if (nc_inq_vardimid(grpid, ddVarId, &dimidIn)) ERR;
+ if (nc_inq_dimid(ncid, TIME_DIMNAME, &timeDimId)) ERR;
+ if (nc_inq_dimid(grpid, C_DIMNAME, &cDimId)) ERR;
+ if (dimidIn == cDimId || cDimId == timeDimId) ERR; /* bug in 4.2.1.1 and earlier */
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing fix of bug in non-coordinate scalar variable with same name as dimension ...");
+ {
#define DIMNAME "abc"
#define SCALAR_VARNAME DIMNAME
- int ncid;
- int dimid, varid;
- int ndims = 1;
- size_t dimsize = 3;
- char varname_in[NC_MAX_NAME];
-
- if ( nc_create(FILE_NAME, NC_NETCDF4, &ncid) ) ERR;
- if ( nc_def_dim(ncid, DIMNAME, dimsize, &dimid) ) ERR;
- if ( nc_def_var(ncid, SCALAR_VARNAME, NC_FLOAT, ndims, &dimid, &varid) ) ERR;
- if ( nc_close(ncid)) ERR;
-
- /* Open the file and check varname. */
- if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
- if (nc_inq_varid(ncid, SCALAR_VARNAME, &varid)) ERR;
- if (nc_inq_varname(ncid, varid, varname_in)) ERR;
- if (strcmp(varname_in, SCALAR_VARNAME) != 0) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing bad inputs to put/get_vara calls...");
- {
- int ncid, dimid[NDIMS2], varid;
- size_t start[NDIMS2] = {0, 0}, count[NDIMS2] = {NX, NY};
- ptrdiff_t stride[NDIMS2] = {1, 1};
- double double_data[NX * NY];
-
- /* Create file with two dims, one 2D var. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, ZD1_NAME, NX, &dimid[0])) ERR;
- if (nc_def_dim(ncid, D2_NAME, NY, &dimid[1])) ERR;
- if (nc_def_var(ncid, ZD1_NAME, NC_DOUBLE, NDIMS2, dimid, &varid)) ERR;
- if (nc_enddef(ncid)) ERR;
-
- /* Try to write some data, but fail. */
- if (nc_put_vara_double(ncid + MILLION, 0, start, count, double_data) != NC_EBADID) ERR;
- if (nc_put_vara_double(ncid + TEST_VAL_42, 0, start, count, double_data) != NC_EBADID) ERR;
-
- /* Write some data. */
- if (nc_put_vars_double(ncid, varid, start, count, NULL, double_data)) ERR;
- if (nc_put_vars_double(ncid, varid, start, count, stride, double_data)) ERR;
-
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+ int ncid;
+ int dimid, varid;
+ int ndims = 1;
+ size_t dimsize = 3;
+ char varname_in[NC_MAX_NAME];
+
+ if ( nc_create(FILE_NAME, NC_NETCDF4, &ncid) ) ERR;
+ if ( nc_def_dim(ncid, DIMNAME, dimsize, &dimid) ) ERR;
+ if ( nc_def_var(ncid, SCALAR_VARNAME, NC_FLOAT, ndims, &dimid, &varid) ) ERR;
+ if ( nc_close(ncid)) ERR;
+
+ /* Open the file and check varname. */
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq_varid(ncid, SCALAR_VARNAME, &varid)) ERR;
+ if (nc_inq_varname(ncid, varid, varname_in)) ERR;
+ if (strcmp(varname_in, SCALAR_VARNAME) != 0) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing bad inputs to put/get_vara calls...");
+ {
+ int ncid, dimid[NDIMS2], varid;
+ size_t start[NDIMS2] = {0, 0}, count[NDIMS2] = {NX, NY};
+ ptrdiff_t stride[NDIMS2] = {1, 1};
+ double double_data[NX * NY];
+
+ /* Create file with two dims, one 2D var. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, ZD1_NAME, NX, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, D2_NAME, NY, &dimid[1])) ERR;
+ if (nc_def_var(ncid, ZD1_NAME, NC_DOUBLE, NDIMS2, dimid, &varid)) ERR;
+ if (nc_enddef(ncid)) ERR;
+
+ /* Try to write some data, but fail. */
+ if (nc_put_vara_double(ncid + MILLION, 0, start, count, double_data) != NC_EBADID) ERR;
+ if (nc_put_vara_double(ncid + TEST_VAL_42, 0, start, count, double_data) != NC_EBADID) ERR;
+
+ /* Write some data. */
+ if (nc_put_vars_double(ncid, varid, start, count, NULL, double_data)) ERR;
+ if (nc_put_vars_double(ncid, varid, start, count, stride, double_data)) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
#ifdef USE_SZIP
- printf("**** testing simple szip filter setup...");
- {
-#define NDIMS1 1
-#define DIM_NAME_1 "one_dim"
-#define DIM_LEN_1 100
-#define VAR_NAME "var1"
-#define H5_FILTER_SZIP 4
-#define NUM_PARAMS_IN 2
-#define NUM_PARAMS_OUT 4
-#define NC_SZIP_NN_OPTION_MASK 32 /**< @internal SZIP NN option mask. */
-#define NC_SZIP_EC_OPTION_MASK 4 /**< @internal SZIP EC option mask. */
-#define NC_SZIP_EC_BPP_IN 32 /**< @internal bits per pixel input. */
-#define NC_SZIP_EC_BPP_OUT 64 /**< @internal bits per pixel output. */
- int ncid;
- int dimid;
- int varid;
- unsigned int params[NUM_PARAMS_IN];
- int options_mask, bits_per_pixel;
- size_t nparams;
- unsigned int filterid;
- unsigned int params_out[NUM_PARAMS_OUT];
- unsigned int tmp;
-
- /* Create a netcdf-4 file with one dimensions. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_1, &dimid)) ERR;
-
- /* Add a var. Turn on szip filter. */
- if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
- params[0] = NC_SZIP_NN_OPTION_MASK; /* options_mask */
- params[1] = NC_SZIP_EC_BPP_IN; /* bits_per_pixel */
- if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, NULL)) ERR;
- if (nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN, params)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- /* The following code should work, but doesn't. See issue 972 in github. */
- if (nc_inq_var_szip(ncid, varid, &options_mask, &bits_per_pixel)) ERR;
- /* H5Zszip code will sometimes bump the bits_per_pixel from 32 to 64
- and may add other flags to the options_mask */
- tmp = options_mask & NC_SZIP_NN_OPTION_MASK;
- if (tmp != NC_SZIP_NN_OPTION_MASK) ERR;
- if (bits_per_pixel != NC_SZIP_EC_BPP_IN && bits_per_pixel != NC_SZIP_EC_BPP_OUT)
- ERR;
-
- /* Also check using nc_inq_var_filter */
- if (nc_inq_var_filter(ncid, varid, &filterid, &nparams, params_out)) ERR;
- if (filterid != H5_FILTER_SZIP || nparams != 4) ERR;
- /* According to H5Zszip, the mapping should be as follows */
- if(params_out[0] != options_mask) ERR;
- if(params[1] != bits_per_pixel) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing more complex use of szip...");
- {
-#define NDIMS1 1
+ printf("**** testing simple szip filter setup...");
+ {
+ int ncid;
+ int dimid;
+ int varid;
+ unsigned int params[NUM_PARAMS_IN];
+ int options_mask, pixels_per_block;
+ size_t nparams;
+ unsigned int filterid;
+ unsigned int params_out[NUM_PARAMS_OUT];
+
+ /* Create a netcdf-4 file with one dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_1, &dimid)) ERR;
+
+ /* Add a var. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
+ /* Turn on szip filter. */
+ params[0] = NC_SZIP_NN; /* options_mask */
+ params[1] = NC_SZIP_EC_BPP_IN; /* pixels_per_block */
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, NULL)) ERR;
+ if (nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN, params)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+
+ /* Check szip settings. */
+ if (nc_inq_var_szip(ncid, varid, &options_mask, &pixels_per_block)) ERR;
+ /* H5Zszip code will sometimes bump the pixels_per_block from 32 to 64
+ and may add other flags to the options_mask */
+ if (!(options_mask & NC_SZIP_NN)) ERR;
+ if (pixels_per_block != NC_SZIP_EC_BPP_IN && pixels_per_block != NC_SZIP_EC_BPP_OUT)
+ ERR;
+
+ /* Also check using nc_inq_var_filter */
+ if (nc_inq_var_filter(ncid, varid, &filterid, &nparams, params_out)) ERR;
+ if (filterid != H5_FILTER_SZIP || nparams != 2) ERR;
+ /* According to H5Zszip, the mapping should be as follows */
+ if (!(options_mask & NC_SZIP_NN)) ERR;
+ if (pixels_per_block != NC_SZIP_EC_BPP_IN && pixels_per_block != NC_SZIP_EC_BPP_OUT)
+ ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing simple szip function use...");
+ {
+ int ncid;
+ int dimid;
+ int varid;
+ int options_mask, pixels_per_block;
+ size_t nparams;
+ unsigned int filterid;
+ unsigned int params_out[NUM_PARAMS_OUT];
+ unsigned int tmp;
+
+ /* Create a netcdf-4 file with one dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_1, &dimid)) ERR;
+
+ /* Add a var. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
+
+ /* Check szip filter settings. */
+ if (nc_inq_var_szip(ncid, varid, &options_mask, &pixels_per_block)) ERR;
+ if (options_mask != 0 || pixels_per_block != 0) ERR;
+
+ /* Turn on szip filter. */
+ if (nc_def_var_szip(ncid, varid, NC_SZIP_NN, NC_SZIP_EC_BPP_IN)) ERR;
+
+ /* Check szip filter settings. */
+ if (nc_inq_var_szip(ncid, varid, &options_mask, &pixels_per_block)) ERR;
+ if (!(options_mask & NC_SZIP_NN)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ /* The following code should work, but doesn't. See issue 972 in github. */
+ if (nc_inq_var_szip(ncid, varid, &options_mask, &pixels_per_block)) ERR;
+ /* H5Zszip code will sometimes bump the pixels_per_block from 32 to 64
+ and may add other flags to the options_mask */
+ tmp = options_mask & NC_SZIP_NN;
+ if (tmp != NC_SZIP_NN) ERR;
+ if (pixels_per_block != NC_SZIP_EC_BPP_IN && pixels_per_block != NC_SZIP_EC_BPP_OUT)
+ ERR;
+
+ /* Also check using nc_inq_var_filter */
+ if (nc_inq_var_filter(ncid, varid, &filterid, &nparams, params_out)) ERR;
+ if (filterid != H5_FILTER_SZIP || nparams != 2) ERR;
+ /* According to H5Zszip, the mapping should be as follows */
+ if(params_out[0] != options_mask) ERR;
+ if(params_out[1] != pixels_per_block) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing more complex use of szip...");
+ {
#define D_SMALL "small_dim"
#define D_SMALL_LEN1 100
#define D_MEDIUM "medium_dim"
@@ -476,90 +527,235 @@
#define V_SMALL "small_var"
#define V_MEDIUM "medium_var"
#define V_LARGE "large_var"
-#define H5_FILTER_SZIP 4
#define NUM_PARAMS 2
-#define NC_SZIP_NN_OPTION_MASK 32 /**< @internal SZIP NN option mask. */
-#define NC_SZIP_EC_OPTION_MASK 4 /**< @internal SZIP EC option mask. */
- int ncid;
- int nvars, ndims, ngatts, unlimdimid;
- int ndims_in, natts_in, dimids_in;
- int small_dimid, medium_dimid, large_dimid;
- int small_varid, medium_varid, large_varid;
- char var_name_in[NC_MAX_NAME + 1];
- nc_type xtype_in;
- /* int options_mask_in, bits_per_pixel_in; */
- long long small_data[D_SMALL_LEN1], small_data_in[D_SMALL_LEN1];
- long long medium_data[D_MEDIUM_LEN1], medium_data_in[D_MEDIUM_LEN1];
- long long large_data[D_LARGE_LEN1], large_data_in[D_LARGE_LEN1];
- unsigned int params[NUM_PARAMS];
- int i;
-
- for (i = 0; i < D_SMALL_LEN1; i++)
- small_data[i] = i;
- for (i = 0; i < D_MEDIUM_LEN1; i++)
- medium_data[i] = i;
- for (i = 0; i < D_LARGE_LEN1; i++)
- large_data[i] = i;
-
- /* Create a netcdf-4 file with three dimensions. */
- if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
- if (nc_def_dim(ncid, D_SMALL, D_SMALL_LEN1, &small_dimid)) ERR;
- if (nc_def_dim(ncid, D_MEDIUM, D_MEDIUM_LEN1, &medium_dimid)) ERR;
- if (nc_def_dim(ncid, D_LARGE, D_LARGE_LEN1, &large_dimid)) ERR;
-
- /* Add three vars. Turn on szip for two of them. */
- if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &small_dimid, &small_varid)) ERR;
-
- if (nc_def_var(ncid, V_MEDIUM, NC_INT64, NDIMS1, &medium_dimid, &medium_varid)) ERR;
- params[0] = NC_SZIP_NN_OPTION_MASK;
- params[1] = 32;
- if (nc_def_var_chunking(ncid, medium_varid, NC_CHUNKED, NULL)) ERR;
- if (nc_def_var_filter(ncid, medium_varid, H5_FILTER_SZIP, NUM_PARAMS, params)) ERR;
- if (nc_def_var(ncid, V_LARGE, NC_INT64, NDIMS1, &large_dimid, &large_varid)) ERR;
- params[1] = 32;
- if (nc_def_var_chunking(ncid, large_varid, NC_CHUNKED, NULL)) ERR;
- if (nc_def_var_filter(ncid, large_varid, H5_FILTER_SZIP, NUM_PARAMS, params)) ERR;
-
- /* Write data. */
- if (nc_put_var_longlong(ncid, small_varid, small_data)) ERR;
- if (nc_put_var_longlong(ncid, medium_varid, medium_data)) ERR;
- if (nc_put_var_longlong(ncid, large_varid, large_data)) ERR;
-
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != 3 || ndims != 3 || ngatts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_var(ncid, 0, var_name_in, &xtype_in, &ndims_in, &dimids_in, &natts_in)) ERR;
- if (strcmp(var_name_in, V_SMALL) || xtype_in != NC_INT64 || ndims_in != 1 ||
- natts_in != 0) ERR;
-
- /* The following code should work, but doesn't. See issue 972 in github. */
- /* Make sure we have the szip settings we expect. */
- /* if (nc_inq_var_szip(ncid, small_varid, &options_mask_in, &bits_per_pixel_in)) ERR; */
- /* if (options_mask_in != 0 || bits_per_pixel_in !=0) ERR; */
- /* if (nc_inq_var_szip(ncid, medium_varid, &options_mask_in, &bits_per_pixel_in)) ERR; */
- /* if (!(options_mask_in & NC_SZIP_EC_OPTION_MASK) || bits_per_pixel_in != 32) ERR; */
- /* if (nc_inq_var_szip(ncid, large_varid, &options_mask_in, &bits_per_pixel_in)) ERR; */
- /* if (!(options_mask_in & NC_SZIP_NN_OPTION_MASK) || bits_per_pixel_in != 16) ERR; */
-
- /* Read data. */
- if (nc_get_var_longlong(ncid, small_varid, small_data_in)) ERR;
- if (nc_get_var_longlong(ncid, medium_varid, medium_data_in)) ERR;
- if (nc_get_var_longlong(ncid, large_varid, large_data_in)) ERR;
-
- /* Check data. */
- for (i = 0; i < D_SMALL_LEN1; i++)
- if (small_data[i] != small_data_in[i]) ERR;
- for (i = 0; i < D_MEDIUM_LEN1; i++)
- if (medium_data[i] != medium_data_in[i]) ERR;
- for (i = 0; i < D_LARGE_LEN1; i++)
- if (large_data[i] != large_data_in[i]) ERR;
-
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+
+ int ncid;
+ int nvars, ndims, ngatts, unlimdimid;
+ int ndims_in, natts_in, dimids_in;
+ int small_dimid, medium_dimid, large_dimid;
+ int small_varid, medium_varid, large_varid;
+ char var_name_in[NC_MAX_NAME + 1];
+ nc_type xtype_in;
+ int options_mask_in, pixels_per_block_in;
+ long long small_data[D_SMALL_LEN1], small_data_in[D_SMALL_LEN1];
+ long long medium_data[D_MEDIUM_LEN1], medium_data_in[D_MEDIUM_LEN1];
+ long long large_data[D_LARGE_LEN1], large_data_in[D_LARGE_LEN1];
+ unsigned int params[NUM_PARAMS];
+ int i;
+
+ for (i = 0; i < D_SMALL_LEN1; i++)
+ small_data[i] = i;
+ for (i = 0; i < D_MEDIUM_LEN1; i++)
+ medium_data[i] = i;
+ for (i = 0; i < D_LARGE_LEN1; i++)
+ large_data[i] = i;
+
+ /* Create a netcdf-4 file with three dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, D_SMALL, D_SMALL_LEN1, &small_dimid)) ERR;
+ if (nc_def_dim(ncid, D_MEDIUM, D_MEDIUM_LEN1, &medium_dimid)) ERR;
+ if (nc_def_dim(ncid, D_LARGE, D_LARGE_LEN1, &large_dimid)) ERR;
+
+ /* Add three vars. Turn on szip for two of them. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &small_dimid, &small_varid)) ERR;
+
+ if (nc_def_var(ncid, V_MEDIUM, NC_INT64, NDIMS1, &medium_dimid, &medium_varid)) ERR;
+ params[0] = NC_SZIP_NN;
+ params[1] = 32;
+ if (nc_def_var_chunking(ncid, medium_varid, NC_CHUNKED, NULL)) ERR;
+ if (nc_def_var_filter(ncid, medium_varid, H5_FILTER_SZIP, NUM_PARAMS, params)) ERR;
+ if (nc_def_var(ncid, V_LARGE, NC_INT64, NDIMS1, &large_dimid, &large_varid)) ERR;
+ params[1] = 32;
+ if (nc_def_var_chunking(ncid, large_varid, NC_CHUNKED, NULL)) ERR;
+ if (nc_def_var_filter(ncid, large_varid, H5_FILTER_SZIP, NUM_PARAMS, params)) ERR;
+
+ /* Write data. */
+ if (nc_put_var_longlong(ncid, small_varid, small_data)) ERR;
+ if (nc_put_var_longlong(ncid, medium_varid, medium_data)) ERR;
+ if (nc_put_var_longlong(ncid, large_varid, large_data)) ERR;
+
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != 3 || ndims != 3 || ngatts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_var(ncid, 0, var_name_in, &xtype_in, &ndims_in, &dimids_in, &natts_in)) ERR;
+ if (strcmp(var_name_in, V_SMALL) || xtype_in != NC_INT64 || ndims_in != 1 ||
+ natts_in != 0) ERR;
+
+ /* Make sure we have the szip settings we expect. */
+ if (nc_inq_var_szip(ncid, small_varid, &options_mask_in, &pixels_per_block_in)) ERR;
+ if (options_mask_in != 0 || pixels_per_block_in !=0) ERR;
+ if (nc_inq_var_szip(ncid, medium_varid, &options_mask_in, &pixels_per_block_in)) ERR;
+ if (!(options_mask_in & NC_SZIP_NN)) ERR;
+ if (nc_inq_var_szip(ncid, large_varid, &options_mask_in, &pixels_per_block_in)) ERR;
+ if (!(options_mask_in & NC_SZIP_NN)) ERR;
+
+ /* Read data. */
+ if (nc_get_var_longlong(ncid, small_varid, small_data_in)) ERR;
+ if (nc_get_var_longlong(ncid, medium_varid, medium_data_in)) ERR;
+ if (nc_get_var_longlong(ncid, large_varid, large_data_in)) ERR;
+
+ /* Check data. */
+ for (i = 0; i < D_SMALL_LEN1; i++)
+ if (small_data[i] != small_data_in[i]) ERR;
+ for (i = 0; i < D_MEDIUM_LEN1; i++)
+ if (medium_data[i] != medium_data_in[i]) ERR;
+ for (i = 0; i < D_LARGE_LEN1; i++)
+ if (large_data[i] != large_data_in[i]) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing attempts to use both zlib and szip...");
+ {
+ int ncid;
+ int dimid;
+ int varid;
+ unsigned int params[NUM_PARAMS_IN] = {NC_SZIP_NN,
+ NC_SZIP_EC_BPP_IN};
+
+ /* Create a netcdf-4 file with one dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_1, &dimid)) ERR;
+
+ /* Add a var. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, NULL)) ERR;
+
+ /* Turn on zlib. */
+ if (nc_def_var_deflate(ncid, varid, 0, 1, 3)) ERR;
+
+ /* Try to turn on szip filter - it will fail. */
+ if (nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN,
+ params) != NC_EINVAL) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Create a netcdf-4 file with one dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_1, &dimid)) ERR;
+
+ /* Add a var. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, NULL)) ERR;
+
+ /* Turn on szip. */
+ if (nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN,
+ params)) ERR;
+
+ /* Try to turn on zlib filter - it will fail. */
+ if (nc_def_var_deflate(ncid, varid, 0, 1, 3) != NC_EINVAL) ERR;
+ if (nc_close(ncid)) ERR;
+
+ }
+ SUMMARIZE_ERR;
+#define SHORT_DIM_LEN_1 12
+#define NUM_MASK 2
+#define NUM_PPB 10
+#define FIRST_VALID 5
+ printf("**** testing different values for szip params...");
+ {
+ int ncid;
+ int dimid;
+ int varid;
+ int option_mask[NUM_MASK] = {NC_SZIP_NN, NC_SZIP_EC};
+ int pixels_per_block[NUM_PPB] = {1, 34, 14, 16, 24, 2, 4, 6, 10, 12};
+ int option_mask_in, pixels_per_block_in;
+ int m, p, ret;
+
+ /* Try different option masks. */
+ for (m = 0; m < NUM_MASK; m++)
+ {
+ /* Try different option masks. */
+ for (p = 0; p < NUM_PPB; p++)
+ {
+ /* Create a netcdf-4 file with one dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME_1, SHORT_DIM_LEN_1, &dimid)) ERR;
+
+ /* Add a var. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
+
+ /* Try to turn on szip filter. */
+ ret = nc_def_var_szip(ncid, varid, option_mask[m], pixels_per_block[p]);
+ if (ret != (p < FIRST_VALID ? NC_EINVAL : NC_NOERR)) ERR;
+
+ /* Check szip filter settings. */
+ if (nc_inq_var_szip(ncid, varid, &option_mask_in, &pixels_per_block_in)) ERR;
+ if (p < FIRST_VALID)
+ {
+ if (option_mask_in) ERR;
+ }
+ else
+ {
+ if (!(option_mask[m] & option_mask_in)) ERR;
+ }
+ if (nc_close(ncid)) ERR;
+
+ {
+ unsigned int params_in[NUM_PARAMS_OUT];
+ size_t nparams;
+ unsigned int filterid;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_var_szip(ncid, varid, &option_mask_in, &pixels_per_block_in))
+ ERR;
+ if (p < FIRST_VALID)
+ {
+ if (option_mask_in) ERR;
+ }
+ else
+ {
+ if (!(option_mask[m] & option_mask_in)) ERR;
+ }
+
+ /* Also check using nc_inq_var_filter */
+ ret = nc_inq_var_filter(ncid, varid, &filterid, &nparams, params_in);
+ if (p < FIRST_VALID) {
+ if(ret != NC_ENOFILTER) ERR;
+ }
+ else
+ {
+ if (filterid != H5_FILTER_SZIP || nparams != 2) ERR;
+ /* According to H5Zszip, the mapping should be as follows */
+ if(params_in[0] != option_mask_in) ERR;
+ if(params_in[1] != pixels_per_block_in) ERR;
+ }
+ if (nc_close(ncid)) ERR;
+ }
+ } /* next PPB */
+ } /* next mask */
+ }
+ SUMMARIZE_ERR;
+#else
+ /* This code is run if szip is not present in HDF5. It checks that
+ * nc_def_var_szip() returns NC_EFILTER in that case. */
+ printf("**** testing szip handling when szip not built...");
+ {
+ int ncid;
+ int dimid;
+ int varid;
+ unsigned int params[NUM_PARAMS_IN];
+
+ /* Create a netcdf-4 file with one dimensions. */
+ if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME_1, DIM_LEN_1, &dimid)) ERR;
+
+ /* Add a var. Try to turn on szip filter, but it will return
+ * error. */
+ if (nc_def_var(ncid, V_SMALL, NC_INT64, NDIMS1, &dimid, &varid)) ERR;
+ params[0] = NC_SZIP_NN; /* options_mask */
+ params[1] = NC_SZIP_EC_BPP_IN; /* pixels_per_block */
+ if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, NULL)) ERR;
+ if (nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN,
+ params) != NC_EFILTER) ERR;
+ if (nc_def_var_szip(ncid, varid, NC_SZIP_NN,
+ NC_SZIP_EC_BPP_IN) != NC_EFILTER) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
#endif /* USE_SZIP */
- FINAL_RESULTS;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_vars4.c netcdf-parallel-4.7.4/nc_test4/tst_vars4.c
--- netcdf-parallel-4.7.3/nc_test4/tst_vars4.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_vars4.c 2020-08-31 10:33:26.000000000 +0000
@@ -10,220 +10,310 @@
#include "err_macros.h"
#define FILE_NAME "tst_vars4.nc"
-#define NDIMS2 2
+#define NDIM2 2
#define NUM_VARS 1
#define Y_NAME "y"
#define X_NAME "x"
+#define Z_NAME "z"
#define VAR_NAME Y_NAME
#define XDIM_LEN 2
#define YDIM_LEN 5
+#define ZDIM_LEN 8193
#define CLAIR "Clair"
#define JAMIE "Jamie"
int
main(int argc, char **argv)
{
- printf("\n*** Testing netcdf-4 variable functions, even more.\n");
- printf("**** testing Jeff's dimension problem...");
- {
- int varid, ncid, dims[NDIMS2], dims_in[NDIMS2];
- int ndims, nvars, ngatts, unlimdimid, natts;
- char name_in[NC_MAX_NAME + 1];
- nc_type type_in;
- size_t len_in;
-
- if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
- if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
- if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != NUM_VARS || ndims != NDIMS2 || ngatts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_var(ncid, 0, name_in, &type_in, &ndims, dims_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME) || type_in != NC_FLOAT || ndims != NDIMS2 ||
- dims_in[0] != dims[0] || dims_in[1] != dims[1] || natts != 0) ERR;
- if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
- if (strcmp(name_in, X_NAME) || len_in != XDIM_LEN) ERR;
- if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
- if (strcmp(name_in, Y_NAME)) ERR;
- if (len_in != YDIM_LEN) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
- if (nvars != NUM_VARS || ndims != NDIMS2 || ngatts != 0 || unlimdimid != -1) ERR;
- if (nc_inq_var(ncid, 0, name_in, &type_in, &ndims, dims_in, &natts)) ERR;
- if (strcmp(name_in, VAR_NAME) || type_in != NC_FLOAT || ndims != NDIMS2 ||
- dims_in[0] != dims[0] || dims_in[1] != dims[1] || natts != 0) ERR;
- if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
- if (strcmp(name_in, X_NAME) || len_in != XDIM_LEN) ERR;
- if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
- if (strcmp(name_in, Y_NAME)) ERR;
- if (len_in != YDIM_LEN) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing chunking turned on by fletcher...");
- {
- int varid, ncid, dims[NDIMS2];
- int storage_in;
- size_t chunksizes_in[NDIMS2];
-
- if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
- if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
- if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
- if (nc_def_var_fletcher32(ncid, varid, NC_FLETCHER32)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
- if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
- if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing chunking turned on by shuffle...");
- {
- int varid, ncid, dims[NDIMS2];
- int storage_in;
- size_t chunksizes_in[NDIMS2];
-
- if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
- if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
- if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
- if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
- if (nc_def_var_deflate(ncid, varid, NC_SHUFFLE, 0, 0)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
- if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
- if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
+ printf("\n*** Testing netcdf-4 variable functions, even more.\n");
+ printf("**** testing Jeff's dimension problem...");
+ {
+ int varid, ncid, dims[NDIM2], dims_in[NDIM2];
+ int ndims, nvars, ngatts, unlimdimid, natts;
+ char name_in[NC_MAX_NAME + 1];
+ nc_type type_in;
+ size_t len_in;
+
+ if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
+ if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
+ if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != NUM_VARS || ndims != NDIM2 || ngatts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &type_in, &ndims, dims_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME) || type_in != NC_FLOAT || ndims != NDIM2 ||
+ dims_in[0] != dims[0] || dims_in[1] != dims[1] || natts != 0) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (strcmp(name_in, X_NAME) || len_in != XDIM_LEN) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (strcmp(name_in, Y_NAME)) ERR;
+ if (len_in != YDIM_LEN) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &ngatts, &unlimdimid)) ERR;
+ if (nvars != NUM_VARS || ndims != NDIM2 || ngatts != 0 || unlimdimid != -1) ERR;
+ if (nc_inq_var(ncid, 0, name_in, &type_in, &ndims, dims_in, &natts)) ERR;
+ if (strcmp(name_in, VAR_NAME) || type_in != NC_FLOAT || ndims != NDIM2 ||
+ dims_in[0] != dims[0] || dims_in[1] != dims[1] || natts != 0) ERR;
+ if (nc_inq_dim(ncid, 0, name_in, &len_in)) ERR;
+ if (strcmp(name_in, X_NAME) || len_in != XDIM_LEN) ERR;
+ if (nc_inq_dim(ncid, 1, name_in, &len_in)) ERR;
+ if (strcmp(name_in, Y_NAME)) ERR;
+ if (len_in != YDIM_LEN) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing chunking turned on by fletcher...");
+ {
+ int varid, ncid, dims[NDIM2];
+ int storage_in;
+ size_t chunksizes_in[NDIM2];
+
+ if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
+ if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
+ if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
+ if (nc_def_var_fletcher32(ncid, varid, NC_FLETCHER32)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
+ if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
+ if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing chunking turned on by shuffle...");
+ {
+ int varid, ncid, dims[NDIM2];
+ int storage_in;
+ size_t chunksizes_in[NDIM2];
+
+ if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
+ if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dims[0])) ERR;
+ if (nc_def_dim(ncid, Y_NAME, YDIM_LEN, &dims[1])) ERR;
+ if (nc_def_var(ncid, VAR_NAME, NC_FLOAT, 2, dims, &varid)) ERR;
+ if (nc_def_var_deflate(ncid, varid, NC_SHUFFLE, 0, 0)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
+ if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, chunksizes_in)) ERR;
+ if (chunksizes_in[0] != XDIM_LEN || chunksizes_in[1] != YDIM_LEN) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
#define DIM_NAME "Distance_from_Mayo"
#define VAR_NAME_2 "Rocky_Road_to_Dublin"
#define NDIMS1 1
#define NUM_RECORDS 3
- printf("**** testing extending var along unlimited dim with no coord var...");
- {
- int varid, ncid, dimid;
- int ndims, nvars, natts, unlimdimid;
- size_t dim_len_in, index;
- int data = TEST_VAL_42;
-
- /* Create the test file with one var, one unlimited dim. */
- if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
- if (nc_def_dim(ncid, DIM_NAME, NC_UNLIMITED, &dimid)) ERR;
- if (nc_def_var(ncid, VAR_NAME_2, NC_INT, NDIMS1, &dimid, &varid)) ERR;
-
- /* Write some records. */
- for (index = 0; index < NUM_RECORDS; index++)
- if (nc_put_var1_int(ncid, varid, &index, &data)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != 1 || nvars != 1 || natts != 0 || unlimdimid != 0) ERR;
- if (nc_inq_dim(ncid, dimid, NULL, &dim_len_in)) ERR;
- if (dim_len_in != NUM_RECORDS) ERR;
-
- /* Now add more records. */
- for (index = 3; index < NUM_RECORDS * 2; index++)
- if (nc_put_var1_int(ncid, varid, &index, &data)) ERR;
- if (nc_inq_dim(ncid, dimid, NULL, &dim_len_in)) ERR;
-
- if (dim_len_in != NUM_RECORDS * 2) ERR;
-
- /* Close the file. */
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing type creation and destruction for atomic types...");
- {
- int varid1, varid2, ncid;
- int ndims, nvars, natts, unlimdimid;
-
- /* Create the test file with two scalar vars. */
- /* nc_set_log_level(4); */
- if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
- if (nc_def_var(ncid, CLAIR, NC_INT, 0, NULL, &varid1)) ERR;
- if (nc_def_var(ncid, JAMIE, NC_INT, 0, NULL, &varid2)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != 0 || nvars != 2 || natts != 0 || unlimdimid != -1) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing scalar big endian vars...");
- {
- int varid1, varid2, ncid;
- int ndims, nvars, natts, unlimdimid;
- int test_val = TEST_VAL_42;
- int test_val2 = TEST_VAL_42 * 2;
- int data_in;
-
- /* Create the test file with two scalar vars. */
- if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
- if (nc_def_var(ncid, CLAIR, NC_INT, 0, NULL, &varid1)) ERR;
- if (nc_def_var_endian(ncid, varid1, NC_ENDIAN_BIG)) ERR;
- if (nc_def_var(ncid, JAMIE, NC_INT, 0, NULL, &varid2)) ERR;
- if (nc_def_var_endian(ncid, varid2, NC_ENDIAN_BIG)) ERR;
- if (nc_enddef(ncid)) ERR;
- if (nc_put_var(ncid, varid1, &test_val)) ERR;
- if (nc_put_var(ncid, varid2, &test_val2)) ERR;
- if (nc_close(ncid)) ERR;
-
- /* Open the file and check. */
- if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
- if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
- if (ndims != 0 || nvars != 2 || natts != 0 || unlimdimid != -1) ERR;
- if (nc_get_var(ncid, varid1, &data_in)) ERR;
- if (data_in != TEST_VAL_42) ERR;
- if (nc_get_var(ncid, varid2, &data_in)) ERR;
- if (data_in != TEST_VAL_42 * 2) ERR;
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- printf("**** testing scalar big endian vars...");
- {
- int ncid, enumid;
- int bigid, littleid;
- int endian_in;
- /* Note: if no zero valued enum, then causes ncdump error */
- int econst0 = 0;
- int econst1 = 1;
-
- if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLOBBER, &ncid)) ERR;
-
- if (nc_def_enum(ncid, NC_INT, "enum_t", &enumid)) ERR;
- if (nc_insert_enum(ncid, enumid, "econst0", &econst0)) ERR;
- if (nc_insert_enum(ncid, enumid, "econst1", &econst1)) ERR;
-
- if (nc_def_var(ncid, "little", enumid, 0, NULL, &littleid)) ERR;
- if (nc_def_var(ncid, "big", enumid, 0, NULL, &bigid)) ERR;
-
- if (nc_def_var_endian(ncid, littleid, NC_ENDIAN_LITTLE) != NC_EINVAL) ERR;
- if (nc_def_var_endian(ncid, bigid, NC_ENDIAN_BIG) != NC_EINVAL) ERR;
-
- /* Note that it is important to set endian ness before testing it */
- if (nc_inq_var_endian(ncid, littleid, &endian_in)) ERR;
- if (endian_in) ERR;
- if (nc_inq_var_endian(ncid, bigid, &endian_in)) ERR;
- if (endian_in) ERR;
-
- if (nc_close(ncid)) ERR;
- }
- SUMMARIZE_ERR;
- FINAL_RESULTS;
+ printf("**** testing extending var along unlimited dim with no coord var...");
+ {
+ int varid, ncid, dimid;
+ int ndims, nvars, natts, unlimdimid;
+ size_t dim_len_in, index;
+ int data = TEST_VAL_42;
+
+ /* Create the test file with one var, one unlimited dim. */
+ if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
+ if (nc_def_dim(ncid, DIM_NAME, NC_UNLIMITED, &dimid)) ERR;
+ if (nc_def_var(ncid, VAR_NAME_2, NC_INT, NDIMS1, &dimid, &varid)) ERR;
+
+ /* Write some records. */
+ for (index = 0; index < NUM_RECORDS; index++)
+ if (nc_put_var1_int(ncid, varid, &index, &data)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != 1 || nvars != 1 || natts != 0 || unlimdimid != 0) ERR;
+ if (nc_inq_dim(ncid, dimid, NULL, &dim_len_in)) ERR;
+ if (dim_len_in != NUM_RECORDS) ERR;
+
+ /* Now add more records. */
+ for (index = 3; index < NUM_RECORDS * 2; index++)
+ if (nc_put_var1_int(ncid, varid, &index, &data)) ERR;
+ if (nc_inq_dim(ncid, dimid, NULL, &dim_len_in)) ERR;
+
+ if (dim_len_in != NUM_RECORDS * 2) ERR;
+
+ /* Close the file. */
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing type creation and destruction for atomic types...");
+ {
+ int varid1, varid2, ncid;
+ int ndims, nvars, natts, unlimdimid;
+
+ /* Create the test file with two scalar vars. */
+ /* nc_set_log_level(4); */
+ if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
+ if (nc_def_var(ncid, CLAIR, NC_INT, 0, NULL, &varid1)) ERR;
+ if (nc_def_var(ncid, JAMIE, NC_INT, 0, NULL, &varid2)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != 0 || nvars != 2 || natts != 0 || unlimdimid != -1) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing scalar big endian vars...");
+ {
+ int varid1, varid2, ncid;
+ int ndims, nvars, natts, unlimdimid;
+ int test_val = TEST_VAL_42;
+ int test_val2 = TEST_VAL_42 * 2;
+ int data_in;
+
+ /* Create the test file with two scalar vars. */
+ if (nc_create(FILE_NAME, NC_NETCDF4 | NC_CLOBBER, &ncid)) ERR;
+ if (nc_def_var(ncid, CLAIR, NC_INT, 0, NULL, &varid1)) ERR;
+ if (nc_def_var_endian(ncid, varid1, NC_ENDIAN_BIG)) ERR;
+ if (nc_def_var(ncid, JAMIE, NC_INT, 0, NULL, &varid2)) ERR;
+ if (nc_def_var_endian(ncid, varid2, NC_ENDIAN_BIG)) ERR;
+ if (nc_enddef(ncid)) ERR;
+ if (nc_put_var(ncid, varid1, &test_val)) ERR;
+ if (nc_put_var(ncid, varid2, &test_val2)) ERR;
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check. */
+ if (nc_open(FILE_NAME, NC_WRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
+ if (ndims != 0 || nvars != 2 || natts != 0 || unlimdimid != -1) ERR;
+ if (nc_get_var(ncid, varid1, &data_in)) ERR;
+ if (data_in != TEST_VAL_42) ERR;
+ if (nc_get_var(ncid, varid2, &data_in)) ERR;
+ if (data_in != TEST_VAL_42 * 2) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing scalar big endian vars...");
+ {
+ int ncid, enumid;
+ int bigid, littleid;
+ int endian_in;
+ /* Note: if no zero valued enum, then causes ncdump error */
+ int econst0 = 0;
+ int econst1 = 1;
+
+ if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLOBBER, &ncid)) ERR;
+
+ if (nc_def_enum(ncid, NC_INT, "enum_t", &enumid)) ERR;
+ if (nc_insert_enum(ncid, enumid, "econst0", &econst0)) ERR;
+ if (nc_insert_enum(ncid, enumid, "econst1", &econst1)) ERR;
+
+ if (nc_def_var(ncid, "little", enumid, 0, NULL, &littleid)) ERR;
+ if (nc_def_var(ncid, "big", enumid, 0, NULL, &bigid)) ERR;
+
+ if (nc_def_var_endian(ncid, littleid, NC_ENDIAN_LITTLE) != NC_EINVAL) ERR;
+ if (nc_def_var_endian(ncid, bigid, NC_ENDIAN_BIG) != NC_EINVAL) ERR;
+
+ /* Note that it is important to set endian ness before testing it */
+ if (nc_inq_var_endian(ncid, littleid, &endian_in)) ERR;
+ if (endian_in) ERR;
+ if (nc_inq_var_endian(ncid, bigid, &endian_in)) ERR;
+ if (endian_in) ERR;
+
+ if (nc_close(ncid)) ERR;
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing compact storage with one scalar var...");
+ {
+ int ncid, varid;
+ int storage_in;
+ int data = TEST_VAL_42;
+
+ /* Create a file with one var which is compact scalar. */
+ if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLOBBER, &ncid)) ERR;
+
+ /* Define a scalar. Scalars can also be compact. */
+ if (nc_def_var(ncid, JAMIE, NC_INT, 0, NULL, &varid)) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_COMPACT, NULL)) ERR;
+
+ /* Write data. */
+ if (nc_put_var_int(ncid, varid, &data)) ERR;
+
+ /* Close file. */
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check it. */
+ {
+ int ndims, nvars;
+
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, NULL, NULL)) ERR;
+ if (ndims != 0 || nvars != 1) ERR;
+ if (nc_inq_var_chunking(ncid, 0, &storage_in, NULL)) ERR;
+ if (storage_in != NC_COMPACT) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ }
+ SUMMARIZE_ERR;
+ printf("**** testing compact storage...");
+ {
+ int ncid, dimid[NDIM2], varid, varid2, varid3;
+ int data[XDIM_LEN];
+ int storage_in;
+ int x;
+
+ /* Create some data. */
+ for (x = 0; x < XDIM_LEN; x++)
+ data[x] = x;
+
+ /* Create a file with one var with compact storage. */
+ if (nc_create(FILE_NAME, NC_NETCDF4|NC_CLOBBER, &ncid)) ERR;
+
+ /* Define dims. */
+ if (nc_def_dim(ncid, X_NAME, XDIM_LEN, &dimid[0])) ERR;
+ if (nc_def_dim(ncid, Z_NAME, ZDIM_LEN, &dimid[1])) ERR;
+
+ /* Define vars1 to be compact. */
+ if (nc_def_var(ncid, Y_NAME, NC_INT, 1, dimid, &varid)) ERR;
+ if (nc_def_var_chunking(ncid, varid, NC_COMPACT, NULL)) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, NULL)) ERR;
+ if (storage_in != NC_COMPACT) ERR;
+
+ /* Define var2 - it's too big for compact. */
+ if (nc_def_var(ncid, CLAIR, NC_INT, NDIM2, dimid, &varid2)) ERR;
+ /* This won't work, the var is too big for compact! */
+ if (nc_def_var_chunking(ncid, varid2, NC_COMPACT, NULL) != NC_EVARSIZE) ERR;
+
+ /* Define var3, a scalar. Scalars can also be compact. */
+ if (nc_def_var(ncid, JAMIE, NC_INT, 0, NULL, &varid3)) ERR;
+ if (nc_def_var_chunking(ncid, varid3, NC_COMPACT, NULL)) ERR;
+
+ /* Write data. */
+ if (nc_put_var_int(ncid, varid3, data)) ERR;
+
+ /* Close file. */
+ if (nc_close(ncid)) ERR;
+
+ /* Open the file and check it. */
+ {
+ int ndims, nvars;
+ int storage_in;
+ if (nc_open(FILE_NAME, NC_NOWRITE, &ncid)) ERR;
+ if (nc_inq(ncid, &ndims, &nvars, NULL, NULL)) ERR;
+ if (ndims != 2 || nvars != 3) ERR;
+ if (nc_inq_var_chunking(ncid, varid, &storage_in, NULL)) ERR;
+ if (storage_in != NC_COMPACT) ERR;
+ if (nc_inq_var_chunking(ncid, varid2, &storage_in, NULL)) ERR;
+ if (storage_in != NC_CONTIGUOUS) ERR;
+ if (nc_inq_var_chunking(ncid, varid3, &storage_in, NULL)) ERR;
+ if (storage_in != NC_COMPACT) ERR;
+ if (nc_close(ncid)) ERR;
+ }
+ }
+ SUMMARIZE_ERR;
+ FINAL_RESULTS;
}
diff -Nru netcdf-parallel-4.7.3/nc_test4/tst_xplatform2.c netcdf-parallel-4.7.4/nc_test4/tst_xplatform2.c
--- netcdf-parallel-4.7.3/nc_test4/tst_xplatform2.c 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/nc_test4/tst_xplatform2.c 2020-08-31 10:33:26.000000000 +0000
@@ -564,7 +564,11 @@
hid_t file_typeid1[NUM_OBJ], native_typeid1[NUM_OBJ];
hid_t file_typeid2, native_typeid2;
hsize_t num_obj, i;
+#if H5_VERSION_GE(1,12,0)
+ H5O_info2_t obj_info;
+#else
H5O_info_t obj_info;
+#endif
char obj_name[NC_MAX_NAME + 1];
/* Open one of the netCDF test files. */
@@ -579,8 +583,13 @@
for (i = 0; i < num_obj; i++)
{
/* Get the name. */
+#if H5_VERSION_GE(1,12,0)
+ if (H5Oget_info_by_idx3(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
+ i, &obj_info, H5O_INFO_BASIC, H5P_DEFAULT) < 0) ERR_RET;
+#else
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i, &obj_info, H5P_DEFAULT) < 0) ERR_RET;
+#endif
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_NAME, H5_ITER_INC, i,
obj_name, NC_MAX_NAME + 1, H5P_DEFAULT) < 0) ERR_RET;
printf(" reading type %s ", obj_name);
diff -Nru netcdf-parallel-4.7.3/netCDFConfig.cmake.in netcdf-parallel-4.7.4/netCDFConfig.cmake.in
--- netcdf-parallel-4.7.3/netCDFConfig.cmake.in 2020-02-17 11:55:18.000000000 +0000
+++ netcdf-parallel-4.7.4/netCDFConfig.cmake.in 2020-08-31 10:33:26.000000000 +0000
@@ -9,7 +9,7 @@
set_and_check(netCDF_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(netCDF_LIB_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
-set(netCDF_LIBRARIES netcdf)
+set(netCDF_LIBRARIES netCDF::netcdf)
# include target information
include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake")
diff -Nru netcdf-parallel-4.7.3/NUG/bestpractices.md netcdf-parallel-4.7.4/NUG/bestpractices.md
--- netcdf-parallel-4.7.3/NUG/bestpractices.md 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/NUG/bestpractices.md 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,353 @@
+Writing NetCDF Files: Best Practices {#BestPractices}
+====================================
+
+[TOC]
+
+Best Practices {#bp_Best_Practices}
+=====================================
+
+## Conventions {#bp_Conventions}
+
+While netCDF is intended for "self-documenting data", it is often
+necessary for data writers and readers to agree upon attribute
+conventions and representations for discipline-specific data structures.
+These agreements are written up as human readable documents called
+***netCDF conventions***.
+
+Use an existing Convention if possible. See the list of [registered
+conventions](/software/netcdf/conventions.html).
+
+The CF Conventions are recommended where applicable, especially for
+gridded (model) datasets.
+
+Document the convention you are using by adding the global attribute
+"Conventions" to each netCDF file, for example:
+
+This document refers to conventions for the netCDF *classic* data model.
+For recommendations about conventions for the netCDF-4 *enhanced* data
+model, see [Developing Conventions for
+NetCDF-4](/netcdf/papers/nc4_conventions.html).
+
+## Coordinate Systems {#bp_Coordinate-Systems}
+
+A ***coordinate variable*** is a one-dimensional variable with the same
+name as a dimension, which names the coordinate values of the dimension.
+It must not have any missing data (for example, no `_FillValue` or
+`missing_value` attributes) and must be strictly monotonic (values
+increasing or decreasing). A two-dimensional variable of type char is a
+***string-valued coordinate variable*** if it has the same name as its
+first dimension, e.g.: **char time( time, time\_len);** all of its
+strings must be unique. A variable's ***coordinate system*** is the set
+of coordinate variables used by the variable. Coordinates that refer to
+physical space are called ***spatial coordinates***, ones that refer to
+physical time are called ***time coordinates***, ones that refer to
+either physical space or time are called ***spatio-temporal
+coordinates.***
+
+- Make coordinate variables for every dimension possible (except for
+ string length dimensions).
+- Give each coordinate variable at least `unit` and `long_name`
+ attributes to document its meaning.
+- Use an existing netCDF [Convention](#Conventions) for your
+ coordinate variables, especially to identify
+ spatio-temporal coordinates.
+- Use shared dimensions to indicate that two variables use the same
+ coordinates along that dimension. If two variables' dimensions are
+ not related, create separate dimensions for them, even if they
+ happen to have the same length.
+
+## Variable Grouping {#bp_Variable-Grouping}
+
+You may structure the data in a netCDF file in different ways, for
+example putting related parameters into a single variable by adding an
+extra dimension. Standard visualization and analysis software may have
+trouble breaking that data out, however. On the other extreme, it is
+possible to create different variables e.g. for different vertical
+levels of the same parameter. However, standard visualization and
+analysis software may have trouble grouping that data back together.
+Here are some guidelines for deciding how to group your data into
+variables:
+
+- All of the data in a variable must be of the same type and should
+ have the same units of measurement.
+- A variable's attributes should be applicable to all its data.
+- If possible, all of the coordinate variables should be
+ spatio-temporal, with no extra dimensions.
+- Use 4D spatio-temporal coordinate systems in preference to 3D. Use
+ 3D spatio-temporal coordinate systems in preference to 2D.
+- Vector valued (e.g. wind) parameters are legitimate uses of extra
+ dimensions. There are trade-offs between putting vectors in the same
+ variables vs. putting each component of a vector in a
+ different variable. Check that any visualization software you plan
+ to use can deal with the structure you choose.
+- Think in terms of complete coordinate systems (especially
+ spatio-temporal), and organize your data into variables accordingly.
+ Variables with the same coordinate system implicitly form a group.
+
+## Variable Attributes {#bp_Variable-Attributes}
+
+
+- For each variable where it makes sense, add a **units** attribute,
+ using the [udunits](/software/udunits/index.html) conventions,
+ if possible.
+- For each variable where it makes sense, add a **long\_name ****
+ attribute, which is a human-readable descriptive name for
+ the variable. This could be used for labeling plots, for example.
+
+## Strings and Variables of type char {#bp_Strings-and-Variables-of-type-char}
+
+NetCDF-3 does not have a primitive **String** type, but does have arrays
+of type **char**, which are 8 bits in size. The main difference is that
+Strings are variable length arrays of chars, while char arrays are fixed
+length. Software written in C usually depends on Strings being zero
+terminated, while software in Fortran and Java do not. Both C
+(*nc\_get\_vara\_text*) and Java (*ArrayChar.getString*) libraries have
+convenience routines that read char arrays and convert to Strings.
+
+- Do not use char type variables for numeric data, use byte type
+ variables instead.
+- Consider using a global Attribute instead of a Variable to store a
+ String applicable to the whole dataset.
+- When you want to store arrays of Strings, use a multidimensional
+ char array. All of the Strings will be the same length.
+- There are 3 strategies for writing variable length Strings and
+ zero-byte termination:
+ 1. *Fortran convention*: pad with blanks and never terminate with a
+ zero byte.
+ 2. *C convention*: pad with zeros and always terminate with a
+ zero byte.
+ 3. *Java convention*: You don't need to store a trailing zero byte,
+ but pad trailing unused characters with zero bytes.
+- When reading, trim zeros and blanks from the end of the char array
+ and if in C, add a zero byte terminator.
+
+## Calendar Date/Time {#bp_Calendar-Date-Time}
+
+Time as a fundamental unit means a time interval, measured in seconds. A
+Calendar date/time is a specific instance in real, physical time. Dates
+are specified as an interval from some ***reference time*** e.g. "days
+elapsed since Greenwich mean noon on 1 January 4713 BCE". The reference
+time implies a system of counting time called a ***calendar*** (e.g.
+Gregorian calendar) and a textual representation (e.g. [ISO
+8601](http://www.cl.cam.ac.uk/%7Emgk25/iso-time.html)).
+
+There are two strategies for storing a date/time into a netCDF variable.
+One is to encode it as a numeric value and a unit that includes the
+reference time, e.g. "seconds since 2001-1-1 0:0:0" or"days since
+2001-1-1 0:0:0" . The other is to store it as a String using a standard
+encoding and Calendar. The former is more compact if you have more than
+one date, and makes it easier to compute intervals between two dates.
+
+Unidata's [udunits](/software/udunits/) package provides a convenient
+way to implement the first strategy. It uses the ISO 8601 encoding and a
+hybrid Gregorian/Julian calendar, but udunits does not support use of
+other Calendars or encodings for the reference time. However the ncdump
+"-T" option can display numeric times that use udunits (and optionally
+climate calendars) as ISO 8601 strings that are easy for humans to
+interpret.
+
+- If your data uses real, physical time that is well represented using
+ the Gregorian/Julian calendar, encode it as an interval from a
+ reference time, and add a units attribute which uses a
+ udunits-compatible time unit. If the data assumes one of the
+ non-standard calendars mentioned in the CF Conventions, specify that
+ with a Calendar attribute. Readers can then use the udunits package
+ to manipulate or format the date values, and the ncdump utility can
+ display them with either numeric or string representation.
+- If your data uses a calendar not supported by the CF Conventions,
+ make it compatible with existing date manipulation packages if
+ possible (for example, java.text.SimpleDateFormat).
+- Add multiple sets of time encodings if necessary to allow different
+ readers to work as well as possible.\
+
+## Unsigned Data {#bp_Unsigned-Data}
+
+NetCDF-3 does not have unsigned integer primitive types.
+
+- To be completely safe with unknown readers, widen the data type, or
+ use floating point.
+- You can use the corresponding signed types to store unsigned data
+ only if all client programs know how to interpret this correctly.
+- A new proposed convention is to create a variable attribute
+ `_Unsigned = "true"` to indicate that integer data should be treated
+ as unsigned.
+
+## Packed Data Values {#bp_Packed-Data-Values}
+
+Packed data is stored in a netCDF file by limiting precision and using a
+smaller data type than the original data, for example, packing
+double-precision (64-bit) values into short (16-bit) integers. The
+C-based netCDF libraries do not do the packing and unpacking. (The
+[netCDF Java library](/software/netcdf-java/) will do automatic
+unpacking when the
+[VariableEnhanced](/software/netcdf-java/v4.1/javadocAll/ucar/nc2/dataset/VariableEnhanced.html)
+Interface is used. For details see
+[EnhancedScaleMissing](/software/netcdf-java/v4.1/javadocAll/ucar/nc2/dataset/EnhanceScaleMissing.html)).
+
+- Each variable with packed data has two attributes called
+ **scale\_factor** and **add\_offset**, so that the packed data may
+ be read and unpacked using the formula:
+
+ > ***unpacked\_data\_value = packed\_data\_value \* scale\_factor +
+ > add\_offset***
+
+- The type of the stored variable is the packed data type, typically
+ byte, short or int.
+- The type of the scale\_factor and add\_offset attributes should be
+ the type that you want the unpacked data to be, typically float
+ or double.
+- To avoid introducing a bias into the unpacked values due to
+ truncation when packing, the data provider should round to the
+ nearest integer rather than just truncating towards zero before
+ writing the data:
+
+ > ***packed\_data\_value = nint((unpacked\_data\_value -
+ > add\_offset) / scale\_factor)***
+
+Depending on whether the packed data values are intended to be
+interpreted by the reader as signed or unsigned integers, there are
+alternative ways for the data provider to compute the *scale\_factor*
+and *add\_offset* attributes. In either case, the formulas above apply
+for unpacking and packing the data.
+
+A conventional way to indicate whether a byte, short, or int variable is
+meant to be interpreted as unsigned, even for the netCDF-3 classic model
+that has no external unsigned integer type, is by providing the special
+variable attribute `_Unsigned` with value `"true"`. However, most
+existing data for which packed values are intended to be interpreted as
+unsigned are stored without this attribute, so readers must be aware of
+packing assumptions in this case. In the enhanced netCDF-4 data model,
+packed integers may be declared to be of the appropriate unsigned type.
+
+Let *n* be the number of bits in the packed type, and assume *dataMin*
+and *dataMax* are the minimum and maximum values that will be used for a
+variable to be packed.
+
+- If the packed values are intended to be interpreted as signed
+ integers (the default assumption for classic model data), you may
+ use:
+
+ > *scale\_factor =(dataMax - dataMin) / (2^n^ - 1)*
+
+ > *add\_offset = dataMin + 2^n\\ -\\ 1^ \* scale\_factor*
+
+- If the packed values are intended to be interpreted as unsigned (for
+ example, when read in the C interface using the `nc_get_var_uchar()`
+ function), use:
+
+ > *scale\_factor =(dataMax - dataMin) / (2^n^ - 1)*
+
+ > *add\_offset = dataMin*
+
+- In either the signed or unsigned case, an alternate formula may be
+ used for the add\_offset and scale\_factor packing parameters that
+ reserves a packed value for a special value, such as an indicator of
+ missing data. For example, to reserve the minimum packed value
+ (-2^n\\ -\\ 1^) for use as a special value in the case of signed
+ packed values:
+
+ > *scale\_factor =(dataMax - dataMin) / (2^n^ - 2)*
+
+ > *add\_offset = (dataMax + dataMin) / 2*
+
+- If the packed values are unsigned, then the analogous formula that
+ reserves 0 as the packed form of a special value would be:
+
+ > *scale\_factor =(dataMax - dataMin) / (2^n^ - 2)*
+
+ > *add\_offset = dataMin - scale\_factor*
+
+- Example, packing 32-bit floats into 16-bit shorts:
+
+ variables:
+ short data( z, y, x);
+ data:scale_offset = 34.02f;
+ data:add_offset = 1.54f;
+
+- The `units` attribute applies to unpacked values.
+
+## Missing Data Values {#bp_Missing-Data-Values}
+
+***Missing data*** is a general name for data values that are invalid,
+never written, or missing. The netCDF library itself does not handle
+these values in any special way, except that the value of a `_FillValue`
+attribute, if any, is used in pre-filling unwritten data. (The
+Java-netCDF library will assist in recognizing these values when
+reading, see class **VariableStandardized**).
+
+- Default fill values for each type are available in the C-based
+ interfaces, and are defined in the appropriate header files. For
+ example, in the C interface, NC\_FILL\_FLOAT and NC\_FILL\_DOUBLE
+ are numbers near 9.9692e+36 that are returned when you try to read
+ values that were never written. Writing, reading, and testing for
+ equality with these default fill values works portably on the
+ platforms on which netCDF has been tested.
+- The `_FillValue` attribute should have the same data type as the
+ variable it describes. If the variable is packed using
+ `scale_factor` and `add_offset` attributes, the `_FillValue`
+ attribute should have the data type of the packed data.
+- Another way of indicating missing values for real type data is to
+ store an IEEE **NaN** floating point value. The advantage of this is
+ that any computation using a NaN results in a NaN. Client software
+ must know to look for NaNs, however, and detection of NaNs is
+ tricky, since any comparison with a NaN is required to return
+ *false*.
+ - In Java, you can use **Double.NaN** and **Float.NaN** constants.
+ - In many C compilers, you can generate a NaN value using **double
+ nan = 0.0 / 0.0;**
+- Alternatively or in addition, set the **valid\_range** attribute for
+ each variable that uses missing values, and make sure all valid data
+ is within that range, and all missing or invalid data is outside of
+ that range. Again, the client software must recognize and make use
+ of this information. Example:
+
+ variables:
+ float data( z, y, x);
+ data:valid_range = -999.0f, 999.0f;
+
+
+ If the variable is packed using `scale_factor` and `add_offset`
+ attributes, the `valid_range` attribute should have the data type of
+ the packed data.
+
+ If the variable is unsigned the `valid_range` values should be
+ widened if needed and stored as unsigned integers.
+
+## Miscellaneous tips {#bp_Miscellaneous-tips}
+
+- To define a file whose structure is known in advance, write a CDL
+ file and create the netCDF file using
+ [ncgen](/cgi-bin/man-cgi?ncgen). Then write the data into the netCDF
+ file using your program. This is typically much easier than
+ programming all of the create calls yourself.
+- For the netCDF classic or 64-bit-offset formats, it's possible to
+ reserve extra space in the file when it is created so that you can
+ later add additional attributes or non-record variables without
+ copying all the data. (This is not necessary for netCDF-4 files,
+ because metadata can be added efficiently to such files.) See the [C
+ man-page reference documentation](/cgi-bin/man-cgi?netcdf+-s3) (or
+ the [Fortran reference documentation](/cgi-bin/man-cgi?netcdf+-s3f))
+ for `nc__create` and `nc__enddef` (`nf__create` and `nf__enddef`
+ for Fortran) for more details on reserving extra space in
+ the header.
+
+## Spelling netCDF: Best Practices {#bp_Spelling-netCDF-Best-Practices}
+
+There are only 3 correct spellings of "netCDF":
+
+1. **netCDF:** The original spelling of the name of the data model,
+ API, and format. The acronym stands for network Common Data Form
+ (not Format), and the "CDF" part was capitalized in part to pay
+ homage to the NASA "CDF" data model which the netCDF data
+ model extended.
+2. **netcdf:** Used in certain file names, such as:
+
+ #include
+
+3. **NetCDF**: Used in titles and at the beginning of sentences, where
+ "netCDF" is awkward or violates style guidelines.
+
+All other forms, and most especially "Netcdf", are considered vulgar and
+a sign of ill-breeding or misspent youth, analogous to the egregious but
+common misspelling "JAVA" used by those who are new to the language or
+who mistakenly think it is an acronym.\
diff -Nru netcdf-parallel-4.7.3/NUG/cleanup.sh netcdf-parallel-4.7.4/NUG/cleanup.sh
--- netcdf-parallel-4.7.3/NUG/cleanup.sh 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/NUG/cleanup.sh 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+rm -rf html
+rm -rf latex
+rm -rf *~
+
diff -Nru netcdf-parallel-4.7.3/NUG/DAP2.dox netcdf-parallel-4.7.4/NUG/DAP2.dox
--- netcdf-parallel-4.7.3/NUG/DAP2.dox 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/NUG/DAP2.dox 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,676 @@
+/*!
+\page dap2 DAP2 Protocol Support
+
+\tableofcontents
+
+
+
+
+# DAP2 (OPeNDAP) Introduction {#dap2_intro}
+
+Beginning with netCDF version 4.1, optional support is provided for
+accessing data through servers supporting the DAP2 protocol.
+
+DAP2 support is enabled if the _--enable-dap__ option
+is used with _./configure_. If DAP2 support is enabled, then
+a usable version of _libcurl_ must be specified
+using the _LDFLAGS_ environment variable (similar to the way
+that the _HDF5_ libraries are referenced).
+Refer to the installation manual for details.
+By default DAP2 support is enabled if _libcurl_ is found.
+DAP2 support can be disabled using the _--disable-dap_.
+
+DAP2 uses a data model that is different from that supported by
+netCDF, either classic or enhanced. Generically, the DAP2
+meta-data is encoded textually in a _DDS_ (Dataset Descriptor
+Structure). There is a second textual object, the _DAS_ (Dataset
+Attribute Structure), for specifying DAP2 attributes. . For
+detailed information about the DAP2 DDS and DAS, refer to the
+OPeNDAP web site http://opendap.org.
+
+# Accessing DAP2 Data {#dap2_accessing_data}
+
+In order to access an OPeNDAP data source through the netCDF API, the
+file name normally used is replaced with a URL with a specific
+format. The URL is composed of three parts.
+- URL - this is a standard form URL such as
+ http://remotetest.unidata.ucar.edu/dts/test.01
+
+- Constraints - these are suffixed to the URL and take the form
+ “?\&\”. The meaning of the terms "projection"
+ and "selection" is somewhat complicated; and the OPeNDAP web site,
+ http://www.opendap.org, should be consulted. The interaction of DAP2
+ constraints with netCDF is complex and at the moment requires an
+ understanding of how DAP2 is translated to netCDF.
+
+- Client parameters - these may be specified in either of
+ two ways. The older, deprecated form prefixes text to the
+ front of the url and is of the the general form [\]
+ or [\=value]. Examples include [show=fetch] and
+ [noprefetch]. The newer, preferred form prefixes the
+ parameters to the end of the url using the semi-standard '#'
+ format: e.g. http://....#show=fetch&noprefetch.
+
+It is possible to see what the translation does to a particular
+DAP2 data source by examining the DDS source through a web
+browser and then examining the translation using the _ncdump -h_
+command to see the netCDF Classic translation. The ncdump output
+will actually be the union of the DDS with the DAS, so to see
+the complete translation, it is necessary to view both via the
+browser.
+
+For example, if a web browser is given the following, the first URL
+will return the DDS for the specified dataset, and the second URL will
+return the DAS for the specified dataset.
+````
+ http://remotetest.unidata.ucar.edu/dts/test.01.dds
+ http://remotetest.unidata.ucar.edu/dts/test.01.das
+````
+
+Then by using the following ncdump command, it is possible to see the
+equivalent netCDF Classic translation.
+````
+ ncdump -h http://remotetest.unidata.ucar.edu/dts/test.01
+````
+
+The DDS output from the web server should look like this.
+````
+Dataset {
+ Byte b;
+ Int32 i32;
+ UInt32 ui32;
+ Int16 i16;
+ UInt16 ui16;
+ Float32 f32;
+ Float64 f64;
+ String s;
+ Url u;
+} SimpleTypes;
+````
+
+The DAS output from the web server should look like this.
+````
+Attributes {
+ Facility {
+ String PrincipleInvestigator ``Mark Abbott'', ``Ph.D'';
+ String DataCenter ``COAS Environmental Computer Facility'';
+ String DrifterType ``MetOcean WOCE/OCM'';
+ }
+ b {
+ String Description ``A test byte'';
+ String units ``unknown'';
+ }
+ i32 {
+ String Description ``A 32 bit test server int'';
+ String units ``unknown'';
+ }
+}
+````
+
+The output from ncdump should look like this.
+````
+netcdf test {
+dimensions:
+ stringdim64 = 64 ;
+variables:
+ byte b ;
+ b:Description = "A test byte" ;
+ b:units = "unknown" ;
+ int i32 ;
+ i32:Description = "A 32 bit test server int" ;
+ i32:units = "unknown" ;
+ int ui32 ;
+ short i16 ;
+ short ui16 ;
+ float f32 ;
+ double f64 ;
+ char s(stringdim64) ;
+ char u(stringdim64) ;
+}
+````
+
+Note that the fields of type String and type URL have suddenly
+acquired a dimension. This is because the netCDF model does
+not support strings, but DAP2 does support strings.
+So, DAP2 strings are translated to arrays
+of char, which requires adding an extra dimension. The size of the
+dimension is determined in a variety of ways and can be specified. It
+defaults to 64 and when read, the underlying string is either padded
+or truncated to that length.
+
+Also note that the "Facility" attributes do not appear in the
+translation because they are neither global nor associated with a
+variable in the DDS.
+
+# DAP2 to NetCDF Translation Rules {#dap2_to_netcdf}
+
+The netCDF library DAP2 support code translate the DAP2 data model
+into the netCDF classic (netCDF-3) data model.
+
+## netCDF-3 Translation Rules {#dap2_nc32_trans_rules}
+
+The netCDF-3 translation is designed to mimic as closely as
+possible the translation provided by the now obsolete libnc-dap2
+system, except that some errors in that older translation have
+been fixed.
+
+For illustrative purposes, the following example will be used.
+````
+Dataset {
+ Int32 f1;
+ Structure {
+ Int32 f11;
+ Structure {
+ Int32 f1[3];
+ Int32 f2;
+ } FS2[2];
+ } S1;
+ Structure {
+ Grid {
+ Array:
+ Float32 temp[lat=2][lon=2];
+ Maps:
+ Int32 lat[lat=2];
+ Int32 lon[lon=2];
+ } G1;
+ } S2;
+ Grid {
+ Array:
+ Float32 G2[lat=2][lon=2];
+ Maps:
+ Int32 lat[2];
+ Int32 lon[2];
+ } G2;
+ Int32 lat[lat=2];
+ Int32 lon[lon=2];
+} D1;
+````
+
+## Variable Definition {#dap2_var2_def}
+
+The set of netCDF variables is derived from the fields with primitive
+base types as they occur in Sequences, Grids, and Structures. The
+field names are modified to be fully qualified initially. For the
+above, the set of variables are as follows. The coordinate variables
+within grids are left out in order to mimic the behavior of libnc-dap2.
+````
+ f1
+ S1.f11
+ S1.FS2.f1
+ S1.FS2.f2
+ S2.G1.temp
+ S2.G2.G2
+ lat
+ lon
+````
+
+## DAP2 Reserved Keywords {#dap2_reserved_keywords}
+
+In the OPeNDAP DAP2 protocol, there are a number of reserved keywords. These keywords are case insensitive and if you use one as a netCDF variable name, you may encounter odd behavior such as case changes (depending on the client DDS/DAS parser). The list of reserved keywords as used by the netCDF-C library parser are as follows:
+
+- alias
+- array
+- attributes
+- byte
+- dataset
+- error
+- float32
+- float64
+- grid
+- int16
+- int32
+- maps
+- sequence
+- string
+- structure
+- uint16
+- uint32
+- url
+- code
+- message
+- program_type
+- program
+
+
+## Variable Dimension Translation {#dap2_var_dim_trans}
+
+A variable's rank is determined from three sources.
+- The variable has the dimensions associated with the field it
+represents (e.g. S1.FS2.f1[3] in the above example).
+- The variable inherits the dimensions associated with any containing
+structure that has a rank greater than zero. These dimensions precede
+those of case 1. Thus, we have in our example, f1[2][3], where the
+first dimension comes from the containing Structure FS2[2].
+- The variable's set of dimensions are altered if any of its
+containers is a DAP2 DDS Sequence. This is discussed more fully below.
+
+If the type of the netCDF variable is char, then an extra string
+dimension is added as the last dimension.
+
+## Dimension translation {#dap2_dim2_trans}
+
+For dimensions, the rules are as follows.
+
+Fields in dimensioned structures inherit the dimension of the
+structure; thus the above list would have the following dimensioned
+variables.
+````
+ S1.FS2.f1 -> S1.FS2.f1[2][3]
+ S1.FS2.f2 -> S1.FS2.f2[2]
+ S2.G1.temp -> S2.G1.temp[lat=2][lon=2]
+ S2.G1.lat -> S2.G1.lat[lat=2]
+ S2.G1.lon -> S2.G1.lon[lon=2]
+ S2.G2.G2 -> S2.G2.lon[lat=2][lon=2]
+ S2.G2.lat -> S2.G2.lat[lat=2]
+ S2.G2.lon -> S2.G2.lon[lon=2]
+ lat -> lat[lat=2]
+ lon -> lon[lon=2]
+````
+
+Collect all of the dimension specifications from the DDS, both named
+and anonymous (unnamed) For each unique anonymous dimension with value
+NN create a netCDF dimension of the form "XX_\=NN", where XX is the
+fully qualified name of the variable and i is the i'th (inherited)
+dimension of the array where the anonymous dimension occurs. For our
+example, this would create the following dimensions.
+````
+ S1.FS2.f1_0 = 2 ;
+ S1.FS2.f1_1 = 3 ;
+ S1.FS2.f2_0 = 2 ;
+ S2.G2.lat_0 = 2 ;
+ S2.G2.lon_0 = 2 ;
+````
+
+If however, the anonymous dimension is the single dimension of a MAP
+vector in a Grid then the dimension is given the same name as the map
+vector This leads to the following.
+````
+ S2.G2.lat_0 -> S2.G2.lat
+ S2.G2.lon_0 -> S2.G2.lon
+````
+
+For each unique named dimension "=NN", create a netCDF dimension
+of the form "=NN", where name has the qualifications removed. If
+this leads to duplicates (i.e. same name and same value), then the
+duplicates are ignored. This produces the following.
+````
+ S2.G2.lat -> lat
+ S2.G2.lon -> lon
+````
+
+Note that this produces duplicates that will be ignored later.
+
+At this point the only dimensions left to process should be named
+dimensions with the same name as some dimension from step number 3,
+but with a different value. For those dimensions create a dimension of
+the form "M=NN" where M is a counter starting at 1. The example
+has no instances of this.
+
+Finally and if needed, define a single UNLIMITED dimension named
+"unlimited" with value zero. Unlimited will be used to handle certain
+kinds of DAP2 sequences (see below).
+
+This leads to the following set of dimensions.
+````
+dimensions:
+ unlimited = UNLIMITED;
+ lat = 2 ;
+ lon = 2 ;
+ S1.FS2.f1_0 = 2 ;
+ S1.FS2.f1_1 = 3 ;
+ S1.FS2.f2_0 = 2 ;
+````
+
+## Variable Name Translation {#dap2_var_name_trans}
+
+The steps for variable name translation are as follows.
+
+Take the set of variables captured above. Thus for the above DDS, the
+following fields would be collected.
+````
+ f1
+ S1.f11
+ S1.FS2.f1
+ S1.FS2.f2
+ S2.G1.temp
+ S2.G2.G2
+ lat
+ lon
+````
+
+All grid array variables are renamed to be the same as the containing
+grid and the grid prefix is removed. In the above DDS, this results in
+the following changes.
+````
+ G1.temp -> G1
+ G2.G2 -> G2
+````
+
+It is important to note that this process could produce duplicate
+variables (i.e. with the same name); in that case they are all assumed
+to have the same content and the duplicates are ignored. If it turns
+out that the duplicates have different content, then the translation
+will not detect this. YOU HAVE BEEN WARNED.
+
+The final netCDF-3 schema (minus attributes) is then as follows.
+````
+netcdf t {
+dimensions:
+ unlimited = UNLIMITED ;
+ lat = 2 ;
+ lon = 2 ;
+ S1.FS2.f1_0 = 2 ;
+ S1.FS2.f1_1 = 3 ;
+ S1.FS2.f2_0 = 2 ;
+variables:
+ int f1 ;
+ int lat(lat) ;
+ int lon(lon) ;
+ int S1.f11 ;
+ int S1.FS2.f1(S1.FS2.f1_0, S1.FS2.f1_1) ;
+ int S1.FS2.f2(S1_FS2_f2_0) ;
+ float S2.G1(lat, lon) ;
+ float G2(lat, lon) ;
+}
+````
+
+In practice, the unlimited dimension is dropped because it is unused.
+
+There are differences with the original libnc-dap2 here because
+libnc-dap2 technically was incorrect. The original would have said
+this, for example.
+````
+int S1.FS2.f1(lat, lat) ;
+````
+
+Note that this is incorrect because it dimensions S1.FS2.f1(2,2)
+rather than S1.FS2.f1(2,3).
+
+## Translating DAP2 DDS Sequences {#dap2_translation}
+
+Any variable (as determined above) that is contained directly or
+indirectly by a Sequence is subject to revision of its rank using the
+following rules.
+
+Let the variable be contained in Sequence Q1, where Q1 is the
+innermost containing sequence. If Q1 is itself contained (directly or
+indirectly) in a sequence, or Q1 is contained (again directly or
+indirectly) in a structure that has rank greater than 0, then the
+variable will have an initial UNLIMITED dimension. Further, all
+dimensions coming from "above" and including (in the containment
+sense) the innermost Sequence, Q1, will be removed and replaced by
+that single UNLIMITED dimension. The size associated with that
+UNLIMITED is zero, which means that its contents are inaccessible
+through the netCDF-3 API. Again, this differs from libnc-dap2, which
+leaves out such variables. Again, however, this difference is backward
+compatible.
+
+If the variable is contained in a single Sequence (i.e. not nested)
+and all containing structures have rank 0, then the variable will have
+an initial dimension whose size is the record count for that
+Sequence. The name of the new dimension will be the name of the
+Sequence.
+
+Consider this example.
+````
+Dataset {
+ Structure {
+ Sequence {
+ Int32 f1[3];
+ Int32 f2;
+ } SQ1;
+ } S1[2];
+ Sequence {
+ Structure {
+ Int32 x1[7];
+ } S2[5];
+ } Q2;
+} D;
+````
+
+The corresponding netCDF-3 translation is pretty much as follows (the
+value for dimension Q2 may differ).
+````
+dimensions:
+ unlimited = UNLIMITED ; // (0 currently)
+ S1.SQ1.f1_0 = 2 ;
+ S1.SQ1.f1_1 = 3 ;
+ S1.SQ1.f2_0 = 2 ;
+ Q2.S2.x1_0 = 5 ;
+ Q2.S2.x1_1 = 7 ;
+ Q2 = 5 ;
+variables:
+ int S1.SQ1.f1(unlimited, S1.SQ1.f1_1) ;
+ int S1.SQ1.f2(unlimited) ;
+ int Q2.S2.x1(Q2, Q2.S2.x1_0, Q2.S2.x1_1) ;
+````
+
+Note that for example S1.SQ1.f1_0 is not actually used because it has
+been folded into the unlimited dimension.
+
+Note that for sequences without a leading unlimited dimension, there
+is a performance cost because the translation code has to walk the
+data to determine how many records are associated with the
+sequence. Since libnc-dap2 did essentially the same thing, it can be
+assumed that the cost is not prohibitive.
+
+# Caching {#dap2_dap2_caching}
+
+In an effort to provide better performance for some access patterns,
+client-side caching of data is available. The default is no caching,
+but it may be enabled by prefixing the URL with the parameter "cache".
+
+Caching operates basically as follows.
+
+When a URL is first accessed using _nc_open()_, netCDF automatically
+does a pre-fetch of selected variables. These include all variables
+smaller than a specified (and user definable) size. This allows, for
+example, quick access to coordinate variables. This can be suppressed
+with the parameter "noprefetch".
+
+Whenever a request is made using some variant of the _nc_get_var()_ API
+procedures, the complete variable is fetched and stored in the cache
+as a new cache entry. Subsequence requests for any part of that
+variable will access the cache entry to obtain the data.
+
+The cache may become too full, either because there are too many
+entries or because it is taking up too much disk space. In this case
+cache entries are purged until the cache size limits are reached. The
+cache purge algorithm is LRU (least recently used) so that variables
+that are repeatedly referenced will tend to stay in the cache.
+
+The cache is completely purged when _nc_close()_ is invoked.
+
+In order to decide if you should enable caching, you will need to have
+some understanding of the access patterns of your program.
+
+The ncdump program always dumps one or more whole variables so it
+turns on caching.
+
+If your program accesses only parts of a number of variables, then
+caching should probably not be used since fetching whole variables
+will probably slow down your program for no purpose.
+
+Unfortunately, caching is currently an all or nothing proposition, so
+for more complex access patterns, the decision to cache or not may not
+have an obvious answer. Probably a good rule of thumb is to avoid
+caching initially and later turn it on to see its effect on
+performance.
+
+# Defined Client Parameters {#dap2_dap2_defined_params}
+
+Currently, a limited set of client parameters is
+recognized. Parameters not listed here are ignored, but no error is
+signalled. All names are case insensitive.
+
+Parameter Name Legal Values Semantics
+- "log" | "log=" - Turn on logging and send the log output to
+ the specified file. If no file is specified, then log output is sent
+ to standard error.
+- "show=... das|dds|url" - This causes information to appear as
+ specific global attributes. The currently recognized tags are "dds"
+ to display the underlying DDS, "das" similarly, and "url" to display
+ the url used to retrieve the data. This parameter may be specified
+ multiple times (e.g. “show=dds&show=url”).
+- "show=fetch" - This parameter causes the netCDF code to log a copy
+ of the complete url for every HTTP get request. If logging is
+ enabled, then this can be helpful in checking to see the access
+ behavior of the netCDF code.
+- "stringlength=NN" - Specify the default string length to use for
+ string dimensions. The default is 64. The name "maxstrlen" is an
+ alias for "stringlength".
+- "stringlength_\=NN" - Specify the default string length to use
+ for a string dimension for the specified variable. The default is
+ 64. The name "maxstrlen_\" is an alias for "stringlength_\".
+- "cache" - This enables caching.
+- "nocache" - This disbles caching.
+- "cachelimit=NN" - Specify the maximum amount of space allowed for
+ the cache.
+- "cachecount=NN" - Specify the maximum number of entries in the
+ cache.
+- "prefetch" - This enables prefetch of small variables (default).
+- "noprefetch" - This disables prefetch of small variables.
+- "fillmismatch" - This enables _FillValue/Variable type mismatch.
+- "nofillmismatch" - This disables _FillValue/Variable type mismatch (default).
+
+# Notes on Debugging OPeNDAP Access {#dap2_dap2_debug}
+
+The OPeNDAP support makes use of the logging facility of the
+underlying oc system (see http://www.OPeNDAP.org/oc).
+Note that this is currently separate from the
+existing netCDF logging facility. Turning on this logging can
+sometimes give important information. Logging can be enabled by
+using the client parameter "log" or "log=filename",
+where the first case will send log output to standard error and the
+second will send log output to the specified file.
+
+Users should also be aware that if one is
+accessing data over an NFS mount, one may see some .nfsxxxxx files;
+those can be ignored.
+
+## HTTP Configuration. {#dap2_http2_config}
+
+Limited support for configuring the http connection is provided via
+parameters in the “.dodsrc” configuration file. The relevant .dodsrc file is
+located by first looking in the current working directory, and if not
+found, then looking in the directory specified by the “$HOME”
+environment variable.
+
+Entries in the .dodsrc file are of the form:
+````
+ ['['']']=
+````
+
+That is, it consists of a key name and value pair and optionally
+preceded by a url enclosed in square brackets.
+
+For given KEY and URL strings, the value chosen is as follows:
+
+If URL is null, then look for the .dodsrc entry that has no url prefix
+and whose key is same as the KEY for which we are looking.
+
+If the URL is not null, then look for all the .dodsrc entries that
+have a url, URL1, say, and for which URL1 has the same host and port
+as URL. All parts of the url's except host and port are ignored.
+For example, if URL = http//x.y/a, then it will match
+entries of the form
+_[http//x.y/a]KEY=VALUE_ or _[http//x.y/b]KEY=VALUE_.
+It will not match an entry of the form _[http//x.y:8080]KEY=VALUE
+because the second has a port number (8080) different than the URL.
+Finally from the set so constructed, choose the first matching entry.
+
+Currently, the supported set of keys (with descriptions) are as
+follows.
+
+1. HTTP.VERBOSE
+ Type: boolean ("1"/"0")
+ Description: Produce verbose output, especially using SSL.
+ Related CURL Flags: CURLOPT_VERBOSE
+1. HTTP.DEFLATE
+ Type: boolean ("1"/"0")
+ Description: Allow use of compression by the server.
+ Related CURL Flags: CURLOPT_ENCODING
+1. HTTP.COOKIEJAR
+ Type: String representing file path
+ Description: Specify the name of file into which to store cookies. Defaults to in-memory storage.
+ Related CURL Flags:CURLOPT_COOKIEJAR
+1. HTTP.CREDENTIALS.USER
+ Type: String representing user name
+ Description: Specify the user name for Digest and Basic authentication.
+ Related CURL Flags:
+1. HTTP.CREDENTIALS.PASSWORD
+ Type: String representing password
+ Type: boolean ("1"/"0")
+ Description: Specify the password for Digest and Basic authentication.
+ Related CURL Flags:
+1. HTTP.SSL.CERTIFICATE
+ Type: String representing file path
+ Description: Path to a file containing a PEM cerficate.
+ Related CURL Flags: CURLOPT_CERT
+1. HTTP.SSL.KEY
+ Type: String representing file path
+ Description: Same as HTTP.SSL.CERTIFICATE, and should usually have the same value.
+ Related CURL Flags: CURLOPT_SSLKEY
+1. HTTP.SSL.KEYPASSWORD
+ Type: String representing password
+ Description: Password for accessing the HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE
+ Related CURL Flags: CURLOPT_KEYPASSWORD
+1. HTTP.SSL.CAPATH
+ Type: String representing directory
+ Description: Path to a directory containing trusted certificates for validating server certificates.
+ Related CURL Flags: CURLOPT_CAPATH
+1. HTTP.SSL.VALIDATE
+ Type: boolean ("1"/"0")
+ Description: Cause the client to verify the server's presented certificate.
+ Related CURL Flags: CURLOPT_SSL_VERIFYPEER, CURLOPT_SSL_VERIFYHOST
+1. HTTP.TIMEOUT
+ Type: String ("dddddd")
+ Description: Specify the maximum time in seconds that you allow the http transfer operation to take.
+ Related CURL Flags: CURLOPT_TIMEOUT, CURLOPT_NOSIGNAL, CURLOPT_CONNECTIONTIMEOUT
+1. HTTP.PROXY_SERVER
+ Type: String representing url to access the proxy: (e.g.http://[username:password@]host[:port])
+ Description: Specify the needed information for accessing a proxy.
+ Related CURL Flags: CURLOPT_PROXY, CURLOPT_PROXYHOST, CURLOPT_PROXYUSERPWD
+1. HTTP.READ.BUFFERSIZE
+ Type: String ("dddddd")
+ Description: Specify the the internal buffer size for curl reads.
+ Related CURL Flags: CURLOPT_BUFFERSIZE, CURL_MAX_WRITE_SIZE (16kB),
+ CURL_MAX_READ_SIZE (512kB).
+1. HTTP.KEEPALIVE
+ Type: String ("on|n/m")
+ Description: Specify that TCP KEEPALIVE should be enabled and that the associated idle wait time is n and that the associated repeat interval is m. If the value is of the form is the string "on", then turn on keepalive, but do not set idle or interval.
+ Related CURL Flags: CURLOPT_TCP_KEEPALIVE, CURLOPT_TCP_KEEPIDLE,
+ CURLOPT_TCP_KEEPINTVL.
+1. HTTP.CONNECTIONTIMEOUT
+ Type: String ("dddddd")
+ Description: Specify the maximum time in seconds that you allow the http connection to complete.
+ Related CURL Flags: CURLOPT_TIMEOUT, CURLOPT_NOSIGNAL
+
+The related curl flags line indicates the curl flags modified by this
+key. See the libcurl documentation of the _curl_easy_setopt()_ function
+for more detail (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html).
+
+For ESG client side key support, the following entries must be specified:
+````
+HTTP.SSL.VALIDATE
+HTTP.COOKIEJAR
+HTTP.SSL.CERTIFICATE
+HTTP.SSL.KEY
+HTTP.SSL.CAPATH
+````
+
+Additionally, for ESG, the _HTTP.SSL.CERTIFICATE_ and _HTTP.SSL.KEY_
+entries should have same value, which is the file path for the
+certificate produced by MyProxyLogon. The HTTP.SSL.CAPATH entry should
+be the path to the "certificates" directory produced by MyProxyLogon.
+
+# Point of Contact {#dap2_poc}
+
+__Author__: Dennis Heimbigner
+__Email__: dmh at ucar dot edu
+__Initial Version__: 3/26/2009
+__Last Revised__: 9/25/2018
+
+
+
+*/
diff -Nru netcdf-parallel-4.7.3/NUG/DAP4.dox netcdf-parallel-4.7.4/NUG/DAP4.dox
--- netcdf-parallel-4.7.3/NUG/DAP4.dox 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/NUG/DAP4.dox 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,259 @@
+/*!
+\page dap4 DAP4 Protocol Support
+
+
+
+
+
+\tableofcontents
+
+# DAP4 Introduction {#dap4_introduction}
+
+Beginning with netCDF version 4.5.0, optional support is provided for
+accessing data from servers supporting the DAP4 protocol.
+
+DAP4 support is enabled if the _--enable-dap_ option
+is used with './configure'. If DAP4 support is enabled, then
+a usable version of _libcurl_ must be specified
+using the _LDFLAGS_ environment variable (similar to the way
+that the _HDF5_ libraries are referenced).
+Refer to the installation manual for details.
+By default DAP4 support is enabled if _libcurl_ is found.
+DAP4 support can be disabled using the _--disable-dap_.
+
+DAP4 uses a data model that is, by design, similar to,
+but -- for historical reasons -- not identical with,
+the netCDF-Enhanced (aka netcdf-4) model.
+Generically, the DAP4 data model is encoded in XML document
+called a DMR.
+For detailed information about the DAP4 DMR, refer to
+the DAP4 specification Volume 1:
+http://docs.opendap.org/index.php/DAP4:_Specification_Volume_1
+
+# Accessing Data Using the DAP4 Prototocol {#dap4_accessing_data}
+
+In order to access a DAP4 data source through the netCDF API, the
+file name normally used is replaced with a URL with a specific
+format. The URL is composed of three parts.
+- URL - this is a standard form URL with specific markers to indicate that
+ it refers to a DAP4 encoded dataset. The markers are of the form
+ "dap4", "mode=dap4", or "/thredds/dap4". The following
+ examples show how they are specified. Note that the "/thredds/dap4"
+ case will only work when accessing a Thredds-based server.
+ + [dap4]http://remotetest.unidata.ucar.edu/d4ts/test.01
+ + [mode=dap4]http://remotetest.unidata.ucar.edu/d4ts/test.01
+ + http://remotetest.unidata.ucar.edu/d4ts/test.01#dap4
+ + http://remotetest.unidata.ucar.edu/d4ts/test.01#mode=dap4
+ + http://thredds.ucar.edu/thredds/dap4/...
+
+- Constraints - these are suffixed to the URL and take the form
+ “?dap4.ce=\”. The form of the constraint expression
+ is somewhat complicated, and the specification should be consulted.
+
+- Client parameters - these may be specified in either of
+ two ways. The older, deprecated form prefixes text to the
+ front of the url and is of the the general form [\]
+ or [\=value]. Examples include [show=fetch] or [noprefetch].
+ The newer, preferred form prefixes the
+ parameters to the end of the url using the semi-standard '#'
+ format: e.g. http://....#show=fetch&noprefetch.
+
+It is possible to see what the translation does to a particular DAP4
+data source in two steps. First, one can examine the DMR
+source through a web browser and then second, one can examine
+the translation using the "ncdump -h" command to see the
+corresponding netCDF-4 representation.
+
+For example, if a web browser is given the following (fictional) URL,
+it will return the DMR for the specified dataset (in XML format).
+\code
+ http://remotetest.unidata.ucar.edu/d4ts/test.01.dmr.xml#dap4
+\endcode
+
+By using the following ncdump command, it is possible to see the
+equivalent netCDF-4 translation.
+
+\code
+ ncdump -h '[dap4]http://remotetest.unidata.ucar.edu/d4ts/test.01'
+\endcode
+
+# Defined Client Parameters {#dap4_defined_params}
+
+Currently, a limited set of client parameters is
+recognized. Parameters not listed here are
+ignored, but no error is signalled.
+
+Parameter Name Legal Values Semantics
+- "log" | "log=" - Turn on logging and send the log output to
+ the specified file. If no file is specified, then output is sent to standard
+ error.
+- "show=fetch" - This parameter causes the netCDF code to log a copy
+ of the complete url for every HTTP get request. If logging is
+ enabled, then this can be helpful in checking to see the access
+ behavior of the netCDF code.
+- "translate=nc4" - This parameter causes the netCDF code to look
+ for specially named elements in the DMR XML in order to
+ achieve a better translation of the DAP4 meta-data to NetCDF enhanced
+ metadata.
+- "opaquesize=" - This parameter causes the netCDF code to
+ convert DAP4 variable size OPAQUE objects to netcdf-4 fixed size
+ objects and forces all of them to be of the size specified.
+- "fillmismatch" - Unfortunately, a number of servers sometimes
+ fail to make sure that the type of the "_FillValue" attribute of a variable
+ is the same as the type of the containing variable. Setting this tag
+ caused the netcdf translation to attempt to fix this mismatch. If not set,
+ then an error will occur.
+
+# Notes on Debugging DAP4 Access {#dap4_debug}
+
+The DAP4 support has a logging facility.
+Turning on this logging can
+sometimes give important information. Logging can be enabled by
+using the client parameter "log" or "log=filename",
+where the first case will send log output to standard error and the
+second will send log output to the specified file.
+
+Users should also be aware that if one is
+accessing data over an NFS mount, one may see some .nfsxxxxx files;
+those can be ignored.
+
+## HTTP Configuration. {#dap4_http2_config}
+
+Limited support for configuring the http connection is provided via
+parameters in the “.daprc” configuration file (aka ".dodsrc").
+The relevant .daprc file is
+located by first looking in the current working directory, and if not
+found, then looking in the directory specified by the “$HOME”
+environment variable.
+
+Entries in the .daprc file are of the form:
+````
+ ['['']']=
+````
+
+That is, it consists of a key name and value pair and optionally
+preceded by a url enclosed in square brackets.
+
+For given KEY and URL strings, the value chosen is as follows:
+
+If URL is null, then look for the .daprc entry that has no url prefix
+and whose key is same as the KEY for which we are looking.
+
+If the URL is not null, then look for all the .daprc entries that
+have a url, URL1, say, and for which URL1 has the same host and port
+as URL. All parts of the url's except host and port are ignored.
+For example, if URL = http//x.y/a, then it will match
+entries of the form
+_[http//x.y/a]KEY=VALUE_ or _[http//x.y/b]KEY=VALUE_.
+It will not match an entry of the form _[http//x.y:8080]KEY=VALUE
+because the second has a port number (8080) different than the URL.
+Finally from the set so constructed, choose the first matching entry.
+
+Currently, the supported set of keys (with descriptions) are as
+follows.
+
+-# HTTP.VERBOSE
+ Type: boolean ("1"/"0")
+ Description: Produce verbose output, especially using SSL.
+ Related CURL Flags: CURLOPT_VERBOSE
+
+-# HTTP.DEFLATE
+ Type: boolean ("1"/"0")
+ Description: Allow use of compression by the server.
+ Related CURL Flags: CURLOPT_ENCODING
+
+-# HTTP.COOKIEJAR
+ Type: String representing file path
+ Description: Specify the name of file into which to store cookies. Defaults to in-memory storage.
+ Related CURL Flags:CURLOPT_COOKIEJAR
+
+-# HTTP.CREDENTIALS.USER
+ Type: String representing user name
+ Description: Specify the user name for Digest and Basic authentication.
+ Related CURL Flags:
+
+-# HTTP.CREDENTIALS.PASSWORD
+ Type: String representing password
+ Type: boolean ("1"/"0")
+ Description: Specify the password for Digest and Basic authentication.
+ Related CURL Flags:
+
+-# HTTP.SSL.CERTIFICATE
+ Type: String representing file path
+ Description: Path to a file containing a PEM cerficate.
+ Related CURL Flags: CURLOPT_CERT
+
+-# HTTP.SSL.KEY
+ Type: String representing file path
+ Description: Same as HTTP.SSL.CERTIFICATE, and should usually have the same value.
+ Related CURL Flags: CURLOPT_SSLKEY
+
+-# HTTP.SSL.KEYPASSWORD
+ Type: String representing password
+ Description: Password for accessing the HTTP.SSL.KEY/HTTP.SSL.CERTIFICATE
+ Related CURL Flags: CURLOPT_KEYPASSWORD
+
+-# HTTP.SSL.CAPATH
+ Type: String representing directory
+ Description: Path to a directory containing trusted certificates for validating server certificates.
+ Related CURL Flags: CURLOPT_CAPATH
+
+-# HTTP.SSL.VALIDATE
+ Type: boolean ("1"/"0")
+ Description: Cause the client to verify the server's presented certificate.
+ Related CURL Flags: CURLOPT_SSL_VERIFYPEER, CURLOPT_SSL_VERIFYHOST
+
+-# HTTP.TIMEOUT
+ Type: String ("dddddd")
+ Description: Specify the maximum time in seconds that you allow the http transfer operation to take.
+ Related CURL Flags: CURLOPT_TIMEOUT, CURLOPT_NOSIGNAL, CURLOPT_CONNECTIONTIMEOUT
+
+-# HTTP.PROXY_SERVER
+ Type: String representing url to access the proxy: (e.g.http://[username:password@]host[:port])
+ Description: Specify the needed information for accessing a proxy.
+ Related CURL Flags: CURLOPT_PROXY, CURLOPT_PROXYHOST, CURLOPT_PROXYUSERPWD
+
+-# HTTP.READ.BUFFERSIZE
+ Type: String ("dddddd")
+ Description: Specify the the internal buffer size for curl reads.
+ Related CURL Flags: CURLOPT_BUFFERSIZE, CURL_MAX_WRITE_SIZE (16kB),
+ CURL_MAX_READ_SIZE (512kB).
+
+-# HTTP.KEEPALIVE
+ Type: String ("on|n/m")
+ Description: Specify that TCP KEEPALIVE should be enabled and that the associated idle wait time is n and that the associated repeat interval is m. If the value is of the form is the string "on", then turn on keepalive, but do not set idle or interval.
+ Related CURL Flags: CURLOPT_TCP_KEEPALIVE, CURLOPT_TCP_KEEPIDLE,
+ CURLOPT_TCP_KEEPINTVL.
+
+-# HTTP.CONNECTIONTIMEOUT
+ Type: String ("dddddd")
+ Description: Specify the maximum time in seconds that you allow the http connection to complete.
+ Related CURL Flags: CURLOPT_TIMEOUT, CURLOPT_NOSIGNAL
+
+The related curl flags line indicates the curl flags modified by this
+key. See the libcurl documentation of the _curl_easy_setopt()_ function
+for more detail (http://curl.haxx.se/libcurl/c/curl_easy_setopt.html).
+
+For servers that require client authentication, as a rule, the following
+.daprc entries should be specified.
+````
+HTTP.SSL.VALIDATE
+HTTP.COOKIEJAR
+HTTP.SSL.CERTIFICATE
+HTTP.SSL.KEY
+HTTP.SSL.CAPATH
+````
+
+Additionally, the _HTTP.SSL.CERTIFICATE_ and _HTTP.SSL.KEY_
+entries should have same value, which is the file path for a
+certificate. The HTTP.SSL.CAPATH entry should
+be the path to a directory containing validation "certificates".
+
+# Point of Contact {#dap4_poc}
+
+__Author__: Dennis Heimbigner
+__Email__: dmh at ucar dot edu
+__Initial Version__: 6/5/2017
+__Last Revised__: 11/7/2018
+
+*/
diff -Nru netcdf-parallel-4.7.3/NUG/Doxyfile netcdf-parallel-4.7.4/NUG/Doxyfile
--- netcdf-parallel-4.7.3/NUG/Doxyfile 1970-01-01 00:00:00.000000000 +0000
+++ netcdf-parallel-4.7.4/NUG/Doxyfile 2020-08-31 10:33:26.000000000 +0000
@@ -0,0 +1,2465 @@
+# Doxyfile 1.8.14
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = "NetCDF Users Guide"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER = development
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO = images/unidata_logo_cmyk.png
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY =
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = YES
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = YES
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines (in the resulting output). You can put ^^ in the value part of an
+# alias to insert a newline as if a physical newline was in the original file.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 0.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 99
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = YES
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if ... \endif and \cond
+# ... \endcond blocks.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = guide.dox \
+ bestpractices.md \
+ install.md \
+ DAP2.dox \
+ DAP4.dox \
+ OPeNDAP.dox \
+ types.dox \
+ user_defined_formats.md \
+ filters.md
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.idl \
+ *.ddl \
+ *.odl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.cs \
+ *.d \
+ *.php \
+ *.php4 \
+ *.php5 \
+ *.phtml \
+ *.inc \
+ *.m \
+ *.markdown \
+ *.md \
+ *.mm \
+ *.dox \
+ *.py \
+ *.pyw \
+ *.f90 \
+ *.f95 \
+ *.f03 \
+ *.f08 \
+ *.f \
+ *.for \
+ *.tcl \
+ *.vhd \
+ *.vhdl \
+ *.ucf \
+ *.qsf
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH = images
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+#
+#
+# where is the value of the INPUT_FILTER tag, and is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = guide.dox
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: https://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND =
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment.
+# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use + S
+# (what the is depends on the OS and browser, but it is typically
+# , /