-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Replace mixer implementations with more modern variants * Implement FYPP macros and re-enable assertions
- Loading branch information
Showing
19 changed files
with
1,016 additions
and
572 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
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,41 @@ | ||
#:include 'common.fypp' | ||
|
||
!> Auxiliary subroutines for the ASSERT command | ||
module common_assert | ||
|
||
implicit none | ||
|
||
private | ||
#:block DEBUG_CODE | ||
public :: assertError | ||
#:endblock DEBUG_CODE | ||
|
||
contains | ||
|
||
#:block DEBUG_CODE | ||
|
||
!> Prints assertion error and abort program execution. | ||
subroutine assertError(fileName, lineNr, message) | ||
|
||
!> Name of the file in which the error occurred. | ||
character(*), intent(in) :: fileName | ||
|
||
!> Nr. of the line at which the error occurred. | ||
integer, intent(in) :: lineNr | ||
|
||
!> Additional message for error | ||
character(*), intent(in), optional :: message | ||
|
||
write(*, '(A)') "!!! UNFULLFILLED ASSERTION" | ||
write(*, '(A,A)') "!!! FILE: ", fileName | ||
write(*, '(A,I0)') "!!! LINE NR.: ", lineNr | ||
if (present(message)) then | ||
write(*, '(A,A,A)') '!!! MESSAGE: "', trim(message), '"' | ||
end if | ||
error stop | ||
|
||
end subroutine assertError | ||
|
||
#:endblock DEBUG_CODE | ||
|
||
end module common_assert |
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,48 @@ | ||
!> Interface wrapper for the blas routines. | ||
!! | ||
!! ALL BLAS routines which are called from the main code must be included here. | ||
module blas | ||
|
||
use common_accuracy, only : rdp | ||
public | ||
|
||
interface | ||
|
||
|
||
!> Performs the rank 1 operation | ||
!! A := alpha*x*y**T + A, | ||
subroutine dger(mm, nn, alpha, xx, incx, yy, incy, aa, lda) | ||
import rdp | ||
|
||
!> Matrix sizing | ||
integer, intent(in) :: mm | ||
|
||
!> Matrix size | ||
integer, intent(in) :: nn | ||
|
||
!> Scale factor | ||
real(rdp), intent(in) :: alpha | ||
|
||
!> Vector | ||
real(rdp), intent(in) :: xx(*) | ||
|
||
!> Stride | ||
integer, intent(in) :: incx | ||
|
||
!> Vector | ||
real(rdp), intent(in) :: yy(*) | ||
|
||
!> Stride | ||
integer, intent(in) :: incy | ||
|
||
!> Leading matrix dimension | ||
integer, intent(in) :: lda | ||
|
||
!> Matrix A | ||
real(rdp), intent(inout) :: aa(lda, *) | ||
|
||
end subroutine dger | ||
|
||
end interface | ||
|
||
end module blas |
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,51 @@ | ||
#:include 'common.fypp' | ||
|
||
!> Contains F90 wrapper functions for some commonly used blas calls needed in the code. | ||
!! The interface of all BLAS calls must be defined in the module blas. | ||
module blasroutines | ||
|
||
use common_accuracy, only : rdp | ||
use blas, only : dger | ||
implicit none | ||
|
||
private | ||
public :: ger | ||
|
||
|
||
!> Rank 1 update of a matrix A := alpha*x*y' + A | ||
!! Wrapper for the level 2 blas routine xger to perform the rank 1 update of a general matrix | ||
interface ger | ||
module procedure ger_dble | ||
end interface ger | ||
|
||
|
||
contains | ||
|
||
!> Double precision rank 1 update of a general matrix | ||
subroutine ger_dble(a, alpha, x, y) | ||
|
||
!> Contains the matrix for the update | ||
real(rdp), intent(inout) :: a(:,:) | ||
|
||
!> Scaling value for the update contribution | ||
real(rdp), intent(in) :: alpha | ||
|
||
!> Vector of values for the update | ||
real(rdp), intent(in) :: x(:) | ||
|
||
!> Vector of values for the update | ||
real(rdp), intent(in) :: y(:) | ||
|
||
integer :: n, m | ||
|
||
@:ASSERT(size(a,dim=1) == size(x)) | ||
@:ASSERT(size(a,dim=2) == size(y)) | ||
|
||
m = size(x) | ||
n = size(y) | ||
|
||
call dger(m, n, alpha, x, 1, y, 1, a, m) | ||
|
||
end subroutine ger_dble | ||
|
||
end module blasroutines |
Oops, something went wrong.