Initialize time reduction.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_reduction_transient_type), | intent(inout) | :: | me |
current time reduction |
||
integer, | intent(in) | :: | nElems |
Number of elements in tree |
||
integer, | intent(in) | :: | nComponents |
nComponents of operation variable |
||
integer, | intent(in) | :: | nDofs |
Number of degrees of freedom |
subroutine tem_reduction_transient_init(me, nElems, nComponents, nDofs) ! -------------------------------------------------------------------- ! !> current time reduction type(tem_reduction_transient_type), intent(inout) :: me !> Number of elements in tree integer, intent(in) :: nElems !> nComponents of operation variable integer, intent(in) :: nComponents !> Number of degrees of freedom integer, intent(in) :: nDofs ! -------------------------------------------------------------------- ! ! -------------------------------------------------------------------- ! me%nTimes = 0 me%last = 1 me%curr = 2 me%nDofs = nDofs me%nComponents = nComponents me%nEntries = nElems * nComponents * nDofs allocate(me%val(me%nEntries,2)) select case(trim(me%config%reduceType)) case('min') me%val(:,me%curr) = huge(1.0_rk) case('max') me%val(:,me%curr) = tiny(1.0_rk) case('sum', 'average') me%val(:,me%curr) = 0.0_rk case default write(logUnit(1),*)'Unknown time reduction operation: '// & & trim(me%config%reduceType) call tem_abort() end select end subroutine tem_reduction_transient_init