tem_load_tracking Subroutine

public subroutine tem_load_tracking(me, conf, parent)

Read the tracker configuration from the main lua file

Setup the values for the tracking entities

Arguments

Type IntentOptional Attributes Name
type(tem_tracking_type), intent(out) :: me

list of the trackingeentities to create

type(flu_State) :: conf

handle of the lua config file

integer, optional :: parent

if the tracking table is a child-table of some other table, use the parent as a reference


Calls

proc~~tem_load_tracking~~CallsGraph proc~tem_load_tracking tem_load_tracking aot_table_close aot_table_close proc~tem_load_tracking->aot_table_close aot_table_length aot_table_length proc~tem_load_tracking->aot_table_length aot_table_open aot_table_open proc~tem_load_tracking->aot_table_open proc~tem_horizontalspacer tem_horizontalSpacer proc~tem_load_tracking->proc~tem_horizontalspacer proc~tem_load_trackingconfig tem_load_trackingConfig proc~tem_load_tracking->proc~tem_load_trackingconfig aot_get_val aot_get_val proc~tem_load_trackingconfig->aot_get_val interface~tem_load_shape tem_load_shape proc~tem_load_trackingconfig->interface~tem_load_shape proc~hvs_output_load hvs_output_load proc~tem_load_trackingconfig->proc~hvs_output_load proc~tem_abort tem_abort proc~tem_load_trackingconfig->proc~tem_abort proc~tem_load_reduction_spatial tem_load_reduction_spatial proc~tem_load_trackingconfig->proc~tem_load_reduction_spatial proc~tem_timecontrol_dump tem_timeControl_dump proc~tem_load_trackingconfig->proc~tem_timecontrol_dump proc~tem_timecontrol_load tem_timeControl_load proc~tem_load_trackingconfig->proc~tem_timecontrol_load proc~tem_load_shape_single tem_load_shape_single interface~tem_load_shape->proc~tem_load_shape_single proc~tem_load_shapes tem_load_shapes interface~tem_load_shape->proc~tem_load_shapes proc~hvs_output_load->aot_table_close proc~hvs_output_load->aot_table_open proc~hvs_output_load->aot_get_val proc~hvs_output_load->proc~tem_abort proc~hvs_vtk_config_load hvs_vtk_config_load proc~hvs_output_load->proc~hvs_vtk_config_load proc~upper_to_lower upper_to_lower proc~hvs_output_load->proc~upper_to_lower mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_load_reduction_spatial->aot_table_close proc~tem_load_reduction_spatial->aot_table_length proc~tem_load_reduction_spatial->aot_table_open proc~tem_load_reduction_single tem_load_reduction_single proc~tem_load_reduction_spatial->proc~tem_load_reduction_single proc~tem_time_dump tem_time_dump proc~tem_timecontrol_dump->proc~tem_time_dump proc~tem_timecontrol_load->aot_table_close proc~tem_timecontrol_load->aot_table_open proc~tem_timecontrol_load->aot_get_val proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load->proc~tem_time_default_zero proc~tem_time_load tem_time_load proc~tem_timecontrol_load->proc~tem_time_load proc~tem_time_needs_reduce tem_time_needs_reduce proc~tem_timecontrol_load->proc~tem_time_needs_reduce proc~tem_time_never tem_time_never proc~tem_timecontrol_load->proc~tem_time_never

Source Code

  subroutine tem_load_tracking(me, conf, parent)
    ! -------------------------------------------------------------------- !
    !> list of the trackingeentities to create
    type( tem_tracking_type ), intent(out) :: me
    !> handle of the lua config file
    type( flu_state ) :: conf
    !> if the tracking table is a child-table of some other table,
    !! use the parent as a reference
    integer, optional :: parent
    ! -------------------------------------------------------------------- !
    integer :: tc_handle, sub_handle
    integer :: iTrack, nTracks
    ! -------------------------------------------------------------------- !

    ! Read the number of trackings in the lua file
    call aot_table_open( L       = conf,       &
      &                  thandle = tc_handle,  &
      &                  key     = 'tracking', &
      &                  parent  = parent      )

    if (tc_handle == 0) then
      write(logUnit(1),*) 'No Tracking entities found!'
      call aot_table_close(L=conf, thandle=tc_handle)
      call tem_horizontalSpacer(fUnit=logUnit(1))
      me%control%nActive = 0
      me%control%nDefined = 0
      allocate( me%config(0) )
      allocate( me%instance(0) )
      return
    else ! track entity exists.
      me%control%active = .true.
    end if

    write(logUnit(1),*) 'Loading tracking ...'
    ! Check whether tracking had a subtable
    ! If no, then it is a single table, load single tracking entry
    ! else load multiple tables, open tracking subtable
    call aot_table_open( L       = conf,       &
      &                  parent  = tc_handle,  &
      &                  thandle = sub_handle, &
      &                  pos     = 1           )

    ! Only single table
    if (sub_handle == 0) then
      nTracks = 1
      write(logUnit(1),*) 'Tracking is a single table'
      allocate( me%config(1) )
      call tem_load_trackingConfig( conf       = conf,         &
        &                           sub_handle = tc_handle,    &
        &                           config     = me%config(1)  )
      call aot_table_close(L=conf, thandle=sub_handle)
    else ! Multiple table
      call aot_table_close(L=conf, thandle=sub_handle)
      nTracks = aot_table_length(L=conf, thandle=tc_handle)
      ! Allocate the defined number of tracking entities
      allocate( me%config( nTracks ))
      write(logUnit(1),"(A,I0)") 'Number of Tracking entities: ', nTracks

      ! Loop over all the definitions and assign the variables from the lua
      ! file on the tem_tracking_type.
      ! Inside this routine it will open tracking subtable. Each subtable
      ! contains one or more tracking variables the stuff is done in the
      ! routine tem_load_trackingConfig
      do iTrack = 1, nTracks
        write(logUnit(1),"(A,I0)") 'Loading tracker: ', iTrack
        call aot_table_open( L       = conf,       &
          &                  parent  = tc_handle,  &
          &                  thandle = sub_handle, &
          &                  pos     = iTrack      )
        call tem_load_trackingConfig( conf       = conf,             &
          &                           sub_handle = sub_handle,       &
          &                           config     = me%config(iTrack) )
        call aot_table_close(L=conf, thandle=sub_handle)
        write(logUnit(1),"(A,I0)") 'Done tracker ', iTrack
      end do
    end if ! sub_handle

    ! me%control%nActive = nTracks
    me%control%nDefined = nTracks
    allocate(me%instance(nTracks))

    call aot_table_close(L=conf, thandle=tc_handle) ! close tracking table
    call tem_horizontalSpacer(fUnit=logUnit(1))

  end subroutine tem_load_tracking