0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_sentinel.f90 File Reference

Module to handle sentinels. More...

Go to the source code of this file.

Data Types

interface  mo_sentinel::set_sentinel
 Set variable to sentinel value. More...
 
interface  mo_sentinel::get_sentinel
 Get sentinel values of the given kind. More...
 
interface  mo_sentinel::check_sentinel
 Check given variable to be equal to the sentinel value. More...
 

Modules

module  mo_sentinel
 Module to handle sentinels.
 

Functions/Subroutines

pure character function, public mo_sentinel::sentinel_char ()
 Default sentinel value (Null character) for characters.
 
pure integer(i1) function, public mo_sentinel::sentinel_i1 ()
 Default sentinel value (-huge()-1) for i1.
 
pure integer(i2) function, public mo_sentinel::sentinel_i2 ()
 Default sentinel value (-huge()-1) for i2.
 
pure integer(i4) function, public mo_sentinel::sentinel_i4 ()
 Default sentinel value (-huge()-1) for i4.
 
pure integer(i8) function, public mo_sentinel::sentinel_i8 ()
 Default sentinel value (-huge()-1) for i8.
 
pure real(sp) function, public mo_sentinel::sentinel_sp ()
 Default sentinel value (NaN) for sp.
 
pure real(dp) function, public mo_sentinel::sentinel_dp ()
 Default sentinel value (NaN) for dp.
 
pure complex(spc) function, public mo_sentinel::sentinel_spc ()
 Default sentinel value (NaN) for spc.
 
pure complex(dpc) function, public mo_sentinel::sentinel_dpc ()
 Default sentinel value (NaN) for dpc.
 
elemental subroutine mo_sentinel::set_sentinel_i1 (value)
 Set sentinel value for i1.
 
elemental subroutine mo_sentinel::set_sentinel_i2 (value)
 Set sentinel value for i2.
 
elemental subroutine mo_sentinel::set_sentinel_i4 (value)
 Set sentinel value for i4.
 
elemental subroutine mo_sentinel::set_sentinel_i8 (value)
 Set sentinel value for i8.
 
elemental subroutine mo_sentinel::set_sentinel_sp (value)
 Set sentinel value for sp.
 
elemental subroutine mo_sentinel::set_sentinel_dp (value)
 Set sentinel value for dp.
 
elemental subroutine mo_sentinel::set_sentinel_spc (value)
 Set sentinel value for spc.
 
elemental subroutine mo_sentinel::set_sentinel_dpc (value)
 Set sentinel value for dpc.
 
elemental subroutine mo_sentinel::set_sentinel_char (value)
 Set sentinel value for char.
 
elemental character function mo_sentinel::get_sentinel_char (value)
 Get sentinel value for char.
 
elemental integer(i1) function mo_sentinel::get_sentinel_i1 (value)
 Get sentinel value for i1.
 
elemental integer(i2) function mo_sentinel::get_sentinel_i2 (value)
 Get sentinel value for i2.
 
elemental integer(i4) function mo_sentinel::get_sentinel_i4 (value)
 Get sentinel value for i4.
 
elemental integer(i8) function mo_sentinel::get_sentinel_i8 (value)
 Get sentinel value for i8.
 
elemental real(sp) function mo_sentinel::get_sentinel_sp (value)
 Get sentinel value for sp.
 
elemental real(dp) function mo_sentinel::get_sentinel_dp (value)
 Get sentinel value for dp.
 
elemental complex(spc) function mo_sentinel::get_sentinel_spc (value)
 Get sentinel value for spc.
 
elemental complex(dpc) function mo_sentinel::get_sentinel_dpc (value)
 Get sentinel value for dpc.
 
elemental logical function mo_sentinel::check_sentinel_char (value)
 Check for sentinel value for string.
 
elemental logical function mo_sentinel::check_sentinel_i1 (value)
 Check for sentinel value for i1.
 
elemental logical function mo_sentinel::check_sentinel_i2 (value)
 Check for sentinel value for i2.
 
elemental logical function mo_sentinel::check_sentinel_i4 (value)
 Check for sentinel value for i4.
 
elemental logical function mo_sentinel::check_sentinel_i8 (value)
 Check for sentinel value for i8.
 
elemental logical function mo_sentinel::check_sentinel_sp (value)
 Check for sentinel value for sp.
 
elemental logical function mo_sentinel::check_sentinel_dp (value)
 Check for sentinel value for dp.
 
elemental logical function mo_sentinel::check_sentinel_spc (value)
 Check for sentinel value for spc.
 
elemental logical function mo_sentinel::check_sentinel_dpc (value)
 Check for sentinel value for dpc.
 

Variables

integer(i1), dimension(0), parameter mo_sentinel::empty_i1 = 0_i1
 
integer(i2), dimension(0), parameter mo_sentinel::empty_i2 = 0_i2
 
integer(i4), dimension(0), parameter mo_sentinel::empty_i4 = 0_i4
 
integer(i8), dimension(0), parameter mo_sentinel::empty_i8 = 0_i8
 
character, parameter mo_sentinel::sent_char = achar(0)
 

Detailed Description

Module to handle sentinels.

This module provides standard sentinels for all used types as well as set, get and check routines. Sentinels are used to mark variables in order to check if they were accessed by an algorithm. A common use case is to check if variables were set by reading a fortran namelist.

Version
0.1
Authors
Sebastian Mueller
Date
Sep 2022

Definition in file mo_sentinel.f90.