dm_util Module

Type conversion functions and other utility procedures.


Uses

  • module~~dm_util~~UsesGraph module~dm_util dm_util module~dm_error dm_error module~dm_util->module~dm_error module~dm_kind dm_kind module~dm_util->module~dm_kind 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

Used by

  • module~~dm_util~~UsedByGraph module~dm_util dm_util module~dm_api dm_api module~dm_api->module~dm_util module~dm_time dm_time module~dm_api->module~dm_time module~dm_arg dm_arg module~dm_arg->module~dm_util module~dm_cgi dm_cgi module~dm_cgi->module~dm_util module~dm_cgi->module~dm_time module~dm_csv dm_csv module~dm_csv->module~dm_util module~dm_db dm_db module~dm_db->module~dm_util module~dm_db->module~dm_time module~dm_geocom dm_geocom module~dm_geocom->module~dm_util module~dm_geocom_api dm_geocom_api module~dm_geocom->module~dm_geocom_api module~dm_request dm_request module~dm_geocom->module~dm_request module~dm_response dm_response module~dm_geocom->module~dm_response module~dm_geocom_api->module~dm_util module~dm_geocom_api->module~dm_request module~dm_geocom_api->module~dm_response module~dm_geojson dm_geojson module~dm_geojson->module~dm_util module~dm_json dm_json module~dm_geojson->module~dm_json module~dm_html dm_html module~dm_html->module~dm_util module~dm_json->module~dm_util module~dm_dp dm_dp module~dm_json->module~dm_dp module~dm_jsonl dm_jsonl module~dm_jsonl->module~dm_util module~dm_jsonl->module~dm_json module~dm_lua dm_lua module~dm_lua->module~dm_util module~dm_lua_api dm_lua_api module~dm_lua_api->module~dm_util module~dm_lua_api->module~dm_lua module~dm_mail dm_mail module~dm_mail->module~dm_util module~dm_mail->module~dm_time module~dm_mqtt dm_mqtt module~dm_mqtt->module~dm_util module~dm_mqueue_util dm_mqueue_util module~dm_mqueue_util->module~dm_util module~dm_mqueue dm_mqueue module~dm_mqueue_util->module~dm_mqueue module~dm_observ dm_observ module~dm_observ->module~dm_util module~dm_observ->module~dm_request module~dm_observ->module~dm_response module~dm_target dm_target module~dm_observ->module~dm_target module~dm_observ->module~dm_time module~dm_request->module~dm_util module~dm_request->module~dm_response module~dm_request->module~dm_time module~dm_response->module~dm_util module~dm_rpc dm_rpc module~dm_rpc->module~dm_util module~dm_target->module~dm_util module~dm_test dm_test module~dm_test->module~dm_util module~dm_test->module~dm_time module~dm_time->module~dm_util module~dm_transform dm_transform module~dm_transform->module~dm_util module~dm_unit dm_unit module~dm_unit->module~dm_util module~dmpack dmpack module~dmpack->module~dm_util module~dmpack->module~dm_api module~dmpack->module~dm_arg module~dmpack->module~dm_cgi module~dmpack->module~dm_csv module~dmpack->module~dm_db module~dmpack->module~dm_geocom module~dmpack->module~dm_geocom_api module~dmpack->module~dm_geojson module~dmpack->module~dm_html module~dmpack->module~dm_json module~dmpack->module~dm_jsonl module~dmpack->module~dm_lua module~dmpack->module~dm_lua_api module~dmpack->module~dm_mail module~dmpack->module~dm_mqtt module~dmpack->module~dm_mqueue_util module~dmpack->module~dm_observ module~dmpack->module~dm_request module~dmpack->module~dm_response module~dmpack->module~dm_rpc module~dmpack->module~dm_target module~dmpack->module~dm_test module~dmpack->module~dm_time module~dmpack->module~dm_transform module~dmpack->module~dm_unit module~dm_atom dm_atom module~dmpack->module~dm_atom module~dm_beat dm_beat module~dmpack->module~dm_beat module~dm_cgi_router dm_cgi_router module~dmpack->module~dm_cgi_router module~dm_config dm_config module~dmpack->module~dm_config module~dmpack->module~dm_dp module~dm_fcgi dm_fcgi module~dmpack->module~dm_fcgi module~dm_job dm_job module~dmpack->module~dm_job module~dm_log dm_log module~dmpack->module~dm_log module~dm_logger dm_logger module~dmpack->module~dm_logger module~dm_lua_geocom dm_lua_geocom module~dmpack->module~dm_lua_geocom module~dmpack->module~dm_mqueue module~dm_plot dm_plot module~dmpack->module~dm_plot module~dm_report dm_report module~dmpack->module~dm_report module~dm_sync dm_sync module~dmpack->module~dm_sync module~dm_block dm_block module~dmpack->module~dm_block proc~dm_fcgi_header dm_fcgi_header proc~dm_fcgi_header->module~dm_util proc~dm_geocom_error_message dm_geocom_error_message proc~dm_geocom_error_message->module~dm_util proc~dm_lua_geocom_register dm_lua_geocom_register proc~dm_lua_geocom_register->module~dm_util proc~dm_node_equals dm_node_equals proc~dm_node_equals->module~dm_util proc~dm_regex_request dm_regex_request proc~dm_regex_request->module~dm_util proc~dm_regex_request->module~dm_request proc~dm_regex_request->module~dm_response proc~dm_sensor_equals dm_sensor_equals proc~dm_sensor_equals->module~dm_util module~dm_atom->module~dm_html module~dm_atom->module~dm_time module~dm_atom->module~dm_log module~dm_beat->module~dm_time module~dm_cgi_router->module~dm_cgi module~dm_config->module~dm_lua module~dm_dp->module~dm_time module~dm_fcgi->module~dm_cgi module~dm_job->module~dm_observ module~dm_log->module~dm_observ module~dm_log->module~dm_target module~dm_log->module~dm_time module~dm_logger->module~dm_observ module~dm_logger->module~dm_log module~dm_lua_geocom->module~dm_geocom_api module~dm_lua_geocom->module~dm_lua module~dm_lua_geocom->module~dm_request module~dm_mqueue->module~dm_observ module~dm_mqueue->module~dm_log module~dm_plot->module~dm_time module~dm_plot->module~dm_dp module~dm_report->module~dm_response module~dm_report->module~dm_target module~dm_report->module~dm_time module~dm_report->module~dm_log module~dm_report->module~dm_plot module~dm_sync->module~dm_observ module~dm_sync->module~dm_time proc~dm_arg_validate dm_arg_validate proc~dm_arg_validate->module~dm_time proc~dm_arg_validate->module~dm_log proc~dm_config_open dm_config_open proc~dm_config_open->module~dm_lua_api proc~dm_config_open->module~dm_lua_geocom proc~dm_csv_header_observ dm_csv_header_observ proc~dm_csv_header_observ->module~dm_observ proc~dm_csv_header_observ->module~dm_request 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_insert_target dm_db_insert_target proc~dm_db_insert_target->module~dm_target 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_db_select_target dm_db_select_target proc~dm_db_select_target->module~dm_target proc~dm_db_update_target dm_db_update_target proc~dm_db_update_target->module~dm_target proc~dm_html_beat dm_html_beat proc~dm_html_beat->module~dm_time proc~dm_html_beat->module~dm_beat proc~dm_html_beats dm_html_beats proc~dm_html_beats->module~dm_time proc~dm_html_beats->module~dm_beat proc~dm_html_cgi_env dm_html_cgi_env proc~dm_html_cgi_env->module~dm_cgi 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_html_request dm_html_request proc~dm_html_request->module~dm_request proc~dm_html_responses dm_html_responses proc~dm_html_responses->module~dm_response proc~dm_html_target dm_html_target proc~dm_html_target->module~dm_target proc~dm_html_targets dm_html_targets proc~dm_html_targets->module~dm_target proc~dm_html_time dm_html_time proc~dm_html_time->module~dm_time proc~dm_lua_api_register dm_lua_api_register proc~dm_lua_api_register->module~dm_response proc~dm_lua_api_register->module~dm_log proc~dm_regex_response_string dm_regex_response_string proc~dm_regex_response_string->module~dm_request proc~dm_test_dummy_observ dm_test_dummy_observ proc~dm_test_dummy_observ->module~dm_observ proc~dm_test_dummy_observ->module~dm_request proc~dm_test_dummy_request dm_test_dummy_request proc~dm_test_dummy_request->module~dm_request proc~dm_test_dummy_request->module~dm_response proc~dm_test_dummy_target dm_test_dummy_target proc~dm_test_dummy_target->module~dm_target proc~dm_test_run dm_test_run proc~dm_test_run->module~dm_time proc~dm_tty_read_request dm_tty_read_request proc~dm_tty_read_request->module~dm_request proc~dm_tty_write_request dm_tty_write_request proc~dm_tty_write_request->module~dm_request proc~dm_z_compress_type dm_z_compress_type proc~dm_z_compress_type->module~dm_observ proc~dm_z_compress_type->module~dm_target proc~dm_z_compress_type->module~dm_beat proc~dm_z_compress_type->module~dm_log proc~luaopen_libdmpack luaopen_libdmpack proc~luaopen_libdmpack->module~dm_lua proc~luaopen_libdmpack->module~dm_lua_api proc~luaopen_libdmpack->module~dm_lua_geocom module~dm_block->module~dm_dp proc~dm_db_insert_beat dm_db_insert_beat proc~dm_db_insert_beat->module~dm_beat proc~dm_db_insert_beats dm_db_insert_beats proc~dm_db_insert_beats->module~dm_beat 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_beat dm_db_select_beat proc~dm_db_select_beat->module~dm_beat 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_test_dummy_beat dm_test_dummy_beat proc~dm_test_dummy_beat->module~dm_beat proc~dm_test_dummy_log dm_test_dummy_log proc~dm_test_dummy_log->module~dm_log

Interfaces

public interface dm_array_has

Returns whether array contains an integer value.

  • private function array_has_int32(array, value) result(has)

    Returns .true. if the integer array contains the given value.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i4), intent(inout) :: array(:)

    Input array.

    integer(kind=i4), intent(in) :: value

    Value to search.

    Return Value logical

  • private function array_has_int64(array, value) result(has)

    Returns .true. if the integer array contains the given value.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i8), intent(inout) :: array(:)

    Input array.

    integer(kind=i8), intent(in) :: value

    Value to search.

    Return Value logical

public interface dm_equals

Returns whether two real numbers are approximately the same.

  • private pure elemental function equals_real32(a, b) result(equals)

    Returns .true. if the 4-byte real numbers a and b are approximately the same, else .false..

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r4), intent(in) :: a
    real(kind=r4), intent(in) :: b

    Return Value logical

  • private pure elemental function equals_real64(a, b) result(equals)

    Returns .true. if the 8-byte real numbers a and b are approximately the same, else .false..

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r8), intent(in) :: a
    real(kind=r8), intent(in) :: b

    Return Value logical

public interface dm_inc

Returns increased integer value.

  • private pure elemental function inc_int32(a, b) result(c)

    Increases argument a by 1 or b.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i4), intent(in) :: a

    Value to increase.

    integer(kind=i4), intent(in), optional :: b

    Summand to use.

    Return Value integer(kind=i4)

  • private pure elemental function inc_int64(a, b) result(c)

    Increases argument a by 1 or b.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i8), intent(in) :: a

    Value to increase.

    integer(kind=i8), intent(in), optional :: b

    Summand to use.

    Return Value integer(kind=i8)

public interface dm_itoa

Generic integer to string converter.

  • private pure function int32_to_string(i) result(str)

    Converts 4-byte integer to allocatable string of length > 0.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: i

    Value.

    Return Value character(len=:), allocatable

    String of value.

  • private pure function int64_to_string(i) result(str)

    Converts 8-byte integer to allocatable string of length > 0.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i8), intent(in) :: i

    Value.

    Return Value character(len=:), allocatable

    String of value.

public interface dm_ftoa

Generic real to string converter.

  • private pure function real32_to_string(f) result(str)

    Converts 4-byte real to allocatable string of length > 1.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r4), intent(in) :: f

    Value.

    Return Value character(len=:), allocatable

    String of value.

  • private pure function real64_to_string(f) result(str)

    Converts 8-byte real to allocatable string of length > 1.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r8), intent(in) :: f

    Value.

    Return Value character(len=:), allocatable

    String of value.

public interface dm_from_real64

Converts 8-byte real to type (for response values).

  • public pure elemental subroutine dm_real64_to_int32(f, i)

    Converts 8-byte real to 4-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r8), intent(in) :: f

    8-byte real value.

    integer(kind=i4), intent(out) :: i

    4-byte integer value.

  • public pure elemental subroutine dm_real64_to_int64(f, i)

    Converts 8-byte real to 8-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r8), intent(in) :: f

    8-byte real value.

    integer(kind=i8), intent(out) :: i

    8-byte integer value.

  • public pure elemental subroutine dm_real64_to_logical(f, l)

    Converts 8-byte real to logical. If f equals 0.0, the result is .false., else .true..

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r8), intent(in) :: f

    8-byte real value.

    logical, intent(out) :: l

    Logical value.

  • public pure elemental subroutine dm_real64_to_real32(f, r)

    Converts 8-byte real to 4-byte real

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r8), intent(in) :: f

    8-byte real value.

    real(kind=r4), intent(out) :: r

    4-byte real value.

public interface dm_to_real64

