run Subroutine

private subroutine run(self)

时间积分

Type Bound

time_integrator

Arguments

Type IntentOptional Attributes Name
class(time_integrator), intent(inout) :: self

Contents

Source Code

run

Source Code

    subroutine run(self)
        class(time_integrator), intent(inout) :: self
        integer :: nstep, nsize, maxstep

        nstep = max(int(tic_obj%dt/self%dt), 1)  ! 一次积分和输出的步数
        nsize = dim*pif_obj%numbers(1)
        maxstep = int(tic_obj%stop_time/self%dt)  ! 最大步数

        call display(nstep, 'number of steps per output:', inline=.true.)
        if (cli_obj%debug_mode) write (lgr_obj%unit, lgr_obj%fmt) 'nstep', nstep
        call terminal_obj%info('start time integration')

        call leapfrog_init(solver, rgn_obj%loc, rgn_obj%vel, rgn_obj%acc, self%cur_time, self%dt, nsize)

        do while (self%cur_time < tic_obj%stop_time)
            call leapfrog(solver, rgn_obj%loc, rgn_obj%vel, rgn_obj%acc, &
                          self%cur_time, nstep, self%dt, nsize)
            call mem_obj%check(pairs%len, pif_obj%numbers(4))
            call stat%update(rgn_obj%loc)           ! 更新统计信息
            call pif_obj%write(self%cur_time)
            call progress_bar(int(self%cur_time/self%dt), maxstep, advance=.false.)
        end do
        call progress_bar(int(self%cur_time/self%dt), maxstep, advance=.true.)

    end subroutine run