-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sam Cox
committed
Sep 5, 2018
1 parent
4c2d515
commit 4e2e16d
Showing
1 changed file
with
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module constraint_test | ||
use fruit | ||
use types_mod | ||
implicit none | ||
|
||
contains | ||
|
||
subroutine test_calcPhotolysisRaw | ||
use types_mod | ||
use constraint_functions_mod, only : calcPhotolysisRaw | ||
use zenith_data_mod, only : cosx, secx | ||
implicit none | ||
|
||
! photolysis = l * cosx ** m * exp( -n * secx ) * tf | ||
cosx = 1.0_DP | ||
secx = 1.0_DP / cosx | ||
call assert_true(calcPhotolysisRaw( 1.0_DP, 1.0_DP, 1.0_DP, 1.0_DP ) == exp( -1.0_DP ), "calcPhotolysisRaw all ones") | ||
call assert_true(calcPhotolysisRaw( 2.0_DP, 1.0_DP, 1.0_DP, 1.0_DP ) == 2.0_DP * exp( -1.0_DP ), "calcPhotolysisRaw 2") | ||
|
||
cosx = 0.5_DP | ||
secx = 1.0_DP / cosx | ||
call assert_true(calcPhotolysisRaw( 2.0_DP, 1.0_DP, 1.0_DP, 1.0_DP ) == exp( -2.0_DP ), "calcPhotolysisRaw 3") | ||
call assert_true(calcPhotolysisRaw( 2.0_DP, 2.0_DP, 1.0_DP, 1.0_DP ) == 0.5_DP * exp( -2.0_DP ), "calcPhotolysisRaw 4") | ||
call assert_true(calcPhotolysisRaw( 2.0_DP, 1.0_DP, 2.0_DP, 1.0_DP ) == exp( -4.0_DP ), "calcPhotolysisRaw 5") | ||
call assert_true(calcPhotolysisRaw( 2.0_DP, 1.0_DP, 1.0_DP, 2.0_DP ) == 2.0_DP * exp( -2.0_DP ), "calcPhotolysisRaw 6") | ||
|
||
end subroutine test_calcPhotolysisRaw | ||
|
||
end module constraint_test |