MONC
Private Member Functions | List of all members
collections_mod::c_real_at Interface Reference

Retrieves the double precision real value held at the specific map index or null if index > map elements. More...

Private Member Functions

real(kind=default_precision) function map_real_at (specificmap, i)
 Retrieves the real value held at the specific map index. Converts between precision and int. More...
 
integer function hashmap_real_at (specificmap, i)
 Retrieves the value held at the specific hashmap index. Converts between precision and from int. Note that this is an expensive operation has it has to potentially process all internal hashed lists so avoid if can. More...
 

Detailed Description

Retrieves the double precision real value held at the specific map index or null if index > map elements.

This has a time complexity of O(n)

Parameters
collectionThe specific map involved
indexThe index to get value from
Returns
Double precision real value or raises an error if none is found

Definition at line 497 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_real_at()

integer function collections_mod::c_real_at::hashmap_real_at ( type(hashmap_type), intent(inout)  specificmap,
integer, intent(in)  i 
)
private

Retrieves the value held at the specific hashmap index. Converts between precision and from int. Note that this is an expensive operation has it has to potentially process all internal hashed lists so avoid if can.

Do not call directly from external module, this is called via the appropriate interface

Parameters
specificmapThe specific hashmap involved
iIndex to get value from
Returns
Double precision real value or raises an error if none is found

Definition at line 1484 of file collections.F90.

1484  type(hashmap_type), intent(inout) :: specificmap
1485  integer, intent(in) :: i
1486  integer :: hashmap_real_at
1487 
1488  class(*), pointer :: generic
1489 
1490  generic=>hashmap_generic_at(specificmap, i)
1491  if (.not. associated(generic)) call log_log(log_error, "Can not find real at "//trim(conv_to_string(i)))
1492  select type(vr=>generic)
1493  type is (real(kind=default_precision))
1494  hashmap_real_at=vr
1495  type is (real)
1496  hashmap_real_at=conv_single_real_to_double(vr)
1497  type is (integer)
1498  hashmap_real_at=conv_single_real_to_double(conv_to_real(vr))
1499  end select

◆ map_real_at()

real(kind=default_precision) function collections_mod::c_real_at::map_real_at ( type(map_type), intent(inout)  specificmap,
integer, intent(in)  i 
)
private

Retrieves the real value held at the specific map index. Converts between precision and int.

Do not call directly from external module, this is called via the appropriate interface

Parameters
specificmapThe specific map involved
iIndex to get value from
Returns
Double precision real value or raises an error if none is found

Definition at line 842 of file collections.F90.

842  type(map_type), intent(inout) :: specificmap
843  integer, intent(in) :: i
844  real(kind=DEFAULT_PRECISION) :: map_real_at
845 
846  class(*), pointer :: generic
847 
848  generic=>map_generic_at(specificmap, i)
849  if (.not. associated(generic)) call log_log(log_error, "Can not find real at "//trim(conv_to_string(i)))
850  select type(vr=>generic)
851  type is (real(kind=default_precision))
852  map_real_at=vr
853  type is (real)
854  map_real_at=conv_single_real_to_double(vr)
855  type is (integer)
856  map_real_at=conv_single_real_to_double(conv_to_real(vr))
857  end select

The documentation for this interface was generated from the following file: