You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the example 0D_bubblecollapse_adap is broken. The reason was that when Lagrange bubble model was updated, the maximum iteration for adaptive time stepping was fixed to 100, while this case requires more than 100 as it involves violent collapse of bubbles. Therefore, I moved adap_dt_max_iters from m_constant to user input parameter.
Type of change
Please delete options that are not relevant.
Bug fix (non-breaking change which fixes an issue)
Scope
This PR comprises a set of related changes with a common goal
How Has This Been Tested?
The figure shows the comparison between adap_dt_max_iters = 100 and adap_dt_max_iters = 200. For adap_dt_max_iters = 100, the rebound cannot be captured.
Test Configuration:
What computers and compilers did you use to test this: MacBook M4 Pro
Checklist
I have added comments for the new code
I added Doxygen docstrings to the new code
I have made corresponding changes to the documentation (docs/)
PR Type
Bug fix
Description
Move adap_dt_max_iters from constant to user parameter
Fix broken 0D bubble collapse adaptive example
Add documentation for new adaptive time stepping parameters
Diagram Walkthrough
flowchart LR
A["m_constants.fpp"] -- "remove constant" --> B["m_global_parameters.fpp"]
B -- "add user parameter" --> C["case.py"]
C -- "set adap_dt_max_iters=200" --> D["Fixed Example"]
B -- "parameter propagation" --> E["m_mpi_proxy.fpp"]
B -- "parameter propagation" --> F["m_start_up.fpp"]
G["case_dicts.py"] -- "add parameter type" --> H["Documentation"]
The default value of 100 for adap_dt_max_iters is set in the initialization function, but this was the original problematic value that caused the bug. Consider if this default should be higher to prevent similar issues in other cases.
The PR fixes a simulation feature but does not include any automated tests to verify the fix works correctly or to prevent regression of this issue in the future.
✅ Use constant instead of hardcoded valueSuggestion Impact:The commit directly implements the suggestion by replacing the hardcoded value 100 with the constant dflt_adap_dt_max_iters
The hardcoded value should use the default constant from m_constants module for consistency with other default parameter assignments. This ensures centralized configuration management and easier maintenance.
Why: This suggestion correctly identifies the use of a magic number (100) and recommends using a named constant, which is a significant improvement for code readability and maintainability.
Medium
✅ Add missing default constant parameterSuggestion Impact:The suggestion was directly implemented - the default constant dflt_adap_dt_max_iters was added with value 100 and appropriate comment
code diff:
+ integer, parameter :: dflt_adap_dt_max_iters = 100 !< Default max iteration for adaptive step size
The removal of adap_dt_max_iters constant leaves a gap in the constants section. Since this parameter is now moved to be a configurable variable, consider adding a default constant for consistency with the pattern used for dflt_adap_dt_tol.
real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
-+integer, parameter :: dflt_adap_dt_max_iters = 100 !< Default maximum number of iterations for adaptive step size
! Constants of the algorithm described by Heirer, E. Hairer S.P.Nørsett G. Wanner, Solving Ordinary Differential Equations I, Chapter II.4
Suggestion importance[1-10]: 6
__
Why: This suggestion correctly points out that a default constant dflt_adap_dt_max_iters should be added for consistency with dflt_adap_dt_tol, improving maintainability by centralizing default values.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.04%. Comparing base (ada47da) to head (55dc6b4). ⚠️ Report is 1 commits behind head on master.
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
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.
User description
Description
I noticed that the example
0D_bubblecollapse_adapis broken. The reason was that when Lagrange bubble model was updated, the maximum iteration for adaptive time stepping was fixed to 100, while this case requires more than 100 as it involves violent collapse of bubbles. Therefore, I movedadap_dt_max_itersfromm_constantto user input parameter.Type of change
Please delete options that are not relevant.
Scope
How Has This Been Tested?
The figure shows the comparison between

adap_dt_max_iters = 100andadap_dt_max_iters = 200. Foradap_dt_max_iters = 100, the rebound cannot be captured.Test Configuration:
Checklist
docs/)PR Type
Bug fix
Description
Move
adap_dt_max_itersfrom constant to user parameterFix broken 0D bubble collapse adaptive example
Add documentation for new adaptive time stepping parameters
Diagram Walkthrough
File Walkthrough