Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • icon-libraries/libfortran-support
1 result
Show changes
Commits on Source (27)
Showing
with 564 additions and 279 deletions
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: CC0-1.0
# ---------------------------------------------------------------
---
Language: Cpp
# BasedOnStyle: GNU
......
with section("parse"):
additional_commands = {
"check_macro_defined": {
"pargs": 2,
"flags": ["QUIET"],
"kwargs": {
"LANG": 1
}
},
"add_icon_c_test": {
"pargs": 2
},
"list_sources": {
"pargs": 1,
"flags": ["EXCLUDE_GENERATED"],
"kwargs": {
"DIRECTORY": 1,
"INCLUDE_REGEX": 1
}
},
"FortUTF_Find_Tests": {}
}
with section("format"):
line_width = 80
autosort = True
keyword_case = 'upper'
with section("markup"):
first_comment_is_literal = True
with section("lint"):
disabled_codes = ['C0301']
function_pattern = '[0-9a-z_]+'
macro_pattern = '[0-9a-z_]+'
local_var_pattern = '[a-zA-Z][0-9a-zA-z_]+'
private_var_pattern = '[a-z][a-z0-9_]+'
public_var_pattern = '[A-Z][0-9a-zA-Z_]+'
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: CC0-1.0
# ---------------------------------------------------------------
# CMake stage files:
/**/CMakeFiles/*
/**/_deps/*
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------
include:
- project: 'anw_dienste/ci-templates'
file: '.slurm-ci.yml'
stages:
- lint
- build_and_test
- build_and_test_OpenMP
- build_OpenACC
- coverage
- prepare
......@@ -28,86 +22,151 @@ workflow:
DEFAULT: '\033[0m'
RED: '\033[0;31m'
variables:
ACCOUNT: "ka1125"
SCHEDULER_PARAMETERS: "--account=$ACCOUNT --partition=shared"
nag:
stage: build_and_test
extends:
- .default
before_script:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0 nag/7.1-gcc-11.2.0
- export NAG_KUSARI_FILE="/etc/nag-license"
- mkdir nag71
- cd nag71
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=nagfor -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_RPATH=/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=nagfor -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_RPATH=/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante-fake, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check License"]
- levante, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
gcc11:
stage: build_and_test
extends:
- .default
before_script:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0
- mkdir gcc112
- cd gcc112
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_CXX_COMPILER=g++
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_CXX_COMPILER=g++
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante-fake, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check License"]
- levante, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
intel22:
stage: build_and_test
extends:
- .default
before_script:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0 intel-oneapi-compilers/2022.0.1-gcc-11.2.0
- mkdir intel22
- cd intel22
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_C_COMPILER=icc -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_CXX_COMPILER=icpc -DCMAKE_BUILD_RPATH=/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=icc -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_CXX_COMPILER=icpc -DCMAKE_BUILD_RPATH=/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante-fake, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check License"]
- levante, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
nvhpc:
stage: build_and_test
extends:
- .default
before_script:
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0 nvhpc/22.5-gcc-11.2.0
- mkdir nvhpc
- cd nvhpc
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=nvc -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_CXX_COMPILER=nvc++
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check CMake Style", "Check License"]
OpenMP_gcc11:
stage: build_and_test_OpenMP
extends:
- .default
before_script:
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0
- mkdir gcc112
- cd gcc112
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFS_ENABLE_OMP=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_CXX_COMPILER=g++
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante, hpc, dkrz
needs: ["gcc11"]
OpenMP_intel22:
stage: build_and_test_OpenMP
extends:
- .default
before_script:
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0 intel-oneapi-compilers/2022.0.1-gcc-11.2.0
- mkdir intel22
- cd intel22
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFS_ENABLE_OMP=ON -DCMAKE_C_COMPILER=icc -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_CXX_COMPILER=icpc -DCMAKE_BUILD_RPATH=/sw/spack-levante/gcc-11.2.0-bcn7mb/lib64
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante, hpc, dkrz
needs: ["intel22"]
OpenMP_nvhpc:
stage: build_and_test_OpenMP
extends:
- .default
before_script:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0 nvhpc/22.5-gcc-11.2.0
- mkdir nvhpc
- cd nvhpc
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_C_COMPILER=nvc -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_CXX_COMPILER=nvc++
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFS_ENABLE_OMP=ON -DCMAKE_C_COMPILER=nvc -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_CXX_COMPILER=nvc++
- make VERBOSE=1
- ctest --output-on-failure
tags:
- levante-fake, hpc, dkrz
needs: ["Check Typo", "Check OpenACC Style", "Check Style", "Check License"]
- levante, hpc, dkrz
needs: ["nvhpc"]
OpenACC:
stage: build_OpenACC
extends:
- .default
before_script:
- . /sw/etc/profile.levante && module use /sw/spack-levante/spack/modules && module list
- module list
script:
- module load gcc/11.2.0-gcc-11.2.0 nvhpc/22.5-gcc-11.2.0
- mkdir nvhpc
- cd nvhpc
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DFS_ENABLE_OPENACC=ON -DCMAKE_C_COMPILER=nvc -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_CXX_COMPILER=nvc++
- /sw/spack-levante/cmake-3.23.1-q5kzz6/bin/cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFS_ENABLE_OPENACC=ON -DCMAKE_C_COMPILER=nvc -DCMAKE_Fortran_COMPILER=nvfortran -DCMAKE_CXX_COMPILER=nvc++
- make VERBOSE=1
tags:
- levante-fake, hpc, dkrz
- levante, hpc, dkrz
needs: ["nvhpc"]
Check Typo:
stage: lint
before_script:
# install typo check package
- conda install typos
- conda install conda-forge::typos
script: typos
tags:
# choose conda available runner
......@@ -179,6 +238,19 @@ Check Style:
when: on_failure
needs: []
Check CMake Style:
stage: lint
before_script:
#install the formatting tool
- pip install cmake-format
script:
# check style for CMake files.
- cmake-lint CMakeLists.txt src/CMakeLists.txt test/CMakeLists.txt test/c/CMakeLists.txt test/fortran/CMakeLists.txt cmake/check_macro.cmake cmake/gtest_helper.cmake cmake/list_sources.cmake
tags:
# choose runner
- sphinx
needs: []
Check License:
stage: lint
before_script:
......@@ -231,7 +303,7 @@ Prepare Changelog:
artifacts:
paths:
- release_notes.md
needs: ["nag", "gcc11", "intel22", "nvhpc", "OpenACC"]
needs: ["nag", "OpenMP_gcc11", "OpenMP_intel22", "OpenMP_nvhpc", "OpenACC"]
Release:
stage: release
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: CC0-1.0
# ---------------------------------------------------------------
categories:
feature: New features
bugfix: Bug fixes
......
<!--
ICON
---------------------------------------------------------------
Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
Contact information: icon-model.org
See AUTHORS.TXT for a list of authors
See LICENSES/ for license information
SPDX-License-Identifier: CC0-1.0
---------------------------------------------------------------
-->
## What is the bug
_Please describe the bug in a couple of words._
## How do you fix it
......
<!--
ICON
---------------------------------------------------------------
Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
Contact information: icon-model.org
See AUTHORS.TXT for a list of authors
See LICENSES/ for license information
SPDX-License-Identifier: CC0-1.0
---------------------------------------------------------------
-->
## What is the new feature
_Please describe your feature in a couple of words._
## How is it implemented
......
ICON
---------------------------------------------------------------
Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
Contact information: icon-model.org
See AUTHORS.TXT for a list of authors
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: CC-BY-4.0
# ---------------------------------------------------------------
# A more complete author list is provided in the ICON repository.
Daniel Hupp
Daniel Reinert
......@@ -23,6 +12,7 @@ Jonas Jucker
Leonidas Linardakis
Luis Kornblueh
Marek Jacob
Mikael Stellio
Monika Esch
Nathanael Huebbe
Pradipta Samanta
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
......@@ -11,7 +11,10 @@
cmake_minimum_required(VERSION 3.18)
project(fortran-support VERSION 0.1.0 LANGUAGES Fortran C)
project(
fortran-support
VERSION 0.1.0
LANGUAGES Fortran C)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_TESTING "Build tests" ON)
......@@ -20,12 +23,7 @@ option(FS_ENABLE_BACKTRACE_TEST "Test backtrace function" ON)
option(FS_ENABLE_OMP "Build with OpenMP support" OFF)
option(FS_ENABLE_OPENACC "Build with OpenACC support" OFF)
option(FS_ENABLE_MIXED_PRECISION "Use mixed precision" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)
message(STATUS "Setting build type to '${CMAKE_BUILD_TYPE}' as none was specified")
endif(NOT CMAKE_BUILD_TYPE)
option(FS_ENABLE_SINGLE_PRECISION "Use single precision" OFF)
include(GNUInstallDirs)
......@@ -37,38 +35,27 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()
export(
EXPORT "${PROJECT_NAME}-targets"
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake"
)
export(EXPORT "${PROJECT_NAME}-targets"
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}"
COMPATIBILITY AnyNewerVersion
)
install(
EXPORT "${PROJECT_NAME}-targets"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake"
)
install(
FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake"
)
COMPATIBILITY AnyNewerVersion)
install(EXPORT "${PROJECT_NAME}-targets"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake")
install(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake")
include("${PROJECT_SOURCE_DIR}/cmake/list_sources.cmake")
......@@ -92,35 +79,28 @@ if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
set(c_format_sources "${format_sources}")
list(FILTER c_format_sources INCLUDE REGEX "\.(c|h|cpp|hpp)$")
add_custom_target(format-c
COMMAND
clang-format
--style=file
-i
${c_format_sources}
)
add_custom_target(
format-c
COMMAND clang-format --style=file -i ${c_format_sources}
COMMENT "Format C codes")
# Collect Fortran source files:
set(fortran_format_sources "${format_sources}")
list(FILTER fortran_format_sources INCLUDE REGEX "\.(f|F|f90|F90)$")
add_custom_target(format-fortran
COMMAND
# We do not use a config file but specify the formatting arguments on the
# command line because the feature requires an extra Python package and
# does not work for certain arguments even in the latest release
# (e.g., see https://github.com/pseewald/fprettify/issues/94):
fprettify
--case 2 2 2 1
--indent 2
--whitespace 2
--strip-comments
${fortran_format_sources}
)
add_custom_target(format
DEPENDS
format-c
format-fortran
)
add_custom_target(
format-fortran
COMMAND # We do not use a config file but specify the formatting arguments
# on the command line because the feature requires an extra Python
# package and does not work for certain arguments even in the latest
# release (e.g., see
# https://github.com/pseewald/fprettify/issues/94):
fprettify --case 2 2 2 1 --indent 2 --whitespace 2 --strip-comments
${fortran_format_sources}
COMMENT "Format Fortran codes")
add_custom_target(
format
DEPENDS format-c format-fortran
COMMENT "Format codes")
endif()
<!--
ICON
---------------------------------------------------------------
Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
Contact information: icon-model.org
See AUTHORS.TXT for a list of authors
See LICENSES/ for license information
SPDX-License-Identifier: CC-BY-4.0
---------------------------------------------------------------
-->
# Fortran-support library
This repository is an external library of ICON collecting low-level supporting modules of ICON.
......@@ -51,7 +38,6 @@ The `libfortran-support` library includes some general Fortran supporting module
- `mo_io_units`: io unit definitions
- `mo_namelist`: open/close namelist files
- `mo_octree`: octree data structure and operations
- `mo_random_number_generators`: generators for pseudo random numbers (should be moved to math-support once available)
- `mo_simple_dump`: array value dumping
- `mo_util_backtrace`: function backtrace
- `mo_util_file`: file operations
......@@ -120,7 +106,7 @@ Please open a merge request and select one of our templates: __[feature/bugfix]_
## Contact
This repository is mainly maintained by the following maintainers:
- __Yen-Chen Chen__ (yen-chen.chen@kit.edu)
- __Jonas Jucker__ (jonas.jucker@env.ethz.ch)
- __Mikael Stellio__ (mikael.stellio@c2sm.ethz.ch)
- __Will Sawyer__ (william.sawyer@cscs.ch)
This repository is owned by the `icon-libraries` group, contacts about general ICON library questions:
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.txt for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: CC0-1.0
# ---------------------------------------------------------------
version = 1
[[annotations]]
# Documentation and its source files:
path = [
"AUTHORS.txt",
"README.md",
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss"
SPDX-License-Identifier = "CC-BY-4.0"
[[annotations]]
# "Unimportant" technical files:
path = [
".gitignore",
".gitlab/**",
".clang-format",
".cmake-format.py",
"_typos.toml"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss"
SPDX-License-Identifier = "CC0-1.0"
[[annotations]]
# GitLab CI configuration file:
path = [
".gitlab-ci.yml"
]
precedence = "aggregate"
SPDX-FileCopyrightText = "2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss"
SPDX-License-Identifier = "BSD-3-Clause"
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
# See LICENSES/ for license information
# SPDX-License-Identifier: CC0-1.0
# ---------------------------------------------------------------
[files]
extend-exclude = [
# Ragel generated files
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
......@@ -9,29 +9,27 @@
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------
# cmake-format: off
# check_macro_defined(<output>
# <macro>
# [LANG] <lang>
# [QUIET])
# cmake-format: on
# -----------------------------------------------------------------------------
# Sets <output> to ON or OFF depending on whether <macro> is already defined
# via CMAKE_${lang}_FLAGS or not. However, this only works when <lang> is Fortran
# Sets <output> to ON or OFF depending on whether <macro> is already defined via
# CMAKE_${lang}_FLAGS or not. However, this only works when <lang> is Fortran
# and fails otherwise.
#
# <lang> can be set using LANG. <lang> is set as Fortran by default.
#
function(check_macro_defined output macro)
cmake_parse_arguments(PARSE_ARGV 1 ARG
"QUIET"
"LANG"
""
)
cmake_parse_arguments(PARSE_ARGV 1 ARG "QUIET" "LANG" "")
if(NOT ARG_LANG)
if(NOT ARG_LANG)
set(ARG_LANG "Fortran")
endif()
if(NOT ARG_LANG STREQUAL "Fortran")
message(FATAL_ERROR "check_macro_defined supports only LANG Fortran")
endif()
......@@ -41,7 +39,8 @@ function(check_macro_defined output macro)
endif()
# Write a simple Fortran program that checks for ${macro}
set(check_source_code "
set(check_source_code
"
program main
implicit none
#ifdef ${macro}
......@@ -56,16 +55,15 @@ function(check_macro_defined output macro)
b = 2
end
")
# Write the Fortran code to a file
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.F90" "${check_source_code}")
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.F90"
"${check_source_code}")
# Try to compile the program
try_compile(result
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.F90"
)
try_compile(result "${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.F90")
if(NOT ARG_QUIET)
if(${result})
message(CHECK_PASS "yes")
......@@ -74,6 +72,8 @@ function(check_macro_defined output macro)
endif()
endif()
set(${output} ${result} PARENT_SCOPE)
set(${output}
${result}
PARENT_SCOPE)
endfunction()
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
......
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
......@@ -9,10 +9,32 @@
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------
macro(add_icon_c_test test_name file_names)
add_executable("CTest_${test_name}" ${file_names})
target_link_libraries("CTest_${test_name}" PRIVATE fortran-support::fortran-support GTest::gtest_main stdc++fs)
add_test(NAME "CTest_${test_name}" COMMAND "CTest_${test_name}")
set_property(TEST "CTest_${test_name}" PROPERTY LABELS C)
set_target_properties("CTest_${test_name}" PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
endmacro()
# cmake-format: off
# fs_add_c_test(<test_name>
# [SOURCES <sources>]
# [ARGS <args>])
# cmake-format: on
# -----------------------------------------------------------------------------
# Compiles a test executable with the name <test_name> using the source code
# <source>. Specify ctest arguments in <args> if necessary. The googletest and
# libfortran-support libraries will be linked automatically.
#
# The C++ standard is set to C++17.
#
function(fs_add_c_test test_name)
cmake_parse_arguments(PARSE_ARGV 1 ARG "" "" "SOURCES;ARGS")
if(NOT ARG_SOURCES)
set(ARG_SOURCES "${ARG_UNPARSED_ARGUMENTS}")
endif()
add_executable("CTest_${test_name}" ${ARG_SOURCES})
target_link_libraries(
"CTest_${test_name}" PRIVATE fortran-support::fortran-support
GTest::gtest_main)
add_test(NAME "CTest_${test_name}" COMMAND "CTest_${test_name}" ${ARG_ARGS})
set_property(TEST "CTest_${test_name}" PROPERTY LABELS C)
set_target_properties("CTest_${test_name}"
PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON)
endfunction()
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
......@@ -9,10 +9,12 @@
# SPDX-License-Identifier: BSD-3-Clause
# ---------------------------------------------------------------
# cmake-format: off
# list_sources(<var>
# [DIRECTORY <dir>]
# [INCLUDE_REGEX <include_regex>]
# [EXCLUDE_GENERATED])
# cmake-format: on
# ------------------------------------------------------------------------------
# Sets <var> to a list of absolute paths to the source files of all targets in
# all subdirectories of <dir> (defaults to the current source directory). The
......@@ -25,18 +27,22 @@
# are excluded from the result.
#
function(list_sources var)
cmake_parse_arguments(PARSE_ARGV 1 ARG
"EXCLUDE_GENERATED"
"DIRECTORY;INCLUDE_REGEX"
""
)
cmake_parse_arguments(PARSE_ARGV 1 ARG "EXCLUDE_GENERATED"
"DIRECTORY;INCLUDE_REGEX" "")
if(ARG_EXCLUDE_GENERATED AND "${CMAKE_VERSION}" VERSION_LESS "3.18")
message(AUTHOR_WARNING
"The generated source files can be automatically excluded only with CMake 3.18 or newer.")
message(
AUTHOR_WARNING
"The generated source files can be automatically excluded only with CMake 3.18 or newer."
)
set(ARG_EXCLUDE_GENERATED FALSE)
endif()
# list_sources_recurse(<var> <dir>)
# ----------------------------------------------------------------------------
# This is a local function that finds the sources recursively. Do not use this
# function directly. Use list_sources instead.
#
function(list_sources_recurse var dir)
get_directory_property(dir_path DIRECTORY ${dir} SOURCE_DIR)
get_directory_property(targets DIRECTORY ${dir} BUILDSYSTEM_TARGETS)
......@@ -54,7 +60,8 @@ function(list_sources var)
if(sources)
foreach(source ${sources})
if(${ARG_EXCLUDE_GENERATED})
get_source_file_property(source_generated ${source} DIRECTORY ${dir} GENERATED)
get_source_file_property(source_generated ${source} DIRECTORY
${dir} GENERATED)
if(source_generated)
continue()
endif()
......@@ -69,7 +76,9 @@ function(list_sources var)
list_sources_recurse(subdir_sources ${subdir} ${ARG_EXCLUDE_GENERATED})
list(APPEND result ${subdir_sources})
endforeach()
set(${var} ${result} PARENT_SCOPE)
set(${var}
${result}
PARENT_SCOPE)
endfunction()
if(NOT ARG_DIRECTORY)
......@@ -83,5 +92,7 @@ function(list_sources var)
endif()
list(REMOVE_DUPLICATES result)
set(${var} ${result} PARENT_SCOPE)
set(${var}
${result}
PARENT_SCOPE)
endfunction()
# ICON
#
# ---------------------------------------------------------------
# Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
# Contact information: icon-model.org
#
# See AUTHORS.TXT for a list of authors
......@@ -15,16 +15,17 @@ check_include_files("link.h" HAVE_LINK_H)
check_include_files("unwind.h" HAVE_UNWIND_H)
check_include_files("sys/resource.h" HAVE_GETRUSAGE)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
include(TestBigEndian)
test_big_endian(HAVE_BIG_ENDIAN)
if (FS_ENABLE_OMP)
find_package(OpenMP QUIET)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}")
endif ()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
add_library(fortran-support
add_library(
fortran-support
${CMAKE_CURRENT_BINARY_DIR}/config.h
fortran_support.F90
mo_iconlib_kind.F90
mo_exception.F90
mo_expression.F90
mo_fortran_tools.F90
......@@ -32,7 +33,6 @@ add_library(fortran-support
mo_io_units.F90
mo_namelist.F90
mo_octree.F90
mo_random_number_generators.F90
mo_simple_dump.F90
mo_util_backtrace.F90
mo_util_file.F90
......@@ -60,72 +60,77 @@ add_library(fortran-support
util_string_parse.c
util_sysinfo.c
util_system.c
util_timer.c
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
util_timer.c)
add_library(${PROJECT_NAME}::fortran-support ALIAS fortran-support)
set(Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mod")
set_target_properties(fortran-support
PROPERTIES
Fortran_PREPROCESS ON
Fortran_MODULE_DIRECTORY "${Fortran_MODULE_DIRECTORY}"
C_STANDARD 99
C_STANDARD_REQUIRED ON
EXPORT_NAME ${PROJECT_NAME}::fortran-support
)
set_target_properties(
fortran-support
PROPERTIES Fortran_PREPROCESS ON
Fortran_MODULE_DIRECTORY "${Fortran_MODULE_DIRECTORY}"
C_STANDARD 99
C_STANDARD_REQUIRED ON
EXPORT_NAME ${PROJECT_NAME}::fortran-support)
if(FS_ENABLE_MIXED_PRECISION)
if(FS_ENABLE_SINGLE_PRECISION)
# Do not enable MIXED_PRECISION if SINGLE_PRECISION enabled
else()
target_compile_definitions(fortran-support PRIVATE __MIXED_PRECISION)
endif()
endif()
if(FS_ENABLE_SINGLE_PRECISION)
target_compile_definitions(fortran-support PRIVATE __SINGLE_PRECISION)
endif()
if (FS_ENABLE_MIXED_PRECISION)
target_compile_definitions(fortran-support PRIVATE __MIXED_PRECISION)
endif ()
if(FS_ENABLE_OMP)
find_package(OpenMP COMPONENTS Fortran REQUIRED)
target_link_libraries(fortran-support PUBLIC OpenMP::OpenMP_Fortran)
endif()
include("${PROJECT_SOURCE_DIR}/cmake/check_macro.cmake")
check_macro_defined(HAS_OPENACC_MACRO _OPENACC QUIET)
if (FS_ENABLE_OPENACC)
if(FS_ENABLE_OPENACC)
# If _OPENACC is defined, assume that the required compiler flags are already
# provided, e.g. in CMAKE_Fortran_FLAGS:
if (NOT HAS_OPENACC_MACRO)
if(NOT HAS_OPENACC_MACRO)
# On LUMI, we only have OpenACC_Fortran, but no OpenACC_C
find_package(OpenACC QUIET)
if (NOT OpenACC_Fortran_FOUND)
message(FATAL_ERROR
"Could NOT find OpenACC_Fortran.")
endif ()
if(NOT OpenACC_Fortran_FOUND)
message(FATAL_ERROR "Could NOT find OpenACC_Fortran.")
endif()
target_compile_options(fortran-support PRIVATE ${OpenACC_Fortran_OPTIONS})
# This make sures that unit tests (FortUTF) compiles without the need of
# passing OpenACC compile option.
target_link_libraries(fortran-support PRIVATE OpenACC::OpenACC_Fortran)
endif ()
else ()
endif()
else()
if(HAS_OPENACC_MACRO)
message(FATAL_ERROR
"The OpenACC support is disabled but the _OPENACC macro is defined")
endif ()
endif ()
message(
FATAL_ERROR
"The OpenACC support is disabled but the _OPENACC macro is defined")
endif()
endif()
target_include_directories(fortran-support
target_include_directories(
fortran-support
PUBLIC
# Path to the Fortran modules:
# Path to the Fortran modules:
$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:${Fortran_MODULE_DIRECTORY}>>
$<INSTALL_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:${CMAKE_INSTALL_INCLUDEDIR}>>
$<INSTALL_INTERFACE:$<$<COMPILE_LANGUAGE:Fortran>:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>>
INTERFACE
# Path to the internal C/C++ headers (for testing):
# Requires CMake 3.15+ for multiple compile languages https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
# Path to the internal C/C++ headers (for testing): Requires CMake 3.15+ for
# multiple compile languages
# https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C,CXX>:${CMAKE_CURRENT_SOURCE_DIR}>>
PRIVATE
# Path to config.h (for C and C++ only):
# Requires CMake 3.15+ for multiple compile languages https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C,CXX>:${CMAKE_CURRENT_BINARY_DIR}>>
)
# Path to config.h (for C and C++ only): Requires CMake 3.15+ for multiple
# compile languages
# https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html
$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:C,CXX>:${CMAKE_CURRENT_BINARY_DIR}>>)
install(
TARGETS fortran-support
EXPORT "${PROJECT_NAME}-targets"
)
install(TARGETS fortran-support EXPORT "${PROJECT_NAME}-targets")
install(
DIRECTORY
"${Fortran_MODULE_DIRECTORY}/"
TYPE INCLUDE
)
install(DIRECTORY "${Fortran_MODULE_DIRECTORY}/" TYPE INCLUDE)
// ICON
//
// ---------------------------------------------------------------
// Copyright (C) 2004-2024, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
// Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
// Contact information: icon-model.org
//
// See AUTHORS.TXT for a list of authors
......@@ -16,3 +16,5 @@
#cmakedefine HAVE_UNWIND_H @HAVE_UNWIND_H@
#cmakedefine HAVE_GETRUSAGE @HAVE_GETRUSAGE@
#cmakedefine HAVE_BIG_ENDIAN @HAVE_BIG_ENDIAN@
! ICON
!
! ---------------------------------------------------------------
! Copyright (C) 2004-2025, DWD, MPI-M, DKRZ, KIT, ETH, MeteoSwiss
! Contact information: icon-model.org
!
! See AUTHORS.TXT for a list of authors
! See LICENSES/ for license information
! SPDX-License-Identifier: BSD-3-Clause
! ---------------------------------------------------------------
! Public interface for the fortran-support library
MODULE fortran_support
USE mo_exception, ONLY: init_logger, debug_on, debug_off, &
& set_msg_timestamp, enable_logging, message, warning, finish, &
& print_value, message_to_own_unit, message_text
USE mo_expression, ONLY: expression, parse_expression_string
USE mo_fortran_tools, ONLY: assign_if_present, assign_if_present_allocatable, if_associated, &
& t_ptr_1d_dp, t_ptr_1d_sp, t_ptr_1d_int, &
& t_ptr_2d_dp, t_ptr_2d_sp, t_ptr_2d_int, &
& t_ptr_3d_dp, t_ptr_3d_sp, t_ptr_3d_int, t_ptr_i2d3d, &
& t_ptr_4d_dp, t_ptr_4d_sp, t_ptr_4d_int, &
& t_ptr_2d3d, t_ptr_2d3d_vp, t_ptr_tracer, &
& copy, init, swap, negative2zero, var_scale, &
& var_add, init_zero_contiguous, init_contiguous, &
& init_zero_contiguous_dp, init_zero_contiguous_sp, &
& init_contiguous_dp, init_contiguous_sp, init_contiguous_i4, &
& init_contiguous_l, minval_1d, minval_2d, resize_arr_c1d, DO_DEALLOCATE, &
& DO_PTR_DEALLOCATE, insert_dimension, assert_acc_host_only, &
& assert_acc_device_only, set_acc_host_or_device
#ifdef __SINGLE_PRECISION
USE mo_fortran_tools, ONLY: &
& t_ptr_1d_wp => t_ptr_1d_sp, &
& t_ptr_2d_wp => t_ptr_2d_sp, &
& t_ptr_3d_wp => t_ptr_3d_sp, &
& t_ptr_4d_wp => t_ptr_4d_sp, &
& t_ptr_1d => t_ptr_1d_sp, &
& t_ptr_2d => t_ptr_2d_sp, &
& t_ptr_3d => t_ptr_3d_sp, &
& t_ptr_4d => t_ptr_4d_sp
#else
USE mo_fortran_tools, ONLY: &
& t_ptr_1d_wp => t_ptr_1d_dp, &
& t_ptr_2d_wp => t_ptr_2d_dp, &
& t_ptr_3d_wp => t_ptr_3d_dp, &
& t_ptr_4d_wp => t_ptr_4d_dp, &
& t_ptr_1d => t_ptr_1d_dp, &
& t_ptr_2d => t_ptr_2d_dp, &
& t_ptr_3d => t_ptr_3d_dp, &
& t_ptr_4d => t_ptr_4d_dp
#endif
USE mo_hash_table, ONLY: t_HashTable, hashTable_make, t_HashIterator
USE mo_io_units, ONLY: filename_max, nerr, nlog, nnml, nstat, ngmt, nin, &
& nout, nnml_output, find_next_free_unit
USE mo_namelist, ONLY: position_nml, open_nml, close_nml, POSITIONED, &
& MISSING, LENGTH_ERROR, READ_ERROR, open_nml_output, close_nml_output
USE mo_octree, ONLY: octree_init, octree_finalize, octree_count_point, &
& octree_query_point, t_range_octree, OCTREE_DEPTH
USE mo_simple_dump, ONLY: dump2text
USE mo_util_backtrace, ONLY: ftn_util_backtrace
USE mo_util_file, ONLY: util_symlink, util_unlink, util_islink, util_rename, &
& util_tmpnam, util_filesize, util_file_is_writable, createSymlink, &
& get_filename, get_filename_noext, get_path
USE mo_util_libc, ONLY: memset_f, memcmp_f, memcpy_f, strerror
USE mo_util_nml, ONLY: util_annotate_nml
USE mo_util_rusage, ONLY: add_rss_list, add_rss_usage, print_rss_usage, &
& close_rss_lists
USE mo_util_sort, ONLY: quicksort, insertion_sort
#ifdef __SX__
USE mo_util_sort, ONLY: radixsort, radixsort_int
#endif
USE mo_util_stride, ONLY: util_stride_1d, util_stride_2d, util_get_ptrdiff
USE mo_util_string, ONLY: tolower, lowcase, toupper, separator, int2string, &
& real2string, logical2string, split_string, string_contains_word, &
& tocompact, str_replace, t_keyword_list, associate_keyword, &
& with_keywords, remove_duplicates, difference, add_to_list, one_of, &
& insert_group, delete_keyword_list, sort_and_compress_list, tohex, &
& remove_whitespace, pretty_print_string_list, find_trailing_number, &
& toCharArray, toCharacter, c2f_char, charArray_dup, charArray_equal, &
& charArray_toLower, normal, bold, fg_black, fg_red, fg_green, fg_yellow, &
& fg_blue, fg_magenta, fg_cyan, fg_white, fg_default, bg_black, bg_red, &
& bg_green, bg_yellow, bg_blue, bg_magenta, bg_cyan, bg_white, bg_default, &
& new_list
USE mo_util_string_parse, ONLY: util_do_parse_intlist
USE mo_util_system, ONLY: util_exit, util_abort, util_system
#ifdef __XT3__
USE mo_util_system, ONLY: util_base_iobuf
#endif
USE mo_util_table, ONLY: initialize_table, finalize_table, add_table_column, &
& set_table_entry, print_table, t_table, t_column
USE mo_util_texthash, ONLY: text_hash, text_hash_c, text_isEqual, sel_char
#if defined(__PGI) || defined(__FLANG)
USE mo_util_texthash, ONLY: t_char_workaround
#endif
USE mo_util_timer, ONLY: util_cputime, util_walltime, util_gettimeofday, &
& util_init_real_time, util_get_real_time_size, util_read_real_time, &
& util_diff_real_time
! From mo_exception
PUBLIC :: init_logger, debug_on, debug_off, set_msg_timestamp, &
& enable_logging, message, warning, finish, print_value, &
& message_to_own_unit, message_text
! From mo_expression
PUBLIC :: expression, parse_expression_string
! From mo_fortran_tools
PUBLIC :: assign_if_present, assign_if_present_allocatable, if_associated, &
& t_ptr_1d, t_ptr_1d_wp, t_ptr_1d_dp, t_ptr_1d_sp, t_ptr_1d_int, &
& t_ptr_2d, t_ptr_2d_wp, t_ptr_2d_dp, t_ptr_2d_sp, t_ptr_2d_int, &
& t_ptr_3d, t_ptr_3d_wp, t_ptr_3d_dp, t_ptr_3d_sp, t_ptr_3d_int, t_ptr_i2d3d, &
& t_ptr_4d, t_ptr_4d_wp, t_ptr_4d_dp, t_ptr_4d_sp, t_ptr_4d_int, &
& t_ptr_2d3d, t_ptr_2d3d_vp, t_ptr_tracer, &
& copy, init, swap, negative2zero, var_scale, &
& var_add, init_zero_contiguous, init_contiguous, &
& init_zero_contiguous_dp, init_zero_contiguous_sp, &
& init_contiguous_dp, init_contiguous_sp, init_contiguous_i4, &
& init_contiguous_l, minval_1d, minval_2d, resize_arr_c1d, DO_DEALLOCATE, &
& DO_PTR_DEALLOCATE, insert_dimension, assert_acc_host_only, &
& assert_acc_device_only, set_acc_host_or_device
! From mo_hash_table
PUBLIC :: t_HashTable, hashTable_make, t_HashIterator
! From mo_io_units
PUBLIC :: filename_max, nerr, nlog, nnml, nstat, ngmt, nin, nout, &
& nnml_output, find_next_free_unit
! From mo_namelist
PUBLIC :: position_nml, open_nml, close_nml, POSITIONED, MISSING, &
& LENGTH_ERROR, READ_ERROR, open_nml_output, close_nml_output
! From mo_octree
PUBLIC :: octree_init, octree_finalize, octree_count_point, &
& octree_query_point, t_range_octree, OCTREE_DEPTH
! From mo_simple_dump
PUBLIC :: dump2text
! From mo_util_backtrace
PUBLIC :: ftn_util_backtrace
! From mo_util_file
PUBLIC :: util_symlink, util_unlink, util_islink, util_rename, util_tmpnam, &
& util_filesize, util_file_is_writable, createSymlink, get_filename, &
& get_filename_noext, get_path
! From mo_util_libc
PUBLIC :: memset_f, memcmp_f, memcpy_f, strerror
! From mo_util_nml
PUBLIC :: util_annotate_nml
! From mo_util_rusage
PUBLIC :: add_rss_list, add_rss_usage, print_rss_usage, close_rss_lists
! From mo_util_sort
PUBLIC :: quicksort, insertion_sort
#ifdef __SX__
PUBLIC :: radixsort, radixsort_int
#endif
! From mo_util_stride
PUBLIC :: util_stride_1d, util_stride_2d, util_get_ptrdiff
! From mo_util_string
PUBLIC :: tolower, lowcase, toupper, separator, int2string, real2string, &
& logical2string, split_string, string_contains_word, tocompact, &
& str_replace, t_keyword_list, associate_keyword, with_keywords, &
& remove_duplicates, difference, add_to_list, one_of, insert_group, &
& delete_keyword_list, sort_and_compress_list, tohex, remove_whitespace, &
& pretty_print_string_list, find_trailing_number, toCharArray, &
& toCharacter, c2f_char, charArray_dup, charArray_equal, &
& charArray_toLower, normal, bold, fg_black, fg_red, fg_green, fg_yellow, &
& fg_blue, fg_magenta, fg_cyan, fg_white, fg_default, bg_black, bg_red, &
& bg_green, bg_yellow, bg_blue, bg_magenta, bg_cyan, bg_white, bg_default, &
& new_list
! From mo_util_string_parse
PUBLIC :: util_do_parse_intlist
! From mo_util_system
PUBLIC :: util_exit, util_abort, util_system
#ifdef __XT3__
PUBLIC :: util_base_iobuf
#endif
! From mo_util_table
PUBLIC :: initialize_table, finalize_table, add_table_column, &
& set_table_entry, print_table, t_table, t_column
! From mo_util_texthash
PUBLIC :: text_hash, text_hash_c, text_isEqual, sel_char
#if defined(__PGI) || defined(__FLANG)
PUBLIC :: t_char_workaround
#endif
! From mo_util_timer
PUBLIC :: util_cputime, util_walltime, util_gettimeofday, &
& util_init_real_time, util_get_real_time_size, util_read_real_time, &
& util_diff_real_time
END MODULE