htmie

Optical properties of water droplets
git clone git://git.meso-star.fr/htmie.git
Log | Files | Refs | README | LICENSE

commit 861ac140918578a4aadc79ec912ff109ea4b9e45
parent b6d0c1217a280c4a0e1df6c99631d687b57d7d35
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  9 Jan 2023 12:07:59 +0100

Merge branch 'release_0.0.4'

Diffstat:
MREADME.md | 42+++++++++++++++++++++++++++++++++---------
Mcmake/CMakeLists.txt | 21++++++++++-----------
Adoc/htmie.5.scd | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ddoc/htmie.5.txt | 57---------------------------------------------------------
Msrc/dump_netcdf_data.sh | 16++++++++--------
Msrc/htmie.c | 5+++--
Msrc/htmie.h | 5+++--
Msrc/test_htmie.c | 5+++--
Msrc/test_htmie_load.c | 5+++--
Msrc/test_htmie_utils.h | 5+++--
10 files changed, 120 insertions(+), 95 deletions(-)

diff --git a/README.md b/README.md @@ -8,7 +8,9 @@ This program relies on the [CMake](http://www.cmake.org) and the [RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends on the [RSys](https://gitlab.com/vaplv/rsys/), and -[NetCDF](https://www.unidata.ucar.edu/software/netcdf/) C libraries. +[NetCDF](https://www.unidata.ucar.edu/software/netcdf/) C libraries. It +optionally depends on [scdoc](https://sr.ht/~sircmpwn/scdoc/) which, if +available, is used to generate the man pages. First ensure that CMake is installed on your system. Then install the RCMake package as well as the aforementioned prerequisites. Finally generate the @@ -18,13 +20,35 @@ resulting project can be edited, built, tested and installed as any CMake project. Refer to the [CMake](https://cmake.org/documentation) for further informations on CMake. -## Licenses +## Release notes -Copyright (C) 2018, 2020, 2021 [|Meso|Star](http://www.meso-star.com) -<contact@meso-star.com>. Copyright (C) 2018 Centre National de la Recherche -Scientifique (CNRS), Université Paul Sabatier -<contact-edstar@laplace.univ-tlse.fr>. HTMie is free software released under -the GPL v3+ license: GNU GPL version 3 or later. You are welcome to -redistribute it under certain conditions; refer to the COPYING file for -details. +### Version 0.0.4 +Use scdoc rather than asciidoc as file format for man sources. + +### Version 0.0.3 + +Sets the CMake minimum version to 3.1: since CMake 3.20, version 2.8 has become +obsolete. + +### Version 0.0.2 + +Fix compilation warnings when using the NetCDF library in version 4.4.0. + +### Version 0.0.1 + +- Fix compilation errors when using the NetCDF library in version 4.4.0. +- Minor correction of linear interpolation: the interpolation parameter was not + correctly truncated between [0,1] in order to handle numerical inaccuracy. + +## Copyright + +Copyright (C) 2018, 2020-2023 [|Méso|Star](http://www.meso-star.com) (<contact@meso-star.com>) +Copyright (C) 2018 Centre National de la Recherche Scientifique (CNRS) +Copyright (C) 2018 Université Paul Sabatier (<contact-edstar@laplace.univ-tlse.fr>) + +## License + +HTMie is free software released under the GPL v3+ license: GNU GPL version 3 +or later. You are welcome to redistribute it under certain conditions; refer +to the COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,5 +1,6 @@ -# Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com) -# Copyright (C) 2018 CNRS, Université Paul Sabatier +# Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) +# Copyright (C) 2018 CNRS +# Copyright (C) 2018 Université Paul Sabatier # # 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 @@ -52,7 +53,7 @@ endif() ################################################################################ set(VERSION_MAJOR 0) set(VERSION_MINOR 0) -set(VERSION_PATCH 3) +set(VERSION_PATCH 4) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) set(HTMIE_FILES_SRC htmie.c) @@ -79,18 +80,16 @@ rcmake_setup_devel(htmie HTMIE ${VERSION} high_tune/htmie_version.h) ################################################################################ # Man pages ################################################################################ -find_program(A2X NAMES a2x a2x.py) -if(NOT A2X) +find_program(SCDOC NAMES scdoc) +if(NOT SCDOC) message(WARNING - "The `a2x' program is missing. " - "The htmie man pages cannot be generated.") + "The `scdoc' program is missing. " + "The High-Tune Mie man page cannot be generated.") else() - set(_src ${PROJECT_SOURCE_DIR}/../doc/htmie.5.txt) - set(_txt ${CMAKE_CURRENT_BINARY_DIR}/htmie.5.txt) + set(_src ${PROJECT_SOURCE_DIR}/../doc/htmie.5.scd) add_custom_command( OUTPUT htmie.5 - COMMAND ${CMAKE_COMMAND} -E copy ${_src} ${_txt} - COMMAND ${A2X} -dmanpage -fmanpage ${_txt} + COMMAND ${SCDOC} < ${_src} > htmie.5 DEPENDS ${_src} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Buid ROFF man page htmie.5" diff --git a/doc/htmie.5.scd b/doc/htmie.5.scd @@ -0,0 +1,54 @@ +htmie(5) + +; Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) +; Copyright (C) 2018 CNRS +; Copyright (C) 2018 Université Paul Sabatier +; +; 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/>. + +# NAME + +htmie - High-Tune: Mie's data file format + +# DESCRIPTION + +*htmie* is the file format used by *htrdr*(1) to describe the optical +properties of water droplets obtained by a Mie code. This format relies on the +NetCDF data format [1]. To be a valid *htmie* file, the NetCDF file must +define the following variables: + +*lambda*++ + One dimensional array of floating point data that lists the wavelengths +in nanometers for which the subsequent data are defined. + +*macs*++ + One dimensional array of massic absorption cross-sections in kg of liquid +water in suspension. + +*mscs*++ + One dimensional array of massic scattering cross-sections in kg of liquid +water in suspension. + +*g*++ + One dimensional array of asymmetry parameters of the equivalent +Henyey-Greenstein phase function. + +# NOTES + +. Network Common Data Form - <https://www.unidata.ucar.edu/software/netcdf/> + +# SEE ALSO + +*htrdr*(1) + diff --git a/doc/htmie.5.txt b/doc/htmie.5.txt @@ -1,57 +0,0 @@ -// Copyright (C) 2018, 2020 |Meso|Star> (contact@meso-star.com) -// Copyright (C) 2018 CNRS, Université Paul Sabatier -// -// 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/>. -:toc: - -htmie(5) -======= - -NAME ----- -htmie - High-Tune: Mie's data file format - -DESCRIPTION ------------ - -*htmie* is the file format used by *htrdr*(1) to describe the optical -properties of water droplets obtained by a Mie code. This format relies on the -NetCDF data format [1]. To be a valid *htmie* file, the NetCDF file must -define the following variables: - -*lambda*:: - One dimensional array of floating point data that lists the wavelengths - in nanometers for which the subsequent data are defined. - -*macs*:: - One dimensional array of massic absorption cross-sections in kg of liquid - water in suspension. - -*mscs*:: - One dimensional array of massic scattering cross-sections in kg of liquid - water in suspension. - -*g*:: - One dimensional array of asymmetry parameters of the equivalent - Henyey-Greenstein phase function. - -NOTES ------ -1. Network Common Data Form - -<https://www.unidata.ucar.edu/software/netcdf/> - -SEE ALSO --------- -*htrdr*(1) - diff --git a/src/dump_netcdf_data.sh b/src/dump_netcdf_data.sh @@ -1,6 +1,8 @@ -#!/bin/bash +#!/bin/sh -e -# Copyright (C) 2018 |Meso|Star> (contact@meso-star.com) +# Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) +# Copyright (C) 2018 CNRS +# Copyright (C) 2018 Université Paul Sabatier # # 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 @@ -14,26 +16,24 @@ # # 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 -set -o pipefail if [ $# -lt 2 ]; then echo "Usage: $0 VAR-NAME MIE-NETCDF " exit 0 fi -if [ ! -f $2 ]; then +if [ ! -f "$2" ]; then echo "\"$2\" is not a valid file." exit 0 fi -name=$(basename $2) +name=${2##*/} name=${name%.*} -ncdump -v $1 $2 \ +ncdump -v "$1" "$2" \ | sed -n "/^ *$1 *=/,\$p" \ | sed "s/^ *$1 *= *//g" \ | sed 's/[;} ]//g' \ | sed 's/,/\n/g' \ - | sed '/^ *$/d' > ${name}_${1} + | sed '/^ *$/d' > "${name}_${1}" diff --git a/src/htmie.c b/src/htmie.c @@ -1,5 +1,6 @@ -/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com) - * Copyright (C) 2018 CNRS, Université Paul Sabatier +/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2018 CNRS + * Copyright (C) 2018 Université Paul Sabatier * * 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 diff --git a/src/htmie.h b/src/htmie.h @@ -1,5 +1,6 @@ -/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com) - * Copyright (C) 2018 CNRS, Université Paul Sabatier +/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2018 CNRS + * Copyright (C) 2018 Université Paul Sabatier * * 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 diff --git a/src/test_htmie.c b/src/test_htmie.c @@ -1,5 +1,6 @@ -/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com) - * Copyright (C) 2018 CNRS, Université Paul Sabatier +/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2018 CNRS + * Copyright (C) 2018 Université Paul Sabatier * * 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 diff --git a/src/test_htmie_load.c b/src/test_htmie_load.c @@ -1,5 +1,6 @@ -/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com) - * Copyright (C) 2018 CNRS, Université Paul Sabatier +/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2018 CNRS + * Copyright (C) 2018 Université Paul Sabatier * * 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 diff --git a/src/test_htmie_utils.h b/src/test_htmie_utils.h @@ -1,5 +1,6 @@ -/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com) - * Copyright (C) 2018 CNRS, Université Paul Sabatier +/* Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com) + * Copyright (C) 2018 CNRS + * Copyright (C) 2018 Université Paul Sabatier * * 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