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_ocean_frac'.
Fixes ufs-community#944.
- Loading branch information
George Gayno
committed
Nov 14, 2024
1 parent
f96db7b
commit e4a2f33
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,37 @@ | ||
! Unit test for the read_ocean_frac routine. | ||
! | ||
! Reads a 6x5 version of the ocean mask file and | ||
! checks values from the ocean fraction record. | ||
! If differences exceed a threshold, then the test fails. | ||
! | ||
program read_ocean_info | ||
|
||
implicit none | ||
|
||
integer, parameter :: lon = 6 | ||
integer, parameter :: lat = 5 | ||
integer, parameter :: tile = 1 | ||
|
||
character(len=3) :: pth1="./" | ||
character(len=3) :: atmres="C48" | ||
character(len=5) :: ocnres="mx500" | ||
|
||
real, parameter :: thresh = 0.001 | ||
real :: ocn_frac(lon,lat) | ||
|
||
print*,"Call routine read_ocean_frac." | ||
|
||
call read_ocean_frac(pth1,atmres,ocnres,tile,lon,lat,ocn_frac) | ||
|
||
print*,"Check records." | ||
|
||
if (abs(ocn_frac(1,1)-1.0) > thresh) stop 2 | ||
if (abs(ocn_frac(6,5)-0.0) > thresh) stop 4 | ||
if (abs(ocn_frac(4,5)-0.0917) > thresh) stop 6 | ||
if (abs(ocn_frac(3,1)-0.162347) > thresh) stop 8 | ||
|
||
print*,"OK" | ||
|
||
print*,"SUCCESS" | ||
|
||
end program read_ocean_info |