00001 /* $Id: fort-lib.h,v 1.4 1997/12/10 16:12:24 steve Exp $ */ 00002 00003 00004 #ifndef UD_FORT_LIB_H 00005 #define UD_FORT_LIB_H 00006 00007 00008 #include <stddef.h> /* for ptrdiff_t, size_t */ 00009 #include "ncfortran.h" 00010 00011 00012 /* 00013 * PURPOSE: Convert a C dimension-ID vector into a FORTRAN dimension-ID 00014 * vector 00015 * REQUIRE: <ncid> is valid && <varid> is valid && <cdimids> != NULL && 00016 * <fdimids> != NULL && <cdimids> != <fdimids> 00017 * PROMISE: The order of the dimensions will be reversed and 1 will be 00018 * added to each element. RESULT == <fdimids> 00019 */ 00020 extern NF_INTEGER* 00021 c2f_dimids(int ncid, /* netCDF dataset ID */ 00022 int varid, /* netCDF variable ID */ 00023 const int* cdimids, /* C dim IDs */ 00024 NF_INTEGER* fdimids); /* FORTRAN dim IDs */ 00025 00026 00027 /* 00028 * PURPOSE: Convert a FORTRAN dimension-ID vector into a C dimension-ID 00029 * vector 00030 * REQUIRE: <ndims> == 0 || (<ndims> >= 0 && <fdimids> != NULL && 00031 * <cdimids> != NULL && <fdimids> != <cdimids>) 00032 * PROMISE: The order of the dimensions will be reversed and 1 will be 00033 * subtracted from each element. RESULT == <cdimids> 00034 */ 00035 extern int* 00036 f2c_dimids(int ndims, /* number of dims */ 00037 const NF_INTEGER* fdimids, /* FORTRAN dim IDs */ 00038 int* cdimids); /* C dim IDs */ 00039 00040 /* 00041 * PURPOSE: Convert a FORTRAN co-ordinate vector into a C co-ordinate vector 00042 * REQUIRE: <ncid> refers to an open dataset && <varid> refers to an 00043 * existing variable && <fcoords> != NULL && <ccoords> != NULL && 00044 * <fcoords> != <ccoords> 00045 * PROMISE: The order of the co-ordinates will be reversed and 1 will be 00046 * subtracted from each element. RESULT == <ccoords>. 00047 */ 00048 extern size_t* 00049 f2c_coords(int ncid, /* dataset ID */ 00050 int varid, /* variable ID */ 00051 const NF_INTEGER* fcoords, /* FORTRAN coords */ 00052 size_t* ccoords); /* C coords */ 00053 00054 /* 00055 * PURPOSE: Convert a FORTRAN edge-count vector into a C edge-count vector 00056 * REQUIRE: <ncid> refers to an open dataset && <varid> refers to an 00057 * existing variable && <fcounts> != NULL && <ccounts> != NULL && 00058 * <fcounts> != <ccounts> && <fcounts> != <ccounts> 00059 * PROMISE: The order of the edge-counts will be reversed. 00060 * RESULT == <ccounts>. 00061 */ 00062 extern size_t* 00063 f2c_counts(int ncid, /* dataset ID */ 00064 int varid, /* variable ID */ 00065 const NF_INTEGER* fcounts, /* FORTRAN counts */ 00066 size_t* ccounts); /* C counts */ 00067 00068 /* 00069 * PURPOSE: Convert a FORTRAN stride vector into a C stride vector 00070 * REQUIRE: <ncid> refers to an open dataset && <varid> refers to an 00071 * existing variable && <fstrides> != NULL && <cstrides> != NULL && 00072 * <fstrides> != <cstrides> 00073 * PROMISE: The order of the strides will be reversed. RESULT == <cstrides>. 00074 */ 00075 extern ptrdiff_t* 00076 f2c_strides(int ncid, /* dataset ID */ 00077 int varid, /* variable ID */ 00078 const NF_INTEGER* fstrides, /* FORTRAN strides */ 00079 ptrdiff_t* cstrides); /* C strides */ 00080 00081 /* 00082 * PURPOSE: Convert a FORTRAN mapping vector into a C mapping vector 00083 * REQUIRE: <ncid> refers to an open dataset && <varid> refers to an 00084 * existing variable && <fmaps> != NULL && <cmaps> != NULL && 00085 * <fmaps> != <cmaps> 00086 * PROMISE: The order of the mapping vector will be reversed. 00087 * RESULT == <cmaps>. 00088 */ 00089 extern ptrdiff_t* 00090 f2c_maps(int ncid, /* dataset ID */ 00091 int varid, /* variable ID */ 00092 const NF_INTEGER* fmaps, /* FORTRAN mapping */ 00093 ptrdiff_t* cmaps); /* C mapping */ 00094 00095 00096 #endif /* header-file lockout */
1.4.4