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

Sign error in downwelling radiation? #248

Open
glwagner opened this issue Nov 14, 2024 · 4 comments
Open

Sign error in downwelling radiation? #248

glwagner opened this issue Nov 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@glwagner
Copy link
Member

These should be + not -:

return @inbounds - (1 - α) * Qs - ϵ * Qℓ

Otherwise it implies that these fluxes have the opposite sign as the turbulent heat fluxes, eg

and it is also inconsistent with the upwelling radiation

# Note: positive implies _upward_ heat flux, and therefore cooling.
return ϵ * σ * Tₒ^4

@glwagner
Copy link
Member Author

I guess the problem is that the JRA55 data also has a sign inconsistent with Oceananigans convention:

julia> Qswt = ClimaOcean.JRA55.JRA55_field_time_series(:downwelling_shortwave_radiation; time_indices=:)
640×320×1×2920 FieldTimeSeries{InMemory} located at (Center, Center, ⋅) on CPU
├── grid: 640×320×1 LatitudeLongitudeGrid{Float32, Periodic, Bounded, Flat} on CPU with 3×3×0 halo and with precomputed metrics
├── indices: (:, :, :)
├── time_indexing: Cyclical(period=3.1536e7)
├── backend: InMemory()
└── data: 646×326×1×2920 OffsetArray(::Array{Float32, 4}, -2:643, -2:323, 1:1, 1:2920) with eltype Float32 with indices -2:643×-2:323×1:1×1:2920
    └── max=1581.63, min=0.0, mean=157.422

To fix this we need to reverse the sign in the JRA55 data when it is loaded.

I think we should always use the same sign convention to avoid confusion. This came up when trying to set up an idealized atmospheric state.

@navidcy
Copy link
Collaborator

navidcy commented Nov 15, 2024

Good catch!

@navidcy navidcy added the bug Something isn't working label Nov 15, 2024
@simone-silvestri
Copy link
Collaborator

might this be connected with #248?

@glwagner
Copy link
Member Author

Ah no, there are two "sign errors" that cancel out. First the fluxes are loaded with the wrong sign (by our convention). But then there is this second sign error that cancels it out. So the solar insolation is heating like it should be I think. But it could easily produce a bug in the future so i think its important to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants