(git:15c7cac)
Loading...
Searching...
No Matches
cp_array_utils Module Reference

various utilities that regard array of different kinds: output, allocation,... maybe it is not a good idea mixing output and memeory utils... More...

Data Types

type  cp_1d_c_cp_type
 represent a pointer to a contiguous 1d array More...
 
type  cp_1d_c_p_type
 represent a pointer to a 1d array More...
 
type  cp_1d_i_cp_type
 represent a pointer to a contiguous 1d array More...
 
type  cp_1d_i_p_type
 represent a pointer to a 1d array More...
 
type  cp_1d_logical_cp_type
 represent a pointer to a contiguous 1d array More...
 
type  cp_1d_logical_p_type
 represent a pointer to a 1d array More...
 
type  cp_1d_r_cp_type
 represent a pointer to a contiguous 1d array More...
 
type  cp_1d_r_p_type
 represent a pointer to a 1d array More...
 
type  cp_2d_c_cp_type
 represent a pointer to a contiguous 2d array More...
 
type  cp_2d_c_p_type
 represent a pointer to a 2d array More...
 
type  cp_2d_i_cp_type
 represent a pointer to a contiguous 2d array More...
 
type  cp_2d_i_p_type
 represent a pointer to a 2d array More...
 
type  cp_2d_logical_cp_type
 represent a pointer to a contiguous 2d array More...
 
type  cp_2d_logical_p_type
 represent a pointer to a 2d array More...
 
type  cp_2d_r_cp_type
 represent a pointer to a contiguous 2d array More...
 
type  cp_2d_r_p_type
 represent a pointer to a 2d array More...
 
type  cp_3d_c_cp_type
 represent a pointer to a contiguous 3d array More...
 
type  cp_3d_c_p_type
 represent a pointer to a 3d array More...
 
type  cp_3d_i_cp_type
 represent a pointer to a contiguous 3d array More...
 
type  cp_3d_i_p_type
 represent a pointer to a 3d array More...
 
type  cp_3d_logical_cp_type
 represent a pointer to a contiguous 3d array More...
 
type  cp_3d_logical_p_type
 represent a pointer to a 3d array More...
 
type  cp_3d_r_cp_type
 represent a pointer to a contiguous 3d array More...
 
type  cp_3d_r_p_type
 represent a pointer to a 3d array More...
 
interface  cp_guarantee_size
 

Functions/Subroutines

subroutine, public cp_1d_r_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_2d_r_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_1d_r_guarantee_size (array, n)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
subroutine, public cp_2d_r_guarantee_size (array, n_rows, n_cols)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
integer function, public cp_1d_r_bsearch (array, el, l_index, u_index)
 returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.
 
subroutine, public cp_1d_c_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_2d_c_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_1d_c_guarantee_size (array, n)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
subroutine, public cp_2d_c_guarantee_size (array, n_rows, n_cols)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
integer function, public cp_1d_c_bsearch (array, el, l_index, u_index)
 returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.
 
subroutine, public cp_1d_i_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_2d_i_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_1d_i_guarantee_size (array, n)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
subroutine, public cp_2d_i_guarantee_size (array, n_rows, n_cols)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
integer function, public cp_1d_i_bsearch (array, el, l_index, u_index)
 returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.
 
subroutine, public cp_1d_logical_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_2d_logical_write (array, unit_nr, el_format)
 writes an array to the given unit
 
subroutine, public cp_1d_logical_guarantee_size (array, n)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
subroutine, public cp_2d_logical_guarantee_size (array, n_rows, n_cols)
 If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).
 
integer function, public cp_1d_logical_bsearch (array, el, l_index, u_index)
 returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.
 

Detailed Description

various utilities that regard array of different kinds: output, allocation,... maybe it is not a good idea mixing output and memeory utils...

History
12.2001 first version [fawzi] 3.2002 templatized [fawzi]
Author
Fawzi Mohamed

Function/Subroutine Documentation

◆ cp_1d_r_write()

