This is a generic method of the derived type display_type with pass
attribute.
This method displays the input object
of supported type and kind and rank in the specified output.
- Parameters
-
[in] | object | : The input object of either,
-
scalar or array of rank
1 or 2 or 3 of type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU), or
-
scalar or array of rank
1 or 2 or 3 of type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
-
scalar or array of rank
1 or 2 or 3 of type logical of kind any supported by the processor (e.g., LK), or
-
scalar or array of rank
1 or 2 or 3 of type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
-
scalar or array of rank
1 or 2 or 3 of type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128), or
-
scalar or array of rank
1 or 2 or 3 of type css_type, or
-
scalar or array of rank
1 or 2 or 3 of type csi_type, or
-
scalar or array of rank
1 or 2 or 3 of type csl_type, or
-
scalar or array of rank
1 or 2 or 3 of type csc_type, or
-
scalar or array of rank
1 or 2 or 3 of type csr_type, or
-
scalar or array of rank
1 or 2 of type cvs_type, or
-
scalar or array of rank
1 or 2 of type cvi_type, or
-
scalar or array of rank
1 or 2 of type cvl_type, or
-
scalar or array of rank
1 or 2 of type cvc_type, or
-
scalar or array of rank
1 or 2 of type cvr_type, or
-
scalar or array of rank
1 of type cms_type, or
-
scalar or array of rank
1 of type cmi_type, or
-
scalar or array of rank
1 of type cml_type, or
-
scalar or array of rank
1 of type cmc_type, or
-
scalar or array of rank
1 of type cmr_type
-
scalar or array of rank
1 or 2 or 3 of type css_pdt, or
-
scalar or array of rank
1 or 2 or 3 of type csi_pdt, or
-
scalar or array of rank
1 or 2 or 3 of type csl_pdt, or
-
scalar or array of rank
1 or 2 or 3 of type csc_pdt, or
-
scalar or array of rank
1 or 2 or 3 of type csr_pdt, or
-
scalar or array of rank
1 or 2 of type cvs_pdt, or
-
scalar or array of rank
1 or 2 of type cvi_pdt, or
-
scalar or array of rank
1 or 2 of type cvl_pdt, or
-
scalar or array of rank
1 or 2 of type cvc_pdt, or
-
scalar or array of rank
1 or 2 of type cvr_pdt, or
-
scalar or array of rank
1 of type cms_pdt, or
-
scalar or array of rank
1 of type cmi_pdt, or
-
scalar or array of rank
1 of type cml_pdt, or
-
scalar or array of rank
1 of type cmc_pdt, or
-
scalar or array of rank
1 of type cmr_pdt
containing the content to display. |
[in] | tmsize | : The input scalar of integer of default kind IK representing the number of empty lines preceding the object in the display.
(optional, default = 0_IK ) |
[in] | bmsize | : The input scalar of integer of default kind IK representing the number of empty lines succeeding the object in the display.
(optional, default = 0_IK ) |
[in] | count | : The input scalar of integer of default kind IK representing the number of times the object will have to be sequentially displayed in separate lines.
(optional, default = 1_IK ) |
[in] | unit | : The input scalar integer of default kind IK representing the output display unit number where the text will be displayed.
(optional, default = display_type%unit ) |
[in] | advance | : The input scalar character of default kind SK that must be either NO or YES .
It has the same functionality and meaning as the advance argument in the Fortran intrinsic IO statement read() .
(optional, default = YES ) |
[in] | format | : The input scalar character of default kind SK containing the format with which the object should be displayed.
If present, the input value is directly passed to the Fortran write() statement for a formatted display.
(optional, default = YES ) |
[in] | deliml | : The input scalar of type character of default kind default kind SK, whose contents represent the left-delimiter to be used for left-wrapping fields of the input object.
The common Fortran-style left-delimiter for complex fields is the left-parenthesis \(\texttt{(}\).
The two most common left-delimiters string fields are the single \(\texttt{'}\) and double \(\texttt{"}\) quotation marks.
The left-delimiter is particularly relevant to string and complex objects that are passed to the methods of display_type.
The input deliml will be used for constructing the field format only if the input argument format is missing.
(optional. default = delimr or if missing, the corresponding value from the deliml component of the parent disp object of this method.) |
[in] | delimr | : The input scalar of type character of default kind default kind SK, whose contents represent the right-delimiter to be used for right-wrapping fields of the input object.
The common Fortran-style right-delimiter for complex fields is the right-parenthesis \(\texttt{)}\).
The two most common right-delimiters string fields are the single \(\texttt{'}\) and double \(\texttt{"}\) quotation marks.
The right-delimiter is particularly relevant to string and complex objects that are passed to the methods of display_type.
The input delimr will be used for constructing the field format only if the input argument format is missing.
(optional. default = deliml or if missing, the corresponding value from the delimr component of the parent disp object of this method.) |
[in] | sticky | : The input scalar logical of default kind LK.
If .true. the input arguments will update the corresponding components of the parent object of type display_type for later usage.
(optional, default = .false._LK ) |
Possible calling interfaces ⛓
type(display_type) :: disp
, tmsize = tmsize &
, bmsize = bmsize &
, count = count &
, unit = unit &
, advance = advance &
, format = format &
, deliml = deliml &
, delimr = delimr &
, sticky = sticky &
)
This is a generic method of the derived type display_type with pass attribute.
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Generate and return an object of type display_type.
- See also
- wrap_type%wrap()
display_type%show()
display_type%skip()
Example usage ⛓
10 type(display_type) :: disp
14 call disp%show(
'disp = display_type(file = SK_"main.out.F90", status = "old", position = "append")')
16 call disp%show(
"call disp%show('ParaMonte') ! output without quotation marks.")
19 call disp%show(
"call disp%show('ParaMonte', deliml = SK_'''') ! output with single quotation marks.")
20 call disp%show(
'ParaMonte', deliml
= SK_
'''')
22 call disp%show(
'call disp%show("ParaMonte", deliml = SK_"""") ! output with double quotation marks.')
23 call disp%show(
'ParaMonte', deliml
= SK_
"""")
25 call disp%show(
'call disp%show("ParaMonte", deliml = SK_"`") ! output with backtick marks.')
26 call disp%show(
'ParaMonte', deliml
= SK_
"`")
30 call disp%show(
'disp = display_type(disp%unit)')
33 call disp%show(
"call disp%show([character(10) :: 'ParaMonte', 'is', 'a', 'machine', 'learning', 'library.']) ! output without quotation marks.")
34 call disp%show([
character(
10) ::
'ParaMonte',
'is',
'a',
'machine',
'learning',
'library.'])
36 call disp%show(
"call disp%show([character(10) :: 'ParaMonte', 'is', 'a', 'machine', 'learning', 'library.'], deliml = SK_'''') ! output with single quotation marks.")
37 call disp%show([
character(
10) ::
'ParaMonte',
'is',
'a',
'machine',
'learning',
'library.'], deliml
= SK_
'''')
39 call disp%show(
'call disp%show([character(10) :: "ParaMonte", "is", "a", "machine", "learning", "library."], deliml = SK_"""") ! output with double quotation marks.')
40 call disp%show([
character(
10) ::
'ParaMonte',
'is',
'a',
'machine',
'learning',
'library.'], deliml
= SK_
"""")
42 call disp%show(
'call disp%show([character(10) :: "ParaMonte", "is", "a", "machine", "learning", "library."], deliml = SK_"`") ! output with backtick marks.')
43 call disp%show([
character(
10) ::
'ParaMonte',
'is',
'a',
'machine',
'learning',
'library.'], deliml
= SK_
"`")
47 call disp%show(
'disp = display_type(disp%unit)')
50 call disp%show(
"call disp%show(.true.)")
53 call disp%show(
"call disp%show([.true., .false.])")
58 call disp%show(
'disp = display_type(disp%unit)')
64 call disp%show(
"call disp%show([1, 2])")
69 call disp%show(
'disp = display_type(disp%unit)')
75 call disp%show(
"call disp%show([1., 2.])")
80 call disp%show(
'disp = display_type(disp%unit)')
83 call disp%show(
"call disp%show((1.,-1.))")
86 call disp%show(
"call disp%show([(1.,-1.), (2.,-2.)])")
91 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
92 call disp%show(
"! Display matrices of values.")
93 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
97 call disp%show(
'disp = display_type(disp%unit)')
100 call disp%show(
"call disp%show(reshape(getUnifRand(0, 1, 9), [3, 3]))")
105 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
106 call disp%show(
"! Display contents of containers of matrices.")
107 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
112 type(cmi_type) :: ConMat(
3)
114 call disp%show(
'allocate(ConMat(1)%val(2,2)); call setUnifRand(ConMat(1)%val)')
115 allocate(ConMat(
1)
%val(
2,
2));
call setUnifRand(ConMat(
1)
%val)
116 call disp%show(
'allocate(ConMat(2)%val(3,5)); call setUnifRand(ConMat(2)%val)')
117 allocate(ConMat(
2)
%val(
3,
5));
call setUnifRand(ConMat(
2)
%val)
118 call disp%show(
'allocate(ConMat(3)%val(5,3)); call setUnifRand(ConMat(3)%val)')
119 allocate(ConMat(
3)
%val(
5,
3));
call setUnifRand(ConMat(
3)
%val)
120 call disp%show(
'disp = display_type(disp%unit)')
123 call disp%show(
"call disp%show(ConMat(:))")
129 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
130 call disp%show(
"! Display cubes of values.")
131 call disp%show(
"!%%%%%%%%%%%%%%%%%%%%%%%%%")
135 call disp%show(
'disp = display_type(disp%unit)')
138 call disp%show(
"call disp%show(reshape(getUnifRand(0, 1, 27), [3, 3, 3]))")
Generate and return a scalar or a contiguous array of rank 1 of length s1 of randomly uniformly distr...
Return a uniform random scalar or contiguous array of arbitrary rank of randomly uniformly distribute...
This is a generic method of the derived type display_type with pass attribute.
This module contains the derived types for generating allocatable containers of scalar,...
This module contains classes and procedures for computing various statistical quantities related to t...
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
This is the derived type for generating a container of a matrix component of type integer of default ...
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
2disp = display_type(file
= SK_
"main.out.F90", status
= "old", position
= "append")
7call disp%show(
'ParaMonte', deliml
= SK_
'''')
10call disp%show(
"ParaMonte", deliml
= SK_
"""")
13call disp%show(
"ParaMonte", deliml
= SK_
"`")
19call disp%show([
character(
10) ::
'ParaMonte',
'is',
'a',
'machine',
'learning',
'library.'])
20ParaMonte , is , a , machine , learning , library.
22call disp%show([
character(
10) ::
'ParaMonte',
'is',
'a',
'machine',
'learning',
'library.'], deliml
= SK_
'''')
23'ParaMonte ',
'is ',
'a ',
'machine ',
'learning ',
'library. '
25call disp%show([
character(
10) ::
"ParaMonte",
"is",
"a",
"machine",
"learning",
"library."], deliml
= SK_
"""")
26"ParaMonte ",
"is ",
"a ",
"machine ",
"learning ",
"library. "
28call disp%show([
character(
10) ::
"ParaMonte",
"is",
"a",
"machine",
"learning",
"library."], deliml
= SK_
"`")
29`ParaMonte `, `is `, `a `, `machine `, `learning `, `library. `
56+1.00000000,
+2.00000000
62(
+1.00000000,
-1.00000000)
65(
+1.00000000,
-1.00000000), (
+2.00000000,
-2.00000000)
86allocate(ConMat(
1)
%val(
2,
2));
call setUnifRand(ConMat(
1)
%val)
87allocate(ConMat(
2)
%val(
3,
5));
call setUnifRand(ConMat(
2)
%val)
88allocate(ConMat(
3)
%val(
5,
3));
call setUnifRand(ConMat(
3)
%val)
93+741900207,
+1001778922
94-1240652431,
+1442219234
96+1466883441,
-1379043405,
+1198677475,
+585175121,
-1628643398
97-252898810,
+2022011753,
+123933851,
+1882487747,
-1396167880
98-659951433,
-1957610109,
-451956310,
+953750058,
-1438064950
100+912069651,
+725737040,
+694612984
101+2025485253,
-1477319234,
-2121591544
102-1056675173,
+1910061962,
-2118203794
103-2020094755,
-659040418,
-1321281282
104+1777822870,
+362109658,
-1450000541
- Bug:
Status: Unresolved
Source: Intel Classic Fortran Compiler ifort
version 2021.5
Description: The Intel Classic Fortran Compiler ifort
version 2021.5 cannot not compile the following interface specification for the procedures, yielding "ambiguous interface" error.
module container_module
use iso_fortran_env
integer, parameter :: lkc = logical_kinds(1)
integer, parameter :: ikc = integer_kinds(1)
type :: container_ik(kind)
integer , kind :: kind = integer_kinds(1)
integer(kind) :: value
end type
type :: container_lk(kind)
integer , kind :: kind = logical_kinds(1)
logical(kind) :: value
end type
end module
module disp_module
use container_module
type :: disp_type
end type
module subroutine show_logical(self, object)
use container_module, only: container => container_lk
class(disp_type) , intent(inout) :: self
type(container(lkc)) , intent(in) :: object
end subroutine
module subroutine show_integer(self, object)
use container_module, only: container => container_ik
class(disp_type) , intent(inout) :: self
type(container(ikc)) , intent(in) :: object
end subroutine
end interface
end module
end
Note that the issue is with the aliasing of the pm_container module entities use container_module, only: container => container_ik
.
Remedy (as of ParaMonte Library version 2.0.0): For now, all interfaces were painfully converted to explicit type names (instead of aliases).
- Todo:
- Critical Priority: The syntax of the procedure interfaces must be fixed and reverted to the original aliasing style, as soon as the Intel Classic Fortran Compiler
ifort
version 2021.5 bug is resolved. Note that GNU Fortran Compiler gfortran
version 10-11 has no problem compiling the code.
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.
-
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.
-
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.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, Oct 16, 2009, 11:14 AM, Michigan
Definition at line 11726 of file pm_io.F90.