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_status dm_api_status module~dm_api_status->module~dm_util module~dm_time dm_time module~dm_api_status->module~dm_time module~dm_arg dm_arg module~dm_arg->module~dm_util module~dm_block dm_block module~dm_block->module~dm_util module~dm_dp dm_dp module~dm_block->module~dm_dp module~dm_cgi dm_cgi module~dm_cgi->module~dm_util module~dm_cgi->module~dm_time module~dm_config dm_config module~dm_config->module~dm_util module~dm_lua dm_lua module~dm_config->module~dm_lua 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_api dm_db_api module~dm_db_api->module~dm_util module~dm_db_api->module~dm_db module~dm_db_row dm_db_row module~dm_db_api->module~dm_db_row module~dm_db_table dm_db_table module~dm_db_api->module~dm_db_table module~dm_db_api->module~dm_time module~dm_db_count dm_db_count module~dm_db_api->module~dm_db_count module~dm_db_pragma dm_db_pragma module~dm_db_api->module~dm_db_pragma module~dm_db_row->module~dm_util module~dm_db_row->module~dm_db module~dm_db_table->module~dm_util module~dm_db_table->module~dm_db module~dm_dwd dm_dwd module~dm_dwd->module~dm_util module~dm_dwd->module~dm_time module~dm_ftp dm_ftp module~dm_ftp->module~dm_util 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_hdf5 dm_hdf5 module~dm_hdf5->module~dm_util module~dm_html dm_html module~dm_html->module~dm_util module~dm_im dm_im module~dm_im->module~dm_util module~dm_job dm_job module~dm_job->module~dm_util module~dm_observ dm_observ module~dm_job->module~dm_observ module~dm_js dm_js module~dm_js->module~dm_util module~dm_json->module~dm_util 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_logger dm_logger module~dm_logger->module~dm_util module~dm_logger->module~dm_observ module~dm_log dm_log module~dm_logger->module~dm_log 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 dm_mqueue module~dm_mqueue->module~dm_util module~dm_mqueue_util dm_mqueue_util module~dm_mqueue_util->module~dm_util module~dm_mqueue_util->module~dm_mqueue module~dm_nml dm_nml module~dm_nml->module~dm_util 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_roff dm_roff module~dm_roff->module~dm_util module~dm_rpc dm_rpc module~dm_rpc->module~dm_util module~dm_z dm_z module~dm_rpc->module~dm_z module~dm_rts dm_rts module~dm_rts->module~dm_util module~dm_sem dm_sem module~dm_sem->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_status module~dmpack->module~dm_arg module~dmpack->module~dm_block module~dmpack->module~dm_cgi module~dmpack->module~dm_config module~dmpack->module~dm_csv module~dmpack->module~dm_db module~dmpack->module~dm_db_api module~dmpack->module~dm_db_row module~dmpack->module~dm_db_table module~dmpack->module~dm_dwd module~dmpack->module~dm_ftp module~dmpack->module~dm_geocom module~dmpack->module~dm_geocom_api module~dmpack->module~dm_geojson module~dmpack->module~dm_hdf5 module~dmpack->module~dm_html module~dmpack->module~dm_im module~dmpack->module~dm_job module~dmpack->module~dm_js module~dmpack->module~dm_json module~dmpack->module~dm_jsonl module~dmpack->module~dm_logger 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 module~dmpack->module~dm_mqueue_util module~dmpack->module~dm_nml module~dmpack->module~dm_observ module~dmpack->module~dm_request module~dmpack->module~dm_response module~dmpack->module~dm_roff module~dmpack->module~dm_rpc module~dmpack->module~dm_rts module~dmpack->module~dm_sem 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~dmpack->module~dm_db_count module~dm_db_json dm_db_json module~dmpack->module~dm_db_json module~dmpack->module~dm_db_pragma module~dmpack->module~dm_dp module~dm_dwd_api dm_dwd_api module~dmpack->module~dm_dwd_api module~dm_fcgi dm_fcgi module~dmpack->module~dm_fcgi module~dm_image dm_image module~dmpack->module~dm_image module~dmpack->module~dm_log module~dm_lua_geocom dm_lua_geocom module~dmpack->module~dm_lua_geocom module~dm_plot dm_plot module~dmpack->module~dm_plot module~dm_report dm_report module~dmpack->module~dm_report module~dm_serial dm_serial module~dmpack->module~dm_serial module~dm_sync dm_sync module~dmpack->module~dm_sync module~dm_transfer dm_transfer module~dmpack->module~dm_transfer module~dm_ve dm_ve module~dmpack->module~dm_ve module~dmpack->module~dm_z proc~dm_beat_out dm_beat_out proc~dm_beat_out->module~dm_util proc~dm_db_query_build dm_db_query_build proc~dm_db_query_build->module~dm_util proc~dm_dp_scale dm_dp_scale proc~dm_dp_scale->module~dm_util proc~dm_dwd_api_weather_report_url dm_dwd_api_weather_report_url proc~dm_dwd_api_weather_report_url->module~dm_util proc~dm_fcgi_header dm_fcgi_header proc~dm_fcgi_header->module~dm_util proc~dm_file_write dm_file_write proc~dm_file_write->module~dm_util proc~dm_geocom_error_message dm_geocom_error_message proc~dm_geocom_error_message->module~dm_util proc~dm_geocom_type_validated dm_geocom_type_validated proc~dm_geocom_type_validated->module~dm_util proc~dm_id_is_valid dm_id_is_valid proc~dm_id_is_valid->module~dm_util proc~dm_image_out dm_image_out proc~dm_image_out->module~dm_util proc~dm_log_out dm_log_out proc~dm_log_out->module~dm_util proc~dm_lua_geocom_register dm_lua_geocom_register proc~dm_lua_geocom_register->module~dm_util proc~dm_modbus_register_out dm_modbus_register_out proc~dm_modbus_register_out->module~dm_util proc~dm_modbus_version dm_modbus_version proc~dm_modbus_version->module~dm_util proc~dm_node_equals dm_node_equals proc~dm_node_equals->module~dm_util proc~dm_node_out dm_node_out proc~dm_node_out->module~dm_util proc~dm_pipe_write dm_pipe_write proc~dm_pipe_write->module~dm_util proc~dm_plot_version dm_plot_version proc~dm_plot_version->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 proc~dm_sensor_out dm_sensor_out proc~dm_sensor_out->module~dm_util proc~dm_signal_name dm_signal_name proc~dm_signal_name->module~dm_util proc~dm_sync_out dm_sync_out proc~dm_sync_out->module~dm_util proc~dm_transfer_out dm_transfer_out proc~dm_transfer_out->module~dm_util proc~dm_tty_flush dm_tty_flush proc~dm_tty_flush->module~dm_util proc~dm_tty_open dm_tty_open proc~dm_tty_open->module~dm_util proc~dm_ve_error_message dm_ve_error_message proc~dm_ve_error_message->module~dm_util proc~dm_ve_frame_read dm_ve_frame_read proc~dm_ve_frame_read->module~dm_util proc~dm_zstd_version dm_zstd_version proc~dm_zstd_version->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_db_count->module~dm_db module~dm_db_json->module~dm_db module~dm_db_json->module~dm_db_row module~dm_db_json->module~dm_db_count module~dm_db_pragma->module~dm_db module~dm_dp->module~dm_time module~dm_dwd_api->module~dm_dwd module~dm_fcgi->module~dm_cgi module~dm_image->module~dm_target module~dm_image->module~dm_time module~dm_log->module~dm_observ module~dm_log->module~dm_target module~dm_log->module~dm_time module~dm_lua_geocom->module~dm_geocom_api module~dm_lua_geocom->module~dm_lua module~dm_lua_geocom->module~dm_request 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_serial->module~dm_csv module~dm_serial->module~dm_json module~dm_serial->module~dm_nml module~dm_sync->module~dm_observ module~dm_sync->module~dm_time module~dm_transfer->module~dm_time module~dm_ve->module~dm_response module~dm_z->module~dm_nml 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_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_dwd_api_callback dm_dwd_api_callback proc~dm_dwd_api_callback->module~dm_rpc 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_image 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 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_image dm_db_insert_image proc~dm_db_insert_image->module~dm_image 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_image dm_db_insert_sync_image proc~dm_db_insert_sync_image->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_insert_transfer dm_db_insert_transfer proc~dm_db_insert_transfer->module~dm_transfer proc~dm_db_select_beat dm_db_select_beat proc~dm_db_select_beat->module~dm_beat proc~dm_db_select_image dm_db_select_image proc~dm_db_select_image->module~dm_image proc~dm_db_select_log dm_db_select_log proc~dm_db_select_log->module~dm_log proc~dm_db_select_sync_image dm_db_select_sync_image proc~dm_db_select_sync_image->module~dm_sync proc~dm_db_select_sync_images dm_db_select_sync_images proc~dm_db_select_sync_images->module~dm_sync 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_db_select_transfer dm_db_select_transfer proc~dm_db_select_transfer->module~dm_transfer proc~dm_db_update_transfer dm_db_update_transfer proc~dm_db_update_transfer->module~dm_transfer proc~dm_html_image dm_html_image proc~dm_html_image->module~dm_image proc~dm_html_images dm_html_images proc~dm_html_images->module~dm_image 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_html_transfer dm_html_transfer proc~dm_html_transfer->module~dm_transfer proc~dm_html_transfers dm_html_transfers proc~dm_html_transfers->module~dm_transfer proc~dm_test_dummy_beat dm_test_dummy_beat proc~dm_test_dummy_beat->module~dm_beat proc~dm_test_dummy_image dm_test_dummy_image proc~dm_test_dummy_image->module~dm_image proc~dm_test_dummy_log dm_test_dummy_log proc~dm_test_dummy_log->module~dm_log

