Commit 054ce75d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Use cgribexlib 1.7.6.

parent 06ae7f1e
2017-04-13 Uwe Schulzweida
* using CGRIBEX library version 1.8.0
* Version 1.8.1 released
2017-04-12 Uwe Schulzweida
......
/* Automatically generated by m214003 at 2017-04-12, do not edit */
/* Automatically generated by m214003 at 2016-12-20, do not edit */
/* CGRIBEXLIB_VERSION="1.8.0" */
/* CGRIBEXLIB_VERSION="1.7.6" */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) || defined (__clang__)
#pragma GCC diagnostic push
......@@ -31,8 +31,8 @@
#include "calendar.h"
#include "timebase.h"
#ifndef CGRIBEX_TEMPLATES_H
#define CGRIBEX_TEMPLATES_H
#ifndef _TEMPLATES_H
#define _TEMPLATES_H
#define CAT(X,Y) X##_##Y
#define TEMPLATE(X,Y) CAT(X,Y)
......@@ -51,13 +51,13 @@
#include <float.h>
#if ! defined (CGRIBEX_H)
#if ! defined (_CGRIBEX_H)
# include "cgribex.h"
#endif
#if ! defined (ERROR_H)
# include "error.h"
#endif
#if ! defined (DTYPES_H)
#if ! defined (_DTYPES_H)
# include "dtypes.h"
#endif
......@@ -223,8 +223,8 @@ int grib2Sections(unsigned char *gribbuffer, long gribbufsize, unsigned char **i
#endif
#endif /* GRIB_INT_H */
#ifndef GRIBDECODE_H
#define GRIBDECODE_H
#ifndef _GRIBDECODE_H
#define _GRIBDECODE_H
#define UNDEFINED 9.999e20
......@@ -363,9 +363,9 @@ int grib2Sections(unsigned char *gribbuffer, long gribbufsize, unsigned char **i
#define GRIB2_SECLEN(section) (GET_UINT4(section[0], section[1], section[2], section[3]))
#define GRIB2_SECNUM(section) (GET_UINT1(section[4]))
#endif /* GRIBDECODE_H */
#ifndef CGRIBEX_GRIB_ENCODE_H
#define CGRIBEX_GRIB_ENCODE_H
#endif /* _GRIBDECODE_H */
#ifndef _GRIB_ENCODE_H
#define _GRIB_ENCODE_H
#include <limits.h>
......@@ -402,7 +402,7 @@ enum {
Put3Byte(mantissa); \
}
#endif /* CGRIBEX_GRIB_ENCODE_H */
#endif /* _GRIB_ENCODE_H */
#ifndef CODEC_COMMON_H
#define CODEC_COMMON_H
#define gribSwapByteOrder_uint16(ui16) ((uint16_t)((ui16<<8) | (ui16>>8)))
......@@ -11402,9 +11402,6 @@ void encodePDS(GRIBPACK *lpds, long pdsLen, int *isec1)
#ifdef T
#define round_float roundf
#define round_double round
static
void TEMPLATE(encode_array_common,T)(int numBits, size_t packStart, size_t datasize, GRIBPACK *lGrib,
const T *data, T zref, T factor, size_t *gz)
......@@ -11422,7 +11419,7 @@ void TEMPLATE(encode_array_common,T)(int numBits, size_t packStart, size_t datas
for ( i = packStart; i < datasize; i++ )
{
/* note float -> unsigned int .. truncate */
ival = (unsigned int)(TEMPLATE(round,T)((data[i] - zref) * factor));
ival = (unsigned int) ((data[i] - zref) * factor + (T)0.5);
/*
if ( ival > max_nbpv_pow2 ) ival = max_nbpv_pow2;
if ( ival < 0 ) ival = 0;
......@@ -11467,7 +11464,7 @@ void TEMPLATE(encode_array_2byte,T)(size_t datasize, GRIBPACK *restrict lGrib,
{
for ( size_t i = 0; i < datasize; i++ )
{
sgrib[i] = (uint16_t)(TEMPLATE(round,T)((data[i] - zref) * factor));
sgrib[i] = (uint16_t) ((data[i] - zref) * factor + (T)0.5);
}
}
else
......@@ -11475,7 +11472,7 @@ void TEMPLATE(encode_array_2byte,T)(size_t datasize, GRIBPACK *restrict lGrib,
uint16_t ui16;
for ( size_t i = 0; i < datasize; i++ )
{
ui16 = (uint16_t)(TEMPLATE(round,T)((data[i] - zref) * factor));
ui16 = (uint16_t) ((data[i] - zref) * factor + (T)0.5);
sgrib[i] = gribSwapByteOrder_uint16(ui16);
}
}
......@@ -11502,7 +11499,7 @@ void TEMPLATE(encode_array_2byte,T)(size_t datasize, GRIBPACK *restrict lGrib,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
ui16 = (uint16_t) tmp;
lGrib[z ] = ui16 >> 8;
lGrib[z+1] = ui16;
......@@ -11545,7 +11542,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
lGrib[z ] = (GRIBPACK)tmp;
z++;
}
......@@ -11608,7 +11605,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
ui32 = (uint32_t) tmp;
lGrib[z ] = (GRIBPACK)(ui32 >> 16);
lGrib[z+1] = (GRIBPACK)(ui32 >> 8);
......@@ -11637,7 +11634,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
ui32 = (uint32_t) tmp;
lGrib[z ] = (GRIBPACK)(ui32 >> 24);
lGrib[z+1] = (GRIBPACK)(ui32 >> 16);
......@@ -11674,17 +11671,17 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
U_BYTEORDER;
size_t i, j, z = *gz;
#ifdef _ARCH_PWR6
enum { CGRIBEX__UNROLL_DEPTH_2 = 8 };
#define __UNROLL_DEPTH_2 8
#else
enum { CGRIBEX__UNROLL_DEPTH_2 = 128 };
#define __UNROLL_DEPTH_2 128
#endif
size_t residual;
size_t ofs;
T dval[CGRIBEX__UNROLL_DEPTH_2];
T dval[__UNROLL_DEPTH_2];
data += packStart;
datasize -= packStart;
residual = datasize % CGRIBEX__UNROLL_DEPTH_2;
residual = datasize % __UNROLL_DEPTH_2;
ofs = datasize - residual;
// reducing FP operations to single FMA is slowing down on pwr6 ...
......@@ -11695,13 +11692,13 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
hpmStart(2, "pack 8 bit unrolled");
#endif
unsigned char *cgrib = (unsigned char *) (lGrib + z);
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
*cgrib++ = (unsigned long) dval[j];
......@@ -11709,11 +11706,11 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
*cgrib++ = (unsigned char) dval[j];
#endif
}
z += CGRIBEX__UNROLL_DEPTH_2;
z += __UNROLL_DEPTH_2;
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < residual; j++)
{
......@@ -11741,15 +11738,15 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
#endif
uint16_t *sgrib = (uint16_t *) (lGrib+z);
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
*sgrib++ = (unsigned long) dval[j];
......@@ -11757,21 +11754,21 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
*sgrib++ = (uint16_t) dval[j];
#endif
}
z += 2*CGRIBEX__UNROLL_DEPTH_2;
z += 2*__UNROLL_DEPTH_2;
}
else
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
ival = (uint16_t) dval[j];
*sgrib++ = gribSwapByteOrder_uint16(ival);
}
z += 2*CGRIBEX__UNROLL_DEPTH_2;
z += 2*__UNROLL_DEPTH_2;
}
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
......@@ -11809,13 +11806,13 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
#else
uint32_t ival;
#endif
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
ival = (unsigned long) dval[j];
......@@ -11830,7 +11827,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < residual; j++)
{
......@@ -11855,15 +11852,15 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
uint32_t ival;
#endif
unsigned int *igrib = (unsigned int *) (lGrib + z);
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
*igrib = (unsigned long) dval[j];
......@@ -11876,7 +11873,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
else
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
ival = (uint32_t) dval[j];
lGrib[z ] = (GRIBPACK)(ival >> 24);
......@@ -11889,7 +11886,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
......@@ -11933,6 +11930,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
*gz = z;
#undef __UNROLL_DEPTH_2
}
#endif /* T */
......@@ -11950,9 +11948,6 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
#ifdef T
#define round_float roundf
#define round_double round
static
void TEMPLATE(encode_array_common,T)(int numBits, size_t packStart, size_t datasize, GRIBPACK *lGrib,
const T *data, T zref, T factor, size_t *gz)
......@@ -11970,7 +11965,7 @@ void TEMPLATE(encode_array_common,T)(int numBits, size_t packStart, size_t datas
for ( i = packStart; i < datasize; i++ )
{
/* note float -> unsigned int .. truncate */
ival = (unsigned int)(TEMPLATE(round,T)((data[i] - zref) * factor));
ival = (unsigned int) ((data[i] - zref) * factor + (T)0.5);
/*
if ( ival > max_nbpv_pow2 ) ival = max_nbpv_pow2;
if ( ival < 0 ) ival = 0;
......@@ -12015,7 +12010,7 @@ void TEMPLATE(encode_array_2byte,T)(size_t datasize, GRIBPACK *restrict lGrib,
{
for ( size_t i = 0; i < datasize; i++ )
{
sgrib[i] = (uint16_t)(TEMPLATE(round,T)((data[i] - zref) * factor));
sgrib[i] = (uint16_t) ((data[i] - zref) * factor + (T)0.5);
}
}
else
......@@ -12023,7 +12018,7 @@ void TEMPLATE(encode_array_2byte,T)(size_t datasize, GRIBPACK *restrict lGrib,
uint16_t ui16;
for ( size_t i = 0; i < datasize; i++ )
{
ui16 = (uint16_t)(TEMPLATE(round,T)((data[i] - zref) * factor));
ui16 = (uint16_t) ((data[i] - zref) * factor + (T)0.5);
sgrib[i] = gribSwapByteOrder_uint16(ui16);
}
}
......@@ -12050,7 +12045,7 @@ void TEMPLATE(encode_array_2byte,T)(size_t datasize, GRIBPACK *restrict lGrib,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
ui16 = (uint16_t) tmp;
lGrib[z ] = ui16 >> 8;
lGrib[z+1] = ui16;
......@@ -12093,7 +12088,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
lGrib[z ] = (GRIBPACK)tmp;
z++;
}
......@@ -12156,7 +12151,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
ui32 = (uint32_t) tmp;
lGrib[z ] = (GRIBPACK)(ui32 >> 16);
lGrib[z+1] = (GRIBPACK)(ui32 >> 8);
......@@ -12185,7 +12180,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
#endif
for ( i = 0; i < datasize; i++ )
{
tmp = TEMPLATE(round,T)((data[i] - zref) * factor);
tmp = ((data[i] - zref) * factor + (T)0.5);
ui32 = (uint32_t) tmp;
lGrib[z ] = (GRIBPACK)(ui32 >> 24);
lGrib[z+1] = (GRIBPACK)(ui32 >> 16);
......@@ -12222,17 +12217,17 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
U_BYTEORDER;
size_t i, j, z = *gz;
#ifdef _ARCH_PWR6
enum { CGRIBEX__UNROLL_DEPTH_2 = 8 };
#define __UNROLL_DEPTH_2 8
#else
enum { CGRIBEX__UNROLL_DEPTH_2 = 128 };
#define __UNROLL_DEPTH_2 128
#endif
size_t residual;
size_t ofs;
T dval[CGRIBEX__UNROLL_DEPTH_2];
T dval[__UNROLL_DEPTH_2];
data += packStart;
datasize -= packStart;
residual = datasize % CGRIBEX__UNROLL_DEPTH_2;
residual = datasize % __UNROLL_DEPTH_2;
ofs = datasize - residual;
// reducing FP operations to single FMA is slowing down on pwr6 ...
......@@ -12243,13 +12238,13 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
hpmStart(2, "pack 8 bit unrolled");
#endif
unsigned char *cgrib = (unsigned char *) (lGrib + z);
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
*cgrib++ = (unsigned long) dval[j];
......@@ -12257,11 +12252,11 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
*cgrib++ = (unsigned char) dval[j];
#endif
}
z += CGRIBEX__UNROLL_DEPTH_2;
z += __UNROLL_DEPTH_2;
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < residual; j++)
{
......@@ -12289,15 +12284,15 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
#endif
uint16_t *sgrib = (uint16_t *) (lGrib+z);
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
*sgrib++ = (unsigned long) dval[j];
......@@ -12305,21 +12300,21 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
*sgrib++ = (uint16_t) dval[j];
#endif
}
z += 2*CGRIBEX__UNROLL_DEPTH_2;
z += 2*__UNROLL_DEPTH_2;
}
else
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
ival = (uint16_t) dval[j];
*sgrib++ = gribSwapByteOrder_uint16(ival);
}
z += 2*CGRIBEX__UNROLL_DEPTH_2;
z += 2*__UNROLL_DEPTH_2;
}
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
......@@ -12357,13 +12352,13 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
#else
uint32_t ival;
#endif
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
ival = (unsigned long) dval[j];
......@@ -12378,7 +12373,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
for (j = 0; j < residual; j++)
{
......@@ -12403,15 +12398,15 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
uint32_t ival;
#endif
unsigned int *igrib = (unsigned int *) (lGrib + z);
for ( i = 0; i < datasize - residual; i += CGRIBEX__UNROLL_DEPTH_2 )
for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
dval[j] = TEMPLATE(round,T)((data[i+j] - zref) * factor);
dval[j] = ((data[i+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
#ifdef _ARCH_PWR6
*igrib = (unsigned long) dval[j];
......@@ -12424,7 +12419,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
else
{
for (j = 0; j < CGRIBEX__UNROLL_DEPTH_2; j++)
for (j = 0; j < __UNROLL_DEPTH_2; j++)
{
ival = (uint32_t) dval[j];
lGrib[z ] = (GRIBPACK)(ival >> 24);
......@@ -12437,7 +12432,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
for (j = 0; j < residual; j++)
{
dval[j] = TEMPLATE(round,T)((data[ofs+j] - zref) * factor);
dval[j] = ((data[ofs+j] - zref) * factor + (T)0.5);
}
if ( IS_BIGENDIAN() )
{
......@@ -12481,6 +12476,7 @@ void TEMPLATE(encode_array_unrolled,T)(int numBits, size_t packStart, size_t dat
}
*gz = z;
#undef __UNROLL_DEPTH_2
}
#endif /* T */
......@@ -13715,7 +13711,7 @@ void encode_dummy(void)
(void) encode_array_unrolled_double(0, 0, 0, NULL, NULL, 0, 0, NULL);
(void) encode_array_unrolled_float(0, 0, 0, NULL, NULL, 0, 0, NULL);
}
static const char grb_libvers[] = "1.8.0" " of ""Apr 12 2017"" ""10:21:00";
static const char grb_libvers[] = "1.7.6" " of ""Dec 20 2016"" ""19:55:24";
const char *
cgribexLibraryVersion(void)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment