variable_types Subroutine

private subroutine variable_types(me, itypes, status_ok)

Returns an array indicating the variable type of each columns.

Note

The first element in the column is used to determine the type.

Type Bound

csv_file

Arguments

Type IntentOptional Attributes Name
class(csv_file), intent(inout) :: me
integer, intent(out), dimension(:), allocatable :: itypes
logical, intent(out) :: status_ok

Calls

proc~~variable_types~~CallsGraph proc~variable_types csv_file%variable_types proc~infer_variable_type infer_variable_type proc~variable_types->proc~infer_variable_type proc~to_integer to_integer proc~infer_variable_type->proc~to_integer proc~to_logical to_logical proc~infer_variable_type->proc~to_logical proc~to_real_wp to_real_wp proc~infer_variable_type->proc~to_real_wp proc~lowercase_string lowercase_string proc~to_logical->proc~lowercase_string

Source Code

    subroutine variable_types(me,itypes,status_ok)

    implicit none

    class(csv_file),intent(inout) :: me
    integer,dimension(:),allocatable,intent(out) :: itypes
    logical,intent(out) :: status_ok

    integer :: i !! counter

    if (allocated(me%csv_data)) then
        allocate(itypes(me%n_cols))
        do i=1,me%n_cols
            call infer_variable_type(me%csv_data(1,i)%str,itypes(i))
        end do
        status_ok = .true.
    else
        if (me%verbose) write(error_unit,'(A,1X,I5)') 'Error: class has not been initialized'
        status_ok = .false.
    end if

    end subroutine variable_types