Skip to content
Snippets Groups Projects
Yen-Chen Chen's avatar
Yen-Chen Chen authored
<!--
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
The CMake version requirement for FortUTF is downgraded to 3.17. Therefore, the line in README is no longer required.
## How do you fix it
A typo is also fixed.

## How urgent is the bugfix
- [ ] I need it as soon as possible
- [ ] I can wait for a couple of days
- [x] None of my current codes is directly affected

## Mandatory steps before review
- [x] Gitlab CI passes _(Hint: use `make format` for linting)_ 
- [x] Bugfix is covered by additional unit tests
- [x] Mark the merge request as ready by removing `Draft:`

## Mandatory steps before merge
- [x] Reviewed by a maintainer
- [x] Incorporate review suggestions
- [ ] Remember to edit the commit message and select the proper changelog category (feature/bugfix/other)

**You are not supposed to merge this request by yourself, the maintainers of fortan-support take care of this action!**

Approved-by: default avatarJonas Jucker <jonas.jucker@env.ethz.ch>
Merged-by: default avatarJonas Jucker <jonas.jucker@env.ethz.ch>
Changelog: other
a265cfff
History

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 for
    • nml_annotate.c
    • util_arithmetic_expr.c
    • util_string_parse.c

For Users

What modules are in the libfortran-support library?

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

How to link modules from fortran-support?

  • 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.
  • The fortran-support library uses fprettify for formatting Fortran codes. Run make 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.

How to add modules in fortran-support?

  1. Put your module file under fortran-support/src
  2. 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
  ...
)
  1. Try to compile the code.
mkdir build
cd build
cmake ..
make
  1. Format the code by make format.
  2. 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:

This repository is owned by the icon-libraries group, contacts about general ICON library questions: