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.7.1 ----------------------------------------------------------------------
11# LOCAL 7 1
12#
13# KWBC localDefinitionTemplate_001
14# --------------------------------
15#
16# Description            Octet    Code    Ksec1    Count
17# -----------            -----    ----    -----    -----
18#
19#sectionLength                   1       L3      n/a     ignore
20#applicationIdentifier           41      I1      37      -
21#type                            42      I1      38      -
22#identificationNumber            43      I1      39      -
23#productIdentifier               44      I1      40      -
24#spatialSmoothingOfProduct       45      I1      41      -
25#!
26#if_ge_46                        -       IF_GT   45      sectionLength
27#probProductDefinition           46      I1      42      -
28#probabilityType                 47      I1      43      -
29#lowerLimit                      48      I4      44      -
30#upperLimit                      52      I4      45      -
31#padding                         56      PAD     n/a     5
32#endif_ge_46                     -       ENDIF   if_ge_46
33#!
34#if_ge_61                        -       IF_GT   60      sectionLength
35#ensembleSize                    61      I1      46      -
36#clusterSize                     62      I1      47      -
37#numberOfClusters                63      I1      48      -
38#clusteringMethod                64      I1      49      -
39#northLatitudeOfCluster          65      S3      50      -
40#southLatitudeOfCluster          68      S3      51      -
41#westLongitudeOfCluster          71      S3      52      -
42#eastLongitudeOfCluster          74      S3      53      -
43#clusterMember1                  77      I1      54      -
44#clusterMember2                  78      I1      55      -
45#clusterMember3                  79      I1      56      -
46#clusterMember4                  80      I1      57      -
47#clusterMember5                  81      I1      58      -
48#clusterMember6                  82      I1      59      -
49#clusterMember7                  83      I1      60      -
50#clusterMember8                  84      I1      61      -
51#clusterMember9                  85      I1      62      -
52#clusterMember10                 86      I1      63      -
53#endif_ge_61                     -       ENDIF   if_ge_61
54
55#applicationIdentifier           1= ensemble
56
57#unsigned[1] applicationIdentifier : dump ; # 1= ensemble
58unsigned[1] type : dump ;                  # 1=unperturbed control forecast,2=individual negative perturbed fcst 3=individual positive perturbed fcst, 4=cluster, 5=whole cluster
59unsigned[1] identificationNumber : dump ;  # if(type=1) { 1=high resolution control fcst, 2=low resolution control fcst} else { ensemble number }
60unsigned[1] productIdentifier  : dump;     # 1= full field, 2=weighted mean, 3= etc
61unsigned[1] spatialSmoothingOfProduct : dump ;
62#
63constant sectionLengthLimitForProbability = 45 : dump;
64if(section1Length > sectionLengthLimitForProbability)
65{
66  unsigned[1] probProductDefinition  : dump;
67  unsigned[1] probabilityType  : dump;
68  unsigned[4] lowerLimit  : dump;
69  unsigned[4] upperLimit  : dump;
70
71    # padding
72    pad padding_local_7_1(5);
73}
74
75#
76constant sectionLengthLimitForEnsembles = 60;
77
78if(section1Length > sectionLengthLimitForEnsembles)
79{
80  unsigned[1] ensembleSize : dump ;
81  unsigned[1] clusterSize  : dump;
82  unsigned[1] numberOfClusters : dump ;
83  unsigned[1] clusteringMethod : dump ;
84  signed[3] northLatitudeOfCluster : dump ;
85  signed[3] southLatitudeOfCluster : dump ;
86  signed[3] westLongitudeOfCluster : dump ;
87  signed[3] eastLongitudeOfCluster : dump ;
88  unsigned[1] clusterMember1 : dump ;
89  unsigned[1] clusterMember2 : dump ;
90  unsigned[1] clusterMember3 : dump ;
91  unsigned[1] clusterMember4 : dump ;
92  unsigned[1] clusterMember5 : dump ;
93  unsigned[1] clusterMember6 : dump ;
94  unsigned[1] clusterMember7 : dump ;
95  unsigned[1] clusterMember8 : dump ;
96  unsigned[1] clusterMember9 : dump ;
97  unsigned[1] clusterMember10 : dump ;
98}
99
100# END   1/local.7.1 ----------------------------------------------------------------------
101