diff --git a/PyDISORT3/README.md b/PyDISORT3/README.md new file mode 100644 index 0000000..4df8f0c --- /dev/null +++ b/PyDISORT3/README.md @@ -0,0 +1,10 @@ +# PyDISORT3 +Adapt pyDISORT to run the DISORT radiative transfer solver in python version 3.x. + +The pyDISORT wrapper (for python v.2.x) is developed by chanGimeno: https://github.com/chanGimeno/pyDISORT + +The DISORT fortran code was developed by Stamnes et al: +(1) K. Stamnes, SC. Tsay, W. Wiscombe and K. Jayaweera, Numerically + stable algorithm for discrete-ordinate-method radiative + transfer in multiple scattering and emitting layered media, + Appl Opt 27 (1988) (12), pp. 2502–2509. diff --git a/pyDISORT-master/Version b/PyDISORT3/Version similarity index 100% rename from pyDISORT-master/Version rename to PyDISORT3/Version diff --git a/pyDISORT-master/README.md b/PyDISORT3/build/lib/disort/__init__.py similarity index 72% rename from pyDISORT-master/README.md rename to PyDISORT3/build/lib/disort/__init__.py index 7847c7d..d1bf8a2 100644 --- a/pyDISORT-master/README.md +++ b/PyDISORT3/build/lib/disort/__init__.py @@ -1,23 +1,31 @@ -# pyDISORT +#!/usr/bin/env python +""" +Python wrapper to the DISORT library -Python wrapper to the DISORT¹ radiative transfer solver. +Module '_disort' is auto-generated with f2py (version:2). +""" +#from __version__ import __version__ +#from .__version__ import __version__ # DKOLL: ? -(1) K. Stamnes, SC. Tsay, W. Wiscombe and K. Jayaweera, Numerically - stable algorithm for discrete-ordinate-method radiative - transfer in multiple scattering and emitting layered media, - Appl Opt 27 (1988) (12), pp. 2502–2509. - -## Installation +import _disort -Go to the directory where you have checked out the pyDISORT project and run the following command: +########################################################################################################## +# +# functions +# +########################################################################################################## - sudo python setup.py install +def run(dTau, w0=1., iphas=2, gg=0.85, + umu0=1., phi0=0., albedo=0.1, fbeam=1.0, + UsrTau=True, utau=0., UsrAng=True, umu=1., + phi=0., Nstr=32, maxmom=299, lamber=True, + onlyFl=False, accur=0., plank=False, + temp=300., wvnmlo=999., wvnmhi=1000., + ibcnd=0, fisot=0., btemp=300., ttemp=300., + temis=1., prnt=[False]*5, verbose=1): -## Documentation + """ - >>> import disort - >>> help(disort.run) - performs radiative transfer simulations by means of the DISORT RT solver Parameters @@ -139,8 +147,9 @@ (Default: 0.) PRNT : array(dtype=bool) Array of LOGICAL print flags causing the following prints + === =============================================== L quantities printed - -- ------------------ + === =============================================== 1 input variables (except PMOM) 2 fluxes 3 intensities at user levels and angles @@ -149,6 +158,7 @@ 5 phase function moments PMOM for each layer ( only if PRNT(1) = TRUE, and only for layers with scattering ) + === =============================================== (Default: array([False False False False False])) Returns @@ -172,21 +182,39 @@ -------- >>> import disort >>> D_dir, D_diff, U_up, dFdt, I = disort.run(dTau, ssalb, iphas='Rayleigh') - -## Examples + """ -See `test` directory. + import numpy as np -## TODO + if not hasattr(w0,'__iter__'): + w0 = w0 * np.ones_like(dTau) + if not hasattr(iphas,'__iter__'): + iphas = iphas * np.ones_like(dTau) + if not hasattr(gg,'__iter__'): + gg = gg * np.ones_like(dTau) + if not hasattr(temp,'__iter__'): + temp = temp * np.ones(len(dTau)+1) + if not hasattr(utau,'__iter__'): + utau = np.array([utau]) + if not hasattr(umu,'__iter__'): + umu = np.array([umu]) + if not hasattr(phi,'__iter__'): + phi = np.array([phi]) + if not hasattr(prnt,'__iter__'): + prnt = prnt * np.ones(5, dtype='bool') -- The current implementation have the following parameters hardcoded: + if verbose > 0: + print( ' **************************************************************'+\ + '**************************************') + print( ' DISORT: Python wrapper to the DISORT radiative transfer solver') + print( ' **************************************************************'+\ + '**************************************') - - MXCLY = 50 (Max no. of computational layers) - - MXULV = 50 (Max no. of output levels) - - MXCMU = 48 (Max no. of computation polar angles) - - MXUMU = 10 (Max no. of output polar angles) - - MXPHI = 3 (Max no. of output azimuthal angles) - - MXSQT = 1000 (Max no. of square roots of integers (for LEPOLY)) + rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed = \ + _disort.run(dTau, w0, maxmom, temp, iphas, gg, + wvnmlo, wvnmhi, UsrTau, utau, Nstr, + UsrAng, umu, phi, ibcnd, fbeam, + umu0, phi0, fisot, lamber, albedo, btemp, + ttemp, temis, plank, onlyFl, accur, prnt) -- These parameters are used as dimensions for array allocation. Allocation - should be done dynamically + return rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed diff --git a/pyDISORT-master/lib/disort/__init__.py b/PyDISORT3/build/lib/disort/__init__.py~ similarity index 95% rename from pyDISORT-master/lib/disort/__init__.py rename to PyDISORT3/build/lib/disort/__init__.py~ index 309f3d4..f1721e9 100644 --- a/pyDISORT-master/lib/disort/__init__.py +++ b/PyDISORT3/build/lib/disort/__init__.py~ @@ -5,6 +5,7 @@ Module '_disort' is auto-generated with f2py (version:2). """ from __version__ import __version__ +#from .__version__ import __version__ # DKOLL: ? import _disort @@ -203,11 +204,11 @@ def run(dTau, w0=1., iphas=2, gg=0.85, prnt = prnt * np.ones(5, dtype='bool') if verbose > 0: - print ' **************************************************************'+\ - '**************************************' - print ' DISORT: Python wrapper to the DISORT radiative transfer solver' - print ' **************************************************************'+\ - '**************************************' + print( ' **************************************************************'+\ + '**************************************') + print( ' DISORT: Python wrapper to the DISORT radiative transfer solver') + print( ' **************************************************************'+\ + '**************************************') rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed = \ _disort.run(dTau, w0, maxmom, temp, iphas, gg, diff --git a/pyDISORT-master/build/lib/disort/__version__.py b/PyDISORT3/build/lib/disort/__version__.py similarity index 100% rename from pyDISORT-master/build/lib/disort/__version__.py rename to PyDISORT3/build/lib/disort/__version__.py diff --git a/pyDISORT-master/doc/Makefile b/PyDISORT3/doc/Makefile similarity index 100% rename from pyDISORT-master/doc/Makefile rename to PyDISORT3/doc/Makefile diff --git a/pyDISORT-master/doc/README b/PyDISORT3/doc/README similarity index 100% rename from pyDISORT-master/doc/README rename to PyDISORT3/doc/README diff --git a/pyDISORT-master/doc/make.bat b/PyDISORT3/doc/make.bat similarity index 96% rename from pyDISORT-master/doc/make.bat rename to PyDISORT3/doc/make.bat index f75e257..e100b17 100644 --- a/pyDISORT-master/doc/make.bat +++ b/PyDISORT3/doc/make.bat @@ -1,242 +1,242 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source -set I18NSPHINXOPTS=%SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pyDISORT.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pyDISORT.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +set I18NSPHINXOPTS=%SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\pyDISORT.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\pyDISORT.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %BUILDDIR%/.. + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end diff --git a/pyDISORT-master/doc/source/conf.py b/PyDISORT3/doc/source/conf.py similarity index 100% rename from pyDISORT-master/doc/source/conf.py rename to PyDISORT3/doc/source/conf.py diff --git a/pyDISORT-master/doc/source/disort.rst b/PyDISORT3/doc/source/disort.rst similarity index 100% rename from pyDISORT-master/doc/source/disort.rst rename to PyDISORT3/doc/source/disort.rst diff --git a/pyDISORT-master/doc/source/index.rst b/PyDISORT3/doc/source/index.rst similarity index 100% rename from pyDISORT-master/doc/source/index.rst rename to PyDISORT3/doc/source/index.rst diff --git a/pyDISORT-master/build/lib/disort/__init__.py b/PyDISORT3/lib/disort/__init__.py similarity index 95% rename from pyDISORT-master/build/lib/disort/__init__.py rename to PyDISORT3/lib/disort/__init__.py index 309f3d4..f61c2fb 100644 --- a/pyDISORT-master/build/lib/disort/__init__.py +++ b/PyDISORT3/lib/disort/__init__.py @@ -4,7 +4,7 @@ Module '_disort' is auto-generated with f2py (version:2). """ -from __version__ import __version__ +from .__version__ import __version__ import _disort @@ -203,11 +203,11 @@ def run(dTau, w0=1., iphas=2, gg=0.85, prnt = prnt * np.ones(5, dtype='bool') if verbose > 0: - print ' **************************************************************'+\ - '**************************************' - print ' DISORT: Python wrapper to the DISORT radiative transfer solver' - print ' **************************************************************'+\ - '**************************************' + print( ' **************************************************************'+\ + '**************************************') + print( ' DISORT: Python wrapper to the DISORT radiative transfer solver') + print( ' **************************************************************'+\ + '**************************************') rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed = \ _disort.run(dTau, w0, maxmom, temp, iphas, gg, diff --git a/pyDISORT-master/lib/disort/__version__.py b/PyDISORT3/lib/disort/__version__.py similarity index 100% rename from pyDISORT-master/lib/disort/__version__.py rename to PyDISORT3/lib/disort/__version__.py diff --git a/pyDISORT-master/setup.py b/PyDISORT3/setup.py similarity index 87% rename from pyDISORT-master/setup.py rename to PyDISORT3/setup.py index 7a0d136..915cf85 100644 --- a/pyDISORT-master/setup.py +++ b/PyDISORT3/setup.py @@ -3,6 +3,8 @@ # Adapted from setup.py from CliMT project # ------------------------------------------------------ +from __future__ import print_function + import os import sys import glob @@ -17,7 +19,7 @@ while 1: base = os.path.basename(direct) if base=='': - print '*f2py* not found in your python installation' + print( '*f2py* not found in your python installation' ) raise SystemExit(0) direct = os.path.dirname(direct) if base=='lib' or base=='lib64': @@ -40,7 +42,7 @@ if '--fcompiler' in sys.argv[i]: compiler = sys.argv.pop(i) compiler = compiler[compiler.index('=')+1:] -print 'Using %s compiler' % compiler +print( 'Using %s compiler' % compiler ) # set some fortran compiler-dependent flags if compiler == 'gnu95' or compiler == 'gnu': @@ -55,7 +57,7 @@ f77flags='-qautodbl=dbl4 -qsuffix=f=f:cpp=F -qfixed=132' f90flags='-qautodbl=dbl4 -qsuffix=f=f90:cpp=F90 -qfree=f90' else: - print 'Sorry, compiler %s not supported' % compiler + print( 'Sorry, compiler %s not supported' % compiler ) sys.exit() for i in range(len(Extensions)): @@ -68,7 +70,8 @@ if compiler == 'ibm': for ext in Extensions: - ext['cppflags']='-WF,'+string.join(ext['cppflags'].split(),',') + #ext['cppflags']='-WF,'+string.join(ext['cppflags'].split(),',') + ext['cppflags']='-WF,'+','.join(ext['cppflags'].split()) def getSources(dir): # Gets list of source files for extensions @@ -91,7 +94,7 @@ def buildNeeded(target,src): for file in src: if newer(file,target): return True - print 'Extension %s is up to date' % os.path.basename(target) + print( 'Extension %s is up to date' % os.path.basename(target) ) return False def build_ext(name=None, dir=None, cppflags='', f77flags='', f90flags='', @@ -103,14 +106,14 @@ def build_ext(name=None, dir=None, cppflags='', f77flags='', f90flags='', f77flags = '"%s %s"' % (cppflags,f77flags) f90flags = '"%s %s"' % (cppflags,f90flags) if buildNeeded(target,src): - print '\n Building %s ... \n' % os.path.basename(target) + print( '\n Building %s ... \n' % os.path.basename(target) ) # generate signature file #os.system('f2py --overwrite-signature %s -m _%s -h _%s.pyf'%(driver,name,name)) ff = '%s '*len(src) #sformat = '/usr/bin/f2py --overwrite-signature '+ff+' -m _%s -h _%s.pyf' sformat = f2py_bin+' --overwrite-signature '+ff+' -m _%s -h _%s.pyf' args = src + [name,name] - print sformat % tuple(args) + print( sformat % tuple(args) ) os.system(sformat % tuple(args)) # compile extension F2pyCommand = [] @@ -133,11 +136,13 @@ def build_ext(name=None, dir=None, cppflags='', f77flags='', f90flags='', F2pyCommand.append('--f77flags=%s' % f77flags) F2pyCommand.append('--f90flags=%s' % f90flags) F2pyCommand.append('_%s.pyf' % name) - F2pyCommand.append('%s' % string.join(src)) - F2pyCommand = string.join(F2pyCommand) - print F2pyCommand + #F2pyCommand.append('%s' % string.join(src)) + #F2pyCommand = string.join(F2pyCommand) + F2pyCommand.append('%s' % ' '.join(src)) + F2pyCommand = ' '.join(F2pyCommand) + print( "xxx\t", F2pyCommand ) if os.system(F2pyCommand) > 0: - print '+++ Compilation failed' + print( '+++ Compilation failed' ) sys.exit() os.system('mv -f _%s.so lib/disort' % name) # os.system('rm -f _%s.pyf' % name) @@ -155,7 +160,7 @@ def build_ext(name=None, dir=None, cppflags='', f77flags='', f90flags='', for File in glob.glob('test/*.py'): if 'CVS' not in File: DataFiles.append('../'+File) -print DataFiles +print( DataFiles ) os.chdir('..') setup(name = "disort", diff --git a/pyDISORT-master/src/disort/Driver.f b/PyDISORT3/src/disort/Driver.f similarity index 100% rename from pyDISORT-master/src/disort/Driver.f rename to PyDISORT3/src/disort/Driver.f diff --git a/pyDISORT-master/src/disort/src/BDREF.f b/PyDISORT3/src/disort/src/BDREF.f similarity index 100% rename from pyDISORT-master/src/disort/src/BDREF.f rename to PyDISORT3/src/disort/src/BDREF.f diff --git a/pyDISORT-master/src/disort/src/DISORT.f b/PyDISORT3/src/disort/src/DISORT.f similarity index 100% rename from pyDISORT-master/src/disort/src/DISORT.f rename to PyDISORT3/src/disort/src/DISORT.f diff --git a/pyDISORT-master/src/disort/src/ErrPack.f b/PyDISORT3/src/disort/src/ErrPack.f similarity index 100% rename from pyDISORT-master/src/disort/src/ErrPack.f rename to PyDISORT3/src/disort/src/ErrPack.f diff --git a/pyDISORT-master/src/disort/src/GETMOM.f b/PyDISORT3/src/disort/src/GETMOM.f similarity index 100% rename from pyDISORT-master/src/disort/src/GETMOM.f rename to PyDISORT3/src/disort/src/GETMOM.f diff --git a/pyDISORT-master/src/disort/src/LINPAK.f b/PyDISORT3/src/disort/src/LINPAK.f similarity index 100% rename from pyDISORT-master/src/disort/src/LINPAK.f rename to PyDISORT3/src/disort/src/LINPAK.f diff --git a/pyDISORT-master/src/disort/src/PRTFIN.f b/PyDISORT3/src/disort/src/PRTFIN.f similarity index 100% rename from pyDISORT-master/src/disort/src/PRTFIN.f rename to PyDISORT3/src/disort/src/PRTFIN.f diff --git a/pyDISORT-master/src/disort/src/RDI1MACH.f b/PyDISORT3/src/disort/src/RDI1MACH.f similarity index 100% rename from pyDISORT-master/src/disort/src/RDI1MACH.f rename to PyDISORT3/src/disort/src/RDI1MACH.f diff --git a/pyDISORT-master/test/rayleigh_layer_opd.txt b/PyDISORT3/test/rayleigh_layer_opd.txt similarity index 100% rename from pyDISORT-master/test/rayleigh_layer_opd.txt rename to PyDISORT3/test/rayleigh_layer_opd.txt diff --git a/pyDISORT-master/test/test_Rayleigh.py b/PyDISORT3/test/test_Rayleigh.py similarity index 93% rename from pyDISORT-master/test/test_Rayleigh.py rename to PyDISORT3/test/test_Rayleigh.py index d607d85..e229799 100644 --- a/pyDISORT-master/test/test_Rayleigh.py +++ b/PyDISORT3/test/test_Rayleigh.py @@ -40,7 +40,7 @@ utau=uTau, umu=umu, phi=phi, prnt=prnt) rfltot = rfldir + rfldn - print '\n# Energy conservation, R(TOA)+T(BOA)*(1-albedo) ~ 1: %.3f' % (flup[0] + rfltot[-1]*(1.-albedo)) + print( '\n# Energy conservation, R(TOA)+T(BOA)*(1-albedo) ~ 1: %.3f' % (flup[0] + rfltot[-1]*(1.-albedo)) ) plt.figure() plt.plot(rfltot, z_atm) diff --git a/PyDISORT3/test/test_disort.py b/PyDISORT3/test/test_disort.py new file mode 100644 index 0000000..90a74f8 --- /dev/null +++ b/PyDISORT3/test/test_disort.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +""" +Test of the Python wrapper to the DISORT library + +Module '_disort' is auto-generated with f2py (version:2). +""" + +import numpy as np +import disort + +########################################################################################################## + +if __name__ == '__main__': + + uTau = np.array([0.,1.]) + phi = np.array([0.,60.,120.]) + fbeam = 1. + umu0 = 1./np.sqrt(2.) + phi0 = 0.0 + albedo = 0.1 + umu = np.array([-1.,-0.5,0.5,1.]) + + # dTau = np.ones(50)*1./50 + # w0 = np.ones(50)*1. + # iphas = np.ones(50,dtype='int')*2 + # gg = np.ones(50)*0.85 + + # [rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed] =\ + # disort.run(dTau, w0=w0, iphas=iphas, gg=gg, + # umu0=umu0, phi0=phi0, albedo=albedo, fbeam=fbeam, + # utau=uTau, umu=umu, phi=phi) + + # CASE IMPLEMENTED IN run_disort.f + dTau = np.array([0.0, 0.0, 0.0, 1.0, 0.0, 0.0]) + iphas = np.array([2, 2, 2, 3, 2, 2]) + w0 = np.array([0.5, 0.5, 0.5, 0.899999976, 0.5, 0.5]) + N = len(dTau) + gg = np.ones(N)*0.85 + prnt = np.array([True, True, True, False, True]) + + [rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed] =\ + disort.run(dTau, w0=w0, iphas=iphas, gg=gg, + umu0=umu0, phi0=phi0, albedo=albedo, fbeam=fbeam, + utau=uTau, umu=umu, phi=phi, prnt=prnt) + + print( '\n\n' ) + print('########################################### REFERENCE ###############################################') + print('\n\n') + print(' ****************************************************************************************************') + print(' DISORT: Test Case No. 10a: like 9c, USRANG = True ') + print(' ****************************************************************************************************') + print('') + print(' No. streams = 32 No. computational layers = 6') + print(' 2 User optical depths : 0.0000 1.0000') + print(' 4 User polar angle cosines : -1.00000 -0.50000 0.50000 1.00000') + print(' 3 User azimuthal angles : 0.00 60.00 120.00') + print(' No thermal emission') + print(' Boundary condition flag: IBCND = 0') + print(' Incident beam with intensity = 1.000E+00 and polar angle cosine = 0.70711 and azimuth angle = 0.00') + print(' plus isotropic incident intensity = 0.000E+00') + print(' Bottom albedo (Lambertian) = 0.1000') + print(' Uses delta-M method') + print(' Uses TMS/IMS method') + print(' Calculate fluxes and intensities') + print(' Relative convergence criterion for azimuth series = 0.00E+00') + print('') + print(' <------------- Delta-M --------------->') + print(' Total Single Total Single') + print(' Optical Optical Scatter Separated Optical Optical Scatter Asymm') + print(' Depth Depth Albedo Fraction Depth Depth Albedo Factor') + print(' 1 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000') + print(' 2 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000') + print(' 3 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000') + print(' 4 1.0000 1.0000 0.90000 0.00551 0.9950 0.9950 0.89950 0.8500') + print(' 5 0.0000 1.0000 0.50000 0.00000 0.0000 0.9950 0.50000 0.0000') + print(' 6 0.0000 1.0000 0.50000 0.00000 0.0000 0.9950 0.50000 0.0000') + print('') + print(' Number of Phase Function Moments = 33') + print(' Layer Phase Function Moments') + print(' 1 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 2 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 3 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 4 1.000000 0.850000 0.722500 0.614125 0.522006 0.443705 0.377150 0.320577 0.272491 0.231617') + print(' 0.196874 0.167343 0.142242 0.120906 0.102770 0.087354 0.074251 0.063113 0.053646 0.045599') + print(' 0.038760 0.032946 0.028004 0.023803 0.020233 0.017198 0.014618 0.012425 0.010562 0.008977') + print(' 0.007631 0.006486 0.005513') + print(' 5 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 6 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print('\n') + print(' <----------------------- FLUXES ----------------------->') + print(' Optical Compu Downward Downward Downward Upward Mean Planck d(Net Flux)') + print(' Depth Layer Direct Diffuse Total Diffuse Net Intensity Source / d(Op Dep)') + print('') + print(' 0.0000 1 7.071E-01 1.192E-07 7.071E-01 8.424E-02 6.229E-01 9.523E-02 0.000E+00 5.983E-01') + print(' 1.0000 4 1.719E-01 3.888E-01 5.607E-01 5.607E-02 5.046E-01 8.305E-02 0.000E+00 1.044E-01') + print('\n') + print(' ********* I N T E N S I T I E S *********') + print('') + print(' Polar Azimuth angles (degrees)') + print(' Optical Angle') + print(' Depth Cosine') + print('') + print(' 0.00 60.00 120.00') + print(' 0.0000 -1.0000 0.000E+00 0.000E+00 0.000E+00') + print(' -0.5000 0.000E+00 0.000E+00 0.000E+00') + print(' 0.5000 4.465E-02 3.413E-02 2.211E-02') + print(' 1.0000 2.149E-02 2.149E-02 2.149E-02') + print('') + print(' 0.00 60.00 120.00') + print(' 1.0000 -1.0000 4.352E-02 4.352E-02 4.352E-02') + print(' -0.5000 6.599E-01 7.163E-02 2.009E-02') + print(' 0.5000 1.785E-02 1.785E-02 1.785E-02') + print(' 1.0000 1.785E-02 1.785E-02 1.785E-02') diff --git a/PyDISORT3/test_disort.py b/PyDISORT3/test_disort.py new file mode 100644 index 0000000..90a74f8 --- /dev/null +++ b/PyDISORT3/test_disort.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +""" +Test of the Python wrapper to the DISORT library + +Module '_disort' is auto-generated with f2py (version:2). +""" + +import numpy as np +import disort + +########################################################################################################## + +if __name__ == '__main__': + + uTau = np.array([0.,1.]) + phi = np.array([0.,60.,120.]) + fbeam = 1. + umu0 = 1./np.sqrt(2.) + phi0 = 0.0 + albedo = 0.1 + umu = np.array([-1.,-0.5,0.5,1.]) + + # dTau = np.ones(50)*1./50 + # w0 = np.ones(50)*1. + # iphas = np.ones(50,dtype='int')*2 + # gg = np.ones(50)*0.85 + + # [rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed] =\ + # disort.run(dTau, w0=w0, iphas=iphas, gg=gg, + # umu0=umu0, phi0=phi0, albedo=albedo, fbeam=fbeam, + # utau=uTau, umu=umu, phi=phi) + + # CASE IMPLEMENTED IN run_disort.f + dTau = np.array([0.0, 0.0, 0.0, 1.0, 0.0, 0.0]) + iphas = np.array([2, 2, 2, 3, 2, 2]) + w0 = np.array([0.5, 0.5, 0.5, 0.899999976, 0.5, 0.5]) + N = len(dTau) + gg = np.ones(N)*0.85 + prnt = np.array([True, True, True, False, True]) + + [rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed] =\ + disort.run(dTau, w0=w0, iphas=iphas, gg=gg, + umu0=umu0, phi0=phi0, albedo=albedo, fbeam=fbeam, + utau=uTau, umu=umu, phi=phi, prnt=prnt) + + print( '\n\n' ) + print('########################################### REFERENCE ###############################################') + print('\n\n') + print(' ****************************************************************************************************') + print(' DISORT: Test Case No. 10a: like 9c, USRANG = True ') + print(' ****************************************************************************************************') + print('') + print(' No. streams = 32 No. computational layers = 6') + print(' 2 User optical depths : 0.0000 1.0000') + print(' 4 User polar angle cosines : -1.00000 -0.50000 0.50000 1.00000') + print(' 3 User azimuthal angles : 0.00 60.00 120.00') + print(' No thermal emission') + print(' Boundary condition flag: IBCND = 0') + print(' Incident beam with intensity = 1.000E+00 and polar angle cosine = 0.70711 and azimuth angle = 0.00') + print(' plus isotropic incident intensity = 0.000E+00') + print(' Bottom albedo (Lambertian) = 0.1000') + print(' Uses delta-M method') + print(' Uses TMS/IMS method') + print(' Calculate fluxes and intensities') + print(' Relative convergence criterion for azimuth series = 0.00E+00') + print('') + print(' <------------- Delta-M --------------->') + print(' Total Single Total Single') + print(' Optical Optical Scatter Separated Optical Optical Scatter Asymm') + print(' Depth Depth Albedo Fraction Depth Depth Albedo Factor') + print(' 1 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000') + print(' 2 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000') + print(' 3 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000') + print(' 4 1.0000 1.0000 0.90000 0.00551 0.9950 0.9950 0.89950 0.8500') + print(' 5 0.0000 1.0000 0.50000 0.00000 0.0000 0.9950 0.50000 0.0000') + print(' 6 0.0000 1.0000 0.50000 0.00000 0.0000 0.9950 0.50000 0.0000') + print('') + print(' Number of Phase Function Moments = 33') + print(' Layer Phase Function Moments') + print(' 1 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 2 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 3 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 4 1.000000 0.850000 0.722500 0.614125 0.522006 0.443705 0.377150 0.320577 0.272491 0.231617') + print(' 0.196874 0.167343 0.142242 0.120906 0.102770 0.087354 0.074251 0.063113 0.053646 0.045599') + print(' 0.038760 0.032946 0.028004 0.023803 0.020233 0.017198 0.014618 0.012425 0.010562 0.008977') + print(' 0.007631 0.006486 0.005513') + print(' 5 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print(' 6 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000') + print(' 0.000000 0.000000 0.000000') + print('\n') + print(' <----------------------- FLUXES ----------------------->') + print(' Optical Compu Downward Downward Downward Upward Mean Planck d(Net Flux)') + print(' Depth Layer Direct Diffuse Total Diffuse Net Intensity Source / d(Op Dep)') + print('') + print(' 0.0000 1 7.071E-01 1.192E-07 7.071E-01 8.424E-02 6.229E-01 9.523E-02 0.000E+00 5.983E-01') + print(' 1.0000 4 1.719E-01 3.888E-01 5.607E-01 5.607E-02 5.046E-01 8.305E-02 0.000E+00 1.044E-01') + print('\n') + print(' ********* I N T E N S I T I E S *********') + print('') + print(' Polar Azimuth angles (degrees)') + print(' Optical Angle') + print(' Depth Cosine') + print('') + print(' 0.00 60.00 120.00') + print(' 0.0000 -1.0000 0.000E+00 0.000E+00 0.000E+00') + print(' -0.5000 0.000E+00 0.000E+00 0.000E+00') + print(' 0.5000 4.465E-02 3.413E-02 2.211E-02') + print(' 1.0000 2.149E-02 2.149E-02 2.149E-02') + print('') + print(' 0.00 60.00 120.00') + print(' 1.0000 -1.0000 4.352E-02 4.352E-02 4.352E-02') + print(' -0.5000 6.599E-01 7.163E-02 2.009E-02') + print(' 0.5000 1.785E-02 1.785E-02 1.785E-02') + print(' 1.0000 1.785E-02 1.785E-02 1.785E-02') diff --git a/README.md b/README.md index 07b3474..b1d1e4f 100644 --- a/README.md +++ b/README.md @@ -14,48 +14,60 @@ References: (3) Stamnes et al, 1988, Applied Optics. # Installation -1) Download to your own computer. +1) Download to your own computer, or upload to your Linux server. -2) Manually compile the MTCKD model: -- cd $PyRADS/DATA/MT_CKD_continuum/cntnm.H2O_N2/build +2) Install the required libraries using conda: + ++ cd $PyRADS-shortwave ++ conda create -n pyrads python=3.7 ++ conda activate pyrads ++ conda install scipy ++ conda install matplotlib + +3) Manually compile the MTCKD model: +- cd $PyRADS-shortwave/DATA/MT_CKD_continuum/cntnm.H2O_N2/build - (on a Mac) make -f make_cntnm osxGNUdbl - (on a Mac if you are using gfortran installed with conda) make -f make_cntnm osxGNUCONDAdbl +- (on Linux) open the file "README.build_instructions" and find the command for your platform. For example, if you are using gfortran, + - make -f make_cntnm linuxGNUdbl + - After compiling, you will find a database named with "cntnm_v3.2_linux_gnu_dbl" in PyRADS-shortwave/DATA/MT_CKD_continuum/cntnm.H2O_N2 + - find "Absorption_Continuum_MTCKD.py" in PyRADS-shortwave/pyrads. Change paths in line 27 - line 31. 3) Manually install the pyDISORT wrapper, which solves the radiative transfer equations with scattering (=in the shortwave). - Steps marked with (x) use conda to create a separate environment, and are optional. - -- (x) conda create --clone base --name base_w_pyDISORT -- (x) source activate base_w_pyDISORT -- cd $PyRADS/pyDISORT-master + +- cd $PyRADS-shortwave/PyDISORT3 - python setup.py install To test whether pyDISORT was successfully installed: -- cd $PyRADS/pyDISORT-master/test +- cd $PyRADS-shortwave/PyDISORT3 - python test_disort.py -- python test_Rayleigh.py If the installation failed, the test scripts will return "ImportError: No module named disort". If the installation worked, the test scripts will print a large slew of output. If using a separate conda environment, later remember to load that environment with 'source activate' before running pyDISORT or importing pyRADS. +- find "Get_Fluxes_pyDISORT.py" in PyRADS-shortwave/pyrads. Add two sentences before you import disort at line 4 +- import sys,os +- sys.path.append("../PyDISORT3") + 4) Run test scripts To compute outgoing longwave radiation (OLR) in W/m2 for a given surface temperature: -- cd $PyRADS/Test01.olr +- cd $PyRADS-shortwave/Test01.olr - python compute_olr_h2o.py To compute OLRs for a set of surface temperatures and save the resulting output to txt: -- cd $PyRADS/Test02.runaway +- cd $PyRADS-shortwave/Test02.runaway - python compute_olr_h2o.01.100RH.py To compute SW fluxes in W/m2 for a given surface temperature (here, 300 K) over a *limited* part of the solar spectrum (here, 1000-2000 cm-1) at some resolution (here, 1 cm-1; see note below) and save the resulting output to txt file in the same directory ("."): -- cd $PyRADS/Test03.sw +- cd $PyRADS-shortwave/Test03.sw - python compute_sw_h2o.py 1000. 2000. 1. 300. . To stitch together the SW fluxes across the entire solar spectrum (takes a while even at low spectral res; see note below): -- cd $PyRADS/Test04.sw_full_spectrum +- cd $PyRADS-shortwave/Test04.sw_full_spectrum - python compute_sw_h2o.py 1000. 10000. 1. 300. . - python compute_sw_h2o.py 10000. 20000. 1. 300. . - python compute_sw_h2o.py 20000. 30000. 1. 300. . @@ -70,11 +82,12 @@ NOTE: resolution in test scripts was chosen for relative speed, not accuracy. Fo # Requirements -Python 2 or 3 with numpy and scipy. +Python 3.7 with numpy and scipy. For the MTCKD continuum model: gmake and gfortran. For the pyDISORT radiation solver: see https://github.com/chanGimeno/pyDISORT. +For the Python 3 version of pyDISORT: see https://github.com/danielkoll/PyDISORT3 # Acknowledgements PyRADS makes use of HITRAN 2016 line lists (http://hitran.org/), AER's MTCKD continuum model (http://rtweb.aer.com/continuum_frame.html), and the PyTran script published by Ray Pierrehumbert as part of the courseware for "Principles of Planetary Climates" (https://geosci.uchicago.edu/~rtp1/PrinciplesPlanetaryClimate/). Brian Rose (http://www.atmos.albany.edu/facstaff/brose/) has helped improve the code. The SW version of PyRADS uses DISORT, developed by Stamnes et al, and the pyDISORT wrapper, developed by chanGimeno (https://github.com/chanGimeno/pyDISORT). diff --git a/pyDISORT-master/_disort.pyf b/pyDISORT-master/_disort.pyf deleted file mode 100644 index 52024f3..0000000 --- a/pyDISORT-master/_disort.pyf +++ /dev/null @@ -1,1016 +0,0 @@ -! -*- f90 -*- -! Note: the context of this file is case sensitive. - -python module _disort ! in - interface ! in :_disort - subroutine errmsg(messag,fatal) ! in :_disort:src/disort/src/ErrPack.f - character*(*) :: messag - logical :: fatal - end subroutine errmsg - function wrtbad(varnam) ! in :_disort:src/disort/src/ErrPack.f - character*(*) :: varnam - logical :: wrtbad - end function wrtbad - function wrtdim(dimnam,minval) ! in :_disort:src/disort/src/ErrPack.f - character*(*) :: dimnam - integer :: minval - logical :: wrtdim - end function wrtdim - function tstbad(varnam,relerr) ! in :_disort:src/disort/src/ErrPack.f - character*(*) :: varnam - real :: relerr - logical :: tstbad - end function tstbad - subroutine getmom(iphas,gg,nmom,pmom) ! in :_disort:src/disort/src/GETMOM.f - integer :: iphas - real :: gg - integer, optional,check((len(pmom)-1)>=nmom),depend(pmom) :: nmom=(len(pmom)-1) - real dimension(nmom + 1) :: pmom - end subroutine getmom - function bdref(wvnmlo,wvnmhi,mu,mup,dphi) ! in :_disort:src/disort/src/BDREF.f - real :: wvnmlo - real :: wvnmhi - real :: mu - real :: mup - real :: dphi - real :: bdref - end function bdref - subroutine prtfin(utau,ntau,umu,numu,phi,nphi,maxulv,maxumu,onlyfl,rfldir,rfldn,flup,dfdt,uu,tstfir,tstfdn,tstfup,tstdfd,tstuu,maxtau,maxmu,maxaz) ! in :_disort:src/disort/src/PRTFIN.f - real dimension(*) :: utau - integer :: ntau - real dimension(*) :: umu - integer :: numu - real dimension(*) :: phi - integer :: nphi - integer, optional,check(shape(uu,1)==maxulv),depend(uu) :: maxulv=shape(uu,1) - integer, optional,check(shape(uu,0)==maxumu),depend(uu) :: maxumu=shape(uu,0) - logical :: onlyfl - real dimension(*) :: rfldir - real dimension(*) :: rfldn - real dimension(*) :: flup - real dimension(*) :: dfdt - real dimension(maxumu,maxulv,*) :: uu - real dimension(*) :: tstfir - real dimension(*) :: tstfdn - real dimension(*) :: tstfup - real dimension(*) :: tstdfd - real dimension(maxtau,maxmu,maxaz) :: tstuu - integer, optional,check(shape(tstuu,0)==maxtau),depend(tstuu) :: maxtau=shape(tstuu,0) - integer, optional,check(shape(tstuu,1)==maxmu),depend(tstuu) :: maxmu=shape(tstuu,1) - integer, optional,check(shape(tstuu,2)==maxaz),depend(tstuu) :: maxaz=shape(tstuu,2) - end subroutine prtfin - subroutine disort(nlyr,dtauc,ssalb,nmom,pmom,temper,wvnmlo,wvnmhi,usrtau,ntau,utau,nstr,usrang,numu,umu,nphi,phi,ibcnd,fbeam,umu0,phi0,fisot,lamber,albedo,btemp,ttemp,temis,plank,onlyfl,accur,prnt,header,maxcly,maxulv,maxumu,maxphi,maxmom,rfldir,rfldn,flup,dfdt,uavg,uu,albmed,trnmed) ! in :_disort:src/disort/src/DISORT.f - integer :: nlyr - real dimension(maxcly) :: dtauc - real dimension(maxcly),depend(maxcly) :: ssalb - integer :: nmom - real dimension(maxmom + 1,maxcly),depend(maxcly) :: pmom - real dimension(maxcly + 1),depend(maxcly) :: temper - real :: wvnmlo - real :: wvnmhi - logical :: usrtau - integer :: ntau - real dimension(maxulv) :: utau - integer :: nstr - logical :: usrang - integer :: numu - real dimension(maxumu) :: umu - integer :: nphi - real dimension(maxphi) :: phi - integer :: ibcnd - real :: fbeam - real :: umu0 - real :: phi0 - real :: fisot - logical :: lamber - real :: albedo - real :: btemp - real :: ttemp - real :: temis - logical :: plank - logical :: onlyfl - real :: accur - logical dimension(5) :: prnt - character*127 :: header - integer, optional,check(len(dtauc)>=maxcly),depend(dtauc) :: maxcly=len(dtauc) - integer, optional,check(len(utau)>=maxulv),depend(utau) :: maxulv=len(utau) - integer, optional,check(len(umu)>=maxumu),depend(umu) :: maxumu=len(umu) - integer, optional,check(len(phi)>=maxphi),depend(phi) :: maxphi=len(phi) - integer, optional,check((shape(pmom,0)-1)==maxmom),depend(pmom) :: maxmom=(shape(pmom,0)-1) - real dimension(maxulv),depend(maxulv) :: rfldir - real dimension(maxulv),depend(maxulv) :: rfldn - real dimension(maxulv),depend(maxulv) :: flup - real dimension(maxulv),depend(maxulv) :: dfdt - real dimension(maxulv),depend(maxulv) :: uavg - real dimension(maxumu,maxulv,maxphi),depend(maxumu,maxulv,maxphi) :: uu - real dimension(maxumu),depend(maxumu) :: albmed - real dimension(maxumu),depend(maxumu) :: trnmed - end subroutine disort - subroutine asymtx(aa,evec,eval,m,ia,ievec,ier,wkd,aad,evecd,evald) ! in :_disort:src/disort/src/DISORT.f - real dimension(ia,m) :: aa - real dimension(ievec,m),depend(m) :: evec - real dimension(m),depend(m) :: eval - integer, optional,check(shape(aa,1)==m),depend(aa) :: m=shape(aa,1) - integer, optional,check(shape(aa,0)==ia),depend(aa) :: ia=shape(aa,0) - integer, optional,check(shape(evec,0)==ievec),depend(evec) :: ievec=shape(evec,0) - integer :: ier - double precision dimension(*) :: wkd - double precision dimension(ia,m),depend(ia,m) :: aad - double precision dimension(ia,m),depend(ia,m) :: evecd - double precision dimension(m),depend(m) :: evald - end subroutine asymtx - subroutine cmpint(fbeam,gc,kk,layru,ll,lyrcut,mazim,mxcmu,mxulv,mxumu,ncut,nn,nstr,plank,ntau,taucpr,umu0,utaupr,zz,zplk0,zplk1,uum) ! in :_disort:src/disort/src/DISORT.f - real :: fbeam - real dimension(mxcmu,mxcmu,*) :: gc - real dimension(mxcmu,*),depend(mxcmu) :: kk - integer dimension(*) :: layru - real dimension(mxcmu,*),depend(mxcmu) :: ll - logical :: lyrcut - integer :: mazim - integer, optional,check(shape(gc,0)==mxcmu),depend(gc) :: mxcmu=shape(gc,0) - integer, optional,check(len(utaupr)>=mxulv),depend(utaupr) :: mxulv=len(utaupr) - integer, optional,check(shape(uum,0)==mxumu),depend(uum) :: mxumu=shape(uum,0) - integer :: ncut - integer :: nn - integer :: nstr - logical :: plank - integer :: ntau - real dimension(*) :: taucpr - real :: umu0 - real dimension(mxulv) :: utaupr - real dimension(mxcmu,*),depend(mxcmu) :: zz - real dimension(mxcmu,*),depend(mxcmu) :: zplk0 - real dimension(mxcmu,*),depend(mxcmu) :: zplk1 - real dimension(mxumu,mxulv),depend(mxulv) :: uum - end subroutine cmpint - subroutine fluxes(cmu,cwt,fbeam,gc,kk,layru,ll,lyrcut,maxulv,mxcmu,mxulv,ncut,nn,nstr,ntau,pi,prnt,prntu0,ssalb,taucpr,umu0,utau,utaupr,xr0,xr1,zz,zplk0,zplk1,dfdt,flup,fldn,fldir,rfldir,rfldn,uavg,u0c) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real :: fbeam - real dimension(mxcmu,mxcmu,*),depend(mxcmu,mxcmu) :: gc - real dimension(mxcmu,*),depend(mxcmu) :: kk - integer dimension(mxulv) :: layru - real dimension(mxcmu,*),depend(mxcmu) :: ll - logical :: lyrcut - integer, optional,check(len(utau)>=maxulv),depend(utau) :: maxulv=len(utau) - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer, optional,check(len(layru)>=mxulv),depend(layru) :: mxulv=len(layru) - integer :: ncut - integer :: nn - integer :: nstr - integer :: ntau - real :: pi - logical dimension(*) :: prnt - logical :: prntu0 - real dimension(*) :: ssalb - real dimension(*) :: taucpr - real :: umu0 - real dimension(maxulv) :: utau - real dimension(mxulv),depend(mxulv) :: utaupr - real dimension(*) :: xr0 - real dimension(*) :: xr1 - real dimension(mxcmu,*),depend(mxcmu) :: zz - real dimension(mxcmu,*),depend(mxcmu) :: zplk0 - real dimension(mxcmu,*),depend(mxcmu) :: zplk1 - real dimension(maxulv),depend(maxulv) :: dfdt - real dimension(maxulv),depend(maxulv) :: flup - real dimension(mxulv),depend(mxulv) :: fldn - real dimension(mxulv),depend(mxulv) :: fldir - real dimension(maxulv),depend(maxulv) :: rfldir - real dimension(maxulv),depend(maxulv) :: rfldn - real dimension(maxulv),depend(maxulv) :: uavg - real dimension(mxcmu,mxulv),depend(mxcmu,mxulv) :: u0c - end subroutine fluxes - subroutine intcor(dither,fbeam,flyr,layru,lyrcut,maxmom,maxulv,maxumu,nmom,ncut,nphi,nstr,ntau,numu,oprim,phasa,phast,phasm,phirad,pi,rpd,pmom,ssalb,dtauc,tauc,taucpr,umu,umu0,utau,utaupr,uu) ! in :_disort:src/disort/src/DISORT.f - real :: dither - real :: fbeam - real dimension(*) :: flyr - integer dimension(*) :: layru - logical :: lyrcut - integer, optional,check((shape(pmom,0)-1)==maxmom),depend(pmom) :: maxmom=(shape(pmom,0)-1) - integer, optional,check(shape(uu,1)==maxulv),depend(uu) :: maxulv=shape(uu,1) - integer, optional,check(shape(uu,0)==maxumu),depend(uu) :: maxumu=shape(uu,0) - integer :: nmom - integer :: ncut - integer :: nphi - integer :: nstr - integer :: ntau - integer :: numu - real dimension(*) :: oprim - real dimension(*) :: phasa - real dimension(*) :: phast - real dimension(*) :: phasm - real dimension(*) :: phirad - real :: pi - real :: rpd - real dimension(maxmom + 1,*) :: pmom - real dimension(*) :: ssalb - real dimension(*) :: dtauc - real dimension(*) :: tauc - real dimension(*) :: taucpr - real dimension(*) :: umu - real :: umu0 - real dimension(*) :: utau - real dimension(*) :: utaupr - real dimension(maxumu,maxulv,*) :: uu - end subroutine intcor - function secsca(ctheta,flyr,layru,maxmom,nmom,nstr,pmom,ssalb,dtauc,tauc,umu,umu0,utau,fbeam,pi) ! in :_disort:src/disort/src/DISORT.f - real :: ctheta - real dimension(*) :: flyr - integer :: layru - integer, optional,check((shape(pmom,0)-1)==maxmom),depend(pmom) :: maxmom=(shape(pmom,0)-1) - integer :: nmom - integer :: nstr - real dimension(maxmom + 1,*) :: pmom - real dimension(*) :: ssalb - real dimension(*) :: dtauc - real dimension(*) :: tauc - real :: umu - real :: umu0 - real :: utau - real :: fbeam - real :: pi - real :: secsca - end function secsca - subroutine setdis(cmu,cwt,deltam,dtauc,dtaucp,expbea,fbeam,flyr,gl,ibcnd,layru,lyrcut,maxmom,maxumu,mxcmu,ncut,nlyr,ntau,nn,nstr,plank,numu,onlyfl,corint,oprim,pmom,ssalb,tauc,taucpr,utau,utaupr,umu,umu0,usrtau,usrang) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - logical :: deltam - real dimension(*) :: dtauc - real dimension(*) :: dtaucp - real dimension(*) :: expbea - real :: fbeam - real dimension(*) :: flyr - real dimension(mxcmu + 1,*),depend(mxcmu) :: gl - integer :: ibcnd - integer dimension(*) :: layru - logical :: lyrcut - integer, optional,check((shape(pmom,0)-1)==maxmom),depend(pmom) :: maxmom=(shape(pmom,0)-1) - integer, optional,check(len(umu)>=maxumu),depend(umu) :: maxumu=len(umu) - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer :: ncut - integer :: nlyr - integer :: ntau - integer :: nn - integer :: nstr - logical :: plank - integer :: numu - logical :: onlyfl - logical :: corint - real dimension(*) :: oprim - real dimension(maxmom + 1,*) :: pmom - real dimension(*) :: ssalb - real dimension(*) :: tauc - real dimension(*) :: taucpr - real dimension(*) :: utau - real dimension(*) :: utaupr - real dimension(maxumu) :: umu - real :: umu0 - logical :: usrtau - logical :: usrang - end subroutine setdis - subroutine setmtx(bdr,cband,cmu,cwt,delm0,dtaucp,gc,kk,lamber,lyrcut,mi,mi9m2,mxcmu,ncol,ncut,nnlyri,nn,nstr,taucpr,wk) ! in :_disort:src/disort/src/DISORT.f - real dimension(mi,mi + 1) :: bdr - real dimension(mi9m2,nnlyri) :: cband - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real :: delm0 - real dimension(*) :: dtaucp - real dimension(mxcmu,mxcmu,*),depend(mxcmu,mxcmu) :: gc - real dimension(mxcmu,*),depend(mxcmu) :: kk - logical :: lamber - logical :: lyrcut - integer, optional,check(shape(bdr,0)==mi),depend(bdr) :: mi=shape(bdr,0) - integer, optional,check(shape(cband,0)==mi9m2),depend(cband) :: mi9m2=shape(cband,0) - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer :: ncol - integer :: ncut - integer, optional,check(shape(cband,1)==nnlyri),depend(cband) :: nnlyri=shape(cband,1) - integer :: nn - integer :: nstr - real dimension(*) :: taucpr - real dimension(mxcmu),depend(mxcmu) :: wk - end subroutine setmtx - function sinsca(dither,layru,nlyr,phase,omega,tau,umu,umu0,utau,fbeam,pi) ! in :_disort:src/disort/src/DISORT.f - real :: dither - integer :: layru - integer :: nlyr - real dimension(*) :: phase - real dimension(*) :: omega - real dimension(*) :: tau - real :: umu - real :: umu0 - real :: utau - real :: fbeam - real :: pi - real :: sinsca - end function sinsca - subroutine soleig(amb,apb,array,cmu,cwt,gl,mi,mazim,mxcmu,nn,nstr,ylmc,cc,evecc,eval,kk,gc,aad,eveccd,evald,wkd) ! in :_disort:src/disort/src/DISORT.f - real dimension(mi,mi) :: amb - real dimension(mi,mi),depend(mi,mi) :: apb - real dimension(mi,*),depend(mi) :: array - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real dimension(mxcmu + 1),depend(mxcmu) :: gl - integer, optional,check(shape(amb,0)==mi),depend(amb) :: mi=shape(amb,0) - integer :: mazim - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer :: nn - integer :: nstr - real dimension(mxcmu + 1,mxcmu),depend(mxcmu,mxcmu) :: ylmc - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: cc - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: evecc - real dimension(mi),depend(mi) :: eval - real dimension(mxcmu),depend(mxcmu) :: kk - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: gc - double precision dimension(mi,mi),depend(mi,mi) :: aad - double precision dimension(mi,mi),depend(mi,mi) :: eveccd - double precision dimension(mi),depend(mi) :: evald - double precision dimension(mxcmu),depend(mxcmu) :: wkd - end subroutine soleig - subroutine solve0(b,bdr,bem,bplank,cband,cmu,cwt,expbea,fbeam,fisot,ipvt,lamber,ll,lyrcut,mazim,mi,mi9m2,mxcmu,ncol,ncut,nn,nstr,nnlyri,pi,tplank,taucpr,umu0,z,zz,zplk0,zplk1) ! in :_disort:src/disort/src/DISORT.f - real dimension(nnlyri) :: b - real dimension(mi,mi + 1) :: bdr - real dimension(mi),depend(mi) :: bem - real :: bplank - real dimension(mi9m2,nnlyri),depend(nnlyri) :: cband - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real dimension(*) :: expbea - real :: fbeam - real :: fisot - integer dimension(*) :: ipvt - logical :: lamber - real dimension(mxcmu,*),depend(mxcmu) :: ll - logical :: lyrcut - integer :: mazim - integer, optional,check(shape(bdr,0)==mi),depend(bdr) :: mi=shape(bdr,0) - integer, optional,check(shape(cband,0)==mi9m2),depend(cband) :: mi9m2=shape(cband,0) - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer :: ncol - integer :: ncut - integer :: nn - integer :: nstr - integer, optional,check(len(b)>=nnlyri),depend(b) :: nnlyri=len(b) - real :: pi - real :: tplank - real dimension(*) :: taucpr - real :: umu0 - real dimension(nnlyri),depend(nnlyri) :: z - real dimension(mxcmu,*),depend(mxcmu) :: zz - real dimension(mxcmu,*),depend(mxcmu) :: zplk0 - real dimension(mxcmu,*),depend(mxcmu) :: zplk1 - end subroutine solve0 - subroutine surfac(albedo,delm0,cmu,fbeam,lamber,mi,mazim,mxumu,nn,numu,onlyfl,pi,umu,umu0,usrang,wvnmlo,wvnmhi,bdr,emu,bem,rmu) ! in :_disort:src/disort/src/DISORT.f - real :: albedo - real :: delm0 - real dimension(*) :: cmu - real :: fbeam - logical :: lamber - integer, optional,check(shape(bdr,0)==mi),depend(bdr) :: mi=shape(bdr,0) - integer :: mazim - integer, optional,check(len(emu)>=mxumu),depend(emu) :: mxumu=len(emu) - integer :: nn - integer :: numu - logical :: onlyfl - real :: pi - real dimension(*) :: umu - real :: umu0 - logical :: usrang - real :: wvnmlo - real :: wvnmhi - real dimension(mi,mi + 1) :: bdr - real dimension(mxumu) :: emu - real dimension(mi),depend(mi) :: bem - real dimension(mxumu,mi + 1),depend(mxumu,mi) :: rmu - end subroutine surfac - subroutine terpev(cwt,evecc,gl,gu,mazim,mxcmu,mxumu,nn,nstr,numu,wk,ylmc,ylmu) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu) :: cwt - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: evecc - real dimension(mxcmu + 1),depend(mxcmu) :: gl - real dimension(mxumu,mxcmu),depend(mxcmu) :: gu - integer :: mazim - integer, optional,check(len(cwt)>=mxcmu),depend(cwt) :: mxcmu=len(cwt) - integer, optional,check(shape(gu,0)==mxumu),depend(gu) :: mxumu=shape(gu,0) - integer :: nn - integer :: nstr - integer :: numu - real dimension(mxcmu),depend(mxcmu) :: wk - real dimension(mxcmu + 1,mxcmu),depend(mxcmu,mxcmu) :: ylmc - real dimension(mxcmu + 1,mxumu),depend(mxcmu,mxumu) :: ylmu - end subroutine terpev - subroutine terpso(cwt,delm0,fbeam,gl,mazim,mxcmu,plank,numu,nstr,oprim,pi,ylm0,ylmc,ylmu,psi0,psi1,xr0,xr1,z0,z1,zj,zbeam,z0u,z1u) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu) :: cwt - real :: delm0 - real :: fbeam - real dimension(mxcmu + 1),depend(mxcmu) :: gl - integer :: mazim - integer, optional,check(len(cwt)>=mxcmu),depend(cwt) :: mxcmu=len(cwt) - logical :: plank - integer :: numu - integer :: nstr - real :: oprim - real :: pi - real dimension(mxcmu + 1),depend(mxcmu) :: ylm0 - real dimension(mxcmu + 1,mxcmu),depend(mxcmu,mxcmu) :: ylmc - real dimension(mxcmu + 1,*),depend(mxcmu) :: ylmu - real dimension(mxcmu),depend(mxcmu) :: psi0 - real dimension(mxcmu),depend(mxcmu) :: psi1 - real :: xr0 - real :: xr1 - real dimension(mxcmu),depend(mxcmu) :: z0 - real dimension(mxcmu),depend(mxcmu) :: z1 - real dimension(mxcmu),depend(mxcmu) :: zj - real dimension(*) :: zbeam - real dimension(*) :: z0u - real dimension(*) :: z1u - end subroutine terpso - subroutine upbeam(array,cc,cmu,delm0,fbeam,gl,ipvt,mazim,mxcmu,nn,nstr,pi,umu0,wk,ylm0,ylmc,zj,zz) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu,mxcmu) :: array - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: cc - real dimension(mxcmu),depend(mxcmu) :: cmu - real :: delm0 - real :: fbeam - real dimension(mxcmu + 1),depend(mxcmu) :: gl - integer dimension(*) :: ipvt - integer :: mazim - integer, optional,check(shape(array,0)==mxcmu),depend(array) :: mxcmu=shape(array,0) - integer :: nn - integer :: nstr - real :: pi - real :: umu0 - real dimension(mxcmu),depend(mxcmu) :: wk - real dimension(mxcmu + 1),depend(mxcmu) :: ylm0 - real dimension(mxcmu + 1,*),depend(mxcmu) :: ylmc - real dimension(mxcmu),depend(mxcmu) :: zj - real dimension(mxcmu),depend(mxcmu) :: zz - end subroutine upbeam - subroutine upisot(array,cc,cmu,ipvt,mxcmu,nn,nstr,oprim,wk,xr0,xr1,z0,z1,zplk0,zplk1) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu,mxcmu) :: array - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: cc - real dimension(mxcmu),depend(mxcmu) :: cmu - integer dimension(*) :: ipvt - integer, optional,check(shape(array,0)==mxcmu),depend(array) :: mxcmu=shape(array,0) - integer :: nn - integer :: nstr - real :: oprim - real dimension(mxcmu),depend(mxcmu) :: wk - real :: xr0 - real :: xr1 - real dimension(mxcmu),depend(mxcmu) :: z0 - real dimension(mxcmu),depend(mxcmu) :: z1 - real dimension(mxcmu),depend(mxcmu) :: zplk0 - real dimension(mxcmu),depend(mxcmu) :: zplk1 - end subroutine upisot - subroutine usrint(bplank,cmu,cwt,delm0,dtaucp,emu,expbea,fbeam,fisot,gc,gu,kk,lamber,layru,ll,lyrcut,mazim,mxcmu,mxulv,mxumu,ncut,nlyr,nn,nstr,plank,numu,ntau,pi,rmu,taucpr,tplank,umu,umu0,utaupr,wk,zbeam,z0u,z1u,zz,zplk0,zplk1,uum) ! in :_disort:src/disort/src/DISORT.f - real :: bplank - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real :: delm0 - real dimension(*) :: dtaucp - real dimension(mxumu) :: emu - real dimension(*) :: expbea - real :: fbeam - real :: fisot - real dimension(mxcmu,mxcmu,*),depend(mxcmu,mxcmu) :: gc - real dimension(mxumu,mxcmu,*),depend(mxumu,mxcmu) :: gu - real dimension(mxcmu,*),depend(mxcmu) :: kk - logical :: lamber - integer dimension(*) :: layru - real dimension(mxcmu,*),depend(mxcmu) :: ll - logical :: lyrcut - integer :: mazim - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer, optional,check(len(utaupr)>=mxulv),depend(utaupr) :: mxulv=len(utaupr) - integer, optional,check(len(emu)>=mxumu),depend(emu) :: mxumu=len(emu) - integer :: ncut - integer :: nlyr - integer :: nn - integer :: nstr - logical :: plank - integer :: numu - integer :: ntau - real :: pi - real dimension(mxumu,*),depend(mxumu) :: rmu - real dimension(*) :: taucpr - real :: tplank - real dimension(*) :: umu - real :: umu0 - real dimension(mxulv) :: utaupr - real dimension(mxcmu),depend(mxcmu) :: wk - real dimension(mxumu,*),depend(mxumu) :: zbeam - real dimension(mxumu,*),depend(mxumu) :: z0u - real dimension(mxumu,*),depend(mxumu) :: z1u - real dimension(mxcmu,*),depend(mxcmu) :: zz - real dimension(mxcmu,*),depend(mxcmu) :: zplk0 - real dimension(mxcmu,*),depend(mxcmu) :: zplk1 - real dimension(mxumu,mxulv),depend(mxumu,mxulv) :: uum - end subroutine usrint - function xifunc(umu1,umu2,umu3,tau) ! in :_disort:src/disort/src/DISORT.f - real :: umu1 - real :: umu2 - real :: umu3 - real :: tau - real :: xifunc - end function xifunc - subroutine chekin(nlyr,dtauc,ssalb,nmom,pmom,temper,wvnmlo,wvnmhi,usrtau,ntau,utau,nstr,usrang,numu,umu,nphi,phi,ibcnd,fbeam,umu0,phi0,fisot,lamber,albedo,btemp,ttemp,temis,plank,onlyfl,deltam,corint,accur,tauc,maxcly,maxulv,maxumu,maxphi,maxmom,mxcly,mxulv,mxumu,mxcmu,mxphi,mxsqt) ! in :_disort:src/disort/src/DISORT.f - integer :: nlyr - real dimension(maxcly) :: dtauc - real dimension(maxcly),depend(maxcly) :: ssalb - integer :: nmom - real dimension(maxmom + 1,maxcly),depend(maxcly) :: pmom - real dimension(maxcly + 1),depend(maxcly) :: temper - real :: wvnmlo - real :: wvnmhi - logical :: usrtau - integer :: ntau - real dimension(maxulv) :: utau - integer :: nstr - logical :: usrang - integer :: numu - real dimension(maxumu) :: umu - integer :: nphi - real dimension(maxphi) :: phi - integer :: ibcnd - real :: fbeam - real :: umu0 - real :: phi0 - real :: fisot - logical :: lamber - real :: albedo - real :: btemp - real :: ttemp - real :: temis - logical :: plank - logical :: onlyfl - logical :: deltam - logical :: corint - real :: accur - real dimension(mxcly + 1) :: tauc - integer, optional,check(len(dtauc)>=maxcly),depend(dtauc) :: maxcly=len(dtauc) - integer, optional,check(len(utau)>=maxulv),depend(utau) :: maxulv=len(utau) - integer, optional,check(len(umu)>=maxumu),depend(umu) :: maxumu=len(umu) - integer, optional,check(len(phi)>=maxphi),depend(phi) :: maxphi=len(phi) - integer, optional,check((shape(pmom,0)-1)==maxmom),depend(pmom) :: maxmom=(shape(pmom,0)-1) - integer, optional,check((len(tauc)-1)>=mxcly),depend(tauc) :: mxcly=(len(tauc)-1) - integer :: mxulv - integer :: mxumu - integer :: mxcmu - integer :: mxphi - integer :: mxsqt - end subroutine chekin - function dref(wvnmlo,wvnmhi,mu) ! in :_disort:src/disort/src/DISORT.f - real :: wvnmlo - real :: wvnmhi - real :: mu - real :: dref - end function dref - subroutine lepoly(nmu,m,maxmu,twonm1,mu,sqt,ylm) ! in :_disort:src/disort/src/DISORT.f - integer :: nmu - integer :: m - integer, optional,check((shape(ylm,0)-1)==maxmu),depend(ylm) :: maxmu=(shape(ylm,0)-1) - integer :: twonm1 - real dimension(*) :: mu - real dimension(*) :: sqt - real dimension(maxmu + 1,*) :: ylm - end subroutine lepoly - function plkavg(wnumlo,wnumhi,t) ! in :_disort:src/disort/src/DISORT.f - real :: wnumlo - real :: wnumhi - real :: t - real :: plkavg - end function plkavg - subroutine pravin(umu,numu,mxumu,utau,ntau,u0u) ! in :_disort:src/disort/src/DISORT.f - real dimension(numu) :: umu - integer, optional,check(len(umu)>=numu),depend(umu) :: numu=len(umu) - integer, optional,check(shape(u0u,0)==mxumu),depend(u0u) :: mxumu=shape(u0u,0) - real dimension(ntau) :: utau - integer, optional,check(len(utau)>=ntau),depend(utau) :: ntau=len(utau) - real dimension(mxumu,*) :: u0u - end subroutine pravin - subroutine prtinp(nlyr,dtauc,dtaucp,ssalb,nmom,pmom,temper,wvnmlo,wvnmhi,ntau,utau,nstr,numu,umu,nphi,phi,ibcnd,fbeam,umu0,phi0,fisot,lamber,albedo,btemp,ttemp,temis,deltam,plank,onlyfl,corint,accur,flyr,lyrcut,oprim,tauc,taucpr,maxmom,prtmom) ! in :_disort:src/disort/src/DISORT.f - integer :: nlyr - real dimension(*) :: dtauc - real dimension(*) :: dtaucp - real dimension(*) :: ssalb - integer :: nmom - real dimension(maxmom + 1,*) :: pmom - real dimension(*) :: temper - real :: wvnmlo - real :: wvnmhi - integer :: ntau - real dimension(*) :: utau - integer :: nstr - integer :: numu - real dimension(*) :: umu - integer :: nphi - real dimension(*) :: phi - integer :: ibcnd - real :: fbeam - real :: umu0 - real :: phi0 - real :: fisot - logical :: lamber - real :: albedo - real :: btemp - real :: ttemp - real :: temis - logical :: deltam - logical :: plank - logical :: onlyfl - logical :: corint - real :: accur - real dimension(*) :: flyr - logical :: lyrcut - real dimension(*) :: oprim - real dimension(*) :: tauc - real dimension(*) :: taucpr - integer, optional,check((shape(pmom,0)-1)==maxmom),depend(pmom) :: maxmom=(shape(pmom,0)-1) - logical :: prtmom - end subroutine prtinp - subroutine prtint(uu,utau,ntau,umu,numu,phi,nphi,maxulv,maxumu) ! in :_disort:src/disort/src/DISORT.f - real dimension(maxumu,maxulv,*) :: uu - real dimension(*) :: utau - integer :: ntau - real dimension(*) :: umu - integer :: numu - real dimension(*) :: phi - integer :: nphi - integer, optional,check(shape(uu,1)==maxulv),depend(uu) :: maxulv=shape(uu,1) - integer, optional,check(shape(uu,0)==maxumu),depend(uu) :: maxumu=shape(uu,0) - end subroutine prtint - subroutine qgausn(m,gmu,gwt) ! in :_disort:src/disort/src/DISORT.f - integer, optional,check(len(gmu)>=m),depend(gmu) :: m=len(gmu) - real dimension(m) :: gmu - real dimension(m),depend(m) :: gwt - end subroutine qgausn - function ratio(a,b) ! in :_disort:src/disort/src/DISORT.f - real :: a - real :: b - real :: ratio - end function ratio - subroutine slftst(corint,accur,albedo,btemp,deltam,dtauc,fbeam,fisot,ibcnd,lamber,nlyr,plank,nphi,numu,nstr,ntau,onlyfl,phi,phi0,nmom,pmom,prnt,prntu0,ssalb,temis,temper,ttemp,umu,usrang,usrtau,utau,umu0,wvnmhi,wvnmlo,compar,flup,rfldir,rfldn,uu) ! in :_disort:src/disort/src/DISORT.f - logical :: corint - real :: accur - real :: albedo - real :: btemp - logical :: deltam - real :: dtauc - real :: fbeam - real :: fisot - integer :: ibcnd - logical :: lamber - integer :: nlyr - logical :: plank - integer :: nphi - integer :: numu - integer :: nstr - integer :: ntau - logical :: onlyfl - real :: phi - real :: phi0 - integer :: nmom - real dimension(*) :: pmom - logical dimension(*) :: prnt - logical dimension(*) :: prntu0 - real :: ssalb - real :: temis - real dimension(*) :: temper - real :: ttemp - real :: umu - logical :: usrang - logical :: usrtau - real :: utau - real :: umu0 - real :: wvnmhi - real :: wvnmlo - logical :: compar - real :: flup - real :: rfldir - real :: rfldn - real :: uu - end subroutine slftst - subroutine zeroal(nd1,expbea,flyr,oprim,phasa,phast,phasm,taucpr,xr0,xr1,nd2,cmu,cwt,psi0,psi1,wk,z0,z1,zj,nd3,ylm0,nd4,array,cc,evecc,nd5,gl,nd6,ylmc,nd7,ylmu,nd8,kk,ll,zz,zplk0,zplk1,nd9,gc,nd10,layru,utaupr,nd11,gu,nd12,z0u,z1u,zbeam,nd13,eval,nd14,amb,apb,nd15,ipvt,z,nd16,rfldir,rfldn,flup,uavg,dfdt,nd17,albmed,trnmed,nd18,u0u,nd19,uu) ! in :_disort:src/disort/src/DISORT.f - integer :: nd1 - real dimension(*) :: expbea - real dimension(*) :: flyr - real dimension(*) :: oprim - real dimension(*) :: phasa - real dimension(*) :: phast - real dimension(*) :: phasm - real dimension(*) :: taucpr - real dimension(*) :: xr0 - real dimension(*) :: xr1 - integer :: nd2 - real dimension(*) :: cmu - real dimension(*) :: cwt - real dimension(*) :: psi0 - real dimension(*) :: psi1 - real dimension(*) :: wk - real dimension(*) :: z0 - real dimension(*) :: z1 - real dimension(*) :: zj - integer :: nd3 - real dimension(*) :: ylm0 - integer :: nd4 - real dimension(*) :: array - real dimension(*) :: cc - real dimension(*) :: evecc - integer :: nd5 - real dimension(*) :: gl - integer :: nd6 - real dimension(*) :: ylmc - integer :: nd7 - real dimension(*) :: ylmu - integer :: nd8 - real dimension(*) :: kk - real dimension(*) :: ll - real dimension(*) :: zz - real dimension(*) :: zplk0 - real dimension(*) :: zplk1 - integer :: nd9 - real dimension(*) :: gc - integer :: nd10 - integer dimension(*) :: layru - real dimension(*) :: utaupr - integer :: nd11 - real dimension(*) :: gu - integer :: nd12 - real dimension(*) :: z0u - real dimension(*) :: z1u - real dimension(*) :: zbeam - integer :: nd13 - real dimension(*) :: eval - integer :: nd14 - real dimension(*) :: amb - real dimension(*) :: apb - integer :: nd15 - integer dimension(*) :: ipvt - real dimension(*) :: z - integer :: nd16 - real dimension(*) :: rfldir - real dimension(*) :: rfldn - real dimension(*) :: flup - real dimension(*) :: uavg - real dimension(*) :: dfdt - integer :: nd17 - real dimension(*) :: albmed - real dimension(*) :: trnmed - integer :: nd18 - real dimension(*) :: u0u - integer :: nd19 - real dimension(*) :: uu - end subroutine zeroal - subroutine zeroit(a,length) ! in :_disort:src/disort/src/DISORT.f - real dimension(length) :: a - integer, optional,check(len(a)>=length),depend(a) :: length=len(a) - end subroutine zeroit - subroutine albtrn(albedo,amb,apb,array,b,bdr,cband,cc,cmu,cwt,dtaucp,eval,evecc,gl,gc,gu,ipvt,kk,ll,nlyr,nn,nstr,numu,prnt,taucpr,umu,u0u,wk,ylmc,ylmu,z,aad,evald,eveccd,wkd,mi,mi9m2,maxumu,mxcmu,mxumu,nnlyri,sqt,albmed,trnmed) ! in :_disort:src/disort/src/DISORT.f - real :: albedo - real dimension(mi,mi) :: amb - real dimension(mi,mi),depend(mi,mi) :: apb - real dimension(mxcmu,mxcmu) :: array - real dimension(nnlyri) :: b - real dimension(mi,mi + 1),depend(mi,mi) :: bdr - real dimension(mi9m2,nnlyri),depend(nnlyri) :: cband - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: cc - real dimension(mxcmu),depend(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real dimension(*) :: dtaucp - real dimension(mi),depend(mi) :: eval - real dimension(mxcmu,mxcmu),depend(mxcmu,mxcmu) :: evecc - real dimension(mxcmu + 1,*),depend(mxcmu) :: gl - real dimension(mxcmu,mxcmu,*),depend(mxcmu,mxcmu) :: gc - real dimension(mxumu,mxcmu,*),depend(mxcmu) :: gu - integer dimension(*) :: ipvt - real dimension(mxcmu,*),depend(mxcmu) :: kk - real dimension(mxcmu,*),depend(mxcmu) :: ll - integer :: nlyr - integer :: nn - integer :: nstr - integer :: numu - logical dimension(*) :: prnt - real dimension(*) :: taucpr - real dimension(maxumu) :: umu - real dimension(mxumu,*),depend(mxumu) :: u0u - real dimension(mxcmu),depend(mxcmu) :: wk - real dimension(mxcmu + 1,mxcmu),depend(mxcmu,mxcmu) :: ylmc - real dimension(mxcmu + 1,*),depend(mxcmu) :: ylmu - real dimension(nnlyri),depend(nnlyri) :: z - double precision dimension(mi,mi),depend(mi,mi) :: aad - double precision dimension(mi),depend(mi) :: evald - double precision dimension(mi,mi),depend(mi,mi) :: eveccd - double precision dimension(mxcmu),depend(mxcmu) :: wkd - integer, optional,check(shape(amb,0)==mi),depend(amb) :: mi=shape(amb,0) - integer, optional,check(shape(cband,0)==mi9m2),depend(cband) :: mi9m2=shape(cband,0) - integer, optional,check(len(umu)>=maxumu),depend(umu) :: maxumu=len(umu) - integer, optional,check(shape(array,0)==mxcmu),depend(array) :: mxcmu=shape(array,0) - integer, optional,check(shape(gu,0)==mxumu),depend(gu) :: mxumu=shape(gu,0) - integer, optional,check(len(b)>=nnlyri),depend(b) :: nnlyri=len(b) - real dimension(*) :: sqt - real dimension(maxumu),depend(maxumu) :: albmed - real dimension(maxumu),depend(maxumu) :: trnmed - end subroutine albtrn - subroutine altrin(gu,kk,ll,mxcmu,mxumu,maxumu,nlyr,nn,nstr,numu,taucpr,umu,u0u,wk) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxumu,mxcmu,*) :: gu - real dimension(mxcmu,*),depend(mxcmu) :: kk - real dimension(mxcmu,*),depend(mxcmu) :: ll - integer, optional,check(shape(gu,1)==mxcmu),depend(gu) :: mxcmu=shape(gu,1) - integer, optional,check(shape(gu,0)==mxumu),depend(gu) :: mxumu=shape(gu,0) - integer, optional,check(len(umu)>=maxumu),depend(umu) :: maxumu=len(umu) - integer :: nlyr - integer :: nn - integer :: nstr - integer :: numu - real dimension(*) :: taucpr - real dimension(maxumu) :: umu - real dimension(mxumu,*),depend(mxumu) :: u0u - real dimension(mxcmu),depend(mxcmu) :: wk - end subroutine altrin - subroutine praltr(umu,numu,albmed,trnmed) ! in :_disort:src/disort/src/DISORT.f - real dimension(numu) :: umu - integer, optional,check(len(umu)>=numu),depend(umu) :: numu=len(umu) - real dimension(numu),depend(numu) :: albmed - real dimension(numu),depend(numu) :: trnmed - end subroutine praltr - subroutine solve1(b,cband,fisot,ihom,ipvt,ll,mi9m2,mxcmu,ncol,ncut,nn,nnlyri,nstr) ! in :_disort:src/disort/src/DISORT.f - real dimension(nnlyri) :: b - real dimension(mi9m2,nnlyri),depend(nnlyri) :: cband - real :: fisot - integer :: ihom - integer dimension(nnlyri),depend(nnlyri) :: ipvt - real dimension(mxcmu,*) :: ll - integer, optional,check(shape(cband,0)==mi9m2),depend(cband) :: mi9m2=shape(cband,0) - integer, optional,check(shape(ll,0)==mxcmu),depend(ll) :: mxcmu=shape(ll,0) - integer :: ncol - integer :: ncut - integer :: nn - integer, optional,check(len(b)>=nnlyri),depend(b) :: nnlyri=len(b) - integer :: nstr - end subroutine solve1 - subroutine spaltr(cmu,cwt,gc,kk,ll,mxcmu,nlyr,nn,nstr,taucpr,sflup,sfldn) ! in :_disort:src/disort/src/DISORT.f - real dimension(mxcmu) :: cmu - real dimension(mxcmu),depend(mxcmu) :: cwt - real dimension(mxcmu,mxcmu,*),depend(mxcmu,mxcmu) :: gc - real dimension(mxcmu,*),depend(mxcmu) :: kk - real dimension(mxcmu,*),depend(mxcmu) :: ll - integer, optional,check(len(cmu)>=mxcmu),depend(cmu) :: mxcmu=len(cmu) - integer :: nlyr - integer :: nn - integer :: nstr - real dimension(*) :: taucpr - real :: sflup - real :: sfldn - end subroutine spaltr - function r1mach(i) ! in :_disort:src/disort/src/RDI1MACH.f - integer :: i - real :: r1mach - end function r1mach - function d1mach(i) ! in :_disort:src/disort/src/RDI1MACH.f - integer :: i - double precision :: d1mach - end function d1mach - function i1mach(i) ! in :_disort:src/disort/src/RDI1MACH.f - integer :: i - integer :: i1mach - end function i1mach - subroutine sgbco(abd,lda,n,ml,mu,ipvt,rcond,z) ! in :_disort:src/disort/src/LINPAK.f - real dimension(lda,*) :: abd - integer, optional,check(shape(abd,0)==lda),depend(abd) :: lda=shape(abd,0) - integer :: n - integer :: ml - integer :: mu - integer dimension(*) :: ipvt - real :: rcond - real dimension(*) :: z - end subroutine sgbco - subroutine sgbfa(abd,lda,n,ml,mu,ipvt,info) ! in :_disort:src/disort/src/LINPAK.f - real dimension(lda,*) :: abd - integer, optional,check(shape(abd,0)==lda),depend(abd) :: lda=shape(abd,0) - integer :: n - integer :: ml - integer :: mu - integer dimension(*) :: ipvt - integer :: info - end subroutine sgbfa - subroutine sgbsl(abd,lda,n,ml,mu,ipvt,b,job) ! in :_disort:src/disort/src/LINPAK.f - real dimension(lda,*) :: abd - integer, optional,check(shape(abd,0)==lda),depend(abd) :: lda=shape(abd,0) - integer :: n - integer :: ml - integer :: mu - integer dimension(*) :: ipvt - real dimension(*) :: b - integer :: job - end subroutine sgbsl - subroutine sgeco(a,lda,n,ipvt,rcond,z) ! in :_disort:src/disort/src/LINPAK.f - real dimension(lda,*) :: a - integer, optional,check(shape(a,0)==lda),depend(a) :: lda=shape(a,0) - integer :: n - integer dimension(*) :: ipvt - real :: rcond - real dimension(*) :: z - end subroutine sgeco - subroutine sgefa(a,lda,n,ipvt,info) ! in :_disort:src/disort/src/LINPAK.f - real dimension(lda,*) :: a - integer, optional,check(shape(a,0)==lda),depend(a) :: lda=shape(a,0) - integer :: n - integer dimension(*) :: ipvt - integer :: info - end subroutine sgefa - subroutine sgesl(a,lda,n,ipvt,b,job) ! in :_disort:src/disort/src/LINPAK.f - real dimension(lda,*) :: a - integer, optional,check(shape(a,0)==lda),depend(a) :: lda=shape(a,0) - integer :: n - integer dimension(*) :: ipvt - real dimension(*) :: b - integer :: job - end subroutine sgesl - function sasum(n,sx,incx) ! in :_disort:src/disort/src/LINPAK.f - integer :: n - real dimension(*) :: sx - integer :: incx - real :: sasum - end function sasum - subroutine saxpy(n,sa,sx,incx,sy,incy) ! in :_disort:src/disort/src/LINPAK.f - integer :: n - real :: sa - real dimension(*) :: sx - integer :: incx - real dimension(*) :: sy - integer :: incy - end subroutine saxpy - function sdot(n,sx,incx,sy,incy) ! in :_disort:src/disort/src/LINPAK.f - integer :: n - real dimension(*) :: sx - integer :: incx - real dimension(*) :: sy - integer :: incy - real :: sdot - end function sdot - subroutine sscal(n,sa,sx,incx) ! in :_disort:src/disort/src/LINPAK.f - integer :: n - real :: sa - real dimension(*) :: sx - integer :: incx - end subroutine sscal - subroutine sswap(n,sx,incx,sy,incy) ! in :_disort:src/disort/src/LINPAK.f - integer :: n - real dimension(*) :: sx - integer :: incx - real dimension(*) :: sy - integer :: incy - end subroutine sswap - function isamax(n,sx,incx) ! in :_disort:src/disort/src/LINPAK.f - integer :: n - real dimension(*) :: sx - integer :: incx - integer :: isamax - end function isamax - subroutine run(maxcly,dtauc,ssalb,maxmom,temper,iphas,gg,wvnmlo,wvnmhi,usrtau,maxulv,utau,nstr,usrang,maxumu,umu,maxphi,phi,ibcnd,fbeam,umu0,phi0,fisot,lamber,albedo,btemp,ttemp,temis,plank,onlyfl,accur,prnt,rfldir,rfldn,flup,dfdt,uavg,uu,albmed,trnmed) ! in :_disort:src/disort/Driver.f - integer, optional,intent(hide),check(len(dtauc)>=maxcly),depend(dtauc) :: maxcly=len(dtauc) - real dimension(maxcly),intent(in) :: dtauc - real dimension(maxcly),intent(in),depend(maxcly) :: ssalb - integer intent(in) :: maxmom - real dimension(maxcly + 1),intent(in),depend(maxcly) :: temper - integer dimension(maxcly),intent(in),depend(maxcly) :: iphas - real dimension(maxcly),intent(in),depend(maxcly) :: gg - real intent(in) :: wvnmlo - real intent(in) :: wvnmhi - logical intent(in) :: usrtau - integer, optional,intent(hide),check(len(utau)>=maxulv),depend(utau) :: maxulv=len(utau) - real dimension(maxulv),intent(in) :: utau - integer intent(in) :: nstr - logical intent(in) :: usrang - integer, optional,intent(hide),check(len(umu)>=maxumu),depend(umu) :: maxumu=len(umu) - real dimension(maxumu),intent(in) :: umu - integer, optional,intent(hide),check(len(phi)>=maxphi),depend(phi) :: maxphi=len(phi) - real dimension(maxphi),intent(in) :: phi - integer intent(in) :: ibcnd - real intent(in) :: fbeam - real intent(in) :: umu0 - real intent(in) :: phi0 - real intent(in) :: fisot - logical intent(in) :: lamber - real intent(in) :: albedo - real intent(in) :: btemp - real intent(in) :: ttemp - real intent(in) :: temis - logical intent(in) :: plank - logical intent(in) :: onlyfl - real intent(in) :: accur - logical dimension(5),intent(in) :: prnt - real dimension(maxulv),intent(out),depend(maxulv) :: rfldir - real dimension(maxulv),intent(out),depend(maxulv) :: rfldn - real dimension(maxulv),intent(out),depend(maxulv) :: flup - real dimension(maxulv),intent(out),depend(maxulv) :: dfdt - real dimension(maxulv),intent(out),depend(maxulv) :: uavg - real dimension(maxumu,maxulv,maxphi),intent(out),depend(maxumu,maxulv,maxphi) :: uu - real dimension(maxumu),intent(out),depend(maxumu) :: albmed - real dimension(maxumu),intent(out),depend(maxumu) :: trnmed - end subroutine run - end interface -end python module _disort - -! This file was auto-generated with f2py (version:2). -! See http://cens.ioc.ee/projects/f2py2e/ diff --git a/pyDISORT-master/_disort.so.dSYM/Contents/Info.plist b/pyDISORT-master/_disort.so.dSYM/Contents/Info.plist deleted file mode 100644 index 7aac456..0000000 --- a/pyDISORT-master/_disort.so.dSYM/Contents/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIdentifier - com.apple.xcode.dsym._disort.so - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - dSYM - CFBundleSignature - ???? - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/pyDISORT-master/_disort.so.dSYM/Contents/Resources/DWARF/_disort.so b/pyDISORT-master/_disort.so.dSYM/Contents/Resources/DWARF/_disort.so deleted file mode 100644 index e604184..0000000 Binary files a/pyDISORT-master/_disort.so.dSYM/Contents/Resources/DWARF/_disort.so and /dev/null differ diff --git a/pyDISORT-master/build/lib/disort/_disort.so b/pyDISORT-master/build/lib/disort/_disort.so deleted file mode 100644 index f351491..0000000 Binary files a/pyDISORT-master/build/lib/disort/_disort.so and /dev/null differ diff --git a/pyDISORT-master/lib/disort/_disort.so b/pyDISORT-master/lib/disort/_disort.so deleted file mode 100644 index f351491..0000000 Binary files a/pyDISORT-master/lib/disort/_disort.so and /dev/null differ diff --git a/pyDISORT-master/test/test_disort.py b/pyDISORT-master/test/test_disort.py deleted file mode 100644 index dbd3c09..0000000 --- a/pyDISORT-master/test/test_disort.py +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env python -""" -Test of the Python wrapper to the DISORT library - -Module '_disort' is auto-generated with f2py (version:2). -""" - -import numpy as np -import disort - -########################################################################################################## - -if __name__ == '__main__': - - uTau = np.array([0.,1.]) - phi = np.array([0.,60.,120.]) - fbeam = 1. - umu0 = 1./np.sqrt(2.) - phi0 = 0.0 - albedo = 0.1 - umu = np.array([-1.,-0.5,0.5,1.]) - - # dTau = np.ones(50)*1./50 - # w0 = np.ones(50)*1. - # iphas = np.ones(50,dtype='int')*2 - # gg = np.ones(50)*0.85 - - # [rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed] =\ - # disort.run(dTau, w0=w0, iphas=iphas, gg=gg, - # umu0=umu0, phi0=phi0, albedo=albedo, fbeam=fbeam, - # utau=uTau, umu=umu, phi=phi) - - # CASE IMPLEMENTED IN run_disort.f - dTau = np.array([0.0, 0.0, 0.0, 1.0, 0.0, 0.0]) - iphas = np.array([2, 2, 2, 3, 2, 2]) - w0 = np.array([0.5, 0.5, 0.5, 0.899999976, 0.5, 0.5]) - N = len(dTau) - gg = np.ones(N)*0.85 - prnt = np.array([True, True, True, False, True]) - - [rfldir, rfldn, flup, dfdt, uavg, uu, albmed, trnmed] =\ - disort.run(dTau, w0=w0, iphas=iphas, gg=gg, - umu0=umu0, phi0=phi0, albedo=albedo, fbeam=fbeam, - utau=uTau, umu=umu, phi=phi, prnt=prnt) - - print '\n\n' - print '########################################### REFERENCE ###############################################' - print '\n\n' - print ' ****************************************************************************************************' - print ' DISORT: Test Case No. 10a: like 9c, USRANG = True ' - print ' ****************************************************************************************************' - print '' - print ' No. streams = 32 No. computational layers = 6' - print ' 2 User optical depths : 0.0000 1.0000' - print ' 4 User polar angle cosines : -1.00000 -0.50000 0.50000 1.00000' - print ' 3 User azimuthal angles : 0.00 60.00 120.00' - print ' No thermal emission' - print ' Boundary condition flag: IBCND = 0' - print ' Incident beam with intensity = 1.000E+00 and polar angle cosine = 0.70711 and azimuth angle = 0.00' - print ' plus isotropic incident intensity = 0.000E+00' - print ' Bottom albedo (Lambertian) = 0.1000' - print ' Uses delta-M method' - print ' Uses TMS/IMS method' - print ' Calculate fluxes and intensities' - print ' Relative convergence criterion for azimuth series = 0.00E+00' - print '' - print ' <------------- Delta-M --------------->' - print ' Total Single Total Single' - print ' Optical Optical Scatter Separated Optical Optical Scatter Asymm' - print ' Depth Depth Albedo Fraction Depth Depth Albedo Factor' - print ' 1 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000' - print ' 2 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000' - print ' 3 0.0000 0.0000 0.50000 0.00000 0.0000 0.0000 0.50000 0.0000' - print ' 4 1.0000 1.0000 0.90000 0.00551 0.9950 0.9950 0.89950 0.8500' - print ' 5 0.0000 1.0000 0.50000 0.00000 0.0000 0.9950 0.50000 0.0000' - print ' 6 0.0000 1.0000 0.50000 0.00000 0.0000 0.9950 0.50000 0.0000' - print '' - print ' Number of Phase Function Moments = 33' - print ' Layer Phase Function Moments' - print ' 1 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000' - print ' 2 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000' - print ' 3 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000' - print ' 4 1.000000 0.850000 0.722500 0.614125 0.522006 0.443705 0.377150 0.320577 0.272491 0.231617' - print ' 0.196874 0.167343 0.142242 0.120906 0.102770 0.087354 0.074251 0.063113 0.053646 0.045599' - print ' 0.038760 0.032946 0.028004 0.023803 0.020233 0.017198 0.014618 0.012425 0.010562 0.008977' - print ' 0.007631 0.006486 0.005513' - print ' 5 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000' - print ' 6 1.000000 0.000000 0.100000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000' - print ' 0.000000 0.000000 0.000000' - print '\n' - print ' <----------------------- FLUXES ----------------------->' - print ' Optical Compu Downward Downward Downward Upward Mean Planck d(Net Flux)' - print ' Depth Layer Direct Diffuse Total Diffuse Net Intensity Source / d(Op Dep)' - print '' - print ' 0.0000 1 7.071E-01 1.192E-07 7.071E-01 8.424E-02 6.229E-01 9.523E-02 0.000E+00 5.983E-01' - print ' 1.0000 4 1.719E-01 3.888E-01 5.607E-01 5.607E-02 5.046E-01 8.305E-02 0.000E+00 1.044E-01' - print '\n' - print ' ********* I N T E N S I T I E S *********' - print '' - print ' Polar Azimuth angles (degrees)' - print ' Optical Angle' - print ' Depth Cosine' - print '' - print ' 0.00 60.00 120.00' - print ' 0.0000 -1.0000 0.000E+00 0.000E+00 0.000E+00' - print ' -0.5000 0.000E+00 0.000E+00 0.000E+00' - print ' 0.5000 4.465E-02 3.413E-02 2.211E-02' - print ' 1.0000 2.149E-02 2.149E-02 2.149E-02' - print '' - print ' 0.00 60.00 120.00' - print ' 1.0000 -1.0000 4.352E-02 4.352E-02 4.352E-02' - print ' -0.5000 6.599E-01 7.163E-02 2.009E-02' - print ' 0.5000 1.785E-02 1.785E-02 1.785E-02' - print ' 1.0000 1.785E-02 1.785E-02 1.785E-02'