Performs the actual field slicing.
27 type(io_configuration_type),
intent(inout) :: io_configuration
28 type(hashmap_type),
intent(inout) :: field_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
36 type(data_values_type),
pointer :: field_local_values
37 type(io_configuration_field_type) :: corresponding_field_definition
39 field_to_slice=get_action_attribute_string(action_attributes,
"field")
41 if (get_prognostic_field_configuration(io_configuration, field_to_slice,
"", corresponding_field_definition))
then
42 dimension_to_slice=get_dimension_to_slice(action_attributes)
43 index_to_slice=get_action_attribute_integer(action_attributes,
"index")
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
47 field_local_values=>get_data_value_by_field_name(field_values, field_to_slice)
49 call determine_dimension_bounds(corresponding_field_definition, io_configuration%registered_moncs(source_monc_location), &
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)