ForwardStep_Model Subroutine

public subroutine ForwardStep_Model(this, tn, dt, ioInterval)

Forward steps the model using the associated tendency procedure and time integrator

If the final time is provided, the model is forward stepped to that final time, otherwise, the model is forward stepped only a single time step

If a time step is provided through the interface, the model time step size is updated and that time step is used to update the model

If ioInterval is provided, file IO will be conducted every ioInterval seconds until tn is reached

Arguments

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

Contents

Source Code


Source Code

  subroutine ForwardStep_Model(this,tn,dt,ioInterval)
  !!  Forward steps the model using the associated tendency procedure and time integrator
  !!
  !!  If the final time  is provided, the model is forward stepped to that final time,
  !!  otherwise, the model is forward stepped only a single time step
  !!
  !!  If a time step is provided through the interface, the model time step size is updated
  !!  and that time step is used to update the model
  !!
  !! If ioInterval is provided, file IO will be conducted every ioInterval seconds until tn
  !! is reached
    implicit none
    class(Model),intent(inout) :: this
    real(prec),intent(in) :: tn
    real(prec),intent(in) :: dt
    real(prec),intent(in) :: ioInterval
    ! Local
    real(prec) :: targetTime,tNext
    integer :: i,nIO

    this%dt = dt
    targetTime = tn

    nIO = int((targetTime-this%t)/ioInterval)
    do i = 1,nIO
      tNext = this%t+ioInterval
      call this%timeIntegrator(tNext)
      this%t = tNext
      call this%WriteModel()
      call this%WriteTecplot()
      call this%IncrementIOCounter()
      call this%CalculateEntropy()
      call this%ReportEntropy()
    enddo

  endsubroutine ForwardStep_Model