init_fields_implicit Subroutine

public subroutine init_fields_implicit()

FIXME : Add documentation

Arguments

None

Contents

Source Code


Source Code

  subroutine init_fields_implicit
    use antenna, only: init_antenna
    use theta_grid, only: init_theta_grid
    use kt_grids, only: init_kt_grids
    use gs2_layouts, only: init_gs2_layouts
    use run_parameters, only: has_phi, has_apar, has_bpar
    use unit_tests, only: should_print
    use mp, only: mp_abort
    implicit none

    logical :: debug=.false.

    if (initialized) return
    initialized = .true.

    debug = should_print(3)

    !Check we have at least one field. If not abort.
    !Note, we do this here rather than as soon as we read input file
    !as other field types may support operation with no fields (e.g. 'local' does)
    if(.not. (has_phi .or. has_apar .or. has_bpar)) then
       call mp_abort("Field_option='implicit' requires at least one field is non-zero",.true.)
    endif

    if (debug) write(6,*) "init_fields_implicit: gs2_layouts"
    call init_gs2_layouts
    if (debug) write(6,*) "init_fields_implicit: theta_grid"
    call init_theta_grid
    if (debug) write(6,*) "init_fields_implicit: kt_grids"
    call init_kt_grids
    if (debug) write(6,*) "init_fields_implicit: response_matrix"
    call init_response_matrix
    if (debug) write(6,*) "init_fields_implicit: antenna"
    call init_antenna
  end subroutine init_fields_implicit