From 5c6ad3981cf453ac15dc4270b460973da50cbdb5 Mon Sep 17 00:00:00 2001 From: SVS87 Date: Mon, 15 Jun 2026 02:36:03 -0400 Subject: [PATCH] fix: extend patch validation loops to num_patches_max The alteration rights, smoothing, and primitive variable validation loops were bounded by num_patches, making the inactive-patch else branches unreachable. Changed all three loop bounds to num_patches_max to match the geometry loop, so inactive patch slots are validated across all four passes. Fixes #1482 --- src/pre_process/m_check_patches.fpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pre_process/m_check_patches.fpp b/src/pre_process/m_check_patches.fpp index 5d31c8dc09..3eb6b2d2ec 100644 --- a/src/pre_process/m_check_patches.fpp +++ b/src/pre_process/m_check_patches.fpp @@ -95,7 +95,7 @@ contains end do ! Constraints on overwrite rights initial condition patch parameters - do i = 1, num_patches + do i = 1, num_patches_max if (i <= num_patches) then call s_check_active_patch_alteration_rights(i) else @@ -104,7 +104,7 @@ contains end do ! Constraints on smoothing initial condition patch parameters - do i = 1, num_patches + do i = 1, num_patches_max if (i > 1 .and. (patch_icpp(i)%geometry == 2 .or. patch_icpp(i)%geometry == 3 .or. patch_icpp(i)%geometry == 4 & & .or. patch_icpp(i)%geometry == 5 .or. patch_icpp(i)%geometry == 8 .or. patch_icpp(i)%geometry == 9 & & .or. patch_icpp(i)%geometry == 10 .or. patch_icpp(i)%geometry == 11 .or. patch_icpp(i)%geometry == 12 & @@ -116,7 +116,7 @@ contains end do ! Constraints on flow variables initial condition patch parameters - do i = 1, num_patches + do i = 1, num_patches_max if (i <= num_patches) then call s_check_active_patch_primitive_variables(i) else