Commit 3780e0c6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexlib update

parent e5a2f901
This diff is collapsed.
/* Automatically generated by m214003 at 2014-01-08, do not edit */
/* Automatically generated by m214003 at 2014-02-26, do not edit */
/* CGRIBEXLIB_VERSION="1.6.3" */
/* CGRIBEXLIB_VERSION="1.6.4" */
#ifdef _ARCH_PWR6
#pragma options nostrict
......@@ -1091,7 +1091,7 @@ int main(void)
printf("gcc\n");
#endif
data = (double *) malloc(datasize*sizeof(double));
data = malloc(datasize*sizeof(double));
for ( long i = datasize-1; i >= 0; i-- ) data[i] = (double) (-datasize/2 + i);
......@@ -1951,8 +1951,8 @@ int main(void)
double t_begin, t_end;
unsigned char *lgrib;
data = (double *) malloc(datasize*sizeof(double));
lgrib = (unsigned char *) malloc(2*datasize*sizeof(unsigned char));
data = malloc(datasize*sizeof(double));
lgrib = malloc(2*datasize*sizeof(unsigned char));
for ( long i = 0; i < datasize; ++i ) data[i] = (double) (-datasize/2 + i);
......@@ -2336,7 +2336,7 @@ void decode_double_array_byte(const unsigned char * restrict igrib, long jlend,
long jlenc = jlend * numBits / 8;
if ( jlenc > 0 )
{
lgrib = (GRIBPACK *) malloc(jlenc*sizeof(GRIBPACK));
lgrib = malloc(jlenc*sizeof(GRIBPACK));
if ( lgrib == NULL ) SysError("No Memory!");
(void) UNPACK_GRIB(igrib, lgrib, jlenc, -1L);
......@@ -3082,7 +3082,7 @@ gribExSP(int *isec0, int *isec1, int *isec2, float *fsec2sp, int *isec3,
fsec3dp[1] = fsec3sp[1];
inum = isec4[0];
fsec4dp = (double *) malloc(inum*sizeof(double));
fsec4dp = malloc(inum*sizeof(double));
if ( fsec4dp == NULL ) SysError("No Memory!");
for ( j = 0; j < inum; j++ ) fsec4dp[j] = fsec4sp[j];
......@@ -3095,7 +3095,7 @@ gribExSP(int *isec0, int *isec1, int *isec2, float *fsec2sp, int *isec3,
}
else if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
{
fsec4dp = (double *) malloc(klenp*sizeof(double));
fsec4dp = malloc(klenp*sizeof(double));
if ( fsec4dp == NULL ) SysError("No Memory!");
for ( j = 0; j < 10; j++ ) fsec2dp[j] = 0.0;
......@@ -4413,7 +4413,7 @@ void gribPrintSec2SP(int *isec0, int *isec2, float *fsec2sp)
inum = 10 + isec2[11];
fsec2 = (double *) malloc(inum*sizeof(double));
fsec2 = malloc(inum*sizeof(double));
if ( fsec2 == NULL ) SysError("No Memory!");
for ( j = 0; j < inum; j++ )
......@@ -5176,7 +5176,7 @@ void encodeBMS(GRIBPACK *lGrib, long *gribLen, double *fsec3, int *isec4, double
fsec4size = 0;
#if defined (VECTORCODE)
imask = (unsigned int *) malloc(imaskSize*sizeof(int));
imask = malloc(imaskSize*sizeof(int));
memset(imask, 0, imaskSize*sizeof(int));
#if defined (CRAY)
......@@ -5452,19 +5452,18 @@ int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *ise
}
}
max_nbpv_pow2 = (unsigned int) (intpow2(nbpv) - 1);
//max_nbpv_pow2 = (unsigned) (intpow2(nbpv) - 1);
max_nbpv_pow2 = (unsigned) ((1ULL << nbpv) - 1);
if ( binscale != 0 )
{
if ( binscale < 0 )
{
if ( (unsigned int)(range*intpow2(-binscale)+0.5) > max_nbpv_pow2 )
binscale++;
if ( (unsigned)(range*intpow2(-binscale)+0.5) > max_nbpv_pow2 ) binscale++;
}
else
{
if ( (unsigned int)(range/intpow2(binscale)+0.5) > max_nbpv_pow2 )
binscale--;
if ( (unsigned)(range/intpow2(binscale)+0.5) > max_nbpv_pow2 ) binscale--;
}
if ( binscale < 0 ) factor = intpow2(-binscale);
......@@ -5550,7 +5549,7 @@ void gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
if ( bmsIncluded ) len += (klenp+7)>>3;
#if defined (VECTORCODE)
lGrib = (GRIBPACK *) malloc(len*sizeof(GRIBPACK));
lGrib = malloc(len*sizeof(GRIBPACK));
if ( lGrib == NULL ) SysError("No Memory!");
#else
lGrib = CGrib;
......@@ -6114,7 +6113,7 @@ int decodeGDS(unsigned char *gds, int *isec0, int *isec2, double *fsec2, int *n
}
#if defined (SX)
lGribLen = 4*ISEC2_NumVCP;
lgrib = (GRIBPACK *) malloc(lGribLen*sizeof(GRIBPACK));
lgrib = malloc(lGribLen*sizeof(GRIBPACK));
igrib = &gds[locnv];
if ( ISEC2_NumVCP > 0 ) (void) UNPACK_GRIB(igrib, lgrib, lGribLen, -1L);
......@@ -6658,7 +6657,7 @@ void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
}
*/
imask = (GRIBPACK *) malloc(imaskSize*sizeof(GRIBPACK));
imask = malloc(imaskSize*sizeof(GRIBPACK));
#if defined (VECTORCODE)
(void) UNPACK_GRIB(BMS_Bitmap, imask, imaskSize/8, -1L);
......@@ -7328,14 +7327,14 @@ double calculate_pfactor(const double* spectralField, long fieldTruncation, long
range = (double) (ismax - ismin +1);
weights = (double*) malloc((ismax+1)*sizeof(double));
weights = malloc((ismax+1)*sizeof(double));
for( loop = ismin; loop <= ismax; loop++ )
weights[loop] = range / (double) (loop-ismin+1);
/*
// Compute norms
// Handle values 2 at a time (real and imaginary parts).
*/
norms = (double*) malloc((ismax+1)*sizeof(double));
norms = malloc((ismax+1)*sizeof(double));
for( loop = 0; loop < ismax+1; loop++ ) norms[loop] = 0.0;
/*
......@@ -7423,7 +7422,7 @@ double calculate_pfactor(const double* spectralField, long fieldTruncation, long
void scaleComplex(double *fpdata, int pcStart, int pcScale, int trunc, int inv)
{
double power;
double *scale = (double *) malloc((trunc+1)*sizeof(double));
double *scale = malloc((trunc+1)*sizeof(double));
int n, m;
int index;
......@@ -7482,7 +7481,7 @@ void scaleComplex(double *fpdata, int pcStart, int pcScale, int trunc, int inv)
void scatterComplex(double *fpdata, int pcStart, int trunc, int nsp)
{
double *fphelp = (double *) malloc(nsp*sizeof(double));
double *fphelp = malloc(nsp*sizeof(double));
int m, n;
int index, inext;
......@@ -7521,7 +7520,7 @@ void scatterComplex(double *fpdata, int pcStart, int trunc, int nsp)
void gatherComplex(double *fpdata, int pcStart, int trunc, int nsp)
{
double *fphelp = (double *) malloc(nsp*sizeof(double));
double *fphelp = malloc(nsp*sizeof(double));
int m, n;
int index, inext;
......@@ -8031,10 +8030,10 @@ int qu2reg2(double *pfield, int *kpoint, int klat, int klon,
int iregno, iquano, j210, j220, j230, j240, j225;
zline = (double *) malloc(2*klon*sizeof(double));
zline = malloc(2*klon*sizeof(double));
if ( zline == NULL ) SysError("No Memory!");
zwork = (double *) malloc(3*(2*klon+3)*sizeof(double));
zwork = malloc(3*(2*klon+3)*sizeof(double));
if ( zwork == NULL ) SysError("No Memory!");
/* Parameter adjustments */
......@@ -8288,13 +8287,13 @@ C
double *zwork = NULL;
int iregno, iquano, j210, j220, j230, j240, j225;
ztemp = (double *) malloc(klon*klat*sizeof(double));
ztemp = malloc(klon*klat*sizeof(double));
if ( ztemp == NULL ) SysError("No Memory!");
zline = (double *) malloc(2*klon*sizeof(double));
zline = malloc(2*klon*sizeof(double));
if ( zline == NULL ) SysError("No Memory!");
zwork = (double *) malloc(3*(2*klon+3)*sizeof(double));
zwork = malloc(3*(2*klon+3)*sizeof(double));
if ( zwork == NULL ) SysError("No Memory!");
/* Parameter adjustments */
......@@ -10156,7 +10155,7 @@ void repair1(unsigned char *gbuf, long gbufsize)
long nelem;
unsigned char *pbuf;
nelem = sourceLen/3;
pbuf = (unsigned char *) malloc(sourceLen);
pbuf = malloc(sourceLen);
for ( i = 0; i < nelem; i++ )
{
pbuf[3*i ] = source[ i];
......@@ -10417,7 +10416,7 @@ int gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufs
{
long nelem;
nelem = sourceLen/3;
pbuf = (unsigned char *) malloc(sourceLen);
pbuf = malloc(sourceLen);
for ( i = 0; i < nelem; i++ )
{
pbuf[ i] = source[3*i ];
......@@ -10756,7 +10755,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
long nelem;
unsigned char *pbuf;
nelem = tmpLen/3;
pbuf = (unsigned char *) malloc(tmpLen);
pbuf = malloc(tmpLen);
for ( i = 0; i < nelem; i++ )
{
pbuf[3*i ] = dest[ i];
......@@ -10837,7 +10836,7 @@ int gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbu
return (gribLen);
}
static const char grb_libvers[] = "1.6.3" " of ""Jan 8 2014"" ""19:55:18";
static const char grb_libvers[] = "1.6.4" " of ""Feb 26 2014"" ""11:29:56";
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