-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c51fa2
commit ff5598e
Showing
13 changed files
with
167 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
--- | ||
layout: page | ||
title: Explanations | ||
title: RTE+RRTMGP - Explanations | ||
--- | ||
|
||
# Explanations will live here | ||
# RTE and RRTMGP | ||
|
||
### Spectral discretization | ||
RTE+RRTMGP is a set of codes for computing radiative fluxes in planetary atmospheres. These pages provide a orientation to the code's architcture. | ||
|
||
The spectral properties of the atmosphere and the source functions depend on electromagnetic wavelength (or frequency or wavenumber). RTE treats this spectral dependence by dividing the spectrum into one or more _bands_, each of which represents a continuous set of wavelengths/frequencies. Bands may be further sub-divided into _g-points_ (the language is borrowed from _k_-distributions). Each _g_-point is treated as a independent psudo-monchromatic calculation but there is no inherent mapping between _g_-points and wavelengths; the sum over _g_-points is the band-average value. | ||
RTE [computes](/explanations/rte-solvers.html) radiative [_fluxes_](/explanations/rte-fluxes.html) given values of optical properties, source functions, and boundary conditions. | ||
|
||
The bands defined by RRTMGP cover the full spectrum of radiation emitted by the Sun and Earth: these are _broadband_ calculations. In RRTMGP the bands are continuous so that the ending wavelength of one band is the starting wavelength of the next. | ||
RRTMGP computes the optical properties and source functions of the gaseous atmosphere given the distribution of temperature, pressure, and gas concentrations within the atmosphere. | ||
|
||
Each of the italicized phrases above corresponds to a class in the Fortran 2003 interface which bundles some combination of code and data. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
layout: page | ||
title: RTE - fluxes | ||
--- | ||
|
||
RTE solves the radiative transfer equation for each spectral point independently but this detailed information typically isn't useful. Class `ty_fluxes` in module `[mo_fluxes](https://earth-system-radiation.github.io/rte-rrtmgp/reference/rte-fortran-interface/module/mo_fluxes.html)` in the RTE library provides a way to reduce the highly-detailed information based on precisely what the user needs. Class `ty_fluxes_broadband` provides an example implementation that reports broadband flux i.e. the sum over all spectral points at all levels. | ||
|
||
# Fluxes interface | ||
|
||
`[ty_fluxes](https://earth-system-radiation.github.io/rte-rrtmgp/reference/rte-fortran-interface/type/ty_fluxes.html)` is an abstract class that defines [two interfaces](/reference/rte-fortran-interface/type/ty_fluxes.html) defining type-bound functions. Function `reduce` is called within the RTE solvers. The input arguments include the spectrally-resolved fluxes up and down (and, optically, the direct-beam flux) and the spectral discretization. Logical function `are_desired` is called by RTE to check if the results of a calculation will be used. | ||
|
||
Class `ty_fluxes` is abstract; it defines only the interfaces to these routines. Implementation is deferred to user classes that extend this class. | ||
|
||
# Broadband fluxes | ||
|
||
Class `[ty_fluxes_broadband](https://earth-system-radiation.github.io/rte-rrtmgp/reference/rte-fortran-interface/type/ty_fluxes_broadband.html)` in the same [module](/reference/rte-fortran-interface/module/mo_fluxes.html) provides an example of how to extend `ty_fluxes`. This class reports broadband values i.e. the sum over every element in the spectral dimensions. The class contains [four data fields](/reference/rte-fortran-interface/type/ty_fluxes_broadband.html). Before calling one of the RTE solvers with this class as output, users either allocate one or more of these output fields or point to an existing array. The fields must have the same number of columns and layers as the problem being solved. In class `ty_fluxes_broadband` logical function \`are_desired()\`\` returns true if one or more of the data fields points to storage and false otherwise. | ||
|
||
# Other extensions | ||
|
||
Class `ty_fluxes_byband` in subdirectory `extensions/` provides another example that makes use of the spectral discretization information. | ||
|
||
It's useful to extend the class when particular subsets of fluxes, such as photosynthetically-active radiation at the surface, are required. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
layout: page | ||
title: RTE - optical properties | ||
--- | ||
|
||
# Optical properties and spectral discretization | ||
|
||
The spectral properties of the atmosphere and the source functions depend on electromagnetic wavelength (or frequency or wavenumber). RTE treats this spectral dependence by dividing the spectrum into one or more _bands_, each of which represents a continuous set of wavelengths/frequencies/wavenumbers. Bands may be further sub-divided into _g-points_ (the language is borrowed from _k_-distributions). Each _g_-point is treated as a independent psudo-monchromatic calculation but there is no inherent mapping between _g_-points and wavelengths; the sum over _g_-points is the band-average value. | ||
|
||
Bands are defined by their bounds, expressed as wavenumbers in cm$^{-1}$, and by their staring and ending (integer) g-points. A spectral discretization defined only on bands is represented with one _g_-point per band. A set of monochromatic caclulations may be represented by additionally setting the upper and lower wavenumbers for each band to the same value. | ||
|
||
Class `ty_optical_props` implements a range of [procedures](/reference/optical-props-overview.html) for representing and manipulating the spectral discretization. These capabilities are inherited by classes that represent arrays of optical properties (i.e. optical depth) or sources of radiation and by those used to compute optical properties from a physical description of the atmosphere. | ||
|
||
# RRTMGP's spectral discretization | ||
|
||
The bands defined by RRTMGP cover the full spectrum of radiation emitted by the Sun and Earth: these are _broadband_ calculations. In RRTMGP the bands are continuous so that the ending wavelength of one band is the starting wavelength of the next. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
layout: page | ||
title: RTE - solvers | ||
--- | ||
|
||
The `[rte_lw()](/reference/rte-fortran-interface/proc/rte_lw.html)` and `[rte_sw()](/reference/rte-fortran-interface/proc/rte_sw.html)` routines in the RTE library compute radiative transfer on a user-specified problem. Both routines allow for an upper boundary condition for spectrally-resolved diffuse radiation. `rte_sw()` is overloaded to allow users to specify either a single value of `mu0` per column or a value at each layer of each column. | ||
|
||
If optical properties are specified as variables of type ty_optical_props_1scl (meaning extinction optical depth alone) in the longwave, radiative transfer is computed accounting for only emission and absorption. If optical properties are specified as variables of type `ty_optical_props_2str` (optical depth, single-scattering albedo, and asymmetry parameter) the rescaling and refinement method of [Tang et al. 2018](https://doi.org/10.1175/JAS-D-18-0014.1) is used by default; two-stream and adding methods maybe be chosen by setting optional argument `use_2stream` to `.TRUE.` | ||
|
||
The sensitivity of broadband flux (W/m$^2$-K) to changes in surface temperature is available in optional output argument `flux_up_Jac` . Jacobians are not available if `use_2stream` is \`\`.TRUE.\` |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
layout: page | ||
title: Example compiler flags | ||
--- | ||
|
||
Here are sets of compiler flags used to compile and test the code over time. They are provided as a starting point - other configurations may work as well or better. | ||
|
||
In these examples `FC` is the Fortran compilers using flags `FCFLAGS` | ||
|
||
# Gnu Fortran | ||
|
||
(see also the [continuous integration](https://github.com/earth-system-radiation/rte-rrtmgp/blob/main/.github/workflows/continuous-integration.yml)) | ||
`FC`: `gfortran-12` or `gfortran-13` or `gfortran-14` | ||
|
||
## Debugging flags | ||
|
||
`FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -finit-real=nan"` | ||
|
||
## Even stricter debugging flags | ||
|
||
`FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -fbacktrace -finit-real=nan -pedantic -g -Wall"` | ||
|
||
# Intel Fortran Classic | ||
|
||
(see also the [continuous integration](https://github.com/earth-system-radiation/rte-rrtmgp/blob/main/.github/workflows/containerized-ci.yml)) | ||
`FC: ifort` | ||
|
||
## Debugging flags | ||
|
||
`FCFLAGS: "-m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08"` | ||
|
||
## Optimization flags: | ||
|
||
`FCFLAGS:"-m64 -O3 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132"` | ||
|
||
# Intel Fortran | ||
|
||
(LLVM, see also the [continuous integration](https://github.com/earth-system-radiation/rte-rrtmgp/blob/main/.github/workflows/containerized-ci.yml)) | ||
`FC: ifx` | ||
|
||
## Debugging flags | ||
|
||
`FCFLAGS: "-debug -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -stand f08"` | ||
|
||
## Using OpenMP GPU offload | ||
|
||
See [this open issue](https://github.com/earth-system-radiation/rte-rrtmgp/issues/194) | ||
|
||
# NVFortran | ||
|
||
(see also the see also the [continuous integration](https://github.com/earth-system-radiation/rte-rrtmgp/blob/main/.github/workflows/containerized-ci.yml)) | ||
`FC: nvfortran` | ||
|
||
## Debugging flags | ||
|
||
`FCFLAGS: "-g -Minfo -Mbounds -Mchkptr -Mstandard -Kieee -Mchkstk -Mallocatable=03 -Mpreprocess"` | ||
|
||
## Optimization flags: | ||
|
||
`FCFLAGS: "-O3 -fast -Minfo -Mallocatable=03 -Mpreprocess"` | ||
|
||
# HPE CCE for GPU using OpenMP-acc: crayftn -- requires at least CCE 14.0.0 | ||
|
||
`FC: crayftn` | ||
|
||
## Debugging flags (these appear to be insufficient during the link stage) | ||
|
||
`FCFLAGS: "-hnoacc -homp -O0"` |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
layout: page | ||
title: Working with optical properties and spectral discretizations | ||
--- | ||
|
||
This page provides an overview of methods available for working with spectral discretizations as used by the optical properties class and its descendents. Further details are available in the [auto-generated documentation](/reference/rte-fortran-interface/type/ty_optical_props.html). | ||
|
||
Optical properties are defined by their spectral dependence which is described during [initialization](/reference/rte-fortran-interface/type/ty_optical_props.html). | ||
|
||
The spectral dependence can be described via arrays: array `band_lims_wvn` with extents (2, number-of-bands) describes the number of bands beginning and ending wavenumber of each band (in MKS units i.e. inverse meters). Optional argument `band_lims_gpt` describes the beginning and ending g-point of each band; if this array isn't provided it's assumed values are available by band. An optional `name` may be useful in debugging. | ||
|
||
Alternatively variables of type `ty_optical_props` can copy the spectral discretization from a previously-initialized variable e.g. `err_msg = op2%init(op1)`. | ||
|
||
Real-valued functions ``` op%get_band_lims_wavenumber()`` and ```op%get_band_lims_wavelength()\` return arrays of extent (2, number-of-bands) containing the spectral limits of each band expressed in wavelength or wavenumber = 1/wavelength (again in MKS units). | ||
|
||
Procedure `op%is_initialized()` returns a logical value indicating if the spectral discretization has been provided. `op%get_nband()` and `op%get_ngpt()` return the (integer) number of band and g-points; if these numbers are the same the optical properties are defined by band. | ||
|
||
Integer functions `op%convert_band2gpt()` and `op%convert_gpt2band()` provide a map between individual bands and g-points. Function `op%get_gpoint_bands()` returns an integer of length op%get_ngpt() with the band number to which each g-point belongs (i.e. it's the vector version of `op%convert_gpt2band()`). | ||
|
||
Comparison functions `op1%bands_are_equal(op2)` and `op1%gpoints_are_equal(op2)` return logical values indicating whether the tw sets of optical properties share the same band or g-point discretization. |
This file contains 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