FIXME : Add documentation
subroutine get_namelists
!CMR, 17/11/2009: use gs2_diagnostics module to pick up public variables
! and routines to reduces maintenance of ingen.
! Should replicate this for other modules in future.
!CMR, 2/2/2011: Have extended this to include use of theta_grid module:
! Strategy is simply to add two types of routines to modules:
! wnml_xxxxx to write the modules namelists
! check_xxxxx to perform the ingen checking inside the module
! More object oriented strategy, easier maintenance of ingen.f90
! which is gradually shrinking.!
!
use antenna, only: init_antenna
use collisions, only: coll_read_parameters=>read_parameters
use collisions, only: collision_model_switch, collision_model_none
use fields, only : fields_read_parameters=>read_parameters
use hyper, only : hyper_read_parameters=>read_parameters
use species,only : spec, init_species
use gs2_layouts, only: init_gs2_layouts
use gs2_reinit, only: init_reinit
use dist_fn, only: dist_fn_read_parameters=>read_parameters
use nonlinear_terms, only: nonlinear_terms_read_parameters=>read_parameters
use run_parameters, only: init_run_parameters
use init_g, only: init_init_g
use run_parameters, only: use_old_diagnostics
use gs2_diagnostics,only: gs2diag_read_parameters=>read_parameters
use diagnostics_config, only: init_diagnostics_config
use theta_grid, only: init_theta_grid
use kt_grids, only: init_kt_grids
use le_grids, only: init_le_grids
use theta_grid, only: init_theta_grid, ntgrid
use gs2_time, only: init_gs2_time
implicit none
logical, parameter :: debug=.false.
if (debug) write(6,*) 'get_namelists: layouts'
call init_gs2_layouts
call init_run_parameters
if (debug) write(6,*) 'get_namelists: collisions'
call coll_read_parameters
if (debug) write(6,*) 'get_namelists: init_g'
call init_init_g
!This needs to come after init_init_g in case we need to read the
!timestep from restart file (init_init_g sets the restart_dir etc.)
call init_gs2_time
if (debug) write(6,*) 'get_namelists: fields'
call fields_read_parameters
if (debug) write(6,*) 'get_namelists: gs2_reinit'
call init_reinit
if (debug) write(6,*) 'get_namelists: hyper'
call hyper_read_parameters
if (debug) write(6,*) 'get_namelists: kt_grids'
call init_kt_grids
if (debug) write(6,*) 'get_namelists: le_grids'
call init_le_grids
if (debug) write(6,*) 'get_namelists: nonlinear terms'
call nonlinear_terms_read_parameters
if (debug) write(6,*) 'get_namelists: init_species'
call init_species
coll_on = any(spec%vnewk > epsilon(0.0)) &
.and. (collision_model_switch /= collision_model_none)
call init_antenna
!CMR, 2/2/2011: reduce much duplication by calling init_theta_grid
if (debug) write(6,*) 'get_namelists: call init_theta_grid, ntgrid=',ntgrid
call init_theta_grid
if (debug) write(6,*) 'get_namelists: done init_theta_grid, ntgrid=',ntgrid
call dist_fn_read_parameters
! gs2_diagnostics
! CMR 18/11/2009: reduce duplication by calling gs2diag_read_parameters
!
if (use_old_diagnostics) then
call gs2diag_read_parameters(.false.)
else
call init_diagnostics_config(gnostics)
end if
if (debug) write(6,*) 'get_namelists: returning'
end subroutine get_namelists