21 real(DEFAULT_PRECISION),
dimension(:) :: values
22 character(len=STRING_LENGTH) :: field_name
40 integer,
intent(in) :: message_tag
41 procedure(handle_recv_data_from_io_server) :: handling_procedure
42 character(len=*),
intent(in) :: name
46 io_configuration%number_inter_io_communications=io_configuration%number_inter_io_communications+1
48 if (io_configuration%number_inter_io_communications .gt.
size(io_configuration%inter_io_communications))
then 52 new_index=io_configuration%number_inter_io_communications
53 io_configuration%inter_io_communications(new_index)%message_tag=message_tag+
starting_tag 54 io_configuration%inter_io_communications(new_index)%handling_procedure=>handling_procedure
55 io_configuration%inter_io_communications(new_index)%name=name
64 character(len=*),
intent(in) :: name
68 do i=1, io_configuration%number_inter_io_communications
69 if (io_configuration%inter_io_communications(i)%name .eq. name)
then 84 character(len=STRING_LENGTH),
intent(in) :: field_name
85 integer,
intent(in) :: timestep
86 integer,
intent(in),
optional :: other_int
87 real(kind=DEFAULT_PRECISION),
dimension(:),
intent(in) :: field_values
88 character,
dimension(:),
allocatable :: package_inter_io_communication_message
90 integer :: current_location
92 allocate(package_inter_io_communication_message(
string_length+8+(8*
size(field_values))))
94 current_location=
pack_scalar_field(package_inter_io_communication_message, 1, string_value=field_name)
95 current_location=
pack_scalar_field(package_inter_io_communication_message, current_location, int_value=timestep)
96 if (
present(other_int))
then 97 current_location=
pack_scalar_field(package_inter_io_communication_message, current_location, int_value=other_int)
99 current_location=
pack_array_field(package_inter_io_communication_message, current_location, real_array_1d=field_values)
110 character,
dimension(:),
intent(in) :: data_buffer
111 character(len=STRING_LENGTH),
intent(out) :: field_name
112 integer,
intent(out) :: timestep
113 integer,
intent(out),
optional :: other_int
114 real(kind=DEFAULT_PRECISION),
dimension(:),
allocatable,
intent(out) :: field_values
116 integer :: values_entries
120 allocate(field_values(values_entries))
121 field_name=transfer(data_buffer(1:
string_length), field_name)
124 field_values=transfer(data_buffer(
string_length+9:), field_values)
Configuration of a specific data definition.
integer function forthread_rwlock_init(rwlock_id, attr_id)
Overall IO configuration.
character function, dimension(:), allocatable, public package_inter_io_communication_message(field_name, timestep, field_values, other_int)
Packages up fields into an io binary message (allocated here) which is used for sending.
integer, parameter, public data_size_stride
integer, parameter, public default_precision
MPI communication type which we use for the prognostic and calculation data.
integer function forthread_rwlock_rdlock(lock_id)
Contains common definitions for the data and datatypes used by MONC.
integer function forthread_mutex_init(mutex_id, attr_id)
integer function forthread_rwlock_wrlock(lock_id)
This defines some constants and procedures that are useful to the IO server and clients that call it...
This is a thread pool and the single management "main" thread will spawn out free threads in the pool...
subroutine, public check_thread_status(ierr)
Checks the error status of any thread operation and reports an error if it failed.
subroutine, public extend_inter_io_comm_array(io_configuration)
Extends the array of inter io communications from its current suze to current size+data_stride+curren...
integer, parameter, public string_length
Default length of strings.
subroutine, public unpackage_inter_io_communication_message(data_buffer, field_name, timestep, field_values, other_int)
Unpackages some binary data into its individual fields. The field values are allocated here and the s...
Inter IO server communication specific functionality. This manages all of the communication that migh...
integer function forthread_rwlock_destroy(rwlock_id)
integer function, public find_inter_io_from_name(io_configuration, name)
Locates a the index of an inter IO entry from the operator name or returns 0 if none is found...
integer function, public pack_array_field(buffer, start_offset, int_array, real_array_1d, real_array_2d, real_array_3d, real_array_4d)
Packs an array field into the sending buffer.
integer function forthread_rwlock_unlock(lock_id)
subroutine, public register_inter_io_communication(io_configuration, message_tag, handling_procedure, name)
Registers an inter IO communication operation.
Parses the XML configuration file to produce the io configuration description which contains the data...
integer function, public pack_scalar_field(buffer, start_offset, int_value, real_value, single_real_value, double_real_value, string_value, logical_value)
Packs the data of a scalar field into a buffer.