Skip to content

Commit

Permalink
Add Arawaka GDTNs (32768,32769) for grib2 (NOAA-EMC#231)
Browse files Browse the repository at this point in the history
* Add arawaka GDTNs (32768,32769) for grib2

* Add testing for Arawaka grib2 cases
  • Loading branch information
AlexanderRichert-NOAA authored Mar 5, 2024
1 parent e10f624 commit 30beaa0
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ip_grid_factory_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ subroutine init_grid_grib2(grid, g2_desc)
allocate(ip_lambert_conf_grid::grid)
case(GAUSSIAN_GRID_ID_GRIB2)
allocate(ip_gaussian_grid::grid)
case(ROT_EQUID_CYLIND_E_GRID_ID_GRIB2)
allocate(ip_rot_equid_cylind_egrid::grid)
case(ROT_EQUID_CYLIND_B_GRID_ID_GRIB2)
allocate(ip_rot_equid_cylind_grid::grid)
case default
print *, "gdt_num: ", g2_desc%gdt_num, " not recognized"
error stop
Expand Down
2 changes: 2 additions & 0 deletions src/ip_grid_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module ip_grid_mod
integer, public, parameter :: POLAR_STEREO_GRID_ID_GRIB2 = 20 !< Integer grid number for polar stereo grid in grib2
integer, public, parameter :: LAMBERT_CONF_GRID_ID_GRIB2 = 30 !< Integer grid number for Lambert conformal grid in grib2
integer, public, parameter :: GAUSSIAN_GRID_ID_GRIB2 = 40 !< Integer grid number for Gaussian grid in grib2
integer, public, parameter :: ROT_EQUID_CYLIND_E_GRID_ID_GRIB2 = 32768 !< Integer grid number for rotated equidistant cylindrical E-stagger grid (grib2)
integer, public, parameter :: ROT_EQUID_CYLIND_B_GRID_ID_GRIB2 = 32769 !< Integer grid number for rotated equidistant cylindrical B-stagger grid (grib2)

private
public :: ip_grid
Expand Down
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ foreach(kind ${kinds})
add_test(test_polar_stereo_neighbor_budget_vector_grib2_${kind} test_vector_grib2_${kind} 212 6)
add_test(test_rotatedB_spectral_vector_grib2_${kind} test_vector_grib2_${kind} 205 4)
add_test(test_rotatedE_budget_vector_grib2_${kind} test_vector_grib2_${kind} 203 3)
add_test(test_rotatedB_direct_spectral_vector_grib2_${kind} test_vector_grib2_${kind} 32769 4)
add_test(test_rotatedE_direct_budget_vector_grib2_${kind} test_vector_grib2_${kind} 32768 3)

# vector station point tests
add_test(test_station_points_bilinear_vector_grib2_${kind} test_vector_grib2_${kind} -1 0)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 14 additions & 0 deletions tests/interp_mod_grib2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,20 @@ subroutine interp_vector(grid, interp_opt)
output_gdtmpl=gdtmpl218
i_output = output_gdtmpl(8)
j_output = output_gdtmpl(9)
case ('32768')
output_gdtnum = 32768
output_gdtlen = gdtlen203
allocate(output_gdtmpl(output_gdtlen))
output_gdtmpl=gdtmpl203
i_output = output_gdtmpl(8)
j_output = output_gdtmpl(9)
case ('32769')
output_gdtnum = 32769
output_gdtlen = gdtlen205
allocate(output_gdtmpl(output_gdtlen))
output_gdtmpl=gdtmpl205
i_output = output_gdtmpl(8)
j_output = output_gdtmpl(9)
case default
print*,"ERROR: ENTER VALID GRID NUMBER."
stop 55
Expand Down

0 comments on commit 30beaa0

Please sign in to comment.