← Back to Pull requests

Add progress logging and tidy use of stdout and stderr #94

Closed
unknown closed this pull request without merging on Oct 29, 2026 16:27 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 11:09 UTC
Author

Closes #92.

The primary function of this PR is to print progress to the screen. I only add this for the outer loop over stations. Since we have OpenMP parallelisation, I use an approach that will give the same output no matter what order the threads are executed. Running the existing tests locally I get

Running test case 'f3', run 'frc'
 total sites =           17 for bgcopt=            3
stations
1...............17
%%%%%%%%%%%%%%%%% done!
fraction    1   3       38.754   1.000   8.234   1.000   1.000   6.941   0.555   1.000   1.000   1.000   2.051   1.000   1.694   1.000   1.595
 cost12   38.7541642706997     
Time taken: 15 seconds
Running test case 'cable3', run 'hwsd'
  calling getdata_hwsd
 input file
 ./input/data_extraction_cable_model_calibration_cluster_test.nc                
                                                              
 fansoc file
 ./input/fanoc_mp_100_matched_sites.nc                                          
                                                              
 mp ms bgcopt=         100           7           3
 run site     1      4      3      0.804    258.096      5.537
 run site     2      6      3      0.709    247.082      5.525
 run site     3      9      3      0.631    139.358      5.412
 run site     4     30      3      1.000    663.059      4.801
 run site     5     31      3      0.721    125.669      7.032
 run site     6     33      3      0.713    253.093      6.612
 run site     7     37      3      0.632    187.054      6.341
 run site     8     40      3      0.642    383.690      6.127
 run site     9     43      3      0.621    513.154      5.830
 run site    10     48      3      0.725    610.978      5.809
 run site    11     55      3      0.646    426.268      6.977
 run site    12     56      3      0.657    386.420      6.821
 run site    13     58      3      0.640    223.950      6.175
 run site    14     64      3      0.604    104.348      7.052
 run site    15     67      3      0.557    292.390      6.799
 run site    16     68      3      0.750    357.402      6.786
 run site    17     75      3      0.650    121.578      5.939
 run site    18     80      3      0.659    265.939      7.250
 run site    19     82      3      0.647    112.525      4.739
 run site    20     87      3      0.645    227.706      6.994
 run site    21     96      3      0.592    120.657      6.114
 run site    22     97      3      0.627    121.327      6.396
stations
1....................22
%%%%%%%%%%%%%%%%%%%%%% done!
hwsd_soc    1   3      137.490   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000
 cost12   137.490397864243     
Time taken: 9 seconds
PASS: test case 'f3', run 'frc'
PASS: test case 'cable3', run 'hwsd'
===== Job finished: Thu Oct 22 11:58:11 AM BST 2026 =====

i.e., the number of stations is listed and then a % symbol is printed whenever a station is accounted for in the loop.

In addition to setting this up, I improved the consistency of how standard output and standard error are handled in the model. In particular, I replace any write(6, write(, and print , with write(stdout, where stdout maps to the standard output unit from iso_fortran_env, and I ensure that anything that is meant to be an error is instead sent to stderr. For error reports, I also use error stop specifically instead of just stop.

Question for reviewers

Is this approach going to be okay for the global simulation or are there so many more stations that the progress bar would likely exceed the line limit?

Diff: 457 lines (+342 / -115) across 5 files Reviewer: joewallwork Review duration: 10397m
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 457 lines diff across 5 files
0.46
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.367
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #94"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 45.5% (MEDIUM) · Higher = larger blast radius
45.5%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 18.0% · Safe to merge
18.0%