Routine to initialise
subroutine init_fields_gf_local
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 mp, only: proc0, mp_abort, barrier
use file_utils, only: error_unit
implicit none
!Early exit if possible
if (initialised) return
!Exit if local fields not supported (e.g. compiled with pgi)
if(.not.fields_gf_local_functional()) call mp_abort("field_option='gf local' not supported with this build")
!Make sure any dependencies are already initialised and
!initialise the field matrix object.
if (debug.and.proc0) write(6,*) "init_fields_gf_local: gs2_layouts"
call init_gs2_layouts
if (debug.and.proc0) write(6,*) "init_fields_gf_local: theta_grid"
call init_theta_grid
if (debug.and.proc0) write(6,*) "init_fields_gf_local: kt_grids"
call init_kt_grids
if (debug.and.proc0) write(6,*) "init_fields_gf_local: init_fields_matrixlocal"
call init_fields_matrixlocal
if (debug.and.proc0) write(6,*) "init_fields_gf_local: antenna"
call init_antenna
!Set the initialised state
initialised = .true.
reinit = .false.
end subroutine init_fields_gf_local