0.6.2-dev0
FORCES
FORtran lib for Comp. Env. Sys.
Loading...
Searching...
No Matches
mo_utils Module Reference

General utilities for the CHS library. More...

Data Types

interface  arange
 Numbers within a given range. More...
 
interface  cumsum
 Cumulative sum. More...
 
interface  eq
 Comparison of real values. More...
 
interface  equal
 Comparison of real values. More...
 
interface  flip
 flip an array at a certain dimension More...
 
interface  ge
 Comparison of real values: a >= b. More...
 
interface  greaterequal
 Comparison of real values: a >= b. More...
 
interface  imaxloc
 First location in array of element with the maximum value. More...
 
interface  iminloc
 First location in array of element with the minimum value. More...
 
interface  is_close
 Comparison of real values. More...
 
interface  is_finite
 .true. if not IEEE Inf. More...
 
interface  is_nan
 .true. if IEEE NaN. More...
 
interface  is_normal
 .true. if nor IEEE Inf nor IEEE NaN. More...
 
interface  le
 Comparison of real values: a <= b. More...
 
interface  lesserequal
 Comparison of real values: a <= b. More...
 
interface  linspace
 Evenly spaced numbers in interval. More...
 
interface  locate
 Find closest values in a monotonic series, returns the indexes. More...
 
interface  ne
 Comparison of real values for inequality. More...
 
interface  notequal
 Comparison of real values for inequality. More...
 
interface  relational_operator_dp
 abstract interface for a relational operator on double precision arguments More...
 
interface  relational_operator_sp
 abstract interface for a relational operator on single precision arguments More...
 
interface  special_value
 Special IEEE values. More...
 
interface  swap
 Swap to values or two elements in array. More...
 
interface  unpack_chunkwise
 chunk version of the unpack operation More...
 

Functions/Subroutines

integer(i4) function, dimension(:), allocatable arange_i4 (lower, upper)
 
integer(i8) function, dimension(:), allocatable arange_i8 (lower, upper)
 
real(dp) function, dimension(:), allocatable arange_dp (lower, upper)
 
real(sp) function, dimension(:), allocatable arange_sp (lower, upper)
 
integer(i4) function, dimension(size(arr, 1)) cumsum_i4 (arr)
 
integer(i8) function, dimension(size(arr, 1)) cumsum_i8 (arr)
 
real(dp) function, dimension(size(arr, 1)) cumsum_dp (arr)
 
complex(dpc) function, dimension(size(arr, 1)) cumsum_dpc (arr)
 
real(sp) function, dimension(size(arr, 1)) cumsum_sp (arr)
 
complex(spc) function, dimension(size(arr, 1)) cumsum_spc (arr)
 
integer(i4) function imaxloc_i4 (arr, mask)
 
integer(i4) function imaxloc_i8 (arr, mask)
 
integer(i4) function imaxloc_dp (arr, mask)
 
integer(i4) function imaxloc_sp (arr, mask)
 
integer(i4) function iminloc_i4 (arr, mask)
 
integer(i4) function iminloc_i8 (arr, mask)
 
integer(i4) function iminloc_dp (arr, mask)
 
integer(i4) function iminloc_sp (arr, mask)
 
integer(i4) function, dimension(nstep) linspace_i4 (lower, upper, nstep)
 
integer(i8) function, dimension(nstep) linspace_i8 (lower, upper, nstep)
 
real(dp) function, dimension(nstep) linspace_dp (lower, upper, nstep)
 
real(sp) function, dimension(nstep) linspace_sp (lower, upper, nstep)
 
logical elemental pure function is_close_dp (a, b, rtol, atol, equal_nan)
 
logical elemental pure function is_close_sp (a, b, rtol, atol, equal_nan)
 
logical elemental pure function equal_dp (a, b)
 
logical elemental pure function equal_sp (a, b)
 
logical elemental pure function greaterequal_dp (a, b)
 
logical elemental pure function greaterequal_sp (a, b)
 
logical elemental pure function lesserequal_dp (a, b)
 
logical elemental pure function lesserequal_sp (a, b)
 
logical elemental pure function notequal_dp (a, b)
 
logical elemental pure function notequal_sp (a, b)
 
elemental pure logical function is_finite_dp (a)
 
elemental pure logical function is_finite_sp (a)
 
elemental pure logical function is_nan_dp (a)
 
elemental pure logical function is_nan_sp (a)
 
elemental pure logical function is_normal_dp (a)
 
elemental pure logical function is_normal_sp (a)
 
