Skip to content

Commit

Permalink
#2766: Updates to PSyADwq
Browse files Browse the repository at this point in the history
  • Loading branch information
TeranIvy committed Nov 18, 2024
1 parent 6004a78 commit 4d6b22d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ subroutine dg_matrix_vector_code(cell, &
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
real(kind=r_def), dimension(undf2), intent(in) :: x
real(kind=r_def), dimension(undf1), intent(inout) :: lhs
real(kind=r_def), dimension(ndf1,ndf2,ncell_3d), intent(in) :: matrix
real(kind=r_def), dimension(ncell_3d,ndf1,ndf2), intent(in) :: matrix

! Internal variables
integer(kind=i_def) :: df, k, ik
Expand All @@ -87,7 +87,7 @@ subroutine dg_matrix_vector_code(cell, &
x_e(df) = x(map2(df)+k)
end do
ik = (cell-1)*nlayers + k + 1
lhs_e = matmul(matrix(:,:,ik),x_e)
lhs_e = matmul(matrix(ik,:,:),x_e)
do df = 1,ndf1
lhs(map1(df)+k) = lhs_e(df)
end do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine transpose_matrix_vector_code(cell, &
integer(kind=i_def), dimension(ndf2), intent(in) :: map2
real(kind=r_def), dimension(undf2), intent(in) :: x
real(kind=r_def), dimension(undf1), intent(inout) :: lhs
real(kind=r_def), dimension(ndf2,ndf1,ncell_3d), intent(in) :: matrix
real(kind=r_def), dimension(ncell_3d,ndf2,ndf1), intent(in) :: matrix
real(kind=r_def), dimension(ndf1,ndf2) :: transposed_matrix

! Internal variables
Expand All @@ -88,10 +88,10 @@ subroutine transpose_matrix_vector_code(cell, &
end do
ik = (cell-1)*nlayers + k + 1
! NB: Later versions of the GNU compiler (>= 9.0) appear to have problems
! with lhs_e = matmul(transposed(matrix(:,:,ik)),x_e), so to avoid these
! with lhs_e = matmul(transposed(matrix(ik,:,:)),x_e), so to avoid these
! issues the local transpose matrix multiplication is performed in two
! stages.
transposed_matrix(:,:) = transpose(matrix(:,:,ik))
transposed_matrix(:,:) = transpose(matrix(ik,:,:))
lhs_e = matmul(transposed_matrix,x_e)
do df = 1,ndf1
lhs(map1(df)+k) = lhs(map1(df)+k) + lhs_e(df)
Expand Down

0 comments on commit 4d6b22d

Please sign in to comment.