tem_load_spacetime_table Subroutine

private subroutine tem_load_spacetime_table(me, conf, parent, key, nComp, errCode)

This routine loads table of spacetime functions from the given key or pos

NOTE: If any of the entries in the table can not be interpreted as a space-time function, none will be returne at all, and an error code of -1 will be set. "Me" will be deallocated in this case. The routine first attempts to read the given key as a single space-time function definition, only if that fails, it tries to read it as a table of functions.

Arguments

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

spacetime fun information

type(flu_State) :: conf

lua state handle

integer, intent(inout), optional :: parent

aotus parent handle

character(len=*), intent(in) :: key

name of the variable which is defined as spacetime function

integer, intent(in), optional :: nComp

number of components of the variable

integer, intent(out), optional :: errCode

errCode /=0, space time function fails use errCode to abort code outside this routine call


Calls

proc~~tem_load_spacetime_table~~CallsGraph proc~tem_load_spacetime_table tem_load_spacetime_table proc~tem_load_spacetime_single tem_load_spacetime_single proc~tem_load_spacetime_table->proc~tem_load_spacetime_single proc~aot_table_close aot_table_close proc~tem_load_spacetime_table->proc~aot_table_close proc~aot_table_open aot_table_open proc~tem_load_spacetime_table->proc~aot_table_open proc~aot_table_length aot_table_length proc~tem_load_spacetime_table->proc~aot_table_length proc~tem_load_spacetime_single->proc~tem_load_spacetime_single proc~tem_load_spacetime_single->proc~aot_table_open proc~load_spacetime_predefined load_spacetime_predefined proc~tem_load_spacetime_single->proc~load_spacetime_predefined proc~aot_exists aot_exists proc~tem_load_spacetime_single->proc~aot_exists interface~tem_load_shape tem_load_shape proc~tem_load_spacetime_single->interface~tem_load_shape proc~load_spacetime_asconst load_spacetime_asConst proc~tem_load_spacetime_single->proc~load_spacetime_asconst proc~aot_type_of aot_type_of proc~tem_load_spacetime_single->proc~aot_type_of proc~aot_reference_for aot_reference_for proc~tem_load_spacetime_single->proc~aot_reference_for proc~aot_fun_open aot_fun_open proc~tem_load_spacetime_single->proc~aot_fun_open proc~aot_fun_close aot_fun_close proc~tem_load_spacetime_single->proc~aot_fun_close proc~aot_get_val~2 aot_get_val proc~tem_load_spacetime_single->proc~aot_get_val~2 proc~tem_abort tem_abort proc~tem_load_spacetime_single->proc~tem_abort proc~load_spacetime_predefined->proc~tem_abort proc~upper_to_lower upper_to_lower proc~load_spacetime_predefined->proc~upper_to_lower interface~tem_load_miescatter_magneticfieldy tem_load_miescatter_magneticfieldy proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldy proc~tem_polygon_material_multi_load tem_polygon_material_multi_load proc~load_spacetime_predefined->proc~tem_polygon_material_multi_load proc~tem_load_spatial tem_load_spatial proc~load_spacetime_predefined->proc~tem_load_spatial proc~tem_aps_load_coupling tem_aps_load_coupling proc~load_spacetime_predefined->proc~tem_aps_load_coupling proc~tem_load_temporal tem_load_temporal proc~load_spacetime_predefined->proc~tem_load_temporal interface~tem_load_miescatter_displacementfieldz tem_load_miescatter_displacementfieldz proc~load_spacetime_predefined->interface~tem_load_miescatter_displacementfieldz interface~tem_load_miescatter_magneticfieldx tem_load_miescatter_magneticfieldx proc~load_spacetime_predefined->interface~tem_load_miescatter_magneticfieldx proc~tem_load_cylindricalwave tem_load_cylindricalWave proc~load_spacetime_predefined->proc~tem_load_cylindricalwave proc~tem_load_acoustic_pulse tem_load_acoustic_pulse proc~load_spacetime_predefined->proc~tem_load_acoustic_pulse proc~tem_polygon_material_single_load tem_polygon_material_single_load proc~load_spacetime_predefined->proc~tem_polygon_material_single_load tem_precice_load_coupling tem_precice_load_coupling proc~load_spacetime_predefined->tem_precice_load_coupling proc~tem_load_shapes tem_load_shapes interface~tem_load_shape->proc~tem_load_shapes proc~tem_load_shape_single tem_load_shape_single interface~tem_load_shape->proc~tem_load_shape_single proc~load_spacetime_asconst->proc~aot_get_val~2 mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_load_spacetime_table~~CalledByGraph proc~tem_load_spacetime_table tem_load_spacetime_table interface~tem_load_spacetime tem_load_spacetime interface~tem_load_spacetime->proc~tem_load_spacetime_table proc~tem_variable_loadmapping_single tem_variable_loadMapping_single proc~tem_variable_loadmapping_single->interface~tem_load_spacetime proc~tem_variable_load_single tem_variable_load_single proc~tem_variable_load_single->interface~tem_load_spacetime proc~tem_variable_loadmapping_vector tem_variable_loadMapping_vector proc~tem_variable_loadmapping_vector->proc~tem_variable_loadmapping_single interface~tem_variable_loadmapping tem_variable_loadMapping interface~tem_variable_loadmapping->proc~tem_variable_loadmapping_single interface~tem_variable_loadmapping->proc~tem_variable_loadmapping_vector interface~tem_variable_load tem_variable_load interface~tem_variable_load->proc~tem_variable_load_single proc~tem_variable_load_vector tem_variable_load_vector interface~tem_variable_load->proc~tem_variable_load_vector proc~tem_variable_load_vector->proc~tem_variable_load_single proc~tem_load_bc_state tem_load_bc_state proc~tem_load_bc_state->interface~tem_variable_loadmapping

