~ubuntu-branches/ubuntu/precise/grib-def/precise

« back to all changes in this revision

Viewing changes to grib2/section.1.def

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Zini
  • Date: 2009-10-14 10:57:24 UTC
  • Revision ID: james.westby@ubuntu.com-20091014105724-p6kx0exiu8risykl
Tags: upstream-1.8.0.1
ImportĀ upstreamĀ versionĀ 1.8.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2005-2007 ECMWF
 
2
#
 
3
# Licensed under the GNU Lesser General Public License which
 
4
# incorporates the terms and conditions of version 3 of the GNU
 
5
# General Public License.
 
6
# See LICENSE and gpl-3.0.txt for details.
 
7
 
 
8
 
 
9
position offsetSection1;
 
10
length[4] section1Length ;
 
11
meta section1Pointer section_pointer(offsetSection1,section1Length,1);
 
12
 
 
13
unsigned[1] numberOfSection = 1 :read_only;
 
14
 
 
15
codetable[2] centre  'grib1/0.table' : dump,string_type;
 
16
 
 
17
alias parameter.centre=centre;
 
18
alias identificationOfOriginatingGeneratingCentre=centre;
 
19
alias ls.centre=centre;
 
20
alias originatingCentre=centre;
 
21
 
 
22
 
 
23
unsigned[2] subCentre  : dump;
 
24
alias identificationOfOriginatingGeneratingSubCentre=subCentre;
 
25
 
 
26
if (subCentre==98 ) {
 
27
alias centreForLocal=subCentre;
 
28
} else {
 
29
alias centreForLocal=centre;
 
30
}
 
31
 
 
32
codetable[1] tablesVersion 'grib2/tables/1.0.table' = 5 : edition_specific;
 
33
alias gribMasterTablesVersionNumber=tablesVersion;
 
34
 
 
35
transient masterDir="grib2/tables/[tablesVersion]";
 
36
when (tablesVersion!=255) {
 
37
  set masterDir="grib2/tables/[tablesVersion]";
 
38
} else {
 
39
  set masterDir="grib2/tables/4";
 
40
}
 
41
 
 
42
#  Version number of GRIB Local Tables used to augment Master Tables
 
43
# NOTE 2 NOT FOUND
 
44
codetable[1] localTablesVersion 'grib2/tables/[tablesVersion]/1.1.table' ;
 
45
alias versionNumberOfGribLocalTables=localTablesVersion;
 
46
 
 
47
transient localDir="";
 
48
when (localTablesVersion != 0) {
 
49
  set localDir="grib2/tables/local/[centre]/[localTablesVersion]";
 
50
} else {
 
51
  set localDir="";
 
52
}
 
53
 
 
54
#  Significance of Reference Time
 
55
codetable[1] significanceOfReferenceTime ('1.2.table',masterDir,localDir) = 1 : dump;
 
56
 
 
57
#  Year
 
58
# (4 digits)
 
59
unsigned[2] year ;
 
60
 
 
61
#  Month
 
62
unsigned[1] month ;
 
63
 
 
64
#  Day
 
65
unsigned[1] day ;
 
66
 
 
67
#  Hour
 
68
unsigned[1] hour ;
 
69
 
 
70
#  Minute
 
71
unsigned[1] minute ;
 
72
 
 
73
#  Second
 
74
unsigned[1] second ;
 
75
 
 
76
meta    dataDate    g2date(year,month,day) : dump;
 
77
alias mars.date = dataDate;
 
78
alias ls.date = dataDate;
 
79
 
 
80
meta julianDay julian_day(dataDate,hour,minute,second) : edition_specific;
 
81
 
 
82
meta      dataTime    time(hour,minute,second) : dump;
 
83
alias mars.time = dataTime;
 
84
 
 
85
 
 
86
#  Production status of processed data in this GRIB message
 
87
codetable[1] productionStatusOfProcessedData ('1.3.table',masterDir,localDir) : dump;
 
88
 
 
89
#  Type of processed data in this GRIB message
 
90
codetable[1] typeOfProcessedData ('1.4.table',masterDir,localDir) = 2  : dump;
 
91
 
 
92
alias ls.dataType=typeOfProcessedData;
 
93
 
 
94
meta md5Section1 md5(offsetSection1,section1Length);