(git:6a2e663)
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...

Functions/Subroutines

subroutine, public cp_1d_r_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
subroutine, public cp_2d_r_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
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). More...
 
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). More...
 
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. More...
 
subroutine, public cp_1d_c_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
subroutine, public cp_2d_c_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
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). More...
 
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). More...
 
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. More...
 
subroutine, public cp_1d_i_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
subroutine, public cp_2d_i_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
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). More...
 
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). More...
 
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. More...
 
subroutine, public cp_1d_logical_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
subroutine, public cp_2d_logical_write (array, unit_nr, el_format)
 writes an array to the given unit More...
 
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). More...
 
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). More...
 
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. More...
 

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 399 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 440 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 473 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 506 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 540 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 589 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 630 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 663 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 696 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 731 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 780 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 821 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 854 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 887 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 921 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 970 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 1011 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 1044 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 1077 of file cp_array_utils.F.