rotex__characters Module

Contains procedures related to characters and character arrays, such as converting integers to characters



Interfaces

public interface s2hms

convert seconds to hours, minutes, seconds

  • private pure module function int_s2hms(s) result(time)

    Given an integer 's' in seconds, convert to the format hh:mm:ss.

    Arguments

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

    Return Value character(len=:), allocatable

  • private pure module function real_s2hms(s_re) result(time)

    Given an integer in seconds, convert to the format hh:mm:ss. Input is a real, gets converted to int

    Arguments

    Type IntentOptional Attributes Name
    real(kind=dp), intent(in) :: s_re

    Return Value character(len=:), allocatable

public interface int2char

  • private pure function scalar_int2char(i) result(res)

    Writes the value i to a character as I0

    Arguments

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

    Return Value character(len=:), allocatable

  • private pure function vector_int2char(i) result(res)

    Writes the value i to a character as I0

    Arguments

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

    Return Value character(len=:), allocatable


Functions

public pure elemental function ndigits(n) result(num)

Returns number of characters an integer will occupy

Arguments

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

Return Value integer

public pure module function dJ2char(dJ) result(res)

Takes an integer dJ and results the character representing half of it. dJ2char(2) -> "1" dJ2char(3) -> "3/2"

Arguments

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

Twice the angular momentum

Return Value character(len=:), allocatable

The output character representation

public pure function lower(chr) result(res)

returns a lower case character

Arguments

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

Return Value character(len=:), allocatable

public pure function upper(chr) result(res)

returns an upper case character

Arguments

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

Return Value character(len=:), allocatable

public pure function sub(x) result(res)

Returns the subscript version of the integer x

Arguments

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

Return Value character(len=:), allocatable

public pure function sup(x) result(res)

Returns the superscript version of the integer x

Arguments

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

Return Value character(len=:), allocatable


Subroutines

public pure module subroutine add_trailing(chr, trail)

Add a trailing character trail to the character chr if it is not already the last character

Arguments

Type IntentOptional Attributes Name
character(len=:), intent(inout), allocatable :: chr
character(len=*), intent(in) :: trail

public pure elemental subroutine to_lower(chr)

converts a character to lower case

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: chr

public pure elemental subroutine to_upper(chr)

converts a character to upper case

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: chr