Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct specification of NCEP grids 172 and 220 #158

Merged
merged 6 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/w3fi71.f
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ SUBROUTINE W3FI71 (IGRID, IGDS, IERR)
& -703, 128, 703, 0, 0, 0, 0, 0, 0/
DATA GRD171/ 0, 255, 5, 770,930, 25032, -119560, 0, -80000,
& 12700, 12700, 0, 64, 0, 0, 0, 0, 0/
DATA GRD172/ 0, 255, 5, 690,710, -36866, -220194, 0, -260000,
DATA GRD172/ 0, 255, 5, 690,710, -36899, -220194, 0, -80000,
& 12700, 12700, 128, 64, 0, 0, 0, 0, 0/
DATA GRD173/ 0, 255, 0,4320,2160, 89958, 42, 128, -89958,
& 359958, 83, 83, 0, 0, 0, 0, 0, 0/
Expand Down Expand Up @@ -806,7 +806,7 @@ SUBROUTINE W3FI71 (IGRID, IGDS, IERR)
& 12191, 12191, 0, 64, 0, 25000, 25000, 0, 0/
DATA GRD219/ 0, 255, 5, 385,465, 25032, -119560, 0, -80000,
& 25400, 25400, 0, 64, 0, 0, 0, 0, 0/
DATA GRD220/ 0, 255, 5, 345,355, -36866, -220194, 0, -260000,
DATA GRD220/ 0, 255, 5, 345,355, -36899, -220194, 0, -80000,
& 25400, 25400, 128, 64, 0, 0, 0, 0, 0/
DATA GRD221/ 0, 255, 3, 349,277, 1000, -145500, 8, -107000,
& 32463, 32463, 0, 64, 0, 50000, 50000, 0, 0/
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ if(BUILD_D)
# These are the tests.
w3emc_test(test_summary)
w3emc_test(test_w3tagb)
w3emc_test(test_w3fi71)
endif()
59 changes: 59 additions & 0 deletions tests/test_w3fi71.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
program test_w3fi71
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the test!!


! Call routine w3fi71 for NCEP grids 172 and 220.
! Compare the Grib1 grid description section
! against expected values.

implicit none
integer :: igrid, igds(18), ierr

print*,"Testing w3fi71..."

print*,"Check grid 172"
igrid = 172
call w3fi71(igrid, igds, ierr)
if (ierr /= 0) stop 2
if (igds(1) /= 0) stop 4
if (igds(2) /= 255) stop 6
if (igds(3) /= 5) stop 8
if (igds(4) /= 690) stop 10
if (igds(5) /= 710) stop 12
if (igds(6) /= -36899) stop 14
if (igds(7) /= -220194) stop 16
if (igds(8) /= 0) stop 18
if (igds(9) /= -80000) stop 20
if (igds(10) /= 12700) stop 22
if (igds(11) /= 12700) stop 24
if (igds(12) /= 128) stop 26
if (igds(13) /= 64) stop 28
if (igds(14) /= 0) stop 30
if (igds(15) /= 0) stop 32
if (igds(16) /= 0) stop 34
if (igds(17) /= 0) stop 36
if (igds(18) /= 0) stop 38

print*,"Check grid 220"
igrid = 220
call w3fi71(igrid, igds, ierr)
if (ierr /= 0) stop 42
if (igds(1) /= 0) stop 44
if (igds(2) /= 255) stop 46
if (igds(3) /= 5) stop 48
if (igds(4) /= 345) stop 50
if (igds(5) /= 355) stop 52
if (igds(6) /= -36899) stop 54
if (igds(7) /= -220194) stop 56
if (igds(8) /= 0) stop 58
if (igds(9) /= -80000) stop 60
if (igds(10) /= 25400) stop 62
if (igds(11) /= 25400) stop 64
if (igds(12) /= 128) stop 66
if (igds(13) /= 64) stop 68
if (igds(14) /= 0) stop 70
if (igds(15) /= 0) stop 72
if (igds(16) /= 0) stop 74
if (igds(17) /= 0) stop 76
if (igds(18) /= 0) stop 78

print*,"SUCCESS"
end program test_w3fi71