From d1f57fddd61a569e06144867a5b498381c4565d5 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 20 Feb 2026 22:53:51 -0500 Subject: [PATCH 1/6] Add Fortran/Fypp static analysis linter Adds toolchain/mfc/lint_source.py with three checks that catch copy-paste and precision bugs in Fortran/Fypp source: - Duplicate entries in Fypp #:for lists (e.g. broadcast lists) - Identical adjacent source lines (duplicated accumulations, args) - Hardcoded int(8._wp, ...) that assumes 8-byte reals Integrated into precheck.sh (step 5/6) and lint-source.yml CI. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/lint-source.yml | 3 + toolchain/bootstrap/precheck.sh | 21 ++-- toolchain/mfc/lint_source.py | 160 ++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 6 deletions(-) create mode 100644 toolchain/mfc/lint_source.py diff --git a/.github/workflows/lint-source.yml b/.github/workflows/lint-source.yml index 59f6dd63bd..f7a844e9ec 100644 --- a/.github/workflows/lint-source.yml +++ b/.github/workflows/lint-source.yml @@ -55,3 +55,6 @@ jobs: ! grep -R '===' ./benchmarks/**/*.py ! grep -R '===' ./examples/**/*.py + - name: Fortran/Fypp static analysis + run: python3 toolchain/mfc/lint_source.py + diff --git a/toolchain/bootstrap/precheck.sh b/toolchain/bootstrap/precheck.sh index 9274f3abae..a3c130c211 100755 --- a/toolchain/bootstrap/precheck.sh +++ b/toolchain/bootstrap/precheck.sh @@ -61,7 +61,7 @@ log "Running$MAGENTA precheck$COLOR_RESET (same checks as CI lint-gate)..." echo "" # 1. Check formatting -log "[$CYAN 1/5$COLOR_RESET] Checking$MAGENTA formatting$COLOR_RESET..." +log "[$CYAN 1/6$COLOR_RESET] Checking$MAGENTA formatting$COLOR_RESET..." # Capture state before formatting BEFORE_HASH=$(git diff -- '*.f90' '*.fpp' '*.py' 2>/dev/null | compute_hash) if ! ./mfc.sh format -j "$JOBS" > /dev/null 2>&1; then @@ -82,7 +82,7 @@ else fi # 2. Spell check -log "[$CYAN 2/5$COLOR_RESET] Running$MAGENTA spell check$COLOR_RESET..." +log "[$CYAN 2/6$COLOR_RESET] Running$MAGENTA spell check$COLOR_RESET..." if ./mfc.sh spelling > /dev/null 2>&1; then ok "Spell check passed." else @@ -91,7 +91,7 @@ else fi # 3. Lint toolchain (Python) -log "[$CYAN 3/5$COLOR_RESET] Running$MAGENTA toolchain lint$COLOR_RESET..." +log "[$CYAN 3/6$COLOR_RESET] Running$MAGENTA toolchain lint$COLOR_RESET..." if ./mfc.sh lint > /dev/null 2>&1; then ok "Toolchain lint passed." else @@ -100,7 +100,7 @@ else fi # 4. Source code lint checks -log "[$CYAN 4/5$COLOR_RESET] Running$MAGENTA source lint$COLOR_RESET checks..." +log "[$CYAN 4/6$COLOR_RESET] Running$MAGENTA source lint$COLOR_RESET checks..." SOURCE_FAILED=0 # Check for raw OpenACC/OpenMP directives @@ -127,8 +127,17 @@ else FAILED=1 fi -# 5. Doc reference check -log "[$CYAN 5/5$COLOR_RESET] Checking$MAGENTA doc references$COLOR_RESET..." +# 5. Fortran/Fypp static analysis +log "[$CYAN 5/6$COLOR_RESET] Running$MAGENTA Fortran/Fypp analysis$COLOR_RESET..." +if python3 toolchain/mfc/lint_source.py 2>&1; then + ok "Fortran/Fypp analysis passed." +else + error "Fortran/Fypp analysis failed. Run$MAGENTA python3 toolchain/mfc/lint_source.py$COLOR_RESET for details." + FAILED=1 +fi + +# 6. Doc reference check +log "[$CYAN 6/6$COLOR_RESET] Checking$MAGENTA doc references$COLOR_RESET..." if python3 toolchain/mfc/lint_docs.py 2>&1; then ok "Doc references are valid." else diff --git a/toolchain/mfc/lint_source.py b/toolchain/mfc/lint_source.py new file mode 100644 index 0000000000..61cd7dd915 --- /dev/null +++ b/toolchain/mfc/lint_source.py @@ -0,0 +1,160 @@ +"""Static analysis for Fortran/Fypp source code. + +Checks for patterns that indicate copy-paste bugs, non-standard constructs, +and hardcoded assumptions that break under different build configurations. +""" + +import re +import sys +from pathlib import Path + +# Source directory to scan (relative to repo root) +SRC_DIR = "src" + +# Minimum stripped line length to consider for duplicate detection. +# Lines shorter than this (e.g. "end if", "end do") are ignored. +MIN_DUP_LINE_LEN = 40 + + +def _is_comment_or_blank(stripped: str) -> bool: + """True if stripped line is blank, a Fortran comment, or a Fypp directive.""" + return not stripped or stripped.startswith("!") or stripped.startswith("#:") + + +def _fortran_fpp_files(src_dir: Path): + """Yield all .f90 and .fpp files under src/.""" + yield from sorted(src_dir.rglob("*.f90")) + yield from sorted(src_dir.rglob("*.fpp")) + + +def check_fypp_list_duplicates(repo_root: Path) -> list[str]: + """Check for duplicate entries in Fypp ``#:for VAR in [...]`` lists. + + Copy-paste errors in broadcast lists or loop variable lists can silently + skip a variable while broadcasting another one twice. + """ + errors: list[str] = [] + src_dir = repo_root / SRC_DIR + + for fpp in sorted(src_dir.rglob("*.fpp")): + lines = fpp.read_text(encoding="utf-8").splitlines() + rel = fpp.relative_to(repo_root) + + i = 0 + while i < len(lines): + line = lines[i].strip() + if line.startswith("#:for") and " in " in line and "[" in line: + start_line = i + 1 # 1-indexed for display + + # Accumulate across Fortran-style '&' continuation lines + full = line + while full.rstrip().endswith("&") and i + 1 < len(lines): + i += 1 + full += " " + lines[i].strip() + + bracket_start = full.find("[") + bracket_end = full.rfind("]") + if bracket_start >= 0 and bracket_end > bracket_start: + list_content = full[bracket_start + 1:bracket_end] + list_content = list_content.replace("&", "") + + # Extract single- or double-quoted entries + entries = re.findall(r"['\"]([^'\"]*)['\"]", list_content) + + seen: dict[str, int] = {} + for pos, entry in enumerate(entries, 1): + if entry in seen: + errors.append( + f" {rel}:{start_line} Fypp list has duplicate" + f" entry '{entry}' (positions {seen[entry]}" + f" and {pos})." + " Fix: one copy is likely a typo for a" + " different variable" + ) + else: + seen[entry] = pos + i += 1 + + return errors + + +def check_duplicate_lines(repo_root: Path) -> list[str]: + """Flag identical adjacent non-trivial source lines. + + Exact duplicate consecutive lines are almost always copy-paste errors: + a duplicated accumulation, a repeated subroutine argument, etc. + """ + errors: list[str] = [] + src_dir = repo_root / SRC_DIR + + for src in _fortran_fpp_files(src_dir): + lines = src.read_text(encoding="utf-8").splitlines() + rel = src.relative_to(repo_root) + + prev_stripped = "" + for i, line in enumerate(lines): + stripped = line.strip() + if ( + stripped == prev_stripped + and len(stripped) >= MIN_DUP_LINE_LEN + and not _is_comment_or_blank(stripped) + ): + display = stripped[:72] + if len(stripped) > 72: + display += "..." + errors.append( + f" {rel}:{i + 1} identical to previous line:" + f" '{display}'." + " Fix: check for accidental copy-paste" + ) + prev_stripped = stripped + + return errors + + +def check_hardcoded_byte_size(repo_root: Path) -> list[str]: + """Flag ``int(8._wp, ...)`` patterns that assume 8-byte reals. + + When MFC is built in single precision (``wp = real32``), reals are + 4 bytes. Hard-coding 8 makes MPI I/O read/write the wrong amount. + Use ``storage_size(0._wp)/8`` instead. + """ + errors: list[str] = [] + src_dir = repo_root / SRC_DIR + byte_re = re.compile(r"\bint\s*\(\s*8\._wp\b", re.IGNORECASE) + + for src in _fortran_fpp_files(src_dir): + lines = src.read_text(encoding="utf-8").splitlines() + rel = src.relative_to(repo_root) + + for i, line in enumerate(lines): + stripped = line.strip() + if _is_comment_or_blank(stripped): + continue + if byte_re.search(stripped): + errors.append( + f" {rel}:{i + 1} hard-codes 8-byte real size." + " Fix: use 'storage_size(0._wp)/8' instead of" + " '8._wp'" + ) + + return errors + + +def main(): + repo_root = Path(__file__).resolve().parents[2] + + all_errors: list[str] = [] + all_errors.extend(check_fypp_list_duplicates(repo_root)) + all_errors.extend(check_duplicate_lines(repo_root)) + all_errors.extend(check_hardcoded_byte_size(repo_root)) + + if all_errors: + print("Fortran/Fypp source analysis failed:") + for e in all_errors: + print(e) + sys.exit(1) + + +if __name__ == "__main__": + main() From 1f4335130703ebffdf2878c5f3bd34666943c26d Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 20 Feb 2026 23:02:51 -0500 Subject: [PATCH 2/6] Add -Wconversion to debug builds and track in cleanliness CI Adds -Wconversion to the GNU debug compiler flags in CMakeLists.txt. This catches implicit type coercions (e.g. integer = real truncation) at compile time. Adds a Conversion Warnings Diff step and count to cleanliness.yml, following the same delta-from-master pattern as the existing checks. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/cleanliness.yml | 9 +++++++++ CMakeLists.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/.github/workflows/cleanliness.yml b/.github/workflows/cleanliness.yml index 778c876e32..a53e3ae699 100644 --- a/.github/workflows/cleanliness.yml +++ b/.github/workflows/cleanliness.yml @@ -86,6 +86,12 @@ jobs: grep -F 'Wmaybe-uninitialized' master.txt > mMaybe.txt diff prMaybe.txt mMaybe.txt + - name: Conversion Warnings Diff + continue-on-error: true + run: | + grep -F 'Wconversion' pr.txt > prConversion.txt + grep -F 'Wconversion' master.txt > mConversion.txt + diff prConversion.txt mConversion.txt - name: Everything Diff continue-on-error: true @@ -106,12 +112,14 @@ jobs: pr_argument=$(grep -c -F 'Wunused-dummy-argument' pr.txt) pr_value=$(grep -c -F 'Wunused-value' pr.txt) pr_uninit=$(grep -c -F 'Wmaybe-uninitialized' pr.txt) + pr_conversion=$(grep -c -F 'Wconversion' pr.txt) pr_everything=$(grep -c '\-W' pr.txt) master_variable=$(grep -c -F 'Wunused-variable' master.txt) master_argument=$(grep -c -F 'Wunused-dummy-argument' master.txt) master_value=$(grep -c -F 'Wunused-value' master.txt) master_uninit=$(grep -c -F 'Wmaybe-uninitialized' master.txt) + master_conversion=$(grep -c -F 'Wconversion' master.txt) master_everything=$(grep -c '\-W' master.txt ) echo "pr_everything=$pr_everything" >> $GITHUB_ENV @@ -124,6 +132,7 @@ jobs: echo "Unused Dummy Argument: $pr_argument, Difference: $((pr_argument - master_argument))" echo "Unused Value: $pr_value, Difference: $((pr_value - master_value))" echo "Maybe Uninitialized: $pr_uninit, Difference: $((pr_uninit - master_uninit))" + echo "Conversion: $pr_conversion, Difference: $((pr_conversion - master_conversion))" echo "Everything: $pr_everything, Difference: $((pr_everything - master_everything))" diff --git a/CMakeLists.txt b/CMakeLists.txt index cb12a065d2..68168c4b76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,7 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") -fsignaling-nans -finit-real=snan -finit-integer=-99999999 + -Wconversion -Wintrinsic-shadow -Wunderflow -Wrealloc-lhs From c8e385cba7655c9d31e787014d0c0d8e489cf059 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 21 Feb 2026 01:24:28 -0500 Subject: [PATCH 3/6] Fix pylint warnings in lint_source.py Extract inner parsing logic of check_fypp_list_duplicates into _check_single_fypp_list helper to resolve R0914 (too-many-locals), R1702 (too-many-nested-blocks), and R1716 (chained-comparison). Co-Authored-By: Claude Sonnet 4.6 --- toolchain/mfc/lint_source.py | 53 ++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/toolchain/mfc/lint_source.py b/toolchain/mfc/lint_source.py index 61cd7dd915..0f5564abfe 100644 --- a/toolchain/mfc/lint_source.py +++ b/toolchain/mfc/lint_source.py @@ -27,6 +27,37 @@ def _fortran_fpp_files(src_dir: Path): yield from sorted(src_dir.rglob("*.fpp")) +def _check_single_fypp_list(full_line: str, rel: Path, start_line: int) -> list[str]: + """Parse one Fypp ``#:for ... in [...]`` line and return errors for duplicates.""" + errors: list[str] = [] + + bracket_start = full_line.find("[") + bracket_end = full_line.rfind("]") + if not 0 <= bracket_start < bracket_end: + return errors + + list_content = full_line[bracket_start + 1:bracket_end] + list_content = list_content.replace("&", "") + + # Extract single- or double-quoted entries + entries = re.findall(r"['\"]([^'\"]*)['\"]", list_content) + + seen: dict[str, int] = {} + for pos, entry in enumerate(entries, 1): + if entry in seen: + errors.append( + f" {rel}:{start_line} Fypp list has duplicate" + f" entry '{entry}' (positions {seen[entry]}" + f" and {pos})." + " Fix: one copy is likely a typo for a" + " different variable" + ) + else: + seen[entry] = pos + + return errors + + def check_fypp_list_duplicates(repo_root: Path) -> list[str]: """Check for duplicate entries in Fypp ``#:for VAR in [...]`` lists. @@ -52,27 +83,7 @@ def check_fypp_list_duplicates(repo_root: Path) -> list[str]: i += 1 full += " " + lines[i].strip() - bracket_start = full.find("[") - bracket_end = full.rfind("]") - if bracket_start >= 0 and bracket_end > bracket_start: - list_content = full[bracket_start + 1:bracket_end] - list_content = list_content.replace("&", "") - - # Extract single- or double-quoted entries - entries = re.findall(r"['\"]([^'\"]*)['\"]", list_content) - - seen: dict[str, int] = {} - for pos, entry in enumerate(entries, 1): - if entry in seen: - errors.append( - f" {rel}:{start_line} Fypp list has duplicate" - f" entry '{entry}' (positions {seen[entry]}" - f" and {pos})." - " Fix: one copy is likely a typo for a" - " different variable" - ) - else: - seen[entry] = pos + errors.extend(_check_single_fypp_list(full, rel, start_line)) i += 1 return errors From 7bd4a4b6b0ff4681727629c09351eb13365826a8 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sat, 21 Feb 2026 09:22:36 -0500 Subject: [PATCH 4/6] Fix check_hardcoded_byte_size false-positive on inline comments byte_re was run against the full stripped line, so a comment like ! old code: int(8._wp, kind=i64) would be flagged even though the pattern is inside a Fortran ! comment. Strip the inline comment portion before searching. Co-Authored-By: Claude Sonnet 4.6 --- toolchain/mfc/lint_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/mfc/lint_source.py b/toolchain/mfc/lint_source.py index 0f5564abfe..a494638ddd 100644 --- a/toolchain/mfc/lint_source.py +++ b/toolchain/mfc/lint_source.py @@ -142,7 +142,7 @@ def check_hardcoded_byte_size(repo_root: Path) -> list[str]: stripped = line.strip() if _is_comment_or_blank(stripped): continue - if byte_re.search(stripped): + if byte_re.search(stripped.split("!")[0]): errors.append( f" {rel}:{i + 1} hard-codes 8-byte real size." " Fix: use 'storage_size(0._wp)/8' instead of" From 10e098454c8b7932f3ae4fb6d822bc2e5712403f Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Mon, 23 Feb 2026 21:24:44 -0500 Subject: [PATCH 5/6] Update docs to reflect 6 precheck steps (was 5) This PR adds a 6th lint check (Fortran/Fypp analysis). Update CLAUDE.md and common-pitfalls.md to match. Co-Authored-By: Claude Opus 4.6 --- .claude/rules/common-pitfalls.md | 2 +- CLAUDE.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude/rules/common-pitfalls.md b/.claude/rules/common-pitfalls.md index 9861f24fbe..75b550c07b 100644 --- a/.claude/rules/common-pitfalls.md +++ b/.claude/rules/common-pitfalls.md @@ -54,7 +54,7 @@ ## PR Checklist Before submitting a PR: - [ ] `./mfc.sh format -j 8` (auto-format) -- [ ] `./mfc.sh precheck -j 8` (5 CI lint checks) +- [ ] `./mfc.sh precheck -j 8` (6 CI lint checks) - [ ] `./mfc.sh build -j 8` (compiles) - [ ] `./mfc.sh test --only -j 8` (tests pass) - [ ] If adding parameters: all 4 locations updated diff --git a/CLAUDE.md b/CLAUDE.md index 38918a2091..63a618897d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -39,7 +39,7 @@ All commands run from the repo root via `./mfc.sh`. ./mfc.sh test --generate --only # Regenerate golden files after intentional output change # Verification (pre-commit CI checks) -./mfc.sh precheck -j 8 # Run all 5 lint checks (same as CI gate) +./mfc.sh precheck -j 8 # Run all 6 lint checks (same as CI gate) ./mfc.sh format -j 8 # Auto-format Fortran (.fpp/.f90) + Python ./mfc.sh lint # Pylint + Python unit tests ./mfc.sh spelling # Spell check @@ -99,7 +99,7 @@ IMPORTANT: Follow this loop for ALL code changes. Do not skip steps. 2. **Plan** — For multi-file changes, outline your approach before implementing. 3. **Implement** — Make small, focused changes. One logical change per commit. 4. **Format** — Run `./mfc.sh format -j 8` to auto-format. -5. **Verify** — Run `./mfc.sh precheck -j 8` (same 5 checks as CI lint gate). +5. **Verify** — Run `./mfc.sh precheck -j 8` (same 6 checks as CI lint gate). 6. **Build** — Run `./mfc.sh build -j 8` to verify compilation. 7. **Test** — Run relevant tests: `./mfc.sh test --only -j 8`. For changes to `src/common/`, test ALL three targets: `./mfc.sh test -j 8`. From 0545695c5d13dba28912c062845f88db513d9ad2 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Tue, 24 Feb 2026 18:37:56 -0500 Subject: [PATCH 6/6] Fix bugs detected by new Fortran/Fypp static analysis linter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - m_mpi_proxy.fpp: fix duplicate 'bc_x%ve2' → 'bc_x%ve3' in MPI broadcast Fypp list; bc_x%ve3 was never broadcast to all ranks - m_assign_variables.fpp: remove duplicate R3bar accumulation line in QBMM path; bubble radius cubed was summed twice per iteration - m_rhs.fpp: fix cylindrical viscous boundary call passing dq_prim_dy_vf twice; 4th arg should be dq_prim_dz_vf (z-gradient) - m_data_input.f90, m_data_output.fpp, m_start_up.fpp (all targets): replace hardcoded WP_MOK = int(8._wp,...) with storage_size(0._stp)/8 for correct mixed-precision MPI-IO offset computation Co-Authored-By: Claude Sonnet 4.6 --- src/post_process/m_data_input.f90 | 6 +++--- src/pre_process/m_assign_variables.fpp | 1 - src/pre_process/m_data_output.fpp | 4 ++-- src/pre_process/m_start_up.fpp | 2 +- src/simulation/m_data_output.fpp | 6 +++--- src/simulation/m_mpi_proxy.fpp | 2 +- src/simulation/m_rhs.fpp | 2 +- src/simulation/m_start_up.fpp | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/post_process/m_data_input.f90 b/src/post_process/m_data_input.f90 index a3e3f22886..e1dc941682 100644 --- a/src/post_process/m_data_input.f90 +++ b/src/post_process/m_data_input.f90 @@ -133,7 +133,7 @@ impure subroutine s_setup_mpi_io_params(data_size, m_MOK, n_MOK, p_MOK, WP_MOK, m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND) @@ -177,7 +177,7 @@ impure subroutine s_read_ib_data_files(file_loc_base, t_step) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) save_index = t_step/t_step_save ! get the number of saves done to this point data_size = (m + 1)*(n + 1)*(p + 1) @@ -517,7 +517,7 @@ impure subroutine s_read_parallel_conservative_data(t_step, m_MOK, n_MOK, p_MOK, m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND) diff --git a/src/pre_process/m_assign_variables.fpp b/src/pre_process/m_assign_variables.fpp index e41428bf90..65809485ba 100644 --- a/src/pre_process/m_assign_variables.fpp +++ b/src/pre_process/m_assign_variables.fpp @@ -233,7 +233,6 @@ contains if (qbmm) then do i = 1, nb R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l))**3._wp - R3bar = R3bar + weight(i)*0.5_wp*(q_prim_vf(bubxb + 1 + (i - 1)*nmom)%sf(j, k, l))**3._wp end do else do i = 1, nb diff --git a/src/pre_process/m_data_output.fpp b/src/pre_process/m_data_output.fpp index bac4fdc038..bf07702bf8 100644 --- a/src/pre_process/m_data_output.fpp +++ b/src/pre_process/m_data_output.fpp @@ -549,7 +549,7 @@ contains m_MOK = int(m_glb_save, MPI_OFFSET_KIND) n_MOK = int(n_glb_save, MPI_OFFSET_KIND) p_MOK = int(p_glb_save, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND) @@ -615,7 +615,7 @@ contains m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND) diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index 3b45547c29..ea93214047 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -660,7 +660,7 @@ contains m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND) diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 5051d5e15d..5760e33089 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -895,7 +895,7 @@ contains m_MOK = int(m_glb_save + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb_save + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb_save + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND) @@ -963,7 +963,7 @@ contains m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(alt_sys, MPI_OFFSET_KIND) @@ -1087,7 +1087,7 @@ contains m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) write (file_loc, '(A)') 'ib.dat' diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index be737782be..95f61fc7d7 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -145,7 +145,7 @@ contains #:for VAR in [ 'dt','weno_eps','teno_CT','pref','rhoref','R0ref','Web','Ca', 'sigma', & & 'Re_inv', 'poly_sigma', 'palpha_eps', 'ptgalpha_eps', 'pi_fac', & - & 'bc_x%vb1','bc_x%vb2','bc_x%vb3','bc_x%ve1','bc_x%ve2','bc_x%ve2', & + & 'bc_x%vb1','bc_x%vb2','bc_x%vb3','bc_x%ve1','bc_x%ve2','bc_x%ve3', & & 'bc_y%vb1','bc_y%vb2','bc_y%vb3','bc_y%ve1','bc_y%ve2','bc_y%ve3', & & 'bc_z%vb1','bc_z%vb2','bc_z%vb3','bc_z%ve1','bc_z%ve2','bc_z%ve3', & & 'bc_x%pres_in','bc_x%pres_out','bc_y%pres_in','bc_y%pres_out', 'bc_z%pres_in','bc_z%pres_out', & diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index e6fd6348ed..4457f7afdd 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -1653,7 +1653,7 @@ contains call s_compute_viscous_stress_cylindrical_boundary(q_prim_vf, & dq_prim_dx_vf(mom_idx%beg:mom_idx%end), & dq_prim_dy_vf(mom_idx%beg:mom_idx%end), & - dq_prim_dy_vf(mom_idx%beg:mom_idx%end), & + dq_prim_dz_vf(mom_idx%beg:mom_idx%end), & tau_Re_vf, & idwbuff(1), idwbuff(2), idwbuff(3)) end if diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index d8d0c87417..b30c0d4f7e 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -652,7 +652,7 @@ contains m_MOK = int(m_glb + 1, MPI_OFFSET_KIND) n_MOK = int(n_glb + 1, MPI_OFFSET_KIND) p_MOK = int(p_glb + 1, MPI_OFFSET_KIND) - WP_MOK = int(8._wp, MPI_OFFSET_KIND) + WP_MOK = int(storage_size(0._stp)/8, MPI_OFFSET_KIND) MOK = int(1._wp, MPI_OFFSET_KIND) str_MOK = int(name_len, MPI_OFFSET_KIND) NVARS_MOK = int(sys_size, MPI_OFFSET_KIND)