/* This is part of the netCDF package. Copyright 2011 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. Includes prototypes for some functions used to translate parameters between C and Fortran. */ #ifndef UD_FORT_LIB_H #define UD_FORT_LIB_H #include /* for ptrdiff_t, size_t */ #include "ncfortran.h" #include /* * PURPOSE: Convert a C dimension-ID vector into a FORTRAN dimension-ID * vector * REQUIRE: is valid && is valid && != NULL && * != NULL && != * PROMISE: The order of the dimensions will be reversed and 1 will be * added to each element. RESULT == */ EXTERNL NF_INTEGER * c2f_dimids(int ncid, /* netCDF dataset ID */ int varid, /* netCDF variable ID */ const int *cdimids, /* C dim IDs */ NF_INTEGER *fdimids); /* FORTRAN dim IDs */ /* * PURPOSE: Convert a FORTRAN dimension-ID vector into a C dimension-ID * vector * REQUIRE: == 0 || ( >= 0 && != NULL && * != NULL && != ) * PROMISE: The order of the dimensions will be reversed and 1 will be * subtracted from each element. RESULT == */ EXTERNL int * f2c_dimids(int ndims, /* number of dims */ const NF_INTEGER *fdimids, /* FORTRAN dim IDs */ int *cdimids); /* C dim IDs */ /* These two are the same as the dimids, but for chunksizes, so that 1 * is not added/subtracted. */ EXTERNL NF_INTEGER * c2f_chunksizes(int ncid, int varid, const int* cchunksizes, NF_INTEGER *fchunksizes); EXTERNL int * f2c_chunksizes(int ncid, int varid, const NF_INTEGER *fchunksizes, int *cchunksizes); /* * PURPOSE: Convert a FORTRAN co-ordinate vector into a C co-ordinate vector * REQUIRE: refers to an open dataset && refers to an * existing variable && != NULL && != NULL && * != * PROMISE: The order of the co-ordinates will be reversed and 1 will be * subtracted from each element. RESULT == . */ EXTERNL size_t * f2c_coords(int ncid, /* dataset ID */ int varid, /* variable ID */ const NF_INTEGER *fcoords, /* FORTRAN coords */ size_t *ccoords); /* C coords */ /* * PURPOSE: Convert a FORTRAN edge-count vector into a C edge-count vector * REQUIRE: refers to an open dataset && refers to an * existing variable && != NULL && != NULL && * != && != * PROMISE: The order of the edge-counts will be reversed. * RESULT == . */ EXTERNL size_t * f2c_counts(int ncid, /* dataset ID */ int varid, /* variable ID */ const NF_INTEGER* fcounts, /* FORTRAN counts */ size_t* ccounts); /* C counts */ /* * PURPOSE: Convert a FORTRAN stride vector into a C stride vector * REQUIRE: refers to an open dataset && refers to an * existing variable && != NULL && != NULL && * != * PROMISE: The order of the strides will be reversed. RESULT == . */ EXTERNL ptrdiff_t * f2c_strides(int ncid, /* dataset ID */ int varid, /* variable ID */ const NF_INTEGER *fstrides, /* FORTRAN strides */ ptrdiff_t *cstrides); /* C strides */ /* * PURPOSE: Convert a FORTRAN mapping vector into a C mapping vector * REQUIRE: refers to an open dataset && refers to an * existing variable && != NULL && != NULL && * != * PROMISE: The order of the mapping vector will be reversed. * RESULT == . */ EXTERNL ptrdiff_t * f2c_maps(int ncid, /* dataset ID */ int varid, /* variable ID */ const NF_INTEGER *fmaps, /* FORTRAN mapping */ ptrdiff_t *cmaps); /* C mapping */ #endif /* header-file lockout */