ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Generate and return a generic or type/kind-specific IO format with the requested specifications that can be use to read or write individual records in IO actions. More...
Generate and return a generic or type/kind-specific IO format with the requested specifications that can be use to read or write individual records in IO actions.
[in] | mold | : The input vector of arbitrary size (:) of,
This argument offers an easy way of defining format for fields of specific intrinsic type in a record, particularly, fields of type character or complex .For example, specifying a complex scalar for mold will automatically use the default left/right Fortran delimiters () for complex fields in the output format .If any other input argument is also present, its value will override the default behavior dictated by the presence of the input argument mold .The specific value and size of mold is completely ignored within the procedure.For more possibilities, see the examples below. (optional. If missing, the output format will be constructed for as generic as possible field records.) |
[in] | prefix | : The input scalar of type character of default kind SK, containing the prefix to be added to the output format .The prefix appears at the beginning of the record to be written via the output format .(optional, default = "" ) |
[in] | ed | : The input scalar of type character of default kind SK, containing the edit descriptor to be used for formatting each (sub)field.Possible values include but are not limited to A , I , E , EN , ES , F , G .(optional, default = G ) |
[in] | sep | : The input scalar of type character of default kind SK, containing the repeat field separator to be used in the output format .(optional, default = ", " ) |
[in] | deliml | : The input scalar of type character of default kind SK, containing the set of characters that serve as the left-delimiter for a group of subfields (for example, the real and imaginary components of fields of type complex ).For example,
"(" if mold is of type complex , \(\ms{"}\) if mold is of type character , and nothing otherwise.) |
[in] | subsep | : The input scalar of type character of default kind SK, containing the sub-field separator to be used in the output format .An example of subfields are the two real and imaginary components of complex fields.For example,
complex values and can be applied to any fixed-size group of fields in a record.It is however, important to specify the number of subfields within a field of a record by setting the value of the input argument subcount .(optional, default = the value of the input argument sep .) |
[in] | delimr | : The input scalar of type character of default kind SK, containing the set of characters that serve as the right-delimiter for a group of subfields (for example, the real and imaginary components of fields of type complex ).For example,
")" if mold is of type complex , \(\ms{"}\) if mold is of type character , and nothing otherwise.) |
[in] | count | : The input scalar positive integer of default kind IK containing the repeat count of groups of subfields in the record.For example,
If the number of entries is larger than the specified repeat count, the rest of entries will be transferred to the next record when performing IO via the output format from this generic interface.(optional, default = * , that is, as many as needed.) |
[in] | subcount | : The input scalar positive integer of default kind IK containing the subfield count within a single field of the record.The input subcount is essentially the number of times the input subsep appears between subfields plus 1 .For example, if the format is to be used for complex values, subcount can be set to 2 along with other appropriate arguments to construct Fortran-style complex formats.(optional, default = 2 if mold is of type complex and 0 otherwise.) |
[in] | width | : The input scalar positive integer of default kind IK containing the width of each each subfield (or if none exists, each field) in the record formatted via the output format .(optional. The default value is computed based on the input arguments such that any field value can be read or written with a fixed field length. Use 0 to request dynamic minimum width for each (sub)field that is automatically specified by the processor.) |
[in] | ndigit | : The input scalar positive integer of default kind IK containing the precision of the subfields or fields.
precision(mold) for real and complex and 1 for integer . In all other cases or if mold is missing, the default is processor dependent.) |
[in] | lenexp | : The input scalar integer of default kind IK containing the minimum width of the exponent for real-valued entries in the records formatted via the output format .Note that when the input argument ndigit is specified, the Fortran default exponent field length becomes 3 .As such, if ndigit is present, then it is recommended to also explicitly specify lenexp must be explicitly set for output formats that are supposed to handle numbers with kind type parameter numbers that have exponent range that occupies more than 3 digits, e.g., RK128, CK128.(optional, default = 0 corresponding to the minimum number of digits required to represent the exponent value, that is, without leading zeros. If present, ndigit must be also present.) |
[in] | signed | : The input scalar logical of default kind LK.
.false. ) |
format
: The output scalar allocatable
of type character
of default kind SK containing the requested IO format.
Possible calling interfaces ⛓
present(lenexp) .and. present(ndigit) .or. .not. present(lenexp)
must hold for the corresponding input argument.present(lenexp) .and. width /= 0 .or. .not. present(lenexp)
must hold for the corresponding input argument.ed == "g" .or. ed == "G" .or. width > 0
must hold for the corresponding input arguments.width >= 5 + ndigit + lenexp
).(ed /= SKG_"f" .and. ed /= SKG_"F") .or. .not.present(lenexp)
must hold for the corresponding input arguments.CHECK_ENABLED=1
.pure
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓ ifort
version 2021.8.0 20221119 ifort
version 2021.8.0 20221119 cannot run the following function call within the implementation of the procedures, yielding the following error,
Remedy (as of ParaMonte Library version 2.0.0): For now, the value
attribute of the input argument of function getCountDigit was converted to intent(in)
.
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.
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.