Initialise stella
Calls the initialisation routines for all the geometry, physics, and diagnostic modules
initialize mpi message passing initialize timer write message to screen with useful info regarding start of simulation initialize file i/o read the parameters_physics namelist from the input file read the zgrid_parameters namelist from the input file and setup the z grid read the species_knobs namelist from the input file read the grid option from the kt_grids_knobs namelist in the input file; depending on the grid option chosen, read the corresponding kt_grids_XXXX_parameters namelist from the input file and allocate some kx and ky arrays read the vpamu_grids_parameters namelist from the input file setup the various data layouts for the distribution function; e.g., vmu_lo is the layout in which vpa, mu and species may be distributed amongst processors, depending on the number of phase space points and processors needs_transforms indicates whether or not FFTs will be needed in the simulation if FFTs are needed, init_transforms sets up the various FFTW plans and allocates the necessary arrays read in the geometry option and any necessary magnetic geometry info and use it to calculate all of the required geometric coefficients read species_parameters from input file and use the info to, e.g., determine if a modified Boltzmann response is to be used read init_g_knobs namelist from the input file and prepare for reading in from restart file if requested read knobs namelist from the input file and the info to determine the mixture of implicit and explicit time advance read layouts_knobs namelist from the input file, which determines the order of parallelisation within the different layouts setup the (kx,ky) grids and (x,y) grids, if applicable finish_init_geometry deallocates various geometric arrays that were defined locally within the geometry_miller module when using Miller geometry setup the (vpa,mu) grids and associated integration weights set up all of the logic needed to do calculations on an extended grid in z. this extended grid could be due to use of a ballooning angle so that z goes from -Npi to Npi, or it could be due to the coupling of different kx modes arising from the twist-and-shift boundary condition when doing a volume average using Fourier coefficients, the ky=0 mode gets a different weighting than finite ky modes, due to the reality condition being imposed; init_volume_averages accounts for this allocates and initialises kperp2, vperp2 and arrays needed for gyro-averaging (j0 and j1 or equivalents) sets up the mappings between different layouts, needed to redistribute data when going from one layout to another read dissipation namelist from the input file and print information about chosen options to stdout allocate and initialise time-independent arrays needed to solve the field equations; e.g., sum_s (Z_s^2 n_s / T_s)*(1-Gamma0_s) initialise the distribution function in the kxkyz_lo and store in gvmu use mapping from kxkyz_lo to vmu_lo to get a copy of g that has ky, kx and z local to each core; stored in gnew and copied to gold if initializing from restart file, set the initial time step size appropriately set the internal time step size variable code_dt from the input variable delt allocate and calculate arrays needed for the mirror, parallel streaming, magnetic drifts, gradient drive, etc. terms during time advance get initial field from initial distribution function fill in the boundary regions using auxilliary simulations if using multibox, or zero it out if using Dirichlet boundary conditions rescale to phiinit if just beginning a new run
read diagnostics_knob namelist from the input file, open ascii output files and initialise the neetcdf file with extension .out.nc initialise the code_time Add a header to the output file stop the timing of the initialization
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | istep0 |
Starting timestep: zero unless the simulation has been restarted |
||
character(len=40), | intent(in) | :: | git_commit | |||
character(len=10), | intent(in) | :: | git_date |