Open edwardhartnett opened 2 years ago
If I remember correctly all floating-point values encoded in grib message must be ieee. Which floats are not converted to ieee?
Well above is a list of all places that mkieee is called in the library.
Most of them seem to be just converting one value, not an array. Only in specpack does an array get converted.
For example in pngpack.F90 we pack an array into our message:
call g2_sbytesc(ctemp, ifld, 0, nbits, 0, ndpts)
The contents of this pack are never run through mkieee(). If this were to run on a non-IEEE machine, the message would contain a lot of non-IEEE data, as far as I can see.
Am I missing something?
Has this code always been run on machines that use IEEE for floating point? So this doesn't matter? If so, why were the mkieee()/rdieee() functions developed in the first place?
Well above is a list of all places that mkieee is called in the library.
Most of them seem to be just converting one value, not an array. Only in specpack does an array get converted.
For example in pngpack.F90 we pack an array into our message:
call g2_sbytesc(ctemp, ifld, 0, nbits, 0, ndpts)
The contents of this pack are never run through mkieee(). If this were to run on a non-IEEE machine, the message would contain a lot of non-IEEE data, as far as I can see.In this specific call none of the argumens is floating point,
ifld
is integer.Am I missing something?
Has this code always been run on machines that use IEEE for floating point? So this doesn't matter? If so, why were the mkieee()/rdieee() functions developed in the first place?
I assume in the past this library was used on non-ieee architecture.
Currently we have a function called mkieee() which we call in a number of places:
Back in olden times, there were machines that did not use IEEE floating point. Are there any longer machines that don't use it?
Also it seems that only some floats are converted to IEEE. So who knows what the output would look like on a machine without IEEE float point. Some floats would be IEEE and many would not. So that would be confusing!
We should either remove mkieee()/rdieee() and check in configuration whether the machine supports IEEE and ifdef() out these calls on machines that don't use them.
@kgerheiser @DusanJovic-NOAA @Hang-Lei-NOAA @BrianCurtis-NOAA @BoiVuong-NOAA comments welcome.