MI - Fimex
GribUtils.h
Go to the documentation of this file.
1 /*
2  * Fimex, GribUtils.h
3  *
4  * (C) Copyright 2009, met.no
5  *
6  * Project Info: https://wiki.met.no/fimex/start
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21  * USA.
22  *
23  * Created on: Dec 11, 2009
24  * Author: Heiko Klein
25  */
26 
27 #ifndef GRIBUTILS_H_
28 #define GRIBUTILS_H_
29 
30 #include "fimex/GridDefinition.h"
31 #include <stdexcept>
32 
33 
34 // forward declaration
35 struct grib_handle;
36 
40 #define MIFI_GRIB_CHECK(error, msg) mifi_grib_check(error, msg, __LINE__, __FILE__);
41 
45 void mifi_grib_check(int error, const char* msg, int line, const char* file) throw(std::runtime_error);
46 
47 
48 namespace MetNoFimex
49 {
50 
55 GridDefinition::Orientation gribGetGridOrientation(boost::shared_ptr<grib_handle> gh);
56 
62 unsigned long gribStepUnits2seconds(const std::string& stepUnits);
66 std::string gribSeconds2stepUnits(unsigned long seconds);
67 
68 
69 }
70 
71 #endif /* GRIBUTILS_H_ */
void mifi_grib_check(int error, const char *msg, int line, const char *file)
basic_string< char > string
GridDefinition::Orientation gribGetGridOrientation(boost::shared_ptr< grib_handle > gh)
Definition: C_CDMReader.h:35
std::string gribSeconds2stepUnits(unsigned long seconds)
subroutine error(error_string)
Definition: fortran_test.f90:287
Orientation
Definition: GridDefinition.h:56
unsigned long gribStepUnits2seconds(const std::string &stepUnits)