-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathgribmod.F90.in
200 lines (167 loc) · 8.43 KB
/
gribmod.F90.in
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
!> @file
!> @brief This Fortran module contains the declaration of derived
!> type gribfield.
!> @author Stephen Gilbert @date 2002-01-23
!> This Fortran module contains the declaration of derived type
!> gribfield.
!>
!> @author Stephen Gilbert @date 2002-01-23
module grib_mod
character(len = 12) :: G2_VERSION = "g2lib-@pVersion@" !< Library version.
type gribfield
integer :: version !< GRIB edition number (currently 2).
!> Message Discipline (see [Code Table 0.0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table0-0.shtml)).
integer :: discipline
!> Contains the entries in the Identification Section (Section
!> 1).
!> - idsect(1) Identification of originating Centre
!> (see Common Code Table C-1) 7 US National Weather Service. ([Table 0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/on388/table0.html)).
!> - idsect(2) Identification of originating Sub-centre ([Table C]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/on388/tablec.html)).
!> - idsect(3) GRIB Master Tables Version Number. ([Table 1.0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-0.shtml))
!> 0 Experimental; 1 Initial operational version number
!> - idsect(4) GRIB Local Tables Version Number ([Table 1.1]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-1.shtml)).
!> - 0 Local tables not used
!> - 0 1-254 Number of local tables version used
!> - idsect(5) Significance of Reference Time ([Table 1.2]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-1.shtml)).
!> - 0 Analysis
!> - 1 Start of forecast
!> - 2 Verifying time of forecast
!> - 3 Observation time
!> - idsect(6) Year (4 digits)
!> - idsect(7) Month
!> - idsect(8) Day
!> - idsect(9) Hour
!> - idsect(10) Minute
!> - idsect(11) Second
!> - idsect(12) Production status of processed data (see [Table 1.3]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-3.shtml))
!> - 0 Operational products
!> - 1 Operational test products
!> - 2 Research products
!> - 3 Re-analysis products
!> - idsect(13) Type of processed data ([Table 1.4]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table1-4.shtml))
!> - 0 Analysis products
!> - 1 Forecast products
!> - 2 Analysis and forecast products
!> - 3 Control forecast products
!> - 4 Perturbed forecast products
!> - 5 Control and perturbed forecast products
!> - 6 Processed satellite observations
!> - 7 Processed radar observations
integer, pointer, dimension(:) :: idsect => null()
!> Number of elements in idsect (always 13).
integer :: idsectlen
!> Pointer to character array containing contents of Local
!> Section 2, if included.
character(len = 1), pointer, dimension(:) :: local => null()
!> Length of array local.
integer :: locallen
!> Field number within GRIB message.
integer :: ifldnum
!> Source of grid definition (see [Code Table 3.0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table3-0.shtml))
!> - 0 Specified in field igdtnum (as defined in [Code table 3.1]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table3-1.shtml).
!> - 1 Predetermined grid Defined by originating centre.
integer :: griddef
!> Number of grid points in the defined grid. Note that the
!> number of actual data values returned from getgb2() (in ndpts)
!> may be less than this value if a logical bitmap is in use with
!> grid points that are being masked out.
integer :: ngrdpts
!> Number of octets needed for each additional grid points
!> definition. Used to define number of points in each row (or
!> column) for non-regular grids. Equal to 0, if using regular
!> grid.
integer :: numoct_opt
!> Interpretation of list of numbers at end of section 3 - the
!> Grid Definiton Section. (See [Code Table 3.11]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table3-11.shtml)).
integer :: interp_opt
!> (Used if numoct_opt .ne. 0.) The number of entries in array
!> ideflist. i.e. number of rows (or columns) for which optional
!> grid points are defined. This value is set to zero, if
!> umoct_opt = 0.
integer :: num_opt
!> (Used if numoct_opt .ne. 0.) This array contains the number of
!> grid points contained in each row (or column) (part of Section
!> 3), This element is actually a pointer to an array that holds
!> the data. This pointer is null if numoct_opt equals 0.
integer, pointer, dimension(:) :: list_opt => null()
!> Grid Definition Template Number ([Code Table 3.1]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table3-1.shtml)).
integer :: igdtnum
!> Number of elements in the Grid Defintion Template specified by
!> igdtnum.
integer :: igdtlen
!> Contains the data values for the Grid Definition Template
!> specified by igdtnum. This element is actually a pointer to an
!> array that holds the data.
integer, pointer, dimension(:) :: igdtmpl => null()
!> Product Definition Template Number ([Code Table 4.0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-0.shtml)).
integer :: ipdtnum
!> Number of elements in the Product Defintion Template specified
!> by ipdtnum.
integer :: ipdtlen
!> Contains the data values for the Product Definition Template
!> specified by ipdtnum. This element is actually a pointer to an
!> array that holds the data.
integer, pointer, dimension(:) :: ipdtmpl => null()
!> Number of values in array coord_list. This is part of Section
!> 3 - the Grid Definition Section.
integer :: num_coord
!> Real array containing floating point values intended to
!> document the vertical discretisation associated to model data
!> on hybrid coordinate vertical levels (part of Section 3 - the
!> Grid Definition Section). This element is actually a pointer
!> to an array that holds the data.
real, pointer, dimension(:) :: coord_list => null()
!> Number of data points unpacked and returned. Note that this
!> number may be different from the value of ngrdpts if a logical
!> bitmap is in use with grid points that are being masked out.
integer :: ndpts
!> Data Representation Template Number ([Code Table 5.0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table5-0.shtml)).
integer :: idrtnum
!> Number of elements in the Data Representation Template array
!> specified by idrtnum.
integer :: idrtlen
!> Contains the data values for the Data Representation Template
!> specified by idrtnum. This element is actually a pointer to an
!> array that holds the data.
integer, pointer, dimension(:) :: idrtmpl => null()
!> Logical value indicating whether the bitmap and data values
!> were unpacked. If false, bmap and fld pointers are null.
logical :: unpacked
!> Logical value indicating whether the data field was expanded
!> to the grid in the case where a bit-map is present. If true,
!> the data points in fld match the grid points and zeros were
!> inserted at grid points where data was bit-mapped out. If
!> false, the data values in fld were not expanded to the grid
!> and are just a consecutive array of data points corresponding
!> to each value of "1" in bmap.
logical :: expanded
!> Bitmap indicator (see [Code Table 6.0]
!> (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table6-0.shtml)).
!> - 0 bitmap applies and is included in Section 6.
!> - 1-253 Predefined bitmap applies.
!> - 254 Previously defined bitmap applies to this field.
!> - 255 Bit map does not apply to this product.
integer :: ibmap
!> Logical*1 array containing decoded bitmap, if ibmap equals 0
!> or 254 - otherwise null. This element is actually a pointer to
!> an array that holds the data.
logical*1, pointer, dimension(:) :: bmap => null()
!> Array of ndpts unpacked data points. This element is actually
!> a pointer to an array that holds the data.
real, pointer, dimension(:) :: fld => null()
end type gribfield
end module grib_mod