# Copyright 2005-2013 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# 
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#

label "Tile information";

#  Parameter category
codetable[1] parameterCategory ('4.1.[discipline:l].table',masterDir,localDir) : dump;

#  Parameter number
codetable[1] parameterNumber ('4.2.[discipline:l].[parameterCategory:l].table',masterDir,localDir)  : dump;
meta parameterUnits codetable_units(parameterNumber) : dump;
meta parameterName  codetable_title(parameterNumber) : dump;

# Tile specifications
codetable[1] tileClassification ('4.242.table',masterDir,localDir) : dump;
unsigned[1] totalNumberOfTileAttributePairs=1 : dump;
unsigned[1] numberOfTiles=1 : dump;
unsigned[1] tileIndex : dump;
unsigned[1] numberOfTileAttributes=1 : dump;
codetable[1] tileAttribute ('4.241.table',masterDir,localDir) : dump;
alias tnt=totalNumberOfTileAttributePairs;

#  Type of generating process
codetable[1] typeOfGeneratingProcess ('4.3.table',masterDir,localDir) : dump;

#  Background generating process identifier
# (defined by originating centre)
#DWD +4
if (centre == 78)  {
#codetable[1] backgroundProcess 'grib2/backgroundProcess.table' : dump ;
codetable[1] backgroundProcess ('backgroundProcess.table',masterDir,localDir) : dump ;
} else {
unsigned[1] backgroundProcess = 255 : edition_specific;
}
alias backgroundGeneratingProcessIdentifier=backgroundProcess;


#  Analysis or forecast generating processes identifier
# (defined by originating centre)
#DWD +4
if (centre == 78)  {
codetable[1] generatingProcessIdentifier ('generatingProcessIdentifier.table',masterDir,localDir) : dump ;
} else {
unsigned[1] generatingProcessIdentifier  : dump;
}


# Please note for the GRIB key "forecastTime" in the following definition file:
# - ecCodes version <= 2.33.0: unsigned 4-byte-integer
# - ecCodes verision > 2.33.0:   signed 4-byte-integer => its positive range of values is approximately halved
include "grib2/templates/template.4.forecast_time.def";
include "grib2/templates/template.4.point_in_time.def";
include "grib2/templates/template.4.horizontal.def";
