Module contains lots of useful general routines
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | a(3,3) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in), | dimension(:) | :: | a | ||
complex(kind=dp), | intent(in), | dimension(:) | :: | b |
Strips string of all blank spaces
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Takes a string and converts to lowercase characters
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Rotates the dim x dim matrix 'mat' according to (rot)^dagger.mat.rot, where 'rot' is a unitary matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp) | :: | mat(dim,dim) | ||||
complex(kind=dp) | :: | rot(dim,dim) | ||||
integer | :: | dim |
Computes the diagonal elements of the matrix mat1.mat2
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp) | :: | mat1(dim,dim) | ||||
complex(kind=dp) | :: | mat2(dim,dim) | ||||
integer | :: | dim |
Rotates the dim x dim matrix 'mat' according to (rot)^dagger.mat.rot, where 'rot' is a unitary matrix. Computes only the diagonal elements of rotated matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp) | :: | mat(dim,dim) | ||||
complex(kind=dp) | :: | rot(dim,dim) | ||||
integer | :: | dim |
Computes diagonal elements of [mat1,mat2]=mat1.mat2-mat2.mat1
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp) | :: | mat1(dim,dim) | ||||
complex(kind=dp) | :: | mat2(dim,dim) | ||||
integer | :: | dim |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in), | dimension(:, :) | :: | a | ||
complex(kind=dp), | intent(in), | dimension(:, :) | :: | b |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in), | dimension(:, :) | :: | a | ||
complex(kind=dp), | intent(in), | dimension(:, :) | :: | b |
Real part of the trace
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | dimension(:, :) | :: | mat |
Imaginary part of the trace
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | dimension(:, :) | :: | mat |
this function computes the approximate theta function for the given order n, at the point x.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp) | :: | x | ||||
integer | :: | n |
the derivative of utility_wgauss: an approximation to the delta function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp) | :: | x | ||||
integer | :: | n |
the derivative of utility_wgauss: an approximation to the delta function
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | x(:) | |||
integer | :: | n |
Error function - computed from the rational approximations of W. J. Cody, Math. Comp. 22 (1969), pages 631-637.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | x |
erfc(x) = 1-erf(x) - See comments in erf
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | x |
gauss_freq(x) = (1+erf(x/sqrt(2)))/2 = erfc(-x/sqrt(2))/2 - See comments in erf
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | x |
Return matrix product of complex n x n matrices a and b:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(out) | :: | c(n,n) | |||
complex(kind=dp), | intent(in) | :: | a(n,n) | |||
character(len=1), | intent(in) | :: | transa | |||
complex(kind=dp), | intent(in) | :: | b(n,n) | |||
character(len=1), | intent(in) | :: | transb | |||
integer, | intent(in) | :: | n |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in) | :: | a(:,:) | |||
complex(kind=dp), | intent(in) | :: | b(:,:) | |||
complex(kind=dp), | intent(out) | :: | c(:,:) | |||
character(len=1), | intent(in), | optional | :: | transa_opt | ||
character(len=1), | intent(in), | optional | :: | transb_opt |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in), | dimension(:, :) | :: | a | ||
character(len=1), | intent(in) | :: | transa | |||
complex(kind=dp), | intent(in), | dimension(:, :) | :: | b | ||
character(len=1), | intent(in) | :: | transb | |||
complex(kind=dp), | intent(in), | dimension(:, :) | :: | c | ||
character(len=1), | intent(in) | :: | transc | |||
complex(kind=dp), | intent(out), | optional | dimension(:, :) | :: | prod1 | |
real(kind=dp), | intent(in), | optional | dimension(:) | :: | eigval | |
complex(kind=dp), | intent(out), | optional | dimension(:, :) | :: | prod2 |
Return in b the adjoint of the 3x3 matrix a, and its determinant. The inverse is defined as the adjoind divided by the determinant, so that inverse(a) = b/det
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | a(3,3) | |||
real(kind=dp), | intent(out) | :: | b(3,3) | |||
real(kind=dp), | intent(out) | :: | det |
Return in b the adjoint of the 2x2 matrix a, together with the determinant of a. The inverse is defined as the adjoind divided by the determinant, so that inverse(a) = b/det
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | a(2,2) | |||
real(kind=dp), | intent(out) | :: | b(2,2) | |||
real(kind=dp), | intent(out) | :: | det |
Calculates the reciprical lattice vectors and the cell volume
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | real_lat(3,3) | |||
real(kind=dp), | intent(out) | :: | recip_lat(3,3) | |||
real(kind=dp), | intent(out) | :: | volume |
Compares two vectors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | a(3) | |||
real(kind=dp), | intent(in) | :: | b(3) | |||
integer, | intent(out) | :: | ifpos | |||
integer, | intent(out) | :: | ifneg |
Calculate the real and reciprical space metrics
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | real_lat(3,3) | |||
real(kind=dp), | intent(in) | :: | recip_lat(3,3) | |||
real(kind=dp), | intent(out) | :: | real_metric(3,3) | |||
real(kind=dp), | intent(out) | :: | recip_metric(3,3) |
Convert from fractional to Cartesian coordinates
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | frac(3) | |||
real(kind=dp), | intent(out) | :: | cart(3) | |||
real(kind=dp), | intent(in) | :: | real_lat(3,3) |
Convert from Cartesian to fractional coordinates
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | cart(3) | |||
real(kind=dp), | intent(out) | :: | frac(3) | |||
real(kind=dp), | intent(in) | :: | recip_lat(3,3) |
Takes a string in the form 0.0,1.0,0.5 and returns an array of the real num
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=maxlen), | intent(in) | :: | string_tmp | |||
real(kind=dp), | intent(out) | :: | outvec(3) |
Translate a vector to the home unit cell
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout) | :: | vec(3) | |||
real(kind=dp), | intent(in) | :: | real_lat(3,3) | |||
real(kind=dp), | intent(in) | :: | recip_lat(3,3) |
Diagonalize the dim x dim hermitian matrix 'mat' and return the eigenvalues 'eig' and the unitary rotation 'rot'
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(in) | :: | mat(dim,dim) | |||
integer, | intent(in) | :: | dim | |||
real(kind=dp), | intent(out) | :: | eig(dim) | |||
complex(kind=dp), | intent(out) | :: | rot(dim,dim) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(inout) | :: | mat(N,N) | |||
complex(kind=dp), | intent(in) | :: | rot(N,N) | |||
integer, | intent(in) | :: | N | |||
logical, | intent(in), | optional | :: | reverse |