From 8900e1242952df46753f636297682d396644f26a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 11 Aug 2022 11:16:24 +0100 Subject: [PATCH] Documentation --- src/grib_accessor_class_bufr_extract_datetime_subsets.c | 3 ++- src/grib_accessor_class_g2end_step.c | 2 +- src/grib_date.c | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/grib_accessor_class_bufr_extract_datetime_subsets.c b/src/grib_accessor_class_bufr_extract_datetime_subsets.c index 7fdc451ee..2658fce54 100644 --- a/src/grib_accessor_class_bufr_extract_datetime_subsets.c +++ b/src/grib_accessor_class_bufr_extract_datetime_subsets.c @@ -157,7 +157,8 @@ static int get_native_type(grib_accessor* a) /* Convert input date to Julian number. If date is invalid, return -1 */ static double date_to_julian(long year, long month, long day, long hour, long minute, double second) { - double result = 0; + double result = 0; /* Julian number in units of days */ + /* For validating the date/time, we specify seconds as an integer */ long lSecond = (long)second; grib_datetime_to_julian(year, month, day, hour, minute, lSecond, &result); diff --git a/src/grib_accessor_class_g2end_step.c b/src/grib_accessor_class_g2end_step.c index 9ecd541d6..1f69a7a60 100644 --- a/src/grib_accessor_class_g2end_step.c +++ b/src/grib_accessor_class_g2end_step.c @@ -561,7 +561,7 @@ static int pack_long(grib_accessor* a, const long* val, size_t* len) if (err != GRIB_SUCCESS) return err; - dstep = (((double)(*val)) * u2s[unit]) / u2s[2]; + dstep = (((double)(*val)) * u2s[unit]) / u2s[2]; /* in days */ dend += dstep; err = grib_julian_to_datetime(dend, &year_of_end_of_interval, &month_of_end_of_interval, diff --git a/src/grib_date.c b/src/grib_date.c index 0f3cb851c..acb7ca76e 100644 --- a/src/grib_date.c +++ b/src/grib_date.c @@ -9,8 +9,11 @@ */ /*************************************************************************** - * Enrico Fucile * - * * + * + * The Julian date of any instant is the Julian day number plus the fraction of a day + * since the preceding noon in Universal Time. + * Julian dates are expressed as a Julian day number with a decimal fraction added. + * ***************************************************************************/ #include "grib_api_internal.h"