kspectrum is a code that will compute high-resolution spectrum (ka vs nu) from public line-by-line databases, for any thermodynamical conditions (temperature, pressure), and for any gas mixture, with a full control of the accuracy over the results.
These spectrum can be used, for instance, in
... [More]
order to produce k-distribution data sets that are very appreciated for radiative transfer simulations.
This code can be used in order to generate entry data for radiative transfer simulation codes, in various research fields, such as planetary atmospheres (climate studies, simulation of atmospheric general circulation), combustion, etc.
The main idea of kspectrum is that the uncertainty over the resulting spectrum can be specified by the user. The absorption coefficient at each wavenumber will be computed within the specified accuracy limits: the contribution of each known energetic transition will be taken into account, no matter how much computation time it requires. As a consequence, kspectrum does not need line profile truncation or line selection techniques, and no ad-hoc corrections have to be brought depending on the local thermodynamic conditions or species concentrations. Moreover, physical phenomenons such as doppler broadening (resulting in a Voigt line profile), sub-lorentzian profiles and collision-induced absorption are taken into account, within the limits of the present knowledge in spectroscopy.
This code has been tested for Earth and Venus atmospheres, and is known to provide very accurate results (specifically for the Earth, since gas spectrum are well known).
kspectrum is written in fortran 77, and will run on any linux cluster that uses mpich.
INSTALLATION
First, the name of your fortran 77 compiler has to be defined within the F77 environment variable. For instance, add the following line to your .bashrc file:
>export F77="g77"
if you are using the GNU fortran 77 compiler. Then use "source .bashrc" to take modifications into account. Adapt the previous commands to your situation. If you do not define the F77 variable, your fortran 77 compiler's name will be asked when compilation commands are executed.
Next,the user should download the most recent archive "kspectrum1.0.4.tgz" and installation script "install_kspectrum1.0.4.bash" in the same directory. Then use the following command:
> ./install_kspectrum1.0.4.bash
The installation script will unzip the archive, creating the main kspectrum directory. It will also compile and run a small program into the /data directory for creating example input data files.
The user should refer to the manual (can be downloaded from the project page or found into the /Doc directory) in order to compile the main executable and to run simulations. The main steps are:
- install MPICH on every system that will take part of your cluster, if you do not already have set up a cluster.
- to edit the "Makefile" file and set the compiler name and compilation options that fit your compiler / system.
- to edit the "includes/max.inc" file and set variables values (although default values should be fine)
- use command "make all" in order to compile the executable.
- install Line-by-Line public databases into the /data directory.
USE
Use command "mpirun -np # kspectrum.exe" to run a simulation, with # the number of processes that have to execute the code. The number of processes should be equal to the number of physical cores of your cluster, plus one.
MODIFICATIONS
Whenever a source file is modified, command "make all" should be use to recompile the modified files.
Whenever an include file is modified, command "make clean all" should be used in order to recompile the executable from scratch.
RESULTS
Results files are located into the /results directory. Each file contains three columns: the wavenumber in inverse centimeters, the absorption cross-section of the gas mixture at that wavenumber, in square centimeters per molecule, and the absorption coefficient of the gas mixture at that wavenumber, in inverse meters.
Results can be used by the "kdistribution" code in order to produce k-distribution data sets. In order to install "kdistribution", follow the same steps than for KSPECTRUM:
- download the main archive "kdistribution1.0.4.tgz" archive and "install_kdistribution1.0.4.bash" installation script, on the same directory (for instance, at the same level you downloaded "kspectrum1.0.4.tgz" and "install_kspectrum1.0.4.bash"). Please note version numbers should be identical for ksectrum and kdistribution, otherwise format issues will occur.
- run "install_kdistribution1.0.4.bash" in order to unzip the archive. This script will find "kspectrum" if both codes are installed at the same level, and will make appropriate links in this case.
- read the documentation file "/Doc/manual.pdf" to compile and use "kdistribution". [Less]