-
Notifications
You must be signed in to change notification settings - Fork 73
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
1 parent
b9e6875
commit 3b53b1b
Showing
39 changed files
with
1,039 additions
and
211 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/tests/**/* linguist-generated=true | ||
/toolchain/mechanisms/* linguist-generated=true |
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
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,6 @@ | ||
#!/bin/bash | ||
|
||
for file in $(find src -type f | grep -Ev 'autogen' | grep -E '\.fpp$'); do | ||
echo "$file" | ||
mv "$file" "$(echo "$file" | sed s/\.fpp/\.fypp/)" | ||
done |
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,127 @@ | ||
module m_finite_differences | ||
|
||
use m_global_parameters | ||
|
||
implicit none | ||
|
||
contains | ||
|
||
subroutine s_compute_fd_divergence(div, fields, ix_s, iy_s, iz_s) | ||
|
||
type(scalar_field), intent(INOUT) :: div | ||
type(scalar_field), intent(IN) :: fields(1:3) | ||
type(int_bounds_info), intent(IN) :: ix_s, iy_s, iz_s | ||
|
||
integer :: x, y, z !< Generic loop iterators | ||
|
||
real(kind(0d0)) :: divergence | ||
|
||
!$acc parallel loop collapse(3) private(divergence) | ||
do x = ix_s%beg, ix_s%end | ||
do y = iy_s%beg, iy_s%end | ||
do z = iz_s%beg, iz_s%end | ||
|
||
if (x == ix_s%beg) then | ||
divergence = (-3d0*fields(1)%sf(x, y, z) + 4d0*fields(1)%sf(x + 1, y, z) - fields(1)%sf(x + 2, y, z))/(x_cc(x + 2) - x_cc(x)) | ||
else if (x == ix_s%end) then | ||
divergence = (+3d0*fields(1)%sf(x, y, z) - 4d0*fields(1)%sf(x - 1, y, z) + fields(1)%sf(x - 2, y, z))/(x_cc(x) - x_cc(x - 2)) | ||
else | ||
divergence = (fields(1)%sf(x + 1, y, z) - fields(1)%sf(x - 1, y, z))/(x_cc(x + 1) - x_cc(x - 1)) | ||
end if | ||
|
||
if (n > 0) then | ||
if (y == iy_s%beg) then | ||
divergence = divergence + (-3d0*fields(2)%sf(x, y, z) + 4d0*fields(2)%sf(x, y + 1, z) - fields(2)%sf(x, y + 2, z))/(y_cc(y + 2) - y_cc(y)) | ||
else if (y == iy_s%end) then | ||
divergence = divergence + (+3d0*fields(2)%sf(x, y, z) - 4d0*fields(2)%sf(x, y - 1, z) + fields(2)%sf(x, y - 2, z))/(y_cc(y) - y_cc(y - 2)) | ||
else | ||
divergence = divergence + (fields(2)%sf(x, y + 1, z) - fields(2)%sf(x, y - 1, z))/(y_cc(y + 1) - y_cc(y - 1)) | ||
end if | ||
end if | ||
|
||
if (p > 0) then | ||
if (z == iz_s%beg) then | ||
divergence = divergence + (-3d0*fields(3)%sf(x, y, z) + 4d0*fields(3)%sf(x, y, z + 1) - fields(3)%sf(x, y, z + 2))/(z_cc(z + 2) - z_cc(z)) | ||
else if (z == iz_s%end) then | ||
divergence = divergence + (+3d0*fields(3)%sf(x, y, z) - 4d0*fields(3)%sf(x, y, z - 1) + fields(2)%sf(x, y, z - 2))/(z_cc(z) - z_cc(z - 2)) | ||
else | ||
divergence = divergence + (fields(3)%sf(x, y, z + 1) - fields(3)%sf(x, y, z - 1))/(z_cc(z + 1) - z_cc(z - 1)) | ||
end if | ||
end if | ||
|
||
div%sf(x, y, z) = div%sf(x, y, z) + divergence | ||
|
||
end do | ||
end do | ||
end do | ||
|
||
end subroutine s_compute_fd_divergence | ||
|
||
!> The purpose of this subroutine is to compute the finite- | ||
!! difference coefficients for the centered schemes utilized | ||
!! in computations of first order spatial derivatives in the | ||
!! s-coordinate direction. The s-coordinate direction refers | ||
!! to the x-, y- or z-coordinate direction, depending on the | ||
!! subroutine's inputs. Note that coefficients of up to 4th | ||
!! order accuracy are available. | ||
!! @param q Number of cells in the s-coordinate direction | ||
!! @param s_cc Locations of the cell-centers in the s-coordinate direction | ||
!! @param fd_coeff_s Finite-diff. coefficients in the s-coordinate direction | ||
subroutine s_compute_finite_difference_coefficients(q, s_cc, fd_coeff_s, buff_size, & | ||
fd_number_in, fd_order_in, offset_s) | ||
integer :: lB, lE !< loop bounds | ||
integer, intent(IN) :: q | ||
integer, intent(IN) :: buff_size, fd_number_in, fd_order_in | ||
type(int_bounds_info), optional, intent(IN) :: offset_s | ||
real(kind(0d0)), allocatable, dimension(:, :), intent(INOUT) :: fd_coeff_s | ||
real(kind(0d0)), & | ||
dimension(-buff_size:q + buff_size), & | ||
intent(IN) :: s_cc | ||
integer :: i !< Generic loop iterator | ||
if (present(offset_s)) then | ||
lB = -offset_s%beg | ||
lE = q + offset_s%end | ||
else | ||
lB = 0 | ||
lE = q | ||
end if | ||
if (allocated(fd_coeff_s)) deallocate (fd_coeff_s) | ||
allocate (fd_coeff_s(-fd_number_in:fd_number_in, lb:lE)) | ||
! Computing the 1st order finite-difference coefficients | ||
if (fd_order_in == 1) then | ||
do i = lB, lE | ||
fd_coeff_s(-1, i) = 0d0 | ||
fd_coeff_s(0, i) = -1d0/(s_cc(i + 1) - s_cc(i)) | ||
fd_coeff_s(1, i) = -fd_coeff_s(0, i) | ||
end do | ||
! Computing the 2nd order finite-difference coefficients | ||
elseif (fd_order_in == 2) then | ||
do i = lB, lE | ||
fd_coeff_s(-1, i) = -1d0/(s_cc(i + 1) - s_cc(i - 1)) | ||
fd_coeff_s(0, i) = 0d0 | ||
fd_coeff_s(1, i) = -fd_coeff_s(-1, i) | ||
end do | ||
! Computing the 4th order finite-difference coefficients | ||
else | ||
do i = lB, lE | ||
fd_coeff_s(-2, i) = 1d0/(s_cc(i - 2) - 8d0*s_cc(i - 1) - s_cc(i + 2) + 8d0*s_cc(i + 1)) | ||
fd_coeff_s(-1, i) = -8d0*fd_coeff_s(-2, i) | ||
fd_coeff_s(0, i) = 0d0 | ||
fd_coeff_s(1, i) = -fd_coeff_s(-1, i) | ||
fd_coeff_s(2, i) = -fd_coeff_s(-2, i) | ||
end do | ||
end if | ||
end subroutine s_compute_finite_difference_coefficients ! -------------- | ||
end module m_finite_differences | ||
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,12 @@ | ||
#:include 'case.fpp' | ||
|
||
module m_thermochem | ||
|
||
#:if chemistry | ||
use m_pyrometheus | ||
#:else | ||
integer, parameter :: num_species = 0 | ||
character(len=:), allocatable, dimension(:) :: species_names | ||
#:endif | ||
|
||
end module m_thermochem |
Oops, something went wrong.