Calls all initialisations required for init_fields_implicit/local, reads parameters and allocates field arrays
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(fields_config_type), | intent(in), | optional | :: | fields_config_in |
subroutine fields_pre_init(fields_config_in)
use theta_grid, only: init_theta_grid
use run_parameters, only: init_run_parameters
use dist_fn, only: init_dist_fn, gf_lo_integrate
use antenna, only: init_antenna
use unit_tests, only: debug_message
use kt_grids, only: naky, ntheta0
use mp, only: nproc, proc0
implicit none
type(fields_config_type), intent(in), optional :: fields_config_in
integer, parameter :: verb=3
call init_fields_parameters(fields_config_in)
call debug_message(verb, "init_fields: init_theta_grid")
call init_theta_grid
call debug_message(verb, "init_fields: init_run_parameters")
call init_run_parameters
call debug_message(verb, "init_fields: init_dist_fn")
call init_dist_fn
if(nproc .lt. ntheta0*naky .and. fieldopt_switch .eq. fieldopt_gf_local) then
fieldopt_switch = fieldopt_local
gf_lo_integrate = .false.
if(proc0) then
write(*,*) 'gf local fields cannot be used as you are running less MPI processes than there are'
write(*,*) 'naky*ntheta0 points. Defaulting to local fields. You need to use at least',naky*ntheta0
write(*,*) 'MPI processes for this simulation'
end if
end if
!call debug_message(verb, "init_fields: init_parameter_scan")
!call init_parameter_scan
call debug_message(verb, "init_fields: init_antenna")
call init_antenna !Must come before allocate_arrays so we know if we need apar_ext
!call debug_message(verb, "init_fields: read_parameters")
!call read_parameters
call debug_message(verb, "init_fields: allocate_arrays")
call allocate_arrays
end subroutine fields_pre_init