df_set_col_complex Subroutine

public subroutine df_set_col_complex(df, col_index, col)

Set entire complex column by index

Arguments

Type IntentOptional Attributes Name
type(data_frame), intent(inout) :: df
integer, intent(in) :: col_index
complex(kind=rk), intent(in), dimension(:) :: col

Source Code

    subroutine df_set_col_complex(df, col_index, col)
        type(data_frame), intent(inout) :: df
        integer, intent(in) :: col_index
        complex(rk), dimension(:), intent(in) :: col

        type(column) :: data_col

        if (col_index < 1 .or. col_index > df % ncols()) error stop "column index out of range"

        data_col = df % get_data_col(col_index)
        if (data_col % get_type() /= COMPLEX_NUM) error stop "column is not complex type"
        if (size(col) /= df % nrows()) error stop "column size mismatch"

        call data_col % destroy()
        call data_col % new(col)
        call df % set_data_col(col_index, data_col)
    end subroutine df_set_col_complex