#include "netcdf.h"
#include "nfconfig.inc"
#include "ncfortran.h"
#include "fort-lib.h"


/*
 * Write values from a FORTRAN CHARACTER*(*) variable.
 */
FCALLSCFUN7(INT, nc_put_varm_text, NF_PUT_VARM_TEXT, nf_put_varm_text,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, CBUF)


/*
 * Read values into a FORTRAN CHARACTER*(*) variable.
 */
FCALLSCFUN7(INT, nc_get_varm_text, NF_GET_VARM_TEXT, nf_get_varm_text,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, CBUF)


/*
 * Write values from a FORTRAN INTEGER*1 variable array.
 */
#if NF_INT1_IS_C_SIGNED_CHAR
FCALLSCFUN7(INT, nc_put_varm_schar, NF_PUT_VARM_INT1, nf_put_varm_int1,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT1VARV)
#elif NF_INT1_IS_C_SHORT
FCALLSCFUN7(INT, nc_put_varm_short, NF_PUT_VARM_INT1, nf_put_varm_int1,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT2VARV)
#elif NF_INT1_IS_C_INT
FCALLSCFUN7(INT, nc_put_varm_int, NF_PUT_VARM_INT1, nf_put_varm_int1,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INTVARV)
#endif


/*
 * Read values into a FORTRAN INTEGER*1 variable array.
 */
#if NF_INT1_IS_C_SIGNED_CHAR
FCALLSCFUN7(INT, nc_get_varm_schar, NF_GET_VARM_INT1, nf_get_varm_int1,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT1VARV)
#elif NF_INT1_IS_C_SHORT
FCALLSCFUN7(INT, nc_get_varm_short, NF_GET_VARM_INT1, nf_get_varm_int1,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT2VARV)
#elif NF_INT1_IS_C_INT
FCALLSCFUN7(INT, nc_get_varm_int, NF_GET_VARM_INT1, nf_get_varm_int1,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
#endif


/*
 * Write values from a FORTRAN INTEGER*2 variable array.
 */
#if NF_INT2_IS_C_SHORT
FCALLSCFUN7(INT, nc_put_varm_short, NF_PUT_VARM_INT2, nf_put_varm_int2,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INT2VARV)
#elif NF_INT2_IS_C_INT
FCALLSCFUN7(INT, nc_put_varm_int, NF_PUT_VARM_INT2, nf_put_varm_int2,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INTVARV)
#endif


/*
 * Read values into a FORTRAN INTEGER*2 variable array.
 */
#if NF_INT2_IS_C_SHORT
FCALLSCFUN7(INT, nc_get_varm_short, NF_GET_VARM_INT2, nf_get_varm_int2,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINT2VARV)
#elif NF_INT2_IS_C_INT
FCALLSCFUN7(INT, nc_get_varm_int, NF_GET_VARM_INT2, nf_get_varm_int2,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)
#endif


/*
 * Write values from a FORTRAN INTEGER variable array.
 */
FCALLSCFUN7(INT, nc_put_varm_int, NF_PUT_VARM_INT, nf_put_varm_int,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, INTVARV)


/*
 * Read values into a FORTRAN INTEGER variable array.
 */
FCALLSCFUN7(INT, nc_get_varm_int, NF_GET_VARM_INT, nf_get_varm_int,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PINTVARV)


/*
 * Write values from a FORTRAN REAL variable array.
 */
#if NF_REAL_IS_C_DOUBLE
FCALLSCFUN7(INT, nc_put_varm_double, NF_PUT_VARM_REAL, nf_put_varm_real,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, DOUBLEVARV)
#else
FCALLSCFUN7(INT, nc_put_varm_float, NF_PUT_VARM_REAL, nf_put_varm_real,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, REALVARV)
#endif


/*
 * Read values into a FORTRAN REAL variable array.
 */
#if NF_REAL_IS_C_DOUBLE
FCALLSCFUN7(INT, nc_get_varm_double, NF_GET_VARM_REAL, nf_get_varm_real,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PDOUBLEVARV)
#else
FCALLSCFUN7(INT, nc_get_varm_float, NF_GET_VARM_REAL, nf_get_varm_real,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PREALVARV)
#endif


/*
 * Write values from a FORTRAN DOUBLEPRECISION variable array.
 */
FCALLSCFUN7(INT, nc_put_varm_double, NF_PUT_VARM_DOUBLE, nf_put_varm_double,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, DOUBLEVARV)


/*
 * Read values into a FORTRAN DOUBLEPRECISION variable array.
 */
FCALLSCFUN7(INT, nc_get_varm_double, NF_GET_VARM_DOUBLE, nf_get_varm_double,
	    NCID, VARID, COORDS, COUNTS, STRIDES, MAPS, PDOUBLEVARV)
