From 926e0ce2aa6075bd1bfaec512a9f04db8ec4995a Mon Sep 17 00:00:00 2001 From: Roy-KC Date: Fri, 18 Aug 2023 14:46:59 -0500 Subject: [PATCH 1/2] Build with cmake and Windows Visual Studio Fixes needed to generate a clean build on Win32 platforms (all tests passed). --- CMakeLists.txt | 18 +++++++++++----- fortran/gen.m4 | 42 ++++++++++++++++++++----------------- fortran/nveaget48.m4 | 14 ++++++++----- fortran/nves.m4 | 7 +++---- fortran/nvesget48.m4 | 7 +++---- fortran/nvesput48.m4 | 7 +++---- nf03_test4/f90tst_vars4.F90 | 6 +++++- nf_test/CMakeLists.txt | 10 +++++---- 8 files changed, 65 insertions(+), 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e42859ea..578a87b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,8 @@ #Minimum required CMake Version cmake_minimum_required(VERSION 3.12.0) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + #Project Name for netCDF-Fortran PROJECT (NC4F LANGUAGES C Fortran @@ -184,6 +186,11 @@ IF(NOT ENABLE_COVERAGE_TESTS) string(APPEND CMAKE_C_FLAGS " -O2") ENDIF() +IF(CMAKE_Fortran_COMPILER_ID MATCHES Intel) + IF(MSVC) + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /heap-arrays:1") + ENDIF() +ENDIF() ADD_DEFINITIONS() @@ -338,7 +345,7 @@ ENDMACRO() # CRT libs, MT tells VS to use the static CRT libs. # # Taken From: -# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F +# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F # MACRO(specify_static_crt_flag) @@ -484,6 +491,7 @@ IF (NETCDF_C_INCLUDE_DIR) string(REGEX MATCH "[01]" USE_NETCDF4 "${macrodef}") IF (USE_NETCDF4) MESSAGE(STATUS "Whether NetCDF-C built with HDF5 enabled: yes") + FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) ELSE() MESSAGE(STATUS "Whether NetCDF-C built with HDF5 enabled: no") ENDIF() @@ -641,7 +649,7 @@ CHECK_LIBRARY_EXISTS(${NETCDF_C_LIBRARY} oc_open "" BUILD_DAP) ### # Check to see if szip write capability is present in netcdf-c. ### -SET(CMAKE_REQUIRED_INCLUDES ${NETCDF_INCLUDE_DIR}) +SET(CMAKE_REQUIRED_INCLUDES ${NETCDF_C_INCLUDE_DIR}) CHECK_C_SOURCE_COMPILES(" #include #if !NC_HAS_SZIP_WRITE @@ -652,7 +660,7 @@ int main() {return 0;}" HAVE_SZIP_WRITE) ### # Check to see if quantize capability is present in netcdf-c. ### -SET(CMAKE_REQUIRED_INCLUDES ${NETCDF_INCLUDE_DIR}) +SET(CMAKE_REQUIRED_INCLUDES ${NETCDF_C_INCLUDE_DIR}) CHECK_C_SOURCE_COMPILES(" #include #if !NC_HAS_QUANTIZE @@ -678,8 +686,8 @@ endif() OPTION(DISABLE_ZSTANDARD_PLUGIN "Disable ZStandard plugin detection and functionality, even if libnetcdf was compiled with plugin support" OFF) -IF(NOT DISABLE_ZSTANDARD_PLUGIN) - SET(CMAKE_REQUIRED_INCLUDES ${NETCDF_INCLUDE_DIR}) +IF(NOT DISABLE_ZSTANDARD_PLUGIN) + SET(CMAKE_REQUIRED_INCLUDES ${NETCDF_C_INCLUDE_DIR}) CHECK_C_SOURCE_COMPILES(" #include #if !NC_HAS_ZSTD diff --git a/fortran/gen.m4 b/fortran/gen.m4 index 6fba64a9..9e81ecc3 100644 --- a/fortran/gen.m4 +++ b/fortran/gen.m4 @@ -1,5 +1,5 @@ define(NVES, dnl -`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4 +`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4 define(`KINDVALUE',$1)dnl define(`PUTORGET', $2)dnl include(f90aux.m4)dnl @@ -7,7 +7,7 @@ include(nves.m4) ')dnl define(NVESPUT48, dnl -`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4 +`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4 define(`KINDVALUE',$1)dnl define(`PUTORGET', $2)dnl include(f90aux.m4)dnl @@ -15,7 +15,7 @@ include(nvesput48.m4) ')dnl define(NVESGET48, dnl -`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4 +`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4 define(`KINDVALUE',$1)dnl define(`PUTORGET', $2)dnl include(f90aux.m4)dnl @@ -49,13 +49,11 @@ include(nveaget48.m4) NVES(OneByteInt, put) NVES(TwoByteInt, put) NVESPUT48(FourByteInt, put) -NVESPUT48(EightByteInt, put) NVES(FourByteReal, put) NVES(EightByteReal, put) NVES(OneByteInt, get) NVES(TwoByteInt, get) NVESGET48(FourByteInt, get) -NVESGET48(EightByteInt, get) NVES(FourByteReal, get) NVES(EightByteReal, get) @@ -80,13 +78,6 @@ NVEAPUT48(4, FourByteInt, put) NVEAPUT48(5, FourByteInt, put) NVEAPUT48(6, FourByteInt, put) NVEAPUT48(7, FourByteInt, put) -NVEAPUT48(1, EightByteInt, put) -NVEAPUT48(2, EightByteInt, put) -NVEAPUT48(3, EightByteInt, put) -NVEAPUT48(4, EightByteInt, put) -NVEAPUT48(5, EightByteInt, put) -NVEAPUT48(6, EightByteInt, put) -NVEAPUT48(7, EightByteInt, put) NVEA(1, FourByteReal, put) NVEA(2, FourByteReal, put) NVEA(3, FourByteReal, put) @@ -122,13 +113,6 @@ NVEAGET48(4, FourByteInt, get) NVEAGET48(5, FourByteInt, get) NVEAGET48(6, FourByteInt, get) NVEAGET48(7, FourByteInt, get) -NVEAGET48(1, EightByteInt, get) -NVEAGET48(2, EightByteInt, get) -NVEAGET48(3, EightByteInt, get) -NVEAGET48(4, EightByteInt, get) -NVEAGET48(5, EightByteInt, get) -NVEAGET48(6, EightByteInt, get) -NVEAGET48(7, EightByteInt, get) NVEA(1, FourByteReal, get) NVEA(2, FourByteReal, get) NVEA(3, FourByteReal, get) @@ -143,3 +127,23 @@ NVEA(4, EightByteReal, get) NVEA(5, EightByteReal, get) NVEA(6, EightByteReal, get) NVEA(7, EightByteReal, get) + +NVEAPUT48(1, EightByteInt, put) +NVEAPUT48(2, EightByteInt, put) +NVEAPUT48(3, EightByteInt, put) +NVEAPUT48(4, EightByteInt, put) +NVEAPUT48(5, EightByteInt, put) +NVEAPUT48(6, EightByteInt, put) +NVEAPUT48(7, EightByteInt, put) + +NVEAGET48(1, EightByteInt, get) +NVEAGET48(2, EightByteInt, get) +NVEAGET48(3, EightByteInt, get) +NVEAGET48(4, EightByteInt, get) +NVEAGET48(5, EightByteInt, get) +NVEAGET48(6, EightByteInt, get) +NVEAGET48(7, EightByteInt, get) + +NVESPUT48(EightByteInt, put) +NVESGET48(EightByteInt, get) + diff --git a/fortran/nveaget48.m4 b/fortran/nveaget48.m4 index 6e4df0ed..98d2b6ca 100644 --- a/fortran/nveaget48.m4 +++ b/fortran/nveaget48.m4 @@ -6,13 +6,16 @@ integer :: NF90_AFUN integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray + integer :: numDims, counter, shapeValues(NUMDIMS) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -31,5 +34,6 @@ NF90_AFUN = & NF_AFUN`'(ncid, varid, localStart, localCount, defaultIntArray) end if - values(COLONS) = reshape(defaultIntArray(:), shape(values)) + values(COLONS) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function NF90_AFUN diff --git a/fortran/nves.m4 b/fortran/nves.m4 index 17041442..04a0f586 100644 --- a/fortran/nves.m4 +++ b/fortran/nves.m4 @@ -3,13 +3,12 @@ TYPE, intent(IN_OR_OUT) :: values integer, dimension(:), optional, intent( in) :: start integer :: NF90_1FUN - + integer, dimension(nf90_max_var_dims) :: localIndex - integer :: counter - + ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + NF90_1FUN = NF_1FUN`'(ncid, varid, localIndex, values) end function NF90_1FUN diff --git a/fortran/nvesget48.m4 b/fortran/nvesget48.m4 index 8878f86f..5a386196 100644 --- a/fortran/nvesget48.m4 +++ b/fortran/nvesget48.m4 @@ -3,15 +3,14 @@ TYPE, intent(IN_OR_OUT) :: values integer, dimension(:), optional, intent( in) :: start integer :: NF90_1FUN - + integer, dimension(nf90_max_var_dims) :: localIndex - integer :: counter integer :: defaultInteger - + ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + NF90_1FUN = NF_1FUN`'(ncid, varid, localIndex, defaultInteger) values = defaultInteger end function NF90_1FUN diff --git a/fortran/nvesput48.m4 b/fortran/nvesput48.m4 index f10ef532..ebef80b3 100644 --- a/fortran/nvesput48.m4 +++ b/fortran/nvesput48.m4 @@ -3,13 +3,12 @@ TYPE, intent(IN_OR_OUT) :: values integer, dimension(:), optional, intent( in) :: start integer :: NF90_1FUN - + integer, dimension(nf90_max_var_dims) :: localIndex - integer :: counter - + ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + NF90_1FUN = NF_1FUN`'(ncid, varid, localIndex, int(values)) end function NF90_1FUN diff --git a/nf03_test4/f90tst_vars4.F90 b/nf03_test4/f90tst_vars4.F90 index 0b59e6c6..f3d6df60 100644 --- a/nf03_test4/f90tst_vars4.F90 +++ b/nf03_test4/f90tst_vars4.F90 @@ -16,7 +16,7 @@ program f90tst_vars4 integer, parameter :: MAX_DIMS = 2 integer, parameter :: NX = 40, NY = 4096 - integer :: data_out(NY, NX), data_in(NY, NX) + integer, dimension(:,:), allocatable :: data_out, data_in ! We need these ids and other gunk for netcdf. integer :: ncid, varid, dimids(MAX_DIMS), chunksizes(MAX_DIMS) @@ -34,6 +34,8 @@ program f90tst_vars4 print *, '' print *,'*** Testing definition of netCDF-4 vars from Fortran 90.' + allocate(data_out(NY, NX), data_in(NY, NX)) + ! Create some pretend data. do x = 1, NX do y = 1, NY @@ -95,6 +97,8 @@ program f90tst_vars4 print *,'*** SUCCESS!' + if (allocated(data_in)) deallocate(data_in) + if (allocated(data_out)) deallocate(data_out) contains ! This subroutine handles errors by printing an error message and diff --git a/nf_test/CMakeLists.txt b/nf_test/CMakeLists.txt index d8165309..42bca31e 100644 --- a/nf_test/CMakeLists.txt +++ b/nf_test/CMakeLists.txt @@ -5,7 +5,7 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON) # Process these files with m4. SET(m4_SOURCES test_get test_put) foreach (f ${m4_SOURCES}) - GEN_m4(${f}) + GEN_m4(${f}) endforeach(f) # Separate C and Fortran Sources @@ -37,7 +37,9 @@ IF(NOT NETCDF_C_LIBRARY) ENDIF() # Need a copy of ref_fills.nc for ftest -execute_process(COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/ref_fills.nc +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ref_fills.nc + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/ref_fills.nc ${CMAKE_CURRENT_BINARY_DIR}/fills.nc) INCLUDE_DIRECTORIES(BEFORE @@ -74,8 +76,8 @@ ENDFOREACH() # Copy test scripts in to current directory. FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh) FILE(COPY ${COPY_FILES} - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ - FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE) + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ + FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE) # Add script-based tests. FOREACH(t ${SCRIPT_TESTS}) From 3acb049002dd1252de80f63c7978bd8d983ba1e5 Mon Sep 17 00:00:00 2001 From: Roy-KC Date: Mon, 21 Aug 2023 16:18:48 -0500 Subject: [PATCH 2/2] Move large automatic arrays to the heap netcdf_eightbyte.F90 and netcdf_expanded.F90 were generated with M4. Two changes repeated in numerous functions. defaultIntArray is allocated rather than placed on the stack. Added shapeValues variable to eliminate temporary stack usage by "reshape" intrinsic. --- fortran/netcdf4_eightbyte.F90 | 141 +++++---- fortran/netcdf_eightbyte.F90 | 196 +++++++----- fortran/netcdf_expanded.F90 | 576 ++++++++++++++++++---------------- 3 files changed, 502 insertions(+), 411 deletions(-) diff --git a/fortran/netcdf4_eightbyte.F90 b/fortran/netcdf4_eightbyte.F90 index a6c0d17f..0da6e91a 100644 --- a/fortran/netcdf4_eightbyte.F90 +++ b/fortran/netcdf4_eightbyte.F90 @@ -3,10 +3,10 @@ function nf90_put_var_1D_EightByteInt(ncid, varid, values, start, count, stride, integer (kind = EightByteInt), dimension(:), intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter, format_num - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -14,7 +14,7 @@ function nf90_put_var_1D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -376,14 +376,15 @@ function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_1D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(1) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -395,6 +396,7 @@ function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_1D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_1D_EightByteInt = & @@ -406,8 +408,10 @@ function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_1D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:) = reshape(defaultInt8Array(:), shape(values)) + values(:) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_1D_EightByteInt = & @@ -419,7 +423,8 @@ function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_1D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:) = reshape(defaultIntArray(:), shape(values)) + values(:) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) endif endif end function nf90_get_var_1D_EightByteInt @@ -433,14 +438,15 @@ function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_2D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(2) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -452,6 +458,7 @@ function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_2D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_2D_EightByteInt = & @@ -463,8 +470,10 @@ function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_2D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:, :) = reshape(defaultInt8Array(:), shape(values)) + values(:, :) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_2D_EightByteInt = & @@ -476,7 +485,8 @@ function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_2D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end if end if end function nf90_get_var_2D_EightByteInt @@ -490,14 +500,15 @@ function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_3D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(3) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -509,6 +520,7 @@ function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_3D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_3D_EightByteInt = & @@ -520,8 +532,10 @@ function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_3D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:, :, :) = reshape(defaultInt8Array(:), shape(values)) + values(:, :, :) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_3D_EightByteInt = & @@ -533,7 +547,8 @@ function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_3D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end if end if end function nf90_get_var_3D_EightByteInt @@ -547,14 +562,15 @@ function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_4D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(4) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -566,6 +582,7 @@ function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_4D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_4D_EightByteInt = & @@ -577,8 +594,10 @@ function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_4D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:, :, :, :) = reshape(defaultInt8Array(:), shape(values)) + values(:, :, :, :) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_4D_EightByteInt = & @@ -590,7 +609,8 @@ function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_4D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end if end if end function nf90_get_var_4D_EightByteInt @@ -604,14 +624,15 @@ function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_5D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(5) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -623,6 +644,7 @@ function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_5D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_5D_EightByteInt = & @@ -634,8 +656,10 @@ function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_5D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:, :, :, :, :) = reshape(defaultInt8Array(:), shape(values)) + values(:, :, :, :, :) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_5D_EightByteInt = & @@ -647,7 +671,8 @@ function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_5D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end if end if end function nf90_get_var_5D_EightByteInt @@ -661,14 +686,15 @@ function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_6D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(6) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -680,6 +706,7 @@ function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_6D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_6D_EightByteInt = & @@ -691,8 +718,10 @@ function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_6D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:, :, :, :, :, :) = reshape(defaultInt8Array(:), shape(values)) + values(:, :, :, :, :, :) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_6D_EightByteInt = & @@ -704,7 +733,8 @@ function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_6D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end if end if end function nf90_get_var_6D_EightByteInt @@ -718,14 +748,15 @@ function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, integer :: nf90_get_var_7D_EightByteInt integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter, format_num - integer, dimension(size(values)) :: defaultIntArray - integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array + integer :: numDims, counter, format_num, shapeValues(7) + integer, dimension(:), allocatable :: defaultIntArray + integer (kind = EightByteInt), dimension(:), allocatable :: defaultInt8Array ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) @@ -737,6 +768,7 @@ function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, if (nf90_get_var_7D_EightByteInt .eq. nf90_noerr) then if (format_num .eq. nf90_format_netcdf4 .OR. & format_num .eq. nf90_format_cdf5) then + allocate(defaultInt8Array(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_7D_EightByteInt = & @@ -748,8 +780,10 @@ function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_7D_EightByteInt = & nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array) end if - values(:, :, :, :, :, :, :) = reshape(defaultInt8Array(:), shape(values)) + values(:, :, :, :, :, :, :) = reshape(defaultInt8Array(:), shapeValues) + if (allocated(defaultInt8Array)) deallocate(defaultInt8Array) else + allocate(defaultIntArray(size(values))) if(present(map)) then localMap (:size(map)) = map(:) nf90_get_var_7D_EightByteInt = & @@ -761,10 +795,11 @@ function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_7D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end if end if - + end function nf90_get_var_7D_EightByteInt diff --git a/fortran/netcdf_eightbyte.F90 b/fortran/netcdf_eightbyte.F90 index 0ab290c0..a80a1967 100644 --- a/fortran/netcdf_eightbyte.F90 +++ b/fortran/netcdf_eightbyte.F90 @@ -1,13 +1,13 @@ - function nf90_put_var_1D_EightByteInt(ncid, varid, values, start, count, stride, map) + function nf90_put_var_1D_EightByteInt(ncid, varid, values, start, count, stride, map) integer, intent( in) :: ncid, varid integer (kind = EightByteInt), dimension(:), & intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -15,7 +15,7 @@ function nf90_put_var_1D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -39,10 +39,10 @@ function nf90_put_var_2D_EightByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_2D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -50,7 +50,7 @@ function nf90_put_var_2D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -74,10 +74,10 @@ function nf90_put_var_3D_EightByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_3D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -85,7 +85,7 @@ function nf90_put_var_3D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -109,10 +109,10 @@ function nf90_put_var_4D_EightByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_4D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -120,7 +120,7 @@ function nf90_put_var_4D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -144,10 +144,10 @@ function nf90_put_var_5D_EightByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_5D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -155,7 +155,7 @@ function nf90_put_var_5D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -179,10 +179,10 @@ function nf90_put_var_6D_EightByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_6D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -190,7 +190,7 @@ function nf90_put_var_6D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -214,10 +214,10 @@ function nf90_put_var_7D_EightByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_7D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -225,7 +225,7 @@ function nf90_put_var_7D_EightByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -249,19 +249,22 @@ function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_1D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(1) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -276,7 +279,8 @@ function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_1D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:) = reshape(defaultIntArray(:), shape(values)) + values(:) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_1D_EightByteInt @@ -286,19 +290,22 @@ function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_2D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(2) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -313,7 +320,8 @@ function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_2D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_2D_EightByteInt @@ -323,19 +331,22 @@ function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_3D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(3) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -350,7 +361,8 @@ function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_3D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_3D_EightByteInt @@ -360,19 +372,22 @@ function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_4D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(4) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -387,7 +402,8 @@ function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_4D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_4D_EightByteInt @@ -397,19 +413,22 @@ function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_5D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(5) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -424,7 +443,8 @@ function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_5D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_5D_EightByteInt @@ -434,19 +454,22 @@ function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_6D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(6) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -461,7 +484,8 @@ function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_6D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_6D_EightByteInt @@ -471,19 +495,22 @@ function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_7D_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(7) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -498,7 +525,8 @@ function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, nf90_get_var_7D_EightByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_7D_EightByteInt @@ -507,13 +535,13 @@ function nf90_put_var_EightByteInt(ncid, varid, values, start) integer (kind = EightByteInt), intent( in) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_put_var_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex - + ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_put_var_EightByteInt = nf_put_var1_int(ncid, varid, localIndex, int(values)) end function nf90_put_var_EightByteInt @@ -523,14 +551,14 @@ function nf90_get_var_EightByteInt(ncid, varid, values, start) integer (kind = EightByteInt), intent(out) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_get_var_EightByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex integer :: defaultInteger - + ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_get_var_EightByteInt = nf_get_var1_int(ncid, varid, localIndex, defaultInteger) values = defaultInteger end function nf90_get_var_EightByteInt diff --git a/fortran/netcdf_expanded.F90 b/fortran/netcdf_expanded.F90 index 5d16418f..9caf6e45 100644 --- a/fortran/netcdf_expanded.F90 +++ b/fortran/netcdf_expanded.F90 @@ -4,13 +4,13 @@ function nf90_put_var_OneByteInt(ncid, varid, values, start) integer (kind = OneByteInt), intent( in) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_put_var_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_put_var_OneByteInt = nf_put_var1_int1(ncid, varid, localIndex, values) end function nf90_put_var_OneByteInt @@ -20,13 +20,13 @@ function nf90_put_var_TwoByteInt(ncid, varid, values, start) integer (kind = TwoByteInt), intent( in) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_put_var_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_put_var_TwoByteInt = nf_put_var1_int2(ncid, varid, localIndex, values) end function nf90_put_var_TwoByteInt @@ -36,13 +36,13 @@ function nf90_put_var_FourByteInt(ncid, varid, values, start) integer (kind = FourByteInt), intent( in) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_put_var_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_put_var_FourByteInt = nf_put_var1_int(ncid, varid, localIndex, int(values)) end function nf90_put_var_FourByteInt @@ -52,13 +52,13 @@ function nf90_put_var_FourByteReal(ncid, varid, values, start) real (kind = FourByteReal), intent( in) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_put_var_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_put_var_FourByteReal = nf_put_var1_real(ncid, varid, localIndex, values) end function nf90_put_var_FourByteReal @@ -68,13 +68,13 @@ function nf90_put_var_EightByteReal(ncid, varid, values, start) real (kind = EightByteReal), intent( in) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_put_var_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_put_var_EightByteReal = nf_put_var1_double(ncid, varid, localIndex, values) end function nf90_put_var_EightByteReal @@ -84,13 +84,13 @@ function nf90_get_var_OneByteInt(ncid, varid, values, start) integer (kind = OneByteInt), intent(out) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_get_var_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_get_var_OneByteInt = nf_get_var1_int1(ncid, varid, localIndex, values) end function nf90_get_var_OneByteInt @@ -100,13 +100,13 @@ function nf90_get_var_TwoByteInt(ncid, varid, values, start) integer (kind = TwoByteInt), intent(out) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_get_var_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_get_var_TwoByteInt = nf_get_var1_int2(ncid, varid, localIndex, values) end function nf90_get_var_TwoByteInt @@ -116,14 +116,14 @@ function nf90_get_var_FourByteInt(ncid, varid, values, start) integer (kind = FourByteInt), intent(out) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_get_var_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localIndex integer :: defaultInteger - + ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_get_var_FourByteInt = nf_get_var1_int(ncid, varid, localIndex, defaultInteger) values = defaultInteger end function nf90_get_var_FourByteInt @@ -134,13 +134,13 @@ function nf90_get_var_FourByteReal(ncid, varid, values, start) real (kind = FourByteReal), intent(out) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_get_var_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_get_var_FourByteReal = nf_get_var1_real(ncid, varid, localIndex, values) end function nf90_get_var_FourByteReal @@ -150,13 +150,13 @@ function nf90_get_var_EightByteReal(ncid, varid, values, start) real (kind = EightByteReal), intent(out) :: values integer, dimension(:), optional, intent( in) :: start integer :: nf90_get_var_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localIndex ! Set local arguments to default values localIndex(:) = 1 if(present(start)) localIndex(:size(start)) = start(:) - + nf90_get_var_EightByteReal = nf_get_var1_double(ncid, varid, localIndex, values) end function nf90_get_var_EightByteReal @@ -168,10 +168,10 @@ function nf90_put_var_1D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -179,7 +179,7 @@ function nf90_put_var_1D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -203,10 +203,10 @@ function nf90_put_var_2D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_2D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -214,7 +214,7 @@ function nf90_put_var_2D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -238,10 +238,10 @@ function nf90_put_var_3D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_3D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -249,7 +249,7 @@ function nf90_put_var_3D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -273,10 +273,10 @@ function nf90_put_var_4D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_4D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -284,7 +284,7 @@ function nf90_put_var_4D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -308,10 +308,10 @@ function nf90_put_var_5D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_5D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -319,7 +319,7 @@ function nf90_put_var_5D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -343,10 +343,10 @@ function nf90_put_var_6D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_6D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -354,7 +354,7 @@ function nf90_put_var_6D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -378,10 +378,10 @@ function nf90_put_var_7D_OneByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_7D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -389,7 +389,7 @@ function nf90_put_var_7D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -413,10 +413,10 @@ function nf90_put_var_1D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -424,7 +424,7 @@ function nf90_put_var_1D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -448,10 +448,10 @@ function nf90_put_var_2D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_2D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -459,7 +459,7 @@ function nf90_put_var_2D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -483,10 +483,10 @@ function nf90_put_var_3D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_3D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -494,7 +494,7 @@ function nf90_put_var_3D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -518,10 +518,10 @@ function nf90_put_var_4D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_4D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -529,7 +529,7 @@ function nf90_put_var_4D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -553,10 +553,10 @@ function nf90_put_var_5D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_5D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -564,7 +564,7 @@ function nf90_put_var_5D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -588,10 +588,10 @@ function nf90_put_var_6D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_6D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -599,7 +599,7 @@ function nf90_put_var_6D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -623,10 +623,10 @@ function nf90_put_var_7D_TwoByteInt(ncid, varid, values, start, count, stride, m intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_7D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -634,7 +634,7 @@ function nf90_put_var_7D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -658,10 +658,10 @@ function nf90_put_var_1D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -669,7 +669,7 @@ function nf90_put_var_1D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -693,10 +693,10 @@ function nf90_put_var_2D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_2D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -704,20 +704,20 @@ function nf90_put_var_2D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) if(present(map)) then - localMap (:size(map)) = map(:) - nf90_put_var_2D_FourByteInt = & - nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values)) + localMap (:size(map)) = map(:) + nf90_put_var_2D_FourByteInt = & + nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values)) else if(present(stride)) then - nf90_put_var_2D_FourByteInt = & - nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values)) + nf90_put_var_2D_FourByteInt = & + nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values)) else - nf90_put_var_2D_FourByteInt = & - nf_put_vara_int(ncid, varid, localStart, localCount, values) + nf90_put_var_2D_FourByteInt = & + nf_put_vara_int(ncid, varid, localStart, localCount, values) end if end function nf90_put_var_2D_FourByteInt @@ -728,10 +728,10 @@ function nf90_put_var_3D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_3D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -739,7 +739,7 @@ function nf90_put_var_3D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -763,10 +763,10 @@ function nf90_put_var_4D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_4D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -774,7 +774,7 @@ function nf90_put_var_4D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -798,10 +798,10 @@ function nf90_put_var_5D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_5D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -809,7 +809,7 @@ function nf90_put_var_5D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -833,10 +833,10 @@ function nf90_put_var_6D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_6D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -844,7 +844,7 @@ function nf90_put_var_6D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -868,10 +868,10 @@ function nf90_put_var_7D_FourByteInt(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_7D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -879,7 +879,7 @@ function nf90_put_var_7D_FourByteInt(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -897,16 +897,16 @@ function nf90_put_var_7D_FourByteInt(ncid, varid, values, start, count, stride, end function nf90_put_var_7D_FourByteInt - function nf90_put_var_1D_FourByteReal(ncid, varid, values, start, count, stride, map) + function nf90_put_var_1D_FourByteReal(ncid, varid, values, start, count, stride, map) integer, intent( in) :: ncid, varid real (kind = FourByteReal), dimension(:), & intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -914,7 +914,7 @@ function nf90_put_var_1D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -938,10 +938,10 @@ function nf90_put_var_2D_FourByteReal(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_2D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -949,7 +949,7 @@ function nf90_put_var_2D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -973,10 +973,10 @@ function nf90_put_var_3D_FourByteReal(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_3D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -984,7 +984,7 @@ function nf90_put_var_3D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1008,10 +1008,10 @@ function nf90_put_var_4D_FourByteReal(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_4D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1019,7 +1019,7 @@ function nf90_put_var_4D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1043,10 +1043,10 @@ function nf90_put_var_5D_FourByteReal(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_5D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1054,7 +1054,7 @@ function nf90_put_var_5D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1078,10 +1078,10 @@ function nf90_put_var_6D_FourByteReal(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_6D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1089,7 +1089,7 @@ function nf90_put_var_6D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1113,10 +1113,10 @@ function nf90_put_var_7D_FourByteReal(ncid, varid, values, start, count, stride, intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_7D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1124,7 +1124,7 @@ function nf90_put_var_7D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1148,10 +1148,10 @@ function nf90_put_var_1D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_1D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1159,7 +1159,7 @@ function nf90_put_var_1D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1183,10 +1183,10 @@ function nf90_put_var_2D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_2D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1194,7 +1194,7 @@ function nf90_put_var_2D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1218,10 +1218,10 @@ function nf90_put_var_3D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_3D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1229,7 +1229,7 @@ function nf90_put_var_3D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1253,10 +1253,10 @@ function nf90_put_var_4D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_4D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1264,7 +1264,7 @@ function nf90_put_var_4D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1288,10 +1288,10 @@ function nf90_put_var_5D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_5D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1299,7 +1299,7 @@ function nf90_put_var_5D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1323,10 +1323,10 @@ function nf90_put_var_6D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_6D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1334,7 +1334,7 @@ function nf90_put_var_6D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1358,10 +1358,10 @@ function nf90_put_var_7D_EightByteReal(ncid, varid, values, start, count, stride intent( in) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_put_var_7D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1369,7 +1369,7 @@ function nf90_put_var_7D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1393,10 +1393,10 @@ function nf90_get_var_1D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_1D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1404,7 +1404,7 @@ function nf90_get_var_1D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1428,10 +1428,10 @@ function nf90_get_var_2D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_2D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1439,7 +1439,7 @@ function nf90_get_var_2D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1463,10 +1463,10 @@ function nf90_get_var_3D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_3D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1474,7 +1474,7 @@ function nf90_get_var_3D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1498,10 +1498,10 @@ function nf90_get_var_4D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_4D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1509,7 +1509,7 @@ function nf90_get_var_4D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1533,10 +1533,10 @@ function nf90_get_var_5D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_5D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1544,7 +1544,7 @@ function nf90_get_var_5D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1568,10 +1568,10 @@ function nf90_get_var_6D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_6D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1579,7 +1579,7 @@ function nf90_get_var_6D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1603,10 +1603,10 @@ function nf90_get_var_7D_OneByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_7D_OneByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1614,7 +1614,7 @@ function nf90_get_var_7D_OneByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1638,10 +1638,10 @@ function nf90_get_var_1D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_1D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1649,7 +1649,7 @@ function nf90_get_var_1D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1673,10 +1673,10 @@ function nf90_get_var_2D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_2D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1684,7 +1684,7 @@ function nf90_get_var_2D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1708,10 +1708,10 @@ function nf90_get_var_3D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_3D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1719,7 +1719,7 @@ function nf90_get_var_3D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1743,10 +1743,10 @@ function nf90_get_var_4D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_4D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1754,7 +1754,7 @@ function nf90_get_var_4D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1778,10 +1778,10 @@ function nf90_get_var_5D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_5D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1789,7 +1789,7 @@ function nf90_get_var_5D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1813,10 +1813,10 @@ function nf90_get_var_6D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_6D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1824,7 +1824,7 @@ function nf90_get_var_6D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1848,10 +1848,10 @@ function nf90_get_var_7D_TwoByteInt(ncid, varid, values, start, count, stride, m intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_7D_TwoByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -1859,7 +1859,7 @@ function nf90_get_var_7D_TwoByteInt(ncid, varid, values, start, count, stride, m localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1883,19 +1883,22 @@ function nf90_get_var_1D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_1D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(1) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1910,7 +1913,8 @@ function nf90_get_var_1D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_1D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:) = reshape(defaultIntArray(:), shape(values)) + values(:) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_1D_FourByteInt @@ -1920,19 +1924,22 @@ function nf90_get_var_2D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_2D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(2) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1947,7 +1954,8 @@ function nf90_get_var_2D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_2D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_2D_FourByteInt @@ -1957,19 +1965,22 @@ function nf90_get_var_3D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_3D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(3) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -1984,7 +1995,8 @@ function nf90_get_var_3D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_3D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_3D_FourByteInt @@ -1994,19 +2006,22 @@ function nf90_get_var_4D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_4D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(4) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2021,7 +2036,8 @@ function nf90_get_var_4D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_4D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_4D_FourByteInt @@ -2031,19 +2047,22 @@ function nf90_get_var_5D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_5D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(5) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2058,7 +2077,8 @@ function nf90_get_var_5D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_5D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_5D_FourByteInt @@ -2068,19 +2088,22 @@ function nf90_get_var_6D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_6D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(6) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2095,7 +2118,8 @@ function nf90_get_var_6D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_6D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_6D_FourByteInt @@ -2105,19 +2129,22 @@ function nf90_get_var_7D_FourByteInt(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_7D_FourByteInt - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap - integer :: numDims, counter - integer, dimension(size(values)) :: defaultIntArray - + integer :: numDims, counter, shapeValues(7) + integer, dimension(:), allocatable :: defaultIntArray + + allocate(defaultIntArray(size(values))) + ! Set local arguments to default values - numDims = size(shape(values)) + shapeValues = shape(values) + numDims = size(shapeValues) localStart (: ) = 1 - localCount (:numDims ) = shape(values) + localCount (:numDims ) = shapeValues localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2132,7 +2159,8 @@ function nf90_get_var_7D_FourByteInt(ncid, varid, values, start, count, stride, nf90_get_var_7D_FourByteInt = & nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray) end if - values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values)) + values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shapeValues) + if (allocated(defaultIntArray)) deallocate(defaultIntArray) end function nf90_get_var_7D_FourByteInt @@ -2142,10 +2170,10 @@ function nf90_get_var_1D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_1D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2153,7 +2181,7 @@ function nf90_get_var_1D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2177,10 +2205,10 @@ function nf90_get_var_2D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_2D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2188,7 +2216,7 @@ function nf90_get_var_2D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2212,10 +2240,10 @@ function nf90_get_var_3D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_3D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2223,7 +2251,7 @@ function nf90_get_var_3D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2247,10 +2275,10 @@ function nf90_get_var_4D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_4D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2258,7 +2286,7 @@ function nf90_get_var_4D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2282,10 +2310,10 @@ function nf90_get_var_5D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_5D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2293,7 +2321,7 @@ function nf90_get_var_5D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2317,10 +2345,10 @@ function nf90_get_var_6D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_6D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2328,7 +2356,7 @@ function nf90_get_var_6D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2352,10 +2380,10 @@ function nf90_get_var_7D_FourByteReal(ncid, varid, values, start, count, stride, intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_7D_FourByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2363,7 +2391,7 @@ function nf90_get_var_7D_FourByteReal(ncid, varid, values, start, count, stride, localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2387,10 +2415,10 @@ function nf90_get_var_1D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_1D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2398,7 +2426,7 @@ function nf90_get_var_1D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2422,10 +2450,10 @@ function nf90_get_var_2D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_2D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2433,7 +2461,7 @@ function nf90_get_var_2D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2457,10 +2485,10 @@ function nf90_get_var_3D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_3D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2468,7 +2496,7 @@ function nf90_get_var_3D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2492,10 +2520,10 @@ function nf90_get_var_4D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_4D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2503,7 +2531,7 @@ function nf90_get_var_4D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2527,10 +2555,10 @@ function nf90_get_var_5D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_5D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2538,7 +2566,7 @@ function nf90_get_var_5D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2562,10 +2590,10 @@ function nf90_get_var_6D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_6D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2573,7 +2601,7 @@ function nf90_get_var_6D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:) @@ -2597,10 +2625,10 @@ function nf90_get_var_7D_EightByteReal(ncid, varid, values, start, count, stride intent(out) :: values integer, dimension(:), optional, intent( in) :: start, count, stride, map integer :: nf90_get_var_7D_EightByteReal - + integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap integer :: numDims, counter - + ! Set local arguments to default values numDims = size(shape(values)) localStart (: ) = 1 @@ -2608,7 +2636,7 @@ function nf90_get_var_7D_EightByteReal(ncid, varid, values, start, count, stride localCount (numDims+1:) = 1 localStride(: ) = 1 localMap (:numDims ) = (/ 1, (product(localCount(:counter)), counter = 1, numDims - 1) /) - + if(present(start)) localStart (:size(start) ) = start(:) if(present(count)) localCount (:size(count) ) = count(:) if(present(stride)) localStride(:size(stride)) = stride(:)