Skip to content

Commit

Permalink
LinearForms.F90: Avoid compiler error with GFortran 10 or newer.
Browse files Browse the repository at this point in the history
The `dgemm` and `dgemv` functions expect rank-2 for some of their
arguments. Newer compilers (e.g., GFortran 10 or newer) emit an error
if the rank of the arguments don't match.
That error is currently downgraded to a warning by adding
`-fallow-argument-mismatch` to the Fortran compiler flags for GFortran.

Avoid that error/warning by passing the respective argument with the
expected rank.
  • Loading branch information
mmuetzel committed Sep 13, 2024
1 parent a6feb25 commit 0430347
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fem/src/LinearForms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ SUBROUTINE LinearForms_GradUdotGradU(m, n, dim, GradU, weight, G, alpha)
END IF
! Compute matrix \grad u \dot \grad u for dim=k
CALL DGEMM('T', 'N', n, n, blklen, &
1D0, GradU(ii,1,k), ldbasis, &
1D0, [[GradU(ii,1,k)]], ldbasis, &
wrk, ldwrk, 1D0, G, ldk)
END DO
END IF
Expand Down Expand Up @@ -252,7 +252,7 @@ SUBROUTINE LinearForms_GradUdotU(m, n, dim, GradU, U, weight, G, alpha, beta)
END IF
! Compute matrix \grad u \dot u for dim=k
CALL DGEMM('T', 'N', n, n, blklen, &
1D0, U(ii,1), lbasis, &
1D0, [[U(ii,1)]], lbasis, &
wrk, ldwrk, 1D0, G, ldk)
END DO
END IF
Expand Down Expand Up @@ -326,7 +326,7 @@ SUBROUTINE LinearForms_UdotV(m, n, dim, U, V, weight, G, alpha)
END IF
! Compute matrix u \dot u
CALL DGEMM('T', 'N', n, n, blklen, &
1D0, U(ii,1), ldbasis, &
1D0, [[U(ii,1)]], ldbasis, &
wrk, ldwrk, 1D0, G, ldk)
END IF
END DO ! Vector blocks
Expand Down Expand Up @@ -398,7 +398,7 @@ SUBROUTINE LinearForms_UdotU(m, n, dim, U, weight, G, alpha)
END IF
! Compute matrix u \dot u
CALL DGEMM('T', 'N', n, n, blklen, &
1D0, U(ii,1), ldbasis, &
1D0, [[U(ii,1)]], ldbasis, &
wrk, ldwrk, 1D0, G, ldk)
END IF
END DO ! Vector blocks
Expand Down Expand Up @@ -477,7 +477,7 @@ SUBROUTINE LinearForms_UdotF(m, n, U, weight, F, UdotF, alpha)
END IF

CALL DGEMV('T', blklen, n, &
1D0, U(ii,1), SIZE(U,1), wrk, 1, 1D0, UdotF, 1)
1D0, [[U(ii,1)]], SIZE(U,1), wrk, 1, 1D0, UdotF, 1)
END IF
END DO
END SUBROUTINE LinearForms_UdotF
Expand Down

0 comments on commit 0430347

Please sign in to comment.