Index: codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.h
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.h	(revision 308)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.h	(revision 308)
@@ -0,0 +1,1943 @@
+/*! \file
+
+Main header file for the C API.
+
+Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 University
+Corporation for Atmospheric Research/Unidata. See \ref copyright file
+for more info.
+*/
+
+#ifndef _NETCDF_
+#define _NETCDF_
+
+#include <stddef.h> /* size_t, ptrdiff_t */
+#include <errno.h>  /* netcdf functions sometimes return system errors */
+
+/* Required for alloca on Windows */ 
+#if defined(_WIN32) || defined(_WIN64)
+#include <malloc.h>
+#endif
+
+#ifdef _WIN64
+#include <sys/stat.h>
+#endif
+
+/*! The nc_type type is just an int. */
+typedef int nc_type;
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/*
+ *  The netcdf external data types
+ */
+#define	NC_NAT 	        0	/**< Not A Type */
+#define	NC_BYTE         1	/**< signed 1 byte integer */
+#define	NC_CHAR 	2	/**< ISO/ASCII character */
+#define	NC_SHORT 	3	/**< signed 2 byte integer */
+#define	NC_INT 	        4	/**< signed 4 byte integer */
+#define NC_LONG         NC_INT  /**< deprecated, but required for backward compatibility. */
+#define	NC_FLOAT 	5	/**< single precision floating point number */
+#define	NC_DOUBLE 	6	/**< double precision floating point number */
+#define	NC_UBYTE 	7	/**< unsigned 1 byte int */
+#define	NC_USHORT 	8	/**< unsigned 2-byte int */
+#define	NC_UINT 	9	/**< unsigned 4-byte int */
+#define	NC_INT64 	10	/**< signed 8-byte int */
+#define	NC_UINT64 	11	/**< unsigned 8-byte int */
+#define	NC_STRING 	12	/**< string */
+
+#define NC_MAX_ATOMIC_TYPE NC_STRING
+
+/* The following are use internally in support of user-defines
+ * types. They are also the class returned by nc_inq_user_type. */
+#define	NC_VLEN 	13	/**< vlen (variable-length) types */
+#define	NC_OPAQUE 	14	/**< opaque types */
+#define	NC_ENUM 	15	/**< enum types */
+#define	NC_COMPOUND 	16	/**< compound types */
+
+/* Define the first user defined type id (leave some room) */
+#define NC_FIRSTUSERTYPEID 32
+
+/** Default fill value. This is used unless _FillValue attribute
+ * is set.  These values are stuffed into newly allocated space as
+ * appropriate.  The hope is that one might use these to notice that a
+ * particular datum has not been set. */
+/**@{*/
+#define NC_FILL_BYTE	((signed char)-127)
+#define NC_FILL_CHAR	((char)0)
+#define NC_FILL_SHORT	((short)-32767)
+#define NC_FILL_INT	(-2147483647L)
+#define NC_FILL_FLOAT	(9.9692099683868690e+36f) /* near 15 * 2^119 */
+#define NC_FILL_DOUBLE	(9.9692099683868690e+36)
+#define NC_FILL_UBYTE   (255)
+#define NC_FILL_USHORT  (65535)
+#define NC_FILL_UINT    (4294967295U)
+#define NC_FILL_INT64   ((long long)-9223372036854775806LL)
+#define NC_FILL_UINT64  ((unsigned long long)18446744073709551614ULL)
+#define NC_FILL_STRING  ""
+/**@}*/
+
+/*! Max or min values for a type. Nothing greater/smaller can be
+ * stored in a netCDF file for their associated types. Recall that a C
+ * compiler may define int to be any length it wants, but a NC_INT is
+ * *always* a 4 byte signed int. On a platform with 64 bit ints,
+ * there will be many ints which are outside the range supported by
+ * NC_INT. But since NC_INT is an external format, it has to mean the
+ * same thing everywhere. */
+/**@{*/
+#define NC_MAX_BYTE 127
+#define NC_MIN_BYTE (-NC_MAX_BYTE-1)
+#define NC_MAX_CHAR 255
+#define NC_MAX_SHORT 32767
+#define NC_MIN_SHORT (-NC_MAX_SHORT - 1)
+#define NC_MAX_INT 2147483647
+#define NC_MIN_INT (-NC_MAX_INT - 1)
+#define NC_MAX_FLOAT 3.402823466e+38f
+#define NC_MIN_FLOAT (-NC_MAX_FLOAT)
+#define NC_MAX_DOUBLE 1.7976931348623157e+308 
+#define NC_MIN_DOUBLE (-NC_MAX_DOUBLE)
+#define NC_MAX_UBYTE NC_MAX_CHAR
+#define NC_MAX_USHORT 65535U
+#define NC_MAX_UINT 4294967295U
+#define NC_MAX_INT64 (9223372036854775807LL)
+#define NC_MIN_INT64 (-9223372036854775807LL-1)
+#define NC_MAX_UINT64 (18446744073709551615ULL)
+#define X_INT64_MAX     (9223372036854775807LL)
+#define X_INT64_MIN     (-X_INT64_MAX - 1)
+#define X_UINT64_MAX    (18446744073709551615ULL)
+/**@}*/
+
+/** Name of fill value attribute.  If you wish a variable to use a
+ * different value than the above defaults, create an attribute with
+ * the same type as the variable and this reserved name. The value you
+ * give the attribute will be used as the fill value for that
+ * variable. */
+#define _FillValue	"_FillValue"
+#define NC_FILL		0	/**< Argument to nc_set_fill() to clear NC_NOFILL */
+#define NC_NOFILL	0x100	/**< Argument to nc_set_fill() to turn off filling of data. */
+
+/* Define the ioflags bits for nc_create and nc_open.
+   currently unused: 0x0010,0x0020,0x0040,0x0080
+   and the whole upper 16 bits
+*/
+
+#define NC_NOWRITE	 0x0000	/**< Set read-only access for nc_open(). */
+#define NC_WRITE    	 0x0001	/**< Set read-write access for nc_open(). */
+/* unused: 0x0002 */
+#define NC_CLOBBER	 0x0000 /**< Destroy existing file. Mode flag for nc_create(). */
+#define NC_NOCLOBBER     0x0004	/**< Don't destroy existing file. Mode flag for nc_create(). */
+
+#define NC_DISKLESS      0x0008  /**< Use diskless file. Mode flag for nc_open() or nc_create(). */
+#define NC_MMAP          0x0010  /**< Use diskless file with mmap. Mode flag for nc_open() or nc_create(). */
+
+#define NC_CLASSIC_MODEL 0x0100 /**< Enforce classic model. Mode flag for nc_create(). */
+#define NC_64BIT_OFFSET  0x0200  /**< Use large (64-bit) file offsets. Mode flag for nc_create(). */
+
+/** \deprecated The following flag currently is ignored, but use in
+ * nc_open() or nc_create() may someday support use of advisory
+ * locking to prevent multiple writers from clobbering a file
+ */
+#define NC_LOCK          0x0400	
+
+/** Share updates, limit cacheing.
+Use this in mode flags for both nc_create() and nc_open(). */
+#define NC_SHARE         0x0800	
+
+#define NC_NETCDF4       0x1000  /**< Use netCDF-4/HDF5 format. Mode flag for nc_create(). */
+
+/** Turn on MPI I/O.
+Use this in mode flags for both nc_create() and nc_open(). */
+#define NC_MPIIO         0x2000 
+/** Turn on MPI POSIX I/O.
+Use this in mode flags for both nc_create() and nc_open(). */
+#define NC_MPIPOSIX      0x4000
+#define NC_PNETCDF       0x8000	/**< Use parallel-netcdf library. Mode flag for nc_open(). */
+
+/** Format specifier for nc_set_default_format() and returned
+ *  by nc_inq_format. This returns the format as provided by
+ *  the API. See nc_inq_format_extended to see the true file format.
+ *  Starting with version 3.6, there are different format netCDF files.
+ *  4.0 introduces the third one. \see netcdf_format
+ */
+/**@{*/
+#define NC_FORMAT_CLASSIC (1)
+#define NC_FORMAT_64BIT   (2)
+#define NC_FORMAT_NETCDF4 (3)
+#define NC_FORMAT_NETCDF4_CLASSIC  (4)
+
+/**@}*/
+
+/** Extended format specifier returned by  nc_inq_format_extended() 
+ *  Added in version 4.3.1. This returns the true format of the
+ *  underlying data.
+ * The function returns two values
+ * 1. a small integer indicating the underlying source type
+ *    of the data. Note that this may differ from what the user
+ *    sees from nc_inq_format() because this latter function
+ *    returns what the user can expect to see thru the API.
+ * 2. A mode value indicating what mode flags are effectively
+ *    set for this dataset. This usually will be a superset
+ *    of the mode flags used as the argument to nc_open
+ *    or nc_create.
+ * More or less, the #1 values track the set of dispatch tables.
+ * The #1 values are as follows.
+ */
+/**@{*/
+#define NC_FORMAT_NC3     (1)
+#define NC_FORMAT_NC_HDF5 (2) /*cdf 4 subset of HDF5 */
+#define NC_FORMAT_NC_HDF4 (3) /* netcdf 4 subset of HDF4 */
+#define NC_FORMAT_PNETCDF (4)
+#define NC_FORMAT_DAP2    (5)
+#define NC_FORMAT_DAP4    (6)
+#define NC_FORMAT_UNDEFINED (0)
+/**@}*/
+
+/** Let nc__create() or nc__open() figure out a suitable buffer size. */
+#define NC_SIZEHINT_DEFAULT 0
+
+/** In nc__enddef(), align to the buffer size. */
+#define NC_ALIGN_CHUNK ((size_t)(-1))
+
+/** Size argument to nc_def_dim() for an unlimited dimension. */
+#define NC_UNLIMITED 0L
+
+/** Attribute id to put/get a global attribute. */
+#define NC_GLOBAL -1
+
+/** 
+Maximum for classic library.
+
+In the classic netCDF model there are maximum values for the number of
+dimensions in the file (\ref NC_MAX_DIMS), the number of global or per
+variable attributes (\ref NC_MAX_ATTRS), the number of variables in
+the file (\ref NC_MAX_VARS), and the length of a name (\ref
+NC_MAX_NAME).
+
+These maximums are enforced by the interface, to facilitate writing
+applications and utilities.  However, nothing is statically allocated
+to these sizes internally.
+
+These maximums are not used for netCDF-4/HDF5 files unless they were
+created with the ::NC_CLASSIC_MODEL flag.
+
+As a rule, NC_MAX_VAR_DIMS <= NC_MAX_DIMS.
+*/
+/**@{*/
+#define NC_MAX_DIMS	1024	
+#define NC_MAX_ATTRS	8192	
+#define NC_MAX_VARS	8192	
+#define NC_MAX_NAME	256	
+#define NC_MAX_VAR_DIMS	1024 /**< max per variable dimensions */
+/**@}*/
+
+/** This is the max size of an SD dataset name in HDF4 (from HDF4 documentation).*/
+#define NC_MAX_HDF4_NAME 64 
+
+/** In HDF5 files you can set the endianness of variables with
+    nc_def_var_endian(). This define is used there. */   
+/**@{*/
+#define NC_ENDIAN_NATIVE 0
+#define NC_ENDIAN_LITTLE 1
+#define NC_ENDIAN_BIG    2
+/**@}*/
+
+/** In HDF5 files you can set storage for each variable to be either
+ * contiguous or chunked, with nc_def_var_chunking().  This define is
+ * used there. */
+/**@{*/
+#define NC_CHUNKED    0
+#define NC_CONTIGUOUS 1
+/**@}*/
+
+/** In HDF5 files you can set check-summing for each variable.
+Currently the only checksum available is Fletcher-32, which can be set
+with the function nc_def_var_fletcher32.  These defines are used
+there. */
+/**@{*/
+#define NC_NOCHECKSUM 0
+#define NC_FLETCHER32 1
+/**@}*/
+
+/**@{*/
+/** Control the HDF5 shuffle filter. In HDF5 files you can specify
+ * that a shuffle filter should be used on each chunk of a variable to
+ * improve compression for that variable. This per-variable shuffle
+ * property can be set with the function nc_def_var_deflate(). */
+#define NC_NOSHUFFLE 0
+#define NC_SHUFFLE   1
+/**@}*/
+
+/** The netcdf version 3 functions all return integer error status.
+ * These are the possible values, in addition to certain values from
+ * the system errno.h.
+ */
+#define NC_ISSYSERR(err)	((err) > 0)
+
+#define	NC_NOERR	0   /**< No Error */
+#define NC2_ERR         (-1)       /**< Returned for all errors in the v2 API. */
+
+/** Not a netcdf id.
+
+The specified netCDF ID does not refer to an
+open netCDF dataset. */
+#define	NC_EBADID	(-33)	   
+#define	NC_ENFILE	(-34)	   /**< Too many netcdfs open */
+#define	NC_EEXIST	(-35)	   /**< netcdf file exists && NC_NOCLOBBER */
+#define	NC_EINVAL	(-36)	   /**< Invalid Argument */
+#define	NC_EPERM	(-37)	   /**< Write to read only */
+
+/** Operation not allowed in data mode. This is returned for netCDF
+classic or 64-bit offset files, or for netCDF-4 files, when they were
+been created with ::NC_CLASSIC_MODEL flag in nc_create(). */
+#define NC_ENOTINDEFINE	(-38)	   
+
+/** Operation not allowed in define mode.
+
+The specified netCDF is in define mode rather than data mode. 
+
+With netCDF-4/HDF5 files, this error will not occur, unless
+::NC_CLASSIC_MODEL was used in nc_create().
+ */
+#define	NC_EINDEFINE	(-39)	   
+
+/** Index exceeds dimension bound.
+
+The specified corner indices were out of range for the rank of the
+specified variable. For example, a negative index or an index that is
+larger than the corresponding dimension length will cause an error. */
+#define	NC_EINVALCOORDS	(-40)	   
+#define	NC_EMAXDIMS	(-41)	   /**< NC_MAX_DIMS exceeded */
+#define	NC_ENAMEINUSE	(-42)	   /**< String match to name in use */
+#define NC_ENOTATT	(-43)	   /**< Attribute not found */
+#define	NC_EMAXATTS	(-44)	   /**< NC_MAX_ATTRS exceeded */
+#define NC_EBADTYPE	(-45)	   /**< Not a netcdf data type */
+#define NC_EBADDIM	(-46)	   /**< Invalid dimension id or name */
+#define NC_EUNLIMPOS	(-47)	   /**< NC_UNLIMITED in the wrong index */
+
+/** NC_MAX_VARS exceeded. Max number of variables exceeded in a
+classic or 64-bit offset file, or an netCDF-4 file with
+::NC_CLASSIC_MODEL on. */
+#define	NC_EMAXVARS	(-48)	   
+
+/** Variable not found.
+
+The variable ID is invalid for the specified netCDF dataset. */
+#define NC_ENOTVAR	(-49)	   
+#define NC_EGLOBAL	(-50)	   /**< Action prohibited on NC_GLOBAL varid */
+#define NC_ENOTNC	(-51)	   /**< Not a netcdf file */
+#define NC_ESTS        	(-52)	   /**< In Fortran, string too short */
+#define NC_EMAXNAME    	(-53)	   /**< NC_MAX_NAME exceeded */
+#define NC_EUNLIMIT    	(-54)	   /**< NC_UNLIMITED size already in use */
+#define NC_ENORECVARS  	(-55)	   /**< nc_rec op when there are no record vars */
+#define NC_ECHAR	(-56)	   /**< Attempt to convert between text & numbers */
+
+/** Start+count exceeds dimension bound.
+
+The specified edge lengths added to the specified corner would have
+referenced data out of range for the rank of the specified
+variable. For example, an edge length that is larger than the
+corresponding dimension length minus the corner index will cause an
+error. */
+#define NC_EEDGE	(-57)	   
+#define NC_ESTRIDE	(-58)	   /**< Illegal stride */
+#define NC_EBADNAME	(-59)	   /**< Attribute or variable name contains illegal characters */
+/* N.B. following must match value in ncx.h */
+
+/** Math result not representable.
+
+One or more of the values are out of the range of values representable
+by the desired type. */
+#define NC_ERANGE	(-60)	   
+#define NC_ENOMEM	(-61)	   /**< Memory allocation (malloc) failure */
+#define NC_EVARSIZE     (-62)      /**< One or more variable sizes violate format constraints */ 
+#define NC_EDIMSIZE     (-63)      /**< Invalid dimension size */
+#define NC_ETRUNC       (-64)      /**< File likely truncated or possibly corrupted */
+#define NC_EAXISTYPE    (-65)      /**< Unknown axis type. */
+
+/* Following errors are added for DAP */
+#define NC_EDAP         (-66)      /**< Generic DAP error */
+#define NC_ECURL        (-67)      /**< Generic libcurl error */
+#define NC_EIO          (-68)      /**< Generic IO error */
+#define NC_ENODATA      (-69)      /**< Attempt to access variable with no data */
+#define NC_EDAPSVC      (-70)      /**< DAP server error */
+#define NC_EDAS		(-71)      /**< Malformed or inaccessible DAS */
+#define NC_EDDS		(-72)      /**< Malformed or inaccessible DDS */
+#define NC_EDATADDS	(-73)      /**< Malformed or inaccessible DATADDS */
+#define NC_EDAPURL	(-74)      /**< Malformed DAP URL */
+#define NC_EDAPCONSTRAINT (-75)    /**< Malformed DAP Constraint*/
+#define NC_ETRANSLATION (-76)      /**< Untranslatable construct */
+#define NC_EACCESS      (-77)      /**< Access Failure */
+#define NC_EAUTH        (-78)      /**< Authorization Failure */
+
+/* Misc. additional errors */
+#define NC_ENOTFOUND     (-90)      /**< No such file */
+#define NC_ECANTREMOVE   (-91)      /**< Can't remove file */
+
+/* The following was added in support of netcdf-4. Make all netcdf-4
+   error codes < -100 so that errors can be added to netcdf-3 if
+   needed. */
+#define NC4_FIRST_ERROR  (-100)
+
+/** Error at HDF5 layer. */
+#define NC_EHDFERR       (-101)    
+#define NC_ECANTREAD     (-102)    /**< Can't read. */
+#define NC_ECANTWRITE    (-103)    /**< Can't write. */
+#define NC_ECANTCREATE   (-104)    /**< Can't create. */
+#define NC_EFILEMETA     (-105)    /**< Problem with file metadata. */
+#define NC_EDIMMETA      (-106)    /**< Problem with dimension metadata. */
+#define NC_EATTMETA      (-107)    /**< Problem with attribute metadata. */
+#define NC_EVARMETA      (-108)    /**< Problem with variable metadata. */
+#define NC_ENOCOMPOUND   (-109)    /**< Not a compound type. */
+#define NC_EATTEXISTS    (-110)    /**< Attribute already exists. */
+#define NC_ENOTNC4       (-111)    /**< Attempting netcdf-4 operation on netcdf-3 file. */  
+
+/** Attempting netcdf-4 operation on strict nc3 netcdf-4 file. */  
+#define NC_ESTRICTNC3    (-112)    
+#define NC_ENOTNC3       (-113)    /**< Attempting netcdf-3 operation on netcdf-4 file. */  
+#define NC_ENOPAR        (-114)    /**< Parallel operation on file opened for non-parallel access. */  
+#define NC_EPARINIT      (-115)    /**< Error initializing for parallel access. */  
+#define NC_EBADGRPID     (-116)    /**< Bad group ID. */  
+#define NC_EBADTYPID     (-117)    /**< Bad type ID. */  
+#define NC_ETYPDEFINED   (-118)    /**< Type has already been defined and may not be edited. */
+#define NC_EBADFIELD     (-119)    /**< Bad field ID. */  
+#define NC_EBADCLASS     (-120)    /**< Bad class. */  
+#define NC_EMAPTYPE      (-121)    /**< Mapped access for atomic types only. */  
+#define NC_ELATEFILL     (-122)    /**< Attempt to define fill value when data already exists. */
+#define NC_ELATEDEF      (-123)    /**< Attempt to define var properties, like deflate, after enddef. */
+#define NC_EDIMSCALE     (-124)    /**< Probem with HDF5 dimscales. */
+#define NC_ENOGRP        (-125)    /**< No group found. */
+#define NC_ESTORAGE      (-126)    /**< Can't specify both contiguous and chunking. */
+#define NC_EBADCHUNK     (-127)    /**< Bad chunksize. */
+#define NC_ENOTBUILT     (-128)    /**< Attempt to use feature that was not turned on when netCDF was built. */
+#define NC_EDISKLESS     (-129)    /**< Error in using diskless  access. */ 
+#define NC_ECANTEXTEND   (-130)    /**< Attempt to extend dataset during ind. I/O operation. */ 
+#define NC_EMPI          (-131)    /**< MPI operation failed. */ 
+
+#define NC4_LAST_ERROR   (-131) 
+
+/* This is used in netCDF-4 files for dimensions without coordinate
+ * vars. */
+#define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable."
+
+/* This is here at the request of the NCO team to support our
+ * mistake of having chunksizes be first ints, then size_t. Doh! */
+#define NC_HAVE_NEW_CHUNKING_API 1
+
+
+/*Errors for all remote access methods(e.g. DAP and CDMREMOTE)*/
+#define NC_EURL		(NC_EDAPURL)   /* Malformed URL */
+#define NC_ECONSTRAINT  (NC_EDAPCONSTRAINT)   /* Malformed Constraint*/
+
+
+/*
+ * The Interface
+ */
+
+/* Declaration modifiers for DLL support (MSC et al) */
+#if defined(DLL_NETCDF) /* define when library is a DLL */
+#  if defined(DLL_EXPORT) /* define when building the library */
+#   define MSC_EXTRA __declspec(dllexport)
+#  else
+#   define MSC_EXTRA __declspec(dllimport)
+#  endif
+#include <io.h>
+#else
+#define MSC_EXTRA
+#endif	/* defined(DLL_NETCDF) */
+
+# define EXTERNL MSC_EXTRA extern
+
+#if defined(DLL_NETCDF) /* define when library is a DLL */
+EXTERNL int ncerr;
+EXTERNL int ncopts;
+#endif
+
+EXTERNL const char *
+nc_inq_libvers(void);
+
+EXTERNL const char *
+nc_strerror(int ncerr);
+
+EXTERNL int
+nc__create(const char *path, int cmode, size_t initialsz,
+	 size_t *chunksizehintp, int *ncidp);
+
+EXTERNL int
+nc_create(const char *path, int cmode, int *ncidp);
+
+EXTERNL int
+nc__open(const char *path, int mode, 
+	size_t *chunksizehintp, int *ncidp);
+
+EXTERNL int
+nc_open(const char *path, int mode, int *ncidp);
+
+/* Learn the path used to open/create the file. */
+EXTERNL int
+nc_inq_path(int ncid, size_t *pathlen, char *path);
+
+/* Given an ncid and group name (NULL gets root group), return
+ * locid. */
+EXTERNL int
+nc_inq_ncid(int ncid, const char *name, int *grp_ncid);
+
+/* Given a location id, return the number of groups it contains, and
+ * an array of their locids. */
+EXTERNL int
+nc_inq_grps(int ncid, int *numgrps, int *ncids);
+
+/* Given locid, find name of group. (Root group is named "/".) */
+EXTERNL int
+nc_inq_grpname(int ncid, char *name);
+
+/* Given ncid, find full name and len of full name. (Root group is
+ * named "/", with length 1.) */
+EXTERNL int
+nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name);
+
+/* Given ncid, find len of full name. */
+EXTERNL int
+nc_inq_grpname_len(int ncid, size_t *lenp);
+
+/* Given an ncid, find the ncid of its parent group. */
+EXTERNL int
+nc_inq_grp_parent(int ncid, int *parent_ncid);
+
+/* Given a name and parent ncid, find group ncid. */
+EXTERNL int
+nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid);
+
+/* Given a full name and ncid, find group ncid. */
+EXTERNL int
+nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid);
+
+/* Get a list of ids for all the variables in a group. */
+EXTERNL int 
+nc_inq_varids(int ncid, int *nvars, int *varids);
+
+/* Find all dimids for a location. This finds all dimensions in a
+ * group, or any of its parents. */
+EXTERNL int 
+nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents);
+
+/* Find all user-defined types for a location. This finds all
+ * user-defined types in a group. */
+EXTERNL int 
+nc_inq_typeids(int ncid, int *ntypes, int *typeids);
+
+/* Are two types equal? */
+EXTERNL int
+nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2, 
+		  nc_type typeid2, int *equal);
+
+/* Create a group. its ncid is returned in the new_ncid pointer. */
+EXTERNL int
+nc_def_grp(int parent_ncid, const char *name, int *new_ncid);
+
+/* Rename a group */
+EXTERNL int
+nc_rename_grp(int grpid, const char *name);
+
+/* Here are functions for dealing with compound types. */
+
+/* Create a compound type. */
+EXTERNL int
+nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp);
+
+/* Insert a named field into a compound type. */
+EXTERNL int
+nc_insert_compound(int ncid, nc_type xtype, const char *name, 
+		   size_t offset, nc_type field_typeid);
+
+/* Insert a named array into a compound type. */
+EXTERNL int
+nc_insert_array_compound(int ncid, nc_type xtype, const char *name, 
+			 size_t offset, nc_type field_typeid,
+			 int ndims, const int *dim_sizes);
+
+/* Get the name and size of a type. */
+EXTERNL int
+nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size);
+
+/* Get the id of a type from the name. */
+EXTERNL int
+nc_inq_typeid(int ncid, const char *name, nc_type *typeidp);
+
+/* Get the name, size, and number of fields in a compound type. */
+EXTERNL int
+nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, 
+		size_t *nfieldsp);
+
+/* Get the name of a compound type. */
+EXTERNL int
+nc_inq_compound_name(int ncid, nc_type xtype, char *name);
+
+/* Get the size of a compound type. */
+EXTERNL int
+nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep);
+
+/* Get the number of fields in this compound type. */
+EXTERNL int
+nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp);
+
+/* Given the xtype and the fieldid, get all info about it. */
+EXTERNL int
+nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, 
+		      size_t *offsetp, nc_type *field_typeidp, int *ndimsp, 
+		      int *dim_sizesp);
+
+/* Given the typeid and the fieldid, get the name. */
+EXTERNL int
+nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, 
+			  char *name);
+
+/* Given the xtype and the name, get the fieldid. */
+EXTERNL int
+nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, 
+			   int *fieldidp);
+
+/* Given the xtype and fieldid, get the offset. */
+EXTERNL int
+nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, 
+			    size_t *offsetp);
+
+/* Given the xtype and the fieldid, get the type of that field. */
+EXTERNL int
+nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, 
+			  nc_type *field_typeidp);
+
+/* Given the xtype and the fieldid, get the number of dimensions for
+ * that field (scalars are 0). */
+EXTERNL int
+nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, 
+			   int *ndimsp);
+
+/* Given the xtype and the fieldid, get the sizes of dimensions for
+ * that field. User must have allocated storage for the dim_sizes. */
+EXTERNL int
+nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, 
+			       int *dim_sizes);
+
+/** This is the type of arrays of vlens. */
+typedef struct {
+    size_t len; /**< Length of VL data (in base type units) */
+    void *p;    /**< Pointer to VL data */
+} nc_vlen_t;
+
+/** Calculate an offset for creating a compound type. This calls a
+ * mysterious C macro which was found carved into one of the blocks of
+ * the Newgrange passage tomb in County Meath, Ireland. This code has
+ * been carbon dated to 3200 B.C.E. */
+#define NC_COMPOUND_OFFSET(S,M)    (offsetof(S,M))
+
+/* Create a variable length type. */
+EXTERNL int
+nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep);
+
+/* Find out about a vlen. */
+EXTERNL int
+nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, 
+	    nc_type *base_nc_typep);
+
+/* When you read VLEN type the library will actually allocate the
+ * storage space for the data. This storage space must be freed, so
+ * pass the pointer back to this function, when you're done with the
+ * data, and it will free the vlen memory. */
+EXTERNL int
+nc_free_vlen(nc_vlen_t *vl);
+
+EXTERNL int
+nc_free_vlens(size_t len, nc_vlen_t vlens[]);
+
+/* Put or get one element in a vlen array. */
+EXTERNL int
+nc_put_vlen_element(int ncid, int typeid1, void *vlen_element, 
+		    size_t len, const void *data);
+
+EXTERNL int
+nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element, 
+		    size_t *len, void *data);
+   
+/* When you read the string type the library will allocate the storage
+ * space for the data. This storage space must be freed, so pass the
+ * pointer back to this function, when you're done with the data, and
+ * it will free the string memory. */
+EXTERNL int
+nc_free_string(size_t len, char **data);
+
+/* Find out about a user defined type. */
+EXTERNL int
+nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, 
+		 nc_type *base_nc_typep, size_t *nfieldsp, int *classp);
+
+/* Write an attribute of any type. */
+EXTERNL int
+nc_put_att(int ncid, int varid, const char *name, nc_type xtype, 
+	   size_t len, const void *op);
+
+/* Read an attribute of any type. */
+EXTERNL int
+nc_get_att(int ncid, int varid, const char *name, void *ip);
+
+/* Enum type. */
+
+/* Create an enum type. Provide a base type and a name. At the moment
+ * only ints are accepted as base types. */
+EXTERNL int
+nc_def_enum(int ncid, nc_type base_typeid, const char *name, 
+	    nc_type *typeidp);
+
+/* Insert a named value into an enum type. The value must fit within
+ * the size of the enum type, the name size must be <= NC_MAX_NAME. */
+EXTERNL int
+nc_insert_enum(int ncid, nc_type xtype, const char *name, 
+	       const void *value);
+
+/* Get information about an enum type: its name, base type and the
+ * number of members defined. */
+EXTERNL int
+nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep, 
+	    size_t *base_sizep, size_t *num_membersp);
+
+/* Get information about an enum member: a name and value. Name size
+ * will be <= NC_MAX_NAME. */
+EXTERNL int
+nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, 
+		   void *value);
+
+
+/* Get enum name from enum value. Name size will be <= NC_MAX_NAME. */
+EXTERNL int
+nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier);
+
+/* Opaque type. */
+
+/* Create an opaque type. Provide a size and a name. */
+EXTERNL int
+nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep);
+
+/* Get information about an opaque type. */
+EXTERNL int
+nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep);
+
+/* Write entire var of any type. */
+EXTERNL int
+nc_put_var(int ncid, int varid,  const void *op);
+
+/* Read entire var of any type. */
+EXTERNL int
+nc_get_var(int ncid, int varid,  void *ip);
+
+/* Write one value. */
+EXTERNL int
+nc_put_var1(int ncid, int varid,  const size_t *indexp,
+	    const void *op);
+
+/* Read one value. */
+EXTERNL int
+nc_get_var1(int ncid, int varid,  const size_t *indexp, void *ip);
+
+/* Write an array of values. */
+EXTERNL int
+nc_put_vara(int ncid, int varid,  const size_t *startp, 
+	    const size_t *countp, const void *op);
+
+/* Read an array of values. */
+EXTERNL int
+nc_get_vara(int ncid, int varid,  const size_t *startp, 
+	    const size_t *countp, void *ip);
+
+/* Write slices of an array of values. */
+EXTERNL int
+nc_put_vars(int ncid, int varid,  const size_t *startp, 
+	    const size_t *countp, const ptrdiff_t *stridep,
+	    const void *op);
+
+/* Read slices of an array of values. */
+EXTERNL int
+nc_get_vars(int ncid, int varid,  const size_t *startp, 
+	    const size_t *countp, const ptrdiff_t *stridep,
+	    void *ip);
+
+/* Write mapped slices of an array of values. */
+EXTERNL int
+nc_put_varm(int ncid, int varid,  const size_t *startp, 
+	    const size_t *countp, const ptrdiff_t *stridep,
+	    const ptrdiff_t *imapp, const void *op);
+
+/* Read mapped slices of an array of values. */
+EXTERNL int
+nc_get_varm(int ncid, int varid,  const size_t *startp, 
+	    const size_t *countp, const ptrdiff_t *stridep,
+	    const ptrdiff_t *imapp, void *ip);
+
+/* Extra netcdf-4 stuff. */
+
+/* Set compression settings for a variable. Lower is faster, higher is
+ * better. Must be called after nc_def_var and before nc_enddef. */
+EXTERNL int
+nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, 
+		   int deflate_level);
+
+/* Find out compression settings of a var. */
+EXTERNL int
+nc_inq_var_deflate(int ncid, int varid, int *shufflep, 
+		   int *deflatep, int *deflate_levelp);
+
+/* Find out szip settings of a var. */
+EXTERNL int
+nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
+
+/* Set fletcher32 checksum for a var. This must be done after nc_def_var
+   and before nc_enddef. */
+EXTERNL int
+nc_def_var_fletcher32(int ncid, int varid, int fletcher32);
+   
+/* Inquire about fletcher32 checksum for a var. */
+EXTERNL int
+nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p);
+
+/* Define chunking for a variable. This must be done after nc_def_var
+   and before nc_enddef. */
+EXTERNL int
+nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp);
+
+/* Inq chunking stuff for a var. */
+EXTERNL int
+nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp);
+
+/* Define fill value behavior for a variable. This must be done after
+   nc_def_var and before nc_enddef. */
+EXTERNL int
+nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value);
+
+/* Inq fill value setting for a var. */
+EXTERNL int
+nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep);
+
+/* Define the endianness of a variable. */
+EXTERNL int
+nc_def_var_endian(int ncid, int varid, int endian);
+
+/* Learn about the endianness of a variable. */
+EXTERNL int
+nc_inq_var_endian(int ncid, int varid, int *endianp);
+
+/* Set the fill mode (classic or 64-bit offset files only). */
+EXTERNL int
+nc_set_fill(int ncid, int fillmode, int *old_modep);
+
+/* Set the default nc_create format to NC_FORMAT_CLASSIC,
+ * NC_FORMAT_64BIT, NC_FORMAT_NETCDF4, NC_FORMAT_NETCDF4_CLASSIC. */
+EXTERNL int
+nc_set_default_format(int format, int *old_formatp);
+
+/* Set the cache size, nelems, and preemption policy. */
+EXTERNL int
+nc_set_chunk_cache(size_t size, size_t nelems, float preemption);
+
+/* Get the cache size, nelems, and preemption policy. */
+EXTERNL int
+nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp);
+
+/* Set the per-variable cache size, nelems, and preemption policy. */
+EXTERNL int
+nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, 
+		       float preemption);
+
+/* Set the per-variable cache size, nelems, and preemption policy. */
+EXTERNL int
+nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, 
+		       float *preemptionp);
+
+EXTERNL int
+nc_redef(int ncid);
+
+/* Is this ever used? */
+EXTERNL int
+nc__enddef(int ncid, size_t h_minfree, size_t v_align,
+	size_t v_minfree, size_t r_align);
+
+EXTERNL int
+nc_enddef(int ncid);
+
+EXTERNL int
+nc_sync(int ncid);
+
+EXTERNL int
+nc_abort(int ncid);
+
+EXTERNL int
+nc_close(int ncid);
+
+EXTERNL int
+nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp);
+
+EXTERNL int 
+nc_inq_ndims(int ncid, int *ndimsp);
+
+EXTERNL int 
+nc_inq_nvars(int ncid, int *nvarsp);
+
+EXTERNL int 
+nc_inq_natts(int ncid, int *nattsp);
+
+EXTERNL int 
+nc_inq_unlimdim(int ncid, int *unlimdimidp);
+
+/* The next function is for NetCDF-4 only */
+EXTERNL int 
+nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp);
+
+/* Added in 3.6.1 to return format of netCDF file. */
+EXTERNL int
+nc_inq_format(int ncid, int *formatp);
+
+/* Added in 4.3.1 to return additional format info */
+EXTERNL int
+nc_inq_format_extended(int ncid, int *formatp, int* modep);
+
+/* Begin _dim */
+
+EXTERNL int
+nc_def_dim(int ncid, const char *name, size_t len, int *idp);
+
+EXTERNL int
+nc_inq_dimid(int ncid, const char *name, int *idp);
+
+EXTERNL int
+nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp);
+
+EXTERNL int 
+nc_inq_dimname(int ncid, int dimid, char *name);
+
+EXTERNL int 
+nc_inq_dimlen(int ncid, int dimid, size_t *lenp);
+
+EXTERNL int
+nc_rename_dim(int ncid, int dimid, const char *name);
+
+/* End _dim */
+/* Begin _att */
+
+EXTERNL int
+nc_inq_att(int ncid, int varid, const char *name,
+	   nc_type *xtypep, size_t *lenp);
+
+EXTERNL int 
+nc_inq_attid(int ncid, int varid, const char *name, int *idp);
+
+EXTERNL int 
+nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep);
+
+EXTERNL int 
+nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp);
+
+EXTERNL int
+nc_inq_attname(int ncid, int varid, int attnum, char *name);
+
+EXTERNL int
+nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
+
+EXTERNL int
+nc_rename_att(int ncid, int varid, const char *name, const char *newname);
+
+EXTERNL int
+nc_del_att(int ncid, int varid, const char *name);
+
+/* End _att */
+/* Begin {put,get}_att */
+
+EXTERNL int
+nc_put_att_text(int ncid, int varid, const char *name,
+		size_t len, const char *op);
+
+EXTERNL int
+nc_get_att_text(int ncid, int varid, const char *name, char *ip);
+
+EXTERNL int
+nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype,
+		 size_t len, const unsigned char *op);
+
+EXTERNL int
+nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip);
+
+EXTERNL int
+nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype,
+		 size_t len, const signed char *op);
+
+EXTERNL int
+nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip);
+
+EXTERNL int
+nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype,
+		 size_t len, const short *op);
+
+EXTERNL int
+nc_get_att_short(int ncid, int varid, const char *name, short *ip);
+
+EXTERNL int
+nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
+	       size_t len, const int *op);
+
+EXTERNL int
+nc_get_att_int(int ncid, int varid, const char *name, int *ip);
+
+EXTERNL int
+nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype,
+		size_t len, const long *op);
+
+EXTERNL int
+nc_get_att_long(int ncid, int varid, const char *name, long *ip);
+
+EXTERNL int
+nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype,
+		 size_t len, const float *op);
+
+EXTERNL int
+nc_get_att_float(int ncid, int varid, const char *name, float *ip);
+
+EXTERNL int
+nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
+		  size_t len, const double *op);
+
+EXTERNL int
+nc_get_att_double(int ncid, int varid, const char *name, double *ip);
+
+EXTERNL int
+nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype,
+		  size_t len, const unsigned short *op);
+
+EXTERNL int
+nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip);
+
+EXTERNL int
+nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype,
+		size_t len, const unsigned int *op);
+
+EXTERNL int
+nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip);
+
+EXTERNL int
+nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype,
+		 size_t len, const long long *op);
+
+EXTERNL int
+nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip);
+
+EXTERNL int
+nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype,
+		     size_t len, const unsigned long long *op);
+
+EXTERNL int
+nc_get_att_ulonglong(int ncid, int varid, const char *name, 
+		     unsigned long long *ip);
+
+EXTERNL int
+nc_put_att_string(int ncid, int varid, const char *name, 
+		  size_t len, const char **op);
+
+EXTERNL int
+nc_get_att_string(int ncid, int varid, const char *name, char **ip);
+
+/* End {put,get}_att */
+/* Begin _var */
+
+EXTERNL int
+nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, 
+	   const int *dimidsp, int *varidp);
+
+EXTERNL int
+nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, 
+	   int *ndimsp, int *dimidsp, int *nattsp);
+
+EXTERNL int
+nc_inq_varid(int ncid, const char *name, int *varidp);
+
+EXTERNL int 
+nc_inq_varname(int ncid, int varid, char *name);
+
+EXTERNL int 
+nc_inq_vartype(int ncid, int varid, nc_type *xtypep);
+
+EXTERNL int 
+nc_inq_varndims(int ncid, int varid, int *ndimsp);
+
+EXTERNL int 
+nc_inq_vardimid(int ncid, int varid, int *dimidsp);
+
+EXTERNL int 
+nc_inq_varnatts(int ncid, int varid, int *nattsp);
+
+EXTERNL int
+nc_rename_var(int ncid, int varid, const char *name);
+
+EXTERNL int
+nc_copy_var(int ncid_in, int varid, int ncid_out);
+
+#ifndef ncvarcpy
+/* support the old name for now */
+#define ncvarcpy(ncid_in, varid, ncid_out) ncvarcopy((ncid_in), (varid), (ncid_out))
+#endif
+
+/* End _var */
+/* Begin {put,get}_var1 */
+
+EXTERNL int
+nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op);
+
+EXTERNL int
+nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip);
+
+EXTERNL int
+nc_put_var1_uchar(int ncid, int varid, const size_t *indexp,
+		  const unsigned char *op);
+
+EXTERNL int
+nc_get_var1_uchar(int ncid, int varid, const size_t *indexp,
+		  unsigned char *ip);
+
+EXTERNL int
+nc_put_var1_schar(int ncid, int varid, const size_t *indexp,
+		  const signed char *op);
+
+EXTERNL int
+nc_get_var1_schar(int ncid, int varid, const size_t *indexp,
+		  signed char *ip);
+
+EXTERNL int
+nc_put_var1_short(int ncid, int varid, const size_t *indexp,
+		  const short *op);
+
+EXTERNL int
+nc_get_var1_short(int ncid, int varid, const size_t *indexp,
+		  short *ip);
+
+EXTERNL int
+nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op);
+
+EXTERNL int
+nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip);
+
+EXTERNL int
+nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op);
+
+EXTERNL int
+nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip);
+
+EXTERNL int
+nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op);
+
+EXTERNL int
+nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip);
+
+EXTERNL int
+nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op);
+
+EXTERNL int
+nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip);
+
+EXTERNL int
+nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, 
+		   const unsigned short *op);
+
+EXTERNL int
+nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, 
+		   unsigned short *ip);
+
+EXTERNL int
+nc_put_var1_uint(int ncid, int varid, const size_t *indexp, 
+		 const unsigned int *op);
+
+EXTERNL int
+nc_get_var1_uint(int ncid, int varid, const size_t *indexp, 
+		 unsigned int *ip);
+
+EXTERNL int
+nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, 
+		     const long long *op);
+
+EXTERNL int
+nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, 
+		  long long *ip);
+
+EXTERNL int
+nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, 
+		   const unsigned long long *op);
+
+EXTERNL int
+nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, 
+		   unsigned long long *ip);
+
+EXTERNL int
+nc_put_var1_string(int ncid, int varid, const size_t *indexp, 
+		   const char **op);
+
+EXTERNL int
+nc_get_var1_string(int ncid, int varid, const size_t *indexp, 
+		   char **ip);
+
+/* End {put,get}_var1 */
+/* Begin {put,get}_vara */
+
+EXTERNL int
+nc_put_vara_text(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const char *op);
+
+EXTERNL int
+nc_get_vara_text(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, char *ip);
+
+EXTERNL int
+nc_put_vara_uchar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const unsigned char *op);
+
+EXTERNL int
+nc_get_vara_uchar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, unsigned char *ip);
+
+EXTERNL int
+nc_put_vara_schar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const signed char *op);
+
+EXTERNL int
+nc_get_vara_schar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, signed char *ip);
+
+EXTERNL int
+nc_put_vara_short(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const short *op);
+
+EXTERNL int
+nc_get_vara_short(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, short *ip);
+
+EXTERNL int
+nc_put_vara_int(int ncid, int varid, const size_t *startp, 
+		const size_t *countp, const int *op);
+
+EXTERNL int
+nc_get_vara_int(int ncid, int varid, const size_t *startp, 
+		const size_t *countp, int *ip);
+
+EXTERNL int
+nc_put_vara_long(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const long *op);
+
+EXTERNL int
+nc_get_vara_long(int ncid, int varid,
+	const size_t *startp, const size_t *countp, long *ip);
+
+EXTERNL int
+nc_put_vara_float(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const float *op);
+
+EXTERNL int
+nc_get_vara_float(int ncid, int varid,
+	const size_t *startp, const size_t *countp, float *ip);
+
+EXTERNL int
+nc_put_vara_double(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const double *op);
+
+EXTERNL int
+nc_get_vara_double(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, double *ip);
+
+EXTERNL int
+nc_put_vara_ushort(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const unsigned short *op);
+
+EXTERNL int
+nc_get_vara_ushort(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, unsigned short *ip);
+
+EXTERNL int
+nc_put_vara_uint(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const unsigned int *op);
+
+EXTERNL int
+nc_get_vara_uint(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, unsigned int *ip);
+
+EXTERNL int
+nc_put_vara_longlong(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const long long *op);
+
+EXTERNL int
+nc_get_vara_longlong(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, long long *ip);
+
+EXTERNL int
+nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const unsigned long long *op);
+
+EXTERNL int
+nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, unsigned long long *ip);
+
+EXTERNL int
+nc_put_vara_string(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const char **op);
+
+EXTERNL int
+nc_get_vara_string(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, char **ip);
+
+/* End {put,get}_vara */
+/* Begin {put,get}_vars */
+
+EXTERNL int
+nc_put_vars_text(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const char *op);
+
+EXTERNL int
+nc_get_vars_text(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	char *ip);
+
+EXTERNL int
+nc_put_vars_uchar(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const unsigned char *op);
+
+EXTERNL int
+nc_get_vars_uchar(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	unsigned char *ip);
+
+EXTERNL int
+nc_put_vars_schar(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const signed char *op);
+
+EXTERNL int
+nc_get_vars_schar(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	signed char *ip);
+
+EXTERNL int
+nc_put_vars_short(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const short *op);
+
+EXTERNL int
+nc_get_vars_short(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  short *ip);
+
+EXTERNL int
+nc_put_vars_int(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const int *op);
+
+EXTERNL int
+nc_get_vars_int(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	int *ip);
+
+EXTERNL int
+nc_put_vars_long(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const long *op);
+
+EXTERNL int
+nc_get_vars_long(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	long *ip);
+
+EXTERNL int
+nc_put_vars_float(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const float *op);
+
+EXTERNL int
+nc_get_vars_float(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	float *ip);
+
+EXTERNL int
+nc_put_vars_double(int ncid, int varid,
+	const size_t *startp, const size_t *countp, const ptrdiff_t *stridep,
+	const double *op);
+
+EXTERNL int
+nc_get_vars_double(int ncid, int varid,	const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep,
+		   double *ip);
+
+EXTERNL int
+nc_put_vars_ushort(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const unsigned short *op);
+
+EXTERNL int
+nc_get_vars_ushort(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   unsigned short *ip);
+
+EXTERNL int
+nc_put_vars_uint(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep, 
+		 const unsigned int *op);
+
+EXTERNL int
+nc_get_vars_uint(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep, 
+		 unsigned int *ip);
+
+EXTERNL int
+nc_put_vars_longlong(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  const long long *op);
+
+EXTERNL int
+nc_get_vars_longlong(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  long long *ip);
+
+EXTERNL int
+nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const unsigned long long *op);
+
+EXTERNL int
+nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   unsigned long long *ip);
+
+EXTERNL int
+nc_put_vars_string(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const char **op);
+
+EXTERNL int
+nc_get_vars_string(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   char **ip);
+
+/* End {put,get}_vars */
+/* Begin {put,get}_varm */
+
+EXTERNL int
+nc_put_varm_text(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep,
+		 const ptrdiff_t *imapp, const char *op);
+
+EXTERNL int
+nc_get_varm_text(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep,
+		 const ptrdiff_t *imapp, char *ip);
+
+EXTERNL int
+nc_put_varm_uchar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, const unsigned char *op);
+
+EXTERNL int
+nc_get_varm_uchar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, unsigned char *ip);
+
+EXTERNL int
+nc_put_varm_schar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, const signed char *op);
+
+EXTERNL int
+nc_get_varm_schar(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, signed char *ip);
+
+EXTERNL int
+nc_put_varm_short(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, const short *op);
+
+EXTERNL int
+nc_get_varm_short(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, short *ip);
+
+EXTERNL int
+nc_put_varm_int(int ncid, int varid, const size_t *startp, 
+		const size_t *countp, const ptrdiff_t *stridep,
+		const ptrdiff_t *imapp, const int *op);
+
+EXTERNL int
+nc_get_varm_int(int ncid, int varid, const size_t *startp, 
+		const size_t *countp, const ptrdiff_t *stridep,
+		const ptrdiff_t *imapp, int *ip);
+
+EXTERNL int
+nc_put_varm_long(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep,
+		 const ptrdiff_t *imapp, const long *op);
+
+EXTERNL int
+nc_get_varm_long(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep,
+		 const ptrdiff_t *imapp, long *ip);
+
+EXTERNL int
+nc_put_varm_float(int ncid, int varid,const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, const float *op);
+
+EXTERNL int
+nc_get_varm_float(int ncid, int varid,const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep,
+		  const ptrdiff_t *imapp, float *ip);
+
+EXTERNL int
+nc_put_varm_double(int ncid, int varid,	const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep,
+		   const ptrdiff_t *imapp, const double *op);
+
+EXTERNL int
+nc_get_varm_double(int ncid, int varid,	const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep,
+		   const ptrdiff_t * imapp, double *ip);
+
+EXTERNL int
+nc_put_varm_ushort(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const ptrdiff_t * imapp, const unsigned short *op);
+
+EXTERNL int
+nc_get_varm_ushort(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const ptrdiff_t * imapp, unsigned short *ip);
+
+EXTERNL int
+nc_put_varm_uint(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep, 
+		 const ptrdiff_t * imapp, const unsigned int *op);
+
+EXTERNL int
+nc_get_varm_uint(int ncid, int varid, const size_t *startp, 
+		 const size_t *countp, const ptrdiff_t *stridep, 
+		 const ptrdiff_t * imapp, unsigned int *ip);
+
+EXTERNL int
+nc_put_varm_longlong(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  const ptrdiff_t * imapp, const long long *op);
+
+EXTERNL int
+nc_get_varm_longlong(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  const ptrdiff_t * imapp, long long *ip);
+
+EXTERNL int
+nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const ptrdiff_t * imapp, const unsigned long long *op);
+
+EXTERNL int
+nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const ptrdiff_t * imapp, unsigned long long *ip);
+
+EXTERNL int
+nc_put_varm_string(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const ptrdiff_t * imapp, const char **op);
+
+EXTERNL int
+nc_get_varm_string(int ncid, int varid, const size_t *startp, 
+		   const size_t *countp, const ptrdiff_t *stridep, 
+		   const ptrdiff_t * imapp, char **ip);
+
+/* End {put,get}_varm */
+/* Begin {put,get}_var */
+
+EXTERNL int
+nc_put_var_text(int ncid, int varid, const char *op);
+
+EXTERNL int
+nc_get_var_text(int ncid, int varid, char *ip);
+
+EXTERNL int
+nc_put_var_uchar(int ncid, int varid, const unsigned char *op);
+
+EXTERNL int
+nc_get_var_uchar(int ncid, int varid, unsigned char *ip);
+
+EXTERNL int
+nc_put_var_schar(int ncid, int varid, const signed char *op);
+
+EXTERNL int
+nc_get_var_schar(int ncid, int varid, signed char *ip);
+
+EXTERNL int
+nc_put_var_short(int ncid, int varid, const short *op);
+
+EXTERNL int
+nc_get_var_short(int ncid, int varid, short *ip);
+
+EXTERNL int
+nc_put_var_int(int ncid, int varid, const int *op);
+
+EXTERNL int
+nc_get_var_int(int ncid, int varid, int *ip);
+
+EXTERNL int
+nc_put_var_long(int ncid, int varid, const long *op);
+
+EXTERNL int
+nc_get_var_long(int ncid, int varid, long *ip);
+
+EXTERNL int
+nc_put_var_float(int ncid, int varid, const float *op);
+
+EXTERNL int
+nc_get_var_float(int ncid, int varid, float *ip);
+
+EXTERNL int
+nc_put_var_double(int ncid, int varid, const double *op);
+
+EXTERNL int
+nc_get_var_double(int ncid, int varid, double *ip);
+
+EXTERNL int
+nc_put_var_ushort(int ncid, int varid, const unsigned short *op);
+
+EXTERNL int
+nc_get_var_ushort(int ncid, int varid, unsigned short *ip);
+
+EXTERNL int
+nc_put_var_uint(int ncid, int varid, const unsigned int *op);
+
+EXTERNL int
+nc_get_var_uint(int ncid, int varid, unsigned int *ip);
+
+EXTERNL int
+nc_put_var_longlong(int ncid, int varid, const long long *op);
+
+EXTERNL int
+nc_get_var_longlong(int ncid, int varid, long long *ip);
+
+EXTERNL int
+nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op);
+
+EXTERNL int
+nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip);
+
+EXTERNL int
+nc_put_var_string(int ncid, int varid, const char **op);
+
+EXTERNL int
+nc_get_var_string(int ncid, int varid, char **ip);
+
+/* Begin Deprecated, same as functions with "_ubyte" replaced by "_uchar" */
+EXTERNL int
+nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype,
+		 size_t len, const unsigned char *op);
+EXTERNL int
+nc_get_att_ubyte(int ncid, int varid, const char *name, 
+		 unsigned char *ip);
+EXTERNL int
+nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, 
+		  const unsigned char *op);
+EXTERNL int
+nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, 
+		  unsigned char *ip);
+EXTERNL int
+nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const unsigned char *op);
+EXTERNL int
+nc_get_vara_ubyte(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, unsigned char *ip);
+EXTERNL int
+nc_put_vars_ubyte(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  const unsigned char *op);
+EXTERNL int
+nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  unsigned char *ip);
+EXTERNL int
+nc_put_varm_ubyte(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  const ptrdiff_t * imapp, const unsigned char *op);
+EXTERNL int
+nc_get_varm_ubyte(int ncid, int varid, const size_t *startp, 
+		  const size_t *countp, const ptrdiff_t *stridep, 
+		  const ptrdiff_t * imapp, unsigned char *ip);
+EXTERNL int
+nc_put_var_ubyte(int ncid, int varid, const unsigned char *op);
+EXTERNL int
+nc_get_var_ubyte(int ncid, int varid, unsigned char *ip);
+/* End Deprecated */
+
+#ifdef LOGGING
+
+/* Set the log level. 0 shows only errors, 1 only major messages,
+ * etc., to 5, which shows way too much information. */
+EXTERNL int
+nc_set_log_level(int new_level);
+
+/* Use this to turn off logging by calling
+   nc_log_level(NC_TURN_OFF_LOGGING) */
+#define NC_TURN_OFF_LOGGING (-1)
+
+#else /* not LOGGING */
+
+#define nc_set_log_level(e)
+
+#endif /* LOGGING */
+
+/* Show the netCDF library's in-memory metadata for a file. */
+EXTERNL int 
+nc_show_metadata(int ncid);
+
+/* End {put,get}_var */
+
+/* #ifdef _CRAYMPP */
+/*
+ * Public interfaces to better support
+ * CRAY multi-processor systems like T3E.
+ * A tip of the hat to NERSC.
+ */
+/*
+ * It turns out we need to declare and define
+ * these public interfaces on all platforms
+ * or things get ugly working out the
+ * FORTRAN interface. On !_CRAYMPP platforms,
+ * these functions work as advertised, but you
+ * can only use "processor element" 0.
+ */
+
+EXTERNL int
+nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe,
+	 size_t *chunksizehintp, int *ncidp);
+
+EXTERNL int
+nc__open_mp(const char *path, int mode, int basepe,
+	size_t *chunksizehintp, int *ncidp);
+
+EXTERNL int
+nc_delete(const char *path);
+
+EXTERNL int
+nc_delete_mp(const char *path, int basepe);
+
+EXTERNL int
+nc_set_base_pe(int ncid, int pe);
+
+EXTERNL int
+nc_inq_base_pe(int ncid, int *pe);
+
+/* #endif _CRAYMPP */
+
+/* This v2 function is used in the nc_test program. */
+EXTERNL int
+nctypelen(nc_type datatype);
+
+/* Begin v2.4 backward compatiblity */
+/*
+ * defining NO_NETCDF_2 to the preprocessor
+ * turns off backward compatiblity declarations.
+ */
+#ifndef NO_NETCDF_2
+
+/** Backward compatible alias. */
+/**@{*/
+#define FILL_BYTE	NC_FILL_BYTE
+#define FILL_CHAR	NC_FILL_CHAR
+#define FILL_SHORT	NC_FILL_SHORT
+#define FILL_LONG	NC_FILL_INT
+#define FILL_FLOAT	NC_FILL_FLOAT
+#define FILL_DOUBLE	NC_FILL_DOUBLE
+
+#define MAX_NC_DIMS	NC_MAX_DIMS
+#define MAX_NC_ATTRS	NC_MAX_ATTRS
+#define MAX_NC_VARS	NC_MAX_VARS
+#define MAX_NC_NAME	NC_MAX_NAME
+#define MAX_VAR_DIMS	NC_MAX_VAR_DIMS
+/**@}*/
+
+
+/*
+ * Global error status
+ */
+EXTERNL int ncerr;
+
+#define NC_ENTOOL       NC_EMAXNAME   /* Backward compatibility */
+#define	NC_EXDR		(-32)	/* */
+#define	NC_SYSERR	(-31)
+
+/*
+ * Global options variable.
+ * Used to determine behavior of error handler.
+ */
+#define	NC_FATAL	1
+#define	NC_VERBOSE	2
+
+EXTERNL int ncopts;	/* default is (NC_FATAL | NC_VERBOSE) */
+
+EXTERNL void
+nc_advise(const char *cdf_routine_name, int err, const char *fmt,...);
+
+/*
+ * C data type corresponding to a netCDF NC_LONG argument,
+ * a signed 32 bit object.
+ * 
+ * This is the only thing in this file which architecture dependent.
+ */
+typedef int nclong;
+
+EXTERNL int
+nccreate(const char* path, int cmode);
+
+EXTERNL int
+ncopen(const char* path, int mode);
+
+EXTERNL int
+ncsetfill(int ncid, int fillmode);
+
+EXTERNL int
+ncredef(int ncid);
+
+EXTERNL int
+ncendef(int ncid);
+
+EXTERNL int
+ncsync(int ncid);
+
+EXTERNL int
+ncabort(int ncid);
+
+EXTERNL int
+ncclose(int ncid);
+
+EXTERNL int
+ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp);
+
+EXTERNL int
+ncdimdef(int ncid, const char *name, long len);
+
+EXTERNL int
+ncdimid(int ncid, const char *name);
+
+EXTERNL int
+ncdiminq(int ncid, int dimid, char *name, long *lenp);
+
+EXTERNL int
+ncdimrename(int ncid, int dimid, const char *name);
+
+EXTERNL int
+ncattput(int ncid, int varid, const char *name, nc_type xtype,
+	int len, const void *op);
+
+EXTERNL int
+ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp);
+
+EXTERNL int
+ncattget(int ncid, int varid, const char *name, void *ip);
+
+EXTERNL int
+ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out,
+	int varid_out);
+
+EXTERNL int
+ncattname(int ncid, int varid, int attnum, char *name);
+
+EXTERNL int
+ncattrename(int ncid, int varid, const char *name, const char *newname);
+
+EXTERNL int
+ncattdel(int ncid, int varid, const char *name);
+
+EXTERNL int
+ncvardef(int ncid, const char *name, nc_type xtype,
+	int ndims, const int *dimidsp);
+
+EXTERNL int
+ncvarid(int ncid, const char *name);
+
+EXTERNL int
+ncvarinq(int ncid, int varid, char *name, nc_type *xtypep,
+	int *ndimsp, int *dimidsp, int *nattsp);
+
+EXTERNL int
+ncvarput1(int ncid, int varid, const long *indexp, const void *op);
+
+EXTERNL int
+ncvarget1(int ncid, int varid, const long *indexp, void *ip);
+
+EXTERNL int
+ncvarput(int ncid, int varid, const long *startp, const long *countp,
+	const void *op);
+
+EXTERNL int
+ncvarget(int ncid, int varid, const long *startp, const long *countp, 
+	void *ip);
+
+EXTERNL int
+ncvarputs(int ncid, int varid, const long *startp, const long *countp,
+	const long *stridep, const void *op);
+
+EXTERNL int
+ncvargets(int ncid, int varid, const long *startp, const long *countp,
+	const long *stridep, void *ip);
+
+EXTERNL int
+ncvarputg(int ncid, int varid, const long *startp, const long *countp,
+	const long *stridep, const long *imapp, const void *op);
+
+EXTERNL int
+ncvargetg(int ncid, int varid, const long *startp, const long *countp,
+	const long *stridep, const long *imapp, void *ip);
+
+EXTERNL int
+ncvarrename(int ncid, int varid, const char *name);
+
+EXTERNL int
+ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp);
+
+EXTERNL int
+ncrecget(int ncid, long recnum, void **datap);
+
+EXTERNL int
+ncrecput(int ncid, long recnum, void *const *datap);
+
+/* End v2.4 backward compatiblity */
+#endif /*!NO_NETCDF_2*/
+
+#if defined(__cplusplus)
+}
+#endif
+
+/* Temporary hack to shut up warnings */
+#ifndef __MINGW32_VERSION 
+#define END_OF_MAIN()
+#endif
+
+
+/* Allow dependent software to tell if
+   nc_rename_grp() is available, as requested
+   by Charlie Zender. */
+#ifndef NC_HAVE_RENAME_GRP
+#define NC_HAVE_RENAME_GRP
+#endif
+
+/* Allow dependent software to tell if
+   inq_format_extended() is available.
+   
+   This is not a scalable approach to querying
+   the functionality of the netcdf library, but
+   it will do for the time being. */
+#ifndef NC_HAVE_INQ_FORMAT_EXTENDED
+#define NC_HAVE_INQ_FORMAT_EXTENDED
+#endif
+
+
+#endif /* _NETCDF_ */
+
+
+
Index: codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.inc
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.inc	(revision 308)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf.inc	(revision 308)
@@ -0,0 +1,1740 @@
+!     NetCDF-3.
+!
+! netcdf version 3 fortran interface:
+!
+
+!
+! external netcdf data types:
+!
+      integer nf_byte
+      integer nf_int1
+      integer nf_char
+      integer nf_short
+      integer nf_int2
+      integer nf_int
+      integer nf_float
+      integer nf_real
+      integer nf_double
+
+      parameter (nf_byte = 1)
+      parameter (nf_int1 = nf_byte)
+      parameter (nf_char = 2)
+      parameter (nf_short = 3)
+      parameter (nf_int2 = nf_short)
+      parameter (nf_int = 4)
+      parameter (nf_float = 5)
+      parameter (nf_real = nf_float)
+      parameter (nf_double = 6)
+
+!
+! default fill values:
+!
+      integer           nf_fill_byte
+      integer           nf_fill_int1
+      integer           nf_fill_char
+      integer           nf_fill_short
+      integer           nf_fill_int2
+      integer           nf_fill_int
+      real              nf_fill_float
+      real              nf_fill_real
+      doubleprecision   nf_fill_double
+
+      parameter (nf_fill_byte = -127)
+      parameter (nf_fill_int1 = nf_fill_byte)
+      parameter (nf_fill_char = 0)
+      parameter (nf_fill_short = -32767)
+      parameter (nf_fill_int2 = nf_fill_short)
+      parameter (nf_fill_int = -2147483647)
+      parameter (nf_fill_float = 9.9692099683868690e+36)
+      parameter (nf_fill_real = nf_fill_float)
+      parameter (nf_fill_double = 9.9692099683868690d+36)
+
+!
+! mode flags for opening and creating a netcdf dataset:
+!
+      integer nf_nowrite
+      integer nf_write
+      integer nf_clobber
+      integer nf_noclobber
+      integer nf_fill
+      integer nf_nofill
+      integer nf_lock
+      integer nf_share
+      integer nf_64bit_offset
+      integer nf_sizehint_default
+      integer nf_align_chunk
+      integer nf_format_classic
+      integer nf_format_64bit
+      integer nf_diskless
+      integer nf_mmap
+
+      parameter (nf_nowrite = 0)
+      parameter (nf_write = 1)
+      parameter (nf_clobber = 0)
+      parameter (nf_noclobber = 4)
+      parameter (nf_fill = 0)
+      parameter (nf_nofill = 256)
+      parameter (nf_lock = 1024)
+      parameter (nf_share = 2048)
+      parameter (nf_64bit_offset = 512)
+      parameter (nf_sizehint_default = 0)
+      parameter (nf_align_chunk = -1)
+      parameter (nf_format_classic = 1)
+      parameter (nf_format_64bit = 2)
+      parameter (nf_diskless = 8)
+      parameter (nf_mmap = 16)
+
+!
+! size argument for defining an unlimited dimension:
+!
+      integer nf_unlimited
+      parameter (nf_unlimited = 0)
+
+!
+! global attribute id:
+!
+      integer nf_global
+      parameter (nf_global = 0)
+
+!
+! implementation limits:
+!
+      integer nf_max_dims
+      integer nf_max_attrs
+      integer nf_max_vars
+      integer nf_max_name
+      integer nf_max_var_dims
+
+      parameter (nf_max_dims = 1024)
+      parameter (nf_max_attrs = 8192)
+      parameter (nf_max_vars = 8192)
+      parameter (nf_max_name = 256)
+      parameter (nf_max_var_dims = nf_max_dims)
+
+!
+! error codes:
+!
+      integer nf_noerr
+      integer nf_ebadid
+      integer nf_eexist
+      integer nf_einval
+      integer nf_eperm
+      integer nf_enotindefine
+      integer nf_eindefine
+      integer nf_einvalcoords
+      integer nf_emaxdims
+      integer nf_enameinuse
+      integer nf_enotatt
+      integer nf_emaxatts
+      integer nf_ebadtype
+      integer nf_ebaddim
+      integer nf_eunlimpos
+      integer nf_emaxvars
+      integer nf_enotvar
+      integer nf_eglobal
+      integer nf_enotnc
+      integer nf_ests
+      integer nf_emaxname
+      integer nf_eunlimit
+      integer nf_enorecvars
+      integer nf_echar
+      integer nf_eedge
+      integer nf_estride
+      integer nf_ebadname
+      integer nf_erange
+      integer nf_enomem
+      integer nf_evarsize
+      integer nf_edimsize
+      integer nf_etrunc
+
+      parameter (nf_noerr = 0)
+      parameter (nf_ebadid = -33)
+      parameter (nf_eexist = -35)
+      parameter (nf_einval = -36)
+      parameter (nf_eperm = -37)
+      parameter (nf_enotindefine = -38)
+      parameter (nf_eindefine = -39)
+      parameter (nf_einvalcoords = -40)
+      parameter (nf_emaxdims = -41)
+      parameter (nf_enameinuse = -42)
+      parameter (nf_enotatt = -43)
+      parameter (nf_emaxatts = -44)
+      parameter (nf_ebadtype = -45)
+      parameter (nf_ebaddim = -46)
+      parameter (nf_eunlimpos = -47)
+      parameter (nf_emaxvars = -48)
+      parameter (nf_enotvar = -49)
+      parameter (nf_eglobal = -50)
+      parameter (nf_enotnc = -51)
+      parameter (nf_ests = -52)
+      parameter (nf_emaxname = -53)
+      parameter (nf_eunlimit = -54)
+      parameter (nf_enorecvars = -55)
+      parameter (nf_echar = -56)
+      parameter (nf_eedge = -57)
+      parameter (nf_estride = -58)
+      parameter (nf_ebadname = -59)
+      parameter (nf_erange = -60)
+      parameter (nf_enomem = -61)
+      parameter (nf_evarsize = -62)
+      parameter (nf_edimsize = -63)
+      parameter (nf_etrunc = -64)
+!
+! error handling modes:
+!
+      integer  nf_fatal
+      integer nf_verbose
+
+      parameter (nf_fatal = 1)
+      parameter (nf_verbose = 2)
+
+!
+! miscellaneous routines:
+!
+      character*80   nf_inq_libvers
+      external       nf_inq_libvers
+
+      character*80   nf_strerror
+!                         (integer             ncerr)
+      external       nf_strerror
+
+      logical        nf_issyserr
+!                         (integer             ncerr)
+      external       nf_issyserr
+
+!
+! control routines:
+!
+      integer         nf_inq_base_pe
+!                         (integer             ncid,
+!                          integer             pe)
+      external        nf_inq_base_pe
+
+      integer         nf_set_base_pe
+!                         (integer             ncid,
+!                          integer             pe)
+      external        nf_set_base_pe
+
+      integer         nf_create
+!                         (character*(*)       path,
+!                          integer             cmode,
+!                          integer             ncid)
+      external        nf_create
+
+      integer         nf__create
+!                         (character*(*)       path,
+!                          integer             cmode,
+!                          integer             initialsz,
+!                          integer             chunksizehint,
+!                          integer             ncid)
+      external        nf__create
+
+      integer         nf__create_mp
+!                         (character*(*)       path,
+!                          integer             cmode,
+!                          integer             initialsz,
+!                          integer             basepe,
+!                          integer             chunksizehint,
+!                          integer             ncid)
+      external        nf__create_mp
+
+      integer         nf_open
+!                         (character*(*)       path,
+!                          integer             mode,
+!                          integer             ncid)
+      external        nf_open
+
+      integer         nf__open
+!                         (character*(*)       path,
+!                          integer             mode,
+!                          integer             chunksizehint,
+!                          integer             ncid)
+      external        nf__open
+
+      integer         nf__open_mp
+!                         (character*(*)       path,
+!                          integer             mode,
+!                          integer             basepe,
+!                          integer             chunksizehint,
+!                          integer             ncid)
+      external        nf__open_mp
+
+      integer         nf_set_fill
+!                         (integer             ncid,
+!                          integer             fillmode,
+!                          integer             old_mode)
+      external        nf_set_fill
+
+      integer         nf_set_default_format
+!                          (integer             format,
+!                          integer             old_format)
+      external        nf_set_default_format
+
+      integer         nf_redef
+!                         (integer             ncid)
+      external        nf_redef
+
+      integer         nf_enddef
+!                         (integer             ncid)
+      external        nf_enddef
+
+      integer         nf__enddef
+!                         (integer             ncid,
+!                          integer             h_minfree,
+!                          integer             v_align,
+!                          integer             v_minfree,
+!                          integer             r_align)
+      external        nf__enddef
+
+      integer         nf_sync
+!                         (integer             ncid)
+      external        nf_sync
+
+      integer         nf_abort
+!                         (integer             ncid)
+      external        nf_abort
+
+      integer         nf_close
+!                         (integer             ncid)
+      external        nf_close
+
+      integer         nf_delete
+!                         (character*(*)       ncid)
+      external        nf_delete
+
+!
+! general inquiry routines:
+!
+
+      integer         nf_inq
+!                         (integer             ncid,
+!                          integer             ndims,
+!                          integer             nvars,
+!                          integer             ngatts,
+!                          integer             unlimdimid)
+      external        nf_inq
+
+! new inquire path
+
+      integer nf_inq_path
+      external nf_inq_path
+
+      integer         nf_inq_ndims
+!                         (integer             ncid,
+!                          integer             ndims)
+      external        nf_inq_ndims
+
+      integer         nf_inq_nvars
+!                         (integer             ncid,
+!                          integer             nvars)
+      external        nf_inq_nvars
+
+      integer         nf_inq_natts
+!                         (integer             ncid,
+!                          integer             ngatts)
+      external        nf_inq_natts
+
+      integer         nf_inq_unlimdim
+!                         (integer             ncid,
+!                          integer             unlimdimid)
+      external        nf_inq_unlimdim
+
+      integer         nf_inq_format
+!                         (integer             ncid,
+!                          integer             format)
+      external        nf_inq_format
+
+!
+! dimension routines:
+!
+
+      integer         nf_def_dim
+!                         (integer             ncid,
+!                          character(*)        name,
+!                          integer             len,
+!                          integer             dimid)
+      external        nf_def_dim
+
+      integer         nf_inq_dimid
+!                         (integer             ncid,
+!                          character(*)        name,
+!                          integer             dimid)
+      external        nf_inq_dimid
+
+      integer         nf_inq_dim
+!                         (integer             ncid,
+!                          integer             dimid,
+!                          character(*)        name,
+!                          integer             len)
+      external        nf_inq_dim
+
+      integer         nf_inq_dimname
+!                         (integer             ncid,
+!                          integer             dimid,
+!                          character(*)        name)
+      external        nf_inq_dimname
+
+      integer         nf_inq_dimlen
+!                         (integer             ncid,
+!                          integer             dimid,
+!                          integer             len)
+      external        nf_inq_dimlen
+
+      integer         nf_rename_dim
+!                         (integer             ncid,
+!                          integer             dimid,
+!                          character(*)        name)
+      external        nf_rename_dim
+
+!
+! general attribute routines:
+!
+
+      integer         nf_inq_att
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype,
+!                          integer             len)
+      external        nf_inq_att
+
+      integer         nf_inq_attid
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             attnum)
+      external        nf_inq_attid
+
+      integer         nf_inq_atttype
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype)
+      external        nf_inq_atttype
+
+      integer         nf_inq_attlen
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             len)
+      external        nf_inq_attlen
+
+      integer         nf_inq_attname
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             attnum,
+!                          character(*)        name)
+      external        nf_inq_attname
+
+      integer         nf_copy_att
+!                         (integer             ncid_in,
+!                          integer             varid_in,
+!                          character(*)        name,
+!                          integer             ncid_out,
+!                          integer             varid_out)
+      external        nf_copy_att
+
+      integer         nf_rename_att
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        curname,
+!                          character(*)        newname)
+      external        nf_rename_att
+
+      integer         nf_del_att
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name)
+      external        nf_del_att
+
+!
+! attribute put/get routines:
+!
+
+      integer         nf_put_att_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             len,
+!                          character(*)        text)
+      external        nf_put_att_text
+
+      integer         nf_get_att_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          character(*)        text)
+      external        nf_get_att_text
+
+      integer         nf_put_att_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype,
+!                          integer             len,
+!                          nf_int1_t           i1vals(1))
+      external        nf_put_att_int1
+
+      integer         nf_get_att_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          nf_int1_t           i1vals(1))
+      external        nf_get_att_int1
+
+      integer         nf_put_att_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype,
+!                          integer             len,
+!                          nf_int2_t           i2vals(1))
+      external        nf_put_att_int2
+
+      integer         nf_get_att_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          nf_int2_t           i2vals(1))
+      external        nf_get_att_int2
+
+      integer         nf_put_att_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype,
+!                          integer             len,
+!                          integer             ivals(1))
+      external        nf_put_att_int
+
+      integer         nf_get_att_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             ivals(1))
+      external        nf_get_att_int
+
+      integer         nf_put_att_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype,
+!                          integer             len,
+!                          real                rvals(1))
+      external        nf_put_att_real
+
+      integer         nf_get_att_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          real                rvals(1))
+      external        nf_get_att_real
+
+      integer         nf_put_att_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             xtype,
+!                          integer             len,
+!                          double              dvals(1))
+      external        nf_put_att_double
+
+      integer         nf_get_att_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          double              dvals(1))
+      external        nf_get_att_double
+
+!
+! general variable routines:
+!
+
+      integer         nf_def_var
+!                         (integer             ncid,
+!                          character(*)        name,
+!                          integer             datatype,
+!                          integer             ndims,
+!                          integer             dimids(1),
+!                          integer             varid)
+      external        nf_def_var
+
+      integer         nf_inq_var
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name,
+!                          integer             datatype,
+!                          integer             ndims,
+!                          integer             dimids(1),
+!                          integer             natts)
+      external        nf_inq_var
+
+      integer         nf_inq_varid
+!                         (integer             ncid,
+!                          character(*)        name,
+!                          integer             varid)
+      external        nf_inq_varid
+
+      integer         nf_inq_varname
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name)
+      external        nf_inq_varname
+
+      integer         nf_inq_vartype
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             xtype)
+      external        nf_inq_vartype
+
+      integer         nf_inq_varndims
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             ndims)
+      external        nf_inq_varndims
+
+      integer         nf_inq_vardimid
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             dimids(1))
+      external        nf_inq_vardimid
+
+      integer         nf_inq_varnatts
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             natts)
+      external        nf_inq_varnatts
+
+      integer         nf_rename_var
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        name)
+      external        nf_rename_var
+
+      integer         nf_copy_var
+!                         (integer             ncid_in,
+!                          integer             varid,
+!                          integer             ncid_out)
+      external        nf_copy_var
+
+!
+! entire variable put/get routines:
+!
+
+      integer         nf_put_var_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        text)
+      external        nf_put_var_text
+
+      integer         nf_get_var_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          character(*)        text)
+      external        nf_get_var_text
+
+      integer         nf_put_var_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          nf_int1_t           i1vals(1))
+      external        nf_put_var_int1
+
+      integer         nf_get_var_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          nf_int1_t           i1vals(1))
+      external        nf_get_var_int1
+
+      integer         nf_put_var_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          nf_int2_t           i2vals(1))
+      external        nf_put_var_int2
+
+      integer         nf_get_var_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          nf_int2_t           i2vals(1))
+      external        nf_get_var_int2
+
+      integer         nf_put_var_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             ivals(1))
+      external        nf_put_var_int
+
+      integer         nf_get_var_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             ivals(1))
+      external        nf_get_var_int
+
+      integer         nf_put_var_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          real                rvals(1))
+      external        nf_put_var_real
+
+      integer         nf_get_var_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          real                rvals(1))
+      external        nf_get_var_real
+
+      integer         nf_put_var_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          doubleprecision     dvals(1))
+      external        nf_put_var_double
+
+      integer         nf_get_var_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          doubleprecision     dvals(1))
+      external        nf_get_var_double
+
+!
+! single variable put/get routines:
+!
+
+      integer         nf_put_var1_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          character*1         text)
+      external        nf_put_var1_text
+
+      integer         nf_get_var1_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          character*1         text)
+      external        nf_get_var1_text
+
+      integer         nf_put_var1_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          nf_int1_t           i1val)
+      external        nf_put_var1_int1
+
+      integer         nf_get_var1_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          nf_int1_t           i1val)
+      external        nf_get_var1_int1
+
+      integer         nf_put_var1_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          nf_int2_t           i2val)
+      external        nf_put_var1_int2
+
+      integer         nf_get_var1_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          nf_int2_t           i2val)
+      external        nf_get_var1_int2
+
+      integer         nf_put_var1_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          integer             ival)
+      external        nf_put_var1_int
+
+      integer         nf_get_var1_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          integer             ival)
+      external        nf_get_var1_int
+
+      integer         nf_put_var1_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          real                rval)
+      external        nf_put_var1_real
+
+      integer         nf_get_var1_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          real                rval)
+      external        nf_get_var1_real
+
+      integer         nf_put_var1_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          doubleprecision     dval)
+      external        nf_put_var1_double
+
+      integer         nf_get_var1_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             index(1),
+!                          doubleprecision     dval)
+      external        nf_get_var1_double
+
+!
+! variable array put/get routines:
+!
+
+      integer         nf_put_vara_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          character(*)        text)
+      external        nf_put_vara_text
+
+      integer         nf_get_vara_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          character(*)        text)
+      external        nf_get_vara_text
+
+      integer         nf_put_vara_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          nf_int1_t           i1vals(1))
+      external        nf_put_vara_int1
+
+      integer         nf_get_vara_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          nf_int1_t           i1vals(1))
+      external        nf_get_vara_int1
+
+      integer         nf_put_vara_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          nf_int2_t           i2vals(1))
+      external        nf_put_vara_int2
+
+      integer         nf_get_vara_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          nf_int2_t           i2vals(1))
+      external        nf_get_vara_int2
+
+      integer         nf_put_vara_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             ivals(1))
+      external        nf_put_vara_int
+
+      integer         nf_get_vara_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             ivals(1))
+      external        nf_get_vara_int
+
+      integer         nf_put_vara_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          real                rvals(1))
+      external        nf_put_vara_real
+
+      integer         nf_get_vara_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          real                rvals(1))
+      external        nf_get_vara_real
+
+      integer         nf_put_vara_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          doubleprecision     dvals(1))
+      external        nf_put_vara_double
+
+      integer         nf_get_vara_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          doubleprecision     dvals(1))
+      external        nf_get_vara_double
+
+!
+! strided variable put/get routines:
+!
+
+      integer         nf_put_vars_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          character(*)        text)
+      external        nf_put_vars_text
+
+      integer         nf_get_vars_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          character(*)        text)
+      external        nf_get_vars_text
+
+      integer         nf_put_vars_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          nf_int1_t           i1vals(1))
+      external        nf_put_vars_int1
+
+      integer         nf_get_vars_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          nf_int1_t           i1vals(1))
+      external        nf_get_vars_int1
+
+      integer         nf_put_vars_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          nf_int2_t           i2vals(1))
+      external        nf_put_vars_int2
+
+      integer         nf_get_vars_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          nf_int2_t           i2vals(1))
+      external        nf_get_vars_int2
+
+      integer         nf_put_vars_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             ivals(1))
+      external        nf_put_vars_int
+
+      integer         nf_get_vars_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             ivals(1))
+      external        nf_get_vars_int
+
+      integer         nf_put_vars_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          real                rvals(1))
+      external        nf_put_vars_real
+
+      integer         nf_get_vars_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          real                rvals(1))
+      external        nf_get_vars_real
+
+      integer         nf_put_vars_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          doubleprecision     dvals(1))
+      external        nf_put_vars_double
+
+      integer         nf_get_vars_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          doubleprecision     dvals(1))
+      external        nf_get_vars_double
+
+!
+! mapped variable put/get routines:
+!
+
+      integer         nf_put_varm_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          character(*)        text)
+      external        nf_put_varm_text
+
+      integer         nf_get_varm_text
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          character(*)        text)
+      external        nf_get_varm_text
+
+      integer         nf_put_varm_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          nf_int1_t           i1vals(1))
+      external        nf_put_varm_int1
+
+      integer         nf_get_varm_int1
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          nf_int1_t           i1vals(1))
+      external        nf_get_varm_int1
+
+      integer         nf_put_varm_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          nf_int2_t           i2vals(1))
+      external        nf_put_varm_int2
+
+      integer         nf_get_varm_int2
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          nf_int2_t           i2vals(1))
+      external        nf_get_varm_int2
+
+      integer         nf_put_varm_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          integer             ivals(1))
+      external        nf_put_varm_int
+
+      integer         nf_get_varm_int
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          integer             ivals(1))
+      external        nf_get_varm_int
+
+      integer         nf_put_varm_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          real                rvals(1))
+      external        nf_put_varm_real
+
+      integer         nf_get_varm_real
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          real                rvals(1))
+      external        nf_get_varm_real
+
+      integer         nf_put_varm_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          doubleprecision     dvals(1))
+      external        nf_put_varm_double
+
+      integer         nf_get_varm_double
+!                         (integer             ncid,
+!                          integer             varid,
+!                          integer             start(1),
+!                          integer             count(1),
+!                          integer             stride(1),
+!                          integer             imap(1),
+!                          doubleprecision     dvals(1))
+      external        nf_get_varm_double
+
+
+!     NetCDF-4.
+!     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 rename grp function
+
+      integer nf_rename_grp
+      external nf_rename_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
+
+!     NetCDF-2.
+!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.9692099683868690e+36)
Index: codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf_meta.h
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf_meta.h	(revision 308)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf_meta.h	(revision 308)
@@ -0,0 +1,54 @@
+/*! \file netcdf_meta.h
+ *
+ * Meta information for libnetcdf which can be used by other packages which
+ * depend on libnetcdf.
+ *
+ * This file is automatically generated by the build system
+ * at configure time, and contains information related to
+ * how libnetcdf was built.  It will not be required to
+ * include this file unless you want to probe the capabilities
+ * of libnetcdf. This should ideally only happen when configuring
+ * a project which depends on libnetcdf.  At configure time,
+ * the dependant project can set its own macros which can be used
+ * in conditionals.
+ *
+ * Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ * 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
+ * University Corporation for Atmospheric Research/Unidata.
+ * See \ref copyright file for more info.
+ */
+
+#ifndef NETCDF_META_H
+#define NETCDF_META_H
+
+#define NC_VERSION_MAJOR 4 /*!< netcdf-c major version. */
+#define NC_VERSION_MINOR 3 /*!< netcdf-c minor version. */
+#define NC_VERSION_PATCH 3 /*!< netcdf-c patch version. */
+#define NC_VERSION_NOTE  "-rc2" /*!< netcdf-c note. May be blank. */
+
+/*! netcdf-c version string.
+ *
+ * The format of the netcdf-c version string is as follows:
+ * \code
+ * NC_VERSION_MAJOR.NC_VERSION_MINOR.NC_VERSION_PATCH.NC_VERSION_NOTE
+ * \endcode
+ * Note that the trailing NC_VERSION_NOTE may be empty. It serves for
+ * identifiers such as '-rc1', etc.
+ */
+#define NC_VERSION       "4.3.3-rc2"
+
+#define NC_HAS_NC2       1       /*!< API version 2 support. */
+#define NC_HAS_NC4       1       /*!< API version 4 support. */
+#define NC_HAS_HDF4      0      /*!< hdf4 support. */
+#define NC_HAS_HDF5      1      /*!< hdf5 support. */
+#define NC_HAS_SZIP      0      /*!< szip support (hdf5 only) */
+#define NC_HAS_DAP       0       /*!< DAP support. */
+#define NC_HAS_DISKLESS  1  /*!< diskless support. */
+#define NC_HAS_MMAP      0      /*!< mmap support. */
+#define NC_HAS_JNA       0       /*!< jna support. */
+#define NC_HAS_PNETCDF   0   /*!< pnetcdf support. */
+#define NC_HAS_PARALLEL  1  /*!< parallel IO support via hdf5. */
+
+
+
+#endif
Index: codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf_par.h
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf_par.h	(revision 308)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/include/netcdf_par.h	(revision 308)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2010 University Corporation for Atmospheric
+ * Research/Unidata. See COPYRIGHT file for more info.
+ *
+ * This header file is for the parallel I/O functions of netCDF.
+ * 
+ */
+/* "$Id: netcdf_par.h,v 1.1 2010/06/01 15:46:49 ed Exp $" */
+
+#ifndef NETCDF_PAR_H
+#define NETCDF_PAR_H 1
+
+#include <mpi.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+/* Use these with nc_var_par_access(). */
+#define NC_INDEPENDENT 0
+#define NC_COLLECTIVE 1
+
+/* Create a file and enable parallel I/O. */
+extern int
+nc_create_par(const char *path, int cmode, MPI_Comm comm, MPI_Info info,
+	      int *ncidp);
+
+/* Open a file and enable parallel I/O. */
+extern int
+nc_open_par(const char *path, int mode, MPI_Comm comm, MPI_Info info,
+	    int *ncidp);
+
+/* Change a variable from independent (the default) to collective
+ * access. */
+extern int
+nc_var_par_access(int ncid, int varid, int par_access);
+
+extern int
+nc_create_par_fortran(const char *path, int cmode, int comm, 
+		      int info, int *ncidp);
+extern int
+nc_open_par_fortran(const char *path, int mode, int comm, 
+		    int info, int *ncidp);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* NETCDF_PAR_H */
Index: codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/lib/libnetcdf.settings
===================================================================
--- codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/lib/libnetcdf.settings	(revision 308)
+++ codes/icosagcm/branches/SATURN_DYNAMICO/NETCDF4/lib/libnetcdf.settings	(revision 308)
@@ -0,0 +1,36 @@
+# NetCDF C Configuration Summary
+==============================
+
+# General
+-------
+NetCDF Version:		4.3.3-rc2
+Configured On:		Mon Dec  8 14:32:11 CET 2014
+Host System:		x86_64-unknown-linux-gnu
+Build Directory: 	/scratch/cnt0004/gdo1419/ymeurd/SATURN_DYNAMICO_OCCIGEN/NETCDF4/netcdf-c-4.3.3-rc2
+Install Prefix:         /scratch/cnt0004/gdo1419/ymeurd/SATURN_DYNAMICO_OCCIGEN/NETCDF4/netcdf-c-4.3.3-rc2/..
+
+# Compiling Options
+-----------------
+C Compiler:		/opt/software/bullmpi/1.2.8.1/bin/mpicc
+CFLAGS:			-g -O2
+CPPFLAGS:		-I/opt/software/libraries/hdf5/hdf51.8.14/include -DpgiFortran
+LDFLAGS:		-L/opt/software/libraries/hdf5/hdf51.8.14/lib
+AM_CFLAGS:		
+AM_CPPFLAGS:		
+AM_LDFLAGS:		
+Shared Library:		no
+Static Library:		yes
+Extra libraries:	-lhdf5_hl -lhdf5 -ldl -lm -lz 
+
+# Features
+--------
+NetCDF-2 API:		yes
+NetCDF-4 API:		yes
+HDF4 Support:		no
+HDF5 Support:		yes
+PNetCDF Support:	no
+Parallel Support:	yes
+DAP Support:		no
+Diskless Support:	yes
+MMap Support:		no
+JNA Support:		no
