ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_kind::model_type Type Reference

This is the abstract derived type for creating objects of class model_type that contain the characteristics of the processor representation model used for the requested data object.
More...

Inheritance diagram for pm_kind::model_type:

Public Attributes

integer(IKkind
 The scalar integer of default kind IK, representing the processor-dependent kind type-parameter of data type of interest.
More...
 
integer(IKstorage_size
 The scalar integer of default kind IK, whose value is the size, in bits, that would be taken in memory by a scalar of the same type and kind as the data type of interest.
More...
 

Detailed Description

This is the abstract derived type for creating objects of class model_type that contain the characteristics of the processor representation model used for the requested data object.

The Fortran standard recognizes three data representation models:

Integer bit model

The Fortran standard (2023) defines intrinsic procedures for manipulating bits held within integers.
They are based on a model in which an integer holds \(s\) bits \(\{w_k : k = 0, \ldots, s - 1\}\), in a sequence from right to left, based on the non-negative value,

\begin{equation} \sum^{s - 1}_{k = 0} w_k \times 2^k ~. \end{equation}

This model is valid only in the context of the standard bit-manipulation intrinsic procedures.
It is identical to the model for integer data object described below when radix \(r = 2\) and \(w_{s - 1} = 0\) (corresponding to the integer-sign bit).
However, when \(r /= 2\) or when \(w_{s - 1} = 1\) the models do not correspond, and the value expressed as an integer may vary from processor to processor.

Integer data model

The standard Fortran numeric inquiry and manipulation functions are defined in terms of a model set of integers for each kind of integer data type implemented.
For each kind of integer type, the model set is,

\begin{equation} i = s \times \sum^{q}_{k = 1} w_k \times r^{k - 1} ~, \end{equation}

where,

  1. \(s\) is ␆ \(\pm1\), representing the sign (returned by the intrinsic sing()),
  2. \(r\) is an integer exceeding \(1\) (usually \(2\)), representing the radix (returned by the intrinsic radix()),
  3. \(q\) is a positive integer, representing the number of significant (equivalent to real mantissa) bits (returned by the intrinsic digits()),
  4. \(w_k\) is an integer in the range \(0\leq w_k < r\).

Real data model

The standard Fortran numeric inquiry and manipulation functions are defined in terms of a model set of integers for each kind of real data type implemented.
For each kind of real type, the model set is,

\begin{equation} x = \begin{cases} 0, \\ s \times b^e \times \sum^{p}_{k = 1} f_k \times b^{-k} ~, \end{cases} \end{equation}

where,

  1. \(s\) is ␆ \(\pm1\), representing the sign (returned by the intrinsic sing()),
  2. \(b\) is an integer exceeding \(1\), representing the radix (returned by the intrinsic radix()),
  3. \(p\) is an integer exceeding \(1\), representing the number of significant (mantissa) bits (returned by the intrinsic digits()),
  4. \(e\) is an integer in the range \(e_{min} \leq e \leq e_{max}\), representing the exponent of the real value (returned by the intrinsic exponent()),
  5. \(f_k\) is an integer in the range \(0\leq f_k < b\) except that \(f_1\) is nonzero.

Values of the parameters in these models are chosen for the processor so as best to fit the hardware with the proviso that all model numbers are representable.
It is likely that there are some machine numbers that lie outside the model.
For example, many computers represent the integer \(-r^q\), and the IEEE standard for floating-point arithmetic (ISO/IEC/IEEE 60559:2011) contains reals with \(f_1 = 0\) (called subnormal numbers) and register numbers with increased precision and range.


Possible calling interfaces

class(model_type), allocatable :: model
model = modelr_type(mold)
model = modelb_type(mold)
model = modeli_type(mold)
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
This is the abstract derived type for creating objects of class model_type that contain the character...
Definition: pm_kind.F90:1504
This is the abstract derived type for creating objects of class modelb_type that contain the characte...
Definition: pm_kind.F90:1680
This is the abstract derived type for creating objects of class modeli_type that contain the characte...
Definition: pm_kind.F90:1615
This is the abstract derived type for creating objects of class modelr_type that contain the characte...
Definition: pm_kind.F90:1746
See also
model_type
modeln_type
modeli_type
modelb_type
modelr_type


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, September 1, 2017, 11:35 PM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 1504 of file pm_kind.F90.

Member Data Documentation

◆ kind

integer(IK) pm_kind::model_type::kind

The scalar integer of default kind IK, representing the processor-dependent kind type-parameter of data type of interest.

Definition at line 1505 of file pm_kind.F90.

◆ storage_size

integer(IK) pm_kind::model_type::storage_size

The scalar integer of default kind IK, whose value is the size, in bits, that would be taken in memory by a scalar of the same type and kind as the data type of interest.

Definition at line 1506 of file pm_kind.F90.


The documentation for this type was generated from the following file: