-
Notifications
You must be signed in to change notification settings - Fork 13
Creating function to be able to run run_fluxnet for any fluxnet site with generic parameters #1182
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Thanhthanh, this is looking great so far! Let me know after you push your most recent changes and address the comments I've made here, and I'll do another review
a630178
to
1cb4760
Compare
This is looking good! I will review in a moment, but it would also be good to: 1. rebase on current main, and 2. not modify the Manifest in this PR - to do this you can check out the Manifest from main by running |
…nctions from any_run_fluxnet pick 1cb4760 deprecated run_fluxnet.jl to become a pure simulation file calling functions from any_run_fluxnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions about how the user-specified params are being used, but we can discuss this afternoon!
), | ||
) | ||
|
||
Base.invokelatest(run_helper, site_ID, params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need to call Base.invokelatest
, and if we remove it we'll be able to get rid of the @eval
macro in run_helper
|
||
sol = SciMLBase.solve(prob, ode_algo; dt = dt, callback = cb) | ||
|
||
# Extract model output from the saved diagnostics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything from here down in this function can go into another function postprocess_fluxnet()
, so that we can run the simulation without postprocessing (e.g. for calibration), and also to make the code more readable
if isfile( | ||
joinpath( | ||
climaland_dir, | ||
"experiments/integrated/fluxnet/$site_ID/Artifacts.toml", | ||
), | ||
) | ||
rm( | ||
joinpath( | ||
climaland_dir, | ||
"experiments/integrated/fluxnet/$site_ID/Artifacts.toml", | ||
), | ||
) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be more concise:
if isfile( | |
joinpath( | |
climaland_dir, | |
"experiments/integrated/fluxnet/$site_ID/Artifacts.toml", | |
), | |
) | |
rm( | |
joinpath( | |
climaland_dir, | |
"experiments/integrated/fluxnet/$site_ID/Artifacts.toml", | |
), | |
) | |
end | |
artifact_file = joinpath(climaland_dir, "experiments/integrated/fluxnet/$site_ID/Artifacts.toml") | |
isfile(artifact_file) && rm(artifact_file) |
43c662e
to
2aa009f
Compare
Purpose
Added function to allow run_fluxnet.jl to be extrapolated for a fixed set of params and any fluxnet site (stored in any_run_fluxnet.jl). Was tested with US-Ha1 to confirm that it is working.
To-do
Content