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

Some revisitation of turbulent fuxes #80

Open
wants to merge 443 commits into
base: main
Choose a base branch
from

Conversation

simone-silvestri
Copy link
Collaborator

This PR revisits surface fluxes to have them produce similar results to COARE 3.6.

In addition there are some OMIP-specific infrastructural changes

  • remove lakes and connected regions to bathymetry
  • add a transmissivity and latitude dependent albedo from Payne (1972)

an ongoing PR subjected to changes

navidcy and others added 30 commits February 12, 2024 13:21
end

Base.summary(::PrescribedAtmosphere) = "PrescribedAtmosphere"
Base.show(io::IO, pa::PrescribedAtmosphere) = print(io, summary(pa))

"""
PrescribedAtmosphere(times;
reference_height,
measurement_height,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go back to reference height

(this doesn't refer to any measurements, at least not for JRA55 which is our only example)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call it something different? In COARE 3.6 reference height is something different. Probably field_height?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reference height in COARE 3.6?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this like many other parts should have another PR and ideally an issue so we can discuss separately and come up with something well thought out

@simone-silvestri
Copy link
Collaborator Author

It is mostly reorganizing code. We just came out of a PR that added new 8800 lines of code (#49), so there is a lot of fine tuning we can do (for example just splitting the gigantic file similarity_theory_turbulent_fluxes.jl in more digestable files which is not really changing anything takes a lot of this PR)

The actual code contribution of this PR is not that large if you remove all the restructuring of the code (which is literally just moving code in new files), the new examples and the new Manifests/Project.toml files.

@glwagner
Copy link
Member

glwagner commented May 3, 2024

It is mostly reorganizing code. We just came out of a PR that added new 8800 lines of code (#49), so there is a lot of fine tuning we can do (for example just splitting the gigantic file similarity_theory_turbulent_fluxes.jl in more digestable files which is not really changing anything takes a lot of this PR)

The actual code contribution of this PR is not that large if you remove all the restructuring of the code (which is literally just moving code in new files), the new examples and the new Manifests/Project.toml files.

Then I think the way I can review this PR is not to look at the changes / diff but rather to sit down together and read the code from top to bottom

Comment on lines 153 to 154
# JRA55 atmosphere is adjusted to formulae without this last term so we exclude it
@inline simplified_bulk_coefficient(ψ, h, ℓ, L) = log(h / ℓ) - ψ(h / L) # + ψ(ℓ / L)
@inline simplified_bulk_coefficients(ψ, h, ℓ, L) = log(h / ℓ) - ψ(h / L) # + ψ(ℓ / L)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I agree with this logic. JRA55 is also nudged strongly to observations. I think we want to treat it like observations --- the objective is not to set up a simulation that is somehow "consistent" with the coupled system that JRA55 was originally run with.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be interesting to see the difference between the two formulations (maybe it is not that large). These "similiarity functions" are all parameterizations that include empirical elements or relations that are extrapolated from data, so rigorous mathematical consistency does not necessarily equate to results that are closer to observations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a bad idea, in that case something like

inline profile::SimplifiedProfile, h, ℓ, L) = ...

might work.

PS this is the profile, not the bulk coeffcient right? It's what we get when we integrate the similarity gradient.

rigorous mathematical consistency does not necessarily equate to results that are closer to observations.

The purpose of including the term is not to be "rigorous". It's to avoid "random" approximations that rely on hidden assumptions. I think the same argument is actually the real reason to include it. If including the extra term means that this expression generalizes to cases with larger or small L --- but does not affect the results for typical values of these parameters --- that is exactly why we should include it. Approximations need to have a purpose. The purpose can't be to drop a term in a mathematical expression. It would actually have to make a difference in computational performance or somethign like that to justify this.


Adapt.adapt_structure(to, α::LatitudeDependentAlbedo) =
LatitudeDependentAlbedo(Adapt.adapt(to, α.direct),
Adapt.adapt(to, α.diffuse))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid design 💪

@simone-silvestri simone-silvestri marked this pull request as ready for review May 20, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants