########################################## **The core modules and programs** ########################################## **Module core_bracket** ====================================== **Module : core_func** **Purpose : monovariate functions** .. class:: func_t A function object for evaluating real and complex values, real and complex roots, and minimum and maximum values abstract type with contains that only has procedures type, abstract :param eval_r: evaluate the real function -- procedure :param eval_c: evaulate the complex function -- procedure(eval_c_i), deferred :param eval => eval_r, eval_c: calls either eval_r or eval_c -- generic :param root_r: evaluate the real root -- procedure :param root_r: evaluate the complex root -- procedure :param root => root_r, root_c: calls either root_r or root_c -- :param minimum => minimum_r: evaluate the real minimum -- procedure :param maximum => maximum_r: evaluate the real maximum -- procedure .. function:: eval_c_i (this, z) result (f_z) A function within an abstract interface for evaluating a complex function specified as deferred in the func_t type definition, so eval_c_i will be assigned by inherited objects function :param this: func_t called as class, so anything of type func_t or that inherits from .. function:: -- class(cunc_t), intent(inout) :param z: complex number to evaulate -- complex(WP), intent(in) :rtype f_z: complex number that is the result of the evaulation -- complex(WP) .. function:: eval_r (this, x) result (f_x) Evaluate the real function based on the complex function this%eval_c function :param this: func_t called as class, so anything of type cunf_t or that inherits from .. function:: -- class(func_t), intent(inout) :param x: real value for determining f_x -- real(WP), intent(in) :rtype f_x: real value from evaluating eval_c at x -- real(WP) .. function:: root_r (this, x_a, x_b, x_tol, f_x_a, f_x_b, n_iter, relative_tol) result (x) find the real root Use Brent's method [based on the ALGOL 60 routine 'zero' published in Brent (1973, "Algorithms for Minimization without Derivatives", Prentice Hall, Englewood Cliffs] to find a root of the real function this%eval_r(x) function :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of root -- real(WP), intent(in) :param x_b: upper bound of root -- real(WP), intent(in) :param x_tol: tolerance -- real(WP), intent(in) :param f_x_a: value of function at x_a -- real(WP), optional, intent(in) :param f_x_b: value of function at x_b -- real(WP), optional, intent(in) :param n_iter: number of iterations for root finding -- integer, optional, intent(inout) :param relative_tol: whether to use relative tolerance for root finding -- logical, optional, intent(in) :rtype x: root value -- real(WP) .. function:: root_c (this, z_a, z_b, z_tol, f_z_a, f_z_b, n_iter, relative_tol) result (z) find the complex root Use the secant method to find a complex root of the function this%eval_c(z) function :param this: func_t called as a class -- class(func_t), intent(inout) :param z_a: lower bound of root -- complex(WP), intent(in) :param z_b: upper bound of root -- complex(WP), intent(in) :param z_tol: tolerance -- real(WP), intent(in) :param f_z_a: function evaluated at z_a -- complex(WP), optional, intent(in) :param f_z_b: function evaluated at z_b -- complex(WP), optional, intent(in) :param n_iter: number of iterations for root finding -- integer, optional, intent(inout) :param relative_tol: whether to use relative tolerance for root finding -- logical, optional, intent(in) :rtype z: root value -- complex(WP) .. function:: minimum_r (this, x_a, x_b, x_c, x_tol, relative_tol) result (x) Find a local minimum of the real function this%eval_r(x) function :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of interval -- real(WP), intent(in) :param x_b: intermediate value of interval -- real(WP), intent(in) :param x_c: upper bound of interval -- real(WP), intent(in) :param x_tol: tolerance of minimum finding -- real(WP), intent(in) :param relative_tol: whether to use relative tolerance for minimum finding -- logical, intent(in), optional :rtype x: minimum value -- real(WP) .. function:: maximum_r (this, x_a, x_b, x_c, x_tol, relative_tol) result (x) Find a local maximum of the real function this%eval_r(x) function :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of interval -- real(WP), intent(in) :param x_b: intermediate value of interval -- real(WP), intent(in) :param x_c: upper bound of interval -- real(WP), intent(in) :param x_tol: tolerance of maximum finding -- real(WP), intent(in) :param relative_tol: whether to use relative tolerance for maximum finding -- logical, intent(in), optional :rtype x: maximum value -- real(WP) .. function:: extremum_r (rf, x_a, x_b, x_c, x_tol, minimum, relative_tol) result (x) Find a real extremum Use a golden section search to find a local extremum of the real function this%eval_r(x) function :param rf: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of interval -- real(WP), intent(in) :param x_b: intermediate value of interval -- real(WP), intent(in) :param x_c: upper bound of interval -- real(WP), intent(in) :param x_tol: tolerance of extremum finding -- real(WP), intent(in) :param minimum: find the minimum (true) or maximum (false) -- logical, intent(in) :param relative_tol: whether to use relative tolerance for extremum finding -- logical, intent(in), optional :rtype x: extremum value -- real(WP) .. function:: shft2 (a, b, c) Shift b to a and c to b within extremum_r via 'contains' subroutine :rtype a: a, which was input b -- real(WP), intent(out) :param b: b, which gets moved to a and becomes input c -- real(WP), intent(inout) :param c: c, which gets moved to b -- real(WP), intent(in) .. function:: shft3 (a,b,c,d) Shift b to a, c to b and d to c within extremum_r via 'contains' subroutine :rtype a: a, which was input b -- real(WP), intent(out) :param b: b, which gets moved to a and becomes input c -- real(WP), intent(inout) :param c: c, which gets moved to b and becomes input d -- real(WP), intent(inout) :param d: d, which gets moved to c -- real(WP), intent(inout) **Module core_c** ====================================== **Module : core_c** **Purpose : C interoperability** .. function:: c_strlen (str) result (len) bind (C, name="strlen") Determines the length of a string uses 'bind´ so it is interoperable with C function within an interface :param str: input string -- type(C_PTR), value :rtype len: string length -- integer(C_SIZE_T) .. function:: c_f_string (c_str) result (f_str) Convert a C string (pointer to char) to a Fortran string function :param c_str: input string in C (pointer to char) -- type(C_PTR), intent(in) :rtype f_str: returned Fortran string -- character(:), allocatable **Module core_constants** ====================================== **Module : core_constants** **Purpose : physical constants** **Module core_cspline** ====================================== **Module : core_cspline** **Purpose : cubic spline interpolation** .. class:: cspline_t .. function:: cspline_t_ (knot_x, knot_y, knot_dy) result (cs) .. function:: cspline_t_eval_derivs_ (knot_x, knot_y, deriv_type, knot_dy_a, knot_dy_b) result (cs) .. function:: cspline_t_y_func_ (knot_x_a, knot_x_b, y_func, y_tol, deriv_type, relative_tol, knot_dy_a, knot_dy_b) result (cs) .. function:: y_func (x) result (y) .. function:: x_n_ (this) result (x) .. function:: y_1_ (this, x) result (y) .. function:: y_v_ (this, x) result (y) .. function:: phi_ (t) .. function:: psi_ (t) .. function:: y_n_ (this) result (y) .. function:: dy_1_ (this, x) result (dy) .. function:: dy_v_ (this, x) result (dy) .. function:: dphi_ (t) .. function:: dpsi_ (t) .. function:: dy_n_ (this) result (dy) .. function:: iy_1_1_ (this, x_a, x_b) result (iy) .. function:: iy_1_v_ (this, x_a, x_b) result (iy) .. function:: iy_v_1_ (this, x_a, x_b) result (iy) .. function:: iy_v_v_ (this, x_a, x_b) result (iy) .. function:: iphi_ (t) .. function:: ipsi_ (t) .. function:: natural_dy_ (x, y, dy_a, dy_b) result (dy) .. function:: findiff_dy_ (x, y, dy_a, dy_b) result (dy) .. function:: mono_dy_ (x, y, dy_a, dy_b) result (dy) .. function:: read_ (hg, cs) .. function:: write_ (hg, cs) .. function:: bcast_0_ (cs, root_rank) .. function:: attribs_ (this, x_min, x_max, n) **Module core_env** ====================================== **Module : core_env** **Purpose : environment access** .. function:: get_env (name, value, trim_name) subroutine :param name: the envirionment variable that is sought after -- character(*), intent(in) :param value: the value of the environment variable -- character(:), allocatable, intent(out) :param trim_name: signifies whether the blanks in 'name' are important -- logical, optional, intent(in) **Module core_func** ====================================== **Module : core_func** **Purpose : monovariate functions** .. class:: func_t A function object for evaluating real and complex values, real and complex roots, and minimum and maximum values abstract type with contains that only has procedures type, abstract :param eval_r_: evaluate the real function -- procedure :param eval_c_: evaulate the complex function -- procedure(eval_c_i), deferred :param eval => eval_r_, eval_c_: calls either eval_r or eval_c -- generic :param expand_bracket => expand_bracket_: expand the bracket until it contains a root of a real function -- procedure, public :param narrow_bracket => narrow_bracket_: narrow the bracket on a root of a real function -- procedure, public :param root_r_: evaluate the real root -- procedure :param root_r_: evaluate the complex root -- procedure :param root => root_r_, root_c_: calls either root_r or root_c -- generic :param minimum => minimum_r_: evaluate the real minimum -- procedure :param maximum => maximum_r_: evaluate the real maximum -- procedure .. function:: eval_c_ (this, z) result (f_z) A function within an abstract interface for evaluating a complex function specified as deferred in the func_t type definition, so eval_c_ will be assigned by inherited objects function :param this: func_t called as class, so anything of type func_t or that inherits from :param z: complex number to evaulate -- complex(WP), intent(in) :rtype f_z: complex number that is the result of the evaulation -- complex(WP) .. function:: eval_r_ (this, x) result (f_x) Evaluate the real function based on the complex function this%eval(z) function :param this: func_t called as class, so anything of type cunf_t or that inherits from type func_t can call this function -- class(func_t), intent(inout) :param x: real value for determining f_x -- real(WP), intent(in) :rtype f_x: real value from evaluating eval at x -- real(WP) .. function:: root_r_ (this, x_a, x_b, x_tol, f_x_a, f_x_b, n_iter, relative_tol) result (x) Find a root of the real function this%eval(x) uses narrow_bracket function :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of root -- real(WP), intent(in) :param x_b: upper bound of root -- real(WP), intent(in) :param x_tol: tolerance -- real(WP), intent(in) :param f_x_a: value of function at x_a -- real(WP), optional, intent(in) :param f_x_b: value of function at x_b -- real(WP), optional, intent(in) :param n_iter: number of iterations for root finding -- integer, optional, intent(inout) :param relative_tol: whether to use relative tolerance for root finding -- logical, optional, intent(in) :rtype x: root value -- real(WP) .. function:: root_c_ (this, z_a, z_b, z_tol, f_z_a, f_z_b, n_iter, relative_tol) result (z) find a complex root Use the secant method to find a complex root of the function this%eval(z) function :param this: func_t called as a class -- class(func_t), intent(inout) :param z_a: lower bound of root -- complex(WP), intent(in) :param z_b: upper bound of root -- complex(WP), intent(in) :param z_tol: tolerance -- real(WP), intent(in) :param f_z_a: function evaluated at z_a -- complex(WP), optional, intent(in) :param f_z_b: function evaluated at z_b -- complex(WP), optional, intent(in) :param n_iter: number of iterations for root finding, default value is 50 -- integer, optional, intent(inout) :param relative_tol: whether to use relative tolerance for root finding, default value is false -- logical, optional, intent(in) :rtype z: root value -- complex(WP) .. function:: minimum_r_ (this, x_a, x_b, x_c, x_tol, relative_tol) result (x) Find a local minimum of the real function this%eval(x) calls extremum_ function :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of interval -- real(WP), intent(in) :param x_b: intermediate value of interval -- real(WP), intent(in) :param x_c: upper bound of interval -- real(WP), intent(in) :param x_tol: tolerance of minimum finding -- real(WP), intent(in) :param relative_tol: whether to use relative tolerance for minimum finding -- logical, intent(in), optional :rtype x: minimum value -- real(WP) .. function:: maximum_r_ (this, x_a, x_b, x_c, x_tol, relative_tol) result (x) Find a local maximum of the real function this%eval(x) calls extremum_ function :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of interval -- real(WP), intent(in) :param x_b: intermediate value of interval -- real(WP), intent(in) :param x_c: upper bound of interval -- real(WP), intent(in) :param x_tol: tolerance of maximum finding -- real(WP), intent(in) :param relative_tol: whether to use relative tolerance for maximum finding -- logical, intent(in), optional :rtype x: maximum value -- real(WP) .. function:: extremum_ (rf, x_a, x_b, x_c, x_tol, minimum, relative_tol) result (x) find a real extremum Use a golden section search to find a local extremum of the real function this%eval(x) function :param rf: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of interval -- real(WP), intent(in) :param x_b: intermediate value of interval -- real(WP), intent(in) :param x_c: upper bound of interval -- real(WP), intent(in) :param x_tol: tolerance of extremum finding -- real(WP), intent(in) :param minimum: find the minimum (true) or maximum (false) -- logical, intent(in) :param relative_tol: whether to use relative tolerance for extremum finding, default value is false -- logical, intent(in), optional :rtype x: extremum value -- real(WP) .. function:: expand_bracket_ (this, x_a, x_b, f_x_a, f_x_b, clamp_a, clamp_b) Expand the bracket [x_a,x_b] until it contains a root of the real function this%eval(x) subroutine :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of root -- real(WP), intent(in) :param x_b: upper bound of root -- real(WP), intent(in) :param f_x_a: value of function at x_a -- real(WP), optional, intent(in) :param f_x_b: value of function at x_b -- real(WP), optional, intent(in) :param clamp_a: clamp the lower bound or not -- logical, intent(in), optional :param clamp_b: clamp the upper bound or not -- logical, intent(in), optional .. function:: narrow_bracket_ (this, x_a, x_b, x_tol, f_x_a, f_x_b, n_iter, relative_tol) Narrow the bracket range on a root Use Brent's method [based on the ALGOL 60 routine 'zero' published in Brent (1973, "Algorithms for Minimization without Derivatives", Prentice Hall, Englewood Cliffs] to narrow the bracket [x_a,x_b] bracket on the real function this%eval(x) subroutine :param this: func_t called as a class -- class(func_t), intent(inout) :param x_a: lower bound of root -- real(WP), intent(in) :param x_b: upper bound of root -- real(WP), intent(in) :param x_tol: tolerance -- real(WP), intent(in) :param f_x_a: value of function at x_a -- real(WP), optional, intent(inout) :param f_x_b: value of function at x_b -- real(WP), optional, intent(inout) :param n_iter: number of iterations for root findingi, default value is 75 -- integer, optional, intent(inout) :param relative_tol: whether to use relative tolerance for root finding, default value is false -- logical, optional, intent(in) .. function:: shft2_ (a, b, c) Shift b to a and c to b within extremum_ via 'contains' subroutine :rtype a: a, which was input b -- real(WP), intent(out) :param b: b, which gets moved to a and becomes input c -- real(WP), intent(inout) :param c: c, which gets moved to b -- real(WP), intent(in) .. function:: shft3_ (a, b, c, d) Shift b to a, c to b and d to c within extremum_ via 'contains' subroutine :rtype a: a, which was input b -- real(WP), intent(out) :param b: b, which gets moved to a and becomes input c -- real(WP), intent(inout) :param c: c, which gets moved to b and becomes input d -- real(WP), intent(inout) :param d: d, which gets moved to c -- real(WP), intent(inout) **Module core_hgroup** ====================================== **Module : core_hgroup** **Purpose : HDF5 input/output** .. class:: hgroup_t .. function:: init_file_ (file_name, access_type) result (hg) .. function:: init_group_ (hg_parent, group_name) result (hg) .. function:: exists_ (this, group_name) .. function:: attr_exists_ (hg, attr_name) result (attr_exists) .. function:: dset_exists_ (hg, dset_name) result (dset_exists) .. function:: integer_mem_type_ (kind) result (mem_type_id) .. function:: real_mem_type_ (kind) result (mem_type_id) .. function:: complex_mem_type_ (kind) result (mem_type_id) .. function:: integer_file_type_ (kind) result (file_type_id) .. function:: real_file_type_ (kind) result (file_type_id) .. function:: complex_file_type_ (kind) result (file_type_id) .. function:: elem_group_name (prefix, indices) result (group_name) .. function:: open_library_ () .. function:: create_complex_type_ (comp_type_id, type_id) .. function:: final_ (this) .. function:: close_library_ () .. function:: read_${ITEM_TYPE}_${INFIX}_${DATA_RANK}_ (hg, item_name, data) .. function:: read_${ITEM_TYPE}_a_${DATA_RANK}_ (hg, item_name, data) .. function:: read_${ITEM_TYPE}_l_${DATA_RANK}_ (hg, item_name, data) .. function:: read_${ITEM_TYPE}_alloc_${INFIX}_${DATA_RANK}_ (hg, item_name, data) .. function:: write_${ITEM_TYPE}_${INFIX}_${DATA_RANK}_ (hg, item_name, data, overwrite, comp_level) .. function:: write_${ITEM_TYPE}_a_${DATA_RANK}_ (hg, item_name, data) .. function:: write_${ITEM_TYPE}_l_${DATA_RANK}_ (hg, item_name, data) .. function:: get_attr_shape (hg, attr_name, shape) .. function:: get_dset_shape (hg, dset_name, shape) **Module core_integ** ====================================== **Module : core_integ** **Purpose : numerical integration olio** .. function:: simps2d_wgt(wgt, i, j, ni, nj) Simpson's rule 2D weighting subroutine :rtype wgt: 2D weighting result; multiplication of weighting 1 and weighting 2 -- real(WP), intent(out) :param i: index for weight 1 -- integer, intent(in) :param j: index for weight 2 -- integer, intent(in) :param ni: number of points in Simpson integration 1 -- integer, intent(in) :param nj: number of points in Simpson integration 2 -- integer, intent(in) .. function:: simps1d_wgt(wgt, i, n) Simpson's rule weightings (1, 2, or 4) for 1D integration subroutine :rtype wgt: weight (1, 2, or 4) that is returned -- real(WP), intent(out) :param i: point in integration for determining the weight -- integer, intent(in) :param n: number of points in integration -- integer, intent(in) .. function:: gl_weights(a, b, x, w) calculate abyssica (x) and weights (w) for Gauss-Legendre quadrature over integral from a to b from Numerical Receipes, Press et al subroutine :param a: lower bound of integral -- real(WP), intent(in) :param b: upper bound of integral -- real(WP), intent(in) :param x(:): abyssica -- real(WP), intent(inout) :param w(:): weights -- real(WP), intent(inout) **Module core_interp** ====================================== **Module : core_interp** **Purpose : interpolant abstract type** .. class:: interp_t .. function:: f_1_ (this, x) result (f) .. function:: f_v_ (this, x) result (f) .. function:: f_n_ (this) result (f) .. function:: f_1_1_ (this, x_a, x_b) result (f) .. function:: f_1_v_ (this, x_a, x_b) result (f) .. function:: f_v_1_ (this, x_a, x_b) result (f) .. function:: f_v_v_ (this, x_a, x_b) result (f) .. function:: attribs_ (this, x_min, x_max, n) **Module core_kinds** ====================================== **Module : core_kinds** **Purpose : kind type** **Module core_legendre** ====================================== **Module : core_legendre** **Purpose : Legendre & related functions** .. function:: factorial (a) result (af) Calculate the factorial a! function :param a: integer whose factorial will be computed -- integer, intent(in) :rtype af: factorial of a -- real(WP) .. function:: P_lm (l, m, norm) Blank subroutine -- only has this single definition line .. function:: Y_lm (theta, phi, Y_lm, grad_Y_lm_theta, grad_Y_lm_phi) Calculate the spherical harmonic Y_lm(theta, phi), and possibly its angular derivatives Only has variable definitions; has no other lines of code subroutine :param theta: polar angle -- real(WP), intent(in) :param phi: azimuthal angle -- real(WP), intent(in) :param T_lm: legendre polynomial -- complex(WP), intent(out) :param grad_Y_lm_theta: gradient with respect to polar angle -- complex(WP), intent(out), optional :param grad_Y_lm_phi: gradient with respect to azimuthal angle -- complex(WP), intent(out), optional .. function:: Y_lm_tableaux (theta, phi, Y_lm, grad_Y_lm_theta, grad_Y_lm_phi) Calculate a tableaux of spherical harmonics Y_lm(theta, phi), and possibly their derivatives, for m >= 0 subroutine :param theta: polar angle -- real(WP), intent(in) :param phi: azimuthal angle -- real(WP), intent(in) :param T_lm: legendre polynomial -- complex(WP), intent(out) :param grad_Y_lm_theta: gradient with respect to polar angle -- complex(WP), intent(out), optional :param grad_Y_lm_phi: gradient with respect to azimuthal angle -- complex(WP), intent(out), optional **Module core_linalg** ====================================== **Module : core_linalg** **Purpose : interfaces to LAPACK and BLAS routines** .. function:: xlamch_${INFIX}_ (x, cmach) .. function:: SGTSV (N, NRHS, DL, D, DU, B, LDB, INFO) .. function:: DGTSV (N, NRHS, DL, D, DU, B, LDB, INFO) .. function:: CGTSV (N, NRHS, DL, D, DU, B, LDB, INFO) .. function:: ZGTSV (N, NRHS, DL, D, DU, B, LDB, INFO) .. function:: SGETRF (M, N, A, LDA, IPIV, INFO) .. function:: DGETRF (M, N, A, LDA, IPIV, INFO) .. function:: CGETRF (M, N, A, LDA, IPIV, INFO) .. function:: ZGETRF (M, N, A, LDA, IPIV, INFO) .. function:: SGETRS (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: DGETRS (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: CGETRS (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: ZGETRS (TRANS, N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: SGESV (N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: DGESV (N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: CGESV (N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: ZGESV (N, NRHS, A, LDA, IPIV, B, LDB, INFO) .. function:: SGESVX (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, & .. function:: DGESVX (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, & .. function:: CGESVX (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, & .. function:: ZGESVX (FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, & .. function:: SGEEV (JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR, WORK, LWORK, INFO) .. function:: DGEEV (JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR, WORK, LWORK, INFO) .. function:: CGEEV (JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO ) .. function:: ZGEEV (JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO) .. function:: SGEEVX (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR, ILO, IHI, SCALE, & .. function:: DGEEVX (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR, ILO, IHI, SCALE, & .. function:: CGEEVX (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, & .. function:: ZGEEVX (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, & .. function:: SGESVD (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO) .. function:: DGESVD (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, INFO) .. function:: CGESVD (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, RWORK, INFO) .. function:: ZGESVD (JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, RWORK, INFO) .. function:: SSTEVR (JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL, & .. function:: DSTEVR (JOBZ, RANGE, N, D, E, VL, VU, IL, IU, ABSTOL, & .. function:: DSTEMR (JOBZ, RANGE, N, D, E, VL, VU, IL, IU, & **Module core_list** ====================================== **Module : core_list** **Purpose : doubly-linked list** .. class:: list_t A function object for lists abstract type with variables and a contains that only has procedures type, abstract :param li_next: pointer to the next entry in the list -- type(list_t), pointer :param li_prev: pointer to the previous entry in the list -- type(list_t), pointer :param next => next_: Get the n'th next item after this -- procedure, public :param prev => prev_: Get the n'th previous item before this -- procedure, public :param head => head_: Get the list head -- procedure, public :param tail => tail_: Get the list tail -- procedure, public :param insert_before => insert_before_: Insert a list item before this -- procedure, public :param insert_after => insert_after_: Insert a list item after this -- procedure, public :param delete => delete_: Delete the item -- procedure, public :param delete_all => delete_all_: Delete the whole list -- procedure, public .. function:: prev (this, n) Get the n'th previous item before this function :param this: func_t called as class-- class(list_t), intent(in) :param n: number of previous items in list to move to -- integer, intent(in), optional :rtype prev: pointer to n'th previous item in list -- class(list_t), pointer .. function:: next (this, n) Get the n'th next item after this function :param this: func_t called as class-- class(list_t), intent(in) :param n: number of subsequent items in list to move to -- integer, intent(in), optional :rtype prev: pointer to n'th next item in list -- class(list_t), pointer .. function:: head (this) Get the list head function :param this: func_t called as class -- class(list_t), intent(in), target :rtype head: pointer to the head of the list -- class(list_t), pointer .. function:: tail (this) Get the list tail function :param this: func_t called as class -- class(list_t), intent(in), target :rtype tail: pointer to the tail of the list -- class(list_t), pointer .. function:: insert_before (this) result (insert) Insert a list item before this function :param this: func_t called as class -- class(list_t), intent(inout) :trype insert: pointer to where to insert item before this -- class(list_t), pointer .. function:: insert_after (this) result (insert) Insert a list item after this insert_after :param this: func_t called as class -- class(list_t), intent(inout) :rtype insert: pointer to where to insert item after this -- class(list_t), pointer .. function:: delete (this) Delete the item subroutine :param this: func_t called as class -- class(list_t), pointer .. function:: delete_all (this) Delete the whole list subroutine :param this: func_t called as class -- class(list_t), pointer **Module core_lspline** ====================================== **Module : core_lspline** **Purpose : linear spline interpolation** .. class:: lspline_t .. function:: lspline_t_ (knot_x, knot_y, knot_dy) result (ls) .. function:: lspline_t_eval_derivs_ (knot_x, knot_y, deriv_type, knot_dy_a, knot_dy_b) result (ls) .. function:: lspline_t_y_func_ (knot_x_a, knot_x_b, y_func, y_tol, deriv_type, relative_tol, knot_dy_a, knot_dy_b) result (ls) .. function:: y_func (x) result (y) .. function:: x_n_ (this) result (x) .. function:: y_1_ (this, x) result (y) .. function:: y_v_ (this, x) result (y) .. function:: phi_ (t) .. function:: y_n_ (this) result (y) .. function:: dy_1_ (this, x) result (dy) .. function:: dy_v_ (this, x) result (dy) .. function:: dphi_ (t) .. function:: dy_n_ (this) result (dy) .. function:: iy_1_1_ (this, x_a, x_b) result (iy) .. function:: iy_1_v_ (this, x_a, x_b) result (iy) .. function:: iy_v_1_ (this, x_a, x_b) result (iy) .. function:: iy_v_v_ (this, x_a, x_b) result (iy) .. function:: iphi_ (t) .. function:: findiff_dy_ (x, y, dy_a, dy_b) result (dy) .. function:: read_ (hg, ls) .. function:: write_ (hg, ls) .. function:: bcast_0_ (ls, root_rank) .. function:: attribs_ (this, x_min, x_max, n) **Module core_memory** ====================================== **Module : core_memory** **Purpose : memory management** **Module core_multi_func** ====================================== **Module : core_multi_func (version 1.0)** **Purpose : systems of functions, evaluation and root** .. class:: multi_func_t .. function:: root_r_ (this, x_init, term_code, x_typical, F_typical, n_iter, broyden, global) result (x_out) .. function:: gradient_(this, x, f_x, x_scale_) result (del_f) .. function:: eval_norm_ (this, a, a_scale_) result (f_n) .. function:: eval_r_ (this, x, F_x, status) .. function:: jac_r_ (this, x, F_x, x_scale_, J_) .. function:: line_search_(this, x_a, x_n, f_norm_a, f_norm_n, F_n, g, p, status, max_taken, F_scale_, x_scale_) .. function:: hook_search_ (this, x_a, x_n, f_norm_a, f_norm_n, F_n, g, s_n, L, H, F_scale_, x_scale_, iter_count, delta, delta_prev, mu, phi, phi_prime, ret_status, max_taken) .. function:: hook_step_ (this, g, L, H, s_n, x_scale_, newtlen, delta, delta_prev, mu, phi, phi_prime, phi_prime_init, firsthook, s, newt_taken) .. function:: trust_region_update_ (this, x_a, f_norm_a, g, L, s, F_scale_, x_scale_, newt_taken, H, delta, ret_status, x_n_prev, F_n_prev, f_norm_n_prev, x_n, f_norm_n, F_n, max_taken) .. function:: nonlinear_solve_(this, restart, F_a, g, M, M2, Jac, H, s_n, F_scale_, x_scale_) .. function:: nonlinear_solve_unfac_(this, F_a, g, Jac, M, H, s_n, F_scale_, x_scale_) .. function:: QR_solve_(this, M, M1, M2, b) .. function:: QR_decomp_(this, M, M1, M2, singular) .. function:: QR_update_(this, u, v, Z, M) .. function:: Q_form_(this, M, M1, Z) .. function:: condest_(this,M,M2,est) .. function:: rsolve_(this, M, M2, b) .. function:: cholsolve_(this, g, L, s) .. function:: choldecomp_pd_(this, H, L) .. function:: lsolve_(this, b, L, y) .. function:: ltsolve_(this, y, L,x) .. function:: broyden_fac_(this, x_a, x_n, F_a, F_n, Z, M, M2, F_scale_, x_scale_) .. function:: jac_rotate_(this, i, a, b, Z, M) .. function:: stop_qq_(this, x_a, x_n, F_n, ret_status, itncount, itnlimit, consec_max, term_code, g_a, f_norm_n, F_scale_, x_scale_) **Module core_order** ====================================== **Module : core_order** **Purpose : sorting/searching** .. function:: index_1d_${INFIX}_ (i, s) result (i1) .. function:: index_nd_${INFIX}_ (i1, s) result (i) .. function:: locate_${INFIX}_ (x, x_loc, i_loc) .. function:: locate_uniform_${INFIX}_ (x_0, dx, x_loc, i_loc) **Module core_parallel** ====================================== **Module : core_parallel** **Purpose : parallel support** .. function:: omp_size () .. function:: omp_rank () .. function:: init_parallel () .. function:: final_parallel () .. function:: barrier () .. function:: bcast_${INFIX}_${BUFFER_RANK}_ (buffer, root_rank) .. function:: bcast_a_${BUFFER_RANK}_ (buffer, root) .. function:: bcast_seq_${INFIX}_${BUFFER_RANK}_ (buffer, i1_a, i1_b, root_rank) .. function:: bcast_alloc_${INFIX}_${BUFFER_RANK}_ (buffer, root_rank) .. function:: recv_${INFIX}_${BUFFER_RANK}_ (buffer, src_rank, tag) .. function:: recv_any_${INFIX}_${BUFFER_RANK}_ (buffer, src_rank, tag) .. function:: allgatherv_${INFIX}_${BUFFER_RANK}_ (buffer, recvcounts, displs) .. function:: allreduce_${INFIX}_${BUFFER_RANK}_ (buffer, op) .. function:: partition_tasks (n, m, k_part) **Module core_random** ====================================== **Module : core_random** **Purpose : random number generation (parallel)** .. function:: random () Calculate a uniformly-distributed random number function .. function:: set_seed (seed) Store the random seed subroutine :param seed: the random seed to be stored -- integer, intent(in) **Module core_spline** ====================================== **Module : core_spline** **Purpose : spline interpolation** .. class:: spline_t .. function:: spline_t_ (x, y, dy_dx) result (sp) .. function:: spline_t_eval_derivs_ (x, y, deriv_type, dy_dx_a, dy_dx_b) result (sp) .. function:: spline_t_y_func_ (x_a, x_b, y_func, y_tol, deriv_type, log_samp, relative_tol, dy_dx_a, dy_dx_b) result (sp) .. function:: y_func (x) result (y) .. function:: interp_1_ (this, x) result (y) .. function:: interp_v_ (this, x) result (y) .. function:: phi_ (t) .. function:: psi_ (t) .. function:: interp_n_ (this) result (y) .. function:: deriv_1_ (this, x) result (dy_dx) .. function:: deriv_v_ (this, x) result (dy_dx) .. function:: dphi_dt_ (t) .. function:: dpsi_dt_ (t) .. function:: deriv_n_ (this) result (dy_dx) .. function:: integ_n_ (this) result (Y) .. function:: natural_dy_dx_ (x, y, dy_dx_a, dy_dx_b) result (dy_dx) .. function:: findiff_dy_dx_ (x, y, dy_dx_a, dy_dx_b) result (dy_dx) .. function:: mono_dy_dx_ (x, y, dy_dx_a, dy_dx_b) result (dy_dx) .. function:: read_ (hg, sp) .. function:: write_ (hg, sp) .. function:: bcast_0_ (sp, root_rank) **Module core_string** ====================================== **Module : core_string** **Purpose : string manipulation** .. function:: extract (string, start, finish) result (substring) .. function:: insert (string, start, substring) result (new_string) .. function:: remove (string, start, finish) result (new_string) .. function:: replace_auto_ (string, start, substring) result (new_string) .. function:: replace_fixed_ (string, start, finish, substring) result (new_string) .. function:: replace_target_ (string, target, substring, every, back) result (new_string) .. function:: get_ (string, maxlen, iostat) .. function:: get_unit_ (unit, string, maxlen, iostat) .. function:: get_set_ (string, set, separator, maxlen, iostat) .. function:: get_unit_set_ (unit, string, set, separator, maxlen, iostat) .. function:: put_ (string, iostat) .. function:: put_unit_ (unit, string, iostat) .. function:: put_line_ (string, iostat) .. function:: put_line_unit_ (unit, string, iostat) .. function:: split (string, word, set, separator, back) **Module core_system** ====================================== **Module : core_system** **Purpose : operating system support** .. function:: n_arg () .. function:: get_arg_${INFIX}_ (number, value, status) .. function:: get_arg_a_ (number, value, status) .. function:: get_env_${INFIX}_ (name, value, status) .. function:: get_env_a_ (name, value, status) **Module core_table** ====================================== **Module : core_table** **Purpose : monovariate tables** .. function:: deriv (x, y, deriv_type, dy_dx_a, dy_dx_b) result (dy_dx) Calculate dy/dx via spline fitting function :param x(:): x array -- real(WP), intent(in) :param y(:): y array -- real(WP), intent(in) :param deriv_type: derivative type -- character(*), intent(in) :param dy_dx_a: derivative at the lower boundary -- real(WP), optional, intent(in) :param dy_dx_b: derivative at the upper boundary -- real(WP), optional, intent(in) :rtype dydx(SIZE(x)): computed derivatve -- real(WP) .. function:: integ (x, y, deriv_type, dy_dx_a, dy_dx_b) result (Y_) Calculate int_0^y y dx via spline fitting function :param x(:): x array -- real(WP), intent(in) :param y(:): y array -- real(WP), intent(in) :param deriv_type: derivative type -- character(*), intent(in) :param dy_dx_a: derivative at the lower boundary -- real(WP), optional, intent(in) :param dy_dx_b: derivative at the upper boundary -- real(WP), optional, intent(in) :rtype Y_(SIZE(x)): computed integral -- real(WP) .. function:: integ_def (x, y, deriv_type, dy_dx_a, dy_dx_b) result (Y_def) Calculate int_{x_min}^{x_max} y dx via spline fitting function :param x(:): x array -- real(WP), intent(in) :param y(:): y array -- real(WP), intent(in) :param deriv_type: derivative type -- character(*), intent(in) :param dy_dx_a: derivative at the lower boundary -- real(WP), optional, intent(in) :param dy_dx_b: derivative at the upper boundary -- real(WP), optional, intent(in) :rtype Y_def: computed integral -- real(WP) **Module core_volume** ====================================== **Module : core_volume** **Purpose : volumetric data** .. class:: volume_t A volume object type :param vr0(3): volume starting position -- real(WP) :param vdr(3): size of an element in each dimension of the volume -- real(WP) :param vn(3): number of elements for each side of the volume -- integer :param node_type: type of nodes specified, either 'CELL' or 'VERT' -- character(NODE_TYPE_LEN) :param nodes_shape: returns the node shape -- procedure :param r_node: returns the node position coordinates -- procedure .. function:: volume_t_ (vr0, vdr, vn, node_type) result (vl) Construct the volume_t function :param vr0(3): volume starting position -- real(WP), intent(in) :param vdr(3): size of an element in each dimension of the volume -- real(WP), intent(in) :param vn(3): number of elements for each side of the volume -- integer, intent(in) :param node_type: type of nodes specified, either 'CELL' or 'VERT' -- character(*), intent(in) :rtype vl: created volume object -- :class:`volume_t` .. function:: nodes_shape (this) result (s) Return the shape to use for node data arrays function :param this: volume object -- :class:`volume_t` :rtype s(3): shape of the volume object -- integer .. function:: r_node (this, vi) Calculate the node coordinates function :param this: volume object -- :class:`volume_t`, intent(in) :param vi(i): indices of the volume element that is sought after -- integer, intent(in) :rtype r_node(3): node coordinates -- real(WP) .. function:: read_ (hg, vl) Read the volume_t subroutine :param hg: hdf5 data set -- :class:`hgroup_t`, intent(inout) :param vl: volume object -- :class:`volume_t`, intent(out) .. function:: write_ (hg, vl) Write the volume_t subroutine :param hg: hdf5 data set -- :class:`hgroup_t`, intent(inout) :: hg :param vl: volume object -- :class:`volume_t`, intent(in) :: vl .. function:: bcast_ (vl, root_rank) Broadcast the volume_t only if MPI subroutine :param vl: volume object to broadcast -- :class:`volume_t`, intent(inout) :param root_rank: rank of root processor -- integer, intent(in)