Load variables, parent scheme and conditions defined in lua file. This routine serves as a wrapper and calls the single routine which loads the various arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_depend_type), | intent(inout), | allocatable | :: | me(:) | list of depend types to be filled |
|
type(flu_state), | intent(in) | :: | conf | lua state to read from |
||
integer, | intent(in) | :: | parent | parent table identifier |
||
character(len=*), | intent(in) | :: | label | label to identify depend type |
||
logical, | intent(in), | optional | :: | requireCond | if true? load condition table for each variable |
subroutine tem_load_depend_vector(me, conf, parent, label, requireCond)
!---------------------------------------------------------------------------
!> list of depend types to be filled
type(tem_depend_type), allocatable, intent(inout) :: me(:)
!> lua state to read from
type(flu_state), intent(in) :: conf
!> parent table identifier
integer, intent(in) :: parent
!> label to identify depend type
character(len=*), intent(in) :: label
!> if true? load condition table for each variable
logical, optional, intent(in) :: requireCond
!---------------------------------------------------------------------------
integer :: iDep, nDeps
integer :: dep_handle ! local depend table handle
integer :: dep_sub_handle ! local depend table handle
!---------------------------------------------------------------------------
call tem_horizontalSpacer(fUnit = logUnit(1))
write(logUnit(1),*) 'loading depend table of: '//trim(label)
! Open the depend table
call aot_table_open( L = conf, &
& parent = parent, &
& thandle = dep_handle, &
& key = 'depend' )
if (dep_handle .ne. 0) then
! Check if there are multiple members inside depend
call aot_table_open( L = conf, &
& parent = dep_handle, &
& thandle = dep_sub_handle, &
& pos = 1 )
! If there is only one member, call the load routine once
if (dep_sub_handle .eq. 0) then
allocate(me(1))
call aot_table_close( L = conf, thandle = dep_sub_handle )
call tem_load_depend_single( me = me(1), &
& conf = conf, &
& parent = dep_handle, &
& label = label, &
& requireCond = requireCond )
else
call aot_table_close( L = conf, thandle = dep_sub_handle )
nDeps = aot_table_length( L = conf, thandle = dep_handle )
allocate( me( nDeps ))
! Read the subtables individually
do iDep = 1, nDeps
call aot_table_open( L = conf, &
& parent = dep_handle, &
& thandle = dep_sub_handle, &
& pos = iDep )
call tem_load_depend_single( me = me(iDep), &
& conf = conf, &
& parent = dep_sub_handle, &
& label = label, &
& requireCond = requireCond )
call aot_table_close( L = conf, thandle = dep_sub_handle )
end do
end if
else
write(logUnit(1),*) 'depend table is not defined'
end if
call aot_table_close( L = conf, thandle = dep_handle )
call tem_horizontalSpacer(fUnit = logUnit(1))
end subroutine tem_load_depend_vector