Merge remote-tracking branch 'origin/license_update.wif' into pr-aggregation.wif

This commit is contained in:
Ward Fisher 2018-12-11 17:08:21 -05:00
commit 30ea33435c
648 changed files with 4426 additions and 5051 deletions

View File

@ -1,3 +1,9 @@
# 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.
#####
# Contains variables and settings used
# by the CMake build system in order to
@ -72,7 +78,7 @@ IF(NC_DPKG)
ENDMACRO(getdpkg_arch)
getdpkg_arch(dpkg_arch)
SET(CPACK_DEBIAN_PACKAGE_NAME "netcdf4-dev")
SET(CPACK_DEBIAN_PACKAGE_NAME "netcdf4-dev")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${dpkg_arch}")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "zlib1g (>= 1:1.2.3.4), libhdf5-7 (>= 1.8.11), libcurl4-openssl-dev (>= 7.22.0)")
ENDIF()
@ -127,4 +133,4 @@ set(CPACK_COMPONENT_DEPENDENCIES_DESCRIPTION
set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
"The NetCDF-C user documentation.")
INCLUDE(CPack)
INCLUDE(CPack)

View File

@ -1150,8 +1150,8 @@ IF (ENABLE_PARALLEL_TESTS AND NOT USE_PARALLEL)
ENDIF()
# Enable special filter test; experimental when using cmake.
OPTION(ENABLE_FILTER_TESTING "Enable filter testing. Ignored if shared libraries or netCDF4 are not enabled" OFF)
IF(NOT ENABLE_NETCDF4)
OPTION(ENABLE_FILTER_TESTING "Enable filter testing. Ignored if shared libraries or netCDF4 are not enabled" ON)
IF(ENABLE_FILTER_TESTING AND NOT ENABLE_NETCDF_4)
MESSAGE(WARNING "ENABLE_FILTER_TESTING requires netCDF-4. Disabling.")
SET(ENABLE_FILTER_TESTING OFF CACHE BOOL "")
ENDIF()

View File

@ -1,39 +1,11 @@
The NetCDF Copyright.
Copyright 2018 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
University Corporation for Atmospheric Research/Unidata.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Portions of this software were developed by the Unidata Program at the
University Corporation for Atmospheric Research.
Access and use of this software shall impose the following obligations
and understandings on the user. The user is granted the right, without
any fee or cost, to use, copy, modify, alter, enhance and distribute
this software, and any derivative works thereof, and its supporting
documentation for any purpose whatsoever, provided that this entire
notice appears in all copies of the software, derivative works and
supporting documentation. Further, UCAR requests that the user credit
UCAR/Unidata in any publications that result from the use of this
software or in any product that includes this software, although this
is not an obligation. The names UCAR and/or Unidata, however, may not
be used in any advertising or publicity to endorse or promote any
products or commercial entity unless specific written permission is
obtained from UCAR/Unidata. The user also understands that
UCAR/Unidata is not obligated to provide the user with any support,
consulting, training or assistance of any kind with regard to the use,
operation and performance of this software nor to provide the user
with any updates, revisions, new versions or "bug fixes."
THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,4 +1,10 @@
## This file should be placed in the root directory of your project.
# 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.
# This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
##

View File

@ -1,3 +1,9 @@
# 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.
## This file is used to customize CTest.
## See:
##

View File

@ -1,3 +1,9 @@
# 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.
INCLUDE(BundleUtilities)
# Set bundle to the full path name of the executable

View File

@ -7,6 +7,9 @@ This file contains a high-level description of this package's evolution. Release
## 4.6.3 - TBD
* Update the license from the home-brewed NetCDF license to the standard 3-Clause BSD License. This change does not result in any new restrictions; it is merely the adoption of a standard, well-known and well-understood license in place of the historic NetCDF license written at Unidata. This is part of a broader push by Unidata to adopt modern, standardized licensing.
* [BugFix][Enhancement] Modified `nccopy` so that `_NCProperties` is not copied over verbatim but is instead generated based on the version of `libnetcdf` used when copying the file. Additionally, `_NCProperties` are displayed if/when associated with a netcdf3 file, now. See [GitHub #803](https://github.com/Unidata/netcdf-c/issues/803) for more information.
## 4.6.2 - November 16, 2018

View File

@ -36,7 +36,7 @@ build: off
build_script:
- cmd: mkdir build
- cmd: cd build
- cmd: cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%INSTALL_LOC% -DENABLE_BASH_SCRIPT_TESTING=OFF
- cmd: cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%INSTALL_LOC% -DENABLE_BASH_SCRIPT_TESTING=OFF -DENABLE_FILTER_TESTING=OFF
- cmd: if errorlevel 1 exit 1
- cmd: cmake --build . --config Release -- /maxcpucount:4

View File

@ -1,3 +1,9 @@
# 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.
CMAKE_POLICY(SET CMP0007 OLD)
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")

View File

@ -1,3 +1,13 @@
/*! \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.
*/
#ifndef CONFIG_H
#define CONFIG_H

View File

@ -1,3 +1,10 @@
# 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.
SET(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
remove_definitions(-DDLL_EXPORT)

View File

@ -1,5 +1,5 @@
## This is a automake file, part of Unidata's netCDF package.
# Copyright 2011, see the COPYRIGHT file for more information.
# Copyright 2018, see the COPYRIGHT file for more information.
# This file builds and runs DAP4 tests.

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)

View File

@ -1,3 +1,10 @@
# 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.
#####
# Build doxygen documentation, if need be.
#####

View File

@ -1,37 +0,0 @@
/*! \page copyright COPYRIGHT
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
University Corporation for Atmospheric Research/Unidata.
Portions of this software were developed by the Unidata Program at the
University Corporation for Atmospheric Research.
Access and use of this software shall impose the following obligations
and understandings on the user. The user is granted the right, without
any fee or cost, to use, copy, modify, alter, enhance and distribute
this software, and any derivative works thereof, and its supporting
documentation for any purpose whatsoever, provided that this entire
notice appears in all copies of the software, derivative works and
supporting documentation. Further, UCAR requests that the user credit
UCAR/Unidata in any publications that result from the use of this
software or in any product that includes this software, although this
is not an obligation. The names UCAR and/or Unidata, however, may not
be used in any advertising or publicity to endorse or promote any
products or commercial entity unless specific written permission is
obtained from UCAR/Unidata. The user also understands that
UCAR/Unidata is not obligated to provide the user with any support,
consulting, training or assistance of any kind with regard to the use,
operation and performance of this software nor to provide the user
with any updates, revisions, new versions or "bug fixes."
THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
*/

16
docs/COPYRIGHT.md Normal file
View File

@ -0,0 +1,16 @@
COPYRIGHT {#copyright}
=====================
Copyright 2018 Unidata
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

View File

@ -761,7 +761,7 @@ INPUT = \
@abs_top_srcdir@/docs/all-error-codes.md \
@abs_top_srcdir@/docs/FAQ.md \
@abs_top_srcdir@/docs/known_problems.md \
@abs_top_srcdir@/docs/COPYRIGHT.dox \
@abs_top_srcdir@/docs/COPYRIGHT.md \
@abs_top_srcdir@/docs/credits.md \
@abs_top_srcdir@/docs/bestpractices.md \
@abs_top_srcdir@/docs/tutorial.dox \

View File

@ -1,6 +1,10 @@
## This is a automake file, part of Unidata's netCDF package.
# Copyright 2005-2011, see the COPYRIGHT file for more information.
# This file builds the netcdf documentation.
# 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.
# These files will be included with the dist.
EXTRA_DIST = netcdf.m4 DoxygenLayout.xml Doxyfile.in footer.html \
@ -10,7 +14,7 @@ building-with-cmake.md CMakeLists.txt groups.dox install.md notes.md \
install-fortran.md all-error-codes.md credits.md auth.md \
obsolete/fan_utils.html bestpractices.md filters.md indexing.dox \
inmemory.md DAP2.dox attribute_conventions.md FAQ.md \
file_format_specifications.md known_problems.md COPYRIGHT.dox \
file_format_specifications.md known_problems.md COPYRIGHT.md \
user_defined_formats.md inmeminternal.dox DAP4.md DAP4.dox
# Turn off parallel builds in this directory.

View File

@ -1,3 +1,10 @@
# 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.
EXTRA_DIST = aqua.jpg chunking2.png compatibility3.png compression.png \
groups.png nc4-model.png ncatts.png nc-classic-uml.png nccoords.png \
ncfile.png pnetcdf.png terra.jpg netcdf_architecture.png \

View File

@ -111,4 +111,3 @@ 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.)

View File

@ -1,3 +1,10 @@
# 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.
SET(exam_C_tests simple_xy_wr simple_xy_rd sfc_pres_temp_wr sfc_pres_temp_rd pres_temp_4D_wr pres_temp_4D_rd)
SET(exam_C_tests_source "")
FOREACH(F ${exam_C_tests})

View File

@ -1,5 +1,5 @@
# This is a automake file, part of Unidata's netCDF package.
# Copyright 2006, see the COPYRIGHT file for more information.
# Copyright 2018, see the COPYRIGHT file for more information.
# This file builds the C examples.

View File

@ -1,5 +1,17 @@
/*! \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.
*/
/* This example program is part of Unidata's netCDF library for
scientific data access.
scientific data access.
This program demonstrates various ways to create a netCDF file,
open an existing file, and close a file.
@ -18,7 +30,7 @@
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return e; \
} while (0)
} while (0)
#define FILENAME "test.nc"
#define VARNAME "var1"
@ -31,7 +43,7 @@ int
main()
{
/* These are netCDF IDs for file, dimension, and variable. */
int ncid, dimid, varid;
int ncid, dimid, varid;
/* This array will hold one ID for each dimension in the
variable, in this case, one. */
@ -41,7 +53,7 @@ main()
int data_out[] = {0,1,2,3,4,5,6,7,8,9};
int data_in[DIMLEN];
int i, res;
int i, res;
/* Create a classic format netCDF file, overwritting any file of
this name that may already exist. */
@ -99,11 +111,10 @@ main()
fprintf(stderr, "Unexpected value!\n");
return ERROR;
}
/* Close the file again. */
if ((res = nc_close(ncid)))
BAIL(res);
return 0;
}

