commit c2888f73002704a27a37a314a28f5f11cd858e65
parent e16743afbdedccc9e13964ab463cab24022eb2a8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 14 Feb 2018 15:23:58 +0100
Improve the kspectrum section
Add an installation procedure and downloadable content: the source code,
the installation script and the manual.
Diffstat:
| M | Makefile | | | 8 | +++++++- |
| M | kspectrum.html.in | | | 68 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- |
| M | misc.sh | | | 7 | ------- |
| A | spectral.sh | | | 67 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
4 files changed, 132 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
@@ -23,13 +23,15 @@ SCHIFF-SCRIPTS=~/code/meso-star/schiff-scripts/src/
STAR-ENGINE-VERSION=0.6.0
STAR-ENGINE-README=~/code/star-engine/README.md
+KSPECTRUM-VERSION=1.3
+
REMOTE=OVH:www/projects/
.PHONY: default
default: all
.PHONY: all
-all: misc solstice schiff star-engine
+all: spectral misc solstice schiff star-engine
.PHONY: clean
clean:
@@ -81,6 +83,10 @@ publish:
$(REMOTE)/downloads/
rsync -avzr man $(REMOTE)
+.PHONY: spectral
+spectral:
+ @sh spectral.sh $(KSPECTRUM-VERSION)
+
.PHONY: star-engine
star-engine:
@sh star-engine.sh $(STAR-ENGINE-VERSION) $(STAR-ENGINE-README)
diff --git a/kspectrum.html.in b/kspectrum.html.in
@@ -2,6 +2,19 @@
<h1>Kspectrum - molecular absorption spectra for arbitrary gas mixtures.</h1>
</header>
+<div id="news">
+ <p><b>Download Kspectrum ${VERSION}</b></p>
+ <ul>
+ <li>Sources:
+ <a href="downloads/kspectrum${VERSION}.tgz">tarball</a> /
+ <a href="downloads/kspectrum${VERSION}.tgz.sig">pgp</a></li>
+ <li>Installation script:
+ <a href="downloads/kspectrum${VERSION}_install.bash">bash</a></li>
+ <li>Manual:
+ <a href="downloads/kspectrum${VERSION}_manual.pdf">pdf</a></li>
+ </ul>
+</div>
+
<p>Kspectrum computes the synthetic absorption spectrum for a gas mixture in
arbitrary thermodynamic conditions (pressure, temperature and molar
composition) from public spectroscopic databases. The main and only purpose of
@@ -42,16 +55,17 @@ and use a specified constant spectral step, but the original algorithms that
give the possibility to compute reference results (in the sense that a
numerical accuracy is provided over resulting spectra) are still available.</p>
-<p>Physical models: this code can take into account the Lorentz and the Voigt line
-profiles, as well as common sub-lorentzian corrective profiles. The isotopic
-composition can be specified, making this code suitable for non-terrestrial
-applications. The code was mainly thought for thermal infrared applications,
-but absorption spectra can be produced for any spectral range as long as
-transition parameters are available. As a general rule, kspectrum was designed
-to remain as polyvalent as possible; one immediate disadvantage is that special
-sources of opacity, such as collision-induced absorption or continua, should be
-computed separately for any given application. Also, line-mixing processes have
-not yet been taken into consideration, and require further developments.</p>
+<p>Physical models: this code can take into account the Lorentz and the Voigt
+line profiles, as well as common sub-lorentzian corrective profiles. The
+isotopic composition can be specified, making this code suitable for
+non-terrestrial applications. The code was mainly thought for thermal infrared
+applications, but absorption spectra can be produced for any spectral range as
+long as transition parameters are available. As a general rule, kspectrum was
+designed to remain as polyvalent as possible; one immediate disadvantage is
+that special sources of opacity, such as collision-induced absorption or
+continua, should be computed separately for any given application. Also,
+line-mixing processes have not yet been taken into consideration, and require
+further developments.</p>
<p>Some neat features: every time-consuming step of the computation has been
parallelised, even though the parallel architecture is far from optimal and
@@ -74,3 +88,37 @@ been implemented with the obsessions of:</p>
current run.</li>
</ul>
+<h2>Installation</h2>
+
+<p>You will have to download both the <code>.tgz</code> file and the
+installation script, and place both files in the same directory. Then run the
+installation script. This will uncompress the archive, compile and run a small
+program that will generate a example composition file (for Venus' atmosphere).
+The installation script will also try to link Line-by-Line spectroscopic
+databases to your new installation of kspectrum, but will most probably fail if
+you are not a frequent kspectrum user, and you will have to read the
+documentation in order to link LBL databases yourself (and probably download
+then first if you have not already done so). Please contact us at <a
+href="mailto:vincent.eymet@meso-star.com">vincent.eymet@meso-star.com</a> if
+you want a specific setup script for your machine so that the linking step is
+performed when you download the next version.</p>
+
+<p><b>Prerequisites:</b> all you need is a fortran compiler. We are using
+gfortran for development, but it should also work with other fortran compilers
+(ifort, pgfortran, <i>etc.</i>). You should export the name of your fortran
+compiler into the F77 environment variable; for instance, using the bash
+interpreter:</p>
+
+<pre class="code">
+export F77=gfortran
+</pre>
+
+<p>Then you can try to compile kspectrum: go to the main kspectrum directory,
+then use the <code>make all</code> command to compile. The most common sources
+of failure can be fixed by editing the "Makefile" file in order to check
+compilation options (and more specifically options related to the target
+architecture and optimisations). Whenever you modify a source file, you can
+re-compile using the <code>make all</code> command. But in the case you have to
+modify a include file, you will have to erase all existing object files first
+using the <code>make clean</code> command, before recompiling from scratch
+using the <code>make all</code> command again.</p>
diff --git a/misc.sh b/misc.sh
@@ -27,13 +27,6 @@ echo "Write index.html"
print_footer
} > index.html
-echo "Write kspectrum.html"
-{
- print_header Kspectrum dummy
- cat kspectrum.html.in
- print_footer
-} > kspectrum.html
-
echo "Write stardis.html"
{
print_header Stardis dummy
diff --git a/spectral.sh b/spectral.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Copyright (C) |Meso|Star> 2017-2018
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+source ./meso-menu.sh
+
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 VERSION"
+ exit 1
+fi
+
+required_files=(
+ "./downloads/kspectrum$1.tgz"
+ "./downloads/kspectrum$1_install.bash"
+ "./downloads/kspectrum$1_manual.pdf"
+)
+
+# Check files
+for((i=0; i < ${#required_files[@]}; ++i)); do
+ if [ ! -f "${required_files[$i]}" ]; then
+ echo "$0:$LINENO: Cannot find ${required_files[$i]}"
+ exit 1
+ fi
+done
+
+################################################################################
+# Sign the tarball
+################################################################################
+tput bold; echo ">>> Kspectrum tarball"; tput sgr0
+
+arch="./downloads/kspectrum$1.tgz"
+if [ ! -f "$arch.sig" ]; then
+ echo "Sign $arch"
+ gpg -a -o $arch.sig --detach-sign $arch
+else
+ echo "Nothing to do"
+fi
+
+echo ""
+
+################################################################################
+# Generate the Kspectrum page
+################################################################################
+echo "Write kspectrum.html"
+{
+ print_header Kspectrum dummy
+ VERSION=$1 envsubst < kspectrum.html.in
+ print_footer
+} > kspectrum.html
+
+echo ""
+