# Copyright 2005-2018 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.
#

# GRID DEFINITION Mercator projection
# grib 1 -> 2
constant gridDefinitionTemplateNumber     = 20;

signed[2] Ni : dump;
alias numberOfPointsAlongAParallel= Ni ;
alias Nx =Ni;
alias geography.Ni=Ni;

signed[2] Nj : dump;
alias numberOfPointsAlongAMeridian=Nj;
alias Nx=Nj;
alias geography.Nj=Nj;

include "grib1/grid_first_last_resandcomp.def";

signed[3] Latin : edition_specific,no_copy;
meta geography.LaDInDegrees scale(Latin,oneConstant,grib1divider,truncateDegrees) : dump;

pad padding_grid1_1(1);

# for change_scanning_direction
alias yFirst=latitudeOfFirstGridPointInDegrees;
alias yLast=latitudeOfLastGridPointInDegrees;
alias xFirst=longitudeOfFirstGridPointInDegrees;
alias xLast=longitudeOfLastGridPointInDegrees;

include "grib1/scanning_mode.def";

signed[3] DiInMetres   : dump;
alias longitudinalDirectionGridLength=DiInMetres;
alias Di=DiInMetres;
alias geography.DiInMetres=DiInMetres;

signed[3] DjInMetres   : dump;
alias latitudinalDirectionGridLength=DjInMetres;
alias Dj=DjInMetres;
alias geography.DjInMetres=DjInMetres;

constant orientationOfTheGridInDegrees=0;

pad padding_grid1_2(8);

meta numberOfDataPoints number_of_points(Ni,Nj) : dump;
alias numberOfPoints=numberOfDataPoints;
meta numberOfValues number_of_values(values,bitsPerValue,numberOfDataPoints,bitmapPresent,bitmap,numberOfCodedValues) : dump;
#alias ls.valuesCount=numberOfValues;

