Skip to content

Extension to RRTMGP.jl and implement RadiativeTransferModel#176

Merged
glwagner merged 81 commits intomainfrom
glw/rrtmgp
Dec 15, 2025
Merged

Extension to RRTMGP.jl and implement RadiativeTransferModel#176
glwagner merged 81 commits intomainfrom
glw/rrtmgp

Conversation

@glwagner
Copy link
Copy Markdown
Member

@glwagner glwagner commented Nov 16, 2025

Continues from #31

Mostly agent-generated, so needs a bit of work. Starting point is going to be the user interface in docs/src/radiative_transfer.md, which will perform some column calculations.

The key elements right now are:

  • RadiativeTransferModel. Eventually this should support other solvers besides RRTMGP
  • AtmosphereModel.radiative_transfer (could call this radiation too)
  • Not implemented yet is something like compute!(rtm::RadiativeTransferModel, model::AtmosphereModel) or something like that

I would also like the RadiativeTransferModel to be invokable without being embedded inside the AtmosphereModel. This will be useful for coupling.

@glwagner glwagner marked this pull request as draft November 16, 2025 18:06
@glwagner glwagner changed the title Extension to RRTMGP.jl Extension to RRTMGP.jl and implement grey radiative transfer model Nov 16, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 16, 2025

Comment thread docs/src/radiative_transfer.md Outdated
Comment thread docs/src/radiative_transfer.md Outdated
Comment thread docs/src/radiative_transfer.md Outdated
Comment thread docs/src/radiative_transfer.md Outdated
glwagner and others added 11 commits November 18, 2025 10:48
Co-authored-by: Navid C. Constantinou <navidcy@users.noreply.github.com>
Co-authored-by: Navid C. Constantinou <navidcy@users.noreply.github.com>
Co-authored-by: Navid C. Constantinou <navidcy@users.noreply.github.com>
Co-authored-by: Navid C. Constantinou <navidcy@users.noreply.github.com>
@glwagner glwagner marked this pull request as ready for review December 10, 2025 21:56
Comment thread Project.toml
Comment thread src/RadiativeTransfer/radiative_transfer_model.jl Outdated
glwagner and others added 3 commits December 10, 2025 15:07
Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
@glwagner
Copy link
Copy Markdown
Member Author

image

@glwagner glwagner marked this pull request as ready for review December 12, 2025 11:51
update_radiation!(radiation, model) = nothing

"""
RadiativeTransferModel(grid, constants, optical_thickness; kw...)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where is this method defined?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the RRTMGP extension. Yeah, we should add an actual method that throws an informative error

The gray atmosphere optical thickness follows the parameterization by [OGormanSchneider2008](@citet):

```math
τ_{lw} = α \frac{Δp}{p} \left[ f_l \frac{p}{p_0} + 4 (1 - f_l) \left(\frac{p}{p_0}\right)^4 \right] \left[ τ_e + (τ_p - τ_e) \sin^2 φ \right]
Copy link
Copy Markdown
Member

@navidcy navidcy Dec 13, 2025

Choose a reason for hiding this comment

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

This is slightly different from the expression in the paper by O'Gorman & Schneider. There is an extra there is an extra Δp/p. Is this OK?

Screenshot 2025-12-13 at 11 25 11 am

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also there is a 4 x (1 - f_l) while in the paper there isn't any 4x

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no please fix!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

might also be worth checking the RRTMGP source but not essential

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where does the SW optical length expression comes from? I can't find it in the paper...

Copy link
Copy Markdown
Member

@navidcy navidcy Dec 13, 2025

Choose a reason for hiding this comment

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

If you look eq. (7) -> (8) seems like a derivative, that is (p/p0)^2 -> 2 (p/p0) Δp/p0

But from (5) -> (6) the terms (p/p0) and (p/p0)^4 didn't become 1 and 4(p/p0)^3 but rather (p/p0) and 4(p/p0)^4.

strange?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok I see it. It is written confusingly. The whole expression is divided by $p$, so you have to notice that because (again confusingly $\sigma = p / p_0$), we get

$$ \frac{f_l \sigma + 4 (1 - f_l) \sigma^4}{p} = \frac{1}{p_0} \left ( f_l + 4 (1 - f_l) \sigma^3 \right ) $$

If i were to write equation 6, I would write it

$$ \tau = \alpha \frac{\Delta p}{p_0} \left [ f_l + 4 (1 - f_l) \left ( \frac{p}{p_0} \right )^3 \right ] \left ( \cdots \right ) $$

alternatively we can define $\Delta \sigma$ and differentiate wrt to $\sigma$ rather than $p$. One of the other.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's rewrite it like this in our docs and just add a note that "this is the same as eq. X in such & such paper"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I thikn that's a good idea. Also maybe there is a better gray optics model we can come up with!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

see #285

Comment thread examples/single_column_radiation.jl Outdated
@giordano giordano added the enhancement ✨ ideas and requests for new features label Dec 15, 2025
@glwagner glwagner changed the title Extension to RRTMGP.jl and implement GrayRadiativeTransferModel Extension to RRTMGP.jl and implement RadiativeTransferModel Dec 15, 2025
@glwagner glwagner merged commit df64adc into main Dec 15, 2025
11 checks passed
@glwagner glwagner deleted the glw/rrtmgp branch December 15, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ ideas and requests for new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants