Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#212 closed Defect (fixed)

Bug in flex_extract v7.0.3 Fortran program "CONVERT2"

Reported by: anphi Owned by: anphi
Priority: critical Milestone: flex_extract_v7.1
Component: flex_extract Version: flex_extract_v7.0.3
Keywords: Cc:

Description

During a test with ERA5 and CERA with the gateway version (submitting the jobscript to the ecgate server) I had problems in the CONVERT2 Fortran program.

I received the following error with grib_api:

grib_ieee_to_long: Number is too large: x=3.35531257646599394446e+44 > xmax=3.40282346638528859812e+38
/scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_ieeefloat.c at line 147: assertion failure Assert(0)

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x3dd543250f in ???
#1  0x3dd5432495 in ???
#2  0x3dd5433c74 in ???
#3  0x7ffff7b38a42 in grib_fail
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_errors.c:111
#4  0x7ffff7b2241b in grib_ieee_to_long
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_ieeefloat.c:147
#5  0x7ffff7b226c7 in grib_ieee_nearest_smaller_to_long
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_ieeefloat.c:237
#6  0x7ffff7b2283e in grib_nearest_smaller_ieee_float
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_ieeefloat.c:280
#7  0x7ffff7b01b1e in pack_double
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_accessor_class_data_simple_packing.c:678
#8  0x7ffff7b0627d in pack_double
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_accessor_class_data_g2simple_packing.c:206
#9  0x7ffff7b3726a in _grib_set_double_array_internal
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_value.c:559
#10  0x7ffff7b3731b in _grib_set_double_array
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_value.c:586
#11  0x7ffff7b373e0 in grib_set_double_array_internal
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_value.c:608
#12  0x7ffff7b0ef3a in pack_double
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_accessor_class_data_apply_bitmap.c:311
#13  0x7ffff7b3726a in _grib_set_double_array_internal
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_value.c:559
#14  0x7ffff7b3731b in _grib_set_double_array
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_value.c:586
#15  0x7ffff7b37474 in __grib_set_double_array
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/src/grib_value.c:679
#16  0x7ffff7deec6c in grib_f_set_real8_array_
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/grib_api/fortran/grib_fortran.c:2619
#17  0x7ffff7df067a in __grib_api_MOD_grib_set_real8_array
    at /scratch/ma/deploy/metabuilds/ecflow-metab_5062/ecgb/GNU.63/grib_api/builds/fortran/grib_f90.f90:2953
#18  0x409733 in __rwgrib2_MOD_writelatlon
    at /home/ms/at/km4a/flex_extract_v7.1/source/fortran/rwGRIB2.f90:154
#19  0x417b61 in preconvert
    at /home/ms/at/km4a/flex_extract_v7.1/source/fortran/preconvert.f90:682
#20  0x418bf9 in main
    at /home/ms/at/km4a/flex_extract_v7.1/source/fortran/preconvert.f90:53 

and the following error while using eccodes:

ECCODES ERROR   :  Maximum value out of range: -nan
ECCODES ERROR   :  unable to compute packing parameters

ECCODES ERROR   :  unable to set double array codedValues (Encoding invalid)
ECCODES ERROR   :  set: values Encoding invalid
 readspectral:            1  records read
 readlatlon:           76  records read
STATISTICS:  97406.7212 97402.4837   908.5665
 readlatlon:           38  records read
 readlatlon:           38  records read
 readlatlon:           38  records read 

Change History (4)

comment:1 Changed 6 years ago by anphi

  • Owner set to anphi
  • Status changed from new to accepted

comment:2 Changed 6 years ago by anphi

Problem was:

The gfortran compiler I used at the ecgate server did not initialize the fortran array to 0! This led to very high values and produced the error in the grib_api/eccodes library.

Solution :

Write the line feld=0. in file rwGRIB2.f90 in line 25, right before the function grib_open_file is called. Then re-compile/re-install the Fortran program CONVERT2.

New Version can be found here:

An updated version is in the git repository master branch.

comment:3 Changed 6 years ago by anphi

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:4 Changed 6 years ago by pesei

  • Milestone set to flex_extract_v7.1
Note: See TracTickets for help on using tickets.
hosted by ZAMG