Contents


Source Code

  subroutine tem_load_spacetime_table( me, conf, parent, key, nComp, &
    &                                  errCode )
    ! -------------------------------------------------------------------- !
    !> spacetime fun information
    type(tem_spacetime_fun_type), allocatable, intent(out) :: me(:)
    !> lua state handle
    type(flu_State) :: conf
    !> aotus parent handle
    integer, intent(inout), optional :: parent
    !> name of the variable which is defined as spacetime function
    character(len=*), intent(in) :: key
    !> number of components of the variable
    integer, intent(in), optional :: nComp
    !> errCode /=0, space time function fails
    !! use errCode to abort code outside this routine call
    integer, optional, intent(out) :: errCode
    ! -------------------------------------------------------------------- !
    !> aotus table handle
    integer :: thandle
    ! counter variables
    integer :: nSt, iSt
    integer :: errCode_loc
    character(len=labelLen) :: buffer
    type(tem_st_fun_listElem_type), pointer :: current
    ! -------------------------------------------------------------------- !
    current => NULL()
    nSt = 1
    allocate(me(nSt))
    ! read in a single spacetime function with given key
    call tem_load_spacetime_single( me      = me(1),      &
      &                             conf    = conf,       &
      &                             parent  = parent,     &
      &                             key     = key,        &
      &                             nComp   = nComp,      &
      &                             errCode = errCode_loc )

    if (errCode_loc /= 0) then
      write(logUnit(3),*) 'Error loading spacetime function from key ' &
       &                  // trim(key)
      write(logUnit(3),*) 'Try to load it from table'

      ! Error loading spacetime function directly via key
      ! Try opening as table of space time functions
      call aot_table_open( L       = conf,     &
        &                  thandle = thandle,  &
        &                  parent  = parent,   &
        &                  key     = trim(key) )

      nSt = aot_table_length( L=conf, thandle=thandle )
      write(logUnit(3),*) 'Multiple spacetime functions are defined'
      write(buffer,'(i3)') nSt
      write(logUnit(3),*) 'Number of spacetime fun tables '//trim(buffer)
      deallocate(me)
      allocate(me(nSt))
      do iSt = 1, nSt
        write(buffer,'(i3)') iSt
        write(logUnit(3),*)
        write(logUnit(3),*) 'loading space time function at pos: '//trim(buffer)
        call tem_load_spacetime_single( me      = me(iSt),    &
          &                             conf    = conf,       &
          &                             parent  = thandle,    &
          &                             pos     = iSt,        &
          &                             nComp   = nComp,      &
          &                             errCode = errCode_loc )

        if (errCode_loc /= 0) then
          write(logUnit(3),*) 'Error loading spacetime function at pos ' &
            &                 //trim(buffer)
          write(logUnit(3),*) 'Aborting the attempt to more functions '
          EXIT
        else
        end if
      end do
      call aot_table_close( L = conf, thandle = thandle )
    end if

    if (errCode_loc /= 0) then
      deallocate(me)
    else
      write(logUnit(1),*) 'Space-time function for key '//trim(key)//':'
      do iSt=1,nSt
          write(logUnit(1),*) '      pos ', iSt, &
            &                 ' is defined as ' // trim(me(iSt)%fun_kind)
      end do
    end if

    if (present(errCode)) errCode = errCode_loc

  end subroutine tem_load_spacetime_table