diff --git a/tests/orog/ftst_get_index.F90 b/tests/orog/ftst_get_index.F90 index 70bfd6bbf..9786085a0 100644 --- a/tests/orog/ftst_get_index.F90 +++ b/tests/orog/ftst_get_index.F90 @@ -21,8 +21,13 @@ program test_get_index print*,"Starting test of get_index." +! The get_index routine contains three 'if' blocks. The test +! points are designed to check each block. + ! Point 1 - At equator. Western edge of grid cell at -! Greenwich. +! Greenwich. This tests the third 'if' block of the routine. + + print*,"Test point 1." lato(1) = 0.0; lono(1) = 0.0 lato(2) = 1.0; lono(2) = 0.5 @@ -40,10 +45,12 @@ program test_get_index if (ilist(i) /= i) stop 8 enddo -! Point 2 - At equator. Grid cell centered at -! Greenwich. +! Point 2 - At equator. Grid cell crosses Greenwich. +! This tests the second 'if' block of the routine. + + print*,"Test point 2." - lato(1) = 0.0; lono(1) = -0.5 + lato(1) = 0.0; lono(1) = 359.5 lato(2) = 1.0; lono(2) = 0.0 lato(3) = 0.0; lono(3) = 0.5 lato(4) = -1.0; lono(4) = 0.0 @@ -56,13 +63,19 @@ program test_get_index if (jen /= 10925) stop 14 if (numx /= 121) stop 16 ii = 1 - do i = -59, 61, 1 + do i = 43141, 43200 ! East of greenwich + if (ilist(ii) /= i) stop 18 + ii = ii + 1 + enddo + do i = 1, 61 ! West of greenwich if (ilist(ii) /= i) stop 18 ii = ii + 1 enddo ! Point 3 - At equator. Grid cell centered at -! the dateline. +! the dateline. This tests the third 'if' block. + + print*,"Test point 3." lato(1) = -1.0; lono(1) = 179.0 lato(2) = 1.0; lono(2) = 179.0 @@ -82,6 +95,27 @@ program test_get_index ii = ii + 1 enddo +! Point 4 - At North Pole. Grid cell centered at +! Greenwich. This tests the first 'if' block. + + print*,"Test point 4." + + lato(1) = 89.0; lono(1) = 359.5 + lato(2) = 90.0; lono(2) = 359.5 + lato(3) = 90.0; lono(3) = 0.5 + lato(4) = 89.0; lono(4) = 0.5 + + ilist = -999 + + call get_index(imn,jmn,npts,lono,lato,delxn,jst,jen,ilist,numx) + + if (jst /= 21476) stop 32 + if (jen /= 21600) stop 34 + if (numx /= 43200) stop 36 + do i = 1, numx + if (ilist(i) /= i) stop 38 + enddo + print*,"OK" print*,"SUCCESS"