read_theta_grid_eik_config Subroutine

private subroutine read_theta_grid_eik_config(self)

Uses

Reads in the theta_grid_eik_knobs namelist and populates the member variables

Type Bound

theta_grid_eik_config_type

Arguments

Type IntentOptional Attributes Name
class(theta_grid_eik_config_type), intent(inout) :: self

Contents


Source Code

  subroutine read_theta_grid_eik_config(self)
    use file_utils, only: input_unit_exist, get_indexed_namelist_unit
    use mp, only: proc0
    implicit none
    class(theta_grid_eik_config_type), intent(in out) :: self
    logical :: exist
    integer :: in_file

    ! Note: When this routine is in the module where these variables live
    ! we shadow the module level variables here. This is intentional to provide
    ! isolation and ensure we can move this routine to another module easily.
    character(len = EQFILE_LENGTH) :: eqfile, eqnormfile
    integer :: bishop, iflux, irho, isym, itor, ntheta_geometry
    logical :: chs_eq, dfit_eq, efit_eq, equal_arc, force_sym, gen_eq, gs2d_eq, idfit_eq, local_eq, ppl_eq, transp_eq, use_large_aspect, writelots
    real :: alpha_input, beta_prime_input, delrho, dp_mult, invlp_input, s_hat_input

    namelist /theta_grid_eik_knobs/ alpha_input, beta_prime_input, bishop, chs_eq, delrho, dfit_eq, dp_mult, efit_eq, eqfile, eqnormfile, equal_arc, force_sym, gen_eq, gs2d_eq, idfit_eq, iflux, invlp_input, irho, isym, itor, local_eq, &
         ntheta_geometry, ppl_eq, s_hat_input, transp_eq, use_large_aspect, writelots

    ! Only proc0 reads from file
    if (.not. proc0) return

    ! First set local variables from current values
    alpha_input = self%alpha_input
    beta_prime_input = self%beta_prime_input
    bishop = self%bishop
    chs_eq = self%chs_eq
    delrho = self%delrho
    dfit_eq = self%dfit_eq
    dp_mult = self%dp_mult
    efit_eq = self%efit_eq
    eqfile = self%eqfile
    eqnormfile = self%eqnormfile
    equal_arc = self%equal_arc
    force_sym = self%force_sym
    gen_eq = self%gen_eq
    gs2d_eq = self%gs2d_eq
    idfit_eq = self%idfit_eq
    iflux = self%iflux
    invlp_input = self%invlp_input
    irho = self%irho
    isym = self%isym
    itor = self%itor
    local_eq = self%local_eq
    ntheta_geometry = self%ntheta_geometry
    ppl_eq = self%ppl_eq
    s_hat_input = self%s_hat_input
    transp_eq = self%transp_eq
    use_large_aspect = self%use_large_aspect
    writelots = self%writelots

    ! Now read in the main namelist
    in_file = input_unit_exist(self%get_name(), exist)
    if (exist) read(in_file, nml = theta_grid_eik_knobs)

    ! Now copy from local variables into type members
    self%alpha_input = alpha_input
    self%beta_prime_input = beta_prime_input
    self%bishop = bishop
    self%chs_eq = chs_eq
    self%delrho = delrho
    self%dfit_eq = dfit_eq
    self%dp_mult = dp_mult
    self%efit_eq = efit_eq
    self%eqfile = eqfile
    self%eqnormfile = eqnormfile
    self%equal_arc = equal_arc
    self%force_sym = force_sym
    self%gen_eq = gen_eq
    self%gs2d_eq = gs2d_eq
    self%idfit_eq = idfit_eq
    self%iflux = iflux
    self%invlp_input = invlp_input
    self%irho = irho
    self%isym = isym
    self%itor = itor
    self%local_eq = local_eq
    self%ntheta_geometry = ntheta_geometry
    self%ppl_eq = ppl_eq
    self%s_hat_input = s_hat_input
    self%transp_eq = transp_eq
    self%use_large_aspect = use_large_aspect
    self%writelots = writelots

    self%exist = exist
  end subroutine read_theta_grid_eik_config