This subroutine looks for a given label in the given boundary conditions table, and returns the according table handle. Note, that this should usually not be necessary, as the number of the header is given by the ordering in the bc_header_type, and you can use the desired position directly to look up a specific bc in the configuration script.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=LabelLen), | intent(in) | :: | label |
The label to look for |
||
integer, | intent(in) | :: | bc_table |
Handle to the boundary_condition table, to look in |
||
type(flu_State) | :: | conf |
Handle of the Lua script to use |
|||
integer, | intent(out) | :: | thandle |
Returned handle of to the entry providing the requested label |
subroutine tem_open_bc( label, bc_table, conf, thandle )
! ---------------------------------------------------------------------------
!> The label to look for
character(len=LabelLen), intent(in) :: label
!> Handle to the boundary_condition table, to look in
integer, intent(in) :: bc_table
!> Handle of the Lua script to use
type(flu_State) :: conf
!> Returned handle of to the entry providing the requested label
integer, intent(out) :: thandle
! ---------------------------------------------------------------------------
character(len=LabelLen) :: bc_name
integer :: myHandle
integer :: iBC, iError
integer :: nBCs
! ---------------------------------------------------------------------------
nBCs = aot_table_length(L=conf, thandle=bc_table)
! Default thandle to nothing found.
thandle = 0
do iBC=1,nBCs
call aot_table_open( L = conf, &
& parent = bc_table, &
& thandle = myHandle, &
& pos = iBC )
if (myHandle /= 0) then
call aot_get_val( L = conf, &
& thandle = myHandle, &
& val = bc_name, &
& ErrCode = iError, &
& key = 'label', &
& default = 'unnamed' )
if (adjustl(bc_name) == adjustl(label)) then
! Found the matching boundary table, returning it...
thandle = myHandle
exit
end if
end if
call aot_table_close(L=conf, thandle=myHandle)
end do
end subroutine tem_open_bc