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

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

Inheritance diagram for pm_kind::modeli_type:
Collaboration diagram for pm_kind::modeli_type:

Public Attributes

integer(IKHhuge
 The scalar integer of the highest kind IKH supported by the ParaMonte library, representing the largest value in the model that includes the integer data type of interest.
More...
 
- Public Attributes inherited from pm_kind::modeln_type
integer(IKdigits
 The scalar integer of default kind IK, whose value is the number of significant bit digits in the model that includes the numeric data type of interest, that is q or p in the integer and real models detailed in model_type.
More...
 
integer(IKradix
 The scalar integer of default kind IK, whose value is the base in the model that includes the numeric data of interest, that is r or b in the integer and real models detailed in model_type.
More...
 
integer(IKrange
 The scalar integer of default kind IK, holding the equivalent decimal exponent range in the models representing integer or real data type of interest.
The value is int(log10(huge)) for integer data type and int(min(log10(huge), -log10(tiny))) for real data type, where huge and tiny are the largest and smallest positive numbers in the corresponding model.
More...
 
- Public Attributes inherited from pm_kind::model_type
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 modeli_type that contain the characteristics of the processor representation model used for the requested integer data object.

See the documentations of model_type for details of model sets for supported data types.

Parameters
[in]mold: The input scalar or array of arbitrary rank of either
  1. type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
whose type and kind will determine the characteristics of the output model object.
The specific value of the input mold is irrelevant and ignored.
Returns
model : The output scalar or array of type,
  1. modeli_type,
containing the characteristics of the processor representation model used for the input data entity.


Possible calling interfaces

class(modeln_type), allocatable :: modelNum
class(model_type), allocatable :: model
type(modeli_type) :: modelInt
modelInt = modeli_type(mold)
modelNum = modeli_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 modeli_type that contain the characte...
Definition: pm_kind.F90:1615
This is the abstract derived type for creating objects of class modeln_type that contain the characte...
Definition: pm_kind.F90:1544
Remarks
The procedures under discussion are pure.
The procedures under discussion are elemental.
See also
model_type
modelb_type
modeln_type
modeli_type
modeli_type


Example usage

1program example
2
3 use pm_kind, only: SK, IK
4 use pm_kind, only: modeli_type
5 use pm_io, only: display_type
6
7 implicit none
8
9 type(display_type) :: disp
10 disp = display_type(file = "main.out.F90")
11
12 block
13 use pm_kind, only: TKG => IKS
14 type(modeli_type) :: model
15 integer(TKG) :: mold
16 call disp%skip()
17 call disp%show("kind(mold)")
18 call disp%show( kind(mold) )
19 call disp%show("model = modeli_type(mold)")
20 model = modeli_type(mold)
21 call disp%show("[model%digits, model%radix, model%range, model%storage_size]")
22 call disp%show( [model%digits, model%radix, model%range, model%storage_size] )
23 call disp%show("model%huge")
24 call disp%show( model%huge )
25 call disp%skip()
26 end block
27
28 block
29 use pm_kind, only: TKG => IKD
30 type(modeli_type) :: model
31 integer(TKG) :: mold
32 call disp%skip()
33 call disp%show("kind(mold)")
34 call disp%show( kind(mold) )
35 call disp%show("model = modeli_type(mold)")
36 model = modeli_type(mold)
37 call disp%show("[model%digits, model%radix, model%range, model%storage_size]")
38 call disp%show( [model%digits, model%radix, model%range, model%storage_size] )
39 call disp%show("model%huge")
40 call disp%show( model%huge )
41 call disp%skip()
42 end block
43
44 block
45 use pm_kind, only: TKG => IKH
46 type(modeli_type) :: model
47 integer(TKG) :: mold
48 call disp%skip()
49 call disp%show("kind(mold)")
50 call disp%show( kind(mold) )
51 call disp%show("model = modeli_type(mold)")
52 model = modeli_type(mold)
53 call disp%show("[model%digits, model%radix, model%range, model%storage_size]")
54 call disp%show( [model%digits, model%radix, model%range, model%storage_size] )
55 call disp%show("model%huge")
56 call disp%show( model%huge )
57 call disp%skip()
58 end block
59
60end program example
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
integer, parameter IKS
The single-precision integer kind in Fortran mode. On most platforms, this is a 32-bit integer kind.
Definition: pm_kind.F90:563
integer, parameter IKH
The scalar integer constant of intrinsic default kind, representing the highest range integer kind ty...
Definition: pm_kind.F90:828
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter IKD
The double precision integer kind in Fortran mode. On most platforms, this is a 64-bit integer kind.
Definition: pm_kind.F90:564
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2kind(mold)
3+4
4model = modeli_type(mold)
5[model%digits, model%radix, model%range, model%storage_size]
6+31, +2, +9, +32
7model%huge
8+2147483647
9
10
11kind(mold)
12+8
13model = modeli_type(mold)
14[model%digits, model%radix, model%range, model%storage_size]
15+63, +2, +18, +64
16model%huge
17+9223372036854775807
18
19
20kind(mold)
21+16
22model = modeli_type(mold)
23[model%digits, model%radix, model%range, model%storage_size]
24+127, +2, +38, +128
25model%huge
26+170141183460469231731687303715884105727
27
28
Test:
test_pm_kind


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 at Austin

Definition at line 1615 of file pm_kind.F90.

Member Data Documentation

◆ huge

integer(IKH) pm_kind::modeli_type::huge

The scalar integer of the highest kind IKH supported by the ParaMonte library, representing the largest value in the model that includes the integer data type of interest.

Definition at line 1616 of file pm_kind.F90.


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