Skip to content
Snippets Groups Projects
Yen-Chen Chen's avatar
Yen-Chen Chen authored
## What is the new feature
Add a contribution guide. Yen-Chen's email is also updated after moving from KIT to TUM.

Approved-by: default avatarMikael Stellio <mikael.stellio@c2sm.ethz.ch>
Merged-by: default avatarMikael Stellio <mikael.stellio@c2sm.ethz.ch>
Changelog: other
fa8f9f85
History

Fortran-support library

This repository is an external library of ICON collecting low-level supporting modules of ICON.

Latest Release pipeline status coverage report
License License: CC BY 4.0 License: CC0-1.0 License: MIT

Requirements

The following packages/libraries are required for libfortran-support.

  • Fortran compiler
  • C compiler
  • CMake 3.18+

The following requirements are optional

  • C++ compiler (testing with GoogleTest)
  • OpenACC(nvhpc) for GPU support
  • fprettify for Fortran code formatting
  • clang-format for C/C++ code formatting
  • REUSE v3.0.0+ for licensing
  • 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_fortran_tools: basic array allocation, copy, etc. subroutines with GPU(OpenACC) support
  • 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

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 ..
! Or the following for GPU support with OpenACC
cmake -DFS_ENABLE_OPENACC=ON ..
make
  1. Format the code by make format.
  2. Make sure your code is tested. Check developer note.
  3. Check license by reuse lint. Check requirements.
    • Code snippets should have license BSD-3-Clause
    • Documentations should have license CC-BY-4.0
    • Files unrelated to the library itself should have license CC0-1.0

How to contribute

Please checkout the Contribution Guidelines.

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: