Skip to content

Commit

Permalink
Merge pull request #511 from mmuetzel/cmake
Browse files Browse the repository at this point in the history
Use unique Fortran module names
  • Loading branch information
raback authored Aug 3, 2024
2 parents 49032a9 + 6d07c51 commit feabc69
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-windows-mingw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ jobs:
mkdir ${GITHUB_WORKSPACE}/build
cd ${GITHUB_WORKSPACE}/build
cmake \
-G "MSYS Makefiles" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/usr" \
-DCPACK_BUNDLE_EXTRA_WINDOWS_DLLS=OFF \
Expand Down
25 changes: 12 additions & 13 deletions fem/tests/mgdyn_anisotropic_cond/currents.f90
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

module ToroidCurrents
contains
module ToroidCurrents1
contains

function rho(r, r0, y)
USE Types
USE Types
real(kind=dp) :: rho, r, r0, y

rho = sqrt((r-r0)**2+y**2)
end function rho

function currentInToroidR(r, r0, y, turns, I) result (curr)
USE Types
USE Types
real(kind=dp) :: r, r0, y, curr, rho1, rho2, turns, I

rho1 = rho(8d-3, r0, y)
rho2 = rho(10d-3, r0, y)

Expand All @@ -21,21 +21,21 @@ function currentInToroidR(r, r0, y, turns, I) result (curr)
end function currentInToroidR

function currentInToroidY(r, r0, y, turns, I) result (curr)
USE Types
USE Types
real(kind=dp) :: r, r0, y, curr, rho1, rho2, turns, I

rho1 = rho(8d-3, r0, y)
rho2 = rho(10d-3, r0, y)

curr = turns * I /(2*pi*(rho2-rho1)*r)*((r-r0)/rho(r, r0, y))

end function currentInToroidY

End module ToroidCurrents
End module ToroidCurrents1

FUNCTION currdens1( model, n, args) RESULT(curr)
USE DefUtils
Use ToroidCurrents
Use ToroidCurrents1
IMPLICIT None
TYPE(Model_t) :: model
INTEGER :: n
Expand Down Expand Up @@ -65,7 +65,7 @@ END FUNCTION currdens1

FUNCTION currdens2( model, n, args) RESULT(curr)
USE DefUtils
Use ToroidCurrents
Use ToroidCurrents1
IMPLICIT None
TYPE(Model_t) :: model
INTEGER :: n
Expand Down Expand Up @@ -95,7 +95,7 @@ END FUNCTION currdens2

FUNCTION currdens3( model, n, args) RESULT(curr)
USE DefUtils
Use ToroidCurrents
Use ToroidCurrents1
IMPLICIT None
TYPE(Model_t) :: model
INTEGER :: n
Expand All @@ -122,4 +122,3 @@ FUNCTION currdens3( model, n, args) RESULT(curr)
curr = currentInToroidR(r, r0, y, turns, I) * cos(theta)

END FUNCTION currdens3

26 changes: 12 additions & 14 deletions fem/tests/mgdyn_lamstack_lowfreq_transient/currents.f90
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

module ToroidCurrents
contains
module ToroidCurrents2
contains

function rho(r, r0, y)
USE Types
USE Types
real(kind=dp) :: rho, r, r0, y

rho = sqrt((r-r0)**2+y**2)
end function rho

function currentInToroidR(r, r0, y, turns, I) result (curr)
USE Types
USE Types
real(kind=dp) :: r, r0, y, curr, rho1, rho2, turns, I

rho1 = rho(8d-3, r0, y)
rho2 = rho(10d-3, r0, y)

Expand All @@ -21,21 +21,21 @@ function currentInToroidR(r, r0, y, turns, I) result (curr)
end function currentInToroidR

function currentInToroidY(r, r0, y, turns, I) result (curr)
USE Types
USE Types
real(kind=dp) :: r, r0, y, curr, rho1, rho2, turns, I

rho1 = rho(8d-3, r0, y)
rho2 = rho(10d-3, r0, y)

curr = turns * I /(2*pi*(rho2-rho1)*r)*((r-r0)/rho(r, r0, y))

end function currentInToroidY

End module ToroidCurrents
End module ToroidCurrents2

FUNCTION currdens1( model, n, args) RESULT(curr)
USE DefUtils
Use ToroidCurrents
Use ToroidCurrents2
IMPLICIT None
TYPE(Model_t) :: model
INTEGER :: n
Expand Down Expand Up @@ -65,7 +65,7 @@ END FUNCTION currdens1

FUNCTION currdens2( model, n, args) RESULT(curr)
USE DefUtils
Use ToroidCurrents
Use ToroidCurrents2
IMPLICIT None
TYPE(Model_t) :: model
INTEGER :: n
Expand Down Expand Up @@ -95,7 +95,7 @@ END FUNCTION currdens2

FUNCTION currdens3( model, n, args) RESULT(curr)
USE DefUtils
Use ToroidCurrents
Use ToroidCurrents2
IMPLICIT None
TYPE(Model_t) :: model
INTEGER :: n
Expand All @@ -122,5 +122,3 @@ FUNCTION currdens3( model, n, args) RESULT(curr)
curr = currentInToroidR(r, r0, y, turns, I) * cos(theta)

END FUNCTION currdens3


0 comments on commit feabc69

Please sign in to comment.