MONC
Functions/Subroutines
test_q_indices_mod Module Reference

Functions/Subroutines

subroutine test_get_q_index
 
subroutine test_q_indices_set
 
subroutine test_q_indices_limits
 

Function/Subroutine Documentation

◆ test_get_q_index()

subroutine test_q_indices_mod::test_get_q_index

Definition at line 12 of file test_q_indices.F90.

13  character(7), parameter :: name='First'
14  integer :: numActive,index
15  index = get_q_index(name)
16  numactive = get_number_active_q_indices()
17 
18  call assert_equals(1, numactive, "First element")
19  ! add the same element for second time
20  index = get_q_index(name)
21  numactive = get_number_active_q_indices()
22  call assert_equals(1, numactive, "Repeated element")
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_q_indices_limits()

subroutine test_q_indices_mod::test_q_indices_limits

Definition at line 45 of file test_q_indices.F90.

46  integer :: numActive,new_numActive,index
47  !number of elements active before
48  numactive = get_number_active_q_indices()
49  !set new value out of range
50  call set_q_index(101,"Limit")
51  !number of elements active after
52  new_numactive = get_number_active_q_indices()
53  !check the number of active elements has not changed
54  call assert_equals(new_numactive, numactive, "Out of range element")
55 
Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_q_indices_set()

subroutine test_q_indices_mod::test_q_indices_set

Definition at line 26 of file test_q_indices.F90.

27  type(q_metadata_type) :: descriptor
28  character(7), parameter :: name='Set'
29  integer :: numActive,new_numActive,index
30  index = get_q_index(name)
31  numactive = get_number_active_q_indices()
32 
33  ! add the same element for second time
34  call set_q_index(index,"New")
35  new_numactive = get_number_active_q_indices()
36  call assert_equals(new_numactive, numactive, "Overwritten element")
37 
38  ! we expect to have overwritten the previous descriptor
39  descriptor = get_indices_descriptor(index)
40  call assert_equals("New",descriptor%name,"Check name of set element")
Here is the call graph for this function:
Here is the caller graph for this function: