File: section.4.def

package info (click to toggle)
grib-def 1.8.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,116 kB
  • sloc: makefile: 1,371; sh: 100
file content (99 lines) | stat: -rw-r--r-- 2,157 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
90
91
92
93
94
95
96
97
98
99
# 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.

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;
#       }