refactor: shared logger module and data verbosity for KIM and QL-Balance#121
Merged
refactor: shared logger module and data verbosity for KIM and QL-Balance#121
Conversation
Design document for issue #116. Introduces a shared logger module in common/logger/ with leveled output (SILENT→TRACE), format helpers, and a separate data_verbosity integer for HDF5 output control. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detailed task-by-task plan for issue #116: shared logger module, config variable migration, source file migration for KIM and QL-Balance, Python interface and golden record test updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New common/logger/logger_m.f90 provides: - Log levels: SILENT, RESULT, ERROR, WARNING, INFO, DEBUG, TRACE - Leveled output: log_error, log_warning, log_info, log_debug, log_trace - Format helpers: fmt_val overloaded for real, integer, logical, string Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…a_verbosity Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…l and data_verbosity WIP: source files still reference old variables, will be migrated next. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert write/print statements across 9 KIM source files to use logger_m calls. Replace fdebug/fstatus guards with log_info/log_debug/ log_trace, fdiagnostics guards with data_verbosity checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert write/print statements across 16 QL-Balance source files to use logger_m calls. Replace debug_mode guards with log_debug, diagnostics_output guards with data_verbosity checks. Convert read_config.f90 display block to fmt_val calls. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The golden record test uses main's namelist template (which has diagnostics_output) for the reference run, and the current branch's template (which has data_verbosity) for the comparison run. Set the correct key based on what's in the loaded template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #116.
common/logger/logger_m.f90) with leveled output (SILENT → TRACE), format helpers (fmt_val), and a clean API (log_info,log_debug,log_warning,log_error, etc.)log_level(console output) anddata_verbosity(HDF5/file output)Removed variables (clean break)
fdebug,fstatus,fdiagnosticslog_level,data_verbositydebug_mode,diagnostics_outputlog_level,data_verbosityExisting namelists must update these variable names. Format toggles (
ihdf5IO,hdf5_output) and feature flags (suppression_mode,misalign_diffusion) are unchanged.Test plan
make clean && make all— full clean build succeedstest_rhs_balance(pre-existing failure on main)grepverified)data_verbosityvariable🤖 Generated with Claude Code