aot_top_get_extdouble Subroutine

private subroutine aot_top_get_extdouble(val, ErrCode, L, default)

Interpret topmost entry on Lua stack as a extdouble precision real.

NOTE that numbers provided by Lua are only double precision.

Arguments

Type IntentOptional Attributes Name
real(kind=xdble_k), intent(out) :: val

Value of the Variable in the script

integer, intent(out) :: ErrCode

Error code to indicate what kind of problem might have occured.

type(flu_State) :: L
real(kind=xdble_k), intent(in), optional :: default

Some default value, that should be used, if the variable is not set in the Lua script.


Calls

proc~~aot_top_get_extdouble~~CallsGraph proc~aot_top_get_extdouble aot_top_get_extdouble proc~flu_isnoneornil flu_isNoneOrNil proc~aot_top_get_extdouble->proc~flu_isnoneornil proc~flu_isnumber flu_isnumber proc~aot_top_get_extdouble->proc~flu_isnumber proc~flu_pop flu_pop proc~aot_top_get_extdouble->proc~flu_pop proc~flu_todouble flu_todouble proc~aot_top_get_extdouble->proc~flu_todouble interface~lua_type lua_type proc~flu_isnoneornil->interface~lua_type interface~lua_isnumber lua_isNumber proc~flu_isnumber->interface~lua_isnumber interface~lua_settop lua_settop proc~flu_pop->interface~lua_settop interface~lua_tonumberx lua_tonumberx proc~flu_todouble->interface~lua_tonumberx

Called by

