@@ -151,6 +151,7 @@ class GribCode {
151151// ----------------------------------------------
152152class GribRecord {
153153public:
154+ /* * Copy constructor performs a deep copy of the GribRecord. */
154155 GribRecord (const GribRecord &rec);
155156 GribRecord () { m_bfilled = false ; }
156157
@@ -272,39 +273,146 @@ class GribRecord {
272273 int &Nj, int &rec1offi, int &rec1offj,
273274 int &rec2offi, int &rec2offj);
274275
275- int id; // unique identifiant
276- bool ok; // valid?
277- bool knownData; // type de donnée connu
276+ /* *
277+ * Unique identifier for this record.
278+ *
279+ * Set during file reading for original records.
280+ * Monotonically increasing for records read from file.
281+ */
282+ int id;
283+ /* *
284+ * Indicates record validity.
285+ *
286+ * A record may be invalid if source records have mismatched dimensions,
287+ * missing data arrays, failed interpolation, or the source records themselves
288+ * are invalid when creating derived records.
289+ */
290+ bool ok;
291+ /* *
292+ * Indicates whether the data type in this record is recognized by the parser.
293+ * Used to skip unknown data types during processing.
294+ */
295+ bool knownData;
296+ /* *
297+ * Differentiates wave-related parameters (height, direction, period) from
298+ * other meteorological data for specialized processing.
299+ */
278300 bool waveData;
301+ /* *
302+ * Indicates if this record was created through copying rather than direct
303+ * reading.
304+ *
305+ * Tracks whether this record was copied to maintain data continuity. This
306+ * happens with wave data gaps or initial values for cumulative parameters.
307+ */
279308 bool IsDuplicated;
309+ /* *
310+ * Signals when the end of the GRIB file has been reached during parsing.
311+ */
280312 bool eof;
313+ /* *
314+ * Unique string identifier constructed from data type, level type, and level
315+ * value. Used for record lookup and comparison.
316+ */
281317 std::string dataKey;
282318 char strRefDate[32 ];
283319 char strCurDate[32 ];
320+ /* *
321+ * Identifies the numerical weather model that produced this data.
322+ *
323+ * Standard WMO values from GRIB2 Table C-11 include:
324+ * - 7: US National Weather Service, National Centers for Environmental
325+ * Prediction (NCEP)
326+ * - 34: Japanese Meteorological Agency - Tokyo (JMA)
327+ * - 58: European Centre for Medium-Range Weather Forecasts (ECMWF)
328+ * - 59: DWD (German Weather Service)
329+ * - 85: French Weather Service (Meteo France)
330+ * - 251: Norwegian Meteorological Institute
331+ */
284332 int dataCenterModel;
333+ /* *
334+ * Indicates whether the data array has been populated. Used to track
335+ * partial loading states during record construction.
336+ */
285337 bool m_bfilled;
286338
287339 // ---------------------------------------------
288340 // SECTION 0: THE INDICATOR SECTION (IS)
289341 // ---------------------------------------------
342+ /* *
343+ * GRIB edition number, indicating the version of the GRIB specification used.
344+ * Determines how subsequent sections should be parsed.
345+ */
290346 zuchar editionNumber;
291347
292348 // SECTION 1: THE PRODUCT DEFINITION SECTION (PDS)
349+ /* *
350+ * Originating center ID as defined by WMO common table C-1.
351+ * Identifies which meteorological center generated the forecast.
352+ */
293353 zuchar idCenter;
354+ /* *
355+ * Model identifier within the originating center.
356+ * Distinguishes between different forecast models run by the same center.
357+ */
294358 zuchar idModel;
359+ /* *
360+ * Grid identifier used by the originating center.
361+ * Specifies the coordinate system and projection of the data grid.
362+ */
295363 zuchar idGrid;
364+ /* *
365+ * Parameter identifier as defined by GRIB tables.
366+ * Specifies what physical quantity is represented (wind, temperature, etc).
367+ */
296368 zuchar dataType; // octet 9 = parameters and units
369+ /* *
370+ * Vertical level type indicator.
371+ * Specifies the type of vertical coordinate (pressure level, height above
372+ * ground, etc).
373+ */
297374 zuchar levelType;
375+ /* *
376+ * Numeric value associated with levelType.
377+ * For example, the specific pressure level in hectopascals.
378+ */
298379 zuint levelValue;
299380
381+ /* *
382+ * Indicates presence of a bitmap section.
383+ * When true, the data section uses a bitmap to indicate valid data points.
384+ */
300385 bool hasBMS;
386+ /* *
387+ * Components of the reference time for this forecast.
388+ * Specifies when the forecast model was initialized.
389+ */
301390 zuint refyear, refmonth, refday, refhour, refminute;
302391 // zuchar periodP1, periodP2;
392+ /* *
393+ * Time range indicators for this forecast step.
394+ * Used to calculate the valid time period for this data.
395+ */
303396 zuint periodP1, periodP2;
397+ /* *
398+ * Statistical processing indicator.
399+ * Describes how the data was processed over time (e.g., accumulation,
400+ * average).
401+ */
304402 zuchar timeRange;
305- zuint periodsec; // period in seconds
306- time_t refDate; // C reference date
307- time_t curDate; // C current date
403+ /* *
404+ * Forecast period in seconds.
405+ * Time offset from the reference time.
406+ */
407+ zuint periodsec;
408+ /* *
409+ * Unix timestamp of model initialization time.
410+ */
411+ time_t refDate;
412+ /* *
413+ * Unix timestamp of when this forecast is valid.
414+ */
415+ time_t curDate;
308416 // SECTION 2: THE GRID DESCRIPTION SECTION (GDS)
309417 zuchar NV, PV;
310418 zuchar gridType;
0 commit comments