ncdf4a13/fortran/ncfortran.h

Go to the documentation of this file.
00001 /* $Id: ncfortran.h,v 1.20 2005/05/02 22:40:26 russ Exp $ */
00002 
00003 /*
00004  * This file contains `cfortran.h' definitions that are specific to the
00005  * netCDF-3 package.
00006  */
00007 
00008 
00009 #ifndef UD_NCFORTRAN_H
00010 #define UD_NCFORTRAN_H
00011 
00012 
00013 #include "cfortran.h"
00014 #include "nfconfig.inc"
00015 
00016 
00017 /*
00018  * The type of a Fortran INTEGER:
00019  */
00020 #if NF_INT_IS_C_INT
00021 #   define      NF_INTEGER      int
00022 #   define      NF_INT          INT
00023 #elif NF_INT_IS_C_LONG
00024 #   define      NF_INTEGER      long
00025 #   define      NF_INT          LONG
00026 #else
00027 #   include "NF_INT_IS_C_... not defined"
00028 #endif
00029 
00030 /*
00031  * Input, Fortran INTEGER converted to C "int" (helper macro):
00032  */
00033 #define FINT2CINT_cfINT(N,A,B,X,Y,Z)    SIMPLE_cfINT(N,A,B,X,Y,Z)
00034 #define FINT2CINT_cfSEP(T,  B)          SIMPLE_cfSEP(T,B)
00035 #define FINT2CINT_cfN(  T,A)            const NF_INTEGER *A
00036 #define FINT2CINT_cfSTR(N,T,A,B,C,D,E)  SIMPLE_cfSTR(N,T,A,B,C,D,E)
00037 #define FINT2CINT_cfT(M,I,A,B,D)        (int)*A
00038 
00039 
00040 /*
00041  * Input, Fortran INTEGER converted to C "size_t":
00042  */
00043 #define FINT2CSIZET_cfINT(N,A,B,X,Y,Z)          SIMPLE_cfINT(N,A,B,X,Y,Z)
00044 #define FINT2CSIZET_cfSEP(T,  B)                SIMPLE_cfSEP(T,B)
00045 #define FINT2CSIZET_cfN(  T,A)                  const NF_INTEGER *A
00046 #define FINT2CSIZET_cfSTR(N,T,A,B,C,D,E)        SIMPLE_cfSTR(N,T,A,B,C,D,E)
00047 #define FINT2CSIZET_cfT(M,I,A,B,D)              (size_t)*A
00048 
00049 
00050 /*
00051  * Input/Output, I/O size hint:
00052  */
00053 #define PCHUNKSIZEHINT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
00054 #define PCHUNKSIZEHINT_cfTYPE           NF_INTEGER
00055 #define PCHUNKSIZEHINT_cfSTR(N,T,A,B,C,D,E)     \
00056                                         _(CFARGS,N)(T,PCHUNKSIZEHINT,A,B,C,D,E)
00057 #define PCHUNKSIZEHINT_cfH(S,U,B)
00058 #define PCHUNKSIZEHINT_cfQ(B)           size_t B;
00059 #define PCHUNKSIZEHINT_cfT(M,I,A,B,D)   ((void*)(B=*A), &B)
00060 #define PCHUNKSIZEHINT_cfR(A,B,D)       *A=B;
00061 
00062 
00063 /*
00064  * Output, C "int" converted to Fortran INTEGER (helper macro):
00065  */
00066 #define PCINT2FINT_cfINT(N,A,B,X,Y,Z)   PDOUBLE_cfINT(N,A,B,X,Y,Z)
00067 #define PCINT2FINT_cfTYPE               NF_INTEGER
00068 #define PCINT2FINT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PCINT2FINT,A,B,C,D,E)
00069 #define PCINT2FINT_cfH(S,U,B)
00070 #define PCINT2FINT_cfQ(B)               int B;
00071 #define PCINT2FINT_cfT(M,I,A,B,D)       &B
00072 #define PCINT2FINT_cfR(A,B,D)           *A=B;
00073 
00074 
00075 /*
00076  * Input, Fortran index converted to C index:
00077  */
00078 #define FNDX2CNDX_cfINT(N,A,B,X,Y,Z)    SIMPLE_cfINT(N,A,B,X,Y,Z)
00079 #define FNDX2CNDX_cfSEP(T,  B)          SIMPLE_cfSEP(T,B)
00080 #define FNDX2CNDX_cfN(  T,A)            const NF_INTEGER *A
00081 #define FNDX2CNDX_cfSTR(N,T,A,B,C,D,E)  SIMPLE_cfSTR(N,T,A,B,C,D,E)
00082 #define FNDX2CNDX_cfT(M,I,A,B,D)        (*A-1)
00083 
00084 
00085 /*
00086  * Output, C index converted to Fortran index:
00087  */
00088 #define PCNDX2FNDX_cfINT(N,A,B,X,Y,Z)   PDOUBLE_cfINT(N,A,B,X,Y,Z)
00089 #define PCNDX2FNDX_cfTYPE               NF_INTEGER
00090 #define PCNDX2FNDX_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PCNDX2FNDX,A,B,C,D,E)
00091 #define PCNDX2FNDX_cfH(S,U,B)
00092 #define PCNDX2FNDX_cfQ(B)               int B;
00093 #define PCNDX2FNDX_cfT(M,I,A,B,D)       &B
00094 #define PCNDX2FNDX_cfR(A,B,D)           *A=B+1;
00095 
00096 
00097 /*******************************************************************************
00098  * Character buffer:
00099  */
00100 
00101 #define CBUF_cfINT(N,A,B,X,Y,Z)         STRING_cfINT(N,A,B,X,Y,Z)
00102 #define CBUF_cfSEP(T,  B)               STRING_cfSEP(T,B)
00103 #define CBUF_cfN(  T,A)                 STRING_cfN(T,A)
00104 #define CBUF_cfSTR(N,T,A,B,C,D,E)       STRING_cfSTR(N,T,A,B,C,D,E)
00105 #if defined(vmsFortran)
00106 #   define CBUF_cfT(M,I,A,B,D)          A->dsc$a_pointer
00107 #elif defined(CRAYFortran)
00108 #   define CBUF_cfT(M,I,A,B,D)          _fcdtocp(A)
00109 #else
00110 #   define CBUF_cfT(M,I,A,B,D)          A
00111 #endif
00112 
00113 
00114 /*******************************************************************************
00115  * netCDf attributes:
00116  */
00117 
00118 #define TEXTATT                 STRING
00119 #define PTEXTATT                PSTRING
00120 
00121 #define INT1ATT                 INT1VARV
00122 #define PINT1ATT                PINT1VARV
00123 
00124 #define INT2ATT                 INT2VARV
00125 #define PINT2ATT                PINT2VARV
00126 
00127 #define INTATT                  INTVARV
00128 #define PINTATT                 PINTVARV
00129 
00130 #define REALATT                 REALVARV
00131 #define PREALATT                PREALVARV
00132 
00133 #define DOUBLEATT               DOUBLEVARV
00134 #define PDOUBLEATT              PDOUBLEVARV
00135 
00136 
00137 /*
00138  * Input, attribute ID:
00139  */
00140 #define ATTID   FNDX2CNDX
00141 
00142 
00143 /*
00144  * Output, attribute ID:
00145  */
00146 #define PATTID  PCNDX2FNDX
00147 
00148 
00149 /*******************************************************************************
00150  * netCDf type:
00151  */
00152 
00153 
00154 /*
00155  * Input, netCDF type:
00156  */
00157 #define TYPE_cfINT(N,A,B,X,Y,Z)         SIMPLE_cfINT(N,A,B,X,Y,Z)
00158 #define TYPE_cfSEP(T,  B)               SIMPLE_cfSEP(T,B)
00159 #define TYPE_cfN(  T,A)                 NF_INTEGER *A
00160 #define TYPE_cfSTR(N,T,A,B,C,D,E)       SIMPLE_cfSTR(N,T,A,B,C,D,E)
00161 #define TYPE_cfT(M,I,A,B,D)             ((nc_type)*A)
00162 
00163 
00164 /*
00165  * Output, netCDF type:
00166  */
00167 #define PTYPE_cfINT(N,A,B,X,Y,Z)        PDOUBLE_cfINT(N,A,B,X,Y,Z)
00168 #define PTYPE_cfTYPE                    NF_INTEGER
00169 #define PTYPE_cfSTR(N,T,A,B,C,D,E)      _(CFARGS,N)(T,PTYPE,A,B,C,D,E)
00170 #define PTYPE_cfH(S,U,B)
00171 #define PTYPE_cfQ(B)                    nc_type B;
00172 #define PTYPE_cfT(M,I,A,B,D)            &B
00173 #define PTYPE_cfR(A,B,D)                *A=B;
00174 
00175 
00176 /*******************************************************************************
00177  * netCDf number-of-<whatever>:
00178  */
00179 
00180 
00181 /*
00182  * Input, number-of-dimensions:
00183  */
00184 #define NDIMS_cfINT(N,A,B,X,Y,Z)        SIMPLE_cfINT(N,A,B,X,Y,Z)
00185 #define NDIMS_cfSEP(T,  B)              SIMPLE_cfSEP(T,B)
00186 #define NDIMS_cfN(  T,A)                NF_INTEGER *fndims
00187 #define NDIMS_cfSTR(N,T,A,B,C,D,E)      SIMPLE_cfSTR(N,T,A,B,C,D,E)
00188 #define NDIMS_cfT(M,I,A,B,D)            ((int)*fndims)
00189 
00190 
00191 /*
00192  * Output number-of-dimensions:
00193  */
00194 #define PNDIMS  PCINT2FINT
00195 
00196 
00197 /*
00198  * Input number-of-variables:
00199  */
00200 #define NVARS   FINT2CINT
00201 
00202 
00203 /*
00204  * Output number-of-variables:
00205  */
00206 #define PNVARS  PNDIMS
00207 
00208 
00209 /*
00210  * Input number-of-attributes:
00211  */
00212 #define NATTS   FINT2CINT
00213 
00214 
00215 /*
00216  * Output number-of-attributes:
00217  */
00218 #define PNATTS  PNDIMS
00219 
00220 /*
00221  * Output format version number
00222  */
00223 #define PFORMAT  PNDIMS
00224 
00225 
00226 /*******************************************************************************
00227  * netCDf variables:
00228  */
00229 
00230 
00231 /*
00232  * Input, CHARACTER*(*) variable:
00233  */
00234 #define TEXTVAR                 STRING
00235 
00236 
00237 /*
00238  * Output, CHARACTER*(*) variable:
00239  */
00240 #define PTEXTVAR                PSTRING
00241 
00242 
00243 /*
00244  * Input, CHARACTER*(*) variable array:
00245  */
00246 #define TEXTVARV                STRING
00247 
00248 
00249 /*
00250  * Output, CHARACTER*(*) variable array:
00251  */
00252 #define PTEXTVARV               PSTRING
00253 
00254 
00255 /*
00256  * Input, INTEGER*1 variable:
00257  */
00258 #define INT1VAR_cfINT(N,A,B,X,Y,Z)      SIMPLE_cfINT(N,A,B,X,Y,Z)
00259 #define INT1VAR_cfSEP(T,  B)            SIMPLE_cfSEP(T,B)
00260 #if NF_INT1_IS_C_SIGNED_CHAR
00261 #   define INT1VAR_cfN(  T,A)           const signed char *A
00262 #elif NF_INT1_IS_C_SHORT
00263 #   define INT1VAR_cfN(  T,A)           const short *A
00264 #elif NF_INT1_IS_C_INT
00265 #   define INT1VAR_cfN(  T,A)           const int *A
00266 #elif NF_INT1_IS_C_LONG
00267 #   define INT1VAR_cfN(  T,A)           const long *A
00268 #endif
00269 #define INT1VAR_cfSTR(N,T,A,B,C,D,E)    SIMPLE_cfSTR(N,T,A,B,C,D,E)
00270 #define INT1VAR_cfT(M,I,A,B,D)          A
00271 
00272 
00273 /*
00274  * Output, INTEGER*1 variable:
00275  */
00276 #define PINT1VAR_cfINT(N,A,B,X,Y,Z)     SIMPLE_cfINT(N,A,B,X,Y,Z)
00277 #define PINT1VAR_cfSEP(T,  B)           SIMPLE_cfSEP(T,B)
00278 #if NF_INT1_IS_C_SIGNED_CHAR
00279 #   define PINT1VAR_cfN(  T,A)          signed char *A
00280 #elif NF_INT1_IS_C_SHORT
00281 #   define PINT1VAR_cfN(  T,A)          short *A
00282 #elif NF_INT1_IS_C_INT
00283 #   define PINT1VAR_cfN(  T,A)          int *A
00284 #elif NF_INT1_IS_C_LONG
00285 #   define PINT1VAR_cfN(  T,A)          long *A
00286 #endif
00287 #define PINT1VAR_cfSTR(N,T,A,B,C,D,E)   SIMPLE_cfSTR(N,T,A,B,C,D,E)
00288 #define PINT1VAR_cfT(M,I,A,B,D)         A
00289 
00290 
00291 /*
00292  * Input, INTEGER*1 variable array:
00293  */
00294 #define INT1VARV        INT1VAR
00295 
00296 
00297 /*
00298  * Output, INTEGER*1 variable array:
00299  */
00300 #define PINT1VARV       PINT1VAR
00301 
00302 
00303 /*
00304  * Input, INTEGER*2 variable:
00305  */
00306 #define INT2VAR_cfINT(N,A,B,X,Y,Z)      SIMPLE_cfINT(N,A,B,X,Y,Z)
00307 #define INT2VAR_cfSEP(T,  B)            SIMPLE_cfSEP(T,B)
00308 #if NF_INT2_IS_C_SHORT
00309 #   define INT2VAR_cfN(  T,A)           const short *A
00310 #elif NF_INT2_IS_C_INT
00311 #   define INT2VAR_cfN(  T,A)           const int *A
00312 #elif NF_INT2_IS_C_LONG
00313 #   define INT2VAR_cfN(  T,A)           const long *A
00314 #endif
00315 #define INT2VAR_cfSTR(N,T,A,B,C,D,E)    SIMPLE_cfSTR(N,T,A,B,C,D,E)
00316 #define INT2VAR_cfT(M,I,A,B,D)          A
00317 
00318 
00319 /*
00320  * Output, INTEGER*2 variable:
00321  */
00322 #define PINT2VAR_cfINT(N,A,B,X,Y,Z)     SIMPLE_cfINT(N,A,B,X,Y,Z)
00323 #define PINT2VAR_cfSEP(T,  B)           SIMPLE_cfSEP(T,B)
00324 #if NF_INT2_IS_C_SHORT
00325 #   define PINT2VAR_cfN(  T,A)          short *A
00326 #elif NF_INT2_IS_C_INT
00327 #   define PINT2VAR_cfN(  T,A)          int *A
00328 #elif NF_INT2_IS_C_LONG
00329 #   define PINT2VAR_cfN(  T,A)          long *A
00330 #endif
00331 #define PINT2VAR_cfSTR(N,T,A,B,C,D,E)   SIMPLE_cfSTR(N,T,A,B,C,D,E)
00332 #define PINT2VAR_cfT(M,I,A,B,D)         A
00333 
00334 
00335 /*
00336  * Input, INTEGER*2 variable array:
00337  */
00338 #define INT2VARV                INT2VAR
00339 
00340 
00341 /*
00342  * Output, INTEGER*2 variable array:
00343  */
00344 #define PINT2VARV               PINT2VAR
00345 
00346 
00347 /*
00348  * Input, INTEGER variable:
00349  */
00350 #define INTVAR_cfINT(N,A,B,X,Y,Z)       SIMPLE_cfINT(N,A,B,X,Y,Z)
00351 #define INTVAR_cfSEP(T,  B)             SIMPLE_cfSEP(T,B)
00352 #define INTVAR_cfN(  T,A)               const NF_INTEGER *A
00353 #define INTVAR_cfSTR(N,T,A,B,C,D,E)     SIMPLE_cfSTR(N,T,A,B,C,D,E)
00354 #define INTVAR_cfT(M,I,A,B,D)           A
00355 
00356 
00357 /*
00358  * Output, INTEGER variable:
00359  */
00360 #define PINTVAR_cfINT(N,A,B,X,Y,Z)      SIMPLE_cfINT(N,A,B,X,Y,Z)
00361 #define PINTVAR_cfSEP(T,  B)            SIMPLE_cfSEP(T,B)
00362 #define PINTVAR_cfN(  T,A)              NF_INTEGER *A
00363 #define PINTVAR_cfSTR(N,T,A,B,C,D,E)    SIMPLE_cfSTR(N,T,A,B,C,D,E)
00364 #define PINTVAR_cfT(M,I,A,B,D)          A
00365 
00366 
00367 /*
00368  * Input, INTEGER variable array:
00369  */
00370 #define INTVARV                 INTVAR
00371 
00372 
00373 /*
00374  * Output, INTEGER variable array:
00375  */
00376 #define PINTVARV                PINTVAR
00377 
00378 
00379 /*
00380  * Input, REAL variable:
00381  */
00382 #define REALVAR_cfINT(N,A,B,X,Y,Z)      SIMPLE_cfINT(N,A,B,X,Y,Z)
00383 #define REALVAR_cfSEP(T,  B)            SIMPLE_cfSEP(T,B)
00384 #if NF_REAL_IS_C_DOUBLE
00385 #   define REALVAR_cfN(  T,A)           const double *A
00386 #else
00387 #   define REALVAR_cfN(  T,A)           const float *A
00388 #endif
00389 #define REALVAR_cfSTR(N,T,A,B,C,D,E)    SIMPLE_cfSTR(N,T,A,B,C,D,E)
00390 #define REALVAR_cfT(M,I,A,B,D)          A
00391 
00392 
00393 /*
00394  * Output, REAL variable:
00395  */
00396 #define PREALVAR_cfINT(N,A,B,X,Y,Z)     SIMPLE_cfINT(N,A,B,X,Y,Z)
00397 #define PREALVAR_cfSEP(T,  B)           SIMPLE_cfSEP(T,B)
00398 #if NF_REAL_IS_C_DOUBLE
00399 #   define PREALVAR_cfN(  T,A)          double *A
00400 #else
00401 #   define PREALVAR_cfN(  T,A)          float *A
00402 #endif
00403 #define PREALVAR_cfSTR(N,T,A,B,C,D,E)   SIMPLE_cfSTR(N,T,A,B,C,D,E)
00404 #define PREALVAR_cfT(M,I,A,B,D)         A
00405 
00406 
00407 /*
00408  * Input, REAL variable array:
00409  */
00410 #define REALVARV                REALVAR
00411 
00412 
00413 /*
00414  * Output, REAL variable array:
00415  */
00416 #define PREALVARV               PREALVAR
00417 
00418 
00419 /*
00420  * Input, DOUBLEPRECISION variable:
00421  */
00422 #define DOUBLEVAR_cfINT(N,A,B,X,Y,Z)    SIMPLE_cfINT(N,A,B,X,Y,Z)
00423 #define DOUBLEVAR_cfSEP(T,  B)          SIMPLE_cfSEP(T,B)
00424 #define DOUBLEVAR_cfN(  T,A)            const double *A
00425 #define DOUBLEVAR_cfSTR(N,T,A,B,C,D,E)  SIMPLE_cfSTR(N,T,A,B,C,D,E)
00426 #define DOUBLEVAR_cfT(M,I,A,B,D)        A
00427 
00428 
00429 /*
00430  * Output, DOUBLEPRECISION variable:
00431  */
00432 #define PDOUBLEVAR_cfINT(N,A,B,X,Y,Z)   SIMPLE_cfINT(N,A,B,X,Y,Z)
00433 #define PDOUBLEVAR_cfSEP(T,  B)         SIMPLE_cfSEP(T,B)
00434 #define PDOUBLEVAR_cfN(  T,A)           double *A
00435 #define PDOUBLEVAR_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
00436 #define PDOUBLEVAR_cfT(M,I,A,B,D)       A
00437 
00438 
00439 /*
00440  * Input, DOUBLEPRECISION variable array:
00441  */
00442 #define DOUBLEVARV              DOUBLEVAR
00443 
00444 
00445 /*
00446  * Output, DOUBLEPRECISION variable array:
00447  */
00448 #define PDOUBLEVARV             PDOUBLEVAR
00449 
00450 
00451 /*******************************************************************************
00452  * Miscellaneious netCDF stuff:
00453  */
00454 
00455 
00456 /*
00457  * Output, `size_t' variable:
00458  */
00459 #define PSIZET_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
00460 #define PSIZET_cfTYPE                   NF_INTEGER
00461 #define PSIZET_cfSTR(N,T,A,B,C,D,E)     _(CFARGS,N)(T,PSIZET,A,B,C,D,E)
00462 #define PSIZET_cfH(S,U,B)
00463 #define PSIZET_cfQ(B)                   size_t B;
00464 #define PSIZET_cfT(M,I,A,B,D)           &B
00465 #define PSIZET_cfR(A,B,D)               *A=B;
00466 
00467 
00468 /*
00469  * Input dimension-ID:
00470  */
00471 #define DIMID   FNDX2CNDX
00472 
00473 
00474 /*
00475  * Output, dimension-ID:
00476  */
00477 #define PDIMID_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
00478 #define PDIMID_cfTYPE                   NF_INTEGER
00479 #define PDIMID_cfSTR(N,T,A,B,C,D,E)     _(CFARGS,N)(T,PDIMID,A,B,C,D,E)
00480 #define PDIMID_cfH(S,U,B)
00481 #define PDIMID_cfQ(B)                   int B = -1;
00482 #define PDIMID_cfT(M,I,A,B,D)           &B
00483 #define PDIMID_cfR(A,B,D)               *A=(B == -1 ? -1 : B+1);
00484 
00485 
00486 /*
00487  * Input, dimension-ID vector:
00488  */
00489 #define DIMIDS_cfINT(N,A,B,X,Y,Z)       DOUBLE_cfINT(N,A,B,X,Y,Z)
00490 #define DIMIDSVVVVVVV_cfTYPE            NF_INTEGER
00491 #define DIMIDS_cfSTR(N,T,A,B,C,D,E)     _(CFARGS,N)(T,DIMIDS,A,B,C,D,E)
00492 #define DIMIDS_cfH(S,U,B)
00493 #define DIMIDS_cfQ(B)                   int B[NC_MAX_DIMS];
00494 #define DIMIDS_cfT(M,I,A,B,D)           f2c_dimids(*fndims, A, B)
00495 #define DIMIDS_cfR(A,B,D)
00496 
00497 
00498 /*
00499  * Output, dimension-ID vector:
00500  */
00501 #define PDIMIDS_cfINT(N,A,B,X,Y,Z)      PDOUBLE_cfINT(N,A,B,X,Y,Z)
00502 #define PDIMIDS_cfTYPE                  NF_INTEGER
00503 #define PDIMIDS_cfSTR(N,T,A,B,C,D,E)    _(CFARGS,N)(T,PDIMIDS,A,B,C,D,E)
00504 #define PDIMIDS_cfH(S,U,B)
00505 #define PDIMIDS_cfQ(B)                  int B[NC_MAX_DIMS];
00506 #define PDIMIDS_cfT(M,I,A,B,D)          B
00507 #define PDIMIDS_cfR(A,B,D)              c2f_dimids(*fncid, *fvarid-1, B, A);
00508 
00509 
00510 /*
00511  * Input, netCDF dataset ID:
00512  */
00513 #define NCID_cfINT(N,A,B,X,Y,Z)         SIMPLE_cfINT(N,A,B,X,Y,Z)
00514 #define NCID_cfSEP(T,  B)               SIMPLE_cfSEP(T,B)
00515 #define NCID_cfN(  T,A)                 NF_INTEGER *fncid
00516 #define NCID_cfSTR(N,T,A,B,C,D,E)       SIMPLE_cfSTR(N,T,A,B,C,D,E)
00517 #define NCID_cfT(M,I,A,B,D)             *fncid
00518 
00519 
00520 /*
00521  * Two, input, netCDF dataset IDs:
00522  */
00523 #define NCID1   FINT2CINT
00524 #define NCID2   FINT2CINT
00525 
00526 
00527 /*
00528  * Output, netCDF dataset ID:
00529  */
00530 #define PNCID   PCINT2FINT
00531 
00532 
00533 /*
00534  * Input, netCDF variable ID:
00535  */
00536 #define VARID_cfINT(N,A,B,X,Y,Z)        SIMPLE_cfINT(N,A,B,X,Y,Z)
00537 #define VARID_cfSEP(T,  B)              SIMPLE_cfSEP(T,B)
00538 #define VARID_cfN(  T,A)                NF_INTEGER *fvarid
00539 #define VARID_cfSTR(N,T,A,B,C,D,E)      SIMPLE_cfSTR(N,T,A,B,C,D,E)
00540 #define VARID_cfT(M,I,A,B,D)            (*fvarid-1)
00541 
00542 
00543 /*
00544  * Two, input, netCDF variable IDs:
00545  */
00546 #define VARID1_cfINT(N,A,B,X,Y,Z)       SIMPLE_cfINT(N,A,B,X,Y,Z)
00547 #define VARID1_cfSEP(T,  B)             SIMPLE_cfSEP(T,B)
00548 #define VARID1_cfN(  T,A)               NF_INTEGER *fvarid1
00549 #define VARID1_cfSTR(N,T,A,B,C,D,E)     SIMPLE_cfSTR(N,T,A,B,C,D,E)
00550 #define VARID1_cfT(M,I,A,B,D)           (*fvarid1-1)
00551 
00552 #define VARID2_cfINT(N,A,B,X,Y,Z)       SIMPLE_cfINT(N,A,B,X,Y,Z)
00553 #define VARID2_cfSEP(T,  B)             SIMPLE_cfSEP(T,B)
00554 #define VARID2_cfN(  T,A)               NF_INTEGER *fvarid2
00555 #define VARID2_cfSTR(N,T,A,B,C,D,E)     SIMPLE_cfSTR(N,T,A,B,C,D,E)
00556 #define VARID2_cfT(M,I,A,B,D)           (*fvarid2-1)
00557 
00558 
00559 /*
00560  * Output, netCDF variable ID:
00561  */
00562 #define PVARID  PCNDX2FNDX
00563 
00564 
00565 /*
00566  * Input, co-ordinate vector:
00567  */
00568 #define COORDS_cfINT(N,A,B,X,Y,Z)       DOUBLE_cfINT(N,A,B,X,Y,Z)
00569 #define COORDSVVVVVVV_cfTYPE            NF_INTEGER
00570 #define COORDS_cfSTR(N,T,A,B,C,D,E)     _(CFARGS,N)(T,COORDS,A,B,C,D,E)
00571 #define COORDS_cfH(S,U,B)
00572 #define COORDS_cfQ(B)                   size_t B[NC_MAX_DIMS];
00573 #define COORDS_cfT(M,I,A,B,D)           f2c_coords(*fncid, *fvarid-1, A, B)
00574 #define COORDS_cfR(A,B,D)
00575 
00576 
00577 /*
00578  * Input count:
00579  */
00580 #define COUNT_cfINT(N,A,B,X,Y,Z)        SIMPLE_cfINT(N,A,B,X,Y,Z)
00581 #define COUNT_cfSEP(T,  B)              SIMPLE_cfSEP(T,B)
00582 #define COUNT_cfN(  T,A)                const NF_INTEGER *A
00583 #define COUNT_cfSTR(N,T,A,B,C,D,E)      SIMPLE_cfSTR(N,T,A,B,C,D,E)
00584 #define COUNT_cfT(M,I,A,B,D)            (size_t)*A
00585 
00586 
00587 /*
00588  * Output count:
00589  */
00590 #define PCOUNT  PSIZET
00591 
00592 
00593 /*
00594  * Input, count vector:
00595  */
00596 #define COUNTS_cfINT(N,A,B,X,Y,Z)       DOUBLE_cfINT(N,A,B,X,Y,Z)
00597 #define COUNTSVVVVVVV_cfTYPE            NF_INTEGER
00598 #define COUNTS_cfSTR(N,T,A,B,C,D,E)     _(CFARGS,N)(T,COUNTS,A,B,C,D,E)
00599 #define COUNTS_cfH(S,U,B)
00600 #define COUNTS_cfQ(B)                   size_t B[NC_MAX_DIMS];
00601 #define COUNTS_cfT(M,I,A,B,D)           f2c_counts(*fncid, *fvarid-1, A, B)
00602 #define COUNTS_cfR(A,B,D)
00603 
00604 
00605 /*
00606  * Input, stride vector:
00607  */
00608 #define STRIDES_cfINT(N,A,B,X,Y,Z)      DOUBLE_cfINT(N,A,B,X,Y,Z)
00609 #define STRIDESVVVVVVV_cfTYPE           NF_INTEGER
00610 #define STRIDES_cfSTR(N,T,A,B,C,D,E)    _(CFARGS,N)(T,STRIDES,A,B,C,D,E)
00611 #define STRIDES_cfH(S,U,B)
00612 #define STRIDES_cfQ(B)                  ptrdiff_t B[NC_MAX_DIMS];
00613 #define STRIDES_cfT(M,I,A,B,D)          f2c_strides(*fncid, *fvarid-1, A, B)
00614 #define STRIDES_cfR(A,B,D)
00615 
00616 
00617 /*
00618  * Input, mapping vector:
00619  */
00620 #define MAPS_cfINT(N,A,B,X,Y,Z)         DOUBLE_cfINT(N,A,B,X,Y,Z)
00621 #define MAPSVVVVVVV_cfTYPE              NF_INTEGER
00622 #define MAPS_cfSTR(N,T,A,B,C,D,E)       _(CFARGS,N)(T,MAPS,A,B,C,D,E)
00623 #define MAPS_cfH(S,U,B)
00624 #define MAPS_cfQ(B)                     ptrdiff_t B[NC_MAX_DIMS];
00625 #define MAPS_cfT(M,I,A,B,D)             f2c_maps(*fncid, *fvarid-1, A, B)
00626 #define MAPS_cfR(A,B,D)
00627 
00628 
00629 /*******************************************************************************
00630  * The following is for f2c-support only.
00631  */
00632 
00633 #if defined(f2cFortran) && !defined(pgiFortran)
00634 
00635 /*
00636  * The f2c(1) utility on BSD/OS and Linux systems adds an additional
00637  * underscore suffix (besides the usual one) to global names that have
00638  * an embedded underscore.  For example, `nfclose' becomes `nfclose_',
00639  * but `nf_close' becomes `nf_close__.  Consequently, we have to modify
00640  * some names.
00641  */
00642 
00643 #define nf_inq_libvers          nf_inq_libvers_
00644 #define nf_strerror             nf_strerror_
00645 #define nf_issyserr             nf_issyserr_
00646 #define nf_create               nf_create_
00647 #define nf_open                 nf_open_
00648 #define nf_set_fill             nf_set_fill_
00649 #define nf_set_default_format   nf_set_default_format_
00650 #define nf_redef                nf_redef_
00651 #define nf_enddef               nf_enddef_
00652 #define nf_sync                 nf_sync_
00653 #define nf_abort                nf_abort_
00654 #define nf_close                nf_close_
00655 #define nf_delete               nf_delete_
00656 #define nf_inq                  nf_inq_
00657 #define nf_inq_ndims            nf_inq_ndims_
00658 #define nf_inq_nvars            nf_inq_nvars_
00659 #define nf_inq_natts            nf_inq_natts_
00660 #define nf_inq_unlimdim         nf_inq_unlimdim_
00661 #define nf_inq_format           nf_inq_format_
00662 #define nf_def_dim              nf_def_dim_
00663 #define nf_inq_dimid            nf_inq_dimid_
00664 #define nf_inq_dim              nf_inq_dim_
00665 #define nf_inq_dimname          nf_inq_dimname_
00666 #define nf_inq_dimlen           nf_inq_dimlen_
00667 #define nf_rename_dim           nf_rename_dim_
00668 #define nf_inq_att              nf_inq_att_
00669 #define nf_inq_attid            nf_inq_attid_
00670 #define nf_inq_atttype          nf_inq_atttype_
00671 #define nf_inq_attlen           nf_inq_attlen_
00672 #define nf_inq_attname          nf_inq_attname_
00673 #define nf_copy_att             nf_copy_att_
00674 #define nf_rename_att           nf_rename_att_
00675 #define nf_del_att              nf_del_att_
00676 #define nf_put_att_text         nf_put_att_text_
00677 #define nf_get_att_text         nf_get_att_text_
00678 #define nf_put_att_int1         nf_put_att_int1_
00679 #define nf_get_att_int1         nf_get_att_int1_
00680 #define nf_put_att_int2         nf_put_att_int2_
00681 #define nf_get_att_int2         nf_get_att_int2_
00682 #define nf_put_att_int          nf_put_att_int_
00683 #define nf_get_att_int          nf_get_att_int_
00684 #define nf_put_att_real         nf_put_att_real_
00685 #define nf_get_att_real         nf_get_att_real_
00686 #define nf_put_att_double       nf_put_att_double_
00687 #define nf_get_att_double       nf_get_att_double_
00688 #define nf_def_var              nf_def_var_
00689 #define nf_inq_var              nf_inq_var_
00690 #define nf_inq_varid            nf_inq_varid_
00691 #define nf_inq_varname          nf_inq_varname_
00692 #define nf_inq_vartype          nf_inq_vartype_
00693 #define nf_inq_varndims         nf_inq_varndims_
00694 #define nf_inq_vardimid         nf_inq_vardimid_
00695 #define nf_inq_varnatts         nf_inq_varnatts_
00696 #define nf_rename_var           nf_rename_var_
00697 #define nf_copy_var             nf_copy_var_
00698 #define nf_put_var_text         nf_put_var_text_
00699 #define nf_get_var_text         nf_get_var_text_
00700 #define nf_put_var_int1         nf_put_var_int1_
00701 #define nf_get_var_int1         nf_get_var_int1_
00702 #define nf_put_var_int2         nf_put_var_int2_
00703 #define nf_get_var_int2         nf_get_var_int2_
00704 #define nf_put_var_int          nf_put_var_int_
00705 #define nf_get_var_int          nf_get_var_int_
00706 #define nf_put_var_real         nf_put_var_real_
00707 #define nf_get_var_real         nf_get_var_real_
00708 #define nf_put_var_double       nf_put_var_double_
00709 #define nf_get_var_double       nf_get_var_double_
00710 #define nf_put_var1_text        nf_put_var1_text_
00711 #define nf_get_var1_text        nf_get_var1_text_
00712 #define nf_put_var1_int1        nf_put_var1_int1_
00713 #define nf_get_var1_int1        nf_get_var1_int1_
00714 #define nf_put_var1_int2        nf_put_var1_int2_
00715 #define nf_get_var1_int2        nf_get_var1_int2_
00716 #define nf_put_var1_int         nf_put_var1_int_
00717 #define nf_get_var1_int         nf_get_var1_int_
00718 #define nf_put_var1_real        nf_put_var1_real_
00719 #define nf_get_var1_real        nf_get_var1_real_
00720 #define nf_put_var1_double      nf_put_var1_double_
00721 #define nf_get_var1_double      nf_get_var1_double_
00722 #define nf_put_vara_text        nf_put_vara_text_
00723 #define nf_get_vara_text        nf_get_vara_text_
00724 #define nf_put_vara_int1        nf_put_vara_int1_
00725 #define nf_get_vara_int1        nf_get_vara_int1_
00726 #define nf_put_vara_int2        nf_put_vara_int2_
00727 #define nf_get_vara_int2        nf_get_vara_int2_
00728 #define nf_put_vara_int         nf_put_vara_int_
00729 #define nf_get_vara_int         nf_get_vara_int_
00730 #define nf_put_vara_real        nf_put_vara_real_
00731 #define nf_get_vara_real        nf_get_vara_real_
00732 #define nf_put_vara_double      nf_put_vara_double_
00733 #define nf_get_vara_double      nf_get_vara_double_
00734 #define nf_put_vars_text        nf_put_vars_text_
00735 #define nf_get_vars_text        nf_get_vars_text_
00736 #define nf_put_vars_int1        nf_put_vars_int1_
00737 #define nf_get_vars_int1        nf_get_vars_int1_
00738 #define nf_put_vars_int2        nf_put_vars_int2_
00739 #define nf_get_vars_int2        nf_get_vars_int2_
00740 #define nf_put_vars_int         nf_put_vars_int_
00741 #define nf_get_vars_int         nf_get_vars_int_
00742 #define nf_put_vars_real        nf_put_vars_real_
00743 #define nf_get_vars_real        nf_get_vars_real_
00744 #define nf_put_vars_double      nf_put_vars_double_
00745 #define nf_get_vars_double      nf_get_vars_double_
00746 #define nf_put_varm_text        nf_put_varm_text_
00747 #define nf_get_varm_text        nf_get_varm_text_
00748 #define nf_put_varm_int1        nf_put_varm_int1_
00749 #define nf_get_varm_int1        nf_get_varm_int1_
00750 #define nf_put_varm_int2        nf_put_varm_int2_
00751 #define nf_get_varm_int2        nf_get_varm_int2_
00752 #define nf_put_varm_int         nf_put_varm_int_
00753 #define nf_get_varm_int         nf_get_varm_int_
00754 #define nf_put_varm_real        nf_put_varm_real_
00755 #define nf_get_varm_real        nf_get_varm_real_
00756 #define nf_put_varm_double      nf_put_varm_double_
00757 #define nf_get_varm_double      nf_get_varm_double_
00758 #define nf__create              nf__create_
00759 #define nf__create_mp           nf__create_mp_
00760 #define nf__enddef              nf__enddef_
00761 #define nf__open                nf__open_
00762 #define nf__open_mp             nf__open_mp_
00763 #define nf_delete_mp            nf_delete_mp_
00764 #define nf_inq_base_pe          nf_inq_base_pe_
00765 #define nf_set_base_pe          nf_set_base_pe_
00766 
00767 #endif  /* f2cFortran */
00768 
00769 
00770 #endif  /* header-file lockout */

Generated on Thu Mar 16 18:10:08 2006 for nco by  doxygen 1.4.4