PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
Main driver of PostProcessing of program Peeling Ballooning in 3D. More...
Functions/Subroutines | |
integer function, public | init_post () |
Initializes the POST driver. More... | |
integer function, public | run_driver_post () |
The main driver routine for postprocessing. More... | |
subroutine, public | stop_post () |
Cleans up main driver for postprocessing. More... | |
integer function | open_decomp_log () |
Opens the decomposition log file. More... | |
integer function | write_decomp_log (X_id, E_pot_int, E_kin_int) |
Write to decomposition log file. More... | |
subroutine | find_stab_ranges (sol, min_id, max_id, last_unstable_id) |
finds the plot ranges min_id and max_id . More... | |
subroutine | plot_sol_val_comp (sol_val_comp) |
Plots difference between Eigenvalues and energy fraction. More... | |
integer function | setup_out_grids (grids_out, XYZ_eq, XYZ_sol) |
Sets up the output grids for a particular parallel job. More... | |
Main driver of PostProcessing of program Peeling Ballooning in 3D.
subroutine driver_post::find_stab_ranges | ( | type(sol_type), intent(in) | sol, |
integer, dimension(3), intent(inout) | min_id, | ||
integer, dimension(3), intent(inout) | max_id, | ||
integer, intent(inout) | last_unstable_id | ||
) |
finds the plot ranges min_id
and max_id
.
There are three ranges, calculated using n_sol_plotted, which indicates:
have to be plotted.
This yields maximally three different ranges: One starting at the first unstable EV, one centered around the zero of the EV's and one ending at the last EV. These ranges can be disjoint but do not have to be.
Also, it is possible that a range does not exist, for example if there are no unstable EV's.
[in] | sol | solution variables |
[in,out] | min_id | min. index of range 1, 2 and 3 |
[in,out] | max_id | max. index of range 1, 2 and 3 |
[in,out] | last_unstable_id | index of last unstable EV |
Definition at line 1037 of file driver_POST.f90.
integer function, public driver_post::init_post |
Initializes the POST driver.
eq_1
(full) and n
& m
(full) POST_style = 1
: extended grid POST_style = 2
: field-aligned grideq_1
(divided) and sol
(divided) variablesIn the actual driver, more detailed plots are possibly made for all requested Eigenvalues if full_output
.
Definition at line 77 of file driver_POST.f90.
integer function driver_post::open_decomp_log |
Opens the decomposition log file.
Definition at line 841 of file driver_POST.f90.
subroutine driver_post::plot_sol_val_comp | ( | complex(dp), dimension(:,:,:), intent(inout) | sol_val_comp | ) |
Plots difference between Eigenvalues and energy fraction.
[in,out] | sol_val_comp | fraction between total \(E_{\text{pot}}\) and \(E_{\text{kin}}\), compared with EV |
Definition at line 1113 of file driver_POST.f90.
integer function, public driver_post::run_driver_post |
The main driver routine for postprocessing.
Furthermore, if Richardson extrapolation is used, the VMEC grids and variables are contained in multiple HDF5 variables. These variables are needed here both in a field-aligned and a plot grid.
A consequence of the above is that for VMEC the field-aligned output is already given, but the output on the plot grid has to be calculated from scratch, while for HELENA both outputs have to be interpolated from the output tables.
The general workflow is as follows:
POST_style = 1
(extended grid):POST_style = 2
(B-aligned grid):Definition at line 542 of file driver_POST.f90.
integer function driver_post::setup_out_grids | ( | type(grid_type), dimension(3), intent(inout) | grids_out, |
real(dp), dimension(:,:,:,:), intent(inout), allocatable | XYZ_eq, | ||
real(dp), dimension(:,:,:,:), intent(inout), allocatable | XYZ_sol | ||
) |
Sets up the output grids for a particular parallel job.
Three grids are returned:
The normal coordinates of these grids correspond to the one used in PB3D. For X this is determined by x_grid_style
.
The angular components of the eq and X grids is determined by post_style:
min_theta_plot
, max_theta_plot
, min_zeta_plot
and max_zeta_plot
.[in,out] | grids_out | eq, X and sol output grids (full parallel and normal range) |
[in,out] | xyz_eq | X , Y and Z on output equilibrium grid |
[in,out] | xyz_sol | X , Y and Z on output solution grid |
Definition at line 1186 of file driver_POST.f90.
subroutine, public driver_post::stop_post |
Cleans up main driver for postprocessing.
Definition at line 816 of file driver_POST.f90.
integer function driver_post::write_decomp_log | ( | integer, intent(in) | X_id, |
complex(dp), dimension(7), intent(in) | E_pot_int, | ||
complex(dp), dimension(2), intent(in) | E_kin_int | ||
) |
Write to decomposition log file.
[in] | x_id | nr. of Eigenvalue |
[in] | e_pot_int | E_pot integrated for requested solutions |
[in] | e_kin_int | E_kin integrated for requested solutions |
Definition at line 922 of file driver_POST.f90.