Fortran-support library
This repository is an external library of ICON collecting low-level supporting modules of ICON.
Requirements
The following packages/libraries are required for libfortran-support
.
- Fortran compiler
- C compiler
- C++ compiler
- CMake 3.18+
The following requirements are optional
-
fprettify
for Fortran code formatting -
clang-format
for C/C++ code formatting - Ragel State Machine Compiler 7.0+ for C code generation from
.rl
files, used fornml_annotate.c
util_arithmetic_expr.c
util_string_parse.c
For Users
libfortran-support
library?
What modules are in the The libfortran-support
library includes some general Fortran supporting modules that are used in ICON but are independent of the data types in ICON. Here is a list of the supported modules.
-
mo_exception
: message logger for ICON -
mo_expression
: expression parsing -
mo_hash_table
: hash table operations -
mo_io_units
: io unit definitions -
mo_namelist
: open/close namelist files -
mo_octree
: octree data structure and operations -
mo_simple_dump
: array value dumping -
mo_util_backtrace
: function backtrace -
mo_util_file
: file operations -
mo_util_libc
: standard C functions interface -
mo_util_nml
: read/annotate namelist files -
mo_util_rusage
: RSS information list -
mo_util_sort
: array sorting -
mo_util_stride
: data stride -
mo_util_string
: string handling -
mo_util_string_parse
: string parsing for arithmetic expressions -
mo_util_system
: system functions (exit, abort, ...) -
mo_util_table
: build and use table -
mo_util_texthash
: hash text operations -
mo_util_timer
: timer functions
fortran-support
?
How to link modules from - The library will be built into
fortran-support/build/src/libfortran-support.so
- The module files (Fortran) will be built under
fortran-support/build/src/mod/
For developers
Some notes for developers
- The
fortran-support
library is only configured by CMake.- Tips and standards on CMake https://gitlab.dkrz.de/icon/wiki/-/wikis/CMake-recommendations-and-requirements
- The
fortran-support
library usesfprettify
for formatting Fortran codes. Runmake format
before you commit. - The
fortran-support
library is unit tested. (work in progress) All merge request changes are preferable to have a unit test. - Fortran preprocessing is automatically applied for files with
.F90
extensions. See #4 for more details.
fortran-support
?
How to add modules in - Put your module file under
fortran-support/src
- Add your file to the library configuration list at
fortran-support/src/CMakeLists.txt
.
add_library(fortran-support
mo_exception.F90
mo_expression.F90
...
# Add your module to the list. The list is in alphabetical order.
mo_util_nml.F90
mo_util_rusage.F90
mo_util_sort.F90
...
)
- Try to compile the code.
mkdir build
cd build
cmake ..
make
- Format the code by
make format
. - Make sure your code is tested. For more information on unit tests, check out this GitLab WIKI page
How to contribute
Please open a merge request and select one of our templates for new features or bugfixes. Detailed instructions on how to proceed are provided there.
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)
- Will Sawyer (william.sawyer@cscs.ch)
This repository is owned by the icon-libraries
group, contacts about general ICON library questions:
- Terry Cojean (terry.cojean@kit.edu)
- Will Sawyer (william.sawyer@cscs.ch)
- Florian Prill (florian.prill@dwd.de)
- Luis Kornblueh (luis.kornblueh@mpimet.mpg.de)