-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
3 changed files
with
58 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
MODULE MODULE_TIMESOLVER | ||
|
||
use MODULE_PRECISION | ||
use MODULE_CONSTANTS | ||
use MODULE_QUADTREE | ||
|
||
contains | ||
!================================================================================================= | ||
subroutine compute_dt_array(first, last, tree, dt) | ||
implicit none | ||
integer(ip), intent(in) :: first, last | ||
type(quadtree), dimensioN(first:last), intent(in) :: tree | ||
real(rp), intent(inout) :: dt | ||
integer(ip) :: i | ||
|
||
do i = first, last | ||
call compute_dt_single(tree(i), dt) | ||
end do | ||
|
||
return | ||
end subroutine compute_dt_array | ||
!================================================================================================== | ||
recursive subroutine compute_dt_single(tree, dt) | ||
implicit none | ||
type(quadtree), intent(in) :: tree | ||
real(rp), intent(inout) :: dt | ||
|
||
if (.not. tree%is_leaf) then | ||
call compute_dt_single(tree%north_west, dt) | ||
call compute_dt_single(tree%north_east, dt) | ||
call compute_dt_single(tree%south_west, dt) | ||
call compute_dt_single(tree%south_east, dt) | ||
else | ||
dt = min(dt, tree%data%dt) | ||
end if | ||
return | ||
end subroutine compute_dt_single | ||
END MODULE MODULE_TIMESOLVER |