1# Copyright 2005-2018 ECMWF.
2#
3# This software is licensed under the terms of the Apache Licence Version 2.0
4# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5#
6# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
7# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
8#
9
10# START 1/local.98.4 ----------------------------------------------------------------------
11# LOCAL 98 4
12#
13# localDefinitionTemplate_004
14# ---------------------------
15#
16# Description                Octet    Code    Ksec1    Count
17# -----------                -----    ----    -----    -----
18#localDefinitionNumber                41  I1  37  -
19#class                                42  I1  38  -
20#type                                 43  I1  39  -
21#stream                               44  I2  40  -
22#experimentVersionNumber              46  A4  41  -
23#! if stream == 1090
24#if1                                  -   IF_EQ   1090    stream
25#ensembleMemberNumber                 50  I2  42  -
26#setToZeroForStream1090Unpacking      n/a PAD 43  1
27#endif1                               -   ENDIF   if1
28#! if stream != 1090
29#if2                                  -   IF_NEQ  1090    stream
30#ensembleMemberNumber                 50  I1  42  -
31#setToZero                            51  PAD 43  1
32#endif2                               -   ENDIF   if2
33#flagShowingPostAuxiliaryArrayInUse   52  F1  -   1
34#systemNumber                         53  I1  44  -
35#methodNumber                         54  I1  45  -
36#!  Coordinate structure definition
37#spaceUnitFlag                        55  I1  46  -
38#verticalCoordinateDefinition         56  I1  47  -
39#horizontalCoordinateDefinition       57  I1  48  -
40#timeUnitFlag                         58  I1  49  -
41#timeCoordinateDefinition             59  I1  50  -
42#!  Position definition:  mixed coordinates
43#mixedCoordinateFieldFlag             60  I1  51  -
44#coordinate1Flag                      61  I1  52  -
45#averagingFlag                        62  I1  53  -
46#positionOfLevel1                     63  S4  54  -
47#positionOfLevel2                     67  S4  55  -
48#coordinate2Flag                      71  I1  56  -
49#averagingFlag                        72  I1  57  -
50#positionOfLevel1                     73  S4  58  -
51#positionOfLevel2                     77  S4  59  -
52#!  Data grid definitions
53#coordinate3Flag                      81  I1  60  -
54#coordinate4Flag                      82  I1  61  -
55#coordinate4OfFirstGridPoint          83  S4  62  -
56#coordinate3OfFirstGridPoint          87  S4  63  -
57#coordinate4OfLastGridPoint           91  S4  64  -
58#coordinate3OfLastGridPoint           95  S4  65  -
59#iIncrement                           99  S4  66  -
60#jIncrement                           103 S4  67  -
61#flagForIrregularGridCoordinateList   107 I1  68  -
62#flagForNormalOrStaggeredGrid         108 I1  69  -
63#!  Auxiliary information
64#flagForAnyFurtherInformation         109 I1  70  -
65#numberInHorizontalCoordinates        110 I1  71  -
66#numberInMixedCoordinateDefinition    111 I2  72  -
67#numberInTheGridCoordinateList        113 I2  73  -
68#numberInTheAuxiliaryArray            115 I2  74  -
69#!   Horizontal coordinate definition
70#horizontalCoordinateSupplement       -   LP_S4   -   numberInHorizontalCoordinates
71#!  Mixed coordinate definition
72#mixedCoordinateDefinition            -   LP_S4   -   numberInMixedCoordinateDefinition
73#!   Grid coordinate list
74#gridCoordinateList                   -   LP_S4   -   numberInTheGridCoordinateList
75#!   Auxiliary array
76#auxiliaryArray                       -   LP_I4   -   numberInTheAuxiliaryArray
77#!  Post-auxiliary array
78#if3                                  -   IF_EQ   1   flagShowingPostAuxiliaryArrayInUse
79#sizeOfPostAuxiliaryArray             -   I4  -   -
80#arrayValues                          -   LP_I4M1 -   sizeOfPostAuxiliaryArray
81#endif3                               -   ENDIF   if3
82##
83
84constant GRIBEXSection1Problem = 0 ;
85
86template mars_labeling "grib1/mars_labeling.def";
87transient localFlag=1 : hidden ;
88
89constant oceanStream = 1090;
90
91if(marsStream == oceanStream)
92{
93 unsigned[2] perturbationNumber : dump ;
94}
95
96if(marsStream != oceanStream)
97{
98 unsigned[1] perturbationNumber : dump ;
99 pad padding_loc4_2(1);
100}
101
102unsigned[1] flagShowingPostAuxiliaryArrayInUse;
103# 'grib1/ocean.1.table';
104
105unsigned[1] systemNumber : dump ;
106alias system=systemNumber;
107
108unsigned[1] methodNumber : dump ;
109
110
111#
112# Coordinate structure definition
113#
114
115unsigned[1] spaceUnitFlag : dump ;
116
117unsigned[1] verticalCoordinateDefinition : dump ;
118
119unsigned[1] horizontalCoordinateDefinition : dump ;
120
121unsigned[1] timeUnitFlag : dump ;
122
123unsigned[1] timeCoordinateDefinition : dump ;
124
125
126#
127# Position definition:  mixed coordinates
128#
129
130unsigned[1] mixedCoordinateFieldFlag : dump ;
131
132unsigned[1] coordinate1Flag : dump ;
133
134unsigned[1] averaging1Flag : dump ;
135
136signed[4] coordinate1Start : dump ;
137
138signed[4] coordinate1End  : dump ;
139
140unsigned[1] coordinate2Flag : dump ;
141
142unsigned[1] averaging2Flag : dump ;
143
144signed[4] coordinate2Start : dump ;
145
146signed[4] coordinate2End : dump ;
147
148#
149# Data grid definitions
150#
151
152unsigned[1] coordinate3Flag : dump ;
153
154unsigned[1] coordinate4Flag : dump ;
155
156signed[4] coordinate4OfFirstGridPoint  : dump;
157
158signed[4] coordinate3OfFirstGridPoint : dump ;
159
160signed[4] coordinate4OfLastGridPoint  : dump;
161
162signed[4] coordinate3OfLastGridPoint : dump ;
163
164signed[4] iIncrement : dump ;
165
166signed[4] jIncrement  : dump;
167
168flags[1] flagForIrregularGridCoordinateList 'grib1/ocean.1.table' : dump;
169
170flags[1] flagForNormalOrStaggeredGrid 'grib1/ocean.1.table' : dump;
171
172#
173# Auxiliary information
174#
175
176flags[1] flagForAnyFurtherInformation 'grib1/ocean.1.table' : dump;
177
178unsigned[1] numberInHorizontalCoordinates  : dump;
179
180unsigned[2] numberInMixedCoordinateDefinition  : dump;
181
182unsigned[2] numberInTheGridCoordinateList  : dump;
183
184unsigned[2] numberInTheAuxiliaryArray : dump ;
185
186#
187# Horizontal coordinate definition
188#
189
190
191unsigned[4] horizontalCoordinateSupplement[numberInHorizontalCoordinates] : dump;
192
193#
194# Mixed coordinate definition
195#
196
197
198unsigned[4] mixedCoordinateDefinition[numberInMixedCoordinateDefinition] : dump;
199
200#
201# Grid coordinate list
202#
203if (numberInTheGridCoordinateList>0) {
204
205  signed[4] gridCoordinate[numberInTheGridCoordinateList] : dump;
206}
207
208#
209# Auxiliary array
210#
211
212unsigned[4] auxiliary[numberInTheAuxiliaryArray] : dump;
213
214#
215# Post-auxiliary array
216#
217
218constant postAuxiliaryArrayPresent = 1;
219
220if (flagShowingPostAuxiliaryArrayInUse == postAuxiliaryArrayPresent){
221    unsigned[4] sizeOfPostAuxiliaryArrayPlusOne  : dump;
222    meta sizeOfPostAuxiliaryArray evaluate(sizeOfPostAuxiliaryArrayPlusOne - 1);
223	if (sizeOfPostAuxiliaryArray>0) {
224      unsigned[4] postAuxiliary[sizeOfPostAuxiliaryArray] : dump;
225
226      if (sizeOfPostAuxiliaryArray>3) {
227        meta referenceDate element(postAuxiliary,3);
228      }
229    } else {
230      transient referenceDate=0;
231    }
232
233}
234alias hdate = dataDate;
235
236
237
238template local_use "grib1/mars_labeling.4.def";
239# END   1/local.98.4 ----------------------------------------------------------------------
240