ECC-457: GRIB1 to GRIB2 conversion: total precipitation

Revert previous change as it broke IFS
This commit is contained in:
Shahram Najm 2017-04-11 11:27:59 +01:00
parent 751db43e2e
commit 5d6dddeee1
5 changed files with 60 additions and 47 deletions

View File

@ -32,8 +32,3 @@
"avgas" = {timeRangeIndicator=128;}
"avgad" = {timeRangeIndicator=130;}
"avgid" = {timeRangeIndicator=133;}
# ECC-457: ECMWF Total Precipitation
"accum" = {timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;}
"accum" = {timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;}

View File

@ -0,0 +1,7 @@
# Concept stepTypeForConversion for ECMWF
# set uses the FIRST one
# get returns the LAST match
# ECC-457: ECMWF Total Precipitation
"accum" = {timeRangeIndicator=0;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;}
"accum" = {timeRangeIndicator=1;indicatorOfParameter=228;gribTablesVersionNo=128;centre=98;}

View File

@ -102,7 +102,6 @@ else
alias vertical.bottomLevel = level;
alias ls.level=level;
alias lev=level;
}
if( indicatorOfTypeOfLevel == 109 ||
@ -144,9 +143,9 @@ codetable[1] subCentre 'grib1/0.[centre].table' : dump;
if(table2Version >= 128) {
_if (centre != 98 && subCentre == 98) {
alias centreForTable2 = subCentre;
} else {
} else {
alias centreForTable2 = centre;
}
}
} else {
alias centreForTable2 = WMO;
}
@ -186,7 +185,7 @@ meta julianDay julian_day(dataDate,hour,minute,second) : edition_specific;
codetable[1] stepUnits 'stepUnits.table' = 1 : transient,dump,no_copy;
concept_nofail stepType (timeRangeIndicator, "stepType.def", conceptsMasterDir, conceptsLocalDirAll)
concept_nofail stepType (timeRangeIndicator, "stepType.def", conceptsMasterDir, conceptsLocalDirAll);
#alias stepTypeInternal=stepType;
#alias lengthOfTimeRange=numberIncludedInAverage;
@ -276,7 +275,6 @@ if(((section1Length > 40) or new() or setLocalDefinition> 0) and deleteLocalDefi
section_padding localExtensionPadding : read_only;
}
}
}
else
{
@ -311,4 +309,10 @@ alias time.startStep=startStep;
alias time.endStep=endStep;
alias time.stepType=stepType;
# ECC-457: GRIB1 to GRIB2 conversion
concept_nofail stepTypeForConversion (unknown, "stepTypeForConversion.def", conceptsMasterDir, conceptsLocalDirAll);
if (stepTypeForConversion is "accum" ) {
alias productDefinitionTemplateNumber=eight;
}
meta md5Section1 md5(offsetSection1,section1Length);

View File

@ -0,0 +1,3 @@
# Concept stepTypeForConversion
# See ECC-457
"unknown" = {dummy=0;}

View File

@ -94,6 +94,10 @@ ${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=m $grib2_sample $temp
unit=`${tools_dir}/grib_get -p indicatorOfUnitOfTimeRange $temp`
[ "$unit" = "0" ]
# ECC-457
input=${data_dir}/tp_ecmwf.grib
stepRange=`${tools_dir}/grib_get -w count=1 -p stepRange,startStep,endStep,stepType $input`
[ "$stepRange" = "12 12 12 instant" ]
rm -f $temp
rm -f $grib2File.p8tmp ${grib2File}.tmp x.grib