Commit 48af4efc authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cgribexlib update

parent 0a63c031
/* Automatically generated by m214003 at 2015-04-22, do not edit */
/* Automatically generated by m214003 at 2015-09-14, do not edit */
/* CGRIBEXLIB_VERSION="1.7.2" */
/* CGRIBEXLIB_VERSION="1.7.3" */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) || defined (__clang__)
#pragma GCC diagnostic push
......@@ -1298,6 +1298,14 @@ int main(void)
#undef _ENABLE_SSE2
#undef GNUC_PUSH_POP
/*
icc -g -Wall -O3 -march=native -std=c99 -qopt-report=5 -DTEST_ENCODE encode_array.c
result on hama (icc 15.0.1):
float:
orig: val1: 1 val2: 1 val3: 2 valn: 66 time: 8.7936s
double:
orig: val1: 1 val2: 1 val3: 2 valn: 66 time: 13.6093s
avx: val1: 1 val2: 1 val3: 2 valn: 66 time: 3.90009s
gcc -g -Wall -O3 -march=native -std=c99 -DTEST_ENCODE encode_array.c
result on hama (gcc 4.8.2):
orig : val1: 1 val2: 1 val3: 2 valn: 66 time: 16.0471s
......@@ -1660,7 +1668,8 @@ double dtime()
static
void pout(char *name, int s, unsigned char *lgrib, long datasize, double tt)
{
printf("%8s: val1: %d val2: %d val3: %d valn: %d time: %gs\n", name, (int) lgrib[s*1+1], (int) lgrib[s*2+1], (int) lgrib[s*3+1], (int) lgrib[2*datasize-1], tt);
printf("%8s: val1: %d val2: %d val3: %d valn: %d time: %gs\n",
name, (int) lgrib[s*1+1], (int) lgrib[s*2+1], (int) lgrib[s*3+1], (int) lgrib[2*datasize-1], tt);
}
int main(void)
......@@ -2101,8 +2110,8 @@ void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
{
*kexp = 0;
*kmant = 0;
iexp = 0;
isign = 0;
// iexp = 0;
// isign = 0;
goto LABEL900;
}
......@@ -2191,8 +2200,8 @@ void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
Message("Value arbitrarily set to zero.");
*kexp = 0;
*kmant = 0;
iexp = 0;
isign = 0;
// iexp = 0;
// isign = 0;
goto LABEL900;
}
......@@ -3365,7 +3374,6 @@ void gribPrintSec1(int *isec0, int *isec1)
fprintf(grprsm, " Number of different time intervals used %5d\n", isec1[48]);
fprintf(grprsm, " List of different time intervals used:\n");
iprev = isec1[49];
icurr = 0;
unsigned icount = 0;
for (jloop = 1; jloop <= isec1[48]; jloop++)
{
......@@ -3855,7 +3863,7 @@ void gribPrintSec2DP(int *isec0, int *isec2, double *fsec2)
fprintf(grprsm, " Number of points along Y axis. %9d\n", isec2[2]);
fprintf(grprsm, " Latitude of sub-satellite point. %9d\n", isec2[3]);
fprintf(grprsm, " Longitude of sub-satellite point. %9d\n", isec2[4]);
iresol = isec2[17] + isec2[18];
//iresol = isec2[17] + isec2[18];
fprintf(grprsm, " Diameter of the earth in x direction. %9d\n", isec2[6]);
fprintf(grprsm, " Y coordinate of sub-satellite point. %9d\n", isec2[9]);
ibit = 8;
......@@ -5724,7 +5732,7 @@ int grib2Sections(unsigned char *gribbuffer, long gribbufsize, unsigned char **i
/* section 3 */
sec_len = GRIB2_SECLEN(section);
sec_num = GRIB2_SECNUM(section);
//sec_num = GRIB2_SECNUM(section);
//fprintf(stderr, "gds %d %ld\n", sec_num, sec_len);
*gdsp = section;
......@@ -10168,7 +10176,7 @@ int TEMPLATE(decodeBDS,T)(int decscale, unsigned char *bds, int *isec2, int *ise
{
/* no unpacked binary data present */
jup = kup = mup = 0;
//jup = kup = mup = 0;
/* octet number of start of packed data */
/* calculated from start of block 4 - 1 */
......@@ -10635,10 +10643,9 @@ void TEMPLATE(grib_decode,T)(int *isec0, int *isec1, int *isec2, T *fsec2, int *
if ( ISEC2_Reduced )
{
int nlon, nlat;
int lsect3, lperio = 1, lveggy;
int lperio = 1, lveggy;
int ilat;
int nvalues = 0;
int dlon;
nlat = ISEC2_NumLat;
nlon = ISEC2_RowLonPtr[0];
......@@ -10646,8 +10653,8 @@ void TEMPLATE(grib_decode,T)(int *isec0, int *isec1, int *isec2, T *fsec2, int *
for ( ilat = 1; ilat < nlat; ++ilat )
if ( ISEC2_RowLon(ilat) > nlon ) nlon = ISEC2_RowLon(ilat);
dlon = ISEC2_LastLon-ISEC2_FirstLon;
if ( dlon < 0 ) dlon += 360000;
// int dlon = ISEC2_LastLon-ISEC2_FirstLon;
// if ( dlon < 0 ) dlon += 360000;
if ( nvalues != ISEC4_NumValues )
{
......@@ -11101,7 +11108,7 @@ int TEMPLATE(decodeBDS,T)(int decscale, unsigned char *bds, int *isec2, int *ise
{
/* no unpacked binary data present */
jup = kup = mup = 0;
//jup = kup = mup = 0;
/* octet number of start of packed data */
/* calculated from start of block 4 - 1 */
......@@ -11568,10 +11575,9 @@ void TEMPLATE(grib_decode,T)(int *isec0, int *isec1, int *isec2, T *fsec2, int *
if ( ISEC2_Reduced )
{
int nlon, nlat;
int lsect3, lperio = 1, lveggy;
int lperio = 1, lveggy;
int ilat;
int nvalues = 0;
int dlon;
nlat = ISEC2_NumLat;
nlon = ISEC2_RowLonPtr[0];
......@@ -11579,8 +11585,8 @@ void TEMPLATE(grib_decode,T)(int *isec0, int *isec1, int *isec2, T *fsec2, int *
for ( ilat = 1; ilat < nlat; ++ilat )
if ( ISEC2_RowLon(ilat) > nlon ) nlon = ISEC2_RowLon(ilat);
dlon = ISEC2_LastLon-ISEC2_FirstLon;
if ( dlon < 0 ) dlon += 360000;
// int dlon = ISEC2_LastLon-ISEC2_FirstLon;
// if ( dlon < 0 ) dlon += 360000;
if ( nvalues != ISEC4_NumValues )
{
......@@ -11681,7 +11687,8 @@ void TEMPLATE(grib_decode,T)(int *isec0, int *isec1, int *isec2, T *fsec2, int *
static
void encodeIS(GRIBPACK *lGrib, long *gribLen)
{
long z = *gribLen;
long z;
// z = *gribLen;
lGrib[0] = 'G';
lGrib[1] = 'R';
......@@ -12157,7 +12164,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
if ( sizeof(T) == sizeof(double) )
{
grib_encode_array_2byte_double(datasize, lGrib, (const double *) data, zref, factor, &z);
grib_encode_array_2byte_double(datasize, lGrib, (const double * restrict) data, zref, factor, &z);
}
else
{
......@@ -12628,7 +12635,7 @@ void TEMPLATE(encode_array,T)(int numBits, size_t packStart, size_t datasize,
if ( sizeof(T) == sizeof(double) )
{
grib_encode_array_2byte_double(datasize, lGrib, (const double *) data, zref, factor, &z);
grib_encode_array_2byte_double(datasize, lGrib, (const double * restrict) data, zref, factor, &z);
}
else
{
......@@ -14203,7 +14210,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.7.2" " of ""Apr 22 2015"" ""13:44:04";
static const char grb_libvers[] = "1.7.3" " of ""Sep 14 2015"" ""10:58:44";
const char *
cgribexLibraryVersion(void)
{
......
! >>> Warning: This is a generated file. If you modify it, you get what you deserve. <<<
!
! Generated by "interfaces/f2003/bindGen.rb" from input file "src/cdi.h".
! Generated by "../interfaces/f2003/bindGen.rb" from input file "../src/cdi.h".
module mo_cdi
use iso_c_binding
......@@ -5675,7 +5675,7 @@ contains
integer(c_int) :: f_result
integer(c_int), value :: instID_dummy
integer(c_int), value :: modelgribID_dummy
character(kind = c_char, len = *), intent(inout) :: name_dummy
character(kind = c_char, len = *), intent(in) :: name_dummy
character(kind = c_char) :: name_temp(len(name_dummy) + 1)
integer :: name_i
interface
......@@ -5688,22 +5688,11 @@ contains
character(kind = c_char) :: name_dummy(*)
end function lib_modelInq
end interface
name_temp(len(name_dummy) + 1) = c_null_char
do name_i = len(name_dummy), 1, -1
if(name_dummy(name_i:name_i) /= ' ') exit
name_temp(name_i) = c_null_char
end do
do name_i = name_i, 1, -1
name_temp(name_i) = name_dummy(name_i:name_i)
end do
f_result = lib_modelInq(instID_dummy, modelgribID_dummy, name_temp)
do name_i = 1, len(name_dummy)
if(name_temp(name_i) == c_null_char) exit
name_dummy(name_i:name_i) = name_temp(name_i)
end do
do name_i = name_i, len(name_dummy)
name_dummy(name_i:name_i) = ' '
name_temp(name_i) = name_dummy(name_i:name_i)
end do
name_temp(len(name_dummy) + 1) = c_null_char
f_result = lib_modelInq(instID_dummy, modelgribID_dummy, name_temp)
end function modelInq
function modelInqNamePtr(modelID_dummy) result(f_result)
......
Supports Markdown
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