"Fossies" - the Fresh Open Source Software Archive

Member "fimex-1.4.2/include/fimex/CDMconstants.h" (6 Jan 2020, 5791 Bytes) of package /linux/privat/fimex-1.4.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "CDMconstants.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.4.1_vs_1.4.2.

    1 /*
    2   Fimex, include/fimex/CDMconstants.h
    3 
    4   Copyright (C) 2019 met.no
    5 
    6   Contact information:
    7   Norwegian Meteorological Institute
    8   Box 43 Blindern
    9   0313 OSLO
   10   NORWAY
   11   email: diana@met.no
   12 
   13   Project Info:  https://wiki.met.no/fimex/start
   14 
   15   This library is free software; you can redistribute it and/or modify it
   16   under the terms of the GNU Lesser General Public License as published by
   17   the Free Software Foundation; either version 2.1 of the License, or
   18   (at your option) any later version.
   19 
   20   This library is distributed in the hope that it will be useful, but
   21   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   22   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
   23   License for more details.
   24 
   25   You should have received a copy of the GNU Lesser General Public
   26   License along with this library; if not, write to the Free Software
   27   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
   28   USA.
   29 */
   30 
   31 #ifndef CDMCONSTANTS_H_
   32 #define CDMCONSTANTS_H_
   33 
   34 /**
   35  * @headerfile fimex/CDMconstants.h
   36  */
   37 /**
   38  * @brief constants used through-out fimex
   39  *
   40  * CDMConstants stores several constants used in fimex, accessible from
   41  * C and C++. Constants are either available as macro, or as function.
   42  */
   43 
   44 #define MIFI_STRINGIFY1(x) #x
   45 #define MIFI_STRINGIFY(x) MIFI_STRINGIFY1(x)
   46 
   47 /*
   48  * The following numbers are used by configure.ac
   49  * - make sure the line-number is correct
   50  */
   51 /*
   52  * fimex version status, e.g >=0xF0 = final, 0xAX = alphaX,
   53  * 0xBX = betaX, 0xCX= releaseCandidateX
   54  * touch configure.ac after changing these numbers
   55  */
   56 #define MIFI_VERSION_MAJOR  1
   57 #define MIFI_VERSION_MINOR  4
   58 #define MIFI_VERSION_PATCH  2
   59 #define MIFI_VERSION_STATUS 0xF0
   60 
   61 #define MIFI_VERSION_PATCH_STRING "." MIFI_STRINGIFY(MIFI_VERSION_PATCH)
   62 
   63 #if (MIFI_VERSION_STATUS == 0xA1)
   64 #define MIFI_VERSION_STATUS_STRING "~alpha1"
   65 #elif (MIFI_VERSION_STATUS == 0xA2)
   66 #define MIFI_VERSION_STATUS_STRING "~alpha2"
   67 #elif (MIFI_VERSION_STATUS == 0xA3)
   68 #define MIFI_VERSION_STATUS_STRING "~alpha3"
   69 #elif (MIFI_VERSION_STATUS == 0xA4)
   70 #define MIFI_VERSION_STATUS_STRING "~alpha4"
   71 #elif (MIFI_VERSION_STATUS == 0xA5)
   72 #define MIFI_VERSION_STATUS_STRING "~alpha5"
   73 #elif (MIFI_VERSION_STATUS == 0xA6)
   74 #define MIFI_VERSION_STATUS_STRING "~alpha6"
   75 #elif (MIFI_VERSION_STATUS == 0xA7)
   76 #define MIFI_VERSION_STATUS_STRING "~alpha7"
   77 #elif (MIFI_VERSION_STATUS == 0xA8)
   78 #define MIFI_VERSION_STATUS_STRING "~alpha8"
   79 #elif (MIFI_VERSION_STATUS == 0xA9)
   80 #define MIFI_VERSION_STATUS_STRING "~alpha9"
   81 
   82 #elif (MIFI_VERSION_STATUS == 0xB1)
   83 #define MIFI_VERSION_STATUS_STRING "~beta1"
   84 #elif (MIFI_VERSION_STATUS == 0xB2)
   85 #define MIFI_VERSION_STATUS_STRING "~beta2"
   86 #elif (MIFI_VERSION_STATUS == 0xB3)
   87 #define MIFI_VERSION_STATUS_STRING "~beta3"
   88 #elif (MIFI_VERSION_STATUS == 0xB4)
   89 #define MIFI_VERSION_STATUS_STRING "~beta4"
   90 #elif (MIFI_VERSION_STATUS == 0xB5)
   91 #define MIFI_VERSION_STATUS_STRING "~beta5"
   92 #elif (MIFI_VERSION_STATUS == 0xB6)
   93 #define MIFI_VERSION_STATUS_STRING "~beta6"
   94 #elif (MIFI_VERSION_STATUS == 0xB7)
   95 #define MIFI_VERSION_STATUS_STRING "~beta7"
   96 #elif (MIFI_VERSION_STATUS == 0xB8)
   97 #define MIFI_VERSION_STATUS_STRING "~beta8"
   98 #elif (MIFI_VERSION_STATUS == 0xB9)
   99 #define MIFI_VERSION_STATUS_STRING "~beta9"
  100 
  101 #elif (MIFI_VERSION_STATUS == 0xC1)
  102 #define MIFI_VERSION_STATUS_STRING "~rc1"
  103 #elif (MIFI_VERSION_STATUS == 0xC2)
  104 #define MIFI_VERSION_STATUS_STRING "~rc2"
  105 #elif (MIFI_VERSION_STATUS == 0xC3)
  106 #define MIFI_VERSION_STATUS_STRING "~rc3"
  107 #elif (MIFI_VERSION_STATUS == 0xC4)
  108 #define MIFI_VERSION_STATUS_STRING "~rc4"
  109 #elif (MIFI_VERSION_STATUS == 0xC5)
  110 #define MIFI_VERSION_STATUS_STRING "~rc5"
  111 #elif (MIFI_VERSION_STATUS == 0xC6)
  112 #define MIFI_VERSION_STATUS_STRING "~rc6"
  113 #elif (MIFI_VERSION_STATUS == 0xC7)
  114 #define MIFI_VERSION_STATUS_STRING "~rc7"
  115 #elif (MIFI_VERSION_STATUS == 0xC8)
  116 #define MIFI_VERSION_STATUS_STRING "~rc8"
  117 #elif (MIFI_VERSION_STATUS == 0xC9)
  118 #define MIFI_VERSION_STATUS_STRING "~rc9"
  119 
  120 #elif (MIFI_VERSION_STATUS == 0xF0)
  121 #define MIFI_VERSION_STATUS_STRING ""
  122 
  123 #else
  124 #error "unknown MIFI_VERSION_STATUS"
  125 #endif
  126 
  127 #define MIFI_VERSION_STRING \
  128     MIFI_STRINGIFY(MIFI_VERSION_MAJOR )\
  129     "." MIFI_STRINGIFY(MIFI_VERSION_MINOR) \
  130     MIFI_VERSION_PATCH_STRING \
  131     MIFI_VERSION_STATUS_STRING
  132 
  133 #define MIFI_VERSION_INT(major,minor,patch) \
  134     (1000000*major + 1000*minor + patch)
  135 #define MIFI_VERSION_CURRENT_INT \
  136     MIFI_VERSION_INT(MIFI_VERSION_MAJOR, MIFI_VERSION_MINOR, MIFI_VERSION_PATCH)
  137 
  138 /**
  139  * the default radius of a spherical earth in meter
  140  */
  141 #define MIFI_EARTH_RADIUS_M 6371000
  142 
  143 /**
  144  * the default earth projection (WGS84 latlong)
  145  */
  146 #define MIFI_WGS84_LATLON_PROJ4 "+proj=latlong +datum=WGS84 +towgs84=0,0,0 +no_defs"
  147 
  148 /**
  149  * default fill values taken from netcdf.h
  150  */
  151 #define MIFI_FILL_CHAR    ((signed char)-127)
  152 #define MIFI_FILL_SHORT   ((short)-32767)
  153 #define MIFI_FILL_INT     (-2147483647L)
  154 #define MIFI_FILL_FLOAT   (9.9692099683868690e+36f) /* near 15 * 2^119 */
  155 #define MIFI_FILL_DOUBLE  (9.9692099683868690e+36)
  156 #define MIFI_FILL_UCHAR   (255)
  157 #define MIFI_FILL_USHORT  (65535)
  158 #define MIFI_FILL_UINT    (4294967295U)
  159 #define MIFI_FILL_INT64   ((long long)-9223372036854775806LL)
  160 #define MIFI_FILL_UINT64  ((unsigned long long)18446744073709551614ULL)
  161 
  162 
  163 #ifdef __cplusplus
  164 extern "C" {
  165 #endif
  166 
  167 /**
  168  * version of fimex
  169  */
  170 extern const char* fimexVersion();
  171 
  172 /**
  173  * major version of fimex
  174  */
  175 extern unsigned int mifi_version_major();
  176 
  177 /**
  178  * minor version of fimex
  179  */
  180 extern unsigned int mifi_version_minor();
  181 
  182 /**
  183  * patch version of fimex
  184  */
  185 extern unsigned int mifi_version_patch();
  186 
  187 /**
  188  * fimex version status, e.g >=0xF0 = final, 0xAX = alphaX,
  189  * 0xBX = betaX, 0xCX= releaseCandidateX
  190  */
  191 extern unsigned int mifi_version_status();
  192 
  193 #ifdef __cplusplus
  194 }
  195 #endif
  196 
  197 
  198 #endif /*CDMCONSTANTS_H_*/