Warn users when SlabOceanSST overwrites surface_condition temperature - #4604
Draft
jefftyoder with Copilot wants to merge 10 commits into
Draft
Warn users when SlabOceanSST overwrites surface_condition temperature#4604jefftyoder with Copilot wants to merge 10 commits into
jefftyoder with Copilot wants to merge 10 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix SlabOceanSST overwriting surface temperature from setup
Warn users when SlabOceanSST overwrites surface_condition temperature
Jun 23, 2026
Co-authored-by: jefftyoder <170672604+jefftyoder@users.noreply.github.com>
Co-authored-by: jefftyoder <170672604+jefftyoder@users.noreply.github.com>
Co-authored-by: jefftyoder <170672604+jefftyoder@users.noreply.github.com>
jefftyoder
force-pushed
the
copilot/fix-surface-temperature-overwrite
branch
from
July 1, 2026 19:29
c2d9e90 to
2d76856
Compare
Contributor
|
📖 Docs preview for this PR: https://clima.github.io/ClimaAtmos.jl/previews/PR4604/ |
- Add slab_ocean_warning.jl to runtests.jl infrastructure group so CI actually runs the tests - Hoist shared AtmosConfig, params, and setup_type to outer testset scope, reducing AtmosConfig constructions from 3 to 2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Triple-quoted string at top of file was parsed as a docstring for `using Test`, which Julia 1.10 rejects. Convert to a # comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@test expr "message" is not supported in Julia 1.10's Test stdlib. Drop the message; the testset context makes the intent clear. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
….ClimaAtmosParameters
The convenience constructor ClimaAtmosParameters(::Type{FT}) lives in the
top-level CA namespace (create_parameters.jl), not in CA.Parameters which
only defines the struct. Matches the pattern used across all other tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
`TRMM_LBA()` requires `prognostic_tke::Bool` and `thermo_params`; the zero-arg call was crashing on all Julia versions with `UndefKeywordError: keyword argument 'prognostic_tke' not assigned`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
@nefrathenrici I tried using CoPilot + Claude Code to write up this PR. If the changes look sensible to you, I'm happy to help clean it up and merge it in. If not, we can close this draft. |
nefrathenrici
approved these changes
Jul 15, 2026
nefrathenrici
left a comment
Member
There was a problem hiding this comment.
Thanks! Looks good, just minor comments
| Setups.surface_condition(setup_type, params) | ||
|
|
||
| temperature = if pa["prognostic_surface"] == "SlabOceanSST" | ||
| if !isnothing(setup_type) && !isnothing(setup_pieces.temperature) |
Member
There was a problem hiding this comment.
Suggested change
| if !isnothing(setup_type) && !isnothing(setup_pieces.temperature) | |
| if !isnothing(setup_type) |
nit, this check is redundant
Member
There was a problem hiding this comment.
This file should be moved to test/config/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using the
SlabOceanSSTsurface model, any surface temperature specified viasurface_conditionin a case setup is overwritten by the slab ocean's prognostic initialization. This is correct and intended behavior, but the silent overwrite can confuse users, particularly when adapting existing cases or debugging initialization values.Changes
Warning in model initialization
AtmosSurface()(src/config/model_getters.jl, lines 833–835) that emits whenSlabOceanSSTis active and a setup provides asurface_conditiontemperatureprognostic_variables.jlTest coverage
test/slab_ocean_warning.jlwith three test cases:SlabOceanSSTsetup_typeisnothingPrescribedSST(as expected)Example