Useful procedures when doing percolation.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | parameter | :: | dp | = | kind(1.0d0) | Kind used for all real variables. |
Make a string of "correct" length from a positive integer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | x | Positive integer to be converted. |
String containing the given integer, without spaces.
Create an array of N linearly spaced values (not intervals)
from a to b.
Similar to numpy.linspace(a, b, N)
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | a | Lower endpoint. |
||
real(kind=dp), | intent(in) | :: | b | Upper endpoint. |
||
integer, | intent(in) | :: | N | Number of values (not intervals). |
Array of linearly spaced values.
Find the common element in two arrays, given a total of num_labels unique elements. Used by find_spanning_cluster.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:) | :: | array1 | Array to analyse. |
|
integer, | intent(in), | dimension(:) | :: | array2 | Array to analyse. |
|
integer, | intent(in) | :: | num_labels | The known number of unique non-zero elements. |
The first non-zero common element.
Return a logical
matrix where the .true.
values are the sites
belonging to the percolating cluster, when periodic boundary
conditions are considered.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | dimension(:,:) | :: | label_matrix | Labelled matrix from label or hoshen_kopelman. |
|
integer, | intent(in) | :: | percolating_label | Known label of the percolating cluster. |
||
integer, | intent(in) | :: | num_clusters | The known number of clusters. |
Matrix where the .true.
values are the sites belonging to
the percolating cluster with periodic boundary conditions.
Compute a linear fit for the given data, return
the slope and the constant term.
dgels
from LAPACK solves the linear least squares problem.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | x | Values to be fitted. |
|
real(kind=dp), | intent(in), | dimension(:) | :: | y | Values to be fitted. |
|
real(kind=dp), | intent(inout) | :: | slope | \(a\) in \(y=ax+b\). |
||
real(kind=dp), | intent(inout) | :: | const | \(b\) in \(y=ax+b\). |
Find a random position on matrix such that
matrix(i, j) is .true.
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in), | dimension(:,:) | :: | matrix | Matrix whose |
|
integer, | intent(out) | :: | i | Returned random point on matrix. |
||
integer, | intent(out) | :: | j | Returned random point on matrix. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout) | :: | x | |||
integer, | intent(in) | :: | L |