Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use diagnostics throughout #746

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

AlexisRenchon
Copy link
Member

@AlexisRenchon AlexisRenchon commented Aug 30, 2024

  • add diagnostics: net radiation, latent heat flux, sensible heat flux, ground heat flux
  • add diagnostics_as_vector function, to get diagnostics from DictWriters
  • use diagnostics in run_fluxnet
  • add water runoff for single site experiment (fluxnet)

closes #788

@Sbozzolo
Copy link
Member

We can add an ArrayWriter too. It would probably make single site much simpler.

@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch 2 times, most recently from 2ae3e38 to 59f93c6 Compare September 18, 2024 15:12
@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch 10 times, most recently from 4ad6766 to 70dcc38 Compare October 14, 2024 17:45
@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch 6 times, most recently from 0ae017a to f9999b3 Compare October 15, 2024 15:24
@AlexisRenchon AlexisRenchon marked this pull request as ready for review October 15, 2024 15:24
Comment on lines 336 to 339
SIF, AR, g_stomata, GPP, canopy_T, SW_u, LW_u, ER, ET, β, SHF, LHF, G, Rn = [
ClimaLand.Diagnostics.diagnostic_as_vectors(d_writer, diag_name, 1)[2][1:721]
for diag_name in hourly_diag_name
] # [1:721] only because summer subset of model output
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't scale very well. ClimaLand.Diagnostics.diagnostic_as_vectors returns the time too, can you use that to detect when it is summer instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this old script had many hardcoded stuff that make it difficult to maintain, and should be refactored properly.

however for instance, we were doing summer only because there was no snow model. once we have snow, we will run the whole year/dataset. so this is temporary.

src/diagnostics/diagnostic.jl Outdated Show resolved Hide resolved
src/diagnostics/diagnostic.jl Outdated Show resolved Hide resolved
@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch 3 times, most recently from 042ecc6 to b57f2be Compare October 15, 2024 20:12
@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch 7 times, most recently from 58015a5 to ee3f7d0 Compare October 17, 2024 17:09
@Sbozzolo Sbozzolo self-requested a review October 17, 2024 17:48
Copy link
Member

@Sbozzolo Sbozzolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch 2 times, most recently from b43b42a to c8ac585 Compare October 18, 2024 17:11
- diagnostics were added for net radiation, latent heat flux, sensible
heat flux, and ground heat flux.
- the function `diagnostic_as_vectors` was added, to get vector outputs
  from DictWriter.
- water runoff was added to `run_fluxnet`.
- `run_fluxnet` now uses diagnostics.
@AlexisRenchon AlexisRenchon force-pushed the ar/refactor_with_diagnostics branch from c8ac585 to 2d7c375 Compare October 18, 2024 17:15
@AlexisRenchon AlexisRenchon merged commit 44e4828 into main Oct 18, 2024
13 checks passed
@AlexisRenchon AlexisRenchon deleted the ar/refactor_with_diagnostics branch October 18, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diagnostics for single column examples
2 participants