-
Notifications
You must be signed in to change notification settings - Fork 121
Removes the macros t_vec3 and the t_4x4 matrix one #941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removes the macros t_vec3 and the t_4x4 matrix one #941
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the t_vec3 and t_mat4x4 macros and replaces all their usages with explicit real(wp), dimension(...) declarations across the codebase.
- Replaces
t_vec3withreal(wp), dimension(1:3)in various modules. - Replaces
t_mat4x4withreal(wp), dimension(1:4,1:4)in helper routines. - Deletes the macro definitions from
macros.fpp.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/pre_process/m_patches.fpp | Swapped vector/matrix macros for explicit types |
| src/pre_process/m_model.fpp | Updated all t_vec3 usages to explicit arrays |
| src/common/m_helper.fpp | Updated transform routines to explicit matrices |
| src/common/m_derived_types.fpp | Replaced macro-based fields with explicit types |
| src/common/include/macros.fpp | Removed t_vec3/t_mat4x4 macro definitions |
src/common/m_helper.fpp
Outdated
| real(wp), dimension(1:3), optional, intent(in) :: center | ||
| real(wp), dimension(1:4,1:4) :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The repeated explicit declarations for 3- and 4×4 arrays throughout the code increase duplication. Consider defining small derived types (e.g., type vec3 and type mat4x4) in a central module to improve readability and reduce boilerplate.
| real(wp), dimension(1:3), optional, intent(in) :: center | |
| real(wp), dimension(1:4,1:4) :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix | |
| type(vec3), optional, intent(in) :: center | |
| type(mat4x4) :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #941 +/- ##
=======================================
Coverage 43.71% 43.71%
=======================================
Files 68 68
Lines 18360 18360
Branches 2292 2292
=======================================
Hits 8026 8026
Misses 8945 8945
Partials 1389 1389 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
User description
Removes some macros and replaces them with normal text. Doesn't make the code longer or harder to read. removing macros seems like a good idea when appropriate.
PR Type
Enhancement
Description
Remove unnecessary
t_vec3andt_mat4x4macrosReplace macro usage with explicit type declarations
Improve code readability by using standard Fortran syntax
Changes diagram
Changes walkthrough 📝
macros.fpp
Remove vector and matrix macrossrc/common/include/macros.fpp
t_vec3macro definitiont_mat4x4macro definitionm_derived_types.fpp
Replace macros in derived typessrc/common/m_derived_types.fpp
t_vec3withreal(wp), dimension(1:3)in type definitionsm_helper.fpp
Replace macros in helper functionssrc/common/m_helper.fpp
t_vec3andt_mat4x4in function parametersm_model.fpp
Replace macros in model processingsrc/pre_process/m_model.fpp
t_vec3with explicit type in variable declarationsm_patches.fpp
Replace macros in patch processingsrc/pre_process/m_patches.fpp
t_vec3andt_mat4x4in local variables