Converts type to 8-byte real (for response values).

  • public pure elemental function dm_int32_to_real64(i) result(r)

    Converts 4-byte integer to 8-byte real.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i4), intent(in) :: i

    4-byte integer value.

    Return Value real(kind=r8)

    Value as 8-byte real.

  • public pure elemental function dm_int64_to_real64(i) result(r)

    Converts 8-byte integer to 8-byte real.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i8), intent(in) :: i

    8-byte integer value.

    Return Value real(kind=r8)

    Value as 8-byte real.

  • public pure elemental function dm_logical_to_real64(l) result(r)

    Converts logical to 8-byte real (0.0 for .false. and 1.0 for .true.).

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in) :: l

    Logical value.

    Return Value real(kind=r8)

    Value as 8-byte real.

  • public pure elemental function dm_real32_to_real64(f) result(r)

    Converts 4-byte real to 8-byte real.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r4), intent(in) :: f

    4-byte real value.

    Return Value real(kind=r8)

    Value as 8-byte real.


Functions

public pure elemental function dm_atof(str) result(f)

Converts string to 8-byte real.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Number string.

Return Value real(kind=r8)

Value.

public pure elemental function dm_atoi(str) result(i)

Converts string to 4-byte integer.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Number string.

Return Value integer

Value.

public pure function dm_btoa(l, true, false) result(str)

Returns either argument true or false as allocatable character, depending on the value of logical value l. The result is trimmed.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: l

Logical value.

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

Return value on .true..

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

Return value on .false..

Return Value character(len=:), allocatable

Returned string.

public pure elemental function dm_btoi(l) result(i)

Converts logical (boolean) to 4-byte integer.

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: l

Logical value.

Return Value integer

0 or 1.

public pure elemental function dm_deg_to_gon(a) result(b)

Converts angle from degrees to gon.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: a

Angle [deg].

Return Value real(kind=r8)

Angle [gon].

public pure elemental function dm_deg_to_rad(a) result(b)

Converts angle from degrees to radiants.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: a

Angle [deg].

Return Value real(kind=r8)

Angle [rad].

public pure elemental function dm_gon_to_deg(a) result(b)

Converts angle from gon to degrees.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: a

Angle [gon].

Return Value real(kind=r8)

Angle [deg].

public pure elemental function dm_gon_to_rad(a) result(b)

Converts angle from gon to radiants.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: a

Angle [gon].

Return Value real(kind=r8)

Angle [rad].

public pure elemental function dm_rad_to_deg(a) result(b)

Converts angle from radiants to degrees.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: a

Angle [rad].

Return Value real(kind=r8)

Angle [deg]

public pure elemental function dm_rad_to_gon(a) result(b)

Converts angle from radiants to gon.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: a

Angle [rad].

Return Value real(kind=r8)

Angle [gon]

public pure elemental function dm_int32_to_real64(i) result(r)

Converts 4-byte integer to 8-byte real.

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in) :: i

4-byte integer value.

Return Value real(kind=r8)

Value as 8-byte real.

public pure elemental function dm_int64_to_real64(i) result(r)

Converts 8-byte integer to 8-byte real.

Arguments

Type IntentOptional Attributes Name
integer(kind=i8), intent(in) :: i

8-byte integer value.

Return Value real(kind=r8)

Value as 8-byte real.

public pure elemental function dm_logical_to_real64(l) result(r)

Converts logical to 8-byte real (0.0 for .false. and 1.0 for .true.).

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: l

Logical value.

Return Value real(kind=r8)

Value as 8-byte real.

public pure elemental function dm_real32_to_real64(f) result(r)

Converts 4-byte real to 8-byte real.

Arguments

Type IntentOptional Attributes Name
real(kind=r4), intent(in) :: f

4-byte real value.

Return Value real(kind=r8)

Value as 8-byte real.


Subroutines

public subroutine dm_msleep(sec)

Pauses program execution for given time in mseconds.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: sec

Delay in seconds [msec].

public subroutine dm_sleep(sec)

Pauses program execution for given time in seconds.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: sec

Delay in seconds [sec].

public subroutine dm_usleep(usec)

Pauses program execution for given time in useconds.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: usec

Delay in useconds [usec].

public pure elemental subroutine dm_real64_to_int32(f, i)

Converts 8-byte real to 4-byte integer.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: f

8-byte real value.

integer(kind=i4), intent(out) :: i

4-byte integer value.

public pure elemental subroutine dm_real64_to_int64(f, i)

Converts 8-byte real to 8-byte integer.

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: f

8-byte real value.

integer(kind=i8), intent(out) :: i

8-byte integer value.

public pure elemental subroutine dm_real64_to_logical(f, l)

Converts 8-byte real to logical. If f equals 0.0, the result is .false., else .true..

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: f

8-byte real value.

logical, intent(out) :: l

Logical value.

public pure elemental subroutine dm_real64_to_real32(f, r)

Converts 8-byte real to 4-byte real

Arguments

Type IntentOptional Attributes Name
real(kind=r8), intent(in) :: f

8-byte real value.

real(kind=r4), intent(out) :: r

4-byte real value.