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.
Create an initial unit test for the 'merge' routine.
Fixes ufs-community#944.
- Loading branch information
George Gayno
committed
Sep 27, 2024
1 parent
d89bb26
commit 70c1233
Showing
4 changed files
with
70 additions
and
2 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
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,64 @@ | ||
! Unit test for the merge routine. | ||
|
||
program ftst_merge | ||
|
||
implicit none | ||
|
||
integer, parameter :: lon = 1 | ||
integer, parameter :: lat = 1 | ||
|
||
integer :: binary_lake | ||
|
||
real :: lat2d(lon,lat) | ||
real :: ocn_frac(lon,lat) | ||
real :: lake_frac(lon,lat) | ||
real :: lake_depth(lon,lat) | ||
real :: land_frac(lon,lat) | ||
real :: slmsk(lon,lat) | ||
|
||
print*,"Begin test of merge routine" | ||
|
||
! test point 1 | ||
|
||
binary_lake = 0 | ||
lat2d(1,1) = 30.0 | ||
ocn_frac(1,1) = .75 | ||
lake_frac(1,1) = 0.0 | ||
lake_depth(1,1) = 0.0 | ||
land_frac(1,1) = -99. | ||
slmsk(1,1) = -99. | ||
|
||
call merge(lon, lat, binary_lake, lat2d, ocn_frac, & | ||
lake_frac, lake_depth, land_frac, slmsk) | ||
|
||
print*,'test point 1 ' | ||
print*,'ocn_frac ',ocn_frac(1,1) | ||
print*,'lake_frac ',lake_frac(1,1) | ||
print*,'lake_depth ',lake_depth(1,1) | ||
print*,'land_frac ',land_frac(1,1) | ||
print*,'slmsk ', slmsk(1,1) | ||
|
||
! test point 2 | ||
|
||
binary_lake = 0 | ||
lat2d(1,1) = 30.0 | ||
ocn_frac(1,1) = 0.0 | ||
lake_frac(1,1) = .75 | ||
lake_depth(1,1) = 100.0 | ||
land_frac(1,1) = -99. | ||
slmsk(1,1) = -99. | ||
|
||
call merge(lon, lat, binary_lake, lat2d, ocn_frac, & | ||
lake_frac, lake_depth, land_frac, slmsk) | ||
|
||
print*,'test point 2 ' | ||
print*,'ocn_frac ',ocn_frac(1,1) | ||
print*,'lake_frac ',lake_frac(1,1) | ||
print*,'lake_depth ',lake_depth(1,1) | ||
print*,'land_frac ',land_frac(1,1) | ||
print*,'slmsk ', slmsk(1,1) | ||
print*, "OK" | ||
|
||
print*, "SUCCESS!" | ||
|
||
end program ftst_merge |