Refactor DDSPLIT: Extract counting operations into focused helper subroutines #107
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.
Description of the feature or the bug
The DDSPLIT subroutine was 3,728 lines—too large for effective maintenance. The file contained multiple distinct logical operations (element counting, boundary condition counting, statistics computation) that could be extracted into focused helpers.
Description of the changes
Extracted five counting/computation blocks into separate subroutines:
ddsplit_count_elements.F(120 lines): Element type counting (solids, shells, beams) and numbering shiftsddsplit_count_bc_loads.F(109 lines): Boundary conditions (IBCL, IBFV) and loads (LLINK, IGRAV, IBVEL)ddsplit_count_thermal.F(95 lines): Thermal boundary conditions (convection, radiation, fluxes)ddsplit_count_constraints.F(121 lines): Rigid bodies (RBY, RBYM) and constraint elements (RBE2, RBE3)ddsplit_compute_stats.F(185 lines): Domain decomposition statistics and memory estimates (DDSTAT array)Main file reduced from 3,728 to 3,562 lines. Each helper has a single responsibility, follows existing
.Ffixed-form conventions, and preserves exact functional behavior.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.