# 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.
#

constant GRIBEXSection1Problem = 120 - section1Length ;

template mars_labeling "grib1/mars_labeling.def";

unsigned[1] yearOfReference  = yearOfCentury : dump;
unsigned[1] monthOfReference = month : dump;
unsigned[1] dayOfReference = day : dump;
unsigned[1] hourOfReference = hour : dump;
unsigned[1] minuteOfReference = minute : dump;
unsigned[1] centuryOfReference = centuryOfReferenceTimeOfData : dump;
transient secondsOfReference = 0 ;

unsigned[1] numberOfForcasts=0 : dump;
unsigned[1] numberOfAnalysis=1 : dump;

if (numberOfForcasts) {
	unsigned[3] forecastSteps[numberOfForcasts] : dump;
}
if (numberOfAnalysis) {
	signed[3] analysisOffsets[numberOfAnalysis] : dump;
}

padto padding_local_35(offsetSection1 + 120);

meta dateOfReference  g1date(centuryOfReference,yearOfReference,monthOfReference,dayOfReference) : dump;
meta timeOfReference  time(hourOfReference,minuteOfReference,secondsOfReference) : dump;

if (indicatorOfTypeOfLevel==160) {
	alias mars.levelist = level;
}
