subroutine setup_adi()
! We initialize the flags for the adi feature
use adi_data, only: tSetDelayAllDoubsInits, tDelayAllDoubsInits, &
tAllDoubsInitiators, tDelayGetRefs, &
tReadRefs, maxNRefs, SIUpdateOffset
use adi_references, only: enable_adi, reallocate_ilutRefAdi, &
reset_coherence_counter
implicit none
call reallocate_ilutRefAdi(maxNRefs)
! If using adi with dynamic SIs, also use a dynamic corespace by default
call setup_dynamic_core()
! Check if one of the keywords is specified as delayed
if (tSetDelayAllDoubsInits .and. tAllDoubsInitiators) then
tAllDoubsInitiators = .false.
tDelayAllDoubsInits = .true.
end if
! Check if we want to get the references right away
if (.not. (tReadRefs .or. tReadPops)) tDelayGetRefs = .true.
if (tDelayAllDoubsInits) tDelayGetRefs = .true.
! Give a status message
if (tAllDoubsInitiators) then
call enable_adi()
tAdiActive = .true.
end if
! there is a minimum cycle lenght for updating the number of SIs, as the reference population
! needs some time to equilibrate
nRefUpdateInterval = max(SIUpdateInterval, 500)
SIUpdateOffset = 0
! Initialize the logging variables
call reset_coherence_counter()
end subroutine setup_adi