34 character,
dimension(:),
intent(in) :: data
35 integer,
intent(inout) :: start_point
48 character,
dimension(:),
intent(in) :: data
49 integer,
intent(inout) :: start_point
62 character,
dimension(:),
intent(in) :: data
63 integer,
intent(inout) :: start_point
75 character,
dimension(:),
intent(in) :: data
76 integer,
intent(inout) :: start_point
89 character,
dimension(:),
intent(in) :: data
90 integer,
intent(inout) :: start_point
102 character(len=*),
intent(in) :: field_name
105 "You must provide the field name in the collective operation configuration")
115 character(len=*),
intent(in) :: field_name
117 character(len=STRING_LENGTH) :: str_val
129 character(len=*),
intent(in) :: field_name
131 if (
c_contains(action_attributes, field_name))
then 147 integer,
intent(in) :: source, data_id
148 character(len=*),
intent(in) :: key
150 integer :: start_index, end_index, monc_location
151 class(*),
pointer :: generic
155 generic=>
c_get_generic(io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), key)
156 if (.not.
associated(generic))
then 161 generic=>
c_get_generic(io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), key)
162 if (.not.
associated(generic))
then 166 end_index=conv_to_integer(generic, .false.)
177 integer function get_field_size(field_starts, field_ends, key, data_type)
178 type(map_type),
intent(inout) :: field_starts, field_ends
179 character(len=*),
intent(in) :: key
180 integer,
intent(in) :: data_type
182 integer :: start_index, end_index, element_size
183 real(kind=DOUBLE_PRECISION) :: dreal
184 real(kind=SINGLE_PRECISION) :: sreal
186 start_index=c_get_integer(field_starts, key)
187 end_index=c_get_integer(field_ends, key)
189 if (data_type == integer_data_type)
then 190 element_size=kind(start_index)
191 else if (data_type == double_data_type)
then 192 element_size=kind(dreal)
193 else if (data_type == float_data_type)
then 194 element_size=kind(sreal)
195 else if (data_type == string_data_type)
then 196 element_size=string_length
207 type(map_type) function get_map(field_starts, field_ends, data_dump, key)
208 type(map_type),
intent(inout) :: field_starts, field_ends
209 character,
dimension(:),
allocatable,
intent(in) :: data_dump
210 character(len=*),
intent(in) :: key
212 integer :: start_index, end_index, elements, i
213 character(len=STRING_LENGTH) :: retrieved1, retrieved2
215 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
216 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
218 start_index=c_get_integer(field_starts, key)
219 end_index=c_get_integer(field_ends, key)
221 elements = (end_index+1 - start_index) / (string_length*2)
224 retrieved1=transfer(data_dump(start_index:start_index+string_length-1), retrieved1)
225 start_index=start_index+string_length
226 retrieved2=transfer(data_dump(start_index:start_index+string_length-1), retrieved2)
227 start_index=start_index+string_length
228 call c_put_string(
get_map, retrieved1, retrieved2)
239 type(map_type) function get_map_from_monc(io_configuration, source, data_id, data_dump, key)
240 type(io_configuration_type),
intent(inout) :: io_configuration
241 integer,
intent(in) :: source, data_id
242 character,
dimension(:),
allocatable,
intent(in) :: data_dump
243 character(len=*),
intent(in) :: key
245 integer :: monc_location
247 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
250 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
259 function get_string(field_starts, field_ends, data_dump, key)
260 type(map_type),
intent(inout) :: field_starts, field_ends
261 character,
dimension(:),
allocatable,
intent(in) :: data_dump
262 character(len=*),
intent(in) :: key
263 character(len=STRING_LENGTH) :: get_string
265 integer :: start_index, end_index
267 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
268 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
270 start_index=c_get_integer(field_starts, key)
271 end_index=c_get_integer(field_ends, key)
284 type(io_configuration_type),
intent(inout) :: io_configuration
285 integer,
intent(in) :: source, data_id
286 character,
dimension(:),
allocatable,
intent(in) :: data_dump
287 character(len=*),
intent(in) :: key
288 character(len=STRING_LENGTH) :: get_string_from_monc
290 integer :: monc_location
292 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
294 get_string_from_monc=
get_string(io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
295 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
305 type(map_type),
intent(inout) :: field_starts, field_ends
306 character,
dimension(:),
allocatable,
intent(in) :: data_dump
307 character(len=*),
intent(in) :: key
309 integer :: start_index, end_index
311 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
312 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
314 start_index=c_get_integer(field_starts, key)
315 end_index=c_get_integer(field_ends, key)
328 type(io_configuration_type),
intent(inout) :: io_configuration
329 integer,
intent(in) :: source, data_id
330 character,
dimension(:),
allocatable,
intent(in) :: data_dump
331 character(len=*),
intent(in) :: key
333 integer :: monc_location
335 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
338 io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
339 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
349 type(map_type),
intent(inout) :: field_starts, field_ends
350 character,
dimension(:),
allocatable,
intent(in) :: data_dump
351 character(len=*),
intent(in) :: key
353 integer :: start_index, end_index
355 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
356 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
358 start_index=c_get_integer(field_starts, key)
359 end_index=c_get_integer(field_ends, key)
372 type(io_configuration_type),
intent(inout) :: io_configuration
373 integer,
intent(in) :: source, data_id
374 character,
dimension(:),
allocatable,
intent(in) :: data_dump
375 character(len=*),
intent(in) :: key
377 integer :: monc_location
379 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
382 io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
383 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
392 real(kind=DOUBLE_PRECISION) function get_scalar_real(field_starts, field_ends, data_dump, key)
393 type(map_type),
intent(inout) :: field_starts, field_ends
394 character,
dimension(:),
allocatable,
intent(in) :: data_dump
395 character(len=*),
intent(in) :: key
397 integer :: start_index, end_index
399 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
400 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
402 start_index=c_get_integer(field_starts, key)
403 end_index=c_get_integer(field_ends, key)
416 type(io_configuration_type),
intent(inout) :: io_configuration
417 integer,
intent(in) :: source, data_id
418 character,
dimension(:),
allocatable,
intent(in) :: data_dump
419 character(len=*),
intent(in) :: key
421 integer :: monc_location
423 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
426 io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
427 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
438 type(map_type),
intent(inout) :: field_starts, field_ends
439 character,
dimension(:),
allocatable,
intent(in) :: data_dump
440 character(len=*),
intent(in) :: key
441 real(kind=DOUBLE_PRECISION),
dimension(:),
allocatable :: get_array_double
443 integer :: start_index, end_index, elements, start_e, end_e, current_start_index, current_end_index
445 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
446 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
448 start_index=c_get_integer(field_starts, key)
449 end_index=c_get_integer(field_ends, key)
451 elements = ceiling((end_index - start_index) /
real(kind(
get_array_double)))
455 current_start_index=start_index
456 do while (current_start_index .lt. end_index)
458 if (current_end_index .gt. end_index) current_end_index=end_index
460 end_e=ceiling((current_end_index-start_index)/real(kind(get_array_double)))
478 type(io_configuration_type),
intent(inout) :: io_configuration
479 integer,
intent(in) :: source, data_id
480 character,
dimension(:),
allocatable,
intent(in) :: data_dump
481 character(len=*),
intent(in) :: key
482 real(kind=DOUBLE_PRECISION),
dimension(:),
allocatable :: get_array_double_from_monc
484 integer :: monc_location
486 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
489 io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
490 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
501 type(map_type),
intent(inout) :: field_starts, field_ends
502 character,
dimension(:),
allocatable,
intent(in) :: data_dump
503 character(len=*),
intent(in) :: key
504 integer,
dimension(:),
allocatable :: get_array_integer
506 integer :: start_index, end_index, elements
508 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
509 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
511 start_index=c_get_integer(field_starts, key)
512 end_index=c_get_integer(field_ends, key)
529 type(io_configuration_type),
intent(inout) :: io_configuration
530 integer,
intent(in) :: source, data_id
531 character,
dimension(:),
allocatable,
intent(in) :: data_dump
532 character(len=*),
intent(in) :: key
533 integer,
dimension(:),
allocatable :: get_array_integer_from_monc
535 integer :: monc_location
537 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
540 io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
541 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key)
557 type(io_configuration_type),
intent(inout) :: io_configuration
558 integer,
intent(in) :: source, data_id, size1, size2
559 character,
dimension(:),
allocatable,
intent(in) :: data_dump
560 character(len=*),
intent(in) :: key
561 real(kind=DOUBLE_PRECISION),
dimension(:,:),
pointer,
contiguous,
intent(inout) :: target_data
563 integer :: monc_location
565 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
567 call get_2darray_double(io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
568 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key, target_data, &
583 subroutine get_2darray_double(field_starts, field_ends, data_dump, key, target_data, size1, size2)
584 type(map_type),
intent(inout) :: field_starts, field_ends
585 integer,
intent(in) :: size1, size2
586 character,
dimension(:),
allocatable,
intent(in) :: data_dump
587 character(len=*),
intent(in) :: key
588 real(kind=DOUBLE_PRECISION),
dimension(:,:),
pointer,
contiguous,
intent(inout) :: target_data
590 integer :: start_index, end_index, element_size
591 real(kind=DOUBLE_PRECISION),
dimension(:),
pointer :: temp_data
594 temp_data(1:size1*size2)=>target_data
596 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
597 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
599 start_index=c_get_integer(field_starts, key)
600 end_index=c_get_integer(field_ends, key)
602 element_size=(end_index-start_index) / kind(target_data)
604 temp_data=transfer(data_dump(start_index:end_index), temp_data)
619 subroutine get_3darray_double(field_starts, field_ends, data_dump, key, target_data, size1, size2, size3)
620 type(map_type),
intent(inout) :: field_starts, field_ends
621 integer,
intent(in) :: size1, size2, size3
622 character,
dimension(:),
allocatable,
intent(in) :: data_dump
623 character(len=*),
intent(in) :: key
624 real(kind=DOUBLE_PRECISION),
dimension(:,:,:),
pointer,
contiguous,
intent(inout) :: target_data
626 integer :: start_index, end_index, element_size
627 real(kind=DOUBLE_PRECISION),
dimension(:),
pointer :: temp_data
630 temp_data(1:size1*size2*size3)=>target_data
632 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
633 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
635 start_index=c_get_integer(field_starts, key)
636 end_index=c_get_integer(field_ends, key)
638 element_size=(end_index-start_index) / kind(target_data)
640 temp_data=transfer(data_dump(start_index:end_index), temp_data)
657 type(io_configuration_type),
intent(inout) :: io_configuration
658 integer,
intent(in) :: source, data_id, size1, size2, size3
659 character,
dimension(:),
allocatable,
intent(in) :: data_dump
660 character(len=*),
intent(in) :: key
661 real(kind=DOUBLE_PRECISION),
dimension(:,:,:),
pointer,
contiguous,
intent(inout) :: target_data
663 integer :: monc_location
665 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
667 call get_3darray_double(io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
668 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key, target_data, &
685 subroutine get_4darray_double(field_starts, field_ends, data_dump, key, target_data, size1, size2, size3, size4)
686 type(map_type),
intent(inout) :: field_starts, field_ends
687 integer,
intent(in) :: size1, size2, size3, size4
688 character,
dimension(:),
allocatable,
intent(in) :: data_dump
689 character(len=*),
intent(in) :: key
690 real(kind=DOUBLE_PRECISION),
dimension(:,:,:,:),
pointer,
contiguous,
intent(inout) :: target_data
692 integer :: start_index, end_index, element_size
693 real(kind=DOUBLE_PRECISION),
dimension(:),
pointer :: temp_data
696 temp_data(1:size1*size2*size3*size4)=>target_data
698 if (.not. c_contains(field_starts, key) .or. .not. c_contains(field_ends, key)) &
699 call log_log(log_error,
"Field name `"//key//
"` not found in the data definition")
701 start_index=c_get_integer(field_starts, key)
702 end_index=c_get_integer(field_ends, key)
704 element_size=(end_index-start_index) / kind(target_data)
706 temp_data=transfer(data_dump(start_index:end_index), temp_data)
725 type(io_configuration_type),
intent(inout) :: io_configuration
726 integer,
intent(in) :: source, data_id, size1, size2, size3, size4
727 character,
dimension(:),
allocatable,
intent(in) :: data_dump
728 character(len=*),
intent(in) :: key
729 real(kind=DOUBLE_PRECISION),
dimension(:,:,:,:),
pointer,
contiguous,
intent(inout) :: target_data
731 integer :: monc_location
733 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
735 call get_4darray_double(io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), &
736 io_configuration%registered_moncs(monc_location)%field_end_locations(data_id), data_dump, key, target_data, &
737 size1, size2, size3, size4)
subroutine, public get_2darray_double(field_starts, field_ends, data_dump, key, target_data, size1, size2)
Retreives a 2D array of doubles with a corresponding key from the raw data dump. The size depends on ...
integer function, dimension(:), allocatable, public get_array_integer_from_monc(io_configuration, source, data_id, data_dump, key)
Retreives an array of integers with a corresponding key from the raw data dump. The size depends on t...
Gets a specific generic element out of the list, stack, queue or map with the corresponding key...
real(kind=double_precision) function, dimension(:), allocatable, public get_array_double(field_starts, field_ends, data_dump, key)
Retreives an array of doubles with a corresponding key from the raw data dump. The size depends on th...
Overall IO configuration.
integer, parameter, public float_data_type
logical function, public unpack_scalar_logical_from_bytedata(data, start_point)
Unpacks a scalar logical from some byte data, this is a very simple unpack routine wrapping the trans...
integer, parameter, public log_error
Only log ERROR messages.
integer, parameter, public boolean_data_type
Contains functionality for managing and extracting data from the raw data dumps that the IO server re...
subroutine, public get_3darray_double(field_starts, field_ends, data_dump, key, target_data, size1, size2, size3)
Retreives a 3D array of doubles with a corresponding key from the raw data dump. The size depends on ...
logical function, public get_scalar_logical_from_monc(io_configuration, source, data_id, data_dump, key)
Retrieves a single logical element (scalar) from the data dump.
integer function, public get_action_attribute_integer(action_attributes, field_name)
Retrieves the name of a field from the attributes specified in the configuration. ...
subroutine, public get_4darray_double_from_monc(io_configuration, source, data_id, data_dump, key, target_data, size1, size2, size3, size4)
Retreives a 4D array of doubles with a corresponding key from the raw data dump. The size depends on ...
subroutine, public get_3darray_double_from_monc(io_configuration, source, data_id, data_dump, key, target_data, size1, size2, size3)
Retreives a 3D array of doubles with a corresponding key from the raw data dump. The size depends on ...
Contains common definitions for the data and datatypes used by MONC.
type(map_type) function, public get_map(field_starts, field_ends, data_dump, key)
Retrieves a map data structure with key->value pairs, each of which are strings.
Gets a specific integer element out of the list, stack, queue or map with the corresponding key...
Conversion between common inbuilt FORTRAN data types.
integer, parameter, public double_data_type
character(len=string_length) function, public get_string_from_monc(io_configuration, source, data_id, data_dump, key)
Retrieves a string from the data dump.
Converts data types to strings.
integer, parameter, public single_precision
Single precision (32 bit) kind.
Puts a string key-value pair into the map.
integer, parameter array_step_threshold
subroutine, public get_4darray_double(field_starts, field_ends, data_dump, key, target_data, size1, size2, size3, size4)
Retreives a 4D array of doubles with a corresponding key from the raw data dump. The size depends on ...
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...
real(kind=double_precision) function, dimension(:), allocatable, public get_array_double_from_monc(io_configuration, source, data_id, data_dump, key)
Retreives an array of doubles with a corresponding key from the raw data dump. The size depends on th...
integer function, dimension(:), allocatable, public get_array_integer(field_starts, field_ends, data_dump, key)
Retreives an array of integers with a corresponding key from the raw data dump. The size depends on t...
integer, parameter, public double_precision
Double precision (64 bit) kind.
integer, parameter, public string_data_type
This defines some constants and procedures that are useful to the IO server and clients that call it...
integer, parameter, public integer_data_type
logical function, public is_field_present(io_configuration, source, data_id, key)
Map data structure that holds string (length 20 maximum) key value pairs.
real(kind=double_precision) function, public unpack_scalar_dp_real_from_bytedata(data, start_point)
Unpacks a double precision scalar real from some byte data, this is a very simple unpack routine wrap...
integer function, public get_field_size(field_starts, field_ends, key, data_type)
Retrieves the size of a field from the data definition.
Collection data structures.
character(len=string_length) function, public unpack_scalar_string_from_bytedata(data, start_point)
Unpacks a string from some byte data with default length, this is a very simple unpack routine wrappi...
Determines whether a data item can be represented as an integer or not.
integer, parameter, public string_length
Default length of strings.
logical function, public get_action_attribute_logical(action_attributes, field_name)
Retrieves a logical value from the attribute which corresponds to a specific key. ...
character(len=string_length) function, public get_string(field_starts, field_ends, data_dump, key)
Retrieves a string from the data dump.
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. ...
integer function, public unpack_scalar_integer_from_bytedata(data, start_point)
Unpacks a scalar integer from some byte data, this is a very simple unpack routine wrapping the trans...
logical function, public get_scalar_logical(field_starts, field_ends, data_dump, key)
Retrieves a single logical element (scalar) from the data dump.
real function, public unpack_scalar_real_from_bytedata(data, start_point)
Unpacks a scalar real from some byte data, this is a very simple unpack routine wrapping the transfer...
real(kind=double_precision) function, public get_scalar_real(field_starts, field_ends, data_dump, key)
Retreives a scalar real with a corresponding key from the raw data dump.
subroutine, public get_2darray_double_from_monc(io_configuration, source, data_id, data_dump, key, target_data, size1, size2)
Retreives a 2D array of doubles with a corresponding key from the raw data dump. The size depends on ...
integer function, public get_scalar_integer_from_monc(io_configuration, source, data_id, data_dump, key)
Retrieves a single integer element (scalar) from the data dump.
real(kind=double_precision) function, public get_scalar_real_from_monc(io_configuration, source, data_id, data_dump, key)
Retreives a scalar real with a corresponding key from the raw data dump.
Converts data types to integers.
Determines whether or not a map contains a specific key.
Gets a specific string element out of the list, stack, queue or map with the corresponding key...
Parses the XML configuration file to produce the io configuration description which contains the data...
integer function, public get_scalar_integer(field_starts, field_ends, data_dump, key)
Retrieves a single integer element (scalar) from the data dump.
type(map_type) function, public get_map_from_monc(io_configuration, source, data_id, data_dump, key)
Retrieves a map data structure with key->value pairs, each of which are strings.