forked from ufs-community/UFS_UTILS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for routine find_poles.
Fixes ufs-community#1000.
- Loading branch information
George Gayno
committed
Dec 3, 2024
1 parent
1c21bcf
commit 92bac68
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
program ftst_find_poles | ||
|
||
! Unit test for routine find_poles. | ||
! | ||
! Author George Gayno NCEP/EMC | ||
|
||
use orog_utils, only : find_poles | ||
|
||
implicit none | ||
|
||
integer, parameter :: nx=9 | ||
integer, parameter :: ny=9 | ||
|
||
integer :: i_north_pole, j_north_pole | ||
integer :: i_south_pole, j_south_pole | ||
|
||
real :: geolat(nx+1,ny+1) | ||
|
||
print*,"Starting test of find_poles." | ||
|
||
! Point 1 - North Pole at (4,5) | ||
|
||
print*,"North pole test." | ||
|
||
geolat = 89.0 | ||
geolat(4,5) = 89.95 ! North pole | ||
|
||
call find_poles(geolat, nx, ny, i_north_pole, j_north_pole, & | ||
i_south_pole, j_south_pole) | ||
|
||
if (i_north_pole /= 4) stop 2 | ||
if (j_north_pole /= 5) stop 4 | ||
if (i_south_pole /= 0) stop 6 | ||
if (j_south_pole /= 0) stop 8 | ||
|
||
! Point 2 - South Pole at (2,8) | ||
|
||
print*,"South pole test." | ||
|
||
geolat = -89.0 | ||
geolat(2,8) = -89.95 ! South pole | ||
|
||
call find_poles(geolat, nx, ny, i_north_pole, j_north_pole, & | ||
i_south_pole, j_south_pole) | ||
|
||
if (i_north_pole /= 0) stop 12 | ||
if (j_north_pole /= 0) stop 14 | ||
if (i_south_pole /= 2) stop 16 | ||
if (j_south_pole /= 8) stop 18 | ||
|
||
! Point 3 - No pole points. | ||
|
||
print*,"No pole test." | ||
|
||
geolat = -89.3 | ||
|
||
call find_poles(geolat, nx, ny, i_north_pole, j_north_pole, & | ||
i_south_pole, j_south_pole) | ||
|
||
if (i_north_pole /= 0) stop 22 | ||
if (j_north_pole /= 0) stop 24 | ||
if (i_south_pole /= 0) stop 26 | ||
if (j_south_pole /= 0) stop 28 | ||
|
||
print*,"OK" | ||
|
||
print*,"SUCCESS" | ||
|
||
end program ftst_find_poles |