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

Gets a specific double precision real element out of the list, stack, queue or map with the corresponding key. More...

Private Member Functions

real(kind=default_precision) function list_get_real (specificlist, i)
 Retrieves the element at index i from the list. Converts between precision and from int. More...
 
real(kind=default_precision) function stack_get_real (specificstack, i)
 Gets a specific element from the stack at index specified. Converts between precision and from int. More...
 
real(kind=default_precision) function queue_get_real (specificqueue, i)
 Returns a specific queue element at an index. Converts between precision and from int. More...
 
real(kind=default_precision) function map_get_real (specificmap, key)
 Gets a specific element out of the map with the corresponding key. This converts between precision and from ints. More...
 
real(kind=default_precision) function hashmap_get_real (specificmap, key)
 Gets a specific element out of the hashmap with the corresponding key. Converts between precision and from int. More...
 
real(kind=default_precision) function mapentry_get_real (mapentry_item)
 Retrieves the double precision real value from a map entry. More...
 

Detailed Description

Gets a specific double precision real element out of the list, stack, queue or map with the corresponding key.

This has a time complexity of O(n)

Parameters
collectionThe specific list, stack, queue or map involved
keyString look up key
Returns
Double precision real value associated with the key or raises an error if none exists

Definition at line 399 of file collections.F90.

Member Function/Subroutine Documentation

◆ hashmap_get_real()

real(kind=default_precision) function collections_mod::c_get_real::hashmap_get_real ( type(hashmap_type), intent(inout)  specificmap,
character(len=*), intent(in)  key 
)
private

Gets a specific element out of the hashmap with the corresponding key. Converts between precision and from int.

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

Parameters
specificmapThe specific hashmap involved
keyLook up key
Returns
Double precision real value associated with the key or raises an error if none is found

Definition at line 1732 of file collections.F90.