Interfaces

public interface dm_array_has

Returns .true. if 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 .true. if 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 itoa_int32(value) result(string)

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

    Arguments

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

    Value.

    Return Value character(len=:), allocatable

    String of value.

  • private pure function itoa_int64(value) result(string)

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

    Arguments

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

    Value.

    Return Value character(len=:), allocatable

    String of value.

public interface dm_ftoa

Generic real to string converter.

  • private pure function ftoa_real32(value) result(string)

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

    Arguments

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

    Value.

    Return Value character(len=:), allocatable

    String of value.

  • private pure function ftoa_real64(value) result(string)

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

    Arguments

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

    Value.

    Return Value character(len=:), allocatable

    String of value.

  • private pure function ftoa2_real32(value, n) result(string)

    Converts 4-byte real to allocatable string of length > 1, with ndigit digits to the right of the decimal point.

    Arguments

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

    Value.

    integer, intent(in) :: n

    Number of digits to the right of the decimal point.

    Return Value character(len=:), allocatable

    String of value.

  • private pure function ftoa2_real64(value, n) result(string)

    Converts 8-byte real to allocatable string of length > 1, with ndigit digits to the right of the decimal point.

    Arguments

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

    Value.

    integer, intent(in) :: n

    Number of digits to the right of the decimal point.

    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(from, to)

    Converts 8-byte real to 4-byte integer.

    Arguments

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

    8-byte real value.

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

    4-byte integer value.

  • public pure elemental subroutine dm_real64_to_int64(from, to)

    Converts 8-byte real to 8-byte integer.

    Arguments

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

    8-byte real value.

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

    8-byte integer value.

  • public pure elemental subroutine dm_real64_to_logical(from, to)

    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) :: from

    8-byte real value.

    logical, intent(out) :: to

    Logical value.

  • public pure elemental subroutine dm_real64_to_real32(from, to)

    Converts 8-byte real to 4-byte real

    Arguments

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

    8-byte real value.

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

    4-byte real value.

