35 class(
ip_grid),
allocatable,
intent(out) :: grid
37 select type(grid_desc)
55 class(
ip_grid),
allocatable,
intent(out) :: grid
57 select case(g1_desc%grid_num)
59 allocate(ip_station_points_grid::grid)
61 allocate(ip_equid_cylind_grid::grid)
63 allocate(ip_mercator_grid::grid)
65 allocate(ip_lambert_conf_grid::grid)
67 allocate(ip_gaussian_grid::grid)
69 allocate(ip_polar_stereo_grid::grid)
71 allocate(ip_rot_equid_cylind_egrid::grid)
73 allocate(ip_rot_equid_cylind_grid::grid)
76 call grid%init(g1_desc)
77 allocate(grid%descriptor, source = g1_desc)
91 class(
ip_grid),
allocatable,
intent(out) :: grid
93 integer :: i_offset_odd, i_offset_even
95 select case(g2_desc%grid_num)
97 allocate(ip_station_points_grid::grid)
99 allocate(ip_equid_cylind_grid::grid)
101 i_offset_odd = mod(g2_desc%gdt_tmpl(19) / 8, 2)
102 i_offset_even = mod(g2_desc%gdt_tmpl(19) / 4, 2)
103 if (i_offset_odd /= i_offset_even)
then
104 allocate(ip_rot_equid_cylind_egrid::grid)
106 allocate(ip_rot_equid_cylind_grid::grid)
109 allocate(ip_mercator_grid::grid)
111 allocate(ip_polar_stereo_grid::grid)
113 allocate(ip_lambert_conf_grid::grid)
115 allocate(ip_gaussian_grid::grid)
117 allocate(ip_rot_equid_cylind_egrid::grid)
119 allocate(ip_rot_equid_cylind_grid::grid)
121 print *,
"gdt_num: ", g2_desc%gdt_num,
" not recognized"
125 call grid%init(g2_desc)
126 allocate(grid%descriptor, source = g2_desc)
Users derived type grid descriptor objects to abstract away the raw GRIB1 and GRIB2 grid definitions.
Routines for creating an ip_grid given a Grib descriptor.
subroutine init_grid_generic(grid, grid_desc)
Initializes a polymorphic ip_grid object from an ip_grid_descriptor.
subroutine init_grid_grib2(grid, g2_desc)
Initializes a polymorphic ip_grid from a grib2_descriptor.
subroutine init_grid_grib1(grid, g1_desc)
Initializes a polymorphic ip_grid from a grib1_descriptor.
integer, parameter, public rot_equid_cylind_e_grid_id_grib2
Integer grid number for rotated equidistant cylindrical E-stagger grid (grib2)
integer, parameter, public lambert_conf_grid_id_grib2
Integer grid number for Lambert conformal grid in grib2.
integer, parameter, public gaussian_grid_id_grib2
Integer grid number for Gaussian grid in grib2.
integer, parameter, public equid_cylind_grid_id_grib2
Integer grid number for equidistant cylindrical grid in grib2.
integer, parameter, public gaussian_grid_id_grib1
Integer grid number for Gaussian grid in grib1.
integer, parameter, public rot_equid_cylind_e_grid_id_grib1
Integer grid number for rotated equidistant cylindrical E-stagger grid.
integer, parameter, public polar_stereo_grid_id_grib2
Integer grid number for polar stereo grid in grib2.
integer, parameter, public lambert_conf_grid_id_grib1
Integer grid number for Lambert Conformal grid in grib1.
integer, parameter, public mercator_grid_id_grib1
Integer grid number for Mercator grid in grib1.
integer, parameter, public equid_cylind_grid_id_grib1
Integer grid number for equidistant cylindrical grid in grib1.
integer, parameter, public rot_equid_cylind_b_grid_id_grib1
Integer grid number for rotated equidistant cylindrical B-stagger grid.
integer, parameter, public rot_equid_cylind_b_grid_id_grib2
Integer grid number for rotated equidistant cylindrical B-stagger grid (grib2)
integer, parameter, public rot_equid_cylind_grid_id_grib2
Integer grid number for rotated equidistant cylindrical grid in grib2.
integer, parameter, public mercator_grid_id_grib2
Integer grid number for Mercator grid in grib2.
integer, parameter, public polar_stereo_grid_id_grib1
Integer grid number for polar stereo grid in grib1.
Re-export the individual grids.
Descriptor representing a grib1 grib descriptor section (GDS) with an integer array.
Grib-2 descriptor containing a grib2 GDT represented by an integer array.
Abstract descriptor object which represents a grib1 or grib2 descriptor.
Abstract grid that holds fields and methods common to all grids.