Accessor: multdouble

This commit is contained in:
Shahram Najm 2024-02-19 13:34:38 +00:00
parent d9dacdd3d7
commit fcd51754fc
4 changed files with 18 additions and 18 deletions

View File

@ -89,7 +89,7 @@ if (horizontalCoordinateDefinition == 0) {
{
meta coordinateIndexNumber evaluate(coordinate4Flag+coordinate3Flag);
# levelist latitude longitude
# levelist latitude longitude
if (coordinateIndexNumber== 3) {
meta marsLatitude divdouble( coordinate1Start,1000000);
meta marsLongitude divdouble( coordinate2Start,1000000);
@ -145,15 +145,15 @@ if (horizontalCoordinateDefinition == 0) {
alias mars.range = marsRange;
}
}
# product
alias mars.product = coordAveragingTims;
# date
if (marsType == TYPE_OR && averaging1Flag == P_INST) {
#remove mars.date;
alias mars.date = verificationDate;
#remove mars.step;
constant stepZero = 0;
alias mars.step =stepZero;
}
# product
alias mars.product = coordAveragingTims;
# date
if (marsType == TYPE_OR && averaging1Flag == P_INST) {
#remove mars.date;
alias mars.date = verificationDate;
#remove mars.step;
constant stepZero = 0;
alias mars.step =stepZero;
}
}
}

View File

@ -73,12 +73,12 @@ _if (shapeOfTheEarth == 3){
# ECC-979
# The 'scale' accessor works with integers so rounds its first argument
# which is not what we want because the inputs are doubles with decimal
# expansions. So use the trick of dividing by 0.001 to multiply by 1000
# expansions.
#
# meta earthMajorAxisInMetres scale(earthMajorAxis, thousand, one, zero);
# meta earthMinorAxisInMetres scale(earthMinorAxis, thousand, one, zero);
meta earthMajorAxisInMetres divdouble(earthMajorAxis, 0.001);
meta earthMinorAxisInMetres divdouble(earthMinorAxis, 0.001);
meta earthMajorAxisInMetres multdouble(earthMajorAxis, 1000);
meta earthMinorAxisInMetres multdouble(earthMinorAxis, 1000);
}
_if (shapeOfTheEarth == 7){
# Major and minor axes specified (in m) by data producer

View File

@ -73,12 +73,12 @@ _if (shapeOfTheEarth == 3){
# ECC-979
# The 'scale' accessor works with integers so rounds its first argument
# which is not what we want because the inputs are doubles with decimal
# expansions. So use the trick of dividing by 0.001 to multiply by 1000
# expansions.
#
# meta earthMajorAxisInMetres scale(earthMajorAxis, thousand, one, zero);
# meta earthMinorAxisInMetres scale(earthMinorAxis, thousand, one, zero);
meta earthMajorAxisInMetres divdouble(earthMajorAxis, 0.001);
meta earthMinorAxisInMetres divdouble(earthMinorAxis, 0.001);
meta earthMajorAxisInMetres multdouble(earthMajorAxis, 1000);
meta earthMinorAxisInMetres multdouble(earthMinorAxis, 1000);
}
_if (shapeOfTheEarth == 7){
# Major and minor axes specified (in m) by data producer

View File

@ -112,7 +112,7 @@ static void init(grib_accessor* a, const long l, grib_arguments* c)
static int unpack_double(grib_accessor* a, double* val, size_t* len)
{
grib_accessor_multdouble* self = (grib_accessor_multdouble*)a;
const grib_accessor_multdouble* self = (grib_accessor_multdouble*)a;
int ret = GRIB_SUCCESS;
double value = 0;