array_mod Module

module~~array_mod~~UsesGraph module~array_mod array_mod module~kinds_mod kinds_mod module~kinds_mod->module~array_mod
Help

Array reduction and transformation routines

Used By

module~~array_mod~~UsedByGraph module~array_mod array_mod program~testvtkio_prg testVtkIO_prg module~array_mod->program~testvtkio_prg module~objective_mod objective_mod module~array_mod->module~objective_mod program~testeval_prg testEval_prg module~array_mod->program~testeval_prg program~logo_prg logo_prg module~array_mod->program~logo_prg module~spline_mod spline_mod module~array_mod->module~spline_mod program~testarray_prg testArray_prg module~array_mod->program~testarray_prg module~plplotlib_mod plplotlib_mod module~array_mod->module~plplotlib_mod module~optimize_mod optimize_mod module~array_mod->module~optimize_mod program~basic_prg basic_prg module~array_mod->program~basic_prg program~testspline_prg testSpline_prg module~array_mod->program~testspline_prg program~testnetcdf_prg testNetCDF_prg module~array_mod->program~testnetcdf_prg module~sparse_mod sparse_mod module~array_mod->module~sparse_mod program~examples_prg examples_prg module~array_mod->program~examples_prg program~testsparse_prg testSparse_prg module~array_mod->program~testsparse_prg program~animate_prg animate_prg module~array_mod->program~animate_prg program~testoptimize_prg testOptimize_prg module~objective_mod->program~testoptimize_prg module~spline_mod->program~testspline_prg module~plplotlib_mod->module~objective_mod module~plplotlib_mod->program~testeval_prg module~plplotlib_mod->program~logo_prg module~plplotlib_mod->program~basic_prg module~plplotlib_mod->program~testspline_prg module~plplotlib_mod->program~examples_prg module~plplotlib_mod->program~testsparse_prg module~plplotlib_mod->program~animate_prg module~optimize_mod->module~objective_mod module~optimize_mod->program~testoptimize_prg module~sparse_mod->program~testsparse_prg module~basicsolvers_mod basicSolvers_mod module~sparse_mod->module~basicsolvers_mod module~solvers_mod solvers_mod module~sparse_mod->module~solvers_mod module~basicsolvers_mod->program~testsparse_prg module~solvers_mod->program~testsparse_prg
Help


Interfaces

public interface mixval

Return a 2-vector comprising the minimum and maximum values of an array

  • private function mixval_1(x) result(b)

    Return [hi,low] for an array

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:):: x

    Array to find extrema in

    Return Value real(kind=wp), dimension(2)

  • private function mixval_2(x) result(b)

    Return [hi,low] for an array

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: x

    Array to find extrema in

    Return Value real(kind=wp), dimension(2)

  • private function mixval_3(x) result(b)

    Return [hi,low] for an array

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:,:):: x

    Array to find extrema in

    Return Value real(kind=wp), dimension(2)

public interface span

Return a the maximum-minumum values of an array

  • private function span_1(x) result(o)

    x values of data Return (hi-low) for an array

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:):: x

    Array of which to find the range

    Return Value real(kind=wp)

    Range of the array

  • private function span_2(x) result(o)

    Return (hi-low) for an array

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: x

    Array of which to find the range

    Return Value real(kind=wp)

    Range of the array

  • private function span_3(x) result(o)

    Return (hi-low) for an array

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:,:):: x

    Array of which to find the range

    Return Value real(kind=wp)

    Range of the array

public interface flatten

Reduce an array to one dimension

  • private function flatten_2(A) result(o)

    Convert a 2D array to 1D

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: A

    Array to convert

    Return Value real(kind=wp), dimension(:), allocatable

    1D version of the data

  • private function flatten_3(A) result(o)

    Convert a 3D array to 1D

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:,:):: A

    Array to convert

    Return Value real(kind=wp), dimension(:), allocatable

    1D version of the data

  • private function flatten_2Z(A) result(o)

    Convert a 2D array to 1D

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in), dimension(:,:):: A

    Array to convert

    Return Value complex(kind=wp), dimension(:), allocatable

    1D version of the data

  • private function flatten_3Z(A) result(o)

    Convert a 3D array to 1D

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in), dimension(:,:,:):: A

    Array to convert

    Return Value complex(kind=wp), dimension(:), allocatable

    1D version of the data