integer(i4) function locate_0d_dp (x, y)
 
integer(i4) function locate_0d_sp (x, y)
 
integer(i4) function, dimension(:), allocatable locate_1d_dp (x, y)
 
integer(i4) function, dimension(:), allocatable locate_1d_sp (x, y)
 
elemental pure subroutine swap_xy_dp (x, y)
 
elemental pure subroutine swap_xy_sp (x, y)
 
elemental pure subroutine swap_xy_i4 (x, y)
 
subroutine swap_vec_dp (x, i1, i2)
 
subroutine swap_vec_sp (x, i1, i2)
 
subroutine swap_vec_i4 (x, i1, i2)
 
real(dp) function special_value_dp (x, ieee)
 
real(sp) function special_value_sp (x, ieee)
 
subroutine flip_1d_dp (data, idim)
 
subroutine flip_2d_dp (data, idim)
 
subroutine flip_3d_dp (data, idim)
 
subroutine flip_4d_dp (data, idim)
 
subroutine flip_1d_i4 (data, idim)
 
subroutine flip_2d_i4 (data, idim)
 
subroutine flip_3d_i4 (data, idim)
 
subroutine flip_4d_i4 (data, idim)
 
real(dp) function, dimension(size(mask, kind=i8)) unpack_chunkwise_dp (vector, mask, field, chunksizearg)
 
integer(i1) function, dimension(size(mask, kind=i8)) unpack_chunkwise_i1 (vector, mask, field, chunksizearg)
 

Detailed Description

General utilities for the CHS library.

This module provides general utilities such as comparisons of two reals.

Changelog
  • Matthias Cuntz, Juliane Mai, Feb 2014
    • written
  • Matthias Cuntz, Juliane Mai, Feb 2014
    • equal, notequal
  • Matthias Cuntz, May 2014
    • swap
  • Matthias Cuntz, May 2014
Authors
Matthias Cuntz, Juliane Mai
Date
2014 - 2016

Function/Subroutine Documentation

◆ arange_dp()

real(dp) function, dimension(:), allocatable mo_utils::arange_dp ( real(dp), intent(in)  lower,
real(dp), intent(in), optional  upper 
)
private

Definition at line 576 of file mo_utils.F90.

◆ arange_i4()

integer(i4) function, dimension(:), allocatable mo_utils::arange_i4 ( integer(i4), intent(in)  lower,
integer(i4), intent(in), optional  upper 
)
private

Definition at line 526 of file mo_utils.F90.

◆ arange_i8()

integer(i8) function, dimension(:), allocatable mo_utils::arange_i8 ( integer(i8), intent(in)  lower,
integer(i8), intent(in), optional  upper 
)
private

Definition at line 551 of file mo_utils.F90.

◆ arange_sp()

real(sp) function, dimension(:), allocatable mo_utils::arange_sp ( real(sp), intent(in)  lower,
real(sp), intent(in), optional  upper 
)
private

Definition at line 601 of file mo_utils.F90.

◆ cumsum_dp()

real(dp) function, dimension(size(arr,1)) mo_utils::cumsum_dp ( real(dp), dimension(:), intent(in)  arr)
private

Definition at line 660 of file mo_utils.F90.

◆ cumsum_dpc()

complex(dpc) function, dimension(size(arr,1)) mo_utils::cumsum_dpc ( complex(dpc), dimension(:), intent(in)  arr)
private

Definition at line 676 of file mo_utils.F90.

◆ cumsum_i4()

integer(i4) function, dimension(size(arr,1)) mo_utils::cumsum_i4 ( integer(i4), dimension(:), intent(in)  arr)
private

Definition at line 628 of file mo_utils.F90.

◆ cumsum_i8()

integer(i8) function, dimension(size(arr,1)) mo_utils::cumsum_i8 ( integer(i8), dimension(:), intent(in)  arr)
private

Definition at line 644 of file mo_utils.F90.

◆ cumsum_sp()

real(sp) function, dimension(size(arr,1)) mo_utils::cumsum_sp ( real(sp), dimension(:), intent(in)  arr)
private

Definition at line 692 of file mo_utils.F90.

◆ cumsum_spc()

complex(spc) function, dimension(size(arr,1)) mo_utils::cumsum_spc ( complex(spc), dimension(:), intent(in)  arr)
private

Definition at line 708 of file mo_utils.F90.

◆ equal_dp()

logical elemental pure function mo_utils::equal_dp ( real(dp), intent(in)  a,
real(dp), intent(in)  b 
)
private

