RCube
Rcube Rest Server calculates sail routes based on Grib files and sailing boat polar files
Loading...
Searching...
No Matches
readgriballeccodes.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include <math.h>
#include <sys/stat.h>
#include <locale.h>
#include "eccodes.h"
#include "../csources/glibwrapper.h"
#include "../csources/r3types.h"
#include "../csources/r3util.h"
#include "../csources/inline.h"
#include <grib_api.h>
Include dependency graph for readgriballeccodes.c:

Go to the source code of this file.

Macros

#define EPSILON   0.001
 compilation: gcc -c grib.c pkg-config --cflags glib-2.0
 
#define GUST_GFS   180
 

Functions

char * gribReaderVersion (char *str, size_t maxLen)
 return version of ECCODE API
 
static long indLat (double lat, const Zone *zone)
 return indice of lat in gribData wind or current

 
static long indLon (double lon, const Zone *zone)
 return indice of lon in gribData wind or current
 
static long updateLong (long value, size_t n, size_t maxSize, long array[])
 Modify array with new value if not already in array.
 
bool readGribLists (const char *fileName, Zone *zone)
 Read lists zone.timeStamp, shortName, zone.dataDate, dataTime before full grib reading.
 
bool readGribParameters (const char *fileName, Zone *zone)
 Read grib parameters in zone before full grib reading.
 
static long indexOf (int timeStep, double lat, double lon, const Zone *zone)
 find index in gribData table
 
bool readGribAll (const char *fileName, Zone *zone, int iFlow)
 read grib file using eccodes C API return true if OK
 

Variables

FlowPtGribData [2] = {NULL, NULL}
 grib data description
 

Macro Definition Documentation

◆ EPSILON

#define EPSILON   0.001

compilation: gcc -c grib.c pkg-config --cflags glib-2.0

Definition at line 17 of file readgriballeccodes.c.

◆ GUST_GFS

#define GUST_GFS   180

Definition at line 18 of file readgriballeccodes.c.

Function Documentation

◆ gribReaderVersion()

char * gribReaderVersion ( char *  str,
size_t  maxLen 
)

return version of ECCODE API

Definition at line 23 of file readgriballeccodes.c.

◆ indexOf()

static long indexOf ( int  timeStep,
double  lat,
double  lon,
const Zone zone 
)
inlinestatic

find index in gribData table

Definition at line 178 of file readgriballeccodes.c.

References indLat(), indLon(), Zone::nbLat, Zone::nbLon, Zone::nTimeStamp, Zone::timeStamp, and zone.

Referenced by readGribAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indLat()

static long indLat ( double  lat,
const Zone zone 
)
inlinestatic

return indice of lat in gribData wind or current

Definition at line 29 of file readgriballeccodes.c.

References Zone::latMin, Zone::latStep, and zone.

Referenced by indexOf().

Here is the caller graph for this function:

◆ indLon()

static long indLon ( double  lon,
const Zone zone 
)
inlinestatic

return indice of lon in gribData wind or current

Definition at line 34 of file readgriballeccodes.c.

References Zone::lonLeft, Zone::lonStep, and zone.

Referenced by indexOf().

Here is the caller graph for this function:

◆ readGribAll()

bool readGribAll ( const char *  fileName,
Zone zone,
int  iFlow 
)

read grib file using eccodes C API return true if OK

Definition at line 196 of file readgriballeccodes.c.

◆ readGribLists()

bool readGribLists ( const char *  fileName,
Zone zone 
)

Read lists zone.timeStamp, shortName, zone.dataDate, dataTime before full grib reading.

Definition at line 56 of file readgriballeccodes.c.

Referenced by readGribAll().

Here is the caller graph for this function:

◆ readGribParameters()

bool readGribParameters ( const char *  fileName,
Zone zone 
)

Read grib parameters in zone before full grib reading.

Definition at line 128 of file readgriballeccodes.c.

Referenced by readGribAll().

Here is the caller graph for this function:

◆ updateLong()

static long updateLong ( long  value,
size_t  n,
size_t  maxSize,
long  array[] 
)
static

Modify array with new value if not already in array.

Return new array size

Definition at line 40 of file readgriballeccodes.c.

Referenced by readGribLists().

Here is the caller graph for this function:

Variable Documentation

◆ tGribData

FlowP* tGribData[2] = {NULL, NULL}

grib data description

Definition at line 20 of file readgriballeccodes.c.

Referenced by readGribAll().