Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Plot the results and cross-reference with the original result of 6 fields to confirm that you understand what has been computed.

Automatic conversion between grids

Write some macro code which automatically converts t2m_forecast.grib to use the same grid as the first field in uv850.grib. Hints:

  • read both files
  • use the grib_get_double(fieldset, string) function twice to extract the grid resolution from the first field in uv850 (uv850[1])
    • use the Grib Examiner to find which GRIB_API keys define these parameters
  • use the read() command to set the grid on the temperature field

Extract field values at a set of locations

...

There are many ways to extract the value of a field at a given point or set of points. Try this one - call nearest_gridpoint_info ( fieldset,number,number ) with the latitude and longitude of a geographical location and print the result to see which data gridpoint is closest to it.

Automatic conversion between grids

Write some macro code which automatically converts t2m_forecast.grib to use the same grid as the first field in uv850.grib. Hints:

  • read both files
  • use the grib_get_double(fieldset, string) function twice to extract the grid resolution from the first field in uv850 (uv850[1])
    • use the Grib Examiner to find which GRIB_API keys define these parameters
  • use the read() command to set the grid on the temperature field