proc~~aot_top_get_extdouble~~CalledByGraph proc~aot_top_get_extdouble aot_top_get_extdouble interface~aot_top_get_val~8 aot_top_get_val interface~aot_top_get_val~8->proc~aot_top_get_extdouble proc~get_table_double get_table_double proc~get_table_double->interface~aot_top_get_val~8 proc~get_table_double_v get_table_double_v proc~get_table_double_v->interface~aot_top_get_val~8 proc~get_table_double_vvect get_table_double_vvect proc~get_table_double_vvect->interface~aot_top_get_val~8 proc~get_table_extdouble get_table_extdouble proc~get_table_extdouble->interface~aot_top_get_val~8 proc~get_table_extdouble_v get_table_extdouble_v proc~get_table_extdouble_v->interface~aot_top_get_val~8 proc~get_table_extdouble_vvect get_table_extdouble_vvect proc~get_table_extdouble_vvect->interface~aot_top_get_val~8 proc~get_table_integer get_table_integer proc~get_table_integer->interface~aot_top_get_val~8 proc~get_table_integer_v get_table_integer_v proc~get_table_integer_v->interface~aot_top_get_val~8 proc~get_table_integer_vvect get_table_integer_vvect proc~get_table_integer_vvect->interface~aot_top_get_val~8 proc~get_table_logical get_table_logical proc~get_table_logical->interface~aot_top_get_val~8 proc~get_table_logical_v get_table_logical_v proc~get_table_logical_v->interface~aot_top_get_val~8 proc~get_table_logical_vvect get_table_logical_vvect proc~get_table_logical_vvect->interface~aot_top_get_val~8 proc~get_table_long get_table_long proc~get_table_long->interface~aot_top_get_val~8 proc~get_table_long_v get_table_long_v proc~get_table_long_v->interface~aot_top_get_val~8 proc~get_table_long_vvect get_table_long_vvect proc~get_table_long_vvect->interface~aot_top_get_val~8 proc~get_table_quadruple get_table_quadruple proc~get_table_quadruple->interface~aot_top_get_val~8 proc~get_table_quadruple_v get_table_quadruple_v proc~get_table_quadruple_v->interface~aot_top_get_val~8 proc~get_table_quadruple_vvect get_table_quadruple_vvect proc~get_table_quadruple_vvect->interface~aot_top_get_val~8 proc~get_table_real get_table_real proc~get_table_real->interface~aot_top_get_val~8 proc~get_table_real_v get_table_real_v proc~get_table_real_v->interface~aot_top_get_val~8 proc~get_table_real_vvect get_table_real_vvect proc~get_table_real_vvect->interface~aot_top_get_val~8 proc~get_table_string get_table_string proc~get_table_string->interface~aot_top_get_val~8 proc~get_table_string_v get_table_string_v proc~get_table_string_v->interface~aot_top_get_val~8 proc~get_table_string_vvect get_table_string_vvect proc~get_table_string_vvect->interface~aot_top_get_val~8 proc~get_table_userdata get_table_userdata proc~get_table_userdata->interface~aot_top_get_val~8 proc~get_top_double_v get_top_double_v proc~get_top_double_v->interface~aot_top_get_val~8 proc~get_top_double_vvect get_top_double_vvect proc~get_top_double_vvect->interface~aot_top_get_val~8 proc~get_top_extdouble_v get_top_extdouble_v proc~get_top_extdouble_v->interface~aot_top_get_val~8 proc~get_top_extdouble_vvect get_top_extdouble_vvect proc~get_top_extdouble_vvect->interface~aot_top_get_val~8 proc~get_top_integer_v get_top_integer_v proc~get_top_integer_v->interface~aot_top_get_val~8 proc~get_top_integer_vvect get_top_integer_vvect proc~get_top_integer_vvect->interface~aot_top_get_val~8 proc~get_top_logical_v get_top_logical_v proc~get_top_logical_v->interface~aot_top_get_val~8 proc~get_top_logical_vvect get_top_logical_vvect proc~get_top_logical_vvect->interface~aot_top_get_val~8 proc~get_top_long_v get_top_long_v proc~get_top_long_v->interface~aot_top_get_val~8 proc~get_top_long_vvect get_top_long_vvect proc~get_top_long_vvect->interface~aot_top_get_val~8 proc~get_top_quadruple_v get_top_quadruple_v proc~get_top_quadruple_v->interface~aot_top_get_val~8 proc~get_top_quadruple_vvect get_top_quadruple_vvect proc~get_top_quadruple_vvect->interface~aot_top_get_val~8 proc~get_top_real_v get_top_real_v proc~get_top_real_v->interface~aot_top_get_val~8 proc~get_top_real_vvect get_top_real_vvect proc~get_top_real_vvect->interface~aot_top_get_val~8 proc~get_top_string_v get_top_string_v proc~get_top_string_v->interface~aot_top_get_val~8 proc~get_top_string_vvect get_top_string_vvect proc~get_top_string_vvect->interface~aot_top_get_val~8 interface~aot_get_val aot_get_val interface~aot_get_val->proc~get_table_extdouble interface~aot_get_val~2 aot_get_val interface~aot_get_val~2->proc~get_table_double interface~aot_get_val~2->proc~get_table_integer interface~aot_get_val~2->proc~get_table_logical interface~aot_get_val~2->proc~get_table_long interface~aot_get_val~2->proc~get_table_real interface~aot_get_val~2->proc~get_table_string interface~aot_get_val~2->proc~get_table_userdata interface~aot_get_val~3 aot_get_val interface~aot_get_val~3->proc~get_table_quadruple_vvect interface~aot_get_val~4 aot_get_val interface~aot_get_val~4->proc~get_table_quadruple_v interface~aot_get_val~5 aot_get_val interface~aot_get_val~5->proc~get_table_double_vvect interface~aot_get_val~5->proc~get_table_integer_vvect interface~aot_get_val~5->proc~get_table_logical_vvect interface~aot_get_val~5->proc~get_table_long_vvect interface~aot_get_val~5->proc~get_table_real_vvect interface~aot_get_val~5->proc~get_table_string_vvect interface~aot_get_val~6 aot_get_val interface~aot_get_val~6->proc~get_table_double_v interface~aot_get_val~6->proc~get_table_integer_v interface~aot_get_val~6->proc~get_table_logical_v interface~aot_get_val~6->proc~get_table_long_v interface~aot_get_val~6->proc~get_table_real_v interface~aot_get_val~6->proc~get_table_string_v interface~aot_get_val~7 aot_get_val interface~aot_get_val~7->proc~get_table_extdouble_vvect interface~aot_get_val~8 aot_get_val interface~aot_get_val~8->proc~get_table_extdouble_v interface~aot_get_val~9 aot_get_val interface~aot_get_val~9->proc~get_table_quadruple interface~aot_table_get_val aot_table_get_val interface~aot_table_get_val->proc~get_table_extdouble interface~aot_table_get_val~2 aot_table_get_val interface~aot_table_get_val~2->proc~get_table_double interface~aot_table_get_val~2->proc~get_table_integer interface~aot_table_get_val~2->proc~get_table_logical interface~aot_table_get_val~2->proc~get_table_long interface~aot_table_get_val~2->proc~get_table_real interface~aot_table_get_val~2->proc~get_table_string interface~aot_table_get_val~2->proc~get_table_userdata interface~aot_table_get_val~3 aot_table_get_val interface~aot_table_get_val~3->proc~get_table_quadruple_vvect interface~aot_table_get_val~4 aot_table_get_val interface~aot_table_get_val~4->proc~get_table_quadruple_v interface~aot_table_get_val~5 aot_table_get_val interface~aot_table_get_val~5->proc~get_table_double_vvect interface~aot_table_get_val~5->proc~get_table_integer_vvect interface~aot_table_get_val~5->proc~get_table_logical_vvect interface~aot_table_get_val~5->proc~get_table_long_vvect interface~aot_table_get_val~5->proc~get_table_real_vvect interface~aot_table_get_val~5->proc~get_table_string_vvect interface~aot_table_get_val~6 aot_table_get_val interface~aot_table_get_val~6->proc~get_table_double_v interface~aot_table_get_val~6->proc~get_table_integer_v interface~aot_table_get_val~6->proc~get_table_logical_v interface~aot_table_get_val~6->proc~get_table_long_v interface~aot_table_get_val~6->proc~get_table_real_v interface~aot_table_get_val~6->proc~get_table_string_v interface~aot_table_get_val~7 aot_table_get_val interface~aot_table_get_val~7->proc~get_table_extdouble_vvect interface~aot_table_get_val~8 aot_table_get_val interface~aot_table_get_val~8->proc~get_table_extdouble_v interface~aot_table_get_val~9 aot_table_get_val interface~aot_table_get_val~9->proc~get_table_quadruple interface~aot_top_get_val aot_top_get_val interface~aot_top_get_val->proc~get_top_quadruple_vvect interface~aot_top_get_val~2 aot_top_get_val interface~aot_top_get_val~2->proc~get_top_quadruple_v interface~aot_top_get_val~4 aot_top_get_val interface~aot_top_get_val~4->proc~get_top_double_vvect interface~aot_top_get_val~4->proc~get_top_integer_vvect interface~aot_top_get_val~4->proc~get_top_logical_vvect interface~aot_top_get_val~4->proc~get_top_long_vvect interface~aot_top_get_val~4->proc~get_top_real_vvect interface~aot_top_get_val~4->proc~get_top_string_vvect interface~aot_top_get_val~5 aot_top_get_val interface~aot_top_get_val~5->proc~get_top_double_v interface~aot_top_get_val~5->proc~get_top_integer_v interface~aot_top_get_val~5->proc~get_top_logical_v interface~aot_top_get_val~5->proc~get_top_long_v interface~aot_top_get_val~5->proc~get_top_real_v interface~aot_top_get_val~5->proc~get_top_string_v interface~aot_top_get_val~6 aot_top_get_val interface~aot_top_get_val~6->proc~get_top_extdouble_vvect interface~aot_top_get_val~7 aot_top_get_val interface~aot_top_get_val~7->proc~get_top_extdouble_v

