-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add optional initial temperature guess #128
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.
LGTM. Some comments on tests below.
Would it be difficult to set maxiter by default to 1 is T_guess if given, and to something larger otherwise? If so, we may get away with a reasonable O(0.1 K) convergence tolerance in all cases.
287428d
to
6f8ec27
Compare
6f8ec27
to
a99bbbe
Compare
132: Add data collection mechanism r=charleskawczynski a=charleskawczynski One concern we've had recently is whether our tolerance for saturation adjustment is reasonable or not because it's a bit difficult to reason about. If the tolerance is occasionally poor, we could have convergence issues with reasonable inputs and, at the moment, it's a bit difficult to know that since the inputs are not in more intuitive variables like temperature. #128 is an attempt to make sure that we start with a reasonable guess, however, knowing whether this is a good idea or not requires collecting data from a real-world run, and we don't have a clean way to do that at the moment. This PR adds a module dedicated to collecting data, to help us better understand statistics of some important information: - Maximum number of iterations performed - Average number of iterations performed - Number of converged and non-converged calls (if / when we set `TD.error_on_non_convergence() = false`) Here's a simple script for running the moist baroclinic wave in ClimaAtmos: ```julia using Revise; include("examples/hybrid/cli_options.jl"); dict = parsed_args_per_job_id(); parsed_args = dict["sphere_baroclinic_wave_rhoe_equilmoist"]; parsed_args["enable_threading"] = false import Thermodynamics import RootSolvers Thermodynamics.solution_type() = RootSolvers.VerboseSolution() include("examples/hybrid/driver.jl") Thermodynamics.DataCollection.print_summary() ``` At the moment, this produces ```julia julia> Thermodynamics.DataCollection.print_summary() ┌ Info: Thermodynamics saturation_adjustment statistics: │ max_iter = 1 │ call_counter = 15904225 │ average_max_iter = 6.287637404526156e-8 │ converged_counter = 15904225 └ non_converged_counter = 0 ``` Which seems pretty good, however, this is running at coarse resolution, for only 6 days (1152 `step!`s). Runtime was about 4 min, so we can definitely crank things up. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
132: Add data collection mechanism r=charleskawczynski a=charleskawczynski One concern we've had recently is whether our tolerance for saturation adjustment is reasonable or not because it's a bit difficult to reason about. If the tolerance is occasionally poor, we could have convergence issues with reasonable inputs and, at the moment, it's a bit difficult to know that since the inputs are not in more intuitive variables like temperature. #128 is an attempt to make sure that we start with a reasonable guess, however, knowing whether this is a good idea or not requires collecting data from a real-world run, and we don't have a clean way to do that at the moment. This PR adds a module dedicated to collecting data, to help us better understand statistics of some important information: - Maximum number of iterations performed - Average number of iterations performed - Number of converged and non-converged calls (if / when we set `TD.error_on_non_convergence() = false`) Here's a simple script for running the moist baroclinic wave in ClimaAtmos: ```julia using Revise; include("examples/hybrid/cli_options.jl"); dict = parsed_args_per_job_id(); parsed_args = dict["sphere_baroclinic_wave_rhoe_equilmoist"]; parsed_args["enable_threading"] = false import Thermodynamics import RootSolvers Thermodynamics.solution_type() = RootSolvers.VerboseSolution() include("examples/hybrid/driver.jl") Thermodynamics.DataCollection.print_summary() ``` At the moment, this produces ```julia julia> Thermodynamics.DataCollection.print_summary() ┌ Info: Thermodynamics saturation_adjustment statistics: │ max_iter = 1 │ call_counter = 15904225 │ average_max_iter = 6.287637404526156e-8 │ converged_counter = 15904225 └ non_converged_counter = 0 ``` Which seems pretty good, however, this is running at coarse resolution, for only 6 days (1152 `step!`s). Runtime was about 4 min, so we can definitely crank things up. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
132: Add data collection mechanism r=charleskawczynski a=charleskawczynski One concern we've had recently is whether our tolerance for saturation adjustment is reasonable or not because it's a bit difficult to reason about. If the tolerance is occasionally poor, we could have convergence issues with reasonable inputs and, at the moment, it's a bit difficult to know that since the inputs are not in more intuitive variables like temperature. #128 is an attempt to make sure that we start with a reasonable guess, however, knowing whether this is a good idea or not requires collecting data from a real-world run, and we don't have a clean way to do that at the moment. This PR adds a module dedicated to collecting data, to help us better understand statistics of some important information: - Maximum number of iterations performed - Average number of iterations performed - Number of converged and non-converged calls (if / when we set `TD.error_on_non_convergence() = false`) Here's a simple script for running the moist baroclinic wave in ClimaAtmos: ```julia using Revise; include("examples/hybrid/cli_options.jl"); dict = parsed_args_per_job_id(); parsed_args = dict["sphere_baroclinic_wave_rhoe_equilmoist"]; parsed_args["enable_threading"] = false import Thermodynamics import RootSolvers Thermodynamics.solution_type() = RootSolvers.VerboseSolution() include("examples/hybrid/driver.jl") Thermodynamics.DataCollection.print_summary() ``` At the moment, this produces ```julia julia> Thermodynamics.DataCollection.print_summary() ┌ Info: Thermodynamics saturation_adjustment statistics: │ max_iter = 1 │ call_counter = 15904225 │ average_max_iter = 6.287637404526156e-8 │ converged_counter = 15904225 └ non_converged_counter = 0 ``` Which seems pretty good, however, this is running at coarse resolution, for only 6 days (1152 `step!`s). Runtime was about 4 min, so we can definitely crank things up. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
132: Add data collection mechanism r=charleskawczynski a=charleskawczynski One concern we've had recently is whether our tolerance for saturation adjustment is reasonable or not because it's a bit difficult to reason about. If the tolerance is occasionally poor, we could have convergence issues with reasonable inputs and, at the moment, it's a bit difficult to know that since the inputs are not in more intuitive variables like temperature. #128 is an attempt to make sure that we start with a reasonable guess, however, knowing whether this is a good idea or not requires collecting data from a real-world run, and we don't have a clean way to do that at the moment. This PR adds a module dedicated to collecting data, to help us better understand statistics of some important information: - Maximum number of iterations performed - Average number of iterations performed - Number of converged and non-converged calls (if / when we set `TD.error_on_non_convergence() = false`) Here's a simple script for running the moist baroclinic wave in ClimaAtmos: ```julia using Revise; include("examples/hybrid/cli_options.jl"); dict = parsed_args_per_job_id(); parsed_args = dict["sphere_baroclinic_wave_rhoe_equilmoist"]; parsed_args["enable_threading"] = false import Thermodynamics import RootSolvers Thermodynamics.solution_type() = RootSolvers.VerboseSolution() include("examples/hybrid/driver.jl") Thermodynamics.DataCollection.print_summary() ``` At the moment, this produces ```julia julia> Thermodynamics.DataCollection.print_summary() ┌ Info: Thermodynamics saturation_adjustment statistics: │ max_iter = 1 │ call_counter = 15904225 │ average_max_iter = 6.287637404526156e-8 │ converged_counter = 15904225 └ non_converged_counter = 0 ``` Which seems pretty good, however, this is running at coarse resolution, for only 6 days (1152 `step!`s). Runtime was about 4 min, so we can definitely crank things up. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
9ccc6bc
to
ea03df2
Compare
bors r+ |
128: Add optional initial temperature guess r=charleskawczynski a=charleskawczynski This PR: - Adds an optional initial temperature guess - Adds appropriate docs - Fixes some docs `@tapios,` I've added a test that I think may be useful for us to review interactively. Closes #32. Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
Build failed: |
WIP Revert tolerance change Exercise T_guess in test suite
ea03df2
to
6ccc3b1
Compare
Codecov ReportBase: 93.63% // Head: 93.10% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #128 +/- ##
==========================================
- Coverage 93.63% 93.10% -0.53%
==========================================
Files 9 9
Lines 1053 1074 +21
==========================================
+ Hits 986 1000 +14
- Misses 67 74 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
bors r+ |
This PR:
@tapios, I've added a test that I think may be useful for us to review interactively.
Closes #32.