Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(Model), | intent(inout) | :: | this | |||
real(kind=prec), | intent(in) | :: | tn |
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