26 source_monc, operator_result_values)
29 type(
map_type),
intent(inout) :: action_attributes
30 integer,
intent(in) :: source_monc_location, source_monc
31 real(kind=
default_precision),
dimension(:),
allocatable,
intent(inout) :: operator_result_values
33 character(len=STRING_LENGTH) :: field_to_slice
34 integer :: i, j, dimension_to_slice, index_to_slice, number_dims, sliced_size, source_dim
35 integer,
dimension(:),
allocatable :: dim_starts, dim_ends, dim_weights, indexes
45 if (io_configuration%registered_moncs(source_monc_location)%local_dim_starts(dimension_to_slice) .le. index_to_slice .and.&
46 io_configuration%registered_moncs(source_monc_location)%local_dim_ends(dimension_to_slice) .ge. index_to_slice)
then
50 dimension_to_slice, index_to_slice, dim_starts, dim_ends, dim_weights, number_dims, sliced_size)
52 allocate(operator_result_values(sliced_size), indexes(number_dims))
57 source_dim=source_dim+(indexes(j)-1)*dim_weights(j)
59 operator_result_values(i)=field_local_values%values(source_dim)
60 indexes(1)=indexes(1)+1
62 if (indexes(j) .gt. dim_ends(j))
then
63 indexes(j)=dim_starts(j)
64 if (j .lt. number_dims) indexes(j+1)=indexes(j+1)+1
68 deallocate(dim_starts, dim_ends, dim_weights, indexes)
84 index_to_slice, dim_starts, dim_ends, dim_weights, number_dims, sliced_size)
87 integer,
intent(in) :: dimension_to_slice, index_to_slice
88 integer,
dimension(:),
allocatable,
intent(out) :: dim_starts, dim_ends, dim_weights
89 integer,
intent(out) :: number_dims, sliced_size
91 integer :: i, j, dimension_id, amount_to_add
92 integer,
dimension(:),
allocatable :: dim_sizes
93 logical :: found_slice_field
95 number_dims=corresponding_field_definition%dimensions
96 allocate(dim_sizes(number_dims), dim_starts(number_dims), dim_ends(number_dims), dim_weights(number_dims))
97 found_slice_field=.false.
101 if (dimension_id==dimension_to_slice)
then
103 dim_starts(i)=index_to_slice
104 dim_ends(i)=index_to_slice
105 found_slice_field=.true.
107 dim_sizes(i)=registered_monc_info%local_dim_sizes(dimension_id)
109 dim_ends(i)=registered_monc_info%local_dim_sizes(dimension_id)
112 if (.not. found_slice_field)
call log_log(
log_error,
"Can not find dimension to slice in provided field")
118 if (j .lt. i) dim_weights(i)=dim_weights(i)*registered_monc_info%local_dim_sizes(j)
119 amount_to_add=amount_to_add*dim_sizes(j)
121 sliced_size=sliced_size+amount_to_add
123 deallocate(dim_sizes)
130 type(
map_type),
intent(inout) :: action_attributes
132 character(len=STRING_LENGTH) :: field_to_slice
141 type(map_type),
intent(inout) :: action_attributes
150 character(len=STRING_LENGTH),
intent(in) :: dim_str
152 if (dim_str .eq.
"x")
then
154 else if (dim_str .eq.
"y")
then
156 else if (dim_str .eq.
"z")
then