LowStorageRK2_timeIntegrator Subroutine

public subroutine LowStorageRK2_timeIntegrator(this, tn)

Arguments

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

Contents


Source Code

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

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

      t0 = this%t
      tRemain = tn-this%t
      this%dt = min(dtLim,tRemain)
      do m = 1,2
        call this%CalculateTendency()
        call this%UpdateGRK2(m)
        this%t = t0+rk2_b(m)*this%dt
      enddo

      this%t = t0+this%dt

    enddo

    this%dt = dtLim

  endsubroutine LowStorageRK2_timeIntegrator