diff --git a/definitions/grib2/stepUnits.def b/definitions/grib2/stepUnits.def new file mode 100644 index 000000000..68efa462a --- /dev/null +++ b/definitions/grib2/stepUnits.def @@ -0,0 +1,7 @@ +# alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 +# template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; +# codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; + +meta stepUnits optimal_step_units(forecastTime,indicatorOfUnitOfTimeRange,lengthOfTimeRange,indicatorOfUnitForTimeRange) : transient,dump; +transient startStepUnit = 255 : hidden; # 255 means MISSING. See code table 4.4 +transient endStepUnit = 255 : hidden; diff --git a/definitions/grib2/template.4.20.def b/definitions/grib2/template.4.20.def index 83db46bc5..b739bf6bb 100644 --- a/definitions/grib2/template.4.20.def +++ b/definitions/grib2/template.4.20.def @@ -15,9 +15,7 @@ unsigned[1] numberOfRadarSitesUsed : dump; codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +include "grib2/stepUnits.def" # Site latitude (in microdegrees) unsigned[4] siteLatitude : dump; diff --git a/definitions/grib2/template.4.forecast_time.def b/definitions/grib2/template.4.forecast_time.def index 8dc62f16b..f228d0a9e 100644 --- a/definitions/grib2/template.4.forecast_time.def +++ b/definitions/grib2/template.4.forecast_time.def @@ -12,9 +12,7 @@ alias minutesAfterReferenceTimeOfDataCutoff=minutesAfterDataCutoff; codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; -meta stepUnits optimal_step_units(forecastTime,indicatorOfUnitOfTimeRange,lengthOfTimeRange,indicatorOfUnitForTimeRange) : transient,dump; -transient startStepUnit = 255 : hidden; # 255 means MISSING. See code table 4.4 -transient endStepUnit = 255 : hidden; +include "grib2/stepUnits.def"; # Forecast time in units defined by previous octet (GRIB-29: supports negative forecast time) signed[4] forecastTime : dump; diff --git a/definitions/grib2/template.4.forecast_time_44.def b/definitions/grib2/template.4.forecast_time_44.def index 0ad48c53b..aa35f543e 100644 --- a/definitions/grib2/template.4.forecast_time_44.def +++ b/definitions/grib2/template.4.forecast_time_44.def @@ -14,9 +14,7 @@ alias minutesAfterReferenceTimeOfDataCutoff=minutesAfterDataCutoff; codetable[1] indicatorOfUnitOfTimeRange ('4.4.table',masterDir,localDir) : dump; alias indicatorOfUnitForForecastTime = indicatorOfUnitOfTimeRange; -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +include "grib2/stepUnits.def"; # Forecast time in units defined by previous octet # See GRIB-530: We have to make a special case for the error in WMO spec diff --git a/definitions/grib2/template.4.localtime.def b/definitions/grib2/template.4.localtime.def index 3432f8b6a..a3e47c754 100644 --- a/definitions/grib2/template.4.localtime.def +++ b/definitions/grib2/template.4.localtime.def @@ -3,9 +3,8 @@ remove is_localtime; transient is_localtime=1; -alias defaultStepUnits = one; # 1 means Hour. See code table 4.4 -template_nofail default_step_units "grib2/localConcepts/[centre:s]/default_step_units.def"; -codetable[1] stepUnits 'stepUnits.table' = defaultStepUnits : transient,dump,no_copy; +#include "grib2/stepUnits.def"; + alias time.stepUnits = stepUnits; # Method used to calculate the field value at the local time specified in section 1