-
Notifications
You must be signed in to change notification settings - Fork 8
Extension to RRTMGP.jl and implement RadiativeTransferModel
#176
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
Changes from all commits
7c4c47a
3232955
f5ecb5b
ef1a99a
5cc92b3
95ff722
bd386ed
83aeb6d
9771b81
836340a
34de9ec
c71fbf5
cf7d174
c278eaf
dfbc019
fa3620d
7e36b5d
a4eaae8
24bbae5
618098f
836b392
6731428
655628b
fb9100f
2e83e7d
101b5de
c036fc5
9932746
44c19dc
2f249d0
044900c
ee6946f
432e128
8a67b0d
d49ff68
c36b08f
f8191b4
825c9e5
d7f6894
fdcc688
4cab27d
f20106c
707fe92
5618153
9905e4a
a4d4394
b9f2b9d
e241230
908cc05
f520e02
4c6035d
ad597a1
4b37d96
240b329
24d71dd
f4f3abb
e135f8e
1264428
dfaf629
f23c5b8
d6c154f
79139ad
3cc0bce
dc28ded
adef7c5
01edcb9
6b20e9d
5fc0971
b36f44e
eda8556
1a8d6d5
e9df6ab
3c398f7
c4dd760
da3cbc2
55f1954
e36d898
4e35b8a
29afe67
2c88a0e
8c340b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # Radiative Transfer | ||
|
|
||
| Breeze.jl integrates with [RRTMGP.jl](https://github.com/CliMA/RRTMGP.jl) to provide radiative transfer capabilities for atmospheric simulations. The radiative transfer model computes longwave and shortwave radiative fluxes, which can be incorporated into energy tendency equations. | ||
|
|
||
| ## Gray Atmosphere Radiation | ||
|
|
||
| The simplest radiative transfer option is gray atmosphere radiation, which uses the optical thickness parameterization from [Schneider2004](@citet) and [OGormanSchneider2008](@citet). This approximation treats the atmosphere as having a single effective absorption coefficient rather than computing full spectral radiation. | ||
|
|
||
| ### Basic Usage | ||
|
|
||
| To use gray radiation in a Breeze simulation, create a `GrayRadiativeTransferModel` model and pass it to the [`AtmosphereModel`](@ref) constructor: | ||
|
|
||
| ```@example | ||
| using Breeze | ||
| using Oceananigans.Units | ||
| using Dates | ||
| using RRTMGP.AtmosphericStates: GrayOpticalThicknessOGorman2008 | ||
|
|
||
| Nz = 64 | ||
| λ, φ = -70.9, 42.5 # longitude, latitude | ||
| grid = RectilinearGrid(size=Nz, x=λ, y=φ, z=(0, 20kilometers), | ||
| topology=(Flat, Flat, Bounded)) | ||
|
|
||
| # Thermodynamic setup | ||
| surface_temperature = 300 | ||
| constants = ThermodynamicConstants() | ||
|
|
||
| reference_state = ReferenceState(grid, constants; | ||
| surface_pressure = 101325, | ||
| potential_temperature = surface_temperature) | ||
|
|
||
| formulation = AnelasticFormulation(reference_state, | ||
| thermodynamics = :LiquidIcePotentialTemperature) | ||
|
|
||
| # Create gray radiation model | ||
| optical_thickness = GrayOpticalThicknessOGorman2008(eltype(grid)) | ||
| radiation = RadiativeTransferModel(grid, constants, optical_thickness; | ||
| surface_temperature, | ||
| surface_emissivity = 0.98, | ||
| surface_albedo = 0.1, | ||
| solar_constant = 1361) # W/m² | ||
|
|
||
| # Create atmosphere model with DateTime clock for solar position | ||
| clock = Clock(time=DateTime(2024, 9, 27, 16, 0, 0)) | ||
| model = AtmosphereModel(grid; clock, formulation, radiation) | ||
| ``` | ||
|
|
||
| When a `DateTime` clock is used, the solar zenith angle is computed automatically from the time and grid location (longitude and latitude). | ||
|
|
||
| ### Gray Radiation Model | ||
|
|
||
| The [`RadiativeTransferModel`](@ref) model computes: | ||
|
|
||
| - **Longwave radiation**: Both upwelling and downwelling thermal radiation using RRTMGP's two-stream solver | ||
| - **Shortwave radiation**: Direct beam solar radiation | ||
|
|
||
| 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] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no please fix!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might also be worth checking the RRTMGP source but not essential
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 If i were to write equation 6, I would write it alternatively we can define
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see #285 |
||
| ``` | ||
|
|
||
| where ``φ`` is latitude and ``α``, ``f_l``, ``τ_e``, ``τ_p`` are empirical parameters. | ||
|
|
||
| For shortwave: | ||
| ```math | ||
| τ_{sw} = 2 τ_0 \frac{p}{p_0} \frac{Δp}{p_0} | ||
| ``` | ||
|
|
||
| where ``τ_0 = 0.22`` is the shortwave optical depth parameter. | ||
|
|
||
| ### Radiative Fluxes | ||
|
|
||
| After running [`set!`](@ref), the radiative fluxes are available from the radiation model: | ||
|
|
||
| ```julia | ||
| # Longwave fluxes (ZFaceFields) | ||
| ℐ_lw_up = radiation.upwelling_longwave_flux | ||
| ℐ_lw_dn = radiation.downwelling_longwave_flux | ||
|
|
||
| # Shortwave flux (direct beam only for non-scattering solver) | ||
| ℐ_sw = radiation.downwelling_shortwave_flux | ||
| ``` | ||
|
|
||
| !!! note "Shortwave Radiation" | ||
| The gray atmosphere uses a non-scattering shortwave approximation, so only | ||
| the direct beam flux is computed. There is no diffuse shortwave or upwelling | ||
| shortwave in this model. | ||
|
|
||
| ### Solar Zenith Angle | ||
|
|
||
| When using a `DateTime` clock, the solar zenith angle is computed from: | ||
| - Grid location (longitude from `x`, latitude from `y` for single-column grids) | ||
| - Date and time from `model.clock.time` | ||
|
|
||
| The calculation accounts for: | ||
| - Day of year (for solar declination) | ||
| - Hour angle (based on solar time) | ||
| - Latitude (for observer position) | ||
|
|
||
| ## Surface Properties | ||
|
|
||
| The `RadiativeTransferModel` model requires surface properties: | ||
|
|
||
| | Property | Description | Typical Values | | ||
| |----------|-------------|----------------| | ||
| | `surface_temperature` | Temperature at the surface [K] | 280-310 | | ||
| | `surface_emissivity` | Longwave emissivity (0-1) | 0.95-0.99 | | ||
| | `surface_albedo` | Shortwave albedo (0-1) | 0.1-0.3 | | ||
| | `solar_constant` | TOA solar flux [W/m²] | 1361 | | ||
|
|
||
| ## Integration with dynamics | ||
|
|
||
| Radiative fluxes can be used to compute heating rates for the energy equation. The radiative heating rate is computed from flux divergence: | ||
|
|
||
| ```math | ||
| F_{\mathscr{I}} = -\frac{1}{\rho cᵖᵐ} \frac{\partial \mathscr{I}_{net}}{\partial z} | ||
| ``` | ||
|
|
||
| where ``\mathscr{I}_{net}`` is the net radiative flux (upwelling minus downwelling), ``cᵖᵐ`` is the mixture heat capacity, and ``F_{\mathscr{I}}`` is the radiative flux divergence (heating rate). | ||
|
|
||
| ## Architecture Support | ||
|
|
||
| The radiative transfer implementation supports both CPU and GPU architectures. The column-based RRTMGP solver is called from Oceananigans' field data arrays with appropriate data layout conversions. | ||

Uh oh!
There was an error while loading. Please reload this page.