A Modular Arbitrary-Order Ocean-Atmosphere Model -- Stochastic implementation
Modules | Functions/Subroutines
util.f90 File Reference

Go to the source code of this file.

Modules

module  util
 Utility module.
 

Functions/Subroutines

character(len=20) function, public util::str (k)
 Convert an integer to string. More...
 
character(len=40) function, public util::rstr (x, fm)
 Convert a real to string with a given format. More...
 
integer function, dimension(size(s)), public util::isin (c, s)
 Determine if a character is in a string and where. More...
 
subroutine, public util::init_random_seed ()
 Random generator initialization routine. More...
 
integer function lcg (s)
 
subroutine, public util::piksrt (k, arr, par)
 Simple card player sorting function. More...
 
subroutine, public util::init_one (A)
 Initialize a square matrix A as a unit matrix. More...
 
real(kind=8) function, public util::mat_trace (A)
 
real(kind=8) function, public util::mat_contract (A, B)
 
subroutine, public util::choldc (a, p)
 
subroutine, public util::printmat (A)
 
subroutine, public util::cprintmat (A)
 
real(kind=8) function, dimension(size(a, 1), size(a, 2)), public util::invmat (A)
 
subroutine, public util::triu (A, T)
 
subroutine, public util::diag (A, d)
 
subroutine, public util::cdiag (A, d)
 
integer function, public util::floordiv (i, j)
 
subroutine, public util::reduce (A, Ared, n, ind, rind)
 
subroutine, public util::ireduce (A, Ared, n, ind, rind)
 
subroutine, public util::vector_outer (u, v, A)
 

Function/Subroutine Documentation

integer function init_random_seed::lcg ( integer(int64)  s)

Definition at line 104 of file util.f90.

104  integer :: lcg
105  integer(int64) :: s
106  IF (s == 0) THEN
107  s = 104729
108  ELSE
109  s = mod(s, 4294967296_int64)
110  END IF
111  s = mod(s * 279470273_int64, 4294967291_int64)
112  lcg = int(mod(s, int(huge(0), int64)), kind(0))
113  END FUNCTION lcg
integer function lcg(s)
Definition: util.f90:104