ECC-1212: Tests

This commit is contained in:
Shahram Najm 2022-06-07 22:16:47 +01:00
parent ba4ca05095
commit 9cbf3767d7
2 changed files with 34 additions and 3 deletions

View File

@ -63,11 +63,11 @@ if (numberOfForecastsUsedInLocalTime == 1) {
# hourOfForecastUsedInLocalTime, minuteOfForecastUsedInLocalTime, secondOfForecastUsedInLocalTime) : hidden;
#meta dateTimeOfLocalTime julian_date(dataDate, dataTime) : hidden;
meta jd1 julian_day(dateOfForecastUsedInLocalTime,
meta jdSelected julian_day(dateOfForecastUsedInLocalTime,
hourOfForecastUsedInLocalTime, minuteOfForecastUsedInLocalTime, secondOfForecastUsedInLocalTime);
meta jd2 julian_day(dataDate, hour,minute,second);
meta jdLocal julian_day(dataDate, hour,minute,second);
transient diffInDays = (jd2 - jd1) : hidden; # float
transient diffInDays = (jdLocal - jdSelected) : hidden; # float
transient diffInHours = (diffInDays * 1440 + 0.5)/60 : hidden;
meta _endStep round(diffInHours, 10): dump, long_type;
transient endStep = _endStep; # needed to force it to be integer

View File

@ -80,5 +80,36 @@ cat $tempOut
diff -w $tempRef $tempOut
# numberOfForecastsUsedInLocalTime > 1
# ------------------------------------
cat > $tempFilt <<EOF
set tablesVersion=27;
set localTablesVersion = 1;
set typeOfProcessedData = "fc";
set significanceOfReferenceTime = 4;
set year = 2022;
set month = 6;
set day = 7;
set hour = 7;
set productDefinitionTemplateNumber = 88;
set numberOfForecastsUsedInLocalTime = 3;
set forecastTime = 24;
set localTimeMethod = 1;
set yearOfForecastUsedInLocalTime = {2022, 2022, 2022};
set monthOfForecastUsedInLocalTime = {12, 6, 5};
set dayOfForecastUsedInLocalTime = {7, 7, 5};
set hourOfForecastUsedInLocalTime = {6, 3, 12};
write;
EOF
${tools_dir}/grib_filter -o $tempGrib $tempFilt $sample_grib2
grib_check_key_equals $tempGrib selectedFcIndex,step '1 4'
grib_check_key_equals $tempGrib mars.date,mars.time '20220607 300'
# Clean up
rm -f $tempGrib $tempFilt $tempOut $tempRef