Skip to content

Updates to dataset frequency and time interval errors #913

@mauzey1

Description

@mauzey1

In response to #912, we want to change the way CMOR reports errors for dataset frequency and time axis interval mismatches.

Currently, CMOR will use a default time interval of 0 days if no frequency is defined leading to a time interval error when defining a time axis or writing data to a variable. This error should make it more clear that the dataset attribute frequency was not defined either by the user or the variable table.

Additionally, we would like to reword the current error message for the frequency not matching the time axis interval.

An example of the current error message:

Error: approximate time axis interval is defined as 2592000.000000 seconds (30.000000 days), for value 1 we got a difference of
86400.000000 seconds (1.000000 days), which is 96.666667 % , seems too big, check your values       

Proposed format change:

Error: Dataset was defined with the frequency 'mon', which has an interval of 30.0 days, but the time axis contains an interval of 1.0 days.
Please adjust the time values in your data to be consistent with the selected frequency.

These error messages are generated from the following section in cmor_axes.c.

cmor/Src/cmor_axes.c

Lines 1571 to 1603 in 4e7f1f3

if (tmp > cmor_axes[axis_id].approx_interval_error) {
if (isbounds == 1) {
cmor_handle_error_variadic(
"approximate time axis interval is defined as %f "
"seconds (%s), for value %i we got a difference "
"(based on bounds) of %f seconds, (%f %s), which "
"is %f %% , seems too big, check your values",
CMOR_CRITICAL,
interv, interval, i + 1, diff2, diff, ctmp2,
tmp * 100.);
} else {
cmor_handle_error_variadic(
"approximate time axis interval is defined as %f "
"seconds (%s), for value %i we got a difference of "
"%f seconds (%f %s), which is %f %% , seems too big, "
"check your values",
CMOR_CRITICAL,
interv, interval, i + 1, diff2, diff, ctmp2,
tmp * 100.);
}
} else if (tmp > cmor_axes[axis_id].approx_interval_warning) {
/* -------------------------------------------------------------------- */
/* more than 10% diff issues a warning */
/* -------------------------------------------------------------------- */
cmor_handle_error_variadic(
"approximate time axis interval is defined as %f "
"seconds (%s), for value %i we got a difference of %f "
"seconds (%f %s), which is %f %% , seems too big, check "
"your values",
CMOR_WARNING,
interv, interval, i + 1, diff2, diff, ctmp2, tmp * 100.);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions