mirror of https://github.com/ecmwf/eccodes.git
Refactoring and DebugAssert
This commit is contained in:
parent
a38d54ccd2
commit
df3e8430ed
|
@ -360,9 +360,11 @@ static int init_oblate(grib_handle* h,
|
||||||
latRad = -M_PI_2;
|
latRad = -M_PI_2;
|
||||||
}
|
}
|
||||||
lonRad = adjust_lon_radians(theta / ns + LoVInRadians);
|
lonRad = adjust_lon_radians(theta / ns + LoVInRadians);
|
||||||
|
if (i == 0 && j == 0) {
|
||||||
|
DebugAssert(fabs(latFirstInRadians - latRad) <= EPSILON);
|
||||||
|
}
|
||||||
latDeg = latRad * RAD2DEG; /* Convert to degrees */
|
latDeg = latRad * RAD2DEG; /* Convert to degrees */
|
||||||
lonDeg = lonRad * RAD2DEG;
|
lonDeg = normalise_longitude_in_degrees(lonRad * RAD2DEG);
|
||||||
lonDeg = normalise_longitude_in_degrees(lonDeg);
|
|
||||||
self->lons[index] = lonDeg;
|
self->lons[index] = lonDeg;
|
||||||
self->lats[index] = latDeg;
|
self->lats[index] = latDeg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,10 +215,12 @@ static int init_mercator(grib_handle* h,
|
||||||
grib_context_free(h->context, self->lons);
|
grib_context_free(h->context, self->lons);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
lonRad = adjust_lon_radians(orientationInRadians + _x / (earthMajorAxisInMetres * m1));
|
lonRad = adjust_lon_radians(orientationInRadians + _x / (earthMajorAxisInMetres * m1));
|
||||||
|
if (i == 0 && j == 0) {
|
||||||
|
DebugAssert(fabs(latFirstInRadians - latRad) <= EPSILON);
|
||||||
|
}
|
||||||
latDeg = latRad * RAD2DEG; /* Convert to degrees */
|
latDeg = latRad * RAD2DEG; /* Convert to degrees */
|
||||||
lonDeg = lonRad * RAD2DEG;
|
lonDeg = normalise_longitude_in_degrees(lonRad * RAD2DEG);
|
||||||
lonDeg = normalise_longitude_in_degrees(lonDeg);
|
|
||||||
self->lons[index] = lonDeg;
|
self->lons[index] = lonDeg;
|
||||||
self->lats[index] = latDeg;
|
self->lats[index] = latDeg;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue