From 15c28fd67c2f1e7306ec1a10cfed66614cac2d7b Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Thu, 12 Jan 2023 20:41:32 +0000 Subject: [PATCH 1/6] Update the corner point latitude and orientation angle to the correct values - grids 172 and 220. Fixes #157. --- src/w3fi71.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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/ From 5ec320550db4454a218813e425205535c5e78342 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 13 Jan 2023 13:22:52 +0000 Subject: [PATCH 2/6] Add unit test stub for routine w3fi71. Fixes #157. --- tests/CMakeLists.txt | 1 + tests/test_w3fi71.f90 | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 tests/test_w3fi71.f90 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..346e72d1 --- /dev/null +++ b/tests/test_w3fi71.f90 @@ -0,0 +1,5 @@ + program test_w3fi71 + implicit none + print*,"Testing w3fi71..." + print*,"SUCCESS" + end program test_w3fi71 From f705b8e4aaa803f99cca1c11fa7d03d45ca53661 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 13 Jan 2023 13:35:56 +0000 Subject: [PATCH 3/6] Update unit test. Fixes #157. --- tests/test_w3fi71.f90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_w3fi71.f90 b/tests/test_w3fi71.f90 index 346e72d1..b1e489fe 100644 --- a/tests/test_w3fi71.f90 +++ b/tests/test_w3fi71.f90 @@ -1,5 +1,10 @@ program test_w3fi71 implicit none + integer :: igrid, igds(18), ierr print*,"Testing w3fi71..." + igrid = 172 + call w3fi71(igrid, igds, ierr) + print*,'ierr ',ierr + print*,'igds ',igds print*,"SUCCESS" end program test_w3fi71 From 31c6a98631c55b2a81e881883ae9cd99bf9e5604 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 13 Jan 2023 13:50:42 +0000 Subject: [PATCH 4/6] More unit tests updates for grid 172 Fixes #157. --- tests/test_w3fi71.f90 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_w3fi71.f90 b/tests/test_w3fi71.f90 index b1e489fe..9a09d69e 100644 --- a/tests/test_w3fi71.f90 +++ b/tests/test_w3fi71.f90 @@ -6,5 +6,27 @@ program test_w3fi71 call w3fi71(igrid, igds, ierr) print*,'ierr ',ierr print*,'igds ',igds + + 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*,"SUCCESS" end program test_w3fi71 From 9bcf61d2b86659bac2ab64c05eed06ea14fa9cb5 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 13 Jan 2023 14:01:35 +0000 Subject: [PATCH 5/6] Add test of grid 220. Fixes #157. --- tests/test_w3fi71.f90 | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/test_w3fi71.f90 b/tests/test_w3fi71.f90 index 9a09d69e..9b523891 100644 --- a/tests/test_w3fi71.f90 +++ b/tests/test_w3fi71.f90 @@ -1,12 +1,12 @@ program test_w3fi71 implicit none integer :: igrid, igds(18), ierr + print*,"Testing w3fi71..." + + print*,"Check grid 172" igrid = 172 call w3fi71(igrid, igds, ierr) - print*,'ierr ',ierr - print*,'igds ',igds - if (ierr /= 0) stop 2 if (igds(1) /= 0) stop 4 if (igds(2) /= 255) stop 6 @@ -27,6 +27,28 @@ program test_w3fi71 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 From ede8c86cf5299d62a8404bafa305227108ec6e36 Mon Sep 17 00:00:00 2001 From: "George.Gayno" Date: Fri, 13 Jan 2023 14:09:28 +0000 Subject: [PATCH 6/6] Add some comments to unit test. Fixes #157. --- tests/test_w3fi71.f90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_w3fi71.f90 b/tests/test_w3fi71.f90 index 9b523891..90943929 100644 --- a/tests/test_w3fi71.f90 +++ b/tests/test_w3fi71.f90 @@ -1,4 +1,9 @@ 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