pic_array Module

Please do not modify this file to implement new methods, please go look at tools/autogen/pic_array_cpu.fypp and edit the generator.


Uses

  • module~~pic_array~~UsesGraph module~pic_array pic_array module~pic_error pic_error module~pic_array->module~pic_error module~pic_io pic_io module~pic_array->module~pic_io module~pic_optional_value pic_optional_value module~pic_array->module~pic_optional_value module~pic_types pic_types module~pic_array->module~pic_types module~pic_error->module~pic_types module~pic_global_definitions pic_global_definitions module~pic_error->module~pic_global_definitions module~pic_io->module~pic_types module~pic_ascii pic_ascii module~pic_io->module~pic_ascii module~pic_optional_value->module~pic_types iso_c_binding iso_c_binding module~pic_types->iso_c_binding iso_fortran_env iso_fortran_env module~pic_types->iso_fortran_env module~pic_ascii->module~pic_types module~pic_global_definitions->module~pic_types

Variables

Type Visibility Attributes Name Initial
integer(kind=default_int), public, parameter :: ASCENDING = 1
integer(kind=default_int), public, parameter :: DESCENDING = 2
integer(kind=default_int), private, parameter :: block_size = 32

This is the size to block over for matrices for performance purposes

character(len=5), private, parameter :: default_format = "NUMPY"

supported formats: NUMPY, MATHEMATICA, and PLAIN which resembles numpy

character(len=*), private, parameter :: fmt_edge = "(A)"
character(len=*), private, parameter :: fmt_in = '(A, ", ")'
logical, private :: use_threaded_default = .false.

Interfaces

public interface get_threading_mode

get_threading_mode returns the current threading mode for the array routines Usage: mode = get_threading_mode()

  • private function get_threading_mode_() result(mode)

    get the current threading mode for the array routines Usage: mode = get_threading_mode()

    Arguments

    None

    Return Value logical

public interface is_sorted

is_sorted provides a simple way to checking if a 1d array is sorted it is implemented for int32, int64, sp, and dp datatypes. The default is to check if an array is sorted in ascending fashion.

Usage: result = is_sorted(array, [optional] ASCENDING/DESCENDING)

  • private pure function is_sorted_int32(array, order) result(sorted)

    check if a 1d array of type int32 is sorted

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: array(:)
    integer(kind=default_int), intent(in), optional :: order

    Return Value logical

  • private pure function is_sorted_int64(array, order) result(sorted)

    check if a 1d array of type int64 is sorted

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: array(:)
    integer(kind=default_int), intent(in), optional :: order

    Return Value logical

  • private pure function is_sorted_sp(array, order) result(sorted)

    check if a 1d array of type sp is sorted

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: array(:)
    integer(kind=default_int), intent(in), optional :: order

    Return Value logical

  • private pure function is_sorted_dp(array, order) result(sorted)

    check if a 1d array of type dp is sorted

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: array(:)
    integer(kind=default_int), intent(in), optional :: order

    Return Value logical

  • private pure function is_sorted_char(array, order) result(sorted)

    check if a 1d array of type char is sorted

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: array(:)
    integer(kind=default_int), intent(in), optional :: order

    Return Value logical

public interface pic_copy

copy provides a blas-less implementation of xcopy where x is (i,s,d) icopy, scopy, dcopy if you built pic with BLAS use the copy interface provided there, I will not beat BLAS copy is implemented for (int32, int64, sp, dp) for 1 and 2d arrays of the same types

Usage: call pic_copy(destination, source, [optional] threaded, [optional] err)

This subroutine is threaded for performance purposes if threaded is set to .true.

A destination whose shape differs from the source is a caller error. If the optional err argument is present it is set to ERROR_VALIDATION and the destination is left unchanged; if err is absent the mismatch aborts the program with error stop, which is the historical behaviour.

Note

