SetTimeIntegrator_withChar Subroutine

public subroutine SetTimeIntegrator_withChar(this, integrator)

Sets the time integrator method, using a character input

Valid options for integrator are

"euler" "rk2" "rk3" "rk4"

Note that the character provided is not case-sensitive

Arguments

TypeIntentOptionalAttributesName
class(Model), intent(inout) :: this
character, intent(in) :: integrator

Calls

proc~~settimeintegrator_withchar~~CallsGraph proc~settimeintegrator_withchar SetTimeIntegrator_withChar proc~uppercase UpperCase proc~settimeintegrator_withchar->proc~uppercase

Contents


Source Code

  subroutine SetTimeIntegrator_withChar(this,integrator)
    !! Sets the time integrator method, using a character input
    !!
    !! Valid options for integrator are
    !!
    !!   "euler"
    !!   "rk2"
    !!   "rk3"
    !!   "rk4"
    !!
    !! Note that the character provided is not case-sensitive
    !!
    implicit none
    class(Model),intent(inout) :: this
    character(*),intent(in) :: integrator
    ! Local
    character(SELF_INTEGRATOR_LENGTH) :: upperCaseInt

    upperCaseInt = UpperCase(trim(integrator))

    select case(trim(upperCaseInt))

    case("EULER")
      this%timeIntegrator => Euler_timeIntegrator

    case("RK2")
      this%timeIntegrator => LowStorageRK2_timeIntegrator

    case("RK3")
      this%timeIntegrator => LowStorageRK3_timeIntegrator

    case("RK4")
      this%timeIntegrator => LowStorageRK4_timeIntegrator

    case DEFAULT
      this%timeIntegrator => LowStorageRK3_timeIntegrator

    endselect

  endsubroutine SetTimeIntegrator_withChar