Create the actual leapfrog integrator: initialize the filter coefficient.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_leapfrog), | intent(inout) | :: | self | Integrator. |
||
character(len=*), | intent(in) | :: | scheme | Selected scheme. |
||
real(kind=R_P), | intent(in), | optional | :: | nu | Williams-Robert-Asselin filter coefficient. |
|
real(kind=R_P), | intent(in), | optional | :: | alpha | Robert-Asselin filter coefficient. |
|
logical, | intent(in), | optional | :: | autoupdate | Enable cyclic autoupdate of previous time steps. |
|
class(integrand_object), | intent(in), | optional | :: | U | Integrand molding prototype. |
|
logical, | intent(in), | optional | :: | stop_on_fail | Stop execution if initialization fail. |
subroutine initialize(self, scheme, nu, alpha, autoupdate, U, stop_on_fail)
!< Create the actual leapfrog integrator: initialize the filter coefficient.
class(integrator_leapfrog), intent(inout) :: self !< Integrator.
character(*), intent(in) :: scheme !< Selected scheme.
real(R_P), intent(in), optional :: nu !< Williams-Robert-Asselin filter coefficient.
real(R_P), intent(in), optional :: alpha !< Robert-Asselin filter coefficient.
logical, intent(in), optional :: autoupdate !< Enable cyclic autoupdate of previous time steps.
class(integrand_object), intent(in), optional :: U !< Integrand molding prototype.
logical, intent(in), optional :: stop_on_fail !< Stop execution if initialization fail.
if (self%is_supported(scheme=scheme)) then
call self%destroy
self%description_ = trim(adjustl(scheme))
select case(trim(adjustl(scheme)))
case('leapfrog_raw')
self%nu = 0.01_R_P ; if (present(nu)) self%nu = nu
self%alpha = 0.53_R_P ; if (present(alpha)) self%alpha = alpha
self%is_filtered = .true.
endselect
self%autoupdate = .true. ; if (present(autoupdate)) self%autoupdate = autoupdate
self%steps = 2
self%registers = self%steps
if (present(U)) call self%allocate_integrand_members(U=U)
else
call self%trigger_error(error=ERROR_UNSUPPORTED_SCHEME, &
error_message='"'//trim(adjustl(scheme))//'" unsupported scheme', &
is_severe=stop_on_fail)
endif
endsubroutine initialize