subroutine, public cp_array_utils::cp_1d_r_write ( real(kind=dp), dimension(:), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated paretized list

Definition at line 350 of file cp_array_utils.F.

Here is the call graph for this function:

◆ cp_2d_r_write()

subroutine, public cp_array_utils::cp_2d_r_write ( real(kind=dp), dimension(:, :), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated parentized list

Definition at line 401 of file cp_array_utils.F.

Here is the call graph for this function:

◆ cp_1d_r_guarantee_size()

subroutine, public cp_array_utils::cp_1d_r_guarantee_size ( real(kind=dp), dimension(:), pointer  array,
integer, intent(in)  n 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
nthe wanted size
History
12.2001 first version [fawzi] 3.2002 templatized [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 442 of file cp_array_utils.F.

◆ cp_2d_r_guarantee_size()

subroutine, public cp_array_utils::cp_2d_r_guarantee_size ( real(kind=dp), dimension(:, :), pointer  array,
integer, intent(in)  n_rows,
integer, intent(in)  n_cols 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
n_rowsthe wanted number of rows
n_colsthe wanted number of cols
History
5.2001 first version [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 475 of file cp_array_utils.F.

◆ cp_1d_r_bsearch()

integer function, public cp_array_utils::cp_1d_r_bsearch ( real(kind=dp), dimension(:), intent(in)  array,
real(kind=dp), intent(in)  el,
integer, intent(in), optional  l_index,
integer, intent(in), optional  u_index 
)

returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.

Parameters
arraythe array to search
elthe element to look for
l_indexthe lower index for binary search (defaults to 1)
u_indexthe upper index for binary search (defaults to size(array))
Returns
...
History
06.2003 created [fawzi]
Author
Fawzi Mohamed
Note
the array should be ordered in growing order

Definition at line 508 of file cp_array_utils.F.

◆ cp_1d_c_write()

subroutine, public cp_array_utils::cp_1d_c_write ( complex(kind=dp), dimension(:), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated paretized list

Definition at line 541 of file cp_array_utils.F.

Here is the call graph for this function:

◆ cp_2d_c_write()

subroutine, public cp_array_utils::cp_2d_c_write ( complex(kind=dp), dimension(:, :), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated parentized list

Definition at line 592 of file cp_array_utils.F.

Here is the call graph for this function:

◆ cp_1d_c_guarantee_size()

subroutine, public cp_array_utils::cp_1d_c_guarantee_size ( complex(kind=dp), dimension(:), pointer  array,
integer, intent(in)  n 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
nthe wanted size
History
12.2001 first version [fawzi] 3.2002 templatized [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 633 of file cp_array_utils.F.

◆ cp_2d_c_guarantee_size()

subroutine, public cp_array_utils::cp_2d_c_guarantee_size ( complex(kind=dp), dimension(:, :), pointer  array,
integer, intent(in)  n_rows,
integer, intent(in)  n_cols 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
n_rowsthe wanted number of rows
n_colsthe wanted number of cols
History
5.2001 first version [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 666 of file cp_array_utils.F.

◆ cp_1d_c_bsearch()

integer function, public cp_array_utils::cp_1d_c_bsearch ( complex(kind=dp), dimension(:), intent(in)  array,
complex(kind=dp), intent(in)  el,
integer, intent(in), optional  l_index,
integer, intent(in), optional  u_index 
)

returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.

Parameters
arraythe array to search
elthe element to look for
l_indexthe lower index for binary search (defaults to 1)
u_indexthe upper index for binary search (defaults to size(array))
Returns
...
History
06.2003 created [fawzi]
Author
Fawzi Mohamed
Note
the array should be ordered in growing order

Definition at line 699 of file cp_array_utils.F.

◆ cp_1d_i_write()

subroutine, public cp_array_utils::cp_1d_i_write ( integer(kind=int_4), dimension(:), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated paretized list

Definition at line 733 of file cp_array_utils.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_2d_i_write()

subroutine, public cp_array_utils::cp_2d_i_write ( integer(kind=int_4), dimension(:, :), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated parentized list

Definition at line 784 of file cp_array_utils.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_1d_i_guarantee_size()

subroutine, public cp_array_utils::cp_1d_i_guarantee_size ( integer(kind=int_4), dimension(:), pointer  array,
integer, intent(in)  n 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
nthe wanted size
History
12.2001 first version [fawzi] 3.2002 templatized [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 825 of file cp_array_utils.F.

◆ cp_2d_i_guarantee_size()

subroutine, public cp_array_utils::cp_2d_i_guarantee_size ( integer(kind=int_4), dimension(:, :), pointer  array,
integer, intent(in)  n_rows,
integer, intent(in)  n_cols 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
n_rowsthe wanted number of rows
n_colsthe wanted number of cols
History
5.2001 first version [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 858 of file cp_array_utils.F.

◆ cp_1d_i_bsearch()

integer function, public cp_array_utils::cp_1d_i_bsearch ( integer(kind=int_4), dimension(:), intent(in)  array,
integer(kind=int_4), intent(in)  el,
integer, intent(in), optional  l_index,
integer, intent(in), optional  u_index 
)

returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.

Parameters
arraythe array to search
elthe element to look for
l_indexthe lower index for binary search (defaults to 1)
u_indexthe upper index for binary search (defaults to size(array))
Returns
...
History
06.2003 created [fawzi]
Author
Fawzi Mohamed
Note
the array should be ordered in growing order

Definition at line 891 of file cp_array_utils.F.

◆ cp_1d_logical_write()

subroutine, public cp_array_utils::cp_1d_logical_write ( logical, dimension(:), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated paretized list

Definition at line 924 of file cp_array_utils.F.

Here is the call graph for this function:

◆ cp_2d_logical_write()

subroutine, public cp_array_utils::cp_2d_logical_write ( logical, dimension(:, :), intent(in)  array,
integer, intent(in)  unit_nr,
character(len=*), intent(in), optional  el_format 
)

writes an array to the given unit

Parameters
arraythe array to write
unit_nrthe unit to write to (defaults to the standard out)
el_formatthe format of a single element
History
4.2002 created [fawzi]
Author
Fawzi Mohamed
Note
maybe I will move to a comma separated parentized list

Definition at line 975 of file cp_array_utils.F.

Here is the call graph for this function:

◆ cp_1d_logical_guarantee_size()

subroutine, public cp_array_utils::cp_1d_logical_guarantee_size ( logical, dimension(:), pointer  array,
integer, intent(in)  n 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
nthe wanted size
History
12.2001 first version [fawzi] 3.2002 templatized [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 1016 of file cp_array_utils.F.

◆ cp_2d_logical_guarantee_size()

subroutine, public cp_array_utils::cp_2d_logical_guarantee_size ( logical, dimension(:, :), pointer  array,
integer, intent(in)  n_rows,
integer, intent(in)  n_cols 
)

If the size of the array is changes reallocate it. Issues a warning when the size changes (but not on allocation and deallocation).

The data is NOT preserved (if you want to preserve the data see the realloc in the module memory_utilities)

Parameters
arraythe array to reallocate if necessary
n_rowsthe wanted number of rows
n_colsthe wanted number of cols
History
5.2001 first version [fawzi]
Author
Fawzi Mohamed
Note
this is a different behaviour than the realloc in the module memory_utilities. It is quite low level

Definition at line 1049 of file cp_array_utils.F.

◆ cp_1d_logical_bsearch()

integer function, public cp_array_utils::cp_1d_logical_bsearch ( logical, dimension(:), intent(in)  array,
logical, intent(in)  el,
integer, intent(in), optional  l_index,
integer, intent(in), optional  u_index 
)

returns the index at which the element el should be inserted in the array to keep it ordered (array(i)>=el). If the element is bigger than all the elements in the array returns the last index+1.

Parameters
arraythe array to search
elthe element to look for
l_indexthe lower index for binary search (defaults to 1)
u_indexthe upper index for binary search (defaults to size(array))
Returns
...
History
06.2003 created [fawzi]
Author
Fawzi Mohamed
Note
the array should be ordered in growing order

Definition at line 1082 of file cp_array_utils.F.