Skip to content

Commit

Permalink
Move latbaset_max_lat() to test_Latbaset.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Nov 12, 2023
1 parent 35478a3 commit 239aa87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/biogeochem/CropType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module CropType
!
! !PUBLIC DATA TYPES:
public :: latbaset
public :: latbaset_max_lat
!

! Possible values of cphase
Expand Down Expand Up @@ -971,7 +970,7 @@ real(r8) function latbaset(baset, latdeg, baset_latvary_intercept, baset_latvary
real(r8), intent(in) :: baset_latvary_slope

! Was originally
! maxlat = latbaset_max_lat(baset_latvary_intercept, baset_latvary_slope)
! maxlat = baset_latvary_intercept / baset_latvary_slope
! if (abs(latdeg) > maxlat) then
! latbaset = baset
! else
Expand All @@ -983,11 +982,4 @@ real(r8) function latbaset(baset, latdeg, baset_latvary_intercept, baset_latvary

end function latbaset

real(r8) function latbaset_max_lat(intercept, slope)
real(r8), intent(in) :: intercept
real(r8), intent(in) :: slope

latbaset_max_lat = intercept / slope
end function latbaset_max_lat

end module CropType
9 changes: 8 additions & 1 deletion src/biogeochem/test/Latbaset_test/test_Latbaset.pf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module test_Latbaset
use unittestSubgridMod
use unittestSimpleSubgridSetupsMod
use unittestFilterBuilderMod
use CropType, only : latbaset, latbaset_max_lat
use CropType, only : latbaset

implicit none

Expand Down Expand Up @@ -36,6 +36,13 @@ contains
call unittest_subgrid_teardown()
end subroutine tearDown

real(r8) function latbaset_max_lat(intercept, slope)
real(r8), intent(in) :: intercept
real(r8), intent(in) :: slope

latbaset_max_lat = intercept / slope
end function latbaset_max_lat

@Test
subroutine too_far_north(this)
class(TestLatbaset), intent(inout) :: this
Expand Down

0 comments on commit 239aa87

Please sign in to comment.