read_parameters Subroutine

private subroutine read_parameters(le_grid_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(le_grids_config_type), intent(in), optional :: le_grid_config_in

Contents

Source Code


Source Code

  subroutine read_parameters(le_grid_config_in)
    use file_utils, only: error_unit
    use text_options, only: text_option, get_option_value
    implicit none
    type(le_grids_config_type), intent(in), optional :: le_grid_config_in    
    type (text_option), dimension (4), parameter :: wfbbcopts = &
         [ text_option('default', wfbbc_option_mixed), &
            text_option('passing', wfbbc_option_passing), &
            text_option('trapped', wfbbc_option_trapped), &
            text_option('mixed', wfbbc_option_mixed)]
    character(20) :: wfbbc_option
    integer :: ierr
    
    if (present(le_grid_config_in)) le_grids_config = le_grid_config_in

    call le_grids_config%init(name = 'le_grids_knobs', requires_index = .false.)

    ! Copy out internal values into module level parameters
    associate(self => le_grids_config)
#include "le_grids_copy_out_auto_gen.inc"
    end associate
    
! user can choose not to set negrid (preferred for old scheme)
    if (negrid == -10) then
       negrid = nesub + nesuper

! If user chose negrid, then set nesuper and nesub accordingly
    else 
       nesuper = min(negrid/10+1, 4)
       nesub = negrid - nesuper
    endif

    ! Set ng2 from ngauss if not specified in the input file
    if (npassing < 0) then
       ng2 = 2 * ngauss
    else
       ng2 = npassing
    end if

    ierr = error_unit()

    call get_option_value &
         (wfbbc_option, wfbbcopts, wfbbc_option_switch, &
         ierr, "wfbbc_option in dist_fn_knobs",.true.)

    trapped_wfb = .false.! flag for treating wfb as a trapped particle
    passing_wfb = .false.! flag for treating wfb as a passing particle

    select case (wfbbc_option_switch)
    case(wfbbc_option_mixed) ! The previous default boundary condition which mixes the passing and trapped boundary conditions
       passing_wfb =.false.
       trapped_wfb =.false.
    case(wfbbc_option_passing) ! Treats wfb using a passing particle boundary condition
       passing_wfb =.true.
       trapped_wfb =.false.
    case(wfbbc_option_trapped) ! Treats the wfb using a trapped particle boundary condition
       passing_wfb =.false.
       trapped_wfb =.true.
    end select
    mixed_wfb = (.not. passing_wfb) .and. (.not. trapped_wfb)
  end subroutine read_parameters