File: section.4.def

package info (click to toggle)
eccodes 2.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 154,404 kB
  • sloc: cpp: 162,953; ansic: 26,308; sh: 21,742; f90: 6,854; perl: 6,361; python: 5,172; java: 2,226; javascript: 1,427; yacc: 854; fortran: 543; lex: 359; makefile: 283; xml: 183; awk: 66
file content (89 lines) | stat: -rw-r--r-- 1,989 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# (C) Copyright 2005- ECMWF.

section_length[3] section4Length;

unsigned[1] reserved=0 : hidden;

flags[1] missingDataFlag 'grib1/1.table';

unsigned[1] numberOfBytesPerInteger ;

unsigned[2] reserved=0 : hidden;

unsigned[3] numberOfChars;

unsigned[3] numberOfFloats;

unsigned[3] numberOfInts;

unsigned[3] numberOfLogicals;

unsigned[3] numberOfReservedBytes;

unsigned[4] reserved=0 : hidden;
unsigned[4] reserved=0 : hidden;
unsigned[1] reserved=0 : hidden;

ibmfloat floatVal[numberOfFloats];

if(numberOfBytesPerInteger == 1) { signed[1] integerValues[numberOfInts]; }
if(numberOfBytesPerInteger == 2) { signed[2] integerValues[numberOfInts]; }
if(numberOfBytesPerInteger == 3) { signed[3] integerValues[numberOfInts]; }
if(numberOfBytesPerInteger == 4) { signed[4] integerValues[numberOfInts]; }

if(numberOfChars >= 12)
{
  ascii[2] marsClass;
  ascii[2] dummy1;
  ascii[2] marsType;
  ascii[2] dummy2;
  ascii[4] marsExpver;

  constant numberOfRemaininChars  = numberOfChars - 12;

  charValues list(numberOfRemaininChars) {
    ascii[1] char;
  }

  constant zero = 0;
  concept isEps(zero)  { 1 = { marsType = "pf"; } }
  concept isSens(zero) { 1 = { marsType = "sf"; } }

  constant oper = "oper";

  concept marsStream(oper) {
    "enfo" = { marsType = "pf"; }
    "enfo" = { marsType = "cf"; }
    "sens" = { marsType = "sf"; }
  }

  if(isEps)
  {
    constant perturbationNumber = 0;
    alias mars.number = perturbationNumber;
  }

  if(isSens)
  {
    constant iterationNumber  = 0;
    constant diagnosticNumber = 0;
    alias mars.iteration  = iterationNumber;
    alias mars.diagnostic = diagnosticNumber;
  }

  # This is commented out because some of the BUDG have the wrong info there
  alias mars.stream = marsStream;
  alias mars.class   = marsClass;
  alias mars.type    = marsType;
  alias mars.expver  = marsExpver;
}
else
{
  charValues list(numberOfChars) {
    ascii[1] char;
  }
}

#reservedBytes list (numberOfReservedBytes){
#   unsigned[1] byte;
#}