View File

@ -1,5 +1,17 @@
/*! \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.
*/
/* This example program is part of Unidata's netCDF library for
scientific data access.
scientific data access.
This example shows how to create and deal with files of different
netcdf formats (i.e. classic vs. 64-bit-offset).
@ -19,7 +31,7 @@
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return NC_EXAMPLE_ERROR; \
} while (0)
} while (0)
#define NUMDIMS 2
#define NUMVARS 1
@ -33,7 +45,7 @@ main()
float temp[LAT_LEN][LON_LEN], *fp;
char classic_file[] = "classic.nc", offset64_file[] = "offset.nc";
char *file = classic_file;
int i, res;
int i, res;
/* Create a bunch of phoney data so we have something to write in
the example file. */
@ -59,12 +71,12 @@ main()
BAIL(res);
if ((res = nc_def_dim(ncid, "longitude", LON_LEN, &dimids[1])))
BAIL(res);
/* Define the variable. */
if ((res = nc_def_var(ncid, "sfc_temp", NC_FLOAT, NUMDIMS,
if ((res = nc_def_var(ncid, "sfc_temp", NC_FLOAT, NUMDIMS,
dimids, &temp_varid)))
BAIL(res);
/* We're finished defining metadata. */
if ((res = nc_enddef(ncid)))
BAIL(res);
@ -79,4 +91,3 @@ main()
return 0;
}

View File

@ -1,3 +1,14 @@
/*! \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 <stdio.h>
#include <stdlib.h>
#include <netcdf.h>
@ -135,7 +146,7 @@ main() { /* create rec2Gp.nc */
for(j=0; j<J_LEN; j++) {
for (k=0; k<K_LEN; k++) {
if (var1[j][k] != (signed char) n) {
printf("Error on read, var1[%d, %d, %d, %d] = %d wrong, should be %d !\n", rec, i, j, k, var1[j][k], (signed char) n);
printf("Error on read, var1[%d, %d, %d, %d] = %d wrong, should be %d !\n", rec, i, j, k, var1[j][k], (signed char) n);
return 1;
}
n++;

View File

@ -1,5 +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.
See \ref copyright file for more info.
*/
/* This example program is part of Unidata's netCDF library for
scientific data access.
scientific data access.
This program demonstrates various ways to create netCDF dimensions
and variables.
@ -35,7 +46,7 @@
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return NC_EXAMPLE_ERROR; \
} while (0)
} while (0)
#define FILENAME "test.nc"
#define NUMDIMS 4
@ -118,7 +129,7 @@ main()
size_t start[NUMDIMS], count[NUMDIMS];
float *fp, *ifp;
int rec, i, res;
int rec, i, res;
/* Create a bunch of phoney data so we have something to write in
the example file. */
@ -128,10 +139,10 @@ main()
lat[i] = PHONEY_LAT_START + (i * PHONEY_LAT_MULT);
for (i=0; i<HEIGHT_LEN; i++)
height[i] = i * PHONEY_HEIGHT_INC;
for (fp=(float *)temp, ifp=(float *)itemp, i=0;
for (fp=(float *)temp, ifp=(float *)itemp, i=0;
i<LAT_LEN*LON_LEN; i++)
*fp++ = (*ifp++ = PHONEY_TEMP_START) + i/PHONEY_TEMP_DIV;
for (fp=(float *)pres, ifp=(float *)ipres, i=0;
for (fp=(float *)pres, ifp=(float *)ipres, i=0;
i<LAT_LEN*LON_LEN*HEIGHT_LEN; i++)
*fp++ = (*ifp++ = PHONEY_PRES_START) - i/PHONEY_PRES_DIV;
@ -142,7 +153,7 @@ main()
/* Store a history string as a file-level attribute. This could
store the name of the person or lab producing the data, or any
information that applies to the dataset as a whole. */
if ((res = nc_put_att_text(ncid, NC_GLOBAL, HISTORY,
if ((res = nc_put_att_text(ncid, NC_GLOBAL, HISTORY,
strlen(HISTSTR), HISTSTR)))
BAIL(res);
@ -157,23 +168,23 @@ main()
BAIL(res);
if ((res = nc_def_dim(ncid, LON_NAME, LON_LEN, &lon_dimid)))
BAIL(res);
if ((res = nc_def_dim(ncid, HEIGHT_NAME, HEIGHT_LEN,
if ((res = nc_def_dim(ncid, HEIGHT_NAME, HEIGHT_LEN,
&height_dimid)))
BAIL(res);
/* Define the variables. Each variable's dimension ids are set in
the dimids array before the call to nc_def_var. The first two
variables share three dimensions, time, lat and lon. */
dimids[0] = time_dimid;
dimids[1] = lat_dimid;
dimids[2] = lon_dimid;
if ((res = nc_def_var(ncid, TEMP_VARNAME, NC_FLOAT, NUMDIMS_3D,
if ((res = nc_def_var(ncid, TEMP_VARNAME, NC_FLOAT, NUMDIMS_3D,
dimids, &temp_varid)))
BAIL(res);
/* For pressure we also add a 4th dimension: height. */
dimids[3] = height_dimid;
if ((res = nc_def_var(ncid, PRES_VARNAME, NC_FLOAT, NUMDIMS_4D,
if ((res = nc_def_var(ncid, PRES_VARNAME, NC_FLOAT, NUMDIMS_4D,
dimids, &pres_varid)))
BAIL(res);
@ -181,23 +192,23 @@ main()
they don't have a time dimension. */
dimids[0] = lat_dimid;
dimids[1] = lon_dimid;
if ((res = nc_def_var(ncid, INIT_TEMP_VARNAME, NC_FLOAT,
if ((res = nc_def_var(ncid, INIT_TEMP_VARNAME, NC_FLOAT,
NUMDIMS_2D, dimids, &itemp_varid)))
BAIL(res);
dimids[2] = height_dimid;
if ((res = nc_def_var(ncid, INIT_PRES_VARNAME, NC_FLOAT,
if ((res = nc_def_var(ncid, INIT_PRES_VARNAME, NC_FLOAT,
NUMDIMS_3D, dimids, &ipres_varid)))
BAIL(res);
/* We'll store the units as attributes for the temperature and
pressure variables. */
if ((res = nc_put_att_text(ncid, pres_varid, UNITS,
if ((res = nc_put_att_text(ncid, pres_varid, UNITS,
strlen(MILIBARS), MILIBARS)))
BAIL(res);
if ((res = nc_put_att_text(ncid, temp_varid, UNITS,
if ((res = nc_put_att_text(ncid, temp_varid, UNITS,
strlen(CELSIUS), CELSIUS)))
BAIL(res);
/* In order to store the coordinate axis data we need to define a
netCDF variable for each axis we want to store data for. In our
@ -208,13 +219,13 @@ main()
be the same as the dimension, it will be one-dimensional, with
the length of the dimension. As it's dimension, it will be
assigned the dimension that it represents. */
if ((res = nc_def_var(ncid, LAT_NAME, NC_FLOAT, NUMDIMS_1D,
if ((res = nc_def_var(ncid, LAT_NAME, NC_FLOAT, NUMDIMS_1D,
&lat_dimid, &lat_varid)))
BAIL(res);
if ((res = nc_def_var(ncid, LON_NAME, NC_FLOAT, NUMDIMS_1D,
if ((res = nc_def_var(ncid, LON_NAME, NC_FLOAT, NUMDIMS_1D,
&lon_dimid, &lon_varid)))
BAIL(res);
if ((res = nc_def_var(ncid, HEIGHT_NAME, NC_INT, NUMDIMS_1D,
if ((res = nc_def_var(ncid, HEIGHT_NAME, NC_INT, NUMDIMS_1D,
&height_dimid, &height_varid)))
BAIL(res);
@ -251,7 +262,7 @@ main()
start[1] = 0;
start[2] = 0;
start[3] = 0;
count[0] = 1;
count[0] = 1;
count[1] = LAT_LEN;
count[2] = LON_LEN;
count[3] = HEIGHT_LEN;
@ -262,14 +273,14 @@ main()
nc_put_vara_<type> function, which can write any array subset
of the variable. */
start[0] = rec; /* We want to write *this* record. */
if ((res = nc_put_vara_float(ncid, temp_varid, start, count,
if ((res = nc_put_vara_float(ncid, temp_varid, start, count,
(float *)temp)))
BAIL(res);
if ((res = nc_put_vara_float(ncid, pres_varid, start, count,
(float *)pres)))
BAIL(res);
/* We're done writing one record. */
}
}
/* Close the file. We're done, so we can go out and see the new
Harry Potter movie! */
@ -278,4 +289,3 @@ main()
return 0;
}

View File

@ -188,4 +188,3 @@ fn_exit:
MPI_Finalize();
return 0;
}

View File

@ -6,7 +6,7 @@ temperatures. It is intended to illustrate the use of the netCDF C
API. The companion program pres_temp_4D_rd.c shows how to read the
netCDF data file created by this program.
Copyright 2006 University Corporation for Atmospheric
Copyright 2018 University Corporation for Atmospheric
Research/Unidata. See COPYRIGHT file for conditions of use.
*/
@ -76,7 +76,7 @@ main()
/* Loop indexes. */
int lvl, lat, lon, rec, i = 0;
/* Error handling. */
int retval;
@ -87,7 +87,7 @@ main()
lats[lat] = START_LAT + 5.*lat;
for (lon = 0; lon < NLON; lon++)
lons[lon] = START_LON + 5.*lon;
for (lvl = 0; lvl < NLVL; lvl++)
for (lat = 0; lat < NLAT; lat++)
for (lon = 0; lon < NLON; lon++)
@ -118,18 +118,18 @@ main()
since coordinate variables only have one dimension, we can
simply provide the address of that dimension ID (&lat_dimid) and
similarly for (&lon_dimid). */
if ((retval = nc_def_var(ncid, LAT_NAME, NC_FLOAT, 1, &lat_dimid,
if ((retval = nc_def_var(ncid, LAT_NAME, NC_FLOAT, 1, &lat_dimid,
&lat_varid)))
ERR(retval);
if ((retval = nc_def_var(ncid, LON_NAME, NC_FLOAT, 1, &lon_dimid,
if ((retval = nc_def_var(ncid, LON_NAME, NC_FLOAT, 1, &lon_dimid,
&lon_varid)))
ERR(retval);
/* Assign units attributes to coordinate variables. */
if ((retval = nc_put_att_text(ncid, lat_varid, UNITS,
if ((retval = nc_put_att_text(ncid, lat_varid, UNITS,
strlen(DEGREES_NORTH), DEGREES_NORTH)))
ERR(retval);
if ((retval = nc_put_att_text(ncid, lon_varid, UNITS,
if ((retval = nc_put_att_text(ncid, lon_varid, UNITS,
strlen(DEGREES_EAST), DEGREES_EAST)))
ERR(retval);
@ -144,18 +144,18 @@ main()
/* Define the netCDF variables for the pressure and temperature
* data. */
if ((retval = nc_def_var(ncid, PRES_NAME, NC_FLOAT, NDIMS,
if ((retval = nc_def_var(ncid, PRES_NAME, NC_FLOAT, NDIMS,
dimids, &pres_varid)))
ERR(retval);
if ((retval = nc_def_var(ncid, TEMP_NAME, NC_FLOAT, NDIMS,
if ((retval = nc_def_var(ncid, TEMP_NAME, NC_FLOAT, NDIMS,
dimids, &temp_varid)))
ERR(retval);
/* Assign units attributes to the netCDF variables. */
if ((retval = nc_put_att_text(ncid, pres_varid, UNITS,
if ((retval = nc_put_att_text(ncid, pres_varid, UNITS,
strlen(PRES_UNITS), PRES_UNITS)))
ERR(retval);
if ((retval = nc_put_att_text(ncid, temp_varid, UNITS,
if ((retval = nc_put_att_text(ncid, temp_varid, UNITS,
strlen(TEMP_UNITS), TEMP_UNITS)))
ERR(retval);
@ -188,10 +188,10 @@ main()
for (rec = 0; rec < NREC; rec++)
{
start[0] = rec;
if ((retval = nc_put_vara_float(ncid, pres_varid, start, count,
if ((retval = nc_put_vara_float(ncid, pres_varid, start, count,
&pres_out[0][0][0])))
ERR(retval);
if ((retval = nc_put_vara_float(ncid, temp_varid, start, count,
if ((retval = nc_put_vara_float(ncid, temp_varid, start, count,
&temp_out[0][0][0])))
ERR(retval);
}
@ -199,7 +199,7 @@ main()
/* Close the file. */
if ((retval = nc_close(ncid)))
ERR(retval);
printf("*** SUCCESS writing example file %s!\n", FILE_NAME);
return 0;
}

View File

@ -1,5 +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.
See \ref copyright file for more info.
*/
/* This example program is part of Unidata's netCDF library for
scientific data access.
scientific data access.
This program (quickly, but not thoroughly) tests the large file
features.
@ -19,14 +30,14 @@
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return NC_EXAMPLE_ERROR; \
} while (0)
} while (0)
#define NUMDIMS 1
#define NUMVARS 2
/* This dim len is the max size for an 8-byte type in 64-bit offset
format: (2*32 - 4) / 8, that is, 4 GB minus a bit, on an 8 byte
boundary. */
#define DIM_LEN 536870911
#define DIM_LEN 536870911
int
main()
@ -34,7 +45,7 @@ main()
int ncid, spockid, kirkid, dimids[NUMDIMS];
double val_in, val_out = 999.99;
size_t index[NUMDIMS] = {DIM_LEN-1};
int i, res;
int i, res;
/* Create the netCDF 64-bit offset format file. */
if ((res = nc_create("example.nc", NC_CLOBBER|NC_64BIT_OFFSET, &ncid)))
@ -47,15 +58,15 @@ main()
/* Define dimension. */
if ((res = nc_def_dim(ncid, "longdim", DIM_LEN, dimids)))
BAIL(res);
/* Define two variables. */
if ((res = nc_def_var(ncid, "spock", NC_DOUBLE, NUMDIMS,
if ((res = nc_def_var(ncid, "spock", NC_DOUBLE, NUMDIMS,
dimids, &spockid)))
BAIL(res);
if ((res = nc_def_var(ncid, "kirk", NC_DOUBLE, NUMDIMS,
if ((res = nc_def_var(ncid, "kirk", NC_DOUBLE, NUMDIMS,
dimids, &kirkid)))
BAIL(res);
/* We're finished defining metadata. */
if ((res = nc_enddef(ncid)))
BAIL(res);
@ -69,9 +80,3 @@ main()
return 0;
}

View File

@ -1,5 +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.
See \ref copyright file for more info.
*/
/* This example program is part of Unidata's netCDF library for
scientific data access.
scientific data access.
This program will create a large file in netCDF classic
format. From the netcdf docs:
@ -25,7 +36,7 @@
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return NC_EXAMPLE_ERROR; \
} while (0)
} while (0)
#define NUMDIMS 1
#define NUMVARS 2
@ -40,7 +51,7 @@ main()
int ncid, spockid, kirkid, dimids[NUMDIMS];
double val_in, val_out = 999.99;
size_t index[NUMDIMS] = {1};
int i, res;
int i, res;
/* Create the netCDF classic format file. */
if ((res = nc_create("example.nc", NC_CLOBBER, &ncid)))
@ -53,15 +64,15 @@ main()
/* Define dimension. */
if ((res = nc_def_dim(ncid, "longdim", DIM_LEN, dimids)))
BAIL(res);
/* Define two variables. */
if ((res = nc_def_var(ncid, "spock", NC_DOUBLE, NUMDIMS,
if ((res = nc_def_var(ncid, "spock", NC_DOUBLE, NUMDIMS,
dimids, &spockid)))
BAIL(res);
if ((res = nc_def_var(ncid, "kirk", NC_DOUBLE, NUMDIMS,
if ((res = nc_def_var(ncid, "kirk", NC_DOUBLE, NUMDIMS,
dimids, &kirkid)))
BAIL(res);
/* We're finished defining metadata. */
if ((res = nc_enddef(ncid)))
BAIL(res);
@ -75,4 +86,3 @@ main()
return 0;
}

View File

@ -1,4 +1,10 @@
#!/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.
# This shell script runs the examples.
# Ed Hartnett

View File

@ -1,4 +1,10 @@
#!/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.
# This shell script runs the examples for netCDF4.
# Ed Hartnett

View File

@ -1,6 +1,10 @@
#!/bin/sh
# This shell script runs the examples for netCDF4.
# Ed Hartnett
# 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

View File

@ -1,6 +1,6 @@
/* This is part of the netCDF package.
Copyright 2006 University Corporation for Atmospheric
Copyright 2018 University Corporation for Atmospheric
Research/Unidata. See COPYRIGHT file for conditions of use.
This is a simple example which writes and then reads some surface
@ -72,7 +72,7 @@ main()
* applies to the entire file, not just to one variable. Don't
* forget that sizeof does not include the null terminator, so if
* you want it, you need to add one more byte. */
if ((retval = nc_put_att_text(ncid, NC_GLOBAL, SONNET_NAME,
if ((retval = nc_put_att_text(ncid, NC_GLOBAL, SONNET_NAME,
sizeof(poem) + 1, poem)))
return retval;
@ -118,7 +118,7 @@ main()
/* Close the file. */
if ((retval = nc_close(ncid)))
return retval;
/* Open the file and check that everything's OK. */
if ((retval = nc_open(FILE_NAME, 0, &ncid)))
return retval;
@ -134,7 +134,7 @@ main()
free(att_in);
if (error)
return -2;
/* Read the data. */
if ((retval = nc_get_var_float(ncid, pres_varid, pres_in)))
return retval;

View File

@ -5,8 +5,8 @@ This is an example which reads some surface pressure and
temperatures. The data file read by this program is produced by the
companion program sfc_pres_temp_wr.c. It is intended to illustrate the
use of the netCDF C API.
Copyright 2006 University Corporation for Atmospheric
Copyright 2018 University Corporation for Atmospheric
Research/Unidata. See COPYRIGHT file for conditions of use.
*/
@ -82,14 +82,14 @@ main()
many netCDF variables, dimensions, and global attributes are in
the file; also the dimension id of the unlimited dimension, if
there is one. */
if ((retval = nc_inq(ncid, &ndims_in, &nvars_in, &ngatts_in,
if ((retval = nc_inq(ncid, &ndims_in, &nvars_in, &ngatts_in,
&unlimdimid_in)))
ERR(retval);
/* In this case we know that there are 2 netCDF dimensions, 4
netCDF variables, no global attributes, and no unlimited
dimension. */
if (ndims_in != 2 || nvars_in != 4 || ngatts_in != 0 ||
if (ndims_in != 2 || nvars_in != 4 || ngatts_in != 0 ||
unlimdimid_in != -1) return 2;
/* Get the varids of the latitude and longitude coordinate
@ -139,12 +139,12 @@ main()
them and check them. */
if ((retval = nc_get_att_text(ncid, lat_varid, UNITS, lat_units_in)))
ERR(retval);
if (strncmp(lat_units_in, LAT_UNITS, strlen(LAT_UNITS)))
if (strncmp(lat_units_in, LAT_UNITS, strlen(LAT_UNITS)))
return 2;
if ((retval = nc_get_att_text(ncid, lon_varid, UNITS, lon_units_in)))
ERR(retval);
if (strncmp(lon_units_in, LON_UNITS, strlen(LON_UNITS)))
if (strncmp(lon_units_in, LON_UNITS, strlen(LON_UNITS)))
return 2;
if ((retval = nc_get_att_text(ncid, pres_varid, UNITS, pres_units_in)))

View File

@ -5,8 +5,8 @@ This example writes some surface pressure and temperatures. It is
intended to illustrate the use of the netCDF C API. The companion
program sfc_pres_temp_rd.c shows how to read the netCDF data file
created by this program.
Copyright 2006 University Corporation for Atmospheric
Copyright 2018 University Corporation for Atmospheric
Research/Unidata. See COPYRIGHT file for conditions of use.
*/
@ -68,7 +68,7 @@ main()
/* Loop indexes. */
int lat, lon;
/* Error handling. */
int retval;
@ -79,7 +79,7 @@ main()
lats[lat] = START_LAT + 5.*lat;
for (lon = 0; lon < NLON; lon++)
lons[lon] = START_LON + 5.*lon;
for (lat = 0; lat < NLAT; lat++)
for (lon = 0; lon < NLON; lon++)
{
@ -100,10 +100,10 @@ main()
/* Define coordinate netCDF variables. They will hold the
coordinate information, that is, the latitudes and longitudes. A
varid is returned for each.*/
if ((retval = nc_def_var(ncid, LAT_NAME, NC_FLOAT, 1, &lat_dimid,
if ((retval = nc_def_var(ncid, LAT_NAME, NC_FLOAT, 1, &lat_dimid,
&lat_varid)))
ERR(retval);
if ((retval = nc_def_var(ncid, LON_NAME, NC_FLOAT, 1, &lon_dimid,
if ((retval = nc_def_var(ncid, LON_NAME, NC_FLOAT, 1, &lon_dimid,
&lon_varid)))
ERR(retval);
@ -114,10 +114,10 @@ main()
not use null-terminated strings. In general it is up to the
reading C program to ensure that it puts null-terminators on
strings where necessary.*/
if ((retval = nc_put_att_text(ncid, lat_varid, UNITS,
if ((retval = nc_put_att_text(ncid, lat_varid, UNITS,
strlen(DEGREES_NORTH), DEGREES_NORTH)))
ERR(retval);
if ((retval = nc_put_att_text(ncid, lon_varid, UNITS,
if ((retval = nc_put_att_text(ncid, lon_varid, UNITS,
strlen(DEGREES_EAST), DEGREES_EAST)))
ERR(retval);
@ -125,18 +125,18 @@ main()
the dimids of the dimensions of the variables.*/
dimids[0] = lat_dimid;
dimids[1] = lon_dimid;
if ((retval = nc_def_var(ncid, PRES_NAME, NC_FLOAT, NDIMS,
if ((retval = nc_def_var(ncid, PRES_NAME, NC_FLOAT, NDIMS,
dimids, &pres_varid)))
ERR(retval);
if ((retval = nc_def_var(ncid, TEMP_NAME, NC_FLOAT, NDIMS,
if ((retval = nc_def_var(ncid, TEMP_NAME, NC_FLOAT, NDIMS,
dimids, &temp_varid)))
ERR(retval);
/* Define units attributes for vars. */
if ((retval = nc_put_att_text(ncid, pres_varid, UNITS,
if ((retval = nc_put_att_text(ncid, pres_varid, UNITS,
strlen(pres_units), pres_units)))
ERR(retval);
if ((retval = nc_put_att_text(ncid, temp_varid, UNITS,
if ((retval = nc_put_att_text(ncid, temp_varid, UNITS,
strlen(temp_units), temp_units)))
ERR(retval);
@ -162,7 +162,7 @@ main()
/* Close the file. */
if ((retval = nc_close(ncid)))
ERR(retval);
printf("*** SUCCESS writing example file sfc_pres_temp.nc!\n");
return 0;
}

View File

@ -1,5 +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.
See \ref copyright file for more info.
*/
/* This example program is part of Unidata's netCDF library for
scientific data access.
scientific data access.
How about a short, but meaningful, netCDF program?
@ -18,7 +29,7 @@
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return NC_EXAMPLE_ERROR; \
} while (0)
} while (0)
#define NUMDIMS 2
#define NUMVARS 1
@ -31,7 +42,7 @@ main()
{
int ncid, temp_varid, dimids[NUMDIMS];
float temp[LAT_LEN][LON_LEN], *fp;
int i, res;
int i, res;
/* Create a bunch of phoney data so we have something to write in
the example file. */
@ -47,14 +58,14 @@ main()
BAIL(res);
if ((res = nc_def_dim(ncid, "longitude", LON_LEN, &dimids[1])))
BAIL(res);
/* Define the variable. */
if ((res = nc_def_var(ncid, "sfc_temp", NC_FLOAT, NUMDIMS,
if ((res = nc_def_var(ncid, "sfc_temp", NC_FLOAT, NUMDIMS,
dimids, &temp_varid)))
BAIL(res);
/* We'll store the units. */
if ((res = nc_put_att_text(ncid, temp_varid, "units",
if ((res = nc_put_att_text(ncid, temp_varid, "units",
strlen(CELSIUS), CELSIUS)))
BAIL(res);
@ -71,4 +82,3 @@ main()
return 0;
}

View File

@ -7,7 +7,7 @@ features of netCDF-4.0.
This example reads a simple file created by simple_nc4_wr.c. This is
intended to illustrate the use of the netCDF-4 C API.
This is part of the netCDF package. Copyright 2006-2011 University
This is part of the netCDF package. Copyright 2006-2018 University
Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for
conditions of use. Full documentation of the netCDF can be found at
http://www.unidata.ucar.edu/software/netcdf/docs.
@ -41,7 +41,7 @@ main()
int x, y, retval;
/* The following struct is written as a compound type. */
struct s1
struct s1
{
int i1;
int i2;
@ -61,7 +61,7 @@ main()
/* Get the varid of the uint64 data variable, based on its name, in
* grp1. */
if ((retval = nc_inq_varid(grp1id, "data", &varid1)))
if ((retval = nc_inq_varid(grp1id, "data", &varid1)))
ERR(retval);
/* Read the data. */
@ -70,7 +70,7 @@ main()
/* Get the varid of the compound data variable, based on its name,
* in grp2. */
if ((retval = nc_inq_varid(grp2id, "data", &varid2)))
if ((retval = nc_inq_varid(grp2id, "data", &varid2)))
ERR(retval);
/* Read the data. */

View File

@ -6,7 +6,7 @@ some netCDF variables in different subgroups. The variables will
include a compound and an enum type, as well as some of the new atomic
types, like the unsigned 64-bit integer.
This is part of the netCDF package. Copyright 2006-2011 University
This is part of the netCDF package. Copyright 2006-2018 University
Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for
conditions of use. Full documentation of the netCDF can be found at
http://www.unidata.ucar.edu/software/netcdf/docs.
@ -45,7 +45,7 @@ main()
int x, y, retval;
/* The following struct is written as a compound type. */
struct s1
struct s1
{
int i1;
int i2;
@ -85,7 +85,7 @@ main()
/* Define an unsigned 64bit integer variable in grp1, using dimensions
* in the root group. */
if ((retval = nc_def_var(grp1id, "data", NC_UINT64, NDIMS,
if ((retval = nc_def_var(grp1id, "data", NC_UINT64, NDIMS,
dimids, &varid1)))
ERR(retval);
@ -95,19 +95,19 @@ main()
ERR(retval);
/* Create a compound type. This will cause nc_reddef to be called. */
if (nc_def_compound(grp2id, sizeof(struct s1), "sample_compound_type",
if (nc_def_compound(grp2id, sizeof(struct s1), "sample_compound_type",
&typeid))
ERR(retval);
if (nc_insert_compound(grp2id, typeid, "i1",
if (nc_insert_compound(grp2id, typeid, "i1",
offsetof(struct s1, i1), NC_INT))
ERR(retval);
if (nc_insert_compound(grp2id, typeid, "i2",
if (nc_insert_compound(grp2id, typeid, "i2",
offsetof(struct s1, i2), NC_INT))
ERR(retval);
/* Define a compound type variable in grp2, using dimensions
* in the root group. */
if ((retval = nc_def_var(grp2id, "data", typeid, NDIMS,
if ((retval = nc_def_var(grp2id, "data", typeid, NDIMS,
dimids, &varid2)))
ERR(retval);

View File

@ -1,6 +1,11 @@
/*! \file
An example program demonstrating a simple 2D write.
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.
*/
#include <stdlib.h>
@ -65,7 +70,7 @@ main()
/* Define the variable. The type of the variable in this case is
* NC_INT (4-byte integer). */
if ((retval = nc_def_var(ncid, "data", NC_INT, NDIMS,
if ((retval = nc_def_var(ncid, "data", NC_INT, NDIMS,
dimids, &varid)))
ERR(retval);

View File

@ -1,3 +1,10 @@
# 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.
SET(CDL_EXAMPLE_TESTS do_comps)
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl)

View File

@ -1,6 +1,11 @@
## This is a automake file, part of Unidata's netCDF package.
# Copyright 2006, see the COPYRIGHT file for more information.
# This file builds CDL examples.
# 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.
# Ed Hartnett
# Note which tests depend on other tests. Necessary for make -j check.

View File

@ -1,4 +1,11 @@
#!/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.
# This shell script runs the cmp test on the example programs.
# $Id: do_comps.sh,v 1.1 2006/06/27 17:44:54 ed Exp $

View File

@ -1,3 +1,9 @@
# 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.
ADD_SUBDIRECTORY(C)
IF(BUILD_UTILITIES)

View File

@ -1,16 +1,18 @@
## This is a automake file, part of Unidata's netCDF package.
# Copyright 2005, see the COPYRIGHT file for more information.
# This is the main automake file for netCDF. It builds the different
# netcdf directories. Not all directories are built, depending on the
# options selected during configure.
# 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.
# Build ncgen/ncdump.
if BUILD_UTILITIES
CDL_DIR = CDL
endif
# These are the subdirectories that will be built.
# These are the subdirectories that will be built.
SUBDIRS = C $(CDL_DIR)
EXTRA_DIST=CMakeLists.txt

View File

@ -1,3 +1,10 @@
# 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.
SET(H5TESTS tst_h_files tst_h_files2 tst_h_files4 tst_h_atts tst_h_atts3 tst_h_atts4 tst_h_vars tst_h_vars2 tst_h_vars3 tst_h_grps tst_h_compounds tst_h_compounds2 tst_h_wrt_cmp tst_h_vl tst_h_opaques tst_h_strings tst_h_strings1 tst_h_strings2 tst_h_ints tst_h_dimscales tst_h_dimscales1 tst_h_dimscales2 tst_h_dimscales3 tst_h_enums tst_h_dimscales4)
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h5 ${CMAKE_CURRENT_SOURCE_DIR}/*.nc)

View File

@ -1,5 +1,5 @@
# This is part of the netCDF package.
# Copyright 2011 University Corporation for Atmospheric Research/Unidata
# Copyright 2018 University Corporation for Atmospheric Research/Unidata
# See COPYRIGHT file for conditions of use.
#
# This entire directory will be skipped, unless the configure script

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,4 +1,10 @@
#!/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

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,
@ -52,14 +52,14 @@ main()
{
float val = 99;
char emp[NUM_EMPS][MAX_LEN + 1] = {"Augustus", "Tiberius",
"Caligula", "Claudius",
char emp[NUM_EMPS][MAX_LEN + 1] = {"Augustus", "Tiberius",
"Caligula", "Claudius",
"Ne_r_o", "V.esp.asi.an"};
char obj_name[MAX_LEN + 1];
int e, i;
/* Open file and create group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gcreate(fileid, EMP_GRP, 0)) < 0) ERR;
@ -69,7 +69,7 @@ main()
/* Attach some zero-length float attributes! */
for (e = 0; e < NUM_EMPS; e++)
{
if ((attid = H5Acreate(grpid, emp[e], H5T_NATIVE_FLOAT, spaceid,
if ((attid = H5Acreate(grpid, emp[e], H5T_NATIVE_FLOAT, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
if (H5Aclose(attid) < 0) ERR;
@ -79,15 +79,15 @@ main()
if (H5Sclose(spaceid) < 0) ERR;
if (H5Gclose(grpid) < 0) ERR;
if (H5Fclose(fileid) < 0) ERR;
/* Now open the file again and read in the attributes. */
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, EMP_GRP)) < 0) ERR;
/* How many attributes are there? */
if ((num_obj = H5Aget_num_attrs(grpid)) != NUM_EMPS) ERR;
/* Make sure the names are in the correct order. */
for (i = 0; i < num_obj; i++)
{
@ -104,7 +104,7 @@ main()
printf("*** Checking HDF5 attribute deletes...");
{
/* Create a file and open the root group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
@ -112,7 +112,7 @@ main()
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
if (H5Tset_size(typeid, strlen(txt) + 1) < 0) ERR;
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, typeid, txt) < 0) ERR;
@ -121,7 +121,7 @@ main()
if (H5Adelete(grpid, ATT1_NAME) < 0) ERR;
/* Create and write it again. */
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, typeid, txt) < 0) ERR;
@ -137,7 +137,7 @@ main()
printf("*** Checking HDF5 attributes attached to the fileid...");
{
/* See if we can write an attribute to the root group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
@ -145,7 +145,7 @@ main()
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
if (H5Tset_size(typeid, strlen(txt) + 1) < 0) ERR;
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, typeid, txt) < 0) ERR;
if (H5Aclose(attid) < 0 ||
@ -158,15 +158,15 @@ main()
printf("*** Checking HDF5 attributes in a group...");
{
/* Open file and create group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
/* Attach a text attribute with some of Hamlet's lines. */
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
if (H5Tset_size(typeid, strlen(txt) + 1) < 0) ERR;
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, typeid, txt) < 0) ERR;
if (H5Aclose(attid) < 0 ||
@ -176,7 +176,7 @@ main()
H5Fclose(fileid) < 0) ERR;
/* Now open the file again and read in the attribute. */
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY,
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
if ((attid = H5Aopen_name(grpid, ATT1_NAME)) < 0) ERR;
@ -221,19 +221,19 @@ main()
float val = 99;
/* Open file and create group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0)
ERR;
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0)
ERR;
/* Attach a float attribute with no data. The
* hell with Hamlet anyway! */
if ((spaceid = H5Screate(H5S_NULL)) < 0)
ERR;
if ((typeid = H5Tcopy(H5T_NATIVE_FLOAT)) < 0)
ERR;
if ((attid = H5Acreate(grpid, ATT1_NAME,
if ((attid = H5Acreate(grpid, ATT1_NAME,
typeid, spaceid, H5P_DEFAULT)) < 0)
ERR;
if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
@ -242,9 +242,9 @@ main()
if (H5Tclose(typeid) < 0) ERR;
if (H5Gclose(grpid) < 0) ERR;
if (H5Fclose(fileid) < 0) ERR;
/* Now open the file again and read in the attribute. */
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
if ((attid = H5Aopen_name(grpid, ATT1_NAME)) < 0) ERR;
@ -258,7 +258,7 @@ main()
if ((spaceid = H5Screate(H5S_NULL)) < 0) ERR;
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
if (H5Tset_size(typeid, 1) < 0) ERR;
if ((attid1 = H5Acreate(grpid, ATT2_NAME, typeid, spaceid,
if ((attid1 = H5Acreate(grpid, ATT2_NAME, typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_FLOAT, &val) < 0) ERR;
if (H5Sclose(spaceid) < 0 ||
@ -267,9 +267,9 @@ main()
H5Tclose(typeid) < 0 ||
H5Gclose(grpid) < 0 ||
H5Fclose(fileid) < 0) ERR;
/* Now open the file again and read in the attribute. */
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY,
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
if ((attid = H5Aopen_name(grpid, ATT2_NAME)) < 0) ERR;
@ -322,21 +322,21 @@ main()
"So tell him, with th' occurrents, more and less,\n"
"Which have solicited- the rest is silence."};
char speech_name[NUM_SPEECHES][MAX_LEN + 1] = {"Act_1_Scene_2",
"Act_3_Scene_2",
char speech_name[NUM_SPEECHES][MAX_LEN + 1] = {"Act_1_Scene_2",
"Act_3_Scene_2",
"Act_5_Scene_2"};
char obj_name[MAX_LEN + 1];
int i;
/* Create a file and get its root group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
/* Create a dataset. */
dims[0] = DIM1_LEN;
if ((var_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
if ((datasetid = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
if ((datasetid = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
var_spaceid, H5P_DEFAULT)) < 0) ERR;
/* Attach three text attributes with some of Hamlet's lines to
@ -347,7 +347,7 @@ main()
for (i = 0; i < NUM_SPEECHES; i++)
{
if (H5Tset_size(typeid, strlen(speech[i]) + 1) < 0) ERR;
if ((attid = H5Acreate(datasetid, speech_name[i], typeid, spaceid,
if ((attid = H5Acreate(datasetid, speech_name[i], typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, typeid, speech[i]) < 0) ERR;
if (H5Aclose(attid) < 0) ERR;
@ -364,14 +364,14 @@ main()
* attributes). */
/* Open file, group, and dataset. */
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
H5P_DEFAULT)) < 0) ERR;
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
if ((datasetid = H5Dopen1(grpid, VAR_NAME)) < 0) ERR;
/* How many attributes are there? */
if ((num_obj = H5Aget_num_attrs(datasetid)) != NUM_SPEECHES) ERR;
/* Make sure the names are in the correct order. */
for (i = 0; i < num_obj; i++)
{
@ -387,7 +387,7 @@ main()
/* Recreate it and add the attributes again. */
if ((var_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
if ((datasetid = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
if ((datasetid = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
var_spaceid, H5P_DEFAULT)) < 0) ERR;
/* Attach three text attributes with some of Hamlet's lines to
@ -398,7 +398,7 @@ main()
for (i = 0; i < NUM_SPEECHES; i++)
{
if (H5Tset_size(typeid, strlen(speech[i]) + 1) < 0) ERR;
if ((attid = H5Acreate(datasetid, speech_name[i], typeid, spaceid,
if ((attid = H5Acreate(datasetid, speech_name[i], typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, typeid, speech[i]) < 0) ERR;
if (H5Aclose(attid) < 0) ERR;
@ -406,7 +406,7 @@ main()
/* How many attributes are there? */
if ((num_obj = H5Aget_num_attrs(datasetid)) != NUM_SPEECHES) ERR;
/* Make sure the names are in the correct order. */
for (i = 0; i < num_obj; i++)
{
@ -448,7 +448,7 @@ main()
/* Write an attribute. */
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
if ((attid = H5Acreate2(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
if ((attid = H5Acreate2(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
spaceid, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Sclose(spaceid) < 0) ERR;
@ -456,15 +456,15 @@ main()
H5Fflush(hdfid, H5F_SCOPE_GLOBAL);
dims[0] = 1;
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
if ((attid1 = H5Acreate2(grpid, "l", H5T_NATIVE_INT, spaceid,
if ((attid1 = H5Acreate2(grpid, "l", H5T_NATIVE_INT, spaceid,
H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Aclose(attid1) < 0) ERR;
if ((attid1 = H5Acreate2(grpid, "y", H5T_NATIVE_INT, spaceid,
if ((attid1 = H5Acreate2(grpid, "y", H5T_NATIVE_INT, spaceid,
H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Aclose(attid1) < 0) ERR;
if ((attid1 = H5Acreate2(grpid, "c", H5T_NATIVE_INT, spaceid,
if ((attid1 = H5Acreate2(grpid, "c", H5T_NATIVE_INT, spaceid,
H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Aclose(attid1) < 0) ERR;
@ -506,7 +506,7 @@ main()
/* Write an attribute. */
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
if ((attid = H5Acreate(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
if ((attid = H5Acreate(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
spaceid, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Sclose(spaceid) < 0) ERR;
@ -514,15 +514,15 @@ main()
H5Fflush(hdfid, H5F_SCOPE_GLOBAL);
dims[0] = 1;
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
if ((attid1 = H5Acreate2(grpid, "z", H5T_NATIVE_INT, spaceid,
if ((attid1 = H5Acreate2(grpid, "z", H5T_NATIVE_INT, spaceid,
H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Aclose(attid1) < 0) ERR;
if ((attid1 = H5Acreate2(grpid, "y", H5T_NATIVE_INT, spaceid,
if ((attid1 = H5Acreate2(grpid, "y", H5T_NATIVE_INT, spaceid,
H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Aclose(attid1) < 0) ERR;
if ((attid1 = H5Acreate2(grpid, "c", H5T_NATIVE_INT, spaceid,
if ((attid1 = H5Acreate2(grpid, "c", H5T_NATIVE_INT, spaceid,
H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid1, H5T_NATIVE_INT, &one) < 0) ERR;
if (H5Aclose(attid1) < 0) ERR;
@ -579,10 +579,10 @@ main()
if ((dimscaleid = H5Dcreate(grpid, "D1", H5T_IEEE_F32BE,
spaceid, H5P_DEFAULT)) < 0)
ERR;
/* Indicate that this is a scale. */
if (H5DSset_scale(dimscaleid, NULL) < 0) ERR;
/* Add another attribute to the group. Call it "third". */
if ((attid = H5Acreate(grpid , att_name[2], H5T_NATIVE_UCHAR,
att_spaceid, H5P_DEFAULT)) < 0) ERR;
@ -610,7 +610,7 @@ main()
/* How many attributes are there? */
if ((num_obj = H5Aget_num_attrs(grpid)) != 3) ERR;
/* Make sure the names are in the correct order. */
for (i = 0; i < num_obj; i++)
{
@ -676,7 +676,7 @@ main()
/* How many attributes are there? */
if ((num_obj = H5Aget_num_attrs(grpid)) != NUM_SIMPLE_ATTS) ERR;
/* Make sure the names are in the correct order. */
for (i = 0; i < num_obj; i++)
{

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,
@ -25,10 +25,10 @@
#define X_NAME "x"
#define Y_NAME "y"
#define S1_NAME "s1"
#define VLEN_TYPE_NAME "Magna_Carta_VLEN"
#define VLEN_TYPE_NAME "Magna_Carta_VLEN"
#define S3_ATT_NAME "King_John"
#define S3_TYPE_NAME "barons"
#define VL_NAME "No scutage or aid may be levied in our kingdom without its general consent"
#define VL_NAME "No scutage or aid may be levied in our kingdom without its general consent"
#define ATT_LEN 1
int
@ -67,7 +67,7 @@ main()
for (i = 0; i < ATT_LEN; i++)
for (j = 0; j < NUM_VL; j++)
{
cvc_out[i].data[j].len = i + 1;
cvc_out[i].data[j].len = i + 1;
if (!(cvc_out[i].data[j].p = calloc(sizeof(struct s1), cvc_out[i].data[j].len))) ERR;
for (k = 0; k < cvc_out[i].data[j].len; k++)
{
@ -80,14 +80,14 @@ main()
* all the timmings. */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG)) ERR;
if (H5Pset_cache(fapl_id, 0, chunk_cache_nelems, chunk_cache_size,
if (H5Pset_cache(fapl_id, 0, chunk_cache_nelems, chunk_cache_size,
chunk_cache_preemption) < 0) ERR;
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST,
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 |
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 |
if (H5Pset_attr_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 (H5Pclose(fapl_id) < 0) ERR;
@ -98,9 +98,9 @@ main()
/* Create the compound type for struct s1. */
if ((s1_typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
if (H5Tinsert(s1_typeid, X_NAME, offsetof(struct s1, x),
if (H5Tinsert(s1_typeid, X_NAME, offsetof(struct s1, x),
H5T_NATIVE_FLOAT) < 0) ERR;
if (H5Tinsert(s1_typeid, Y_NAME, offsetof(struct s1, y),
if (H5Tinsert(s1_typeid, Y_NAME, offsetof(struct s1, y),
H5T_NATIVE_DOUBLE) < 0) ERR;
if (H5Tcommit(grpid, S1_TYPE_NAME, s1_typeid) < 0) ERR;
@ -110,13 +110,13 @@ main()
/* Create the struct s3 type, which contains the vlen. */
if ((s3_typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s3))) < 0) ERR;
if (H5Tinsert(s3_typeid, VL_NAME, offsetof(struct s3, data),
if (H5Tinsert(s3_typeid, VL_NAME, offsetof(struct s3, data),
vlen_typeid) < 0) ERR;
if (H5Tcommit(grpid, S3_TYPE_NAME, s3_typeid) < 0) ERR;
/* Create an attribute of this new type. */
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
if ((attid = H5Acreate(grpid, S3_ATT_NAME, s3_typeid, spaceid,
if ((attid = H5Acreate(grpid, S3_ATT_NAME, s3_typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, s3_typeid, cvc_out) < 0) ERR;
@ -127,7 +127,7 @@ main()
/* Close the att. */
if (H5Aclose(attid) < 0) ERR;
/* Close the space. */
if (H5Sclose(spaceid) < 0) ERR;
@ -156,7 +156,7 @@ main()
/* Get the typeid and native typeid. */
if ((file_typeid1[i] = H5Topen2(grpid, obj_name, H5P_DEFAULT)) < 0) ERR;
if ((native_typeid1[i] = H5Tget_native_type(file_typeid1[i],
if ((native_typeid1[i] = H5Tget_native_type(file_typeid1[i],
H5T_DIR_DEFAULT)) < 0) ERR;
}
@ -211,42 +211,42 @@ main()
* int. */
for (i = 0; i < ATT_LEN; i++)
{
vc_out[i].len = i + 1;
vc_out[i].len = i + 1;
if (!(vc_out[i].p = calloc(sizeof(int), vc_out[i].len))) ERR;
for (k = 0; k < vc_out[i].len; k++)
((int *)vc_out[i].p)[k] = 42;
}
/* Create the HDF5 file with creation order. */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
if (H5Pset_link_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
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 |
if (H5Pset_attr_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 (H5Pclose(fapl_id) < 0) ERR;
if (H5Pclose(fcpl_id) < 0) ERR;
/* Open the root group. */
if ((grpid = H5Gopen2(fileid, "/", H5P_DEFAULT)) < 0) ERR;
/* Create a vlen type. Its a vlen of int. */
if ((vlen_typeid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) ERR;
if (H5Tcommit(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
/* Create an attribute of this new type. */
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
if ((attid = H5Acreate(grpid, ATT_NAME, vlen_typeid, spaceid,
if ((attid = H5Acreate(grpid, ATT_NAME, vlen_typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, vlen_typeid, vc_out) < 0) ERR;
/* Close the type. */
if (H5Tclose(vlen_typeid) < 0) ERR;
/* Close the att. */
if (H5Aclose(attid) < 0) ERR;
/* Close the space. */
if (H5Sclose(spaceid) < 0) ERR;

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2010 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,
@ -26,10 +26,10 @@
#define X_NAME "x"
#define Y_NAME "y"
#define S1_NAME "s1"
#define VLEN_TYPE_NAME "Percy_Jackson_VLEN"
#define VLEN_TYPE_NAME "Percy_Jackson_VLEN"
#define ATT_NAME "Poseidon"
#define S3_TYPE_NAME "Olympus"
#define VL_NAME "Trident"
#define VL_NAME "Trident"
#define ATT_LEN 1
int
@ -67,7 +67,7 @@ main()
if (!(vc_out = calloc(sizeof(hvl_t), ATT_LEN))) ERR;
for (i = 0; i < ATT_LEN; i++)
{
vc_out[i].len = i + 1;
vc_out[i].len = i + 1;
if (!(vc_out[i].p = calloc(sizeof(struct s1), vc_out[i].len))) ERR;
for (k = 0; k < vc_out[i].len; k++)
{
@ -75,50 +75,50 @@ main()
((struct s1 *)vc_out[i].p)[k].y = 2.0;
}
}
/* Create the HDF5 file, with cache control, creation order, and
* all the timmings. */
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG)) ERR;
if (H5Pset_cache(fapl_id, 0, chunk_cache_nelems, chunk_cache_size,
if (H5Pset_cache(fapl_id, 0, chunk_cache_nelems, chunk_cache_size,
chunk_cache_preemption) < 0) ERR;
if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) ERR;
if (H5Pset_link_creation_order(fcpl_id, (H5P_CRT_ORDER_TRACKED |
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 |
if (H5Pset_attr_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 (H5Pclose(fapl_id) < 0) ERR;
if (H5Pclose(fcpl_id) < 0) ERR;
/* Open the root group. */
if ((grpid = H5Gopen2(fileid, "/", H5P_DEFAULT)) < 0) ERR;
/* Create the compound type for struct s1. */
if ((s1_typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
if (H5Tinsert(s1_typeid, X_NAME, offsetof(struct s1, x),
if (H5Tinsert(s1_typeid, X_NAME, offsetof(struct s1, x),
H5T_NATIVE_FLOAT) < 0) ERR;
if (H5Tinsert(s1_typeid, Y_NAME, offsetof(struct s1, y),
if (H5Tinsert(s1_typeid, Y_NAME, offsetof(struct s1, y),
H5T_NATIVE_DOUBLE) < 0) ERR;
if (H5Tcommit(grpid, S1_TYPE_NAME, s1_typeid) < 0) ERR;
/* Create a vlen type. Its a vlen of struct s1. */
if ((vlen_typeid = H5Tvlen_create(s1_typeid)) < 0) ERR;
if (H5Tcommit(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
/* Create an attribute of this new type. */
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
if ((attid = H5Acreate(grpid, ATT_NAME, vlen_typeid, spaceid,
if ((attid = H5Acreate(grpid, ATT_NAME, vlen_typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;
if (H5Awrite(attid, vlen_typeid, vc_out) < 0) ERR;
/* Close the types. */
if (H5Tclose(s1_typeid) < 0 ||
H5Tclose(vlen_typeid) < 0) ERR;
/* Close the att. */
if (H5Aclose(attid) < 0) ERR;
/* Close the space. */
if (H5Sclose(spaceid) < 0) ERR;

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,
@ -42,11 +42,11 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct s2), DIM1_LEN))) ERR;
memcpy((void *)data2, (void *)dummy, sizeof(struct s2) * DIM1_LEN);
free(dummy);
memcpy((void *)data2, (void *)dummy, sizeof(struct s2) * DIM1_LEN);
free(dummy);
if (!(dummy = calloc(sizeof(struct s1), DIM1_LEN))) ERR;
memcpy((void *)data2, (void *)dummy, sizeof(struct s1) * DIM1_LEN);
free(dummy);
memcpy((void *)data2, (void *)dummy, sizeof(struct s1) * DIM1_LEN);
free(dummy);
for (i=0; i<DIM1_LEN; i++)
{
@ -60,9 +60,9 @@ main()
printf("\n*** Checking HDF5 compound types.\n");
printf("*** Checking simple HDF5 compound types...");
{
/* Open file and create group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((osmonds_grpid = H5Gcreate(fileid, OSMONDS, 0)) < 0) ERR;
@ -77,11 +77,11 @@ main()
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
/* Create a dataset of this compound type. */
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
spaceid, H5P_DEFAULT)) < 0) ERR;
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL,
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, data) < 0) ERR;
/* Release all resources. */
@ -98,7 +98,7 @@ main()
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
if (H5Tget_nmembers(typeid) != 2) ERR;
/* This doesn't work because all I have is a reference to the type!
/* This doesn't work because all I have is a reference to the type!
if (H5Iget_name(typeid, type_name, STR_LEN) < 0) ERR;
if (strcmp(type_name, COMPOUND_NAME)) ERR;*/
@ -111,10 +111,10 @@ main()
SUMMARIZE_ERR;
printf("*** Checking HDF5 compound types and groups...");
{
/* Open file and create two group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((osmonds_grpid = H5Gcreate(fileid, OSMONDS, 0)) < 0) ERR;
if ((who_grpid = H5Gcreate(fileid, WHO, 0)) < 0) ERR;
@ -130,19 +130,19 @@ main()
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
/* Create a dataset of this compound type in the same group. */
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
spaceid, H5P_DEFAULT)) < 0) ERR;
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL,
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, data) < 0) ERR;
/* Create a dataset of this compound type in a different group. */
if ((datasetid1 = H5Dcreate(who_grpid, BOOZE_VAR, typeid,
if ((datasetid1 = H5Dcreate(who_grpid, BOOZE_VAR, typeid,
spaceid, H5P_DEFAULT)) < 0) ERR;
/* Write some data. */
if (H5Dwrite(datasetid1, typeid, H5S_ALL, H5S_ALL,
if (H5Dwrite(datasetid1, typeid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, data) < 0) ERR;
/* Release all resources. */
@ -206,13 +206,13 @@ main()
SUMMARIZE_ERR;
printf("*** Checking HDF5 compound type which contains an array...");
{
hsize_t array_dims[] = {ARRAY_LEN};
hid_t array_typeid;
/* Open file and create group. */
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT)) < 0) ERR;
if ((osmonds_grpid = H5Gcreate(fileid, OSMONDS, 0)) < 0) ERR;
@ -230,13 +230,13 @@ main()
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
/* Create a dataset of this compound type. */
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
spaceid, H5P_DEFAULT)) < 0) ERR;
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL,
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, data2) < 0) ERR;
/* Release all resources. */
if (H5Dclose(datasetid) < 0 ||
H5Tclose(typeid) < 0 ||
@ -252,7 +252,7 @@ main()
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
if (H5Tget_nmembers(typeid) != 2) ERR;
/* This doesn't work because all I have is a reference to the type!
/* This doesn't work because all I have is a reference to the type!
if (H5Iget_name(typeid, type_name, STR_LEN) < 0) ERR;
if (strcmp(type_name, COMPOUND_NAME)) ERR;*/
@ -265,7 +265,7 @@ main()
SUMMARIZE_ERR;
printf("*** Checking HDF5 compound type 6 different types...");
{
#define DAY "day"
#define ELEV "elev"
@ -275,7 +275,7 @@ main()
#define OBS_T "obs_t"
#define OBS_VAR "obs_var"
#define DIM6_LEN 3
hid_t fileid, grpid, spaceid, typeid, native_typeid;
hid_t datasetid, mem_type;
hsize_t dims[1];
@ -295,8 +295,8 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct obs_t), DIM6_LEN))) ERR;
memcpy((void *)obsdata, (void *)dummy, sizeof(struct obs_t) * DIM6_LEN);
free(dummy);
memcpy((void *)obsdata, (void *)dummy, sizeof(struct obs_t) * DIM6_LEN);
free(dummy);
/* Initialize data. */
for (i = 0; i < DIM6_LEN; i++)
@ -330,7 +330,7 @@ main()
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, obsdata) < 0) ERR;
/* Release all resources. */
if (H5Dclose(datasetid) < 0 ||
H5Tclose(typeid) < 0 ||
@ -443,8 +443,8 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct hr_rec), DIM1_LEN))) ERR;
memcpy((void *)hr_data_out, (void *)dummy, sizeof(struct hr_rec) * DIM1_LEN);
free(dummy);
memcpy((void *)hr_data_out, (void *)dummy, sizeof(struct hr_rec) * DIM1_LEN);
free(dummy);
/* Create some phony data. */
for (i = 0; i < DIM1_LEN; i++)
@ -489,7 +489,7 @@ main()
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, hr_data_out) < 0) ERR;
/* Release all resources. */
if (H5Dclose(datasetid) < 0 ||
H5Tclose(array1_tid) < 0 ||
@ -596,7 +596,7 @@ main()
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, hr_data_out) < 0) ERR;
/* Release all resources. */
if (H5Dclose(datasetid) < 0 ||
H5Tclose(array1_tid) < 0 ||
@ -702,7 +702,7 @@ main()
/* Write some data to the attribute. */
if (H5Awrite(attid, typeid, hr_data_out) < 0) ERR;
/* Release all resources. */
if (H5Aclose(attid) < 0 ||
H5Tclose(typeid) < 0 ||
@ -785,7 +785,7 @@ main()
/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, hr_data_out) < 0) ERR;
/* Release all resources. */
if (H5Dclose(datasetid) < 0 ||
H5Tclose(array1_tid) < 0 ||
@ -835,8 +835,8 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct hr_rec), DIM2_LEN))) ERR;
memcpy((void *)hr_data_out, (void *)dummy, sizeof(struct hr_rec) * DIM2_LEN);
free(dummy);
memcpy((void *)hr_data_out, (void *)dummy, sizeof(struct hr_rec) * DIM2_LEN);
free(dummy);
/* Create some phony data. */
for (i = 0; i < DIM2_LEN; i++)
@ -869,7 +869,7 @@ main()
/* Write some data. */
if (H5Awrite(attid, typeid, hr_data_out) < 0) ERR;
/* Release all resources. */
if (H5Aclose(attid) < 0 ||
H5Tclose(array1_tid) < 0 ||
@ -956,7 +956,7 @@ main()
/* Write some data. */
if (H5Awrite(attid, typeid, data_out) < 0) ERR;
/* Release all resources. */
if (H5Aclose(attid) < 0 ||
H5Tclose(array1_tid) < 0 ||
@ -1018,8 +1018,8 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct s2), DIM_CMP_LEN))) ERR;
memcpy((void *)data_out, (void *)dummy, sizeof(struct s2) * DIM_CMP_LEN);
free(dummy);
memcpy((void *)data_out, (void *)dummy, sizeof(struct s2) * DIM_CMP_LEN);
free(dummy);
/* Create some phony data. */
for (i = 0; i < DIM_CMP_LEN; i++)
@ -1061,7 +1061,7 @@ main()
/* Write some data to the attribute. */
if (H5Awrite(attid, typeid_outer, data_out) < 0) ERR;
/* Release all resources. */
if (H5Aclose(attid) < 0 ||
H5Tclose(typeid_outer) < 0 ||
@ -1120,8 +1120,8 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct s2), DIM_CMP_LEN))) ERR;
memcpy((void *)data_out, (void *)dummy, sizeof(struct s2) * DIM_CMP_LEN);
free(dummy);
memcpy((void *)data_out, (void *)dummy, sizeof(struct s2) * DIM_CMP_LEN);
free(dummy);
/* Create some phony data. */
for (i = 0; i < DIM_CMP_LEN; i++)
@ -1163,7 +1163,7 @@ main()
/* Write some data to the attribute. */
if (H5Awrite(attid, typeid_outer, data_out) < 0) ERR;
/* Release all resources. */
if (H5Aclose(attid) < 0 ||
H5Tclose(typeid_outer) < 0 ||

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,
@ -58,8 +58,8 @@ main()
/* REALLY initialize the data (even the gaps in the structs). This
* is only needed to pass valgrind. */
if (!(dummy = calloc(sizeof(struct s2), DIM_CMP_LEN))) ERR;
memcpy((void *)data_out, (void *)dummy, sizeof(struct s2) * DIM_CMP_LEN);
free(dummy);
memcpy((void *)data_out, (void *)dummy, sizeof(struct s2) * DIM_CMP_LEN);
free(dummy);
/* Create some phony data. */
for (i = 0; i < DIM_CMP_LEN; i++)
@ -101,7 +101,7 @@ main()
/* Write some data to the attribute. */
if (H5Awrite(attid, typeid_outer, data_out) < 0) ERR;
/* Release all resources. */
if (H5Aclose(attid) < 0 ||
H5Tclose(typeid_outer) < 0 ||
@ -131,25 +131,25 @@ main()
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
for (i_obj = 0; i_obj < num_obj; i_obj++)
{
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i_obj, &obj_info, H5P_DEFAULT) < 0) ERR;
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC,
i_obj, obj_name, STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
/* Deal with groups and datasets. */
if (obj_info.type == H5O_TYPE_NAMED_DATATYPE)
{
/* Learn about the user-defined type. */
if ((obj_hdf_typeid[i_obj] = H5Topen2(grpid, obj_name,
if ((obj_hdf_typeid[i_obj] = H5Topen2(grpid, obj_name,
H5P_DEFAULT)) < 0) ERR;
if ((obj_native_typeid[i_obj] = H5Tget_native_type(obj_hdf_typeid[i_obj],
if ((obj_native_typeid[i_obj] = H5Tget_native_type(obj_hdf_typeid[i_obj],
H5T_DIR_DEFAULT)) < 0) ERR;
/* If this is the inner type, the obj_native_typeid
* should be equal to the inner_type_native_typeid. */
if (!strcmp(obj_name, INNER_TYPE_NAME))
{
if ((equal = H5Tequal(obj_native_typeid[i_obj],
if ((equal = H5Tequal(obj_native_typeid[i_obj],
inner_type_native_typeid)) < 0) ERR;
if (!equal) ERR;
}
@ -170,7 +170,7 @@ main()
strcpy(file_in, getenv("srcdir"));
strcat(file_in, "/");
strcat(file_in, REF_FILE_IN);
}
}
else
strcpy(file_in, REF_FILE_IN);
@ -194,9 +194,9 @@ main()
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
for (i_obj = 0; i_obj < num_obj; i_obj++)
{
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, &obj_info,
if (H5Oget_info_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, &obj_info,
H5P_DEFAULT) < 0) ERR;
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, obj_name,
if (H5Lget_name_by_idx(grpid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, i_obj, obj_name,
STR_LEN + 1, H5P_DEFAULT) < 0) ERR;
/* Deal with groups and datasets. */
@ -204,7 +204,7 @@ main()
{
/* Learn about the user-defined type. */
if ((obj_hdf_typeid[i_obj] = H5Topen2(grpid, obj_name, H5P_DEFAULT)) < 0) ERR;
if ((obj_native_typeid[i_obj] = H5Tget_native_type(obj_hdf_typeid[i_obj],
if ((obj_native_typeid[i_obj] = H5Tget_native_type(obj_hdf_typeid[i_obj],
H5T_DIR_DEFAULT)) < 0) ERR;
/* If this is the inner type, the obj_native_typeid

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2005-2011 University
/* This is part of the netCDF package. Copyright 2018-2011 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2005 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Check out HDF5 groups.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2010 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2007 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2005 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 20057 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,
@ -46,14 +46,14 @@ main(int argc, char **argv)
#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();
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");
@ -80,7 +80,7 @@ main(int argc, char **argv)
* 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");
@ -89,7 +89,7 @@ main(int argc, char **argv)
/* 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,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
fapl_id)) < 0) ERR;
/* Create a space to deal with one slice in memory. */
@ -101,7 +101,7 @@ main(int argc, char **argv)
if ((whole_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
/* Create dataset. */
if ((dsid = H5Dcreate1(fileid, VAR_NAME, H5T_NATIVE_INT,
if ((dsid = H5Dcreate1(fileid, VAR_NAME, H5T_NATIVE_INT,
whole_spaceid, H5P_DEFAULT)) < 0) ERR;
/* Use collective write operations. */
@ -115,7 +115,7 @@ main(int argc, char **argv)
#endif /* USE_MPE */
/* Write the data in num_step steps. */
ftime = MPI_Wtime();
ftime = MPI_Wtime();
num_steps = (DIM2_LEN/SC1) / p;
for (s = 0; s < num_steps; s++)
{
@ -126,10 +126,10 @@ main(int argc, char **argv)
/* 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,
if (H5Sselect_hyperslab(whole_spaceid, H5S_SELECT_SET,
start, NULL, count, NULL) < 0) ERR;
if (H5Dwrite(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid,
if (H5Dwrite(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid,
xferid, data) < 0) ERR;
#ifdef USE_MPE
@ -140,10 +140,10 @@ main(int argc, char **argv)
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;
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 */
@ -177,23 +177,23 @@ main(int argc, char **argv)
if ((dsid = H5Dopen(fileid, VAR_NAME)) < 0) ERR;
if ((whole_spaceid1 = H5Dget_space(dsid)) < 0) ERR;
ftime = MPI_Wtime();
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)
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)
if (H5Dread(dsid, H5T_NATIVE_INT, slice_spaceid, whole_spaceid1,
H5P_DEFAULT, data_in) < 0)
{
ERR;
return 2;
@ -211,10 +211,10 @@ main(int argc, char **argv)
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;
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 ||

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2005 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2010 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2010 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 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,

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2007 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2009 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,4 +1,4 @@
/* This is part of the netCDF package. Copyright 2005 University
/* This is part of the netCDF package. Copyright 2018 University
Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
conditions of use.

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2007 University Corporation for Atmospheric Research/Unidata
Copyright 2018 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Test HDF5 compound types.

View File

@ -1,3 +1,10 @@
# 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.
# Copy some test files from current source dir to out-of-tree build dir.
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.hdf4)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
@ -14,4 +21,3 @@ IF(USE_HDF4_FILE_TESTS AND NOT MSVC)
add_sh_test(hdf4_test run_get_hdf4_files)
add_sh_test(hdf4_test run_formatx_hdf4)
ENDIF()

View File

@ -1,6 +1,9 @@
# This is part of the netCDF package.
# Copyright 2018 University Corporation for Atmospheric Research/Unidata
# See COPYRIGHT file for conditions of use.
# 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.
#
# This directory has tests for the HDF4 code. This directory will be
# skipped if HDF4 is not enabled.
@ -19,7 +22,7 @@ TESTS = tst_chunk_hdf4 tst_h4_lendian tst_hdf4_extra
# This test script depends on ncdump and tst_interops2.c.
if BUILD_UTILITIES
check_PROGRAMS += tst_interops2
check_PROGRAMS += tst_interops2
TESTS += run_formatx_hdf4.sh
endif # BUILD_UTILITIES

View File

@ -1,5 +1,11 @@
/*! Testing for proper read of little-endian variables in an hdf4 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.
* Added to debug issue NCF-332. Based on code submitted by
* https://github.com/Unidata/netcdf-c/issues/113.
*/
@ -27,7 +33,7 @@ int read_hdf_file(int dtype)
if (nc_inq_varid(ncid,SDSNAME,&le_int16_varid)) ERR;
if (nc_inq_var_endian(ncid,le_int16_varid,&ed)) ERR;
if (nc_close(ncid)) ERR;
if (ed != NC_ENDIAN_LITTLE)
return -1;

View File

@ -1,3 +1,9 @@
# 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.
#####
# Installation of various netCDF headers.
#####

View File

@ -1,5 +1,5 @@
## This is a automake file, part of Unidata's netCDF package.
# Copyright 2010, see the COPYRIGHT file for more information.
# Copyright 2018, see the COPYRIGHT file for more information.
# This automake file generates the Makefile to build the include
# directory.

View File

@ -1,7 +1,13 @@
/*********************************************************************
* Copyright 1993, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
/*! \file
Copyright 2018, 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.
*/
/* $Header$ */
#ifndef CECONSTRAINTS_H
@ -28,4 +34,3 @@ CES_VALUE=18, CES_SLICE=19
} CEsort;
#endif /*CECONSTRAINTS_H*/

View File

@ -1,5 +1,5 @@
/* This is part of the netCDF package.
Copyright 2005 University Corporation for Atmospheric Research/Unidata
Copyright 2018 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.
Common includes, defines, etc., for test code in the libsrc4 and

View File

@ -1,5 +1,5 @@
/*
* Copyright 1995, University Corporation for Atmospheric Research
* Copyright 2018, University Corporation for Atmospheric Research
* See top level COPYRIGHT file for copying and redistribution conditions.
*/
/* $Id: fbits.h,v 1.2 1995/05/26 20:46:46 davis Exp $ */

View File

@ -1,4 +1,4 @@
/* Copyright 2005-2018 University Corporation for Atmospheric
/* Copyright 2018-2018 University Corporation for Atmospheric
Research/Unidata. */
/**
* @file

View File

@ -1,4 +1,4 @@
/* Copyright 2005-2018 University Corporation for Atmospheric
/* Copyright 2018-2018 University Corporation for Atmospheric
Research/Unidata. */
/**
* @file This header file contains macros, types, and prototypes for

View File

@ -1,5 +1,5 @@
/*
* Copyright 1996, University Corporation for Atmospheric Research
* Copyright 2018, University Corporation for Atmospheric Research
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
#ifndef _NC_H_

View File

@ -1,5 +1,5 @@
/*
* Copyright 1993-1996 University Corporation for Atmospheric Research/Unidata
* Copyright 2018-1996 University Corporation for Atmospheric Research/Unidata
*
* Portions of this software were developed by the Unidata Program at the
* University Corporation for Atmospheric Research.

View File

@ -1,5 +1,5 @@
/*
* Copyright 1996, University Corporation for Atmospheric Research
* Copyright 2018, University Corporation for Atmospheric Research
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
#ifndef _NC3INTERNAL_

View File

@ -1,4 +1,4 @@
/* Copyright 2005-2018 University Corporation for Atmospheric
/* Copyright 2018-2018 University Corporation for Atmospheric
Research/Unidata. */
/**
* @file

View File

@ -1,4 +1,4 @@
/* Copyright 2005-2018 University Corporation for Atmospheric
/* Copyright 2018-2018 University Corporation for Atmospheric
Research/Unidata. */
/**
* @file

View File

@ -1,3 +1,14 @@
/*! \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.
*/
#ifndef HASHMAP_H_INCLUDED
#define HASHMAP_H_INCLUDED
#include <stdlib.h>

Some files were not shown because too many files have changed in this diff Show More