[netcdf] 01/02: updated to netCDF nightly 2014-06-12

Nico Schlömer nschloe-guest at moszumanska.debian.org
Thu Jun 12 13:16:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

nschloe-guest pushed a commit to branch master
in repository netcdf.

commit ff508ec1000416e23819fb3d0c5d5641f120c422
Author: Nico Schlömer <nico.schloemer at gmail.com>
Date:   Thu Jun 12 15:15:39 2014 +0200

    updated to netCDF nightly 2014-06-12
---
 CMakeLists.txt                                |  191 +++-
 CTestConfig.cmake                             |   17 +
 Doxyfile                                      |    2 +-
 Makefile.am                                   |   14 +-
 RELEASE_NOTES.md                              |   14 +
 cf                                            |   18 +-
 config.h.in.cmake => config.h.cmake.in        |    0
 configure.ac                                  |   84 +-
 docs/CMakeLists.txt                           |   71 ++
 {man4 => docs}/Doxyfile.guide.in              |   34 +-
 {man4 => docs}/Doxyfile.in                    |   58 +-
 {man4 => docs}/Doxyfile.tutorial.in           |   34 +-
 {man4 => docs}/DoxygenLayout.xml              |    0
 {man4 => docs}/Makefile.am                    |   18 +-
 {man4 => docs}/all-error-codes.md             |    0
 docs/architecture.dox                         |   20 +
 {man4 => docs}/building-with-cmake.md         |    0
 {man4 => docs}/cdl.dox                        |    2 +-
 {man4 => docs}/cmake_faq.md                   |    2 +-
 {man4 => docs}/dispatch.dox                   |    0
 {man4 => docs}/errors.dox.old                 |    2 +-
 {man4 => docs}/esg.html                       |    2 +-
 {man4 => docs}/footer.html                    |    0
 {man4 => docs}/groups.dox                     |    0
 {man4 => docs}/guide.dox                      |    0
 {man4 => docs}/header.html                    |    0
 {man4 => docs}/images/InstallTreeWindows.jpg  |  Bin
 {man4 => docs}/images/InstallTreeWindows.png  |  Bin
 {man4 => docs}/images/Makefile.am             |    0
 {man4 => docs}/images/aqua.jpg                |  Bin
 {man4 => docs}/images/chunking2.png           |  Bin
 {man4 => docs}/images/compatibility3.png      |  Bin
 {man4 => docs}/images/compression.png         |  Bin
 {man4 => docs}/images/deptree.jpg             |  Bin
 {man4 => docs}/images/groups.png              |  Bin
 {man4 => docs}/images/nc-classic-uml.png      |  Bin
 {man4 => docs}/images/nc4-model.png           |  Bin
 {man4 => docs}/images/ncatts.png              |  Bin
 {man4 => docs}/images/nccoords.png            |  Bin
 {man4 => docs}/images/ncfile.png              |  Bin
 {man4 => docs}/images/netcdf_architecture.odg |  Bin
 docs/images/netcdf_architecture.png           |  Bin 0 -> 131864 bytes
 {man4 => docs}/images/pnetcdf.png             |  Bin
 {man4 => docs}/images/terra.jpg               |  Bin
 {man4 => docs}/install-fortran.md             |    0
 {man4 => docs}/install.dox                    |    0
 {man4 => docs}/install.md                     |    0
 {man4 => docs}/internal.dox                   |    0
 {man4 => docs}/mainpage.dox                   |    0
 {man4 => docs}/netcdf-50x50.png               |  Bin
 {man4 => docs}/netcdf.m4                      |    0
 {man4 => docs}/notes.dox                      |    0
 {man4 => docs}/old/defines.texi               |    0
 {man4 => docs}/old/netcdf-c.texi              |    0
 {man4 => docs}/old/netcdf-cxx.texi            |    0
 {man4 => docs}/old/netcdf-cxx4.texi           |    0
 {man4 => docs}/old/netcdf-f77.texi            |    0
 {man4 => docs}/old/netcdf-f90.texi            |    0
 {man4 => docs}/old/netcdf-install.texi        |    0
 {man4 => docs}/old/netcdf-internal.texi       |    0
 {man4 => docs}/old/netcdf-tutorial.texi       |    0
 {man4 => docs}/old/netcdf.texi                |    0
 {man4 => docs}/tutorial.dox                   |    0
 {man4 => docs}/types.dox                      |   22 +-
 {man4 => docs}/unidata_logo_cmyk.png          |  Bin
 {man4 => docs}/windows-binaries.md            |    0
 examples/C/CMakeLists.txt                     |    6 +-
 examples/CDL/CMakeLists.txt                   |    5 -
 examples/CMakeLists.txt                       |    4 -
 h5_test/CMakeLists.txt                        |    4 -
 include/CMakeLists.txt                        |    4 -
 include/netcdf.h                              |    4 +-
 libdap2/CMakeLists.txt                        |    6 +-
 libdap2/env                                   |    3 +-
 libdap2/getvara.c                             |    3 +-
 libdap2/ncd2dispatch.c                        |    7 +-
 libdispatch/CMakeLists.txt                    |    4 -
 liblib/CMakeLists.txt                         |    6 +-
 libnetcdf.settings.in                         |   39 +
 libsrc/CMakeLists.txt                         |    7 +-
 libsrc/Makefile.am                            |    2 +-
 libsrc4/CMakeLists.txt                        |    4 -
 libsrc4/nc4file.c                             |   19 +
 libsrc4/nc4hdf.c                              |   34 +-
 libsrc4/nc4var.c                              |   27 +-
 libsrc5/CMakeLists.txt                        |    4 -
 man4/CMakeLists.txt                           |   70 --
 man4/architecture.dox                         |   11 -
 man4/images/netcdf_architecture.png           |  Bin 114366 -> 0 bytes
 nc-config.in.cmake => nc-config.cmake.in      |    0
 nc_test/CMakeLists.txt                        |    4 -
 nc_test4/CMakeLists.txt                       |   11 +-
 nc_test4/Makefile.am                          |    9 +-
 nc_test4/chunked.hdf4                         |  Bin 0 -> 741175 bytes
 nc_test4/contiguous.hdf4                      |  Bin 0 -> 2919 bytes
 nc_test4/run_chunk_hdf4.sh                    |   34 +
 nc_test4/tst_chunk_hdf4.c                     |   92 ++
 ncdap_test/CMakeLists.txt                     |    5 -
 ncdap_test/expected3/CMakeLists.txt           |    6 +-
 ncdap_test/expected4/CMakeLists.txt           |    6 +-
 ncdap_test/expectremote3/CMakeLists.txt       |    6 +-
 ncdap_test/expectremote4/CMakeLists.txt       |    6 +-
 ncdap_test/expecttds3/CMakeLists.txt          |    6 +-
 ncdap_test/nocacheremote3/CMakeLists.txt      |    6 +-
 ncdap_test/nocacheremote4/CMakeLists.txt      |    6 +-
 ncdap_test/special3/CMakeLists.txt            |    6 +-
 ncdap_test/testdata3/CMakeLists.txt           |    4 -
 ncdump/CMakeLists.txt                         |   12 +-
 ncdump/cdl4/CMakeLists.txt                    |    6 +-
 ncdump/ctest.c                                | 1333 -------------------------
 ncdump/ctest64.c                              | 1333 -------------------------
 ncdump/expected4/CMakeLists.txt               |    6 +-
 ncgen/CMakeLists.txt                          |    4 -
 ncgen3/CMakeLists.txt                         |    4 -
 nctest/CMakeLists.txt                         |    4 -
 oc2/CMakeLists.txt                            |    6 +-
 oc2/ochttp.c                                  |    2 +-
 117 files changed, 711 insertions(+), 3084 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 17ef1e1..d435879 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@
 ##################################
 
 #Minimum required CMake Version
-cmake_minimum_required(VERSION 2.8.8)
+cmake_minimum_required(VERSION 2.8.9)
 
 #Project Name
 project(netCDF C)
@@ -22,6 +22,8 @@ set(PACKAGE "netCDF" CACHE STRING "")
 # http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
 #####
 
+MESSAGE("XXX $ENV{CFLAGS}")
+
 SET(netCDF_VERSION_MAJOR 4)
 SET(netCDF_VERSION_MINOR 3)
 SET(netCDF_VERSION_PATCH 3)
@@ -47,7 +49,8 @@ ENDIF()
 
 # Determine if DOXYGEN and DOT are available.  These will be used
 # when building the documentation.
-FIND_PROGRAM(NC_DOXYGEN NAMES doxygen)
+
+FIND_PACKAGE(Doxygen)
 FIND_PROGRAM(NC_DOT NAMES dot)
 
 # For CMAKE_INSTALL_LIBDIR
@@ -97,6 +100,10 @@ ENDIF()
 # Set build type uppercase
 STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
 
+# Determine the configure date.
+EXECUTE_PROCESS(COMMAND date
+  OUTPUT_VARIABLE CONFIG_DATE)
+
 ################################
 # End Project Properties
 ################################
@@ -131,14 +138,11 @@ INCLUDE(GenerateExportHeader)
 ################################
 
 # Default building shared libraries.
+# BUILD_SHARED_LIBS is provided by/used by
+# CMake directly.
 OPTION(BUILD_SHARED_LIBS "Configure netCDF as a shared library." ON)
-SET(LIB_TYPE STATIC)
 IF(BUILD_SHARED_LIBS)
-  SET(LIB_TYPE SHARED)
-  IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-    SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC")
-  ENDIF()
+  SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
 ENDIF()
 
 # Set some default linux gcc & apple compiler options for
@@ -152,11 +156,11 @@ IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
   # Debugging flags
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
 
-  # Check to see if -W1,--no-undefined is supported.
-  CHECK_C_LINKER_FLAG("-W1,--no-undefined" LIBTOOL_HAS_NO_UNDEFINED)
+  # Check to see if -Wl,--no-undefined is supported.
+  CHECK_C_LINKER_FLAG("-Wl,--no-undefined" LIBTOOL_HAS_NO_UNDEFINED)
 
   IF(LIBTOOL_HAS_NO_UNDEFINED)
-    SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -W1,--no-undefined")
+    SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no-undefined")
   ENDIF()
   SET(CMAKE_REQUIRED_FLAGS "${TMP_CMAKE_REQUIRED_FLAGS}")
 
@@ -329,7 +333,7 @@ MACRO(print_conf_summary)
     MESSAGE("")
   ENDIF()
 
-  MESSAGE("Tests Enabled:     ${ENABLE_TESTS}")
+  MESSAGE("Tests Enabled:              ${ENABLE_TESTS}")
   IF(ENABLE_TESTS)
     MESSAGE(STATUS "DAP Remote Tests:  ${ENABLE_DAP_REMOTE_TESTS}")
     MESSAGE(STATUS "DAP AUTH Tests:    ${ENABLE_DAP_AUTH_TESTS}")
@@ -393,6 +397,28 @@ MACRO(specify_static_crt_flag)
   MESSAGE(STATUS "")
 ENDMACRO()
 
+# A function used to create autotools-style 'yes/no' definitions.
+# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
+# returned.
+FUNCTION(is_enabled feature ret_val)
+  IF(${feature})
+    SET(${ret_val} "yes" PARENT_SCOPE)
+  ELSE()
+    SET(${ret_val} "no" PARENT_SCOPE)
+  ENDIF(${feature})
+ENDFUNCTION()
+
+# A function used to create autotools-style 'yes/no' definitions.
+# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
+# returned.
+FUNCTION(is_disabled feature ret_val)
+  IF(${feature})
+    SET(${ret_val} "no" PARENT_SCOPE)
+  ELSE()
+    SET(${ret_val} "yes" PARENT_SCOPE)
+  ENDIF(${feature})
+ENDFUNCTION()
+
 ################################
 # End Macro Definitions
 ################################
@@ -438,8 +464,6 @@ ENDIF()
 # Option checks
 ################################
 
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
 # HDF5 cache variables.
 SET(DEFAULT_CHUNK_SIZE 4194304 CACHE STRING "Default Chunk Cache Size.")
 SET(DEFAULT_CHUNKS_IN_CACHE 10 CACHE STRING "Default number of chunks in cache.")
@@ -615,7 +639,7 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
       FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
     ENDIF()
   ENDIF()
-  
+
   IF(NOT MSVC)
     # Depending on the install, either HDF5_hdf_library or
     # HDF5_C_LIBRARY may be defined.  We must check for either.
@@ -720,23 +744,27 @@ IF(ENABLE_DAP)
   ADD_DEFINITIONS(-DCURL_STATICLIB=1)
   INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
 
