# LEIPSIC **Repository Path**: BinLeipzig/LEIPSIC ## Basic Information - **Project Name**: LEIPSIC - **Description**: 3D radiative transfer code based on backward Monte Carlo - **Primary Language**: C/C++ - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 1 - **Created**: 2018-10-02 - **Last Updated**: 2024-03-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LEIPSIC #### Description Light Estimator Including Polarization, Surface Inhomogeneities, and Clouds ([LEIPSIC](https://doi.org/10.1016/j.jqsrt.2019.106690)), a 3D radiative transfer (RT) code based on backward Monte Carlo. LEIPSIC includes the abilities to handle: - 3D cloud field; - 2D surface albedo map; - digital elevation model (DEM); - polarized/scalar scattering; - solar/thermal radiation; - radiance/irradiance calculation; - spectrum integration; - variance reduction; - parallel computing. LEIPSIC has been validated against the benchmarks of spectral radiances from the International working group on Polarized Radiative Transfer ([IPRT](https://www.meteo.physik.uni-muenchen.de/~iprt/)) project, and broadband irradiances benchmarks from [Barker et al. 2003](https://doi.org/10.1175/1520-0442(2003)016%3C2676:ADASRT%3E2.0.CO;2). #### Software Architecture The LEIPSIC code has two parts: - **Leipsic_bwd** : backward RT at a single wavelength; - **Leipsic_reptran** : spectrum integration module following the REPTRAN model ([J.Gasteiger et al. 2014](https://www.sciencedirect.com/science/article/pii/S0022407314002842)). LEIPSIC is coded under [openSUSE](https://www.opensuse.org/) system, based on [Qt4](https://www.qt.io/) library. It can also be compiled and run on the SUSE Linux Enterprise Server, Ubuntu and Debian system. LEIPSIC can be called parallelly through the MPI framework, which enables LEIPSIC taking advantage of the powerful parallel capability of the modern workbench. Further, the migration to Intel Xeon Phi is under planning. The default compiling is under GCC and MPICH. The using of Intel Parallel Studio can give LEIPSIC an extra speed-up for about 10 percent, please contact the author for the setup of Intel compiler. #### Installation 1. Install & configure 3rd party libraries 2. Download 3. Compile 4. Benchmark test #### Instructions The **_compile video_** under openSUSE and Ubuntu can be found at [attachment](https://gitee.com/BinLeipzig/LEIPSIC/attach_files). 1. Install & configure 3rd party libraries - For _openSUSE_ (Ubuntu in below) ``` sudo zypper install mpich mpich-devel libqt4-devel netcdf-devel python3-numpy python3-matplotlib ``` Setup the MPI path by put into the following line into file “/etc/profile”, ``` export PATH=$PATH:/usr/lib64/mpi/gcc/mpich/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/mpi/gcc/mpich/lib64/ ``` and refresh it by command “source”: ``` source /etc/profile ``` Setup the MPI node, add the hostname of current computer into the configure file “/etc/hosts”: ``` 127.0.0.1 localhost name ``` where the “ _name_ ” can be get from your terminal, e.g. the hostname of my current computer is“ _linux-rdpv_ ”, which can be get from the terminal prompt “binsun@ _linux-rdpv_ :~> ”. - For _Ubuntu_ ``` sudo apt install mpich qt4-dev-tools libnetcdf-dev gsl-bin libgsl0-dev libf2c2-dev python3-matplotlib ``` Setup the MPI node, add the hostname of current computer into the configure file “/etc/hosts”: ``` 127.0.0.1 localhost name ``` where the “ _name_ ” can be get from your terminal, e.g. the hostname of my current computer is“ _linux-rdpv_ ”, which can be get from the terminal prompt “binsun@ _linux-rdpv_ :~> ”. Other Linux distributions can certainly possible to build & run LEIPSIC, as long as the mpich, Qt4, f2c and NetCDF libraries are installed. The detailed instructions for all sorts of distributions are welcome to be added here. 2. Download Note: due to the recently changed rules of gitee.com, the users have to (free of charge) register at gitee.com in order to download via the Https links below. The code body itself can be retrieved in command line `git clone "https://gitee.com/BinLeipzig/LEIPSIC.git"` without registration, however, the [database attachments](https://gitee.com/BinLeipzig/LEIPSIC/attach_files) still need a registration to download. [Download](https://gitee.com/BinLeipzig/LEIPSIC/repository/archive/master.zip) and unzip the code body. [Download](https://gitee.com/BinLeipzig/LEIPSIC/attach_files) all the database files. Put all pieces of database together by running: ``` cat values.zip.00* > values.zip ``` Then unzip the values.zip file into directory “LEIPSIC/bin”. 3. Compile For **_openSUSE_** ``` sh compile.sh ``` For **_Ubuntu_** ``` bash compile.sh ``` 4. Benchmark test [IPRT](https://www.meteo.physik.uni-muenchen.de/~iprt/) test. ``` cd bin/ python3 IPRT_test.py ``` [Barker et al. 2003](https://doi.org/10.1175/1520-0442(2003)016%3C2676:ADASRT%3E2.0.CO;2) test, see Sec. 2.3 of LEIPSIC manual. ``` ./Leipsic_reptran -parallel_over_bands 4 -nPhoton 100000 -incidentPosition 0 0 120000 -recvDirection 60 0 -solar unity -atmosphere_file values/mole/atmmod/afglt.dat -band 0.2 0.775 -irradiance_downside -keep_gross_err_point -set_z_grid 28000 20000 15000 12000 11000 10000 9000 8000 7000 6000 5000 2000 1000 -albedo 0.2 -keep_mol_profile_cache -cloud_file_lwc examples/Barker_2003_cloud/cloud_a.cdf -rEffWC 10 -seperate_LE_near_solar -reducedSideScatLE -keep_gross_err_point -delta_truncation -no_polarization -reflectance -solar_weight_adjust -verbose ``` **_Tips_**: The Python3 code of "IPRT_test.py" can be found at the "LEIPSIC/bin" directory. The examples inside can be the best tutorial about questions like how to set up a cloud field, how to set up a profile of aerosol, etc. A NetCDF viewer is helpful to look into all kinds of LEIPSIC database, e.g. [ncBrowse](https://www.nodc.noaa.gov/woce/woce_v3/wocedata_1/utils/netcdf/ncbrowse/index.htm) or [Panoply](https://www.giss.nasa.gov/tools/panoply/). #### Contribution 1. Fork the project 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request #### Gitee Feature 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 4. The most valuable open source project [GVP](https://gitee.com/gvp) 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)