If this subroutine is called inside a omp threaded region it will run serially because of nested parallelism

  • private subroutine copy_vector_int32(dest, source, threaded, err)

    copy a vector of datatype int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: dest(:)
    integer(kind=int32), intent(in) :: source(:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_vector_int64(dest, source, threaded, err)

    copy a vector of datatype int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: dest(:)
    integer(kind=int64), intent(in) :: source(:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_vector_sp(dest, source, threaded, err)

    copy a vector of datatype sp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: dest(:)
    real(kind=sp), intent(in) :: source(:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_vector_dp(dest, source, threaded, err)

    copy a vector of datatype dp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: dest(:)
    real(kind=dp), intent(in) :: source(:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_matrix_int32(dest, source, threaded, err)

    copy a matrix of datatype int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: dest(:,:)
    integer(kind=int32), intent(in) :: source(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_matrix_int64(dest, source, threaded, err)

    copy a matrix of datatype int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: dest(:,:)
    integer(kind=int64), intent(in) :: source(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_matrix_sp(dest, source, threaded, err)

    copy a matrix of datatype sp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: dest(:,:)
    real(kind=sp), intent(in) :: source(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_matrix_dp(dest, source, threaded, err)

    copy a matrix of datatype dp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: dest(:,:)
    real(kind=dp), intent(in) :: source(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_3d_tensor_int32(dest, source, threaded, err)

    copy a tensor of datatype int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: dest(:,:,:)
    integer(kind=int32), intent(in) :: source(:,:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_3d_tensor_int64(dest, source, threaded, err)

    copy a tensor of datatype int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: dest(:,:,:)
    integer(kind=int64), intent(in) :: source(:,:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_3d_tensor_sp(dest, source, threaded, err)

    copy a tensor of datatype sp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: dest(:,:,:)
    real(kind=sp), intent(in) :: source(:,:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

  • private subroutine copy_3d_tensor_dp(dest, source, threaded, err)

    copy a tensor of datatype dp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: dest(:,:,:)
    real(kind=dp), intent(in) :: source(:,:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

public interface pic_fill

fill provides a generic interface to assing a value alpha of types (int32, int64, sp, dp) as defined in pic_types.F90 The inteface supports filling 1d and 2d arrays of the specified variables

Usage: call pic_fill(array, value, [optional] threaded)

This subroutine is threaded for performance purposes if threaded is set to .true.

Note

If this subroutine is called inside a omp threaded region it will run serially because of nested parallelism

  • private subroutine fill_vector_int32(vector, alpha, threaded)

    fill a vector of datatype int32 with a value

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: vector(:)
    integer(kind=int32), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_vector_int64(vector, alpha, threaded)

    fill a vector of datatype int64 with a value

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: vector(:)
    integer(kind=int64), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_vector_sp(vector, alpha, threaded)

    fill a vector of datatype sp with a value

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: vector(:)
    real(kind=sp), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_vector_dp(vector, alpha, threaded)

    fill a vector of datatype dp with a value

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: vector(:)
    real(kind=dp), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_matrix_int32(matrix, alpha, threaded)

    fill a matrix of datatype int32 with a value

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: matrix(:,:)
    integer(kind=int32), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_matrix_int64(matrix, alpha, threaded)

    fill a matrix of datatype int64 with a value

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: matrix(:,:)
    integer(kind=int64), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_matrix_sp(matrix, alpha, threaded)

    fill a matrix of datatype sp with a value

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: matrix(:,:)
    real(kind=sp), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_matrix_dp(matrix, alpha, threaded)

    fill a matrix of datatype dp with a value

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: matrix(:,:)
    real(kind=dp), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_3d_tensor_int32(tensor, alpha, threaded)

    fill a tensor of datatype int32 with a value

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: tensor(:,:,:)
    integer(kind=int32), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_3d_tensor_int64(tensor, alpha, threaded)

    fill a tensor of datatype int64 with a value

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: tensor(:,:,:)
    integer(kind=int64), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_3d_tensor_sp(tensor, alpha, threaded)

    fill a tensor of datatype sp with a value

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: tensor(:,:,:)
    real(kind=sp), intent(in) :: alpha
    logical, intent(in), optional :: threaded
  • private subroutine fill_3d_tensor_dp(tensor, alpha, threaded)

    fill a tensor of datatype dp with a value

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: tensor(:,:,:)
    real(kind=dp), intent(in) :: alpha
    logical, intent(in), optional :: threaded

public interface pic_print_array

Generic interface for printing arrays of different types

Usage: call pic_print_array(array, [optional] format, [optional] err) Where format can be: NUMPY, PLAIN, MATHEMATICA (can use lower caps)

Implemented types are:

array(:) -> int32, int64, sp, dp

array(:,:) -> int32, int64, sp, dp

array(:) (packed matrix) -> sp, dp

array(:,:,:) -> sp, dp

Reporting bad input

Two things can go wrong while printing, and both are reported through the optional err argument without changing what the routines do:

  • an unrecognised format string. err is set to ERROR_VALIDATION and the array is still printed using NumPy brackets. When err is absent a warning is printed to stdout instead, exactly as before.

  • an n_elements that is not a packed triangle size (the packed-matrix specifics only). err is set to ERROR_VALIDATION and nothing is printed. When err is absent the complaint is printed to stdout instead, again as before.

Neither case aborts, with or without err: these routines never terminated the program and still do not, so adding err cannot turn a working caller into a crashing one. A caller that wants to be told about bad input must pass err and inspect it; a caller that does not pass err gets the historical stdout message and no other signal.

  • private subroutine print_vector_int32(vector, format_type, err)

    print a vector of values

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: vector(:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

  • private subroutine print_vector_int64(vector, format_type, err)

    print a vector of values

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: vector(:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

  • private subroutine print_vector_sp(vector, format_type, err)

    print a vector of values

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: vector(:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

  • private subroutine print_vector_dp(vector, format_type, err)

    print a vector of values

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: vector(:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

  • private subroutine print_matrix_int32(matrix, format_type, err)

    print a matrix of values

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: matrix(:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

  • private subroutine print_matrix_int64(matrix, format_type, err)

    print a matrix of values

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: matrix(:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

  • private subroutine print_matrix_sp(matrix, format_type, err)

    print a matrix of values

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: matrix(:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

  • private subroutine print_matrix_dp(matrix, format_type, err)

    print a matrix of values

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: matrix(:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

  • private subroutine print_packed_matrix_int32(packed, n_elements, format_type, err)

    Print a packed lower triangular matrix of values

    n_elements must be n*(n + 1)/2 for some n. If it is not, nothing is printed: err is set to ERROR_VALIDATION when it is present, and the complaint goes to stdout when it is not. Neither path aborts, which is how this routine has always behaved.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: packed(:)
    integer(kind=default_int), intent(in) :: n_elements
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

  • private subroutine print_packed_matrix_int64(packed, n_elements, format_type, err)

    Print a packed lower triangular matrix of values

    n_elements must be n*(n + 1)/2 for some n. If it is not, nothing is printed: err is set to ERROR_VALIDATION when it is present, and the complaint goes to stdout when it is not. Neither path aborts, which is how this routine has always behaved.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: packed(:)
    integer(kind=default_int), intent(in) :: n_elements
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

  • private subroutine print_packed_matrix_sp(packed, n_elements, format_type, err)

    Print a packed lower triangular matrix of values

    n_elements must be n*(n + 1)/2 for some n. If it is not, nothing is printed: err is set to ERROR_VALIDATION when it is present, and the complaint goes to stdout when it is not. Neither path aborts, which is how this routine has always behaved.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: packed(:)
    integer(kind=default_int), intent(in) :: n_elements
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

  • private subroutine print_packed_matrix_dp(packed, n_elements, format_type, err)

    Print a packed lower triangular matrix of values

    n_elements must be n*(n + 1)/2 for some n. If it is not, nothing is printed: err is set to ERROR_VALIDATION when it is present, and the complaint goes to stdout when it is not. Neither path aborts, which is how this routine has always behaved.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: packed(:)
    integer(kind=default_int), intent(in) :: n_elements
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

  • private subroutine print_3d_tensor_int32(matrix, format_type, err)

    Print a 3D tensor of values

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: matrix(:,:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

  • private subroutine print_3d_tensor_int64(matrix, format_type, err)

    Print a 3D tensor of values

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: matrix(:,:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

  • private subroutine print_3d_tensor_sp(matrix, format_type, err)

    Print a 3D tensor of values

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: matrix(:,:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

  • private subroutine print_3d_tensor_dp(matrix, format_type, err)

    Print a 3D tensor of values

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: matrix(:,:,:)
    character(len=*), intent(in), optional :: format_type
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

public interface pic_scramble_array

  • private subroutine scramble_array_int32(array)

    should not be used, intended for testing purposes. randomizes an array of type int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(inout) :: array(:)
  • private subroutine scramble_array_int64(array)

    should not be used, intended for testing purposes. randomizes an array of type int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(inout) :: array(:)
  • private subroutine scramble_array_sp(array)

    should not be used, intended for testing purposes. randomizes an array of type sp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(inout) :: array(:)
  • private subroutine scramble_array_dp(array)

    should not be used, intended for testing purposes. randomizes an array of type dp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(inout) :: array(:)
  • private subroutine scramble_array_character(array)

    should not be used, intended for testing purposes. randomizes an array of type char

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(inout) :: array(:)

public interface pic_sum

pic_sum provides a threaded alternative to the sum(array) Fortran intrinsic which will be too slow for large sizes of vectors and matrices. Note that this provides the total sum. As opposed to the blas alternative XASUM which does the absolute sum

pic_sum is implemented for (int32, int64, sp, dp) 1 and 2d arrays

Usage: result = pic_sum(array, [optional] threaded)

This subroutine is threaded for performance purposes if threaded is set to true

Note

If this subroutine is called inside a omp threaded region it will run serially because of nested parallelism

  • private function sum_vector_int32(vector, threaded) result(res)

    perform the total sum of all components of type int32 in a vector

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: vector(:)
    logical, intent(in), optional :: threaded

    Return Value integer(kind=int32)

  • private function sum_vector_int64(vector, threaded) result(res)

    perform the total sum of all components of type int64 in a vector

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: vector(:)
    logical, intent(in), optional :: threaded

    Return Value integer(kind=int64)

  • private function sum_vector_sp(vector, threaded) result(res)

    perform the total sum of all components of type sp in a vector

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: vector(:)
    logical, intent(in), optional :: threaded

    Return Value real(kind=sp)

  • private function sum_vector_dp(vector, threaded) result(res)

    perform the total sum of all components of type dp in a vector

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: vector(:)
    logical, intent(in), optional :: threaded

    Return Value real(kind=dp)

  • private function sum_matrix_int32(matrix, threaded) result(res)

    perform the total sum of all components of type int32 in a matrix

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: matrix(:,:)
    logical, intent(in), optional :: threaded

    Return Value integer(kind=int32)

  • private function sum_matrix_int64(matrix, threaded) result(res)

    perform the total sum of all components of type int64 in a matrix

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: matrix(:,:)
    logical, intent(in), optional :: threaded

    Return Value integer(kind=int64)

  • private function sum_matrix_sp(matrix, threaded) result(res)

    perform the total sum of all components of type sp in a matrix

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: matrix(:,:)
    logical, intent(in), optional :: threaded

    Return Value real(kind=sp)

  • private function sum_matrix_dp(matrix, threaded) result(res)

    perform the total sum of all components of type dp in a matrix

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: matrix(:,:)
    logical, intent(in), optional :: threaded

    Return Value real(kind=dp)

  • private function sum_3d_tensor_int32(tensor, threaded) result(res)

    perform the total sum of all components of type int32 in a 3d tensor

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: tensor(:,:,:)
    logical, intent(in), optional :: threaded

    Return Value integer(kind=int32)

  • private function sum_3d_tensor_int64(tensor, threaded) result(res)

    perform the total sum of all components of type int64 in a 3d tensor

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: tensor(:,:,:)
    logical, intent(in), optional :: threaded

    Return Value integer(kind=int64)

  • private function sum_3d_tensor_sp(tensor, threaded) result(res)

    perform the total sum of all components of type sp in a 3d tensor

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: tensor(:,:,:)
    logical, intent(in), optional :: threaded

    Return Value real(kind=sp)

  • private function sum_3d_tensor_dp(tensor, threaded) result(res)

    perform the total sum of all components of type dp in a 3d tensor

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: tensor(:,:,:)
    logical, intent(in), optional :: threaded

    Return Value real(kind=dp)

public interface pic_transpose

pic_transpose provides a blas-less, threaded alternative to the Fortran transpose intrinsic which will be slow for large matrix sizes. pic_transpose does not assume symmetric matrices

pic_transpose is implemented for (int32, int64, sp, dp) 2d arrays

Usage: call pic_transpose(matrix_to_transpose, result, [optional] threaded, [optional] err)

This subroutine is threaded for performance purposes if threaded is set to true

The result must be shaped (cols, rows) for an input shaped (rows, cols). If it is not, the optional err argument is set to ERROR_VALIDATION; if err is absent the mismatch aborts the program with error stop, which is the historical behaviour. The result is intent(out), so on the error path it is undefined and the caller must not read it.

Note

If this subroutine is called inside a omp threaded region it will run serially because of nested parallelism

  • private subroutine transpose_matrix_int32(A, B, threaded, err)

    transpose a matrix of datatype int32

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: A(:,:)
    integer(kind=int32), intent(out) :: B(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

  • private subroutine transpose_matrix_int64(A, B, threaded, err)

    transpose a matrix of datatype int64

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: A(:,:)
    integer(kind=int64), intent(out) :: B(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

  • private subroutine transpose_matrix_sp(A, B, threaded, err)

    transpose a matrix of datatype sp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=sp), intent(in) :: A(:,:)
    real(kind=sp), intent(out) :: B(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

  • private subroutine transpose_matrix_dp(A, B, threaded, err)

    transpose a matrix of datatype dp

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: A(:,:)
    real(kind=dp), intent(out) :: B(:,:)
    logical, intent(in), optional :: threaded
    type(error_t), intent(inout), optional :: err

    set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

public interface set_threading_mode

set_threading sets the threading mode for the array routines this will set the use_threaded variable to true or false depending on the input Usage: call set_threading_mode(.true.) or call set_threading_mode(.false.)

  • private subroutine set_threading_mode_(threaded)

    set the threading mode for the array routines, this will set the use_threaded variable to true or false depending on the input

    Usage: call set_threading(.true.) or call set_threading(.false.)

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: threaded

Functions

private function get_threading_mode_() result(mode)

get the current threading mode for the array routines Usage: mode = get_threading_mode()

Arguments

None

Return Value logical

private pure function is_sorted_char(array, order) result(sorted)

check if a 1d array of type char is sorted

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: array(:)
integer(kind=default_int), intent(in), optional :: order

Return Value logical

private pure function is_sorted_dp(array, order) result(sorted)

check if a 1d array of type dp is sorted

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: array(:)
integer(kind=default_int), intent(in), optional :: order

Return Value logical

private pure function is_sorted_int32(array, order) result(sorted)

check if a 1d array of type int32 is sorted

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: array(:)
integer(kind=default_int), intent(in), optional :: order

Return Value logical

private pure function is_sorted_int64(array, order) result(sorted)

check if a 1d array of type int64 is sorted

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: array(:)
integer(kind=default_int), intent(in), optional :: order

Return Value logical

private pure function is_sorted_sp(array, order) result(sorted)

check if a 1d array of type sp is sorted

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: array(:)
integer(kind=default_int), intent(in), optional :: order

Return Value logical

private function sum_3d_tensor_dp(tensor, threaded) result(res)

perform the total sum of all components of type dp in a 3d tensor

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)

private function sum_3d_tensor_int32(tensor, threaded) result(res)

perform the total sum of all components of type int32 in a 3d tensor

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_3d_tensor_int64(tensor, threaded) result(res)

perform the total sum of all components of type int64 in a 3d tensor

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_3d_tensor_sp(tensor, threaded) result(res)

perform the total sum of all components of type sp in a 3d tensor

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: tensor(:,:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_matrix_dp(matrix, threaded) result(res)

perform the total sum of all components of type dp in a matrix

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)

private function sum_matrix_int32(matrix, threaded) result(res)

perform the total sum of all components of type int32 in a matrix

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_matrix_int64(matrix, threaded) result(res)

perform the total sum of all components of type int64 in a matrix

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_matrix_sp(matrix, threaded) result(res)

perform the total sum of all components of type sp in a matrix

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_vector_dp(vector, threaded) result(res)

perform the total sum of all components of type dp in a vector

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)

private function sum_vector_int32(vector, threaded) result(res)

perform the total sum of all components of type int32 in a vector

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_vector_int64(vector, threaded) result(res)

perform the total sum of all components of type int64 in a vector

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_vector_sp(vector, threaded) result(res)

perform the total sum of all components of type sp in a vector

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)


Subroutines

private subroutine copy_3d_tensor_dp(dest, source, threaded, err)

copy a tensor of datatype dp

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: dest(:,:,:)
real(kind=dp), intent(in) :: source(:,:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_3d_tensor_int32(dest, source, threaded, err)

copy a tensor of datatype int32

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: dest(:,:,:)
integer(kind=int32), intent(in) :: source(:,:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_3d_tensor_int64(dest, source, threaded, err)

copy a tensor of datatype int64

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: dest(:,:,:)
integer(kind=int64), intent(in) :: source(:,:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_3d_tensor_sp(dest, source, threaded, err)

copy a tensor of datatype sp

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: dest(:,:,:)
real(kind=sp), intent(in) :: source(:,:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_matrix_dp(dest, source, threaded, err)

copy a matrix of datatype dp

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: dest(:,:)
real(kind=dp), intent(in) :: source(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_matrix_int32(dest, source, threaded, err)

copy a matrix of datatype int32

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: dest(:,:)
integer(kind=int32), intent(in) :: source(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_matrix_int64(dest, source, threaded, err)

copy a matrix of datatype int64

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: dest(:,:)
integer(kind=int64), intent(in) :: source(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_matrix_sp(dest, source, threaded, err)

copy a matrix of datatype sp

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: dest(:,:)
real(kind=sp), intent(in) :: source(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_vector_dp(dest, source, threaded, err)

copy a vector of datatype dp

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: dest(:)
real(kind=dp), intent(in) :: source(:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_vector_int32(dest, source, threaded, err)

copy a vector of datatype int32

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: dest(:)
integer(kind=int32), intent(in) :: source(:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_vector_int64(dest, source, threaded, err)

copy a vector of datatype int64

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: dest(:)
integer(kind=int64), intent(in) :: source(:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine copy_vector_sp(dest, source, threaded, err)

copy a vector of datatype sp

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: dest(:)
real(kind=sp), intent(in) :: source(:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION on a size mismatch, leaving dest unchanged; when absent a mismatch aborts with error stop

private subroutine fill_3d_tensor_dp(tensor, alpha, threaded)

fill a tensor of datatype dp with a value

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: tensor(:,:,:)
real(kind=dp), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_3d_tensor_int32(tensor, alpha, threaded)

fill a tensor of datatype int32 with a value

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: tensor(:,:,:)
integer(kind=int32), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_3d_tensor_int64(tensor, alpha, threaded)

fill a tensor of datatype int64 with a value

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: tensor(:,:,:)
integer(kind=int64), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_3d_tensor_sp(tensor, alpha, threaded)

fill a tensor of datatype sp with a value

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: tensor(:,:,:)
real(kind=sp), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_matrix_dp(matrix, alpha, threaded)

fill a matrix of datatype dp with a value

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: matrix(:,:)
real(kind=dp), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_matrix_int32(matrix, alpha, threaded)

fill a matrix of datatype int32 with a value

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: matrix(:,:)
integer(kind=int32), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_matrix_int64(matrix, alpha, threaded)

fill a matrix of datatype int64 with a value

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: matrix(:,:)
integer(kind=int64), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_matrix_sp(matrix, alpha, threaded)

fill a matrix of datatype sp with a value

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: matrix(:,:)
real(kind=sp), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_vector_dp(vector, alpha, threaded)

fill a vector of datatype dp with a value

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: vector(:)
real(kind=dp), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_vector_int32(vector, alpha, threaded)

fill a vector of datatype int32 with a value

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: vector(:)
integer(kind=int32), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_vector_int64(vector, alpha, threaded)

fill a vector of datatype int64 with a value

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: vector(:)
integer(kind=int64), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine fill_vector_sp(vector, alpha, threaded)

fill a vector of datatype sp with a value

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: vector(:)
real(kind=sp), intent(in) :: alpha
logical, intent(in), optional :: threaded

private subroutine print_3d_tensor_dp(matrix, format_type, err)

Print a 3D tensor of values

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

private subroutine print_3d_tensor_int32(matrix, format_type, err)

Print a 3D tensor of values

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: matrix(:,:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

private subroutine print_3d_tensor_int64(matrix, format_type, err)

Print a 3D tensor of values

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: matrix(:,:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

private subroutine print_3d_tensor_sp(matrix, format_type, err)

Print a 3D tensor of values

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: matrix(:,:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the tensor is printed with NumPy brackets regardless

private subroutine print_matrix_dp(matrix, format_type, err)

print a matrix of values

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

private subroutine print_matrix_int32(matrix, format_type, err)

print a matrix of values

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: matrix(:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

private subroutine print_matrix_int64(matrix, format_type, err)

print a matrix of values

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: matrix(:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

private subroutine print_matrix_sp(matrix, format_type, err)

print a matrix of values

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: matrix(:,:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the matrix is printed with NumPy brackets regardless

private subroutine print_packed_matrix_dp(packed, n_elements, format_type, err)

Print a packed lower triangular matrix of values

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: packed(:)
integer(kind=default_int), intent(in) :: n_elements
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

private subroutine print_packed_matrix_int32(packed, n_elements, format_type, err)

Print a packed lower triangular matrix of values

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: packed(:)
integer(kind=default_int), intent(in) :: n_elements
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

private subroutine print_packed_matrix_int64(packed, n_elements, format_type, err)

Print a packed lower triangular matrix of values

Read more…

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: packed(:)
integer(kind=default_int), intent(in) :: n_elements
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

private subroutine print_packed_matrix_sp(packed, n_elements, format_type, err)

Print a packed lower triangular matrix of values

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: packed(:)
integer(kind=default_int), intent(in) :: n_elements
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when n_elements is not a packed triangle size, or when format_type is not supported

private subroutine print_vector_dp(vector, format_type, err)

print a vector of values

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vector(:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

private subroutine print_vector_int32(vector, format_type, err)

print a vector of values

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: vector(:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

private subroutine print_vector_int64(vector, format_type, err)

print a vector of values

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: vector(:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

private subroutine print_vector_sp(vector, format_type, err)

print a vector of values

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: vector(:)
character(len=*), intent(in), optional :: format_type
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the vector is printed with NumPy brackets regardless

private subroutine scramble_array_character(array)

should not be used, intended for testing purposes. randomizes an array of type char

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: array(:)

private subroutine scramble_array_dp(array)

should not be used, intended for testing purposes. randomizes an array of type dp

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: array(:)

private subroutine scramble_array_int32(array)

should not be used, intended for testing purposes. randomizes an array of type int32

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(inout) :: array(:)

private subroutine scramble_array_int64(array)

should not be used, intended for testing purposes. randomizes an array of type int64

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: array(:)

private subroutine scramble_array_sp(array)

should not be used, intended for testing purposes. randomizes an array of type sp

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(inout) :: array(:)

private subroutine set_brackets(format_type, open_bracket, close_bracket, err)

Set brackets based on output format type

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: format_type
character(len=1), intent(out) :: open_bracket
character(len=1), intent(out) :: close_bracket
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION for an unsupported format_type; the brackets still come back as the NumPy defaults

private subroutine set_threading_mode_(threaded)

set the threading mode for the array routines, this will set the use_threaded variable to true or false depending on the input

Read more…

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: threaded

private subroutine transpose_matrix_dp(A, B, threaded, err)

transpose a matrix of datatype dp

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: A(:,:)
real(kind=dp), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

private subroutine transpose_matrix_int32(A, B, threaded, err)

transpose a matrix of datatype int32

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: A(:,:)
integer(kind=int32), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

private subroutine transpose_matrix_int64(A, B, threaded, err)

transpose a matrix of datatype int64

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: A(:,:)
integer(kind=int64), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

private subroutine transpose_matrix_sp(A, B, threaded, err)

transpose a matrix of datatype sp

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: A(:,:)
real(kind=sp), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop