dm_observ Module

The observation data derived type declaration, and all associated procedures.


Uses

  • module~~dm_observ~~UsesGraph module~dm_observ dm_observ module~dm_error dm_error module~dm_observ->module~dm_error module~dm_id dm_id module~dm_observ->module~dm_id module~dm_kind dm_kind module~dm_observ->module~dm_kind module~dm_node dm_node module~dm_observ->module~dm_node module~dm_request dm_request module~dm_observ->module~dm_request module~dm_response dm_response module~dm_observ->module~dm_response module~dm_sensor dm_sensor module~dm_observ->module~dm_sensor module~dm_target dm_target module~dm_observ->module~dm_target module~dm_time dm_time module~dm_observ->module~dm_time module~dm_util dm_util module~dm_observ->module~dm_util module~dm_uuid dm_uuid module~dm_observ->module~dm_uuid module~dm_error->module~dm_kind module~dm_ascii dm_ascii module~dm_error->module~dm_ascii iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_node->module~dm_id module~dm_node->module~dm_kind module~dm_request->module~dm_error module~dm_request->module~dm_id module~dm_request->module~dm_kind module~dm_request->module~dm_response module~dm_request->module~dm_time module~dm_request->module~dm_util module~dm_string dm_string module~dm_request->module~dm_string module~dm_response->module~dm_error module~dm_response->module~dm_id module~dm_response->module~dm_kind module~dm_response->module~dm_util module~dm_sensor->module~dm_id module~dm_sensor->module~dm_kind module~dm_sensor->module~dm_node module~dm_target->module~dm_id module~dm_target->module~dm_kind module~dm_target->module~dm_util module~dm_time->module~dm_error module~dm_time->module~dm_kind module~dm_time->module~dm_util module~dm_util->module~dm_error module~dm_util->module~dm_kind module~dm_string->module~dm_error module~dm_string->module~dm_kind

Used by

  • module~~dm_observ~~UsedByGraph module~dm_observ dm_observ module~dm_job dm_job module~dm_job->module~dm_observ module~dm_log dm_log module~dm_log->module~dm_observ module~dm_logger dm_logger module~dm_logger->module~dm_observ module~dm_logger->module~dm_log module~dm_mqueue dm_mqueue module~dm_mqueue->module~dm_observ module~dm_mqueue->module~dm_log module~dm_sync dm_sync module~dm_sync->module~dm_observ module~dmpack dmpack module~dmpack->module~dm_observ module~dmpack->module~dm_job module~dmpack->module~dm_log module~dmpack->module~dm_logger module~dmpack->module~dm_mqueue module~dmpack->module~dm_sync module~dm_atom dm_atom module~dmpack->module~dm_atom module~dm_mqueue_util dm_mqueue_util module~dmpack->module~dm_mqueue_util module~dm_report dm_report module~dmpack->module~dm_report proc~dm_csv_header_observ dm_csv_header_observ proc~dm_csv_header_observ->module~dm_observ proc~dm_db_insert_observ dm_db_insert_observ proc~dm_db_insert_observ->module~dm_observ proc~dm_db_insert_observs dm_db_insert_observs proc~dm_db_insert_observs->module~dm_observ proc~dm_db_select_observ dm_db_select_observ proc~dm_db_select_observ->module~dm_observ proc~dm_db_select_observ_ids dm_db_select_observ_ids proc~dm_db_select_observ_ids->module~dm_observ proc~dm_db_select_observ_views dm_db_select_observ_views proc~dm_db_select_observ_views->module~dm_observ proc~dm_db_select_observs_by_id dm_db_select_observs_by_id proc~dm_db_select_observs_by_id->module~dm_observ proc~dm_db_select_observs_by_time dm_db_select_observs_by_time proc~dm_db_select_observs_by_time->module~dm_observ proc~dm_html_observ dm_html_observ proc~dm_html_observ->module~dm_observ proc~dm_html_observs dm_html_observs proc~dm_html_observs->module~dm_observ proc~dm_test_dummy_observ dm_test_dummy_observ proc~dm_test_dummy_observ->module~dm_observ proc~dm_z_compress_type dm_z_compress_type proc~dm_z_compress_type->module~dm_observ proc~dm_z_compress_type->module~dm_log module~dm_atom->module~dm_log module~dm_mqueue_util->module~dm_mqueue module~dm_report->module~dm_log proc~dm_arg_validate dm_arg_validate proc~dm_arg_validate->module~dm_log proc~dm_db_insert_log dm_db_insert_log proc~dm_db_insert_log->module~dm_log proc~dm_db_insert_sync dm_db_insert_sync proc~dm_db_insert_sync->module~dm_sync proc~dm_db_insert_sync_log dm_db_insert_sync_log proc~dm_db_insert_sync_log->module~dm_sync proc~dm_db_insert_sync_node dm_db_insert_sync_node proc~dm_db_insert_sync_node->module~dm_sync proc~dm_db_insert_sync_observ dm_db_insert_sync_observ proc~dm_db_insert_sync_observ->module~dm_sync proc~dm_db_insert_sync_sensor dm_db_insert_sync_sensor proc~dm_db_insert_sync_sensor->module~dm_sync proc~dm_db_insert_sync_target dm_db_insert_sync_target proc~dm_db_insert_sync_target->module~dm_sync proc~dm_db_select_log dm_db_select_log proc~dm_db_select_log->module~dm_log proc~dm_db_select_logs_by_observ dm_db_select_logs_by_observ proc~dm_db_select_logs_by_observ->module~dm_log proc~dm_db_select_sync_log dm_db_select_sync_log proc~dm_db_select_sync_log->module~dm_sync proc~dm_db_select_sync_logs dm_db_select_sync_logs proc~dm_db_select_sync_logs->module~dm_sync proc~dm_db_select_sync_node dm_db_select_sync_node proc~dm_db_select_sync_node->module~dm_sync proc~dm_db_select_sync_nodes dm_db_select_sync_nodes proc~dm_db_select_sync_nodes->module~dm_sync proc~dm_db_select_sync_observ dm_db_select_sync_observ proc~dm_db_select_sync_observ->module~dm_sync proc~dm_db_select_sync_observs dm_db_select_sync_observs proc~dm_db_select_sync_observs->module~dm_sync proc~dm_db_select_sync_sensor dm_db_select_sync_sensor proc~dm_db_select_sync_sensor->module~dm_sync proc~dm_db_select_sync_sensors dm_db_select_sync_sensors proc~dm_db_select_sync_sensors->module~dm_sync proc~dm_db_select_sync_target dm_db_select_sync_target proc~dm_db_select_sync_target->module~dm_sync proc~dm_db_select_sync_targets dm_db_select_sync_targets proc~dm_db_select_sync_targets->module~dm_sync proc~dm_html_log dm_html_log proc~dm_html_log->module~dm_log proc~dm_html_logs dm_html_logs proc~dm_html_logs->module~dm_log proc~dm_lua_api_register dm_lua_api_register proc~dm_lua_api_register->module~dm_log proc~dm_test_dummy_log dm_test_dummy_log proc~dm_test_dummy_log->module~dm_log

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: OBSERV_ID_LEN = UUID_LEN

