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.
All unit test for routine read_lake_mask.
Fixes ufs-community#944.
- Loading branch information
George Gayno
committed
Oct 9, 2024
1 parent
c64161b
commit b4188b9
Showing
3 changed files
with
49 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,42 @@ | ||
! Unit test for the read_lake_mask routine. | ||
! | ||
! Reads a 6x4 version of the lake mask file and | ||
! checks values from the lake fraction, lake depth | ||
! and latitude records. If differences exceed a | ||
! threshold, then the test fails. | ||
! | ||
program read_lake_info | ||
|
||
implicit none | ||
|
||
integer, parameter :: lon = 6 | ||
integer, parameter :: lat = 4 | ||
integer, parameter :: tile = 1 | ||
|
||
character(len=3) :: pth2="./" | ||
character(len=3) :: atmres="C48" | ||
|
||
real, parameter :: thresh = 0.001 | ||
real :: lake_frac(lon,lat) | ||
real :: lake_depth(lon,lat) | ||
real :: lat2d(lon,lat) | ||
|
||
print*,"Call routine read_lake_mask." | ||
|
||
call read_lake_mask(pth2,atmres,tile,lon,lat,lake_frac, & | ||
lake_depth,lat2d) | ||
|
||
print*,"Check records." | ||
|
||
if (abs(lake_depth(1,1)-0.0) > thresh) stop 2 | ||
if (abs(lake_depth(5,2)-68.3817) > thresh) stop 4 | ||
if (abs(lake_frac(4,3)-1.0) > thresh) stop 6 | ||
if (abs(lake_frac(4,4)-0.0) > thresh) stop 8 | ||
if (abs(lat2d(1,4)-0.399218) > thresh) stop 10 | ||
if (abs(lat2d(6,1)-(-1.87402)) > thresh) stop 12 | ||
|
||
print*,"OK" | ||
|
||
print*,"SUCCESS" | ||
|
||
end program read_lake_info |