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)
129 type(
list_type) function fieldslicer_operator_get_required_fields(action_attributes)
132 character(len=STRING_LENGTH) :: field_to_slice
135 call c_add_string(fieldslicer_operator_get_required_fields, 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 Slices a field based upon the selected dimension and index.
Overall IO configuration.
integer, parameter, public log_error
Only log ERROR messages.
subroutine, public perform_fieldslicer_operator(io_configuration, field_values, action_attributes, source_monc_location, source_monc, operator_result_values)
Performs the actual field slicing.
integer function get_dimension_to_slice(action_attributes)
Retrieves the integer index of the dimension to slice.
integer function convert_dimension_str_to_id(dim_str)
Converts a dimension string to the corresponding numeric ID.
Contains functionality for managing and extracting data from the raw data dumps that the IO server re...
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
integer, parameter, public z_index
Grid index parameters.
integer function, public get_action_attribute_integer(action_attributes, field_name)
Retrieves the name of a field from the attributes specified in the configuration. ...
Contains common definitions for the data and datatypes used by MONC.
A hashmap structure, the same as a map but uses hashing for greatly improved performance when storing...
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...
logical function, public get_prognostic_field_configuration(io_configuration, field_name, field_namespace, prognostic_config, prognostic_containing_data_defn)
Retrieves the prognostic field configuration corresponding to a specific field name and returns wheth...
Map data structure that holds string (length 20 maximum) key value pairs.
subroutine determine_dimension_bounds(corresponding_field_definition, registered_monc_info, dimension_to_slice, index_to_slice, dim_starts, dim_ends, dim_weights, number_dims, sliced_size)
Determines the bounds for each dimension which is specified via the configuration file...
Collection data structures.
Configuration that representes the state of a registered MONC process.
integer, parameter, public string_length
Default length of strings.
type(list_type) function, public fieldslicer_operator_get_required_fields(action_attributes)
Retrieves a list of the required fields for running this operator.
character(len=string_length) function, public get_action_attribute_string(action_attributes, field_name)
Retrieves the name of a field from the attributes specified in the configuration. ...
List data structure which implements a doubly linked list. This list will preserve its order...
Functionality to support the different types of grid and abstraction between global grids and local o...
Configuration associated with the representation of a specific data field.
Adds a string to the end of the list.
integer, parameter, public y_index
Parses the XML configuration file to produce the io configuration description which contains the data...
integer, parameter, public x_index