ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
Developer Remarks
Type pm_arrayChoice::getChoice
The choice of the input argument name s1 is deliberate to allow future expansion of the interface to output choice of higher rank than 1.
Module pm_arrayComplement
The two generic interfaces of this module getComplement and getComplementRange are intentionally kept separately from each other under different names.
Type pm_arrayRebill::setRebilled
An optional dummy argument stat (instead of failed) for the procedures of this generic interface are impossible as it creates ambiguous interfaces.
Type pm_arrayRebind::setRebound
An optional dummy argument stat (instead of failed) for the procedures of this generic interface are impossible as it creates ambiguous interfaces.
Type pm_arrayRefill::setRefilled
An optional dummy argument stat (instead of failed) for the procedures of this generic interface are impossible as it creates ambiguous interfaces.
Type pm_arrayResize::setResized
An optional dummy argument stat (instead of failed) for the procedures of this generic interface are impossible as it creates ambiguous interfaces.
Type pm_arraySort::getSorted
The use of the Fortran intrinsic minloc in the sorting routines appears to lead a slightly better performance than the manual search.
Type pm_arraySort::setSorted
The use of the Fortran intrinsic minloc in the sorting routines appears to lead a slightly better performance than the manual search.
Module pm_arrayStrip
The subroutine equivalents of the function interface getStripped of this module were deemed unnecessary.
The functional interfaces exist solely for improved flexibility.
If performance matters, getSIL and getSIR can be readily used to eliminate the avoidable allocations within the procedures.
Module pm_container
Currently, only the scalar containers (matching names \(\ms{cs*_pdt}\) and \(\ms{cs*_type}\)) have custom elemental constructors.
The was no perceived usage and consensus on how to design custom constructors for containers of higher-rank components (e.g., vector, matrix, and cube containers).
Type pm_cosmology::setVolComDiffNormed
There is no performance benefit in passing the inverse of hubbleParamNormed instead of the what is passed in the current interface.
Do not attempt to change the interface.
Module pm_distanceEuclid
While it is possible to merge the generic interfaces for computing the Euclidean, Minkowski, Manhattan, and other distances into a single module, the decision was made not to do so, as each of these metrics require certain parameters that are distinct from other methods.
In such a case, there is no point in merging disparate procedures under a single generic interface name.
Type pm_distanceEuclid::getDisMatEuclid
The input arguments pack, subset appear first for a good reason: To allow the possibility of adding of similarly-named arguments for the input point matrix.
Type pm_distBand::distBand_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distBern::distBern_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distBeta::distBeta_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distCosRaised::distCosRaised_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distExp::distExp_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distExpGamma::distExpGamma_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distGamma::distGamma_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distGenExpGamma::distGenExpGamma_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distGenGamma::distGenGamma_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distGeom::distGeom_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distGeomCyclic::distGeomCyclic_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distKolm::distKolm_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distLogNorm::distLogNorm_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distLogUnif::distLogUnif_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distMultiNorm::distMultiNorm_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distNegExp::distNegExp_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distNorm::distNorm_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distPareto::distPareto_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distPois::distPois_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distPower::distPower_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distPoweto::distPoweto_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distUnif::distUnif_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distUnifEll::distUnifEll_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distUnifPar::distUnifPar_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_distUnifSphere::distUnifSphere_type
This derived type is currently devoid of any components or type-bound procedures because of the lack of portable and reliable support for Parameterized Derived Types (PDT) in some Fortran compilers.
For now, the utility of this derived type is limited to generic interface resolutions.
Type pm_err::getFine
The name Fine results from merging File with Line.
Type pm_err::mark_type
The allocation status of the components is used to signify the optional argument presence within the methods.
Type pm_err::note_type
The allocation status of the components is used to signify the optional argument presence within the methods.
Module pm_fftnr
The naming of this module is in honor of the Numerical Recipes book in Fortran that contains one of the most widely used implementations of radix-2 algorithm.
Type pm_io::getErrTableRead
The naming choice sep over delim or similar is deliberate.
While many resources consider separator and delimiter identical, it is more sensible to consider delimiter as a character set that determines what belong to a field, and separator as a character set that separates different fields from each other.
This convention is also consistent with the Fortran standard terminology where delimiters are referred to as delimiters.
Type pm_io::wrap_type
The allocation status of the components is used as the actual argument presence within the derived type methods.
Type pm_mathExp::getExpNext
A real value of kind RK32 can represent integer values as large as huge(1_int128) = 170141183460469231731687303715884105727 = 1.70141183E+38 < huge(1._RK32) = 3.40282347E+38 << huge(1._RK64).
One can envision a distant future human society with advanced computers capable of representing higher precision integer value for which RK32 or RK64 would be insufficient.
Type pm_mathExp::getExpPrev
A real value of kind RK32 can represent integer values as large as huge(1_int128) = 170141183460469231731687303715884105727 = 1.70141183E+38 < huge(1._RK32) = 3.40282347E+38 << huge(1._RK64).
One can envision a distant future human society with advanced computers capable of representing higher precision integer value for which RK32 or RK64 would be insufficient.
Type pm_matrixUpdate::setMatUpdate
The optional input argument operationA in the current interface was originally designed be either missing or set to trans standing for transposed.
While such convention offers a cleaner interface, it was later replaced with the two possible options transSymm and transHerm.
Although the new interface is uglier and verbose, it allows the possibility of extending this interface in the future without breaking the existing interface.
The redundancy also offers an automatic compile-time check against semantic bugs, given that alpha, beta must be of type real when transHerm transposition is requested.
Type pm_matrixUpdate::setMatUpdateTriang
The optional input argument operationA in the current interface was originally designed be either missing or set to trans standing for transposed.
While such convention offers a cleaner interface, it was later replaced with the two possible options transSymm and transHerm.
Although the new interface is uglier and verbose, it allows the possibility of extending this interface in the future without breaking the existing interface.
The redundancy also offers an automatic compile-time check against semantic bugs, given that alpha, beta must be of type real when transHerm transposition is requested.
Subprogram pm_parallelism::setImageCount (count)
Although this procedure exists for all parallelism builds of the ParaMonte library, it does nothing for non OpenMP-enabled library builds.
Note that the number of images/processes for Coarray/MPI -enabled applications must be set by the user at the time of running the parallel application.
This is unlike the OpenMP parallel applications where the number of threads can be (re)set at runtime during the program execution.
Module pm_physUnit
This is an experimental module still under development.
Other similar work includes but is not limited to Kim et al. 2017, Fortran 90 Programming With Physical Unit Annotations.
Type pm_quadPack::wcauchy_type
This generic interface exists because of the lack of support for PDTs in gfortran, requiring the derived type wcauchy_type to have cs component with the highest precision.
Type pm_quadPack::wcos_type
This generic interface exists because of the lack of support for PDTs in gfortran, requiring the derived type wcos_type to have omega component with the highest precision.
Type pm_quadPack::wsin_type
This generic interface exists because of the lack of support for PDTs in gfortran, requiring the derived type wsin_type to have omega component with the highest precision.
Module pm_sampleMean
While it is tempting to extend the generic interfaces of this module to weight arguments of type integer or real of various kinds, such extensions do not add any benefits beyond making the interface more flexible for the end user.
But such extensions would certainly make the maintenance and future extensions of this interface difficult and complex.
According to the coercion rules of the Fortran standard, if an integer is multiplied with a real, the integer value must be first converted to real of the same kind as the real value, then multiplied.
Furthermore, the floating-point multiplication tends to be faster than integer multiplication on most modern architecture.
The following list compares the cost and latencies of some of basic operations involving integers and real numbers.
Type pm_sampleMean::getMean
An XY input sample interface is impossible due to ambiguity with existing interfaces.
Type pm_sampleMean::setMean
The logic behind allowing a pair of time series data x and y is to allow fast computation of the mean of the pair and the weight sums in one loop.
This pattern occurs frequently in the computation of correlation coefficients.
Module pm_sampleNorm
While it is tempting to add generic interfaces for automatic standard normalization of the sample (in the absence of arbitrary shift andscale` arguments), such interfaces were not added to this module for the following reasons:
Type pm_sampleQuan::getQuan
A subroutine equivalent of this functional interface was deemed unnecessary.
Internally, the functional interface requires two internal runtime allocatable arrays to sort the input sample and store the sample ECDF.
For intensive repeated calculations, these allocation actions and copies can be avoided by explicitly implementing this generic interface as the following for a 1D sample.
Module pm_sampleScale
While it is tempting to add generic interfaces for automatic scaling by the inverse of the standard deviation of the sample (in the absence of arbitrary amount argument), such interfaces were not added to this module for the following reasons:
Module pm_sampleShift
While it is tempting to add generic interfaces for automatic shifting by the negative of the mean of the sample (in the absence of arbitrary amount argument), such interfaces were not added to this module for the following reasons:
Type pm_sampleWeight::getReweight
The term reweight here stands for refined weight.
Type pm_sampleWeight::setReweight
The term reweight here stands for refined weight.
Module pm_str

This module and its generic interfaces could have been written for strings of all kinds. However, there is no clear usage for the extended functionality of wrapping non-string arrays. Consequently, it is implemented specifically for strings.

Do not change the double back-ticks in

Subprogram pm_sysShell::VARENV_DIRTEMP_UNIX
The specific order of the vector elements is important and signifies the popularity of the environment variable names.
Subprogram pm_sysShell::VARENV_DIRTEMP_WINDOWS
The specific order of the vector elements is important and signifies the popularity of the environment variable names.
Module pm_val2complex
Do not change the double back-ticks in
Module pm_val2int
Do not change the double back-ticks in
Module pm_val2logical
Do not change the double back-ticks in
Module pm_val2real
Do not change the double back-ticks in
Module pm_val2str
Do not change the double back-ticks in