Max. observation id length.

integer, public, parameter :: OBSERV_NAME_LEN = ID_LEN

Max. observation name length.

integer, public, parameter :: OBSERV_SOURCE_LEN = ID_LEN

Max. observation source length.

integer, public, parameter :: OBSERV_DEVICE_LEN = 32

Max. observation device length.

integer, public, parameter :: OBSERV_RECEIVER_LEN = ID_LEN

Max. observation receiver length.

integer, public, parameter :: OBSERV_MAX_NRECEIVERS = 16

Max. number of receivers.

integer, public, parameter :: OBSERV_MAX_NREQUESTS = 8

Max. number of requests.

integer, public, parameter :: OBSERV_SIZE = storage_size(observ_type())/8

Size of observ_type in bytes.

integer, public, parameter :: OBSERV_VIEW_SIZE = storage_size(observ_view_type())/8

Size of observ_view_type in bytes.


Interfaces

public interface operator (==)

Returns whether observations or observation views are equal.

  • public pure elemental function dm_observ_equals(observ1, observ2) result(equals)

    Returns .true. if given observations are equal.

    Arguments

    Type IntentOptional Attributes Name
    type(observ_type), intent(in) :: observ1

    The first observation.

    type(observ_type), intent(in) :: observ2

    The second observation.

    Return Value logical

  • public pure elemental function dm_observ_view_equals(view1, view2) result(equals)

    Returns .true. if given observation views are equal.

    Arguments

    Type IntentOptional Attributes Name
    type(observ_view_type), intent(in) :: view1

    The first observation view.

    type(observ_view_type), intent(in) :: view2

    The second observation view.

    Return Value logical


Derived Types

type, public ::  observ_type

Observation with receivers, requests, and responses. Modifying this type requires changes in dm_csv, dm_db, dm_hdf5, dm_html, dm_json, and several other modules (you probably don’t want that!).

Components

Type Visibility Attributes Name Initial
character(len=OBSERV_ID_LEN), public :: id = UUID_DEFAULT

Observation id (UUIDv4).

character(len=NODE_ID_LEN), public :: node_id = ' '

Node id (-0-9A-Z_a-z).

character(len=SENSOR_ID_LEN), public :: sensor_id = ' '