public interface dm_to_real64

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

  • public pure elemental function dm_int16_to_real64(i16) result(r64)

    Converts 2-byte integer to 8-byte real.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i2), intent(in) :: i16

    2-byte integer value.

    Return Value real(kind=r8)

    Value as 8-byte real.

  • public pure elemental function dm_int32_to_real64(i32) result(r64)

    Converts 4-byte integer to 8-byte real.

    Arguments

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

    4-byte integer value.

    Return Value real(kind=r8)

    Value as 8-byte real.

  • public pure elemental function dm_int64_to_real64(i64) result(r64)

    Converts 8-byte integer to 8-byte real.

    Arguments

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

    8-byte integer value.

    Return Value real(kind=r8)

    Value as 8-byte real.

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

    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.

  • private pure elemental function dm_real32_to_real64(r32) result(r64)

    Converts 8-byte integer to 8-byte real.

    Arguments

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

    4-byte real value.

    Return Value real(kind=r8)

    Value as 8-byte real.

public interface dm_present

Returns present argument or default value.

  • private pure elemental function present_character(arg, default) result(value)

    Returns 1-byte character argument arg if present or default otherwise.

    Arguments

    Type IntentOptional Attributes Name
    character(len=1), intent(in), optional :: arg

    Argument.

    character(len=1), intent(in) :: default

    Default value.

    Return Value character(len=1)

    Argument or default.

  • private pure elemental function present_int32(arg, default) result(value)

    Returns 4-byte integer argument arg if present or default otherwise.

    Arguments

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

    Argument.

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

    Default value.

    Return Value integer(kind=i4)

    Argument or default.

  • private pure elemental function present_int64(arg, default) result(value)

    Returns 8-byte integer argument arg if present or default otherwise.

    Arguments

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

    Argument.

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

    Default value.

    Return Value integer(kind=i8)

    Argument or default.

  • private pure elemental function present_logical(arg, default) result(value)

    Returns logical argument arg if present or default otherwise.

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in), optional :: arg

    Argument.

    logical, intent(in) :: default

    Default value.

    Return Value logical

    Argument or default.

  • private pure elemental function present_ptr(arg, default) result(value)

    Returns C pointer argument arg if present or default otherwise.

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), intent(in), optional :: arg

    Argument.

    type(c_ptr), intent(in) :: default

    Default value.

    Return Value type(c_ptr)

    Argument or default.

  • private pure elemental function present_real32(arg, default) result(value)

    Returns 4-byte real argument arg if present or default otherwise.

    Arguments

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

    Argument.

    real(kind=r4), intent(in) :: default

    Default value.

    Return Value real(kind=r4)

    Argument or default.

  • private pure elemental function present_real64(arg, default) result(value)

    Returns 8-byte real argument arg if present or default otherwise.

    Arguments

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

    Argument.

    real(kind=r8), intent(in) :: default

    Default value.

    Return Value real(kind=r8)

    Argument or default.