Definition at line 996 of file mo_utils.F90.

◆ equal_sp()

logical elemental pure function mo_utils::equal_sp ( real(sp), intent(in)  a,
real(sp), intent(in)  b 
)
private

Definition at line 1008 of file mo_utils.F90.

◆ flip_1d_dp()

subroutine mo_utils::flip_1d_dp ( real(dp), dimension(:), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1461 of file mo_utils.F90.

◆ flip_1d_i4()

subroutine mo_utils::flip_1d_i4 ( integer(i4), dimension(:), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1599 of file mo_utils.F90.

◆ flip_2d_dp()

subroutine mo_utils::flip_2d_dp ( real(dp), dimension(:, :), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1482 of file mo_utils.F90.

◆ flip_2d_i4()

subroutine mo_utils::flip_2d_i4 ( integer(i4), dimension(:, :), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1620 of file mo_utils.F90.

◆ flip_3d_dp()

subroutine mo_utils::flip_3d_dp ( real(dp), dimension(:, :, :), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1513 of file mo_utils.F90.

◆ flip_3d_i4()

subroutine mo_utils::flip_3d_i4 ( integer(i4), dimension(:, :, :), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1651 of file mo_utils.F90.

◆ flip_4d_dp()

subroutine mo_utils::flip_4d_dp ( real(dp), dimension(:, :, :, :), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1551 of file mo_utils.F90.

◆ flip_4d_i4()

subroutine mo_utils::flip_4d_i4 ( integer(i4), dimension(:, :, :, :), intent(inout), allocatable  data,
integer(i4), intent(in)  idim 
)
private

Definition at line 1689 of file mo_utils.F90.

◆ greaterequal_dp()

logical elemental pure function mo_utils::greaterequal_dp ( real(dp), intent(in)  a,
real(dp), intent(in)  b 
)
private

Definition at line 1021 of file mo_utils.F90.

◆ greaterequal_sp()

logical elemental pure function mo_utils::greaterequal_sp ( real(sp), intent(in)  a,
real(sp), intent(in)  b 
)
private

Definition at line 1031 of file mo_utils.F90.

◆ imaxloc_dp()

integer(i4) function mo_utils::imaxloc_dp ( real(dp), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 764 of file mo_utils.F90.

◆ imaxloc_i4()

integer(i4) function mo_utils::imaxloc_i4 ( integer(i4), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 726 of file mo_utils.F90.

◆ imaxloc_i8()

integer(i4) function mo_utils::imaxloc_i8 ( integer(i8), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 745 of file mo_utils.F90.

◆ imaxloc_sp()

integer(i4) function mo_utils::imaxloc_sp ( real(sp), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 783 of file mo_utils.F90.

◆ iminloc_dp()

integer(i4) function mo_utils::iminloc_dp ( real(dp), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 842 of file mo_utils.F90.

◆ iminloc_i4()

integer(i4) function mo_utils::iminloc_i4 ( integer(i4), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 804 of file mo_utils.F90.

◆ iminloc_i8()

integer(i4) function mo_utils::iminloc_i8 ( integer(i8), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 823 of file mo_utils.F90.

◆ iminloc_sp()

integer(i4) function mo_utils::iminloc_sp ( real(sp), dimension(:), intent(in)  arr,
logical, dimension(:), intent(in), optional  mask 
)
private

Definition at line 861 of file mo_utils.F90.

◆ is_close_dp()

logical elemental pure function mo_utils::is_close_dp ( real(dp), intent(in)  a,
real(dp), intent(in)  b,
real(dp), intent(in), optional  rtol,
real(dp), intent(in), optional  atol,
logical, intent(in), optional  equal_nan 
)
private

Definition at line 936 of file mo_utils.F90.

◆ is_close_sp()

logical elemental pure function mo_utils::is_close_sp ( real(sp), intent(in)  a,
real(sp), intent(in)  b,
real(sp), intent(in), optional  rtol,
real(sp), intent(in), optional  atol,
logical, intent(in), optional  equal_nan 
)
private

Definition at line 966 of file mo_utils.F90.

◆ is_finite_dp()

elemental pure logical function mo_utils::is_finite_dp ( real(dp), intent(in)  a)
private
Parameters
[in]aNumber to be evaluated.
Returns
logical :: is_finite — \( a \neq \infty \), logically true or false.

Definition at line 1084 of file mo_utils.F90.

Referenced by mo_utils::is_finite::is_finite_dp().

Here is the caller graph for this function:

◆ is_finite_sp()

elemental pure logical function mo_utils::is_finite_sp ( real(sp), intent(in)  a)
private
Parameters
[in]aNumber to be evaluated.
Returns
logical :: is_finite — \( a \neq \infty \), logically true or false.

Definition at line 1098 of file mo_utils.F90.

Referenced by mo_utils::is_finite::is_finite_sp().

Here is the caller graph for this function:

◆ is_nan_dp()

elemental pure logical function mo_utils::is_nan_dp ( real(dp), intent(in)  a)
private
Parameters
[in]aNumber to be evaluated.
Returns
logical :: is_nan — \( a = NaN \), logically true or false.

Definition at line 1112 of file mo_utils.F90.

Referenced by mo_utils::is_nan::is_nan_dp().

Here is the caller graph for this function:

◆ is_nan_sp()

elemental pure logical function mo_utils::is_nan_sp ( real(sp), intent(in)  a)
private
Parameters
[in]aNumber to be evaluated.
Returns
logical :: is_nan — \( a = NaN \), logically true or false.

Definition at line 1125 of file mo_utils.F90.

Referenced by mo_utils::is_nan::is_nan_sp().

Here is the caller graph for this function:

◆ is_normal_dp()

elemental pure logical function mo_utils::is_normal_dp ( real(dp), intent(in)  a)
private
Parameters
[in]aNumber to be evaluated.
Returns
logical :: is_normal — \( a \neq \infty \land a = NaN \), logically true or false.

Definition at line 1139 of file mo_utils.F90.

Referenced by mo_utils::is_normal::is_normal_dp().

Here is the caller graph for this function:

◆ is_normal_sp()

elemental pure logical function mo_utils::is_normal_sp ( real(sp), intent(in)  a)
private
Parameters
[in]aNumber to be evaluated.
Returns
logical :: is_normal — \( a \neq \infty \land a = NaN \), logically true or false.

Definition at line 1152 of file mo_utils.F90.

Referenced by mo_utils::is_normal::is_normal_sp().

Here is the caller graph for this function:

◆ lesserequal_dp()

logical elemental pure function mo_utils::lesserequal_dp ( real(dp), intent(in)  a,
real(dp), intent(in)  b 
)
private

Definition at line 1042 of file mo_utils.F90.

◆ lesserequal_sp()

logical elemental pure function mo_utils::lesserequal_sp ( real(sp), intent(in)  a,
real(sp), intent(in)  b 
)
private

Definition at line 1052 of file mo_utils.F90.

◆ linspace_dp()

real(dp) function, dimension(nstep) mo_utils::linspace_dp ( real(dp), intent(in)  lower,
real(dp), intent(in)  upper,
integer(i4), intent(in)  nstep 
)
private

Definition at line 908 of file mo_utils.F90.

◆ linspace_i4()

integer(i4) function, dimension(nstep) mo_utils::linspace_i4 ( integer(i4), intent(in)  lower,
integer(i4), intent(in)  upper,
integer(i4), intent(in)  nstep 
)
private

Definition at line 882 of file mo_utils.F90.

◆ linspace_i8()

integer(i8) function, dimension(nstep) mo_utils::linspace_i8 ( integer(i8), intent(in)  lower,
integer(i8), intent(in)  upper,
integer(i4), intent(in)  nstep 
)
private

Definition at line 895 of file mo_utils.F90.

◆ linspace_sp()

real(sp) function, dimension(nstep) mo_utils::linspace_sp ( real(sp), intent(in)  lower,
real(sp), intent(in)  upper,
integer(i4), intent(in)  nstep 
)
private

Definition at line 921 of file mo_utils.F90.

◆ locate_0d_dp()

integer(i4) function mo_utils::locate_0d_dp ( real(dp), dimension(:), intent(in)  x,
real(dp), intent(in)  y 
)
private

Definition at line 1171 of file mo_utils.F90.

◆ locate_0d_sp()

integer(i4) function mo_utils::locate_0d_sp ( real(sp), dimension(:), intent(in)  x,
real(sp), intent(in)  y 
)
private

Definition at line 1188 of file mo_utils.F90.

◆ locate_1d_dp()

integer(i4) function, dimension(:), allocatable mo_utils::locate_1d_dp ( real(dp), dimension(:), intent(in)  x,
real(dp), dimension(:), intent(in)  y 
)
private

Definition at line 1205 of file mo_utils.F90.

◆ locate_1d_sp()

integer(i4) function, dimension(:), allocatable mo_utils::locate_1d_sp ( real(sp), dimension(:), intent(in)  x,
real(sp), dimension(:), intent(in)  y 
)
private

Definition at line 1229 of file mo_utils.F90.

◆ notequal_dp()

logical elemental pure function mo_utils::notequal_dp ( real(dp), intent(in)  a,
real(dp), intent(in)  b 
)
private

Definition at line 1063 of file mo_utils.F90.

◆ notequal_sp()

logical elemental pure function mo_utils::notequal_sp ( real(sp), intent(in)  a,
real(sp), intent(in)  b 
)
private

Definition at line 1073 of file mo_utils.F90.

◆ special_value_dp()

real(dp) function mo_utils::special_value_dp ( real(dp), intent(in)  x,
character(len = *), intent(in)  ieee 
)
private
Parameters
[in]xdummy for kind of output.
[in]ieeeieee signal name.
Returns
real(dp) :: special_value — IEEE special value, IEEE_SIGNALING_NAN, IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_POSITIVE_INF, IEEE_NEGATIVE_DENORMAL, IEEE_POSITIVE_DENORMAL, IEEE_NEGATIVE_NORMAL, IEEE_POSITIVE_NORMAL, IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO,

Definition at line 1339 of file mo_utils.F90.

Referenced by mo_utils::special_value::special_value_dp().

Here is the caller graph for this function:

◆ special_value_sp()

real(sp) function mo_utils::special_value_sp ( real(sp), intent(in)  x,
character(len = *), intent(in)  ieee 
)
private
Parameters
[in]xdummy for kind of output.
[in]ieeeieee signal name.
Returns
IEEE special value, IEEE_SIGNALING_NAN, IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_POSITIVE_INF, IEEE_NEGATIVE_DENORMAL, IEEE_POSITIVE_DENORMAL, IEEE_NEGATIVE_NORMAL, IEEE_POSITIVE_NORMAL, IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO,

Definition at line 1400 of file mo_utils.F90.

Referenced by mo_utils::special_value::special_value_sp().

Here is the caller graph for this function:

◆ swap_vec_dp()

subroutine mo_utils::swap_vec_dp ( real(dp), dimension(:), intent(inout)  x,
integer(i4), intent(in)  i1,
integer(i4), intent(in)  i2 
)
private

Definition at line 1295 of file mo_utils.F90.

◆ swap_vec_i4()

subroutine mo_utils::swap_vec_i4 ( integer(i4), dimension(:), intent(inout)  x,
integer(i4), intent(in)  i1,
integer(i4), intent(in)  i2 
)
private

Definition at line 1323 of file mo_utils.F90.

◆ swap_vec_sp()

subroutine mo_utils::swap_vec_sp ( real(sp), dimension(:), intent(inout)  x,
integer(i4), intent(in)  i1,
integer(i4), intent(in)  i2 
)
private

Definition at line 1309 of file mo_utils.F90.

◆ swap_xy_dp()

elemental pure subroutine mo_utils::swap_xy_dp ( real(dp), intent(inout)  x,
real(dp), intent(inout)  y 
)
private

Definition at line 1255 of file mo_utils.F90.

◆ swap_xy_i4()

elemental pure subroutine mo_utils::swap_xy_i4 ( integer(i4), intent(inout)  x,
integer(i4), intent(inout)  y 
)
private

Definition at line 1281 of file mo_utils.F90.

◆ swap_xy_sp()

elemental pure subroutine mo_utils::swap_xy_sp ( real(sp), intent(inout)  x,
real(sp), intent(inout)  y 
)
private

Definition at line 1268 of file mo_utils.F90.

◆ unpack_chunkwise_dp()

real(dp) function, dimension(size(mask, kind=i8)) mo_utils::unpack_chunkwise_dp ( real(dp), dimension(:), intent(in)  vector,
logical, dimension(:), intent(in)  mask,
real(dp), intent(in)  field,
integer(i8), intent(in), optional  chunksizearg 
)
private

Definition at line 1737 of file mo_utils.F90.

◆ unpack_chunkwise_i1()

integer(i1) function, dimension(size(mask, kind=i8)) mo_utils::unpack_chunkwise_i1 ( integer(i1), dimension(:), intent(in)  vector,
logical, dimension(:), intent(in)  mask,
integer(i1), intent(in)  field,
integer(i8), intent(in), optional  chunksizearg 
)
private

Definition at line 1785 of file mo_utils.F90.