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

Pops a double precision real element off the stack or queue. More...

Private Member Functions

real(kind=default_precision) function stack_pop_real (specificstack)
 Pops an element off the stack (LIFO). Converts between precision and from int. More...
 
real(kind=default_precision) function queue_pop_real (specificqueue)
 Pops the queue element off the head of the queue (FIFO). Converts between precision and from int. More...
 

Detailed Description

Pops a double precision real element off the stack or queue.

This has a time complexity of O(1)

Parameters
collectionThe specific stack or queue involved
Returns
Double precision real element which has been popped off the collection or raises and error if none is found

Definition at line 185 of file collections.F90.

Member Function/Subroutine Documentation

◆ queue_pop_real()

real(kind=default_precision) function collections_mod::c_pop_real::queue_pop_real ( type(queue_type), intent(inout)  specificqueue)
private

Pops the queue element off the head of the queue (FIFO). 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
Returns
Double precision real element at head of the queue or raises an error if there is none

Definition at line 2591 of file collections.F90.

2592  type(queue_type), intent(inout) :: specificqueue
2593  real(kind=default_precision) :: queue_pop_real
2594 
2595  class(*), pointer :: generic
2596 
2597  generic=>queue_pop_generic(specificqueue)
2598  if (.not. associated(generic)) call log_log(log_error, "Can not pop real from queue")
2599  select type(vr=>generic)
2600  type is (real(kind=default_precision))
2601  queue_pop_real=vr
2602  type is (real)
2603  queue_pop_real=conv_single_real_to_double(vr)
2604  type is (integer)
2605  queue_pop_real=conv_single_real_to_double(conv_to_real(vr))
2606  end select

◆ stack_pop_real()

real(kind=default_precision) function collections_mod::c_pop_real::stack_pop_real ( type(stack_type), intent(inout)  specificstack)
private

Pops an element off the stack (LIFO). 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
Returns
Double precision real data of the last element added to the stack or raises an error if none is found

Definition at line 2295 of file collections.F90.

2296  type(stack_type), intent(inout) :: specificstack
2297  real(kind=default_precision) :: stack_pop_real
2298 
2299  class(*), pointer :: generic
2300 
2301  generic=>stack_pop_generic(specificstack)
2302  if (.not. associated(generic)) call log_log(log_error, "Can not pop real from stack")
2303  select type(vr=>generic)
2304  type is (real(kind=default_precision))
2305  stack_pop_real=vr
2306  type is (real)
2307  stack_pop_real=conv_single_real_to_double(vr)
2308  type is (integer)
2309  stack_pop_real=conv_single_real_to_double(conv_to_real(vr))
2310  end select

The documentation for this interface was generated from the following file:
logging_mod::log_error
integer, parameter, public log_error
Only log ERROR messages.
Definition: logging.F90:11
logging_mod::log_log
subroutine, public log_log(level, message, str)
Logs a message at the specified level. If the level is above the current level then the message is ig...
Definition: logging.F90:75
datadefn_mod::default_precision
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
Definition: datadefn.F90:17