Sensor id (-0-9A-Z_a-z).

character(len=TARGET_ID_LEN), public :: target_id = ' '

Target id (-0-9A-Z_a-z).

character(len=OBSERV_NAME_LEN), public :: name = ' '

Observation name (-0-9A-Z_a-z).

character(len=TIME_LEN), public :: timestamp = ' '

ISO 8601 timestamp.

character(len=OBSERV_SOURCE_LEN), public :: source = ' '

Observation source (-0-9A-Z_a-z).

character(len=OBSERV_DEVICE_LEN), public :: device = ' '

Physical device (TTY/PTY).

integer, public :: priority = 0

Message queue priority (>= 0).

integer, public :: error = E_NONE

Error code.

integer, public :: next = 0

Next receiver index.

integer, public :: nreceivers = 0

Number of receivers.

integer, public :: nrequests = 0

Number of requests.

character(len=OBSERV_RECEIVER_LEN), public :: receivers(OBSERV_MAX_NRECEIVERS) = ' '

Array of receivers (-0-9A-Z_a-z).

type(request_type), public :: requests(OBSERV_MAX_NREQUESTS)

Array of requests.

type, public ::  observ_view_type

View of an observation with only one response of a single request.

Components

Type Visibility Attributes Name Initial
character(len=OBSERV_ID_LEN), public :: observ_id = UUID_DEFAULT

Observation id (UUID).

character(len=NODE_ID_LEN), public :: node_id = ' '

Node id (-0-9A-Z_a-z).

character(len=SENSOR_ID_LEN), public :: sensor_id = ' '

Sensor id (-0-9A-Z_a-z).

character(len=TARGET_ID_LEN), public :: target_id = ' '

Target id (-0-9A-Z_a-z).

character(len=OBSERV_NAME_LEN), public :: observ_name = ' '

Observation name.

integer, public :: observ_error = E_NONE

Observation error code.

character(len=REQUEST_NAME_LEN), public :: request_name = ' '

Request name (-0-9A-Z_a-z).

character(len=TIME_LEN), public :: request_timestamp = ' '

Request timestamp (ISO 8601).

integer, public :: request_error = E_NONE

Request error code.

character(len=RESPONSE_NAME_LEN), public :: response_name = ' '

Response name (-0-9A-Z_a-z).

character(len=RESPONSE_UNIT_LEN), public :: response_unit = ' '

Response unit (optional).

integer, public :: response_type = RESPONSE_TYPE_REAL64

Response value type.

integer, public :: response_error = E_NONE

Response error code.

real(kind=r8), public :: response_value = 0.0_r8

Response value.


Functions

public function dm_observ_add_receiver(observ, receiver) result(rc)

Validates and adds receiver to observation.

Read more…

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(inout) :: observ

Observation type.

character(len=*), intent(in) :: receiver

Receiver name.

Return Value integer

public function dm_observ_add_request(observ, request) result(rc)

Appends a request to an observation. Returns E_BOUNDS if the list of requests is full. The function does not validate the given request.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(inout) :: observ

Observation type.

type(request_type), intent(inout) :: request

Request type.

Return Value integer

public pure elemental function dm_observ_equals(observ1, observ2) result(equals)

Returns .true. if given observations are equal.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(in) :: observ1

The first observation.

type(observ_type), intent(in) :: observ2

The second observation.

Return Value logical

public function dm_observ_index(observ, response_name, request_index, response_index) result(rc)

Searches requests array of the observation for responses of passed name and returns the index of the first found. If no request of this name is found, E_NOT_FOUND is returned and request and index are set to 0.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(inout) :: observ

Observation type.

character(len=*), intent(in) :: response_name

Response name.

integer, intent(out), optional :: request_index

Position of request in requests array.

integer, intent(out), optional :: response_index

Position of response in responses array.

Return Value integer

public pure elemental function dm_observ_valid(observ, id, timestamp) result(valid)

Returns .true. if given observation is valid. An observation is valid if it conforms to the following requirements:

Read more…

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(in) :: observ

Observation type.

logical, intent(in), optional :: id

Enable id validation (on by default).

logical, intent(in), optional :: timestamp

Enable timestamp validation (on by default).

Return Value logical

public pure elemental function dm_observ_view_equals(view1, view2) result(equals)

Returns .true. if given observation views are equal.

Arguments

Type IntentOptional Attributes Name
type(observ_view_type), intent(in) :: view1

The first observation view.

type(observ_view_type), intent(in) :: view2

The second observation view.

Return Value logical


Subroutines

public subroutine dm_observ_out(observ, unit)

Prints observation to standard output or given file unit.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(inout) :: observ

Observation type.

integer, intent(in), optional :: unit

File unit.