1732  type(hashmap_type), intent(inout) :: specificmap
1733  character(len=*), intent(in) :: key
1734  real(kind=DEFAULT_PRECISION) :: hashmap_get_real
1735 
1736  class(*), pointer :: generic
1737 
1738  generic=>hashmap_get_generic(specificmap, key)
1739  if (.not. associated(generic)) call log_log(log_error, "Can not find real entry with key '"//trim(key)//"'")
1740  select type(vr=>generic)
1741  type is (real(kind=default_precision))
1742  hashmap_get_real=vr
1743  type is (real)
1744  hashmap_get_real=conv_single_real_to_double(vr)
1745  type is (integer)
1746  hashmap_get_real=conv_single_real_to_double(conv_to_real(vr))
1747  end select

◆ list_get_real()

real(kind=default_precision) function collections_mod::c_get_real::list_get_real ( type(list_type), intent(inout)  specificlist,
integer, intent(in)  i 
)
private

Retrieves the element at index i from the list. Converts between precision and from int.

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

Parameters
specificlistThe specific list involved
iIndex to look up
Returns
Double precision real data in the list or raises an error if none is found

Definition at line 3075 of file collections.F90.

3075  type(list_type), intent(inout) :: specificlist
3076  integer, intent(in) :: i
3077  real(kind=DEFAULT_PRECISION) :: list_get_real
3078 
3079  class(*), pointer :: generic
3080 
3081  generic=>list_get_generic(specificlist, i)
3082  if (.not. associated(generic)) call log_log(log_error, "Can not get real from list at index "//trim(conv_to_string(i)))
3083  select type(vr=>generic)
3084  type is (real(kind=default_precision))
3085  list_get_real=vr
3086  type is (real)
3087  list_get_real=conv_single_real_to_double(vr)
3088  type is (integer)
3089  list_get_real=conv_single_real_to_double(conv_to_real(vr))
3090  end select

◆ map_get_real()

real(kind=default_precision) function collections_mod::c_get_real::map_get_real ( type(map_type), intent(inout)  specificmap,
character(len=*), intent(in)  key 
)
private

Gets a specific element out of the map with the corresponding key. This converts between precision and from ints.

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

Parameters
specificmapThe specific map involved
keyLook up key
Returns
Real value associated with the key or raises an error if none is found

Definition at line 1094 of file collections.F90.

1094  type(map_type), intent(inout) :: specificmap
1095  character(len=*), intent(in) :: key
1096  real(kind=DEFAULT_PRECISION) :: map_get_real
1097 
1098  class(*), pointer :: generic
1099 
1100  generic=>map_get_generic(specificmap, key)
1101  if (.not. associated(generic)) call log_log(log_error, "Can not find real entry with key '"//trim(key)//"'")
1102  select type(vr=>generic)
1103  type is (real(kind=default_precision))
1104  map_get_real=vr
1105  type is (real)
1106  map_get_real=conv_single_real_to_double(vr)
1107  type is (integer)
1108  map_get_real=conv_single_real_to_double(conv_to_real(vr))
1109  end select

◆ mapentry_get_real()

real(kind=default_precision) function collections_mod::c_get_real::mapentry_get_real ( type(mapentry_type), intent(in)  mapentry_item)
private

Retrieves the double precision real value from a map entry.

Parameters
mapentry_itemThe map entry to retrieve the double precision real value from (auto converts from single/ints)

Definition at line 3347 of file collections.F90.

3347  type(mapentry_type), intent(in) :: mapentry_item
3348  real(kind=DEFAULT_PRECISION) :: mapentry_get_real
3349 
3350  class(*), pointer :: generic
3351 
3352  generic=>mapentry_item%value
3353  if (.not. associated(generic)) call log_log(log_error, "Can not get real from map entry")
3354  select type(vr=>generic)
3355  type is (real(kind=default_precision))
3356  mapentry_get_real=vr
3357  type is (real)
3358  mapentry_get_real=conv_single_real_to_double(vr)
3359  type is (integer)
3360  mapentry_get_real=conv_single_real_to_double(conv_to_real(vr))
3361  end select

◆ queue_get_real()

real(kind=default_precision) function collections_mod::c_get_real::queue_get_real ( type(queue_type), intent(inout)  specificqueue,
integer, intent(in)  i 
)
private

Returns a specific queue element at an index. Converts between precision and from int.

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

Parameters
specificqueueThe specific queue involved
iThe index to look up
Returns
Double precision real element at i or raises an error if none is found

Definition at line 2681 of file collections.F90.

2681  type(queue_type), intent(inout) :: specificqueue
2682  integer, intent(in) :: i
2683  real(kind=DEFAULT_PRECISION) :: queue_get_real
2684 
2685  class(*), pointer :: generic
2686 
2687  generic=>queue_get_generic(specificqueue, i)
2688  if (.not. associated(generic)) call log_log(log_error, "Can not get real from queue at index "//trim(conv_to_string(i)))
2689  select type(vr=>generic)
2690  type is (real(kind=default_precision))
2691  queue_get_real=vr
2692  type is (real)
2693  queue_get_real=conv_single_real_to_double(vr)
2694  type is (integer)
2695  queue_get_real=conv_single_real_to_double(conv_to_real(vr))
2696  end select

◆ stack_get_real()

real(kind=default_precision) function collections_mod::c_get_real::stack_get_real ( type(stack_type), intent(inout)  specificstack,
integer, intent(in)  i 
)
private

Gets a specific element from the stack at index specified. Converts between precision and from int.

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

Parameters
specificstackThe specific stack involved
iThe index to retrieve the element at
Returns
Double precision real data or raises an error if none is found

Definition at line 2385 of file collections.F90.

2385  type(stack_type), intent(inout) :: specificstack
2386  integer, intent(in) :: i
2387  real(kind=DEFAULT_PRECISION) :: stack_get_real
2388 
2389  class(*), pointer :: generic
2390 
2391  generic=>stack_get_generic(specificstack, i)
2392  if (.not. associated(generic)) call log_log(log_error, "Can not get real from stack at index "//trim(conv_to_string(i)))
2393  select type(vr=>generic)
2394  type is (real(kind=default_precision))
2395  stack_get_real=vr
2396  type is (real)
2397  stack_get_real=conv_single_real_to_double(vr)
2398  type is (integer)
2399  stack_get_real=conv_single_real_to_double(conv_to_real(vr))
2400  end select

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