From fb7c9f5d1c7061951bbaeb47438d9b4518f0472b Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Tue, 14 Oct 2025 23:29:33 +0530 Subject: [PATCH 1/8] submodule procedures declaration made compatible with older cmake versions --- src/stdlib_linalg.fypp | 8 ++++---- src/stdlib_linalg_diag.fypp | 8 ++++---- src/stdlib_system.F90 | 6 +++--- src/stdlib_system_subprocess.F90 | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/stdlib_linalg.fypp b/src/stdlib_linalg.fypp index c33668839..e9bbdbede 100644 --- a/src/stdlib_linalg.fypp +++ b/src/stdlib_linalg.fypp @@ -154,13 +154,13 @@ module stdlib_linalg ! Vector to matrix ! #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$(v) result(res) + pure module function diag_${t1[0]}$${k1}$(v) result(res) ${t1}$, intent(in) :: v(:) ${t1}$ :: res(size(v),size(v)) end function diag_${t1[0]}$${k1}$ #:endfor #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$_k(v,k) result(res) + pure module function diag_${t1[0]}$${k1}$_k(v,k) result(res) ${t1}$, intent(in) :: v(:) integer, intent(in) :: k ${t1}$ :: res(size(v)+abs(k),size(v)+abs(k)) @@ -171,13 +171,13 @@ module stdlib_linalg ! Matrix to vector ! #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$_mat(A) result(res) + pure module function diag_${t1[0]}$${k1}$_mat(A) result(res) ${t1}$, intent(in) :: A(:,:) ${t1}$ :: res(minval(shape(A))) end function diag_${t1[0]}$${k1}$_mat #:endfor #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$_mat_k(A,k) result(res) + pure module function diag_${t1[0]}$${k1}$_mat_k(A,k) result(res) ${t1}$, intent(in) :: A(:,:) integer, intent(in) :: k ${t1}$ :: res(minval(shape(A))-abs(k)) diff --git a/src/stdlib_linalg_diag.fypp b/src/stdlib_linalg_diag.fypp index 3e74ab67f..e303c946a 100644 --- a/src/stdlib_linalg_diag.fypp +++ b/src/stdlib_linalg_diag.fypp @@ -7,7 +7,7 @@ submodule (stdlib_linalg) stdlib_linalg_diag contains #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$(v) result(res) + pure module function diag_${t1[0]}$${k1}$(v) result(res) ${t1}$, intent(in) :: v(:) ${t1}$ :: res(size(v),size(v)) integer :: i @@ -20,7 +20,7 @@ contains #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$_k(v,k) result(res) + pure module function diag_${t1[0]}$${k1}$_k(v,k) result(res) ${t1}$, intent(in) :: v(:) integer, intent(in) :: k ${t1}$ :: res(size(v)+abs(k),size(v)+abs(k)) @@ -44,7 +44,7 @@ contains #:endfor #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$_mat(A) result(res) + pure module function diag_${t1[0]}$${k1}$_mat(A) result(res) ${t1}$, intent(in) :: A(:,:) ${t1}$ :: res(minval(shape(A))) integer :: i @@ -55,7 +55,7 @@ contains #:endfor #:for k1, t1 in RCI_KINDS_TYPES - module pure function diag_${t1[0]}$${k1}$_mat_k(A,k) result(res) + pure module function diag_${t1[0]}$${k1}$_mat_k(A,k) result(res) ${t1}$, intent(in) :: A(:,:) integer, intent(in) :: k ${t1}$ :: res(minval(shape(A))-abs(k)) diff --git a/src/stdlib_system.F90 b/src/stdlib_system.F90 index 783ea1b14..2fba7578b 100644 --- a/src/stdlib_system.F90 +++ b/src/stdlib_system.F90 @@ -500,7 +500,7 @@ end function run_sync_args !! !! @note The implementation relies on system-level process management capabilities. !! - module logical function process_is_running(process) result(is_running) + logical module function process_is_running(process) result(is_running) !> The process object to check. class(process_type), intent(inout) :: process !> Logical result: `.true.` if the process is still running, `.false.` otherwise. @@ -524,7 +524,7 @@ end function process_is_running !! !! @note The implementation relies on system-level process management capabilities. !! - module logical function process_is_completed(process) result(is_completed) + logical module function process_is_completed(process) result(is_completed) !> The process object to check. class(process_type), intent(inout) :: process !> Logical result: `.true.` if the process has completed, `.false.` otherwise. @@ -711,7 +711,7 @@ end subroutine process_callback !! !! @note This function relies on the `_WIN32` macro, which is defined in C compilers when targeting Windows. !! - module logical function is_windows() + logical module function is_windows() end function is_windows module function process_get_ID(process) result(ID) diff --git a/src/stdlib_system_subprocess.F90 b/src/stdlib_system_subprocess.F90 index 29cd0d412..0d62fdeee 100644 --- a/src/stdlib_system_subprocess.F90 +++ b/src/stdlib_system_subprocess.F90 @@ -331,7 +331,7 @@ subroutine launch_synchronous(process, args, stdin) end subroutine launch_synchronous !> Return the current (or total) process lifetime, in seconds - module real(RTICKS) function process_lifetime(process) result(delta_t) + real(RTICKS) module function process_lifetime(process) result(delta_t) class(process_type), intent(in) :: process real(RTICKS) :: ticks_per_second @@ -511,7 +511,7 @@ subroutine save_completed_state(process,delete_files) end subroutine save_completed_state !> Live check if a process is running - module logical function process_is_running(process) result(is_running) + logical module function process_is_running(process) result(is_running) class(process_type), intent(inout) :: process ! Each evaluation triggers a state update @@ -522,7 +522,7 @@ module logical function process_is_running(process) result(is_running) end function process_is_running !> Live check if a process has completed - module logical function process_is_completed(process) result(is_completed) + logical module function process_is_completed(process) result(is_completed) class(process_type), intent(inout) :: process ! Each evaluation triggers a state update @@ -600,7 +600,7 @@ end function assemble_cmd !> Returns the file path of the null device for the current operating system. !> !> Version: Helper function. - module logical function is_windows() + logical module function is_windows() is_windows = logical(process_is_windows()) end function is_windows From 376b08c17f3affd745c4405f59f41215f3c4fcdb Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:32:49 +0530 Subject: [PATCH 2/8] docs: added module procedure attribute ordering convention in Style Guide --- STYLE_GUIDE.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 70c2ebb8a..f2abed984 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -61,6 +61,15 @@ focus on the semantics of the proposed changes rather than style and formatting. ``` When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose. * If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute. +* For module procedures, declare attributes before the `module` keyword for better retro compatibility: + Use this: + ``` + pure module function example() + ``` + instead of: + ``` + module pure function example() + ``` ## End block closing statements From 79c9bf2f08952cc75ba02314d2b8ce627d58a4ba Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:39:33 +0530 Subject: [PATCH 3/8] docs: refined module procedure attribute ordering convention in Style Guide --- STYLE_GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index f2abed984..c02d8b443 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -64,11 +64,11 @@ focus on the semantics of the proposed changes rather than style and formatting. * For module procedures, declare attributes before the `module` keyword for better retro compatibility: Use this: ``` - pure module function example() + module ``` instead of: ``` - module pure function example() + module ``` ## End block closing statements From 407736e5f95c5eaf4ffa4c3f4b97bcdcf6374375 Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:45:40 +0530 Subject: [PATCH 4/8] docs: STYLE GUIDE attribute ordering convention --- STYLE_GUIDE.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index c02d8b443..303fa5310 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -61,16 +61,15 @@ focus on the semantics of the proposed changes rather than style and formatting. ``` When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose. * If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute. -* For module procedures, declare attributes before the `module` keyword for better retro compatibility: - Use this: - ``` - module - ``` - instead of: - ``` - module - ``` - +* For module procedures, it is recommended to declare attributes before the module keyword for better retro compatibility (Projects using CMake versions lower than CMake 3.25.0 are concerned see Spurious modules). +Prefere the following pattern: +``` + module +``` +instead of: +``` +module +``` ## End block closing statements Fortran allows certain block constructs or scopes to include the name of the program unit in the end statement. From 638a40c78086f9220611756fb38fb802481aad12 Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:48:57 +0530 Subject: [PATCH 5/8] docs: STYLE GUIDE attribute ordering convention added link --- STYLE_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 303fa5310..349cbf5c6 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -61,7 +61,7 @@ focus on the semantics of the proposed changes rather than style and formatting. ``` When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose. * If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute. -* For module procedures, it is recommended to declare attributes before the module keyword for better retro compatibility (Projects using CMake versions lower than CMake 3.25.0 are concerned see Spurious modules). +* For module procedures, it is recommended to declare attributes before the module keyword for better retro compatibility (Projects using CMake versions lower than CMake 3.25.0 are concerned see [Spurious modules](https://gitlab.kitware.com/cmake/cmake/-/issues/18427#note_983426)). Prefere the following pattern: ``` module From a9eff9a912168193fc75dd0ca4f42c21faca93f6 Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:56:31 +0530 Subject: [PATCH 6/8] docs: STYLE GUIDE attribute ordering convention spelling mistake corrected --- STYLE_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 349cbf5c6..822bfd87b 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -62,7 +62,7 @@ focus on the semantics of the proposed changes rather than style and formatting. When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose. * If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute. * For module procedures, it is recommended to declare attributes before the module keyword for better retro compatibility (Projects using CMake versions lower than CMake 3.25.0 are concerned see [Spurious modules](https://gitlab.kitware.com/cmake/cmake/-/issues/18427#note_983426)). -Prefere the following pattern: +Prefer the following pattern: ``` module ``` From 5199ca260a4cad1e1c7c7eff7cc084ea0bc49b3c Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:02:07 +0530 Subject: [PATCH 7/8] docs: STYLE GUIDE attribute ordering convention spacing corrected --- STYLE_GUIDE.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 822bfd87b..83162aa7c 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -64,12 +64,12 @@ focus on the semantics of the proposed changes rather than style and formatting. * For module procedures, it is recommended to declare attributes before the module keyword for better retro compatibility (Projects using CMake versions lower than CMake 3.25.0 are concerned see [Spurious modules](https://gitlab.kitware.com/cmake/cmake/-/issues/18427#note_983426)). Prefer the following pattern: ``` - module -``` -instead of: -``` -module -``` + module + ``` + instead of: + ``` + module + ``` ## End block closing statements Fortran allows certain block constructs or scopes to include the name of the program unit in the end statement. From 0369649a514427d13290e8fc33ac8694f715db95 Mon Sep 17 00:00:00 2001 From: BhoomishGupta <150552347+BhoomishGupta@users.noreply.github.com> Date: Fri, 17 Oct 2025 17:03:04 +0530 Subject: [PATCH 8/8] docs: STYLE GUIDE attribute ordering convention spacing corrected --- STYLE_GUIDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 83162aa7c..03ff8157a 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -62,8 +62,8 @@ focus on the semantics of the proposed changes rather than style and formatting. When defining many arrays of the same dimension, `dimension` can be used as an exception if it makes the code less verbose. * If the `optional` attribute is used to declare a dummy argument, it should follow the `intent` attribute. * For module procedures, it is recommended to declare attributes before the module keyword for better retro compatibility (Projects using CMake versions lower than CMake 3.25.0 are concerned see [Spurious modules](https://gitlab.kitware.com/cmake/cmake/-/issues/18427#note_983426)). -Prefer the following pattern: -``` + Prefer the following pattern: + ``` module ``` instead of: