fort-vario.c
Go to the documentation of this file.
/*
This file is part of the netCDF Fortran 77 API.
This file handles the netCDF var functions.
Copyright 2006, University Corporation for Atmospheric Research. See
the COPYRIGHT file for copying and redistribution conditions.
$Id: fort-vario.c,v 1.15 2008/03/21 15:49:16 dmh Exp $
*/
#include <config.h>
#include "netcdf.h"
#include "nfconfig.inc"
#include "ncfortran.h"
#include "fort-lib.h"
/*
* Write an entire variable from a FORTRAN CHARACTER*(*) variable.
*/
FCALLSCFUN3(NF_INT, nc_put_var_text, NF_PUT_VAR_TEXT, nf_put_var_text,
NCID, VARID, CBUF)
/*
* Read an entire variable into a FORTRAN CHARACTER*(*) variable.
*/
FCALLSCFUN3(NF_INT, nc_get_var_text, NF_GET_VAR_TEXT, nf_get_var_text,
NCID, VARID, CBUF)
/*
* Write an entire variable from a FORTRAN INTEGER*1 variable.
*/
#if NF_INT1_IS_C_SIGNED_CHAR
FCALLSCFUN3(NF_INT, nc_put_var_schar, NF_PUT_VAR_INT1, nf_put_var_int1,
NCID, VARID, INT1VAR)
#elif NF_INT1_IS_C_SHORT
FCALLSCFUN3(NF_INT, nc_put_var_short, NF_PUT_VAR_INT1, nf_put_var_int1,
NCID, VARID, INT1VAR)
#elif NF_INT1_IS_C_INT
FCALLSCFUN3(NF_INT, nc_put_var_int, NF_PUT_VAR_INT1, nf_put_var_int1,
NCID, VARID, INT1VAR)
#elif NF_INT1_IS_C_LONG
FCALLSCFUN3(NF_INT, nc_put_var_long, NF_PUT_VAR_INT1, nf_put_var_int1,
NCID, VARID, INT1VAR)
#endif
/*
* Read an entire variable into a FORTRAN INTEGER*1 variable.
*/
#if NF_INT1_IS_C_SIGNED_CHAR
FCALLSCFUN3(NF_INT, nc_get_var_schar, NF_GET_VAR_INT1, nf_get_var_int1,
NCID, VARID, PINT1VAR)
#elif NF_INT1_IS_C_SHORT
FCALLSCFUN3(NF_INT, nc_get_var_short, NF_GET_VAR_INT1, nf_get_var_int1,
NCID, VARID, PINT1VAR)
#elif NF_INT1_IS_C_INT
FCALLSCFUN3(NF_INT, nc_get_var_int, NF_GET_VAR_INT1, nf_get_var_int1,
NCID, VARID, PINT1VAR)
#elif NF_INT1_IS_C_LONG
FCALLSCFUN3(NF_INT, nc_get_var_long, NF_GET_VAR_INT1, nf_get_var_int1,
NCID, VARID, PINT1VAR)
#endif
/*
* Write an entire variable from a FORTRAN INTEGER*2 variable.
*/
#if NF_INT2_IS_C_SHORT
FCALLSCFUN3(NF_INT, nc_put_var_short, NF_PUT_VAR_INT2, nf_put_var_int2,
NCID, VARID, INT2VAR)
#elif NF_INT2_IS_C_INT
FCALLSCFUN3(NF_INT, nc_put_var_int, NF_PUT_VAR_INT2, nf_put_var_int2,
NCID, VARID, INT2VAR)
#elif NF_INT2_IS_C_LONG
FCALLSCFUN3(NF_INT, nc_put_var_long, NF_PUT_VAR_INT2, nf_put_var_int2,
NCID, VARID, INT2VAR)
#endif
/*
* Read an entire variable into a FORTRAN INTEGER*2 variable.
*/
#if NF_INT2_IS_C_SHORT
FCALLSCFUN3(NF_INT, nc_get_var_short, NF_GET_VAR_INT2, nf_get_var_int2,
NCID, VARID, PINT2VAR)
#elif NF_INT2_IS_C_INT
FCALLSCFUN3(NF_INT, nc_get_var_int, NF_GET_VAR_INT2, nf_get_var_int2,
NCID, VARID, PINT2VAR)
#elif NF_INT2_IS_C_LONG
FCALLSCFUN3(NF_INT, nc_get_var_long, NF_GET_VAR_INT2, nf_get_var_int2,
NCID, VARID, PINT2VAR)
#endif
/*
* Write an entire variable from a FORTRAN INTEGER variable.
*/
#if NF_INT_IS_C_INT
FCALLSCFUN3(NF_INT, nc_put_var_int, NF_PUT_VAR_INT, nf_put_var_int,
NCID, VARID, INTVAR)
#elif NF_INT_IS_C_LONG
FCALLSCFUN3(NF_INT, nc_put_var_long, NF_PUT_VAR_INT, nf_put_var_int,
NCID, VARID, INTVAR)
#endif
/*
* Read an entire variable into a FORTRAN INTEGER variable.
*/
#if NF_INT_IS_C_INT
FCALLSCFUN3(NF_INT, nc_get_var_int, NF_GET_VAR_INT, nf_get_var_int,
NCID, VARID, PINTVAR)
#elif NF_INT_IS_C_LONG
FCALLSCFUN3(NF_INT, nc_get_var_long, NF_GET_VAR_INT, nf_get_var_int,
NCID, VARID, PINTVAR)
#endif
/*
* Write an entire variable from a FORTRAN REAL variable.
*/
#if NF_REAL_IS_C_DOUBLE
FCALLSCFUN3(NF_INT, nc_put_var_double, NF_PUT_VAR_REAL, nf_put_var_real,
NCID, VARID, DOUBLEVAR)
#else
FCALLSCFUN3(NF_INT, nc_put_var_float, NF_PUT_VAR_REAL, nf_put_var_real,
NCID, VARID, REALVAR)
#endif
/*
* Read an entire variable into a FORTRAN REAL variable.
*/
#if NF_REAL_IS_C_DOUBLE
FCALLSCFUN3(NF_INT, nc_get_var_double, NF_GET_VAR_REAL, nf_get_var_real,
NCID, VARID, PDOUBLEVAR)
#else
FCALLSCFUN3(NF_INT, nc_get_var_float, NF_GET_VAR_REAL, nf_get_var_real,
NCID, VARID, PREALVAR)
#endif
/*
* Write an entire variable from a FORTRAN DOUBLEPRECISION variable.
*/
FCALLSCFUN3(NF_INT, nc_put_var_double, NF_PUT_VAR_DOUBLE, nf_put_var_double,
NCID, VARID, DOUBLEVAR)
/*
* Read an entire variable into a FORTRAN DOUBLEPRECISION variable.
*/
FCALLSCFUN3(NF_INT, nc_get_var_double, NF_GET_VAR_DOUBLE, nf_get_var_double,
NCID, VARID, PDOUBLEVAR)
/* Apparently only defined for netcdf-4 */
#ifdef USE_NETCDF4
/* Handle any type. */
FCALLSCFUN3(NF_INT, nc_put_var, NF_PUT_VAR, nf_put_var, NCID, VARID, PVOID)
/* Handle any type. */
FCALLSCFUN3(NF_INT, nc_get_var, NF_GET_VAR, nf_get_var, NCID, VARID, PVOID)
#endif
nf_put_var_int2
integer function nf_put_var_int2(ncid, varid, i2vals)
Definition: nf_vario.F90:119
nf_put_var_real
integer function nf_put_var_real(ncid, varid, rvals)
Definition: nf_vario.F90:182
nf_put_var_text
integer function nf_put_var_text(ncid, varid, text)
Definition: nf_vario.F90:34
nf_put_var_int1
integer function nf_put_var_int1(ncid, varid, i1vals)
Definition: nf_vario.F90:82
nf_put_var_int
integer function nf_put_var_int(ncid, varid, ivals)
Definition: nf_vario.F90:154
nf_get_var_int2
integer function nf_get_var_int2(ncid, varid, i2vals)
Definition: nf_vario.F90:320
nf_get_var_real
integer function nf_get_var_real(ncid, varid, rvals)
Definition: nf_vario.F90:383
nf_get_var_double
integer function nf_get_var_double(ncid, varid, dvals)
Definition: nf_vario.F90:411
nf_put_var
integer function nf_put_var(ncid, varid, values)
Definition: nf_nc4.f90:2026
NF_INT
#define NF_INT
Definition: ncfortran.h:19
ncfortran.h
nf_get_var_int
integer function nf_get_var_int(ncid, varid, ivals)
Definition: nf_vario.F90:355
nf_get_var_text
integer function nf_get_var_text(ncid, varid, text)
Definition: nf_vario.F90:234
FCALLSCFUN3
#define FCALLSCFUN3(T0, CN, UN, LN, T1, T2, T3)
Definition: cfortran.h:2419
nf_get_var
integer function nf_get_var(ncid, varid, values)
Definition: nf_nc4.f90:2056
nf_get_var_int1
integer function nf_get_var_int1(ncid, varid, i1vals)
Definition: nf_vario.F90:283
fort-lib.h
nf_put_var_double
integer function nf_put_var_double(ncid, varid, dvals)
Definition: nf_vario.F90:210

Return to the Main Unidata NetCDF page.