read_parameters Subroutine

private subroutine read_parameters(split_nonlinear_terms_config_in)

Read the split_nonlinear_terms namelist

Arguments

Type IntentOptional Attributes Name
type(split_nonlinear_terms_config_type), intent(in), optional :: split_nonlinear_terms_config_in

Contents

Source Code


Source Code

  subroutine read_parameters(split_nonlinear_terms_config_in)
    use file_utils, only: error_unit
    use text_options, only: text_option, get_option_value
    use rk_schemes, only: get_rk_schemes_as_text_options, get_rk_scheme_by_id
    implicit none
    type(split_nonlinear_terms_config_type), intent(in), optional :: split_nonlinear_terms_config_in
    type(text_option), dimension (*), parameter :: split_method_opts = &
         [ &
         text_option('default', split_method_rk), &
         text_option('AB3', split_method_ab3), &
         text_option('RK', split_method_rk), &
         text_option('beuler', split_method_backwards_euler),  &
         text_option('picard', split_method_picard)  &
         ]
    character(len = 20) :: rk_method, split_method
    integer :: ierr, rk_method_switch

    if (present(split_nonlinear_terms_config_in)) split_nonlinear_terms_config = split_nonlinear_terms_config_in

    call split_nonlinear_terms_config%init(name = 'split_nonlinear_terms_knobs', requires_index = .false.)

    ! Copy out internal values into module level parameters
    associate(self => split_nonlinear_terms_config)
#include "split_nonlinear_terms_copy_out_auto_gen.inc"
    end associate

    ierr = error_unit()

    call get_option_value &
         (split_method, split_method_opts, split_method_switch, &
         ierr, "split_method in split_nonlinear_terms_knobs",.true.)

    call get_option_value &
         (rk_method, get_rk_schemes_as_text_options(), rk_method_switch, &
         ierr, "rk_method in split_nonlinear_terms_knobs",.true.)
    the_rk_scheme = get_rk_scheme_by_id(rk_method_switch)
  end subroutine read_parameters