Skip to content

Commit 1277200

Browse files
Merge pull request #336 from easifem/system-method-organize
This pull request introduces several improvements and refinements across configuration, documentation, and source files. The main changes include expanded Fortran source file inclusion in the System module, enhanced ARPACK interface definitions, improved Fortran code formatting, and updates to project metadata and linting configurations.
2 parents 584811e + be88f63 commit 1277200

24 files changed

Lines changed: 5019 additions & 5484 deletions

.helix/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[editor]
2+
workspace-lsp-roots = ["CMakeLists.txt", ".git"]

FORDsetup.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
project: easifemBase
3-
summary: easifemBase is part of easifem library, which is a framework for Expandable And Scalable Infrastructure for Finite Element Methods.
4-
project_download: https://github.com/vickysharma0812/easifem-base
5-
project_github: https://github.com/vickysharma0812/easifem-base
3+
summary: easifemBase is part of easifem library, which is a platform for Expandable And Scalable Infrastructure for Finite Element Methods.
4+
project_download: https://github.com/easifem/base
5+
project_github: https://github.com/easifem/base
66
project_website: https://www.easifem.com
77
license: gfdl
88
project_dir: ./src/modules/Utility
@@ -41,5 +41,3 @@ preprocesses: true
4141
---
4242

4343
{!./README.md!}
44-
45-
<!-- FORD features two macros to make it easier to provide intradocumentation links. These are `|url|` which gets replaced by the project URL, and `|media|`, which gets replaced by the (absolute) path to the media directory in the output. you can also use `favicon:` -->

fortitude.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
[check]
22
preview = true
3-
select = ["C", "E", "S", "MOD", "OB"]
4-
# ignore = []
3+
select = ["C", "E", "S", "MOD"]
4+
ignore = [
5+
"superfluous-implicit-none",
6+
"implicit-external-procedures",
7+
"interface-implicit-typing",
8+
]
59
file-extensions = ["f90", "F90"]
610
line-length = 78
7-
fix = false
11+
fix = true
812
# output-format = "full"
913
# show-fixes = false
1014
# unsafe-fixes = true

src/modules/ARPACK/src/ARPACK_SAUPD.F90

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,52 @@
1515
! along with this program. If not, see <https: //www.gnu.org/licenses/>
1616
!
1717

18+
!> author: Vikas Sharma, Ph. D.
19+
! date: 2022-12-09
20+
! summary: Reverse communication interface (RCI) for the Implicitly
21+
! Restarted Arnoldi Iteration.
22+
1823
MODULE ARPACK_SAUPD
1924
USE GlobalData, ONLY: I4B, DFP, LGT
2025
USE String_Class, ONLY: String
2126
IMPLICIT NONE
2227
PRIVATE
2328

29+
PUBLIC :: SAUPD_ErrorMsg
30+
PUBLIC :: SEUPD_ErrorMsg
31+
PUBLIC :: SymLargestEigenVal
32+
PUBLIC :: SymSmallestEigenVal
33+
2434
!----------------------------------------------------------------------------
2535
! SAUPD_ErrorMsg
2636
!----------------------------------------------------------------------------
2737

38+
!> author: Vikas Sharma, Ph. D.
39+
! date: 2022-12-09
40+
! summary: error message for SAUPD
41+
2842
INTERFACE
2943
MODULE FUNCTION SAUPD_ErrorMsg(INFO) RESULT(ans)
3044
INTEGER(I4B), INTENT(IN) :: INFO
3145
TYPE(String) :: ans
3246
END FUNCTION SAUPD_ErrorMsg
3347
END INTERFACE
3448

35-
PUBLIC :: SAUPD_ErrorMsg
36-
3749
!----------------------------------------------------------------------------
3850
! SAUPD_ErrorMsg
3951
!----------------------------------------------------------------------------
4052

53+
!> author: Vikas Sharma, Ph. D.
54+
! date: 2022-12-09
55+
! summary: error message for SEUPD
56+
4157
INTERFACE
4258
MODULE FUNCTION SEUPD_ErrorMsg(INFO) RESULT(ans)
4359
INTEGER(I4B), INTENT(IN) :: INFO
4460
TYPE(String) :: ans
4561
END FUNCTION SEUPD_ErrorMsg
4662
END INTERFACE
4763

48-
PUBLIC :: SEUPD_ErrorMsg
49-
5064
!----------------------------------------------------------------------------
5165
!
5266
!----------------------------------------------------------------------------
@@ -59,10 +73,10 @@ END FUNCTION SEUPD_ErrorMsg
5973
!
6074
!- This routine calculates the largest eigenvalue of a real sym dense matrix.
6175
!- It calls ARPACK SSAUPD or DSAUPD routine
62-
63-
INTERFACE
76+
!
77+
INTERFACE SymLargestEigenVal
6478
MODULE FUNCTION SymLargestEigenVal1(mat, which, NCV, maxIter, tol) &
65-
& RESULT(ans)
79+
RESULT(ans)
6680
REAL(DFP), INTENT(IN) :: mat(:, :)
6781
!! dense matrix
6882
CHARACTER(*), OPTIONAL, INTENT(IN) :: which
@@ -80,30 +94,24 @@ MODULE FUNCTION SymLargestEigenVal1(mat, which, NCV, maxIter, tol) &
8094
REAL(DFP) :: ans
8195
!! maximum eigenvalue
8296
END FUNCTION SymLargestEigenVal1
83-
END INTERFACE
84-
85-
INTERFACE SymLargestEigenVal
86-
MODULE PROCEDURE SymLargestEigenVal1
8797
END INTERFACE SymLargestEigenVal
8898

