get_real_wp_column Subroutine

private subroutine get_real_wp_column(me, icol, r, status_ok)

Return a column from a CSV file as a real(wp) vector.

Type Bound

csv_file

Arguments

Type IntentOptional Attributes Name
class(csv_file), intent(inout) :: me
integer, intent(in) :: icol

column number

real(kind=wp), intent(out), dimension(:), allocatable :: r
logical, intent(out) :: status_ok

Calls

proc~~get_real_wp_column~~CallsGraph proc~get_real_wp_column csv_file%get_real_wp_column proc~get_column csv_file%get_column proc~get_real_wp_column->proc~get_column proc~csv_get_value csv_file%csv_get_value proc~get_column->proc~csv_get_value proc~to_integer to_integer proc~csv_get_value->proc~to_integer proc~to_logical to_logical proc~csv_get_value->proc~to_logical proc~to_real_sp to_real_sp proc~csv_get_value->proc~to_real_sp proc~to_real_wp to_real_wp proc~csv_get_value->proc~to_real_wp proc~lowercase_string lowercase_string proc~to_logical->proc~lowercase_string

Source Code

    subroutine get_real_wp_column(me,icol,r,status_ok)

    implicit none

    class(csv_file),intent(inout) :: me
    integer,intent(in) :: icol  !! column number
    real(wp),dimension(:),allocatable,intent(out) :: r
    logical,intent(out) :: status_ok

    if (allocated(me%csv_data)) then
        allocate(r(me%n_rows))  ! size the output vector
        call me%get_column(icol,r,status_ok)
    else
        if (me%verbose) write(error_unit,'(A,1X,I5)') 'Error: class has not been initialized'
        status_ok = .false.
    end if

    end subroutine get_real_wp_column