Source Code

  subroutine aot_top_get_extdouble(val, ErrCode, L, default)
    type(flu_State) :: L !< Handle to the Lua script

    !> Value of the Variable in the script
    real(kind=xdble_k), intent(out) :: val

    !> Error code to indicate what kind of problem might have occured.
    integer, intent(out) :: ErrCode

    !> Some default value, that should be used, if the variable is not set in
    !! the Lua script.
    real(kind=xdble_k), optional, intent(in) :: default

    logical :: not_retrievable

    ErrCode = 0
    not_retrievable = .false.

    if (flu_isNoneOrNil(L, -1)) then
      ErrCode = ibSet(ErrCode, aoterr_NonExistent)
      not_retrievable = .true.
    else
      if (flu_isNumber(L, -1)) then
        val = real(flu_toDouble(L, -1), kind=xdble_k)
      else
        ErrCode = ibSet(ErrCode, aoterr_WrongType)
        ErrCode = ibSet(ErrCode, aoterr_Fatal)
        not_retrievable = .true.
      end if
    end if

    if (not_retrievable) then
      if (present(default)) then
        val = default
      else
        ErrCode = ibSet(ErrCode, aoterr_Fatal)
      end if
    end if
    call flu_pop(L)

  end subroutine aot_top_get_extdouble