public interface TDMA

  • private function TDMA_s(A, b) result(x)

    Solve a tridiagonal linear algebra problem \( [A]\{x\}=\{b\} \)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: A

    Coefficient matrix with the diagonals in columns \( [A] \)

    real(kind=wp), intent(in), dimension(:):: b

    Right-hand-side of the system \( \{b\} \)

    Return Value real(kind=wp), dimension(:), allocatable

    Problem solution \( \{x\} \)

  • private function TDMA_m(A, b) result(x)

    Solve a tridiagonal linear algebra problem \( [A]\{x\}=\{b\} \)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: A

    Coefficient matrix with the diagonals in columns \( [A] \)

    real(kind=wp), intent(in), dimension(:,:):: b

    Right-hand-side of the system \( \{b\} \)

    Return Value real(kind=wp), dimension(:,:), allocatable

    Problem solution \( \{x\} \)

  • private function TDMA_sZ(A, b) result(x)

    Solve a tridiagonal linear algebra problem \( [A]\{x\}=\{b\} \)

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in), dimension(:,:):: A

    Coefficient matrix with the diagonals in columns \( [A] \)

    complex(kind=wp), intent(in), dimension(:):: b

    Right-hand-side of the system \( \{b\} \)

    Return Value complex(kind=wp), dimension(:), allocatable

    Problem solution \( \{x\} \)

  • private function TDMA_mZ(A, b) result(x)

    Solve a tridiagonal linear algebra problem \( [A]\{x\}=\{b\} \)

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in), dimension(:,:):: A

    Coefficient matrix with the diagonals in columns \( [A] \)

    complex(kind=wp), intent(in), dimension(:,:):: b

    Right-hand-side of the system \( \{b\} \)

    Return Value complex(kind=wp), dimension(:,:), allocatable

    Problem solution \( \{x\} \)

public interface solveLU

  • private function solveLU_s(A, b) result(x)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: A
    real(kind=wp), intent(in), dimension(:):: b

    Return Value real(kind=wp), dimension(:), allocatable

  • private function solveLU_m(A, b) result(x)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(:,:):: A
    real(kind=wp), intent(in), dimension(:,:):: b

    Return Value real(kind=wp), dimension(:,:), allocatable

  • private function solveLU_sZ(A, b) result(x)

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in), dimension(:,:):: A
    complex(kind=wp), intent(in), dimension(:):: b

    Return Value complex(kind=wp), dimension(:), allocatable

  • private function solveLU_mZ(A, b) result(x)

    Arguments

    Type IntentOptional AttributesName
    complex(kind=wp), intent(in), dimension(:,:):: A
    complex(kind=wp), intent(in), dimension(:,:):: b

    Return Value complex(kind=wp), dimension(:,:), allocatable


Functions

public function deDup(l) result(o)

Remove duplicates from a list of positive integers

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: l

List for de-duplication

Return Value integer, dimension(:), allocatable

List without duplicates

public function linspace(l, h, N) result(o)

Return an array of evenly-spaced values

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: l

Low-bound for values

real(kind=wp), intent(in) :: h

High-bound for values

integer, intent(in), optional :: N

Number of values (default 20)

Return Value real(kind=wp), dimension(:), allocatable

public function meshGridX(x, y) result(o)

Construct a grid from x and y spacing

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

Grid values in x and y

real(kind=wp), intent(in), dimension(:):: y

Grid values in x and y

Return Value real(kind=wp), dimension(:,:), allocatable

Array x expanded into y

public function meshGridY(x, y) result(o)

Construct a grid from x and y spacing

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(:):: x

Grid values in x and y

real(kind=wp), intent(in), dimension(:):: y

Grid values in x and y

Return Value real(kind=wp), dimension(:,:), allocatable

Array x expanded into y

public function linearInterp(r, x, y) result(o)

Linear interpolation of y(x) at x=r

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: r

Position of desired value

real(kind=wp), intent(in), dimension(:):: x

x values of data

real(kind=wp), intent(in), dimension(size(x)):: y

y values of data

Return Value real(kind=wp)

y(x=r) via linear interpolation

public function findInterval(t, t0) result(o)

Find the locations in t0 that bracket t

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: t

Position of desired value

real(kind=wp), intent(in), dimension(:):: t0

t values of data

Return Value integer

Index of lower t0 value which brakets t