Euler_timeIntegrator Subroutine

public subroutine Euler_timeIntegrator(this, tn)

Arguments

TypeIntentOptionalAttributesName
class(Model), intent(inout) :: this
real(kind=prec), intent(in) :: tn

Contents

Source Code


Source Code

  subroutine Euler_timeIntegrator(this,tn)
    implicit none
    class(Model),intent(inout) :: this
    real(prec),intent(in) :: tn
    ! Local
    real(prec) :: tRemain
    real(prec) :: dtLim

    dtLim = this%dt ! Get the max time step size from the dt attribute
    do while(this%t < tn)

      tRemain = tn-this%t
      this%dt = min(dtLim,tRemain)
      call this%CalculateTendency()
      call this%UpdateSolution()
      this%t = this%t+this%dt

    enddo

    this%dt = dtLim

  endsubroutine Euler_timeIntegrator