Checks if the elastic_xs_threshold (threshold for elastic XS) and inelastic_xs_threshold (threshold for inelastic XS) conditions are already fulfilled.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | largest_elastic_xs_ |
largest elastic XS in the block |
||
real(kind=dp), | intent(in) | :: | largest_inelastic_xs_ |
largest inelastic XS in the block |
||
integer(kind=int32), | intent(inout) | :: | consecutive_elastic_ |
number of consecutive blocks meeting condition on elastic XS |
||
integer(kind=int32), | intent(inout) | :: | consecutive_inelastic_ |
number of consecutive blocks meeting condition on inelastic XS |
||
logical, | intent(inout) | :: | terminate_ |
flag to indicate termination of loop based on thresholds |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | private | :: | is_elastic_xs_within_threshold | ||||
logical, | private | :: | is_inelastic_xs_within_threshold |
subroutine check_cross_section_thresholds(largest_elastic_xs_, &
largest_inelastic_xs_, consecutive_elastic_, consecutive_inelastic_, &
terminate_)
!! Checks if the elastic_xs_threshold (threshold for elastic XS)
!! and inelastic_xs_threshold (threshold for inelastic XS) conditions
!! are already fulfilled.
!---------------------------------------------------------------------!
real(dp), intent(in) :: largest_elastic_xs_
!! largest elastic XS in the block
real(dp), intent(in) :: largest_inelastic_xs_
!! largest inelastic XS in the block
integer(int32), intent(inout) :: consecutive_elastic_
!! number of consecutive blocks meeting condition on elastic XS
integer(int32), intent(inout) :: consecutive_inelastic_
!! number of consecutive blocks meeting condition on inelastic XS
logical, intent(inout) :: terminate_
!! flag to indicate termination of loop based on thresholds
!---------------------------------------------------------------------!
logical :: is_elastic_xs_within_threshold, is_inelastic_xs_within_threshold
!---------------------------------------------------------------------!
terminate_ = .false.
is_elastic_xs_within_threshold &
= (largest_elastic_xs_ <= elastic_xs_threshold)
is_inelastic_xs_within_threshold &
= (largest_inelastic_xs_ <= inelastic_xs_threshold)
if (is_elastic_xs_within_threshold) then
consecutive_elastic_ = consecutive_elastic_ + 1
else
consecutive_elastic_ = 0
endif
if (is_inelastic_xs_within_threshold) then
consecutive_inelastic_ = consecutive_inelastic_ + 1
else
consecutive_inelastic_ = 0
endif
if ((consecutive_elastic_ >= consecutive_blocks_threshold).and. &
(consecutive_inelastic_ >= consecutive_blocks_threshold)) then
terminate_ = .true.
endif
!---------------------------------------------------------------------!
end subroutine check_cross_section_thresholds