MONC
Functions/Subroutines
reductionlocation_operator_mod Module Reference

Functions/Subroutines

subroutine, public perform_reductionlocation_operator (io_configuration, field_values, action_attributes, source_monc_location, source_monc, operator_result_values)
 
type(list_type) function, public reductionlocation_operator_get_required_fields (action_attributes)
 
subroutine extract_tripplet_variables (field_str, location_local, val, val_local)
 

Function/Subroutine Documentation

◆ extract_tripplet_variables()

subroutine reductionlocation_operator_mod::extract_tripplet_variables ( character(len=*), intent(in)  field_str,
character(len=*), intent(out)  location_local,
character(len=*), intent(out)  val,
character(len=*), intent(out)  val_local 
)
private

Definition at line 55 of file reductionlocation-operator.F90.

56  character(len=*), intent(in) :: field_str
57  character(len=*), intent(out) :: location_local, val, val_local
58 
59  character :: c
60  character(len=STRING_LENGTH) :: artefacts(3)
61  integer :: i, field_length, start_point, index_loc
62 
63  field_length=len(trim(field_str))
64 
65  start_point=1
66  index_loc=1
67  do i=1, field_length
68  c=field_str(i:i)
69  if (c .eq. ",") then
70  artefacts(index_loc)=trim(adjustl(field_str(start_point: i-1)))
71  start_point=i+1
72  index_loc=index_loc+1
73  end if
74  end do
75  if (start_point .lt. i) artefacts(index_loc)=trim(adjustl(field_str(start_point: i-1)))
76  location_local=artefacts(1)
77  val=artefacts(2)
78  val_local=artefacts(3)
Here is the caller graph for this function:

◆ perform_reductionlocation_operator()

subroutine, public reductionlocation_operator_mod::perform_reductionlocation_operator ( type(io_configuration_type), intent(inout)  io_configuration,
type(hashmap_type), intent(inout)  field_values,
type(map_type), intent(inout)  action_attributes,
integer, intent(in)  source_monc_location,
integer, intent(in)  source_monc,
real(kind=default_precision), dimension(:), intent(inout), allocatable  operator_result_values 
)

Definition at line 15 of file reductionlocation-operator.F90.

17  type(io_configuration_type), intent(inout) :: io_configuration
18  type(hashmap_type), intent(inout) :: field_values
19  type(map_type), intent(inout) :: action_attributes
20  integer, intent(in) :: source_monc_location, source_monc
21  real(kind=default_precision), dimension(:), allocatable, intent(inout) :: operator_result_values
22 
23  character(len=STRING_LENGTH) :: location_local, val, val_local
24  type(data_values_type), pointer :: val_local_values, val_values, location_local_values
25  integer :: i
26 
27  call extract_tripplet_variables(get_action_attribute_string(action_attributes, "input"), location_local, val, val_local)
28 
29  val_local_values=>get_data_value_by_field_name(field_values, val_local)
30  val_values=>get_data_value_by_field_name(field_values, val)
31  location_local_values=>get_data_value_by_field_name(field_values, location_local)
32 
33  allocate(operator_result_values(size(location_local_values%values)))
34  do i=1, size(val_local_values%values)
35  if (val_local_values%values(i) .eq. val_values%values(i)) then
36  operator_result_values(i)=location_local_values%values(i)
37  else
38  operator_result_values(i)=-1.0_default_precision
39  end if
40  end do
Here is the call graph for this function:

◆ reductionlocation_operator_get_required_fields()

type(list_type) function, public reductionlocation_operator_mod::reductionlocation_operator_get_required_fields ( type(map_type), intent(inout)  action_attributes)

Definition at line 43 of file reductionlocation-operator.F90.

44  type(map_type), intent(inout) :: action_attributes
45 
46  character(len=STRING_LENGTH) :: location_local, val, val_local
47 
48  call extract_tripplet_variables(get_action_attribute_string(action_attributes, "input"), location_local, val, val_local)
49 
50  call c_add_string(reductionlocation_operator_get_required_fields, location_local)
51  call c_add_string(reductionlocation_operator_get_required_fields, val)
52  call c_add_string(reductionlocation_operator_get_required_fields, val_local)
Here is the call graph for this function:
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