-  # Check to see if CURLOPT_USERNAME is defined. It is present starting version 7.19.1
+  # Check to see if CURLOPT_USERNAME is defined.
+  # It is present starting version 7.19.1.
   CHECK_C_SOURCE_COMPILES("
   #include <curl/curl.h>
   int main() {int x = CURLOPT_USERNAME;}" HAVE_CURLOPT_USERNAME)
 
-# Check to see if CURLOPT_PASSWORD is defined. It is present starting version 7.19.1
-CHECK_C_SOURCE_COMPILES("
+  # Check to see if CURLOPT_PASSWORD is defined.
+  # It is present starting version 7.19.1.
+  CHECK_C_SOURCE_COMPILES("
   #include <curl/curl.h>
   int main() {int x = CURLOPT_PASSWORD;}" HAVE_CURLOPT_PASSWORD)
 
-# Check to see if CURLOPT_KEYPASSWD is defined. It is present starting version 7.16.4
-CHECK_C_SOURCE_COMPILES("
+  # Check to see if CURLOPT_KEYPASSWD is defined.
+  # It is present starting version 7.16.4.
+  CHECK_C_SOURCE_COMPILES("
   #include <curl/curl.h>
   int main() {int x = CURLOPT_KEYPASSWD;}" HAVE_CURLOPT_KEYPASSWD)
 
-# Check to see if CURLINFO_RESPONSE_CODE is defined. It showed up in curl 7.10.7
-CHECK_C_SOURCE_COMPILES("
+  # Check to see if CURLINFO_RESPONSE_CODE is defined.
+  # It showed up in curl 7.10.7.
+  CHECK_C_SOURCE_COMPILES("
   #include <curl/curl.h>
   int main() {int x = CURLINFO_RESPONSE_CODE;}" HAVE_CURLINFO_RESPONSE_CODE)
 ENDIF()
@@ -824,7 +852,7 @@ IF(ENABLE_FSYNC)
   SET(USE_FSYNC ON)
 ENDIF()
 
-# Temporary 
+# Temporary
 OPTION (ENABLE_JNA "Enable jna bug fix code." OFF)
 IF(ENABLE_JNA)
   SET(JNA ON)
@@ -892,9 +920,7 @@ ENDIF()
 # Determine whether or not to generate documentation.
 OPTION(ENABLE_DOXYGEN "Enable generation of doxygen." OFF)
 IF(ENABLE_DOXYGEN)
-  IF(NC_DOXYGEN)
-    SET(BUILD_DOCS ON CACHE BOOL "")
-
+  IF(DOXYGEN_FOUND)
     # Offer the option to build internal documentation.
     OPTION(ENABLE_INTERNAL_DOCS "Build internal documentation. This is of interest to developers only." OFF)
     IF(ENABLE_INTERNAL_DOCS)
@@ -907,9 +933,9 @@ IF(ENABLE_DOXYGEN)
     OPTION(ENABLE_DOXYGEN_TASKS "Turn on test, todo, bug lists in documentation. This is of interest to developers only." OFF)
     IF(ENABLE_DOXYGEN_TASKS)
       SET(SHOW_DOXYGEN_TAG_LIST YES CACHE STRING "")
-    ELSE()
+    ELSE(ENABLE_DOXYGEN_TASKS)
       SET(SHOW_DOXYGEN_TODO_LIST NO CACHE STRING "")
-    ENDIF()
+    ENDIF(ENABLE_DOXYGEN_TASKS)
 
     # Specify whether or not 'dot' was found on the system path.
     IF(NC_DOT)
@@ -918,9 +944,10 @@ IF(ENABLE_DOXYGEN)
       SET(HAVE_DOT NO CACHE_STRING "")
     ENDIF(NC_DOT)
 
-  ELSE(NC_DOXYGEN)
+  ELSE(DOXYGEN_FOUND)
     MESSAGE(STATUS "Unable to build internal documentation.  Doxygen does not appear to be on your executable path. Install doxygen and configure the project again.")
-  ENDIF(NC_DOXYGEN)
+    SET(ENABLE_DOXYGEN=OFF)
+  ENDIF(DOXYGEN_FOUND)
 ENDIF()
 
 # By default, MSVC has a stack size of 1000000.
@@ -1059,7 +1086,7 @@ CHECK_FUNCTION_EXISTS(_filelengthi64 HAVE_FILE_LENGTH_I64)
 #####
 
 # Create config.h file.
-configure_file("${netCDF_SOURCE_DIR}/config.h.in.cmake"
+configure_file("${netCDF_SOURCE_DIR}/config.h.cmake.in"
   "${netCDF_BINARY_DIR}/config.h")
 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
 INCLUDE_DIRECTORIES(${netCDF_BINARY_DIR})
@@ -1137,15 +1164,18 @@ ENDIF()
 #####
 # Build doxygen documentation, if need be.
 #####
-ADD_SUBDIRECTORY(man4)
+ADD_SUBDIRECTORY(docs)
 #####
 # Moving on to CPack, install packages.
 #####
 INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf.h
-  DESTINATION include COMPONENT headers)
+  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+  COMPONENT headers)
+
 IF(ENABLE_PNETCDF OR ENABLE_PARALLEL)
   INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_par.h
-    DESTINATION include COMPONENT headers)
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+    COMPONENT headers)
 ENDIF()
 
 # Install the dependencies. This is Windows/Visual studio only,
@@ -1157,11 +1187,6 @@ IF(MSVC)
   INSTALL(DIRECTORY ${CMAKE_PREFIX_PATH} DESTINATION "deps" COMPONENT dependencies)
 ENDIF()
 
-
-IF(ENABLE_DOXYGEN)
-  INSTALL(DIRECTORY man4 DESTINATION "." COMPONENT documentation)
-ENDIF()
-
 # Subdirectory CMakeLists.txt files should specify their own
 # 'install' files.
 # Including 'CPack' kicks everything off.
@@ -1211,15 +1236,13 @@ SET(CC ${CMAKE_C_COMPILER})
 # Process all dependency libraries and create a string
 # used when parsing netcdf.pc.in
 
-IF(NOT BUILD_SHARED_LIBS)
-  FOREACH(_LIB ${ALL_TLL_LIBS})
-    GET_FILENAME_COMPONENT(_LIB_NAME ${_LIB} NAME_WE)
-    STRING(REGEX REPLACE "^lib" "" _NAME ${_LIB_NAME})
-    LIST(APPEND NC_LIBS "-l${_NAME}")
-    GET_FILENAME_COMPONENT(_LIB_DIR ${_LIB} PATH)
-    LIST(APPEND LINKFLAGS "-L${_LIB_DIR}")
-  ENDFOREACH()
-ENDIF(NOT BUILD_SHARED_LIBS)
+FOREACH(_LIB ${ALL_TLL_LIBS})
+  GET_FILENAME_COMPONENT(_LIB_NAME ${_LIB} NAME_WE)
+  STRING(REGEX REPLACE "^lib" "" _NAME ${_LIB_NAME})
+  LIST(APPEND NC_LIBS "-l${_NAME}")
+  GET_FILENAME_COMPONENT(_LIB_DIR ${_LIB} PATH)
+  LIST(APPEND LINKFLAGS "-L${_LIB_DIR}")
+ENDFOREACH()
 
 SET(NC_LIBS "-lnetcdf ${NC_LIBS}")
 
@@ -1234,16 +1257,19 @@ configure_file(
   ${netCDF_BINARY_DIR}/netcdf.pc @ONLY)
 
 FILE(MAKE_DIRECTORY ${netCDF_BINARY_DIR}/tmp)
-configure_file("${netCDF_SOURCE_DIR}/nc-config.in.cmake"
+configure_file("${netCDF_SOURCE_DIR}/nc-config.cmake.in"
   "${netCDF_BINARY_DIR}/tmp/nc-config" @ONLY)
 FILE(COPY "${netCDF_BINARY_DIR}/tmp/nc-config"
   DESTINATION ${netCDF_BINARY_DIR}/
   FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 
 INSTALL(FILES ${netCDF_BINARY_DIR}/netcdf.pc
-  DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig )
+  DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+  COMPONENT utilities)
 
-INSTALL(PROGRAMS ${netCDF_BINARY_DIR}/nc-config DESTINATION bin COMPONENT utilities)
+INSTALL(PROGRAMS ${netCDF_BINARY_DIR}/nc-config
+  DESTINATION ${CMAKE_INSTALL_BINDIR}
+  COMPONENT utilities)
 
 ###
 # End pkgconfig, nc-config file creation.
@@ -1328,7 +1354,68 @@ print_conf_summary()
 
 # Enable Makedist files.
 ADD_MAKEDIST()
-ENABLE_MAKEDIST(README.md COPYRIGHT RELEASE_NOTES.md INSTALL INSTALL.cmake test_prog.c lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt config.h.in.cmake cmake_uninstall.cmake.in netcdf-config-version.cmake.in netcdf-config.cmake.in FixBundle.cmake.in nc-config.in.cmake configure configure.ac install-sh config.h.in config.sub CTestConfig.cmake.in)
+ENABLE_MAKEDIST(README.md COPYRIGHT RELEASE_NOTES.md INSTALL INSTALL.cmake test_prog.c lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt config.h.cmake.in cmake_uninstall.cmake.in netcdf-config-version.cmake.in netcdf-config.cmake.in FixBundle.cmake.in nc-config.cmake.in configure configure.ac install-sh config.h.in config.sub CTestConfig.cmake.in)
+
+#####
+# Configure and print the libnetcdf.settings file.
+#####
+
+# Set variables to mirror those used by autoconf.
+# This way we don't need to maintain two separate template
+# files.
+SET(host_cpu "${cpu}")
+SET(host_vendor "${osname}")
+SET(host_os "${osrel}")
+SET(abs_top_builddir "${CMAKE_BINARY_DIR}")
+
+SET(CC_VERSION "${CMAKE_C_COMPILER}")
+
+# Build *FLAGS for libnetcdf.settings.
+SET(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}")
+SET(CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${CMAKE_BUILD_TYPE}}")
+SET(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE}}")
+
+is_disabled(BUILD_SHARED_LIBS enable_static)
+is_enabled(BUILD_SHARED_LIBS enable_shared)
+
+# Remove libnetcdf from NC_LIBS.
+STRING(REPLACE "-lnetcdf " "" TMP_NC_LIBS "${NC_LIBS}")
+SET(LIBS "${TMP_NC_LIBS}")
+
+is_enabled(ENABLE_V2_API HAS_NC2)
+is_enabled(ENABLE_NETCDF_4 HAS_NC4)
+is_enabled(ENABLE_HDF4 HAS_HDF4)
+is_enabled(ENABLE_NETCDF_4 HAS_HDF5)
+is_enabled(STATUS_PNETCDF HAS_PNETCDF)
+is_enabled(STATUS_PARALLEL HAS_PARALLEL)
+is_enabled(USE_DAP HAS_DAP)
+is_enabled(USE_DISKLESS HAS_DISKLESS)
+is_enabled(USE_MMAP HAS_MMAP)
+is_enabled(JNA HAS_JNA)
+
+# Generate file from template.
+
+CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/libnetcdf.settings.in"
+  "${CMAKE_CURRENT_BINARY_DIR}/libnetcdf.settings"
+  @ONLY
+  )
+
+# Read in settings file, print out.
+# Avoid using system-specific calls so that this
+# might also work on Windows.
+FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/libnetcdf.settings"
+  LIBNETCDF_SETTINGS)
+MESSAGE(${LIBNETCDF_SETTINGS})
+
+# Install libnetcdf.settings file into same location
+# as the libraries.
+INSTALL(FILES "${netCDF_BINARY_DIR}/libnetcdf.settings"
+  DESTINATION "${CMAKE_INSTALL_BINDIR}"
+  COMPONENT libraries)
+
+#####
+# End libnetcdf.settings section.
+#####
 
 # CPack inclusion must come last.
 INCLUDE(CPack)
diff --git a/CTestConfig.cmake b/CTestConfig.cmake
new file mode 100644
index 0000000..84fa0fb
--- /dev/null
+++ b/CTestConfig.cmake
@@ -0,0 +1,17 @@
+## 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.
+##
+## # The following are required to submit to the CDash dashboard:
+##   ENABLE_TESTING()
+##   INCLUDE(CTest)
+
+set(DART_TESTING_TIMEOUT "4800")
+
+set(CTEST_PROJECT_NAME "netcdf-c")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org") 
+set(CTEST_DROP_LOCATION "/submit.php?project=netcdf-c")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Doxyfile b/Doxyfile
index a84e55a..64c7e1e 100755
--- a/Doxyfile
+++ b/Doxyfile
@@ -45,7 +45,7 @@ PROJECT_BRIEF          = "The netCDF C libraries"
 # exceed 55 pixels and the maximum width should not exceed 200 pixels. 
 # Doxygen will copy the logo to the output directory.
 
-PROJECT_LOGO           = ./man4/unidata_logo_cmyk.png
+PROJECT_LOGO           = ./docs/unidata_logo_cmyk.png
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 
diff --git a/Makefile.am b/Makefile.am
index e1849e8..670b6eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,12 +10,12 @@ ACLOCAL_AMFLAGS = -I m4
 
 # These files get added to the distribution.
 EXTRA_DIST = README.md COPYRIGHT INSTALL INSTALL.cmake test_prog.c \
-	lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt config.h.in.cmake \
-	config.h.in.cmake cmake_uninstall.cmake.in \
+	lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt \
+	config.h.cmake.in cmake_uninstall.cmake.in \
 	netcdf-config-version.cmake.in \
 	netcdf-config.cmake.in FixBundle.cmake.in \
-	nc-config.in.cmake RELEASE_NOTES.md CTestCustom.cmake \
-	CTestConfig.cmake.in
+	nc-config.cmake.in RELEASE_NOTES.md CTestCustom.cmake \
+	CTestConfig.cmake.in libnetcdf.settings
 
 # Doxygen doesn't build nicely in vpath builds.
 # Don't do this; it wipes out any exported values
@@ -25,9 +25,9 @@ pkgconfigdir=$(libdir)/pkgconfig
 pkgconfig_DATA = netcdf.pc
 
 # We need a way to automatically generate INSTALL from
-# man4/install.doc, now that we've switched from texinfo to doxygen.
+# docs/install.doc, now that we've switched from texinfo to doxygen.
 # INSTALL:
-#	non-existent-doxygen-to-text-utility <  man4/install.doc > INSTALL
+#	non-existent-doxygen-to-text-utility <  docs/install.doc > INSTALL
 
 # Does the user want to build the V2 API?
 if BUILD_V2
@@ -89,7 +89,7 @@ SUBDIRS = include $(OCLIB) $(H5_TEST_DIR) libdispatch libsrc		\
 $(LIBSRC4_DIR) $(DAP2) $(LIBCDMR) $(LIBSRC5) liblib  \
 $(NCGEN3) $(NCGEN) $(NCDUMP) \
 $(TESTDIRS) \
-man4 $(EXAMPLES) \
+docs $(EXAMPLES) \
 $(UDUNITS) $(LIBCF)
 
 # Remove these generated files, for a distclean.
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index c49e793..a8e047e 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -9,6 +9,20 @@ This file contains a high-level description of this package's evolution. Release
 
 ### 4.3.3-rc1 Released TBD
 
+* Bumped minimum CMake version to `2.8.9` from `2.8.8` as part of a larger pull request contributed by Nico Schlömer. [Pull Request #64](https://github.com/Unidata/netcdf-c/pull/64) 
+
+* Replaced the `NetCDF Library Architecture` image with an updated version from the 2012 NetCDF Workshop slides.  
+
+* Fix HDF4 files to support chunking.
+  [NCF-272](https://bugtracking.unidata.ucar.edu/browse/NCF-272)
+
+* NetCDF creates a `libnetcdf.settings` file after configuration now, similar to those generated by `HDF4` and `HDF5`.  It is installed into the same directory as the libraries. [NCF-303](https://bugtracking.unidata.ucar.edu/browse/NCF-303).
+
+
+* Renamed `man4/` directory to `docs/` to make the purpose and contents clearer. See [man4 vs. docs #60](https://github.com/Unidata/netcdf-c/issues/60).
+
+* Removed redundant variable `BUILD_DOCS` from the CMake configuration file.  See the issue at github: [BUILD\_DOCS, ENABLE\_DOXYGEN #59](https://github.com/Unidata/netcdf-c/issues/59).
+
 * Added missing documentation templates to `man4/Makefile.am`, to correct an issue when trying to build the local `Doxygen`-generated documentation. This issue was reported by Nico Schlömer and may be viewed on github.  [Releases miss Doxygen files #56](https://github.com/Unidata/netcdf-c/issues/56)
 
 * When the NC_MPIPOSIX flag is given for parallel I/O access and the HDF5 library does not have the MPI-POSIX VFD configured in, the NC_MPIPOSIX flag is transparently aliased to the NC_MPIIO flag within the netCDF-4 library.
diff --git a/cf b/cf
index ac3bca2..831645f 100644
--- a/cf
+++ b/cf
@@ -21,16 +21,16 @@ CFLAGS=""
 #CFLAGS="-Wall -Wno-unused-variable -Wno-unused-parameter ${CFLAGS}"
 #CFLAGS="-Wconversion"
 
-PREFIX=/usr/local
 stddir="/usr/local"
-
-if test "x$cmds" = x ; then
-cmds=""
-#cmds="all"
-#cmds="all check"
-#cmds="all dist"
-#cmds="all distcheck"
-#cmds="$cmds install"
+PREFIX=/usr/local
+if test "x${cmds}" = x ; then
+  cmds=""
+else
+for f in $cmds ; do
+  if test "x$f" = "xdistcheck" ; then
+    PREFIX=/tmp/$HOST
+  fi
+done
 fi
 
 # HDF4=>HDF5
diff --git a/config.h.in.cmake b/config.h.cmake.in
similarity index 100%
rename from config.h.in.cmake
rename to config.h.cmake.in
diff --git a/configure.ac b/configure.ac
index 99b582d..ddf2b61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,9 +17,15 @@ AC_PREREQ([2.59])
 # Initialize with name, version, and support email address. 
 AC_INIT([netCDF], [4.3.3-rc1], [support-netcdf at unidata.ucar.edu])
 
+
+#####
+# Set some variables used to generate a libnetcdf.settings file,
+# pattered after the files generated by libhdf4, libhdf5.
+#####
+
 # Create the VERSION file, which contains the package version from
 # AC_INIT.
-echo -n AC_PACKAGE_VERSION>VERSION
+echo AC_PACKAGE_VERSION>VERSION
 AC_SUBST(PACKAGE_VERSION)
 
 AC_MSG_NOTICE([netCDF AC_PACKAGE_VERSION])
@@ -27,6 +33,9 @@ AC_MSG_NOTICE([netCDF AC_PACKAGE_VERSION])
 # Keep libtool macros in an m4 directory.
 AC_CONFIG_MACRO_DIR([m4])
 
+# Configuration Date
+AC_SUBST([CONFIG_DATE]) CONFIG_DATE="`date`"
+
 # Find out about the host we're building on.
 AC_CANONICAL_HOST
 
@@ -532,6 +541,29 @@ AC_DEFINE_UNQUOTED([TEMP_LARGE], ["$TEMP_LARGE"], [Place to put very large netCD
 # Find the C compiler.
 AC_MSG_NOTICE([finding C compiler])
 
+## Compiler with version information. This consists of the full path
+## name of the compiler and the reported version number.
+AC_SUBST([CC_VERSION])
+## Strip anything that looks like a flag off of $CC
+CC_NOFLAGS=`echo $CC | sed 's/ -.*//'`
+
+if `echo $CC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
+  CC_VERSION="$CC"
+else
+  CC_VERSION="$CC";
+  for x in `echo $PATH | sed -e 's/:/ /g'`; do
+    if test -x $x/$CC_NOFLAGS; then
+      CC_VERSION="$x/$CC"
+      break
+    fi
+  done
+fi
+if test -n "$cc_version_info"; then
+  CC_VERSION="$CC_VERSION ( $cc_version_info)"
+fi
+
+
+
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_C_CONST
@@ -627,13 +659,15 @@ fi
 if test "x$enable_doxygen" != xno; then
    if test -n "$DOXYGEN"; then
         AC_SUBST(HAVE_DOT)   
-        AC_CONFIG_FILES([man4/Doxyfile])
+        AC_CONFIG_FILES([docs/Doxyfile
+			 docs/Doxyfile.guide
+			 docs/Doxyfile.tutorial])
    fi
 # Note: the list of files to input to doxygen
-# has been moved to man4/Doxyfile.in so
+# has been moved to docs/Doxyfile.in so
 # that make distcheck works correctly.
 # Any new inputs should be inserted into
-# man4/Doxyfile.in and possibley man4/Makefile.am
+# docs/Doxyfile.in and possibley docs/Makefile.am
 fi
 
 # Find the install program.
@@ -955,15 +989,6 @@ esac
 
 NC_FLIBS="-lnetcdff $NC_LIBS"
 
-AC_SUBST(NC_LIBS,[$NC_LIBS])
-AC_SUBST(HAS_DAP,[$enable_dap])
-AC_SUBST(HAS_NC2,[$nc_build_v2])
-AC_SUBST(HAS_NC4,[$enable_netcdf_4])
-AC_SUBST(HAS_HDF4,[$enable_hdf4])
-AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
-AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
-AC_SUBST(HAS_SZLIB,[$nc_has_szlib])
-
 # temporary to deal with a JNA problem
 AC_MSG_CHECKING([If compilation is for use with JNA])
 AC_ARG_ENABLE([jna],
@@ -977,6 +1002,19 @@ if test "x$enable_jna" = xyes ; then
 AC_DEFINE([JNA], [1], [if true, include JNA bug fix])
 fi
 
+AC_SUBST(NC_LIBS,[$NC_LIBS])
+AC_SUBST(HAS_DAP,[$enable_dap])
+AC_SUBST(HAS_NC2,[$nc_build_v2])
+AC_SUBST(HAS_NC4,[$enable_netcdf_4])
+AC_SUBST(HAS_HDF4,[$enable_hdf4])
+AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
+AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
+AC_SUBST(HAS_SZLIB,[$nc_has_szlib])
+AC_SUBST(HAS_PARALLEL,[$enable_parallel])
+AC_SUBST(HAS_DISKLESS,[$enable_diskless])
+AC_SUBST(HAS_MMAP,[$enable_mmap])
+AC_SUBST(HAS_JNA,[$enable_jna])
+
 # Include some specifics for netcdf on windows.
 #AH_VERBATIM([_WIN32_STRICMP],
 AH_BOTTOM(
@@ -994,15 +1032,29 @@ AH_BOTTOM([#include "ncconfigure.h"])
 # debugging purposes.
 # cp confdefs.h my_config.h
 
+# Create output variables from various 
+# shell variables, for use in generating
+# libnetcdf.settings.
+AC_SUBST([enable_shared])
+AC_SUBST([enable_static])
+AC_SUBST([CFLAGS])
+AC_SUBST([CPPFLAGS])
+AC_SUBST([LDFLAGS])
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CPPFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
+
 
 AC_MSG_NOTICE([generating header files and makefiles])
 AC_CONFIG_FILES([Makefile
                  nc-config
                  netcdf.pc
+		 libnetcdf.settings
                  include/Makefile
                  h5_test/Makefile
-                 man4/Makefile
-                 man4/images/Makefile
+                 docs/Makefile
+                 docs/images/Makefile
                  libsrc/Makefile
                  libsrc4/Makefile
                  libsrc5/Makefile
@@ -1030,3 +1082,5 @@ AC_CONFIG_FILES([Makefile
 		 ],
                  [test -f  nc-config && chmod 755 nc-config])
 AC_OUTPUT()
+
+cat libnetcdf.settings
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
new file mode 100644
index 0000000..a5e0844
--- /dev/null
+++ b/docs/CMakeLists.txt
@@ -0,0 +1,71 @@
+#####
+# Build doxygen documentation, if need be.
+#####
+IF(ENABLE_DOXYGEN)
+  # The following is redundant but does not hurt anything.
+
+  FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.html ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_SOURCE_DIR}/*.doc ${CMAKE_CURRENT_SOURCE_DIR}/*.xml ${CMAKE_CURRENT_SOURCE_DIR}/*.m4 ${CMAKE_CURRENT_SOURCE_DIR}/*.texi)
+  FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
+
+   # Set abs_top_srcdir to work with the autotools
+  # doxyfile template.
+  SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
+  SET(abs_builddir ${CMAKE_CURRENT_BINARY_DIR})
+  # Create general and guide doxyfiles.
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
+    ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.guide.in
+    ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.guide @ONLY)
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.tutorial.in
+    ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.tutorial @ONLY)
+
+  # We need to loop through twice. First to generate tags.
+  ADD_CUSTOM_TARGET(all_doc_tags ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating API Tags" VERBATIM
+    )
+  ADD_CUSTOM_TARGET(all_doc_tags_guide ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.guide
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating Guide Tags" VERBATIM
+    )
+  ADD_CUSTOM_TARGET(all_doc_tags_tutorial ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.tutorial
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating Tutorial Tags" VERBATIM
+    )
+
+  # Second, generate documentation that uses the tags.
+  ADD_CUSTOM_TARGET(doc_all ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating API Documentation" VERBATIM
+    )
+  ADD_CUSTOM_TARGET(doc_guide ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.guide
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating NetCDF Users Guide" VERBATIM
+    )
+  ADD_CUSTOM_TARGET(doc_tutorial ALL
+    ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.tutorial
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    COMMENT "Generating Tutorial Tags" VERBATIM
+    )
+
+  # Copy the image files used by markdown documentation
+  # manually.
+  FILE(GLOB IMG_FILES ${CMAKE_CURRENT_BINARY_DIR}/images/*.jpg
+    ${CMAKE_CURRENT_BINARY_DIR}/images/*.png)
+
+  FILE(COPY ${IMG_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html)
+
+  INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
+    DESTINATION ${CMAKE_INSTALL_DOCDIR}
+    COMPONENT documentation)
+
+ENDIF(ENABLE_DOXYGEN)
+
+SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am netcdf.m4 DoxygenLayout.xml Doxyfile.in Doxyfile.guide.in footer.html mainpage.dox tutorial.dox install.dox dispatch.dox guide.dox types.dox notes.dox cdl.dox architecture.dox internal.dox install-fortran.dox Doxyfile.in.cmake windows-binaries.md building-with-cmake.md)
+
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/man4/Doxyfile.guide.in b/docs/Doxyfile.guide.in
similarity index 99%
rename from man4/Doxyfile.guide.in
rename to docs/Doxyfile.guide.in
index 149cd90..0c3e266 100644
--- a/man4/Doxyfile.guide.in
+++ b/docs/Doxyfile.guide.in
@@ -51,7 +51,7 @@ PROJECT_BRIEF          =
 # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
 # to the output directory.
 
-PROJECT_LOGO           = ../../man4/netcdf-50x50.png
+PROJECT_LOGO           = @abs_top_srcdir@/docs/netcdf-50x50.png
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
 # into which the generated documentation will be written. If a relative path is
@@ -661,7 +661,7 @@ FILE_VERSION_FILTER    =
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
 # tag is left empty.
 
-LAYOUT_FILE            = @abs_top_srcdir@/man4/DoxygenLayout.xml
+LAYOUT_FILE            = @abs_top_srcdir@/docs/DoxygenLayout.xml
 
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
 # the reference definitions. This must be a list of .bib files. The .bib
@@ -743,7 +743,7 @@ WARN_LOGFILE           =
 # spaces.
 # Note: If this tag is empty the current directory is searched.
 
-INPUT = @abs_top_srcdir@/man4/guide.dox
+INPUT = @abs_top_srcdir@/docs/guide.dox
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -831,19 +831,19 @@ EXAMPLE_RECURSIVE      = NO
 # that contain images that are to be included in the documentation (see the
 # \image command).
 
-IMAGE_PATH = @abs_top_srcdir@/man4/images/chunking2.png \
-    @abs_top_srcdir@/man4/images/compatibility3.png \
-    @abs_top_srcdir@/man4/images/compression.png \
-    @abs_top_srcdir@/man4/images/groups.png \
-    @abs_top_srcdir@/man4/images/nc4-model.png \
-    @abs_top_srcdir@/man4/images/ncatts.png \
-    @abs_top_srcdir@/man4/images/nc-classic-uml.png \
-    @abs_top_srcdir@/man4/images/nccoords.png \
-    @abs_top_srcdir@/man4/images/ncfile.png \
-    @abs_top_srcdir@/man4/images/netcdf_architecture.png \
-    @abs_top_srcdir@/man4/images/pnetcdf.png \
-    @abs_top_srcdir@/man4/images/deptree.jpg \
-    @abs_top_srcdir@/man4/images/InstallTreeWindows.jpg
+IMAGE_PATH = @abs_top_srcdir@/docs/images/chunking2.png \
+    @abs_top_srcdir@/docs/images/compatibility3.png \
+    @abs_top_srcdir@/docs/images/compression.png \
+    @abs_top_srcdir@/docs/images/groups.png \
+    @abs_top_srcdir@/docs/images/nc4-model.png \
+    @abs_top_srcdir@/docs/images/ncatts.png \
+    @abs_top_srcdir@/docs/images/nc-classic-uml.png \
+    @abs_top_srcdir@/docs/images/nccoords.png \
+    @abs_top_srcdir@/docs/images/ncfile.png \
+    @abs_top_srcdir@/docs/images/netcdf_architecture.png \
+    @abs_top_srcdir@/docs/images/pnetcdf.png \
+    @abs_top_srcdir@/docs/images/deptree.jpg \
+    @abs_top_srcdir@/docs/images/InstallTreeWindows.jpg
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
@@ -1076,7 +1076,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            = @abs_top_srcdir@/man4/footer.html
+HTML_FOOTER            = @abs_top_srcdir@/docs/footer.html
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of
diff --git a/man4/Doxyfile.in b/docs/Doxyfile.in
similarity index 98%
rename from man4/Doxyfile.in
rename to docs/Doxyfile.in
index e2108ef..1666c1b 100644
--- a/man4/Doxyfile.in
+++ b/docs/Doxyfile.in
@@ -51,7 +51,7 @@ PROJECT_BRIEF          =
 # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
 # to the output directory.
 
-PROJECT_LOGO           = ../../man4/netcdf-50x50.png
+PROJECT_LOGO           = @abs_top_srcdir@/docs/netcdf-50x50.png
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
 # into which the generated documentation will be written. If a relative path is
@@ -661,7 +661,7 @@ FILE_VERSION_FILTER    =
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
 # tag is left empty.
 
-LAYOUT_FILE            = @abs_top_srcdir@/man4/DoxygenLayout.xml
+LAYOUT_FILE            = @abs_top_srcdir@/docs/DoxygenLayout.xml
 
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
 # the reference definitions. This must be a list of .bib files. The .bib
@@ -746,19 +746,19 @@ WARN_LOGFILE           =
 INPUT = \
     @abs_top_srcdir@/RELEASE_NOTES.md \
     @abs_top_srcdir@/COPYRIGHT \
-    @abs_top_srcdir@/man4/groups.dox \
-    @abs_top_srcdir@/man4/mainpage.dox \
-    @abs_top_srcdir@/man4/install.md \
-    @abs_top_srcdir@/man4/install-fortran.md \
-    @abs_top_srcdir@/man4/dispatch.dox \
-    @abs_top_srcdir@/man4/types.dox \
-    @abs_top_srcdir@/man4/notes.dox \
-    @abs_top_srcdir@/man4/cdl.dox \
-    @abs_top_srcdir@/man4/architecture.dox \
-    @abs_top_srcdir@/man4/internal.dox \
-    @abs_top_srcdir@/man4/windows-binaries.md \
-    @abs_top_srcdir@/man4/all-error-codes.md \
-    @abs_top_srcdir@/man4/cmake_faq.md \
+    @abs_top_srcdir@/docs/groups.dox \
+    @abs_top_srcdir@/docs/mainpage.dox \
+    @abs_top_srcdir@/docs/install.md \
+    @abs_top_srcdir@/docs/install-fortran.md \
+    @abs_top_srcdir@/docs/dispatch.dox \
+    @abs_top_srcdir@/docs/types.dox \
+    @abs_top_srcdir@/docs/notes.dox \
+    @abs_top_srcdir@/docs/cdl.dox \
+    @abs_top_srcdir@/docs/architecture.dox \
+    @abs_top_srcdir@/docs/internal.dox \
+    @abs_top_srcdir@/docs/windows-binaries.md \
+    @abs_top_srcdir@/docs/all-error-codes.md \
+    @abs_top_srcdir@/docs/cmake_faq.md \
     @abs_top_srcdir@/include/netcdf.h \
     @abs_top_srcdir@/libdispatch/dfile.c \
     @abs_top_srcdir@/libdispatch/ddim.c \
@@ -869,19 +869,19 @@ EXAMPLE_RECURSIVE      = NO
 # that contain images that are to be included in the documentation (see the
 # \image command).
 
-IMAGE_PATH = @abs_top_srcdir@/man4/images/chunking2.png \
-    @abs_top_srcdir@/man4/images/compatibility3.png \
-    @abs_top_srcdir@/man4/images/compression.png \
-    @abs_top_srcdir@/man4/images/groups.png \
-    @abs_top_srcdir@/man4/images/nc4-model.png \
-    @abs_top_srcdir@/man4/images/ncatts.png \
-    @abs_top_srcdir@/man4/images/nc-classic-uml.png \
-    @abs_top_srcdir@/man4/images/nccoords.png \
-    @abs_top_srcdir@/man4/images/ncfile.png \
-    @abs_top_srcdir@/man4/images/netcdf_architecture.png \
-    @abs_top_srcdir@/man4/images/pnetcdf.png \
-    @abs_top_srcdir@/man4/images/deptree.jpg \
-    @abs_top_srcdir@/man4/images/InstallTreeWindows.jpg
+IMAGE_PATH = @abs_top_srcdir@/docs/images/chunking2.png \
+    @abs_top_srcdir@/docs/images/compatibility3.png \
+    @abs_top_srcdir@/docs/images/compression.png \
+    @abs_top_srcdir@/docs/images/groups.png \
+    @abs_top_srcdir@/docs/images/nc4-model.png \
+    @abs_top_srcdir@/docs/images/ncatts.png \
+    @abs_top_srcdir@/docs/images/nc-classic-uml.png \
+    @abs_top_srcdir@/docs/images/nccoords.png \
+    @abs_top_srcdir@/docs/images/ncfile.png \
+    @abs_top_srcdir@/docs/images/netcdf_architecture.png \
+    @abs_top_srcdir@/docs/images/pnetcdf.png \
+    @abs_top_srcdir@/docs/images/deptree.jpg \
+    @abs_top_srcdir@/docs/images/InstallTreeWindows.jpg
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
@@ -1114,7 +1114,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            = @abs_top_srcdir@/man4/footer.html
+HTML_FOOTER            = @abs_top_srcdir@/docs/footer.html
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of
diff --git a/man4/Doxyfile.tutorial.in b/docs/Doxyfile.tutorial.in
similarity index 99%
rename from man4/Doxyfile.tutorial.in
rename to docs/Doxyfile.tutorial.in
index f744df4..e7b399c 100644
--- a/man4/Doxyfile.tutorial.in
+++ b/docs/Doxyfile.tutorial.in
@@ -51,7 +51,7 @@ PROJECT_BRIEF          =
 # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
 # to the output directory.
 
-PROJECT_LOGO           = ../../man4/netcdf-50x50.png
+PROJECT_LOGO           = @abs_top_srcdir@/docs/netcdf-50x50.png
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
 # into which the generated documentation will be written. If a relative path is
@@ -661,7 +661,7 @@ FILE_VERSION_FILTER    =
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
 # tag is left empty.
 
-LAYOUT_FILE            = @abs_top_srcdir@/man4/DoxygenLayout.xml
+LAYOUT_FILE            = @abs_top_srcdir@/docs/DoxygenLayout.xml
 
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
 # the reference definitions. This must be a list of .bib files. The .bib
@@ -743,7 +743,7 @@ WARN_LOGFILE           =
 # spaces.
 # Note: If this tag is empty the current directory is searched.
 
-INPUT = @abs_top_srcdir@/man4/tutorial.dox \
+INPUT = @abs_top_srcdir@/docs/tutorial.dox \
     @abs_top_srcdir@/examples/C/simple_xy_wr.c \
     @abs_top_srcdir@/examples/C/simple_xy_rd.c \
     @abs_top_srcdir@/examples/C/sfc_pres_temp_wr.c \
@@ -842,19 +842,19 @@ EXAMPLE_RECURSIVE      = NO
 # that contain images that are to be included in the documentation (see the
 # \image command).
 
-IMAGE_PATH = @abs_top_srcdir@/man4/images/chunking2.png \
-    @abs_top_srcdir@/man4/images/compatibility3.png \
-    @abs_top_srcdir@/man4/images/compression.png \
-    @abs_top_srcdir@/man4/images/groups.png \
-    @abs_top_srcdir@/man4/images/nc4-model.png \
-    @abs_top_srcdir@/man4/images/ncatts.png \
-    @abs_top_srcdir@/man4/images/nc-classic-uml.png \
-    @abs_top_srcdir@/man4/images/nccoords.png \
-    @abs_top_srcdir@/man4/images/ncfile.png \
-    @abs_top_srcdir@/man4/images/netcdf_architecture.png \
-    @abs_top_srcdir@/man4/images/pnetcdf.png \
-    @abs_top_srcdir@/man4/images/deptree.jpg \
-    @abs_top_srcdir@/man4/images/InstallTreeWindows.jpg
+IMAGE_PATH = @abs_top_srcdir@/docs/images/chunking2.png \
+    @abs_top_srcdir@/docs/images/compatibility3.png \
+    @abs_top_srcdir@/docs/images/compression.png \
+    @abs_top_srcdir@/docs/images/groups.png \
+    @abs_top_srcdir@/docs/images/nc4-model.png \
+    @abs_top_srcdir@/docs/images/ncatts.png \
+    @abs_top_srcdir@/docs/images/nc-classic-uml.png \
+    @abs_top_srcdir@/docs/images/nccoords.png \
+    @abs_top_srcdir@/docs/images/ncfile.png \
+    @abs_top_srcdir@/docs/images/netcdf_architecture.png \
+    @abs_top_srcdir@/docs/images/pnetcdf.png \
+    @abs_top_srcdir@/docs/images/deptree.jpg \
+    @abs_top_srcdir@/docs/images/InstallTreeWindows.jpg
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
@@ -1087,7 +1087,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            = @abs_top_srcdir@/man4/footer.html
+HTML_FOOTER            = @abs_top_srcdir@/docs/footer.html
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of
diff --git a/man4/DoxygenLayout.xml b/docs/DoxygenLayout.xml
similarity index 100%
rename from man4/DoxygenLayout.xml
rename to docs/DoxygenLayout.xml
diff --git a/man4/Makefile.am b/docs/Makefile.am
similarity index 80%
rename from man4/Makefile.am
rename to docs/Makefile.am
index 952f473..75ee6b5 100644
--- a/man4/Makefile.am
+++ b/docs/Makefile.am
@@ -25,7 +25,7 @@ if BUILD_DOCS
 
 # Copy man pages.
 #directory = $(top_srcdir)/docs/man/man3/
-#dist_man_MANS = $(man4directory)/man_page_1.3 $(directory)/man_page_2.3
+#dist_man_MANS = $(docsdirectory)/man_page_1.3 $(directory)/man_page_2.3
 # $(directory)/man_page_1.3: doxyfile.stamp
 # $(directory)/man_page_2.3: doxyfile.stamp
 
@@ -39,14 +39,24 @@ if BUILD_DOCS
 
 all-local: doxyfile.stamp
 clean-local:
-	rm -rf $(top_builddir)/man4/man
-	rm -rf $(top_builddir)/man4/html
-	rm -rf $(top_builddir)/man4/latex
+	rm -rf $(top_builddir)/docs/man
+	rm -rf $(top_builddir)/docs/html
+	rm -rf $(top_builddir)/docs/latex
 endif 
 
 # Timestamp to prevent rebuilds.
+# We must do this twice. The first time
+# builds the tag files. The second time
+# includes them in the documentation.
+
 doxyfile.stamp:
 	$(DOXYGEN) Doxyfile
+	$(DOXYGEN) Doxyfile.guide
+	$(DOXYGEN) Doxyfile.tutorial
+
+	$(DOXYGEN) Doxyfile
+	$(DOXYGEN) Doxyfile.guide
+	$(DOXYGEN) Doxyfile.tutorial
 	echo Timestamp > doxyfile.stamp
 
 CLEANFILES = doxyfile.stamp html latex man
diff --git a/man4/all-error-codes.md b/docs/all-error-codes.md
similarity index 100%
rename from man4/all-error-codes.md
rename to docs/all-error-codes.md
diff --git a/docs/architecture.dox b/docs/architecture.dox
new file mode 100644
index 0000000..ef19ed2
--- /dev/null
+++ b/docs/architecture.dox
@@ -0,0 +1,20 @@
+/** \file 
+Documentation of netCDF architecture.
+
+\page architecture NetCDF Library Architecture
+
+\image html netcdf_architecture.png "NetCDF Architecture"
+\image latex netcdf_architecture.png "NetCDF Architecture"
+\image rtf netcdf_architecture.png "NetCDF Architecture"
+
+
+The netCDF C-based libraries depend on a core C library and some externally developed libraries.
+
+- NetCDF-Java is an independent implementation, not shown here
+- C-based 3rd-party netCDF APIs for other languages include Python, Ruby, Perl, Fortran-2003, MATLAB, IDL, and R
+- Libraries that don't support netCDF-4 include Perl and old C++
+- 3rd party libraries are optional (HDF5, HDF4, zlib, szlib, pnetcdf, libcurl), depending on what features are needed and how netCDF is configured
+- "Apps" in the above means applications, not mobile apps!
+
+*/
+
diff --git a/man4/building-with-cmake.md b/docs/building-with-cmake.md
similarity index 100%
rename from man4/building-with-cmake.md
rename to docs/building-with-cmake.md
diff --git a/man4/cdl.dox b/docs/cdl.dox
similarity index 99%
rename from man4/cdl.dox
rename to docs/cdl.dox
index 318b07c..ce99d60 100644
--- a/man4/cdl.dox
+++ b/docs/cdl.dox
@@ -268,4 +268,4 @@ acceptable double constants:
      1.d
 \endcode
 
-*/
\ No newline at end of file
+*/
diff --git a/man4/cmake_faq.md b/docs/cmake_faq.md
similarity index 98%
rename from man4/cmake_faq.md
rename to docs/cmake_faq.md
index 105a5f3..58934d0 100644
--- a/man4/cmake_faq.md
+++ b/docs/cmake_faq.md
@@ -69,4 +69,4 @@ Below are a list of commonly-asked questions regarding NetCDF and CMake.
             -DHDF5_INCLUDE_DIR=/usr/include/openmpi-x86_64 \
 		
 
-    You will, of course, need to use the location of the libraries specific to your development environment.
\ No newline at end of file
+    You will, of course, need to use the location of the libraries specific to your development environment.
diff --git a/man4/dispatch.dox b/docs/dispatch.dox
similarity index 100%
rename from man4/dispatch.dox
rename to docs/dispatch.dox
diff --git a/man4/errors.dox.old b/docs/errors.dox.old
similarity index 99%
rename from man4/errors.dox.old
rename to docs/errors.dox.old
index 7c1c84c..6e0300c 100644
--- a/man4/errors.dox.old
+++ b/docs/errors.dox.old
@@ -48,4 +48,4 @@ if (nc_inq(ncid, &ndims, NULL, NULL, NULL))
    return SOME_ERROR;
 \endcode
 
-*/
\ No newline at end of file
+*/
diff --git a/man4/esg.html b/docs/esg.html
similarity index 99%
rename from man4/esg.html
rename to docs/esg.html
index bc98dff..6bef0a4 100644
--- a/man4/esg.html
+++ b/docs/esg.html
@@ -1,5 +1,5 @@
 <html><!-- InstanceBegin template="/Templates/MyUnidata.dwt" codeOutsideHTMLIsLocked="true" -->
-<!-- This document is kept in netcdf-c/man4;
+<!-- This document is kept in netcdf-c/docs;
      it is not normally included in the distribution.
 -->
 <head>
diff --git a/man4/footer.html b/docs/footer.html
similarity index 100%
rename from man4/footer.html
rename to docs/footer.html
diff --git a/man4/groups.dox b/docs/groups.dox
similarity index 100%
rename from man4/groups.dox
rename to docs/groups.dox
diff --git a/man4/guide.dox b/docs/guide.dox
similarity index 100%
rename from man4/guide.dox
rename to docs/guide.dox
diff --git a/man4/header.html b/docs/header.html
similarity index 100%
rename from man4/header.html
rename to docs/header.html
diff --git a/man4/images/InstallTreeWindows.jpg b/docs/images/InstallTreeWindows.jpg
similarity index 100%
rename from man4/images/InstallTreeWindows.jpg
rename to docs/images/InstallTreeWindows.jpg
diff --git a/man4/images/InstallTreeWindows.png b/docs/images/InstallTreeWindows.png
similarity index 100%
rename from man4/images/InstallTreeWindows.png
rename to docs/images/InstallTreeWindows.png
diff --git a/man4/images/Makefile.am b/docs/images/Makefile.am
similarity index 100%
rename from man4/images/Makefile.am
rename to docs/images/Makefile.am
diff --git a/man4/images/aqua.jpg b/docs/images/aqua.jpg
similarity index 100%
rename from man4/images/aqua.jpg
rename to docs/images/aqua.jpg
diff --git a/man4/images/chunking2.png b/docs/images/chunking2.png
similarity index 100%
rename from man4/images/chunking2.png
rename to docs/images/chunking2.png
diff --git a/man4/images/compatibility3.png b/docs/images/compatibility3.png
similarity index 100%
rename from man4/images/compatibility3.png
rename to docs/images/compatibility3.png
diff --git a/man4/images/compression.png b/docs/images/compression.png
similarity index 100%
rename from man4/images/compression.png
rename to docs/images/compression.png
diff --git a/man4/images/deptree.jpg b/docs/images/deptree.jpg
similarity index 100%
rename from man4/images/deptree.jpg
rename to docs/images/deptree.jpg
diff --git a/man4/images/groups.png b/docs/images/groups.png
similarity index 100%
rename from man4/images/groups.png
rename to docs/images/groups.png
diff --git a/man4/images/nc-classic-uml.png b/docs/images/nc-classic-uml.png
similarity index 100%
rename from man4/images/nc-classic-uml.png
rename to docs/images/nc-classic-uml.png
diff --git a/man4/images/nc4-model.png b/docs/images/nc4-model.png
similarity index 100%
rename from man4/images/nc4-model.png
rename to docs/images/nc4-model.png
diff --git a/man4/images/ncatts.png b/docs/images/ncatts.png
similarity index 100%
rename from man4/images/ncatts.png
rename to docs/images/ncatts.png
diff --git a/man4/images/nccoords.png b/docs/images/nccoords.png
similarity index 100%
rename from man4/images/nccoords.png
rename to docs/images/nccoords.png
diff --git a/man4/images/ncfile.png b/docs/images/ncfile.png
similarity index 100%
rename from man4/images/ncfile.png
rename to docs/images/ncfile.png
diff --git a/man4/images/netcdf_architecture.odg b/docs/images/netcdf_architecture.odg
similarity index 100%
rename from man4/images/netcdf_architecture.odg
rename to docs/images/netcdf_architecture.odg
diff --git a/docs/images/netcdf_architecture.png b/docs/images/netcdf_architecture.png
new file mode 100644
index 0000000..0728e6b
Binary files /dev/null and b/docs/images/netcdf_architecture.png differ
diff --git a/man4/images/pnetcdf.png b/docs/images/pnetcdf.png
similarity index 100%
rename from man4/images/pnetcdf.png
rename to docs/images/pnetcdf.png
diff --git a/man4/images/terra.jpg b/docs/images/terra.jpg
similarity index 100%
rename from man4/images/terra.jpg
rename to docs/images/terra.jpg
diff --git a/man4/install-fortran.md b/docs/install-fortran.md
similarity index 100%
rename from man4/install-fortran.md
rename to docs/install-fortran.md
diff --git a/man4/install.dox b/docs/install.dox
similarity index 100%
rename from man4/install.dox
rename to docs/install.dox
diff --git a/man4/install.md b/docs/install.md
similarity index 100%
rename from man4/install.md
rename to docs/install.md
diff --git a/man4/internal.dox b/docs/internal.dox
similarity index 100%
rename from man4/internal.dox
rename to docs/internal.dox
diff --git a/man4/mainpage.dox b/docs/mainpage.dox
similarity index 100%
rename from man4/mainpage.dox
rename to docs/mainpage.dox
diff --git a/man4/netcdf-50x50.png b/docs/netcdf-50x50.png
similarity index 100%
rename from man4/netcdf-50x50.png
rename to docs/netcdf-50x50.png
diff --git a/man4/netcdf.m4 b/docs/netcdf.m4
similarity index 100%
rename from man4/netcdf.m4
rename to docs/netcdf.m4
diff --git a/man4/notes.dox b/docs/notes.dox
similarity index 100%
rename from man4/notes.dox
rename to docs/notes.dox
diff --git a/man4/old/defines.texi b/docs/old/defines.texi
similarity index 100%
rename from man4/old/defines.texi
rename to docs/old/defines.texi
diff --git a/man4/old/netcdf-c.texi b/docs/old/netcdf-c.texi
similarity index 100%
rename from man4/old/netcdf-c.texi
rename to docs/old/netcdf-c.texi
diff --git a/man4/old/netcdf-cxx.texi b/docs/old/netcdf-cxx.texi
similarity index 100%
rename from man4/old/netcdf-cxx.texi
rename to docs/old/netcdf-cxx.texi
diff --git a/man4/old/netcdf-cxx4.texi b/docs/old/netcdf-cxx4.texi
similarity index 100%
rename from man4/old/netcdf-cxx4.texi
rename to docs/old/netcdf-cxx4.texi
diff --git a/man4/old/netcdf-f77.texi b/docs/old/netcdf-f77.texi
similarity index 100%
rename from man4/old/netcdf-f77.texi
rename to docs/old/netcdf-f77.texi
diff --git a/man4/old/netcdf-f90.texi b/docs/old/netcdf-f90.texi
similarity index 100%
rename from man4/old/netcdf-f90.texi
rename to docs/old/netcdf-f90.texi
diff --git a/man4/old/netcdf-install.texi b/docs/old/netcdf-install.texi
similarity index 100%
rename from man4/old/netcdf-install.texi
rename to docs/old/netcdf-install.texi
diff --git a/man4/old/netcdf-internal.texi b/docs/old/netcdf-internal.texi
similarity index 100%
rename from man4/old/netcdf-internal.texi
rename to docs/old/netcdf-internal.texi
diff --git a/man4/old/netcdf-tutorial.texi b/docs/old/netcdf-tutorial.texi
similarity index 100%
rename from man4/old/netcdf-tutorial.texi
rename to docs/old/netcdf-tutorial.texi
diff --git a/man4/old/netcdf.texi b/docs/old/netcdf.texi
similarity index 100%
rename from man4/old/netcdf.texi
rename to docs/old/netcdf.texi
diff --git a/man4/tutorial.dox b/docs/tutorial.dox
similarity index 100%
rename from man4/tutorial.dox
rename to docs/tutorial.dox
diff --git a/man4/types.dox b/docs/types.dox
similarity index 94%
rename from man4/types.dox
rename to docs/types.dox
index df40b2f..32ccca9 100644
--- a/man4/types.dox
+++ b/docs/types.dox
@@ -1,8 +1,10 @@
-/** \file 
+/** \file types.dox Documentation related to NetCDF Types
 Documentation of types.
 
 \page data_type Data Types
 
+\tableofcontents
+
 Data in a netCDF file may be one of the \ref external_types, or may be
 a user-defined data type (see \ref user_defined_types).
 
@@ -163,7 +165,7 @@ nc_put_var1()/nc_get_var1(), nc_put_vara()/nc_get_vara(), or
 nc_put_vars()/nc_get_vars() functons to access attribute and variable
 data of user defined type.
 
-\subsection Compound Types
+\subsection compound_types Compound Types
 
 Compound types allow the user to combine atomic and user-defined types
 into C-like structs. Since users defined types may be used within a
@@ -183,7 +185,7 @@ are portable.
 For more information on creating and using compound types, see
 Compound Types in The NetCDF C Interface Guide.
 
-\subsection VLEN Types
+\subsection vlen_types VLEN Types
 
 Variable length arrays can be used to create a ragged array of data,
 in which one of the dimensions varies in size from point to point.
@@ -210,14 +212,14 @@ and pointers to the data, rather than the actual data.
 For more information on creating and using variable length arrays, see
 Variable Length Arrays in The NetCDF C Interface Guide.
 
-\subsection Opaque Types
+\subsection opaque_types Opaque Types
 
 Opaque types allow the user to store arrays of data blobs of a fixed size.
 
 For more information on creating and using opaque types, see Opaque
 Type in The NetCDF C Interface Guide.
 
-\subsection Enum Types
+\subsection enum_types Enum Types
 
 Enum types allow the user to specify an enumeration.
 
@@ -286,4 +288,14 @@ precision value you can write to a double variable is the largest
 double-precision number representable on your system that is less than
 2 to the 1024th power.
 
+The _uchar and _schar functions were introduced in netCDF-3 to
+eliminate an ambiguity, and support both signed and unsigned byte data.
+In netCDF-2, whether the external NC_BYTE type represented signed or
+unsigned values was left up to the user. In netcdf-3, we treat NC_BYTE
+as signed for the purposes of conversion to short, int, long, float, or
+double. (Of course, no conversion takes place when the internal type is
+signed char.) In the _uchar functions, we treat NC_BYTE as if it were
+unsigned. Thus, no NC_ERANGE error can occur converting between NC_BYTE
+and unsigned char.
+
 */
diff --git a/man4/unidata_logo_cmyk.png b/docs/unidata_logo_cmyk.png
similarity index 100%
rename from man4/unidata_logo_cmyk.png
rename to docs/unidata_logo_cmyk.png
diff --git a/man4/windows-binaries.md b/docs/windows-binaries.md
similarity index 100%
rename from man4/windows-binaries.md
rename to docs/windows-binaries.md
diff --git a/examples/C/CMakeLists.txt b/examples/C/CMakeLists.txt
index caa7cea..da62844 100644
--- a/examples/C/CMakeLists.txt
+++ b/examples/C/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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}) 
+FOREACH(F ${exam_C_tests})
   set(exam_C_tests_source ${exam_C_test_source} ${F}.c)
 ENDFOREACH()
 
diff --git a/examples/CDL/CMakeLists.txt b/examples/CDL/CMakeLists.txt
index f28f389..de80227 100644
--- a/examples/CDL/CMakeLists.txt
+++ b/examples/CDL/CMakeLists.txt
@@ -1,8 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
-
 SET(CDL_EXAMPLE_TESTS create_sample_files do_comps)
 
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl)
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index f0e72e0..6c6c7ba 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 ADD_SUBDIRECTORY(C)
 
 IF(BUILD_UTILITIES)
diff --git a/h5_test/CMakeLists.txt b/h5_test/CMakeLists.txt
index 7e8b10f..e8f3d56 100644
--- a/h5_test/CMakeLists.txt
+++ b/h5_test/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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_rd_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)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index a2117e2..1e15922 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} Makefile.am CMakeLists.txt)
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/include/netcdf.h b/include/netcdf.h
index 5d556bc..fb61ebb 100644
--- a/include/netcdf.h
+++ b/include/netcdf.h
@@ -76,7 +76,7 @@ extern "C" {
 #define NC_FILL_UINT    (4294967295U)
 #define NC_FILL_INT64   ((long long)-9223372036854775806LL)
 #define NC_FILL_UINT64  ((unsigned long long)18446744073709551614ULL)
-#define NC_FILL_STRING  ""
+#define NC_FILL_STRING  ((char *)"")
 /**@}*/
 
 /*! Max or min values for a type. Nothing greater/smaller can be
@@ -152,7 +152,7 @@ Use this in mode flags for both nc_create() and nc_open(). */
 #define NC_MPIIO         0x2000 
 /** Turn on MPI POSIX I/O.
 Use this in mode flags for both nc_create() and nc_open(). */
-#define NC_MPIPOSIX      0x4000
+#define NC_MPIPOSIX      0x4000 /**< \deprecated As of libhdf5 1.8.13. */
 #define NC_PNETCDF       0x8000	/**< Use parallel-netcdf library. Mode flag for nc_open(). */
 
 /** Format specifier for nc_set_default_format() and returned
diff --git a/libdap2/CMakeLists.txt b/libdap2/CMakeLists.txt
index 086f3d0..42e4083 100644
--- a/libdap2/CMakeLists.txt
+++ b/libdap2/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(dap2_SOURCES constraints.c dapcvt.c dapalign.c dapodom.c daputil.c ncdaperr.c cdf.c cache.c dapdump.c dapdebug.c dapattr.c ncd2dispatch.c getvara.c dceconstraints.c dcetab.c dceparse.c dcelex.c)
 
-add_library(dap2 OBJECT ${dap2_SOURCES}) 
+add_library(dap2 OBJECT ${dap2_SOURCES})
 
 ###
 # Options related to the man page generation.
diff --git a/libdap2/env b/libdap2/env
index e5eba9a..c0123c9 100644
--- a/libdap2/env
+++ b/libdap2/env
@@ -6,8 +6,7 @@ alias q0=;alias qq=;alias qv=;alias q=;alias  qh=;alias qqh=;alias qall=;alias q
 #TOP="/home/dmh/mach/netcdf-c"
 TOP="/cygdrive/f/git/netcdf-c"
 
-F="http://thredds.ucar.edu/thredds/dodsC/grib/NCEP/NAM/CONUS_12km/best"
-#CON="OneD.amp,TwoD.amp,ThreeD.amp"
+F="http://thredds1.nkn.uidaho.edu:8080/thredds/dodsC/NWCSC_INTEGRATED_SCENARIOS_ALL_CLIMATE/macav2livneh/TEST/macav2livneh_nocompress_tasmax_CSIRO-Mk3-6-0_historical_1980_1989_CONUS.nc"
 
 #VAR=SPEED
 
diff --git a/libdap2/getvara.c b/libdap2/getvara.c
index a105fe4..054609a 100644
--- a/libdap2/getvara.c
+++ b/libdap2/getvara.c
@@ -39,6 +39,7 @@ static int extract(NCDAPCOMMON*, Getvara*, CDFnode*, DCEsegment*, size_t diminde
 static int extractstring(NCDAPCOMMON*, Getvara*, CDFnode*, DCEsegment*, size_t dimindex, OClink, OCdatanode, struct NCMEMORY*);
 static void freegetvara(Getvara* vara);
 static NCerror makegetvar(NCDAPCOMMON*, CDFnode*, void*, nc_type, Getvara**);
+static NCerror attachsubset(CDFnode* target, CDFnode* template);
 
 /**************************************************/
 /**
@@ -1154,7 +1155,7 @@ template tree is typically a structural superset of target tree.
 WARNING: Dimensions are not attached 
 */
 
-NCerror
+static NCerror
 attachsubset(CDFnode* target, CDFnode* template)
 {
     NCerror ncstat = NC_NOERR;
diff --git a/libdap2/ncd2dispatch.c b/libdap2/ncd2dispatch.c
index 377c904..ba22475 100644
--- a/libdap2/ncd2dispatch.c
+++ b/libdap2/ncd2dispatch.c
@@ -5,6 +5,7 @@
 
 #include "ncdap.h"
 #include "ncd2dispatch.h"
+#include "dapalign.h"
 
 #ifdef HAVE_GETRLIMIT
 #  ifdef HAVE_SYS_RESOURCE_H
@@ -399,9 +400,9 @@ NCD2_open(const char * path, int mode,
 	ncloginit();
         if(nclogopen(value))
 	    ncsetlogging(1);
-	ocloginit();
-        if(oclogopen(value))
-	    ocsetlogging(1);
+	ncloginit();
+        if(nclogopen(value))
+	    ncsetlogging(1);
     }
 
     /* fetch and build the unconstrained DDS for use as
diff --git a/libdispatch/CMakeLists.txt b/libdispatch/CMakeLists.txt
index 06ebc86..c3f718c 100644
--- a/libdispatch/CMakeLists.txt
+++ b/libdispatch/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(libdispatch_SOURCES dparallel.c dcopy.c dfile.c ddim.c datt.c dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c dvarinq.c ddispatch.c nclog.c dstring.c dutf8proc.c ncuri.c nclist.c ncbytes.c nchashmap.c nctime.c dsubstrate.c nc.c nclistmgr.c)
 
 IF(USE_NETCDF4)
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index c6dfcb4..8b12cc5 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(liblib_LIBS dispatch netcdf3)
 
 #####
@@ -28,7 +24,7 @@ FOREACH(LIBS ${liblib_LIBS})
   SET(LARGS ${LARGS} $<TARGET_OBJECTS:${LIBS}>)
 ENDFOREACH()
 
-ADD_LIBRARY(netcdf ${LIB_TYPE} stub.c ${LARGS} )
+ADD_LIBRARY(netcdf stub.c ${LARGS} )
 IF(MOD_NETCDF_NAME)
   SET_TARGET_PROPERTIES(netcdf PROPERTIES LIBRARY_OUTPUT_NAME ${NETCDF_LIB_NAME})
   SET_TARGET_PROPERTIES(netcdf PROPERTIES ARCHIVE_OUTPUT_NAME ${NETCDF_LIB_NAME})
diff --git a/libnetcdf.settings.in b/libnetcdf.settings.in
new file mode 100644
index 0000000..b7345a1
--- /dev/null
+++ b/libnetcdf.settings.in
@@ -0,0 +1,39 @@
+NetCDF Configuration Summary
+============================
+
+General
+-------
+
+NetCDF Version:		@PACKAGE_VERSION@
+Configured On:		@CONFIG_DATE@
+Host System:		@host_cpu at -@host_vendor at -@host_os@
+Build Directory: 	@abs_top_builddir@
+Install Prefix:         @prefix@
+
+Compiling Options
+-----------------
+
+C Compiler:			@CC_VERSION@
+CFLAGS:				@CFLAGS@
+CPPFLAGS:			@CPPFLAGS@
+LDFLAGS:			@LDFLAGS@
+AM_CFLAGS			@AM_CFLAGS@
+AM_CPPFLAGS:			@AM_CPPFLAGS@
+AM_LDFLAGS:			@AM_LDFLAGS@
+Shared Library:			@enable_shared@
+Static Library:			@enable_static@
+Extra libraries:		@LIBS@
+
+
+Features:
+---------
+NetCDF-2 API:			@HAS_NC2@
+NetCDF-4 API:			@HAS_NC4@
+HDF4 Support:			@HAS_HDF4@
+HDF5 Support:			@HAS_HDF5@
+PNetCDF Support:		@HAS_PNETCDF@
+Parallel Support:		@HAS_PARALLEL@
+DAP Support:			@HAS_DAP@
+Diskless Support:		@HAS_DISKLESS@
+MMap Support:			@HAS_MMAP@
+JNA Support:			@HAS_JNA@
\ No newline at end of file
diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt
index 84e83f4..7d221fd 100644
--- a/libsrc/CMakeLists.txt
+++ b/libsrc/CMakeLists.txt
@@ -1,11 +1,6 @@
 ## This is a CMake file, part of Unidata's netCDF package.
 # Copyright 2012-2013, see the COPYRIGHT file for more information.
 
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
-
 # Process these files with m4.
 SET(m4_SOURCES attr ncx putget t_ncxx)
 foreach (f ${m4_SOURCES})      
@@ -52,7 +47,7 @@ ENDIF(BUILD_PARALLEL)
 # Generate the man page.
 IF(NOT MSVC)
 
-  FILE(GLOB libsrc_MANPAGE ${CMAKE_SOURCE_DIR}/man4/netcdf.m4)
+  FILE(GLOB libsrc_MANPAGE ${CMAKE_SOURCE_DIR}/docs/netcdf.m4)
   FILE(COPY ${libsrc_MANPAGE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
   ADD_CUSTOM_TARGET(manpage ALL
diff --git a/libsrc/Makefile.am b/libsrc/Makefile.am
index 1e4f3eb..f582953 100644
--- a/libsrc/Makefile.am
+++ b/libsrc/Makefile.am
@@ -61,7 +61,7 @@ ARGS_MANPAGE += -DPARALLEL_IO=TRUE
 endif
 
 # This rule generates the C manpage.
-netcdf.3: $(top_srcdir)/man4/netcdf.m4 
+netcdf.3: $(top_srcdir)/docs/netcdf.m4 
 	m4 $(M4FLAGS) $(ARGS_MANPAGE) $? >$@  || rm $@
 
 
diff --git a/libsrc4/CMakeLists.txt b/libsrc4/CMakeLists.txt
index af893f9..3d9e6c4 100644
--- a/libsrc4/CMakeLists.txt
+++ b/libsrc4/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 # Process these files with m4.
 
 SET(libsrc4_SOURCES nc4dispatch.c nc4attr.c nc4dim.c nc4file.c nc4grp.c nc4type.c nc4var.c ncfunc.c nc4internal.c nc4hdf.c)
diff --git a/libsrc4/nc4file.c b/libsrc4/nc4file.c
index e2d8ac6..f2aaf9b 100644
--- a/libsrc4/nc4file.c
+++ b/libsrc4/nc4file.c
@@ -2617,6 +2617,25 @@ nc4_open_hdf4_file(const char *path, int mode, NC *nc)
 	 }
       }
       if(dimsize) free(dimsize);
+
+      {
+        /* HDF4 files can be chunked */
+	HDF_CHUNK_DEF chunkdefs;
+	int flag;
+        if(!SDgetchunkinfo(var->sdsid, &chunkdefs, &flag)) {
+	    if(flag == HDF_NONE)
+		var->contiguous = NC_TRUE;
+            else if((flag & HDF_CHUNK) != 0) {
+		var->contiguous = NC_FALSE;
+		if (!(var->chunksizes = malloc(var->ndims * sizeof(size_t))))
+	 	    return NC_ENOMEM;
+	        for (d = 0; d < var->ndims; d++) {
+		    var->chunksizes[d] = chunkdefs.chunk_lengths[d];
+		}
+	    }
+	}
+      }
+
    } /* next var */
 
 #ifdef LOGGING
diff --git a/libsrc4/nc4hdf.c b/libsrc4/nc4hdf.c
index 1d41f21..bc0efde 100644
--- a/libsrc4/nc4hdf.c
+++ b/libsrc4/nc4hdf.c
@@ -1413,10 +1413,17 @@ var_create_dataset(NC_GRP_INFO_T *grp, NC_VAR_INFO_T *var, int write_dimid)
       /* If there are no unlimited dims, and no filters, and the user
        * has not specified chunksizes, use contiguous variable for
        * better performance. */
-      if (!unlimdim && !var->shuffle && !var->deflate && !var->options_mask &&
-          !var->fletcher32 && (var->chunksizes == NULL || !var->chunksizes[0]))
-         var->contiguous = NC_TRUE;
 
+      if(!var->shuffle && !var->deflate && !var->options_mask &&
+          !var->fletcher32 && (var->chunksizes == NULL || !var->chunksizes[0])) {
+#ifdef USE_HDF4
+      NC_HDF5_FILE_INFO_T *h5 = grp->nc4_info;
+      if(h5->hdf4 || !unlimdim)
+#else 
+      if(!unlimdim)
+#endif
+         var->contiguous = NC_TRUE;
+      }
       if (!(dimsize = malloc(var->ndims * sizeof(hsize_t))))
          BAIL(NC_ENOMEM);
       if (!(maxdimsize = malloc(var->ndims * sizeof(hsize_t))))
@@ -2535,17 +2542,18 @@ nc4_rec_write_groups_types(NC_GRP_INFO_T *grp)
    return NC_NOERR;
 }
 
-/* This function will copy data from one buffer to another, in
-   accordance with the types. Range errors will be noted, and the fill
-   value used (or the default fill value if none is supplied) for
-   values that overflow the type.
+/*! Copy data from one buffer to another, performing appropriate data conversion.
 
-   I should be able to take this out when HDF5 does the right thing
-   with data type conversion.
-
-   Ed Hartnett, 11/15/3
+  This function will copy data from one buffer to another, in
+  accordance with the types. Range errors will be noted, and the fill
+  value used (or the default fill value if none is supplied) for
+  values that overflow the type.
+  
+  I should be able to take this out when HDF5 does the right thing
+  with data type conversion.
+  
+  Ed Hartnett, 11/15/3
 */
-
 int
 nc4_convert_type(const void *src, void *dest, 
                  const nc_type src_type, const nc_type dest_type, 
@@ -3314,7 +3322,7 @@ nc4_convert_type(const void *src, void *dest,
             case NC_UBYTE:
                for (fp = (float *)src, ubp = dest; count < len; count++)
                {
-                  if (*fp > X_UCHAR_MAX || *fp < 0)
+		 if (*fp > X_UCHAR_MAX || *fp < 0)
                      (*range_error)++;
                   *ubp++ = *fp++;
                }
diff --git a/libsrc4/nc4var.c b/libsrc4/nc4var.c
index 4d6a683..ecdb60d 100644
--- a/libsrc4/nc4var.c
+++ b/libsrc4/nc4var.c
@@ -522,7 +522,12 @@ nc_def_var_nc4(int ncid, const char *name, nc_type xtype,
       }
 
       /* Check for unlimited dimension and turn off contiguous storage */
+      /* (unless HDF4 file) */
+#ifdef USE_HDF4
+      if (dim->unlimited && !h5->hdf4)
+#else
       if (dim->unlimited)
+#endif
 	 var->contiguous = NC_FALSE;
 
       /* Track dimensions for variable */
@@ -802,6 +807,7 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *deflate,
    NC_DIM_INFO_T *dim;
    int d;
    int retval;
+   nc_bool_t ishdf4 = NC_FALSE; /* Use this to avoid so many ifdefs */
 
    LOG((2, "%s: ncid 0x%x varid %d", __func__, ncid, varid));
 
@@ -809,6 +815,10 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *deflate,
    if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
       return retval;
 
+#ifdef USE_HDF4
+   ishdf4 = h5->hdf4;
+#endif
+
    /* Attempting to do any of these things on a netCDF-3 file produces
     * an error. */
    if (!h5)
@@ -883,6 +893,7 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *deflate,
       if (var->deflate || var->fletcher32 || var->shuffle)
 	 return NC_EINVAL;
       
+     if (!ishdf4) {
       for (d = 0; d < var->ndims; d++)
       {
 	 if ((retval = nc4_find_dim(grp, var->dimids[d], &dim, NULL)))
@@ -890,12 +901,12 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *deflate,
 	 if (dim->unlimited)
 	    return NC_EINVAL;
       }
-
       var->contiguous = NC_TRUE;
+    }
    }
 
    /* Chunksizes anyone? */
-   if (contiguous && *contiguous == NC_CHUNKED)
+   if (!ishdf4 && contiguous && *contiguous == NC_CHUNKED)
    {
       var->contiguous = NC_FALSE;
 
@@ -1005,11 +1016,13 @@ nc_inq_var_chunking_ints(int ncid, int varid, int *contiguousp, int *chunksizesp
    NC *nc;
    NC_GRP_INFO_T *grp; 
    NC_VAR_INFO_T *var;
+   NC_HDF5_FILE_INFO_T *h5;
+
    size_t *cs = NULL;
    int i, retval;
 
    /* Find this ncid's file info. */
-   if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, NULL)))
+   if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
       return retval;
    assert(nc);
 
@@ -1050,14 +1063,20 @@ nc_def_var_chunking_ints(int ncid, int varid, int contiguous, int *chunksizesp)
    NC *nc;
    NC_GRP_INFO_T *grp; 
    NC_VAR_INFO_T *var;
+   NC_HDF5_FILE_INFO_T *h5;
    size_t *cs = NULL;
    int i, retval;
 
    /* Find this ncid's file info. */
-   if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, NULL)))
+   if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
       return retval;
    assert(nc);
 
+#ifdef USE_HDF4
+   if(h5->hdf4)
+	return NC_NOERR;
+#endif  
+
    /* Find var cause I need the number of dims. */
    if ((retval = nc4_find_g_var_nc(nc, ncid, varid, &grp, &var)))
       return retval;
diff --git a/libsrc5/CMakeLists.txt b/libsrc5/CMakeLists.txt
index 81350ef..5859425 100644
--- a/libsrc5/CMakeLists.txt
+++ b/libsrc5/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(libsrc5_SOURCES nc5dispatch.c)
 
 add_library(netcdf5 OBJECT ${libsrc5_SOURCES})
diff --git a/man4/CMakeLists.txt b/man4/CMakeLists.txt
deleted file mode 100644
index 205ac99..0000000
--- a/man4/CMakeLists.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
-
-#####
-# Build doxygen documentation, if need be.
-#####
-IF(BUILD_DOCS)
-  FIND_PACKAGE(Doxygen)
-  IF(DOXYGEN_FOUND)
-    FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.html ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_SOURCE_DIR}/*.doc ${CMAKE_CURRENT_SOURCE_DIR}/*.xml ${CMAKE_CURRENT_SOURCE_DIR}/*.m4 ${CMAKE_CURRENT_SOURCE_DIR}/*.texi)
-    FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-    # Copy the image files used by markdown documentation 
-    # manually.
-    FILE(GLOB IMG_FILES ${CMAKE_CURRENT_BINARY_DIR}/images/*.jpg ${CMAKE_CURRENT_BINARY_DIR}/images/*.png)
-    
-    # Set abs_top_srcdir to work with the autotools
-    # doxyfile template.
-    SET(abs_top_srcdir ${CMAKE_SOURCE_DIR})
-    SET(abs_builddir ${CMAKE_CURRENT_BINARY_DIR})
-    # Create general and guide doxyfiles.
-    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
-      ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
-    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.guide.in
-      ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.guide @ONLY)
-    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.tutorial.in
-      ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.tutorial @ONLY)
-
-    # We need to loop through twice. First to generate tags.
-    ADD_CUSTOM_TARGET(all_doc_tags ALL
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating API Tags" VERBATIM
-      )
-    ADD_CUSTOM_TARGET(all_doc_tags_guide ALL
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.guide
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating Guide Tags" VERBATIM
-      )
-    ADD_CUSTOM_TARGET(all_doc_tags_tutorial ALL
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.tutorial
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating Tutorial Tags" VERBATIM
-      )
-
-    # Second, generate documentation that uses the tags.
-    ADD_CUSTOM_TARGET(doc_all ALL
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating API Documentation" VERBATIM
-      )
-    ADD_CUSTOM_TARGET(doc_guide ALL
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.guide
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating NetCDF Users Guide" VERBATIM
-      )
-    ADD_CUSTOM_TARGET(doc_tutorial ALL
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.tutorial
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      COMMENT "Generating Tutorial Tags" VERBATIM
-      )
-
-    FILE(COPY ${IMG_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html)		
-  ENDIF()
-ENDIF()
-
-SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am netcdf.m4 DoxygenLayout.xml Doxyfile.in Doxyfile.guide.in footer.html mainpage.dox tutorial.dox install.dox dispatch.dox guide.dox types.dox notes.dox cdl.dox architecture.dox internal.dox install-fortran.dox Doxyfile.in.cmake windows-binaries.md building-with-cmake.md)
-
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
diff --git a/man4/architecture.dox b/man4/architecture.dox
deleted file mode 100644
index d5a683d..0000000
--- a/man4/architecture.dox
+++ /dev/null
@@ -1,11 +0,0 @@
-/** \file 
-Documentation of netCDF architecture.
-
-\page architecture NetCDF Library Architecture
-
-\image html netcdf_architecture.png "NetCDF Architecture"
-\image latex netcdf_architecture.png "NetCDF Architecture"
-\image rtf netcdf_architecture.png "NetCDF Architecture"
-
-*/
-
diff --git a/man4/images/netcdf_architecture.png b/man4/images/netcdf_architecture.png
deleted file mode 100644
index 8698774..0000000
Binary files a/man4/images/netcdf_architecture.png and /dev/null differ
diff --git a/nc-config.in.cmake b/nc-config.cmake.in
similarity index 100%
rename from nc-config.in.cmake
rename to nc-config.cmake.in
diff --git a/nc_test/CMakeLists.txt b/nc_test/CMakeLists.txt
index e6edb00..ba2203c 100644
--- a/nc_test/CMakeLists.txt
+++ b/nc_test/CMakeLists.txt
@@ -1,12 +1,8 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
 SET (nc_test_m4_SOURCES test_get test_put)
 FOREACH (F ${nc_test_m4_SOURCES})
   GEN_m4(${F})
 ENDFOREACH()
 
-
 SET (nc_test_SRC nc_test.c error.c test_get.c test_put.c test_read.c test_write.c util.c)
 ADD_EXECUTABLE(nc_test ${nc_test_SRC})
 TARGET_LINK_LIBRARIES(nc_test netcdf)
diff --git a/nc_test4/CMakeLists.txt b/nc_test4/CMakeLists.txt
index 210bc39..5428314 100644
--- a/nc_test4/CMakeLists.txt
+++ b/nc_test4/CMakeLists.txt
@@ -1,6 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
 # Some extra tests
 SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars 
   tst_varms tst_unlim_vars tst_converts tst_converts2 tst_grps tst_grps2
@@ -66,20 +63,22 @@ IF(USE_HDF4_FILE_TESTS)
   add_sh_test(nc_test4 run_get_hdf4_files)
   add_bin_test(nc_test4 tst_interops3)
   add_sh_test(nc_test4 tst_formatx_hdf4)
+  build_bin_test(tst_chunk_hdf4)
+  add_sh_test(nc_test4 run_chunk_hdf4)
 ENDIF()
 
 IF(TEST_PARALLEL)
-  build_bin_test(tst_mpi_parallel)	
+  build_bin_test(tst_mpi_parallel)
   build_bin_test(tst_parallel)
   build_bin_test(tst_parallel3)
   build_bin_test(tst_parallel4)
   build_bin_test(tst_nc4perf)
   add_sh_test(nc_test4 run_par_test)
-ENDIF()	
+ENDIF()
 
 ## Specify files to be distributed by 'make dist'
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ref_chunks1.cdl ref_chunks2.cdl ref_tst_compounds.nc ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc ref_tst_interops4.nc ref_grp_rename.cdl ref_tst_nvars.nc)
+SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} ref_chunks1.cdl ref_chunks2.cdl ref_tst_compounds.nc ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc ref_tst_interops4.nc ref_grp_rename.cdl ref_tst_nvars.nc contig.hdf4 chunked.hdf4)
 
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/nc_test4/Makefile.am b/nc_test4/Makefile.am
index 1c01e77..6b3c265 100644
--- a/nc_test4/Makefile.am
+++ b/nc_test4/Makefile.am
@@ -85,8 +85,8 @@ endif # BUILD_BENCHMARKS
 
 # These are the tests for HDF4.
 if USE_HDF4
-check_PROGRAMS += tst_interops2
-TESTS += tst_interops2  tst_formatx_hdf4.sh
+check_PROGRAMS += tst_interops2 tst_chunk_hdf4
+TESTS += tst_interops2  tst_formatx_hdf4.sh run_chunk_hdf4.sh
 if USE_HDF4_FILE_TESTS
 check_PROGRAMS += tst_interops3
 TESTS += run_get_hdf4_files.sh tst_interops3
@@ -120,7 +120,8 @@ run_get_hdf4_files.sh run_valgrind_tests.sh run_valgrind_tests2.sh	\
 run_bm_ar4.sh ref_tst_compounds.nc run_hdf4_valgrind_tests.sh		\
 ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc ref_tst_dims.nc		\
 ref_tst_interops4.nc run_get_knmi_files.sh CMakeLists.txt               \
-run_grp_rename.sh tst_formatx_hdf4.sh
+run_grp_rename.sh tst_formatx_hdf4.sh                                   \
+run_chunk_hdf4.sh contiguous.hdf4 chunked.hdf4
 
 CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc	\
 bm_radar.nc bm_radar1.nc radar_3d_compression_test.txt			\
@@ -130,7 +131,7 @@ tst_*.nc tst_floats2_*.cdl tst_ints2_*.cdl tst_shorts2_*.cdl		\
 tst_elena_*.cdl tst_simple*.cdl tst_chunks.cdl pr_A1.* tauu_A1.*	\
 usi_01.* thetau_01.* tst_*.nc tst_*.h5                                  \
 tst_grp_rename.cdl tst_grp_rename.nc tst_grp_rename.dmp ref_grp_rename.cdl \
-foo1.nc
+foo1.nc tst_interops2.h4
 
 if USE_HDF4_FILE_TESTS
 DISTCLEANFILES = AMSR_E_L2_Rain_V10_200905312326_A.hdf	\
diff --git a/nc_test4/chunked.hdf4 b/nc_test4/chunked.hdf4
new file mode 100755
index 0000000..db7276d
Binary files /dev/null and b/nc_test4/chunked.hdf4 differ
diff --git a/nc_test4/contiguous.hdf4 b/nc_test4/contiguous.hdf4
new file mode 100644
index 0000000..487dd61
Binary files /dev/null and b/nc_test4/contiguous.hdf4 differ
diff --git a/nc_test4/run_chunk_hdf4.sh b/nc_test4/run_chunk_hdf4.sh
new file mode 100755
index 0000000..d2da211
--- /dev/null
+++ b/nc_test4/run_chunk_hdf4.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Run test_chunk_hdf4 passing ${src_dir}
+set -x
+CHUNKED=chunked.hdf4
+CONTIG=contiguous.hdf4
+
+echo ""
+echo "*** Testing hdf4 chunking..."
+
+if test "x${src_dir}" = "x" ; then
+src_dir="."
+fi
+
+# Move the data sets into place
+ISDISTCHECK=0
+if test -f ./${CHUNKED} ; then
+ISDISTCHECK=0
+else
+ISDISTCHECK=1
+cp ${src_dir}/${CHUNKED} .
+cp ${src_dir}/${CONTIG} .
+fi
+
+if ./tst_chunk_hdf4 ; then
+  echo "***SUCCESS!! tst_chunk_hdf4"
+else
+  echo "***FAIL: tst_chunk_hdf4"
+fi
+
+if test "x${ISDISTCHECK}" = "x1" ; then
+echo rm -f ./${CHUNKED} ./${CONTIG}
+fi
+
+exit 0
diff --git a/nc_test4/tst_chunk_hdf4.c b/nc_test4/tst_chunk_hdf4.c
new file mode 100644
index 0000000..8ccca07
--- /dev/null
+++ b/nc_test4/tst_chunk_hdf4.c
@@ -0,0 +1,92 @@
+/* This is part of the netCDF package.  Copyright 2005-2011,
+   University Corporation for Atmospheric Research/Unidata. See
+   COPYRIGHT file for conditions of use.
+
+   Test that NetCDF-4 can read HDF4 files.
+*/
+#include <config.h>
+#include <nc_tests.h>
+#include <hdf5.h>
+#include <H5DSpublic.h>
+#include <mfhdf.h>
+
+#define CHUNKEDFILE "chunked.hdf4"
+#define CHUNKEDVAR "LandWater"
+
+#define CONTIGFILE "contiguous.hdf4"
+#define CONTIGVAR "pres"
+
+#define LAT_LEN 3
+#define LON_LEN 2
+#define DIMS_2 2
+
+static size_t EXPECTED_CHUNKSIZES[2] = {1,1200};
+
+int
+main(int argc, char **argv)
+{
+   int ncid;
+   int varid;
+   int rank;
+   int d;
+   int storage;
+   size_t chunksizes[NC_MAX_VAR_DIMS];
+   const char* srcdir = ".";
+
+   printf("\n*** Testing HDF4/NetCDF-4 chunking API: chunked...\n");
+   {
+
+      /* Open with netCDF */
+      if (nc_open(CHUNKEDFILE, NC_NOWRITE, &ncid)) ERR; 
+
+      /* Get a variable id */
+      if(nc_inq_varid(ncid,CHUNKEDVAR,&varid)) ERR;
+
+      /* get rank */
+      if(nc_inq_varndims(ncid,varid,&rank)) ERR;
+
+      /* get chunk info */
+      memset(chunksizes,0,sizeof(chunksizes));
+      if(nc_inq_var_chunking(ncid,varid,&storage,chunksizes)) ERR;
+
+      if(storage == NC_CONTIGUOUS) {
+	fprintf(stderr,"nc_inq_var_chunking did not return CHUNKED\n");
+	ERR;
+      }
+
+      for(d=0;d<rank;d++) {
+	if(EXPECTED_CHUNKSIZES[d] != chunksizes[d]) {
+	    fprintf(stderr,"chunk size mismatch: [%d] %ld :: %ld\n",d,chunksizes[d],EXPECTED_CHUNKSIZES[d]);
+	    ERR;
+	}
+      }
+      if (nc_close(ncid)) ERR; 
+   }
+   
+   printf("\n*** Testing HDF4/NetCDF-4 chunking API: contiguous...\n");
+   {
+      /* Open with netCDF */
+      if (nc_open(CONTIGFILE, NC_NOWRITE, &ncid)) ERR; 
+
+      /* Get a variable id */
+      if(nc_inq_varid(ncid,CONTIGVAR,&varid)) ERR;
+
+      /* get rank */
+      if(nc_inq_varndims(ncid,varid,&rank)) ERR;
+
+      /* get chunk info */
+      memset(chunksizes,0,sizeof(chunksizes));
+      if(nc_inq_var_chunking(ncid,varid,&storage,chunksizes)) ERR;
+
+      if(storage != NC_CONTIGUOUS) {
+	fprintf(stderr,"nc_inq_var_chunking did not return CONTIGUOUS\n");
+	ERR;
+      }
+
+      if (nc_close(ncid)) ERR; 
+   }
+
+   SUMMARIZE_ERR;
+   FINAL_RESULTS;
+}
+
diff --git a/ncdap_test/CMakeLists.txt b/ncdap_test/CMakeLists.txt
index 2a572fd..5fd2816 100644
--- a/ncdap_test/CMakeLists.txt
+++ b/ncdap_test/CMakeLists.txt
@@ -1,8 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
-
 SET(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR})
 
 remove_definitions(-DDLL_EXPORT)
diff --git a/ncdap_test/expected3/CMakeLists.txt b/ncdap_test/expected3/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/expected3/CMakeLists.txt
+++ b/ncdap_test/expected3/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/expected4/CMakeLists.txt b/ncdap_test/expected4/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/expected4/CMakeLists.txt
+++ b/ncdap_test/expected4/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/expectremote3/CMakeLists.txt b/ncdap_test/expectremote3/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/expectremote3/CMakeLists.txt
+++ b/ncdap_test/expectremote3/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/expectremote4/CMakeLists.txt b/ncdap_test/expectremote4/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/expectremote4/CMakeLists.txt
+++ b/ncdap_test/expectremote4/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/expecttds3/CMakeLists.txt b/ncdap_test/expecttds3/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/expecttds3/CMakeLists.txt
+++ b/ncdap_test/expecttds3/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/nocacheremote3/CMakeLists.txt b/ncdap_test/nocacheremote3/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/nocacheremote3/CMakeLists.txt
+++ b/ncdap_test/nocacheremote3/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/nocacheremote4/CMakeLists.txt b/ncdap_test/nocacheremote4/CMakeLists.txt
index 2c8b26f..d46021e 100644
--- a/ncdap_test/nocacheremote4/CMakeLists.txt
+++ b/ncdap_test/nocacheremote4/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/special3/CMakeLists.txt b/ncdap_test/special3/CMakeLists.txt
index caf9684..2332d8f 100644
--- a/ncdap_test/special3/CMakeLists.txt
+++ b/ncdap_test/special3/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdap_test/testdata3/CMakeLists.txt b/ncdap_test/testdata3/CMakeLists.txt
index 2c8b26f..ce07345 100644
--- a/ncdap_test/testdata3/CMakeLists.txt
+++ b/ncdap_test/testdata3/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
diff --git a/ncdump/CMakeLists.txt b/ncdump/CMakeLists.txt
index 0822305..732dfc4 100644
--- a/ncdump/CMakeLists.txt
+++ b/ncdump/CMakeLists.txt
@@ -1,23 +1,17 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 IF(BUILD_SHARED_LIBS AND WIN32)
   remove_definitions(-DDLL_EXPORT)
   remove_definitions(-DDLL_NETCDF)
 ENDIF()
 
-
-
 #IF(EXTRA_TESTS)
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ctest.c
-  COMMAND cmake -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest.c"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest.c"
   "${CMAKE_CURRENT_SOURCE_DIR}/ctest.c"
   )
 ADD_CUSTOM_COMMAND(
   OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ctest64.c
-  COMMAND cmake -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest64.c"
+  COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest64.c"
   "${CMAKE_CURRENT_SOURCE_DIR}/ctest64.c"
   )
 #ENDIF()
@@ -154,8 +148,6 @@ FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SO
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} test0.cdl ref_ctest1_nc4.cdl ref_ctest1_nc4c.cdl ref_tst_solar_1.cdl ref_tst_solar_2.cdl ref_tst_small.cdl tst_ncml.cdl ref1.ncml ref_tst_group_data.cdl ref_tst_enum_data.cdl ref_tst_opaque_data.cdl ref_tst_string_data.cdl ref_tst_vlen_data.cdl ref_tst_comp.cdl ref_tst_unicode.cdl ref_tst_nans.cdl small.cdl small2.cdl ref_tst_utf8.cdl ref_tst_fillbug.cdl tst_calendars.cdl ref_times.cdl ref_tst_special_atts.cdl ref_tst_noncoord.cdl ref_tst_compounds2.n [...]
 ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
 
-
-
 SET(CLEANFILES test0.nc test1.cdl test1.nc test2.cdl ctest1.cdl ctest.c ctest64.c ctest0.nc  ctest0_64.nc c1.cdl c1_4.cdl ctest1_64.cdl c0.nc c0_4.nc small.nc small2.nc c0tmp.nc c1.ncml utf8.cdl utf8_64.cdl utf8.nc utf8_64.nc tmp.cdl tst_vlen_data.nc tst_utf8.nc tst_special_atts.nc tst_unicode.nc tst_solar_2.nc tst_string_data.nc tst_calendars.nc tst_nans.nc tst_opaque_data.nc tst_solar_cmp.nc tst_enum_data.nc tst_solar_1.nc tst_mslp_64.nc tst_mslp.nc tst_comp2.nc tst_ncml.nc tst_fillbug [...]
 
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")
diff --git a/ncdump/cdl4/CMakeLists.txt b/ncdump/cdl4/CMakeLists.txt
index a384685..8c089e2 100644
--- a/ncdump/cdl4/CMakeLists.txt
+++ b/ncdump/cdl4/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncdump/ctest.c b/ncdump/ctest.c
deleted file mode 100644
index 95b2199..0000000
--- a/ncdump/ctest.c
+++ /dev/null
@@ -1,1333 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <netcdf.h>
-
-void
-check_err(const int stat, const int line, const char *file) {
-    if (stat != NC_NOERR) {
-	   (void) fprintf(stderr, "line %d of %s: %s\n", line, file, nc_strerror(stat));
-        exit(1);
-    }
-}
-
-int
-main() {			/* create ctest0.nc */
-
-   int  stat;			/* return status */
-   int  ncid;			/* netCDF id */
-
-   /* dimension ids */
-   int Dr_dim;
-   int D1_dim;
-   int D2_dim;
-   int D3_dim;
-   int dim_MINUS_name_MINUS_dashes_dim;
-   int dim_PERIOD_name_PERIOD_dots_dim;
-   int dim_PLUS_name_PLUS_plusses_dim;
-   int dim_ATSIGN_name_ATSIGN_ats_dim;
-
-   /* dimension lengths */
-   size_t Dr_len = NC_UNLIMITED;
-   size_t D1_len = 1;
-   size_t D2_len = 2;
-   size_t D3_len = 3;
-   size_t dim_MINUS_name_MINUS_dashes_len = 4;
-   size_t dim_PERIOD_name_PERIOD_dots_len = 5;
-   size_t dim_PLUS_name_PLUS_plusses_len = 6;
-   size_t dim_ATSIGN_name_ATSIGN_ats_len = 7;
-
-   /* variable ids */
-   int c_id;
-   int b_id;
-   int s_id;
-   int i_id;
-   int f_id;
-   int d_id;
-   int cr_id;
-   int br_id;
-   int sr_id;
-   int ir_id;
-   int fr_id;
-   int dr_id;
-   int c1_id;
-   int b1_id;
-   int s1_id;
-   int i1_id;
-   int f1_id;
-   int d1_id;
-   int c2_id;
-   int b2_id;
-   int s2_id;
-   int i2_id;
-   int f2_id;
-   int d2_id;
-   int c3_id;
-   int b3_id;
-   int s3_id;
-   int i3_id;
-   int f3_id;
-   int d3_id;
-   int cr1_id;
-   int br2_id;
-   int sr3_id;
-   int f11_id;
-   int d12_id;
-   int c13_id;
-   int s21_id;
-   int i22_id;
-   int f23_id;
-   int c31_id;
-   int b32_id;
-   int s33_id;
-   int sr11_id;
-   int ir12_id;
-   int fr13_id;
-   int cr21_id;
-   int br22_id;
-   int sr23_id;
-   int fr31_id;
-   int dr32_id;
-   int cr33_id;
-   int c111_id;
-   int b112_id;
-   int s113_id;
-   int f121_id;
-   int d122_id;
-   int c123_id;
-   int s131_id;
-   int i132_id;
-   int f133_id;
-   int f211_id;
-   int d212_id;
-   int c213_id;
-   int s221_id;
-   int i222_id;
-   int f223_id;
-   int c231_id;
-   int b232_id;
-   int s233_id;
-   int s311_id;
-   int i312_id;
-   int f313_id;
-   int var_MINUS_name_MINUS_dashes_id;
-   int var_PERIOD_name_PERIOD_dots_id;
-   int var_PLUS_name_PLUS_plusses_id;
-   int var_ATSIGN_name_ATSIGN_ats_id;
-
-   /* rank (number of dimensions) for each variable */
-#  define RANK_c 0
-#  define RANK_b 0
-#  define RANK_s 0
-#  define RANK_i 0
-#  define RANK_f 0
-#  define RANK_d 0
-#  define RANK_cr 1
-#  define RANK_br 1
-#  define RANK_sr 1
-#  define RANK_ir 1
-#  define RANK_fr 1
-#  define RANK_dr 1
-#  define RANK_c1 1
-#  define RANK_b1 1
-#  define RANK_s1 1
-#  define RANK_i1 1
-#  define RANK_f1 1
-#  define RANK_d1 1
-#  define RANK_c2 1
-#  define RANK_b2 1
-#  define RANK_s2 1
-#  define RANK_i2 1
-#  define RANK_f2 1
-#  define RANK_d2 1
-#  define RANK_c3 1
-#  define RANK_b3 1
-#  define RANK_s3 1
-#  define RANK_i3 1
-#  define RANK_f3 1
-#  define RANK_d3 1
-#  define RANK_cr1 2
-#  define RANK_br2 2
-#  define RANK_sr3 2
-#  define RANK_f11 2
-#  define RANK_d12 2
-#  define RANK_c13 2
-#  define RANK_s21 2
-#  define RANK_i22 2
-#  define RANK_f23 2
-#  define RANK_c31 2
-#  define RANK_b32 2
-#  define RANK_s33 2
-#  define RANK_sr11 3
-#  define RANK_ir12 3
-#  define RANK_fr13 3
-#  define RANK_cr21 3
-#  define RANK_br22 3
-#  define RANK_sr23 3
-#  define RANK_fr31 3
-#  define RANK_dr32 3
-#  define RANK_cr33 3
-#  define RANK_c111 3
-#  define RANK_b112 3
-#  define RANK_s113 3
-#  define RANK_f121 3
-#  define RANK_d122 3
-#  define RANK_c123 3
-#  define RANK_s131 3
-#  define RANK_i132 3
-#  define RANK_f133 3
-#  define RANK_f211 3
-#  define RANK_d212 3
-#  define RANK_c213 3
-#  define RANK_s221 3
-#  define RANK_i222 3
-#  define RANK_f223 3
-#  define RANK_c231 3
-#  define RANK_b232 3
-#  define RANK_s233 3
-#  define RANK_s311 3
-#  define RANK_i312 3
-#  define RANK_f313 3
-#  define RANK_var_MINUS_name_MINUS_dashes 0
-#  define RANK_var_PERIOD_name_PERIOD_dots 0
-#  define RANK_var_PLUS_name_PLUS_plusses 0
-#  define RANK_var_ATSIGN_name_ATSIGN_ats 0
-
-   /* variable shapes */
-   int cr_dims[RANK_cr];
-   int br_dims[RANK_br];
-   int sr_dims[RANK_sr];
-   int ir_dims[RANK_ir];
-   int fr_dims[RANK_fr];
-   int dr_dims[RANK_dr];
-   int c1_dims[RANK_c1];
-   int b1_dims[RANK_b1];
-   int s1_dims[RANK_s1];
-   int i1_dims[RANK_i1];
-   int f1_dims[RANK_f1];
-   int d1_dims[RANK_d1];
-   int c2_dims[RANK_c2];
-   int b2_dims[RANK_b2];
-   int s2_dims[RANK_s2];
-   int i2_dims[RANK_i2];
-   int f2_dims[RANK_f2];
-   int d2_dims[RANK_d2];
-   int c3_dims[RANK_c3];
-   int b3_dims[RANK_b3];
-   int s3_dims[RANK_s3];
-   int i3_dims[RANK_i3];
-   int f3_dims[RANK_f3];
-   int d3_dims[RANK_d3];
-   int cr1_dims[RANK_cr1];
-   int br2_dims[RANK_br2];
-   int sr3_dims[RANK_sr3];
-   int f11_dims[RANK_f11];
-   int d12_dims[RANK_d12];
-   int c13_dims[RANK_c13];
-   int s21_dims[RANK_s21];
-   int i22_dims[RANK_i22];
-   int f23_dims[RANK_f23];
-   int c31_dims[RANK_c31];
-   int b32_dims[RANK_b32];
-   int s33_dims[RANK_s33];
-   int sr11_dims[RANK_sr11];
-   int ir12_dims[RANK_ir12];
-   int fr13_dims[RANK_fr13];
-   int cr21_dims[RANK_cr21];
-   int br22_dims[RANK_br22];
-   int sr23_dims[RANK_sr23];
-   int fr31_dims[RANK_fr31];
-   int dr32_dims[RANK_dr32];
-   int cr33_dims[RANK_cr33];
-   int c111_dims[RANK_c111];
-   int b112_dims[RANK_b112];
-   int s113_dims[RANK_s113];
-   int f121_dims[RANK_f121];
-   int d122_dims[RANK_d122];
-   int c123_dims[RANK_c123];
-   int s131_dims[RANK_s131];
-   int i132_dims[RANK_i132];
-   int f133_dims[RANK_f133];
-   int f211_dims[RANK_f211];
-   int d212_dims[RANK_d212];
-   int c213_dims[RANK_c213];
-   int s221_dims[RANK_s221];
-   int i222_dims[RANK_i222];
-   int f223_dims[RANK_f223];
-   int c231_dims[RANK_c231];
-   int b232_dims[RANK_b232];
-   int s233_dims[RANK_s233];
-   int s311_dims[RANK_s311];
-   int i312_dims[RANK_i312];
-   int f313_dims[RANK_f313];
-
-   /* attribute vectors */
-   int c_att_MINUS_name_MINUS_dashes[1];
-   int c_att_PERIOD_name_PERIOD_dots[1];
-   int c_att_PLUS_name_PLUS_plusses[1];
-   int c_att_ATSIGN_name_ATSIGN_ats[1];
-   int s_b[4];
-   short s_s[3];
-   int i_i[3];
-   float i_f[3];
-   double i_d[3];
-   int cdf_Gb[2];
-   short cdf_Gs[3];
-   int cdf_Gi[3];
-   float cdf_Gf[3];
-   double cdf_Gd[3];
-   int cdf_Gatt_MINUS_name_MINUS_dashes[1];
-   int cdf_Gatt_PERIOD_name_PERIOD_dots[1];
-   int cdf_Gatt_PLUS_name_PLUS_plusses[1];
-   int cdf_Gatt_ATSIGN_name_ATSIGN_ats[1];
-
-   /* enter define mode */
-   stat = nc_create("ctest0.nc", NC_CLOBBER, &ncid);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* define dimensions */
-   stat = nc_def_dim(ncid, "Dr", Dr_len, &Dr_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "D1", D1_len, &D1_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "D2", D2_len, &D2_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "D3", D3_len, &D3_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim-name-dashes", dim_MINUS_name_MINUS_dashes_len, &dim_MINUS_name_MINUS_dashes_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim.name.dots", dim_PERIOD_name_PERIOD_dots_len, &dim_PERIOD_name_PERIOD_dots_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim+name+plusses", dim_PLUS_name_PLUS_plusses_len, &dim_PLUS_name_PLUS_plusses_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim at name@ats", dim_ATSIGN_name_ATSIGN_ats_len, &dim_ATSIGN_name_ATSIGN_ats_dim);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* define variables */
-
-   stat = nc_def_var(ncid, "c", NC_CHAR, RANK_c, 0, &c_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "b", NC_BYTE, RANK_b, 0, &b_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "s", NC_SHORT, RANK_s, 0, &s_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "i", NC_INT, RANK_i, 0, &i_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "f", NC_FLOAT, RANK_f, 0, &f_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "d", NC_DOUBLE, RANK_d, 0, &d_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "cr", NC_CHAR, RANK_cr, cr_dims, &cr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   br_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "br", NC_BYTE, RANK_br, br_dims, &br_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "sr", NC_SHORT, RANK_sr, sr_dims, &sr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   ir_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "ir", NC_INT, RANK_ir, ir_dims, &ir_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   fr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "fr", NC_FLOAT, RANK_fr, fr_dims, &fr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   dr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "dr", NC_DOUBLE, RANK_dr, dr_dims, &dr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "c1", NC_CHAR, RANK_c1, c1_dims, &c1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "b1", NC_BYTE, RANK_b1, b1_dims, &b1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "s1", NC_SHORT, RANK_s1, s1_dims, &s1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "i1", NC_INT, RANK_i1, i1_dims, &i1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "f1", NC_FLOAT, RANK_f1, f1_dims, &f1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "d1", NC_DOUBLE, RANK_d1, d1_dims, &d1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "c2", NC_CHAR, RANK_c2, c2_dims, &c2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "b2", NC_BYTE, RANK_b2, b2_dims, &b2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "s2", NC_SHORT, RANK_s2, s2_dims, &s2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "i2", NC_INT, RANK_i2, i2_dims, &i2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "f2", NC_FLOAT, RANK_f2, f2_dims, &f2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "d2", NC_DOUBLE, RANK_d2, d2_dims, &d2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "c3", NC_CHAR, RANK_c3, c3_dims, &c3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "b3", NC_BYTE, RANK_b3, b3_dims, &b3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "s3", NC_SHORT, RANK_s3, s3_dims, &s3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "i3", NC_INT, RANK_i3, i3_dims, &i3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "f3", NC_FLOAT, RANK_f3, f3_dims, &f3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "d3", NC_DOUBLE, RANK_d3, d3_dims, &d3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr1_dims[0] = Dr_dim;
-   cr1_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "cr1", NC_CHAR, RANK_cr1, cr1_dims, &cr1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   br2_dims[0] = Dr_dim;
-   br2_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "br2", NC_BYTE, RANK_br2, br2_dims, &br2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr3_dims[0] = Dr_dim;
-   sr3_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "sr3", NC_SHORT, RANK_sr3, sr3_dims, &sr3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f11_dims[0] = D1_dim;
-   f11_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "f11", NC_FLOAT, RANK_f11, f11_dims, &f11_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d12_dims[0] = D1_dim;
-   d12_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "d12", NC_DOUBLE, RANK_d12, d12_dims, &d12_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c13_dims[0] = D1_dim;
-   c13_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "c13", NC_CHAR, RANK_c13, c13_dims, &c13_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s21_dims[0] = D2_dim;
-   s21_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "s21", NC_SHORT, RANK_s21, s21_dims, &s21_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i22_dims[0] = D2_dim;
-   i22_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "i22", NC_INT, RANK_i22, i22_dims, &i22_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f23_dims[0] = D2_dim;
-   f23_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "f23", NC_FLOAT, RANK_f23, f23_dims, &f23_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c31_dims[0] = D3_dim;
-   c31_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "c31", NC_CHAR, RANK_c31, c31_dims, &c31_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b32_dims[0] = D3_dim;
-   b32_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "b32", NC_BYTE, RANK_b32, b32_dims, &b32_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s33_dims[0] = D3_dim;
-   s33_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "s33", NC_SHORT, RANK_s33, s33_dims, &s33_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr11_dims[0] = Dr_dim;
-   sr11_dims[1] = D1_dim;
-   sr11_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "sr11", NC_SHORT, RANK_sr11, sr11_dims, &sr11_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   ir12_dims[0] = Dr_dim;
-   ir12_dims[1] = D1_dim;
-   ir12_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "ir12", NC_INT, RANK_ir12, ir12_dims, &ir12_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   fr13_dims[0] = Dr_dim;
-   fr13_dims[1] = D1_dim;
-   fr13_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "fr13", NC_FLOAT, RANK_fr13, fr13_dims, &fr13_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr21_dims[0] = Dr_dim;
-   cr21_dims[1] = D2_dim;
-   cr21_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "cr21", NC_CHAR, RANK_cr21, cr21_dims, &cr21_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   br22_dims[0] = Dr_dim;
-   br22_dims[1] = D2_dim;
-   br22_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "br22", NC_BYTE, RANK_br22, br22_dims, &br22_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr23_dims[0] = Dr_dim;
-   sr23_dims[1] = D2_dim;
-   sr23_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "sr23", NC_SHORT, RANK_sr23, sr23_dims, &sr23_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   fr31_dims[0] = Dr_dim;
-   fr31_dims[1] = D3_dim;
-   fr31_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "fr31", NC_FLOAT, RANK_fr31, fr31_dims, &fr31_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   dr32_dims[0] = Dr_dim;
-   dr32_dims[1] = D3_dim;
-   dr32_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "dr32", NC_DOUBLE, RANK_dr32, dr32_dims, &dr32_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr33_dims[0] = Dr_dim;
-   cr33_dims[1] = D3_dim;
-   cr33_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "cr33", NC_CHAR, RANK_cr33, cr33_dims, &cr33_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c111_dims[0] = D1_dim;
-   c111_dims[1] = D1_dim;
-   c111_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "c111", NC_CHAR, RANK_c111, c111_dims, &c111_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b112_dims[0] = D1_dim;
-   b112_dims[1] = D1_dim;
-   b112_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "b112", NC_BYTE, RANK_b112, b112_dims, &b112_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s113_dims[0] = D1_dim;
-   s113_dims[1] = D1_dim;
-   s113_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "s113", NC_SHORT, RANK_s113, s113_dims, &s113_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f121_dims[0] = D1_dim;
-   f121_dims[1] = D2_dim;
-   f121_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "f121", NC_FLOAT, RANK_f121, f121_dims, &f121_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d122_dims[0] = D1_dim;
-   d122_dims[1] = D2_dim;
-   d122_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "d122", NC_DOUBLE, RANK_d122, d122_dims, &d122_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c123_dims[0] = D1_dim;
-   c123_dims[1] = D2_dim;
-   c123_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "c123", NC_CHAR, RANK_c123, c123_dims, &c123_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s131_dims[0] = D1_dim;
-   s131_dims[1] = D3_dim;
-   s131_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "s131", NC_SHORT, RANK_s131, s131_dims, &s131_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i132_dims[0] = D1_dim;
-   i132_dims[1] = D3_dim;
-   i132_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "i132", NC_INT, RANK_i132, i132_dims, &i132_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f133_dims[0] = D1_dim;
-   f133_dims[1] = D3_dim;
-   f133_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "f133", NC_FLOAT, RANK_f133, f133_dims, &f133_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f211_dims[0] = D2_dim;
-   f211_dims[1] = D1_dim;
-   f211_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "f211", NC_FLOAT, RANK_f211, f211_dims, &f211_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d212_dims[0] = D2_dim;
-   d212_dims[1] = D1_dim;
-   d212_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "d212", NC_DOUBLE, RANK_d212, d212_dims, &d212_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c213_dims[0] = D2_dim;
-   c213_dims[1] = D1_dim;
-   c213_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "c213", NC_CHAR, RANK_c213, c213_dims, &c213_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s221_dims[0] = D2_dim;
-   s221_dims[1] = D2_dim;
-   s221_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "s221", NC_SHORT, RANK_s221, s221_dims, &s221_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i222_dims[0] = D2_dim;
-   i222_dims[1] = D2_dim;
-   i222_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "i222", NC_INT, RANK_i222, i222_dims, &i222_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f223_dims[0] = D2_dim;
-   f223_dims[1] = D2_dim;
-   f223_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "f223", NC_FLOAT, RANK_f223, f223_dims, &f223_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c231_dims[0] = D2_dim;
-   c231_dims[1] = D3_dim;
-   c231_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "c231", NC_CHAR, RANK_c231, c231_dims, &c231_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b232_dims[0] = D2_dim;
-   b232_dims[1] = D3_dim;
-   b232_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "b232", NC_BYTE, RANK_b232, b232_dims, &b232_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s233_dims[0] = D2_dim;
-   s233_dims[1] = D3_dim;
-   s233_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "s233", NC_SHORT, RANK_s233, s233_dims, &s233_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s311_dims[0] = D3_dim;
-   s311_dims[1] = D1_dim;
-   s311_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "s311", NC_SHORT, RANK_s311, s311_dims, &s311_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i312_dims[0] = D3_dim;
-   i312_dims[1] = D1_dim;
-   i312_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "i312", NC_INT, RANK_i312, i312_dims, &i312_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f313_dims[0] = D3_dim;
-   f313_dims[1] = D1_dim;
-   f313_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "f313", NC_FLOAT, RANK_f313, f313_dims, &f313_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var-name-dashes", NC_DOUBLE, RANK_var_MINUS_name_MINUS_dashes, 0, &var_MINUS_name_MINUS_dashes_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var.name.dots", NC_DOUBLE, RANK_var_PERIOD_name_PERIOD_dots, 0, &var_PERIOD_name_PERIOD_dots_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var+name+plusses", NC_DOUBLE, RANK_var_PLUS_name_PLUS_plusses, 0, &var_PLUS_name_PLUS_plusses_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var at name@ats", NC_DOUBLE, RANK_var_ATSIGN_name_ATSIGN_ats, 0, &var_ATSIGN_name_ATSIGN_ats_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* assign attributes */
-   c_att_MINUS_name_MINUS_dashes[0] = 4;
-   stat = nc_put_att_int(ncid, c_id, "att-name-dashes", NC_INT, 1, c_att_MINUS_name_MINUS_dashes);
-   check_err(stat,__LINE__,__FILE__);
-   c_att_PERIOD_name_PERIOD_dots[0] = 5;
-   stat = nc_put_att_int(ncid, c_id, "att.name.dots", NC_INT, 1, c_att_PERIOD_name_PERIOD_dots);
-   check_err(stat,__LINE__,__FILE__);
-   c_att_PLUS_name_PLUS_plusses[0] = 6;
-   stat = nc_put_att_int(ncid, c_id, "att+name+plusses", NC_INT, 1, c_att_PLUS_name_PLUS_plusses);
-   check_err(stat,__LINE__,__FILE__);
-   c_att_ATSIGN_name_ATSIGN_ats[0] = 7;
-   stat = nc_put_att_int(ncid, c_id, "att at name@ats", NC_INT, 1, c_att_ATSIGN_name_ATSIGN_ats);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, b_id, "c", 1, "");
-   check_err(stat,__LINE__,__FILE__);
-   s_b[0] = 0;
-   s_b[1] = 127;
-   s_b[2] = -128;
-   s_b[3] = -1;
-   stat = nc_put_att_int(ncid, s_id, "b", NC_BYTE, 4, s_b);
-   check_err(stat,__LINE__,__FILE__);
-   s_s[0] = -32768;
-   s_s[1] = 0;
-   s_s[2] = 32767;
-   stat = nc_put_att_short(ncid, s_id, "s", NC_SHORT, 3, s_s);
-   check_err(stat,__LINE__,__FILE__);
-   i_i[0] = -2147483647;
-   i_i[1] = 0;
-   i_i[2] = 2147483647;
-   stat = nc_put_att_int(ncid, i_id, "i", NC_INT, 3, i_i);
-   check_err(stat,__LINE__,__FILE__);
-   i_f[0] = -9.9999996e+35;
-   i_f[1] = 0;
-   i_f[2] = 9.9999996e+35;
-   stat = nc_put_att_float(ncid, i_id, "f", NC_FLOAT, 3, i_f);
-   check_err(stat,__LINE__,__FILE__);
-   i_d[0] = -1e+308;
-   i_d[1] = 0;
-   i_d[2] = 1e+308;
-   stat = nc_put_att_double(ncid, i_id, "d", NC_DOUBLE, 3, i_d);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, f_id, "c", 1, "x");
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, d_id, "c", 8, "abcd\tZ$&");
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, NC_GLOBAL, "Gc", 1, "");
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gb[0] = -128;
-   cdf_Gb[1] = 127;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gb", NC_BYTE, 2, cdf_Gb);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gs[0] = -32768;
-   cdf_Gs[1] = 0;
-   cdf_Gs[2] = 32767;
-   stat = nc_put_att_short(ncid, NC_GLOBAL, "Gs", NC_SHORT, 3, cdf_Gs);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gi[0] = -2147483647;
-   cdf_Gi[1] = 0;
-   cdf_Gi[2] = 2147483647;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gi", NC_INT, 3, cdf_Gi);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gf[0] = -9.9999996e+35;
-   cdf_Gf[1] = 0;
-   cdf_Gf[2] = 9.9999996e+35;
-   stat = nc_put_att_float(ncid, NC_GLOBAL, "Gf", NC_FLOAT, 3, cdf_Gf);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gd[0] = -1e+308;
-   cdf_Gd[1] = 0;
-   cdf_Gd[2] = 1e+308;
-   stat = nc_put_att_double(ncid, NC_GLOBAL, "Gd", NC_DOUBLE, 3, cdf_Gd);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_MINUS_name_MINUS_dashes[0] = -1;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt-name-dashes", NC_INT, 1, cdf_Gatt_MINUS_name_MINUS_dashes);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_PERIOD_name_PERIOD_dots[0] = -2;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt.name.dots", NC_INT, 1, cdf_Gatt_PERIOD_name_PERIOD_dots);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_PLUS_name_PLUS_plusses[0] = -3;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt+name+plusses", NC_INT, 1, cdf_Gatt_PLUS_name_PLUS_plusses);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_ATSIGN_name_ATSIGN_ats[0] = -4;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt at name@ats", NC_INT, 1, cdf_Gatt_ATSIGN_name_ATSIGN_ats);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* leave define mode */
-   stat = nc_enddef (ncid);
-   check_err(stat,__LINE__,__FILE__);
-
-   {			/* store c */
-    static char c = '2';
-    stat = nc_put_var_text(ncid, c_id, &c);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b */
-    static signed char b = -2;
-    stat = nc_put_var_schar(ncid, b_id, &b);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s */
-    static short s = -5;
-    stat = nc_put_var_short(ncid, s_id, &s);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i */
-    static int i = -20;
-    stat = nc_put_var_int(ncid, i_id, &i);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f */
-    static float f = -9;
-    stat = nc_put_var_float(ncid, f_id, &f);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d */
-    static double d = -10.;
-    stat = nc_put_var_double(ncid, d_id, &d);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr */
-    static size_t cr_start[RANK_cr];
-    static size_t cr_count[RANK_cr];
-    static char cr[] = {"ab"};
-    Dr_len = 2;			/* number of records of cr data */
-    cr_start[0] = 0;
-    cr_count[0] = Dr_len;
-    stat = nc_put_vara_text(ncid, cr_id, cr_start, cr_count, cr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store br */
-    static size_t br_start[RANK_br];
-    static size_t br_count[RANK_br];
-    static signed char br[] = {-128, 127};
-    Dr_len = 2;			/* number of records of br data */
-    br_start[0] = 0;
-    br_count[0] = Dr_len;
-    stat = nc_put_vara_schar(ncid, br_id, br_start, br_count, br);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr */
-    static size_t sr_start[RANK_sr];
-    static size_t sr_count[RANK_sr];
-    static short sr[] = {-32768, 32767};
-    Dr_len = 2;			/* number of records of sr data */
-    sr_start[0] = 0;
-    sr_count[0] = Dr_len;
-    stat = nc_put_vara_short(ncid, sr_id, sr_start, sr_count, sr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store ir */
-    static size_t ir_start[RANK_ir];
-    static size_t ir_count[RANK_ir];
-    static int ir[] = {-2147483646, 2147483647};
-    Dr_len = 2;			/* number of records of ir data */
-    ir_start[0] = 0;
-    ir_count[0] = Dr_len;
-    stat = nc_put_vara_int(ncid, ir_id, ir_start, ir_count, ir);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store fr */
-    static size_t fr_start[RANK_fr];
-    static size_t fr_count[RANK_fr];
-    static float fr[] = {-9.9999996e+35, 9.9999996e+35};
-    Dr_len = 2;			/* number of records of fr data */
-    fr_start[0] = 0;
-    fr_count[0] = Dr_len;
-    stat = nc_put_vara_float(ncid, fr_id, fr_start, fr_count, fr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store dr */
-    static size_t dr_start[RANK_dr];
-    static size_t dr_count[RANK_dr];
-    static double dr[] = {-1.e+308, 1.e+308};
-    Dr_len = 2;			/* number of records of dr data */
-    dr_start[0] = 0;
-    dr_count[0] = Dr_len;
-    stat = nc_put_vara_double(ncid, dr_id, dr_start, dr_count, dr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c1 */
-    static char c1[] = {""};
-    stat = nc_put_var_text(ncid, c1_id, c1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b1 */
-    static signed char b1[] = {-128};
-    stat = nc_put_var_schar(ncid, b1_id, b1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s1 */
-    static short s1[] = {-32768};
-    stat = nc_put_var_short(ncid, s1_id, s1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i1 */
-    static int i1[] = {-2147483646};
-    stat = nc_put_var_int(ncid, i1_id, i1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f1 */
-    static float f1[] = {-9.9999996e+35};
-    stat = nc_put_var_float(ncid, f1_id, f1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d1 */
-    static double d1[] = {-1.e+308};
-    stat = nc_put_var_double(ncid, d1_id, d1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c2 */
-    static char c2[] = {"ab"};
-    stat = nc_put_var_text(ncid, c2_id, c2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b2 */
-    static signed char b2[] = {-128, 127};
-    stat = nc_put_var_schar(ncid, b2_id, b2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s2 */
-    static short s2[] = {-32768, 32767};
-    stat = nc_put_var_short(ncid, s2_id, s2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i2 */
-    static int i2[] = {-2147483646, 2147483647};
-    stat = nc_put_var_int(ncid, i2_id, i2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f2 */
-    static float f2[] = {-9.9999996e+35, 9.9999996e+35};
-    stat = nc_put_var_float(ncid, f2_id, f2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d2 */
-    static double d2[] = {-1.e+308, 1.e+308};
-    stat = nc_put_var_double(ncid, d2_id, d2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c3 */
-    static char c3[] = {"\001\300."};
-    stat = nc_put_var_text(ncid, c3_id, c3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b3 */
-    static signed char b3[] = {-128, 127, -1};
-    stat = nc_put_var_schar(ncid, b3_id, b3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s3 */
-    static short s3[] = {-32768, 0, 32767};
-    stat = nc_put_var_short(ncid, s3_id, s3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i3 */
-    static int i3[] = {-2147483646, 0, 2147483647};
-    stat = nc_put_var_int(ncid, i3_id, i3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f3 */
-    static float f3[] = {-9.9999996e+35, 0, 9.9999996e+35};
-    stat = nc_put_var_float(ncid, f3_id, f3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d3 */
-    static double d3[] = {-1.e+308, 0., 1.e+308};
-    stat = nc_put_var_double(ncid, d3_id, d3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr1 */
-    static size_t cr1_start[RANK_cr1];
-    static size_t cr1_count[RANK_cr1];
-    static char cr1[] = {"xy"};
-    Dr_len = 2;			/* number of records of cr1 data */
-    cr1_start[0] = 0;
-    cr1_start[1] = 0;
-    cr1_count[0] = Dr_len;
-    cr1_count[1] = D1_len;
-    stat = nc_put_vara_text(ncid, cr1_id, cr1_start, cr1_count, cr1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store br2 */
-    static size_t br2_start[RANK_br2];
-    static size_t br2_count[RANK_br2];
-    static signed char br2[] = {-24, -26, -20, -22};
-    Dr_len = 2;			/* number of records of br2 data */
-    br2_start[0] = 0;
-    br2_start[1] = 0;
-    br2_count[0] = Dr_len;
-    br2_count[1] = D2_len;
-    stat = nc_put_vara_schar(ncid, br2_id, br2_start, br2_count, br2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr3 */
-    static size_t sr3_start[RANK_sr3];
-    static size_t sr3_count[RANK_sr3];
-    static short sr3[] = {-375, -380, -385, -350, -355, -360};
-    Dr_len = 2;			/* number of records of sr3 data */
-    sr3_start[0] = 0;
-    sr3_start[1] = 0;
-    sr3_count[0] = Dr_len;
-    sr3_count[1] = D3_len;
-    stat = nc_put_vara_short(ncid, sr3_id, sr3_start, sr3_count, sr3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f11 */
-    static float f11[] = {-2187};
-    stat = nc_put_var_float(ncid, f11_id, f11);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d12 */
-    static double d12[] = {-3000., -3010.};
-    stat = nc_put_var_double(ncid, d12_id, d12);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c13 */
-    static char c13[] = {"\tb\177"};
-    stat = nc_put_var_text(ncid, c13_id, c13);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s21 */
-    static short s21[] = {-375, -350};
-    stat = nc_put_var_short(ncid, s21_id, s21);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i22 */
-    static int i22[] = {-24000, -24020, -23600, -23620};
-    stat = nc_put_var_int(ncid, i22_id, i22);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f23 */
-    static float f23[] = {-2187, -2196, -2205, -2106, -2115, -2124};
-    stat = nc_put_var_float(ncid, f23_id, f23);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c31 */
-    static char c31[] = {"+- "};
-    stat = nc_put_var_text(ncid, c31_id, c31);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b32 */
-    static signed char b32[] = {-24, -26, -20, -22, -16, -18};
-    stat = nc_put_var_schar(ncid, b32_id, b32);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s33 */
-    static short s33[] = {-375, -380, -385, -350, -355, -360, -325, -330, -335};
-    stat = nc_put_var_short(ncid, s33_id, s33);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr11 */
-    static size_t sr11_start[RANK_sr11];
-    static size_t sr11_count[RANK_sr11];
-    static short sr11[] = {2500, 2375};
-    Dr_len = 2;			/* number of records of sr11 data */
-    sr11_start[0] = 0;
-    sr11_start[1] = 0;
-    sr11_start[2] = 0;
-    sr11_count[0] = Dr_len;
-    sr11_count[1] = D1_len;
-    sr11_count[2] = D1_len;
-    stat = nc_put_vara_short(ncid, sr11_id, sr11_start, sr11_count, sr11);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store ir12 */
-    static size_t ir12_start[RANK_ir12];
-    static size_t ir12_count[RANK_ir12];
-    static int ir12[] = {640000, 639980, 632000, 631980};
-    Dr_len = 2;			/* number of records of ir12 data */
-    ir12_start[0] = 0;
-    ir12_start[1] = 0;
-    ir12_start[2] = 0;
-    ir12_count[0] = Dr_len;
-    ir12_count[1] = D1_len;
-    ir12_count[2] = D2_len;
-    stat = nc_put_vara_int(ncid, ir12_id, ir12_start, ir12_count, ir12);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store fr13 */
-    static size_t fr13_start[RANK_fr13];
-    static size_t fr13_count[RANK_fr13];
-    static float fr13[] = {26244, 26235, 26226, 25515, 25506, 25497};
-    Dr_len = 2;			/* number of records of fr13 data */
-    fr13_start[0] = 0;
-    fr13_start[1] = 0;
-    fr13_start[2] = 0;
-    fr13_count[0] = Dr_len;
-    fr13_count[1] = D1_len;
-    fr13_count[2] = D3_len;
-    stat = nc_put_vara_float(ncid, fr13_id, fr13_start, fr13_count, fr13);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr21 */
-    static size_t cr21_start[RANK_cr21];
-    static size_t cr21_count[RANK_cr21];
-    static char cr21[] = {"@DHL"};
-    Dr_len = 2;			/* number of records of cr21 data */
-    cr21_start[0] = 0;
-    cr21_start[1] = 0;
-    cr21_start[2] = 0;
-    cr21_count[0] = Dr_len;
-    cr21_count[1] = D2_len;
-    cr21_count[2] = D1_len;
-    stat = nc_put_vara_text(ncid, cr21_id, cr21_start, cr21_count, cr21);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store br22 */
-    static size_t br22_start[RANK_br22];
-    static size_t br22_count[RANK_br22];
-    static signed char br22[] = {64, 62, 68, 66, 56, 54, 60, 58};
-    Dr_len = 2;			/* number of records of br22 data */
-    br22_start[0] = 0;
-    br22_start[1] = 0;
-    br22_start[2] = 0;
-    br22_count[0] = Dr_len;
-    br22_count[1] = D2_len;
-    br22_count[2] = D2_len;
-    stat = nc_put_vara_schar(ncid, br22_id, br22_start, br22_count, br22);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr23 */
-    static size_t sr23_start[RANK_sr23];
-    static size_t sr23_count[RANK_sr23];
-    static short sr23[] = {2500, 2495, 2490, 2525, 2520, 2515, 2375, 2370, 2365, 2400, 2395, 2390};
-    Dr_len = 2;			/* number of records of sr23 data */
-    sr23_start[0] = 0;
-    sr23_start[1] = 0;
-    sr23_start[2] = 0;
-    sr23_count[0] = Dr_len;
-    sr23_count[1] = D2_len;
-    sr23_count[2] = D3_len;
-    stat = nc_put_vara_short(ncid, sr23_id, sr23_start, sr23_count, sr23);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store fr31 */
-    static size_t fr31_start[RANK_fr31];
-    static size_t fr31_count[RANK_fr31];
-    static float fr31[] = {26244, 26325, 26406, 25515, 25596, 25677};
-    Dr_len = 2;			/* number of records of fr31 data */
-    fr31_start[0] = 0;
-    fr31_start[1] = 0;
-    fr31_start[2] = 0;
-    fr31_count[0] = Dr_len;
-    fr31_count[1] = D3_len;
-    fr31_count[2] = D1_len;
-    stat = nc_put_vara_float(ncid, fr31_id, fr31_start, fr31_count, fr31);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store dr32 */
-    static size_t dr32_start[RANK_dr32];
-    static size_t dr32_count[RANK_dr32];
-    static double dr32[] = {40000., 39990., 40100., 40090., 40200., 40190., 39000., 38990., 39100., 39090., 39200., 39190.};
-    Dr_len = 2;			/* number of records of dr32 data */
-    dr32_start[0] = 0;
-    dr32_start[1] = 0;
-    dr32_start[2] = 0;
-    dr32_count[0] = Dr_len;
-    dr32_count[1] = D3_len;
-    dr32_count[2] = D2_len;
-    stat = nc_put_vara_double(ncid, dr32_id, dr32_start, dr32_count, dr32);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr33 */
-    static size_t cr33_start[RANK_cr33];
-    static size_t cr33_count[RANK_cr33];
-    static char cr33[] = {"1\000\000two3\000\0004\000\0005\000\000six"};
-    Dr_len = 2;			/* number of records of cr33 data */
-    cr33_start[0] = 0;
-    cr33_start[1] = 0;
-    cr33_start[2] = 0;
-    cr33_count[0] = Dr_len;
-    cr33_count[1] = D3_len;
-    cr33_count[2] = D3_len;
-    stat = nc_put_vara_text(ncid, cr33_id, cr33_start, cr33_count, cr33);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c111 */
-    static char c111[] = {"@"};
-    stat = nc_put_var_text(ncid, c111_id, c111);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b112 */
-    static signed char b112[] = {64, 62};
-    stat = nc_put_var_schar(ncid, b112_id, b112);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s113 */
-    static short s113[] = {2500, 2495, 2490};
-    stat = nc_put_var_short(ncid, s113_id, s113);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f121 */
-    static float f121[] = {26244, 26325};
-    stat = nc_put_var_float(ncid, f121_id, f121);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d122 */
-    static double d122[] = {40000., 39990., 40100., 40090.};
-    stat = nc_put_var_double(ncid, d122_id, d122);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c123 */
-    static char c123[] = {"one2\000\000"};
-    stat = nc_put_var_text(ncid, c123_id, c123);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s131 */
-    static short s131[] = {2500, 2525, 2550};
-    stat = nc_put_var_short(ncid, s131_id, s131);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i132 */
-    static int i132[] = {640000, 639980, 640400, 640380, 640800, 640780};
-    stat = nc_put_var_int(ncid, i132_id, i132);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f133 */
-    static float f133[] = {26244, 26235, 26226, 26325, 26316, 26307, 26406, 26397, 26388};
-    stat = nc_put_var_float(ncid, f133_id, f133);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f211 */
-    static float f211[] = {26244, 25515};
-    stat = nc_put_var_float(ncid, f211_id, f211);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d212 */
-    static double d212[] = {40000., 39990., 39000., 38990.};
-    stat = nc_put_var_double(ncid, d212_id, d212);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s221 */
-    static short s221[] = {2500, 2525, 2375, 2400};
-    stat = nc_put_var_short(ncid, s221_id, s221);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i222 */
-    static int i222[] = {640000, 639980, 640400, 640380, 632000, 631980, 632400, 632380};
-    stat = nc_put_var_int(ncid, i222_id, i222);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f223 */
-    static float f223[] = {26244, 26235, 26226, 26325, 26316, 26307, 25515, 25506, 25497, 25596, 25587, 25578};
-    stat = nc_put_var_float(ncid, f223_id, f223);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c231 */
-    static char c231[] = {"@DHHLP"};
-    stat = nc_put_var_text(ncid, c231_id, c231);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b232 */
-    static signed char b232[] = {64, 62, 68, 66, 72, 70, 56, 54, 60, 58, 64, 62};
-    stat = nc_put_var_schar(ncid, b232_id, b232);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s233 */
-    static short s233[] = {2500, 2495, 2490, 2525, 2520, 2515, 2550, 2545, 2540, 2375, 2370, 2365, 2400, 2395, 2390, 2425, 2420, 2415};
-    stat = nc_put_var_short(ncid, s233_id, s233);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s311 */
-    static short s311[] = {2500, 2375, 2250};
-    stat = nc_put_var_short(ncid, s311_id, s311);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i312 */
-    static int i312[] = {640000, 639980, 632000, 631980, 624000, 623980};
-    stat = nc_put_var_int(ncid, i312_id, i312);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f313 */
-    static float f313[] = {26244, 26235, 26226, 25515, 25506, 25497, 24786, 24777, 24768};
-    stat = nc_put_var_float(ncid, f313_id, f313);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store var-name-dashes */
-    static double var_MINUS_name_MINUS_dashes = -1.;
-    stat = nc_put_var_double(ncid, var_MINUS_name_MINUS_dashes_id, &var_MINUS_name_MINUS_dashes);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store var.name.dots */
-    static double var_PERIOD_name_PERIOD_dots = -2.;
-    stat = nc_put_var_double(ncid, var_PERIOD_name_PERIOD_dots_id, &var_PERIOD_name_PERIOD_dots);
-    check_err(stat,__LINE__,__FILE__);
-   }
-   stat = nc_close(ncid);
-   check_err(stat,__LINE__,__FILE__);
-   return 0;
-}
diff --git a/ncdump/ctest64.c b/ncdump/ctest64.c
deleted file mode 100644
index 0c116a7..0000000
--- a/ncdump/ctest64.c
+++ /dev/null
@@ -1,1333 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <netcdf.h>
-
-void
-check_err(const int stat, const int line, const char *file) {
-    if (stat != NC_NOERR) {
-	   (void) fprintf(stderr, "line %d of %s: %s\n", line, file, nc_strerror(stat));
-        exit(1);
-    }
-}
-
-int
-main() {			/* create ctest0_64.nc */
-
-   int  stat;			/* return status */
-   int  ncid;			/* netCDF id */
-
-   /* dimension ids */
-   int Dr_dim;
-   int D1_dim;
-   int D2_dim;
-   int D3_dim;
-   int dim_MINUS_name_MINUS_dashes_dim;
-   int dim_PERIOD_name_PERIOD_dots_dim;
-   int dim_PLUS_name_PLUS_plusses_dim;
-   int dim_ATSIGN_name_ATSIGN_ats_dim;
-
-   /* dimension lengths */
-   size_t Dr_len = NC_UNLIMITED;
-   size_t D1_len = 1;
-   size_t D2_len = 2;
-   size_t D3_len = 3;
-   size_t dim_MINUS_name_MINUS_dashes_len = 4;
-   size_t dim_PERIOD_name_PERIOD_dots_len = 5;
-   size_t dim_PLUS_name_PLUS_plusses_len = 6;
-   size_t dim_ATSIGN_name_ATSIGN_ats_len = 7;
-
-   /* variable ids */
-   int c_id;
-   int b_id;
-   int s_id;
-   int i_id;
-   int f_id;
-   int d_id;
-   int cr_id;
-   int br_id;
-   int sr_id;
-   int ir_id;
-   int fr_id;
-   int dr_id;
-   int c1_id;
-   int b1_id;
-   int s1_id;
-   int i1_id;
-   int f1_id;
-   int d1_id;
-   int c2_id;
-   int b2_id;
-   int s2_id;
-   int i2_id;
-   int f2_id;
-   int d2_id;
-   int c3_id;
-   int b3_id;
-   int s3_id;
-   int i3_id;
-   int f3_id;
-   int d3_id;
-   int cr1_id;
-   int br2_id;
-   int sr3_id;
-   int f11_id;
-   int d12_id;
-   int c13_id;
-   int s21_id;
-   int i22_id;
-   int f23_id;
-   int c31_id;
-   int b32_id;
-   int s33_id;
-   int sr11_id;
-   int ir12_id;
-   int fr13_id;
-   int cr21_id;
-   int br22_id;
-   int sr23_id;
-   int fr31_id;
-   int dr32_id;
-   int cr33_id;
-   int c111_id;
-   int b112_id;
-   int s113_id;
-   int f121_id;
-   int d122_id;
-   int c123_id;
-   int s131_id;
-   int i132_id;
-   int f133_id;
-   int f211_id;
-   int d212_id;
-   int c213_id;
-   int s221_id;
-   int i222_id;
-   int f223_id;
-   int c231_id;
-   int b232_id;
-   int s233_id;
-   int s311_id;
-   int i312_id;
-   int f313_id;
-   int var_MINUS_name_MINUS_dashes_id;
-   int var_PERIOD_name_PERIOD_dots_id;
-   int var_PLUS_name_PLUS_plusses_id;
-   int var_ATSIGN_name_ATSIGN_ats_id;
-
-   /* rank (number of dimensions) for each variable */
-#  define RANK_c 0
-#  define RANK_b 0
-#  define RANK_s 0
-#  define RANK_i 0
-#  define RANK_f 0
-#  define RANK_d 0
-#  define RANK_cr 1
-#  define RANK_br 1
-#  define RANK_sr 1
-#  define RANK_ir 1
-#  define RANK_fr 1
-#  define RANK_dr 1
-#  define RANK_c1 1
-#  define RANK_b1 1
-#  define RANK_s1 1
-#  define RANK_i1 1
-#  define RANK_f1 1
-#  define RANK_d1 1
-#  define RANK_c2 1
-#  define RANK_b2 1
-#  define RANK_s2 1
-#  define RANK_i2 1
-#  define RANK_f2 1
-#  define RANK_d2 1
-#  define RANK_c3 1
-#  define RANK_b3 1
-#  define RANK_s3 1
-#  define RANK_i3 1
-#  define RANK_f3 1
-#  define RANK_d3 1
-#  define RANK_cr1 2
-#  define RANK_br2 2
-#  define RANK_sr3 2
-#  define RANK_f11 2
-#  define RANK_d12 2
-#  define RANK_c13 2
-#  define RANK_s21 2
-#  define RANK_i22 2
-#  define RANK_f23 2
-#  define RANK_c31 2
-#  define RANK_b32 2
-#  define RANK_s33 2
-#  define RANK_sr11 3
-#  define RANK_ir12 3
-#  define RANK_fr13 3
-#  define RANK_cr21 3
-#  define RANK_br22 3
-#  define RANK_sr23 3
-#  define RANK_fr31 3
-#  define RANK_dr32 3
-#  define RANK_cr33 3
-#  define RANK_c111 3
-#  define RANK_b112 3
-#  define RANK_s113 3
-#  define RANK_f121 3
-#  define RANK_d122 3
-#  define RANK_c123 3
-#  define RANK_s131 3
-#  define RANK_i132 3
-#  define RANK_f133 3
-#  define RANK_f211 3
-#  define RANK_d212 3
-#  define RANK_c213 3
-#  define RANK_s221 3
-#  define RANK_i222 3
-#  define RANK_f223 3
-#  define RANK_c231 3
-#  define RANK_b232 3
-#  define RANK_s233 3
-#  define RANK_s311 3
-#  define RANK_i312 3
-#  define RANK_f313 3
-#  define RANK_var_MINUS_name_MINUS_dashes 0
-#  define RANK_var_PERIOD_name_PERIOD_dots 0
-#  define RANK_var_PLUS_name_PLUS_plusses 0
-#  define RANK_var_ATSIGN_name_ATSIGN_ats 0
-
-   /* variable shapes */
-   int cr_dims[RANK_cr];
-   int br_dims[RANK_br];
-   int sr_dims[RANK_sr];
-   int ir_dims[RANK_ir];
-   int fr_dims[RANK_fr];
-   int dr_dims[RANK_dr];
-   int c1_dims[RANK_c1];
-   int b1_dims[RANK_b1];
-   int s1_dims[RANK_s1];
-   int i1_dims[RANK_i1];
-   int f1_dims[RANK_f1];
-   int d1_dims[RANK_d1];
-   int c2_dims[RANK_c2];
-   int b2_dims[RANK_b2];
-   int s2_dims[RANK_s2];
-   int i2_dims[RANK_i2];
-   int f2_dims[RANK_f2];
-   int d2_dims[RANK_d2];
-   int c3_dims[RANK_c3];
-   int b3_dims[RANK_b3];
-   int s3_dims[RANK_s3];
-   int i3_dims[RANK_i3];
-   int f3_dims[RANK_f3];
-   int d3_dims[RANK_d3];
-   int cr1_dims[RANK_cr1];
-   int br2_dims[RANK_br2];
-   int sr3_dims[RANK_sr3];
-   int f11_dims[RANK_f11];
-   int d12_dims[RANK_d12];
-   int c13_dims[RANK_c13];
-   int s21_dims[RANK_s21];
-   int i22_dims[RANK_i22];
-   int f23_dims[RANK_f23];
-   int c31_dims[RANK_c31];
-   int b32_dims[RANK_b32];
-   int s33_dims[RANK_s33];
-   int sr11_dims[RANK_sr11];
-   int ir12_dims[RANK_ir12];
-   int fr13_dims[RANK_fr13];
-   int cr21_dims[RANK_cr21];
-   int br22_dims[RANK_br22];
-   int sr23_dims[RANK_sr23];
-   int fr31_dims[RANK_fr31];
-   int dr32_dims[RANK_dr32];
-   int cr33_dims[RANK_cr33];
-   int c111_dims[RANK_c111];
-   int b112_dims[RANK_b112];
-   int s113_dims[RANK_s113];
-   int f121_dims[RANK_f121];
-   int d122_dims[RANK_d122];
-   int c123_dims[RANK_c123];
-   int s131_dims[RANK_s131];
-   int i132_dims[RANK_i132];
-   int f133_dims[RANK_f133];
-   int f211_dims[RANK_f211];
-   int d212_dims[RANK_d212];
-   int c213_dims[RANK_c213];
-   int s221_dims[RANK_s221];
-   int i222_dims[RANK_i222];
-   int f223_dims[RANK_f223];
-   int c231_dims[RANK_c231];
-   int b232_dims[RANK_b232];
-   int s233_dims[RANK_s233];
-   int s311_dims[RANK_s311];
-   int i312_dims[RANK_i312];
-   int f313_dims[RANK_f313];
-
-   /* attribute vectors */
-   int c_att_MINUS_name_MINUS_dashes[1];
-   int c_att_PERIOD_name_PERIOD_dots[1];
-   int c_att_PLUS_name_PLUS_plusses[1];
-   int c_att_ATSIGN_name_ATSIGN_ats[1];
-   int s_b[4];
-   short s_s[3];
-   int i_i[3];
-   float i_f[3];
-   double i_d[3];
-   int cdf_Gb[2];
-   short cdf_Gs[3];
-   int cdf_Gi[3];
-   float cdf_Gf[3];
-   double cdf_Gd[3];
-   int cdf_Gatt_MINUS_name_MINUS_dashes[1];
-   int cdf_Gatt_PERIOD_name_PERIOD_dots[1];
-   int cdf_Gatt_PLUS_name_PLUS_plusses[1];
-   int cdf_Gatt_ATSIGN_name_ATSIGN_ats[1];
-
-   /* enter define mode */
-   stat = nc_create("ctest0_64.nc", NC_CLOBBER|NC_64BIT_OFFSET, &ncid);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* define dimensions */
-   stat = nc_def_dim(ncid, "Dr", Dr_len, &Dr_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "D1", D1_len, &D1_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "D2", D2_len, &D2_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "D3", D3_len, &D3_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim-name-dashes", dim_MINUS_name_MINUS_dashes_len, &dim_MINUS_name_MINUS_dashes_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim.name.dots", dim_PERIOD_name_PERIOD_dots_len, &dim_PERIOD_name_PERIOD_dots_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim+name+plusses", dim_PLUS_name_PLUS_plusses_len, &dim_PLUS_name_PLUS_plusses_dim);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_def_dim(ncid, "dim at name@ats", dim_ATSIGN_name_ATSIGN_ats_len, &dim_ATSIGN_name_ATSIGN_ats_dim);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* define variables */
-
-   stat = nc_def_var(ncid, "c", NC_CHAR, RANK_c, 0, &c_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "b", NC_BYTE, RANK_b, 0, &b_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "s", NC_SHORT, RANK_s, 0, &s_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "i", NC_INT, RANK_i, 0, &i_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "f", NC_FLOAT, RANK_f, 0, &f_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "d", NC_DOUBLE, RANK_d, 0, &d_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "cr", NC_CHAR, RANK_cr, cr_dims, &cr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   br_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "br", NC_BYTE, RANK_br, br_dims, &br_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "sr", NC_SHORT, RANK_sr, sr_dims, &sr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   ir_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "ir", NC_INT, RANK_ir, ir_dims, &ir_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   fr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "fr", NC_FLOAT, RANK_fr, fr_dims, &fr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   dr_dims[0] = Dr_dim;
-   stat = nc_def_var(ncid, "dr", NC_DOUBLE, RANK_dr, dr_dims, &dr_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "c1", NC_CHAR, RANK_c1, c1_dims, &c1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "b1", NC_BYTE, RANK_b1, b1_dims, &b1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "s1", NC_SHORT, RANK_s1, s1_dims, &s1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "i1", NC_INT, RANK_i1, i1_dims, &i1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "f1", NC_FLOAT, RANK_f1, f1_dims, &f1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d1_dims[0] = D1_dim;
-   stat = nc_def_var(ncid, "d1", NC_DOUBLE, RANK_d1, d1_dims, &d1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "c2", NC_CHAR, RANK_c2, c2_dims, &c2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "b2", NC_BYTE, RANK_b2, b2_dims, &b2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "s2", NC_SHORT, RANK_s2, s2_dims, &s2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "i2", NC_INT, RANK_i2, i2_dims, &i2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "f2", NC_FLOAT, RANK_f2, f2_dims, &f2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d2_dims[0] = D2_dim;
-   stat = nc_def_var(ncid, "d2", NC_DOUBLE, RANK_d2, d2_dims, &d2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "c3", NC_CHAR, RANK_c3, c3_dims, &c3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "b3", NC_BYTE, RANK_b3, b3_dims, &b3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "s3", NC_SHORT, RANK_s3, s3_dims, &s3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "i3", NC_INT, RANK_i3, i3_dims, &i3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "f3", NC_FLOAT, RANK_f3, f3_dims, &f3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d3_dims[0] = D3_dim;
-   stat = nc_def_var(ncid, "d3", NC_DOUBLE, RANK_d3, d3_dims, &d3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr1_dims[0] = Dr_dim;
-   cr1_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "cr1", NC_CHAR, RANK_cr1, cr1_dims, &cr1_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   br2_dims[0] = Dr_dim;
-   br2_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "br2", NC_BYTE, RANK_br2, br2_dims, &br2_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr3_dims[0] = Dr_dim;
-   sr3_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "sr3", NC_SHORT, RANK_sr3, sr3_dims, &sr3_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f11_dims[0] = D1_dim;
-   f11_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "f11", NC_FLOAT, RANK_f11, f11_dims, &f11_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d12_dims[0] = D1_dim;
-   d12_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "d12", NC_DOUBLE, RANK_d12, d12_dims, &d12_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c13_dims[0] = D1_dim;
-   c13_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "c13", NC_CHAR, RANK_c13, c13_dims, &c13_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s21_dims[0] = D2_dim;
-   s21_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "s21", NC_SHORT, RANK_s21, s21_dims, &s21_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i22_dims[0] = D2_dim;
-   i22_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "i22", NC_INT, RANK_i22, i22_dims, &i22_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f23_dims[0] = D2_dim;
-   f23_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "f23", NC_FLOAT, RANK_f23, f23_dims, &f23_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c31_dims[0] = D3_dim;
-   c31_dims[1] = D1_dim;
-   stat = nc_def_var(ncid, "c31", NC_CHAR, RANK_c31, c31_dims, &c31_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b32_dims[0] = D3_dim;
-   b32_dims[1] = D2_dim;
-   stat = nc_def_var(ncid, "b32", NC_BYTE, RANK_b32, b32_dims, &b32_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s33_dims[0] = D3_dim;
-   s33_dims[1] = D3_dim;
-   stat = nc_def_var(ncid, "s33", NC_SHORT, RANK_s33, s33_dims, &s33_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr11_dims[0] = Dr_dim;
-   sr11_dims[1] = D1_dim;
-   sr11_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "sr11", NC_SHORT, RANK_sr11, sr11_dims, &sr11_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   ir12_dims[0] = Dr_dim;
-   ir12_dims[1] = D1_dim;
-   ir12_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "ir12", NC_INT, RANK_ir12, ir12_dims, &ir12_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   fr13_dims[0] = Dr_dim;
-   fr13_dims[1] = D1_dim;
-   fr13_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "fr13", NC_FLOAT, RANK_fr13, fr13_dims, &fr13_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr21_dims[0] = Dr_dim;
-   cr21_dims[1] = D2_dim;
-   cr21_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "cr21", NC_CHAR, RANK_cr21, cr21_dims, &cr21_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   br22_dims[0] = Dr_dim;
-   br22_dims[1] = D2_dim;
-   br22_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "br22", NC_BYTE, RANK_br22, br22_dims, &br22_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   sr23_dims[0] = Dr_dim;
-   sr23_dims[1] = D2_dim;
-   sr23_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "sr23", NC_SHORT, RANK_sr23, sr23_dims, &sr23_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   fr31_dims[0] = Dr_dim;
-   fr31_dims[1] = D3_dim;
-   fr31_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "fr31", NC_FLOAT, RANK_fr31, fr31_dims, &fr31_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   dr32_dims[0] = Dr_dim;
-   dr32_dims[1] = D3_dim;
-   dr32_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "dr32", NC_DOUBLE, RANK_dr32, dr32_dims, &dr32_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   cr33_dims[0] = Dr_dim;
-   cr33_dims[1] = D3_dim;
-   cr33_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "cr33", NC_CHAR, RANK_cr33, cr33_dims, &cr33_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c111_dims[0] = D1_dim;
-   c111_dims[1] = D1_dim;
-   c111_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "c111", NC_CHAR, RANK_c111, c111_dims, &c111_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b112_dims[0] = D1_dim;
-   b112_dims[1] = D1_dim;
-   b112_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "b112", NC_BYTE, RANK_b112, b112_dims, &b112_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s113_dims[0] = D1_dim;
-   s113_dims[1] = D1_dim;
-   s113_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "s113", NC_SHORT, RANK_s113, s113_dims, &s113_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f121_dims[0] = D1_dim;
-   f121_dims[1] = D2_dim;
-   f121_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "f121", NC_FLOAT, RANK_f121, f121_dims, &f121_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d122_dims[0] = D1_dim;
-   d122_dims[1] = D2_dim;
-   d122_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "d122", NC_DOUBLE, RANK_d122, d122_dims, &d122_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c123_dims[0] = D1_dim;
-   c123_dims[1] = D2_dim;
-   c123_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "c123", NC_CHAR, RANK_c123, c123_dims, &c123_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s131_dims[0] = D1_dim;
-   s131_dims[1] = D3_dim;
-   s131_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "s131", NC_SHORT, RANK_s131, s131_dims, &s131_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i132_dims[0] = D1_dim;
-   i132_dims[1] = D3_dim;
-   i132_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "i132", NC_INT, RANK_i132, i132_dims, &i132_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f133_dims[0] = D1_dim;
-   f133_dims[1] = D3_dim;
-   f133_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "f133", NC_FLOAT, RANK_f133, f133_dims, &f133_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f211_dims[0] = D2_dim;
-   f211_dims[1] = D1_dim;
-   f211_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "f211", NC_FLOAT, RANK_f211, f211_dims, &f211_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   d212_dims[0] = D2_dim;
-   d212_dims[1] = D1_dim;
-   d212_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "d212", NC_DOUBLE, RANK_d212, d212_dims, &d212_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c213_dims[0] = D2_dim;
-   c213_dims[1] = D1_dim;
-   c213_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "c213", NC_CHAR, RANK_c213, c213_dims, &c213_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s221_dims[0] = D2_dim;
-   s221_dims[1] = D2_dim;
-   s221_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "s221", NC_SHORT, RANK_s221, s221_dims, &s221_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i222_dims[0] = D2_dim;
-   i222_dims[1] = D2_dim;
-   i222_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "i222", NC_INT, RANK_i222, i222_dims, &i222_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f223_dims[0] = D2_dim;
-   f223_dims[1] = D2_dim;
-   f223_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "f223", NC_FLOAT, RANK_f223, f223_dims, &f223_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   c231_dims[0] = D2_dim;
-   c231_dims[1] = D3_dim;
-   c231_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "c231", NC_CHAR, RANK_c231, c231_dims, &c231_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   b232_dims[0] = D2_dim;
-   b232_dims[1] = D3_dim;
-   b232_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "b232", NC_BYTE, RANK_b232, b232_dims, &b232_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s233_dims[0] = D2_dim;
-   s233_dims[1] = D3_dim;
-   s233_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "s233", NC_SHORT, RANK_s233, s233_dims, &s233_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   s311_dims[0] = D3_dim;
-   s311_dims[1] = D1_dim;
-   s311_dims[2] = D1_dim;
-   stat = nc_def_var(ncid, "s311", NC_SHORT, RANK_s311, s311_dims, &s311_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   i312_dims[0] = D3_dim;
-   i312_dims[1] = D1_dim;
-   i312_dims[2] = D2_dim;
-   stat = nc_def_var(ncid, "i312", NC_INT, RANK_i312, i312_dims, &i312_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   f313_dims[0] = D3_dim;
-   f313_dims[1] = D1_dim;
-   f313_dims[2] = D3_dim;
-   stat = nc_def_var(ncid, "f313", NC_FLOAT, RANK_f313, f313_dims, &f313_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var-name-dashes", NC_DOUBLE, RANK_var_MINUS_name_MINUS_dashes, 0, &var_MINUS_name_MINUS_dashes_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var.name.dots", NC_DOUBLE, RANK_var_PERIOD_name_PERIOD_dots, 0, &var_PERIOD_name_PERIOD_dots_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var+name+plusses", NC_DOUBLE, RANK_var_PLUS_name_PLUS_plusses, 0, &var_PLUS_name_PLUS_plusses_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   stat = nc_def_var(ncid, "var at name@ats", NC_DOUBLE, RANK_var_ATSIGN_name_ATSIGN_ats, 0, &var_ATSIGN_name_ATSIGN_ats_id);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* assign attributes */
-   c_att_MINUS_name_MINUS_dashes[0] = 4;
-   stat = nc_put_att_int(ncid, c_id, "att-name-dashes", NC_INT, 1, c_att_MINUS_name_MINUS_dashes);
-   check_err(stat,__LINE__,__FILE__);
-   c_att_PERIOD_name_PERIOD_dots[0] = 5;
-   stat = nc_put_att_int(ncid, c_id, "att.name.dots", NC_INT, 1, c_att_PERIOD_name_PERIOD_dots);
-   check_err(stat,__LINE__,__FILE__);
-   c_att_PLUS_name_PLUS_plusses[0] = 6;
-   stat = nc_put_att_int(ncid, c_id, "att+name+plusses", NC_INT, 1, c_att_PLUS_name_PLUS_plusses);
-   check_err(stat,__LINE__,__FILE__);
-   c_att_ATSIGN_name_ATSIGN_ats[0] = 7;
-   stat = nc_put_att_int(ncid, c_id, "att at name@ats", NC_INT, 1, c_att_ATSIGN_name_ATSIGN_ats);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, b_id, "c", 1, "");
-   check_err(stat,__LINE__,__FILE__);
-   s_b[0] = 0;
-   s_b[1] = 127;
-   s_b[2] = -128;
-   s_b[3] = -1;
-   stat = nc_put_att_int(ncid, s_id, "b", NC_BYTE, 4, s_b);
-   check_err(stat,__LINE__,__FILE__);
-   s_s[0] = -32768;
-   s_s[1] = 0;
-   s_s[2] = 32767;
-   stat = nc_put_att_short(ncid, s_id, "s", NC_SHORT, 3, s_s);
-   check_err(stat,__LINE__,__FILE__);
-   i_i[0] = -2147483647;
-   i_i[1] = 0;
-   i_i[2] = 2147483647;
-   stat = nc_put_att_int(ncid, i_id, "i", NC_INT, 3, i_i);
-   check_err(stat,__LINE__,__FILE__);
-   i_f[0] = -9.9999996e+35;
-   i_f[1] = 0;
-   i_f[2] = 9.9999996e+35;
-   stat = nc_put_att_float(ncid, i_id, "f", NC_FLOAT, 3, i_f);
-   check_err(stat,__LINE__,__FILE__);
-   i_d[0] = -1e+308;
-   i_d[1] = 0;
-   i_d[2] = 1e+308;
-   stat = nc_put_att_double(ncid, i_id, "d", NC_DOUBLE, 3, i_d);
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, f_id, "c", 1, "x");
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, d_id, "c", 8, "abcd\tZ$&");
-   check_err(stat,__LINE__,__FILE__);
-   stat = nc_put_att_text(ncid, NC_GLOBAL, "Gc", 1, "");
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gb[0] = -128;
-   cdf_Gb[1] = 127;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gb", NC_BYTE, 2, cdf_Gb);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gs[0] = -32768;
-   cdf_Gs[1] = 0;
-   cdf_Gs[2] = 32767;
-   stat = nc_put_att_short(ncid, NC_GLOBAL, "Gs", NC_SHORT, 3, cdf_Gs);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gi[0] = -2147483647;
-   cdf_Gi[1] = 0;
-   cdf_Gi[2] = 2147483647;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gi", NC_INT, 3, cdf_Gi);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gf[0] = -9.9999996e+35;
-   cdf_Gf[1] = 0;
-   cdf_Gf[2] = 9.9999996e+35;
-   stat = nc_put_att_float(ncid, NC_GLOBAL, "Gf", NC_FLOAT, 3, cdf_Gf);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gd[0] = -1e+308;
-   cdf_Gd[1] = 0;
-   cdf_Gd[2] = 1e+308;
-   stat = nc_put_att_double(ncid, NC_GLOBAL, "Gd", NC_DOUBLE, 3, cdf_Gd);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_MINUS_name_MINUS_dashes[0] = -1;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt-name-dashes", NC_INT, 1, cdf_Gatt_MINUS_name_MINUS_dashes);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_PERIOD_name_PERIOD_dots[0] = -2;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt.name.dots", NC_INT, 1, cdf_Gatt_PERIOD_name_PERIOD_dots);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_PLUS_name_PLUS_plusses[0] = -3;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt+name+plusses", NC_INT, 1, cdf_Gatt_PLUS_name_PLUS_plusses);
-   check_err(stat,__LINE__,__FILE__);
-   cdf_Gatt_ATSIGN_name_ATSIGN_ats[0] = -4;
-   stat = nc_put_att_int(ncid, NC_GLOBAL, "Gatt at name@ats", NC_INT, 1, cdf_Gatt_ATSIGN_name_ATSIGN_ats);
-   check_err(stat,__LINE__,__FILE__);
-
-   /* leave define mode */
-   stat = nc_enddef (ncid);
-   check_err(stat,__LINE__,__FILE__);
-
-   {			/* store c */
-    static char c = '2';
-    stat = nc_put_var_text(ncid, c_id, &c);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b */
-    static signed char b = -2;
-    stat = nc_put_var_schar(ncid, b_id, &b);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s */
-    static short s = -5;
-    stat = nc_put_var_short(ncid, s_id, &s);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i */
-    static int i = -20;
-    stat = nc_put_var_int(ncid, i_id, &i);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f */
-    static float f = -9;
-    stat = nc_put_var_float(ncid, f_id, &f);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d */
-    static double d = -10.;
-    stat = nc_put_var_double(ncid, d_id, &d);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr */
-    static size_t cr_start[RANK_cr];
-    static size_t cr_count[RANK_cr];
-    static char cr[] = {"ab"};
-    Dr_len = 2;			/* number of records of cr data */
-    cr_start[0] = 0;
-    cr_count[0] = Dr_len;
-    stat = nc_put_vara_text(ncid, cr_id, cr_start, cr_count, cr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store br */
-    static size_t br_start[RANK_br];
-    static size_t br_count[RANK_br];
-    static signed char br[] = {-128, 127};
-    Dr_len = 2;			/* number of records of br data */
-    br_start[0] = 0;
-    br_count[0] = Dr_len;
-    stat = nc_put_vara_schar(ncid, br_id, br_start, br_count, br);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr */
-    static size_t sr_start[RANK_sr];
-    static size_t sr_count[RANK_sr];
-    static short sr[] = {-32768, 32767};
-    Dr_len = 2;			/* number of records of sr data */
-    sr_start[0] = 0;
-    sr_count[0] = Dr_len;
-    stat = nc_put_vara_short(ncid, sr_id, sr_start, sr_count, sr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store ir */
-    static size_t ir_start[RANK_ir];
-    static size_t ir_count[RANK_ir];
-    static int ir[] = {-2147483646, 2147483647};
-    Dr_len = 2;			/* number of records of ir data */
-    ir_start[0] = 0;
-    ir_count[0] = Dr_len;
-    stat = nc_put_vara_int(ncid, ir_id, ir_start, ir_count, ir);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store fr */
-    static size_t fr_start[RANK_fr];
-    static size_t fr_count[RANK_fr];
-    static float fr[] = {-9.9999996e+35, 9.9999996e+35};
-    Dr_len = 2;			/* number of records of fr data */
-    fr_start[0] = 0;
-    fr_count[0] = Dr_len;
-    stat = nc_put_vara_float(ncid, fr_id, fr_start, fr_count, fr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store dr */
-    static size_t dr_start[RANK_dr];
-    static size_t dr_count[RANK_dr];
-    static double dr[] = {-1.e+308, 1.e+308};
-    Dr_len = 2;			/* number of records of dr data */
-    dr_start[0] = 0;
-    dr_count[0] = Dr_len;
-    stat = nc_put_vara_double(ncid, dr_id, dr_start, dr_count, dr);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c1 */
-    static char c1[] = {""};
-    stat = nc_put_var_text(ncid, c1_id, c1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b1 */
-    static signed char b1[] = {-128};
-    stat = nc_put_var_schar(ncid, b1_id, b1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s1 */
-    static short s1[] = {-32768};
-    stat = nc_put_var_short(ncid, s1_id, s1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i1 */
-    static int i1[] = {-2147483646};
-    stat = nc_put_var_int(ncid, i1_id, i1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f1 */
-    static float f1[] = {-9.9999996e+35};
-    stat = nc_put_var_float(ncid, f1_id, f1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d1 */
-    static double d1[] = {-1.e+308};
-    stat = nc_put_var_double(ncid, d1_id, d1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c2 */
-    static char c2[] = {"ab"};
-    stat = nc_put_var_text(ncid, c2_id, c2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b2 */
-    static signed char b2[] = {-128, 127};
-    stat = nc_put_var_schar(ncid, b2_id, b2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s2 */
-    static short s2[] = {-32768, 32767};
-    stat = nc_put_var_short(ncid, s2_id, s2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i2 */
-    static int i2[] = {-2147483646, 2147483647};
-    stat = nc_put_var_int(ncid, i2_id, i2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f2 */
-    static float f2[] = {-9.9999996e+35, 9.9999996e+35};
-    stat = nc_put_var_float(ncid, f2_id, f2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d2 */
-    static double d2[] = {-1.e+308, 1.e+308};
-    stat = nc_put_var_double(ncid, d2_id, d2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c3 */
-    static char c3[] = {"\001\300."};
-    stat = nc_put_var_text(ncid, c3_id, c3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b3 */
-    static signed char b3[] = {-128, 127, -1};
-    stat = nc_put_var_schar(ncid, b3_id, b3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s3 */
-    static short s3[] = {-32768, 0, 32767};
-    stat = nc_put_var_short(ncid, s3_id, s3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i3 */
-    static int i3[] = {-2147483646, 0, 2147483647};
-    stat = nc_put_var_int(ncid, i3_id, i3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f3 */
-    static float f3[] = {-9.9999996e+35, 0, 9.9999996e+35};
-    stat = nc_put_var_float(ncid, f3_id, f3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d3 */
-    static double d3[] = {-1.e+308, 0., 1.e+308};
-    stat = nc_put_var_double(ncid, d3_id, d3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr1 */
-    static size_t cr1_start[RANK_cr1];
-    static size_t cr1_count[RANK_cr1];
-    static char cr1[] = {"xy"};
-    Dr_len = 2;			/* number of records of cr1 data */
-    cr1_start[0] = 0;
-    cr1_start[1] = 0;
-    cr1_count[0] = Dr_len;
-    cr1_count[1] = D1_len;
-    stat = nc_put_vara_text(ncid, cr1_id, cr1_start, cr1_count, cr1);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store br2 */
-    static size_t br2_start[RANK_br2];
-    static size_t br2_count[RANK_br2];
-    static signed char br2[] = {-24, -26, -20, -22};
-    Dr_len = 2;			/* number of records of br2 data */
-    br2_start[0] = 0;
-    br2_start[1] = 0;
-    br2_count[0] = Dr_len;
-    br2_count[1] = D2_len;
-    stat = nc_put_vara_schar(ncid, br2_id, br2_start, br2_count, br2);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr3 */
-    static size_t sr3_start[RANK_sr3];
-    static size_t sr3_count[RANK_sr3];
-    static short sr3[] = {-375, -380, -385, -350, -355, -360};
-    Dr_len = 2;			/* number of records of sr3 data */
-    sr3_start[0] = 0;
-    sr3_start[1] = 0;
-    sr3_count[0] = Dr_len;
-    sr3_count[1] = D3_len;
-    stat = nc_put_vara_short(ncid, sr3_id, sr3_start, sr3_count, sr3);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f11 */
-    static float f11[] = {-2187};
-    stat = nc_put_var_float(ncid, f11_id, f11);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d12 */
-    static double d12[] = {-3000., -3010.};
-    stat = nc_put_var_double(ncid, d12_id, d12);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c13 */
-    static char c13[] = {"\tb\177"};
-    stat = nc_put_var_text(ncid, c13_id, c13);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s21 */
-    static short s21[] = {-375, -350};
-    stat = nc_put_var_short(ncid, s21_id, s21);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i22 */
-    static int i22[] = {-24000, -24020, -23600, -23620};
-    stat = nc_put_var_int(ncid, i22_id, i22);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f23 */
-    static float f23[] = {-2187, -2196, -2205, -2106, -2115, -2124};
-    stat = nc_put_var_float(ncid, f23_id, f23);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c31 */
-    static char c31[] = {"+- "};
-    stat = nc_put_var_text(ncid, c31_id, c31);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b32 */
-    static signed char b32[] = {-24, -26, -20, -22, -16, -18};
-    stat = nc_put_var_schar(ncid, b32_id, b32);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s33 */
-    static short s33[] = {-375, -380, -385, -350, -355, -360, -325, -330, -335};
-    stat = nc_put_var_short(ncid, s33_id, s33);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr11 */
-    static size_t sr11_start[RANK_sr11];
-    static size_t sr11_count[RANK_sr11];
-    static short sr11[] = {2500, 2375};
-    Dr_len = 2;			/* number of records of sr11 data */
-    sr11_start[0] = 0;
-    sr11_start[1] = 0;
-    sr11_start[2] = 0;
-    sr11_count[0] = Dr_len;
-    sr11_count[1] = D1_len;
-    sr11_count[2] = D1_len;
-    stat = nc_put_vara_short(ncid, sr11_id, sr11_start, sr11_count, sr11);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store ir12 */
-    static size_t ir12_start[RANK_ir12];
-    static size_t ir12_count[RANK_ir12];
-    static int ir12[] = {640000, 639980, 632000, 631980};
-    Dr_len = 2;			/* number of records of ir12 data */
-    ir12_start[0] = 0;
-    ir12_start[1] = 0;
-    ir12_start[2] = 0;
-    ir12_count[0] = Dr_len;
-    ir12_count[1] = D1_len;
-    ir12_count[2] = D2_len;
-    stat = nc_put_vara_int(ncid, ir12_id, ir12_start, ir12_count, ir12);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store fr13 */
-    static size_t fr13_start[RANK_fr13];
-    static size_t fr13_count[RANK_fr13];
-    static float fr13[] = {26244, 26235, 26226, 25515, 25506, 25497};
-    Dr_len = 2;			/* number of records of fr13 data */
-    fr13_start[0] = 0;
-    fr13_start[1] = 0;
-    fr13_start[2] = 0;
-    fr13_count[0] = Dr_len;
-    fr13_count[1] = D1_len;
-    fr13_count[2] = D3_len;
-    stat = nc_put_vara_float(ncid, fr13_id, fr13_start, fr13_count, fr13);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr21 */
-    static size_t cr21_start[RANK_cr21];
-    static size_t cr21_count[RANK_cr21];
-    static char cr21[] = {"@DHL"};
-    Dr_len = 2;			/* number of records of cr21 data */
-    cr21_start[0] = 0;
-    cr21_start[1] = 0;
-    cr21_start[2] = 0;
-    cr21_count[0] = Dr_len;
-    cr21_count[1] = D2_len;
-    cr21_count[2] = D1_len;
-    stat = nc_put_vara_text(ncid, cr21_id, cr21_start, cr21_count, cr21);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store br22 */
-    static size_t br22_start[RANK_br22];
-    static size_t br22_count[RANK_br22];
-    static signed char br22[] = {64, 62, 68, 66, 56, 54, 60, 58};
-    Dr_len = 2;			/* number of records of br22 data */
-    br22_start[0] = 0;
-    br22_start[1] = 0;
-    br22_start[2] = 0;
-    br22_count[0] = Dr_len;
-    br22_count[1] = D2_len;
-    br22_count[2] = D2_len;
-    stat = nc_put_vara_schar(ncid, br22_id, br22_start, br22_count, br22);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store sr23 */
-    static size_t sr23_start[RANK_sr23];
-    static size_t sr23_count[RANK_sr23];
-    static short sr23[] = {2500, 2495, 2490, 2525, 2520, 2515, 2375, 2370, 2365, 2400, 2395, 2390};
-    Dr_len = 2;			/* number of records of sr23 data */
-    sr23_start[0] = 0;
-    sr23_start[1] = 0;
-    sr23_start[2] = 0;
-    sr23_count[0] = Dr_len;
-    sr23_count[1] = D2_len;
-    sr23_count[2] = D3_len;
-    stat = nc_put_vara_short(ncid, sr23_id, sr23_start, sr23_count, sr23);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store fr31 */
-    static size_t fr31_start[RANK_fr31];
-    static size_t fr31_count[RANK_fr31];
-    static float fr31[] = {26244, 26325, 26406, 25515, 25596, 25677};
-    Dr_len = 2;			/* number of records of fr31 data */
-    fr31_start[0] = 0;
-    fr31_start[1] = 0;
-    fr31_start[2] = 0;
-    fr31_count[0] = Dr_len;
-    fr31_count[1] = D3_len;
-    fr31_count[2] = D1_len;
-    stat = nc_put_vara_float(ncid, fr31_id, fr31_start, fr31_count, fr31);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store dr32 */
-    static size_t dr32_start[RANK_dr32];
-    static size_t dr32_count[RANK_dr32];
-    static double dr32[] = {40000., 39990., 40100., 40090., 40200., 40190., 39000., 38990., 39100., 39090., 39200., 39190.};
-    Dr_len = 2;			/* number of records of dr32 data */
-    dr32_start[0] = 0;
-    dr32_start[1] = 0;
-    dr32_start[2] = 0;
-    dr32_count[0] = Dr_len;
-    dr32_count[1] = D3_len;
-    dr32_count[2] = D2_len;
-    stat = nc_put_vara_double(ncid, dr32_id, dr32_start, dr32_count, dr32);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store cr33 */
-    static size_t cr33_start[RANK_cr33];
-    static size_t cr33_count[RANK_cr33];
-    static char cr33[] = {"1\000\000two3\000\0004\000\0005\000\000six"};
-    Dr_len = 2;			/* number of records of cr33 data */
-    cr33_start[0] = 0;
-    cr33_start[1] = 0;
-    cr33_start[2] = 0;
-    cr33_count[0] = Dr_len;
-    cr33_count[1] = D3_len;
-    cr33_count[2] = D3_len;
-    stat = nc_put_vara_text(ncid, cr33_id, cr33_start, cr33_count, cr33);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c111 */
-    static char c111[] = {"@"};
-    stat = nc_put_var_text(ncid, c111_id, c111);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b112 */
-    static signed char b112[] = {64, 62};
-    stat = nc_put_var_schar(ncid, b112_id, b112);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s113 */
-    static short s113[] = {2500, 2495, 2490};
-    stat = nc_put_var_short(ncid, s113_id, s113);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f121 */
-    static float f121[] = {26244, 26325};
-    stat = nc_put_var_float(ncid, f121_id, f121);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d122 */
-    static double d122[] = {40000., 39990., 40100., 40090.};
-    stat = nc_put_var_double(ncid, d122_id, d122);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c123 */
-    static char c123[] = {"one2\000\000"};
-    stat = nc_put_var_text(ncid, c123_id, c123);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s131 */
-    static short s131[] = {2500, 2525, 2550};
-    stat = nc_put_var_short(ncid, s131_id, s131);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i132 */
-    static int i132[] = {640000, 639980, 640400, 640380, 640800, 640780};
-    stat = nc_put_var_int(ncid, i132_id, i132);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f133 */
-    static float f133[] = {26244, 26235, 26226, 26325, 26316, 26307, 26406, 26397, 26388};
-    stat = nc_put_var_float(ncid, f133_id, f133);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f211 */
-    static float f211[] = {26244, 25515};
-    stat = nc_put_var_float(ncid, f211_id, f211);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store d212 */
-    static double d212[] = {40000., 39990., 39000., 38990.};
-    stat = nc_put_var_double(ncid, d212_id, d212);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s221 */
-    static short s221[] = {2500, 2525, 2375, 2400};
-    stat = nc_put_var_short(ncid, s221_id, s221);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i222 */
-    static int i222[] = {640000, 639980, 640400, 640380, 632000, 631980, 632400, 632380};
-    stat = nc_put_var_int(ncid, i222_id, i222);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f223 */
-    static float f223[] = {26244, 26235, 26226, 26325, 26316, 26307, 25515, 25506, 25497, 25596, 25587, 25578};
-    stat = nc_put_var_float(ncid, f223_id, f223);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store c231 */
-    static char c231[] = {"@DHHLP"};
-    stat = nc_put_var_text(ncid, c231_id, c231);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store b232 */
-    static signed char b232[] = {64, 62, 68, 66, 72, 70, 56, 54, 60, 58, 64, 62};
-    stat = nc_put_var_schar(ncid, b232_id, b232);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s233 */
-    static short s233[] = {2500, 2495, 2490, 2525, 2520, 2515, 2550, 2545, 2540, 2375, 2370, 2365, 2400, 2395, 2390, 2425, 2420, 2415};
-    stat = nc_put_var_short(ncid, s233_id, s233);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store s311 */
-    static short s311[] = {2500, 2375, 2250};
-    stat = nc_put_var_short(ncid, s311_id, s311);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store i312 */
-    static int i312[] = {640000, 639980, 632000, 631980, 624000, 623980};
-    stat = nc_put_var_int(ncid, i312_id, i312);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store f313 */
-    static float f313[] = {26244, 26235, 26226, 25515, 25506, 25497, 24786, 24777, 24768};
-    stat = nc_put_var_float(ncid, f313_id, f313);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store var-name-dashes */
-    static double var_MINUS_name_MINUS_dashes = -1.;
-    stat = nc_put_var_double(ncid, var_MINUS_name_MINUS_dashes_id, &var_MINUS_name_MINUS_dashes);
-    check_err(stat,__LINE__,__FILE__);
-   }
-
-   {			/* store var.name.dots */
-    static double var_PERIOD_name_PERIOD_dots = -2.;
-    stat = nc_put_var_double(ncid, var_PERIOD_name_PERIOD_dots_id, &var_PERIOD_name_PERIOD_dots);
-    check_err(stat,__LINE__,__FILE__);
-   }
-   stat = nc_close(ncid);
-   check_err(stat,__LINE__,__FILE__);
-   return 0;
-}
diff --git a/ncdump/expected4/CMakeLists.txt b/ncdump/expected4/CMakeLists.txt
index eaea36d..f5e836e 100644
--- a/ncdump/expected4/CMakeLists.txt
+++ b/ncdump/expected4/CMakeLists.txt
@@ -1,10 +1,6 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 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)
 
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.dmp)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/ncgen/CMakeLists.txt b/ncgen/CMakeLists.txt
index 4974885..369344d 100644
--- a/ncgen/CMakeLists.txt
+++ b/ncgen/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(ncgen_FILES generate.c main.c cdata.c bindata.c genchar.c cvt.c data.c debug.c escapes.c genc.c genbin.c generr.c genlib.c getfill.c odom.c offsets.c semantics.c ncgentab.c dump.c util.c bytebuffer.c list.c genf77.c f77data.c genj.c jdata.c nc_iter.c ConvertUTF.c  )
 
 IF(USE_X_GETOPT)
diff --git a/ncgen3/CMakeLists.txt b/ncgen3/CMakeLists.txt
index e5619d3..670fc59 100644
--- a/ncgen3/CMakeLists.txt
+++ b/ncgen3/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(ncgen3_FILES main.c load.c escapes.c getfill.c init.c genlib.c ncgentab.c)
 
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl)
diff --git a/nctest/CMakeLists.txt b/nctest/CMakeLists.txt
index 6cf1bb6..d1ac3d5 100644
--- a/nctest/CMakeLists.txt
+++ b/nctest/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(nctest_SRC add.c atttests.c cdftests.c dimtests.c driver.c emalloc.c error.c misctest.c rec.c slabs.c val.c vardef.c varget.c vargetg.c varput.c varputg.c vartests.c vputget.c vputgetg.c)
 
 FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.nc)
diff --git a/oc2/CMakeLists.txt b/oc2/CMakeLists.txt
index 58f0a3d..941e9ea 100644
--- a/oc2/CMakeLists.txt
+++ b/oc2/CMakeLists.txt
@@ -1,7 +1,3 @@
-SET(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-INCLUDE_DIRECTORIES(".")
-
 SET(oc_SOURCES oc.c daplex.c dapparse.c daptab.c occlientparams.c occompile.c occurlfunctions.c ocdata.c ocdebug.c ocdump.c ocinternal.c ocnode.c ochttp.c ocrc.c ocread.c ocutil.c ocbytes.c oclist.c ocuri.c oclog.c xxdr.c)
 
 
@@ -12,4 +8,4 @@ add_library(oc2 OBJECT ${oc_SOURCES})
 FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.sh)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt Makefile.am)
 SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} dap.y)
-ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
\ No newline at end of file
+ADD_EXTRA_DIST("${CUR_EXTRA_DIST}")
diff --git a/oc2/ochttp.c b/oc2/ochttp.c
index 652ff29..be7f91c 100644
--- a/oc2/ochttp.c
+++ b/oc2/ochttp.c
@@ -97,7 +97,6 @@ ocfetchurl(CURL* curl, const char* url, OCbytes* buf, long* filetime,
 	CURLcode cstat = CURLE_OK;
 	size_t len;
         long httpcode = 0;
-	char tbuf[1024];
 	/* Set the URL */
 	cstat = curl_easy_setopt(curl, CURLOPT_URL, (void*)url);
 	if (cstat != CURLE_OK)
@@ -114,6 +113,7 @@ ocfetchurl(CURL* curl, const char* url, OCbytes* buf, long* filetime,
 	    if (cstat != CURLE_OK)
 		goto fail;
 #else		
+        	char tbuf[1024];
 		snprintf(tbuf,1023,"%s:%s",creds->username,creds->password);	
 		cstat = curl_easy_setopt(curl, CURLOPT_USERPWD, tbuf);
 		if (cstat != CURLE_OK)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/netcdf.git



More information about the Pkg-grass-devel mailing list