col_constructor_alloc_character Subroutine

private subroutine col_constructor_alloc_character(this, n, len)

Type Bound

column

Arguments

Type IntentOptional Attributes Name
class(column), intent(inout) :: this
integer, intent(in) :: n
integer, intent(in), optional :: len

Source Code

    subroutine col_constructor_alloc_character(this, n, len)
        class(column), intent(inout) :: this
        integer, intent(in) :: n
        integer, intent(in), optional :: len

        integer :: char_len

        if (present(len)) then
            char_len = len
        else
            char_len = MAX_CHAR_LEN_DEFAULT
        end if

        if (this % initialized) call this % destroy()
        this % initialized = .true.

        this % dtype = CHARACTER_NUM
        this % n = n
        allocate (character(len=char_len) :: this % charcol(n))

    end subroutine col_constructor_alloc_character