tem_get_required_Lua Subroutine

public subroutine tem_get_required_Lua(L, fileList, labelList)

Obtain the recorded open files by track_rq from the Lua state.

The track_rq function tracks all requires that are made after its call and stores the corresponding filename along with the given module name. These two lists can be retrieved with this routine.

Arguments

Type IntentOptional Attributes Name
type(flu_State) :: L

Lua state to get the requires from

character(len=PathLen), intent(out), allocatable :: fileList(:)

List of required filenames in the Lua state.

character(len=LabelLen), intent(out), allocatable :: labelList(:)

List of the module names associated to the corresponding files.


Calls

proc~~tem_get_required_lua~~CallsGraph proc~tem_get_required_lua tem_get_required_Lua aot_get_val aot_get_val proc~tem_get_required_lua->aot_get_val aot_table_close aot_table_close proc~tem_get_required_lua->aot_table_close aot_table_open aot_table_open proc~tem_get_required_lua->aot_table_open

Called by

proc~~tem_get_required_lua~~CalledByGraph proc~tem_get_required_lua tem_get_required_Lua proc~tem_open_distconf tem_open_distconf proc~tem_open_distconf->proc~tem_get_required_lua proc~tem_open_distconf_array tem_open_distconf_array proc~tem_open_distconf_array->proc~tem_get_required_lua proc~tem_restart_readheader tem_restart_readHeader proc~tem_restart_readheader->proc~tem_open_distconf proc~tem_load_restart tem_load_restart proc~tem_load_restart->proc~tem_restart_readheader

Source Code

  subroutine tem_get_required_Lua(L, fileList, labelList)
    ! ---------------------------------------------------------------------------
    !> Lua state to get the requires from
    type(flu_State) :: L
    !> List of required filenames in the Lua state.
    character(len=PathLen), allocatable, intent(out) :: fileList(:)
    !> List of the module names associated to the corresponding files.
    character(len=LabelLen), allocatable, intent(out) :: labelList(:)
    ! ---------------------------------------------------------------------------
    integer :: track_handle
    integer :: of_handle
    integer :: list_handle
    integer :: nFiles
    integer :: iError
    integer :: i
    ! ---------------------------------------------------------------------------

    call aot_table_open( L       = L,                                          &
      &                  thandle = track_handle,                               &
      &                  key     = "track_rq" )
    call aot_table_open( L       = L,                                          &
      &                  parent  = track_handle,                               &
      &                  thandle = of_handle,                                  &
      &                  key     = "open_files" )
    call aot_get_val( L       = L,                                             &
      &               val     = nFiles,                                        &
      &               ErrCode = iError,                                        &
      &               thandle = of_handle,                                     &
      &               key     = "count" )
    allocate(fileList(nFiles))
    allocate(labelList(nFiles))

    call aot_table_open( L       = L,                                          &
      &                  parent  = of_handle,                                  &
      &                  thandle = list_handle,                                &
      &                  key     = "name" )
    do i=1,nFiles
      call aot_get_val( L       = L,                                           &
        &               val     = labelList(i),                                &
        &               ErrCode = iError,                                      &
        &               thandle = list_handle,                                 &
        &               pos     = i )
    end do
    call aot_table_close(L, list_handle)

    call aot_table_open( L       = L,                                          &
      &                  parent  = of_handle,                                  &
      &                  thandle = list_handle,                                &
      &                  key     = "file" )
    do i=1,nFiles
      call aot_get_val( L       = L,                                           &
        &               val     = fileList(i),                                 &
        &               ErrCode = iError,                                      &
        &               thandle = list_handle,                                 &
        &               pos     = i )
    end do
    call aot_table_close(L, list_handle)
    call aot_table_close(L, of_handle)
    call aot_table_close(L, track_handle)

  end subroutine tem_get_required_Lua