89-
PUBLIC :: SymLargestEigenVal
90-
9199
!----------------------------------------------------------------------------
92100
!
93101
!----------------------------------------------------------------------------
94102

95103
!> author: Vikas Sharma, Ph. D.
96104
! date: 2022-12-10
97-
! summary: Calculate the `nev` smallest eigenvalue of a real sym dense matrix
105+
! summary: Calculate the smallest eigenvalue of a real sym dense matrix
98106
!
99107
!# Introduction
100108
!
101109
!- This routine calculates the smallest eigenvalue of a real sym dense matrix.
102110
!- It calls ARPACK SSAUPD or DSAUPD routine
103-
104-
INTERFACE
111+
!
112+
INTERFACE SymLargestEigenVal
105113
MODULE FUNCTION SymLargestEigenVal2(mat, nev, which, NCV, maxIter, tol) &
106-
& RESULT(ans)
114+
RESULT(ans)
107115
REAL(DFP), INTENT(IN) :: mat(:, :)
108116
!! dense matrix
109117
INTEGER(I4B), INTENT(IN) :: nev
@@ -123,10 +131,6 @@ MODULE FUNCTION SymLargestEigenVal2(mat, nev, which, NCV, maxIter, tol) &
123131
REAL(DFP) :: ans(nev)
124132
!! first k, largest eigenvalue
125133
END FUNCTION SymLargestEigenVal2
126-
END INTERFACE
127-
128-
INTERFACE SymLargestEigenVal
129-
MODULE PROCEDURE SymLargestEigenVal2
130134
END INTERFACE SymLargestEigenVal
131135

132136
!----------------------------------------------------------------------------
@@ -156,9 +160,9 @@ END FUNCTION SymLargestEigenVal2
156160
! decomposition of mat0.
157161
!@endnote
158162

159-
INTERFACE
163+
INTERFACE SymSmallestEigenVal
160164
MODULE FUNCTION SymSmallestEigenVal1(mat, sigma, which, NCV, maxIter, tol) &
161-
& RESULT(ans)
165+
RESULT(ans)
162166
REAL(DFP), INTENT(IN) :: mat(:, :)
163167
!! dense matrix
164168
REAL(DFP), OPTIONAL, INTENT(IN) :: sigma
@@ -178,14 +182,8 @@ MODULE FUNCTION SymSmallestEigenVal1(mat, sigma, which, NCV, maxIter, tol) &
178182
REAL(DFP) :: ans
179183
!! maximum eigenvalue
180184
END FUNCTION SymSmallestEigenVal1
181-
END INTERFACE
182-
183-
INTERFACE SymSmallestEigenVal
184-
MODULE PROCEDURE SymSmallestEigenVal1
185185
END INTERFACE SymSmallestEigenVal
186186

187-
PUBLIC :: SymSmallestEigenVal
188-
189187
!----------------------------------------------------------------------------
190188
!
191189
!----------------------------------------------------------------------------
@@ -205,19 +203,15 @@ END FUNCTION SymSmallestEigenVal1
205203
!
206204
!- [ ] TODO use Cholsky factorization instead of LU as mat is
207205
! symmetric.
208-
!
209206

