Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(out), | dimension(:, :, :, :) | :: | residue | Store residue at each cell-center |
|
real(kind=wp), | intent(in), | dimension(:, :, :, :) | :: | F | Store fluxes throught the I faces |
|
real(kind=wp), | intent(in), | dimension(:, :, :, :) | :: | G | Store fluxes throught the J faces |
|
real(kind=wp), | intent(in), | dimension(:, :, :, :) | :: | H | Store fluxes throught the K faces |
|
type(extent), | intent(in) | :: | dims | extent of the 3D domain |
subroutine compute_residue(residue,F,G,H,dims)
implicit none
type(extent), intent(in) :: dims
!< extent of the 3D domain
real(wp), dimension(:, :, :, :), intent(out) :: residue
!< Store residue at each cell-center
real(wp), dimension(:, :, :, :), intent(in) :: F
!< Store fluxes throught the I faces
real(wp), dimension(:, :, :, :), intent(in) :: G
!< Store fluxes throught the J faces
real(wp), dimension(:, :, :, :), intent(in) :: H
!< Store fluxes throught the K faces
integer :: i, j, k, l
DebugCall('compute_residue')
do l = 1, dims%n_var
do k = 1, dims%kmx - 1
do j = 1, dims%jmx - 1
do i = 1, dims%imx - 1
residue(i, j, k, l) = (F(i+1, j, k, l) - F(i, j, k, l)) &
+ (G(i, j+1, k, l) - G(i, j, k, l)) &
+ (H(i, j, k+1, l) - H(i, j, k, l))
end do
end do
end do
end do
end subroutine compute_residue