ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Generate and return the number of records in the entire record-oriented input file. More...
Generate and return the number of records in the entire record-oriented input file.
If any error occurs during the IO and the output iostat
argument is missing, the program will halt by calling error stop
.
Within the procedures,
file
is present, the file will be opened on input and closed before returning the control.unit
is present, the file is assumed to opened already, will be rewound to the file beginning, and will be positioned after the last record in file without being closed on return.See getCountRecordLeft for counting the number of records left in an already-opened file.
[in] | file | : The input scalar character of default kind SK containing the file path, whose number of records will be returned.The input file must not be connected prior to calling this procedure.If the file is already connected, specify the file unit as input unit argument.(optional. It must be present if and only if the input argument unit is missing.) |
[in] | unit | : The input scalar integer of default kind IK containing the connected file unit, whose number of records will be returned.The input unit must be connected prior to calling this procedure.If the unit is not already connected, specify the file path as the input file argument.(optional. It must be present if and only if the input argument unit is missing.) |
isCountable | : The external user-specified function that takes one input scalar character of default kind SK of arbitrary length type parameter containing the most recent record that has been read from the input file.It returns a scalar logical of default kind LK that is .true. if and only if the input record should be included in counting.The following illustrates the generic interface of isCountable , function isCountable(record) result(countable)
character(*, SK), intent(in) :: record
logical(LK) :: countable
end function
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar... Definition: pm_kind.F90:268 integer, parameter LK The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(.... Definition: pm_kind.F90:541 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 (optional. If missing, all records are included in counting.) | |
[in] | del | : The input scalar logical of default kind LK.
.false. ) |
[out] | iostat | : The optional output scalar integer of default kind IK.
|
[in,out] | iomsg | : The input/output scalar character of default kind SK containing the error message, if any error occurs.A length type parameter value of LEN_IOMSG is generally sufficient for iomsg to contain the output error messages.(optional. Its presence is relevant only if the iostat output argument is also present.) |
nrecord
: The output scalar integer
of default kind IK, representing the number of records in the input file.
Possible calling interfaces ⛓
file
must not be connected prior to calling this procedure.unit
must be already connected prior to calling this procedure.CHECK_ENABLED=1
.impure
.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓ iseq()
external comparison procedures for custom exclusion or inclusion of lines in the count.
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.