init_kt_grids_single Subroutine

public subroutine init_kt_grids_single(rhostar, kt_grids_single_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: rhostar
type(kt_grids_single_config_type), intent(in), optional :: kt_grids_single_config_in

Contents

Source Code


Source Code

  subroutine init_kt_grids_single(rhostar, kt_grids_single_config_in)
    use warning_helpers, only: exactly_equal, is_not_zero
    use theta_grid, only: drhodpsi, shat
    implicit none
    real, intent(in) :: rhostar
    type(kt_grids_single_config_type), intent(in), optional :: kt_grids_single_config_in

    if(initialized) return
    initialized = .true.

    call read_parameters_single(kt_grids_single_config_in)

    ! If n0>0 then override aky inputs and use n0 to determine aky
    if (n0 > 0) aky = n0 * drhodpsi * rhostar

    ! Try to ensure consistency between akx and theta0
    if (exactly_equal(akx, default_unset_value)) then
       ! If kx hasn't been set, set it from theta0
       akx = theta0 * aky * shat
    else
       ! If kx has been set, force theta0 to be calculated from this
       if (is_not_zero(shat) .and. is_not_zero(aky)) then
          theta0 = akx / (aky * shat)
       end if
    end if
  end subroutine init_kt_grids_single