Loading repository data…
Loading repository data…
LDEO-CREW / repository
Discrete Ordinates Solver for the (1D) Radiative Transfer Equation in a single or multi-layer plane-parallel atmosphere. Coded entirely in Python 3. Based on Stamnes' FORTRAN DISORT (see references in the Jupyter Notebook) and has its main features.
The PythonicDISORT package is a Discrete Ordinates Solver for the (1D) Radiative Transfer Equation in a plane-parallel, horizontally homogeneous atmosphere. It is coded entirely in Python 3 and is not a wrapper. PythonicDISORT has been optimized for speed and as of v1.8 is one-third the speed of FORTRAN DISORT while being NumPy and Scipy only. PythonicDISORT is intended to be easier to install, use, and modify than FORTRAN-based Discrete Ordinates Solvers.
PythonicDISORT is based on Stamnes' FORTRAN DISORT (see References, in particular [2, 3, 8]), as of v1.8 the only missing features are $\delta$-M+ scaling (PythonicDISORT instead implements NT corrections), the Chapman function for near-horizon solar angles, and pseudo-spherical corrections. On the other hand, we added a subroutine to compute actinic fluxes to satisfy a user request, added analytic integration with respect to optical depth, and improved the handling of singularities. Further feature requests as well as feedback are welcome.
You may contact me, Dion, through dh3065@columbia.edu.
The GitHub repository is https://github.com/LDEO-CREW/Pythonic-DISORT.
Accompanying Journal of Open Source Software paper: https://joss.theoj.org/papers/10.21105/joss.06442. Please cite this paper if you use PythonicDISORT.
https://pythonic-disort.readthedocs.io/en/latest/
Also see the accompanying Jupyter Notebook Pythonic-DISORT.ipynb in the docs directory
of our GitHub repository.
This Jupyter Notebook provides comprehensive documentation, suggested inputs, explanations,
mathematical derivations and verification tests.
It is highly recommended that new users read the non-optional parts of sections 1 and 2.
Not only are there verification tests in Pythonic-DISORT.ipynb,
most of the test problems in Stamnes' disotest.f90 (download DISORT 4.0.99 from http://www.rtatmocn.com/disort/) have also been recreated and enhanced.
In these tests, the solutions from PythonicDISORT are compared against solutions
from a F2PY-wrapped Stamnes' DISORT (version 4.0.99; wrapper inspired by https://github.com/kconnour/pyRT_DISORT). With PyTest installed, execute the console command pytest
in the pydisotest directory to run these tests. The pydisotest directory also contains Jupyter Notebooks to show the implementation of each test.
These notebooks double up as examples of how to use PythonicDISORT. The tests which have been implemented are:
(no corresponding Jupyter Notebook)
pip install PythonicDISORTconda install -c conda-forge pythonicdisort or mamba install -c conda-forge pythonicdisortpip install . in the Pythonic-DISORT directory; pip install -r all_optional_dependencies.txt to install all optional dependencies (see Requirements to run PythonicDISORT)numpy >= 1.8.0scipy >= 1.8.0autograd >= 1.5 (autograd can be used to compute gradients of the output functions)pytest >= 6.2.5 (Required to use the command pytest, see PyTest and examples of how to use PythonicDISORT)jupyter > 1.0.0notebook > 6.5.2matplotlib >= 3.6.0In addition, a F2PY-wrapped Stamnes' DISORT or equivalent (https://github.com/kconnour/pyRT_DISORT may work) is required to properly run the last section (section 6).
The PythonicDISORT package should be system agnostic given its minimal dependencies and pure Python code. Everything in the repository was built and tested on Windows 11.
I acknowledge funding from NSF through the Learning the Earth with Artificial intelligence and Physics (LEAP) Science and Technology Center (STC) (Award #2019625) under which this package was initially created.
S. Chandrasekhar. 1960. Radiative Transfer.
Knut Stamnes and S-Chee Tsay and Warren Wiscombe and Kolf Jayaweera. 1988. Numerically stable algorithm for discrete-ordinate-method radiative transfer in multiple scattering and emitting layered media. http://opg.optica.org/ao/abstract.cfm?URI=ao-27-12-2502.
Stamnes, S.. 1999. LLLab disort website. http://www.rtatmocn.com/disort/.
Knut Stamnes and Paul Conklin. 1984. A new multi-layer discrete ordinate approach to radiative transfer in vertically inhomogeneous atmospheres. https://www.sciencedirect.com/science/article/pii/0022407384900311.
W. J. Wiscombe. 1977. The Delta–M Method: Rapid Yet Accurate Radiative Flux Calculations for Strongly Asymmetric Phase Functions. https://journals.ametsoc.org/view/journals/atsc/34/9/1520-0469_1977_034_1408_tdmrya_2_0_co_2.xml.
J. H. Joseph and W. J. Wiscombe and J. A. Weinman. 1976. The Delta-Eddington Approximation for Radiative Flux Transfer. https://journals.ametsoc.org/view/journals/atsc/33/12/1520-0469_1976_033_2452_tdeafr_2_0_co_2.xml.
Sykes, J. B.. 1951. Approximate Integration of the Equation of Transfer. https://doi.org/10.1093/mnras/111.4.377.
Stamnes, Knut and Tsay, Si-Chee and Wiscombe, Warren and Laszlo, Istvan and Einaudi, Franco. 2000. General Purpose Fortran Program for Discrete-Ordinate-Method Radiative Transfer in Scattering and Emitting Layered Media: An Update of DISORT.
Z. Lin and S. Stamnes and Z. Jin and I. Laszlo and S.-C. Tsay and W.J. Wiscombe and K. Stamnes. 2015. Improved discrete ordinate solutions in the presence of an anisotropically reflecting lower boundary: Upgrades of the DISORT computational tool. https://www.sciencedirect.com/science/article/pii/S0022407315000679.
Trefethen, L. N.. 1996. Finite difference and spectral methods for ordinary and partial differential equations. https://people.maths.ox.ac.uk/trefethen/pdetext.html.
Knut Stamnes. 1982. On the computation of angular distributions of radiation in planetary atmospheres. https://www.sciencedirect.com/science/article/pii/0022407382900966.
T. Nakajima and M. Tanaka. 1988. Algorithms for radiative intensity calculations in moderately thick atmospheres using a truncation approximation. https://www.sciencedirect.com/science/article/pii/0022407388900313.
Connour, Kyle and Wolff, Michael. 2020. pyRT_DISORT: A pre-processing front-end to help make DISORT simulations easier in Python. https://github.com/kconnour/pyRT_DISORT.