public interface dm_sec_to_msec

Generic seconds to milliseconds function.

  • private pure elemental function sec_to_msec_int32(sec) result(msec)

    Converts seconds to milliseconds (4 bytes).

    Arguments

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

    Seconds.

    Return Value integer(kind=i4)

    Milliseconds.

  • private pure elemental function sec_to_msec_int64(sec) result(msec)

    Converts seconds to milliseconds (8 bytes).

    Arguments

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

    Seconds.

    Return Value integer(kind=i8)

    Milliseconds.

public interface dm_msec_to_sec

Generic seconds to milliseconds function.

  • private pure elemental function msec_to_sec_int32(msec) result(sec)

    Converts milliseconds to seconds (4 bytes).

    Arguments

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

    Milliseconds.

    Return Value integer(kind=i4)

    Seconds.

  • private pure elemental function msec_to_sec_int64(msec) result(sec)

    Converts milliseconds to seconds (8 bytes).

    Arguments

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

    Milliseconds.

    Return Value integer(kind=i8)

    Seconds.

public interface dm_size_to_human

Generic size formatting function. Returns allocatable string of given size converted to human-readable IEC format with suffix.

  • private function size_to_human_int32(nbyte) result(string)

    Arguments

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

    Return Value character(len=:), allocatable

  • private function size_to_human_int64(nbyte) result(string)

    Arguments

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

    Return Value character(len=:), allocatable

public interface dm_swap

Subroutines to reverse the byte order of integer and real variables. This is useful when reading binary data from a file intended for use on a compute whose byte order is opposite that of the computer on which the Fortran program is to be run.

Adopted from Fortran 90 routines written by David G. Simpson, NASA Goddard Space Flight Center (https://caps.gsfc.nasa.gov/simpson/).

  • public pure elemental subroutine dm_swap_int16(n)

    Swaps bytes for a 2-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i2), intent(inout) :: n
  • public pure elemental subroutine dm_swap_int32(n)

    Swaps bytes for a 4-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i4), intent(inout) :: n
  • public pure elemental subroutine dm_swap_int64(n)

    Swaps bytes for a 8-byte integer.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=i8), intent(inout) :: n
  • public pure elemental subroutine dm_swap_real32(f)

    Swaps bytes for a 4-byte real.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=r4), intent(inout) :: f
  • public pure elemental subroutine dm_swap_real64(f)

    Swaps bytes for an 8-byte real.

    Arguments

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

