-
Notifications
You must be signed in to change notification settings - Fork 121
update cursor rules. #955
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
Merged
Merged
update cursor rules. #955
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,32 +1,30 @@ | ||||||
| --- | ||||||
| description: Full MFC project rules – consolidated for Agent Mode | ||||||
| alwaysApply: true | ||||||
| --- | ||||||
| ---- | ||||||
| -description: Full MFC project rules – consolidated for Agent Mode | ||||||
| -alwaysApply: true | ||||||
| ---- | ||||||
|
|
||||||
| # 0 Purpose & Scope | ||||||
| Consolidated guidance for the MFC exascale, many-physics solver. | ||||||
| Written primarily for Fortran/Fypp; the OpenACC and style sections matter only when | ||||||
| `.fpp` / `.f90` files are in view. | ||||||
| Consolidated guidance for the MFC exascale, many-physics solver. | ||||||
| Written primarily for Fortran/Fypp; the GPU and style sections matter only when `.fpp` / `.f90` files are in view. | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| # 1 Global Project Context (always) | ||||||
| - **Project**: *MFC* is modern Fortran 2008+ generated with **Fypp**. | ||||||
| - Sources `src/`, tests `tests/`, examples `examples/`. | ||||||
| - Most sources are `.fpp`; CMake transpiles them to `.f90`. | ||||||
| - **Fypp macros** live in `src/<subprogram>/include/` you should scan these first. | ||||||
| `<subprogram>` ∈ {`simulation`,`common`,`pre_process`,`post_process`}. | ||||||
| - Only `simulation` (+ its `common` calls) is GPU-accelerated via **OpenACC** or **OpenMP**. | ||||||
| - Assume free-form Fortran 2008+, `implicit none`, explicit `intent`, and modern | ||||||
| intrinsics. | ||||||
| - Prefer `module … contains … subroutine foo()`; avoid `COMMON` blocks and | ||||||
| file-level `include` files. | ||||||
| - **Read the full codebase and docs *before* changing code.** | ||||||
| Docs: <https://mflowcode.github.io/documentation/md_readme.html> and the respository root `README.md`. | ||||||
| - **Project**: *MFC* is modern Fortran 2008+ generated with **Fypp**. | ||||||
| - Sources `src/`, tests `tests/`, examples `examples/`. | ||||||
| - Most sources are `.fpp`; CMake transpiles them to `.f90`. | ||||||
| - **Fypp macros** live in `src/<subprogram>/include/` you should scan these first. | ||||||
| `<subprogram>` ∈ {`simulation`,`common`,`pre_process`,`post_process`}. | ||||||
| - Only `simulation` (+ its `common` calls) is GPU-accelerated via **OpenACC** or **OpenMP**. | ||||||
| - Assume free-form Fortran 2008+, `implicit none`, explicit `intent`, and modern intrinsics. | ||||||
| - Prefer `module … contains … subroutine foo()`; avoid `COMMON` blocks and file-level `include` files. | ||||||
| - **Read the full codebase and docs *before* changing code.** | ||||||
| - Docs: <https://mflowcode.github.io/documentation/md_readme.html> and the respository root `README.md`. | ||||||
|
|
||||||
| ### Incremental-change workflow | ||||||
| 1. Draft a step-by-step plan. | ||||||
| 2. After each step, build: | ||||||
|
|
||||||
| 1. Draft a step-by-step plan. | ||||||
| 2. After each step, build: | ||||||
| ```bash | ||||||
| ./mfc.sh build -t pre_process simulation -j $(nproc) | ||||||
| ``` | ||||||
|
|
@@ -49,12 +47,10 @@ Written primarily for Fortran/Fypp; the OpenACC and style sections matter only w | |||||
| * Subroutine → `s_<verb>_<noun>` (e.g. `s_compute_flux`) | ||||||
| * Function → `f_<verb>_<noun>` | ||||||
| * Private helpers stay in the module; avoid nested procedures. | ||||||
| * **Size limits**: subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, | ||||||
| module/file ≤ 1000. | ||||||
| * ≤ 6 arguments per routine; otherwise pass a derived-type “params” struct. | ||||||
| * **Size limits**: subroutine ≤ 500 lines, helper ≤ 150, function ≤ 100, module/file ≤ 1000. | ||||||
| * ≤ 6 arguments per routine; otherwise pass a derived-type "params" struct. | ||||||
| * No `goto` (except unavoidable legacy); no global state (`COMMON`, `save`). | ||||||
| * Every variable: `intent(in|out|inout)` + appropriate `dimension` / `allocatable` | ||||||
| / `pointer`. | ||||||
| * Every variable: `intent(in|out|inout)` + appropriate `dimension` / `allocatable` / `pointer`. | ||||||
| * Use `s_mpi_abort(<msg>)` for errors, not `stop`. | ||||||
| * Mark GPU-callable helpers that are called from GPU parallel loops immediately after declaration: | ||||||
| ```fortran | ||||||
|
|
@@ -66,9 +62,10 @@ Written primarily for Fortran/Fypp; the OpenACC and style sections matter only w | |||||
|
|
||||||
| --- | ||||||
|
|
||||||
| # 3 FYPP Macros for GPU acceleration Pogramming Guidelines (for kernels) | ||||||
| # 3 FYPP Macros for GPU acceleration Pogramming Guidelines (for GPU kernels) | ||||||
|
||||||
| # 3 FYPP Macros for GPU acceleration Pogramming Guidelines (for GPU kernels) | |
| # 3 FYPP Macros for GPU acceleration Programming Guidelines (for GPU kernels) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There is a spelling error: 'respository' should be 'repository'.