210-
INTERFACE
207+
INTERFACE SymSmallestEigenVal
211208
MODULE FUNCTION SymSmallestEigenVal2(mat, isFactor, ipiv, sigma, which, &
212-
& NCV, maxIter, tol) &
213-
& RESULT(ans)
209+
NCV, maxIter, tol) RESULT(ans)
214210
REAL(DFP), INTENT(INOUT) :: mat(:, :)
215-
!!
216211
!! Dense matrix
217212
!! If isFactor is false, then this matrix will change on return
218213
!! in this case, it will contain LU decomposition of `A-sigma*I`
219214
!! If isFactor is true, then this matrix will not change
220-
!!
221215
LOGICAL(LGT), INTENT(INOUT) :: isFactor
222216
!! if mat is already factorized, the set isFactor to true
223217
!! if mat is not factorized, then set isFactor to false
@@ -244,10 +238,6 @@ MODULE FUNCTION SymSmallestEigenVal2(mat, isFactor, ipiv, sigma, which, &
244238
REAL(DFP) :: ans
245239
!! smallest eigenvalue
246240
END FUNCTION SymSmallestEigenVal2
247-
END INTERFACE
248-
249-
INTERFACE SymSmallestEigenVal
250-
MODULE PROCEDURE SymSmallestEigenVal2
251241
END INTERFACE SymSmallestEigenVal
252242

253243
END MODULE ARPACK_SAUPD

src/modules/Display/src/Display_Method.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,9 +1642,9 @@ SUBROUTINE EqualLine(unitNo)
16421642
INTEGER(I4B), INTENT(IN), OPTIONAL :: unitNo
16431643

16441644
IF (PRESENT(unitNo)) THEN
1645-
WRITE (unitNo, "(A)") equal
1645+
WRITE (unitNo, '(80("="))')
16461646
ELSE
1647-
WRITE (stdout, "(A)") equal
1647+
WRITE (stdout, '(80("="))')
16481648
END IF
16491649

16501650
END SUBROUTINE EqualLine

src/modules/String/src/String_Class.F90

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ MODULE String_Class
2929
! INTEGER, PARAMETER, PUBLIC :: CK = SELECTED_CHAR_KIND('DEFAULT')
3030
INTEGER, PARAMETER :: CK = SELECTED_CHAR_KIND('DEFAULT')
3131
! internal parameters
32-
CHARACTER(kind=CK, len=26), PARAMETER :: UPPER_ALPHABET = &
33-
& 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
34-
CHARACTER(kind=CK, len=26), PARAMETER :: LOWER_ALPHABET = &
35-
& 'abcdefghijklmnopqrstuvwxyz'
32+
CHARACTER(kind=CK, len=26), PARAMETER :: UPPER_ALPHABET = &
33+
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
34+
CHARACTER(kind=CK, len=26), PARAMETER :: LOWER_ALPHABET = &
35+
'abcdefghijklmnopqrstuvwxyz'
3636
CHARACTER(kind=CK, len=1), PARAMETER :: SPACE = ' '
3737
CHARACTER(kind=CK, len=1), PARAMETER :: TAB = ACHAR(9)
3838
CHARACTER(kind=CK, len=1), PARAMETER :: UIX_DIR_SEP = CHAR(47)
@@ -44,7 +44,7 @@ MODULE String_Class
4444

4545
INTERFACE strjoin
4646
MODULE PROCEDURE strjoin_strings, strjoin_characters, &
47-
& strjoin_strings_array, strjoin_characters_array
47+
strjoin_strings_array, strjoin_characters_array
4848
END INTERFACE strjoin
4949

5050
PUBLIC :: strjoin
@@ -89,7 +89,7 @@ MODULE String_Class
8989

9090
INTERFACE index
9191
MODULE PROCEDURE sindex_string_string, sindex_string_character, &
92-
& sindex_character_string
92+
sindex_character_string
9393
END INTERFACE index
9494

9595
!----------------------------------------------------------------------------
@@ -150,7 +150,7 @@ MODULE String_Class
150150

151151
INTERFACE verify
152152
MODULE PROCEDURE sverify_string_string, sverify_string_character, &
153-
& sverify_character_string
153+
sverify_character_string
154154
END INTERFACE verify
155155

156156
PUBLIC :: verify

src/modules/System/CMakeLists.txt

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@
1616
#
1717

1818
set(src_path "${CMAKE_CURRENT_LIST_DIR}/src/")
19-
target_sources(${PROJECT_NAME} PRIVATE ${src_path}/System_Method.F90)
20-
19+
target_sources(
20+
${PROJECT_NAME}
21+
PRIVATE
22+
${src_path}/SystemInterface.F90
23+
${src_path}/SystemOptions.F90
24+
${src_path}/System_Method.F90
25+
${src_path}/SystemSignal_Method.F90
26+
${src_path}/SystemFile_Method.F90
27+
${src_path}/SystemEnvironment_Method.F90
28+
${src_path}/SystemEnquiry_Method.F90
29+
${src_path}/SystemProcess_Method.F90
30+
${src_path}/System_Utility.F90
31+
)
2132

2233
set(subproject_name "easifemSystem")
2334

@@ -28,16 +39,17 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${subproject_name})
2839
# target properties
2940

3041
set_target_properties(
31-
${subproject_name}
32-
PROPERTIES POSITION_INDEPENDENT_CODE 1
33-
SOVERSION ${VERSION_MAJOR}
34-
# OUTPUT_NAME ${PROJECT_NAME}
35-
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
36-
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
37-
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
38-
MACOSX_RPATH ON
39-
WINDOWS_EXPORT_ALL_SYMBOLS ON
40-
LINKER_LANGUAGE C)
41-
42+
${subproject_name}
43+
PROPERTIES
44+
POSITION_INDEPENDENT_CODE 1
45+
SOVERSION ${VERSION_MAJOR}
46+
# OUTPUT_NAME ${PROJECT_NAME}
47+
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
48+
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
49+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
50+
MACOSX_RPATH ON
51+
WINDOWS_EXPORT_ALL_SYMBOLS ON
52+
LINKER_LANGUAGE C
53+
)
4254

4355
list(APPEND C_PROJECTS ${subproject_name})

0 commit comments

Comments
 (0)