diff --git a/src/w3fi71.f b/src/w3fi71.f index 3ce0cd8a..d6990801 100644 --- a/src/w3fi71.f +++ b/src/w3fi71.f @@ -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/ @@ -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/ diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 08b06562..e9067d7d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,4 +15,5 @@ if(BUILD_D) # These are the tests. w3emc_test(test_summary) w3emc_test(test_w3tagb) + w3emc_test(test_w3fi71) endif() diff --git a/tests/test_w3fi71.f90 b/tests/test_w3fi71.f90 new file mode 100644 index 00000000..90943929 --- /dev/null +++ b/tests/test_w3fi71.f90 @@ -0,0 +1,59 @@ + program test_w3fi71 + +! 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