Skip to content
Snippets Groups Projects
Commit 316d3dc6 authored by Dylan Kierans's avatar Dylan Kierans Committed by Yen-Chen Chen
Browse files

Support for single precision wp (!98)

## What is the new feature
Support for single-precision as working-precision in libfortran-support. Related to icon-mpim MR (https://gitlab.dkrz.de/icon/icon-mpim/-/merge_requests/558), and libiconmath MR (libiconmath!13

).

## How is it implemented
- New CMake argument `FS_ENABLE_SINGLE_PRECISION`, disabled by default
- Precision handling: Introduction of `src/mo_iconlib_kind.f90` shared by fortran-support and iconmath:
  - Precision (dp+sp): Using iso_fortran_env variables `dp=>real64` and `sp=>real32`
  - Working precision (wp): `FS_ENABLE_SINGLE_PRECISION==TRUE` -> `wp=real32`, else `wp=real64`
  - Variable precision (vp): `FS_ENABLE_MIXED_PRECISION==TRUE` -> `vp=real32`, else `vp=wp`
- Extensions of some functions to include sp and dp interfaces
- Kind for `t_ptr` types is `wp` by default, with wp or dp or sp versions specified by suffix.

Co-authored-by: default avatarYen-Chen Chen <yen-chen.chen@tum.de>
Co-authored-by: default avatarDylan Kierans <dylankierans53@gmail.com>
Co-authored-by: default avatarPradipta Samanta <samanta@dkrz.de>
Approved-by: default avatarYen-Chen Chen <yen-chen.chen@tum.de>
Merged-by: default avatarYen-Chen Chen <yen-chen.chen@tum.de>
Changelog: feature
parent 7041b0ca
No related branches found
No related tags found
1 merge request!98Support for single precision wp
Pipeline #96246 passed