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
101 type(map_type),
intent(inout) :: action_attributes
102 character(len=*),
intent(in) :: field_name
104 if (.not. c_contains(action_attributes, field_name))
call log_log(log_error, &
105 "You must provide the field name in the collective operation configuration")
114 type(map_type),
intent(inout) :: action_attributes
115 character(len=*),
intent(in) :: field_name
117 character(len=STRING_LENGTH) :: str_val
120 if (.not. conv_is_integer(str_val))
call log_log(log_error,
"Can not convert string '"//trim(str_val)//
"' to an integer")
128 type(map_type),
intent(inout) :: action_attributes
129 character(len=*),
intent(in) :: field_name
131 if (c_contains(action_attributes, field_name))
then
146 type(io_configuration_type),
intent(inout) :: io_configuration
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
153 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
155 generic=>c_get_generic(io_configuration%registered_moncs(monc_location)%field_start_locations(data_id), key)
156 if (.not.
associated(generic))
then
160 start_index=conv_to_integer(generic, .false.)
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.)
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)
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
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
290 integer :: monc_location
292 monc_location=c_get_integer(io_configuration%monc_to_index, conv_to_string(source))
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
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
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
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
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
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, &
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)