# (C) Copyright 2005- ECMWF.

# Generalised tile specifications
codetable[1] tileClassification ('4.242.table',masterDir,localDir) : dump, string_type;
codetable[2] typeOfTile ('4.252.table',masterDir,localDir) : dump, string_type;
unsigned[1]  numberOfUsedSpatialTiles=1 : dump; # Maximum number of tiles used in the entire grid
unsigned[1]  numberOfUsedTileAttributeCombinationsForTypeOfTile=1 : dump; # Number of tile attributes for a given tile in the gridbox
unsigned[1]  numberOfUsedTileAttributesForTileAttributeCombination=1 : dump; # Number of used attributes in a given combination
listOfUsedTileAttributesInCombination list(numberOfUsedTileAttributesForTileAttributeCombination){
    codetable[1] attributeOfTile ('4.241.table',masterDir,localDir) : dump;
}
unsigned[1] totalNumberOfTileAttributeCombinations=1 : dump; # Sum over all tile-attribute pairs over whole grid. >= 1
unsigned[1] tileIndex=1 : dump; # Local index of tile

concept combinationOfAttributesOfTile (unknown,"combinationOfAttributesOfTileConcept.def",conceptsDir2,conceptsDir1): no_copy,dump;
byte[16] uuidOfDataGroup : dump; # UUID of data group

# Extract long name (title) + part in brackets (grouping)
meta tileGrouping codetable_units(typeOfTile) : dump;
meta tileName codetable_title(typeOfTile) : dump;

alias uuid=uuidOfDataGroup;

alias ls.tile=typeOfTile;
alias ls.tileAttribute=combinationOfAttributesOfTile;

alias tile.tileIndex=tileIndex;
alias tile=typeOfTile;
alias tile.tile=tile;
alias tile.tileName=tileName;
alias tileAttribute=combinationOfAttributesOfTile;
alias tile.tileAttribute=tileAttribute;
alias nTiles=numberOfUsedSpatialTiles;
alias tile.nTiles=nTiles;
alias totalTileAttCombo=totalNumberOfTileAttributeCombinations;
alias tile.totalTileAttCombo=totalTileAttCombo;
alias nTileAttCombo=numberOfUsedTileAttributeCombinationsForTypeOfTile;
alias tile.nTileAttCombo=nTileAttCombo;
alias nTileAtt=numberOfUsedTileAttributesForTileAttributeCombination;
alias tile.nTileAtt=nTileAtt;

alias mars.tile=typeOfTile;
alias mars.tileattribute=tileAttribute;
constant paramTypeTile = "tile";
# unalias paramtype;
alias paramtype=paramTypeTile;
