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 'read_global_orog'.
Fixes ufs-community#1000.
- Loading branch information
George Gayno
committed
Jan 3, 2025
1 parent
ddfbc61
commit 53250b2
Showing
3 changed files
with
44 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
Binary file not shown.
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,36 @@ | ||
program read_gbl_orog | ||
|
||
! Test routine "read_global_orog" using a reduced-size | ||
! version (6 x 3 vs 43200 x 21600) of the gmted 2010 orog file. | ||
|
||
use io_utils, only : read_global_orog | ||
|
||
implicit none | ||
|
||
integer, parameter :: im=6 | ||
integer, parameter :: jm=3 | ||
|
||
integer :: i, j | ||
|
||
integer(kind=2) :: glob(im,jm) | ||
integer(kind=2) :: glob_expected(im,jm) | ||
|
||
! Note the routine flips the i and j directions. | ||
data glob_expected /161,162,163,167,162,162, & | ||
157,153,148,166,165,162, & | ||
169,163,155,169,170,171/ | ||
|
||
print*,"- Begin test of read_global_orog" | ||
|
||
call read_global_orog(im, jm, glob) | ||
|
||
do j = 1, jm | ||
do i = 1, im | ||
if (glob(i,j) /= glob_expected(i,j)) stop 3 | ||
enddo | ||
enddo | ||
|
||
print*,"OK" | ||
print*,"SUCCSSS" | ||
|
||
end program read_gbl_orog |