commit 36a88c6465a701b1b8b1023698c24cdc7976ab25
parent e676a6fb2ace575c9b3c13ee26cea692a8bbb964
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 9 Jan 2023 10:38:22 +0100
Merge branch 'release_0.0.4'
Diffstat:
19 files changed, 343 insertions(+), 343 deletions(-)
diff --git a/README.md b/README.md
@@ -17,9 +17,8 @@ They rely on the [CMake](http://www.cmake.org) and the
on the [RSys](https://gitlab.com/vaplv/rsys/) library. Furthermore, the
`les2htcp` tool depends on the
[NetCDF](https://www.unidata.ucar.edu/software/netcdf/) C library.
-Both eventually depend on the [AsciiDoc](https://asciidoc.org/) suite of
-tools; if available, the man pages for the reference documentation will be
-generated.
+Both eventually depend on [scdoc](https://sr.ht/~sircmpwn/scdoc/)
+which, if available, is used to generate the man pages.
To build them, first ensure that CMake is installed on your system. Then
install the RCMake package as well as the aforementioned prerequisites. Finally
@@ -29,10 +28,34 @@ 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.
+## Release notes
+
+### Version 0.0.4
+
+- Use scdoc rather than asciidoc as file format for man sources.
+- Make internal shell scripts POSIX compliant.
+
+### Version 0.0.3
+
+- Fix a man page error: the RCT field was named "liquid vapor mixing report"
+ rather than "liquid _water_ mixing report".
+- Miscellaneous minor corrections to log messages.
+
+### Version 0.0.2
+
+Fix the les2htcp man page. The units were incorrect for the water vapor
+mixing ratio and the liquid water mixing ratio.
+
+### Version 0.0.1
+
+- Fix warnings and compilation errors when using the NetCDF library in version
+ 4.4.0.
+- Fix compilation errors on systems with GNU C library version less than 2.19.
+
## Copyright notice
-Copyright (C) 2018, 2020, 2021 |Meso|Star> (<contact@meso-star.com>).
-Copyright (C) 2018 Centre National de la Recherche Scientifique (CNRS).
+Copyright (C) 2018, 2020-2023 |Méso|Star> (<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
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 (contact-edstar@laplace.univ-tlse.fr)
#
# 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
@@ -59,6 +60,11 @@ endif()
################################################################################
# Sub projects
################################################################################
+set(VERSION_MAJOR 0)
+set(VERSION_MINOR 0)
+set(VERSION_PATCH 4)
+set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
+
add_subdirectory(doc)
add_subdirectory(htcp)
add_subdirectory(les2htcp)
diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/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-2022 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 2018 CNRS
+# Copyright (C) 2018 Université Paul Sabatier (contact-edstar@laplace.univ-tlse.fr)
#
# 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
@@ -19,49 +20,27 @@ set(HTCP_DOC_DIR ${PROJECT_SOURCE_DIR}/../doc)
################################################################################
# Look for the a2x program
################################################################################
-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 htcp man pages cannot be generated.")
+ "The `scdoc' program is missing. "
+ "The High-Tune Cloud Properties man pages cannot be generated.")
return()
endif()
################################################################################
-# Copy doc files
-################################################################################
-set(MAN_NAMES htcp.5 les2htcp.1)
-
-set(MAN_FILES)
-foreach(_name IN LISTS MAN_NAMES)
- set(_src ${HTCP_DOC_DIR}/${_name}.txt)
- set(_dst ${CMAKE_CURRENT_BINARY_DIR}/${_name}.txt)
- add_custom_command(
- OUTPUT ${_dst}
- COMMAND ${CMAKE_COMMAND} -E copy ${_src} ${_dst}
- DEPENDS ${_src}
- COMMENT "Copy the asciidoc ${_src}"
- VERBATIM)
- list(APPEND MAN_FILES ${_dst})
-endforeach()
-add_custom_target(man-copy ALL DEPENDS ${MAN_FILES})
-
-################################################################################
# ROFF man pages
################################################################################
-set(A2X_OPTS -dmanpage -fmanpage)
-set(MAN_FILES)
+set(MAN_NAMES htcp.5 les2htcp.1)
set(MAN5_FILES)
set(MAN1_FILES)
-foreach(_name IN LISTS MAN_NAMES)
- set(_man ${CMAKE_CURRENT_BINARY_DIR}/${_name})
- set(_txt ${CMAKE_CURRENT_BINARY_DIR}/${_name}.txt)
+foreach(_man IN LISTS MAN_NAMES)
+ set(_src ${HTCP_DOC_DIR}/${_man}.scd)
add_custom_command(
OUTPUT ${_man}
- COMMAND ${A2X} ${A2X_OPTS} ${_txt}
- DEPENDS man-copy ${_txt}
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND ${SCDOC} < ${_src} > ${_man}
+ DEPENDS ${_src}
COMMENT "Build ROFF man page ${_man}"
VERBATIM)
list(APPEND MAN_FILES ${_man})
@@ -69,15 +48,13 @@ foreach(_name IN LISTS MAN_NAMES)
string(REGEX MATCH "^.*.5$" _man5 ${_man})
string(REGEX MATCH "^.*.1$" _man1 ${_man})
if(_man1)
- list(APPEND MAN1_FILES ${_man1})
+ list(APPEND MAN1_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_man1})
elseif(_man5)
- list(APPEND MAN5_FILES ${_man5})
+ list(APPEND MAN5_FILES ${CMAKE_CURRENT_BINARY_DIR}/${_man5})
else()
message(FATAL_ERROR "Unexpected man type")
endif()
endforeach()
-add_custom_target(man-roff ALL DEPENDS ${MAN_FILES})
-
+add_custom_target(man-roff ALL DEPENDS ${MAN_NAMES})
install(FILES ${MAN1_FILES} DESTINATION share/man/man1)
install(FILES ${MAN5_FILES} DESTINATION share/man/man5)
-
diff --git a/cmake/htcp/CMakeLists.txt b/cmake/htcp/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
@@ -20,11 +21,6 @@ project(htcp-library C)
################################################################################
# Configure and define targets
################################################################################
-set(VERSION_MAJOR 0)
-set(VERSION_MINOR 0)
-set(VERSION_PATCH 3)
-set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
-
set(HTCP_FILES_SRC htcp.c)
set(HTCP_FILES_INC )
set(HTCP_FILES_INC_API htcp.h)
diff --git a/cmake/les2htcp/CMakeLists.txt b/cmake/les2htcp/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) 208 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
@@ -35,11 +36,6 @@ include_directories(
################################################################################
# Generate files
################################################################################
-set(VERSION_MAJOR 0)
-set(VERSION_MINOR 0)
-set(VERSION_PATCH 2)
-set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
-
configure_file(${HTCP_SOURCE_DIR}/les2htcp.h.in
${CMAKE_CURRENT_BINARY_DIR}/les2htcp.h @ONLY)
diff --git a/doc/htcp.5.scd b/doc/htcp.5.scd
@@ -0,0 +1,98 @@
+htcp(5)
+
+; Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
+; Copyright (C) 2018 CNRS
+; Copyright (C) 2018 Université Paul Sabatier (contact-edstar@laplace.univ-tlse.fr)
+;
+; 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
+
+htcp - High-Tune: Cloud Properties file format
+
+# DESCRIPTION
+
+*htcp* is a binary file format that describes properties on liquid water
+content in suspension within clouds. The *les2htcp*(1) command can be used to
+generate a *htcp* file from cloud properties saved in a NetCDF file format.
+
+The cloud properties are actually spatio temporal double precision floating
+point data, structured in a 4D grid whose definition and spatial origin is
+given by the _<definition>_ and the _<lower-pos>_ fields. The size of a grid
+cell along the X and Y dimension is constant while the size along the Z axis
+can be irregular. Is such case, the _<is-Z-irregular>_ header flag is set to 1
+and the sizes of the cells in Z are explicitly listed in _<voxel-size>_. Note
+that in *htcp*, the spatial dimensions are defined in meters, i.e. values
+listed in _<lower-pos>_ and _<voxel-size>_ are meters.
+
+For a given property, the list of its spatio temporal data are linearly listed
+along the X, Y, Z and time dimension, in that order. The address where its
+first data is stored is aligned on the value defined by the file header field
+_<pagesize>_; several bytes of padding can be thus added priorly to a property
+in order to ensure that its first data is correctly aligned.
+
+Available cloud properties are:
+
+- _<RVT>_: water vapor mixing ratio in kg of water per m^3 of dry air.
+- _<RCT>_: liquid water in suspension mixing ratio in kg of water per m^3 of dry
+ air.
+- _<PABST>_: pressure in Pascal.
+- _<T>_: temperature in Kelvin.
+
+# BINARY FILE FORMAT
+
+Data are encoded with respect to the little endian bytes ordering, i.e. least
+significant bytes are stored first.
+
+```
+<htcp> ::= <header>
+ <definition>
+ <lower-pos>
+ <voxel-size>
+ <padding>
+ <RVT>
+ <padding>
+ <RCT>
+ <padding>
+ <PABST>
+ <padding>
+ <T>
+ <padding>
+
+<header> ::= <pagesize> <is-Z-irregular>
+<definition> ::= <X> <Y> <Z> <time> # Spatial and temporal definition
+<lower-pos> ::= DOUBLE DOUBLE DOUBLE # Spatial origin of the grid
+<voxel-size> ::= DOUBLE DOUBLE # Size of a cell in X and Y
+ DOUBLE [ DOUBLE ... ] # Size of the cells in Z
+
+<pagesize> ::= INT64
+<is-Z-irregular>
+ ::= INT8
+
+<X> ::= INT32
+<Y> ::= INT32
+<Z> ::= INT32
+<time> ::= INT32
+
+<RVT> ::= DOUBLE [ DOUBLE ... ] # Water vapor mixing ratio
+<RCT> ::= DOUBLE [ DOUBLE ... ] # Liquid water in suspension mixing ratio
+<PABST> ::= DOUBLE [ DOUBLE ... ] # Pressure
+<T> ::= DOUBLE [ DOUBLE ... ] # Temperature
+
+<padding> ::= [ BYTE ... ]
+```
+
+# SEE ALSO
+
+*les2htcp*(1)
diff --git a/doc/htcp.5.txt b/doc/htcp.5.txt
@@ -1,101 +0,0 @@
-// Copyright (C) 2018 CNRS, |Meso|Star>, 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:
-
-htcp(5)
-=======
-
-NAME
-----
-htcp - High-Tune: Cloud Properties file format
-
-DESCRIPTION
------------
-
-*htcp* is a binary file format that describes properties on liquid water
-content in suspension within clouds. The *les2htcp*(1) command can be used to
-generate a *htcp* file from cloud properties saved in a NetCDF file format.
-
-The cloud properties are actually spatio temporal double precision floating
-point data, structured in a 4D grid whose definition and spatial origin is
-given by the _<definition>_ and the _<lower-pos>_ fields. The size of a grid
-cell along the X and Y dimension is constant while the size along the Z axis
-can be irregular. Is such case, the _<is-Z-irregular>_ header flag is set to 1
-and the sizes of the cells in Z are explicitly listed in _<voxel-size>_. Note
-that in *htcp*, the spatial dimensions are defined in meters, i.e. values
-listed in _<lower-pos>_ and _<voxel-size>_ are meters.
-
-For a given property, the list of its spatio temporal data are linearly listed
-along the X, Y, Z and time dimension, in that order. The address where its
-first data is stored is aligned on the value defined by the file header field
-_<pagesize>_; several bytes of padding can be thus added priorly to a property
-in order to ensure that its first data is correctly aligned.
-
-Available cloud properties are:
-
-* _<RVT>_: water vapor mixing ratio in kg of water per m^3 of dry air.
-* _<RCT>_: liquid water in suspension mixing ratio in kg of water per m^3 of
- dry air.
-* _<PABST>_: pressure in Pascal.
-* _<T>_: temperature in Kelvin.
-
-BINARY FILE FORMAT
-------------------
-
-Data are encoded with respect to the little endian bytes ordering, i.e. least
-significant bytes are stored first.
-
-[verse]
--------
-<htcp> ::= <header>
- <definition>
- <lower-pos>
- <voxel-size>
- <padding>
- <RVT>
- <padding>
- <RCT>
- <padding>
- <PABST>
- <padding>
- <T>
- <padding>
-
-<header> ::= <pagesize> <is-Z-irregular>
-<definition> ::= <X> <Y> <Z> <time> # Spatial and temporal definition
-<lower-pos> ::= DOUBLE DOUBLE DOUBLE # Spatial origin of the grid
-<voxel-size> ::= DOUBLE DOUBLE # Size of a cell in X and Y
- DOUBLE [ DOUBLE ... ] # Size of the cells in Z
-
-<pagesize> ::= INT64
-<is-Z-irregular>
- ::= INT8
-
-<X> ::= INT32
-<Y> ::= INT32
-<Z> ::= INT32
-<time> ::= INT32
-
-<RVT> ::= DOUBLE [ DOUBLE ... ] # Water vapor mixing ratio
-<RCT> ::= DOUBLE [ DOUBLE ... ] # Liquid water in suspension mixing ratio
-<PABST> ::= DOUBLE [ DOUBLE ... ] # Pressure
-<T> ::= DOUBLE [ DOUBLE ... ] # Temperature
-
-<padding> ::= [ BYTE ... ]
--------
-
-SEE ALSO
---------
-*les2htcp*(1)
diff --git a/doc/les2htcp.1.scd b/doc/les2htcp.1.scd
@@ -0,0 +1,131 @@
+les2htcp(1)
+
+; Copyright (C) 2018, 2020-2023 |Méso|Star> (contact@meso-star.com)
+; Copyright (C) 2018 Centre National de la Recherche Scientifique
+; Copyright (C) 2018 Université Paul Sabatier (contact-edstar@laplace.univ-tlse.fr)
+;
+; 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
+
+les2htcp - convert cloud properties from NetCDF to htcp(5) file format
+
+# SYNOPSIS
+
+les2htcp [_option_] ... -i __NetCDF__
+
+# DESCRIPTION
+*les2htcp* generates a *htcp*(5) file from cloud properties stores in a NetCDF
+file [1]. Expected variables in the submitted NetCDF file are:
+
+- _W_E_direction_ *and* _S_N_direction_: one dimensional list of position of the
+ center of each cell along the West-East and South-North horizontal axis,
+ respectively. This should be a homogeneous mesh: each cell should have the
+ same width along each axis. The unit is assumed to be the meter but it can
+ be adjusted by the *-m* option.
+- _VLEV_ *or* _vertical_levels_: position of the center of each cell along the
+ vertical axis. The vertical mesh can possibly be inhomogeneous: each cell
+ can have different vertical extent. At least one of this variable must be
+ defined. Note that _VLEV_ is a four dimensional variable while
+ _vertical_levels_ is assumed to be one dimensional. In all cases, *les2htcp*
+ assumes that the vertical columns are the same for each cell along the
+ West-East and South-North axis. The unit is assumed to be the meter but it
+ can be adjusted by the *-m* option.
+- _RVT_: water vapor mixing ratio in each grid cell; in kg of water per kg of
+ air.
+- _RCT_: liquid water (in suspension) mixing ratio in each grid cell; in kg of
+ water per kg of dry air.
+- _PABST_: pressure in each grid cell in Pascal.
+- _THT_: potential temperature in each grid cell in Kelvin.
+
+# OPTIONS
+
+*-c*
+ Advanced checks on the validity of the submitted _NetCDF_ file with respect
+ to the *les2htcp* prerequisites on the NetCDF data. Note that this option
+ can increase significantly the conversion time.
+
+*-f*
+ Force overwrite of the _output_ file.
+
+*-h*
+ List short help and exit.
+
+*-i* _NetCDF_
+ NetCDF file to convert.
+
+*-m* _float-to-meter_
+ Scale factor from floating point unit to meters. By default it is set to 1.
+
+*-o* _output_
+ Destination file where the *htcp*(5) file is written. If not defined, the
+ results are written to standard output.
+
+*-p* _page-size_
+ Targeted page size in bytes; must be a power of 2. The size of the converted
+ NetCDF data and their starting address into the *htcp*(5) file are aligned
+ according to _page-size_. By default, _page-size_ is 4096 bytes.
+
+*-q*
+ Write nothing to _output_. Might be used in conjunction of the *-c* option
+ to only check the submitted _NetCDF_.
+
+*-v*
+ Display version information and exit.
+
+# EXAMPLES
+
+Convert the _clouds.nc_ NetCDF file. Write the resulting *htcp*(5) file in
+_cloud.htcp_ excepted if the file already exists; in this case an error is
+notified, the program stops and the _cloud.htcp_ file remains unchanged:
+
+```
+les2htcp -i clouds.nc -o clouds.htcp
+```
+
+Convert the _clouds_km.nc_ file to *htcp*(5) file format. Use the *-f* option
+to write the output file _clouds.htcp_ even though it already exists. The
+_clouds_km.nc_ file to convert has its spatial unit in kilo-meters while the
+*htcp*(5) file format assumes meters: use the *-m* _1000_ option to map
+kilo-meters to meters:
+
+```
+les2htcp -i clouds_km.nc -m 1000 -o clouds.htcp
+```
+
+Check that the submitted _clouds.nc_ file is valid regarding the
+*les2htcp* constraints. Use the *-q* option to disable the generation of
+output data:
+
+```
+les2htcp -c -i clouds.nc -q
+```
+
+# COPYRIGHT
+
+Copyright © 2018, 2020 |Méso|Star> <contact@meso-star.com>++
+Copyright © 2018 Centre National de la Recherche Scientifique++
+Copyright © 2018 Université Paul Sabatier <contact-edstar@laplace.univ-tlse.fr>
+
+# LICENSE
+
+*les2htcp* is free software released under the GPLv3+ license: GNU GPL version
+3 or later <https://gnu.org/licenses/gpl.html>. You are free to change and
+redistribute it. There is NO WARRANTY, to the extent permitted by law.
+
+# SEE ALSO
+
+. Network Common Data Form - <https://www.unidata.ucar.edu/software/netcdf/>
+
+*htcp*(5)
diff --git a/doc/les2htcp.1.txt b/doc/les2htcp.1.txt
@@ -1,134 +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:
-
-les2htcp(1)
-===========
-
-NAME
-----
-les2htcp - convert cloud properties from NetCDF to htcp(5) file format
-
-SYNOPSIS
---------
-[verse]
-*les2htcp* [_option_] ... -i __NetCDF__
-
-DESCRIPTION
------------
-*les2htcp* generates a *htcp*(5) file from cloud properties stores in a NetCDF
-file [1]. Expected variables in the submitted NetCDF file are:
-
-* _W_E_direction_ *and* _S_N_direction_: one dimensional list of position of the
- center of each cell along the West-East and South-North horizontal axis,
- respectively. This should be a homogeneous mesh: each cell should have the
- same width along each axis. The unit is assumed to be the meter but it can
- be adjusted by the *-m* option.
-
-* _VLEV_ *or* _vertical_levels_: position of the center of each cell along the
- vertical axis. The vertical mesh can possibly be inhomogeneous: each cell
- can have different vertical extent. At least one of this variable must be
- defined. Note that _VLEV_ is a four dimensional variable while
- _vertical_levels_ is assumed to be one dimensional. In all cases, *les2htcp*
- assumes that the vertical columns are the same for each cell along the
- West-East and South-North axis. The unit is assumed to be the meter but it
- can be adjusted by the *-m* option.
-
-* _RVT_: water vapor mixing ratio in each grid cell; in kg of water per kg of
- dry air.
-
-* _RCT_: liquid water (in suspension) mixing ratio in each grid cell; in kg of
- water per kg of dry air.
-
-* _PABST_: pressure in each grid cell in Pascal.
-
-* _THT_: potential temperature in each grid cell in Kelvin.
-
-OPTIONS
--------
-*-c*::
- Advanced checks on the validity of the submitted _NetCDF_ file with respect
- to the *les2htcp* prerequisites on the NetCDF data. Note that this option
- can increase significantly the conversion time.
-
-*-f*::
- Force overwrite of the _output_ file.
-
-*-h*::
- List short help and exit.
-
-*-i* _NetCDF_::
- NetCDF file to convert.
-
-*-m* _float-to-meter_::
- Scale factor from floating point unit to meters. By default it is set to 1.
-
-*-o* _output_::
- Destination file where the *htcp*(5) file is written. If not defined, the
- results are written to standard output.
-
-*-p* _page-size_::
- Targeted page size in bytes; must be a power of 2. The size of the converted
- NetCDF data and their starting address into the *htcp*(5) file are aligned
- according to _page-size_. By default, _page-size_ is 4096 bytes.
-
-*-q*::
- Write nothing to _output_. Might be used in conjunction of the *-c* option
- to only check the submitted _NetCDF_.
-
-*-v*::
- Display version information and exit.
-
-EXAMPLES
---------
-
-Convert the *clouds.nc* NetCDF file. Write the resulting *htcp*(5) file in
-*cloud.htcp* excepted if the file already exists; in this case an error is
-notified, the program stops and the *cloud.htcp* file remains unchanged:
-
- $ les2htcp -i clouds.nc -o clouds.htcp
-
-Convert the *clouds_km.nc* file to *htcp*(5) file format. Use the *-f* option
-to write the output file *clouds.htcp* even though it already exists. The
-*clouds_km.nc* file to convert has its spatial unit in kilo-meters while the
-*htcp*(5) file formats assumes meters: use the *-m 1000* option to map
-kilo-meters to meters:
-
- $ les2htcp -i clouds_km.nc -m 1000 -o clouds.htcp
-
-Check that the submitted *clouds.nc* file is valid regarding the
-*les2htcp* constraints. Use the *-q* option to disable the generation of
-output data:
-
- $ les2htcp -c -i clouds.nc -q
-
-NOTES
------
-1. Network Common Data Form -
-<https://www.unidata.ucar.edu/software/netcdf/>
-
-COPYRIGHT
----------
-Copyright © 2018, 2020 |Meso|Star> <contact@meso-star.com>.
-Copyright © 2018 CNRS, Université Paul Sabatier
-<contact-edstar@laplace.univ-tlse.fr>.
-*les2htcp* is free software released under the GPLv3+ license: GNU GPL version
-3 or later <https://gnu.org/licenses/gpl.html>. You are free to change and
-redistribute it. There is NO WARRANTY, to the extent permitted by law.
-
-SEE ALSO
---------
-*htcp*(5)
diff --git a/src/dump_netcdf_data.sh b/src/dump_netcdf_data.sh
@@ -1,6 +1,7 @@
-#!/bin/bash
+#!/bin/sh
-# Copyright (C) 2018 |Meso|Star> (contact@meso-star.com)
+# Copyright (C) 2018, 2020-2022 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 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
@@ -14,25 +15,25 @@
#
# 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
>&2 echo "Usage: $0 VAR-NAME LES-NETCDF "
- exit -1
+ exit 1
fi
-if [ ! -f $2 ]; then
+if [ ! -f "$2" ]; then
>&2 echo "\"$2\" is not a valid file."
- exit -1
+ exit 1
fi
-name=$(basename $2)
+name=$(basename "$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/dump_netcdf_desc.sh b/src/dump_netcdf_desc.sh
@@ -1,6 +1,7 @@
-#!/bin/bash
+#!/bin/sh
-# Copyright (C) 2018 |Meso|Star> (contact@meso-star.com)
+# Copyright (C) 2018, 2020-2022 |Méso|Star> (contact@meso-star.com)
+# Copyright (C) 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
@@ -15,33 +16,32 @@
# 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 1 ]; then
- >&2 echo "Usage: $0 -NAME LES-NETCDF "
- exit -1
+ >&2 printf "Usage: %s -NAME LES-NETCDF\n" "$0"
+ exit 1
fi
-dimensions=$(ncdump -h $1 | sed '/^ *variables/,$d' | sed '1,2d')
-nx=$(echo $dimensions | sed -n 's/^.*W_E_direction *= *\([0-9]\+\) *;.*$/\1/p')
-ny=$(echo $dimensions | sed -n 's/^.*S_N_direction *= *\([0-9]\+\) *;.*$/\1/p')
-nz=$(echo $dimensions | sed -n 's/^.*vertical_levels *= *\([0-9]\+\) *;.*$/\1/p')
-ntimes=$(echo $dimensions | sed -n 's/^.*time *= *\([0-9]\+\) *;.*$/\1/p')
+dimensions=$(ncdump -h "$1" | sed '/^ *variables/,$d' | sed '1,2d')
+nx=$(echo "${dimensions}" | sed -n 's/^.*W_E_direction *= *\([0-9]\{1,\}\) *;.*$/\1/p')
+ny=$(echo "${dimensions}" | sed -n 's/^.*S_N_direction *= *\([0-9]\{1,\}\) *;.*$/\1/p')
+nz=$(echo "${dimensions}" | sed -n 's/^.*vertical_levels *= *\([0-9]\{1,\}\) *;.*$/\1/p')
+ntimes=$(echo "${dimensions}" | sed -n 's/^.*time *= *\([0-9]\{1,\}\) *;.*$/\1/p')
-if [ -z "$ntimes" ]; then
- ntimes=$(echo $dimensions | sed -n 's/^.*time *=.*\/\/ *(\([0-9]\+\) currently).*$/\1/p')
+if [ -z "${ntimes}" ]; then
+ ntimes=$(echo "${dimensions}" | sed -n 's/^.*time *=.*\/\/ *(\([0-9]\{1,\}\) currently).*$/\1/p')
fi
-if [ -z "$nx" -o -z "$ny" -o -z "$nz" -o -z "$ntimes" ]; then
- >&2 echo $0: Error retrieving the dimensions of \"$1\"
- exit -1
+if [ -z "${nx}" ] || [ -z "${ny}" ] || [ -z "${nz}" ] || [ -z "${ntimes}" ]; then
+ >&2 printf "%s: Error retrieving the dimensions of \"%s\"\n" "$0" "$1"
+ exit 1
fi
-name=$(basename $1)
+name=$(basename "$1")
name=${name%.*}
{
- echo $nx
- echo $ny
- echo $nz
- echo $ntimes
-} > ${name}_desc
+ echo "${nx}"
+ echo "${ny}"
+ echo "${nz}"
+ echo "${ntimes}"
+} > "${name}_desc"
diff --git a/src/htcp.c b/src/htcp.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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/htcp.h b/src/htcp.h
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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/les2htcp.c b/src/les2htcp.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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
@@ -81,10 +82,8 @@ print_help(const char* cmd)
" -v display version information and exit.\n");
printf("\n");
printf(
-"Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com).\n"
-"Copyright (C) 2018 CNRS, Université Paul Sabatier. les2htcp is free software\n"
-"released under the GNU GPL license, version 3 or later. You are free to\n"
-"change or redistribute it under certain conditions\n"
+"les2htcp is free software released under the GNU GPL license, version 3 or\n"
+"later. You are free to change or redistribute it under certain conditions\n"
"<http://gnu.org/licenses/gpl.html>\n");
}
diff --git a/src/les2htcp.h.in b/src/les2htcp.h.in
@@ -1,4 +1,6 @@
-/* Copyright (C) 2018 |Meso|Star> (contact@meso-star.com)
+/* Copyright (C) 2018, 2020-2022 |Méso|Star> (contact@meso-star.com)
+ * Copyright (C) 2018 CNRS
+ * Copyright (C) 2018 Université Paul Sabatier (contact-edstar@laplace.univ-tlse.fr)
*
* 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_htcp.c b/src/test_htcp.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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_htcp_load.c b/src/test_htcp_load.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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_htcp_load_from_file.c b/src/test_htcp_load_from_file.c
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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_htcp_utils.h b/src/test_htcp_utils.h
@@ -1,5 +1,6 @@
-/* Copyright (C) 2018, 2020, 2021 |Meso|Star> (contact@meso-star.com)
- * Copyright (C) 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 (contact-edstar@laplace.univ-tlse.fr)
*
* 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