Read the tracker variables from tracking subtables defined in configuration from the main lua file
If tracking is just a single table with single tracking entry then load only one tracking log exists with one or more variables using tem_load_trackingHeader_single. Else if tracking is table of many log then allocate log and load each log type using tem_load_trackingHeader_single Setup the values for the tracking entities
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_tracking_config_type), | intent(out) | :: | config |
list of the tracking entities to create |
||
type(flu_State) | :: | conf |
handle of the lua config file |
|||
integer, | intent(in) | :: | sub_handle |
table sub-handle for the tracking table |
subroutine tem_load_trackingConfig(config, conf, sub_handle)
! -------------------------------------------------------------------- !
!> list of the tracking entities to create
type( tem_tracking_config_type ), intent(out) :: config
!> handle of the lua config file
type( flu_state ) :: conf
!> table sub-handle for the tracking table
integer, intent(in) :: sub_handle
! -------------------------------------------------------------------- !
integer :: iError ! error flag handle
integer, allocatable :: vError(:)
!> number of requested variables
integer :: nRequestedVars
! -------------------------------------------------------------------- !
call aot_get_val( L = conf, &
& thandle = sub_handle, &
& val = config%label, &
& ErrCode = iError, &
& key = 'label', &
& default = 'unnamed_track' )
write(logUnit(1),*) 'Tracking label: '//trim( config%label )
call aot_get_val( val = config%varName, &
& ErrCode = vError, &
& maxLength = 100, &
& L = conf, &
& thandle = sub_handle, &
& key = 'variable' )
if ( any(btest(vError, aoterr_Fatal)) ) then
write(logUnit(1),*) 'FATAL Error occured, while retrieving'
write(logUnit(1),*) 'list of variables to track in '//trim(config%label)
call tem_abort()
end if
nRequestedVars = size(config%varName)
! load time control to output tracking
call tem_timeControl_load( conf = conf, &
& parent = sub_handle, &
& me = config%timeControl )
call tem_timeControl_dump(config%timeControl, logUnit(2))
! Where to store the tracking file?
call aot_get_val( L = conf, &
& thandle = sub_handle, &
& val = config%prefix, &
& ErrCode = iError, &
& key = 'folder', &
& default = '' )
! Load SPATIAL reductions
call tem_load_reduction_spatial( &
& conf = conf, &
& parent = sub_handle, &
& redSpatial_config = config%redSpatial_config )
if( config%redSpatial_config%active ) then
! Check if the number of reductions correspond to the number of variables
! in the system
if( size( config%redSpatial_config%reduceType ) /= nRequestedVars ) then
write(logUnit(1),*) 'The number of defined reductions does not ' &
& //'correspond to the '
write(logUnit(1),*)'number of variables in the system. '
call tem_abort()
end if
end if
! Load output table for vis_kind
call hvs_output_load( me = config%output_config, &
& conf = conf, &
& parent = sub_handle, &
& isReduce = config%redSpatial_config%active )
! load tracking object shapes like point, line, plane
call tem_load_shape( conf = conf, &
& parent = sub_handle, &
& me = config%geometry, &
& reqSegments = config%output_config%useGetPoint )
if( size( config%geometry) < 1) then
write(logUnit(1),*)'The geometrical objects for the tracker are not '// &
& 'defined correctly.'
call tem_abort()
end if
end subroutine tem_load_trackingConfig