commit 3a0016f5e8be9b065722e59be7740d3790d9a3fd
parent cc61e667ebd03116a90c8e09fb385d247d00e9bc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 19 Aug 2025 18:13:34 +0200
Draft of a new compilation procedure
Test a data-driven compilation procedure.
Menu entries are described by configuration files used by a new script
that generates page headers accordingly.
The content of static pages is converted to HTML from Markdown files
that can be written by hand or generated dynamically by a shell script
whose name is the web page to be generated (its suffix is .sh).
Images are now assumed to be located in "images", while downloadable
content is located in "downloads".
The compilation procedure relies on this fixed hierarchy and naming
convention to iterate over the data in the sections in order to generate
their content.
Currently, tests are only performed on the A.R.T. section, which is
fairly easy since its content is mainly written by hand. Ultimately,
all sections should be generated in the same way from a single Makefile.
This will allow users to focus on writing the site's content rather than
on the site's generation infrastructure
Diffstat:
27 files changed, 575 insertions(+), 467 deletions(-)
diff --git a/art/Makefile b/art/Makefile
@@ -12,113 +12,60 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
.POSIX:
+.SUFFIXES: .md .html .sh .lint
include ../config.mk
-KSPECTRUM_VERSION=1.3
-KDISTRIBUTION_VERSION=1.1.1
-KARINE_VERSION=3.5
-
-ART_PKG=\
- downloads/kspectrum$(KSPECTRUM_VERSION).tgz\
- downloads/kdistribution_light$(KDISTRIBUTION_VERSION).tgz\
- downloads/hr_ppart.tgz\
- downloads/ppart_lw.tgz\
- downloads/ppart_sw.tgz\
- downloads/karine$(KARINE_VERSION).tgz
-ART_SIG=$(ART_PKG:=.sig)
-
-ART_FILES=\
- downloads/install_kspectrum$(KSPECTRUM_VERSION).bash\
- downloads/kspectrum$(KSPECTRUM_VERSION)_manual.pdf\
- downloads/install_kdistribution_light$(KDISTRIBUTION_VERSION).bash\
- downloads/kdistribution_light$(KDISTRIBUTION_VERSION)_manual.pdf\
- downloads/karine$(KARINE_VERSION)_manual.pdf
-
-KSPECTRUM_IMG=k001.svg tau_cumulated_1180-1200.svg
-HR_PPART_IMG=emission_altitude_500-505.svg Te_signal_500-505.svg
-KARINE_IMG=pne_mls_cs.svg pne_mls_ac.svg venus_ner.svg
-IMG=$(KSPECTRUM_IMG) $(HR_PPART_IMG) $(KARINE_IMG) Tb.svg si_flux.svg
-
-HTML=\
- art.html\
- kspectrum.html\
- kdistribution.html\
- hr_ppart.html\
- ppart_lw.html\
- ppart_sw.html\
- karine.html
+LINT=$(HTML:.html=.lint)
-build: .sig
- @$(MAKE) -fMakefile -f .sig build_all
+default: build
-build_all: $(ART_SIG) $(HTML)
+build clean lint install:
+ @$(MAKE) -fMakefile $@__ \
+ HTML="$$(find . ! -path . -type d -prune -o \
+ \( \
+ -name "*.md" \
+ -o -name "*.sh" \
+ \) -exec sh -c 'printf "%s.html " "$${1%.*}"' -- {} \;)" \
+ SIG="$$(find ./downloads -type f ! -name "*.sig" \
+ -exec sh -c 'printf "%s.sig " "$$1"' -- {} \;)"
-clean:
- @echo "Cleaning generated files"
- @rm -f $(HTML) $(HTML:=.err) .sig .lint
+build__: $(HTML) $(SIG)
-distclean: clean
- @echo "Cleaning PGP signatures"
- @rm -f $(ART_SIG)
+clean__:
+ rm -f $(HTML)
+ rm -f $(SIG)
-install: build
- @rsync -avzrR --delete-after --progress \
- $(HTML) $(IMG) $(ART_FILES) $(ART_PKG) $(ART_SIG) $(PREFIX)/art/
-
-art_build.sh: ../meso-menu.sh
- @touch art_build.sh
+install__: $(HTML) $(SIG)
+ @rsync --mkpath -avzrR --delete-after --progress \
+ $(HTML) images downloads $(PREFIX)/art/
################################################################################
-# html
+# Generate content
################################################################################
-art.html: art.md art_build.sh
- @echo "Building $@"
- @$(SHELL) art_build.sh overview > $@
-
-kspectrum.html: kspectrum.md art_build.sh Makefile $(KSPECTRUM_IMG)
- @echo "Building $@"
- @$(SHELL) art_build.sh kspectrum $(KSPECTRUM_VERSION) > $@
-
-kdistribution.html: kdistribution.md art_build.sh Makefile
- @echo "Building $@"
- @$(SHELL) art_build.sh kdistribution $(KDISTRIBUTION_VERSION) > $@
+$(HTML): ../generate_header.sh
-hr_ppart.html: hr_ppart.md art_build.sh $(HR_PPART_IMG)
- @echo "Building $@"
- @$(SHELL) art_build.sh hr_ppart > $@
+$(SIG): $(@:.sig=)
+ gpg --yes -a -o $@ --detach-sign $(@:.sig=)
-ppart_lw.html: ppart_lw.md Tb.svg art_build.sh
- @echo "Building $@"
- @$(SHELL) art_build.sh ppart_lw > $@
-
-ppart_sw.html: ppart_sw.md si_flux.svg art_build.sh
- @echo "Building $@"
- @$(SHELL) art_build.sh ppart_sw > $@
+.sh.md:
+ @$(SHELL) ./$< > $@
-karine.html: karine.md art_build.sh Makefile $(KARINE_IMG)
+.md.html:
@echo "Building $@"
- @$(SHELL) art_build.sh karine $(KARINE_VERSION) > $@
+ @{ \
+ $(SHELL) ../generate_header.sh $${PWD}/$@; \
+ $(MD2HTML) $<; \
+ cat ../footer.html; \
+ } > $@
################################################################################
# Check files
################################################################################
-lint: build .lint
- @$(MAKE) -fMakefile -f .lint lint_all
-
-lint_all: lint_shells $(HTML:=.lint)
-
-lint_shells:
- @echo "Linting art_build.sh" && shellcheck -o all -x art_build.sh
-
-################################################################################
-# Miscellaneous targets
-################################################################################
-.sig: Makefile ../configure_targets.sh
- @echo "Setup .sig"
- @$(SHELL) ../configure_targets.sh sig $(ART_PKG) > .sig
+.html.lint:
+ tidy --show-info no -qe $<
-.lint: Makefile ../configure_targets.sh
- @echo "Setup .lint"
- @$(SHELL) ../configure_targets.sh lint $(HTML) > .lint
+lint__: $(HTML) $(LINT)
+ shellcheck -o all -x *.sh
diff --git a/art/art_build.sh b/art/art_build.sh
@@ -1,84 +0,0 @@
-#!/bin/sh -e
-
-# Copyright (C) 2017-2025 |Méso|Star> (contact@meso-star.com)
-#
-# 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/>.
-
-. ../meso-menu.sh
-
-overview()
-{
- print_header -s ART -n Overview -r ../
- md2html art.md
- print_footer
-}
-
-kspectrum()
-{
- if [ $# -lt 1 ]; then
- printf "Usage: %s kspectrum <version>\n" "$0" >&2
- exit 1
- fi
-
- print_header -s ART -n Kspectrum -r ../
- sed "s/@VERSION@/$1/g" kspectrum.md | md2html
- print_footer
-}
-
-kdistribution()
-{
- if [ $# -lt 1 ]; then
- printf "Usage: %s kdistribution <version>\n" "$0" >&2
- exit 1
- fi
-
- print_header -s ART -n Kdistribution -r ../
- sed "s/@VERSION@/$1/g" kdistribution.md | md2html
- print_footer
-}
-
-hr_ppart()
-{
- print_header -s ART -n HR_PPart -r ../
- md2html hr_ppart.md
- print_footer
-}
-
-ppart_lw()
-{
- print_header -s ART -n PPart_LW -r ../
- md2html ppart_lw.md
- print_footer
-}
-
-ppart_sw()
-{
- print_header -s ART -n PPart_SW -r ../
- md2html ppart_sw.md
- print_footer
-}
-
-karine()
-{
- if [ $# -lt 1 ]; then
- printf "Usage: %s karine <version>\n" "$0" >&2
- exit 1
- fi
-
- print_header -s ART -n Karine -r ../
- sed "s/@VERSION@/$1/g" karine.md | md2html
- print_footer
-}
-
-"$@"
diff --git a/art/hr_ppart.md b/art/hr_ppart.md
@@ -16,12 +16,12 @@ optical thickness.
This is only an approximation, not intended to provide accurate results.
Reference results are only achieved for a purely absorbing atmosphere.
-[](emission_altitude_500-505.svg)
+[](images/emission_altitude_500-505.svg)
> Emission altitude signal in the [500-505] inv. cm spectral range, for
> a Mid-Latitude Summer standard atmosphere.
-[](Te_signal_500-505.svg)
+[](images/Te_signal_500-505.svg)
> Emission temperature signal in the [500-505] inv. cm spectral range,
> for a Mid-Latitude Summer standard atmosphere.
diff --git a/art/Tb.svg b/art/images/Tb.svg
diff --git a/art/Te_signal_500-505.svg b/art/images/Te_signal_500-505.svg
diff --git a/art/emission_altitude_500-505.svg b/art/images/emission_altitude_500-505.svg
diff --git a/art/k001.svg b/art/images/k001.svg
diff --git a/art/pne_mls_ac.svg b/art/images/pne_mls_ac.svg
diff --git a/art/pne_mls_cs.svg b/art/images/pne_mls_cs.svg
diff --git a/art/si_flux.svg b/art/images/si_flux.svg
diff --git a/art/tau_cumulated_1180-1200.svg b/art/images/tau_cumulated_1180-1200.svg
diff --git a/art/venus_ner.svg b/art/images/venus_ner.svg
diff --git a/art/index.tsv b/art/index.tsv
@@ -0,0 +1,7 @@
+Overview art.html
+Kspectrum kspectrum.html
+Kdistribution kdistribution.html
+HR_PPart hr_ppart.html
+PPart_LW ppart_lw.html
+PPart_SW ppart_sw.html
+Karine karine.html
diff --git a/art/karine.md b/art/karine.md
@@ -1,118 +0,0 @@
-# Karine
-
-This code performs radiative transfer computations in the LW spectral
-region, for a absorbing, emitting and scattering atmosphere.
-`karine` uses the k-distribution spectral model (and the CK hypothesis
-for inhomogeneities).
-Radiative transfer results that are computed are: fluxes (upward,
-downward, net), the radiative budget (average per layer) and its
-gas-gas, gas-ground and gas-space components, and the Net Exchange Rate
-matrix.
-All results are provided for each spectral interval the input data is
-defined for, and is also spectrally integrated.
-
-## Physical model
-
-The inhomogeneous atmosphere is represented as a succession of
-homogeneous slabs.
-The temperature profile is taken as linear between layers centres.
-In each layer, absorption and scattering properties must be provided for
-the gas mixture (k-distribution data set), for a water cloud, and for
-aerosols.
-Reflection by the ground is taken into account.
-
-## Numerical method
-
-Karine is based on a Monte-Carlo algorithm.
-In addition to the possibility to take into account scattering, this
-method has the advantage to compute a statistical uncertainty over each
-result; this uncertainty can be interpreted in terms of a numerical
-error.
-In this respect, the Monte-Carlo method is considered as a reference
-method: the numerical uncertainty can be lowered as much as necessary by
-increasing the number of realisations.
-
-## Net Exchange Formalism
-
-The Monte-Carlo algorithm consists in computing the Net Exchange Rate
-between each couple (i,j) of atmospheric layers (+ ground and space).
-See figures for examples.
-This formalism provides a graphical representation of all radiative net
-exchanges in the atmospheres: dominant and non-dominant terms can be
-immediately identified, for any given spectral interval.
-
-[](pne_mls_cs.svg)
-
-> Matrix of Net Exchange Rates, spectrally integrated over the LW
-> interval (4-100 micrometers) for a standard clear-sky Mid-Latitude
-> Summer atmospheric profile.
-
-
-[](pne_mls_ac.svg)
-
-> Matrix of Net Exchange Rates, spectrally integrated over the LW
-> interval (4-100 micrometers) for a standard Mid-Latitude Summer
-> atmospheric profile, in the presence of three water clouds.
-
-[](venus_ner.svg)
-
-> Matrix of Net Exchange Rates, spectrally integrated over the LW
-> interval (1.71-250 micrometers) for the Venus atmosphere.
-
-## Quick start
-
-Karine @VERSION@:
-
-- Sources: [tarball](downloads/karine@VERSION@.tgz) /
- [pgp](downloads/karine@VERSION@.tgz.sig)
-- Manual: [pdf](downloads/karine@VERSION@_manual.pdf)
-
-### Prerequisites
-
-Only a fortran compiler is needed (no external libraries).
-The `gfortran` compiler has been used for development.
-
-
-### Installation
-
-Download and uncompress the `.tgz` archive.
-Then you can try to compile the `karine` executable: go to the main
-karine directory, then use the `make all` 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 `make
-all` command.
-But in the case you have to modify a include file, you will have to
-erase all existing object files first using the `make clean` command,
-before recompiling from scratch using the `make all` command again.
-
-## Usage
-
-Please refer to the documentation in order to produce the
-`/data/atmos_data.txt` input data file required by karine.
-A example program (`make_data`) is provided in the `/data` directory:
-use the `f0` script in order to compile it, but this program will only
-produce a dummy data set (not a physical configuration).
-The user has the possibility to set many options and input data by
-editing the `options.in` and `data.in` input data files.
-Please refer to the documentation for a description of the content of
-these files.
-
-## License
-
-Copyright © 2014-2018 |Méso|Star>
-([contact@meso-star.com](mailto:contact@meso-star.com))
-Copyright © 2008-2014 Centre National de la Recherche Scientifique (CNRS)
-Copyright © 2008-2014 Institut Mines-Télécom Albi-Carmaux
-Copyright © 2008-2014 Université Paul Sabatier
-
-
-Karine is free software released under the GPLv2+ license: GNU GPL
-version 2 or later.
-You can freely study, modify or extend it. You are also welcome to
-redistribute it under certain conditions;
-refer to the
-[license](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) for
-details.
diff --git a/art/karine.md.in b/art/karine.md.in
@@ -0,0 +1,118 @@
+# Karine
+
+This code performs radiative transfer computations in the LW spectral
+region, for a absorbing, emitting and scattering atmosphere.
+`karine` uses the k-distribution spectral model (and the CK hypothesis
+for inhomogeneities).
+Radiative transfer results that are computed are: fluxes (upward,
+downward, net), the radiative budget (average per layer) and its
+gas-gas, gas-ground and gas-space components, and the Net Exchange Rate
+matrix.
+All results are provided for each spectral interval the input data is
+defined for, and is also spectrally integrated.
+
+## Physical model
+
+The inhomogeneous atmosphere is represented as a succession of
+homogeneous slabs.
+The temperature profile is taken as linear between layers centres.
+In each layer, absorption and scattering properties must be provided for
+the gas mixture (k-distribution data set), for a water cloud, and for
+aerosols.
+Reflection by the ground is taken into account.
+
+## Numerical method
+
+Karine is based on a Monte-Carlo algorithm.
+In addition to the possibility to take into account scattering, this
+method has the advantage to compute a statistical uncertainty over each
+result; this uncertainty can be interpreted in terms of a numerical
+error.
+In this respect, the Monte-Carlo method is considered as a reference
+method: the numerical uncertainty can be lowered as much as necessary by
+increasing the number of realisations.
+
+## Net Exchange Formalism
+
+The Monte-Carlo algorithm consists in computing the Net Exchange Rate
+between each couple (i,j) of atmospheric layers (+ ground and space).
+See figures for examples.
+This formalism provides a graphical representation of all radiative net
+exchanges in the atmospheres: dominant and non-dominant terms can be
+immediately identified, for any given spectral interval.
+
+[](images/pne_mls_cs.svg)
+
+> Matrix of Net Exchange Rates, spectrally integrated over the LW
+> interval (4-100 micrometers) for a standard clear-sky Mid-Latitude
+> Summer atmospheric profile.
+
+
+[](images/pne_mls_ac.svg)
+
+> Matrix of Net Exchange Rates, spectrally integrated over the LW
+> interval (4-100 micrometers) for a standard Mid-Latitude Summer
+> atmospheric profile, in the presence of three water clouds.
+
+[](images/venus_ner.svg)
+
+> Matrix of Net Exchange Rates, spectrally integrated over the LW
+> interval (1.71-250 micrometers) for the Venus atmosphere.
+
+## Quick start
+
+Karine @VERSION@:
+
+- Sources: [tarball](downloads/karine@VERSION@.tgz) /
+ [pgp](downloads/karine@VERSION@.tgz.sig)
+- Manual: [pdf](downloads/karine@VERSION@_manual.pdf)
+
+### Prerequisites
+
+Only a fortran compiler is needed (no external libraries).
+The `gfortran` compiler has been used for development.
+
+
+### Installation
+
+Download and uncompress the `.tgz` archive.
+Then you can try to compile the `karine` executable: go to the main
+karine directory, then use the `make all` 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 `make
+all` command.
+But in the case you have to modify a include file, you will have to
+erase all existing object files first using the `make clean` command,
+before recompiling from scratch using the `make all` command again.
+
+## Usage
+
+Please refer to the documentation in order to produce the
+`/data/atmos_data.txt` input data file required by karine.
+A example program (`make_data`) is provided in the `/data` directory:
+use the `f0` script in order to compile it, but this program will only
+produce a dummy data set (not a physical configuration).
+The user has the possibility to set many options and input data by
+editing the `options.in` and `data.in` input data files.
+Please refer to the documentation for a description of the content of
+these files.
+
+## License
+
+Copyright © 2014-2018 |Méso|Star>
+([contact@meso-star.com](mailto:contact@meso-star.com))
+Copyright © 2008-2014 Centre National de la Recherche Scientifique (CNRS)
+Copyright © 2008-2014 Institut Mines-Télécom Albi-Carmaux
+Copyright © 2008-2014 Université Paul Sabatier
+
+
+Karine is free software released under the GPLv2+ license: GNU GPL
+version 2 or later.
+You can freely study, modify or extend it. You are also welcome to
+redistribute it under certain conditions;
+refer to the
+[license](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) for
+details.
diff --git a/art/karine.sh b/art/karine.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+version=3.5
+sed "s/@VERSION@/${version}/g" karine.md.in
diff --git a/art/kdistribution.md b/art/kdistribution.md.in
diff --git a/art/kdistribution.sh b/art/kdistribution.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+version=1.1.1
+sed "s/@VERSION@/${version}/g" kdistribution.md.in
diff --git a/art/kspectrum.md b/art/kspectrum.md
@@ -1,171 +0,0 @@
-# Kspectrum
-
-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 the code is to produce high-resolution
-absorption spectra for a given set of thermodynamic conditions; in
-particular, Kspectrum will *NOT* perform the following tasks:
-
-- compute molecular absorption for any other source than allowed
- energetic transitions: even if some limited effort has been put into
- the representation of collision-induced absorption and continua, these
- sources of opacity will have to be computed separately for each
- application in a separate step.
-
-- perform radiative transfer computations: one of the main ideas behind
- Kspectrum is that the resulting absorption spectra can be used for a
- wide variety of applications, possibly in complex 3D scenes (as, for
- instance, in combustion engines).
- Dedicated tools will have to be used in order to solve radiative
- transfer; Kspectrum by itself will only be used to produce the input
- spectral data.
-
-[](k001.svg)
-
-> Absorption spectrum for terrestrial air, at ground level, for a
-> Mid-Latitude Summer standard atmospheric profile.
-> The absorption coefficient is also provided for each one of the three
-> molecular species used in the gas mixture (logscale).
-
-## Spectroscopic databases
-
-Kspectrum uses the [HITRAN](http://hitran.org) spectroscopic database in
-order to retrieve transition parameters (versions 2004, 2008 and 2012).
-Additionally, it can use the [HITEMP](http://hitran.org/hitemp/)-2010
-and [CDSD](ftp://ftp.iao.ru/pub)-4000 databases (respectively for water
-and carbon dioxide) at high-temperature levels.
-Further development would be required for additional databases
-(HITRAN-2016 ? GEISA ?).
-
-## Reference results
-
-The main idea behind Kspectrum was initially to develop a code that
-would not need to use numerical simplifications such as a line profile
-truncation (assuming the distant line-wing profile is well known, which
-is obviously not the case).
-The resulting code was therefore capable of adding the contribution of
-every known transition at every wavenumber, in order to produce a value
-of the absorption coefficient with a known accuracy; also, a custom
-spectral discretisation algorithm was implemented in order to produce a
-non-uniform spectral grid according to a second accuracy criteria.
-Further versions quickly acquired the possibility to perform a
-line-wings truncation 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.
-
-[](tau_cumulated_1180-1200.svg)
-
-> Plot of the atmospheric cumulated optical depth as a function of
-> wavenumber, for a clear-sky Mid-Latitude Summer standard terrestrial
-> atmospheric profile.
-> Two kspectrum results are provided: using a 25 inverse centimeters
-> truncation of the line profile, and without any truncation.
-> The same result (with a truncation) obtained from the 4A code is also
-> presented.
-
-## 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.
-
-## Some neat features
-
-Every time-consuming step of the computation has been parallelised, even
-though the parallel architecture is far from optimal and should require
-a major revision: the computation time does not scale very well with the
-number of processes because of inter-processes communication, and also
-it was not thought for multi-node clusters.
-But at least Kspectrum will run faster on a reasonably good single node
-(approx. 20 cores).
-
-Also, the code has been implemented with the obsessions of:
-
-- working with arbitrary large numbers of transitions.
- For instance, the CDSD-4000 database holds the parameters for more
- than 6 hundred millions of transitions for carbon dioxide;
- Kspectrum will, in time, eventually compute the contribution of every
- transition at every wavenumber of the spectrum.
-
-- being able to resume interrupted runs: whether your PC crashes or
- Kspectrum reaches the maximum computation time allowed by the
- cluster's queue, it will be possible to resume an interrupted
- computation instead of starting over from scratch: as in a video game,
- Kspectrum performs frequent backups of the current run.
-
-## Quickstart
-
-Kspectrum @VERSION@:
-
-- Sources: [tarball](downloads/kspectrum@VERSION@.tgz) /
- [pgp](downloads/kspectrum@VERSION@.tgz.sig)
-- Installation script: [bash](downloads/install_kspectrum@VERSION@.bash)
-- Manual: [pdf](downloads/kspectrum@VERSION@_manual.pdf)
-
-### Preqrequisites
-
-All you need is a fortran compiler.
-We are using gfortran for development, but it should also work with
-other fortran compilers (ifort, pgfortran, etc.).
-You should export the name of your fortran compiler into the F77
-environment variable; for instance, using the bash interpreter:
-
- export F77=gfortran
-
-Then you can try to compile Kspectrum: go to the main Kspectrum
-directory, then use the `make all` 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 `make
-all` command.
-But in the case you have to modify an include file, you will have to
-erase all existing object files first using the `make clean` command,
-before recompiling from scratch using the `make all` command again.
-
-### Installation
-
-You will have to download both the `.tgz` 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 an 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](mailto:contact@meso-star.com) if you want a specific
-setup script for your machine so that the linking step is performed when
-you download the next version.
-
-## Copyright notice
-
-Copyright © 2014-2018 |Méso|Star>
-([contact@meso-star.com](mailto:contact@meso-star.com))
-Copyright © 2008-2014 Centre National de la Recherche Scientifique (CNRS)
-Copyright © 2008-2014 Fondation Sciences et Technologies pour l'Aéronotique et l'Espace
-Copyright © 2008-2014 Institut Mines-Télécom Albi-Carmaux
-Copyright © 2008-2014 Université Bordeaux 1
-Copyright © 2008-2014 Université Paul Sabatier
-
-## License
-
-Kspectrum is free software released under the CeCILL v2.1 license.
-You are welcome to redistribute it under certain conditions; refer to
-the
-[license](http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt)
-for details.
diff --git a/art/kspectrum.md.in b/art/kspectrum.md.in
@@ -0,0 +1,171 @@
+# Kspectrum
+
+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 the code is to produce high-resolution
+absorption spectra for a given set of thermodynamic conditions; in
+particular, Kspectrum will *NOT* perform the following tasks:
+
+- compute molecular absorption for any other source than allowed
+ energetic transitions: even if some limited effort has been put into
+ the representation of collision-induced absorption and continua, these
+ sources of opacity will have to be computed separately for each
+ application in a separate step.
+
+- perform radiative transfer computations: one of the main ideas behind
+ Kspectrum is that the resulting absorption spectra can be used for a
+ wide variety of applications, possibly in complex 3D scenes (as, for
+ instance, in combustion engines).
+ Dedicated tools will have to be used in order to solve radiative
+ transfer; Kspectrum by itself will only be used to produce the input
+ spectral data.
+
+[](images/k001.svg)
+
+> Absorption spectrum for terrestrial air, at ground level, for a
+> Mid-Latitude Summer standard atmospheric profile.
+> The absorption coefficient is also provided for each one of the three
+> molecular species used in the gas mixture (logscale).
+
+## Spectroscopic databases
+
+Kspectrum uses the [HITRAN](http://hitran.org) spectroscopic database in
+order to retrieve transition parameters (versions 2004, 2008 and 2012).
+Additionally, it can use the [HITEMP](http://hitran.org/hitemp/)-2010
+and [CDSD](ftp://ftp.iao.ru/pub)-4000 databases (respectively for water
+and carbon dioxide) at high-temperature levels.
+Further development would be required for additional databases
+(HITRAN-2016 ? GEISA ?).
+
+## Reference results
+
+The main idea behind Kspectrum was initially to develop a code that
+would not need to use numerical simplifications such as a line profile
+truncation (assuming the distant line-wing profile is well known, which
+is obviously not the case).
+The resulting code was therefore capable of adding the contribution of
+every known transition at every wavenumber, in order to produce a value
+of the absorption coefficient with a known accuracy; also, a custom
+spectral discretisation algorithm was implemented in order to produce a
+non-uniform spectral grid according to a second accuracy criteria.
+Further versions quickly acquired the possibility to perform a
+line-wings truncation 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.
+
+[](images/tau_cumulated_1180-1200.svg)
+
+> Plot of the atmospheric cumulated optical depth as a function of
+> wavenumber, for a clear-sky Mid-Latitude Summer standard terrestrial
+> atmospheric profile.
+> Two kspectrum results are provided: using a 25 inverse centimeters
+> truncation of the line profile, and without any truncation.
+> The same result (with a truncation) obtained from the 4A code is also
+> presented.
+
+## 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.
+
+## Some neat features
+
+Every time-consuming step of the computation has been parallelised, even
+though the parallel architecture is far from optimal and should require
+a major revision: the computation time does not scale very well with the
+number of processes because of inter-processes communication, and also
+it was not thought for multi-node clusters.
+But at least Kspectrum will run faster on a reasonably good single node
+(approx. 20 cores).
+
+Also, the code has been implemented with the obsessions of:
+
+- working with arbitrary large numbers of transitions.
+ For instance, the CDSD-4000 database holds the parameters for more
+ than 6 hundred millions of transitions for carbon dioxide;
+ Kspectrum will, in time, eventually compute the contribution of every
+ transition at every wavenumber of the spectrum.
+
+- being able to resume interrupted runs: whether your PC crashes or
+ Kspectrum reaches the maximum computation time allowed by the
+ cluster's queue, it will be possible to resume an interrupted
+ computation instead of starting over from scratch: as in a video game,
+ Kspectrum performs frequent backups of the current run.
+
+## Quickstart
+
+Kspectrum @VERSION@:
+
+- Sources: [tarball](downloads/kspectrum@VERSION@.tgz) /
+ [pgp](downloads/kspectrum@VERSION@.tgz.sig)
+- Installation script: [bash](downloads/install_kspectrum@VERSION@.bash)
+- Manual: [pdf](downloads/kspectrum@VERSION@_manual.pdf)
+
+### Preqrequisites
+
+All you need is a fortran compiler.
+We are using gfortran for development, but it should also work with
+other fortran compilers (ifort, pgfortran, etc.).
+You should export the name of your fortran compiler into the F77
+environment variable; for instance, using the bash interpreter:
+
+ export F77=gfortran
+
+Then you can try to compile Kspectrum: go to the main Kspectrum
+directory, then use the `make all` 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 `make
+all` command.
+But in the case you have to modify an include file, you will have to
+erase all existing object files first using the `make clean` command,
+before recompiling from scratch using the `make all` command again.
+
+### Installation
+
+You will have to download both the `.tgz` 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 an 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](mailto:contact@meso-star.com) if you want a specific
+setup script for your machine so that the linking step is performed when
+you download the next version.
+
+## Copyright notice
+
+Copyright © 2014-2018 |Méso|Star>
+([contact@meso-star.com](mailto:contact@meso-star.com))
+Copyright © 2008-2014 Centre National de la Recherche Scientifique (CNRS)
+Copyright © 2008-2014 Fondation Sciences et Technologies pour l'Aéronotique et l'Espace
+Copyright © 2008-2014 Institut Mines-Télécom Albi-Carmaux
+Copyright © 2008-2014 Université Bordeaux 1
+Copyright © 2008-2014 Université Paul Sabatier
+
+## License
+
+Kspectrum is free software released under the CeCILL v2.1 license.
+You are welcome to redistribute it under certain conditions; refer to
+the
+[license](http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt)
+for details.
diff --git a/art/kspectrum.sh b/art/kspectrum.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+version=1.3
+sed "s/@VERSION@/${version}/g" kspectrum.md.in
diff --git a/art/ppart_lw.md b/art/ppart_lw.md
@@ -9,7 +9,7 @@ atmosphere.
This code should therefore be used, in the case of the terrestrial
atmosphere, for clear-sky LW computations only.
-[](Tb.svg)
+[](images/Tb.svg)
> Brightness temperature in the [4-20] micrometers range, for a
> Mid-Latitude Summer standard atmospheric profile.
diff --git a/art/ppart_sw.md b/art/ppart_sw.md
@@ -13,7 +13,7 @@ It can be used as a toy-model in which only the transmission of incoming
SW radiation is taken into account (as well as the emitted radiation
when the atmosphere is hot enough).
-[](si_flux.svg)
+[](images/si_flux.svg)
> Spectrally integrated SW flux profiles (upward, downward and net) as a
> function of altitude for a Mid-Latitude Summer standard atmosphere.
@@ -45,7 +45,7 @@ using the `mpirun` command:
mpirun -np <NPROCS> ./PPart.exe
-with <NPROCS> the number of processes requested for the computation;
+with `<NPROCS>` the number of processes requested for the computation;
MacOS users might encounter a error where the OS considers the user
requested a number of processes higher than recommended.
You can bypass it using the `-oversubscribe` option:
diff --git a/config.mk b/config.mk
@@ -15,3 +15,5 @@
# Destination where to synchronise data
PREFIX=OVH:www/projects
+
+MD2HTML=md2html
diff --git a/footer.html b/footer.html
@@ -0,0 +1,16 @@
+<div id="footer">
+ <a rel="license" href="http://creativecommons.org/licenses/by-nd/4.0/">
+ <img
+ alt="Creative Commons License"
+ style="border-width:0; float: left; margin-right: 1em"
+ src="https://i.creativecommons.org/l/by-nd/4.0/88x31.png" />
+ </a>
+ Copyright © 2015-2025
+ <a href="mailto:contact@meso-star.com">|Méso|Star></a>
+ <br>
+ This page is licensed under a
+ <a rel="license"
+ href="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons
+ Attribution-NoDerivatives 4.0 International License</a>.
+</div>
+</body>
diff --git a/generate_header.sh b/generate_header.sh
@@ -0,0 +1,202 @@
+#!/bin/sh
+
+# Copyright (C) 2017-2025 |Méso|Star> (contact@meso-star.com)
+#
+# 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
+
+########################################################################
+# Helper functions
+########################################################################
+# Print the absolute dir of the input file
+absdir() # file
+{
+ cd -- "$(dirname "$1")" && pwd
+ cd "${OLDPWD}"
+}
+
+# Print relative path from input file to worktree
+relpath_to_worktree() # file
+{
+ # Build directory from worktree to path
+ dir__="$(absdir "$1")"
+ dir__="$(printf '%s\n' "${dir__}" | sed "s;^${worktree}[/]\{0,\};;g")"
+
+ # Ensure that the directory if a subpath of the worktree
+ if ! [ -d "${dir__}" ]; then
+ return 1
+ fi
+
+ printf '%s\n' "${dir__}" | sed 's/\//\n/g' | while read -r i; do
+ printf "../"
+ done
+}
+
+# Delete irrelevant data
+strip_dummy()
+{
+ # - Remove comments
+ # - Remove empty lines
+ # - Remove heading an trailing spaces
+ sed 's/#.\{0,\}$//g' \
+ | sed '/^[[:space:]]\{0,\}$/d' \
+ | sed -e 's/^[[:space:]]\{1,\}//g' -e 's/[[:space:]]\{1,\}$//g'
+}
+
+print_head()
+{
+ printf '<!DOCTYPE html>\n'
+ printf '<html lang="%s">\n' "${lang:-en}"
+ printf '<head>\n'
+ printf ' <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n'
+ printf ' <meta name="viewport" content="width=device-width, initial-scale=1">\n'
+ printf ' <title>|M|S> %s</title>\n' "${section}"
+ printf ' <link rel="stylesheet" title="default" href="%smeso.css">\n' "${root}"
+ printf '</head>\n'
+ printf '<body>\n'
+}
+
+# Print top-level menu
+print_menu1()
+{
+ printf '<div id="menu">\n'
+
+ n__="0"
+
+ strip_dummy < "${worktree}/menu.tsv" | while read -r i; do
+
+ # Retrieve the menu label and its associated directory
+ label__="$(echo "${i}" | cut -d' ' -f1)"
+ directory__="$(echo "${i}" | cut -d' ' -f2)"
+
+ if [ "${n__}" -gt 0 ]; then
+ printf '  | \n'
+ fi
+ n__="$((n__+1))"
+
+ if [ "${directory__}" = "${section}" ]; then
+ printf ' %s\n' "${label__}"
+
+ else
+ # Get the default page of the section, i.e., the first entry in
+ # its index. The menu is a link to it.
+ index__="$(strip_dummy < "${worktree}/${directory__}/index.tsv" \
+ | head -1 | cut -d' ' -f2)"
+ printf ' <a href="%s%s/%s">%s</a>\n' \
+ "${root}" "${directory__}" "${index__}" "${label__}"
+ fi
+ done
+
+ printf '</div>\n<hr>\n'
+}
+
+# Print second-level menu
+print_menu2()
+{
+
+ printf '<div id="sub-menu">\n'
+
+ n__="0"
+
+ strip_dummy < "${worktree}/${section}/index.tsv" | while read -r i; do
+ label__="$(echo "${i}" | cut -d' ' -f1)"
+ uri__="$(echo "${i}" | cut -d' ' -f2)"
+
+ if [ "${n__}" -gt 0 ]; then
+ printf '  . \n'
+ fi
+ n__="$((n__+1))"
+
+ if [ "${uri__}" = "${html}" ]; then
+ # This is the current web page
+ printf ' <span class="cur">%s</span>\n' "${label__}"
+
+ elif echo "${uri__}" | grep -qe "^http[s]\{0,1\}://"; then
+ # The entry links to an http[s] URL
+ printf ' <a href="%s">%s</a>\n' "${uri__}" "${label__}"
+
+ else
+ # The entry links to a local web page for the section.
+ printf ' <a href="%s%s/%s">%s</a>\n' \
+ "${root}" "${section}" "${uri__}" "${label__}"
+ fi
+ done
+
+ printf '</div>\n'
+}
+
+########################################################################
+# The script
+########################################################################
+if [ "$#" -lt 1 ]; then
+ >&2 printf 'usage: %s file\n' "${0##*/}"
+ exit 1
+fi
+
+# Define the absolute path of the working directory, i.e. the root
+# directory of the site, and enter it.
+worktree="$(absdir "$0")"
+cd "${worktree}"
+
+# Define the section directory where the input file is located, i.e., the
+# subdirectory in the working directory.
+section="$(absdir "$1")"
+section="$(printf '%s\n' "${section}" | sed "s;^${worktree}[/]\{0,\};;g")"
+section="${section%%/*}"
+
+if [ -z "${section}" ]; then
+ >&2 printf \
+ '%s: unable to extract the section directory from file %s\n' \
+ "${0##*/}" "$1"
+ exit 1
+fi
+
+# Find the menu entry corresponding to the section directory
+entry="$(strip_dummy < "${worktree}/menu.tsv" \
+ | sed -n "/\t${section}/p")"
+
+if [ -z "${entry}" ]; then
+ >&2 printf \
+'%s: the %s directory of the %s file is not a valid menu entry '\
+'(see menu.tsv)\n' "${0##*/}" "${section}" "$1"
+ exit 1
+fi
+
+if ! [ -e "${section}/index.tsv" ]; then
+ >&2 printf \
+ '%s: unable to find the index.tsv file in the directory %s\n' \
+ "${0##*/}" "${section}"
+ exit 1
+fi
+
+# Define whether the entry corresponds to a subsection index, i.e.,
+# whether it is the file to be displayed when entering the subsection.
+html="$(basename "$1")"
+subentry="$(strip_dummy < "${worktree}/${section}/index.tsv" \
+ | sed -n "/\t${html}/p")"
+
+if [ -n "${subentry}" ]; then
+ lang="$(echo "${subentry}" | cut -d' ' -f3)"
+else
+ # Indicate that the file is not accessible via the menu
+ >&2 printf '%s: %s is not an index file of the section %s\n' \
+ "${0##*/}" "${html}" "${section}"
+fi
+
+root="$(relpath_to_worktree "$1")"
+
+print_head
+print_menu1
+print_menu2
diff --git a/menu.tsv b/menu.tsv
@@ -0,0 +1,6 @@
+#Home misc
+A.R.T art
+#htrdr htrdr
+#Schiff schiff
+#Solstice solstice
+#Stardis stardis