-
Notifications
You must be signed in to change notification settings - Fork 7
read land ICs from a file #1318
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
WalkthroughThe changes add a new optional Boolean argument Assessment against linked issues
Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
experiments/ClimaEarth/components/land/climaland_integrated.jl (2)
152-154
: Add error handling for file path retrieval.The file path is obtained without error handling. Consider handling potential issues if the file doesn't exist.
- ic_path = ClimaLand.Artifacts.soil_ic_2008_50m_path() + ic_path = try + ClimaLand.Artifacts.soil_ic_2008_50m_path() + catch e + @error "Failed to retrieve soil IC file path: $e" + rethrow(e) + end
154-156
: Consider making the IC file path configurable.Currently, the initial conditions path is hardcoded. Consider making it a constructor parameter for flexibility.
This would allow users to specify custom initial condition files rather than relying on the default.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
experiments/ClimaEarth/components/land/climaland_integrated.jl
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: ci 1.11 - windows-latest
- GitHub Check: ci 1.11 - ubuntu-latest
- GitHub Check: ci 1.10 - windows-latest
- GitHub Check: test (1.11)
- GitHub Check: ci 1.10 - ubuntu-latest
- GitHub Check: docbuild
- GitHub Check: test (1.10)
🔇 Additional comments (2)
experiments/ClimaEarth/components/land/climaland_integrated.jl (2)
146-150
: Nicely structured initialization for non-file parameters.The code clearly separates initialization between hardcoded values and file-loaded values with a helpful comment.
561-561
:❓ Verification inconclusive
Address the TODO comment about snow temperature.
The TODO indicates the snow temperature is 0 at this point. Consider investigating why and whether this is expected behavior.
🏁 Script executed:
#!/bin/bash # Look for information about snow temperature initialization rg "set_snow_initial_conditions" -A 10 -B 10Length of output: 2408
Verify snow temperature initialization
It looks like you’re reading snow and soil initial conditions via ClimaLand.set_snow_initial_conditions! but still see a computed snow temperature of 0 at the TODO. Please investigate:
• In experiments/ClimaEarth/components/land/climaland_integrated.jl (around the TODO at line 561), add a quick check or print of the snow temperature field right after set_snow_initial_conditions! to confirm its values.
• Inspect the IC file at ClimaLand.Artifacts.soil_ic_2008_50m_path() — does it include nonzero snow temperatures?
• Review the implementation of ClimaLand.set_snow_initial_conditions! in the ClimaLand package to ensure it correctly assigns snow temperature.
• If the IC or loader is missing snow-T data, decide whether to supply a default or fall back to canopy surface T.
c9812e5
to
f0726a5
Compare
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
NEWS.md
(1 hunks)experiments/ClimaEarth/cli_options.jl
(1 hunks)experiments/ClimaEarth/components/land/climaland_integrated.jl
(3 hunks)experiments/ClimaEarth/setup_run.jl
(2 hunks)experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
(1 hunks)experiments/ClimaEarth/user_io/arg_parsing.jl
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- experiments/ClimaEarth/components/land/climaland_integrated.jl
🧰 Additional context used
📓 Path-based instructions (1)
`*`: # CodeRabbit Style Guide (CliMA Inspired)
Leverage CodeRabbit for code reviews aligning with CliMA's practices.
I. Key Areas for CodeRabbit:
- Style: Naming (Titl...
*
: # CodeRabbit Style Guide (CliMA Inspired)Leverage CodeRabbit for code reviews aligning with CliMA's practices.
I. Key Areas for CodeRabbit:
- Style: Naming (TitleCase, lowercase_with_underscores), line length (<78), indentation (4 spaces), import order.
- DRY: Flag duplicated code; encourage modularization.
- Docstrings: Flag missing docstrings for modules, structs, functions.
- Tests: Detect missing unit tests (if configured).
- Complexity: Report on cyclomatic complexity.
II. Conventions (CodeRabbit Can Help):
- Naming: Follow CliMA/CMIP conventions. Avoid
l
,O
,I
as single-char vars.- Unicode: Human review needed. Acceptable chars.
III. Documentation (CodeRabbit Flags Deficiencies):
- Docstrings: Describe purpose, inputs, outputs, examples.
IV. Testing (CodeRabbit: Missing Tests):
- Unit tests required for new/modified code.
V. CodeRabbit Config:
.coderabbit.yaml
: Customize language, line length, tests.VI. Workflow:
- Review CodeRabbit's suggestions; investigate, provide context, address issues, improve config.
VII. Abandoned Code: Delete or clearly mark as deprecated.
VIII. Reviewer Responsibilities: Ensure adherence to best practices.
NEWS.md
🪛 GitHub Actions: JuliaFormatter
experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
[error] 66-67: Code formatting change detected in ClimaLandSimulation call. The line was split into multiple lines, causing a diff failure.
🪛 markdownlint-cli2 (0.17.2)
NEWS.md
9-9: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: ci 1.11 - windows-latest
- GitHub Check: ci 1.11 - ubuntu-latest
- GitHub Check: ci 1.10 - windows-latest
- GitHub Check: test (1.11)
- GitHub Check: test (1.10)
- GitHub Check: ci 1.10 - ubuntu-latest
- GitHub Check: docbuild
🔇 Additional comments (6)
NEWS.md (1)
9-14
: New feature documentation looks good.Clear explanation of the
land_spun_up_ic
flag and its requirements. Users will understand when to use this feature.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
9-9: Heading style
Expected: setext; Actual: atx(MD003, heading-style)
experiments/ClimaEarth/cli_options.jl (1)
150-153
: CLI option added appropriately.The
land_spun_up_ic
flag is well positioned in the ClimaLand-specific section with clear help text.experiments/ClimaEarth/user_io/arg_parsing.jl (2)
117-119
: Good extraction of the land_spun_up_ic parameter.The parameter is correctly extracted from the config dictionary.
143-146
: Parameter ordering in return tuple is logical.Grouping land model parameters together makes sense -
land_spun_up_ic
near other land parameters and before the bucket-specific options.experiments/ClimaEarth/setup_run.jl (2)
128-130
: New parameter for land initial conditions added correctly.The addition of the
land_spun_up_ic
parameter alongside other land-related parameters is well-placed, maintaining logical code organization.
294-295
: Parameter correctly passed to integrated land model.The new boolean flag is appropriately forwarded to the
ClimaLandSimulation
constructor, enabling the loading of soil and snow states from external files as described in the PR.
experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
Outdated
Show resolved
Hide resolved
f0726a5
to
961fb20
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
NEWS.md (1)
9-15
: Ensure consistent heading style and line length
The new ATX-style heading (#### …
) mixes with the file’s existing setext headings and exceeds the 78-character limit. To keep the style uniform and wrap long lines, convert it to setext style:-#### Add option for integrated land spun up IC. PR[#1318](https://github.com/CliMA/ClimaCoupler.jl/pull/1318) +Add option for integrated land spun up IC. PR[#1318](https://github.com/CliMA/ClimaCoupler.jl/pull/1318) +-----------------------------------------------🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
9-9: Heading style
Expected: setext; Actual: atx(MD003, heading-style)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
NEWS.md
(1 hunks)experiments/ClimaEarth/cli_options.jl
(1 hunks)experiments/ClimaEarth/components/land/climaland_integrated.jl
(3 hunks)experiments/ClimaEarth/setup_run.jl
(2 hunks)experiments/ClimaEarth/test/amip_test.yml
(1 hunks)experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
(1 hunks)experiments/ClimaEarth/user_io/arg_parsing.jl
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- experiments/ClimaEarth/test/amip_test.yml
🚧 Files skipped from review as they are similar to previous changes (5)
- experiments/ClimaEarth/user_io/arg_parsing.jl
- experiments/ClimaEarth/cli_options.jl
- experiments/ClimaEarth/setup_run.jl
- experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
- experiments/ClimaEarth/components/land/climaland_integrated.jl
🧰 Additional context used
📓 Path-based instructions (1)
`*`: # CodeRabbit Style Guide (CliMA Inspired)
Leverage CodeRabbit for code reviews aligning with CliMA's practices.
I. Key Areas for CodeRabbit:
- Style: Naming (Titl...
*
: # CodeRabbit Style Guide (CliMA Inspired)Leverage CodeRabbit for code reviews aligning with CliMA's practices.
I. Key Areas for CodeRabbit:
- Style: Naming (TitleCase, lowercase_with_underscores), line length (<78), indentation (4 spaces), import order.
- DRY: Flag duplicated code; encourage modularization.
- Docstrings: Flag missing docstrings for modules, structs, functions.
- Tests: Detect missing unit tests (if configured).
- Complexity: Report on cyclomatic complexity.
II. Conventions (CodeRabbit Can Help):
- Naming: Follow CliMA/CMIP conventions. Avoid
l
,O
,I
as single-char vars.- Unicode: Human review needed. Acceptable chars.
III. Documentation (CodeRabbit Flags Deficiencies):
- Docstrings: Describe purpose, inputs, outputs, examples.
IV. Testing (CodeRabbit: Missing Tests):
- Unit tests required for new/modified code.
V. CodeRabbit Config:
.coderabbit.yaml
: Customize language, line length, tests.VI. Workflow:
- Review CodeRabbit's suggestions; investigate, provide context, address issues, improve config.
VII. Abandoned Code: Delete or clearly mark as deprecated.
VIII. Reviewer Responsibilities: Ensure adherence to best practices.
NEWS.md
🪛 markdownlint-cli2 (0.17.2)
NEWS.md
9-9: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: ci 1.11 - windows-latest
- GitHub Check: ci 1.11 - ubuntu-latest
- GitHub Check: ci 1.10 - windows-latest
- GitHub Check: ci 1.10 - ubuntu-latest
- GitHub Check: test (1.11)
- GitHub Check: docbuild
961fb20
to
9b3e118
Compare
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
NEWS.md (1)
9-9
: Inconsistent heading style
The top-level title uses Setext style (=====
underlining) while this subheading uses ATX (####
). For consistency, either switch this and other subheadings to Setext or convert the main title to ATX (e.g.# ClimaCoupler.jl Release Notes
).🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
9-9: Heading style
Expected: setext; Actual: atx(MD003, heading-style)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
NEWS.md
(1 hunks)experiments/ClimaEarth/cli_options.jl
(1 hunks)experiments/ClimaEarth/components/land/climaland_integrated.jl
(3 hunks)experiments/ClimaEarth/setup_run.jl
(2 hunks)experiments/ClimaEarth/test/amip_test.yml
(1 hunks)experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
(1 hunks)experiments/ClimaEarth/user_io/arg_parsing.jl
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- experiments/ClimaEarth/test/amip_test.yml
- experiments/ClimaEarth/cli_options.jl
- experiments/ClimaEarth/test/component_model_tests/climaland_tests.jl
- experiments/ClimaEarth/setup_run.jl
- experiments/ClimaEarth/user_io/arg_parsing.jl
- experiments/ClimaEarth/components/land/climaland_integrated.jl
🧰 Additional context used
📓 Path-based instructions (1)
`*`: # CodeRabbit Style Guide (CliMA Inspired)
Leverage CodeRabbit for code reviews aligning with CliMA's practices.
I. Key Areas for CodeRabbit:
- Style: Naming (Titl...
*
: # CodeRabbit Style Guide (CliMA Inspired)Leverage CodeRabbit for code reviews aligning with CliMA's practices.
I. Key Areas for CodeRabbit:
- Style: Naming (TitleCase, lowercase_with_underscores), line length (<78), indentation (4 spaces), import order.
- DRY: Flag duplicated code; encourage modularization.
- Docstrings: Flag missing docstrings for modules, structs, functions.
- Tests: Detect missing unit tests (if configured).
- Complexity: Report on cyclomatic complexity.
II. Conventions (CodeRabbit Can Help):
- Naming: Follow CliMA/CMIP conventions. Avoid
l
,O
,I
as single-char vars.- Unicode: Human review needed. Acceptable chars.
III. Documentation (CodeRabbit Flags Deficiencies):
- Docstrings: Describe purpose, inputs, outputs, examples.
IV. Testing (CodeRabbit: Missing Tests):
- Unit tests required for new/modified code.
V. CodeRabbit Config:
.coderabbit.yaml
: Customize language, line length, tests.VI. Workflow:
- Review CodeRabbit's suggestions; investigate, provide context, address issues, improve config.
VII. Abandoned Code: Delete or clearly mark as deprecated.
VIII. Reviewer Responsibilities: Ensure adherence to best practices.
NEWS.md
🪛 markdownlint-cli2 (0.17.2)
NEWS.md
9-9: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: ci 1.11 - windows-latest
- GitHub Check: ci 1.11 - ubuntu-latest
- GitHub Check: ci 1.10 - windows-latest
- GitHub Check: ci 1.10 - macOS-latest
- GitHub Check: ci 1.10 - ubuntu-latest
- GitHub Check: test (1.11)
- GitHub Check: docbuild
#### Add option for integrated land spun up IC. PR[#1318](https://github.com/CliMA/ClimaCoupler.jl/pull/1318) | ||
|
||
Adds a boolean flag `land_spun_up_ic` that allows the user to request reading | ||
integrated land initial conditions from a saved simulation, rather than setting | ||
them with default values. If this option is true, the land/sea mask must be used, | ||
since the spun-up ICs are only defined over land. |
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.
🛠️ Refactor suggestion
Clarify default behavior and usage
– Hyphenate and pluralize the heading for clarity:
-#### Add option for integrated land spun up IC. PR[#1318](...)
+#### Add option for integrated land spun-up ICs. PR[#1318](...)
– Document the default value (true
) and how to disable it, for example:
The
land_spun_up_ic
flag (default:true
) enables reading spun-up ICs from disk. To revert to defaults, pass--land_spun_up_ic=false
.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
#### Add option for integrated land spun up IC. PR[#1318](https://github.com/CliMA/ClimaCoupler.jl/pull/1318) | |
Adds a boolean flag `land_spun_up_ic` that allows the user to request reading | |
integrated land initial conditions from a saved simulation, rather than setting | |
them with default values. If this option is true, the land/sea mask must be used, | |
since the spun-up ICs are only defined over land. | |
#### Add option for integrated land spun-up ICs. PR[#1318](https://github.com/CliMA/ClimaCoupler.jl/pull/1318) | |
Adds a boolean flag `land_spun_up_ic` that allows the user to request reading | |
integrated land initial conditions from a saved simulation, rather than setting | |
them with default values. If this option is true, the land/sea mask must be used, | |
since the spun-up ICs are only defined over land. |
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
9-9: Heading style
Expected: setext; Actual: atx
(MD003, heading-style)
Purpose
Read integrated land initial conditions from file
closes #1289
analogous to CliMA/ClimaLand.jl#1029
To Do