Functions

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

Converts string to 8-byte real.

Arguments

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

Number string.

Return Value real(kind=r8)

Real result.

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

Converts string to 4-byte integer.

Arguments

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

Number string.

Return Value integer(kind=i4)

Integer result.

public pure function dm_btoa(b, true, false) result(a)

Returns either argument true or false as allocatable character, depending on the value of logical value b. If true and/or false is missing, T or F is returned respectively. The result is trimmed.

Arguments

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

Logical value.

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

Return value on .true..

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

Return value on .false..

Return Value character(len=:), allocatable

String result.

public pure elemental function dm_btoi(b, true, false) result(i)

Converts logical (boolean) to 4-byte integer. The result is either 0 or 1, unless argument true or false is passed to overwrite the value.

Arguments

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

Logical value.

integer, intent(in), optional :: true

Returns value on .true..

integer, intent(in), optional :: false

Returns value on .false..

Return Value integer

Integer result.

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_int16_to_real64(i16) result(r64)

Converts 2-byte integer to 8-byte real.

Arguments

Type IntentOptional Attributes Name
integer(kind=i2), intent(in) :: i16

2-byte integer value.

Return Value real(kind=r8)

Value as 8-byte real.

public pure elemental function dm_int32_to_real64(i32) result(r64)

Converts 4-byte integer to 8-byte real.

Arguments

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

4-byte integer value.

Return Value real(kind=r8)

Value as 8-byte real.

public pure elemental function dm_int64_to_real64(i64) result(r64)

Converts 8-byte integer to 8-byte real.

Arguments

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

8-byte integer value.

Return Value real(kind=r8)

Value as 8-byte real.

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

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.


Subroutines

public pure elemental subroutine dm_hex_to_rgb(hex, r, g, b)

Converts hex string to RGB values, for instance, #FFFFFF to (255, 255, 255).

Arguments

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

Hex string.

integer, intent(out) :: r

Red.

integer, intent(out) :: g

Green.

integer, intent(out) :: b

Blue.

public pure elemental subroutine dm_rgb_to_hex(r, g, b, hex)

Converts RGB values to hex string, for instance, (255, 255, 255) to #FFFFFF.

Arguments

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

Red.

integer, intent(in) :: g

Green.

integer, intent(in) :: b

Blue.

character(len=7), intent(out) :: hex

Hex string.

public pure elemental subroutine dm_real64_to_int32(from, to)

Converts 8-byte real to 4-byte integer.

Arguments

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

8-byte real value.

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

4-byte integer value.

public pure elemental subroutine dm_real64_to_int64(from, to)

Converts 8-byte real to 8-byte integer.

Arguments

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

8-byte real value.

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

8-byte integer value.

public pure elemental subroutine dm_real64_to_logical(from, to)

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) :: from

8-byte real value.

logical, intent(out) :: to

Logical value.

public pure elemental subroutine dm_real64_to_real32(from, to)

Converts 8-byte real to 4-byte real

Arguments

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

8-byte real value.

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

4-byte real value.

public subroutine dm_msleep(msec)

Pauses program execution for given time in mseconds.

Arguments

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

Delay [msec].

public subroutine dm_sleep(sec)

Pauses program execution for given time in seconds.

Arguments

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

Delay [sec].

public subroutine dm_usleep(usec)

Pauses program execution for given time in useconds.

Arguments

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

Delay [usec].

public pure elemental subroutine dm_swap_int16(n)

Swaps bytes for a 2-byte integer.

Arguments

Type IntentOptional Attributes Name
integer(kind=i2), intent(inout) :: n

public pure elemental subroutine dm_swap_int32(n)

Swaps bytes for a 4-byte integer.

Arguments

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

public pure elemental subroutine dm_swap_int64(n)

Swaps bytes for a 8-byte integer.

Arguments

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

public pure elemental subroutine dm_swap_real32(f)

Swaps bytes for a 4-byte real.

Arguments

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

public pure elemental subroutine dm_swap_real64(f)

Swaps bytes for an 8-byte real.

Arguments

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