# Copyright 2005-2007 ECMWF
#
# Licensed under the GNU Lesser General Public License which
# incorporates the terms and conditions of version 3 of the GNU
# General Public License.
# See LICENSE and gpl-3.0.txt for details.

# START 1/local.98.17 ----------------------------------------------------------------------
# LOCAL 98 17
#
# localDefinitionTemplate_017
# ---------------------------
#
# Description            Octet    Code    Ksec1    Count
# -----------            -----    ----    -----    -----
#localDefinitionNumber           41      I1      37      -
#class                           42      I1      38      -
#type                            43      I1      39      -
#stream                          44      I2      40      -
#experimentVersionNumber         46      A4      41      -
#zeroes                          50      PAD     42      2
#dateOfSSTFieldUsed              52      D3      44      -
#typeOfSSTFieldUsed              55      I1      45      -
#countOfICEFieldsUsed            56      I1      46      -
#iceFieldDate+Satellite          57      LIST    47      countOfICEFieldsUsed
#dateOfIceFieldUsed              -       D3      -       -
#satelliteNumber                 -       I1      -       -
#ENDLIST                         -       ENDLIST -       iceFieldDate+Satellite
#paddingToMultipleOf40Bytes      57      PADMULT -       40
#


template mars_labeling "grib1/mars_labeling.def";

# zeroes
#pad padding_loc17_1(2);

unsigned[1] perturbationNumber           : dump;
alias number = perturbationNumber;

unsigned[1] numberOfForecastsInEnsemble  : dump;

# Need a proper date (sst_date)
unsigned[3] dateOfSSTFieldUsed : dump ;

unsigned[1] typeOfSSTFieldUsed : dump ;

unsigned[1] countOfICEFieldsUsed : dump ;

position offsetICEFieldsUsed;
ICEFieldsUsed list(countOfICEFieldsUsed)
{
  unsigned[3] dateOfIceFieldUsed : dump ;
#  d3date dateOfIceFieldUsed ;
  unsigned[1] satelliteNumber : dump ;
}

# paddingToMultipleOf40Bytes
padtomultiple padding_loc17_2(offsetICEFieldsUsed,40);
position offsetAfterPadding;

constant GRIBEXSection1Problem = ( offsetAfterPadding - offsetICEFieldsUsed ) % 40;

# END   1/local.98.17 ----------------------------------------------------------------------
