mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-04-06 18:00:24 +08:00
moving to trunk subdir
This commit is contained in:
parent
6e22b23b01
commit
18f4bca367
297
Makefile.am
Normal file
297
Makefile.am
Normal file
@ -0,0 +1,297 @@
|
||||
## This is a automake file, part of Unidata's netCDF package.
|
||||
# Copyright 2005, see the COPYRIGHT file for more information.
|
||||
|
||||
# This is the main automake file for netCDF. It builds the different
|
||||
# netcdf directories. Not all directories are built, depending on the
|
||||
# options selected during configure.
|
||||
|
||||
# $Id: Makefile.am,v 1.137 2010/06/01 15:34:49 ed Exp $
|
||||
|
||||
# This directory stores libtool macros, put there by aclocal.
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# Tell automake that netcdf.h (and maybe netcdf_par.h) is a header
|
||||
# file we want to install.
|
||||
include_HEADERS = netcdf.h
|
||||
if BUILD_PARALLEL
|
||||
include_HEADERS += netcdf_par.h
|
||||
endif
|
||||
|
||||
# This header is used by all test programs but will not be installed.
|
||||
noinst_HEADERS = nc_tests.h nc_logging.h
|
||||
|
||||
# These files get added to the distribution.
|
||||
EXTRA_DIST = README COPYRIGHT RELEASE_NOTES INSTALL test_prog.c \
|
||||
test_prog.F test_prog.f90
|
||||
|
||||
pkgconfigdir=$(libdir)/pkgconfig
|
||||
pkgconfig_DATA = netcdf.pc
|
||||
|
||||
# This will go to the man directory and build, if necessary, the
|
||||
# netcdf-install.txt file, which will be copied into the main
|
||||
# directory, renamed "INSTALL".
|
||||
INSTALL:
|
||||
cd man4; make netcdf-install.info netcdf-install.txt
|
||||
cp man4/netcdf-install.txt INSTALL
|
||||
|
||||
# If the user wants the F77 API this will cause it to be built and
|
||||
# tested.
|
||||
if BUILD_F77
|
||||
F77_DIR = fortran
|
||||
F77_TEST = nf_test
|
||||
endif
|
||||
|
||||
# Does the user want C API?
|
||||
if BUILD_C
|
||||
|
||||
LIBSRC_DIR = libsrc
|
||||
NC_TEST_DIR = nc_test
|
||||
|
||||
# Does the user want to build the V2 API?
|
||||
if BUILD_V2
|
||||
V2_TEST = nctest
|
||||
endif
|
||||
|
||||
# Does the user want C++ API?
|
||||
if BUILD_CXX
|
||||
CXX_DIR = cxx
|
||||
endif
|
||||
|
||||
# Does the user want to build ncgen/ncdump?
|
||||
if BUILD_UTILITIES
|
||||
NCGEN3 = ncgen3
|
||||
NCGEN = ncgen
|
||||
NCDUMP = ncdump
|
||||
endif
|
||||
|
||||
# Does the user want to build the examples?
|
||||
if BUILD_EXAMPLES
|
||||
EXAMPLES = examples
|
||||
endif
|
||||
|
||||
# Is the user building netCDF-4?
|
||||
if USE_NETCDF4
|
||||
LIBSRC4_DIR = libsrc4
|
||||
NC_TEST4 = nc_test4
|
||||
endif
|
||||
|
||||
# Is the user building dispatch?
|
||||
if USE_DISPATCH
|
||||
DISPATCHDIR = libdispatch
|
||||
ASSEMBLEDIR = liblib
|
||||
endif
|
||||
|
||||
endif # BUILD_C
|
||||
|
||||
# Does the user want F90 API?
|
||||
if BUILD_F90
|
||||
F90_DIR = f90
|
||||
endif
|
||||
|
||||
# Build the new netCDF-4 C++ API?
|
||||
if BUILD_CXX4
|
||||
CXX4 = cxx4
|
||||
endif
|
||||
|
||||
# Build the opendap client?
|
||||
if BUILD_DAP
|
||||
OCLIB=oc
|
||||
NCDAP3=libncdap3
|
||||
if BUILD_UTILITIES
|
||||
NCDAPTESTDIR=ncdap_test
|
||||
endif # BUILD_UTILITIES
|
||||
NCDAP4=libncdap4
|
||||
endif
|
||||
|
||||
# Build UDUNITS?
|
||||
if BUILD_UDUNITS
|
||||
UDUNITS=udunits
|
||||
endif
|
||||
|
||||
# Build libcf?
|
||||
if BUILD_LIBCF
|
||||
LIBCF=libcf
|
||||
endif
|
||||
|
||||
#WIN32=win32
|
||||
|
||||
# This is the list of subdirs for which Makefiles will be constructed
|
||||
# and run. ncgen must come before ncdump and cxx, because their tests
|
||||
# depend on it. nf_test depends upon ncgen as well.
|
||||
# If not using dispatch then NC3DAPDIR must be
|
||||
# built right before LIBSRC_DIR and NC4DAPDIR must be
|
||||
# built right before LIBSRC4_DIR.
|
||||
# If using dispatch, then the order is different
|
||||
if BUILD_SEPARATE_FORTRAN
|
||||
SUBDIRS = $(UDUNITS) $(DISPATCHDIR) $(OCLIB) \
|
||||
$(F90_DIR) $(F77_DIR) \
|
||||
$(LIBSRC_DIR) $(LIBSRC4_DIR) $(NCDAP3) $(NCDAP4) \
|
||||
${ASSEMBLEDIR} \
|
||||
$(V2_TEST) $(NCGEN3) $(NCGEN) $(NCDUMP) \
|
||||
$(F77_TEST) ${CXX_DIR} $(CXX4) \
|
||||
$(NC_TEST_DIR) $(NC_TEST4) $(NCDAPTESTDIR) \
|
||||
man4 $(EXAMPLES) $(WIN32) $(LIBCF)
|
||||
else
|
||||
SUBDIRS = $(UDUNITS) $(DISPATCHDIR) $(OCLIB) \
|
||||
$(F90_DIR) $(F77_DIR) \
|
||||
$(LIBSRC_DIR) $(LIBSRC4_DIR) $(NCDAP3) $(NCDAP4) \
|
||||
${ASSEMBLEDIR} \
|
||||
$(V2_TEST) $(NCGEN3) $(NCGEN) $(NCDUMP) \
|
||||
$(F77_TEST) ${CXX_DIR} $(CXX4) \
|
||||
$(NC_TEST_DIR) $(NC_TEST4) $(NCDAPTESTDIR) \
|
||||
man4 $(EXAMPLES) $(WIN32) $(LIBCF)
|
||||
endif
|
||||
|
||||
# make test should do the same as make check.
|
||||
test: check
|
||||
|
||||
# Remove these generated files, for a distclean.
|
||||
DISTCLEANFILES = VERSION comps.txt test_prog
|
||||
|
||||
# The nc-config script helps the user build programs with netCDF.
|
||||
bin_SCRIPTS = nc-config
|
||||
|
||||
# What needs to go in the binrary dist?
|
||||
BINFILES = README_BINARIES.txt
|
||||
if BUILD_C
|
||||
BINFILES += include/netcdf.h share/man/man3/netcdf.3 lib/libnetcdf.a
|
||||
endif
|
||||
|
||||
if BUILD_UTILITIES
|
||||
BINFILES += bin/ncgen3$(EXEEXT) bin/ncgen$(EXEEXT) bin/ncdump$(EXEEXT) \
|
||||
share/man/man1/ncgen.1 share/man/man1/ncdump.1
|
||||
endif
|
||||
|
||||
if BUILD_F77
|
||||
BINFILES += include/netcdf.inc share/man/man3/netcdf_f77.3
|
||||
if BUILD_SEPARATE_FORTRAN
|
||||
BINFILES += lib/libnetcdff.a
|
||||
endif
|
||||
endif
|
||||
|
||||
if BUILD_F90
|
||||
if UPPER_CASE_MOD
|
||||
BINFILES += include/NETCDF.mod include/TYPESIZES.mod
|
||||
else
|
||||
BINFILES += include/netcdf.mod include/typesizes.mod
|
||||
endif
|
||||
BINFILES += share/man/man3/netcdf_f90.3
|
||||
endif
|
||||
|
||||
if BUILD_CXX
|
||||
BINFILES += include/netcdf.hh include/ncvalues.h include/netcdfcpp.h lib/libnetcdf_c++.a
|
||||
endif
|
||||
|
||||
# At Unidata, package up binaries.
|
||||
ftpbin: install
|
||||
echo "Getting binaries from ${prefix}"
|
||||
ls -l ${prefix}
|
||||
echo "These are the binaries for netCDF @PACKAGE_VERSION@." > ${prefix}/README_BINARIES.txt
|
||||
echo "For this build: CC=$(CC) CXX=$(CXX) FC=$(FC) F77=$(F77) $F90=$(F90)" >> ${prefix}/README_BINARIES.txt
|
||||
echo "CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS)" >> ${prefix}/README_BINARIES.txt
|
||||
echo "FCFLAGS=$(FCFLAGS) F77FLAGS=$(F77FLAGS) $F90FLAGS=$(F90FLAGS)" >> ${prefix}/README_BINARIES.txt
|
||||
which tar
|
||||
echo "PATH: $PATH"
|
||||
tar cf @BINFILE_NAME@ -C ${prefix} ${BINFILES}
|
||||
gzip -f @BINFILE_NAME@
|
||||
|
||||
check_nc_config:
|
||||
$(CC) `./nc-config --cflags` test_prog.c -o test_prog `./nc-config --libs`
|
||||
./test_prog
|
||||
$(F77) `./nc-config --fflags` test_prog.F -o test_prog `./nc-config --libs`
|
||||
./test_prog
|
||||
$(FC) `./nc-config --fflags` test_prog.f90 -o test_prog `./nc-config --libs`
|
||||
./test_prog
|
||||
|
||||
install-data-hook:
|
||||
@echo ''
|
||||
@echo '+-------------------------------------------------------------+'
|
||||
@echo '| Congratulations! You have successfully installed netCDF! |'
|
||||
@echo '| |'
|
||||
@echo '| You can use script "nc-config" to find out the relevant |'
|
||||
@echo '| compiler options to build your application. Enter |'
|
||||
@echo '| |'
|
||||
@echo '| nc-config --help |'
|
||||
@echo '| |'
|
||||
@echo '| for additional information. |'
|
||||
@echo '| |'
|
||||
@echo '| CAUTION: |'
|
||||
@echo '| |'
|
||||
@echo '| If you have not already run "make check", then we strongly |'
|
||||
@echo '| recommend you do so. It does not take very long. |'
|
||||
@echo '| |'
|
||||
@echo '| Before using netCDF to store important data, test your |'
|
||||
@echo '| build with "make check". |'
|
||||
@echo '| |'
|
||||
@echo '| NetCDF is tested nightly on many platforms at Unidata |'
|
||||
@echo '| but your platform is probably different in some ways. |'
|
||||
@echo '| |'
|
||||
@echo '| If any tests fail, please see the netCDF web site: |'
|
||||
@echo '| http://www.unidata.ucar.edu/software/netcdf/ |'
|
||||
@echo '| |'
|
||||
@echo '| NetCDF is developed and maintained at the Unidata Program |'
|
||||
@echo '| Center. Unidata provides a broad array of data and software |'
|
||||
@echo '| tools for use in geoscience education and research. |'
|
||||
@echo '| http://www.unidata.ucar.edu |'
|
||||
@echo '+-------------------------------------------------------------+'
|
||||
@echo ''
|
||||
|
||||
# If building the dll on windows, with MingW, this extra target
|
||||
# # packages the results.
|
||||
# win32_bin:
|
||||
# @echo 'This netCDF DLL was generated using MingW.' > README_DLL.txt
|
||||
# @echo '' >> README_DLL.txt
|
||||
# @echo './configure --enable-dll --enable-shared --disable-separate-fortram --disable-cxx --disable-f90' >> README_DLL.txt
|
||||
# @echo 'To use the DLL from C, include netcdf.h and set pre-processor macro DLL_NETCDF.' >> README_DLL.txt
|
||||
# @echo 'To use the DLL from Fortran, include netcdf.inc.' >> README_DLL.txt
|
||||
# cd libsrc/.libs
|
||||
# lib /machine:i386 /def:libnetcdf.def
|
||||
# ls
|
||||
# cd ../..
|
||||
# cp libsrc/.libs/netcdf.lib .
|
||||
# cp libsrc/netcdf.h .
|
||||
# cp fortran/netcdf.inc .
|
||||
# cp ncgen3/.libs/ncgen3.exe .
|
||||
# cp ncgen/.libs/ncgen.exe .
|
||||
# cp ncdump/.libs/ncdump.exe .
|
||||
# cp libsrc/.libs/libnetcdf-4.dll .
|
||||
# cp libsrc/.libs/libnetcdf.a .
|
||||
# cp libsrc/.libs/libnetcdf.dll.a .
|
||||
# tar -cf win32_dll_$(VERSION).tar netcdf.h libnetcdf-4.dll README_DLL.txt netcdf.inc ncgen3.exe ncgen.exe ncdump.exe netcdf.lib
|
||||
# gzip -f win32_dll_$(VERSION).tar
|
||||
|
||||
# # If building the dll on windows, with Cygwin, using the -mno-cygwin
|
||||
# # option, this extra target packages the results.
|
||||
# win32_bin_nocygwin:
|
||||
# @echo 'This netCDF DLL was generated using MingW.' > README_DLL.txt
|
||||
# @echo '' >> README_DLL.txt
|
||||
# @echo './configure --enable-dll --enable-shared --disable-separate-fortram --disable-cxx --disable-f90' >> README_DLL.txt
|
||||
# @echo 'To use the DLL from C, include netcdf.h and set pre-processor macro DLL_NETCDF.' >> README_DLL.txt
|
||||
# @echo 'To use the DLL from Fortran, include netcdf.inc.' >> README_DLL.txt
|
||||
# cp libsrc/netcdf.h .
|
||||
# cp fortran/netcdf.inc .
|
||||
# cp ncgen3/.libs/ncgen3.exe .
|
||||
# cp ncgen/.libs/ncgen.exe .
|
||||
# cp ncdump/.libs/ncdump.exe .
|
||||
# cp libsrc/.libs/cygnetcdf-4.dll libnetcdf-4.dll
|
||||
# cp libsrc/.libs/libnetcdf.a .
|
||||
# cp libsrc/.libs/libnetcdf.dll.a .
|
||||
# tar -cf win32_dll_$(VERSION).tar netcdf.h libnetcdf-4.dll README_DLL.txt netcdf.inc ncgen3.exe ncgen.exe ncdump.exe
|
||||
# gzip -f win32_dll_$(VERSION).tar
|
||||
|
||||
# # If building the dll on windows, with visual studio, this extra
|
||||
# # target packages the results.
|
||||
# win32_vs_bin:
|
||||
# @echo 'This netCDF DLL was generated using visual studio.' > README_DLL.txt
|
||||
# @echo '' >> README_DLL.txt
|
||||
# @echo 'To use the DLL from C, include netcdf.h and set pre-processor macro DLL_NETCDF.' >> README_DLL.txt
|
||||
# @echo 'To use the DLL from Fortran, include netcdf.inc.' >> README_DLL.txt
|
||||
# cp libsrc4/netcdf.h .
|
||||
# cp fortran/netcdf.inc .
|
||||
# cp win32/NET/Debug/ncgen.exe .
|
||||
# cp win32/NET/Debug/ncdump.exe .
|
||||
# cp win32/NET/Debug/netcdf.dll .
|
||||
# cp win32/NET/Debug/netcdf.exp .
|
||||
# cp win32/NET/Debug/netcdf.lib .
|
||||
# zip win32_vs_dll_$(VERSION).zip netcdf.h netcdf.dll netcdf.lib netcdf.exp README_DLL.txt netcdf.inc ncgen.exe ncdump.exe
|
||||
|
73
README
Normal file
73
README
Normal file
@ -0,0 +1,73 @@
|
||||
Unidata NetCDF
|
||||
|
||||
The Unidata network Common Data Form (netCDF) is an interface for
|
||||
scientific data access and a freely-distributed software library that
|
||||
provides an implementation of the interface. The netCDF library also
|
||||
defines a machine-independent format for representing scientific data.
|
||||
Together, the interface, library, and format support the creation,
|
||||
access, and sharing of scientific data. The current netCDF software
|
||||
provides C, Fortran-77, Fortran-90, and C++ interfaces for
|
||||
applications and data. It has been tested on various common
|
||||
platforms.
|
||||
|
||||
NetCDF files are self-describing, network-transparent, directly
|
||||
accessible, and extendible. `Self-describing' means that a netCDF file
|
||||
includes information about the data it contains. `Network-transparent'
|
||||
means that a netCDF file is represented in a form that can be accessed
|
||||
by computers with different ways of storing integers, characters, and
|
||||
floating-point numbers. `Direct-access' means that a small subset of a
|
||||
large dataset may be accessed efficiently, without first reading through
|
||||
all the preceding data. `Extendible' means that data can be appended to
|
||||
a netCDF dataset without copying it or redefining its structure.
|
||||
|
||||
NetCDF is useful for supporting access to diverse kinds of scientific
|
||||
data in heterogeneous networking environments and for writing
|
||||
application software that does not depend on application-specific
|
||||
formats. A variety of analysis and display packages have been developed
|
||||
to analyze and display data in netCDF form.
|
||||
|
||||
For more information about netCDF, see the netCDF Web page at
|
||||
|
||||
http://www.unidata.ucar.edu/software/netcdf/
|
||||
|
||||
You can obtain a copy of the latest released version of netCDF software
|
||||
using a WWW browser or anonymous FTP from
|
||||
|
||||
ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.Z
|
||||
|
||||
Included in this distribution are: the C source for the netCDF data
|
||||
access library, sources for the FORTRAN and C++ interfaces,
|
||||
documentation for the netCDF library and utilities in the form of a
|
||||
netCDF User's Guide, source for the netCDF utilities ncdump and ncgen,
|
||||
and test programs to verify the correct implementation of the netCDF
|
||||
library.
|
||||
|
||||
Legal stuff (copyright, licensing restrictions, etc.) can be found in
|
||||
the file COPYRIGHT.
|
||||
|
||||
To install this package, please see the file INSTALL in the
|
||||
distribution, or the (possibly more up-to-date) document:
|
||||
|
||||
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/
|
||||
|
||||
The netCDF-3 C and FORTRAN-77 interfaces are documented in man(1)
|
||||
pages in the distribution in files netcdf.3 and netcdf.3f,
|
||||
respectively, or at
|
||||
|
||||
http://www.unidata.ucar.edu/software/netcdf/docs
|
||||
|
||||
User's Guides for C, FORTRAN, and FORTRAN-90 are also available in
|
||||
several forms from the same location.
|
||||
|
||||
A mailing list, netcdfgroup@unidata.ucar.edu, exists for discussion of
|
||||
the netCDF interface and announcements about netCDF bugs, fixes, and
|
||||
enhancements. For information about how to subscribe, see the URL
|
||||
|
||||
http://www.unidata.ucar.edu/software/netcdf/mailing-lists.html
|
||||
|
||||
An archive of past postings to the netcdfgroup mailing list is available
|
||||
for searching from the netCDF home page.
|
||||
|
||||
We appreciate feedback from users of this package. Please send
|
||||
comments, suggestions, and bug reports to <support@unidata.ucar.edu>.
|
||||
Please identify the version of the package (file VERSION).
|
993
RELEASE_NOTES
Normal file
993
RELEASE_NOTES
Normal file
@ -0,0 +1,993 @@
|
||||
This file contains a high-level description of this package's evolution.
|
||||
Entries are in reverse chronological order (most recent first).
|
||||
|
||||
VERSION COMMENTS
|
||||
------- --------
|
||||
4.2 2010-04-10
|
||||
|
||||
Modified constraint parser to be more compatible with
|
||||
a java version of the parser.
|
||||
|
||||
Modified ncgen to utilize iterators internally; should be
|
||||
no user visible effect.
|
||||
|
||||
4.1.1 2010-04-01
|
||||
|
||||
Fixed various build issues.
|
||||
|
||||
Fixed various memory bugs.
|
||||
|
||||
Fixed bug for netCDF-4 files with dimensions and coord
|
||||
vars written in different orders, with data writes
|
||||
interspersed.
|
||||
|
||||
Added test for HDF5-1.8.4 bug.
|
||||
|
||||
Added new C++ API from Lynton Appel.
|
||||
|
||||
4.1 2010-01-30
|
||||
|
||||
Much better memory leak checking with valgrind.
|
||||
|
||||
Added per-variable chunk cache control for better
|
||||
performance. Use nc_set_var_chunk_cache /
|
||||
nf_set_var_chunk_cache / nf90_set_var_chunk_cache to
|
||||
set the per-variable cache.
|
||||
|
||||
Automatically set per-variable chunk cache when
|
||||
opening a file, or creating a variable, so that the
|
||||
cache is big enough for more than one chunk. (Can be
|
||||
overridden by user). Settings may be changed with
|
||||
configure options --max-default-chunk-size and
|
||||
--default-chunks-in-cache.
|
||||
|
||||
Better default chunks size. Now chunks are sized to
|
||||
fit inside the DEFAULT_CHUNK_SIZE (settable at
|
||||
configure time with --with-default-chunk-size=
|
||||
option.)
|
||||
|
||||
Added nccopy utility for converting among netCDF
|
||||
format variants or to copy data from DAP servers to
|
||||
netCDF files.
|
||||
|
||||
The oc library has been modified to allow the occurrence
|
||||
of alias definitions in the DAS, but they will be ignored.
|
||||
|
||||
The old ncgen has been moved to ncgen3 and
|
||||
ncgen is now the new ncgen4.
|
||||
|
||||
Modified --enable-remote-tests to be on by default.
|
||||
|
||||
Fixed the nc_get_varm code as applied to DAP data sources.
|
||||
|
||||
Added tests for nc-config.
|
||||
|
||||
Many documentation fixes.
|
||||
|
||||
Added capability to use the parallel-netcdf
|
||||
(a.k.a. pnetcdf) library to perform parallel I/O on
|
||||
classic and 32-bit offset files. Use the NC_PNETCDF
|
||||
mode flag to get parallel I/O for non-netcdf-4 files.
|
||||
|
||||
Added libcf library to netCDF distribution. Turn it on
|
||||
with configure option --with-libcf.
|
||||
|
||||
Added capability to read HDF4 files created with the
|
||||
SD (Scientific Data) API.
|
||||
|
||||
The DAP support was revised to closely mimic the
|
||||
original libnc-dap support.
|
||||
|
||||
Significantly revised the data handling mechanism
|
||||
in ncgen4 to more closely mimic the output from the
|
||||
original ncgen.
|
||||
|
||||
Added prototype NcML output capability to ncgen4.
|
||||
It is specified by the -lcml flag.
|
||||
|
||||
Added capabilty to read HDF5 files without dimension
|
||||
scales. This will allow most existing HDF5 datasets to
|
||||
be read by netCDF-4.
|
||||
|
||||
Fixed bug with endianness of default fill values for
|
||||
integer types when variables are created with a
|
||||
non-native endiannesss and use the default fill value.
|
||||
|
||||
Significant refactoring of HDF5 type handling to
|
||||
improve performance and handle complicated nesting of
|
||||
types in cross-platform cases.
|
||||
|
||||
Added UDUNITS2 to the distribution. Use --with-udunits
|
||||
to build udunits along with netcdf.
|
||||
|
||||
Made changes suggested by HDF5 team to relax
|
||||
creation-order requirement (for read-only cases) which
|
||||
allows HDF5 1.6.x files to be retrofitted with
|
||||
dimension scales, and be readable to netCDF-4.
|
||||
|
||||
Handle duplicate type names within different groups in
|
||||
ncdump. Fix group path handling in absolute and
|
||||
relative variable names for "-v" option.
|
||||
|
||||
Added nc-config shell script to help users build
|
||||
netCDF programs without having to figure out all the
|
||||
compiler options they will need.
|
||||
|
||||
Fixed ncdump -s bug with displaying special attributes
|
||||
for classic and 64-bit offset files.
|
||||
|
||||
For writers, nc_sync() now calls fsync() to flush data
|
||||
to disk sooner.
|
||||
|
||||
The nc_inq_type() function now works for primitive types.
|
||||
|
||||
4.0.1 2009-03-26
|
||||
|
||||
Added optional arguments to F90 API to
|
||||
nf90_open/create, nf90_create_var, and
|
||||
nf90_inquire_variable so that all netCDF-4 settings
|
||||
may be accomplished with optional arguments, instead
|
||||
of separate function calls.
|
||||
|
||||
Added control of HDF5 chunk cache to allow for user
|
||||
performance tuning.
|
||||
|
||||
Added parallel example program in F90.
|
||||
|
||||
Changed default chunking to better handle very large
|
||||
varibles.
|
||||
|
||||
Made contiguous the default for fixed size data sets
|
||||
with no filters.
|
||||
|
||||
Fixed bug in nc_inq_ncid; now it returns NC_ENOGRP if
|
||||
the named group is not found.
|
||||
|
||||
Fixed man pages for C and F77 so that netCDF-4 builds
|
||||
will result in man pages that document new netCDF-4
|
||||
functions.
|
||||
|
||||
Added OPeNDAP support based on a new C-only implementation.
|
||||
This is enabled using --enable-dap option and requires
|
||||
libcurl. The configure script will attempt to locate libcurl,
|
||||
but if it fails, then its location must be specified by the
|
||||
--with-curl option.
|
||||
|
||||
4.0.1-beta2 2008-12-26
|
||||
|
||||
Changed chunksizes to size_t from int.
|
||||
|
||||
Fixed fill value problem from F77 API.
|
||||
|
||||
Fixed problems in netcdf-4 files with
|
||||
multi-dimensional coordinate variables.
|
||||
|
||||
Fixed ncgen to properly handle CDL input that uses
|
||||
Windows line endings ("\r\n"), instead of getting a
|
||||
syntax error.
|
||||
|
||||
Added "-s" option to ncdump to display performance
|
||||
characterisitics of netCDF-4 files as special virtual
|
||||
attributes, such as _Chunking, _DeflateLevel, _Format,
|
||||
and _Endianness.
|
||||
|
||||
Added "-t" option to ncdump to display times in human
|
||||
readable form as strings. Added code to interpret
|
||||
"calendar" attribute according to CF conventions, if
|
||||
present, in displaying human-readable times.
|
||||
|
||||
Added experimental version of ncgen4 capable of
|
||||
generating netcdf-4 data files and C code for creating
|
||||
them. In addition, it supports the special attributes
|
||||
_Format, etc.
|
||||
|
||||
4.0.1-beta1 2008-10-16
|
||||
|
||||
Fixed Fortran 90 int64 problems.
|
||||
|
||||
Rewrote HDF5 read/write code in accordance with
|
||||
performance advice from Kent.
|
||||
|
||||
Fixed memory leaks in gets/puts of HDF5 data.
|
||||
|
||||
Fixed some broken tests for parallel I/O (i.e. MPI)
|
||||
builds.
|
||||
|
||||
Fixed some cross-compile problems.
|
||||
|
||||
Rewrote code which placed bogus errors on the HDF5
|
||||
error stack, trying to open non-existant attributes
|
||||
and variables. Now no HDF5 errors are seen.
|
||||
|
||||
Removed man subdirectory. Now man4 subdirectory is
|
||||
used for all builds.
|
||||
|
||||
Changed build so that users with access to parallel
|
||||
make can use it.
|
||||
|
||||
Added experimental support for accessing data through
|
||||
OPeNDAP servers using the DAP protocol (use
|
||||
--enable-opendap to build it).
|
||||
|
||||
Fixed ncdump bugs with array field members of compound
|
||||
type variables. Fixed ncdump bug of assuming default
|
||||
fill value for data of type unsigned byte.
|
||||
|
||||
4.0 2008-05-31
|
||||
|
||||
Introduced the use of HDF5 as a storage layer, which
|
||||
allows use of groups, user-defined types, multiple
|
||||
unlimited dimensions, compression, data chunking,
|
||||
parallel I/O, and other features. See the netCDF
|
||||
Users Guide for more information.
|
||||
|
||||
3.6.3 2008-05-31
|
||||
|
||||
In ncdump and ncgen, added CDL support for UTF-8
|
||||
encoding of characters in names and for escaped
|
||||
special chars in names. Made sure UTF-8 names are
|
||||
normalized using NFC rules before storing or
|
||||
comparing.
|
||||
|
||||
Handle IEEE NaNs and infinities in a
|
||||
platform-independent way in ncdump output.
|
||||
|
||||
Added support for ARM representation of doubles,
|
||||
(thanks to Warren Turkal).
|
||||
|
||||
Fixed bug in C++ API creating 64-bit offset
|
||||
files. (See
|
||||
http://www.unidata.ucar.edu/software/netcdf/docs/known_problems.html#cxx_64-bit.)
|
||||
|
||||
Fixed bug for variables larger than 4 GB. (See
|
||||
http://www.unidata.ucar.edu/software/netcdf/docs/known_problems.html#large_vars_362.)
|
||||
|
||||
Changed the configure.ac to build either 3.6.x or 4.x
|
||||
build from the same configure.ac.
|
||||
|
||||
Build now checks gfortran version and handles it
|
||||
cleanly, also Portland Group in Intel fortran, with
|
||||
various configurations.
|
||||
|
||||
A Fortran netcdf.inc file is now created at build time, based
|
||||
on the setting of --disable-v2.
|
||||
|
||||
Documentation has been fixed in several places.
|
||||
|
||||
Upgraded to automake 1.10, autoconf 2.62, and libtool 2.2.2.
|
||||
|
||||
Includes missing Windows Visual Studio build files.
|
||||
|
||||
Fixed missing include of config.h in a C++ test program.
|
||||
|
||||
Fixed maintainer-clean in man directory.
|
||||
|
||||
Fixed --enable-c-only and make check.
|
||||
|
||||
Fixed behavior when opening a zero-length file.
|
||||
|
||||
Many portability enhancements to build cleanly on
|
||||
various platforms.
|
||||
|
||||
Turned on some old test programs which were not being
|
||||
used in the build.
|
||||
|
||||
3.6.2 2007-03-05
|
||||
|
||||
Released.
|
||||
|
||||
3.6.2 beta6 2007-01-20
|
||||
|
||||
Fine tuning of build system to properly handle cygwin,
|
||||
Mingw, and strange configuration issues.
|
||||
|
||||
Automake 1.10 has a problem with running our tests on
|
||||
MinGW, so I'm switching back to automake 1.9.6 for
|
||||
this release.
|
||||
|
||||
3.6.2 beta5 2006-12-30
|
||||
|
||||
Now netCDF configuration uses autoconf 2.61, and
|
||||
automake 1.10. (Thanks to Ralf Wildenhues for the
|
||||
patches, and all the autotools help in general!)
|
||||
|
||||
Final major revision of netCDF tutorial before the
|
||||
3.6.2 release.
|
||||
|
||||
Now netCDF builds under MinGW, producing a windows DLL
|
||||
with the C and F77 APIs. Use the --enable-shared --enable-dll
|
||||
--disable-cxx --disable-f90 flags to configure. (C++
|
||||
and F90 have never been built as windows DLLs, but
|
||||
might be in a future release if there is user
|
||||
interest). This has all been documented in the netCDF
|
||||
Porting and Installation Guide.
|
||||
|
||||
Now extreme numbers (i.e. those close to the limits of
|
||||
their type) can be turned off in nc_test/nf_test, with
|
||||
--disable-extreme-numbers. It is turned off
|
||||
automatically for Solaris i386 systems.
|
||||
|
||||
Added --enable-c-only option to configure. This causes
|
||||
only the core netCDF-3 C library to be built. It's the
|
||||
same as --disable-f77 --disable-cxx --disable-v2
|
||||
--disable-utilities.
|
||||
|
||||
Added --disable-utilities to turn off building and
|
||||
testing of ncgen/ncdump.
|
||||
|
||||
Fix a long-standing bug in nf90_get_att_text() pointed
|
||||
out by Ryo Furue, to make sure resulting string is
|
||||
blank-padded on return. This is fixed in the
|
||||
Fortran-90 interface, but is impractical to fix in the
|
||||
Fortran-77 interface implemented via cfortran.h.
|
||||
|
||||
Now large file tests are run if --enable-large-file-tests
|
||||
is used in the configure.
|
||||
|
||||
For Cray users, the ffio module is used if the
|
||||
--enable-ffio option is passed to configure.
|
||||
|
||||
Unrolled loops in byte-swapping code used on
|
||||
little-endian platforms to reduce loop overhead. This
|
||||
optimization resulted in a 22% speedup for some
|
||||
applications accessing floats or ints (e.g. NCO
|
||||
utilities ncap and ncbo) and a smaller speedup for
|
||||
shorts or doubles.
|
||||
|
||||
Added "-k" option to ncdump and ncgen, for identifying
|
||||
and specifying the kind of netCDF file, one of
|
||||
"classic", "64-bit-offset", "hdf5", or "hdf5-nc3".
|
||||
Removed output of kind of netCDF file in CDL comment
|
||||
produced by ncdump.
|
||||
|
||||
Fixed bug of ncdump seg-faulting if invoked
|
||||
incorrectly with option like "-c" or "-h" but no file
|
||||
name.
|
||||
|
||||
3.6.2 beta4 2006-08-15
|
||||
|
||||
Changed F77/F90 man pages from netcdf.3f and
|
||||
netcdf.3f90 to netcdf_f77.3 and netcdf_f90.3. Also
|
||||
fixed broken install of man pages.
|
||||
|
||||
Changed configure script so that "-g -O2" is no longer
|
||||
set as CFLAGS, CXXFLAGS, and FFLAGS by default if a
|
||||
GNU compiler is being used. Now nothing is set.
|
||||
|
||||
Changed configure script so that fortran flag is set
|
||||
in config.h.
|
||||
|
||||
Updated Installation and Porting Guide, C++
|
||||
Interface Guide, F77 and F90 Interface Guides.
|
||||
|
||||
Build with static libraries by default.
|
||||
|
||||
Added configure option --enable-separate-fortran,
|
||||
which causes the fortran library to be built
|
||||
separately. This is turned on automatically for shared
|
||||
libraries.
|
||||
|
||||
Improved clarity of error messages.
|
||||
|
||||
Changed configuration to get cygwin DLL and mingw DLL
|
||||
builds working, for the C library only (i.e. no
|
||||
F77, F90, or C++ APIs).
|
||||
|
||||
Changed type of ncbyte in C++ interface from unsigned
|
||||
char to signed char, for consistency with C interface.
|
||||
The C++ documentation warned this change would
|
||||
eventually occur.
|
||||
|
||||
Changed the C++ interface to use only the netCDF-3 C
|
||||
interface instead of the older netCDF-2 C interface.
|
||||
This has the added benefit that on-the-fly numeric
|
||||
conversions are now supported using get methods, for
|
||||
example you can get data of any type as double. When
|
||||
using --disable-v2 flag to configure, the C++
|
||||
interface can now be built and installed.
|
||||
|
||||
3.6.2 beta3 2006-05-24
|
||||
|
||||
Changed to use default prefix of /usr/local instead of
|
||||
package-based prefix of previous releases of
|
||||
netCDF. Use the --prefix argument to the configure
|
||||
script to override the default.
|
||||
|
||||
Made separate fortran library file, instead of
|
||||
appending fortran library functions to the C library
|
||||
file, if --enable-separate-fortran is used during
|
||||
configure (it's turned on automatically if
|
||||
--enable-shared is used). If uses, the fortran API
|
||||
users must link to *both* the C library and the new
|
||||
fortran library, like this: -lnetcdff -lnetcdf
|
||||
|
||||
Added netCDF examples in C, C++, F77, F90, and
|
||||
CDL. See the examples subdirectory.
|
||||
|
||||
Added the NetCDF Tutorial.
|
||||
|
||||
Minor fixes to some of the netCDF documentation.
|
||||
|
||||
Made it possible to build without V2 API using
|
||||
--disable-v2 from configure.
|
||||
|
||||
Switched to new build system, with automake and
|
||||
libtool. Now shared libraries are built (as well as
|
||||
static ones) on platforms which support it. For more
|
||||
information about shared libraries, see
|
||||
http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#shared_intro
|
||||
|
||||
Fixed ncdump crash that happened when no arguments were
|
||||
used.
|
||||
|
||||
Fixed for building with gfortran 4.1.0.
|
||||
|
||||
Important fix for machines whose SIZEOF_SIZE_T !=
|
||||
SIZEOF_LONG, such as NEC-SX, thanks to Stephen Leak.
|
||||
|
||||
Fixed C++ on AIX platform.
|
||||
|
||||
Fixed 64-bit builds on AIX platform.
|
||||
|
||||
Removed bad assertion that could be triggered in rare
|
||||
cases when reading a small file.
|
||||
|
||||
Added comments in v1hpg.c to clarify purpose of each
|
||||
internal function.
|
||||
|
||||
Make sure filesize is determined in nc_close() *after*
|
||||
buffers get flushed.
|
||||
|
||||
Fix long-standing problem resulting in files up to 3
|
||||
bytes longer than necessary if there is exactly one
|
||||
record variable of type byte, char, or short and if
|
||||
the number of values per record for that variable is
|
||||
not divisible by 4 (or 2 in the case of short). Now
|
||||
the filesize determined from header info by
|
||||
NC_calcsize should be correct in all cases.
|
||||
|
||||
3.6.1 2006-01-31
|
||||
|
||||
Updated installation manual for 3.6.1.
|
||||
|
||||
Changed installation to try to provide correct
|
||||
compiler flags for compiling in 64-bit mode on Sun,
|
||||
Irix, AIX, and HPUX. (HPUX doesn't work for me,
|
||||
however). Now run configure with --enable-64bit to get
|
||||
a 64 bit compile.
|
||||
|
||||
Fixed long-standing bug that would cause small netCDF
|
||||
files to be padded on the end with zero bytes to 4096
|
||||
bytes when they were opened and changed. Now small
|
||||
files should stay small after you change a value.
|
||||
|
||||
Fixed bug in assertions in putget.c that would only be
|
||||
noticed if you change the manifest constant
|
||||
NC_MAX_DIMS in netcdf.h to be different from
|
||||
NC_MAX_VAR_DIMS.
|
||||
|
||||
Moved test ftest.F from fortran to nf_test directory,
|
||||
and fixed bug in ftest.F which caused it to return 0
|
||||
even if tests failed (no tests were failing,
|
||||
however). Also renamed some test
|
||||
output files to make things a little clearer.
|
||||
|
||||
If open for writing, pad with up to 3 extra zero bytes
|
||||
before close to the correct canonical length,
|
||||
calculated from the header. Previously files could be
|
||||
short due to not padding when writing in NOFILL mode.
|
||||
|
||||
Doubled arbitrary limits on number of dimensions,
|
||||
variables, attributes, and length of names.
|
||||
|
||||
Change name of nc_get_format() to nc_inq_format().
|
||||
Add analogous interfaces for nf_inq_format(),
|
||||
nf90_inquire(), and NcFile::get_format() to f77, f90,
|
||||
and C++ interfaces. Document new function in texinfo
|
||||
files. Add minimal test to nc_test, nf_test.
|
||||
|
||||
3.6.1-beta3 2005-02-17
|
||||
|
||||
Added function nc_get_format(int ncid, int* formatp)
|
||||
that returns either NC_FORMAT_CLASSIC or
|
||||
NC_FORMAT_64BIT for a CDF1 or CDF2 file, respectively.
|
||||
|
||||
Added test to nc_test that detects whether format
|
||||
version was changed after a file is reopened and
|
||||
define mode is entered.
|
||||
|
||||
Correctly configure for Intel ifort Fortran compiler on Linux.
|
||||
|
||||
3.6.0-p1 2005-02-18
|
||||
|
||||
Fixed bug that changes CDF2 files to CDF1 files if CDF2
|
||||
file is reopened for write access and either an
|
||||
attribute is changed or define mode is entered.
|
||||
|
||||
3.6.1-beta2 2005-1-6
|
||||
|
||||
Fixed absoft compile problem. Maybe.
|
||||
|
||||
3.6.1-beta1 2005-1-3
|
||||
|
||||
Fixed Cygwin C++ problem.
|
||||
|
||||
Fixed large file problem in MS Visual C++.NET environment.
|
||||
|
||||
More information in installation and porting guide.
|
||||
|
||||
3.6.0 2004-12-16
|
||||
|
||||
Added texinfo source for the documentation.
|
||||
|
||||
Added large file tests to Windows directory in distribution.
|
||||
|
||||
Modified win32 visual studio project files so that m4
|
||||
is no longer required to build netcdf under visual studio.
|
||||
|
||||
Modified rules.make to use install instead of cp,
|
||||
fixing install problem for cygwin users.
|
||||
|
||||
Modified configure/install stuff to support HP-UX.
|
||||
|
||||
Modified configure/install stuff to support G95.
|
||||
|
||||
In the f90 interface, applied Arnaud Desitter's fixes
|
||||
to correct mismatches between scalar and array
|
||||
arguments, eliminating (legitimate) complaints by the
|
||||
NAGWare f95 compiler. Also fixed bugs introduced in
|
||||
3.6.0-beta5 in the mapped array interfaces.
|
||||
|
||||
3.6.0-beta6 2004-10-05
|
||||
|
||||
Fixed AIX 64-bit/largefile install problems.
|
||||
|
||||
Removed FAQ section from netcdf.texi User's Guide, in
|
||||
deference to online version that can be kept up to
|
||||
date more easily.
|
||||
|
||||
3.6.0-beta5 2004-10-04
|
||||
|
||||
Fixed assertion violation on 64-bit platforms when
|
||||
size of last fixed size variable exceeds 2^32 - 1.
|
||||
|
||||
Removed another restriction on file size by making
|
||||
record size (derived from other sizes, not part of the
|
||||
format) an off_t instead of a size_t, when an off_t is
|
||||
larger than a size_t. This permits records to be
|
||||
*much* larger in either classic format or
|
||||
64-bit-offset format.
|
||||
|
||||
Incorporated patch from Mathis Rosenhauer to improve
|
||||
performance of Fortran 90 interface for calls to
|
||||
nf90_put_var_TYPE(), nf90_get_var_TYPE(),
|
||||
nf90_put_vara_TYPE(), and nf90_get_vara_TYPE()
|
||||
functions by not emulating them with the corresponding
|
||||
nf90_put_varm_TYPE() and nf90_get_varm_TYPE() calls.
|
||||
|
||||
Added tests for invalid offsets in classic format when
|
||||
defining multiple large variables.
|
||||
|
||||
Improved installation ease. Have configure script use
|
||||
Large File Support as a default, if available.
|
||||
|
||||
Add "extra_test" as a target for testing Large File
|
||||
Support.
|
||||
|
||||
3.6.0-beta3 2004-08-24
|
||||
|
||||
Upgraded to recent autoconf, changed configure to
|
||||
(hopefully) improve installation. Also added macros
|
||||
to deal with large file systems.
|
||||
|
||||
Added nf_set_default_format to Fortran interface.
|
||||
|
||||
Added testing to the set_default_format functions to
|
||||
nc_test and nf_test.
|
||||
|
||||
Added documentation to the man page for
|
||||
set_default_format functions.
|
||||
|
||||
Added two new error return codes to C, f77, and f90
|
||||
interfaces for invalid dimension size and for bad
|
||||
variable size. Made test for max dimension size
|
||||
depend on whether 64-bit offsets used. Fixed bug with
|
||||
dimension sizes between 2^31 and 2^32 (for byte
|
||||
variables).
|
||||
|
||||
Fixed ncdump to properly print dimensions larger than
|
||||
2^31.
|
||||
|
||||
Fixed ncgen to properly handle dimensions between 2^31
|
||||
and 2^32.
|
||||
|
||||
3.6.0-beta2
|
||||
Added -v2 (version 2 format with 64-bit offsets)
|
||||
option to ncgen, to specify that generated files or
|
||||
generated C/Fortran code should create 64-bit offset
|
||||
files. Also added -x option to ncgen to specify use
|
||||
of no-fill mode for fast creation of large files.
|
||||
|
||||
Added function to set default create mode to C
|
||||
interface (nc_set_default_create).
|
||||
|
||||
Added win32 directory, with NET subdirectory to hold
|
||||
.NET port of netCDF. To use, open netcdf.sln with
|
||||
Visual Studio, and do a clean and then a build of
|
||||
either the debug or release builds. Tests will be run
|
||||
as part of the build process. VC++ with managed
|
||||
extensions is required (i.e. VC++.NET).
|
||||
|
||||
Added windows installer files to build windows binary
|
||||
installs.
|
||||
|
||||
3.6.0-beta1 By incorporating Greg Sjaardema's patch, added support
|
||||
for 64-bit offset files, which remove many of the
|
||||
restrictions relating to very large files (i.e.
|
||||
larger than 2 GB.) This introduces a new data format
|
||||
for the first time since the original netCDF format
|
||||
was introduced. Files in this new 64-bit offset
|
||||
format can't be read by earlier versions of
|
||||
netCDF. Users should continue to use the netCDF
|
||||
classic format unless they need to create very large
|
||||
files.
|
||||
|
||||
The test suite, nc_test, will now be run twice, once for
|
||||
netCDF classic format testing, and once for 64-bit offset
|
||||
format testing.
|
||||
|
||||
The implementation of the Fortran-77 interface has been
|
||||
adapted to version 4.3 of Burkhard Burow's "cfortran.h".
|
||||
|
||||
3.6.0-alpha
|
||||
Added NEC SX specific optimization for NFILL tunable
|
||||
parameter in libsrc/putget.c
|
||||
|
||||
Added support for the ifc Fortran-90 compiler creating
|
||||
files "netcdf.d" and "typesizes.d" (instead of ".mod"
|
||||
files).
|
||||
|
||||
Fixed access to iargc and getarg functions from
|
||||
Fortran-90 for NAG f90 compiler, contributed by Harald
|
||||
Anlauf.
|
||||
|
||||
3.5.1 2004-02-03
|
||||
|
||||
Updated INSTALL.html for Mac OS X (Darwin).
|
||||
|
||||
Made the installation of the netCDF Fortran-90 module
|
||||
file more robust regarding the name of the file.
|
||||
|
||||
Added support for eight-byte integers in Fortran90
|
||||
interface.
|
||||
|
||||
Increased advisory limits in C netcdf.h and Fortran
|
||||
netcdf.inc for maximum number of dimensions,
|
||||
variables, and attributes.
|
||||
|
||||
Changed C++ declarations "friend NcFile" to "friend
|
||||
class NcFile" in cxx/netcdfcpp.h to conform to
|
||||
standard.
|
||||
|
||||
Added Dan Schmitt's backward compatible extension to
|
||||
the C++ record interface to work with arbitrary
|
||||
dimension slices.
|
||||
|
||||
Added C++ documentation note that caller is
|
||||
responsible for deleting pointer returned by
|
||||
Variable::values() method when no longer needed.
|
||||
|
||||
Made C++ interface more standard; the result may not
|
||||
compile on some old pre-standard C++ compilers.
|
||||
|
||||
Fixed bug in ncgen when parsing values of a
|
||||
multidimensional char variable that resulted in
|
||||
failure to pad a value with nulls on IRIX.
|
||||
|
||||
Fixed ncdump bug adding extra quote to char variable
|
||||
data when using -fc or -ff option.
|
||||
|
||||
Fixed so compiling with -DNO_NETCDF_2 will work for
|
||||
building without backward-compatibility netCDF-2
|
||||
interfaces.
|
||||
|
||||
Eliminated use of ftruncate(), because it fails on
|
||||
FAT32 file systems under Linux.
|
||||
|
||||
Initialized a pointer in putget.m4 (used to generate
|
||||
putget.c) that was involved in uninitialized memory
|
||||
references when nc_test is run under Purify. Two
|
||||
users had reported seeing crashes resulting from this
|
||||
problem in their applications.
|
||||
|
||||
Reverted pointer initializations in putget.m4, after
|
||||
testing revealed these caused a performance problem,
|
||||
resulting in many extra calls to px_pgin and px_pgout
|
||||
when running nc_test.
|
||||
|
||||
Added checking of size of "dimids" vector in function
|
||||
nf90_inquire_variable(...) and error-returning if it
|
||||
isn't sufficiently capacious.
|
||||
|
||||
Added variable index to ncvarget() and ncattinq() error
|
||||
messages and attribute name to ncattinq() error message.
|
||||
|
||||
Tweaked configure script to work with recent C++ compilers.
|
||||
|
||||
Fixed a memory leak in C++ interface, making sure
|
||||
NcVar::cur_rec[] gets deleted in NcVar destructor.
|
||||
|
||||
Reimplemented nc_sync() fix of version 3.5.0 to eliminate
|
||||
performance penalty when synchronization is unnecessary.
|
||||
|
||||
Changed order of targets in Makefile to build Fortran
|
||||
interface last, as a workaround for problem with make
|
||||
on AIX platforms.
|
||||
|
||||
3.5.0 2001-03-23
|
||||
|
||||
Added Fortran 90 interface.
|
||||
|
||||
Changed C macro TIMELEN in file cxx/nctst.cpp to
|
||||
TIMESTRINGLEN to avoid clash with macro defined on AIX
|
||||
systems in /usr/include/time.h.
|
||||
|
||||
Fixed miswriting of netCDF header when exiting define
|
||||
mode. Because the header was always written correctly
|
||||
later, this was only a problem if there was another
|
||||
reader of the netCDF file.
|
||||
|
||||
Fixed explicit synchronizing between netCDF writer and
|
||||
readers via the nc_sync(), nf_sync(), and ncsync()
|
||||
functions.
|
||||
|
||||
Fixed a number of bugs related to attempts to support
|
||||
shrinking the header in netCDF files when attributes
|
||||
are rewritten or deleted. Also fixed the problem that
|
||||
nc__endef() did not work as intended in reserving
|
||||
extra space in the file header, since the extra space
|
||||
would be compacted again on calling nc_close().
|
||||
|
||||
Fixed the "redef bug" that occurred when nc_enddef()
|
||||
or nf_enddef() is called after nc_redef() or
|
||||
nf_redef(), the file is growing such that the new
|
||||
beginning of a record variable is in the next "chunk",
|
||||
and the size of at least one record variable exceeds
|
||||
the chunk size (see netcdf.3 man page for a
|
||||
description of this tuning parameter and how to set
|
||||
it). This bug resulted in corruption of some values
|
||||
in other variables than the one being added.
|
||||
|
||||
The "__" tuning functions for the Fortran interface,
|
||||
nf__create, nf__open, and nf__enddef, are now
|
||||
documented in the Fortran interface man pages.
|
||||
|
||||
Add an 'uninstall' target to all the Makefiles.
|
||||
Dave Glowacki <dglo@SSEC.WISC.EDU> 199810011851.MAA27335
|
||||
|
||||
Added support for multiprocessing on Cray T3E.
|
||||
Hooks added by Glenn, but the majority of the work
|
||||
was done at NERSC. Also includes changes to ffio
|
||||
option specification. Patch rollup provided by
|
||||
R. K. Owen <rkowen@Nersc.GOV>. The following functions
|
||||
are added to the public interface.
|
||||
nc__create_mp()
|
||||
nc__open_mp()
|
||||
nc_set_base_pe()
|
||||
nc_inq_base_pe()
|
||||
|
||||
Fixed makefile URL for Win32 systems in INSTALL file.
|
||||
|
||||
Made test for UNICOS system in the configure script case
|
||||
independent.
|
||||
|
||||
Ported to the following systems:
|
||||
AIX 4.3 (both /bin/xlc and /usr/vac/bin/xlc compilers)
|
||||
IRIX 6.5
|
||||
IRIX64 6.5
|
||||
|
||||
Changed the extension of C++ files from ".cc" to ".cpp".
|
||||
Renamed the C++ interface header file "netcdfcpp.h"
|
||||
instead of "netcdf.hh", changing "netcdf.hh" to
|
||||
include "netcdfcpp.h" for backward compatibility.
|
||||
|
||||
Treat "FreeBSD" systems the same as "BSD/OS" system
|
||||
w.r.t. Fortran and "whatis" database.
|
||||
|
||||
Corrected manual pages: corrected spelling of "enddef" (was
|
||||
"endef") and ensured that the words "index" and "format"
|
||||
will be correctly printed.
|
||||
|
||||
Updated support for Fortran-calling-C interface by
|
||||
updating "fortran/cfortran.h" from version 3.9 to
|
||||
version 4.1. This new version supports the Portland
|
||||
Group Fortran compiler (C macro "pgiFortran")
|
||||
and the Absoft Pro Fortran compiler (C macro
|
||||
"AbsoftProFortran").
|
||||
|
||||
Corrected use of non-integral-constant-expression
|
||||
in specifying size of temporary arrays in file
|
||||
"libsrc/ncx_cray.c".
|
||||
|
||||
Added Compaq Alpha Linux workstation example to INSTALL
|
||||
file.
|
||||
|
||||
Ported cfortran.h to Cygnus GNU Win32 C compiler (gcc
|
||||
for Windows).
|
||||
|
||||
Fixed bug in ncdump using same CDL header name when
|
||||
called with multiple files.
|
||||
|
||||
Added new NULL data type NC_NAT (Not A Type) to
|
||||
facilitate checking whether a variable object has had
|
||||
its type defined yet, for example when working with
|
||||
packed values.
|
||||
|
||||
Fixed use of compile-time macro NO_NETCDF_2 so it
|
||||
really doesn't include old netCDF-2 interfaces, as
|
||||
intended.
|
||||
|
||||
Ported to MacOS X Public Beta (Darwin 1.2/PowerPC).
|
||||
|
||||
Fixed C++ friend declarations to conform to C++ standard.
|
||||
|
||||
Changed INSTALL file to INSTALL.html instead.
|
||||
|
||||
3.4 1998-03-09
|
||||
|
||||
Fixed ncx_cray.c to work on all CRAY systems,
|
||||
not just CRAY1. Reworked USE_IEG, which was incorrect.
|
||||
Reworked short support. Now USE_IEG and otherwise
|
||||
both pass t_ncx.
|
||||
|
||||
To better support parallel systems, static and malloc'ed
|
||||
scratch areas which were shared in the library
|
||||
were eliminated. These were made private and on the
|
||||
stack where possible. To support this, the macros
|
||||
ALLOC_ONSTACK and FREE_ONSTACK are defined in onstack.h.
|
||||
|
||||
The buffered i/o system implementation in posixio.c
|
||||
was reimplemented to limit the number and size of read()
|
||||
or write() system calls and use greater reliance on memory
|
||||
to memory copy. This saves a great deal of wall clock time
|
||||
on slow (NFS) filesystems, especially during nc_endef().
|
||||
|
||||
Added performance tuning "underbar underbar" interfaces
|
||||
nc__open(), nc__create(), and nc__enddef().
|
||||
|
||||
The 'sizehint' contract between the higher
|
||||
layers and the ncio layer is consistently enforced.
|
||||
|
||||
The C++ interface has been updated so that the
|
||||
deprecated "nclong" typedef should no longer be
|
||||
required, and casts to nclong no longer necessary. Just
|
||||
use int or long as appropriate. nclong is still
|
||||
supported for backwards compatibility.
|
||||
|
||||
The ncdump utility now displays byte values as signed,
|
||||
even on platforms where the type corresponding to a C
|
||||
char is unsigned (SGI, for example). Also the ncdump
|
||||
and ncgen utilities have been updated to display and
|
||||
accept byte attributes as signed numeric values (with a
|
||||
"b" suffix) instead of using character constants.
|
||||
|
||||
In libsrc/error.c:nc_strerror(int), explain that
|
||||
NC_EBADTYPE applies to "_FillValue type mismatch".
|
||||
|
||||
Some changes to configure scripts (aclocal.m4),
|
||||
macros.make.in and ncgen/Makefile to support
|
||||
NEC SUPER-UX 7.2.
|
||||
|
||||
The "usage" messages of ncgen and ncdump include the
|
||||
string returned from nc_inq_libvers().
|
||||
|
||||
Corrected some casts in the library so that all phases of
|
||||
the arithmetic computing file offsets occurs with "off_t"
|
||||
type. This allows certain larger netcdf files to be created
|
||||
and read on systems with larger (64bit) off_t.
|
||||
|
||||
In ncgen, multidimensional character variables are now
|
||||
padded to the length of last dimension, instead of just
|
||||
concatenating them. This restores an undocumented but
|
||||
convenient feature of ncgen under netCDF-2. Also, a
|
||||
syntax error is now reliably reported if the netcdf name
|
||||
is omitted in CDL input.
|
||||
|
||||
Fortran and C code generated by ncgen for netCDF
|
||||
components whose names contain "-" characters will now
|
||||
compile and run correctly instead of causing syntax
|
||||
errors.
|
||||
|
||||
The library allows "." characters in names as well
|
||||
as "_" and "-" characters. A zero length name "" is
|
||||
explicitly not allowed. The ncgen utility will now
|
||||
permit "." characters in CDL names as well.
|
||||
|
||||
Memory leaks in the C++ interface NcVar::as_*() member
|
||||
functions and NcFile::add_var() member function are
|
||||
fixed. The documentation was fixed where it indicated
|
||||
incorrectly that the library managed value blocks that
|
||||
the user is actually responsible for deleting.
|
||||
|
||||
The values of the version 2 Fortran error codes have
|
||||
been modified to make the version 2 Fortran interface
|
||||
more backward compatible at the source level.
|
||||
|
||||
Added support for systems whose Fortran INTEGER*1 and
|
||||
INTEGER*2 types are equivalent to the C "long" type but
|
||||
whose C "int" and "long" types differ. An example of
|
||||
such a system is the NEC SX-4 with the "-ew" option to
|
||||
the f90 compiler (sheesh, what a system!).
|
||||
|
||||
Fixed Version 2 Fortran compatibility bug: NCVGTG,
|
||||
NCVGGC, NCVPTG, and NCVPGC didn't work according to the
|
||||
Version 2 documentation if the innermost mapping value
|
||||
(i.e. IMAP[1]) was zero (indicating that the netCDF
|
||||
structure of the variable should be used).
|
||||
|
||||
3.3.1 1997-06-16
|
||||
|
||||
One can now inquire about the number of attributes that a
|
||||
variable has using the global variable ID.
|
||||
|
||||
The FORTRAN interface should now work on more systems.
|
||||
In particular:
|
||||
|
||||
It should now work with FORTRAN compilers whose
|
||||
"integer*1" datatype is either a C "signed char",
|
||||
"short", or "int" and whose "integer*2" datatype is
|
||||
either a C "short" or "int".
|
||||
|
||||
It should now work with FORTRAN compilers that are
|
||||
extremely picky about source code formatting (e.g.
|
||||
the NAG f90 compiler).
|
||||
|
||||
The dependency on the non-POSIX utility m4(1) for
|
||||
generating the C and FORTRAN manual pages has been
|
||||
eliminated.
|
||||
|
||||
EXTERNAL statements have been added to the FORTRAN
|
||||
include-file "netcdf.inc" to eliminate excessive
|
||||
warnings about "unused" variables (which were actually
|
||||
functions) by some compilers (e.g. SunOS 4.1.3's f77(1)
|
||||
version 1.x).
|
||||
|
||||
Building the netCDF-3 package no longer requires the
|
||||
existence of the Standard C macro RAND_MAX.
|
||||
|
||||
Fixed an ncdump bug resulting in ncdump reporting
|
||||
Attempt to convert between text & numbers
|
||||
when _FillValue attribute of a character variable set to
|
||||
the empty string "".
|
||||
|
||||
Made ncgen tests more stringent and fixed various bugs
|
||||
this uncovered. These included bugs in handling byte
|
||||
attributes on platforms on which char is unsigned,
|
||||
initializing scalar character variables in generated C
|
||||
code under "-c" option, interspersing DATA statements
|
||||
with declaration statements in generated Fortran code
|
||||
under "-f" option, handling empty string as a value
|
||||
correctly in generated C and Fortran, and handling
|
||||
escape characters in strings. The Fortran output under
|
||||
the "-f" option was also made less obscure and more
|
||||
portable, using automatic conversion with netCDF-3
|
||||
interfaces instead of "BYTE", "INTEGER*1", or
|
||||
"INTEGER*2" declarations.
|
||||
|
||||
Fixed a C++ interface problem that prevented compiling
|
||||
the C++ library with Digital's cxx compiler.
|
||||
|
||||
Made ncgen "make test" report failure and stop if test
|
||||
resulted in a failure of generated C or Fortran code.
|
||||
|
||||
The file that you are now reading was created to contain
|
||||
a high-level description of the evolution of the
|
||||
netCDF-3 package.
|
||||
|
||||
3.3 1997-05-15
|
||||
|
||||
The production version of the netCDF-3 package was
|
||||
released.
|
||||
|
||||
A comparison of the netCDF-2 and netCDF-3 releases can
|
||||
be found in the file COMPATIBILITY.
|
603
dods.m4
Normal file
603
dods.m4
Normal file
@ -0,0 +1,603 @@
|
||||
# # m4 macros from the Unidata netcdf 2.3.2 pl4 distribution. Modified for use
|
||||
# # with GNU Autoconf 2.1. I renamed these from UC_* to DODS_* so that there
|
||||
# # will not be confusion when porting future versions of netcdf into the DODS
|
||||
# # source distribution. Unidata, Inc. wrote the text of these macros and holds
|
||||
# # a copyright on them.
|
||||
# #
|
||||
# # jhrg 3/27/95
|
||||
# #
|
||||
# # Added some of my own macros (don't blame Unidata for them!) starting with
|
||||
# # DODS_PROG_LEX and down in the file. jhrg 2/11/96
|
||||
# #
|
||||
# # I've added a table of contents for this file. jhrg 2/2/98
|
||||
# #
|
||||
# # 1. Unidata-derived macros.
|
||||
# # 2. Macros for finding libraries used by the core software.
|
||||
# # 3. Macros used to test things about the compiler
|
||||
# # 4. Macros for locating various systems (Matlab, etc.)
|
||||
# # 5. Macros used to test things about the computer/OS/hardware
|
||||
# #
|
||||
# # $Id: dods.m4,v 1.3 2008/07/28 16:57:06 dmh Exp $
|
||||
#
|
||||
# # 1. Unidata's macros
|
||||
# #-------------------------------------------------------------------------
|
||||
#
|
||||
# # 2. Finding libraries
|
||||
# #
|
||||
# # To use these in DODS software, in the Makefile.in use LIBS XTRALIBS for
|
||||
# # non-gui and LIBS GUILIBS XTRALIBS for the clients that link with the
|
||||
# # gui DAP++ library. These should be set by a line like LIBS=@LIBS@, etc.
|
||||
# # Then the group should be used on the link line. 10/16/2000 jhrg
|
||||
# #--------------------------------------------------------------------------
|
||||
#
|
||||
# # Electric fence and dbnew are used to debug malloc/new and free/delete.
|
||||
# # I assume that if you use these switches you know enough to build the
|
||||
# # libraries. 2/3/98 jhrg
|
||||
#
|
||||
# AC_DEFUN([DODS_EFENCE], [dnl
|
||||
# AC_ARG_ENABLE(efence,
|
||||
# [ --enable-efence Runtime memory checks (malloc)],
|
||||
# EFENCE=$enableval, EFENCE=no)
|
||||
#
|
||||
# case "$EFENCE" in
|
||||
# yes)
|
||||
# AC_MSG_RESULT(Configuring dynamic memory checks on malloc/free calls)
|
||||
# LIBS="$LIBS -lefence"
|
||||
# ;;
|
||||
# *)
|
||||
# ;;
|
||||
# esac])
|
||||
#
|
||||
# AC_DEFUN([DODS_DBNEW], [dnl
|
||||
# AC_ARG_ENABLE(dbnew,
|
||||
# [ --enable-dbnew Runtime memory checks (new)],
|
||||
# DBNEW=$enableval, DBNEW=no)
|
||||
#
|
||||
# case "$DBNEW" in
|
||||
# yes)
|
||||
# AC_MSG_RESULT(Configuring dynamic memory checks on new/delete calls)
|
||||
# AC_DEFINE(TRACE_NEW, , [Use the dbnew library to trace bew/delete calls])
|
||||
# LIBS="$LIBS -ldbnew"
|
||||
# ;;
|
||||
# *)
|
||||
# ;;
|
||||
# esac])
|
||||
#
|
||||
# # check for hdf libraries
|
||||
# # cross-compile problem with test option -d
|
||||
# AC_DEFUN([DODS_HDF_LIBRARY], [dnl
|
||||
# AC_ARG_WITH(hdf,
|
||||
# [ --with-hdf=ARG Where is the HDF library (directory)],
|
||||
# HDF_PATH=${withval}, HDF_PATH="$HDF_PATH")
|
||||
# if test ! -d "$HDF_PATH"
|
||||
# then
|
||||
# HDF_PATH="/usr/local/hdf"
|
||||
# fi
|
||||
# if test "$HDF_PATH"
|
||||
# then
|
||||
# LDFLAGS="$LDFLAGS -L${HDF_PATH}/lib"
|
||||
# INCS="$INCS -I${HDF_PATH}/include"
|
||||
# AC_SUBST(INCS)
|
||||
# fi
|
||||
#
|
||||
# dnl None of this works with HDF 4.1 r1. jhrg 8/2/97
|
||||
#
|
||||
# AC_CHECK_LIB(z, deflate, LIBS="-lz $LIBS", nohdf=1)
|
||||
# AC_CHECK_LIB(jpeg, jpeg_start_compress, LIBS="-ljpeg $LIBS", nohdf=1)
|
||||
# AC_CHECK_LIB(df, Hopen, LIBS="-ldf $LIBS" , nohdf=1)
|
||||
# AC_CHECK_LIB(mfhdf, SDstart, LIBS="-lmfhdf $LIBS" , nohdf=1)])
|
||||
#
|
||||
# # 3. Compiler test macros
|
||||
# #--------------------------------------------------------------------------
|
||||
#
|
||||
# AC_DEFUN([DODS_GCC_VERSION], [dnl
|
||||
# AC_MSG_CHECKING(for gcc/g++ 2.8 or greater)
|
||||
#
|
||||
# GCC_VER=`gcc -v 2>&1 | awk '/version/ {print}'`
|
||||
#
|
||||
# dnl We need the gcc version number as a number, without `.'s and limited
|
||||
# dnl to three digits. The old version below was replaced by Andy Jacobson's
|
||||
# dnl patch which works with gcc 3, including the pre-release versions.
|
||||
#
|
||||
# dnl GCC_VER=`echo $GCC_VER | sed 's@[[a-z ]]*\([[0-9.]]\)@\1@'`
|
||||
# GCC_VER=`echo $GCC_VER | sed 's@.*gcc version \([[0-9\.]]*\).*@\1@'`
|
||||
#
|
||||
# case $GCC_VER in
|
||||
# *egcs*) AC_MSG_RESULT(Found egcs version ${GCC_VER}.) ;;
|
||||
# 2.[[7-9]]*) AC_MSG_RESULT(Found gcc/g++ version ${GCC_VER}) ;;
|
||||
# 3.[[0-9]]*) AC_MSG_RESULT(Found gcc/g++ version ${GCC_VER}) ;;
|
||||
# *) AC_MSG_ERROR(must be at least version 2.7.x) ;;
|
||||
# esac])
|
||||
#
|
||||
# # 4. Macros to locate various programs/systems used by parts of DODS
|
||||
# #---------------------------------------------------------------------------
|
||||
#
|
||||
# # Added by Ethan, 1999/06/21
|
||||
# # Look for perl.
|
||||
# #
|
||||
# # I modified the regexp below to remove any text that follows the version
|
||||
# # number. This extra text was hosing the test. 7/15/99 jhrg
|
||||
#
|
||||
# AC_DEFUN([DODS_PROG_PERL], [dnl
|
||||
# AC_CHECK_PROG(PERL, perl, `which perl`)
|
||||
# case "$PERL" in
|
||||
# *perl*)
|
||||
# perl_ver=`$PERL -v 2>&1 | awk '/This is perl/ {print}'`
|
||||
# perl_ver=`echo $perl_ver | sed 's/This is perl,[[^0-9]]*\([[0-9._]]*\).*/\1/'`
|
||||
# perl_ver_main=`echo $perl_ver | sed 's/\([[0-9]]*\).*/\1/'`
|
||||
# if test -n "$perl_ver" && test $perl_ver_main -ge 5
|
||||
# then
|
||||
# AC_MSG_RESULT(Found perl version ${perl_ver}.)
|
||||
# else
|
||||
# AC_MSG_ERROR(perl version: found ${perl_ver} should be at least 5.000.)
|
||||
# fi
|
||||
# ;;
|
||||
# *)
|
||||
# AC_MSG_WARN(perl is required.)
|
||||
# ;;
|
||||
# esac
|
||||
#
|
||||
# AC_SUBST(PERL)])
|
||||
#
|
||||
# # Added by Ethan, 1999/06/21
|
||||
# # Look for GNU tar.
|
||||
# #
|
||||
# # I modified the regexp below but it still does not work exactly correctly;
|
||||
# # the variable tar_ver should have only the version number in it. However,
|
||||
# # my version (1.12) spits out a multi-line thing. The regexp below gets the
|
||||
# # version number from the first line but does not remove the subsequent lines
|
||||
# # of garbage. 7/15/99 jhrg
|
||||
# # Added awk line to handle multiline output. 1999/07/22 erd
|
||||
#
|
||||
# AC_DEFUN([DODS_PROG_GTAR], [dnl
|
||||
# AC_CHECK_PROGS(TAR,gtar tar,tar)
|
||||
# case "$TAR" in
|
||||
# *tar)
|
||||
# tar_ver=`$TAR --version 2>&1 | awk '/G[[Nn]][[Uu]] tar/ {print}'`
|
||||
# tar_ver=`echo $tar_ver | sed 's/.*GNU tar[[^0-9.]]*\([[0-9._]]*\)/\1/'`
|
||||
# if test -n "$tar_ver"
|
||||
# then
|
||||
# AC_MSG_RESULT(Found Gnu tar version ${tar_ver}.)
|
||||
# else
|
||||
# AC_MSG_WARN(GNU tar is required for some Makefile targets.)
|
||||
# fi
|
||||
# ;;
|
||||
# *)
|
||||
# AC_MSG_WARN(GNU tar is required for some Makefile targets.)
|
||||
# ;;
|
||||
# esac
|
||||
#
|
||||
# AC_SUBST(TAR)])
|
||||
#
|
||||
# # Find the matlab root directory
|
||||
# # cross-compile problem with test option -d
|
||||
#
|
||||
# AC_DEFUN([DODS_MATLAB], [dnl
|
||||
# AC_ARG_WITH(matlab,
|
||||
# [ --with-matlab=ARG Where is the Matlab root directory],
|
||||
# MATLAB_ROOT=${withval}, MATLAB_ROOT="$MATLAB_ROOT")
|
||||
# if test "$MATLAB_ROOT" = no; then
|
||||
# MATLAB_ROOT="$MATLAB_ROOT"
|
||||
# elif test ! -d "$MATLAB_ROOT"
|
||||
# then
|
||||
# MATLAB_ROOT=""
|
||||
# fi
|
||||
# if test -z "$MATLAB_ROOT"
|
||||
# then
|
||||
# AC_MSG_CHECKING(for matlab root)
|
||||
#
|
||||
# MATLAB_ROOT=`mex -v 2>&1 | awk '/MATLAB *= / {print}'`
|
||||
# MATLAB_ROOT=`echo $MATLAB_ROOT | sed 's@[[^/]]*\(/.*\)@\1@'`
|
||||
#
|
||||
# if test -z "$MATLAB_ROOT"
|
||||
# then
|
||||
# AC_MSG_ERROR(Matlab not found! Run configure --help)
|
||||
# else
|
||||
# AC_SUBST(MATLAB_ROOT)
|
||||
# AC_MSG_RESULT($MATLAB_ROOT)
|
||||
# fi
|
||||
# else
|
||||
# AC_SUBST(MATLAB_ROOT)
|
||||
# AC_MSG_RESULT("Set Matlab root to $MATLAB_ROOT")
|
||||
# fi
|
||||
#
|
||||
# dnl Find the lib directory (which is named according to machine type).
|
||||
# dnl The test was using -z; I changed it to -n to fix a problem withthe
|
||||
# dnl matlab server build. The build did not find the libraries with the
|
||||
# dnl env var MATLAB_LIB was not set. 04/12/04 jhrg
|
||||
# AC_MSG_CHECKING(for matlab library dir)
|
||||
# if test -n "$MATLAB_LIB"
|
||||
# then
|
||||
# matlab_lib_dir=${MATLAB_LIB}
|
||||
# else
|
||||
# matlab_lib_dir=`find ${MATLAB_ROOT}/extern/lib -name 'libmat*' -print | sed '1q'`
|
||||
# matlab_lib_dir=`echo $matlab_lib_dir | sed 's@\(.*\)/libmat.*@\1@'`
|
||||
# fi
|
||||
# AC_MSG_RESULT($matlab_lib_dir)
|
||||
#
|
||||
# if test "$matlab_lib_dir"
|
||||
# then
|
||||
# LDFLAGS="$LDFLAGS -L$matlab_lib_dir"
|
||||
# dnl This is used by the nph script to set LD_LIBRARY_PATH
|
||||
# AC_SUBST(matlab_lib_dir)
|
||||
# fi
|
||||
#
|
||||
# dnl sleazy test for version 5; look for the version 4 compat flag
|
||||
#
|
||||
# if grep V4_COMPAT ${MATLAB_ROOT}/extern/include/mat.h > /dev/null 2>&1
|
||||
# then
|
||||
# dnl if we're here, we're linking under ML 5 or 6. 02/10/03 jhrg
|
||||
# MAT_VERSION_FLAG="-V4"
|
||||
# dnl ML 6 lacks libmi.a/.so. 02/10/03 jhrg
|
||||
# if access -r ${matlab_lib_dir}/libmi.*
|
||||
# then
|
||||
# MATLIBS="-lmat -lmi -lmx -lut"
|
||||
# else
|
||||
# MATLIBS="-lmat -lmx -lut"
|
||||
# fi
|
||||
# else
|
||||
# MAT_VERSION_FLAG=""
|
||||
# MATLIBS="-lmat"
|
||||
# fi
|
||||
#
|
||||
# AC_CHECK_LIB(ots, _OtsDivide64Unsigned, MATLIBS="$MATLIBS -lots", )
|
||||
# AC_SUBST(MATLIBS)
|
||||
# AC_SUBST(MAT_VERSION_FLAG)])
|
||||
#
|
||||
# # cross-compile problem with test option -d
|
||||
# AC_DEFUN([DODS_DSP_ROOT], [dnl
|
||||
#
|
||||
# AC_ARG_WITH(dsp,
|
||||
# [ --with-dsp=DIR Directory containing DSP software from U of Miami],
|
||||
# DSP_ROOT=${withval}, DSP_ROOT="$DSP_ROOT")
|
||||
#
|
||||
# if test ! -d "$DSP_ROOT"
|
||||
# then
|
||||
# DSP_ROOT=""
|
||||
# fi
|
||||
# if test -z "$DSP_ROOT"
|
||||
# then
|
||||
# AC_MSG_CHECKING(for the DSP library root directory)
|
||||
#
|
||||
# for p in /usr/local/src/DSP /usr/local/DSP \
|
||||
# /usr/local/src/dsp /usr/local/dsp \
|
||||
# /usr/contrib/src/dsp /usr/contrib/dsp \
|
||||
# $DODS_ROOT/third-party/dsp /usr/dsp /data1/dsp
|
||||
# do
|
||||
# if test -z "$DSP_ROOT"
|
||||
# then
|
||||
# for d in `ls -dr ${p}* 2>/dev/null`
|
||||
# do
|
||||
# if test -f ${d}/inc/dsplib.h
|
||||
# then
|
||||
# DSP_ROOT=${d}
|
||||
# break
|
||||
# fi
|
||||
# done
|
||||
# fi
|
||||
# done
|
||||
# fi
|
||||
#
|
||||
# if test "$DSP_ROOT"
|
||||
# then
|
||||
# AC_SUBST(DSP_ROOT)
|
||||
# dnl Only add this path to gcc's options... jhrg 11/15/96
|
||||
# INCS="$INCS -I\$(DSP_ROOT)/inc"
|
||||
# AC_SUBST(INCS) # 09/20/02 jhrg
|
||||
# LDFLAGS="$LDFLAGS -L\$(DSP_ROOT)/lib -L\$(DSP_ROOT)/shlib"
|
||||
# AC_MSG_RESULT(Set DSP root directory to $DSP_ROOT)
|
||||
# else
|
||||
# AC_MSG_ERROR(not found! see configure --help)
|
||||
# fi])
|
||||
#
|
||||
# # Find IDL. 9/23/99 jhrg
|
||||
#
|
||||
# AC_DEFUN([DODS_IDL], [dnl
|
||||
# AC_ARG_WITH(idl,
|
||||
# [ --with-idl=ARG Where is the IDL root directory],
|
||||
# IDL_ROOT=${withval}, IDL_ROOT="$IDL_ROOT")
|
||||
# AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
#
|
||||
# AC_MSG_CHECKING(for the IDL root directory)
|
||||
# if test -z "$IDL_ROOT"
|
||||
# then
|
||||
# # Find IDL's root directory by looking at the exectuable and then
|
||||
# # finding where that symbolic link points.
|
||||
# # !!! Doesn't work if idl isn't a symbolic link - erd !!!
|
||||
# # I think that the following 'if' fixes the symbolic link problem.
|
||||
# # 05/02/03 jhrg
|
||||
# idl_loc=`which idl`
|
||||
# if echo `ls -l $idl_loc` | grep '.*->.*' > /dev/null 2>&1
|
||||
# then
|
||||
# idl_loc=`ls -l $idl_loc | sed 's/.*->[ ]*\(.*\)$/\1/'`
|
||||
# fi
|
||||
# IDL_ROOT=`echo $idl_loc | sed 's/\(.*\)\/bin.*/\1/'`
|
||||
# fi
|
||||
#
|
||||
# AC_MSG_RESULT($IDL_ROOT)
|
||||
# AC_SUBST(IDL_ROOT)
|
||||
#
|
||||
# # Now find where the IDL 5.2 or later sharable libraries live.
|
||||
# # NB: This won't work if libraries for several architecutures are
|
||||
# # installed for several machines.
|
||||
# AC_MSG_CHECKING(for the IDL sharable library directory)
|
||||
# # cd to the IDL root because it is likely a symbolic link and find
|
||||
# # won't normally follow symbolic links.
|
||||
# IDL_LIBS=`(cd $IDL_ROOT; find . -name 'libidl.so' -print)`
|
||||
# # Strip off the leading `.' (it's there because we ran find in the CWD)
|
||||
# # and the name of the library used to find the directory.
|
||||
# IDL_LIBS=`echo $IDL_LIBS | sed 's/\.\(.*\)\/libidl.so/\1/' | sed '1q'`
|
||||
# IDL_LIBS=${IDL_ROOT}${IDL_LIBS}
|
||||
# AC_MSG_RESULT($IDL_LIBS)
|
||||
# AC_SUBST(IDL_LIBS)])
|
||||
#
|
||||
#
|
||||
# # 5. Misc stuff
|
||||
# #---------------------------------------------------------------------------
|
||||
#
|
||||
# AC_DEFUN([DODS_DEBUG_OPTION], [dnl
|
||||
# AC_ARG_ENABLE(debug,
|
||||
# [ --enable-debug=ARG Program instrumentation (1,2)],
|
||||
# DEBUG=$enableval, DEBUG=no)
|
||||
#
|
||||
# case "$DEBUG" in
|
||||
# no)
|
||||
# ;;
|
||||
# 1)
|
||||
# AC_MSG_RESULT(Setting debugging to level 1)
|
||||
# AC_DEFINE(DODS_DEBUG)
|
||||
# ;;
|
||||
# 2)
|
||||
# AC_MSG_RESULT(Setting debugging to level 2)
|
||||
# AC_DEFINE(DODS_DEBUG, , [Set instrumentation to level 1 (see debug.h)])
|
||||
# AC_DEFINE(DODS_DEBUG2, , [Set instrumentation to level 2])
|
||||
# ;;
|
||||
# *)
|
||||
# AC_MSG_ERROR(Bad debug value)
|
||||
# ;;
|
||||
# esac])
|
||||
#
|
||||
AC_DEFUN([DODS_OS], [dnl
|
||||
AC_MSG_CHECKING(type of operating system)
|
||||
# I have removed the following test because some systems (e.g., SGI)
|
||||
# define OS in a way that breaks this code but that is close enough
|
||||
# to also be hard to detect. jhrg 3/23/97
|
||||
# if test -z "$OS"; then
|
||||
# fi
|
||||
OS=`uname -s | tr '[[A-Z]]' '[[a-z]]' | sed 's;/;;g'`
|
||||
if test -z "$OS"; then
|
||||
AC_MSG_WARN(OS unknown!)
|
||||
fi
|
||||
case $OS in
|
||||
aix)
|
||||
;;
|
||||
hp-ux)
|
||||
OS=hpux`uname -r | sed 's/[[A-Z.0]]*\([[0-9]]*\).*/\1/'`
|
||||
;;
|
||||
irix)
|
||||
OS=${OS}`uname -r | sed 's/\..*//'`
|
||||
;;
|
||||
# I added the following case because the `tr' command above *seems*
|
||||
# to fail on Irix 5. I can get it to run just fine from the shell,
|
||||
# but not in the configure script built using this macro. jhrg 8/27/97
|
||||
IRIX)
|
||||
OS=irix`uname -r | sed 's/\..*//'`
|
||||
;;
|
||||
osf*)
|
||||
;;
|
||||
sn*)
|
||||
OS=unicos
|
||||
;;
|
||||
sunos)
|
||||
OS_MAJOR=`uname -r | sed 's/\..*//'`
|
||||
OS=$OS$OS_MAJOR
|
||||
;;
|
||||
ultrix)
|
||||
case `uname -m` in
|
||||
VAX)
|
||||
OS=vax-ultrix
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# On at least one UNICOS system, 'uname -s' returned the
|
||||
# hostname (sigh).
|
||||
if uname -a | grep CRAY >/dev/null; then
|
||||
OS=unicos
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Adjust OS for CRAY MPP environment.
|
||||
#
|
||||
case "$OS" in
|
||||
unicos)
|
||||
|
||||
case "$CC$TARGET$CFLAGS" in
|
||||
*cray-t3*)
|
||||
OS=unicos-mpp
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(OS)
|
||||
|
||||
AC_MSG_RESULT($OS)])
|
||||
|
||||
|
||||
AC_DEFUN([DODS_MACHINE], [dnl
|
||||
AC_MSG_CHECKING(type of machine)
|
||||
|
||||
if test -z "$MACHINE"; then
|
||||
MACHINE=`uname -m | tr '[[A-Z]]' '[[a-z]]'`
|
||||
case $OS in
|
||||
aix*)
|
||||
MACHINE=rs6000
|
||||
;;
|
||||
hp*)
|
||||
MACHINE=hp`echo $MACHINE | sed 's%/.*%%'`
|
||||
;;
|
||||
sunos*)
|
||||
case $MACHINE in
|
||||
sun4*)
|
||||
MACHINE=sun4
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
irix*)
|
||||
case $MACHINE in
|
||||
ip2?)
|
||||
MACHINE=sgi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ultrix*)
|
||||
case $MACHINE in
|
||||
vax*)
|
||||
case "$CC" in
|
||||
/bin/cc*|cc*)
|
||||
echo "changing C compiler to \`vcc' because \`cc' floating-point is broken"
|
||||
CC=vcc
|
||||
v ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_SUBST(MACHINE)
|
||||
AC_MSG_RESULT($MACHINE)])
|
||||
|
||||
AC_DEFUN([DODS_CHECK_SIZES], [dnl
|
||||
# Ignore the errors about AC_TRY_RUN missing an argument. jhrg 5/2/95
|
||||
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(char)
|
||||
AC_CHECK_SIZEOF(double)
|
||||
AC_CHECK_SIZEOF(float)
|
||||
|
||||
# check for C99 types, headers and functions
|
||||
AC_CHECK_HEADER([inttypes.h],[dap_inttypes_header=yes],,)
|
||||
# DINT32 4
|
||||
AC_CHECK_SIZEOF([int32_t])
|
||||
# DUINT32
|
||||
AC_CHECK_SIZEOF([uint32_t])
|
||||
# DINT16 short
|
||||
AC_CHECK_SIZEOF([int16_t])
|
||||
# DUINT16 unsigned short
|
||||
AC_CHECK_SIZEOF([uint16_t])
|
||||
# DBYTE 1
|
||||
AC_CHECK_SIZEOF([uint8_t])
|
||||
if test x"$dap_inttypes_header" = x'yes' -a $ac_cv_sizeof_int32_t -eq 4 -a $ac_cv_sizeof_int16_t -eq 2 -a $ac_cv_sizeof_uint8_t -eq 1 -a $ac_cv_sizeof_double -eq 8; then
|
||||
dap_use_c99_types=yes
|
||||
fi
|
||||
# Force dods to always be c99
|
||||
# dap_use_c99_types=yes
|
||||
AM_CONDITIONAL([USE_C99_TYPES],[test x"$dap_use_c99_types" = 'xyes'])
|
||||
|
||||
# I've separated the typedefs from the config.h header because other
|
||||
# projects which use the DAP were getting conflicts with their includes,
|
||||
# or the includes of still other libraries, and config.h. The
|
||||
# config.h header is now included only by .cc and .c files and headers
|
||||
# that need the typedefs use dods-datatypes.h.
|
||||
# there are 2 possibilities for the definition of dods_int32, ...,
|
||||
# types. First possibility is that the C99 types are used and
|
||||
# dods-datatypes-static.h is copied. In that case the following
|
||||
# definitions are not really usefull. In case the C99 types are
|
||||
# not available, dods-datatypes-config.h.in is used to generate
|
||||
# dods-datatypes.h.
|
||||
# The code below makes dods-datatypes-config.h stand on its own.
|
||||
# 8/2/2000 jhrg
|
||||
|
||||
# DMH: Divide into two sets of tests: one for DODS and one for XDR
|
||||
if test x"$dap_use_c99_types" = 'xyes'; then
|
||||
DODS_INT32=int32_t
|
||||
DODS_UINT32=uint32_t
|
||||
DODS_INT16=int16_t
|
||||
DODS_UINT16=uint16_t
|
||||
DODS_BYTE=uint8_t
|
||||
else
|
||||
DODS_INT16=short
|
||||
DODS_UINT16="unsigned short"
|
||||
DODS_INT32=int
|
||||
DODS_UINT32="unsigned int"
|
||||
DODS_BYTE="unsigned char"
|
||||
fi
|
||||
DODS_FLOAT64=double
|
||||
DODS_FLOAT32=float
|
||||
|
||||
# I'm using the three arg form of AC_DEFINE_UNQUOTED because autoheader
|
||||
# needs the third argument (although I don't quite get the specifics...
|
||||
# 2/15/2001 jhrg
|
||||
AC_DEFINE_UNQUOTED(DINT32, $DODS_INT32, [int32])
|
||||
AC_DEFINE_UNQUOTED(DUINT32, $DODS_UINT32, [uint32])
|
||||
AC_DEFINE_UNQUOTED(DINT16, $DODS_INT16, [dint16])
|
||||
AC_DEFINE_UNQUOTED(DUINT16, $DODS_UINT16, [uint16])
|
||||
AC_DEFINE_UNQUOTED(DFLOAT64, $DODS_FLOAT64, [dfloat64])
|
||||
AC_DEFINE_UNQUOTED(DFLOAT32, $DODS_FLOAT32, [dfloat32])
|
||||
AC_DEFINE_UNQUOTED(DBYTE, $DODS_BYTE, [dbyte])
|
||||
|
||||
# XDR INTEGER TYPES
|
||||
# Unfortunately, there is little commonality about xdr
|
||||
|
||||
# First, we need to see if the xdr routines are in libc, librpc,
|
||||
# or librpcsvc or libnsl
|
||||
dap_xdrlib=
|
||||
AC_SEARCH_LIBS([xdr_void],[c rpc nsl rpcsvc],[
|
||||
dap_xdrlib=`echo $ac_res|sed -e 's/^-l//'`],[
|
||||
AC_MSG_WARN(Cannot locate library containing xdr functions.)])
|
||||
if test "$dap_xdrlib" = "none required" ; then dap_xdrlib=c; fi
|
||||
if test "$dap_xdrlib" != "c" ; then
|
||||
# Add to library list
|
||||
AC_CHECK_LIB($dap_xdrlib,xdr_void)
|
||||
fi
|
||||
# Now figure out what integer functions to use
|
||||
dap_xdrint=0
|
||||
AC_CHECK_LIB($dap_xdrlib,[xdr_uint32_t],[dap_xdrint=1],[
|
||||
AC_CHECK_LIB($dap_xdrlib,[xdr_u_int32_t],[dap_xdrint=2],[
|
||||
AC_CHECK_LIB($dap_xdrlib,[xdr_uint],[dap_xdrint=3],[
|
||||
AC_CHECK_LIB($dap_xdrlib,[xdr_u_int],[dap_xdrint=4],[])])])])
|
||||
case "$dap_xdrint" in
|
||||
1) # uint32_t
|
||||
XDR_INT32=xdr_int32_t
|
||||
XDR_UINT32=xdr_uint32_t
|
||||
XDR_INT16=xdr_int16_t
|
||||
XDR_UINT16=xdr_uint16_t
|
||||
;;
|
||||
2) # u_int32_t
|
||||
XDR_INT32=xdr_int32_t
|
||||
XDR_UINT32=xdr_u_int32_t
|
||||
XDR_INT16=xdr_int16_t
|
||||
XDR_UINT16=xdr_u_int16_t
|
||||
;;
|
||||
3) # uint
|
||||
XDR_INT32=xdr_int
|
||||
XDR_UINT32=xdr_uint
|
||||
XDR_INT16=xdr_short
|
||||
XDR_UINT16=xdr_ushort
|
||||
;;
|
||||
4) # u_int
|
||||
XDR_INT32=xdr_int
|
||||
XDR_UINT32=xdr_u_int
|
||||
XDR_INT16=xdr_short
|
||||
XDR_UINT16=xdr_u_short
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(Cannot determine DODS XDR integer sizes)
|
||||
;;
|
||||
esac
|
||||
XDR_FLOAT64=xdr_double
|
||||
XDR_FLOAT32=xdr_float
|
||||
|
||||
AC_DEFINE_UNQUOTED([XDR_INT16], [$XDR_INT16], [xdr int16])
|
||||
AC_DEFINE_UNQUOTED([XDR_UINT16], [$XDR_UINT16], [xdr uint16])
|
||||
AC_DEFINE_UNQUOTED([XDR_INT32], [$XDR_INT32], [xdr int32])
|
||||
AC_DEFINE_UNQUOTED([XDR_UINT32], [$XDR_UINT32], [xdr uint32])
|
||||
AC_DEFINE_UNQUOTED([XDR_FLOAT64], [$XDR_FLOAT64], [xdr float64])
|
||||
AC_DEFINE_UNQUOTED([XDR_FLOAT32], [$XDR_FLOAT32], [xdr float32])])
|
2
f90/.exrc
Normal file
2
f90/.exrc
Normal file
@ -0,0 +1,2 @@
|
||||
set nonu aw sm sw=4 nobf ts=8 ai terse ic ws wm=0 redraw
|
||||
set para=IPLPPPQPTPP\ LIpplpipnpbp'
|
16
f90/EightByteIntTest-2.f90
Normal file
16
f90/EightByteIntTest-2.f90
Normal file
@ -0,0 +1,16 @@
|
||||
program EightBytIntTest
|
||||
use typeSizes
|
||||
implicit none
|
||||
|
||||
integer (kind = EightByteInt) :: Eight
|
||||
integer :: defaultInt
|
||||
|
||||
print *, "Kind parameter for EightByteInt is", EightByteInt
|
||||
print *, "Bit size of eight byte int is", bit_size(Eight)
|
||||
contains
|
||||
subroutine EightByteIntProcedure(input)
|
||||
integer (kind = EightByteInt), intent( in) :: input
|
||||
|
||||
print *, int(input)
|
||||
end subroutine EightByteIntProcedure
|
||||
end program EightBytIntTest
|
11
f90/EightByteIntTest.f90
Normal file
11
f90/EightByteIntTest.f90
Normal file
@ -0,0 +1,11 @@
|
||||
program EightBytIntTest
|
||||
use typeSizes
|
||||
implicit none
|
||||
|
||||
integer (kind = EightByteInt) :: Eight
|
||||
integer :: defaultInt
|
||||
|
||||
print *, "Bit size of default int is", bit_size(defaultInt)
|
||||
print *, "Kind parameter for EightByteInt is", EightByteInt
|
||||
print *, "Bit size of eight byte int is", bit_size(Eight)
|
||||
end program EightBytIntTest
|
84
f90/Makefile.am
Normal file
84
f90/Makefile.am
Normal file
@ -0,0 +1,84 @@
|
||||
## This is an automake file, part of Unidata's netCDF package.
|
||||
# Copyright 2005-2006, see the COPYRIGHT file for more information.
|
||||
|
||||
# This file controls the building of the fortran 90 API. All testing
|
||||
# of the F90 API is done in the nf_test directory.
|
||||
|
||||
# The F90 library is always built as a convenience library. It is
|
||||
# included by the netCDF-4 library in libsrc4, or the netCDF-3 library
|
||||
# in libsrc, or the separate fortran library in fortran.
|
||||
|
||||
# $Id: Makefile.am,v 1.51 2010/05/29 00:20:53 dmh Exp $
|
||||
|
||||
AM_FCFLAGS =
|
||||
AM_LDFLAGS =
|
||||
|
||||
AM_FCFLAGS += @EXTERN_CFLAGS@
|
||||
AM_LDFLAGS += @EXTERN_LDFLAGS@
|
||||
|
||||
# This is the F90 API man page.
|
||||
man_MANS = netcdf_f90.3
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
||||
# This, plus either netcdf4.f90 or netcdf.f90, is the main source.
|
||||
libnetcdff90_la_SOURCES = typeSizes.f90
|
||||
|
||||
# The file netcdf.f90 includes all of these.
|
||||
libnetcdff90_la_DEPENDENCIES = netcdf_attributes.f90 \
|
||||
netcdf_constants.f90 netcdf_dims.f90 netcdf_expanded.f90 \
|
||||
netcdf_externals.f90 netcdf_file.f90 netcdf3_file.f90 netcdf4_file.f90 \
|
||||
netcdf_overloads.f90 netcdf_text_variables.f90 netcdf_variables.f90 \
|
||||
netcdf_visibility.f90 netcdf_eightbyte.f90
|
||||
|
||||
# Is the user building netCDF-4?
|
||||
if USE_NETCDF4
|
||||
|
||||
# Use netcdf4.f90 to build the library.
|
||||
libnetcdff90_la_SOURCES += netcdf4.f90
|
||||
|
||||
# These are the extra netCDF-4 F90 source files.
|
||||
libnetcdff90_la_DEPENDENCIES += netcdf4_func.f90 netcdf4_externals.f90 \
|
||||
netcdf4_visibility.f90 netcdf4_constants.f90 netcdf4.f90 \
|
||||
netcdf4_eightbyte.f90 netcdf4_variables.f90
|
||||
|
||||
NETCDF_O = netcdf4.o
|
||||
|
||||
else # not USE_NETCDF4
|
||||
|
||||
# Use netcdf.f90 to get the library.
|
||||
libnetcdff90_la_SOURCES += netcdf.f90
|
||||
libnetcdff90_la_DEPENDENCIES += netcdf.f90
|
||||
|
||||
NETCDF_O = netcdf.o
|
||||
|
||||
endif # USE_NETCDF4
|
||||
|
||||
# Some fortran compilers change the file names of .mod files to all
|
||||
# uppercase. Just to be special.
|
||||
if UPPER_CASE_MOD
|
||||
nodist_include_HEADERS = TYPESIZES.mod NETCDF.mod
|
||||
TYPESIZES.mod: typeSizes.o
|
||||
NETCDF.mod: $(NETCDF_O)
|
||||
BUILT_SOURCES = TYPESIZES.mod
|
||||
else
|
||||
nodist_include_HEADERS = typesizes.mod netcdf.mod
|
||||
typesizes.mod: typeSizes.o
|
||||
netcdf.mod: $(NETCDF_O)
|
||||
BUILT_SOURCES = typesizes.mod
|
||||
endif
|
||||
|
||||
# This is what we are building: a convenience library of F90 functions.
|
||||
noinst_LTLIBRARIES = libnetcdff90.la
|
||||
|
||||
# Since these are included from either netcdf.f90 or netcdf4.f90, we
|
||||
# have to explicitly make sure they make it into the distribution.
|
||||
EXTRA_DIST += netcdf_attributes.f90 netcdf_constants.f90 \
|
||||
netcdf_dims.f90 netcdf_expanded.f90 netcdf4_eightbyte.f90 \
|
||||
netcdf_eightbyte.f90 netcdf_externals.f90 netcdf_file.f90 \
|
||||
netcdf3_file.f90 netcdf4_file.f90 netcdf_overloads.f90 \
|
||||
netcdf_text_variables.f90 netcdf_variables.f90 netcdf4_variables.f90 \
|
||||
netcdf_visibility.f90 netcdf4_func.f90 netcdf4_externals.f90 \
|
||||
netcdf4_visibility.f90 netcdf4_constants.f90
|
||||
|
||||
CLEANFILES = typesizes.mod netcdf.mod
|
||||
|
37
f90/NOTES
Normal file
37
f90/NOTES
Normal file
@ -0,0 +1,37 @@
|
||||
Implemented with 4 files:
|
||||
|
||||
f90aux.m4 auxiliary m4 macro definitions used by nves.m4 and nvea.m4
|
||||
nves.m4 to generate netcdf_vars_expand_single variations
|
||||
nvea.m4 to generate netcdf_vars_expand_arrays variations
|
||||
gen.m4 defines top-level NVES and NVEA macros and invokes them to
|
||||
generate all variations
|
||||
|
||||
To generate all the 6*2 nves functions and 7*6*2 nvea functions:
|
||||
|
||||
m4 gen.m4 > netcdf_expanded.f90
|
||||
|
||||
m4 uses common names for some built-in macros, e.g. "index", so
|
||||
f90aux.m4 renames a few of these to avoid clashes with source
|
||||
variables and functions.
|
||||
|
||||
All the invocations of the "dnl" macro (delete to new line) in
|
||||
f90aux.m4 are just to avoid gratuitous blank lines in the output.
|
||||
|
||||
m4 may be used for generating parameterized documentation and
|
||||
comments also.
|
||||
|
||||
Another approach to generating all the f90 functions other than the
|
||||
definition and invocation of the top-level NVES and NVEA macros in
|
||||
gen.m4 would be to just invoke m4 for each function generation,
|
||||
something like:
|
||||
|
||||
m4 -D NUMDIMS=2 -D KINDVALUE=FourByteReal -D PUTORGET=put f90aux.m4 nvea.m4
|
||||
|
||||
for the array functions, or
|
||||
|
||||
m4 -D NUMDIMS=0 -D KINDVALUE=FourByteReal -D PUTORGET=put f90aux.m4 nves.m4
|
||||
|
||||
for the single value functions.
|
||||
|
||||
|
||||
|
51
f90/example_good.cdl
Normal file
51
f90/example_good.cdl
Normal file
@ -0,0 +1,51 @@
|
||||
netcdf example {
|
||||
dimensions:
|
||||
lat = 4 ;
|
||||
lon = 3 ;
|
||||
frtime = UNLIMITED ; // (2 currently)
|
||||
timelen = 20 ;
|
||||
variables:
|
||||
float P(frtime, lat, lon) ;
|
||||
P:long_name = "pressure at maximum wind" ;
|
||||
P:units = "hectopascals" ;
|
||||
P:valid_range = 0.f, 1500.f ;
|
||||
P:_FillValue = -9999.f ;
|
||||
float lat(lat) ;
|
||||
lat:long_name = "latitude" ;
|
||||
lat:units = "degrees_north" ;
|
||||
float lon(lon) ;
|
||||
lon:long_name = "longitude" ;
|
||||
lon:units = "degrees_east" ;
|
||||
int frtime(frtime) ;
|
||||
frtime:long_name = "forecast time" ;
|
||||
frtime:units = "hours" ;
|
||||
char reftime(timelen) ;
|
||||
reftime:long_name = "reference time" ;
|
||||
reftime:units = "text_time" ;
|
||||
float ScalarVariable ;
|
||||
|
||||
// global attributes:
|
||||
:history = "created by Unidata LDM from NPS broadcast" ;
|
||||
:title = "NMC Global Product Set: Pressure at Maximum Wind" ;
|
||||
data:
|
||||
|
||||
P =
|
||||
950, 951, 952,
|
||||
953, 954, 955,
|
||||
956, 957, 958,
|
||||
959, 960, 961,
|
||||
962, 963, 964,
|
||||
965, 966, 967,
|
||||
968, 969, 970,
|
||||
971, 972, 973 ;
|
||||
|
||||
lat = -90, -87.5, -85, -82.5 ;
|
||||
|
||||
lon = -180, -175, -170 ;
|
||||
|
||||
frtime = 12, 18 ;
|
||||
|
||||
reftime = "1992-3-21 12:00" ;
|
||||
|
||||
ScalarVariable = 10 ;
|
||||
}
|
50
f90/f90aux.m4
Normal file
50
f90/f90aux.m4
Normal file
@ -0,0 +1,50 @@
|
||||
divert(-1)dnl
|
||||
ifdef(`NUMDIMS',,
|
||||
`errprint(`****NUMDIMS should be defined as 0, 1, 2, 3, 4, 5, 6, 7, ...****')m4exit')dnl
|
||||
ifdef(`KINDVALUE',,
|
||||
`errprint(`****KINDVALUE must be defined as "text", "OneByteInt", "TwoBytInt", "FourByteInt", "EightByteInt", "FourByteReal", or "EightByteReal"****\n')m4exit')dnl
|
||||
ifdef(`PUTORGET',,
|
||||
`errprint(`****PUTORGET must be defined as "put" or "get"****\n')m4exit')dnl
|
||||
dnl# NCOLONS(1) = ":", NCOLONS(2) = ":, :", etc.
|
||||
define(`NCOLONS',`ifelse($1, 1, `:', `:, '`NCOLONS(decr($1))')')
|
||||
define(`COLONS',`NCOLONS(NUMDIMS)')
|
||||
define(`NUMERIC_DECL',`$1 (kind = KINDVALUE)')
|
||||
define(`TEXT_DEFINES',
|
||||
`define(`TYPE',`character (len = *)')define(`NCKIND',`text')')
|
||||
define(`INT1_DEFINES',
|
||||
`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int1')')
|
||||
define(`INT2_DEFINES',
|
||||
`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int2')')
|
||||
define(`INT4_DEFINES',
|
||||
`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int')')
|
||||
define(`INT8_DEFINES',
|
||||
`define(`TYPE',`NUMERIC_DECL(integer)')define(`NCKIND',`int')')
|
||||
define(`FLT4_DEFINES',
|
||||
`define(`TYPE',`NUMERIC_DECL(real)')define(`NCKIND',`real')')
|
||||
define(`FLT8_DEFINES',
|
||||
`define(`TYPE',`NUMERIC_DECL(real)')define(`NCKIND',`double')')
|
||||
ifelse(KINDVALUE,text,`TEXT_DEFINES',
|
||||
KINDVALUE,OneByteInt,`INT1_DEFINES',
|
||||
KINDVALUE,TwoByteInt,`INT2_DEFINES',
|
||||
KINDVALUE,FourByteInt,`INT4_DEFINES',
|
||||
KINDVALUE,EightByteInt,`INT8_DEFINES',
|
||||
KINDVALUE,FourByteReal,`FLT4_DEFINES',
|
||||
KINDVALUE,EightByteReal,`FLT8_DEFINES',
|
||||
|
||||
`errprint(`****KINDVALUE must be "text", "OneByteInt", "TwoBytInt", "FourByteInt", "EightByteInt", "FourByteReal", or "EightByteReal"****\n')')
|
||||
ifelse(PUTORGET,`put',`define(`IN_OR_OUT',` in')',
|
||||
PUTORGET,`get',`define(`IN_OR_OUT',`out')',
|
||||
|
||||
`errprint(`****PUTORGET must be "put" or "get"****')')
|
||||
define(`ND_KINDVALUE',NUMDIMS`'D_`'KINDVALUE)
|
||||
define(`NF90_AFUN',`nf90_'PUTORGET`_var_'ND_KINDVALUE)
|
||||
define(`NF90_1FUN',`nf90_'PUTORGET`_var_'KINDVALUE)
|
||||
define(`NF_MFUN',`nf_'PUTORGET`_varm_'NCKIND)
|
||||
define(`NF_SFUN',`nf_'PUTORGET`_vars_'NCKIND)
|
||||
define(`NF_AFUN',`nf_'PUTORGET`_vara_'NCKIND)
|
||||
define(`NF_1FUN',`nf_'PUTORGET`_var1_'NCKIND)
|
||||
define(`m4_rename',`ifdef(`$1',`define(`m4'_`$1',defn(`$1'))undefine(`$1')')')
|
||||
m4_rename(`index')
|
||||
m4_rename(`len')
|
||||
m4_rename(`shift')
|
||||
divert`'dnl
|
145
f90/gen.m4
Normal file
145
f90/gen.m4
Normal file
@ -0,0 +1,145 @@
|
||||
define(NVES, dnl
|
||||
`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4
|
||||
define(`KINDVALUE',$1)dnl
|
||||
define(`PUTORGET', $2)dnl
|
||||
include(f90aux.m4)dnl
|
||||
include(nves.m4)
|
||||
')dnl
|
||||
|
||||
define(NVESPUT48, dnl
|
||||
`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4
|
||||
define(`KINDVALUE',$1)dnl
|
||||
define(`PUTORGET', $2)dnl
|
||||
include(f90aux.m4)dnl
|
||||
include(nvesput48.m4)
|
||||
')dnl
|
||||
|
||||
define(NVESGET48, dnl
|
||||
`define(`NUMDIMS',0)dnl # not used, but permits sharing f90aux.m4
|
||||
define(`KINDVALUE',$1)dnl
|
||||
define(`PUTORGET', $2)dnl
|
||||
include(f90aux.m4)dnl
|
||||
include(nvesget48.m4)
|
||||
')dnl
|
||||
|
||||
define(NVEA, dnl
|
||||
`define(`NUMDIMS',$1)dnl
|
||||
define(`KINDVALUE',$2)dnl
|
||||
define(`PUTORGET', $3)dnl
|
||||
include(f90aux.m4)dnl
|
||||
include(nvea.m4)
|
||||
')dnl
|
||||
|
||||
define(NVEAPUT48, dnl
|
||||
`define(`NUMDIMS',$1)dnl
|
||||
define(`KINDVALUE',$2)dnl
|
||||
define(`PUTORGET', $3)dnl
|
||||
include(f90aux.m4)dnl
|
||||
include(nveaput48.m4)
|
||||
')dnl
|
||||
|
||||
define(NVEAGET48, dnl
|
||||
`define(`NUMDIMS',$1)dnl
|
||||
define(`KINDVALUE',$2)dnl
|
||||
define(`PUTORGET', $3)dnl
|
||||
include(f90aux.m4)dnl
|
||||
include(nveaget48.m4)
|
||||
')dnl
|
||||
|
||||
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)
|
||||
|
||||
NVEA(1, OneByteInt, put)
|
||||
NVEA(2, OneByteInt, put)
|
||||
NVEA(3, OneByteInt, put)
|
||||
NVEA(4, OneByteInt, put)
|
||||
NVEA(5, OneByteInt, put)
|
||||
NVEA(6, OneByteInt, put)
|
||||
NVEA(7, OneByteInt, put)
|
||||
NVEA(1, TwoByteInt, put)
|
||||
NVEA(2, TwoByteInt, put)
|
||||
NVEA(3, TwoByteInt, put)
|
||||
NVEA(4, TwoByteInt, put)
|
||||
NVEA(5, TwoByteInt, put)
|
||||
NVEA(6, TwoByteInt, put)
|
||||
NVEA(7, TwoByteInt, put)
|
||||
NVEAPUT48(1, FourByteInt, put)
|
||||
NVEAPUT48(2, FourByteInt, put)
|
||||
NVEAPUT48(3, FourByteInt, put)
|
||||
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)
|
||||
NVEA(4, FourByteReal, put)
|
||||
NVEA(5, FourByteReal, put)
|
||||
NVEA(6, FourByteReal, put)
|
||||
NVEA(7, FourByteReal, put)
|
||||
NVEA(1, EightByteReal, put)
|
||||
NVEA(2, EightByteReal, put)
|
||||
NVEA(3, EightByteReal, put)
|
||||
NVEA(4, EightByteReal, put)
|
||||
NVEA(5, EightByteReal, put)
|
||||
NVEA(6, EightByteReal, put)
|
||||
NVEA(7, EightByteReal, put)
|
||||
NVEA(1, OneByteInt, get)
|
||||
NVEA(2, OneByteInt, get)
|
||||
NVEA(3, OneByteInt, get)
|
||||
NVEA(4, OneByteInt, get)
|
||||
NVEA(5, OneByteInt, get)
|
||||
NVEA(6, OneByteInt, get)
|
||||
NVEA(7, OneByteInt, get)
|
||||
NVEA(1, TwoByteInt, get)
|
||||
NVEA(2, TwoByteInt, get)
|
||||
NVEA(3, TwoByteInt, get)
|
||||
NVEA(4, TwoByteInt, get)
|
||||
NVEA(5, TwoByteInt, get)
|
||||
NVEA(6, TwoByteInt, get)
|
||||
NVEA(7, TwoByteInt, get)
|
||||
NVEAGET48(1, FourByteInt, get)
|
||||
NVEAGET48(2, FourByteInt, get)
|
||||
NVEAGET48(3, FourByteInt, get)
|
||||
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)
|
||||
NVEA(4, FourByteReal, get)
|
||||
NVEA(5, FourByteReal, get)
|
||||
NVEA(6, FourByteReal, get)
|
||||
NVEA(7, FourByteReal, get)
|
||||
NVEA(1, EightByteReal, get)
|
||||
NVEA(2, EightByteReal, get)
|
||||
NVEA(3, EightByteReal, get)
|
||||
NVEA(4, EightByteReal, get)
|
||||
NVEA(5, EightByteReal, get)
|
||||
NVEA(6, EightByteReal, get)
|
||||
NVEA(7, EightByteReal, get)
|
55
f90/netcdf.f90
Normal file
55
f90/netcdf.f90
Normal file
@ -0,0 +1,55 @@
|
||||
! Description:
|
||||
!
|
||||
! Input Parameters:
|
||||
! None.
|
||||
!
|
||||
! Output Parameters:
|
||||
! Many public constants are defined in "netcdf_constants.f90". The names follow
|
||||
! the Fortran 77 names, with nf90_ used as a prefix instead of nf_77.
|
||||
! Functions are made accessable through PUBLIC:: statements in "netcdf_visibility.f90".
|
||||
! Only the functions listed in this file are available in the interface.
|
||||
!
|
||||
! References and Credits:
|
||||
! Written by
|
||||
! Robert Pincus
|
||||
! Cooperative Institue for Meteorological Satellite Studies
|
||||
! University of Wisconsin - Madison
|
||||
! 1225 W. Dayton St.
|
||||
! Madison, Wisconsin 53706
|
||||
! Robert.Pincus@ssec.wisc.edu
|
||||
!
|
||||
! Design Notes:
|
||||
! Module elements are private by default.
|
||||
! Many functions have optional arguments. In order to keep the interface easy to use,
|
||||
! we've reordered the arguments (relative to the F77 interface) in some functions.
|
||||
! The external datatype of attributes is the same as the internal type.
|
||||
! By default, data is read from or put into the lowest part of the netCDF array with stride 1.
|
||||
! We've made heavy use of overloading, especially in the variable put and get routines.
|
||||
! A single function exists for putting all variables; a single function exists for getting
|
||||
! variables.
|
||||
! Text variables must be treated somewhat differently. When a character variable is defined, the
|
||||
! fastest-varying index (first index in Fortran) must be the maxiumu length of the character
|
||||
! string. N dimensional arrays of strings passed to the put or get functions are written/read
|
||||
! from dimensions 2:N+1. The number of values along the first dimension is determined by the
|
||||
! length of the argument character string.
|
||||
!
|
||||
module netcdf
|
||||
use typeSizes, only: OneByteInt, TwoByteInt, FourByteInt, EightByteInt, &
|
||||
FourByteReal, EightByteReal
|
||||
implicit none
|
||||
private
|
||||
|
||||
include "netcdf_constants.f90"
|
||||
include "netcdf_externals.f90"
|
||||
include "netcdf_overloads.f90"
|
||||
include "netcdf_visibility.f90"
|
||||
contains
|
||||
include "netcdf_file.f90"
|
||||
include "netcdf3_file.f90"
|
||||
include "netcdf_dims.f90"
|
||||
include "netcdf_attributes.f90"
|
||||
include "netcdf_variables.f90"
|
||||
include "netcdf_text_variables.f90"
|
||||
include "netcdf_expanded.f90"
|
||||
include "netcdf_eightbyte.f90"
|
||||
end module netcdf
|
37
f90/netcdf3_file.f90
Normal file
37
f90/netcdf3_file.f90
Normal file
@ -0,0 +1,37 @@
|
||||
! -------
|
||||
function nf90_open(path, mode, ncid, chunksize)
|
||||
character (len = *), intent(in ) :: path
|
||||
integer, intent(in ) :: mode
|
||||
integer, intent( out) :: ncid
|
||||
integer, optional, intent(inout) :: chunksize
|
||||
integer :: nf90_open
|
||||
|
||||
if(present(chunksize)) then
|
||||
nf90_open = nf__open(path, mode, chunksize, ncid)
|
||||
else
|
||||
nf90_open = nf_open(path, mode, ncid)
|
||||
end if
|
||||
end function nf90_open
|
||||
! -------
|
||||
function nf90_create(path, cmode, ncid, initialsize, chunksize)
|
||||
character (len = *), intent(in ) :: path
|
||||
integer, intent(in ) :: cmode
|
||||
integer, intent( out) :: ncid
|
||||
integer, optional, intent(in ) :: initialsize
|
||||
integer, optional, intent(inout) :: chunksize
|
||||
integer :: nf90_create
|
||||
|
||||
integer :: fileSize, chunk
|
||||
|
||||
if(.not. (present(initialsize) .or. present(chunksize)) ) then
|
||||
nf90_create = nf_create(path, cmode, ncid)
|
||||
else
|
||||
! Default values per man page
|
||||
filesize = 0; chunk = nf90_sizehint_default
|
||||
if(present(initialsize)) filesize = initialsize
|
||||
if(present(chunksize )) chunk = chunksize
|
||||
nf90_create = nf__create(path, cmode, filesize, chunk, ncid)
|
||||
! Pass back the value actually used
|
||||
if(present(chunksize )) chunksize = chunk
|
||||
end if
|
||||
end function nf90_create
|
62
f90/netcdf4.f90
Normal file
62
f90/netcdf4.f90
Normal file
@ -0,0 +1,62 @@
|
||||
! Description:
|
||||
!
|
||||
! Input Parameters:
|
||||
! None.
|
||||
!
|
||||
! Output Parameters:
|
||||
! Many public constants are defined in "netcdf_constants.f90". The names follow
|
||||
! the Fortran 77 names, with nf90_ used as a prefix instead of nf_77.
|
||||
! Functions are made accessable through PUBLIC:: statements in "netcdf_visibility.f90".
|
||||
! Only the functions listed in this file are available in the interface.
|
||||
!
|
||||
! References and Credits:
|
||||
! Written by
|
||||
! Robert Pincus
|
||||
! Cooperative Institue for Meteorological Satellite Studies
|
||||
! University of Wisconsin - Madison
|
||||
! 1225 W. Dayton St.
|
||||
! Madison, Wisconsin 53706
|
||||
! Robert.Pincus@ssec.wisc.edu
|
||||
!
|
||||
! Design Notes:
|
||||
! Module elements are private by default.
|
||||
! Many functions have optional arguments. In order to keep the interface easy to use,
|
||||
! we've reordered the arguments (relative to the F77 interface) in some functions.
|
||||
! The external datatype of attributes is the same as the internal type.
|
||||
! By default, data is read from or put into the lowest part of the netCDF array with stride 1.
|
||||
! We've made heavy use of overloading, especially in the variable put and get routines.
|
||||
! A single function exists for putting all variables; a single function exists for getting
|
||||
! variables.
|
||||
! Text variables must be treated somewhat differently. When a character variable is defined, the
|
||||
! fastest-varying index (first index in Fortran) must be the maxiumu length of the character
|
||||
! string. N dimensional arrays of strings passed to the put or get functions are written/read
|
||||
! from dimensions 2:N+1. The number of values along the first dimension is determined by the
|
||||
! length of the argument character string.
|
||||
!
|
||||
! NOTE: The netcdf4.f90 version of this file was created by Ed
|
||||
! Hartnett in 2006 to support the netCDF-4 API.
|
||||
!
|
||||
module netcdf
|
||||
use typeSizes, only: OneByteInt, TwoByteInt, FourByteInt, EightByteInt, &
|
||||
FourByteReal, EightByteReal
|
||||
implicit none
|
||||
private
|
||||
|
||||
include "netcdf_constants.f90"
|
||||
include "netcdf4_constants.f90"
|
||||
include "netcdf_externals.f90"
|
||||
include "netcdf4_externals.f90"
|
||||
include "netcdf_overloads.f90"
|
||||
include "netcdf_visibility.f90"
|
||||
include "netcdf4_visibility.f90"
|
||||
contains
|
||||
include "netcdf_file.f90"
|
||||
include "netcdf4_file.f90"
|
||||
include "netcdf_dims.f90"
|
||||
include "netcdf_attributes.f90"
|
||||
include "netcdf4_variables.f90"
|
||||
include "netcdf_text_variables.f90"
|
||||
include "netcdf_expanded.f90"
|
||||
include "netcdf4_eightbyte.f90"
|
||||
include "netcdf4_func.f90"
|
||||
end module netcdf
|
91
f90/netcdf4_constants.f90
Normal file
91
f90/netcdf4_constants.f90
Normal file
@ -0,0 +1,91 @@
|
||||
! This is part of netCDF-4. Copyright 2006 UCAR. See COPYRIGHT file for details.
|
||||
|
||||
! This file contains the extra F90 constants needed for netCDF-4.
|
||||
|
||||
! $Id: netcdf4_constants.f90,v 1.14 2010/05/25 13:53:00 ed Exp $
|
||||
|
||||
! extra data types:
|
||||
integer, parameter, public :: &
|
||||
nf90_ubyte = 7, &
|
||||
nf90_ushort = 8, &
|
||||
nf90_uint = 9, &
|
||||
nf90_int64 = 10, &
|
||||
nf90_uint64 = 11, &
|
||||
nf90_string = 12, &
|
||||
nf90_vlen = 13, &
|
||||
nf90_opaque = 14, &
|
||||
nf90_enum = 15, &
|
||||
nf90_compound = 16
|
||||
|
||||
|
||||
! extra default fill values:
|
||||
integer (kind = TwoByteInt), parameter, public :: &
|
||||
nf90_fill_ubyte = 255, &
|
||||
nf90_fill_uint1 = nf90_fill_ubyte
|
||||
integer (kind = FourByteInt), parameter, public :: &
|
||||
nf90_fill_ushort = 65535, &
|
||||
nf90_fill_uint2 = nf90_fill_ushort
|
||||
integer (kind = EightByteInt), parameter, public :: &
|
||||
nf90_fill_uint = 4294967295_8
|
||||
|
||||
! Extra file create mode flags.
|
||||
integer, parameter, public :: &
|
||||
nf90_netcdf4 = 4096, &
|
||||
nf90_hdf5 = 4096, & ! deprecated
|
||||
nf90_classic_model = 256
|
||||
|
||||
! Flags for parallel access.
|
||||
integer, parameter, public :: nf90_independent = 0, nf90_collective = 1
|
||||
|
||||
! Flags for parallel I/O.
|
||||
integer, parameter, public :: nf90_mpiio = 8192, nf90_mpiposix = 16384, &
|
||||
nf90_pnetcdf = 32768
|
||||
|
||||
! Extra variable flags.
|
||||
integer, parameter, public :: &
|
||||
nf90_chunk_seq = 0, &
|
||||
nf90_chunk_sub = 1, &
|
||||
nf90_chunk_sizes = 2, &
|
||||
nf90_endian_native = 0, &
|
||||
nf90_endian_little = 1, &
|
||||
nf90_endian_big = 2, &
|
||||
nf90_chunked = 0, &
|
||||
nf90_notcontiguous = 0, &
|
||||
nf90_contiguous = 1, &
|
||||
nf90_nochecksum = 0, &
|
||||
nf90_fletcher32 = 1, &
|
||||
nf90_noshuffle = 0, &
|
||||
nf90_shuffle = 1, &
|
||||
nf90_szip_ec_option_mask = 4, &
|
||||
nf90_szip_nn_option_mask = 32
|
||||
|
||||
! Extra error codes.
|
||||
integer, parameter, public :: &
|
||||
nf90_ehdferr = -101, & ! Error at HDF5 layer.
|
||||
nf90_ecantread = -102, & ! Can't read.
|
||||
nf90_ecantwrite = -103, & ! Can't write.
|
||||
nf90_ecantcreate = -104, & ! Can't create.
|
||||
nf90_efilemeta = -105, & ! Problem with file metadata.
|
||||
nf90_edimmeta = -106, & ! Problem with dimension metadata.
|
||||
nf90_eattmeta = -107, & ! Problem with attribute metadata.
|
||||
nf90_evarmeta = -108, & ! Problem with variable metadata.
|
||||
nf90_enocompound = -109, & ! Not a compound type.
|
||||
nf90_eattexists = -110, & ! Attribute already exists.
|
||||
nf90_enotnc4 = -111, & ! Attempting netcdf-4 operation on netcdf-3 file.
|
||||
nf90_estrictnc3 = -112, & ! Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
|
||||
nf90_enotnc3 = -113, & ! Attempting netcdf-3 operation on netcdf-4 file.
|
||||
nf90_enopar = -114, & ! Parallel operation on file opened for non-parallel access.
|
||||
nf90_eparinit = -115, & ! Error initializing for parallel access.
|
||||
nf90_ebadgrpid = -116, & ! Bad group ID.
|
||||
nf90_ebadtypid = -117, & ! Bad type ID.
|
||||
nf90_etypdefined = -118, & ! Type has already been defined and may not be edited.
|
||||
nf90_ebadfield = -119, & ! Bad field ID.
|
||||
nf90_ebadclass = -120, & ! Bad class.
|
||||
nf90_emaptype = -121, & ! Mapped access for atomic types only.
|
||||
nf90_elatefill = -122, & ! Attempt to define fill value when data already exists.
|
||||
nf90_elatedef = -122 ! Attempt to define var properties, like deflate, after enddef.
|
||||
|
||||
! This is the position of NC_NETCDF4 in cmode, counting from the
|
||||
! right, starting (uncharacteristically for fortran) at 0. It's needed
|
||||
! for the BTEST function calls.
|
||||
integer, parameter, private :: NETCDF4_BIT = 12
|
808
f90/netcdf4_eightbyte.f90
Normal file
808
f90/netcdf4_eightbyte.f90
Normal file
@ -0,0 +1,808 @@
|
||||
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, format_num
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_1D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_1D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
endif
|
||||
endif
|
||||
end function nf90_put_var_1D_EightByteInt
|
||||
|
||||
function nf90_put_var_2D_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_2D_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_2D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_2D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
endif
|
||||
endif
|
||||
|
||||
end function nf90_put_var_2D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_3D_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_3D_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_3D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_3D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
endif
|
||||
endif
|
||||
end function nf90_put_var_3D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_4D_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_4D_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_4D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_4D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end function nf90_put_var_4D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_5D_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_5D_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_5D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_5D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end function nf90_put_var_5D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_6D_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_6D_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_6D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_6D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end function nf90_put_var_6D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_7D_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_7D_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_put_var_7D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_7D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_vars_int64(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_vara_int64(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end function nf90_put_var_7D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_1D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_1D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:) = reshape(defaultIntArray(:), shape(values))
|
||||
endif
|
||||
endif
|
||||
end function nf90_get_var_1D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_2D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_2D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:, :) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end if
|
||||
end if
|
||||
end function nf90_get_var_2D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_3D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_3D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:, :, :) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end if
|
||||
end if
|
||||
end function nf90_get_var_3D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_4D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_4D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:, :, :, :) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end if
|
||||
end if
|
||||
end function nf90_get_var_4D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :, :), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_5D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_5D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:, :, :, :, :) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end if
|
||||
end if
|
||||
end function nf90_get_var_5D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :, :, :), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_6D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_6D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:, :, :, :, :, :) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end if
|
||||
end if
|
||||
end function nf90_get_var_6D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :, :, :, :), &
|
||||
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, format_num
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
integer (kind = EightByteInt), dimension(size(values)) :: defaultInt8Array
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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(:)
|
||||
nf90_get_var_7D_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_7D_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_varm_int64(ncid, varid, localStart, localCount, localStride, localMap, defaultInt8Array)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_vars_int64(ncid, varid, localStart, localCount, localStride, defaultInt8Array)
|
||||
else
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_vara_int64(ncid, varid, localStart, localCount, defaultInt8Array)
|
||||
end if
|
||||
values(:, :, :, :, :, :, :) = reshape(defaultInt8Array(:), shape(values))
|
||||
else
|
||||
if(present(map)) then
|
||||
localMap (:size(map)) = map(:)
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end if
|
||||
end if
|
||||
|
||||
end function nf90_get_var_7D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_EightByteInt(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start
|
||||
integer :: nf90_put_var_EightByteInt
|
||||
|
||||
integer, dimension(nf90_max_var_dims) :: localIndex
|
||||
integer :: counter, format_num
|
||||
|
||||
! Set local arguments to default values
|
||||
localIndex(:) = 1
|
||||
if(present(start)) localIndex(:size(start)) = start(:)
|
||||
|
||||
nf90_put_var_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_put_var_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
nf90_put_var_EightByteInt = nf_put_var1_int64(ncid, varid, localIndex, values)
|
||||
else
|
||||
nf90_put_var_EightByteInt = nf_put_var1_int(ncid, varid, localIndex, int(values))
|
||||
endif
|
||||
endif
|
||||
end function nf90_put_var_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_EightByteInt(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
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 :: counter, format_num
|
||||
integer :: defaultInteger
|
||||
integer (kind = EightByteInt) :: defaultInteger8
|
||||
|
||||
! Set local arguments to default values
|
||||
localIndex(:) = 1
|
||||
if(present(start)) localIndex(:size(start)) = start(:)
|
||||
|
||||
nf90_get_var_EightByteInt = nf_inq_format(ncid, format_num)
|
||||
if (nf90_get_var_EightByteInt .eq. nf90_noerr) then
|
||||
if (format_num .eq. nf90_format_netcdf4) then
|
||||
nf90_get_var_EightByteInt = nf_get_var1_int64(ncid, varid, localIndex, defaultInteger8)
|
||||
values = defaultInteger8
|
||||
else
|
||||
nf90_get_var_EightByteInt = nf_get_var1_int(ncid, varid, localIndex, defaultInteger)
|
||||
values = defaultInteger
|
||||
endif
|
||||
endif
|
||||
end function nf90_get_var_EightByteInt
|
||||
|
||||
|
32
f90/netcdf4_externals.f90
Normal file
32
f90/netcdf4_externals.f90
Normal file
@ -0,0 +1,32 @@
|
||||
! This is part of the netCDF-4 fortran 90 API.
|
||||
! Copyright 2006, UCAR
|
||||
! $Id: netcdf4_externals.f90,v 1.21 2010/01/20 13:06:15 ed Exp $
|
||||
|
||||
! Extra netCDF-4 functions
|
||||
|
||||
integer, external :: nf_create_par, nf_open_par, nf_var_par_access, &
|
||||
nf_inq_ncid, nf_inq_grps, nf_inq_grpname, nf_inq_grpname_full, &
|
||||
nf_inq_grpname_len, nf_inq_grp_parent, nf_inq_grp_ncid, nf_inq_grp_full_ncid, nf_inq_varids, &
|
||||
nf_inq_dimids, nf_inq_typeids, nf_inq_typeid, nf_def_grp, nf_def_compound, &
|
||||
nf_insert_compound, nf_insert_array_compound, nf_inq_type, &
|
||||
nf_inq_compound, nf_inq_compound_name, nf_inq_compound_size, &
|
||||
nf_inq_compound_nfields, nf_inq_compound_field, &
|
||||
nf_inq_compound_fieldname, nf_inq_compound_fieldindex, &
|
||||
nf_inq_compound_fieldtype, nf_inq_compound_fieldndims, &
|
||||
nf_inq_compound_fielddim_sizes, nf_inq_compound_fieldoffset, &
|
||||
nf_def_vlen, nf_inq_vlen, nf_free_vlen, nf_inq_user_type, &
|
||||
nf_def_enum, nf_insert_enum, nf_inq_enum, nf_inq_enum_member, &
|
||||
nf_inq_enum_ident, nf_def_opaque, nf_inq_opaque, &
|
||||
nf_def_var_chunking, nf_def_var_deflate, &
|
||||
nf_def_var_fletcher32, nf_inq_var_chunking, nf_inq_var_deflate, &
|
||||
nf_inq_var_fletcher32, nf_inq_var_endian, nf_def_var_endian, &
|
||||
nf_def_var_fill, nf_inq_var_fill, nf_get_att, nf_put_att, &
|
||||
nf_put_vars, nf_get_vars, nf_put_vlen_element, &
|
||||
nf_put_var1_int64, nf_put_vara_int64, nf_put_vars_int64, &
|
||||
nf_put_varm_int64, nf_put_var_int64, nf_get_var1_int64, &
|
||||
nf_get_vara_int64, nf_get_vars_int64, nf_get_varm_int64, &
|
||||
nf_get_var_int64, nf_get_chunk_cache, nf_set_chunk_cache, &
|
||||
nf_inq_var_szip, nf_free_vlens, nf_free_string, &
|
||||
nf_set_var_chunk_cache, nf_get_var_chunk_cache
|
||||
|
||||
|
149
f90/netcdf4_file.f90
Normal file
149
f90/netcdf4_file.f90
Normal file
@ -0,0 +1,149 @@
|
||||
! -------
|
||||
function nf90_open(path, mode, ncid, chunksize, cache_size, cache_nelems, &
|
||||
cache_preemption, comm, info)
|
||||
implicit none
|
||||
character (len = *), intent(in) :: path
|
||||
integer, intent(in) :: mode
|
||||
integer, intent(out) :: ncid
|
||||
integer, optional, intent(inout) :: chunksize
|
||||
integer, optional, intent(in) :: cache_size, cache_nelems
|
||||
real, optional, intent(in) :: cache_preemption
|
||||
integer, optional, intent(in) :: comm, info
|
||||
integer :: size_in, nelems_in, preemption_in
|
||||
integer :: size_out, nelems_out, preemption_out, ret
|
||||
integer :: nf90_open
|
||||
|
||||
! If using parallel, both comm and info must be provided.
|
||||
if (present(comm) .and. .not. present(info)) then
|
||||
nf90_open = NF90_EINVAL;
|
||||
return
|
||||
end if
|
||||
|
||||
! If the user specified chuck cache parameters, use them. But user
|
||||
! may have specified one, two, or three settings. Leave the others
|
||||
! unchanged.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
ret = nf_get_chunk_cache(size_in, nelems_in, preemption_in)
|
||||
if (ret .ne. nf90_noerr) then
|
||||
nf90_open = ret
|
||||
return
|
||||
end if
|
||||
if (present(cache_size)) then
|
||||
size_out = cache_size
|
||||
else
|
||||
size_out = size_in
|
||||
end if
|
||||
if (present(cache_nelems)) then
|
||||
nelems_out = cache_nelems
|
||||
else
|
||||
nelems_out = nelems_in
|
||||
end if
|
||||
if (present(cache_preemption)) then
|
||||
preemption_out = cache_preemption
|
||||
else
|
||||
preemption_out = preemption_in
|
||||
end if
|
||||
nf90_open = nf_set_chunk_cache(size_out, nelems_out, preemption_out)
|
||||
if (nf90_open .ne. nf90_noerr) return
|
||||
end if
|
||||
|
||||
! Do the open.
|
||||
if(present(chunksize)) then
|
||||
nf90_open = nf__open(path, mode, chunksize, ncid)
|
||||
else
|
||||
if (present(comm)) then
|
||||
nf90_open = nf_open_par(path, mode, comm, info, ncid)
|
||||
else
|
||||
nf90_open = nf_open(path, mode, ncid)
|
||||
end if
|
||||
end if
|
||||
if (nf90_open .ne. nf90_noerr) return
|
||||
|
||||
! If settings were changed, reset chunk chache to original settings.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
nf90_open = nf_set_chunk_cache(size_in, nelems_in, preemption_in)
|
||||
end if
|
||||
|
||||
end function nf90_open
|
||||
! -------
|
||||
function nf90_create(path, cmode, ncid, initialsize, chunksize, cache_size, &
|
||||
cache_nelems, cache_preemption, comm, info)
|
||||
implicit none
|
||||
character (len = *), intent(in) :: path
|
||||
integer, intent(in) :: cmode
|
||||
integer, intent(out) :: ncid
|
||||
integer, optional, intent(in) :: initialsize
|
||||
integer, optional, intent(inout) :: chunksize
|
||||
integer, optional, intent(in) :: cache_size, cache_nelems
|
||||
integer, optional, intent(in) :: cache_preemption
|
||||
integer, optional, intent(in) :: comm, info
|
||||
integer :: size_in, nelems_in, preemption_in
|
||||
integer :: size_out, nelems_out, preemption_out, ret
|
||||
integer :: nf90_create
|
||||
integer :: fileSize, chunk
|
||||
integer :: x
|
||||
|
||||
! Just ignore options netCDF-3 options for netCDF-4 files, or
|
||||
! netCDF-4 options, for netCDF-3 files, so that the same user code
|
||||
! can work for both cases.
|
||||
|
||||
! If using parallel, but comm and info must be provided.
|
||||
if (present(comm) .and. .not. present(info)) then
|
||||
nf90_create = NF90_EINVAL;
|
||||
return
|
||||
end if
|
||||
|
||||
! If the user specified chuck cache parameters, use them. But user
|
||||
! may have specified one, two, or three settings. Leave the others
|
||||
! unchanged.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
nf90_create = nf_get_chunk_cache(size_in, nelems_in, preemption_in)
|
||||
if (nf90_create .ne. nf90_noerr) return
|
||||
if (present(cache_size)) then
|
||||
size_out = cache_size
|
||||
else
|
||||
size_out = size_in
|
||||
end if
|
||||
if (present(cache_nelems)) then
|
||||
nelems_out = cache_nelems
|
||||
else
|
||||
nelems_out = nelems_in
|
||||
end if
|
||||
if (present(cache_preemption)) then
|
||||
preemption_out = cache_preemption
|
||||
else
|
||||
preemption_out = preemption_in
|
||||
end if
|
||||
nf90_create = nf_set_chunk_cache(size_out, nelems_out, preemption_out)
|
||||
if (nf90_create .ne. nf90_noerr) return
|
||||
end if
|
||||
|
||||
! Do the file create.
|
||||
if(.not. (present(initialsize) .or. present(chunksize)) ) then
|
||||
if (present(comm)) then
|
||||
nf90_create = nf_create_par(path, cmode, comm, info, ncid)
|
||||
else
|
||||
nf90_create = nf_create(path, cmode, ncid)
|
||||
end if
|
||||
else
|
||||
! Default values per man page
|
||||
filesize = 0; chunk = nf90_sizehint_default
|
||||
if(present(initialsize)) filesize = initialsize
|
||||
if(present(chunksize )) chunk = chunksize
|
||||
nf90_create = nf__create(path, cmode, filesize, chunk, ncid)
|
||||
! Pass back the value actually used
|
||||
if(present(chunksize )) chunksize = chunk
|
||||
end if
|
||||
if (nf90_create .ne. nf90_noerr) return
|
||||
|
||||
! If settings were changed, reset chunk chache to original settings.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
nf90_create = nf_set_chunk_cache(size_in, nelems_in, preemption_in)
|
||||
end if
|
||||
|
||||
|
||||
end function nf90_create
|
654
f90/netcdf4_func.f90
Normal file
654
f90/netcdf4_func.f90
Normal file
@ -0,0 +1,654 @@
|
||||
!
|
||||
! NetCDF-4 extra routines:
|
||||
!
|
||||
! -----------
|
||||
function nf90_create_par(path, cmode, comm, info, ncid, cache_size, &
|
||||
cache_nelems, cache_preemption)
|
||||
character (len = *), intent(in) :: path
|
||||
integer, intent(in) :: cmode
|
||||
integer, intent(in) :: comm
|
||||
integer, intent(in) :: info
|
||||
integer, intent(out) :: ncid
|
||||
integer, optional, intent(in) :: cache_size, cache_nelems
|
||||
real, optional, intent(in) :: cache_preemption
|
||||
integer :: size_in, nelems_in, preemption_in
|
||||
integer :: size_out, nelems_out, preemption_out, ret
|
||||
integer :: nf90_create_par
|
||||
|
||||
! If the user specified chuck cache parameters, use them. But user
|
||||
! may have specified one, two, or three settings. Leave the others
|
||||
! unchanged.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
ret = nf_get_chunk_cache(size_in, nelems_in, preemption_in)
|
||||
if (ret .ne. nf90_noerr) then
|
||||
nf90_create_par = ret
|
||||
return
|
||||
end if
|
||||
if (present(cache_size)) then
|
||||
size_out = cache_size
|
||||
else
|
||||
size_out = size_in
|
||||
end if
|
||||
if (present(cache_nelems)) then
|
||||
nelems_out = cache_nelems
|
||||
else
|
||||
nelems_out = nelems_in
|
||||
end if
|
||||
if (present(cache_preemption)) then
|
||||
preemption_out = cache_preemption
|
||||
else
|
||||
preemption_out = preemption_in
|
||||
end if
|
||||
nf90_create_par = nf_set_chunk_cache(size_out, nelems_out, preemption_out)
|
||||
if (nf90_create_par .ne. nf90_noerr) return
|
||||
end if
|
||||
|
||||
nf90_create_par = nf_create_par(path, cmode, comm, info, ncid)
|
||||
end function nf90_create_par
|
||||
! -----------
|
||||
function nf90_open_par(path, cmode, comm, info, ncid, cache_size, &
|
||||
cache_nelems, cache_preemption)
|
||||
character (len = *), intent(in) :: path
|
||||
integer, intent(in) :: cmode
|
||||
integer, intent(in) :: comm
|
||||
integer, intent(in) :: info
|
||||
integer, intent(out) :: ncid
|
||||
integer, optional, intent(in) :: cache_size, cache_nelems
|
||||
real, optional, intent(in) :: cache_preemption
|
||||
integer :: size_in, nelems_in, preemption_in
|
||||
integer :: size_out, nelems_out, preemption_out, ret
|
||||
integer :: nf90_open_par
|
||||
|
||||
! If the user specified chuck cache parameters, use them. But user
|
||||
! may have specified one, two, or three settings. Leave the others
|
||||
! unchanged.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
ret = nf_get_chunk_cache(size_in, nelems_in, preemption_in)
|
||||
if (ret .ne. nf90_noerr) then
|
||||
nf90_open_par = ret
|
||||
return
|
||||
end if
|
||||
if (present(cache_size)) then
|
||||
size_out = cache_size
|
||||
else
|
||||
size_out = size_in
|
||||
end if
|
||||
if (present(cache_nelems)) then
|
||||
nelems_out = cache_nelems
|
||||
else
|
||||
nelems_out = nelems_in
|
||||
end if
|
||||
if (present(cache_preemption)) then
|
||||
preemption_out = cache_preemption
|
||||
else
|
||||
preemption_out = preemption_in
|
||||
end if
|
||||
nf90_open_par = nf_set_chunk_cache(size_out, nelems_out, preemption_out)
|
||||
if (nf90_open_par .ne. nf90_noerr) return
|
||||
end if
|
||||
|
||||
nf90_open_par = nf_open_par(path, cmode, comm, info, ncid)
|
||||
end function nf90_open_par
|
||||
! -----------
|
||||
function nf90_var_par_access(ncid, varid, access)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(in) :: access
|
||||
integer :: nf90_var_par_access
|
||||
|
||||
nf90_var_par_access = nf_var_par_access(ncid, varid, access)
|
||||
end function nf90_var_par_access
|
||||
! -----------
|
||||
function nf90_inq_ncid(ncid, name, grp_ncid)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: grp_ncid
|
||||
integer :: nf90_inq_ncid
|
||||
|
||||
nf90_inq_ncid = nf_inq_ncid(ncid, name, grp_ncid)
|
||||
end function nf90_inq_ncid
|
||||
! -----------
|
||||
function nf90_inq_grps(ncid, numgrps, ncids)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(out) :: numgrps
|
||||
integer, dimension(:), intent(out) :: ncids
|
||||
integer :: nf90_inq_grps
|
||||
|
||||
nf90_inq_grps = nf_inq_grps(ncid, numgrps, ncids)
|
||||
end function nf90_inq_grps
|
||||
! -----------
|
||||
function nf90_inq_grpname_len(ncid, len)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(out) :: len
|
||||
integer :: nf90_inq_grpname_len
|
||||
|
||||
nf90_inq_grpname_len = nf_inq_grpname_len(ncid, len)
|
||||
end function nf90_inq_grpname_len
|
||||
! -----------
|
||||
function nf90_inq_grp_ncid(ncid, name, grpid)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: grpid
|
||||
integer :: nf90_inq_grp_ncid
|
||||
|
||||
nf90_inq_grp_ncid = nf_inq_grp_ncid(ncid, name, grpid)
|
||||
end function nf90_inq_grp_ncid
|
||||
! -----------
|
||||
function nf90_inq_grp_full_ncid(ncid, full_name, grpid)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(in) :: full_name
|
||||
integer, intent(out) :: grpid
|
||||
integer :: nf90_inq_grp_full_ncid
|
||||
|
||||
nf90_inq_grp_full_ncid = nf_inq_grp_full_ncid(ncid, full_name, grpid)
|
||||
end function nf90_inq_grp_full_ncid
|
||||
! -----------
|
||||
function nf90_inq_grp_parent(ncid, parent_ncid)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(out) :: parent_ncid
|
||||
integer :: nf90_inq_grp_parent
|
||||
|
||||
nf90_inq_grp_parent = nf_inq_grp_parent(ncid, parent_ncid)
|
||||
end function nf90_inq_grp_parent
|
||||
! -----------
|
||||
function nf90_inq_grpname(ncid, name)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(out) :: name
|
||||
integer :: nf90_inq_grpname
|
||||
|
||||
nf90_inq_grpname = nf_inq_grpname(ncid, name)
|
||||
end function nf90_inq_grpname
|
||||
! -----------
|
||||
function nf90_inq_grpname_full(ncid, len, name)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(out) :: len
|
||||
character (len = *), intent(out) :: name
|
||||
integer :: nf90_inq_grpname_full
|
||||
|
||||
nf90_inq_grpname_full = nf_inq_grpname_full(ncid, len, name)
|
||||
end function nf90_inq_grpname_full
|
||||
! -----------
|
||||
function nf90_inq_varids(ncid, nvars, varids)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(out) :: nvars
|
||||
integer, dimension(:), intent(out) :: varids
|
||||
integer :: nf90_inq_varids
|
||||
|
||||
nf90_inq_varids = nf_inq_varids(ncid, nvars, varids)
|
||||
end function nf90_inq_varids
|
||||
! -----------
|
||||
function nf90_inq_dimids(ncid, ndims, dimids, include_parents)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(out) :: ndims
|
||||
integer, dimension(:), intent(out) :: dimids
|
||||
integer, intent(out) :: include_parents
|
||||
integer :: nf90_inq_dimids
|
||||
|
||||
nf90_inq_dimids = nf_inq_dimids(ncid, ndims, dimids, include_parents)
|
||||
end function nf90_inq_dimids
|
||||
! -----------
|
||||
function nf90_inq_typeids(ncid, ntypes, typeids)
|
||||
integer, intent(in) :: ncid
|
||||
integer, optional, intent(out) :: ntypes
|
||||
integer, dimension(:), optional, intent(out) :: typeids
|
||||
integer :: nf90_inq_typeids
|
||||
|
||||
nf90_inq_typeids = nf_inq_typeids(ncid, ntypes, typeids)
|
||||
|
||||
end function nf90_inq_typeids
|
||||
! -----------
|
||||
function nf90_inq_typeid(ncid, name, typeid)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, optional, intent(out) :: typeid
|
||||
integer :: nf90_inq_typeid
|
||||
|
||||
nf90_inq_typeid = nf_inq_typeid(ncid, name, typeid)
|
||||
|
||||
end function nf90_inq_typeid
|
||||
! -----------
|
||||
function nf90_def_grp(parent_ncid, name, new_ncid)
|
||||
integer, intent(in) :: parent_ncid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: new_ncid
|
||||
integer :: nf90_def_grp
|
||||
|
||||
nf90_def_grp = nf_def_grp(parent_ncid, name, new_ncid)
|
||||
end function nf90_def_grp
|
||||
! -----------
|
||||
function nf90_def_compound(ncid, size, name, typeid)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: size
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: typeid
|
||||
integer :: nf90_def_compound
|
||||
|
||||
nf90_def_compound = nf_def_compound(ncid, size, name, typeid)
|
||||
end function nf90_def_compound
|
||||
! -----------
|
||||
function nf90_insert_compound(ncid, xtype, name, offset, field_typeid)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(in) :: offset
|
||||
integer, intent(in) :: field_typeid
|
||||
integer :: nf90_insert_compound
|
||||
|
||||
nf90_insert_compound = nf_insert_compound(ncid, xtype, name, offset, field_typeid)
|
||||
end function nf90_insert_compound
|
||||
! -----------
|
||||
function nf90_insert_array_compound(ncid, xtype, name, offset, field_typeid, &
|
||||
ndims, dim_sizes)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(in) :: offset
|
||||
integer, intent(in) :: field_typeid
|
||||
integer, intent(in) :: ndims
|
||||
integer, intent(in) :: dim_sizes
|
||||
integer :: nf90_insert_array_compound
|
||||
|
||||
nf90_insert_array_compound = nf_insert_array_compound(ncid, xtype, name, &
|
||||
offset, field_typeid, ndims, dim_sizes)
|
||||
end function nf90_insert_array_compound
|
||||
! -----------
|
||||
function nf90_inq_type(ncid, xtype, name, size, nfields)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: size
|
||||
integer, intent(out) :: nfields
|
||||
integer :: nf90_inq_type
|
||||
|
||||
nf90_inq_type = nf_inq_type(ncid, xtype, name, size, nfields)
|
||||
end function nf90_inq_type
|
||||
! -----------
|
||||
function nf90_inq_compound(ncid, xtype, name, size, nfields)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: size
|
||||
integer, intent(out) :: nfields
|
||||
integer :: nf90_inq_compound
|
||||
|
||||
nf90_inq_compound = nf_inq_compound(ncid, xtype, name, size, nfields)
|
||||
end function nf90_inq_compound
|
||||
! -----------
|
||||
function nf90_inq_compound_name(ncid, xtype, name)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer :: nf90_inq_compound_name
|
||||
|
||||
nf90_inq_compound_name = nf_inq_compound_name(ncid, xtype, name)
|
||||
end function nf90_inq_compound_name
|
||||
! -----------
|
||||
function nf90_inq_compound_size(ncid, xtype, size)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(out) :: size
|
||||
integer :: nf90_inq_compound_size
|
||||
|
||||
nf90_inq_compound_size = nf_inq_compound_size(ncid, xtype, size)
|
||||
end function nf90_inq_compound_size
|
||||
! -----------
|
||||
function nf90_inq_compound_nfields(ncid, xtype, nfields)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(out) :: nfields
|
||||
integer :: nf90_inq_compound_nfields
|
||||
|
||||
nf90_inq_compound_nfields = nf_inq_compound_nfields(ncid, xtype, nfields)
|
||||
end function nf90_inq_compound_nfields
|
||||
! -----------
|
||||
function nf90_inq_compound_field(ncid, xtype, fieldid, name, offset, &
|
||||
field_typeid, ndims, dim_sizes)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: fieldid
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: offset
|
||||
integer, intent(out) :: field_typeid
|
||||
integer, intent(out) :: ndims
|
||||
integer, intent(out) :: dim_sizes
|
||||
integer :: nf90_inq_compound_field
|
||||
|
||||
nf90_inq_compound_field = nf_inq_compound_field(ncid, xtype, fieldid, name, offset, &
|
||||
field_typeid, ndims, dim_sizes)
|
||||
end function nf90_inq_compound_field
|
||||
! -----------
|
||||
function nf90_inq_compound_fieldname(ncid, xtype, fieldid, name)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: fieldid
|
||||
character (len = *), intent(out) :: name
|
||||
integer :: nf90_inq_compound_fieldname
|
||||
|
||||
nf90_inq_compound_fieldname = nf_inq_compound_fieldname(ncid, xtype, fieldid, name)
|
||||
end function nf90_inq_compound_fieldname
|
||||
! -----------
|
||||
function nf90_inq_compound_fieldindex(ncid, xtype, name, fieldid)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: fieldid
|
||||
integer :: nf90_inq_compound_fieldindex
|
||||
|
||||
nf90_inq_compound_fieldindex = nf_inq_compound_fieldindex(ncid, xtype, name, fieldid)
|
||||
end function nf90_inq_compound_fieldindex
|
||||
! -----------
|
||||
function nf90_inq_compound_fieldoffset(ncid, xtype, fieldid, offset)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: fieldid
|
||||
integer, intent(out) :: offset
|
||||
integer :: nf90_inq_compound_fieldoffset
|
||||
|
||||
nf90_inq_compound_fieldoffset = nf_inq_compound_fieldoffset(ncid, xtype, fieldid, offset)
|
||||
end function nf90_inq_compound_fieldoffset
|
||||
! -----------
|
||||
function nf90_inq_compound_fieldtype(ncid, xtype, fieldid, field_typeid)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: fieldid
|
||||
integer, intent(out) :: field_typeid
|
||||
integer :: nf90_inq_compound_fieldtype
|
||||
|
||||
nf90_inq_compound_fieldtype = nf_inq_compound_fieldtype(ncid, xtype, fieldid, field_typeid)
|
||||
end function nf90_inq_compound_fieldtype
|
||||
! -----------
|
||||
function nf90_inq_compound_fieldndims(ncid, xtype, fieldid, ndims)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: fieldid
|
||||
integer, intent(out) :: ndims
|
||||
integer :: nf90_inq_compound_fieldndims
|
||||
|
||||
nf90_inq_compound_fieldndims = nf_inq_compound_fieldndims(ncid, xtype, fieldid, ndims)
|
||||
end function nf90_inq_compound_fieldndims
|
||||
! -----------
|
||||
function nf90_inq_cmp_fielddim_sizes(ncid, xtype, fieldid, dim_sizes)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: fieldid
|
||||
integer, intent(out) :: dim_sizes
|
||||
integer :: nf90_inq_cmp_fielddim_sizes
|
||||
|
||||
nf90_inq_cmp_fielddim_sizes = nf_inq_compound_fielddim_sizes(ncid, xtype, fieldid, dim_sizes)
|
||||
end function nf90_inq_cmp_fielddim_sizes
|
||||
! -----------
|
||||
function nf90_def_vlen(ncid, name, base_typeid, xtypeid)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(in) :: base_typeid
|
||||
integer, intent(out) :: xtypeid
|
||||
integer :: nf90_def_vlen
|
||||
|
||||
nf90_def_vlen = nf_def_vlen(ncid, name, base_typeid, xtypeid)
|
||||
end function nf90_def_vlen
|
||||
! -----------
|
||||
function nf90_inq_vlen(ncid, xtype, name, datum_size, base_nc_type)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: datum_size
|
||||
integer, intent(out) :: base_nc_type
|
||||
integer :: nf90_inq_vlen
|
||||
|
||||
nf90_inq_vlen = nf_inq_vlen(ncid, xtype, name, datum_size, base_nc_type)
|
||||
end function nf90_inq_vlen
|
||||
! -----------
|
||||
function nf90_free_vlen(vl)
|
||||
character (len = *), intent(in) :: vl
|
||||
integer :: nf90_free_vlen
|
||||
|
||||
nf90_free_vlen = nf_free_vlen(vl)
|
||||
end function nf90_free_vlen
|
||||
! ! -----------
|
||||
function nf90_def_enum(ncid, base_typeid, name, typeid)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: base_typeid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: typeid
|
||||
integer :: nf90_def_enum
|
||||
|
||||
nf90_def_enum = nf_def_enum(ncid, base_typeid, name, typeid)
|
||||
end function nf90_def_enum
|
||||
! ! -----------
|
||||
function nf90_inq_user_type(ncid, xtype, name, size, base_typeid, nfields, class)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: size
|
||||
integer, intent(out) :: base_typeid
|
||||
integer, intent(out) :: nfields
|
||||
integer, intent(out) :: class
|
||||
integer :: nf90_inq_user_type
|
||||
|
||||
nf90_inq_user_type = nf_inq_user_type(ncid, xtype, name, size, base_typeid, nfields, class)
|
||||
end function nf90_inq_user_type
|
||||
! -----------
|
||||
function nf90_insert_enum(ncid, xtype, name, value)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(in) :: value
|
||||
integer :: nf90_insert_enum
|
||||
|
||||
nf90_insert_enum = nf_insert_enum(ncid, xtype, name, value)
|
||||
end function nf90_insert_enum
|
||||
! -----------
|
||||
function nf90_inq_enum(ncid, xtype, name, base_nc_type, base_size, num_members)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: base_nc_type
|
||||
integer, intent(out) :: base_size
|
||||
integer, intent(out) :: num_members
|
||||
integer :: nf90_inq_enum
|
||||
|
||||
nf90_inq_enum = nf_inq_enum(ncid, xtype, name, base_nc_type, base_size, num_members)
|
||||
end function nf90_inq_enum
|
||||
! -----------
|
||||
function nf90_inq_enum_member(ncid, xtype, idx, name, value)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: idx
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(in) :: value
|
||||
integer :: nf90_inq_enum_member
|
||||
|
||||
nf90_inq_enum_member = nf_inq_enum_member(ncid, xtype, idx, name, value)
|
||||
end function nf90_inq_enum_member
|
||||
! -----------
|
||||
function nf90_inq_enum_ident(ncid, xtype, value, idx)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: value
|
||||
integer, intent(out) :: idx
|
||||
integer :: nf90_inq_enum_ident
|
||||
|
||||
nf90_inq_enum_ident = nf_inq_enum_ident(ncid, xtype, value, idx)
|
||||
end function nf90_inq_enum_ident
|
||||
! -----------
|
||||
function nf90_def_opaque(ncid, size, name, xtype)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: size
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent(out) :: xtype
|
||||
integer :: nf90_def_opaque
|
||||
|
||||
nf90_def_opaque = nf_def_opaque(ncid, size, name, xtype)
|
||||
end function nf90_def_opaque
|
||||
! -----------
|
||||
function nf90_inq_opaque(ncid, xtype, name, size)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: xtype
|
||||
character (len = *), intent(out) :: name
|
||||
integer, intent(out) :: size
|
||||
integer :: nf90_inq_opaque
|
||||
|
||||
nf90_inq_opaque = nf_inq_opaque(ncid, xtype, name, size)
|
||||
end function nf90_inq_opaque
|
||||
! -----------
|
||||
function nf90_def_var_chunking(ncid, varid, contiguous, chunksizes)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(in) :: contiguous
|
||||
integer, dimension(:), intent(in) :: chunksizes
|
||||
integer :: nf90_def_var_chunking
|
||||
|
||||
nf90_def_var_chunking = nf_def_var_chunking(ncid, varid, contiguous, chunksizes)
|
||||
end function nf90_def_var_chunking
|
||||
! -----------
|
||||
function nf90_def_var_deflate(ncid, varid, shuffle, deflate, deflate_level)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(in) :: shuffle
|
||||
integer, intent(in) :: deflate
|
||||
integer, intent(in) :: deflate_level
|
||||
integer :: nf90_def_var_deflate
|
||||
|
||||
nf90_def_var_deflate = nf_def_var_deflate(ncid, varid, shuffle, deflate, deflate_level)
|
||||
end function nf90_def_var_deflate
|
||||
! -----------
|
||||
function nf90_def_var_fletcher32(ncid, varid, fletcher32)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(in) :: fletcher32
|
||||
integer :: nf90_def_var_fletcher32
|
||||
|
||||
nf90_def_var_fletcher32 = nf_def_var_fletcher32(ncid, varid, fletcher32)
|
||||
end function nf90_def_var_fletcher32
|
||||
! -----------
|
||||
function nf90_inq_var_chunking(ncid, varid, contiguous, chunksizes)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(out) :: contiguous
|
||||
integer, dimension(:), intent(out) :: chunksizes
|
||||
integer :: nf90_inq_var_chunking
|
||||
|
||||
nf90_inq_var_chunking = nf_inq_var_chunking(ncid, varid, contiguous, chunksizes)
|
||||
end function nf90_inq_var_chunking
|
||||
! -----------
|
||||
function nf90_inq_var_deflate(ncid, varid, shuffle, deflate, deflate_level)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(out) :: shuffle
|
||||
integer, intent(out) :: deflate
|
||||
integer, intent(out) :: deflate_level
|
||||
integer :: nf90_inq_var_deflate
|
||||
|
||||
nf90_inq_var_deflate = nf_inq_var_deflate(ncid, varid, shuffle, deflate, deflate_level)
|
||||
end function nf90_inq_var_deflate
|
||||
! -----------
|
||||
function nf90_inq_var_fletcher32(ncid, varid, fletcher32)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(out) :: fletcher32
|
||||
integer :: nf90_inq_var_fletcher32
|
||||
|
||||
nf90_inq_var_fletcher32 = nf_inq_var_fletcher32(ncid, varid, fletcher32)
|
||||
end function nf90_inq_var_fletcher32
|
||||
! -----------
|
||||
function nf90_def_var_endian(ncid, varid, endian)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(in) :: endian
|
||||
integer :: nf90_def_var_endian
|
||||
|
||||
nf90_def_var_endian = nf_def_var_endian(ncid, varid, endian)
|
||||
end function nf90_def_var_endian
|
||||
! -----------
|
||||
function nf90_inq_var_endian(ncid, varid, endian)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(out) :: endian
|
||||
integer :: nf90_inq_var_endian
|
||||
|
||||
nf90_inq_var_endian = nf_inq_var_endian(ncid, varid, endian)
|
||||
end function nf90_inq_var_endian
|
||||
! -----------
|
||||
function nf90_def_var_fill(ncid, varid, no_fill, fill)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(in) :: no_fill
|
||||
integer, intent(in) :: fill
|
||||
integer :: nf90_def_var_fill
|
||||
|
||||
nf90_def_var_fill = nf_def_var_fill(ncid, varid, no_fill, fill)
|
||||
end function nf90_def_var_fill
|
||||
! -----------
|
||||
function nf90_inq_var_fill(ncid, varid, no_fill, fill)
|
||||
integer, intent(in) :: ncid
|
||||
integer, intent(in) :: varid
|
||||
integer, intent(out) :: no_fill
|
||||
integer, intent(out) :: fill
|
||||
integer :: nf90_inq_var_fill
|
||||
|
||||
nf90_inq_var_fill = nf_inq_var_fill(ncid, varid, no_fill, fill)
|
||||
end function nf90_inq_var_fill
|
||||
! -----------
|
||||
function nf90_put_att_any(ncid, varid, name, typeid, length, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer, intent( in) :: typeid, length
|
||||
character(len = *), intent( in) :: values
|
||||
integer :: nf90_put_att_any
|
||||
|
||||
nf90_put_att_any = nf_put_att(ncid, varid, name, typeid, length, values)
|
||||
end function nf90_put_att_any
|
||||
! -----------
|
||||
function nf90_get_att_any(ncid, varid, name, length, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer, intent( in) :: length
|
||||
character(len = *), intent( in) :: values
|
||||
integer :: nf90_get_att_any
|
||||
|
||||
nf90_get_att_any = nf_get_att(ncid, varid, name, values)
|
||||
end function nf90_get_att_any
|
||||
! -----------
|
||||
function nf90_put_var_any(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_any
|
||||
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (:) = 1
|
||||
localCount (1) = len_trim(values); localCount (2:) = 1
|
||||
localStride(:) = 1
|
||||
|
||||
if(present(start)) localStart (:size(start) ) = start(:)
|
||||
if(present(count)) localCount (:size(count) ) = count(:)
|
||||
if(present(stride)) localStride(:size(stride)) = stride(:)
|
||||
|
||||
nf90_put_var_any = nf_put_vars(ncid, varid, localStart, localCount, localStride, values)
|
||||
end function nf90_put_var_any
|
||||
! -----------
|
||||
function nf90_get_var_any(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_any
|
||||
|
||||
integer, dimension(nf90_max_var_dims) :: textDimIDs
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride
|
||||
integer :: stringLength
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (:) = 1
|
||||
localCount (1) = len(values); localCount (2:) = 1
|
||||
localStride(:) = 1
|
||||
|
||||
if(present(start)) localStart (:size(start) ) = start(:)
|
||||
if(present(count)) localCount (:size(count) ) = count(:)
|
||||
if(present(stride)) localStride(:size(stride)) = stride(:)
|
||||
|
||||
nf90_get_var_any = nf_get_vars(ncid, varid, localStart, localCount, localStride, values)
|
||||
end function nf90_get_var_any
|
356
f90/netcdf4_variables.f90
Normal file
356
f90/netcdf4_variables.f90
Normal file
@ -0,0 +1,356 @@
|
||||
! -----
|
||||
! Variable definitions and inquiry
|
||||
! -----
|
||||
function nf90_def_var_Scalar(ncid, name, xtype, varid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(out) :: varid
|
||||
integer :: nf90_def_var_Scalar
|
||||
|
||||
! Dummy - shouldn't get used
|
||||
integer, dimension(1) :: dimids
|
||||
|
||||
! These may not be used with scalars, but it causes an interface
|
||||
! violation if they are not optional arguments.
|
||||
|
||||
nf90_def_var_Scalar = nf_def_var(ncid, name, xtype, 0, dimids, varid)
|
||||
end function nf90_def_var_Scalar
|
||||
! -----
|
||||
function nf90_def_var_oneDim(ncid, name, xtype, dimids, varid, contiguous, &
|
||||
chunksizes, deflate_level, shuffle, fletcher32, endianness, &
|
||||
cache_size, cache_nelems, cache_preemption)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent(in) :: xtype
|
||||
integer, intent(in) :: dimids
|
||||
integer, intent(out) :: varid
|
||||
logical, optional, intent(in) :: contiguous
|
||||
integer, optional, intent(in) :: chunksizes
|
||||
integer, optional, intent(in) :: deflate_level
|
||||
logical, optional, intent(in) :: shuffle, fletcher32
|
||||
integer, optional, intent(in) :: endianness
|
||||
integer, optional, intent(in) :: cache_size, cache_nelems, cache_preemption
|
||||
integer :: nf90_def_var_oneDim
|
||||
|
||||
integer, dimension(1) :: dimidsA, chunksizes1
|
||||
integer :: size1 = -1, nelems1 = -1, preemption1 = -1
|
||||
integer :: contiguous1
|
||||
|
||||
! Put this int into an array, where all decent folk keep ids.
|
||||
dimidsA(1) = dimids
|
||||
|
||||
! This is forbidden! Don't even think about it.
|
||||
if (present(contiguous)) then
|
||||
if (contiguous .and. present(chunksizes)) then
|
||||
nf90_def_var_oneDim = nf90_einval
|
||||
return
|
||||
end if
|
||||
end if
|
||||
if (present(contiguous)) then
|
||||
if (.not. contiguous .and. .not. present(chunksizes)) then
|
||||
nf90_def_var_oneDim = nf90_einval
|
||||
return
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
! Define the variable.
|
||||
nf90_def_var_oneDim = nf_def_var(ncid, name, xtype, 1, dimidsA, varid)
|
||||
if (nf90_def_var_oneDim .ne. nf90_noerr) return
|
||||
|
||||
! Handle chunksizes and contiguous.
|
||||
if (present(chunksizes) .or. present(contiguous)) then
|
||||
if (present(contiguous)) then
|
||||
if (contiguous) then
|
||||
contiguous1 = nf90_contiguous
|
||||
else
|
||||
contiguous1 = nf90_notcontiguous
|
||||
endif
|
||||
endif
|
||||
if (present(chunksizes)) then
|
||||
contiguous1 = 0
|
||||
chunksizes1(1) = chunksizes
|
||||
endif
|
||||
nf90_def_var_oneDim = nf_def_var_chunking(ncid, varid, contiguous1, chunksizes1)
|
||||
endif
|
||||
if (present(contiguous)) then
|
||||
if (contiguous) then
|
||||
nf90_def_var_oneDim = nf_def_var_chunking(ncid, varid, 1, 0)
|
||||
endif
|
||||
endif
|
||||
if (nf90_def_var_oneDim .ne. nf90_noerr) return
|
||||
|
||||
! Handle deflate and shuffle.
|
||||
if (present(deflate_level)) then
|
||||
if (deflate_level .gt. 0) then
|
||||
if (present(shuffle)) then
|
||||
if (shuffle) then
|
||||
nf90_def_var_oneDim = nf_def_var_deflate(ncid, varid, 1, 1, deflate_level)
|
||||
else
|
||||
nf90_def_var_oneDim = nf_def_var_deflate(ncid, varid, 0, 1, deflate_level)
|
||||
end if
|
||||
if (nf90_def_var_oneDim .ne. nf90_noerr) return
|
||||
end if
|
||||
end if
|
||||
endif
|
||||
|
||||
! Handle fletcher32.
|
||||
if (present(fletcher32)) then
|
||||
if (fletcher32) then
|
||||
nf90_def_var_oneDim = nf_def_var_fletcher32(ncid, varid, 1)
|
||||
if (nf90_def_var_oneDim .ne. nf90_noerr) return
|
||||
endif
|
||||
endif
|
||||
|
||||
! Handle endianness.
|
||||
if (present(endianness)) then
|
||||
nf90_def_var_oneDim = nf_def_var_endian(ncid, varid, endianness)
|
||||
if (nf90_def_var_oneDim .ne. nf90_noerr) return
|
||||
endif
|
||||
|
||||
! Set the cache if the user wants to.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
! Negative values mean leave it alone.
|
||||
if (present(cache_size)) size1 = cache_size
|
||||
if (present(cache_nelems)) nelems1 = cache_nelems
|
||||
if (present(cache_preemption)) preemption1 = cache_preemption
|
||||
|
||||
nf90_def_var_oneDim = nf_set_var_chunk_cache(ncid, varid, &
|
||||
size1, nelems1, preemption1)
|
||||
if (nf90_def_var_oneDim .ne. nf90_noerr) return
|
||||
endif
|
||||
|
||||
end function nf90_def_var_oneDim
|
||||
! -----
|
||||
function nf90_def_var_ManyDims(ncid, name, xtype, dimids, varid, contiguous, &
|
||||
chunksizes, deflate_level, shuffle, fletcher32, endianness, cache_size, &
|
||||
cache_nelems, cache_preemption)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent(in) :: name
|
||||
integer, intent( in) :: xtype
|
||||
integer, dimension(:), intent(in) :: dimids
|
||||
integer, intent(out) :: varid
|
||||
logical, optional, intent(in) :: contiguous
|
||||
integer, optional, dimension(:), intent(in) :: chunksizes
|
||||
integer, optional, intent(in) :: deflate_level
|
||||
logical, optional, intent(in) :: shuffle, fletcher32
|
||||
integer, optional, intent(in) :: endianness
|
||||
integer, optional, intent(in) :: cache_size, cache_nelems, cache_preemption
|
||||
integer :: nf90_def_var_ManyDims
|
||||
|
||||
! Local variables.
|
||||
integer :: contiguous1, d
|
||||
integer :: size1 = -1, nelems1 = -1, preemption1 = -1
|
||||
integer, dimension(nf90_max_dims) :: chunksizes1
|
||||
|
||||
! This is forbidden!
|
||||
if (present(contiguous)) then
|
||||
if (contiguous .and. present(chunksizes)) then
|
||||
nf90_def_var_ManyDims = nf90_einval
|
||||
return
|
||||
end if
|
||||
end if
|
||||
if (present(contiguous)) then
|
||||
if (.not. contiguous .and. .not. present(chunksizes)) then
|
||||
nf90_def_var_ManyDims = nf90_einval
|
||||
return
|
||||
endif
|
||||
end if
|
||||
|
||||
! Be nice and check array size.
|
||||
if (present(chunksizes)) then
|
||||
if (size(chunksizes) .ne. size(dimids)) then
|
||||
nf90_def_var_ManyDims = nf90_einval
|
||||
return
|
||||
end if
|
||||
end if
|
||||
|
||||
! Define the variable.
|
||||
nf90_def_var_ManyDims = nf_def_var(ncid, name, xtype, size(dimids), dimids, varid)
|
||||
if (nf90_def_var_ManyDims .ne. nf90_noerr) return
|
||||
|
||||
! Handle chunksizes and contiguous.
|
||||
if (present(chunksizes) .or. present(contiguous)) then
|
||||
if (present(contiguous)) then
|
||||
if (contiguous) then
|
||||
contiguous1 = nf90_contiguous
|
||||
else
|
||||
contiguous1 = nf90_notcontiguous
|
||||
endif
|
||||
endif
|
||||
if (present(chunksizes)) then
|
||||
contiguous1 = 0
|
||||
do d = 1, size(dimids)
|
||||
chunksizes1(d) = chunksizes(d)
|
||||
end do
|
||||
endif
|
||||
nf90_def_var_ManyDims = nf_def_var_chunking(ncid, varid, contiguous1, chunksizes1)
|
||||
endif
|
||||
if (present(contiguous)) then
|
||||
if (contiguous) then
|
||||
nf90_def_var_ManyDims = nf_def_var_chunking(ncid, varid, 1, 0)
|
||||
endif
|
||||
endif
|
||||
if (nf90_def_var_ManyDims .ne. nf90_noerr) return
|
||||
|
||||
! Handle deflate and shuffle.
|
||||
if (present(deflate_level)) then
|
||||
if (deflate_level .gt. 0) then
|
||||
if (present(shuffle)) then
|
||||
if (shuffle) then
|
||||
nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 1, 1, deflate_level)
|
||||
else
|
||||
nf90_def_var_ManyDims = nf_def_var_deflate(ncid, varid, 0, 1, deflate_level)
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
endif
|
||||
if (nf90_def_var_ManyDims .ne. nf90_noerr) return
|
||||
|
||||
! Handle fletcher32.
|
||||
if (present(fletcher32)) then
|
||||
if (fletcher32) then
|
||||
nf90_def_var_ManyDims = nf_def_var_fletcher32(ncid, varid, 1)
|
||||
endif
|
||||
endif
|
||||
if (nf90_def_var_ManyDims .ne. nf90_noerr) return
|
||||
|
||||
! Handle endianness.
|
||||
if (present(endianness)) then
|
||||
nf90_def_var_ManyDims = nf_def_var_endian(ncid, varid, endianness)
|
||||
endif
|
||||
|
||||
! Set the cache if the user wants to.
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. &
|
||||
present(cache_preemption)) then
|
||||
! Negative values mean leave it alone.
|
||||
if (present(cache_size)) size1 = cache_size
|
||||
if (present(cache_nelems)) nelems1 = cache_nelems
|
||||
if (present(cache_preemption)) preemption1 = cache_preemption
|
||||
|
||||
nf90_def_var_ManyDims = nf_set_var_chunk_cache(ncid, varid, &
|
||||
size1, nelems1, preemption1)
|
||||
if (nf90_def_var_ManyDims .ne. nf90_noerr) return
|
||||
endif
|
||||
|
||||
end function nf90_def_var_ManyDims
|
||||
! -----
|
||||
function nf90_inq_varid(ncid, name, varid)
|
||||
integer, intent(in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent(out) :: varid
|
||||
integer :: nf90_inq_varid
|
||||
|
||||
nf90_inq_varid = nf_inq_varid(ncid, name, varid)
|
||||
if (nf90_inq_varid .ne. nf90_noerr) return
|
||||
|
||||
end function nf90_inq_varid
|
||||
! -----
|
||||
function nf90_set_var_chunk_cache(ncid, varid, size, nelems, preemption)
|
||||
integer, intent(in) :: ncid, varid, size, nelems, preemption
|
||||
integer :: nf90_set_var_chunk_cache
|
||||
|
||||
nf90_set_var_chunk_cache = nf_set_var_chunk_cache(ncid, varid, &
|
||||
size, nelems, preemption)
|
||||
if (nf90_set_var_chunk_cache .ne. nf90_noerr) return
|
||||
|
||||
end function nf90_set_var_chunk_cache
|
||||
! -----
|
||||
function nf90_inquire_variable(ncid, varid, name, xtype, ndims, dimids, nAtts, &
|
||||
contiguous, chunksizes, deflate_level, shuffle, fletcher32, endianness, &
|
||||
cache_size, cache_nelems, cache_preemption)
|
||||
integer, intent(in) :: ncid, varid
|
||||
character (len = *), optional, intent(out) :: name
|
||||
integer, optional, intent(out) :: xtype, ndims
|
||||
integer, dimension(:), optional, intent(out) :: dimids
|
||||
integer, optional, intent(out) :: nAtts
|
||||
logical, optional, intent(out) :: contiguous
|
||||
integer, optional, dimension(:), intent(out) :: chunksizes
|
||||
integer, optional, intent(out) :: deflate_level
|
||||
logical, optional, intent(out) :: shuffle, fletcher32
|
||||
integer, optional, intent(out) :: endianness
|
||||
integer, optional, intent(out) :: cache_size, cache_nelems, cache_preemption
|
||||
integer :: nf90_inquire_variable
|
||||
|
||||
! Local variables
|
||||
character (len = nf90_max_name) :: varName = ''
|
||||
integer :: externalType, numDimensions
|
||||
integer, dimension(nf90_max_var_dims) :: dimensionIDs
|
||||
integer :: numAttributes
|
||||
integer :: deflate1, deflate_level1, contiguous1, shuffle1, fletcher321
|
||||
integer, dimension(nf90_max_dims) :: chunksizes1
|
||||
integer :: size1, nelems1, preemption1
|
||||
integer :: d
|
||||
|
||||
! Learn the basic facts.
|
||||
nf90_inquire_variable = nf_inq_var(ncid, varid, varName, externalType, &
|
||||
numDimensions, dimensionIDs, numAttributes)
|
||||
if (nf90_inquire_variable .ne. nf90_noerr) return
|
||||
|
||||
! Tell the user what he wants to know.
|
||||
if (present(name)) name = trim(varName)
|
||||
if (present(xtype)) xtype = externalType
|
||||
if (present(ndims)) ndims = numDimensions
|
||||
if (present(dimids)) then
|
||||
if (size(dimids) .ge. numDimensions) then
|
||||
dimids(:numDimensions) = dimensionIDs(:numDimensions)
|
||||
else
|
||||
nf90_inquire_variable = nf90_einval
|
||||
endif
|
||||
endif
|
||||
if (present(nAtts)) nAtts = numAttributes
|
||||
|
||||
! Get the chunksizes and contiguous settings, if desired.
|
||||
if (present(chunksizes) .or. present(contiguous)) then
|
||||
nf90_inquire_variable = nf_inq_var_chunking(ncid, varid, contiguous1, chunksizes1)
|
||||
if (nf90_inquire_variable .ne. nf90_noerr) return
|
||||
if (present(contiguous)) contiguous = contiguous1 .ne. nf90_notcontiguous
|
||||
if (present(chunksizes)) then
|
||||
do d = 1, numDimensions
|
||||
chunksizes(d) = chunksizes1(d)
|
||||
end do
|
||||
endif
|
||||
endif
|
||||
|
||||
! Get the fletcher32 settings, if desired.
|
||||
if (present(fletcher32)) then
|
||||
nf90_inquire_variable = nf_inq_var_fletcher32(ncid, varid, fletcher321)
|
||||
if (nf90_inquire_variable .ne. nf90_noerr) return
|
||||
fletcher32 = fletcher321 .gt. 0
|
||||
endif
|
||||
|
||||
! Get the deflate and shuffle settings, if desired.
|
||||
if (present(deflate_level) .or. present(shuffle)) then
|
||||
nf90_inquire_variable = nf_inq_var_deflate(ncid, varid, shuffle1, deflate1, deflate_level1)
|
||||
if (nf90_inquire_variable .ne. nf90_noerr) return
|
||||
if (present(deflate_level)) deflate_level = deflate_level1
|
||||
if (present(shuffle)) shuffle = shuffle1 .ne. 0
|
||||
endif
|
||||
|
||||
! And the endianness...
|
||||
if (present(endianness)) then
|
||||
nf90_inquire_variable = nf_inq_var_endian(ncid, varid, endianness)
|
||||
if (nf90_inquire_variable .ne. nf90_noerr) return
|
||||
endif
|
||||
|
||||
! Does the user want cache settings?
|
||||
if (present(cache_size) .or. present(cache_nelems) .or. present(cache_preemption)) then
|
||||
nf90_inquire_variable = nf_get_var_chunk_cache(ncid, varid, &
|
||||
size1, nelems1, preemption1)
|
||||
if (nf90_inquire_variable .ne. nf90_noerr) return
|
||||
if (present(cache_size)) cache_size = size1
|
||||
if (present(cache_nelems)) cache_nelems = nelems1
|
||||
if (present(cache_preemption)) cache_preemption = preemption1
|
||||
endif
|
||||
end function nf90_inquire_variable
|
||||
! -----
|
||||
function nf90_rename_var(ncid, varid, newname)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: newname
|
||||
integer :: nf90_rename_var
|
||||
|
||||
nf90_rename_var = nf_rename_var(ncid, varid, newname)
|
||||
end function nf90_rename_var
|
||||
! -----
|
23
f90/netcdf4_visibility.f90
Normal file
23
f90/netcdf4_visibility.f90
Normal file
@ -0,0 +1,23 @@
|
||||
! This is part of the netCDF-4 fortran 90 API.
|
||||
! Copyright 2006, UCAR
|
||||
! $Id: netcdf4_visibility.f90,v 1.15 2009/09/28 17:53:00 ed Exp $
|
||||
|
||||
public :: nf90_create_par, nf90_open_par, nf90_var_par_access, &
|
||||
nf90_inq_ncid, nf90_inq_grps, nf90_inq_grp_ncid, nf90_inq_grp_full_ncid, nf90_inq_grpname, &
|
||||
nf90_inq_grpname_full, nf90_inq_grpname_len, nf90_inq_varids, nf90_inq_grp_parent, &
|
||||
nf90_inq_dimids, nf90_inq_typeids, nf90_def_grp, nf90_def_compound, &
|
||||
nf90_insert_compound, nf90_insert_array_compound, nf90_inq_type, &
|
||||
nf90_inq_compound, nf90_inq_compound_name, nf90_inq_compound_size, &
|
||||
nf90_inq_compound_nfields, nf90_inq_compound_field, &
|
||||
nf90_inq_compound_fieldname, nf90_inq_compound_fieldindex, &
|
||||
nf90_inq_compound_fieldoffset, nf90_inq_compound_fieldtype, &
|
||||
nf90_inq_compound_fieldndims, nf90_inq_cmp_fielddim_sizes, nf90_def_vlen, nf90_inq_vlen, &
|
||||
nf90_def_enum, nf90_insert_enum, nf90_inq_enum, nf90_inq_enum_member, nf90_inq_enum_ident, &
|
||||
nf90_def_opaque, nf90_inq_opaque, nf90_def_var_deflate, nf90_inq_var_deflate, &
|
||||
nf90_def_var_fletcher32, nf90_inq_var_fletcher32, nf90_def_var_chunking, &
|
||||
nf90_inq_var_chunking, &
|
||||
nf90_def_var_fill, nf90_inq_var_fill, &
|
||||
nf90_def_var_endian, nf90_inq_var_endian, nf90_inq_user_type, &
|
||||
nf90_put_att_any, nf90_get_att_any, nf90_get_var_any, nf90_put_var_any
|
||||
|
||||
|
330
f90/netcdf_attributes.f90
Normal file
330
f90/netcdf_attributes.f90
Normal file
@ -0,0 +1,330 @@
|
||||
!
|
||||
! Attribute routines:
|
||||
!
|
||||
! -------
|
||||
function nf90_copy_att(ncid_in, varid_in, name, ncid_out, varid_out)
|
||||
integer, intent( in) :: ncid_in, varid_in
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent( in) :: ncid_out, varid_out
|
||||
integer :: nf90_copy_att
|
||||
|
||||
nf90_copy_att = nf_copy_att(ncid_in, varid_in, name, ncid_out, varid_out)
|
||||
end function nf90_copy_att
|
||||
! -------
|
||||
function nf90_rename_att(ncid, varid, curname, newname)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: curname, newname
|
||||
integer :: nf90_rename_att
|
||||
|
||||
nf90_rename_att = nf_rename_att(ncid, varid, curname, newname)
|
||||
end function nf90_rename_att
|
||||
! -------
|
||||
function nf90_del_att(ncid, varid, name)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: name
|
||||
integer :: nf90_del_att
|
||||
|
||||
nf90_del_att = nf_del_att(ncid, varid, name)
|
||||
end function nf90_del_att
|
||||
! -------
|
||||
! Attribute inquiry functions
|
||||
! -------
|
||||
function nf90_inq_attname(ncid, varid, attnum, name)
|
||||
integer, intent( in) :: ncid, varid, attnum
|
||||
character (len = *), intent(out) :: name
|
||||
integer :: nf90_inq_attname
|
||||
|
||||
nf90_inq_attname = nf_inq_attname(ncid, varid, attnum, name)
|
||||
end function nf90_inq_attname
|
||||
! -------
|
||||
function nf90_inquire_attribute(ncid, varid, name, xtype, len, attnum)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent(out), optional :: xtype, len, attnum
|
||||
integer :: nf90_inquire_attribute
|
||||
|
||||
integer :: local_xtype, local_len
|
||||
|
||||
! Do we need to worry about not saving the state from this call?
|
||||
if(present(attnum)) &
|
||||
nf90_inquire_attribute = nf_inq_attid(ncid, varid, name, attnum)
|
||||
nf90_inquire_attribute = nf_inq_att (ncid, varid, name, local_xtype, local_len)
|
||||
if(present(xtype)) xtype = local_xtype
|
||||
if(present(len )) len = local_len
|
||||
end function nf90_inquire_attribute
|
||||
! -------
|
||||
! Put and get functions; these will get overloaded
|
||||
! -------
|
||||
! Text
|
||||
! -------
|
||||
function nf90_put_att_text(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
character(len = *), intent( in) :: values
|
||||
integer :: nf90_put_att_text
|
||||
|
||||
nf90_put_att_text = nf_put_att_text(ncid, varid, name, len_trim(values), trim(values))
|
||||
end function nf90_put_att_text
|
||||
! -------
|
||||
function nf90_get_att_text(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
character(len = *), intent(out) :: values
|
||||
integer :: nf90_get_att_text
|
||||
|
||||
values = ' ' !! make sure result will be blank padded
|
||||
nf90_get_att_text = nf_get_att_text(ncid, varid, name, values)
|
||||
end function nf90_get_att_text
|
||||
! -------
|
||||
! Integer attributes
|
||||
! -------
|
||||
function nf90_put_att_OneByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = OneByteInt), dimension(:), intent( in) :: values
|
||||
integer :: nf90_put_att_OneByteInt
|
||||
|
||||
nf90_put_att_OneByteInt = nf_put_att_int1(ncid, varid, name, nf90_int1, size(values), values)
|
||||
end function nf90_put_att_OneByteInt
|
||||
! -------
|
||||
function nf90_put_att_one_OneByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = OneByteInt), intent( in) :: values
|
||||
integer :: nf90_put_att_one_OneByteInt
|
||||
|
||||
integer (kind = OneByteInt), dimension(1) :: valuesA
|
||||
valuesA(1) = values
|
||||
nf90_put_att_one_OneByteInt = nf_put_att_int1(ncid, varid, name, nf90_int1, 1, valuesA)
|
||||
end function nf90_put_att_one_OneByteInt
|
||||
! -------
|
||||
function nf90_get_att_OneByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = OneByteInt), dimension(:), intent(out) :: values
|
||||
integer :: nf90_get_att_OneByteInt
|
||||
|
||||
nf90_get_att_OneByteInt = nf_get_att_int1(ncid, varid, name, values)
|
||||
end function nf90_get_att_OneByteInt
|
||||
! -------
|
||||
function nf90_get_att_one_OneByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = OneByteInt), intent(out) :: values
|
||||
integer :: nf90_get_att_one_OneByteInt
|
||||
|
||||
integer (kind = OneByteInt), dimension(1) :: valuesA
|
||||
nf90_get_att_one_OneByteInt = nf_get_att_int1(ncid, varid, name, valuesA)
|
||||
values = valuesA(1)
|
||||
end function nf90_get_att_one_OneByteInt
|
||||
! -------
|
||||
function nf90_put_att_TwoByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = TwoByteInt), dimension(:), intent( in) :: values
|
||||
integer :: nf90_put_att_TwoByteInt
|
||||
|
||||
nf90_put_att_TwoByteInt = nf_put_att_int2(ncid, varid, name, nf90_int2, size(values), values)
|
||||
end function nf90_put_att_TwoByteInt
|
||||
! -------
|
||||
function nf90_put_att_one_TwoByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = TwoByteInt), intent( in) :: values
|
||||
integer :: nf90_put_att_one_TwoByteInt
|
||||
|
||||
integer (kind = TwoByteInt), dimension(1) :: valuesA
|
||||
valuesA(1) = values
|
||||
nf90_put_att_one_TwoByteInt = nf_put_att_int2(ncid, varid, name, nf90_int2, 1, valuesA)
|
||||
end function nf90_put_att_one_TwoByteInt
|
||||
! -------
|
||||
function nf90_get_att_TwoByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = TwoByteInt), dimension(:), intent(out) :: values
|
||||
integer :: nf90_get_att_TwoByteInt
|
||||
|
||||
nf90_get_att_TwoByteInt = nf_get_att_int2(ncid, varid, name, values)
|
||||
end function nf90_get_att_TwoByteInt
|
||||
! -------
|
||||
function nf90_get_att_one_TwoByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = TwoByteInt), intent(out) :: values
|
||||
integer :: nf90_get_att_one_TwoByteInt
|
||||
|
||||
integer (kind = TwoByteInt), dimension(1) :: valuesA
|
||||
nf90_get_att_one_TwoByteInt = nf_get_att_int2(ncid, varid, name, valuesA)
|
||||
values = valuesA(1)
|
||||
end function nf90_get_att_one_TwoByteInt
|
||||
! -------
|
||||
function nf90_put_att_FourByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = FourByteInt), dimension(:), intent( in) :: values
|
||||
integer :: nf90_put_att_FourByteInt
|
||||
|
||||
nf90_put_att_FourByteInt = nf_put_att_int(ncid, varid, name, nf90_int, size(values), int(values))
|
||||
end function nf90_put_att_FourByteInt
|
||||
! -------
|
||||
function nf90_put_att_one_FourByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = FourByteInt), intent( in) :: values
|
||||
integer :: nf90_put_att_one_FourByteInt
|
||||
|
||||
integer (kind = FourByteInt), dimension(1) :: valuesA
|
||||
valuesA(1) = int(values)
|
||||
nf90_put_att_one_FourByteInt = nf_put_att_int(ncid, varid, name, nf90_int, 1, int(valuesA))
|
||||
end function nf90_put_att_one_FourByteInt
|
||||
! -------
|
||||
function nf90_get_att_FourByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = FourByteInt), dimension(:), intent(out) :: values
|
||||
integer :: nf90_get_att_FourByteInt
|
||||
|
||||
integer, dimension(size(values)) :: defaultInteger
|
||||
|
||||
nf90_get_att_FourByteInt = nf_get_att_int(ncid, varid, name, defaultInteger)
|
||||
values(:) = defaultInteger(:)
|
||||
end function nf90_get_att_FourByteInt
|
||||
! -------
|
||||
function nf90_get_att_one_FourByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = FourByteInt), intent(out) :: values
|
||||
integer :: nf90_get_att_one_FourByteInt
|
||||
|
||||
integer, dimension(1) :: defaultInteger
|
||||
|
||||
nf90_get_att_one_FourByteInt = nf_get_att_int(ncid, varid, name, defaultInteger)
|
||||
values = defaultInteger(1)
|
||||
end function nf90_get_att_one_FourByteInt
|
||||
! -------
|
||||
function nf90_put_att_EightByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = EightByteInt), dimension(:), intent( in) :: values
|
||||
integer :: nf90_put_att_EightByteInt
|
||||
|
||||
nf90_put_att_EightByteInt = nf_put_att_int(ncid, varid, name, nf90_int, size(values), int(values))
|
||||
end function nf90_put_att_EightByteInt
|
||||
! -------
|
||||
function nf90_put_att_one_EightByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = EightByteInt), intent( in) :: values
|
||||
integer :: nf90_put_att_one_EightByteInt
|
||||
|
||||
integer, dimension(1) :: valuesA
|
||||
valuesA(1) = values
|
||||
nf90_put_att_one_EightByteInt = nf_put_att_int(ncid, varid, name, nf90_int, 1, valuesA)
|
||||
end function nf90_put_att_one_EightByteInt
|
||||
! -------
|
||||
function nf90_get_att_EightByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = EightByteInt), dimension(:), intent(out) :: values
|
||||
integer :: nf90_get_att_EightByteInt
|
||||
|
||||
integer, dimension(size(values)) :: defaultInteger
|
||||
|
||||
nf90_get_att_EightByteInt = nf_get_att_int(ncid, varid, name, defaultInteger)
|
||||
values(:) = defaultInteger(:)
|
||||
end function nf90_get_att_EightByteInt
|
||||
! -------
|
||||
function nf90_get_att_one_EightByteInt(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
integer (kind = EightByteInt), intent(out) :: values
|
||||
integer :: nf90_get_att_one_EightByteInt
|
||||
|
||||
integer, dimension(1) :: defaultInteger
|
||||
|
||||
nf90_get_att_one_EightByteInt = nf_get_att_int(ncid, varid, name, defaultInteger)
|
||||
values = defaultInteger(1)
|
||||
end function nf90_get_att_one_EightByteInt
|
||||
! -------
|
||||
! Real attributes
|
||||
! -------
|
||||
function nf90_put_att_FourByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = FourByteReal), dimension(:), intent( in) :: values
|
||||
integer :: nf90_put_att_FourByteReal
|
||||
|
||||
nf90_put_att_FourByteReal = nf_put_att_real(ncid, varid, name, nf90_real4, size(values), values)
|
||||
end function nf90_put_att_FourByteReal
|
||||
! -------
|
||||
function nf90_put_att_one_FourByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = FourByteReal), intent( in) :: values
|
||||
integer :: nf90_put_att_one_FourByteReal
|
||||
|
||||
real (kind = FourByteReal), dimension(1) :: valuesA
|
||||
valuesA(1) = values
|
||||
nf90_put_att_one_FourByteReal = nf_put_att_real(ncid, varid, name, nf90_real4, 1, valuesA)
|
||||
end function nf90_put_att_one_FourByteReal
|
||||
! -------
|
||||
function nf90_get_att_FourByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = FourByteReal), dimension(:), intent(out) :: values
|
||||
integer :: nf90_get_att_FourByteReal
|
||||
|
||||
nf90_get_att_FourByteReal = nf_get_att_real(ncid, varid, name, values)
|
||||
end function nf90_get_att_FourByteReal
|
||||
! -------
|
||||
function nf90_get_att_one_FourByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = FourByteReal), intent(out) :: values
|
||||
integer :: nf90_get_att_one_FourByteReal
|
||||
|
||||
real (kind = FourByteReal), dimension(1) :: valuesA
|
||||
nf90_get_att_one_FourByteReal = nf_get_att_real(ncid, varid, name, valuesA)
|
||||
values = valuesA(1)
|
||||
end function nf90_get_att_one_FourByteReal
|
||||
! -------
|
||||
function nf90_put_att_EightByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = EightByteReal), dimension(:), intent( in) :: values
|
||||
integer :: nf90_put_att_EightByteReal
|
||||
|
||||
nf90_put_att_EightByteReal = nf_put_att_double(ncid, varid, name, nf90_real8, size(values), values)
|
||||
end function nf90_put_att_EightByteReal
|
||||
! -------
|
||||
function nf90_put_att_one_EightByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = EightByteReal), intent( in) :: values
|
||||
integer :: nf90_put_att_one_EightByteReal
|
||||
|
||||
real (kind = EightByteReal), dimension(1) :: valuesA
|
||||
valuesA(1) = values
|
||||
nf90_put_att_one_EightByteReal = nf_put_att_double(ncid, varid, name, nf90_real8, 1, valuesA)
|
||||
end function nf90_put_att_one_EightByteReal
|
||||
! -------
|
||||
function nf90_get_att_EightByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = EightByteReal), dimension(:), intent(out) :: values
|
||||
integer :: nf90_get_att_EightByteReal
|
||||
|
||||
nf90_get_att_EightByteReal = nf_get_att_double(ncid, varid, name, values)
|
||||
end function nf90_get_att_EightByteReal
|
||||
! -------
|
||||
function nf90_get_att_one_EightByteReal(ncid, varid, name, values)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character(len = *), intent( in) :: name
|
||||
real (kind = EightByteReal), intent(out) :: values
|
||||
integer :: nf90_get_att_one_EightByteReal
|
||||
|
||||
real (kind = EightByteReal), dimension(1) :: valuesA
|
||||
nf90_get_att_one_EightByteReal = nf_get_att_double(ncid, varid, name, valuesA)
|
||||
values = valuesA(1)
|
||||
end function nf90_get_att_one_EightByteReal
|
||||
! -------
|
128
f90/netcdf_constants.f90
Normal file
128
f90/netcdf_constants.f90
Normal file
@ -0,0 +1,128 @@
|
||||
!
|
||||
! external netcdf data types:
|
||||
!
|
||||
integer, parameter, public :: &
|
||||
nf90_byte = 1, &
|
||||
nf90_int1 = nf90_byte, &
|
||||
nf90_char = 2, &
|
||||
nf90_short = 3, &
|
||||
nf90_int2 = nf90_short, &
|
||||
nf90_int = 4, &
|
||||
nf90_int4 = nf90_int, &
|
||||
nf90_float = 5, &
|
||||
nf90_real = nf90_float, &
|
||||
nf90_real4 = nf90_float, &
|
||||
nf90_double = 6, &
|
||||
nf90_real8 = nf90_double
|
||||
|
||||
!
|
||||
! default fill values:
|
||||
!
|
||||
character (len = 1), parameter, public :: &
|
||||
nf90_fill_char = achar(0)
|
||||
integer (kind = OneByteInt), parameter, public :: &
|
||||
nf90_fill_byte = -127, &
|
||||
nf90_fill_int1 = nf90_fill_byte
|
||||
integer (kind = TwoByteInt), parameter, public :: &
|
||||
nf90_fill_short = -32767, &
|
||||
nf90_fill_int2 = nf90_fill_short
|
||||
integer (kind = FourByteInt), parameter, public :: &
|
||||
nf90_fill_int = -2147483647
|
||||
real (kind = FourByteReal), parameter, public :: &
|
||||
nf90_fill_float = 9.9692099683868690e+36, &
|
||||
nf90_fill_real = nf90_fill_float, &
|
||||
nf90_fill_real4 = nf90_fill_float
|
||||
real (kind = EightByteReal), parameter, public :: &
|
||||
nf90_fill_double = 9.9692099683868690e+36, &
|
||||
nf90_fill_real8 = nf90_fill_double
|
||||
|
||||
!
|
||||
! mode flags for opening and creating a netcdf dataset:
|
||||
!
|
||||
integer, parameter, public :: &
|
||||
nf90_nowrite = 0, &
|
||||
nf90_write = 1, &
|
||||
nf90_clobber = 0, &
|
||||
nf90_noclobber = 4, &
|
||||
nf90_fill = 0, &
|
||||
nf90_nofill = 256, &
|
||||
nf90_64bit_offset = 512, &
|
||||
nf90_lock = 1024, &
|
||||
nf90_share = 2048
|
||||
|
||||
integer, parameter, public :: &
|
||||
nf90_sizehint_default = 0, &
|
||||
nf90_align_chunk = -1
|
||||
|
||||
!
|
||||
! size argument for defining an unlimited dimension:
|
||||
!
|
||||
integer, parameter, public :: nf90_unlimited = 0
|
||||
|
||||
!
|
||||
! global attribute id:
|
||||
!
|
||||
integer, parameter, public :: nf90_global = 0
|
||||
|
||||
!
|
||||
! implementation limits:
|
||||
!
|
||||
integer, parameter, public :: &
|
||||
nf90_max_dims = 1024, &
|
||||
nf90_max_attrs = 8192, &
|
||||
nf90_max_vars = 8192, &
|
||||
nf90_max_name = 256, &
|
||||
nf90_max_var_dims = nf90_max_dims
|
||||
|
||||
!
|
||||
! error codes:
|
||||
!
|
||||
integer, parameter, public :: &
|
||||
nf90_noerr = 0, &
|
||||
nf90_ebadid = -33, &
|
||||
nf90_eexist = -35, &
|
||||
nf90_einval = -36, &
|
||||
nf90_eperm = -37, &
|
||||
nf90_enotindefine = -38, &
|
||||
nf90_eindefine = -39, &
|
||||
nf90_einvalcoords = -40, &
|
||||
nf90_emaxdims = -41, &
|
||||
nf90_enameinuse = -42, &
|
||||
nf90_enotatt = -43, &
|
||||
nf90_emaxatts = -44, &
|
||||
nf90_ebadtype = -45, &
|
||||
nf90_ebaddim = -46, &
|
||||
nf90_eunlimpos = -47, &
|
||||
nf90_emaxvars = -48, &
|
||||
nf90_enotvar = -49, &
|
||||
nf90_eglobal = -50, &
|
||||
nf90_enotnc = -51, &
|
||||
nf90_ests = -52, &
|
||||
nf90_emaxname = -53, &
|
||||
nf90_eunlimit = -54, &
|
||||
nf90_enorecvars = -55, &
|
||||
nf90_echar = -56, &
|
||||
nf90_eedge = -57, &
|
||||
nf90_estride = -58, &
|
||||
nf90_ebadname = -59, &
|
||||
nf90_erange = -60, &
|
||||
nf90_enomem = -61, &
|
||||
nf90_evarsize = -62, &
|
||||
nf90_edimsize = -63, &
|
||||
nf90_etrunc = -64
|
||||
|
||||
!
|
||||
! error handling modes:
|
||||
!
|
||||
integer, parameter, public :: &
|
||||
nf90_fatal = 1, &
|
||||
nf90_verbose = 2
|
||||
|
||||
!
|
||||
! format version numbers:
|
||||
!
|
||||
integer, parameter, public :: &
|
||||
nf90_format_classic = 1, &
|
||||
nf90_format_64bit = 2, &
|
||||
nf90_format_netcdf4 = 3, &
|
||||
nf90_format_netcdf4_classic = 4
|
46
f90/netcdf_dims.f90
Normal file
46
f90/netcdf_dims.f90
Normal file
@ -0,0 +1,46 @@
|
||||
!
|
||||
! Dimension routines:
|
||||
!
|
||||
! -----------
|
||||
function nf90_def_dim(ncid, name, len, dimid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent( in) :: len
|
||||
integer, intent(out) :: dimid
|
||||
integer :: nf90_def_dim
|
||||
|
||||
nf90_def_dim = nf_def_dim(ncid, name, len, dimid)
|
||||
end function nf90_def_dim
|
||||
! -----------
|
||||
function nf90_inq_dimid(ncid, name, dimid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent(out) :: dimid
|
||||
integer :: nf90_inq_dimid
|
||||
|
||||
nf90_inq_dimid = nf_inq_dimid(ncid, name, dimid)
|
||||
end function nf90_inq_dimid
|
||||
! -----------
|
||||
function nf90_rename_dim(ncid, dimid, name)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent( in) :: dimid
|
||||
integer :: nf90_rename_dim
|
||||
|
||||
nf90_rename_dim = nf_rename_dim(ncid, dimid, name)
|
||||
end function nf90_rename_dim
|
||||
! -----------
|
||||
function nf90_inquire_dimension(ncid, dimid, name, len)
|
||||
integer, intent( in) :: ncid, dimid
|
||||
character (len = *), optional, intent(out) :: name
|
||||
integer, optional, intent(out) :: len
|
||||
integer :: nf90_inquire_dimension
|
||||
|
||||
character (len = nf90_max_name) :: dimName
|
||||
integer :: length
|
||||
|
||||
nf90_inquire_dimension = nf_inq_dim(ncid, dimid, dimName, length)
|
||||
if(present(name)) name = trim(dimName)
|
||||
if(present(len )) len = length
|
||||
end function nf90_inquire_dimension
|
||||
! -----------
|
540
f90/netcdf_eightbyte.f90
Normal file
540
f90/netcdf_eightbyte.f90
Normal file
@ -0,0 +1,540 @@
|
||||
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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_1D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_1D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_1D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_2D_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_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_2D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_2D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_3D_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_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_3D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_3D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_3D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_4D_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_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_4D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_4D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_4D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_5D_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_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_5D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_5D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_5D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_6D_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_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_6D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_6D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_6D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_7D_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_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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_7D_EightByteInt = &
|
||||
nf_put_varm_int(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_vars_int(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
nf90_put_var_7D_EightByteInt = &
|
||||
nf_put_vara_int(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function nf90_put_var_7D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_1D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_1D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_1D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_1D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_2D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_2D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_2D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_2D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_3D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_3D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_3D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_3D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_4D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_4D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_4D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_4D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_5D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :, :), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_5D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_5D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_5D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_6D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :, :, :), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_6D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_6D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_6D_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_7D_EightByteInt(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), dimension(:, :, :, :, :, :, :), &
|
||||
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
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_get_var_7D_EightByteInt = &
|
||||
nf_get_varm_int(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_vars_int(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
nf90_get_var_7D_EightByteInt = &
|
||||
nf_get_vara_int(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(:, :, :, :, :, :, :) = reshape(defaultIntArray(:), shape(values))
|
||||
end function nf90_get_var_7D_EightByteInt
|
||||
|
||||
|
||||
function nf90_put_var_EightByteInt(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
integer (kind = EightByteInt), intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start
|
||||
integer :: nf90_put_var_EightByteInt
|
||||
|
||||
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_put_var_EightByteInt = nf_put_var1_int(ncid, varid, localIndex, int(values))
|
||||
end function nf90_put_var_EightByteInt
|
||||
|
||||
|
||||
function nf90_get_var_EightByteInt(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
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 :: counter
|
||||
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
|
||||
|
||||
|
2643
f90/netcdf_expanded.f90
Normal file
2643
f90/netcdf_expanded.f90
Normal file
File diff suppressed because it is too large
Load Diff
46
f90/netcdf_externals.f90
Normal file
46
f90/netcdf_externals.f90
Normal file
@ -0,0 +1,46 @@
|
||||
character (len = 80), external :: nf_inq_libvers, nf_strerror
|
||||
! Control routines
|
||||
integer, external :: nf_open, nf__open, nf_create, nf__create, &
|
||||
nf_enddef, nf__enddef, nf_set_fill, nf_redef, &
|
||||
nf_sync, nf_abort, nf_close, &
|
||||
! These are used only in undocumented functions
|
||||
nf_set_base_pe, nf_inq_base_pe, &
|
||||
nf__create_mp, nf__open_mp, nf_delete, &
|
||||
nf_inq_format
|
||||
! File level inquiry
|
||||
integer, external :: nf_inq
|
||||
|
||||
! Dimension routines nf_inq_dim
|
||||
integer, external :: nf_def_dim, nf_inq_dimid, nf_rename_dim, nf_inq_dim
|
||||
|
||||
! Attribute routines
|
||||
integer, external :: nf_copy_att, nf_rename_att, nf_del_att, &
|
||||
nf_inq_att, nf_inq_attid, nf_inq_attname
|
||||
integer, external :: nf_put_att_text, nf_get_att_text, &
|
||||
nf_put_att_int1, nf_put_att_int2, nf_put_att_int, &
|
||||
nf_get_att_int1, nf_get_att_int2, nf_get_att_int, &
|
||||
nf_put_att_real, nf_get_att_real, &
|
||||
nf_put_att_double, nf_get_att_double
|
||||
|
||||
! Variable routines
|
||||
integer, external :: nf_def_var, nf_inq_varid, nf_inq_var, nf_rename_var
|
||||
integer, external :: nf_put_var1_text, nf_get_var1_text, &
|
||||
nf_put_var1_int1, nf_put_var1_int2, nf_put_var1_int, &
|
||||
nf_get_var1_int1, nf_get_var1_int2, nf_get_var1_int, &
|
||||
nf_put_var1_real, nf_get_var1_real, &
|
||||
nf_put_var1_double, nf_get_var1_double
|
||||
integer, external :: nf_put_vars_text, nf_get_vars_text, &
|
||||
nf_put_vars_int1, nf_put_vars_int2, nf_put_vars_int, &
|
||||
nf_get_vars_int1, nf_get_vars_int2, nf_get_vars_int, &
|
||||
nf_put_vars_real, nf_get_vars_real, &
|
||||
nf_put_vars_double, nf_get_vars_double
|
||||
integer, external :: nf_put_vara_text, nf_get_vara_text, &
|
||||
nf_put_vara_int1, nf_put_vara_int2, nf_put_vara_int, &
|
||||
nf_get_vara_int1, nf_get_vara_int2, nf_get_vara_int, &
|
||||
nf_put_vara_real, nf_get_vara_real, &
|
||||
nf_put_vara_double, nf_get_vara_double
|
||||
integer, external :: nf_put_varm_text, nf_get_varm_text, &
|
||||
nf_put_varm_int1, nf_put_varm_int2, nf_put_varm_int, &
|
||||
nf_get_varm_int1, nf_get_varm_int2, nf_get_varm_int, &
|
||||
nf_put_varm_real, nf_get_varm_real, &
|
||||
nf_put_varm_double, nf_get_varm_double
|
1013
f90/netcdf_f90.3
Normal file
1013
f90/netcdf_f90.3
Normal file
File diff suppressed because it is too large
Load Diff
137
f90/netcdf_file.f90
Normal file
137
f90/netcdf_file.f90
Normal file
@ -0,0 +1,137 @@
|
||||
! -------
|
||||
function nf90_inq_libvers()
|
||||
character(len = 80) :: nf90_inq_libvers
|
||||
|
||||
nf90_inq_libvers = nf_inq_libvers()
|
||||
end function nf90_inq_libvers
|
||||
! -------
|
||||
function nf90_strerror(ncerr)
|
||||
integer, intent( in) :: ncerr
|
||||
character(len = 80) :: nf90_strerror
|
||||
|
||||
nf90_strerror = nf_strerror(ncerr)
|
||||
end function nf90_strerror
|
||||
! -------
|
||||
!
|
||||
! File level control routines:
|
||||
!
|
||||
function nf90_inq_base_pe(ncid, pe)
|
||||
integer, intent( in) :: ncid
|
||||
integer, intent(out) :: pe
|
||||
integer :: nf90_inq_base_pe
|
||||
|
||||
nf90_inq_base_pe = nf_inq_base_pe(ncid, pe)
|
||||
end function nf90_inq_base_pe
|
||||
! -------
|
||||
function nf90_set_base_pe(ncid, pe)
|
||||
integer, intent( in) :: ncid, pe
|
||||
integer :: nf90_set_base_pe
|
||||
|
||||
nf90_set_base_pe = nf_set_base_pe(ncid, pe)
|
||||
end function nf90_set_base_pe
|
||||
! -------
|
||||
function nf90_create_mp(path, cmode, initalsz, basepe, chunksizehint, ncid)
|
||||
character (len = *), intent( in) :: path
|
||||
integer, intent( in) :: cmode, initalsz, basepe, chunksizehint
|
||||
integer, intent(out) :: ncid
|
||||
integer :: nf90_create_mp
|
||||
|
||||
nf90_create_mp = nf__create_mp(path, cmode, initalsz, basepe, chunksizehint, ncid)
|
||||
end function nf90_create_mp
|
||||
! -------
|
||||
function nf90_open_mp(path, mode, basepe, chunksizeint, ncid)
|
||||
character (len = *), intent( in) :: path
|
||||
integer, intent( in) :: mode, basepe, chunksizeint
|
||||
integer, intent(out) :: ncid
|
||||
integer :: nf90_open_mp
|
||||
|
||||
nf90_open_mp = nf__open_mp(path, mode, basepe, chunksizeint, ncid)
|
||||
end function nf90_open_mp
|
||||
! -------
|
||||
function nf90_set_fill(ncid, fillmode, old_mode)
|
||||
integer, intent( in) :: ncid, fillmode
|
||||
integer, intent(out) :: old_mode
|
||||
integer :: nf90_set_fill
|
||||
|
||||
nf90_set_fill = nf_set_fill(ncid, fillmode, old_mode)
|
||||
end function nf90_set_fill
|
||||
! -------
|
||||
function nf90_redef(ncid)
|
||||
integer, intent( in) :: ncid
|
||||
integer :: nf90_redef
|
||||
|
||||
nf90_redef = nf_redef(ncid)
|
||||
end function nf90_redef
|
||||
! -------
|
||||
function nf90_enddef(ncid, h_minfree, v_align, v_minfree, r_align)
|
||||
integer, intent( in) :: ncid
|
||||
integer, optional, intent( in) :: h_minfree, v_align, v_minfree, r_align
|
||||
integer :: nf90_enddef
|
||||
|
||||
integer :: hMinFree, VAlign, VMinFree, RAlign
|
||||
|
||||
if(.not. any( (/ present(h_minfree), present(v_align), &
|
||||
present(v_minfree), present(r_align) /) ) )then
|
||||
nf90_enddef = nf_enddef(ncid)
|
||||
else
|
||||
! Default values per the man page
|
||||
hMinFree = 0; VMinFree = 0
|
||||
VAlign = 4; RAlign = 4
|
||||
if(present(h_minfree)) HMinFree = h_minfree
|
||||
if(present(v_align )) VAlign = v_align
|
||||
if(present(v_minfree)) VMinFree = v_minfree
|
||||
if(present(r_align )) RAlign = r_align
|
||||
nf90_enddef = nf__enddef(ncid, hMinFree, VAlign, VMinFree, RAlign)
|
||||
end if
|
||||
end function nf90_enddef
|
||||
! -------
|
||||
function nf90_sync(ncid)
|
||||
integer, intent( in) :: ncid
|
||||
integer :: nf90_sync
|
||||
|
||||
nf90_sync = nf_sync(ncid)
|
||||
end function nf90_sync
|
||||
! -------
|
||||
function nf90_abort(ncid)
|
||||
integer, intent( in) :: ncid
|
||||
integer :: nf90_abort
|
||||
|
||||
nf90_abort = nf_abort(ncid)
|
||||
end function nf90_abort
|
||||
! -------
|
||||
function nf90_close(ncid)
|
||||
integer, intent( in) :: ncid
|
||||
integer :: nf90_close
|
||||
|
||||
nf90_close = nf_close(ncid)
|
||||
end function nf90_close
|
||||
! -------
|
||||
function nf90_delete(name)
|
||||
character(len = *), intent( in) :: name
|
||||
integer :: nf90_delete
|
||||
|
||||
nf90_delete = nf_delete(name)
|
||||
end function nf90_delete
|
||||
|
||||
!
|
||||
! A single file level inquiry routine
|
||||
!
|
||||
function nf90_inquire(ncid, nDimensions, nVariables, nAttributes, unlimitedDimId, formatNum)
|
||||
integer, intent( in) :: ncid
|
||||
integer, optional, intent(out) :: nDimensions, nVariables, nAttributes, unlimitedDimId, formatNum
|
||||
integer :: nf90_inquire
|
||||
|
||||
integer :: nDims, nVars, nGAtts, unlimDimId, frmt
|
||||
|
||||
nf90_inquire = nf_inq(ncid, nDims, nVars, nGAtts, unlimDimId)
|
||||
if(present(nDimensions)) nDimensions = nDims
|
||||
if(present(nVariables)) nVariables = nVars
|
||||
if(present(nAttributes)) nAttributes = nGAtts
|
||||
if(present(unlimitedDimId)) unlimitedDimId = unlimDimId
|
||||
if(present(formatNum)) then
|
||||
nf90_inquire = nf_inq_format(ncid, frmt)
|
||||
formatNum = frmt
|
||||
endif
|
||||
end function nf90_inquire
|
||||
|
||||
|
95
f90/netcdf_overloads.f90
Normal file
95
f90/netcdf_overloads.f90
Normal file
@ -0,0 +1,95 @@
|
||||
! Overloaded variable functions
|
||||
interface nf90_def_var
|
||||
module procedure nf90_def_var_Scalar, nf90_def_var_oneDim, nf90_def_var_ManyDims
|
||||
end interface ! nf90_def_var
|
||||
|
||||
! Overloaded attribute functions
|
||||
interface nf90_put_att
|
||||
module procedure nf90_put_att_text, &
|
||||
nf90_put_att_OneByteInt, nf90_put_att_TwoByteInt, &
|
||||
nf90_put_att_FourByteInt, nf90_put_att_EightByteInt, &
|
||||
nf90_put_att_FourByteReal, nf90_put_att_EightByteReal
|
||||
module procedure nf90_put_att_one_OneByteInt, nf90_put_att_one_TwoByteInt, &
|
||||
nf90_put_att_one_FourByteInt, nf90_put_att_one_EightByteInt, &
|
||||
nf90_put_att_one_FourByteReal, nf90_put_att_one_EightByteReal
|
||||
end interface !nf90_put_att
|
||||
interface nf90_get_att
|
||||
module procedure nf90_get_att_text, &
|
||||
nf90_get_att_OneByteInt, nf90_get_att_TwoByteInt, &
|
||||
nf90_get_att_FourByteInt, nf90_get_att_EightByteInt, &
|
||||
nf90_get_att_FourByteReal, nf90_get_att_EightByteReal
|
||||
module procedure nf90_get_att_one_OneByteInt, nf90_get_att_one_TwoByteInt, &
|
||||
nf90_get_att_one_FourByteInt, nf90_get_att_one_EightByteInt, &
|
||||
nf90_get_att_one_FourByteReal, nf90_get_att_one_EightByteReal
|
||||
end interface ! nf90_get_att
|
||||
|
||||
! Overloaded variable functions
|
||||
interface nf90_put_var
|
||||
module procedure nf90_put_var_text, &
|
||||
nf90_put_var_OneByteInt, nf90_put_var_TwoByteInt, &
|
||||
nf90_put_var_FourByteInt, nf90_put_var_EightByteInt, &
|
||||
nf90_put_var_FourByteReal, nf90_put_var_EightByteReal
|
||||
module procedure nf90_put_var_1D_text, &
|
||||
nf90_put_var_1D_OneByteInt, nf90_put_var_1D_TwoByteInt, &
|
||||
nf90_put_var_1D_FourByteInt, nf90_put_var_1D_EightByteInt, &
|
||||
nf90_put_var_1D_FourByteReal, nf90_put_var_1D_EightByteReal
|
||||
module procedure nf90_put_var_2D_text, &
|
||||
nf90_put_var_2D_OneByteInt, nf90_put_var_2D_TwoByteInt, &
|
||||
nf90_put_var_2D_FourByteInt, nf90_put_var_2D_EightByteInt, &
|
||||
nf90_put_var_2D_FourByteReal, nf90_put_var_2D_EightByteReal
|
||||
module procedure nf90_put_var_3D_text, &
|
||||
nf90_put_var_3D_OneByteInt, nf90_put_var_3D_TwoByteInt, &
|
||||
nf90_put_var_3D_FourByteInt, nf90_put_var_3D_EightByteInt, &
|
||||
nf90_put_var_3D_FourByteReal, nf90_put_var_3D_EightByteReal
|
||||
module procedure nf90_put_var_4D_text, &
|
||||
nf90_put_var_4D_OneByteInt, nf90_put_var_4D_TwoByteInt, &
|
||||
nf90_put_var_4D_FourByteInt, nf90_put_var_4D_EightByteInt, &
|
||||
nf90_put_var_4D_FourByteReal, nf90_put_var_4D_EightByteReal
|
||||
module procedure nf90_put_var_5D_text, &
|
||||
nf90_put_var_5D_OneByteInt, nf90_put_var_5D_TwoByteInt, &
|
||||
nf90_put_var_5D_FourByteInt, nf90_put_var_5D_EightByteInt, &
|
||||
nf90_put_var_5D_FourByteReal, nf90_put_var_5D_EightByteReal
|
||||
module procedure nf90_put_var_6D_text, &
|
||||
nf90_put_var_6D_OneByteInt, nf90_put_var_6D_TwoByteInt, &
|
||||
nf90_put_var_6D_FourByteInt, nf90_put_var_6D_EightByteInt, &
|
||||
nf90_put_var_6D_FourByteReal, nf90_put_var_6D_EightByteReal
|
||||
module procedure nf90_put_var_7D_text, &
|
||||
nf90_put_var_7D_OneByteInt, nf90_put_var_7D_TwoByteInt, &
|
||||
nf90_put_var_7D_FourByteInt, nf90_put_var_7D_EightByteInt, &
|
||||
nf90_put_var_7D_FourByteReal, nf90_put_var_7D_EightByteReal
|
||||
end interface ! nf90_put_var
|
||||
|
||||
interface nf90_get_var
|
||||
module procedure nf90_get_var_text, &
|
||||
nf90_get_var_OneByteInt, nf90_get_var_TwoByteInt, &
|
||||
nf90_get_var_FourByteInt, nf90_get_var_EightByteInt, &
|
||||
nf90_get_var_FourByteReal, nf90_get_var_EightByteReal
|
||||
module procedure nf90_get_var_1D_text, &
|
||||
nf90_get_var_1D_OneByteInt, nf90_get_var_1D_TwoByteInt, &
|
||||
nf90_get_var_1D_FourByteInt, nf90_get_var_1D_EightByteInt, &
|
||||
nf90_get_var_1D_FourByteReal, nf90_get_var_1D_EightByteReal
|
||||
module procedure nf90_get_var_2D_text, &
|
||||
nf90_get_var_2D_OneByteInt, nf90_get_var_2D_TwoByteInt, &
|
||||
nf90_get_var_2D_FourByteInt, nf90_get_var_2D_EightByteInt, &
|
||||
nf90_get_var_2D_FourByteReal, nf90_get_var_2D_EightByteReal
|
||||
module procedure nf90_get_var_3D_text, &
|
||||
nf90_get_var_3D_OneByteInt, nf90_get_var_3D_TwoByteInt, &
|
||||
nf90_get_var_3D_FourByteInt, nf90_get_var_3D_EightByteInt, &
|
||||
nf90_get_var_3D_FourByteReal, nf90_get_var_3D_EightByteReal
|
||||
module procedure nf90_get_var_4D_text, &
|
||||
nf90_get_var_4D_OneByteInt, nf90_get_var_4D_TwoByteInt, &
|
||||
nf90_get_var_4D_FourByteInt, nf90_get_var_4D_EightByteInt, &
|
||||
nf90_get_var_4D_FourByteReal, nf90_get_var_4D_EightByteReal
|
||||
module procedure nf90_get_var_5D_text, &
|
||||
nf90_get_var_5D_OneByteInt, nf90_get_var_5D_TwoByteInt, &
|
||||
nf90_get_var_5D_FourByteInt, nf90_get_var_5D_EightByteInt, &
|
||||
nf90_get_var_5D_FourByteReal, nf90_get_var_5D_EightByteReal
|
||||
module procedure nf90_get_var_6D_text, &
|
||||
nf90_get_var_6D_OneByteInt, nf90_get_var_6D_TwoByteInt, &
|
||||
nf90_get_var_6D_FourByteInt, nf90_get_var_6D_EightByteInt, &
|
||||
nf90_get_var_6D_FourByteReal, nf90_get_var_6D_EightByteReal
|
||||
module procedure nf90_get_var_7D_text, &
|
||||
nf90_get_var_7D_OneByteInt, nf90_get_var_7D_TwoByteInt, &
|
||||
nf90_get_var_7D_FourByteInt, nf90_get_var_7D_EightByteInt, &
|
||||
nf90_get_var_7D_FourByteReal, nf90_get_var_7D_EightByteReal
|
||||
end interface ! nf90_get_var
|
489
f90/netcdf_text_variables.f90
Normal file
489
f90/netcdf_text_variables.f90
Normal file
@ -0,0 +1,489 @@
|
||||
function nf90_put_var_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_text
|
||||
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (:) = 1
|
||||
localCount (1) = len(values); localCount (2:) = 1
|
||||
localStride(:) = 1
|
||||
|
||||
if(present(start)) localStart (:size(start) ) = start(:)
|
||||
if(present(count)) localCount (:size(count) ) = count(:)
|
||||
if(present(stride)) localStride(:size(stride)) = stride(:)
|
||||
|
||||
nf90_put_var_text = nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values)
|
||||
end function nf90_put_var_text
|
||||
|
||||
function nf90_get_var_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_text
|
||||
|
||||
integer, dimension(nf90_max_var_dims) :: localIndex, textDimIDs
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride
|
||||
integer :: counter, stringLength
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (:) = 1
|
||||
localCount (1) = len(values); localCount (2:) = 1
|
||||
localStride(:) = 1
|
||||
|
||||
if(present(start)) localStart (:size(start) ) = start(:)
|
||||
if(present(count)) localCount (:size(count) ) = count(:)
|
||||
if(present(stride)) localStride(:size(stride)) = stride(:)
|
||||
|
||||
nf90_get_var_text = nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values)
|
||||
end function nf90_get_var_text
|
||||
|
||||
|
||||
function nf90_put_var_1D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_1D_text
|
||||
|
||||
integer, parameter :: numDims = 1
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_1D_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1))
|
||||
else
|
||||
nf90_put_var_1D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1))
|
||||
end if
|
||||
end function nf90_put_var_1D_text
|
||||
|
||||
|
||||
function nf90_put_var_2D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_2D_text
|
||||
|
||||
integer, parameter :: numDims = 2
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1))
|
||||
else
|
||||
nf90_put_var_2D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1))
|
||||
end if
|
||||
end function nf90_put_var_2D_text
|
||||
|
||||
|
||||
function nf90_put_var_3D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_3D_text
|
||||
|
||||
integer, parameter :: numDims = 3
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_3D_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1))
|
||||
else
|
||||
nf90_put_var_3D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1))
|
||||
end if
|
||||
end function nf90_put_var_3D_text
|
||||
|
||||
|
||||
function nf90_put_var_4D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_4D_text
|
||||
|
||||
integer, parameter :: numDims = 4
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_4D_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1))
|
||||
else
|
||||
nf90_put_var_4D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1))
|
||||
end if
|
||||
end function nf90_put_var_4D_text
|
||||
|
||||
|
||||
function nf90_put_var_5D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :, :), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_5D_text
|
||||
|
||||
integer, parameter :: numDims = 5
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_5D_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1,1))
|
||||
else
|
||||
nf90_put_var_5D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1,1))
|
||||
end if
|
||||
end function nf90_put_var_5D_text
|
||||
|
||||
|
||||
function nf90_put_var_6D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :, :, :), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_6D_text
|
||||
|
||||
integer, parameter :: numDims = 6
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_6D_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1,1,1))
|
||||
else
|
||||
nf90_put_var_6D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1,1,1))
|
||||
end if
|
||||
end function nf90_put_var_6D_text
|
||||
|
||||
|
||||
function nf90_put_var_7D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :, :, :, :), &
|
||||
intent( in) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_put_var_7D_text
|
||||
|
||||
integer, parameter :: numDims = 7
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount ( :numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_7D_text = &
|
||||
nf_put_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1,1,1,1))
|
||||
else
|
||||
nf90_put_var_7D_text = &
|
||||
nf_put_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1,1,1,1))
|
||||
end if
|
||||
end function nf90_put_var_7D_text
|
||||
|
||||
|
||||
function nf90_get_var_1D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_1D_text
|
||||
|
||||
integer, parameter :: numDims = 1
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
localStride(: ) = 1
|
||||
localMap (: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_get_var_1D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1))
|
||||
else
|
||||
nf90_get_var_1D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1))
|
||||
end if
|
||||
end function nf90_get_var_1D_text
|
||||
|
||||
|
||||
function nf90_get_var_2D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_2D_text
|
||||
|
||||
integer, parameter :: numDims = 2
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_get_var_2D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1))
|
||||
else
|
||||
nf90_get_var_2D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1))
|
||||
end if
|
||||
end function nf90_get_var_2D_text
|
||||
|
||||
|
||||
function nf90_get_var_3D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_3D_text
|
||||
|
||||
integer, parameter :: numDims = 3
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_get_var_3D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1))
|
||||
else
|
||||
nf90_get_var_3D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1))
|
||||
end if
|
||||
end function nf90_get_var_3D_text
|
||||
|
||||
|
||||
function nf90_get_var_4D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_4D_text
|
||||
|
||||
integer, parameter :: numDims = 4
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_get_var_4D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1))
|
||||
else
|
||||
nf90_get_var_4D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1))
|
||||
end if
|
||||
end function nf90_get_var_4D_text
|
||||
|
||||
|
||||
function nf90_get_var_5D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :, :), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_5D_text
|
||||
|
||||
integer, parameter :: numDims = 5
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_get_var_5D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1,1))
|
||||
else
|
||||
nf90_get_var_5D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1,1))
|
||||
end if
|
||||
end function nf90_get_var_5D_text
|
||||
|
||||
|
||||
function nf90_get_var_6D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :, :, :), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_6D_text
|
||||
|
||||
integer, parameter :: numDims = 6
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_get_var_6D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1,1,1))
|
||||
else
|
||||
nf90_get_var_6D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1,1,1))
|
||||
end if
|
||||
end function nf90_get_var_6D_text
|
||||
|
||||
|
||||
function nf90_get_var_7D_text(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), dimension(:, :, :, :, :, :, :), &
|
||||
intent(out) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: nf90_get_var_7D_text
|
||||
|
||||
integer, parameter :: numDims = 7
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: counter
|
||||
|
||||
! Set local arguments to default values
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims+1) = (/ len(values(1, 1, 1, 1, 1, 1, 1)), shape(values) /)
|
||||
localCount (numDims+2:) = 0
|
||||
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_get_var_7D_text = &
|
||||
nf_get_varm_text(ncid, varid, localStart, localCount, localStride, localMap, values(1,1,1,1,1,1,1))
|
||||
else
|
||||
nf90_get_var_7D_text = &
|
||||
nf_get_vars_text(ncid, varid, localStart, localCount, localStride, values(1,1,1,1,1,1,1))
|
||||
end if
|
||||
end function nf90_get_var_7D_text
|
88
f90/netcdf_variables.f90
Normal file
88
f90/netcdf_variables.f90
Normal file
@ -0,0 +1,88 @@
|
||||
! -----
|
||||
! Variable definitions and inquiry
|
||||
! -----
|
||||
function nf90_def_var_Scalar(ncid, name, xtype, varid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent( in) :: xtype
|
||||
integer, intent(out) :: varid
|
||||
integer :: nf90_def_var_Scalar
|
||||
|
||||
! Dummy - shouldn't get used
|
||||
integer, dimension(1) :: dimids
|
||||
|
||||
nf90_def_var_Scalar = nf_def_var(ncid, name, xtype, 0, dimids, varid)
|
||||
end function nf90_def_var_Scalar
|
||||
! -----
|
||||
function nf90_def_var_oneDim(ncid, name, xtype, dimids, varid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent( in) :: xtype
|
||||
integer, intent( in) :: dimids
|
||||
integer, intent(out) :: varid
|
||||
integer :: nf90_def_var_oneDim
|
||||
|
||||
integer, dimension(1) :: dimidsA
|
||||
dimidsA(1) = dimids
|
||||
nf90_def_var_oneDim = nf_def_var(ncid, name, xtype, 1, dimidsA, varid)
|
||||
end function nf90_def_var_oneDim
|
||||
! -----
|
||||
function nf90_def_var_ManyDims(ncid, name, xtype, dimids, varid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent( in) :: xtype
|
||||
integer, dimension(:), intent( in) :: dimids
|
||||
integer, intent(out) :: varid
|
||||
integer :: nf90_def_var_ManyDims
|
||||
|
||||
nf90_def_var_ManyDims = nf_def_var(ncid, name, xtype, size(dimids), dimids, varid)
|
||||
end function nf90_def_var_ManyDims
|
||||
! -----
|
||||
function nf90_inq_varid(ncid, name, varid)
|
||||
integer, intent( in) :: ncid
|
||||
character (len = *), intent( in) :: name
|
||||
integer, intent(out) :: varid
|
||||
integer :: nf90_inq_varid
|
||||
|
||||
nf90_inq_varid = nf_inq_varid(ncid, name, varid)
|
||||
end function nf90_inq_varid
|
||||
! -----
|
||||
function nf90_inquire_variable(ncid, varid, name, xtype, ndims, dimids, nAtts)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), optional, intent(out) :: name
|
||||
integer, optional, intent(out) :: xtype, ndims
|
||||
integer, dimension(:), optional, intent(out) :: dimids
|
||||
integer, optional, intent(out) :: nAtts
|
||||
integer :: nf90_inquire_variable
|
||||
|
||||
! Local variables
|
||||
character (len = nf90_max_name) :: varName
|
||||
integer :: externalType, numDimensions
|
||||
integer, dimension(nf90_max_var_dims) :: dimensionIDs
|
||||
integer :: numAttributes
|
||||
|
||||
nf90_inquire_variable = nf_inq_var(ncid, varid, varName, externalType, &
|
||||
numDimensions, dimensionIDs, numAttributes)
|
||||
if (nf90_inquire_variable == nf90_noerr) then
|
||||
if(present(name)) name = trim(varName)
|
||||
if(present(xtype)) xtype = externalType
|
||||
if(present(ndims)) ndims = numDimensions
|
||||
if(present(dimids)) then
|
||||
if (size(dimids) .ge. numDimensions) then
|
||||
dimids(:numDimensions) = dimensionIDs(:numDimensions)
|
||||
else
|
||||
nf90_inquire_variable = nf90_einval
|
||||
endif
|
||||
endif
|
||||
if(present(nAtts)) nAtts = numAttributes
|
||||
endif
|
||||
end function nf90_inquire_variable
|
||||
! -----
|
||||
function nf90_rename_var(ncid, varid, newname)
|
||||
integer, intent( in) :: ncid, varid
|
||||
character (len = *), intent( in) :: newname
|
||||
integer :: nf90_rename_var
|
||||
|
||||
nf90_rename_var = nf_rename_var(ncid, varid, newname)
|
||||
end function nf90_rename_var
|
||||
! -----
|
25
f90/netcdf_visibility.f90
Normal file
25
f90/netcdf_visibility.f90
Normal file
@ -0,0 +1,25 @@
|
||||
! Library version, error string
|
||||
public :: nf90_inq_libvers, nf90_strerror
|
||||
|
||||
! Control routines
|
||||
public :: nf90_create, nf90_open, nf90_set_base_pe, nf90_inq_base_pe, &
|
||||
nf90_set_fill, nf90_redef, nf90_enddef, &
|
||||
nf90_create_mp, nf90_open_mp, &
|
||||
nf90_sync, nf90_abort, nf90_close, nf90_delete
|
||||
|
||||
! File level inquiry
|
||||
public :: nf90_inquire
|
||||
|
||||
! Dimension routines
|
||||
public :: nf90_def_dim, nf90_inq_dimid, nf90_rename_dim, nf90_inquire_dimension
|
||||
|
||||
! attribute routines
|
||||
public :: nf90_copy_att, nf90_rename_att, nf90_del_att, nf90_inq_attname, &
|
||||
nf90_inquire_attribute
|
||||
! overloaded functions
|
||||
public :: nf90_put_att, nf90_get_att
|
||||
|
||||
! Variable routines
|
||||
public :: nf90_def_var, nf90_inq_varid, nf90_rename_var, nf90_inquire_variable
|
||||
! overloaded functions
|
||||
public :: nf90_put_var, nf90_get_var
|
33
f90/nvea.m4
Normal file
33
f90/nvea.m4
Normal file
@ -0,0 +1,33 @@
|
||||
function NF90_AFUN`'(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
TYPE, dimension(COLONS), &
|
||||
intent(IN_OR_OUT) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: NF90_AFUN
|
||||
|
||||
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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_AFUN = &
|
||||
NF_MFUN`'(ncid, varid, localStart, localCount, localStride, localMap, values)
|
||||
else if(present(stride)) then
|
||||
NF90_AFUN = &
|
||||
NF_SFUN`'(ncid, varid, localStart, localCount, localStride, values)
|
||||
else
|
||||
NF90_AFUN = &
|
||||
NF_AFUN`'(ncid, varid, localStart, localCount, values)
|
||||
end if
|
||||
end function NF90_AFUN
|
35
f90/nveaget48.m4
Normal file
35
f90/nveaget48.m4
Normal file
@ -0,0 +1,35 @@
|
||||
function NF90_AFUN`'(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
TYPE, dimension(COLONS), &
|
||||
intent(IN_OR_OUT) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: NF90_AFUN
|
||||
|
||||
integer, dimension(nf90_max_var_dims) :: localStart, localCount, localStride, localMap
|
||||
integer :: numDims, counter
|
||||
integer, dimension(size(values)) :: defaultIntArray
|
||||
|
||||
! Set local arguments to default values
|
||||
numDims = size(shape(values))
|
||||
localStart (: ) = 1
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_AFUN = &
|
||||
NF_MFUN`'(ncid, varid, localStart, localCount, localStride, localMap, defaultIntArray)
|
||||
else if(present(stride)) then
|
||||
NF90_AFUN = &
|
||||
NF_SFUN`'(ncid, varid, localStart, localCount, localStride, defaultIntArray)
|
||||
else
|
||||
NF90_AFUN = &
|
||||
NF_AFUN`'(ncid, varid, localStart, localCount, defaultIntArray)
|
||||
end if
|
||||
values(COLONS) = reshape(defaultIntArray(:), shape(values))
|
||||
end function NF90_AFUN
|
33
f90/nveaput48.m4
Normal file
33
f90/nveaput48.m4
Normal file
@ -0,0 +1,33 @@
|
||||
function NF90_AFUN`'(ncid, varid, values, start, count, stride, map)
|
||||
integer, intent( in) :: ncid, varid
|
||||
TYPE, dimension(COLONS), &
|
||||
intent(IN_OR_OUT) :: values
|
||||
integer, dimension(:), optional, intent( in) :: start, count, stride, map
|
||||
integer :: NF90_AFUN
|
||||
|
||||
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
|
||||
localCount (:numDims ) = shape(values)
|
||||
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_AFUN = &
|
||||
NF_MFUN`'(ncid, varid, localStart, localCount, localStride, localMap, int(values))
|
||||
else if(present(stride)) then
|
||||
NF90_AFUN = &
|
||||
NF_SFUN`'(ncid, varid, localStart, localCount, localStride, int(values))
|
||||
else
|
||||
NF90_AFUN = &
|
||||
NF_AFUN`'(ncid, varid, localStart, localCount, int(values))
|
||||
end if
|
||||
end function NF90_AFUN
|
15
f90/nves.m4
Normal file
15
f90/nves.m4
Normal file
@ -0,0 +1,15 @@
|
||||
function NF90_1FUN`'(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
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
|
17
f90/nvesget48.m4
Normal file
17
f90/nvesget48.m4
Normal file
@ -0,0 +1,17 @@
|
||||
function NF90_1FUN`'(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
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
|
15
f90/nvesput48.m4
Normal file
15
f90/nvesput48.m4
Normal file
@ -0,0 +1,15 @@
|
||||
function NF90_1FUN`'(ncid, varid, values, start)
|
||||
integer, intent( in) :: ncid, varid
|
||||
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
|
49
f90/testEightByteGet.f90
Normal file
49
f90/testEightByteGet.f90
Normal file
@ -0,0 +1,49 @@
|
||||
program testEightByteGet
|
||||
use typeSizes
|
||||
use netcdf
|
||||
implicit none
|
||||
|
||||
! netcdf related variables
|
||||
integer :: ncFileID, dimId, varId
|
||||
|
||||
! Local variables
|
||||
integer, parameter :: numLats = 10
|
||||
character (len = *), parameter :: fileName = "eightByteIntExample.nc"
|
||||
integer :: counter
|
||||
!integer(kind = FourByteInt), dimension(numLats) :: lats
|
||||
integer(kind = EightByteInt), dimension(numLats) :: lats
|
||||
|
||||
! -----
|
||||
call check(nf90_create(path = trim(fileName), cmode = nf90_clobber, ncid = ncFileID))
|
||||
|
||||
! Define the dimensions
|
||||
call check(nf90_def_dim(ncid = ncFileID, name = "lat", len = numLats, dimid = dimID))
|
||||
! Define the variable
|
||||
call check(nf90_def_var(ncFileID, "lat", nf90_int, dimids = dimID, varID = varID) )
|
||||
! Leave define mode
|
||||
call check(nf90_enddef(ncfileID))
|
||||
! Write the variable
|
||||
lats(:) = (/ (counter, counter = 1, numLats) /)
|
||||
print *, lats
|
||||
call check(nf90_put_var(ncFileID, varId, lats ))
|
||||
call check(nf90_close(ncFileID))
|
||||
|
||||
! Now read it back in...
|
||||
lats(:) = 0
|
||||
call check(nf90_open(path = trim(fileName), mode = nf90_nowrite, ncid = ncFileID))
|
||||
call check(nf90_inq_varid(ncFileId, "lat", varId))
|
||||
call check(nf90_get_var(ncFileID, varId, lats))
|
||||
print *, lats
|
||||
call check(nf90_close(ncFileID))
|
||||
|
||||
contains
|
||||
! Internal subroutine - checks error status after each netcdf, prints out text message each time
|
||||
! an error code is returned.
|
||||
subroutine check(status)
|
||||
integer, intent ( in) :: status
|
||||
|
||||
if(status /= nf90_noerr) then
|
||||
print *, trim(nf90_strerror(status))
|
||||
end if
|
||||
end subroutine check
|
||||
end program testEightByteGet
|
64
f90/typeSizes.f90
Normal file
64
f90/typeSizes.f90
Normal file
@ -0,0 +1,64 @@
|
||||
! Description:
|
||||
! Provide named kind parameters for use in declarations of real and integer
|
||||
! variables with specific byte sizes (i.e. one, two, four, and eight byte
|
||||
! integers; four and eight byte reals). The parameters can then be used
|
||||
! in (KIND = XX) modifiers in declarations.
|
||||
! A single function (byteSizesOK()) is provided to ensure that the selected
|
||||
! kind parameters are correct.
|
||||
!
|
||||
! Input Parameters:
|
||||
! None.
|
||||
!
|
||||
! Output Parameters:
|
||||
! Public parameters, fixed at compile time:
|
||||
! OneByteInt, TwoByteInt, FourByteInt, EightByteInt
|
||||
! FourByteReal, EightByteRadl
|
||||
!
|
||||
! References and Credits:
|
||||
! Written by
|
||||
! Robert Pincus
|
||||
! Cooperative Institue for Meteorological Satellite Studies
|
||||
! University of Wisconsin - Madison
|
||||
! 1225 W. Dayton St.
|
||||
! Madison, Wisconsin 53706
|
||||
! Robert.Pincus@ssec.wisc.edu
|
||||
!
|
||||
! Design Notes:
|
||||
! Fortran 90 doesn't allow one to check the number of bytes in a real variable;
|
||||
! we check only that four byte and eight byte reals have different kind parameters.
|
||||
!
|
||||
module typeSizes
|
||||
implicit none
|
||||
public
|
||||
integer, parameter :: OneByteInt = selected_int_kind(2), &
|
||||
TwoByteInt = selected_int_kind(4), &
|
||||
FourByteInt = selected_int_kind(9), &
|
||||
EightByteInt = selected_int_kind(18)
|
||||
|
||||
integer, parameter :: &
|
||||
FourByteReal = selected_real_kind(P = 6, R = 37), &
|
||||
EightByteReal = selected_real_kind(P = 13, R = 307)
|
||||
contains
|
||||
logical function byteSizesOK()
|
||||
! Users may call this function once to ensure that the kind parameters
|
||||
! the module defines are available with the current compiler.
|
||||
! We can't ensure that the two REAL kinds are actually four and
|
||||
! eight bytes long, but we can ensure that they are distinct.
|
||||
! Early Fortran 90 compilers would sometimes report incorrect results for
|
||||
! the bit_size intrinsic, but I haven't seen this in a long time.
|
||||
|
||||
! Local variables
|
||||
integer (kind = OneByteInt) :: One
|
||||
integer (kind = TwoByteInt) :: Two
|
||||
integer (kind = FourByteInt) :: Four
|
||||
|
||||
if (bit_size( One) == 8 .and. bit_size( Two) == 16 .and. &
|
||||
bit_size(Four) == 32 .and. &
|
||||
FourByteReal > 0 .and. EightByteReal > 0 .and. &
|
||||
FourByteReal /= EightByteReal) then
|
||||
byteSizesOK = .true.
|
||||
else
|
||||
byteSizesOK = .false.
|
||||
end if
|
||||
end function byteSizesOK
|
||||
end module typeSizes
|
105
fortran/Makefile.am
Normal file
105
fortran/Makefile.am
Normal file
@ -0,0 +1,105 @@
|
||||
## This is an automake file, part of Unidata's netCDF package.
|
||||
# Copyright 2005, see the COPYRIGHT file for more information.
|
||||
|
||||
## This file controls the building of the fortran convenience library.
|
||||
|
||||
# $Id: Makefile.am,v 1.60 2010/05/29 00:21:22 dmh Exp $
|
||||
|
||||
AM_CPPFLAGS =
|
||||
AM_LDFLAGS =
|
||||
# May need to set this.
|
||||
libnetcdff_la_LIBADD =
|
||||
|
||||
|
||||
# The F77 API man page.
|
||||
man_MANS = netcdf_f77.3
|
||||
|
||||
# This rule generates the F77 manpage.
|
||||
ARGS_MANPAGE = -DAPI=FORTRAN
|
||||
if USE_NETCDF4
|
||||
ARGS_MANPAGE += -DNETCDF4=TRUE
|
||||
endif
|
||||
if BUILD_DAP
|
||||
ARGS_MANPAGE += -DDAP=TRUE
|
||||
endif
|
||||
if BUILD_PARALLEL
|
||||
ARGS_MANPAGE += -DPARALLEL_IO=TRUE
|
||||
endif
|
||||
netcdf_f77.3: $(top_srcdir)/man4/netcdf.m4
|
||||
m4 $(M4FLAGS) $(ARGS_MANPAGE) $? >$@ || rm $@
|
||||
|
||||
# These are the source files for the fortran library.
|
||||
libnetcdff_la_SOURCES = fort-attio.c fort-control.c fort-dim.c \
|
||||
fort-genatt.c fort-geninq.c fort-genvar.c fort-lib.c fort-misc.c \
|
||||
fort-v2compat.c fort-vario.c fort-var1io.c fort-varaio.c fort-varmio.c \
|
||||
fort-varsio.c cfortran.h fort-lib.h ncfortran.h
|
||||
|
||||
# Tell make to install this as a header file.
|
||||
nodist_include_HEADERS = netcdf.inc
|
||||
|
||||
# The include file and man page are both built by make.
|
||||
BUILT_SOURCES = netcdf.inc netcdf_f77.3
|
||||
|
||||
netcdf.inc: netcdf2.inc netcdf3.inc netcdf4.inc nfconfig.inc
|
||||
echo '! NetCDF-3.' > netcdf.inc
|
||||
cat @top_srcdir@/fortran/netcdf3.inc >> netcdf.inc
|
||||
if BUILD_V2
|
||||
echo >> netcdf.inc
|
||||
echo '! NetCDF-2.' >> netcdf.inc
|
||||
cat @top_srcdir@/fortran/netcdf2.inc >> netcdf.inc
|
||||
endif
|
||||
if USE_NETCDF4
|
||||
echo >> netcdf.inc
|
||||
echo '! NetCDF-4.' >> netcdf.inc
|
||||
cat @top_srcdir@/fortran/netcdf4.inc >> netcdf.inc
|
||||
endif
|
||||
if USE_LOGGING
|
||||
echo >> netcdf.inc
|
||||
echo '! This is to turn on netCDF internal logging.' >> netcdf.inc
|
||||
echo ' integer nf_set_log_level' >> netcdf.inc
|
||||
echo ' external nf_set_log_level' >> netcdf.inc
|
||||
endif
|
||||
|
||||
# Tell make to rebuld fortran library if nfconfig.inc has changed
|
||||
# (it's generated by the configure script from nfconfig.in), or if
|
||||
# netcdf.inc has changed.
|
||||
libnetcdff_la_DEPENDENCIES = nfconfig.inc netcdf.inc
|
||||
|
||||
# Is the user building netCDF-4?
|
||||
if USE_NETCDF4
|
||||
# All netCDF-4 F77 functions are in one code file.
|
||||
libnetcdff_la_SOURCES += fort-nc4.c
|
||||
endif
|
||||
|
||||
if BUILD_SEPARATE_FORTRAN
|
||||
lib_LTLIBRARIES = libnetcdff.la
|
||||
else
|
||||
noinst_LTLIBRARIES = libnetcdff.la
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS += -I$(top_builddir)/liblib @EXTERN_CFLAGS@
|
||||
|
||||
# If F90 is built, include it's convenience library.
|
||||
if BUILD_F90
|
||||
libnetcdff_la_LIBADD += ${top_builddir}/f90/libnetcdff90.la
|
||||
nodist_EXTRA_libnetcdff_la_SOURCES = dummy.f90
|
||||
endif
|
||||
|
||||
# If we are building the dll (under MinGW) then set the correct flags.
|
||||
if BUILD_DLL
|
||||
AM_CPPFLAGS += -DNC_DLL_EXPORT
|
||||
endif
|
||||
|
||||
AM_LDFLAGS += @EXTERN_LDFLAGS@
|
||||
|
||||
# The nfconfig.in file is turned into nfconfig.inc by the configure
|
||||
# script. The man page is generated on the developers machine for the
|
||||
# dist.
|
||||
EXTRA_DIST = nfconfig.in $(man_MANS) netcdf2.inc netcdf3.inc \
|
||||
netcdf4.inc
|
||||
|
||||
# These files need to be cleaned up my make.
|
||||
CLEANFILES = nfconfig1.inc netcdf.inc
|
||||
DISTCLEANFILES = nfconfig.inc
|
||||
|
||||
test: check
|
99
fortran/NOTEBOOK
Normal file
99
fortran/NOTEBOOK
Normal file
@ -0,0 +1,99 @@
|
||||
Resolved:
|
||||
|
||||
The netCDF-3 package will only support *.F FORTRAN files.
|
||||
|
||||
Ramification:
|
||||
|
||||
The netCDF FORTRAN include-file will contain C preprocessor
|
||||
directives.
|
||||
|
||||
Arguments For:
|
||||
|
||||
1. We can rely on a C preprocessor being available.
|
||||
|
||||
2. Most FORTRAN compilers automatically run *.F files through the
|
||||
C preprocessor.
|
||||
|
||||
3. Without C preprocessor macros, it will be extremely difficult
|
||||
and cumbersome to write portable FORTRAN code (e.g. ftest.F):
|
||||
the macros are necessary to customize the code to the data types
|
||||
that the system supports (e.g. byte, integer*2).
|
||||
|
||||
4. The problem of writing portable FORTRAN code will have to be
|
||||
solved in order to write the FORTRAN API test utility (ftest).
|
||||
It is wrong for us to solve this problem yet tell our clients
|
||||
that they're on their own.
|
||||
|
||||
5. Supporting portability is why the netCDF package exists.
|
||||
|
||||
Arguments Against:
|
||||
|
||||
1. It is wrong to unnecessarily require a programmer to use the C
|
||||
preprocessor.
|
||||
|
||||
2. It is possible that a person could distribute a netCDF-using
|
||||
FORTRAN library to a system that doesn't have a C compiler.
|
||||
|
||||
(It would seem to me that the onus would be on the distributor
|
||||
of the library to support portability --Steve)
|
||||
|
||||
3. Most FORTRAN programmers work on Crays, which don't
|
||||
automatically preprocess *.F files. It is wrong to require them
|
||||
to do something that they didn't have to do before.
|
||||
|
||||
(I don't know that most FORTRAN programmers work on Crays.
|
||||
With netCDF 2.4, if a Cray FORTRAN programmer wanted to write
|
||||
portable code, then they had to use our m4(1)-based fortc(1)
|
||||
utility to do it. Using the C preprocessor is better in many
|
||||
ways).
|
||||
|
||||
Possible Compromise:
|
||||
|
||||
Have 2 netCDF FORTRAN include-files: one that contains C
|
||||
preprocessor directives and one that doesn't. The one that doesn't
|
||||
would not be able to support the writing of portable FORTRAN code.
|
||||
|
||||
For example:
|
||||
|
||||
File `netcdf.inc':
|
||||
|
||||
C Contains (possibly system-specific) PARAMETER, EXTERNAL,
|
||||
C and data-type statements only, e.g.
|
||||
|
||||
INTEGER NF_BYTE
|
||||
...
|
||||
PARAMETER (NF_BYTE = 1)
|
||||
...
|
||||
PARAMETER (NF_FILL_BYTE = -127)
|
||||
...
|
||||
EXTERNAL NF_CREATE
|
||||
INTEGER NF_CREATE
|
||||
...
|
||||
|
||||
C Since this file only contains the above types of
|
||||
C statements, conditional compilation is unnecessary. As a
|
||||
C consequence, however, this file cannot be used to write
|
||||
C portable code.
|
||||
|
||||
File `netcdf.F' (can anyone think of a better extension?):
|
||||
|
||||
#define NF_BYTE_T BYTE /* type of `data' argument in
|
||||
* nf_{put,get}_var*_int1()
|
||||
* routines */
|
||||
#undef NF_SHORT_T /* i.e. FORTRAN doesn't support the
|
||||
* INTEGER*2 data type */
|
||||
...
|
||||
#include "netcdf.inc" /* so portable FORTRAN code would
|
||||
* only need to `#include
|
||||
* "netcdf.F"' */
|
||||
|
||||
Arguments For:
|
||||
|
||||
Seems to satisfy both camps.
|
||||
|
||||
Arguments Against:
|
||||
|
||||
More complex.
|
||||
|
||||
Comments?
|
||||
This is a test.
|
111
fortran/NOTES
Normal file
111
fortran/NOTES
Normal file
@ -0,0 +1,111 @@
|
||||
This file is a collection of OS-specific notes on the generation of the
|
||||
netCDF Fortran interface and problems with some of the resulting interfaces.
|
||||
If your platform isn't here, either we know of no problems with that OS, or
|
||||
we haven't generated a Fortran interface for it, for lack of the necessary
|
||||
OS-specific .m4 file, describing the characteristics of how C is called form
|
||||
Fortran and peculiarities of the particular implementation of Fortran. If
|
||||
you write a new .m4 file for another platform that successfully generates a
|
||||
netCDF Fortran interface, please send it to us to add to the collection.
|
||||
|
||||
|
||||
|
||||
Cray/UNICOS
|
||||
|
||||
1. The way BYTE data and attributes are implemented (packing and unpacking
|
||||
from CRAY integers), only unsigned byte values between 0 and 255 work
|
||||
as expected. For example, if you store -100 as a byte value, it will be
|
||||
retrieved as 156.
|
||||
|
||||
2. The UNICOS jackets treat double precision as real, partly because the
|
||||
FORTRAN 128-bit double has no corresponding C type (in C doubles and
|
||||
floats are both 64 bits). Use "real" or "real*8" declarations for double
|
||||
precision. XDR can't store Cray's 128-bit double precision numbers
|
||||
anyway.
|
||||
|
||||
|
||||
Microsoft Fortran and C
|
||||
|
||||
1. This distribution and Makefiles have been tested on PCDOS 3.3, PCDOS
|
||||
4.01, OS/2 1.2, OS/2 1.3, using Microsoft C 6.0 and Microsoft Fortran
|
||||
5.0.
|
||||
|
||||
2. Copy the fortran/msoft/* files up into the parent directory with
|
||||
|
||||
cp *.* ..
|
||||
|
||||
before using the msoft.mk makefile.
|
||||
|
||||
3. fslen.asm is an assembler routine needed to help find the length of
|
||||
FORTRAN character*(*) variables from a C routine they are passed into.
|
||||
This relies on undocumented mechanisms, so it might break in some future
|
||||
release.
|
||||
|
||||
|
||||
IBM RS6000/AIX
|
||||
|
||||
We used the "xlf" compiler on AIX to test the Fortran jackets:
|
||||
|
||||
make OS=aix_3.1 FC=xlf
|
||||
|
||||
|
||||
|
||||
DEC VAX/VMS
|
||||
|
||||
These were generated on a UNIX system, since we require sed and m4. All
|
||||
the resulting generated files and ".com" command files to make and
|
||||
install the resulting library interface are in the fortran/vms
|
||||
subdirectory. They should be copied into this parent directory before
|
||||
running make.com and install.com.
|
||||
|
||||
|
||||
DEC/Ultrix
|
||||
|
||||
1. We tested these with the standard (unsupported) f77 compiler on a
|
||||
VAXstation and a DECstation under Ultrix 4.0.
|
||||
|
||||
2. THE MIPS compiler for DECstations seems to have problems with compiling the
|
||||
FORTRAN test program generated by "ncgen -f" when running "make ftest" in
|
||||
the ../ncgen directory. The standard FORTRAN construct it chokes on
|
||||
compiles fine on other platforms ('a string' // char(10) // 'another
|
||||
string'), but on this platform produces the error:
|
||||
|
||||
f77 -o test0 test0.f ../../../lib/libnetcdf.a
|
||||
Error on line 59 of test0.f: concatenation of nonchar data
|
||||
grow failed sp >= USRSTACK-ctob(u.u_ssize) 0x7fffffff >= 0x7fffd000
|
||||
Fatal error in: /usr/lib/fcom1.31 Segmentation fault - core dumped
|
||||
|
||||
If anyone discovers a way around this, please let us know.
|
||||
|
||||
3. If in running "ftest" as a result of "make test" in the netcdf/fortran
|
||||
directory, you get errors like the following:
|
||||
|
||||
--- Testing ncagt, ncagtc ...
|
||||
error in ncagt FLOAT
|
||||
--- Testing ncredf, ncdren, ncvren, ncaren, ncendf ...
|
||||
--- Testing ncacpy ...
|
||||
error in ncagt FLOAT
|
||||
|
||||
you almost surely have linked with the system-supplied XDR and its buggy
|
||||
xdr_float instead of the one we supply. Remake your netcdf library with
|
||||
the netcdf-distributed xdr instead of the system xdr.
|
||||
|
||||
|
||||
SunOS 5 f90
|
||||
|
||||
1. SunOS's f90 compiler is a bit green. The following bugs have been
|
||||
noticed:
|
||||
|
||||
*) The manual page says the "-F" option causes the preprocessor
|
||||
to generate a .for file from a .F; whereas, it actually
|
||||
generates a .f file.
|
||||
|
||||
*) The compiler fails to compile the file ftest.F in the
|
||||
simplest way:
|
||||
|
||||
/opt/SUNWspro/bin/f90 -c -g ftest.F
|
||||
cf90-995 f90comp: INTERNAL TFILLS, File = ftest.F, Line = 1351
|
||||
Unrecoverable error encountered while attempting to print buffered messages -
|
||||
hit EOF while trying to issue message 197 at line 1351.
|
||||
|
||||
The line number is incorrect. It might refer to the
|
||||
preprocessed (virtual .f) file -- but there's no way to tell.
|
2049
fortran/cfortran.doc
Normal file
2049
fortran/cfortran.doc
Normal file
File diff suppressed because it is too large
Load Diff
2519
fortran/cfortran.h
Normal file
2519
fortran/cfortran.h
Normal file
File diff suppressed because it is too large
Load Diff
168
fortran/depend
Normal file
168
fortran/depend
Normal file
@ -0,0 +1,168 @@
|
||||
fort-attio.o: ../libsrc/netcdf.h
|
||||
fort-attio.o: ../libsrc/netcdf.h
|
||||
fort-attio.o: cfortran.h
|
||||
fort-attio.o: cfortran.h
|
||||
fort-attio.o: fort-attio.c
|
||||
fort-attio.o: fort-attio.c
|
||||
fort-attio.o: ncfortran.h
|
||||
fort-attio.o: ncfortran.h
|
||||
fort-attio.o: nfconfig.inc
|
||||
fort-attio.o: nfconfig.inc
|
||||
fort-attio.o: nfconfig.inc
|
||||
fort-control.o: ../libsrc/netcdf.h
|
||||
fort-control.o: ../libsrc/netcdf.h
|
||||
fort-control.o: cfortran.h
|
||||
fort-control.o: cfortran.h
|
||||
fort-control.o: fort-control.c
|
||||
fort-control.o: fort-control.c
|
||||
fort-control.o: ncfortran.h
|
||||
fort-control.o: ncfortran.h
|
||||
fort-control.o: nfconfig.inc
|
||||
fort-dim.o: ../libsrc/netcdf.h
|
||||
fort-dim.o: ../libsrc/netcdf.h
|
||||
fort-dim.o: cfortran.h
|
||||
fort-dim.o: cfortran.h
|
||||
fort-dim.o: fort-dim.c
|
||||
fort-dim.o: fort-dim.c
|
||||
fort-dim.o: ncfortran.h
|
||||
fort-dim.o: ncfortran.h
|
||||
fort-dim.o: nfconfig.inc
|
||||
fort-genatt.o: ../libsrc/netcdf.h
|
||||
fort-genatt.o: ../libsrc/netcdf.h
|
||||
fort-genatt.o: cfortran.h
|
||||
fort-genatt.o: cfortran.h
|
||||
fort-genatt.o: fort-genatt.c
|
||||
fort-genatt.o: fort-genatt.c
|
||||
fort-genatt.o: ncfortran.h
|
||||
fort-genatt.o: ncfortran.h
|
||||
fort-genatt.o: nfconfig.inc
|
||||
fort-geninq.o: ../libsrc/netcdf.h
|
||||
fort-geninq.o: ../libsrc/netcdf.h
|
||||
fort-geninq.o: cfortran.h
|
||||
fort-geninq.o: cfortran.h
|
||||
fort-geninq.o: fort-geninq.c
|
||||
fort-geninq.o: fort-geninq.c
|
||||
fort-geninq.o: ncfortran.h
|
||||
fort-geninq.o: ncfortran.h
|
||||
fort-geninq.o: nfconfig.inc
|
||||
fort-genvar.o: ../libsrc/netcdf.h
|
||||
fort-genvar.o: ../libsrc/netcdf.h
|
||||
fort-genvar.o: cfortran.h
|
||||
fort-genvar.o: cfortran.h
|
||||
fort-genvar.o: fort-genvar.c
|
||||
fort-genvar.o: fort-genvar.c
|
||||
fort-genvar.o: fort-lib.h
|
||||
fort-genvar.o: fort-lib.h
|
||||
fort-genvar.o: ncfortran.h
|
||||
fort-genvar.o: ncfortran.h
|
||||
fort-genvar.o: ncfortran.h
|
||||
fort-genvar.o: nfconfig.inc
|
||||
fort-lib.o: ../libsrc/netcdf.h
|
||||
fort-lib.o: ../libsrc/netcdf.h
|
||||
fort-lib.o: cfortran.h
|
||||
fort-lib.o: fort-lib.c
|
||||
fort-lib.o: fort-lib.c
|
||||
fort-lib.o: fort-lib.h
|
||||
fort-lib.o: fort-lib.h
|
||||
fort-lib.o: ncfortran.h
|
||||
fort-lib.o: ncfortran.h
|
||||
fort-lib.o: nfconfig.inc
|
||||
fort-misc.o: ../libsrc/netcdf.h
|
||||
fort-misc.o: cfortran.h
|
||||
fort-misc.o: cfortran.h
|
||||
fort-misc.o: fort-misc.c
|
||||
fort-misc.o: fort-misc.c
|
||||
fort-misc.o: ncfortran.h
|
||||
fort-misc.o: ncfortran.h
|
||||
fort-misc.o: nfconfig.inc
|
||||
fort-v2compat.o: ../config.h
|
||||
fort-v2compat.o: ../config.h
|
||||
fort-v2compat.o: ../libsrc/netcdf.h
|
||||
fort-v2compat.o: ../libsrc/netcdf.h
|
||||
fort-v2compat.o: cfortran.h
|
||||
fort-v2compat.o: cfortran.h
|
||||
fort-v2compat.o: fort-lib.h
|
||||
fort-v2compat.o: fort-lib.h
|
||||
fort-v2compat.o: fort-v2compat.c
|
||||
fort-v2compat.o: fort-v2compat.c
|
||||
fort-v2compat.o: ncfortran.h
|
||||
fort-v2compat.o: ncfortran.h
|
||||
fort-v2compat.o: ncfortran.h
|
||||
fort-v2compat.o: nfconfig.inc
|
||||
fort-v2compat.o: nfconfig.inc
|
||||
fort-v2compat.o: nfconfig.inc
|
||||
fort-var1io.o: ../libsrc/netcdf.h
|
||||
fort-var1io.o: ../libsrc/netcdf.h
|
||||
fort-var1io.o: cfortran.h
|
||||
fort-var1io.o: cfortran.h
|
||||
fort-var1io.o: fort-lib.h
|
||||
fort-var1io.o: fort-lib.h
|
||||
fort-var1io.o: fort-var1io.c
|
||||
fort-var1io.o: fort-var1io.c
|
||||
fort-var1io.o: ncfortran.h
|
||||
fort-var1io.o: ncfortran.h
|
||||
fort-var1io.o: ncfortran.h
|
||||
fort-var1io.o: nfconfig.inc
|
||||
fort-var1io.o: nfconfig.inc
|
||||
fort-var1io.o: nfconfig.inc
|
||||
fort-varaio.o: ../libsrc/netcdf.h
|
||||
fort-varaio.o: ../libsrc/netcdf.h
|
||||
fort-varaio.o: cfortran.h
|
||||
fort-varaio.o: cfortran.h
|
||||
fort-varaio.o: fort-lib.h
|
||||
fort-varaio.o: fort-lib.h
|
||||
fort-varaio.o: fort-varaio.c
|
||||
fort-varaio.o: fort-varaio.c
|
||||
fort-varaio.o: ncfortran.h
|
||||
fort-varaio.o: ncfortran.h
|
||||
fort-varaio.o: ncfortran.h
|
||||
fort-varaio.o: nfconfig.inc
|
||||
fort-varaio.o: nfconfig.inc
|
||||
fort-varaio.o: nfconfig.inc
|
||||
fort-vario.o: ../libsrc/netcdf.h
|
||||
fort-vario.o: ../libsrc/netcdf.h
|
||||
fort-vario.o: cfortran.h
|
||||
fort-vario.o: cfortran.h
|
||||
fort-vario.o: fort-lib.h
|
||||
fort-vario.o: fort-lib.h
|
||||
fort-vario.o: fort-vario.c
|
||||
fort-vario.o: fort-vario.c
|
||||
fort-vario.o: ncfortran.h
|
||||
fort-vario.o: ncfortran.h
|
||||
fort-vario.o: ncfortran.h
|
||||
fort-vario.o: nfconfig.inc
|
||||
fort-vario.o: nfconfig.inc
|
||||
fort-vario.o: nfconfig.inc
|
||||
fort-varmio.o: ../libsrc/netcdf.h
|
||||
fort-varmio.o: ../libsrc/netcdf.h
|
||||
fort-varmio.o: cfortran.h
|
||||
fort-varmio.o: cfortran.h
|
||||
fort-varmio.o: fort-lib.h
|
||||
fort-varmio.o: fort-lib.h
|
||||
fort-varmio.o: fort-varmio.c
|
||||
fort-varmio.o: fort-varmio.c
|
||||
fort-varmio.o: ncfortran.h
|
||||
fort-varmio.o: ncfortran.h
|
||||
fort-varmio.o: ncfortran.h
|
||||
fort-varmio.o: nfconfig.inc
|
||||
fort-varmio.o: nfconfig.inc
|
||||
fort-varmio.o: nfconfig.inc
|
||||
fort-varsio.o: ../libsrc/netcdf.h
|
||||
fort-varsio.o: ../libsrc/netcdf.h
|
||||
fort-varsio.o: cfortran.h
|
||||
fort-varsio.o: cfortran.h
|
||||
fort-varsio.o: fort-lib.h
|
||||
fort-varsio.o: fort-lib.h
|
||||
fort-varsio.o: fort-varsio.c
|
||||
fort-varsio.o: fort-varsio.c
|
||||
fort-varsio.o: ncfortran.h
|
||||
fort-varsio.o: ncfortran.h
|
||||
fort-varsio.o: ncfortran.h
|
||||
fort-varsio.o: nfconfig.inc
|
||||
fort-varsio.o: nfconfig.inc
|
||||
fort-varsio.o: nfconfig.inc
|
||||
ftest.o: ftest.F
|
||||
ftest.o: netcdf.inc
|
||||
ftest.o: nfconfig.inc
|
||||
imap.o: imap.F
|
||||
imap.o: netcdf.inc
|
149
fortran/fort-attio.c
Normal file
149
fortran/fort-attio.c
Normal file
@ -0,0 +1,149 @@
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "netcdf.h"
|
||||
#include "nfconfig.inc"
|
||||
#include "ncfortran.h"
|
||||
|
||||
|
||||
/*
|
||||
* Write an attribute from a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_put_att_text, NF_PUT_ATT_TEXT, nf_put_att_text,
|
||||
NCID, VARID, STRING, COUNT, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Read an attribute into a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_text, NF_GET_ATT_TEXT, nf_get_att_text,
|
||||
NCID, VARID, STRING, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Write an attribute from an INTEGER*1 array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_schar, NF_PUT_ATT_INT1, nf_put_att_int1,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT1ATT)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_short, NF_PUT_ATT_INT1, nf_put_att_int1,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT1ATT)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_int, NF_PUT_ATT_INT1, nf_put_att_int1,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT1ATT)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_long, NF_PUT_ATT_INT1, nf_put_att_int1,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT1ATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an attribute into an INTEGER*1 array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_schar, NF_GET_ATT_INT1, nf_get_att_int1,
|
||||
NCID, VARID, STRING, PINT1ATT)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_short, NF_GET_ATT_INT1, nf_get_att_int1,
|
||||
NCID, VARID, STRING, PINT1ATT)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_int, NF_GET_ATT_INT1, nf_get_att_int1,
|
||||
NCID, VARID, STRING, PINT1ATT)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_long, NF_GET_ATT_INT1, nf_get_att_int1,
|
||||
NCID, VARID, STRING, PINT1ATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an attribute from an INTEGER*2 array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_short, NF_PUT_ATT_INT2, nf_put_att_int2,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT2ATT)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_int, NF_PUT_ATT_INT2, nf_put_att_int2,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT2ATT)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_long, NF_PUT_ATT_INT2, nf_put_att_int2,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INT2ATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an attribute into an INTEGER*2 array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_short, NF_GET_ATT_INT2, nf_get_att_int2,
|
||||
NCID, VARID, STRING, PINT2ATT)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_int, NF_GET_ATT_INT2, nf_get_att_int2,
|
||||
NCID, VARID, STRING, PINT2ATT)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_long, NF_GET_ATT_INT2, nf_get_att_int2,
|
||||
NCID, VARID, STRING, PINT2ATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an attribute from an INTEGER array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_int, NF_PUT_ATT_INT, nf_put_att_int,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INTATT)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_long, NF_PUT_ATT_INT, nf_put_att_int,
|
||||
NCID, VARID, STRING, TYPE, COUNT, INTATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an attribute into an INTEGER array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_int, NF_GET_ATT_INT, nf_get_att_int,
|
||||
NCID, VARID, STRING, PINTATT)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_long, NF_GET_ATT_INT, nf_get_att_int,
|
||||
NCID, VARID, STRING, PINTATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an attribute from a REAL array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_double, NF_PUT_ATT_REAL, nf_put_att_real,
|
||||
NCID, VARID, STRING, TYPE, COUNT, DOUBLEATT)
|
||||
#else
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_float, NF_PUT_ATT_REAL, nf_put_att_real,
|
||||
NCID, VARID, STRING, TYPE, COUNT, REALATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an attribute into a REAL array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_double, NF_GET_ATT_REAL, nf_get_att_real,
|
||||
NCID, VARID, STRING, PDOUBLEATT)
|
||||
#else
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_float, NF_GET_ATT_REAL, nf_get_att_real,
|
||||
NCID, VARID, STRING, PREALATT)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an attribute from a DOUBLEPRECISION array.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc_put_att_double, NF_PUT_ATT_DOUBLE, nf_put_att_double,
|
||||
NCID, VARID, STRING, TYPE, COUNT, DOUBLEATT)
|
||||
|
||||
|
||||
/*
|
||||
* Read an attribute into a DOUBLEPRECISION array.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_get_att_double, NF_GET_ATT_DOUBLE, nf_get_att_double,
|
||||
NCID, VARID, STRING, PDOUBLEATT)
|
130
fortran/fort-control.c
Normal file
130
fortran/fort-control.c
Normal file
@ -0,0 +1,130 @@
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
|
||||
#ifdef LOGGING
|
||||
FCALLSCFUN1(NF_INT, nc_set_log_level, NF_SET_LOG_LEVEL, nf_set_log_level,
|
||||
FINT2CINT)
|
||||
#endif /* LOGGING */
|
||||
|
||||
/*
|
||||
* Create a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_create, NF_CREATE, nf_create,
|
||||
STRING, FINT2CINT, PNCID)
|
||||
|
||||
|
||||
/*
|
||||
* Create a netCDF dataset with I/O attributes.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc__create, NF__CREATE, nf__create,
|
||||
STRING, FINT2CINT, FINT2CSIZET, PCHUNKSIZEHINT, PNCID)
|
||||
|
||||
|
||||
/*
|
||||
* Open a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_open, NF_OPEN, nf_open,
|
||||
STRING, FINT2CINT, PNCID)
|
||||
|
||||
|
||||
/*
|
||||
* Open a netCDF dataset with I/O attributes.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc__open, NF__OPEN, nf__open,
|
||||
STRING, FINT2CINT, PCHUNKSIZEHINT, PNCID)
|
||||
|
||||
|
||||
/*
|
||||
* Set the fill mode of a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_set_fill, NF_SET_FILL, nf_set_fill,
|
||||
NCID, FINT2CINT, PCINT2FINT)
|
||||
|
||||
|
||||
/*
|
||||
* Set the fill mode of a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_set_default_format, NF_SET_DEFAULT_FORMAT,
|
||||
nf_set_default_format, FINT2CINT, PCINT2FINT)
|
||||
|
||||
|
||||
/*
|
||||
* Put a netCDF dataset into redefine mode.
|
||||
*/
|
||||
FCALLSCFUN1(NF_INT, nc_redef, NF_REDEF, nf_redef,
|
||||
NCID)
|
||||
|
||||
|
||||
/*
|
||||
* End definition mode for a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN1(NF_INT, nc_enddef, NF_ENDDEF, nf_enddef,
|
||||
NCID)
|
||||
|
||||
|
||||
/*
|
||||
* End definition mode for a netCDF dataset with I/O attributes.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc__enddef, NF__ENDDEF, nf__enddef,
|
||||
NCID, FINT2CSIZET, FINT2CSIZET, FINT2CSIZET, FINT2CSIZET)
|
||||
|
||||
|
||||
/*
|
||||
* Synchronize the external representation of a netCDF dataset with its
|
||||
* internal one.
|
||||
*/
|
||||
FCALLSCFUN1(NF_INT, nc_sync, NF_SYNC, nf_sync,
|
||||
NCID)
|
||||
|
||||
|
||||
/*
|
||||
* Abort changes to a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN1(NF_INT, nc_abort, NF_ABORT, nf_abort,
|
||||
NCID)
|
||||
|
||||
|
||||
/*
|
||||
* Close a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN1(NF_INT, nc_close, NF_CLOSE, nf_close,
|
||||
NCID)
|
||||
|
||||
|
||||
/*
|
||||
* Delete a netCDF dataset by name.
|
||||
*/
|
||||
/*EXTERNL int nc_delete(const char * path);*/ /* defined in ../libsrc/nc.c */
|
||||
FCALLSCFUN1(NF_INT, nc_delete, NF_DELETE, nf_delete,
|
||||
STRING)
|
||||
|
||||
/*
|
||||
* Create a netCDF dataset with I/O attributes and specific base pe.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc__create_mp, NF__CREATE_MP, nf__create_mp,
|
||||
STRING, FINT2CINT, FINT2CSIZET, FINT2CINT, PCHUNKSIZEHINT, PNCID)
|
||||
|
||||
/*
|
||||
* Open a netCDF dataset with I/O attributes and specific base pe.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc__open_mp, NF__OPEN_MP, nf__open_mp,
|
||||
STRING, FINT2CINT, FINT2CINT, PCHUNKSIZEHINT, PNCID)
|
||||
|
||||
/*
|
||||
* Delete a netCDF dataset by name using a specific base pe.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_delete_mp, NF_DELETE_MP, nf_delete_mp,
|
||||
STRING, FINT2CINT)
|
||||
|
||||
/*
|
||||
* Set netCDF of base PE
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_set_base_pe, NF_SET_BASE_PE, nf_set_base_pe,
|
||||
NCID, FINT2CINT)
|
||||
|
||||
/*
|
||||
* Inquire netCDF of base PE
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_inq_base_pe, NF_INQ_BASE_PE, nf_inq_base_pe,
|
||||
NCID, PCINT2FINT)
|
56
fortran/fort-dim.c
Normal file
56
fortran/fort-dim.c
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF dimension functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-dim.c,v 1.3 2006/08/16 03:56:51 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
|
||||
|
||||
/*
|
||||
* Define a netCDF dimension.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_def_dim, NF_DEF_DIM, nf_def_dim,
|
||||
NCID, STRING, COUNT, PDIMID)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain a netCDF dimension's index.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_dimid, NF_INQ_DIMID, nf_inq_dimid,
|
||||
NCID, STRING, PDIMID)
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about a netCDF dimension.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_inq_dim, NF_INQ_DIM, nf_inq_dim,
|
||||
NCID, DIMID, PSTRING, PCOUNT)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain a netCDF dimension's name.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_dimname, NF_INQ_DIMNAME, nf_inq_dimname,
|
||||
NCID, DIMID, PSTRING)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain a netCDF dimension's length.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_dimlen, NF_INQ_DIMLEN, nf_inq_dimlen,
|
||||
NCID, DIMID, PCOUNT)
|
||||
|
||||
|
||||
/*
|
||||
* Rename a netCDF dimension.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_rename_dim, NF_RENAME_DIM, nf_rename_dim,
|
||||
NCID, DIMID, STRING)
|
70
fortran/fort-genatt.c
Normal file
70
fortran/fort-genatt.c
Normal file
@ -0,0 +1,70 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF attribute functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-genatt.c,v 1.4 2006/08/16 03:56:51 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_inq_att, NF_INQ_ATT, nf_inq_att,
|
||||
NCID, VARID, STRING, PTYPE, PCOUNT)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the index of a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_inq_attid, NF_INQ_ATTID, nf_inq_attid,
|
||||
NCID, VARID, STRING, PATTID)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the type of a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_inq_atttype, NF_INQ_ATTTYPE, nf_inq_atttype,
|
||||
NCID, VARID, STRING, PTYPE)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the length of a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_inq_attlen, NF_INQ_ATTLEN, nf_inq_attlen,
|
||||
NCID, VARID, STRING, PCOUNT)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the name of a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_inq_attname, NF_INQ_ATTNAME, nf_inq_attname,
|
||||
NCID, VARID, ATTID, PSTRING)
|
||||
|
||||
|
||||
/*
|
||||
* Copy an attribute from one netCDF dataset to another.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_copy_att, NF_COPY_ATT, nf_copy_att,
|
||||
NCID1, VARID1, STRING, NCID2, VARID2)
|
||||
|
||||
|
||||
/*
|
||||
* Rename a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_rename_att, NF_RENAME_ATT, nf_rename_att,
|
||||
NCID, VARID, STRING, STRING)
|
||||
|
||||
|
||||
/*
|
||||
* Remove a netCDF attribute.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_del_att, NF_DEL_ATT, nf_del_att,
|
||||
NCID, VARID, STRING)
|
55
fortran/fort-geninq.c
Normal file
55
fortran/fort-geninq.c
Normal file
@ -0,0 +1,55 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF inquiry functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-geninq.c,v 1.4 2006/08/16 03:56:54 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
|
||||
|
||||
/*
|
||||
* Generally inquire about a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_inq, NF_INQ, nf_inq,
|
||||
NCID, PNDIMS, PNVARS, PNATTS, PDIMID)
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about the number of dimensions in a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_inq_ndims, NF_INQ_NDIMS, nf_inq_ndims,
|
||||
NCID, PNDIMS)
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about the number of variables in a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_inq_nvars, NF_INQ_NVARS, nf_inq_nvars,
|
||||
NCID, PNVARS)
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about the number of attributes in a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_inq_natts, NF_INQ_NATTS, nf_inq_natts,
|
||||
NCID, PNATTS)
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about the index of the unlimited dimension in a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_inq_unlimdim, NF_INQ_UNLIMDIM, nf_inq_unlimdim,
|
||||
NCID, PDIMID)
|
||||
|
||||
/*
|
||||
* Inquire about the format version of a netCDF dataset.
|
||||
*/
|
||||
FCALLSCFUN2(NF_INT, nc_inq_format, NF_INQ_FORMAT, nf_inq_format,
|
||||
NCID, PFORMAT)
|
84
fortran/fort-genvar.c
Normal file
84
fortran/fort-genvar.c
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF variable functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-genvar.c,v 1.4 2008/02/19 21:47:05 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
/*
|
||||
* Define a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc_def_var, NF_DEF_VAR, nf_def_var,
|
||||
NCID, STRING, TYPE, NDIMS, DIMIDS, PVARID)
|
||||
|
||||
|
||||
/*
|
||||
* Inquire about a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN7(NF_INT, nc_inq_var, NF_INQ_VAR, nf_inq_var,
|
||||
NCID, VARID, PSTRING, PTYPE, PNDIMS, PDIMIDS, PNATTS)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the ID of a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_varid, NF_INQ_VARID, nf_inq_varid,
|
||||
NCID, STRING, PVARID)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the name of a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_varname, NF_INQ_VARNAME, nf_inq_varname,
|
||||
NCID, VARID, PSTRING)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the type of a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_vartype, NF_INQ_VARTYPE, nf_inq_vartype,
|
||||
NCID, VARID, PTYPE)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the number of dimensions of a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_varndims, NF_INQ_VARNDIMS, nf_inq_varndims,
|
||||
NCID, VARID, PNDIMS)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the shape of a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_vardimid, NF_INQ_VARDIMID, nf_inq_vardimid,
|
||||
NCID, VARID, PDIMIDS)
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the number of attributes of a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_inq_varnatts, NF_INQ_VARNATTS, nf_inq_varnatts,
|
||||
NCID, VARID, PNATTS)
|
||||
|
||||
|
||||
/*
|
||||
* Rename a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_rename_var, NF_RENAME_VAR, nf_rename_var,
|
||||
NCID, VARID, STRING)
|
||||
|
||||
|
||||
/*
|
||||
* Copy a netCDF variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_copy_var, NF_COPY_VAR, nf_copy_var,
|
||||
NCID1, VARID, NCID2)
|
279
fortran/fort-lib.c
Normal file
279
fortran/fort-lib.c
Normal file
@ -0,0 +1,279 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the the conversion of vecors from fortran to C.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-lib.c,v 1.15 2009/02/13 15:58:00 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stddef.h> /* for NULL */
|
||||
#include <errno.h>
|
||||
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Convert a C dimension-ID vector into a FORTRAN dimension-ID vector.
|
||||
*/
|
||||
NF_INTEGER*
|
||||
c2f_dimids(int ncid, int varid, const int* cdimids, NF_INTEGER* fdimids)
|
||||
{
|
||||
int i;
|
||||
int ndims;
|
||||
|
||||
if (nc_inq_varndims(ncid, varid, &ndims) != 0)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
fdimids[ndims - 1 - i] = cdimids[i] + 1;
|
||||
|
||||
return fdimids;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a FORTRAN dimension-ID vector into a C dimension-ID vector.
|
||||
*/
|
||||
int*
|
||||
f2c_dimids(int ndims, const NF_INTEGER* fdimids, int* cdimids)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
cdimids[i] = fdimids[ndims - 1 - i] - 1;
|
||||
|
||||
return cdimids;
|
||||
}
|
||||
|
||||
/* Convert a C dimension-ID vector into a FORTRAN dimension-ID vector. */
|
||||
NF_INTEGER *
|
||||
c2f_chunksizes(int ncid, int varid, const int *cchunksizes, NF_INTEGER *fchunksizes)
|
||||
{
|
||||
int i;
|
||||
int ndims;
|
||||
|
||||
if (nc_inq_varndims(ncid, varid, &ndims))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
fchunksizes[ndims - 1 - i] = cchunksizes[i];
|
||||
|
||||
return fchunksizes;
|
||||
}
|
||||
|
||||
/* Convert a FORTRAN dimension-ID vector into a C dimension-ID vector. */
|
||||
int *
|
||||
f2c_chunksizes(int ncid, int varid, const NF_INTEGER *fchunksizes, int *cchunksizes)
|
||||
{
|
||||
int i;
|
||||
int ndims;
|
||||
|
||||
if (nc_inq_varndims(ncid, varid, &ndims))
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
cchunksizes[i] = fchunksizes[ndims - 1 - i];
|
||||
|
||||
return cchunksizes;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert FORTRAN co-ordinates into C co-ordinates.
|
||||
*/
|
||||
size_t*
|
||||
f2c_coords(int ncid, int varid, const NF_INTEGER* fcoords,
|
||||
size_t* ccoords)
|
||||
{
|
||||
int i;
|
||||
int ndims;
|
||||
|
||||
if (nc_inq_varndims(ncid, varid, &ndims) != 0)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
ccoords[i] = fcoords[ndims - 1 - i] - 1;
|
||||
|
||||
return ccoords;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert FORTRAN counts into C counts.
|
||||
*/
|
||||
size_t*
|
||||
f2c_counts(int ncid, int varid, const NF_INTEGER* fcounts,
|
||||
size_t* ccounts)
|
||||
{
|
||||
int i;
|
||||
int ndims;
|
||||
|
||||
if (nc_inq_varndims(ncid, varid, &ndims) != 0)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
ccounts[i] = fcounts[ndims - 1 - i];
|
||||
|
||||
return ccounts;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert FORTRAN strides into C strides.
|
||||
*
|
||||
* Helper function.
|
||||
*/
|
||||
ptrdiff_t*
|
||||
f2c_strides(int ncid, int varid, const NF_INTEGER* fstrides,
|
||||
ptrdiff_t* cstrides)
|
||||
{
|
||||
int i;
|
||||
int ndims;
|
||||
|
||||
if (nc_inq_varndims(ncid, varid, &ndims) != 0)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < ndims; ++i)
|
||||
cstrides[i] = fstrides[ndims - 1 - i];
|
||||
|
||||
return cstrides;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert a FORTRAN mapping vector into a C mapping vector.
|
||||
*/
|
||||
ptrdiff_t*
|
||||
f2c_maps(int ncid, int varid, const NF_INTEGER* fmaps, ptrdiff_t* cmaps)
|
||||
{
|
||||
return f2c_strides(ncid, varid, fmaps, cmaps);
|
||||
}
|
||||
|
||||
#ifdef USE_NETCDF4
|
||||
/* These appear to only be defined in netcdf-4*/
|
||||
|
||||
/* Get the varids for a fortran function (i.e. add 1 to each
|
||||
* varid.) */
|
||||
int
|
||||
nc_inq_varids_f(int ncid, int *nvars, int *fvarids)
|
||||
{
|
||||
int *varids, nvars1;
|
||||
int i, ret = NC_NOERR;
|
||||
|
||||
/* Get the information from the C library. */
|
||||
if ((ret = nc_inq_varids(ncid, &nvars1, NULL)))
|
||||
return ret;
|
||||
if (!(varids = malloc(nvars1 * sizeof(int))))
|
||||
return NC_ENOMEM;
|
||||
if ((ret = nc_inq_varids(ncid, NULL, varids)))
|
||||
goto exit;
|
||||
|
||||
/* Add one to each, for fortran. */
|
||||
for (i = 0; i < nvars1; i++)
|
||||
fvarids[i] = varids[i] + 1;
|
||||
|
||||
/* Tell the user how many there are. */
|
||||
if (nvars)
|
||||
*nvars = nvars1;
|
||||
|
||||
exit:
|
||||
free(varids);
|
||||
return ret;
|
||||
}
|
||||
/* Get the dimids for a fortran function (i.e. add 1 to each
|
||||
* dimid.) */
|
||||
int
|
||||
nc_inq_dimids_f(int ncid, int *ndims, int *fdimids, int parent)
|
||||
{
|
||||
int *dimids, ndims1;
|
||||
int i, ret = NC_NOERR;
|
||||
|
||||
/* Get the information from the C library. */
|
||||
if ((ret = nc_inq_dimids(ncid, &ndims1, NULL, parent)))
|
||||
return ret;
|
||||
if (!(dimids = malloc(ndims1 * sizeof(int))))
|
||||
return NC_ENOMEM;
|
||||
if ((ret = nc_inq_dimids(ncid, NULL, dimids, parent)))
|
||||
goto exit;
|
||||
|
||||
/* Add one to each, for fortran. */
|
||||
for (i = 0; i < ndims1; i++)
|
||||
fdimids[i] = dimids[i] + 1;
|
||||
|
||||
/* Tell the user how many there are. */
|
||||
if (ndims)
|
||||
*ndims = ndims1;
|
||||
|
||||
exit:
|
||||
free(dimids);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Swap the dim sizes for fortran. */
|
||||
int
|
||||
nc_insert_array_compound_f(int ncid, int typeid, char *name,
|
||||
size_t offset, nc_type field_typeid,
|
||||
int ndims, int *dim_sizesp)
|
||||
{
|
||||
int *dim_sizes_f;
|
||||
int i, ret;
|
||||
|
||||
if (ndims <= 0)
|
||||
return NC_EINVAL;
|
||||
|
||||
/* Allocate some storage to hold ids. */
|
||||
if (!(dim_sizes_f = malloc(ndims * sizeof(int))))
|
||||
return NC_ENOMEM;
|
||||
|
||||
/* Create a backwards list of dimension sizes. */
|
||||
for (i = 0; i < ndims; i++)
|
||||
dim_sizes_f[i] = dim_sizesp[ndims - i - 1];
|
||||
|
||||
/* Call with backwards list. */
|
||||
ret = nc_insert_array_compound(ncid, typeid, name, offset, field_typeid,
|
||||
ndims, dim_sizes_f);
|
||||
|
||||
/* Clean up. */
|
||||
free(dim_sizes_f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
nc_inq_compound_field_f(int ncid, nc_type xtype, int fieldid, char *name,
|
||||
size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
|
||||
int *dim_sizesp)
|
||||
{
|
||||
int ndims;
|
||||
int ret;
|
||||
|
||||
/* Find out how many dims. */
|
||||
if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, NULL, NULL,
|
||||
NULL, &ndims, NULL)))
|
||||
return ret;
|
||||
|
||||
/* Call the function. */
|
||||
if ((ret = nc_inq_compound_field(ncid, xtype, fieldid, name, offsetp,
|
||||
field_typeidp, ndimsp, dim_sizesp)))
|
||||
return ret;
|
||||
|
||||
/* Swap the order of the dimsizes. */
|
||||
if (ndims)
|
||||
{
|
||||
int *f, *b, temp;
|
||||
for (f = dim_sizesp, b = &dim_sizesp[ndims - 1]; f < b; f++, b--)
|
||||
{
|
||||
temp = *f;
|
||||
*f = *b;
|
||||
*b = temp;
|
||||
}
|
||||
}
|
||||
|
||||
return NC_NOERR;
|
||||
}
|
||||
|
||||
#endif /*USE_NETCDF4*/
|
104
fortran/fort-lib.h
Normal file
104
fortran/fort-lib.h
Normal file
@ -0,0 +1,104 @@
|
||||
/* $Id: fort-lib.h,v 1.7 2009/02/01 16:14:54 ed Exp $ */
|
||||
|
||||
|
||||
#ifndef UD_FORT_LIB_H
|
||||
#define UD_FORT_LIB_H
|
||||
|
||||
|
||||
#include <stddef.h> /* for ptrdiff_t, size_t */
|
||||
#include "ncfortran.h"
|
||||
|
||||
|
||||
/*
|
||||
* PURPOSE: Convert a C dimension-ID vector into a FORTRAN dimension-ID
|
||||
* vector
|
||||
* REQUIRE: <ncid> is valid && <varid> is valid && <cdimids> != NULL &&
|
||||
* <fdimids> != NULL && <cdimids> != <fdimids>
|
||||
* PROMISE: The order of the dimensions will be reversed and 1 will be
|
||||
* added to each element. RESULT == <fdimids>
|
||||
*/
|
||||
extern NF_INTEGER*
|
||||
c2f_dimids(int ncid, /* netCDF dataset ID */
|
||||
int varid, /* netCDF variable ID */
|
||||
const int* cdimids, /* C dim IDs */
|
||||
NF_INTEGER* fdimids); /* FORTRAN dim IDs */
|
||||
|
||||
|
||||
/*
|
||||
* PURPOSE: Convert a FORTRAN dimension-ID vector into a C dimension-ID
|
||||
* vector
|
||||
* REQUIRE: <ndims> == 0 || (<ndims> >= 0 && <fdimids> != NULL &&
|
||||
* <cdimids> != NULL && <fdimids> != <cdimids>)
|
||||
* PROMISE: The order of the dimensions will be reversed and 1 will be
|
||||
* subtracted from each element. RESULT == <cdimids>
|
||||
*/
|
||||
extern int*
|
||||
f2c_dimids(int ndims, /* number of dims */
|
||||
const NF_INTEGER* fdimids, /* FORTRAN dim IDs */
|
||||
int* cdimids); /* C dim IDs */
|
||||
|
||||
/* These two are the same as the dimids, but for chunksizes, so that 1
|
||||
* is not added/subtracted. */
|
||||
extern NF_INTEGER* c2f_chunksizes(int ncid, int varid, const int* cchunksizes,
|
||||
NF_INTEGER *fchunksizes);
|
||||
|
||||
extern int* f2c_chunksizes(int ncid, int varid, const NF_INTEGER *fchunksizes,
|
||||
int *cchunksizes);
|
||||
|
||||
/*
|
||||
* PURPOSE: Convert a FORTRAN co-ordinate vector into a C co-ordinate vector
|
||||
* REQUIRE: <ncid> refers to an open dataset && <varid> refers to an
|
||||
* existing variable && <fcoords> != NULL && <ccoords> != NULL &&
|
||||
* <fcoords> != <ccoords>
|
||||
* PROMISE: The order of the co-ordinates will be reversed and 1 will be
|
||||
* subtracted from each element. RESULT == <ccoords>.
|
||||
*/
|
||||
extern size_t*
|
||||
f2c_coords(int ncid, /* dataset ID */
|
||||
int varid, /* variable ID */
|
||||
const NF_INTEGER* fcoords, /* FORTRAN coords */
|
||||
size_t* ccoords); /* C coords */
|
||||
|
||||
/*
|
||||
* PURPOSE: Convert a FORTRAN edge-count vector into a C edge-count vector
|
||||
* REQUIRE: <ncid> refers to an open dataset && <varid> refers to an
|
||||
* existing variable && <fcounts> != NULL && <ccounts> != NULL &&
|
||||
* <fcounts> != <ccounts> && <fcounts> != <ccounts>
|
||||
* PROMISE: The order of the edge-counts will be reversed.
|
||||
* RESULT == <ccounts>.
|
||||
*/
|
||||
extern size_t*
|
||||
f2c_counts(int ncid, /* dataset ID */
|
||||
int varid, /* variable ID */
|
||||
const NF_INTEGER* fcounts, /* FORTRAN counts */
|
||||
size_t* ccounts); /* C counts */
|
||||
|
||||
/*
|
||||
* PURPOSE: Convert a FORTRAN stride vector into a C stride vector
|
||||
* REQUIRE: <ncid> refers to an open dataset && <varid> refers to an
|
||||
* existing variable && <fstrides> != NULL && <cstrides> != NULL &&
|
||||
* <fstrides> != <cstrides>
|
||||
* PROMISE: The order of the strides will be reversed. RESULT == <cstrides>.
|
||||
*/
|
||||
extern ptrdiff_t*
|
||||
f2c_strides(int ncid, /* dataset ID */
|
||||
int varid, /* variable ID */
|
||||
const NF_INTEGER* fstrides, /* FORTRAN strides */
|
||||
ptrdiff_t* cstrides); /* C strides */
|
||||
|
||||
/*
|
||||
* PURPOSE: Convert a FORTRAN mapping vector into a C mapping vector
|
||||
* REQUIRE: <ncid> refers to an open dataset && <varid> refers to an
|
||||
* existing variable && <fmaps> != NULL && <cmaps> != NULL &&
|
||||
* <fmaps> != <cmaps>
|
||||
* PROMISE: The order of the mapping vector will be reversed.
|
||||
* RESULT == <cmaps>.
|
||||
*/
|
||||
extern ptrdiff_t*
|
||||
f2c_maps(int ncid, /* dataset ID */
|
||||
int varid, /* variable ID */
|
||||
const NF_INTEGER* fmaps, /* FORTRAN mapping */
|
||||
ptrdiff_t* cmaps); /* C mapping */
|
||||
|
||||
|
||||
#endif /* header-file lockout */
|
53
fortran/fort-misc.c
Normal file
53
fortran/fort-misc.c
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF strerror and libvers functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-misc.c,v 1.8 2007/07/26 20:29:45 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "ncfortran.h"
|
||||
|
||||
|
||||
/*
|
||||
* Return a string that identifies the version of the netCDF library.
|
||||
*/
|
||||
FCALLSCFUN0(STRING, (char*)nc_inq_libvers, NF_INQ_LIBVERS, nf_inq_libvers)
|
||||
|
||||
|
||||
/*
|
||||
* Return the string associated with an error code.
|
||||
*/
|
||||
#ifdef ABSOFT10_HACK
|
||||
extern void NF_STRERROR(char *AS, unsigned D0, const int *A1)
|
||||
{
|
||||
char *A0;
|
||||
A0= (char*)nc_strerror( (int)*A1 );
|
||||
memcpy(AS,A0, (D0<(A0==((void *)0)?0:strlen(A0))?D0:(A0==((void *)0)?0:strlen(A0))) );
|
||||
D0>(A0==((void *)0)?0:strlen(A0))?memset(AS+(A0==((void *)0)?0:strlen(A0)), ' ', D0-(A0==((void *)0)?0:strlen(A0))):0;
|
||||
return ;
|
||||
}
|
||||
#else
|
||||
FCALLSCFUN1(STRING, (char*)nc_strerror, NF_STRERROR, nf_strerror,
|
||||
FINT2CINT)
|
||||
#endif
|
||||
|
||||
|
||||
static int
|
||||
nc_issyserr(int errcode)
|
||||
{
|
||||
return errcode > 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Indicate whether or not an error-code refers to a system error
|
||||
* rather than a netCDF error
|
||||
*/
|
||||
FCALLSCFUN1(LOGICAL, nc_issyserr, NF_ISSYSERR, nf_issyserr,
|
||||
FINT2CINT)
|
251
fortran/fort-nc4.c
Normal file
251
fortran/fort-nc4.c
Normal file
@ -0,0 +1,251 @@
|
||||
/*
|
||||
This file is part of netcdf-4, a netCDF-like interface for HDF5, or a
|
||||
HDF5 backend for netCDF, depending on your point of view.
|
||||
|
||||
This file provides the fortran functions for the new functions added
|
||||
to the API as part of netCDF-4. This file is only compiled for
|
||||
netCDF-4 builds.
|
||||
|
||||
Copyright 2005, University Corporation for Atmospheric Research. See
|
||||
COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-nc4.c,v 1.55 2010/01/19 18:31:43 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include <ncfortran.h>
|
||||
#include <fort-lib.h>
|
||||
|
||||
/* Prototypes for some extra functions in fort-lib.c. */
|
||||
int nc_inq_varids_f(int ncid, int *nvars, int *fvarids);
|
||||
int nc_inq_dimids_f(int ncid, int *ndims, int *fdimids, int parent);
|
||||
int nc_insert_array_compound_f(int ncid, int typeid, char *name,
|
||||
size_t offset, nc_type field_typeid,
|
||||
int ndims, int *dim_sizesp);
|
||||
int nc_inq_compound_field_f(int ncid, nc_type xtype, int fieldid, char *name,
|
||||
size_t *offsetp, nc_type *field_typeidp, int *ndimsp,
|
||||
int *dim_sizesp);
|
||||
|
||||
/* These are in libsrc4/nc4vars.c... */
|
||||
int nc_inq_var_chunking_ints(int ncid, int varid, int *contiguousp, int *chunksizesp);
|
||||
int nc_def_var_chunking_ints(int ncid, int varid, int contiguous, int *chunksizes);
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_create_par_fortran, NF_CREATE_PAR, nf_create_par,
|
||||
STRING, FINT2CINT, FINT2CINT, FINT2CINT, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_open_par_fortran, NF_OPEN_PAR, nf_open_par,
|
||||
STRING, FINT2CINT, FINT2CINT, FINT2CINT, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_var_par_access, NF_VAR_PAR_ACCESS, nf_var_par_access,
|
||||
NCID, VARID, FINT2CINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_ncid, NF_INQ_NCID, nf_inq_ncid,
|
||||
NCID, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_grps, NF_INQ_GRPS, nf_inq_grps,
|
||||
NCID, PCINT2FINT, INTV)
|
||||
|
||||
FCALLSCFUN2(NF_INT, nc_inq_grpname, NF_INQ_GRPNAME, nf_inq_grpname,
|
||||
NCID, PSTRING)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_grpname_full, NF_INQ_GRPNAME_FULL, nf_inq_grpname_full,
|
||||
NCID, PSIZET, PSTRING)
|
||||
|
||||
FCALLSCFUN2(NF_INT, nc_inq_grpname_len, NF_INQ_GRPNAME_LEN, nf_inq_grpname_len,
|
||||
NCID, PSIZET)
|
||||
|
||||
FCALLSCFUN2(NF_INT, nc_inq_grp_parent, NF_INQ_GRP_PARENT, nf_inq_grp_parent,
|
||||
NCID, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_grp_ncid, NF_INQ_GRP_NCID, nf_inq_grp_ncid,
|
||||
NCID, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_grp_full_ncid, NF_INQ_GRP_FULL_NCID, nf_inq_grp_full_ncid,
|
||||
NCID, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_varids_f, NF_INQ_VARIDS, nf_inq_varids,
|
||||
NCID, PCINT2FINT, INTV)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_dimids_f, NF_INQ_DIMIDS, nf_inq_dimids,
|
||||
NCID, PCINT2FINT, INTV, FINT2CINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_typeids, NF_INQ_TYPEIDS, nf_inq_typeids,
|
||||
NCID, PCINT2FINT, INTV)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_typeid, NF_INQ_TYPEID, nf_inq_typeid,
|
||||
NCID, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_def_grp, NF_DEF_GRP, nf_def_grp,
|
||||
NCID, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_def_compound, NF_DEF_COMPOUND, nf_def_compound,
|
||||
NCID, FINT2CSIZET, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_insert_compound, NF_INSERT_COMPOUND, nf_insert_compound,
|
||||
NCID, FINT2CINT, STRING, FINT2CSIZET, FINT2CINT)
|
||||
|
||||
FCALLSCFUN7(NF_INT, nc_insert_array_compound_f, NF_INSERT_ARRAY_COMPOUND,
|
||||
nf_insert_array_compound,
|
||||
NCID, FINT2CINT, STRING, FINT2CSIZET,
|
||||
FINT2CINT, FINT2CINT, INTV)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_type, NF_INQ_TYPE, nf_inq_type,
|
||||
NCID, FINT2CINT, STRING, PSIZET)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_inq_compound, NF_INQ_COMPOUND, nf_inq_compound,
|
||||
NCID, FINT2CINT, STRING, PSIZET, PSIZET)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_compound_name, NF_INQ_COMPOUND_NAME, nf_inq_compound_name,
|
||||
NCID, FINT2CINT, STRING)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_compound_size, NF_INQ_COMPOUND_SIZE, nf_inq_compound_size,
|
||||
NCID, FINT2CINT, PSIZET)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_compound_nfields, NF_INQ_COMPOUND_NFIELDS,
|
||||
nf_inq_compound_nfields,
|
||||
NCID, FINT2CINT, PSIZET)
|
||||
|
||||
FCALLSCFUN8(NF_INT, nc_inq_compound_field_f, NF_INQ_COMPOUND_FIELD,
|
||||
nf_inq_compound_field,
|
||||
NCID, FINT2CINT, VARID, PSTRING, PSIZET, PCINT2FINT,
|
||||
PCINT2FINT, INTV)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_compound_fieldname, NF_INQ_COMPOUND_FIELDNAME,
|
||||
nf_inq_compound_fieldname,
|
||||
NCID, FINT2CINT, FIELDIDX, PSTRING)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_compound_fieldindex, NF_INQ_COMPOUND_FIELDINDEX,
|
||||
nf_inq_compound_fieldindex,
|
||||
NCID, FINT2CINT, STRING, PCNDX2FNDX)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_compound_fieldoffset, NF_INQ_COMPOUND_FIELDOFFSET,
|
||||
nf_inq_compound_fieldoffset,
|
||||
NCID, FINT2CINT, FIELDIDX, PSIZET)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_compound_fieldtype, NF_INQ_COMPOUND_FIELDTYPE,
|
||||
nf_inq_compound_fieldtype,
|
||||
NCID, FINT2CINT, FIELDIDX, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_compound_fieldndims, NF_INQ_COMPOUND_FIELDNDIMS,
|
||||
nf_inq_compound_fieldndims,
|
||||
NCID, FINT2CINT, FIELDIDX, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_compound_fielddim_sizes, NF_INQ_COMPOUND_FIELDDIM_SIZES,
|
||||
nf_inq_compound_fielddim_sizes,
|
||||
NCID, FINT2CINT, FIELDIDX, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_def_vlen, NF_DEF_VLEN, nf_def_vlen,
|
||||
NCID, STRING, FINT2CINT, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_inq_vlen, NF_INQ_VLEN, nf_inq_vlen,
|
||||
NCID, FINT2CINT, PSTRING, PSIZET, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN7(NF_INT, nc_inq_user_type, NF_INQ_USER_TYPE, nf_inq_user_type,
|
||||
NCID, FINT2CINT, PSTRING, PSIZET, PCINT2FINT, PSIZET, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_def_enum, NF_DEF_ENUM, nf_def_enum,
|
||||
NCID, FINT2CINT, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_insert_enum, NF_INSERT_ENUM, nf_insert_enum,
|
||||
NCID, FINT2CINT, STRING, PVOID)
|
||||
|
||||
FCALLSCFUN6(NF_INT, nc_inq_enum, NF_INQ_ENUM, nf_inq_enum,
|
||||
NCID, FINT2CINT, STRING, PCINT2FINT, PSIZET, PSIZET)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_inq_enum_member, NF_INQ_ENUM_MEMBER, nf_inq_enum_member,
|
||||
NCID, FINT2CINT, FNDX2CNDX, PSTRING, PVOID)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_enum_ident, NF_INQ_ENUM_IDENT, nf_inq_enum_ident,
|
||||
NCID, FINT2CINT, FINT2CINT, PSTRING)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_def_opaque, NF_DEF_OPAQUE, nf_def_opaque,
|
||||
NCID, FINT2CSIZET, STRING, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_opaque, NF_INQ_OPAQUE, nf_inq_opaque,
|
||||
NCID, FINT2CSIZET, STRING, PSIZET)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_def_var_chunking_ints, NF_DEF_VAR_CHUNKING, nf_def_var_chunking,
|
||||
NCID, VARID, FINT2CINT, CHUNKSIZES)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_def_var_deflate, NF_DEF_VAR_DEFLATE, nf_def_var_deflate,
|
||||
NCID, VARID, FINT2CINT, FINT2CINT, FINT2CINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_def_var_fill, NF_DEF_VAR_FILL, nf_def_var_fill,
|
||||
NCID, VARID, FINT2CINT, PVOID)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_var_fill, NF_INQ_VAR_FILL, nf_inq_var_fill,
|
||||
NCID, VARID, PCINT2FINT, PVOID)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_def_var_fletcher32, NF_DEF_VAR_FLETCHER32, nf_def_var_fletcher32,
|
||||
NCID, VARID, FINT2CINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_var_chunking_ints, NF_INQ_VAR_CHUNKING, nf_inq_var_chunking,
|
||||
NCID, VARID, PCINT2FINT, PCHUNKSIZES)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_inq_var_deflate, NF_INQ_VAR_DEFLATE, nf_inq_var_deflate,
|
||||
NCID, VARID, PCINT2FINT, PCINT2FINT, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_inq_var_szip, NF_INQ_VAR_SZIP, nf_inq_var_szip,
|
||||
NCID, VARID, PCINT2FINT, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_var_fletcher32, NF_INQ_VAR_FLETCHER32, nf_inq_var_fletcher32,
|
||||
NCID, VARID, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_def_var_endian, NF_DEF_VAR_ENDIAN, nf_def_var_endian,
|
||||
NCID, VARID, FINT2CINT)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_inq_var_endian, NF_INQ_VAR_ENDIAN, nf_inq_var_endian,
|
||||
NCID, VARID, PCINT2FINT)
|
||||
|
||||
FCALLSCFUN6(NF_INT, nc_put_att, NF_PUT_ATT, nf_put_att,
|
||||
NCID, VARID, STRING, FINT2CINT, FINT2CSIZET, PVOID)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_get_att, NF_GET_ATT, nf_get_att,
|
||||
NCID, VARID, STRING, PVOID)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_put_vlen_element, NF_PUT_VLEN_ELEMENT, nf_put_vlen_element,
|
||||
NCID, FINT2CINT, PVOID, FINT2CSIZET, PVOID)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_get_vlen_element, NF_GET_VLEN_ELEMENT, nf_get_vlen_element,
|
||||
NCID, FINT2CINT, PVOID, PSIZET, PVOID)
|
||||
|
||||
FCALLSCFUN1(NF_INT, nc_free_vlen, NF_FREE_VLEN, nf_free_vlen, PVOID)
|
||||
FCALLSCFUN2(NF_INT, nc_free_vlens, NF_FREE_VLENS, nf_free_vlens, FINT2CSIZET, PVOID)
|
||||
FCALLSCFUN2(NF_INT, nc_free_string, NF_FREE_STRING, nf_free_string, FINT2CSIZET, PVOID)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_longlong, NF_PUT_VAR1_INT64, nf_put_var1_int64,
|
||||
NCID, VARID, COORDS, INTVAR)
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_longlong, NF_PUT_VARA_INT64, nf_put_vara_int64,
|
||||
NCID, VARID, COORDS, COUNTS, INTVARV)
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_longlong, NF_PUT_VARS_INT64, nf_put_vars_int64,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INTVARV)
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_longlong, NF_PUT_VARM_INT64, nf_put_varm_int64,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_longlong, NF_PUT_VAR_INT64, nf_put_var_int64,
|
||||
NCID, VARID, PINTVAR)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_longlong, NF_GET_VAR1_INT64, nf_get_var1_int64,
|
||||
NCID, VARID, COORDS, INTVAR)
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_longlong, NF_GET_VARA_INT64, nf_get_vara_int64,
|
||||
NCID, VARID, COORDS, COUNTS, INTVARV)
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_longlong, NF_GET_VARS_INT64, nf_get_vars_int64,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INTVARV)
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_longlong, NF_GET_VARM_INT64, nf_get_varm_int64,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_longlong, NF_GET_VAR_INT64, nf_get_var_int64,
|
||||
NCID, VARID, PINTVAR)
|
||||
|
||||
FCALLSCFUN3(NF_INT, nc_set_chunk_cache_ints, NF_SET_CHUNK_CACHE, nf_set_chunk_cache,
|
||||
INT, INT, INT)
|
||||
FCALLSCFUN3(NF_INT, nc_get_chunk_cache_ints, NF_GET_CHUNK_CACHE, nf_get_chunk_cache,
|
||||
PINT, PINT, PINT)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_set_var_chunk_cache_ints, NF_SET_VAR_CHUNK_CACHE, nf_set_var_chunk_cache,
|
||||
NCID, VARID, INT, INT, INT)
|
||||
FCALLSCFUN5(NF_INT, nc_get_var_chunk_cache_ints, NF_GET_VAR_CHUNK_CACHE, nf_get_var_chunk_cache,
|
||||
NCID, VARID, PINT, PINT, PINT)
|
||||
|
||||
|
||||
|
||||
|
1978
fortran/fort-v2compat.c
Normal file
1978
fortran/fort-v2compat.c
Normal file
File diff suppressed because it is too large
Load Diff
166
fortran/fort-var1io.c
Normal file
166
fortran/fort-var1io.c
Normal file
@ -0,0 +1,166 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF var1 functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-var1io.c,v 1.10 2008/02/25 17:24:24 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "nfconfig.inc"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Write a single value from a FORTRAN CHARACTER*(*) variable (the
|
||||
* `single value' is the whole string).
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_text, NF_PUT_VAR1_TEXT, nf_put_var1_text,
|
||||
NCID, VARID, COORDS, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Read a single value into a FORTRAN CHARACTER*(*) variable (the
|
||||
* `single value' is the whole string).
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_text, NF_GET_VAR1_TEXT, nf_get_var1_text,
|
||||
NCID, VARID, COORDS, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Write a single value from a FORTRAN INTEGER*1 variable.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_schar, NF_PUT_VAR1_INT1, nf_put_var1_int1,
|
||||
NCID, VARID, COORDS, INT1VAR)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_short, NF_PUT_VAR1_INT1, nf_put_var1_int1,
|
||||
NCID, VARID, COORDS, INT1VAR)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_int, NF_PUT_VAR1_INT1, nf_put_var1_int1,
|
||||
NCID, VARID, COORDS, INT1VAR)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_long, NF_PUT_VAR1_INT1, nf_put_var1_int1,
|
||||
NCID, VARID, COORDS, INT1VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read a single value into a FORTRAN INTEGER*1 variable.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_schar, NF_GET_VAR1_INT1, nf_get_var1_int1,
|
||||
NCID, VARID, COORDS, PINT1VAR)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_short, NF_GET_VAR1_INT1, nf_get_var1_int1,
|
||||
NCID, VARID, COORDS, PINT1VAR)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_int, NF_GET_VAR1_INT1, nf_get_var1_int1,
|
||||
NCID, VARID, COORDS, PINT1VAR)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_long, NF_GET_VAR1_INT1, nf_get_var1_int1,
|
||||
NCID, VARID, COORDS, PINT1VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write a single value from a FORTRAN INTEGER*2 variable.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_short, NF_PUT_VAR1_INT2, nf_put_var1_int2,
|
||||
NCID, VARID, COORDS, INT2VAR)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_int, NF_PUT_VAR1_INT2, nf_put_var1_int2,
|
||||
NCID, VARID, COORDS, INT2VAR)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_long, NF_PUT_VAR1_INT2, nf_put_var1_int2,
|
||||
NCID, VARID, COORDS, INT2VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read a single value into a FORTRAN INTEGER*2 variable.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_short, NF_GET_VAR1_INT2, nf_get_var1_int2,
|
||||
NCID, VARID, COORDS, PINT2VAR)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_int, NF_GET_VAR1_INT2, nf_get_var1_int2,
|
||||
NCID, VARID, COORDS, PINT2VAR)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_long, NF_GET_VAR1_INT2, nf_get_var1_int2,
|
||||
NCID, VARID, COORDS, PINT2VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write a single value from a FORTRAN INTEGER variable.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_int, NF_PUT_VAR1_INT, nf_put_var1_int,
|
||||
NCID, VARID, COORDS, INTVAR)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_long, NF_PUT_VAR1_INT, nf_put_var1_int,
|
||||
NCID, VARID, COORDS, INTVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read a single value into a FORTRAN INTEGER variable.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_int, NF_GET_VAR1_INT, nf_get_var1_int,
|
||||
NCID, VARID, COORDS, PINTVAR)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_long, NF_GET_VAR1_INT, nf_get_var1_int,
|
||||
NCID, VARID, COORDS, PINTVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write a single value from a FORTRAN REAL variable.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_double, NF_PUT_VAR1_REAL, nf_put_var1_real,
|
||||
NCID, VARID, COORDS, DOUBLEVAR)
|
||||
#else
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_float, NF_PUT_VAR1_REAL, nf_put_var1_real,
|
||||
NCID, VARID, COORDS, REALVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read a single value into a FORTRAN REAL variable.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_double, NF_GET_VAR1_REAL, nf_get_var1_real,
|
||||
NCID, VARID, COORDS, PDOUBLEVAR)
|
||||
#else
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_float, NF_GET_VAR1_REAL, nf_get_var1_real,
|
||||
NCID, VARID, COORDS, PREALVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write a single value from a FORTRAN DOUBLEPRECISION variable.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1_double, NF_PUT_VAR1_DOUBLE, nf_put_var1_double,
|
||||
NCID, VARID, COORDS, DOUBLEVAR)
|
||||
|
||||
|
||||
/*
|
||||
* Read a single value into a FORTRAN DOUBLEPRECISION variable.
|
||||
*/
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1_double, NF_GET_VAR1_DOUBLE, nf_get_var1_double,
|
||||
NCID, VARID, COORDS, PDOUBLEVAR)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_put_var1, NF_PUT_VAR1, nf_put_var1,
|
||||
NCID, VARID, COORDS, PVOID)
|
||||
|
||||
FCALLSCFUN4(NF_INT, nc_get_var1, NF_GET_VAR1, nf_get_var1,
|
||||
NCID, VARID, COORDS, PVOID)
|
164
fortran/fort-varaio.c
Normal file
164
fortran/fort-varaio.c
Normal file
@ -0,0 +1,164 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF vara functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-varaio.c,v 1.10 2008/02/25 17:24:24 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "nfconfig.inc"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_text, NF_PUT_VARA_TEXT, nf_put_vara_text,
|
||||
NCID, VARID, COORDS, COUNTS, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_text, NF_GET_VARA_TEXT, nf_get_vara_text,
|
||||
NCID, VARID, COORDS, COUNTS, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER*1 variable array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_schar, NF_PUT_VARA_INT1, nf_put_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, INT1VARV)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_short, NF_PUT_VARA_INT1, nf_put_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, INT1VARV)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_int, NF_PUT_VARA_INT1, nf_put_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, INT1VARV)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_long, NF_PUT_VARA_INT1, nf_put_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, INT1VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER*1 variable array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_schar, NF_GET_VARA_INT1, nf_get_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_short, NF_GET_VARA_INT1, nf_get_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_int, NF_GET_VARA_INT1, nf_get_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_long, NF_GET_VARA_INT1, nf_get_vara_int1,
|
||||
NCID, VARID, COORDS, COUNTS, PINT1VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER*2 variable array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_short, NF_PUT_VARA_INT2, nf_put_vara_int2,
|
||||
NCID, VARID, COORDS, COUNTS, INT2VARV)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_int, NF_PUT_VARA_INT2, nf_put_vara_int2,
|
||||
NCID, VARID, COORDS, COUNTS, INT2VARV)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_long, NF_PUT_VARA_INT2, nf_put_vara_int2,
|
||||
NCID, VARID, COORDS, COUNTS, INT2VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER*2 variable array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_short, NF_GET_VARA_INT2, nf_get_vara_int2,
|
||||
NCID, VARID, COORDS, COUNTS, PINT2VARV)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_int, NF_GET_VARA_INT2, nf_get_vara_int2,
|
||||
NCID, VARID, COORDS, COUNTS, PINT2VARV)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_long, NF_GET_VARA_INT2, nf_get_vara_int2,
|
||||
NCID, VARID, COORDS, COUNTS, PINT2VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER variable array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_int, NF_PUT_VARA_INT, nf_put_vara_int,
|
||||
NCID, VARID, COORDS, COUNTS, INTVARV)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_long, NF_PUT_VARA_INT, nf_put_vara_int,
|
||||
NCID, VARID, COORDS, COUNTS, INTVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER variable array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_int, NF_GET_VARA_INT, nf_get_vara_int,
|
||||
NCID, VARID, COORDS, COUNTS, PINTVARV)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_long, NF_GET_VARA_INT, nf_get_vara_int,
|
||||
NCID, VARID, COORDS, COUNTS, PINTVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN REAL variable array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_double, NF_PUT_VARA_REAL, nf_put_vara_real,
|
||||
NCID, VARID, COORDS, COUNTS, DOUBLEVARV)
|
||||
#else
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_float, NF_PUT_VARA_REAL, nf_put_vara_real,
|
||||
NCID, VARID, COORDS, COUNTS, REALVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN REAL variable array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_double, NF_GET_VARA_REAL, nf_get_vara_real,
|
||||
NCID, VARID, COORDS, COUNTS, PDOUBLEVARV)
|
||||
#else
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_float, NF_GET_VARA_REAL, nf_get_vara_real,
|
||||
NCID, VARID, COORDS, COUNTS, PREALVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN DOUBLEPRECISION variable array.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara_double, NF_PUT_VARA_DOUBLE, nf_put_vara_double,
|
||||
NCID, VARID, COORDS, COUNTS, DOUBLEVARV)
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN DOUBLEPRECISION variable array.
|
||||
*/
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara_double, NF_GET_VARA_DOUBLE, nf_get_vara_double,
|
||||
NCID, VARID, COORDS, COUNTS, PDOUBLEVARV)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_put_vara, NF_PUT_VARA, nf_put_vara,
|
||||
NCID, VARID, COORDS, COUNTS, PVOID)
|
||||
|
||||
FCALLSCFUN5(NF_INT, nc_get_vara, NF_GET_VARA, nf_get_vara,
|
||||
NCID, VARID, COORDS, COUNTS, PVOID)
|
168
fortran/fort-vario.c
Normal file
168
fortran/fort-vario.c
Normal file
@ -0,0 +1,168 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF var functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-vario.c,v 1.15 2008/03/21 15:49:16 dmh Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "nfconfig.inc"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Write an entire variable from a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_text, NF_PUT_VAR_TEXT, nf_put_var_text,
|
||||
NCID, VARID, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Read an entire variable into a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_text, NF_GET_VAR_TEXT, nf_get_var_text,
|
||||
NCID, VARID, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Write an entire variable from a FORTRAN INTEGER*1 variable.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_schar, NF_PUT_VAR_INT1, nf_put_var_int1,
|
||||
NCID, VARID, INT1VAR)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_short, NF_PUT_VAR_INT1, nf_put_var_int1,
|
||||
NCID, VARID, INT1VAR)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_int, NF_PUT_VAR_INT1, nf_put_var_int1,
|
||||
NCID, VARID, INT1VAR)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_long, NF_PUT_VAR_INT1, nf_put_var_int1,
|
||||
NCID, VARID, INT1VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an entire variable into a FORTRAN INTEGER*1 variable.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_schar, NF_GET_VAR_INT1, nf_get_var_int1,
|
||||
NCID, VARID, PINT1VAR)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_short, NF_GET_VAR_INT1, nf_get_var_int1,
|
||||
NCID, VARID, PINT1VAR)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_int, NF_GET_VAR_INT1, nf_get_var_int1,
|
||||
NCID, VARID, PINT1VAR)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_long, NF_GET_VAR_INT1, nf_get_var_int1,
|
||||
NCID, VARID, PINT1VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an entire variable from a FORTRAN INTEGER*2 variable.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_short, NF_PUT_VAR_INT2, nf_put_var_int2,
|
||||
NCID, VARID, INT2VAR)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_int, NF_PUT_VAR_INT2, nf_put_var_int2,
|
||||
NCID, VARID, INT2VAR)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_long, NF_PUT_VAR_INT2, nf_put_var_int2,
|
||||
NCID, VARID, INT2VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an entire variable into a FORTRAN INTEGER*2 variable.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_short, NF_GET_VAR_INT2, nf_get_var_int2,
|
||||
NCID, VARID, PINT2VAR)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_int, NF_GET_VAR_INT2, nf_get_var_int2,
|
||||
NCID, VARID, PINT2VAR)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_long, NF_GET_VAR_INT2, nf_get_var_int2,
|
||||
NCID, VARID, PINT2VAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an entire variable from a FORTRAN INTEGER variable.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_int, NF_PUT_VAR_INT, nf_put_var_int,
|
||||
NCID, VARID, INTVAR)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_long, NF_PUT_VAR_INT, nf_put_var_int,
|
||||
NCID, VARID, INTVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an entire variable into a FORTRAN INTEGER variable.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_int, NF_GET_VAR_INT, nf_get_var_int,
|
||||
NCID, VARID, PINTVAR)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_long, NF_GET_VAR_INT, nf_get_var_int,
|
||||
NCID, VARID, PINTVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an entire variable from a FORTRAN REAL variable.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_double, NF_PUT_VAR_REAL, nf_put_var_real,
|
||||
NCID, VARID, DOUBLEVAR)
|
||||
#else
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_float, NF_PUT_VAR_REAL, nf_put_var_real,
|
||||
NCID, VARID, REALVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read an entire variable into a FORTRAN REAL variable.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_double, NF_GET_VAR_REAL, nf_get_var_real,
|
||||
NCID, VARID, PDOUBLEVAR)
|
||||
#else
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_float, NF_GET_VAR_REAL, nf_get_var_real,
|
||||
NCID, VARID, PREALVAR)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write an entire variable from a FORTRAN DOUBLEPRECISION variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_put_var_double, NF_PUT_VAR_DOUBLE, nf_put_var_double,
|
||||
NCID, VARID, DOUBLEVAR)
|
||||
|
||||
|
||||
/*
|
||||
* Read an entire variable into a FORTRAN DOUBLEPRECISION variable.
|
||||
*/
|
||||
FCALLSCFUN3(NF_INT, nc_get_var_double, NF_GET_VAR_DOUBLE, nf_get_var_double,
|
||||
NCID, VARID, PDOUBLEVAR)
|
||||
|
||||
/* Apparently only defined for netcdf-4 */
|
||||
#ifdef USE_NETCDF4
|
||||
|
||||
/* Handle any type. */
|
||||
FCALLSCFUN3(NF_INT, nc_put_var, NF_PUT_VAR, nf_put_var, NCID, VARID, PVOID)
|
||||
|
||||
/* Handle any type. */
|
||||
FCALLSCFUN3(NF_INT, nc_get_var, NF_GET_VAR, nf_get_var, NCID, VARID, PVOID)
|
||||
#endif
|
158
fortran/fort-varmio.c
Normal file
158
fortran/fort-varmio.c
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF varm functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-varmio.c,v 1.9 2006/08/16 03:55:12 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "nfconfig.inc"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_text, NF_PUT_VARM_TEXT, nf_put_varm_text,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_text, NF_GET_VARM_TEXT, nf_get_varm_text,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER*1 variable array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_schar, NF_PUT_VARM_INT1, nf_put_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT1VARV)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_short, NF_PUT_VARM_INT1, nf_put_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT1VARV)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_int, NF_PUT_VARM_INT1, nf_put_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT1VARV)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_long, NF_PUT_VARM_INT1, nf_put_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT1VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER*1 variable array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_schar, NF_GET_VARM_INT1, nf_get_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_short, NF_GET_VARM_INT1, nf_get_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_int, NF_GET_VARM_INT1, nf_get_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_long, NF_GET_VARM_INT1, nf_get_varm_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT1VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER*2 variable array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_short, NF_PUT_VARM_INT2, nf_put_varm_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT2VARV)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_int, NF_PUT_VARM_INT2, nf_put_varm_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT2VARV)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_long, NF_PUT_VARM_INT2, nf_put_varm_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT2VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER*2 variable array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_short, NF_GET_VARM_INT2, nf_get_varm_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT2VARV)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_int, NF_GET_VARM_INT2, nf_get_varm_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT2VARV)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_long, NF_GET_VARM_INT2, nf_get_varm_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT2VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER variable array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_int, NF_PUT_VARM_INT, nf_put_varm_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INTVARV)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_long, NF_PUT_VARM_INT, nf_put_varm_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INTVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER variable array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_int, NF_GET_VARM_INT, nf_get_varm_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_long, NF_GET_VARM_INT, nf_get_varm_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN REAL variable array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_double, NF_PUT_VARM_REAL, nf_put_varm_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, DOUBLEVARV)
|
||||
#else
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_float, NF_PUT_VARM_REAL, nf_put_varm_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, REALVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN REAL variable array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_double, NF_GET_VARM_REAL, nf_get_varm_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PDOUBLEVARV)
|
||||
#else
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_float, NF_GET_VARM_REAL, nf_get_varm_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PREALVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN DOUBLEPRECISION variable array.
|
||||
*/
|
||||
FCALLSCFUN7(NF_INT, nc_put_varm_double, NF_PUT_VARM_DOUBLE, nf_put_varm_double,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, DOUBLEVARV)
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN DOUBLEPRECISION variable array.
|
||||
*/
|
||||
FCALLSCFUN7(NF_INT, nc_get_varm_double, NF_GET_VARM_DOUBLE, nf_get_varm_double,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PDOUBLEVARV)
|
167
fortran/fort-varsio.c
Normal file
167
fortran/fort-varsio.c
Normal file
@ -0,0 +1,167 @@
|
||||
/*
|
||||
This file is part of the netCDF Fortran 77 API.
|
||||
|
||||
This file handles the netCDF vars functions.
|
||||
|
||||
Copyright 2006, University Corporation for Atmospheric Research. See
|
||||
the COPYRIGHT file for copying and redistribution conditions.
|
||||
|
||||
$Id: fort-varsio.c,v 1.10 2008/02/25 17:24:24 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "netcdf.h"
|
||||
#include "nfconfig.inc"
|
||||
#include "ncfortran.h"
|
||||
#include "fort-lib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_text, NF_PUT_VARS_TEXT, nf_put_vars_text,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN CHARACTER*(*) variable.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_text, NF_GET_VARS_TEXT, nf_get_vars_text,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, CBUF)
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER*1 variable array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_schar, NF_PUT_VARS_INT1, nf_put_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT1VARV)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_short, NF_PUT_VARS_INT1, nf_put_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT1VARV)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_int, NF_PUT_VARS_INT1, nf_put_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT1VARV)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_long, NF_PUT_VARS_INT1, nf_put_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT1VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER*1 variable array.
|
||||
*/
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_schar, NF_GET_VARS_INT1, nf_get_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_short, NF_GET_VARS_INT1, nf_get_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_int, NF_GET_VARS_INT1, nf_get_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT1VARV)
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_long, NF_GET_VARS_INT1, nf_get_vars_int1,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT1VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER*2 variable array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_short, NF_PUT_VARS_INT2, nf_put_vars_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT2VARV)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_int, NF_PUT_VARS_INT2, nf_put_vars_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT2VARV)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_long, NF_PUT_VARS_INT2, nf_put_vars_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INT2VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER*2 variable array.
|
||||
*/
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_short, NF_GET_VARS_INT2, nf_get_vars_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT2VARV)
|
||||
#elif NF_INT2_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_int, NF_GET_VARS_INT2, nf_get_vars_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT2VARV)
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_long, NF_GET_VARS_INT2, nf_get_vars_int2,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINT2VARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN INTEGER variable array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_int, NF_PUT_VARS_INT, nf_put_vars_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INTVARV)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_long, NF_PUT_VARS_INT, nf_put_vars_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, INTVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN INTEGER variable array.
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_int, NF_GET_VARS_INT, nf_get_vars_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINTVARV)
|
||||
#elif NF_INT_IS_C_LONG
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_long, NF_GET_VARS_INT, nf_get_vars_int,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PINTVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN REAL variable array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_double, NF_PUT_VARS_REAL, nf_put_vars_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, DOUBLEVARV)
|
||||
#else
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_float, NF_PUT_VARS_REAL, nf_put_vars_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, REALVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN REAL variable array.
|
||||
*/
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_double, NF_GET_VARS_REAL, nf_get_vars_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PDOUBLEVARV)
|
||||
#else
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_float, NF_GET_VARS_REAL, nf_get_vars_real,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PREALVARV)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write values from a FORTRAN DOUBLEPRECISION variable array.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars_double, NF_PUT_VARS_DOUBLE, nf_put_vars_double,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, DOUBLEVARV)
|
||||
|
||||
|
||||
/*
|
||||
* Read values into a FORTRAN DOUBLEPRECISION variable array.
|
||||
*/
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars_double, NF_GET_VARS_DOUBLE, nf_get_vars_double,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PDOUBLEVARV)
|
||||
|
||||
FCALLSCFUN6(NF_INT, nc_put_vars, NF_PUT_VARS, nf_put_vars,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PVOID)
|
||||
|
||||
FCALLSCFUN6(NF_INT, nc_get_vars, NF_GET_VARS, nf_get_vars,
|
||||
NCID, VARID, COORDS, COUNTS, STRIDES, PVOID)
|
||||
|
||||
|
||||
|
20
fortran/makevms.com
Normal file
20
fortran/makevms.com
Normal file
@ -0,0 +1,20 @@
|
||||
$! --------------------------------------------------------------------------
|
||||
$! For making FTEST.EXE on VMS
|
||||
$! --------------------------------------------------------------------------
|
||||
$!
|
||||
$! $Id: makevms.com,v 1.3 1996/02/27 22:56:05 steve Exp $
|
||||
$
|
||||
$ ccc := cc /opt/nodebug/nolist/include=([-.src])
|
||||
$
|
||||
$ ccc JACKETS.C
|
||||
$ fort FTEST.FOR
|
||||
$
|
||||
$ link/nodebug/notraceback/exec=FTEST.exe -
|
||||
ftest.obj, -
|
||||
jackets.obj, -
|
||||
[---.lib]netcdf.olb/lib, -
|
||||
sys$input/opt
|
||||
sys$library:vaxcrtl.exe/share
|
||||
$
|
||||
$ run ftest
|
||||
$
|
898
fortran/ncfortran.h
Normal file
898
fortran/ncfortran.h
Normal file
@ -0,0 +1,898 @@
|
||||
/* $Id: ncfortran.h,v 1.41 2010/04/05 17:29:17 ed Exp $ */
|
||||
|
||||
/*
|
||||
* This file contains `cfortran.h' definitions that are specific to the
|
||||
* netCDF-3 package.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef UD_NCFORTRAN_H
|
||||
#define UD_NCFORTRAN_H
|
||||
|
||||
#include "cfortran.h"
|
||||
#include "nfconfig.inc"
|
||||
|
||||
|
||||
/*
|
||||
* The type of a Fortran INTEGER:
|
||||
*/
|
||||
#if NF_INT_IS_C_INT
|
||||
# define NF_INTEGER int
|
||||
# define NF_INT INT
|
||||
#elif NF_INT_IS_C_LONG
|
||||
# define NF_INTEGER long
|
||||
# define NF_INT LONG
|
||||
#else
|
||||
# include "NF_INT_IS_C_... not defined"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Input, Fortran INTEGER converted to C "int" (helper macro):
|
||||
*/
|
||||
#define FINT2CINT_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define FINT2CINT_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define FINT2CINT_cfN( T,A) const NF_INTEGER *A
|
||||
#define FINT2CINT_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define FINT2CINT_cfT(M,I,A,B,D) (int)*A
|
||||
|
||||
|
||||
/*
|
||||
* Input, Fortran INTEGER converted to C "size_t":
|
||||
*/
|
||||
#define FINT2CSIZET_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define FINT2CSIZET_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define FINT2CSIZET_cfN( T,A) const NF_INTEGER *A
|
||||
#define FINT2CSIZET_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define FINT2CSIZET_cfT(M,I,A,B,D) (size_t)*A
|
||||
|
||||
|
||||
/*
|
||||
* Input/Output, I/O size hint:
|
||||
*/
|
||||
#define PCHUNKSIZEHINT_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PCHUNKSIZEHINT_cfTYPE NF_INTEGER
|
||||
#define PCHUNKSIZEHINT_cfSTR(N,T,A,B,C,D,E) \
|
||||
_(CFARGS,N)(T,PCHUNKSIZEHINT,A,B,C,D,E)
|
||||
#define PCHUNKSIZEHINT_cfH(S,U,B)
|
||||
#define PCHUNKSIZEHINT_cfQ(B) size_t B;
|
||||
#define PCHUNKSIZEHINT_cfT(M,I,A,B,D) ((void*)(B=*A), &B)
|
||||
#define PCHUNKSIZEHINT_cfR(A,B,D) *A=B;
|
||||
|
||||
|
||||
/*
|
||||
* Output, C "int" converted to Fortran INTEGER (helper macro):
|
||||
*/
|
||||
#define PCINT2FINT_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PCINT2FINT_cfTYPE NF_INTEGER
|
||||
#define PCINT2FINT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PCINT2FINT,A,B,C,D,E)
|
||||
#define PCINT2FINT_cfH(S,U,B)
|
||||
#define PCINT2FINT_cfQ(B) int B;
|
||||
#define PCINT2FINT_cfT(M,I,A,B,D) &B
|
||||
#define PCINT2FINT_cfR(A,B,D) *A=B;
|
||||
|
||||
|
||||
/*
|
||||
* Input, Fortran index converted to C index:
|
||||
*/
|
||||
#define FNDX2CNDX_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define FNDX2CNDX_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define FNDX2CNDX_cfN( T,A) const NF_INTEGER *A
|
||||
#define FNDX2CNDX_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define FNDX2CNDX_cfT(M,I,A,B,D) (*A-1)
|
||||
|
||||
|
||||
/*
|
||||
* Output, C index converted to Fortran index:
|
||||
*/
|
||||
#define PCNDX2FNDX_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PCNDX2FNDX_cfTYPE NF_INTEGER
|
||||
#define PCNDX2FNDX_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PCNDX2FNDX,A,B,C,D,E)
|
||||
#define PCNDX2FNDX_cfH(S,U,B)
|
||||
#define PCNDX2FNDX_cfQ(B) int B;
|
||||
#define PCNDX2FNDX_cfT(M,I,A,B,D) &B
|
||||
#define PCNDX2FNDX_cfR(A,B,D) *A=B+1;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Character buffer:
|
||||
*/
|
||||
|
||||
#define CBUF_cfINT(N,A,B,X,Y,Z) STRING_cfINT(N,A,B,X,Y,Z)
|
||||
#define CBUF_cfSEP(T, B) STRING_cfSEP(T,B)
|
||||
#define CBUF_cfN( T,A) STRING_cfN(T,A)
|
||||
#define CBUF_cfSTR(N,T,A,B,C,D,E) STRING_cfSTR(N,T,A,B,C,D,E)
|
||||
#if defined(vmsFortran)
|
||||
# define CBUF_cfT(M,I,A,B,D) A->dsc$a_pointer
|
||||
#elif defined(CRAYFortran)
|
||||
# define CBUF_cfT(M,I,A,B,D) _fcdtocp(A)
|
||||
#else
|
||||
# define CBUF_cfT(M,I,A,B,D) A
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* netCDf attributes:
|
||||
*/
|
||||
|
||||
#define TEXTATT STRING
|
||||
#define PTEXTATT PSTRING
|
||||
|
||||
#define INT1ATT INT1VARV
|
||||
#define PINT1ATT PINT1VARV
|
||||
|
||||
#define INT2ATT INT2VARV
|
||||
#define PINT2ATT PINT2VARV
|
||||
|
||||
#define INTATT INTVARV
|
||||
#define PINTATT PINTVARV
|
||||
|
||||
#define REALATT REALVARV
|
||||
#define PREALATT PREALVARV
|
||||
|
||||
#define DOUBLEATT DOUBLEVARV
|
||||
#define PDOUBLEATT PDOUBLEVARV
|
||||
|
||||
|
||||
/*
|
||||
* Input, attribute ID:
|
||||
*/
|
||||
#define ATTID FNDX2CNDX
|
||||
|
||||
|
||||
/*
|
||||
* Output, attribute ID:
|
||||
*/
|
||||
#define PATTID PCNDX2FNDX
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* netCDf type:
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Input, netCDF type:
|
||||
*/
|
||||
#define TYPE_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define TYPE_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define TYPE_cfN( T,A) NF_INTEGER *A
|
||||
#define TYPE_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define TYPE_cfT(M,I,A,B,D) ((nc_type)*A)
|
||||
|
||||
|
||||
/*
|
||||
* Output, netCDF type:
|
||||
*/
|
||||
#define PTYPE_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PTYPE_cfTYPE NF_INTEGER
|
||||
#define PTYPE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PTYPE,A,B,C,D,E)
|
||||
#define PTYPE_cfH(S,U,B)
|
||||
#define PTYPE_cfQ(B) nc_type B;
|
||||
#define PTYPE_cfT(M,I,A,B,D) &B
|
||||
#define PTYPE_cfR(A,B,D) *A=B;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* netCDf number-of-<whatever>:
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Input, number-of-dimensions:
|
||||
*/
|
||||
#define NDIMS_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define NDIMS_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define NDIMS_cfN( T,A) NF_INTEGER *fndims
|
||||
#define NDIMS_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define NDIMS_cfT(M,I,A,B,D) ((int)*fndims)
|
||||
|
||||
|
||||
/*
|
||||
* Output number-of-dimensions:
|
||||
*/
|
||||
#define PNDIMS PCINT2FINT
|
||||
|
||||
|
||||
/*
|
||||
* Input number-of-variables:
|
||||
*/
|
||||
#define NVARS FINT2CINT
|
||||
|
||||
|
||||
/*
|
||||
* Output number-of-variables:
|
||||
*/
|
||||
#define PNVARS PNDIMS
|
||||
|
||||
|
||||
/*
|
||||
* Input number-of-attributes:
|
||||
*/
|
||||
#define NATTS FINT2CINT
|
||||
|
||||
|
||||
/*
|
||||
* Output number-of-attributes:
|
||||
*/
|
||||
#define PNATTS PNDIMS
|
||||
|
||||
/*
|
||||
* Output format version number
|
||||
*/
|
||||
#define PFORMAT PNDIMS
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* netCDf variables:
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Input, CHARACTER*(*) variable:
|
||||
*/
|
||||
#define TEXTVAR STRING
|
||||
|
||||
|
||||
/*
|
||||
* Output, CHARACTER*(*) variable:
|
||||
*/
|
||||
#define PTEXTVAR PSTRING
|
||||
|
||||
|
||||
/*
|
||||
* Input, CHARACTER*(*) variable array:
|
||||
*/
|
||||
#define TEXTVARV STRING
|
||||
|
||||
|
||||
/*
|
||||
* Output, CHARACTER*(*) variable array:
|
||||
*/
|
||||
#define PTEXTVARV PSTRING
|
||||
|
||||
|
||||
/*
|
||||
* Input, INTEGER*1 variable:
|
||||
*/
|
||||
#define INT1VAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define INT1VAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
# define INT1VAR_cfN( T,A) const signed char *A
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
# define INT1VAR_cfN( T,A) const short *A
|
||||
#elif NF_INT1_IS_C_INT
|
||||
# define INT1VAR_cfN( T,A) const int *A
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
# define INT1VAR_cfN( T,A) const long *A
|
||||
#endif
|
||||
#define INT1VAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define INT1VAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Output, INTEGER*1 variable:
|
||||
*/
|
||||
#define PINT1VAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PINT1VAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#if NF_INT1_IS_C_SIGNED_CHAR
|
||||
# define PINT1VAR_cfN( T,A) signed char *A
|
||||
#elif NF_INT1_IS_C_SHORT
|
||||
# define PINT1VAR_cfN( T,A) short *A
|
||||
#elif NF_INT1_IS_C_INT
|
||||
# define PINT1VAR_cfN( T,A) int *A
|
||||
#elif NF_INT1_IS_C_LONG
|
||||
# define PINT1VAR_cfN( T,A) long *A
|
||||
#endif
|
||||
#define PINT1VAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define PINT1VAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Input, INTEGER*1 variable array:
|
||||
*/
|
||||
#define INT1VARV INT1VAR
|
||||
|
||||
|
||||
/*
|
||||
* Output, INTEGER*1 variable array:
|
||||
*/
|
||||
#define PINT1VARV PINT1VAR
|
||||
|
||||
|
||||
/*
|
||||
* Input, INTEGER*2 variable:
|
||||
*/
|
||||
#define INT2VAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define INT2VAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
# define INT2VAR_cfN( T,A) const short *A
|
||||
#elif NF_INT2_IS_C_INT
|
||||
# define INT2VAR_cfN( T,A) const int *A
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
# define INT2VAR_cfN( T,A) const long *A
|
||||
#endif
|
||||
#define INT2VAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define INT2VAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Output, INTEGER*2 variable:
|
||||
*/
|
||||
#define PINT2VAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PINT2VAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#if NF_INT2_IS_C_SHORT
|
||||
# define PINT2VAR_cfN( T,A) short *A
|
||||
#elif NF_INT2_IS_C_INT
|
||||
# define PINT2VAR_cfN( T,A) int *A
|
||||
#elif NF_INT2_IS_C_LONG
|
||||
# define PINT2VAR_cfN( T,A) long *A
|
||||
#endif
|
||||
#define PINT2VAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define PINT2VAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Input, INTEGER*2 variable array:
|
||||
*/
|
||||
#define INT2VARV INT2VAR
|
||||
|
||||
|
||||
/*
|
||||
* Output, INTEGER*2 variable array:
|
||||
*/
|
||||
#define PINT2VARV PINT2VAR
|
||||
|
||||
|
||||
/*
|
||||
* Input, INTEGER variable:
|
||||
*/
|
||||
#define INTVAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define INTVAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define INTVAR_cfN( T,A) const NF_INTEGER *A
|
||||
#define INTVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define INTVAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Output, INTEGER variable:
|
||||
*/
|
||||
#define PINTVAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PINTVAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define PINTVAR_cfN( T,A) NF_INTEGER *A
|
||||
#define PINTVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define PINTVAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Input, INTEGER variable array:
|
||||
*/
|
||||
#define INTVARV INTVAR
|
||||
|
||||
|
||||
/*
|
||||
* Output, INTEGER variable array:
|
||||
*/
|
||||
#define PINTVARV PINTVAR
|
||||
|
||||
|
||||
/*
|
||||
* Input, REAL variable:
|
||||
*/
|
||||
#define REALVAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define REALVAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
# define REALVAR_cfN( T,A) const double *A
|
||||
#else
|
||||
# define REALVAR_cfN( T,A) const float *A
|
||||
#endif
|
||||
#define REALVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define REALVAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Output, REAL variable:
|
||||
*/
|
||||
#define PREALVAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PREALVAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#if NF_REAL_IS_C_DOUBLE
|
||||
# define PREALVAR_cfN( T,A) double *A
|
||||
#else
|
||||
# define PREALVAR_cfN( T,A) float *A
|
||||
#endif
|
||||
#define PREALVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define PREALVAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Input, REAL variable array:
|
||||
*/
|
||||
#define REALVARV REALVAR
|
||||
|
||||
|
||||
/*
|
||||
* Output, REAL variable array:
|
||||
*/
|
||||
#define PREALVARV PREALVAR
|
||||
|
||||
|
||||
/*
|
||||
* Input, DOUBLEPRECISION variable:
|
||||
*/
|
||||
#define DOUBLEVAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define DOUBLEVAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define DOUBLEVAR_cfN( T,A) const double *A
|
||||
#define DOUBLEVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define DOUBLEVAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Output, DOUBLEPRECISION variable:
|
||||
*/
|
||||
#define PDOUBLEVAR_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PDOUBLEVAR_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define PDOUBLEVAR_cfN( T,A) double *A
|
||||
#define PDOUBLEVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define PDOUBLEVAR_cfT(M,I,A,B,D) A
|
||||
|
||||
|
||||
/*
|
||||
* Input, DOUBLEPRECISION variable array:
|
||||
*/
|
||||
#define DOUBLEVARV DOUBLEVAR
|
||||
|
||||
|
||||
/*
|
||||
* Output, DOUBLEPRECISION variable array:
|
||||
*/
|
||||
#define PDOUBLEVARV PDOUBLEVAR
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Miscellaneious netCDF stuff:
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Output, `size_t' variable:
|
||||
*/
|
||||
#define PSIZET_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PSIZET_cfTYPE NF_INTEGER
|
||||
#define PSIZET_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSIZET,A,B,C,D,E)
|
||||
#define PSIZET_cfH(S,U,B)
|
||||
#define PSIZET_cfQ(B) size_t B;
|
||||
#define PSIZET_cfT(M,I,A,B,D) &B
|
||||
#define PSIZET_cfR(A,B,D) *A=B;
|
||||
|
||||
|
||||
/*
|
||||
* Input dimension-ID:
|
||||
*/
|
||||
#define DIMID FNDX2CNDX
|
||||
|
||||
|
||||
/*
|
||||
* Output, dimension-ID:
|
||||
*/
|
||||
#define PDIMID_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PDIMID_cfTYPE NF_INTEGER
|
||||
#define PDIMID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PDIMID,A,B,C,D,E)
|
||||
#define PDIMID_cfH(S,U,B)
|
||||
#define PDIMID_cfQ(B) int B = -1;
|
||||
#define PDIMID_cfT(M,I,A,B,D) &B
|
||||
#define PDIMID_cfR(A,B,D) *A=(B == -1 ? -1 : B+1);
|
||||
|
||||
|
||||
/*
|
||||
* Input, dimension-ID vector:
|
||||
*/
|
||||
#define DIMIDS_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define DIMIDSVVVVVVV_cfTYPE NF_INTEGER
|
||||
#define DIMIDS_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DIMIDS,A,B,C,D,E)
|
||||
#define DIMIDS_cfH(S,U,B)
|
||||
#define DIMIDS_cfQ(B) int B[NC_MAX_DIMS];
|
||||
#define DIMIDS_cfT(M,I,A,B,D) f2c_dimids(*fndims, A, B)
|
||||
#define DIMIDS_cfR(A,B,D)
|
||||
|
||||
|
||||
/*
|
||||
* Output, dimension-ID vector:
|
||||
*/
|
||||
#define PDIMIDS_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PDIMIDS_cfTYPE NF_INTEGER
|
||||
#define PDIMIDS_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PDIMIDS,A,B,C,D,E)
|
||||
#define PDIMIDS_cfH(S,U,B)
|
||||
#define PDIMIDS_cfQ(B) int B[NC_MAX_DIMS];
|
||||
#define PDIMIDS_cfT(M,I,A,B,D) B
|
||||
#define PDIMIDS_cfR(A,B,D) c2f_dimids(*fncid, *fvarid-1, B, A);
|
||||
|
||||
/*
|
||||
* Input, chunksizes vector:
|
||||
*/
|
||||
#define CHUNKSIZES_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define CHUNKSIZESVVVVVVV_cfTYPE NF_INTEGER
|
||||
#define CHUNKSIZES_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,CHUNKSIZES,A,B,C,D,E)
|
||||
#define CHUNKSIZES_cfH(S,U,B)
|
||||
#define CHUNKSIZES_cfQ(B) int B[NC_MAX_DIMS];
|
||||
#define CHUNKSIZES_cfT(M,I,A,B,D) f2c_chunksizes(*fncid, *fvarid-1, A, B)
|
||||
#define CHUNKSIZES_cfR(A,B,D)
|
||||
|
||||
|
||||
/*
|
||||
* Output, chunksizes vector:
|
||||
*/
|
||||
#define PCHUNKSIZES_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define PCHUNKSIZES_cfTYPE NF_INTEGER
|
||||
#define PCHUNKSIZES_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PCHUNKSIZES,A,B,C,D,E)
|
||||
#define PCHUNKSIZES_cfH(S,U,B)
|
||||
#define PCHUNKSIZES_cfQ(B) int B[NC_MAX_DIMS];
|
||||
#define PCHUNKSIZES_cfT(M,I,A,B,D) B
|
||||
#define PCHUNKSIZES_cfR(A,B,D) c2f_chunksizes(*fncid, *fvarid-1, B, A);
|
||||
|
||||
|
||||
/*
|
||||
* Input, netCDF dataset ID:
|
||||
*/
|
||||
#define NCID_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define NCID_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define NCID_cfN( T,A) NF_INTEGER *fncid
|
||||
#define NCID_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define NCID_cfT(M,I,A,B,D) *fncid
|
||||
|
||||
|
||||
/*
|
||||
* Two, input, netCDF dataset IDs:
|
||||
*/
|
||||
#define NCID1 FINT2CINT
|
||||
#define NCID2 FINT2CINT
|
||||
|
||||
|
||||
/*
|
||||
* Output, netCDF dataset ID:
|
||||
*/
|
||||
#define PNCID PCINT2FINT
|
||||
|
||||
|
||||
/*
|
||||
* Input, netCDF variable ID:
|
||||
*/
|
||||
#define VARID_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define VARID_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define VARID_cfN( T,A) NF_INTEGER *fvarid
|
||||
#define VARID_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define VARID_cfT(M,I,A,B,D) (*fvarid-1)
|
||||
|
||||
|
||||
/*
|
||||
* Two, input, netCDF variable IDs:
|
||||
*/
|
||||
#define VARID1_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define VARID1_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define VARID1_cfN( T,A) NF_INTEGER *fvarid1
|
||||
#define VARID1_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define VARID1_cfT(M,I,A,B,D) (*fvarid1-1)
|
||||
|
||||
#define VARID2_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define VARID2_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define VARID2_cfN( T,A) NF_INTEGER *fvarid2
|
||||
#define VARID2_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define VARID2_cfT(M,I,A,B,D) (*fvarid2-1)
|
||||
|
||||
|
||||
/*
|
||||
* Output, netCDF variable ID:
|
||||
*/
|
||||
#define PVARID PCNDX2FNDX
|
||||
|
||||
/*
|
||||
* Input, netCDF field index:
|
||||
*/
|
||||
#define FIELDIDX_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define FIELDIDX_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define FIELDIDX_cfN( T,A) NF_INTEGER *ffieldidx
|
||||
#define FIELDIDX_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define FIELDIDX_cfT(M,I,A,B,D) (*ffieldidx-1)
|
||||
|
||||
/*
|
||||
* Input, co-ordinate vector:
|
||||
*/
|
||||
#define COORDS_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define COORDSVVVVVVV_cfTYPE NF_INTEGER
|
||||
#define COORDS_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,COORDS,A,B,C,D,E)
|
||||
#define COORDS_cfH(S,U,B)
|
||||
#define COORDS_cfQ(B) size_t B[NC_MAX_DIMS];
|
||||
#define COORDS_cfT(M,I,A,B,D) f2c_coords(*fncid, *fvarid-1, A, B)
|
||||
#define COORDS_cfR(A,B,D)
|
||||
|
||||
|
||||
/*
|
||||
* Input count:
|
||||
*/
|
||||
#define COUNT_cfINT(N,A,B,X,Y,Z) SIMPLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define COUNT_cfSEP(T, B) SIMPLE_cfSEP(T,B)
|
||||
#define COUNT_cfN( T,A) const NF_INTEGER *A
|
||||
#define COUNT_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
|
||||
#define COUNT_cfT(M,I,A,B,D) (size_t)*A
|
||||
|
||||
|
||||
/*
|
||||
* Output count:
|
||||
*/
|
||||
#define PCOUNT PSIZET
|
||||
|
||||
|
||||
/*
|
||||
* Input, count vector:
|
||||
*/
|
||||
#define COUNTS_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define COUNTSVVVVVVV_cfTYPE NF_INTEGER
|
||||
#define COUNTS_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,COUNTS,A,B,C,D,E)
|
||||
#define COUNTS_cfH(S,U,B)
|
||||
#define COUNTS_cfQ(B) size_t B[NC_MAX_DIMS];
|
||||
#define COUNTS_cfT(M,I,A,B,D) f2c_counts(*fncid, *fvarid-1, A, B)
|
||||
#define COUNTS_cfR(A,B,D)
|
||||
|
||||
|
||||
/*
|
||||
* Input, stride vector:
|
||||
*/
|
||||
#define STRIDES_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define STRIDESVVVVVVV_cfTYPE NF_INTEGER
|
||||
#define STRIDES_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRIDES,A,B,C,D,E)
|
||||
#define STRIDES_cfH(S,U,B)
|
||||
#define STRIDES_cfQ(B) ptrdiff_t B[NC_MAX_DIMS];
|
||||
#define STRIDES_cfT(M,I,A,B,D) f2c_strides(*fncid, *fvarid-1, A, B)
|
||||
#define STRIDES_cfR(A,B,D)
|
||||
|
||||
|
||||
/*
|
||||
* Input, mapping vector:
|
||||
*/
|
||||
#define MAPS_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z)
|
||||
#define MAPSVVVVVVV_cfTYPE NF_INTEGER
|
||||
#define MAPS_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,MAPS,A,B,C,D,E)
|
||||
#define MAPS_cfH(S,U,B)
|
||||
#define MAPS_cfQ(B) ptrdiff_t B[NC_MAX_DIMS];
|
||||
#define MAPS_cfT(M,I,A,B,D) f2c_maps(*fncid, *fvarid-1, A, B)
|
||||
#define MAPS_cfR(A,B,D)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* The following is for f2c-support only.
|
||||
*/
|
||||
|
||||
#if defined(f2cFortran) && !defined(pgiFortran) && !defined(gFortran)
|
||||
|
||||
/*
|
||||
* The f2c(1) utility on BSD/OS and Linux systems adds an additional
|
||||
* underscore suffix (besides the usual one) to global names that have
|
||||
* an embedded underscore. For example, `nfclose' becomes `nfclose_',
|
||||
* but `nf_close' becomes `nf_close__. Consequently, we have to modify
|
||||
* some names.
|
||||
*/
|
||||
#ifdef LOGGING
|
||||
#define nf_set_log_level nf_set_log_level_
|
||||
#endif /* LOGGING */
|
||||
#define nf_inq_libvers nf_inq_libvers_
|
||||
#define nf_strerror nf_strerror_
|
||||
#define nf_issyserr nf_issyserr_
|
||||
#define nf_create nf_create_
|
||||
#define nf_open nf_open_
|
||||
#define nf_set_fill nf_set_fill_
|
||||
#define nf_set_default_format nf_set_default_format_
|
||||
#define nf_redef nf_redef_
|
||||
#define nf_enddef nf_enddef_
|
||||
#define nf_sync nf_sync_
|
||||
#define nf_abort nf_abort_
|
||||
#define nf_close nf_close_
|
||||
#define nf_delete nf_delete_
|
||||
#define nf_inq nf_inq_
|
||||
#define nf_inq_ndims nf_inq_ndims_
|
||||
#define nf_inq_nvars nf_inq_nvars_
|
||||
#define nf_inq_natts nf_inq_natts_
|
||||
#define nf_inq_unlimdim nf_inq_unlimdim_
|
||||
#define nf_inq_format nf_inq_format_
|
||||
#define nf_def_dim nf_def_dim_
|
||||
#define nf_inq_dimid nf_inq_dimid_
|
||||
#define nf_inq_dim nf_inq_dim_
|
||||
#define nf_inq_dimname nf_inq_dimname_
|
||||
#define nf_inq_dimlen nf_inq_dimlen_
|
||||
#define nf_rename_dim nf_rename_dim_
|
||||
#define nf_inq_att nf_inq_att_
|
||||
#define nf_inq_attid nf_inq_attid_
|
||||
#define nf_inq_atttype nf_inq_atttype_
|
||||
#define nf_inq_attlen nf_inq_attlen_
|
||||
#define nf_inq_attname nf_inq_attname_
|
||||
#define nf_copy_att nf_copy_att_
|
||||
#define nf_rename_att nf_rename_att_
|
||||
#define nf_del_att nf_del_att_
|
||||
#define nf_put_att_text nf_put_att_text_
|
||||
#define nf_get_att_text nf_get_att_text_
|
||||
#define nf_put_att_int1 nf_put_att_int1_
|
||||
#define nf_get_att_int1 nf_get_att_int1_
|
||||
#define nf_put_att_int2 nf_put_att_int2_
|
||||
#define nf_get_att_int2 nf_get_att_int2_
|
||||
#define nf_put_att_int nf_put_att_int_
|
||||
#define nf_get_att_int nf_get_att_int_
|
||||
#define nf_put_att_real nf_put_att_real_
|
||||
#define nf_get_att_real nf_get_att_real_
|
||||
#define nf_put_att_double nf_put_att_double_
|
||||
#define nf_get_att_double nf_get_att_double_
|
||||
#define nf_def_var nf_def_var_
|
||||
#define nf_inq_var nf_inq_var_
|
||||
#define nf_inq_varid nf_inq_varid_
|
||||
#define nf_inq_varname nf_inq_varname_
|
||||
#define nf_inq_vartype nf_inq_vartype_
|
||||
#define nf_inq_varndims nf_inq_varndims_
|
||||
#define nf_inq_vardimid nf_inq_vardimid_
|
||||
#define nf_inq_varnatts nf_inq_varnatts_
|
||||
#define nf_rename_var nf_rename_var_
|
||||
#define nf_copy_var nf_copy_var_
|
||||
#define nf_put_var_text nf_put_var_text_
|
||||
#define nf_get_var_text nf_get_var_text_
|
||||
#define nf_put_var_int1 nf_put_var_int1_
|
||||
#define nf_get_var_int1 nf_get_var_int1_
|
||||
#define nf_put_var_int2 nf_put_var_int2_
|
||||
#define nf_get_var_int2 nf_get_var_int2_
|
||||
#define nf_put_var_int nf_put_var_int_
|
||||
#define nf_get_var_int nf_get_var_int_
|
||||
#define nf_put_var_real nf_put_var_real_
|
||||
#define nf_get_var_real nf_get_var_real_
|
||||
#define nf_put_var_double nf_put_var_double_
|
||||
#define nf_get_var_double nf_get_var_double_
|
||||
#define nf_put_var1_text nf_put_var1_text_
|
||||
#define nf_get_var1_text nf_get_var1_text_
|
||||
#define nf_put_var1_int1 nf_put_var1_int1_
|
||||
#define nf_get_var1_int1 nf_get_var1_int1_
|
||||
#define nf_put_var1_int2 nf_put_var1_int2_
|
||||
#define nf_get_var1_int2 nf_get_var1_int2_
|
||||
#define nf_put_var1_int nf_put_var1_int_
|
||||
#define nf_get_var1_int nf_get_var1_int_
|
||||
#define nf_put_var1_real nf_put_var1_real_
|
||||
#define nf_get_var1_real nf_get_var1_real_
|
||||
#define nf_put_var1_double nf_put_var1_double_
|
||||
#define nf_get_var1_double nf_get_var1_double_
|
||||
#define nf_put_vara_text nf_put_vara_text_
|
||||
#define nf_get_vara_text nf_get_vara_text_
|
||||
#define nf_put_vara_int1 nf_put_vara_int1_
|
||||
#define nf_get_vara_int1 nf_get_vara_int1_
|
||||
#define nf_put_vara_int2 nf_put_vara_int2_
|
||||
#define nf_get_vara_int2 nf_get_vara_int2_
|
||||
#define nf_put_vara_int nf_put_vara_int_
|
||||
#define nf_get_vara_int nf_get_vara_int_
|
||||
#define nf_put_vara_real nf_put_vara_real_
|
||||
#define nf_get_vara_real nf_get_vara_real_
|
||||
#define nf_put_vara_double nf_put_vara_double_
|
||||
#define nf_get_vara_double nf_get_vara_double_
|
||||
#define nf_put_vars_text nf_put_vars_text_
|
||||
#define nf_get_vars_text nf_get_vars_text_
|
||||
#define nf_put_vars_int1 nf_put_vars_int1_
|
||||
#define nf_get_vars_int1 nf_get_vars_int1_
|
||||
#define nf_put_vars_int2 nf_put_vars_int2_
|
||||
#define nf_get_vars_int2 nf_get_vars_int2_
|
||||
#define nf_put_vars_int nf_put_vars_int_
|
||||
#define nf_get_vars_int nf_get_vars_int_
|
||||
#define nf_put_vars_real nf_put_vars_real_
|
||||
#define nf_get_vars_real nf_get_vars_real_
|
||||
#define nf_put_vars_double nf_put_vars_double_
|
||||
#define nf_get_vars_double nf_get_vars_double_
|
||||
#define nf_put_varm_text nf_put_varm_text_
|
||||
#define nf_get_varm_text nf_get_varm_text_
|
||||
#define nf_put_varm_int1 nf_put_varm_int1_
|
||||
#define nf_get_varm_int1 nf_get_varm_int1_
|
||||
#define nf_put_varm_int2 nf_put_varm_int2_
|
||||
#define nf_get_varm_int2 nf_get_varm_int2_
|
||||
#define nf_put_varm_int nf_put_varm_int_
|
||||
#define nf_get_varm_int nf_get_varm_int_
|
||||
#define nf_put_varm_real nf_put_varm_real_
|
||||
#define nf_get_varm_real nf_get_varm_real_
|
||||
#define nf_put_varm_double nf_put_varm_double_
|
||||
#define nf_get_varm_double nf_get_varm_double_
|
||||
#define nf__create nf__create_
|
||||
#define nf__create_mp nf__create_mp_
|
||||
#define nf__enddef nf__enddef_
|
||||
#define nf__open nf__open_
|
||||
#define nf__open_mp nf__open_mp_
|
||||
#define nf_delete_mp nf_delete_mp_
|
||||
#define nf_inq_base_pe nf_inq_base_pe_
|
||||
#define nf_set_base_pe nf_set_base_pe_
|
||||
|
||||
#ifdef USE_NETCDF4
|
||||
#define nf_create_par nf_create_par_
|
||||
#define nf_open_par nf_open_par_
|
||||
#define nf_var_par_access nf_var_par_access_
|
||||
#define nf_inq_ncid nf_inq_ncid_
|
||||
#define nf_inq_grps nf_inq_grps_
|
||||
#define nf_inq_grpname nf_inq_grpname_
|
||||
#define nf_inq_grp_parent nf_inq_grp_parent_
|
||||
#define nf_inq_grp_ncid nf_inq_grp_ncid_
|
||||
#define nf_inq_varids nf_inq_varids_
|
||||
#define nf_inq_dimids nf_inq_dimids_
|
||||
#define nf_inq_typeids nf_inq_typeids_
|
||||
#define nf_inq_typeid nf_inq_typeid_
|
||||
#define nf_def_grp nf_def_grp_
|
||||
#define nf_def_compound nf_def_compound_
|
||||
#define nf_insert_compound nf_insert_compound_
|
||||
#define nf_insert_array_compound nf_insert_array_compound_
|
||||
#define nf_inq_type nf_inq_type_
|
||||
#define nf_inq_compound nf_inq_compound_
|
||||
#define nf_inq_compound_name nf_inq_compound_name_
|
||||
#define nf_inq_compound_size nf_inq_compound_size_
|
||||
#define nf_inq_compound_nfields nf_inq_compound_nfields_
|
||||
#define nf_inq_compound_field nf_inq_compound_field_
|
||||
#define nf_inq_compound_fieldname nf_inq_compound_fieldname_
|
||||
#define nf_inq_compound_fieldindex nf_inq_compound_fieldindex_
|
||||
#define nf_inq_compound_fieldtype nf_inq_compound_fieldtype_
|
||||
#define nf_inq_compound_fieldndims nf_inq_compound_fieldndims_
|
||||
#define nf_inq_compound_fielddim_sizes nf_inq_compound_fielddim_sizes_
|
||||
#define nf_def_vlen nf_def_vlen_
|
||||
#define nf_inq_vlen nf_inq_vlen_
|
||||
#define nf_free_vlen nf_free_vlen_
|
||||
#define nf_inq_user_type nf_inq_user_type_
|
||||
#define nf_put_att nf_put_att_
|
||||
#define nf_get_att nf_get_att_
|
||||
#define nf_def_enum nf_def_enum_
|
||||
#define nf_insert_enum nf_insert_enum_
|
||||
#define nf_inq_enum nf_inq_enum_
|
||||
#define nf_inq_enum_member nf_inq_enum_member_
|
||||
#define nf_inq_enum_ident nf_inq_enum_ident_
|
||||
#define nf_def_opaque nf_def_opaque_
|
||||
#define nf_inq_opaque nf_inq_opaque_
|
||||
#define nf_put_var nf_put_var_
|
||||
#define nf_put_var1 nf_put_var1_
|
||||
#define nf_put_vara nf_put_vara_
|
||||
#define nf_put_vars nf_put_vars_
|
||||
#define nf_put_varm nf_put_varm_
|
||||
#define nf_get_var nf_get_var_
|
||||
#define nf_get_var1 nf_get_var1_
|
||||
#define nf_get_vara nf_get_vara_
|
||||
#define nf_get_vars nf_get_vars_
|
||||
#define nf_get_varm nf_get_varm_
|
||||
#define nf_put_var_int64 nf_put_var_int64_
|
||||
#define nf_put_var1_int64 nf_put_var1_int64_
|
||||
#define nf_put_vara_int64 nf_put_vara_int64_
|
||||
#define nf_put_vars_int64 nf_put_vars_int64_
|
||||
#define nf_put_varm_int64 nf_put_varm_int64_
|
||||
#define nf_get_var_int64 nf_get_var_int64_
|
||||
#define nf_get_var1_int64 nf_get_var1_int64_
|
||||
#define nf_get_vara_int64 nf_get_vara_int64_
|
||||
#define nf_get_vars_int64 nf_get_vars_int64_
|
||||
#define nf_get_varm_int64 nf_get_varm_int64_
|
||||
#define nf_def_var_chunking nf_def_var_chunking_
|
||||
#define nf_def_var_deflate nf_def_var_deflate_
|
||||
#define nf_def_var_szip nf_def_var_szip_
|
||||
#define nf_def_var_fletcher32 nf_def_var_fletcher32_
|
||||
#define nf_inq_var_chunking nf_inq_var_chunking_
|
||||
#define nf_inq_var_deflate nf_inq_var_deflate_
|
||||
#define nf_inq_var_szip nf_inq_var_szip_
|
||||
#define nf_inq_var_fletcher32 nf_inq_var_fletcher32_
|
||||
#define nf_def_var_endian nf_def_var_endian_
|
||||
#define nf_inq_var_endian nf_inq_var_endian_
|
||||
#define nf_def_var_fill nf_def_var_fill_
|
||||
#define nf_inq_var_fill nf_inq_var_fill_
|
||||
#define nf_get_vlen_element nf_get_vlen_element_
|
||||
#define nf_inq_compound_fieldoffset nf_inq_compound_fieldoffset_
|
||||
#define nf_inq_grp_full nf_inq_grp_full_
|
||||
#define nf_inq_grpname_full nf_inq_grpname_full_
|
||||
#define nf_inq_grpname_len nf_inq_grpname_len_
|
||||
#define nf_put_vlen_element nf_put_vlen_element_
|
||||
#define nf_inq_grp_full_ncid nf_inq_grp_full_ncid_
|
||||
#define nf_set_chunk_cache nf_set_chunk_cache_
|
||||
#define nf_get_chunk_cache nf_get_chunk_cache_
|
||||
#define nf_set_var_chunk_cache nf_set_var_chunk_cache_
|
||||
#define nf_get_var_chunk_cache nf_get_var_chunk_cache_
|
||||
#define nf_free_string nf_free_string_
|
||||
#define nf_free_vlens nf_free_vlens_
|
||||
|
||||
#endif /* USE_NETCDF4 */
|
||||
|
||||
#endif /* f2cFortran */
|
||||
|
||||
#if defined(DLL_NETCDF) /* define when library is a DLL */
|
||||
# if defined(NC_DLL_EXPORT) /* define when building the library */
|
||||
# define extern extern __declspec(dllexport)
|
||||
# else
|
||||
# define extern extern __declspec(dllimport)
|
||||
# endif
|
||||
#endif /* defined(DLL_NETCDF) */
|
||||
|
||||
#endif /* header-file lockout */
|
224
fortran/netcdf2.inc
Normal file
224
fortran/netcdf2.inc
Normal file
@ -0,0 +1,224 @@
|
||||
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
|
||||
! begin netcdf 2.4 backward compatibility:
|
||||
!
|
||||
|
||||
!
|
||||
! functions in the fortran interface
|
||||
!
|
||||
integer nccre
|
||||
integer ncopn
|
||||
integer ncddef
|
||||
integer ncdid
|
||||
integer ncvdef
|
||||
integer ncvid
|
||||
integer nctlen
|
||||
integer ncsfil
|
||||
|
||||
external nccre
|
||||
external ncopn
|
||||
external ncddef
|
||||
external ncdid
|
||||
external ncvdef
|
||||
external ncvid
|
||||
external nctlen
|
||||
external ncsfil
|
||||
|
||||
|
||||
integer ncrdwr
|
||||
integer nccreat
|
||||
integer ncexcl
|
||||
integer ncindef
|
||||
integer ncnsync
|
||||
integer nchsync
|
||||
integer ncndirty
|
||||
integer nchdirty
|
||||
integer nclink
|
||||
integer ncnowrit
|
||||
integer ncwrite
|
||||
integer ncclob
|
||||
integer ncnoclob
|
||||
integer ncglobal
|
||||
integer ncfill
|
||||
integer ncnofill
|
||||
integer maxncop
|
||||
integer maxncdim
|
||||
integer maxncatt
|
||||
integer maxncvar
|
||||
integer maxncnam
|
||||
integer maxvdims
|
||||
integer ncnoerr
|
||||
integer ncebadid
|
||||
integer ncenfile
|
||||
integer nceexist
|
||||
integer nceinval
|
||||
integer nceperm
|
||||
integer ncenotin
|
||||
integer nceindef
|
||||
integer ncecoord
|
||||
integer ncemaxds
|
||||
integer ncename
|
||||
integer ncenoatt
|
||||
integer ncemaxat
|
||||
integer ncebadty
|
||||
integer ncebadd
|
||||
integer ncests
|
||||
integer nceunlim
|
||||
integer ncemaxvs
|
||||
integer ncenotvr
|
||||
integer nceglob
|
||||
integer ncenotnc
|
||||
integer ncfoobar
|
||||
integer ncsyserr
|
||||
integer ncfatal
|
||||
integer ncverbos
|
||||
integer ncentool
|
||||
|
||||
|
||||
!
|
||||
! netcdf data types:
|
||||
!
|
||||
integer ncbyte
|
||||
integer ncchar
|
||||
integer ncshort
|
||||
integer nclong
|
||||
integer ncfloat
|
||||
integer ncdouble
|
||||
|
||||
parameter(ncbyte = 1)
|
||||
parameter(ncchar = 2)
|
||||
parameter(ncshort = 3)
|
||||
parameter(nclong = 4)
|
||||
parameter(ncfloat = 5)
|
||||
parameter(ncdouble = 6)
|
||||
|
||||
!
|
||||
! masks for the struct nc flag field; passed in as 'mode' arg to
|
||||
! nccreate and ncopen.
|
||||
!
|
||||
|
||||
! read/write, 0 => readonly
|
||||
parameter(ncrdwr = 1)
|
||||
! in create phase, cleared by ncendef
|
||||
parameter(nccreat = 2)
|
||||
! on create destroy existing file
|
||||
parameter(ncexcl = 4)
|
||||
! in define mode, cleared by ncendef
|
||||
parameter(ncindef = 8)
|
||||
! synchronise numrecs on change (x'10')
|
||||
parameter(ncnsync = 16)
|
||||
! synchronise whole header on change (x'20')
|
||||
parameter(nchsync = 32)
|
||||
! numrecs has changed (x'40')
|
||||
parameter(ncndirty = 64)
|
||||
! header info has changed (x'80')
|
||||
parameter(nchdirty = 128)
|
||||
! prefill vars on endef and increase of record, the default behavior
|
||||
parameter(ncfill = 0)
|
||||
! do not fill vars on endef and increase of record (x'100')
|
||||
parameter(ncnofill = 256)
|
||||
! isa link (x'8000')
|
||||
parameter(nclink = 32768)
|
||||
|
||||
!
|
||||
! 'mode' arguments for nccreate and ncopen
|
||||
!
|
||||
parameter(ncnowrit = 0)
|
||||
parameter(ncwrite = ncrdwr)
|
||||
parameter(ncclob = nf_clobber)
|
||||
parameter(ncnoclob = nf_noclobber)
|
||||
|
||||
!
|
||||
! 'size' argument to ncdimdef for an unlimited dimension
|
||||
!
|
||||
integer ncunlim
|
||||
parameter(ncunlim = 0)
|
||||
|
||||
!
|
||||
! attribute id to put/get a global attribute
|
||||
!
|
||||
parameter(ncglobal = 0)
|
||||
|
||||
!
|
||||
! advisory maximums:
|
||||
!
|
||||
parameter(maxncop = 64)
|
||||
parameter(maxncdim = 1024)
|
||||
parameter(maxncatt = 8192)
|
||||
parameter(maxncvar = 8192)
|
||||
! not enforced
|
||||
parameter(maxncnam = 256)
|
||||
parameter(maxvdims = maxncdim)
|
||||
|
||||
!
|
||||
! global netcdf error status variable
|
||||
! initialized in error.c
|
||||
!
|
||||
|
||||
! no error
|
||||
parameter(ncnoerr = nf_noerr)
|
||||
! not a netcdf id
|
||||
parameter(ncebadid = nf_ebadid)
|
||||
! too many netcdfs open
|
||||
parameter(ncenfile = -31) ! nc_syserr
|
||||
! netcdf file exists && ncnoclob
|
||||
parameter(nceexist = nf_eexist)
|
||||
! invalid argument
|
||||
parameter(nceinval = nf_einval)
|
||||
! write to read only
|
||||
parameter(nceperm = nf_eperm)
|
||||
! operation not allowed in data mode
|
||||
parameter(ncenotin = nf_enotindefine )
|
||||
! operation not allowed in define mode
|
||||
parameter(nceindef = nf_eindefine)
|
||||
! coordinates out of domain
|
||||
parameter(ncecoord = nf_einvalcoords)
|
||||
! maxncdims exceeded
|
||||
parameter(ncemaxds = nf_emaxdims)
|
||||
! string match to name in use
|
||||
parameter(ncename = nf_enameinuse)
|
||||
! attribute not found
|
||||
parameter(ncenoatt = nf_enotatt)
|
||||
! maxncattrs exceeded
|
||||
parameter(ncemaxat = nf_emaxatts)
|
||||
! not a netcdf data type
|
||||
parameter(ncebadty = nf_ebadtype)
|
||||
! invalid dimension id
|
||||
parameter(ncebadd = nf_ebaddim)
|
||||
! ncunlimited in the wrong index
|
||||
parameter(nceunlim = nf_eunlimpos)
|
||||
! maxncvars exceeded
|
||||
parameter(ncemaxvs = nf_emaxvars)
|
||||
! variable not found
|
||||
parameter(ncenotvr = nf_enotvar)
|
||||
! action prohibited on ncglobal varid
|
||||
parameter(nceglob = nf_eglobal)
|
||||
! not a netcdf file
|
||||
parameter(ncenotnc = nf_enotnc)
|
||||
parameter(ncests = nf_ests)
|
||||
parameter (ncentool = nf_emaxname)
|
||||
parameter(ncfoobar = 32)
|
||||
parameter(ncsyserr = -31)
|
||||
|
||||
!
|
||||
! global options variable. used to determine behavior of error handler.
|
||||
! initialized in lerror.c
|
||||
!
|
||||
parameter(ncfatal = 1)
|
||||
parameter(ncverbos = 2)
|
||||
|
||||
!
|
||||
! default fill values. these must be the same as in the c interface.
|
||||
!
|
||||
integer filbyte
|
||||
integer filchar
|
||||
integer filshort
|
||||
integer fillong
|
||||
real filfloat
|
||||
doubleprecision fildoub
|
||||
|
||||
parameter (filbyte = -127)
|
||||
parameter (filchar = 0)
|
||||
parameter (filshort = -32767)
|
||||
parameter (fillong = -2147483647)
|
||||
parameter (filfloat = 9.9692099683868690e+36)
|
||||
parameter (fildoub = 9.9692099683868690d+36)
|
1109
fortran/netcdf3.inc
Normal file
1109
fortran/netcdf3.inc
Normal file
File diff suppressed because it is too large
Load Diff
388
fortran/netcdf4.inc
Normal file
388
fortran/netcdf4.inc
Normal file
@ -0,0 +1,388 @@
|
||||
! This is part of netCDF-4. Copyright 2006, UCAR, See COPYRIGHT
|
||||
! file for distribution information.
|
||||
|
||||
! Netcdf version 4 fortran interface.
|
||||
|
||||
! $Id: netcdf4.inc,v 1.28 2010/05/25 13:53:02 ed Exp $
|
||||
|
||||
! New netCDF-4 types.
|
||||
integer nf_ubyte
|
||||
integer nf_ushort
|
||||
integer nf_uint
|
||||
integer nf_int64
|
||||
integer nf_uint64
|
||||
integer nf_string
|
||||
integer nf_vlen
|
||||
integer nf_opaque
|
||||
integer nf_enum
|
||||
integer nf_compound
|
||||
|
||||
parameter (nf_ubyte = 7)
|
||||
parameter (nf_ushort = 8)
|
||||
parameter (nf_uint = 9)
|
||||
parameter (nf_int64 = 10)
|
||||
parameter (nf_uint64 = 11)
|
||||
parameter (nf_string = 12)
|
||||
parameter (nf_vlen = 13)
|
||||
parameter (nf_opaque = 14)
|
||||
parameter (nf_enum = 15)
|
||||
parameter (nf_compound = 16)
|
||||
|
||||
! New netCDF-4 fill values.
|
||||
integer nf_fill_ubyte
|
||||
integer nf_fill_ushort
|
||||
! real nf_fill_uint
|
||||
! real nf_fill_int64
|
||||
! real nf_fill_uint64
|
||||
parameter (nf_fill_ubyte = 255)
|
||||
parameter (nf_fill_ushort = 65535)
|
||||
|
||||
! New constants.
|
||||
integer nf_format_netcdf4
|
||||
parameter (nf_format_netcdf4 = 3)
|
||||
|
||||
integer nf_format_netcdf4_classic
|
||||
parameter (nf_format_netcdf4_classic = 4)
|
||||
|
||||
integer nf_netcdf4
|
||||
parameter (nf_netcdf4 = 4096)
|
||||
|
||||
integer nf_classic_model
|
||||
parameter (nf_classic_model = 256)
|
||||
|
||||
integer nf_chunk_seq
|
||||
parameter (nf_chunk_seq = 0)
|
||||
integer nf_chunk_sub
|
||||
parameter (nf_chunk_sub = 1)
|
||||
integer nf_chunk_sizes
|
||||
parameter (nf_chunk_sizes = 2)
|
||||
|
||||
integer nf_endian_native
|
||||
parameter (nf_endian_native = 0)
|
||||
integer nf_endian_little
|
||||
parameter (nf_endian_little = 1)
|
||||
integer nf_endian_big
|
||||
parameter (nf_endian_big = 2)
|
||||
|
||||
! For NF_DEF_VAR_CHUNKING
|
||||
integer nf_chunked
|
||||
parameter (nf_chunked = 0)
|
||||
integer nf_contiguous
|
||||
parameter (nf_contiguous = 1)
|
||||
|
||||
! For NF_DEF_VAR_FLETCHER32
|
||||
integer nf_nochecksum
|
||||
parameter (nf_nochecksum = 0)
|
||||
integer nf_fletcher32
|
||||
parameter (nf_fletcher32 = 1)
|
||||
|
||||
! For NF_DEF_VAR_DEFLATE
|
||||
integer nf_noshuffle
|
||||
parameter (nf_noshuffle = 0)
|
||||
integer nf_shuffle
|
||||
parameter (nf_shuffle = 1)
|
||||
|
||||
! For NF_DEF_VAR_SZIP
|
||||
integer nf_szip_ec_option_mask
|
||||
parameter (nf_szip_ec_option_mask = 4)
|
||||
integer nf_szip_nn_option_mask
|
||||
parameter (nf_szip_nn_option_mask = 32)
|
||||
|
||||
! For parallel I/O.
|
||||
integer nf_mpiio
|
||||
parameter (nf_mpiio = 8192)
|
||||
integer nf_mpiposix
|
||||
parameter (nf_mpiposix = 16384)
|
||||
integer nf_pnetcdf
|
||||
parameter (nf_pnetcdf = 32768)
|
||||
|
||||
! For NF_VAR_PAR_ACCESS.
|
||||
integer nf_independent
|
||||
parameter (nf_independent = 0)
|
||||
integer nf_collective
|
||||
parameter (nf_collective = 1)
|
||||
|
||||
! New error codes.
|
||||
integer nf_ehdferr ! Error at HDF5 layer.
|
||||
parameter (nf_ehdferr = -101)
|
||||
integer nf_ecantread ! Can't read.
|
||||
parameter (nf_ecantread = -102)
|
||||
integer nf_ecantwrite ! Can't write.
|
||||
parameter (nf_ecantwrite = -103)
|
||||
integer nf_ecantcreate ! Can't create.
|
||||
parameter (nf_ecantcreate = -104)
|
||||
integer nf_efilemeta ! Problem with file metadata.
|
||||
parameter (nf_efilemeta = -105)
|
||||
integer nf_edimmeta ! Problem with dimension metadata.
|
||||
parameter (nf_edimmeta = -106)
|
||||
integer nf_eattmeta ! Problem with attribute metadata.
|
||||
parameter (nf_eattmeta = -107)
|
||||
integer nf_evarmeta ! Problem with variable metadata.
|
||||
parameter (nf_evarmeta = -108)
|
||||
integer nf_enocompound ! Not a compound type.
|
||||
parameter (nf_enocompound = -109)
|
||||
integer nf_eattexists ! Attribute already exists.
|
||||
parameter (nf_eattexists = -110)
|
||||
integer nf_enotnc4 ! Attempting netcdf-4 operation on netcdf-3 file.
|
||||
parameter (nf_enotnc4 = -111)
|
||||
integer nf_estrictnc3 ! Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
|
||||
parameter (nf_estrictnc3 = -112)
|
||||
integer nf_enotnc3 ! Attempting netcdf-3 operation on netcdf-4 file.
|
||||
parameter (nf_enotnc3 = -113)
|
||||
integer nf_enopar ! Parallel operation on file opened for non-parallel access.
|
||||
parameter (nf_enopar = -114)
|
||||
integer nf_eparinit ! Error initializing for parallel access.
|
||||
parameter (nf_eparinit = -115)
|
||||
integer nf_ebadgrpid ! Bad group ID.
|
||||
parameter (nf_ebadgrpid = -116)
|
||||
integer nf_ebadtypid ! Bad type ID.
|
||||
parameter (nf_ebadtypid = -117)
|
||||
integer nf_etypdefined ! Type has already been defined and may not be edited.
|
||||
parameter (nf_etypdefined = -118)
|
||||
integer nf_ebadfield ! Bad field ID.
|
||||
parameter (nf_ebadfield = -119)
|
||||
integer nf_ebadclass ! Bad class.
|
||||
parameter (nf_ebadclass = -120)
|
||||
integer nf_emaptype ! Mapped access for atomic types only.
|
||||
parameter (nf_emaptype = -121)
|
||||
integer nf_elatefill ! Attempt to define fill value when data already exists.
|
||||
parameter (nf_elatefill = -122)
|
||||
integer nf_elatedef ! Attempt to define var properties, like deflate, after enddef.
|
||||
parameter (nf_elatedef = -123)
|
||||
integer nf_edimscale ! Probem with HDF5 dimscales.
|
||||
parameter (nf_edimscale = -124)
|
||||
integer nf_enogrp ! No group found.
|
||||
parameter (nf_enogrp = -125)
|
||||
|
||||
|
||||
! New functions.
|
||||
|
||||
! Parallel I/O.
|
||||
integer nf_create_par
|
||||
external nf_create_par
|
||||
|
||||
integer nf_open_par
|
||||
external nf_open_par
|
||||
|
||||
integer nf_var_par_access
|
||||
external nf_var_par_access
|
||||
|
||||
! Functions to handle groups.
|
||||
integer nf_inq_ncid
|
||||
external nf_inq_ncid
|
||||
|
||||
integer nf_inq_grps
|
||||
external nf_inq_grps
|
||||
|
||||
integer nf_inq_grpname
|
||||
external nf_inq_grpname
|
||||
|
||||
integer nf_inq_grpname_full
|
||||
external nf_inq_grpname_full
|
||||
|
||||
integer nf_inq_grpname_len
|
||||
external nf_inq_grpname_len
|
||||
|
||||
integer nf_inq_grp_parent
|
||||
external nf_inq_grp_parent
|
||||
|
||||
integer nf_inq_grp_ncid
|
||||
external nf_inq_grp_ncid
|
||||
|
||||
integer nf_inq_grp_full_ncid
|
||||
external nf_inq_grp_full_ncid
|
||||
|
||||
integer nf_inq_varids
|
||||
external nf_inq_varids
|
||||
|
||||
integer nf_inq_dimids
|
||||
external nf_inq_dimids
|
||||
|
||||
integer nf_def_grp
|
||||
external nf_def_grp
|
||||
|
||||
! New options for netCDF variables.
|
||||
integer nf_def_var_deflate
|
||||
external nf_def_var_deflate
|
||||
|
||||
integer nf_inq_var_deflate
|
||||
external nf_inq_var_deflate
|
||||
|
||||
integer nf_def_var_fletcher32
|
||||
external nf_def_var_fletcher32
|
||||
|
||||
integer nf_inq_var_fletcher32
|
||||
external nf_inq_var_fletcher32
|
||||
|
||||
integer nf_def_var_chunking
|
||||
external nf_def_var_chunking
|
||||
|
||||
integer nf_inq_var_chunking
|
||||
external nf_inq_var_chunking
|
||||
|
||||
integer nf_def_var_fill
|
||||
external nf_def_var_fill
|
||||
|
||||
integer nf_inq_var_fill
|
||||
external nf_inq_var_fill
|
||||
|
||||
integer nf_def_var_endian
|
||||
external nf_def_var_endian
|
||||
|
||||
integer nf_inq_var_endian
|
||||
external nf_inq_var_endian
|
||||
|
||||
! User defined types.
|
||||
integer nf_inq_typeids
|
||||
external nf_inq_typeids
|
||||
|
||||
integer nf_inq_typeid
|
||||
external nf_inq_typeid
|
||||
|
||||
integer nf_inq_type
|
||||
external nf_inq_type
|
||||
|
||||
integer nf_inq_user_type
|
||||
external nf_inq_user_type
|
||||
|
||||
! User defined types - compound types.
|
||||
integer nf_def_compound
|
||||
external nf_def_compound
|
||||
|
||||
integer nf_insert_compound
|
||||
external nf_insert_compound
|
||||
|
||||
integer nf_insert_array_compound
|
||||
external nf_insert_array_compound
|
||||
|
||||
integer nf_inq_compound
|
||||
external nf_inq_compound
|
||||
|
||||
integer nf_inq_compound_name
|
||||
external nf_inq_compound_name
|
||||
|
||||
integer nf_inq_compound_size
|
||||
external nf_inq_compound_size
|
||||
|
||||
integer nf_inq_compound_nfields
|
||||
external nf_inq_compound_nfields
|
||||
|
||||
integer nf_inq_compound_field
|
||||
external nf_inq_compound_field
|
||||
|
||||
integer nf_inq_compound_fieldname
|
||||
external nf_inq_compound_fieldname
|
||||
|
||||
integer nf_inq_compound_fieldindex
|
||||
external nf_inq_compound_fieldindex
|
||||
|
||||
integer nf_inq_compound_fieldoffset
|
||||
external nf_inq_compound_fieldoffset
|
||||
|
||||
integer nf_inq_compound_fieldtype
|
||||
external nf_inq_compound_fieldtype
|
||||
|
||||
integer nf_inq_compound_fieldndims
|
||||
external nf_inq_compound_fieldndims
|
||||
|
||||
integer nf_inq_compound_fielddim_sizes
|
||||
external nf_inq_compound_fielddim_sizes
|
||||
|
||||
! User defined types - variable length arrays.
|
||||
integer nf_def_vlen
|
||||
external nf_def_vlen
|
||||
|
||||
integer nf_inq_vlen
|
||||
external nf_inq_vlen
|
||||
|
||||
integer nf_free_vlen
|
||||
external nf_free_vlen
|
||||
|
||||
! User defined types - enums.
|
||||
integer nf_def_enum
|
||||
external nf_def_enum
|
||||
|
||||
integer nf_insert_enum
|
||||
external nf_insert_enum
|
||||
|
||||
integer nf_inq_enum
|
||||
external nf_inq_enum
|
||||
|
||||
integer nf_inq_enum_member
|
||||
external nf_inq_enum_member
|
||||
|
||||
integer nf_inq_enum_ident
|
||||
external nf_inq_enum_ident
|
||||
|
||||
! User defined types - opaque.
|
||||
integer nf_def_opaque
|
||||
external nf_def_opaque
|
||||
|
||||
integer nf_inq_opaque
|
||||
external nf_inq_opaque
|
||||
|
||||
! Write and read attributes of any type, including user defined
|
||||
! types.
|
||||
integer nf_put_att
|
||||
external nf_put_att
|
||||
integer nf_get_att
|
||||
external nf_get_att
|
||||
|
||||
! Write and read variables of any type, including user defined
|
||||
! types.
|
||||
integer nf_put_var
|
||||
external nf_put_var
|
||||
integer nf_put_var1
|
||||
external nf_put_var1
|
||||
integer nf_put_vara
|
||||
external nf_put_vara
|
||||
integer nf_put_vars
|
||||
external nf_put_vars
|
||||
integer nf_get_var
|
||||
external nf_get_var
|
||||
integer nf_get_var1
|
||||
external nf_get_var1
|
||||
integer nf_get_vara
|
||||
external nf_get_vara
|
||||
integer nf_get_vars
|
||||
external nf_get_vars
|
||||
|
||||
! 64-bit int functions.
|
||||
integer nf_put_var1_int64
|
||||
external nf_put_var1_int64
|
||||
integer nf_put_vara_int64
|
||||
external nf_put_vara_int64
|
||||
integer nf_put_vars_int64
|
||||
external nf_put_vars_int64
|
||||
integer nf_put_varm_int64
|
||||
external nf_put_varm_int64
|
||||
integer nf_put_var_int64
|
||||
external nf_put_var_int64
|
||||
integer nf_get_var1_int64
|
||||
external nf_get_var1_int64
|
||||
integer nf_get_vara_int64
|
||||
external nf_get_vara_int64
|
||||
integer nf_get_vars_int64
|
||||
external nf_get_vars_int64
|
||||
integer nf_get_varm_int64
|
||||
external nf_get_varm_int64
|
||||
integer nf_get_var_int64
|
||||
external nf_get_var_int64
|
||||
|
||||
! For helping F77 users with VLENs.
|
||||
integer nf_get_vlen_element
|
||||
external nf_get_vlen_element
|
||||
integer nf_put_vlen_element
|
||||
external nf_put_vlen_element
|
||||
|
||||
! For dealing with file level chunk cache.
|
||||
integer nf_set_chunk_cache
|
||||
external nf_set_chunk_cache
|
||||
integer nf_get_chunk_cache
|
||||
external nf_get_chunk_cache
|
||||
|
||||
! For dealing with per variable chunk cache.
|
||||
integer nf_set_var_chunk_cache
|
||||
external nf_set_var_chunk_cache
|
||||
integer nf_get_var_chunk_cache
|
||||
external nf_get_var_chunk_cache
|
83
fortran/nfconfig.in
Normal file
83
fortran/nfconfig.in
Normal file
@ -0,0 +1,83 @@
|
||||
#if 0
|
||||
$Id: nfconfig.in,v 1.11 1997/12/03 17:41:42 steve Exp $
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef UD_NETCDF_CPP_INC
|
||||
#define UD_NETCDF_CPP_INC
|
||||
|
||||
|
||||
#if 0
|
||||
Do not have C-style comments in here because this file is processed
|
||||
by both the FORTRAN compiler (for the nf_test/ stuff) and the C
|
||||
compiler (for the FORTRAN-callable interface routines) and some
|
||||
FORTRAN preprocessors do not understand the /*...*/ syntax.
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
The following macros define the supplementary FORTRAN arithmetic
|
||||
datatypes beyond the standard INTEGER, REAL, and DOUBLEPRECISION --
|
||||
ostensibly corresponding to 8-bit and 16-bit integers, respectively.
|
||||
For example:
|
||||
|
||||
#define NF_INT1_T byte
|
||||
#define NF_INT2_T integer*2
|
||||
|
||||
These are the types of the relevant arguments in the NF_*_INT1() and
|
||||
NF_*_INT2() netCDF FORTRAN function calls. The word "ostensibly"
|
||||
is used advisedly: on some systems an "integer*2" datatype,
|
||||
nevertheless, occupies 64 bits (we are not making this up).
|
||||
|
||||
If your FORTRAN system does not have the respective supplementary
|
||||
datatype, then do not define the corresponding macro.
|
||||
#endif
|
||||
#undef NF_INT1_T
|
||||
#undef NF_INT2_T
|
||||
|
||||
|
||||
#if 0
|
||||
Define the following NF_*_IS_C_* macros appropriatly for your system.
|
||||
The "INT1", "INT2" and "INT" after the "NF_" refer to the NF_INT1_T
|
||||
FORTRAN datatype, the NF_INT2_T FORTRAN datatype, and the INTEGER
|
||||
FORTRAN datatype, respectively. If the respective FORTRAN datatype
|
||||
does not exist, then do not define the corresponding macro.
|
||||
#endif
|
||||
#undef NF_INT1_IS_C_SIGNED_CHAR
|
||||
#undef NF_INT1_IS_C_SHORT
|
||||
#undef NF_INT1_IS_C_INT
|
||||
#undef NF_INT1_IS_C_LONG
|
||||
#undef NF_INT2_IS_C_SHORT
|
||||
#undef NF_INT2_IS_C_INT
|
||||
#undef NF_INT2_IS_C_LONG
|
||||
#undef NF_INT_IS_C_INT
|
||||
#undef NF_INT_IS_C_LONG
|
||||
#undef NF_REAL_IS_C_FLOAT
|
||||
#undef NF_REAL_IS_C_DOUBLE
|
||||
#undef NF_DOUBLEPRECISION_IS_C_DOUBLE
|
||||
#undef NF_DOUBLEPRECISION_IS_C_FLOAT
|
||||
|
||||
|
||||
#if 0
|
||||
Whether the system uses something besides the IEEE floating-point
|
||||
format to represent floating-point values.
|
||||
#endif
|
||||
#undef NO_IEEE_FLOAT
|
||||
|
||||
|
||||
#if 0
|
||||
END OF CUSTOMIZATION
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
FORTRAN data types corresponding to netCDF version 2 "byte" and "short"
|
||||
data types (e.g. INTEGER*1, INTEGER*2). See file "ftest.F" for usage.
|
||||
#endif
|
||||
#if !defined(NO_NETCDF_2)
|
||||
# undef NCBYTE_T
|
||||
# undef NCSHORT_T
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
35
libcf/COPYRIGHT
Normal file
35
libcf/COPYRIGHT
Normal file
@ -0,0 +1,35 @@
|
||||
Copyright 1993-2004 University Corporation for Atmospheric Research/Unidata
|
||||
|
||||
Portions of this software were developed by the Unidata Program at the
|
||||
University Corporation for Atmospheric Research.
|
||||
|
||||
Access and use of this software shall impose the following obligations
|
||||
and understandings on the user. The user is granted the right, without
|
||||
any fee or cost, to use, copy, modify, alter, enhance and distribute
|
||||
this software, and any derivative works thereof, and its supporting
|
||||
documentation for any purpose whatsoever, provided that this entire
|
||||
notice appears in all copies of the software, derivative works and
|
||||
supporting documentation. Further, UCAR requests that the user credit
|
||||
UCAR/Unidata in any publications that result from the use of this
|
||||
software or in any product that includes this software, although this
|
||||
is not an obligation. The names UCAR and/or Unidata, however, may not
|
||||
be used in any advertising or publicity to endorse or promote any
|
||||
products or commercial entity unless specific written permission is
|
||||
obtained from UCAR/Unidata. The user also understands that
|
||||
UCAR/Unidata is not obligated to provide the user with any support,
|
||||
consulting, training or assistance of any kind with regard to the use,
|
||||
operation and performance of this software nor to provide the user
|
||||
with any updates, revisions, new versions or "bug fixes."
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL,
|
||||
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
|
||||
WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
|
||||
|
45
libcf/Makefile.am
Normal file
45
libcf/Makefile.am
Normal file
@ -0,0 +1,45 @@
|
||||
## This is a automake file, part of Unidata's NetCDF CF Library package.
|
||||
# Copyright 2006, see the COPYRIGHT file for more information.
|
||||
|
||||
# This is the main automake file for the NetCDF CF Library.
|
||||
|
||||
# $Id: Makefile.am,v 1.4 2009/07/07 14:02:10 ed Exp $
|
||||
|
||||
# These files get added to the distribution.
|
||||
EXTRA_DIST = COPYRIGHT
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# Does the user want to build cfcheck?
|
||||
if BUILD_CFCHECK
|
||||
CFCHECK = cfcheck
|
||||
endif
|
||||
|
||||
# Does the user want to build the docs?
|
||||
if BUILD_DOCS
|
||||
DOC = doc
|
||||
endif
|
||||
|
||||
# Does the user want to build the gridspec?
|
||||
if BUILD_GRIDSPEC
|
||||
GRIDSPEC = gridspec
|
||||
endif
|
||||
|
||||
SUBDIRS = $(GRIDSPEC) src $(CFCHECK) $(DOC)
|
||||
|
||||
check_install: check install
|
||||
|
||||
# What needs to go in the binrary dist?
|
||||
BINFILES = README_BINARIES.txt include/libcf.h lib/libcf.a
|
||||
|
||||
# At Unidata, package up binaries.
|
||||
ftpbin: install
|
||||
echo "Getting binaries from ${prefix}"
|
||||
ls ${prefix}
|
||||
echo "These are the binaries for libCF @PACKAGE_VERSION@." > ${prefix}/README_BINARIES.txt
|
||||
echo "For this build: CC=$(CC) CXX=$(CXX) FC=$(FC) F77=$(F77) $F90=$(F90)" >> ${prefix}/README_BINARIES.txt
|
||||
echo "CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS)" >> ${prefix}/README_BINARIES.txt
|
||||
echo "FCFLAGS=$(FCFLAGS) F77FLAGS=$(F77FLAGS) $F90FLAGS=$(F90FLAGS)" >> ${prefix}/README_BINARIES.txt
|
||||
tar cf binary-libcf-@PACKAGE_VERSION@.tar -C ${prefix} ${BINFILES}
|
||||
gzip -f binary-libcf-@PACKAGE_VERSION@.tar
|
||||
|
19
libcf/RELEASE_NOTES
Normal file
19
libcf/RELEASE_NOTES
Normal file
@ -0,0 +1,19 @@
|
||||
This file contains a high-level description of this package's evolution.
|
||||
Entries are in reverse chronological order (most recent first).
|
||||
|
||||
VERSION COMMENTS
|
||||
------- --------
|
||||
|
||||
1.0 alpha3 2006-09-13
|
||||
|
||||
Added def, inq functions for lat, lon, level, time.
|
||||
|
||||
Added tst_cvars.
|
||||
|
||||
Updated and extended documentation.
|
||||
|
||||
Added tst_files, tst_vars.
|
||||
|
||||
Added nccf_var_def, inq, nccf_var_def,inq_missing,
|
||||
nccf_def,inq_file, also notes functions.
|
||||
|
58
libcf/acinclude.m4
Normal file
58
libcf/acinclude.m4
Normal file
@ -0,0 +1,58 @@
|
||||
AC_DEFUN([AX_F90_MODULE_FLAG],[
|
||||
AC_CACHE_CHECK([fortran 90 modules inclusion flag],
|
||||
ax_cv_f90_modflag,
|
||||
[AC_LANG_PUSH(Fortran)
|
||||
i=0
|
||||
while test \( -f tmpdir_$i \) -o \( -d tmpdir_$i \) ; do
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
mkdir tmpdir_$i
|
||||
cd tmpdir_$i
|
||||
AC_COMPILE_IFELSE([module conftest_module
|
||||
contains
|
||||
subroutine conftest_routine
|
||||
write(*,'(a)') 'gotcha!'
|
||||
end subroutine conftest_routine
|
||||
end module conftest_module
|
||||
],[],[])
|
||||
cd ..
|
||||
ax_cv_f90_modflag="not found"
|
||||
for ax_flag in "-I" "-M" "-p"; do
|
||||
if test "$ax_cv_f90_modflag" = "not found" ; then
|
||||
ax_save_FCFLAGS="$FCFLAGS"
|
||||
FCFLAGS="$ax_save_FCFLAGS ${ax_flag}tmpdir_$i"
|
||||
AC_COMPILE_IFELSE([program conftest_program
|
||||
use conftest_module
|
||||
call conftest_routine
|
||||
end program conftest_program
|
||||
],[ax_cv_f90_modflag="$ax_flag"],[])
|
||||
FCFLAGS="$ax_save_FCFLAGS"
|
||||
fi
|
||||
done
|
||||
rm -fr tmpdir_$i
|
||||
if test "$ax_flag" = "not found" ; then
|
||||
AC_MSG_ERROR([unable to find compiler flag for modules inclusion])
|
||||
fi
|
||||
AC_LANG_POP(Fortran)
|
||||
])])
|
||||
|
||||
AC_DEFUN([AC_PROG_FC_UPPERCASE_MOD],
|
||||
[
|
||||
AC_LANG_PUSH(Fortran)
|
||||
AC_MSG_CHECKING([if Fortran 90 compiler capitalizes .mod filenames])
|
||||
cat <<EOF >conftest.f90
|
||||
module conftest
|
||||
end module conftest
|
||||
EOF
|
||||
ac_try='$F90 ${F90FLAGS} conftest.f90 ${F90LIBS}>&AS_MESSAGE_LOG_FD'
|
||||
AC_TRY_EVAL(ac_try)
|
||||
if test -f CONFTEST.mod ; then
|
||||
ac_cv_prog_f90_uppercase_mod=yes
|
||||
rm -f CONFTEST.mod
|
||||
else
|
||||
ac_cv_prog_f90_uppercase_mod=no
|
||||
fi
|
||||
AC_MSG_RESULT($ac_cv_prog_f90_uppercase_mod)
|
||||
#rm -f conftest*
|
||||
AC_LANG_POP(Fortran)
|
||||
])
|
4
libcf/cfcheck/CVS/Entries
Normal file
4
libcf/cfcheck/CVS/Entries
Normal file
@ -0,0 +1,4 @@
|
||||
/Makefile.am/1.5/Sat May 29 01:46:30 2010//
|
||||
/cfcheck.c/1.1.1.1/Mon Jul 6 15:06:29 2009//
|
||||
/tst_cfcheck.sh/1.1.1.1/Mon Jul 6 15:06:29 2009//
|
||||
D
|
1
libcf/cfcheck/CVS/Repository
Normal file
1
libcf/cfcheck/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
netcdf-3/libcf/cfcheck
|
1
libcf/cfcheck/CVS/Root
Normal file
1
libcf/cfcheck/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
/upc/share/CVS
|
32
libcf/cfcheck/Makefile.am
Normal file
32
libcf/cfcheck/Makefile.am
Normal file
@ -0,0 +1,32 @@
|
||||
# This is part of the libcf library.
|
||||
|
||||
# This automake file handles the building of cfcheck.
|
||||
|
||||
# Ed Hartnett 11/23/06
|
||||
|
||||
# $Id: Makefile.am,v 1.5 2010/05/29 01:46:30 dmh Exp $
|
||||
|
||||
AM_CPPFLAGS =
|
||||
AM_LDFLAGS =
|
||||
LDADD =
|
||||
|
||||
AM_CPPFLAGS += -I${top_srcdir}/src
|
||||
|
||||
if USE_NETCDF_DIR
|
||||
AM_CPPFLAGS += -I@NETCDFDIR@/include
|
||||
AM_LDFLAGS += -L@NETCDFDIR@/lib
|
||||
else #!USE_NETCDF_DIR
|
||||
AM_CPPFLAGS += -I${top_srcdir}/../liblib
|
||||
AM_LDFLAGS += ${top_builddir}/../liblib/libnetcdf.la
|
||||
endif #!USE_NETCDF_DIR
|
||||
|
||||
AM_LDFLAGS += @EXTERN_LDFLAGS@ -lm
|
||||
|
||||
EXTRA_DIST = tst_cfcheck.sh
|
||||
|
||||
bin_PROGRAMS = cfcheck
|
||||
cfcheck_SOURCES = cfcheck.c
|
||||
|
||||
TESTS = tst_cfcheck.sh
|
||||
|
||||
CLEANFILES = useage.txt
|
87
libcf/cfcheck/cfcheck.c
Normal file
87
libcf/cfcheck/cfcheck.c
Normal file
@ -0,0 +1,87 @@
|
||||
/* Copyright 2006, Unidata/UCAR. See COPYRIGHT file for more
|
||||
details.
|
||||
|
||||
This program checks a netCDF file to see how well it complies with
|
||||
the CF Metadata conventions.
|
||||
|
||||
Ed Hartnett, 11/23/06
|
||||
|
||||
$Id: cfcheck.c,v 1.1.1.1 2009/07/06 15:06:29 ed Exp $
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h> /* for getopt */
|
||||
#include <netcdf.h>
|
||||
#include <libcf.h>
|
||||
|
||||
/* This struct is used to keep track of user options from the command
|
||||
* line. */
|
||||
typedef struct
|
||||
{
|
||||
int verbose;
|
||||
} OPTIONS_T;
|
||||
|
||||
/* This is a message to the user about how to use cfcheck. */
|
||||
#define USAGE "\
|
||||
file Name of netCDF file\n"
|
||||
|
||||
/* This prints out a helpful message to the user when they screw up or
|
||||
* are confused and ask for help. */
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
fprintf(stderr, "cfcheck file\n%s", USAGE);
|
||||
fprintf(stderr, "netcdf library version %s\n", nc_inq_libvers());
|
||||
}
|
||||
|
||||
/* This function checks one file for cf conventions. */
|
||||
static int
|
||||
do_cfcheck(char *filename, OPTIONS_T *options)
|
||||
{
|
||||
printf("Checking CF conventions for file %s.\n", filename);
|
||||
return CF_NOERR;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
extern char *optarg;
|
||||
char c;
|
||||
OPTIONS_T options;
|
||||
int i;
|
||||
|
||||
/* If the user called ncdump without arguments, print the usage
|
||||
* message and return peacefully. */
|
||||
if (argc <= 1)
|
||||
{
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* See what options the user wants, and set flags in the OPTIONS_T
|
||||
* stuct. */
|
||||
while ((c = getopt(argc, argv, "?:v")) != EOF)
|
||||
{
|
||||
switch(c)
|
||||
{
|
||||
case '?':
|
||||
usage();
|
||||
return 0;
|
||||
case 'v':
|
||||
options.verbose = 1;
|
||||
return 0;
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
}
|
||||
|
||||
/* Check each file in turn. */
|
||||
for (i = 1; i < argc; i++)
|
||||
if (argc > 0)
|
||||
do_cfcheck(argv[i], &options);
|
||||
|
||||
return CF_NOERR;
|
||||
}
|
21
libcf/cfcheck/tst_cfcheck.sh
Executable file
21
libcf/cfcheck/tst_cfcheck.sh
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2006, Unidata/UCAR. See COPYRIGHT file.
|
||||
|
||||
# This is part of the libcf library.
|
||||
|
||||
# This shell script runs the cfcheck tests.
|
||||
|
||||
# Ed Hartnett, 11/23/06
|
||||
|
||||
# $Id: tst_cfcheck.sh,v 1.1.1.1 2009/07/06 15:06:29 ed Exp $
|
||||
|
||||
set -e
|
||||
echo ""
|
||||
echo "*** Testing cfcheck."
|
||||
|
||||
echo "*** testing that useage works..."
|
||||
./cfcheck &> useage.txt
|
||||
#diff -w usage.txt ref_usage.txt
|
||||
|
||||
echo "*** All tests of cfcheck passed!"
|
||||
exit 0
|
436
libcf/configure.ac
Normal file
436
libcf/configure.ac
Normal file
@ -0,0 +1,436 @@
|
||||
# -*- Autoconf -*-
|
||||
## Process this file with autoconf to produce a configure script.
|
||||
|
||||
# This is part of Unidata's NetCDF CF Library. package. Copyright
|
||||
# 2006, see the COPYRIGHT file for more information.
|
||||
|
||||
## This puts the cvs ID tag in the output configure script.
|
||||
AC_REVISION([$Id: configure.ac,v 1.13 2010/05/21 23:24:04 dmh Exp $])
|
||||
|
||||
## Running autoconf on this file will trigger a warning if
|
||||
## autoconf is not at least the specified version.
|
||||
AC_PREREQ([2.59])
|
||||
|
||||
## Initialize with name, version, and support email address.
|
||||
AC_INIT([libcf], [1.0-alpha5], [support@unidata.ucar.edu])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AC_MSG_NOTICE([libcf AC_PACKAGE_VERSION])
|
||||
|
||||
# Find out about the host we're building on.
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
# We will output a config.h for the C library, and a fortran inc file,
|
||||
# nfconfig.inc.
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_HEADERS([nfconfig.inc:nfconfig.in],
|
||||
[sed '1d;s%^/\* \(.*\) \*/%\1%' nfconfig.inc >conftest.tmp && mv conftest.tmp nfconfig.inc])
|
||||
|
||||
# This call is required by automake.
|
||||
AM_INIT_AUTOMAKE([foreign no-installinfo dist-bzip2 subdir-objects -Wall])
|
||||
|
||||
# Check for the existance of this file before proceeding.
|
||||
AC_CONFIG_SRCDIR([src/nccoord.c])
|
||||
|
||||
AC_MSG_NOTICE([checking user options])
|
||||
|
||||
# Turn off shared libraries by default
|
||||
AM_DISABLE_SHARED
|
||||
|
||||
# The autoconf manual suggests the following to set a var if it's not
|
||||
# already set: test "${var+set}" = set || var={value}
|
||||
|
||||
# For backward compatibility, check to see if the user has set FC to
|
||||
# null. If so, treat that as the --disable-fortran option to
|
||||
# configure.
|
||||
|
||||
# Did the user set fc to null?
|
||||
AC_MSG_CHECKING([whether FC is set to ''])
|
||||
nc_null_fc=no
|
||||
test "x${FC+set}" = xset && test "x$FC" = x && nc_null_fc=yes
|
||||
AC_MSG_RESULT([$nc_null_fc])
|
||||
|
||||
# Does the user want to build documentation?
|
||||
AC_MSG_CHECKING([whether documentation is to be built])
|
||||
AC_ARG_ENABLE([docs],
|
||||
[AS_HELP_STRING([--enable-docs],
|
||||
[build the libcf documentation (a built version is already \
|
||||
included with the distrubution)])])
|
||||
test "x$enable_docs" = xyes || enable_docs=no
|
||||
AC_MSG_RESULT($enable_docs)
|
||||
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_docs = xyes])
|
||||
|
||||
# Does the user want to build gridspec tools?
|
||||
AC_MSG_CHECKING([whether gridspec tools are to be built])
|
||||
AC_ARG_ENABLE([gridspec],
|
||||
[AS_HELP_STRING([--enable-gridspec],
|
||||
[build the gridspec tools])])
|
||||
test "x$enable_gridspec" = xyes || enable_gridspec=no
|
||||
AC_MSG_RESULT($enable_gridspec)
|
||||
AM_CONDITIONAL(BUILD_GRIDSPEC, [test x$enable_gridspec = xyes])
|
||||
|
||||
# Does the user want to fetch test data and run extra gridspec tests?
|
||||
AC_MSG_CHECKING([whether gridspec test data should be fetched from Unidata FTP site])
|
||||
AC_ARG_ENABLE([gridspec-file-tests],
|
||||
[AS_HELP_STRING([--enable-gridspec-file-tests],
|
||||
[get GRIDSPEC test data from Unidata FTP server and run extra tests])])
|
||||
test "x$enable_gridspec_file_tests" = xyes || enable_gridspec_file_tests=no
|
||||
AC_MSG_RESULT($enable_gridspec_file_tests)
|
||||
AM_CONDITIONAL(BUILD_GRIDSPEC_FILE_TESTS, [test x$enable_gridspec_file_tests = xyes])
|
||||
|
||||
# Does the user want to build cfcheck?
|
||||
AC_MSG_CHECKING([whether cfcheck is to be built])
|
||||
AC_ARG_ENABLE([cfcheck],
|
||||
[AS_HELP_STRING([--disable-cfcheck],
|
||||
[don't build the cfcheck application])])
|
||||
test "x$enable_cfcheck" = xno || enable_cfcheck=yes
|
||||
AC_MSG_RESULT($enable_cfcheck)
|
||||
AM_CONDITIONAL(BUILD_CFCHECK, [test x$enable_cfcheck = xyes])
|
||||
|
||||
# Does the user want to enable logging?
|
||||
AC_MSG_CHECKING([whether logging is enabled (useful to CF developers, mainly])
|
||||
AC_ARG_ENABLE([logging],
|
||||
[AS_HELP_STRING([--enable-logging],
|
||||
[enable logging capability. This debugging features \
|
||||
is only of interest to libcf developers.])])
|
||||
test "x$enable_logging" = "xyes" || enable_logging=no
|
||||
AC_MSG_RESULT([$enable_logging])
|
||||
if test "x$enable_logging" = xyes; then
|
||||
AC_DEFINE([LOGGING], 1, [if true, turn on logging])
|
||||
fi
|
||||
|
||||
# Does the user want to use netcdf-4?
|
||||
AC_MSG_CHECKING([whether netCDF-4 is to be used])
|
||||
AC_ARG_ENABLE([netcdf-4],
|
||||
[AS_HELP_STRING([--enable-netcdf-4],
|
||||
[build with netcdf-4 (HDF5 is required)])])
|
||||
|
||||
# If hdf5 dir is set, turn on enable-netcdf-4.
|
||||
if test "x$with_hdf5" != x; then
|
||||
enable_netcdf_4=yes
|
||||
else
|
||||
test "x$enable_netcdf_4" = xyes || enable_netcdf_4=no
|
||||
fi
|
||||
AC_MSG_RESULT($enable_netcdf_4)
|
||||
AM_CONDITIONAL(USE_NETCDF4, [test x$enable_netcdf_4 = xyes])
|
||||
if test "x$enable_netcdf_4" = xyes; then
|
||||
AC_DEFINE([USE_NETCDF4], 1, [if true, use netCDF-4])
|
||||
fi
|
||||
|
||||
# Does the user want to turn on HDF4 read ability?
|
||||
AC_ARG_ENABLE([hdf4], [AS_HELP_STRING([--enable-hdf4],
|
||||
[build netcdf-4 with HDF4 read capability (HDF4, HDF5 and zlib required)])])
|
||||
|
||||
# Does the user want extra tests on CF sample files?
|
||||
AC_MSG_CHECKING([whether extra tests on sample data should be performed])
|
||||
AC_ARG_ENABLE([extra-data-tests],
|
||||
[AS_HELP_STRING([--enable-extra-data-tests],
|
||||
[Perform extra tests using CF example files from Unidata web site \
|
||||
(example files must be donloaded separately). This option should \
|
||||
only be used by those with excessive interest in testing libcf.])])
|
||||
test "x$enable_extra_data_tests" = xyes || enable_extra_data_tests=no
|
||||
AC_MSG_RESULT($enable_extra_data_tests)
|
||||
AM_CONDITIONAL(EXTRA_DATA_TESTS, [test x$enable_extra_data_tests = xyes])
|
||||
|
||||
# Did the user specify a location for the HDF5 library?
|
||||
AC_MSG_CHECKING([whether a location for the HDF5 library was specified])
|
||||
AC_ARG_WITH([hdf5],
|
||||
[AS_HELP_STRING([--with-hdf5=<directory>],
|
||||
[Specify location of HDF5 library. Configure will expect \
|
||||
to find subdirs include and lib.])],
|
||||
[HDF5DIR=$with_hdf5])
|
||||
AC_MSG_RESULT([$HDF5DIR])
|
||||
AM_CONDITIONAL(USE_HDF5_DIR, [test ! "x$HDF5DIR" = x])
|
||||
AC_SUBST(HDF5DIR, [$HDF5DIR])
|
||||
if test ! "x$HDF5DIR" = x; then
|
||||
LDFLAGS="${LDFLAGS} -L$HDF5DIR/lib"
|
||||
fi
|
||||
|
||||
# Did the user specify a location for the HDF4 library?
|
||||
AC_MSG_CHECKING([whether a location for the HDF4 library was specified])
|
||||
AC_ARG_WITH([hdf4],
|
||||
[AS_HELP_STRING([--with-hdf4=<directory>],
|
||||
[Specify location of HDF4 library. Configure will \
|
||||
expect to find subdirs include and lib.])],
|
||||
[HDF4DIR=$with_hdf4])
|
||||
AC_MSG_RESULT([$HDF4DIR])
|
||||
AM_CONDITIONAL(USE_HDF4_DIR, [test ! "x$HDF4DIR" = x])
|
||||
AC_SUBST(HDF4DIR, [$HDF4DIR])
|
||||
AM_CONDITIONAL(USE_HDF4, [test x$enable_hdf4 = xyes])
|
||||
|
||||
# Did the user specify a location for the ZLIB library?
|
||||
AC_MSG_CHECKING([whether a location for the ZLIB library was specified])
|
||||
AC_ARG_WITH([zlib],
|
||||
[AS_HELP_STRING([--with-zlib=<directory>],
|
||||
[Specify location of ZLIB library. ZLIB is required \
|
||||
for netCDF-4. Configure will expect to find subdirs \
|
||||
include and lib.])],
|
||||
[ZLIBDIR=$with_zlib])
|
||||
AC_MSG_RESULT([$ZLIBDIR])
|
||||
AC_SUBST(ZLIBDIR, [$ZLIBDIR])
|
||||
|
||||
# Did the user specify a location for the SZLIB library?
|
||||
AC_MSG_CHECKING([whether a location for the SZLIB library was specified])
|
||||
AC_ARG_WITH([szlib],
|
||||
[AS_HELP_STRING([--with-szlib=<directory>],
|
||||
[Specify location of SZLIB library. SZLIB is not \
|
||||
required for netCDF-4, but you must specify its location \
|
||||
if HDF5 was built with SZLIB. Configure will expect to \
|
||||
find subdirs include and lib.])],
|
||||
[SZLIBDIR=$with_szlib])
|
||||
AC_MSG_RESULT([$SZLIBDIR])
|
||||
AC_SUBST(SZLIBDIR, [$SZLIBDIR])
|
||||
|
||||
AM_CONDITIONAL(USE_ZLIB_DIR, [test ! "x$ZLIBDIR" = x])
|
||||
AM_CONDITIONAL(USE_SZLIB_DIR, [test ! "x$SZLIBDIR" = x])
|
||||
|
||||
# Do we want to build the fortran API? Check for --disable-f90
|
||||
nc_build_f90=yes
|
||||
AC_MSG_CHECKING([whether Fortran 90 API is desired])
|
||||
AC_ARG_ENABLE([f90],
|
||||
[AS_HELP_STRING([--disable-f90],
|
||||
[don't try to build Fortran 90 API])])
|
||||
test "x$enable_f90" = "xno" && nc_build_f90=no
|
||||
test "x$nc_null_fc" = xyes && nc_build_f90=no
|
||||
AC_MSG_RESULT([$nc_build_f90])
|
||||
AM_CONDITIONAL(BUILD_F90, [test "x$nc_build_f90" = xyes])
|
||||
|
||||
# Did the user specify a location for the netcdf library?
|
||||
AC_MSG_CHECKING([whether a location for the netCDF library was specified])
|
||||
AC_ARG_WITH([netcdf],
|
||||
[AS_HELP_STRING([--with-netcdf=<directory>],
|
||||
[Specify location of netCDF library. Configure will expect to find \
|
||||
subdirs include and lib.])], [], [with_netcdf=no])
|
||||
AC_MSG_RESULT([$with_netcdf])
|
||||
AM_CONDITIONAL([USE_NETCDF_DIR], [test ! x$with_netcdf = xno])
|
||||
if test ! x$with_netcdf = xno; then
|
||||
AC_SUBST(NETCDFDIR, [$with_netcdf])
|
||||
AC_SUBST(NCDUMPDIR, [$with_netcdf/bin])
|
||||
LDFLAGS="${LDFLAGS} -L$NETCDFDIR/lib"
|
||||
else
|
||||
AC_SUBST(NCDUMPDIR, [../../../../ncdump])
|
||||
fi
|
||||
|
||||
# According to the autoconf mailing list gurus, we must test for
|
||||
# compilers unconditionally. That is, we can't skip looking for the
|
||||
# fortran compilers, just because the user doesn't want fortran. This
|
||||
# is due to a limitation in autoconf.
|
||||
|
||||
# Find the C compiler.
|
||||
AC_MSG_NOTICE([finding C compiler])
|
||||
AC_PROG_CC(mpcc_r xlc cc c89 acc gcc)
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
# Find fortran compiler. If FC isn't set after AC_PROG_FC, we couldn't
|
||||
# find a fortran compiler. If the user requested the fortran API, then
|
||||
# bail out right here.
|
||||
AC_MSG_NOTICE([finding Fortran compiler (required, even if Fortran API is not desired)])
|
||||
|
||||
# On solaris, f95 comes before gfortran.
|
||||
case "$host" in
|
||||
*solaris*)
|
||||
F77S="xlf fort xlf95 ifort ifc efc pgf77 lf95 f95 f90 g95 gfortran f77 frt pgf95 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 g77"
|
||||
F90S="xlf90 fort xlf95 ifort ifc efc pgf95 lf95 f95 f90 g95 gfortran xlf90 pgf90 epcf90"
|
||||
;;
|
||||
*)
|
||||
F77S="xlf fort xlf95 ifort ifc efc pgf77 lf95 g95 gfortran f77 frt pgf95 f95 f90 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 g77"
|
||||
F90S="xlf90 fort xlf95 ifort ifc efc pgf95 lf95 g95 gfortran f95 f90 f90 xlf90 pgf90 epcf90"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Find a fortran 90 compiler, if possible.
|
||||
# MingW has a wierd problem. If arguments are passed to AC_PROG_FC,
|
||||
# the link of tests won't work (you get a multiply defined atexit
|
||||
# function.) This is annoying, but there it is.
|
||||
if test "$host" = "i686-pc-mingw32"; then
|
||||
AC_PROG_FC
|
||||
else
|
||||
AC_PROG_FC($F90S)
|
||||
fi
|
||||
|
||||
# If we couldn't find an F90 compiler, deal with it.
|
||||
if test "${FC+set}" = set && test "x$FC" = x; then
|
||||
AC_MSG_WARN([No F90 compiler found. F90 API will not be built.])
|
||||
nc_build_f90=no
|
||||
fi
|
||||
|
||||
# We must call AC_PROG_F77 here, otherwise the LIBTOOL macro below
|
||||
# will call it, and reset F77 to g77.
|
||||
AC_PROG_F77($F77S)
|
||||
if test "${F77+set}" = set && test "x$F77" = x; then
|
||||
AC_MSG_WARN([No F77 compiler found. F77 API will not be built.])
|
||||
nc_build_f77=no
|
||||
fi
|
||||
|
||||
if test "x$nc_build_f90" = xno; then
|
||||
F90=
|
||||
# If F77 is set, and FC isn't, then set FC to whatever F77 was set to.
|
||||
FC=$F77
|
||||
fi
|
||||
|
||||
ac_cv_prog_f90_uppercase_mod=no
|
||||
if test "x$nc_build_f90" = xyes; then
|
||||
# Some f90 compilers change the case of the mod file names. Others
|
||||
# require special flags to be set to deal with .f90 files. Find out
|
||||
# about this compiler.
|
||||
AC_LANG_PUSH(Fortran)
|
||||
AC_FC_SRCEXT(f90)
|
||||
AC_LANG_POP(Fortran)
|
||||
AX_F90_MODULE_FLAG
|
||||
AC_SUBST(MOD_FLAG, ${ax_cv_f90_modflag})
|
||||
AC_PROG_FC_UPPERCASE_MOD
|
||||
fi
|
||||
AM_CONDITIONAL(UPPER_CASE_MOD, [test "x$ac_cv_prog_f90_uppercase_mod" = xyes])
|
||||
|
||||
AC_MSG_NOTICE([finding other utilities])
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_MSG_NOTICE([setting up libtool])
|
||||
|
||||
# Produce a windows DLL. This macro must be before AM_PROG_LIBTOOL.
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
|
||||
# Use libtool.
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
AC_MSG_NOTICE([checking for large file support])
|
||||
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
AC_MSG_NOTICE([checking types, headers, and functions])
|
||||
|
||||
AC_CHECK_HEADER(stdlib.h, ,AC_DEFINE([NO_STDLIB_H], [], [no stdlib.h]))
|
||||
AC_CHECK_HEADER(sys/types.h, ,AC_DEFINE([NO_SYS_TYPES_H], [], [no sys_types.h]))
|
||||
AC_CHECK_HEADER([unistd.h])
|
||||
AC_CHECK_FUNC(strerror, ,AC_DEFINE([NO_STRERROR], [], [no strerror.h]))
|
||||
AC_CHECK_FUNC(strlcat,AC_DEFINE([HAVE_STRLCAT],1,[Define this if you have strlcat()]))
|
||||
AC_FUNC_ALLOCA
|
||||
AC_STRUCT_ST_BLKSIZE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_CHECK_TYPES([ssize_t, ptrdiff_t, uchar])
|
||||
AC_C_CHAR_UNSIGNED
|
||||
AC_C_BIGENDIAN
|
||||
AC_CHECK_SIZEOF(short)
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(float)
|
||||
AC_CHECK_SIZEOF(double)
|
||||
AC_CHECK_SIZEOF(off_t)
|
||||
AC_CHECK_SIZEOF(size_t)
|
||||
|
||||
AC_SEARCH_LIBS([floor], [m])
|
||||
|
||||
AC_MSG_NOTICE([generating header files and makefiles])
|
||||
|
||||
##################################################
|
||||
# Include dispatch stuff from netcdf/configure.ac
|
||||
AC_MSG_CHECKING([if API dispatch is enabled])
|
||||
AC_ARG_ENABLE([dispatch],
|
||||
[AS_HELP_STRING([--enable-dispatch],
|
||||
[enable experimental dispatch support])])
|
||||
test "x$enable_dispatch" = xno || enable_dispatch=yes
|
||||
AC_MSG_RESULT($enable_dispatch)
|
||||
if test "x$enable_dispatch" = xyes ; then
|
||||
AC_DEFINE([USE_DISPATCH], [1], [if true, include experimental API dispatch code])
|
||||
fi
|
||||
AM_CONDITIONAL(USE_DISPATCH, [test x$enable_dispatch = xyes])
|
||||
|
||||
# The following flags are defined
|
||||
# Define the -L flags and libs for external libraries
|
||||
EXTERN_LDFLAGS=""
|
||||
# Define the -I flags for external libraries
|
||||
EXTERN_CFLAGS=""
|
||||
|
||||
# Add all libraries even if shared is enabled
|
||||
if test "x$enable_netcdf_4" = xyes ; then
|
||||
if test "x$HDF5DIR" != x ; then
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -L$HDF5DIR/lib"
|
||||
EXTERN_CFLAGS="${EXTERN_CFLAGS} -I$HDF5DIR/include"
|
||||
fi
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -lhdf5_hl -lhdf5"
|
||||
if test "x$enable_hdf4" = xyes; then
|
||||
if test "x$HDF4DIR" != x ; then
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -L$HDF4DIR/lib"
|
||||
EXTERN_CFLAGS="${EXTERN_CFLAGS} -I$HDF4DIR/include"
|
||||
fi
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -lmfhdf -ldf"
|
||||
fi
|
||||
fi # netcdf-4
|
||||
# Do zlib and szlib no matter-what
|
||||
if test "x$ZLIBDIR" != x ; then
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -L$ZLIBDIR/lib"
|
||||
EXTERN_CFLAGS="${EXTERN_CFLAGS} -I$ZLIBDIR/include"
|
||||
fi
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -lz"
|
||||
if test "x$SZLIBDIR" != x ; then
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -L$SZLIBDIR/lib -lsz"
|
||||
EXTERN_CFLAGS="${EXTERN_CFLAGS} -I$SZLIBDIR/include"
|
||||
fi
|
||||
|
||||
if test "x$enable_dap" = xyes ; then
|
||||
if test "x$curl_libs" != x ; then
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} $curl_libs"
|
||||
EXTERN_CFLAGS="${EXTERN_CFLAGS} $curl_cflags"
|
||||
fi
|
||||
# If we are building with dap support check to see if we need to add
|
||||
# external oc library
|
||||
if test "x$with_oclib" != x ; then
|
||||
EXTERN_LDFLAGS="${EXTERN_LDFLAGS} -L$OCLIBDIR/lib -loc"
|
||||
EXTERN_CFLAGS="${EXTERN_CFLAGS} -I$OCLIBDIR/include"
|
||||
fi
|
||||
fi
|
||||
|
||||
# If we are running on Solaris, then we need to add -R flags as well
|
||||
|
||||
case "x$target_os" in
|
||||
xsolaris*)
|
||||
NEWLDFLAGS=""
|
||||
for x in $EXTERN_LDFLAGS ; do
|
||||
case "$x" in
|
||||
-L*) r=`echo "$x" | sed -e 's|^-L|-R|'`
|
||||
NEWLDFLAGS="$NEWLDFLAGS $x $r"
|
||||
;;
|
||||
*) NEWLDFLAGS="$NEWLDFLAGS $x" ;;
|
||||
esac
|
||||
done
|
||||
EXTERN_LDFLAGS="$NEWLDFLAGS"
|
||||
;;
|
||||
*);;
|
||||
esac
|
||||
AC_SUBST(EXTERN_CFLAGS,[$EXTERN_CFLAGS])
|
||||
AC_SUBST(EXTERN_LDFLAGS,[$EXTERN_LDFLAGS])
|
||||
AC_SUBST(EXTERN_CPPFLAGS,[$EXTERN_CFLAGS])
|
||||
|
||||
##################################################
|
||||
|
||||
|
||||
|
||||
AC_CONFIG_FILES([gridspec/tools/make_hgrid/run_tests],
|
||||
[chmod +x gridspec/tools/make_hgrid/run_tests])
|
||||
AC_CONFIG_FILES([gridspec/tools/make_vgrid/run_tests],
|
||||
[chmod +x gridspec/tools/make_vgrid/run_tests])
|
||||
AC_CONFIG_FILES([gridspec/tools/make_topog/run_tests],
|
||||
[chmod +x gridspec/tools/make_topog/run_tests])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
doc/Makefile
|
||||
cfcheck/Makefile
|
||||
src/Makefile
|
||||
gridspec/Makefile
|
||||
gridspec/shared/Makefile
|
||||
gridspec/shared/mosaic/Makefile
|
||||
gridspec/tools/Makefile
|
||||
gridspec/tools/shared/Makefile
|
||||
gridspec/tools/make_hgrid/Makefile
|
||||
gridspec/tools/make_solo_mosaic/Makefile
|
||||
gridspec/tools/make_coupler_mosaic/Makefile
|
||||
gridspec/tools/fregrid/Makefile
|
||||
gridspec/tools/make_topog/Makefile
|
||||
gridspec/tools/make_vgrid/Makefile
|
||||
gridspec/tools/river_regrid/Makefile
|
||||
gridspec/tools/transfer_to_mosaic_grid/Makefile])
|
||||
|
||||
AC_OUTPUT()
|
||||
|
4
libcf/doc/CVS/Entries
Normal file
4
libcf/doc/CVS/Entries
Normal file
@ -0,0 +1,4 @@
|
||||
/Makefile.am/1.2/Thu Nov 19 14:45:54 2009//
|
||||
/defines.texi/1.1.1.1/Mon Jul 6 15:06:30 2009//
|
||||
/libcf.texi/1.1.1.1/Mon Jul 6 15:06:30 2009//
|
||||
D
|
1
libcf/doc/CVS/Repository
Normal file
1
libcf/doc/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
netcdf-3/libcf/doc
|
1
libcf/doc/CVS/Root
Normal file
1
libcf/doc/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
/upc/share/CVS
|
43
libcf/doc/Makefile.am
Normal file
43
libcf/doc/Makefile.am
Normal file
@ -0,0 +1,43 @@
|
||||
## This is a automake file, part of Unidata's NetCDF CF Library package.
|
||||
# Copyright 2006, see the COPYRIGHT file for more information.
|
||||
|
||||
# This is the automake file for the NetCDF CF Library documentation.
|
||||
|
||||
# $Id: Makefile.am,v 1.2 2009/11/19 14:45:54 ed Exp $
|
||||
|
||||
info_TEXINFOS = libcf.texi
|
||||
|
||||
# Get texi2dvi to shut the hell up!
|
||||
TEXI2DVI = texi2dvi -s
|
||||
|
||||
# Get lists of the coresponding ps, info, and pdf files.
|
||||
html_docs = ${info_TEXINFOS:.texi=.html}
|
||||
ps_docs = ${info_TEXINFOS:.texi=.ps}
|
||||
pdf_docs = ${info_TEXINFOS:.texi=.pdf}
|
||||
info_docs= ${info_TEXINFOS:.texi=.info}
|
||||
|
||||
EXTRA_DIST = defines.texi
|
||||
|
||||
# Distributes the ps, info, and pdf files with the distribution.
|
||||
dist_pkgdata_DATA = $(ps_docs) $(info_docs) $(pdf_docs)
|
||||
|
||||
# Automake seems to be broken with respect to generating html
|
||||
# output. Also it steals the *.html targets, no matter what I do. So
|
||||
# this cheesy phoney target does the html builds.
|
||||
libcf_html:
|
||||
$(MAKEINFO) --html $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I$(srcdir) libcf.texi
|
||||
$(MAKEINFO) --no-split --html $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I$(srcdir) libcf.texi
|
||||
|
||||
# This isn't made by all, but tars up everything needed for the website
|
||||
web-tarball: all libcf_html
|
||||
tar cf libcf_info.tar *.info*
|
||||
gzip -f libcf_info.tar
|
||||
zip libcf_info *.info &> /dev/null
|
||||
tar cf libcf_pdf.tar *.pdf
|
||||
gzip -f libcf_pdf.tar
|
||||
zip libcf_pdf *.pdf &> /dev/null
|
||||
tar cf libcf_html.tar libcf libcf.html
|
||||
gzip -f libcf_html.tar
|
||||
zip libcf_html *.pdf &> /dev/null
|
||||
tar cf libcf_docs.tar $(nmans) *.pdf *.html *.tar.gz *.zip libcf
|
||||
gzip -f libcf_docs.tar
|
61
libcf/doc/defines.texi
Normal file
61
libcf/doc/defines.texi
Normal file
@ -0,0 +1,61 @@
|
||||
@c This is part of the libcf documentation. See COPYRIGHT file
|
||||
@c for terms of use.
|
||||
|
||||
@c This file is included by the texi file, and contains
|
||||
@c common definitions.
|
||||
|
||||
@c $Id: defines.texi,v 1.1.1.1 2009/07/06 15:06:30 ed Exp $
|
||||
|
||||
@set libcf-man The NetCDF CF Library Users Guide and Reference
|
||||
|
||||
@set libcf-support-email support-libcf@@unidata.ucar.edu
|
||||
|
||||
@c URLs for CF stuff.
|
||||
@set cf-url http://www.cgd.ucar.edu/cms/eaton/cf-metadata/CF-1.0.html
|
||||
|
||||
@c home pages for netcdf, netcdf-4, netcdf java, hdf5, Unidata
|
||||
@set hdf5-url http://hdf.ncsa.uiuc.edu/HDF5
|
||||
@set unidata-url http://www.unidata.ucar.edu
|
||||
@set netcdf-url @value{unidata-url}/software/netcdf
|
||||
@set netcdf-4-url @value{netcdf-url}/netcdf-4
|
||||
@set netcdf-java-url @value{unidata-url}/software/netcdf-java
|
||||
@set ucar-url http://www.ucar.edu
|
||||
@set udunits-url http://www.unidata.ucar.edu/software/udunits/
|
||||
|
||||
@c urls for netcdf documents
|
||||
@set docs-url @value{netcdf-url}/docs
|
||||
|
||||
@c urls to search on-line stuff
|
||||
@set libcf-support-search-url @value{unidata-url}/mailsearchform.php?archive=libcf&archivename=LibCF
|
||||
@set libcf-list-search-url @value{unidata-url}/mailsearchform.php?archive=libcfgroup-list&archivename=LibCF_Group
|
||||
|
||||
@c places to get downloads
|
||||
@set ftp-site ftp://ftp.unidata.ucar.edu/pub/libcf
|
||||
|
||||
@setchapternewpage odd
|
||||
@finalout
|
||||
@copying
|
||||
Copyright @copyright{} 2006 University Corporation for
|
||||
Atmospheric Research
|
||||
|
||||
@sp 2
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
manual provided that the copyright notice and these paragraphs are
|
||||
preserved on all copies. The software and any accompanying written
|
||||
materials are provided ``as is'' without warranty of any kind. UCAR
|
||||
expressly disclaims all warranties of any kind, either expressed or
|
||||
implied, including but not limited to the implied warranties of
|
||||
merchantability and fitness for a particular purpose.
|
||||
|
||||
The Unidata Program Center is managed by the University
|
||||
Corporation for Atmospheric Research and sponsored by the National
|
||||
Science Foundation. Any opinions, findings, conclusions, or
|
||||
recommendations expressed in this publication are those of the
|
||||
author(s) and do not necessarily reflect the views of the National
|
||||
Science Foundation.
|
||||
|
||||
Mention of any commercial company or product in this document
|
||||
does not constitute an endorsement by the Unidata Program Center.
|
||||
Unidata does not authorize any use of information from this
|
||||
publication for advertising or publicity purposes.
|
||||
@end copying
|
2546
libcf/doc/libcf.texi
Normal file
2546
libcf/doc/libcf.texi
Normal file
File diff suppressed because it is too large
Load Diff
3
libcf/gridspec/CVS/Entries
Normal file
3
libcf/gridspec/CVS/Entries
Normal file
@ -0,0 +1,3 @@
|
||||
/Makefile.am/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
D/shared////
|
||||
D/tools////
|
1
libcf/gridspec/CVS/Repository
Normal file
1
libcf/gridspec/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
netcdf-3/libcf/gridspec
|
1
libcf/gridspec/CVS/Root
Normal file
1
libcf/gridspec/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
/upc/share/CVS
|
1
libcf/gridspec/Makefile.am
Normal file
1
libcf/gridspec/Makefile.am
Normal file
@ -0,0 +1 @@
|
||||
SUBDIRS = shared tools
|
2
libcf/gridspec/shared/CVS/Entries
Normal file
2
libcf/gridspec/shared/CVS/Entries
Normal file
@ -0,0 +1,2 @@
|
||||
/Makefile.am/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
D/mosaic////
|
1
libcf/gridspec/shared/CVS/Repository
Normal file
1
libcf/gridspec/shared/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
netcdf-3/libcf/gridspec/shared
|
1
libcf/gridspec/shared/CVS/Root
Normal file
1
libcf/gridspec/shared/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
/upc/share/CVS
|
1
libcf/gridspec/shared/Makefile.am
Normal file
1
libcf/gridspec/shared/Makefile.am
Normal file
@ -0,0 +1 @@
|
||||
SUBDIRS = mosaic
|
13
libcf/gridspec/shared/mosaic/CVS/Entries
Normal file
13
libcf/gridspec/shared/mosaic/CVS/Entries
Normal file
@ -0,0 +1,13 @@
|
||||
/Makefile.am/1.5/Sat May 29 01:46:31 2010//
|
||||
/constant.h/1.2/Tue Aug 25 19:55:20 2009//
|
||||
/create_xgrid.c/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/create_xgrid.h/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/gradient_c2l.c/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/gradient_c2l.h/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/interp.c/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/interp.h/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/mosaic_util.c/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/mosaic_util.h/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
/read_mosaic.c/1.2/Tue Aug 25 19:55:20 2009//
|
||||
/read_mosaic.h/1.1.1.1/Tue Jul 7 13:57:38 2009//
|
||||
D
|
1
libcf/gridspec/shared/mosaic/CVS/Repository
Normal file
1
libcf/gridspec/shared/mosaic/CVS/Repository
Normal file
@ -0,0 +1 @@
|
||||
netcdf-3/libcf/gridspec/shared/mosaic
|
1
libcf/gridspec/shared/mosaic/CVS/Root
Normal file
1
libcf/gridspec/shared/mosaic/CVS/Root
Normal file
@ -0,0 +1 @@
|
||||
/upc/share/CVS
|
29
libcf/gridspec/shared/mosaic/Makefile.am
Normal file
29
libcf/gridspec/shared/mosaic/Makefile.am
Normal file
@ -0,0 +1,29 @@
|
||||
## This is an automake file, part of Unidata's NetCDF CF Library
|
||||
## package. Copyright 2009, see the COPYRIGHT file for more
|
||||
## information.
|
||||
|
||||
# This automake file is in charge of building the gridspec
|
||||
# tools/shared convenience library.
|
||||
|
||||
# $Id: Makefile.am,v 1.5 2010/05/29 01:46:31 dmh Exp $
|
||||
|
||||
noinst_LTLIBRARIES = libshared.la
|
||||
libshared_la_SOURCES = constant.h create_xgrid.c create_xgrid.h \
|
||||
gradient_c2l.c gradient_c2l.h interp.c interp.h mosaic_util.c \
|
||||
mosaic_util.h read_mosaic.c read_mosaic.h
|
||||
|
||||
AM_CPPFLAGS =
|
||||
AM_LDFLAGS =
|
||||
LDADD =
|
||||
|
||||
AM_CPPFLAGS += -I${top_srcdir}/src
|
||||
|
||||
AM_CPPFLAGS += ${top_srcdir}../liblib
|
||||
AM_LDFLAGS += ${top_builddir}../liblib/libnetcdf.la
|
||||
|
||||
AM_LDFLAGS += @EXTERN_LDFLAGS@ -lm
|
||||
|
||||
|
||||
|
||||
|
||||
|
38
libcf/gridspec/shared/mosaic/constant.h
Normal file
38
libcf/gridspec/shared/mosaic/constant.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef CONSTANT_H_
|
||||
#define CONSTANT_H_
|
||||
#define RADIUS (6371000.)
|
||||
#define STRING 255
|
||||
#define STRING_NAME "string"
|
||||
#define MOSAIC_NAME "mosaic"
|
||||
#define NTILES_NAME "ntiles"
|
||||
#define NMOSAIC_NAME "nmosaic"
|
||||
#define NCONTACT_NAME "ncontact"
|
||||
#define TILE_FILES_NAME "tile_files"
|
||||
#define MOSAIC_FILES_NAME "mosaic_files"
|
||||
#define CONTACT_FILES_NAME "contact_files"
|
||||
#define OVERLAP_FILES_NAME "overlap_files"
|
||||
#define TILE_NAME "tile"
|
||||
#define NX_NAME "nx"
|
||||
#define NY_NAME "ny"
|
||||
#define NXP_NAME "nxp"
|
||||
#define NYP_NAME "nyp"
|
||||
#define X_NAME "x"
|
||||
#define Y_NAME "y"
|
||||
#define DX_NAME "dx"
|
||||
#define DY_NAME "dy"
|
||||
#define ANGLE_DX_NAME "angle_dx"
|
||||
#define ANGLE_DY_NAME "angle_dy"
|
||||
#define ARCX_NAME "arcx"
|
||||
#define DEPTH_NAME "depth"
|
||||
#define MASK_NAME "area_frac"
|
||||
#define NZV_NAME "nzv"
|
||||
#define ZETA_NAME "zeta"
|
||||
#define GRID_VERSION_NAME "grid_version"
|
||||
#define CODE_VERSION_NAME "code_version"
|
||||
#define HISTORY_NAME "history"
|
||||
#define CONFORMAL_NAME "isConformal"
|
||||
#define REGULAR_NAME "isRegular"
|
||||
#define DISCRETIZATION_NAME "discretizationType"
|
||||
#define GEOMETRY_NAME "geometryType"
|
||||
#define CONGRUCENCE_NAME "congruentTiles"
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user