type_variable_set Subroutine

private subroutine type_variable_set(self, value)

Type Bound

type_variable

Arguments

Type IntentOptional Attributes Name
class(type_variable), intent(inout) :: self
real(kind=real64), intent(in) :: value(:)

Source Code

    subroutine type_variable_set(self, value)
        implicit none
        class(type_variable), intent(inout) :: self
        real(real64), intent(in) :: value(:)
        integer(int32) :: i

        ! new, pre に値を設定
        self%new(:) = value(:)
        self%pre(:) = value(:)

        ! old の全履歴に値を設定
        ! rankの値に関わらず、ループで全ての履歴を一度に設定する
        if (self%rank > 0) then
            do i = 1, self%rank
                self%old(:, i) = value(:)
            end do
        end if

        ! 時間微分項はゼロに初期化
        self%dif(:) = 0.0d0

    end subroutine type_variable_set