uaf-arctic-eco-modeling / dvm-dos-tem

A process based Dynamic Vegetation, Dynamic Organic Soil, Terrestrial Ecosystem Model.
MIT License
22 stars 24 forks source link

Adding post-SA equilibrium checking functions #698

Closed Benjamin-Maglio closed 7 months ago

Benjamin-Maglio commented 8 months ago

Commits adding functions to mads_calibration/SA_post_hoc_analysis.py for post sensitivity analysis comparison of equilibrium quality metrics and time series data to either user input thresholds or prescribed defaults. Additionally, there is an update to the nitrogen checking function here to produce further outputs. These are highlighted below.

plot_equilibrium_metrics_scatter plots all results as a scatter plot for considering spread of results compared with either user input or default equilibrium metrics. Screenshot from 2024-03-28 07-19-27

plot_equilibrium_metrics_boxplot plots boxplots similarly to above but as a single figure for more concise analysis Screenshot from 2024-03-28 07-19-40

plot_equilibrium_relationships plots equilibrium time series against target (observed) value for all targeted variables Screenshot from 2024-03-28 07-20-03 Screenshot from 2024-03-28 07-20-12

equilibrium_check create Pandas DataFrames showing pass/fail statistics for each target variable, bool for each variable following all tests, and bool for each variable with each test for closer inspection. Additionally plots pass/fail bar graphs for each variable. Screenshot from 2024-03-28 07-20-23 Screenshot from 2024-03-28 07-20-39

nitrogen_check function for post sensitivity analysis run nitrogen limitation description in SA_post_hoc_analysis.py script.

Requires INGPP, GPP, AVLN output variables with nitrogen feedback enabled during SA_setup_and_run.py.

Nitrogen_check function analyses ratio between INGPP:GPP and compares to range associated with boreal or tundra biome, providing pandas DataFrames giving pass/fail % and INGPP:GPP ratio, AVLN for final 10 years of equilibrium.

Creates plots for INGPP:GPP and AVLN time series for visual inspection and bar plot showing pass/fail percentage. Plot titles suggest possible adjustment for parameters or new available nitrogen target. Screenshot from 2024-03-28 07-21-01 image

Functions require either a path to a sample directory or output eq_quality and targets csv files. Nitrogen check function specifically requires a path but also that INGPP, GPP, and AVLN are specified when the sensitivity analysis is first run, with nitrogen feedback enabled. Tested on AC-REFAC branch with combinations of variables containing non-pft, pft, and compartments. May require further debugging after broader uptake.