PB3D  [2.45]
Ideal linear high-n MHD stability in 3-D
MPI_ops.f90
Go to the documentation of this file.
1 !------------------------------------------------------------------------------!
3 !------------------------------------------------------------------------------!
4 module mpi_ops
5 #include <PB3D_macros.h>
6  use str_utilities
7  use messages
8  use mpi
9  use num_vars, only: dp, max_str_ln, pi
10  use mpi_vars, only: lock_type
11 
12  implicit none
13  private
16 
17 contains
21  integer function start_mpi() result(ierr)
23  use mpi_vars, only: hdf5_lock
24  use input_utilities, only: pause_prog
25 #if ldebug
28  use x_vars, only: n_alloc_x_1s, n_alloc_x_2s
29  use sol_vars, only: n_alloc_sols
30 #endif
31 
32  character(*), parameter :: rout_name = 'start_MPI'
33 
34  ! initialize ierr
35  ierr = 0
36 
37  ! start MPI
38  call mpi_init(ierr) ! initialize MPI
39  chckerr('MPI init failed')
40  call mpi_comm_rank(mpi_comm_world,rank,ierr) ! rank
41  chckerr('MPI rank failed')
42  call mpi_comm_size(mpi_comm_world,n_procs,ierr) ! nr. processes
43  chckerr('MPI size failed')
44 
45  ! create HDF5 lock
46  ierr = hdf5_lock%init(10)
47  chckerr('')
48 
49  ! initialize time
50  call system_clock(time_start)
51 
52 #if ldebug
53  ! set up allocated variable counters and number of extra IO tries
54  n_alloc_discs = 0
55  n_alloc_grids = 0
56  n_alloc_eq_1s = 0
57  n_alloc_eq_2s = 0
58  n_alloc_x_1s = 0
59  n_alloc_x_2s = 0
60  n_alloc_sols = 0
61 #endif
62  end function start_mpi
63 
79  integer function stop_mpi(grid_eq,grid_eq_B,grid_X,grid_X_B,grid_sol,eq_1,&
80  &eq_2,X_1,X_2,vac,sol) result(ierr)
81 
82  use mpi_vars, only: dealloc_lock, &
83  &hdf5_lock
84  use grid_vars, only: grid_type
85  use eq_vars, only: eq_1_type, eq_2_type
86  use x_vars, only: x_1_type, x_2_type
87  use vac_vars, only: vac_type
88  use sol_vars, only: sol_type
89  use num_vars, only: eq_style
90 #if ldebug
91  use mpi_utilities, only: get_ser_var, &
92  &n_waits
93  use num_vars, only: rank, n_procs
96  use x_vars, only: n_alloc_x_1s, n_alloc_x_2s
97  use sol_vars, only: n_alloc_sols
98 #endif
99 
100  character(*), parameter :: rout_name = 'stop_MPI'
101 
102  ! input / output
103  type(grid_type), intent(inout), optional :: grid_eq
104  type(grid_type), intent(inout), pointer, optional :: grid_eq_b
105  type(grid_type), intent(inout), optional :: grid_x
106  type(grid_type), intent(inout), pointer, optional :: grid_x_b
107  type(grid_type), intent(inout), optional :: grid_sol
108  type(eq_1_type), intent(inout), optional :: eq_1
109  type(eq_2_type), intent(inout), optional :: eq_2
110  type(x_1_type), intent(inout), optional :: x_1
111  type(x_2_type), intent(inout), optional :: x_2
112  type(vac_type), intent(inout), optional :: vac
113  type(sol_type), intent(inout), optional :: sol
114 
115  ! local variables
116 #if ldebug
117  integer :: id ! counter
118  integer, allocatable :: ser_n_waits(:) ! serial n_waits
119 #endif
120 
121  ! initialize ierr
122  ierr = 0
123 
124  ! user output
125  call writo('Stopping MPI')
126 
127  ! clean up variables
128  if (present(grid_eq)) then
129  if (associated(grid_eq%r_F)) call grid_eq%dealloc()
130  end if
131  if (present(grid_eq_b)) then
132  if (associated(grid_eq_b)) then
133  if (eq_style.eq.2) then
134  call grid_eq_b%dealloc()
135  deallocate(grid_eq_b)
136  end if
137  nullify(grid_eq_b)
138  end if
139  end if
140  if (present(grid_x)) then
141  if (associated(grid_x%r_F)) call grid_x%dealloc()
142  end if
143  if (present(grid_x_b)) then
144  if (associated(grid_x_b)) then
145  if (eq_style.eq.2) then
146  call grid_x_b%dealloc()
147  deallocate(grid_x_b)
148  end if
149  nullify(grid_x_b)
150  end if
151  end if
152  if (present(grid_sol)) then
153  if (associated(grid_sol%r_F)) call grid_sol%dealloc()
154  end if
155  if (present(eq_1)) then
156  if (allocated(eq_1%pres_FD)) call eq_1%dealloc()
157  end if
158  if (present(eq_2))then
159  if (allocated(eq_2%jac_FD)) call eq_2%dealloc()
160  end if
161  if (present(x_1)) then
162  if (allocated(x_1%U_0)) call x_1%dealloc()
163  end if
164  if (present(x_2)) then
165  if (allocated(x_2%PV_0)) call x_2%dealloc()
166  end if
167  if (present(vac)) then
168  if (allocated(vac%res)) call vac%dealloc()
169  end if
170  if (present(sol)) then
171  if (allocated(sol%val)) call sol%dealloc()
172  end if
173 
174 #if ldebug
175  ! information about allocated variables
176  if (n_alloc_discs.ne.0) call writo('For rank '//trim(i2str(rank))//&
177  &', n_alloc_discs = '//trim(i2str(n_alloc_discs)),&
178  &persistent=.true.)
179  if (n_alloc_grids.ne.0) call writo('For rank '//trim(i2str(rank))//&
180  &', n_alloc_grids = '//trim(i2str(n_alloc_grids)),&
181  &persistent=.true.)
182  if (n_alloc_eq_1s.ne.0) call writo('For rank '//trim(i2str(rank))//&
183  &', n_alloc_eq_1s = '//trim(i2str(n_alloc_eq_1s)),&
184  &persistent=.true.)
185  if (n_alloc_eq_2s.ne.0) call writo('For rank '//trim(i2str(rank))//&
186  &', n_alloc_eq_2s = '//trim(i2str(n_alloc_eq_2s)),&
187  &persistent=.true.)
188  if (n_alloc_x_1s.ne.0) call writo('For rank '//trim(i2str(rank))//&
189  &', n_alloc_X_1s = '//trim(i2str(n_alloc_x_1s)),&
190  &persistent=.true.)
191  if (n_alloc_x_2s.ne.0) call writo('For rank '//trim(i2str(rank))//&
192  &', n_alloc_X_2s = '//trim(i2str(n_alloc_x_2s)),&
193  &persistent=.true.)
194  if (n_alloc_sols.ne.0) call writo('For rank '//trim(i2str(rank))//&
195  &', n_alloc_sols = '//trim(i2str(n_alloc_sols)),&
196  &persistent=.true.)
197 
198  ! information about synchronization of wait_MPI
199  ierr = get_ser_var([n_waits],ser_n_waits)
200  chckerr('')
201  if (rank.eq.0 .and. (minval(ser_n_waits).ne.n_waits .or. &
202  &maxval(ser_n_waits).ne.n_waits)) then
203  call writo('The number of wait_MPI commands was not consistent')
204  call lvl_ud(1)
205  do id = 1,n_procs
206  call writo('For rank '//trim(i2str(id-1))//': '//&
207  &trim(i2str(ser_n_waits(id))))
208  end do
209  call lvl_ud(-1)
210  end if
211 #endif
212 
213  ! deallocate HDF5 lock
214  ierr = dealloc_lock(hdf5_lock)
215  chckerr('')
216 
217  ! finalize
218  call blacs_exit(1)
219  call mpi_finalize(ierr)
220  chckerr('MPI stop failed')
221  end function stop_mpi
222 
226  integer function abort_mpi() result(ierr)
227  character(*), parameter :: rout_name = 'abort_MPI'
228 
229  ! initialize ierr
230  ierr = 0
231 
232  call mpi_abort(mpi_comm_world,0,ierr)
233  chckerr('MPI abort failed')
234  end function abort_mpi
235 
246  integer function broadcast_input_opts() result(ierr)
261  &rich_restart_lvl, &
262  &pb3d_name, &
263  &rz_0, &
265  &n_vac_plot
266  use grid_vars, only: min_par_x, max_par_x
268 
269  character(*), parameter :: rout_name = 'broadcast_input_opts'
270 
271  ! local variables
272  character(len=max_str_ln) :: err_msg ! error message
273 
274  ! initialize ierr
275  ierr = 0
276 
277  ! set err_msg
278  err_msg = 'MPI broadcast failed'
279 
280  if (n_procs.gt.1) then ! need to broadcast from rank 0 to other processes
281  ! print message
282  call writo('Broadcasting input option variables')
283  call lvl_ud(1)
284 
285  ! variables that are sent for every program style:
286  call mpi_bcast(ltest,1,mpi_logical,0,mpi_comm_world,ierr)
287  chckerr(err_msg)
288  call mpi_bcast(no_plots,1,mpi_logical,0,mpi_comm_world,ierr)
289  chckerr(err_msg)
290  call mpi_bcast(do_execute_command_line,1,mpi_logical,0,&
291  &mpi_comm_world,ierr)
292  call mpi_bcast(print_mem_usage,1,mpi_logical,0,mpi_comm_world,ierr)
293  chckerr(err_msg)
294  call mpi_bcast(plot_flux_q,1,mpi_logical,0,mpi_comm_world,ierr)
295  chckerr(err_msg)
296  call mpi_bcast(plot_kappa,1,mpi_logical,0,mpi_comm_world,ierr)
297  chckerr(err_msg)
298  call mpi_bcast(plot_magn_grid,1,mpi_logical,0,mpi_comm_world,ierr)
299  chckerr(err_msg)
300  call mpi_bcast(plot_b,1,mpi_logical,0,mpi_comm_world,ierr)
301  chckerr(err_msg)
302  call mpi_bcast(plot_j,1,mpi_logical,0,mpi_comm_world,ierr)
303  chckerr(err_msg)
304  call mpi_bcast(plot_resonance,1,mpi_logical,0,mpi_comm_world,ierr)
305  chckerr(err_msg)
306  call mpi_bcast(tol_zero,1,mpi_double_precision,0,mpi_comm_world,&
307  &ierr)
308  chckerr(err_msg)
309  call mpi_bcast(min_theta_plot,1,mpi_double_precision,0,&
310  &mpi_comm_world,ierr)
311  chckerr(err_msg)
312  call mpi_bcast(max_theta_plot,1,mpi_double_precision,0,&
313  &mpi_comm_world,ierr)
314  chckerr(err_msg)
315  call mpi_bcast(min_zeta_plot,1,mpi_double_precision,0,&
316  &mpi_comm_world,ierr)
317  chckerr(err_msg)
318  call mpi_bcast(max_zeta_plot,1,mpi_double_precision,0,&
319  &mpi_comm_world,ierr)
320  chckerr(err_msg)
321  call mpi_bcast(min_r_plot,1,mpi_double_precision,0,mpi_comm_world,&
322  &ierr)
323  chckerr(err_msg)
324  call mpi_bcast(max_r_plot,1,mpi_double_precision,0,mpi_comm_world,&
325  &ierr)
326  chckerr(err_msg)
327  call mpi_bcast(max_tot_mem,1,mpi_double_precision,0,&
328  &mpi_comm_world,ierr)
329  chckerr(err_msg)
330  call mpi_bcast(sol_n_procs,1,mpi_integer,0,mpi_comm_world,ierr)
331  chckerr(err_msg)
332  call mpi_bcast(n_theta_plot,1,mpi_integer,0,mpi_comm_world,ierr)
333  chckerr(err_msg)
334  call mpi_bcast(n_zeta_plot,1,mpi_integer,0,mpi_comm_world,ierr)
335  chckerr(err_msg)
336  call mpi_bcast(max_it_rich,1,mpi_integer,0,mpi_comm_world,ierr)
337  chckerr(err_msg)
338  call mpi_bcast(max_it_zero,1,mpi_integer,0,mpi_comm_world,ierr)
339  chckerr(err_msg)
340  call mpi_bcast(max_nr_backtracks_hh,1,mpi_integer,0,mpi_comm_world,&
341  &ierr)
342  chckerr(err_msg)
343  call mpi_bcast(ex_plot_style,1,mpi_integer,0,mpi_comm_world,ierr)
344  chckerr(err_msg)
345  call mpi_bcast(plot_size,2,mpi_integer,0,mpi_comm_world,ierr)
346  chckerr(err_msg)
347  call mpi_bcast(pb3d_name,len(pb3d_name),mpi_character,0,&
348  &mpi_comm_world,ierr)
349  chckerr(err_msg)
350 
351  ! select according to program style
352  select case (prog_style)
353  case(1) ! PB3D
354  call mpi_bcast(no_guess,1,mpi_logical,0,mpi_comm_world,ierr)
355  chckerr(err_msg)
356  call mpi_bcast(jump_to_sol,1,mpi_logical,0,mpi_comm_world,&
357  &ierr)
358  chckerr(err_msg)
359  call mpi_bcast(export_hel,1,mpi_logical,0,mpi_comm_world,&
360  &ierr)
361  chckerr(err_msg)
362  call mpi_bcast(plot_vmec_modes,1,mpi_logical,0,&
363  &mpi_comm_world,ierr)
364  chckerr(err_msg)
365  call mpi_bcast(invert_top_bottom_h,1,mpi_logical,0,&
366  &mpi_comm_world,ierr)
367  chckerr(err_msg)
368  call mpi_bcast(min_n_par_x,1,mpi_integer,0,mpi_comm_world,&
369  &ierr)
370  chckerr(err_msg)
371  call mpi_bcast(solver_slepc_style,1,mpi_integer,0,&
372  &mpi_comm_world,ierr)
373  chckerr(err_msg)
374  call mpi_bcast(n_sol_requested,1,mpi_integer,0,&
375  &mpi_comm_world,ierr)
376  chckerr(err_msg)
377  call mpi_bcast(retain_all_sol,1,mpi_integer,0,&
378  &mpi_comm_world,ierr)
379  chckerr(err_msg)
380  call mpi_bcast(max_it_slepc,1,mpi_integer,0,mpi_comm_world,&
381  &ierr)
382  chckerr(err_msg)
383  call mpi_bcast(rich_restart_lvl,1,mpi_integer,0,&
384  &mpi_comm_world,ierr)
385  chckerr(err_msg)
386  call mpi_bcast(ev_guess,1,mpi_double_precision,0,&
387  &mpi_comm_world,ierr)
388  chckerr(err_msg)
389  call mpi_bcast(tol_norm,1,mpi_double_precision,0,&
390  &mpi_comm_world,ierr)
391  chckerr(err_msg)
392  call mpi_bcast(min_par_x,1,mpi_double_precision,0,&
393  &mpi_comm_world,ierr)
394  chckerr(err_msg)
395  call mpi_bcast(max_par_x,1,mpi_double_precision,0,&
396  &mpi_comm_world,ierr)
397  chckerr(err_msg)
398  call mpi_bcast(max_x_mem,1,mpi_double_precision,&
399  &0,mpi_comm_world,ierr)
400  chckerr(err_msg)
401  call mpi_bcast(tol_rich,1,mpi_double_precision,0,&
402  &mpi_comm_world,ierr)
403  chckerr(err_msg)
404  if (rank.ne.0) allocate(tol_slepc(max_it_rich))
405  call mpi_bcast(tol_slepc,max_it_rich,mpi_double_precision,&
406  &0,mpi_comm_world,ierr)
407  chckerr(err_msg)
408  case(2) ! POST
409  call mpi_bcast(swap_angles,1,mpi_logical,0,mpi_comm_world,&
410  &ierr)
411  chckerr(err_msg)
412  call mpi_bcast(compare_tor_pos,1,mpi_logical,0,&
413  &mpi_comm_world,ierr)
414  chckerr(err_msg)
415  call mpi_bcast(plot_sol_xi,1,mpi_logical,0,mpi_comm_world,&
416  &ierr)
417  chckerr(err_msg)
418  call mpi_bcast(plot_sol_q,1,mpi_logical,0,mpi_comm_world,&
419  &ierr)
420  chckerr(err_msg)
421  call mpi_bcast(plot_vac_pot,1,mpi_logical,0,mpi_comm_world,&
422  &ierr)
423  chckerr(err_msg)
424  call mpi_bcast(plot_e_rec,1,mpi_logical,0,mpi_comm_world,&
425  &ierr)
426  chckerr(err_msg)
427  call mpi_bcast(post_output_full,1,mpi_logical,0,&
428  &mpi_comm_world,ierr)
429  chckerr(err_msg)
430  call mpi_bcast(post_output_sol,1,mpi_logical,0,&
431  &mpi_comm_world,ierr)
432  chckerr(err_msg)
433  call mpi_bcast(n_vac_plot,2,mpi_integer,0,mpi_comm_world,&
434  &ierr)
435  chckerr(err_msg)
436  call mpi_bcast(plot_grid_style,1,mpi_integer,0,&
437  &mpi_comm_world,ierr)
438  chckerr(err_msg)
439  call mpi_bcast(n_sol_plotted,4,mpi_integer,0,&
440  &mpi_comm_world,ierr)
441  chckerr(err_msg)
442  call mpi_bcast(rich_lvl,1,mpi_integer,0,mpi_comm_world,ierr)
443  chckerr(err_msg)
444  call mpi_bcast(post_style,1,mpi_integer,0,mpi_comm_world,&
445  &ierr)
446  chckerr(err_msg)
447  call mpi_bcast(pert_mult_factor_post,1,&
448  &mpi_double_precision,0,mpi_comm_world,ierr)
449  chckerr(err_msg)
450  call mpi_bcast(rz_0,2,mpi_double_precision,0,&
451  &mpi_comm_world,ierr)
452  chckerr(err_msg)
453  call mpi_bcast(min_rvac_plot,1,mpi_double_precision,0,&
454  &mpi_comm_world,ierr)
455  chckerr(err_msg)
456  call mpi_bcast(max_rvac_plot,1,mpi_double_precision,0,&
457  &mpi_comm_world,ierr)
458  chckerr(err_msg)
459  call mpi_bcast(min_zvac_plot,1,mpi_double_precision,0,&
460  &mpi_comm_world,ierr)
461  chckerr(err_msg)
462  call mpi_bcast(max_zvac_plot,1,mpi_double_precision,0,&
463  &mpi_comm_world,ierr)
464  chckerr(err_msg)
465  case default
466  err_msg = 'No program style associated with '//&
467  &trim(i2str(prog_style))
468  ierr = 1
469  chckerr(err_msg)
470  end select
471 
472  call lvl_ud(-1)
473  call writo('Input option variables broadcasted')
474  end if
475  end function broadcast_input_opts
476 
482  subroutine sudden_stop(ierr)
483  use num_vars, only: rank
484 
485  ! input / output
486  integer, intent(in) :: ierr ! error to output
487 
488  ! local variables
489  integer :: ierr_abort ! error to output
490 
491  if (ierr.ne.66) then
492  call writo('>> calling routine: PB3D (main) of rank '//&
493  &trim(i2str(rank)),persistent=.true.)
494  call writo('ERROR CODE '//trim(i2str(ierr))//&
495  &'. Aborting MPI rank '//trim(i2str(rank)),&
496  &persistent=.true.)
497  call lvl_ud(1)
498  ierr_abort = abort_mpi()
499  else
500  ierr_abort = stop_mpi()
501  end if
502  if (ierr_abort.ne.0) then
503  call writo('MPI cannot abort...',persistent=.true.)
504  call writo('Shutting down',persistent=.true.)
505  end if
506  call lvl_ud(-1)
507  stop
508  end subroutine
509 end module mpi_ops
mpi_utilities::get_ser_var
Gather parallel variable in serial version on group master.
Definition: MPI_utilities.f90:55
num_vars::plot_e_rec
logical, public plot_e_rec
whether to plot energy reconstruction in POST
Definition: num_vars.f90:111
mpi_utilities::n_waits
integer, public n_waits
number of waits
Definition: MPI_utilities.f90:41
num_vars::ex_plot_style
integer, public ex_plot_style
external plot style (1: GNUPlot, 2: Bokeh for 2D, Mayavi for 3D)
Definition: num_vars.f90:175
mpi_ops::stop_mpi
integer function, public stop_mpi(grid_eq, grid_eq_B, grid_X, grid_X_B, grid_sol, eq_1, eq_2, X_1, X_2, vac, sol)
Stop MPI.
Definition: MPI_ops.f90:81
num_vars::plot_sol_xi
logical, public plot_sol_xi
whether to plot plasma perturbation of solution in POST
Definition: num_vars.f90:108
num_vars::swap_angles
logical, public swap_angles
swap angles theta and zeta in plots (only for POST)
Definition: num_vars.f90:150
num_vars::plot_resonance
logical, public plot_resonance
whether to plot the q-profile or iota-profile with resonances
Definition: num_vars.f90:102
num_vars::invert_top_bottom_h
logical, public invert_top_bottom_h
invert top and bottom for HELENA equilibria
Definition: num_vars.f90:144
num_vars::dp
integer, parameter, public dp
double precision
Definition: num_vars.f90:46
eq_vars
Variables that have to do with equilibrium quantities and the grid used in the calculations:
Definition: eq_vars.f90:27
num_vars::n_sol_plotted
integer, dimension(4), public n_sol_plotted
how many solutions to be plot (first unstable, last unstable, first stable, last stable)
Definition: num_vars.f90:171
mpi_ops
Operations related to MPI.
Definition: MPI_ops.f90:4
mpi_utilities
Numerical utilities related to MPI.
Definition: MPI_utilities.f90:20
num_vars
Numerical variables used by most other modules.
Definition: num_vars.f90:4
mpi_ops::abort_mpi
integer function, public abort_mpi()
Abort MPI suddenly.
Definition: MPI_ops.f90:227
num_vars::max_str_ln
integer, parameter, public max_str_ln
maximum length of strings
Definition: num_vars.f90:50
num_vars::max_it_zero
integer, public max_it_zero
maximum number of iterations to find zeros
Definition: num_vars.f90:131
num_vars::plot_sol_q
logical, public plot_sol_q
whether to plot magnetic perturbation of solution in POST
Definition: num_vars.f90:109
rich_vars
Variables concerning Richardson extrapolation.
Definition: rich_vars.f90:4
str_utilities::i2str
elemental character(len=max_str_ln) function, public i2str(k)
Convert an integer to string.
Definition: str_utilities.f90:18
num_vars::retain_all_sol
logical, public retain_all_sol
retain also faulty solutions
Definition: num_vars.f90:152
grid_vars::max_par_x
real(dp), public max_par_x
max. of parallel coordinate [ ] in field-aligned grid
Definition: grid_vars.f90:25
num_vars::plot_size
integer, dimension(2), public plot_size
size of plot in inches
Definition: num_vars.f90:172
num_vars::n_sol_requested
integer, public n_sol_requested
how many solutions requested
Definition: num_vars.f90:170
num_vars::n_zeta_plot
integer, public n_zeta_plot
nr. of toroidal points in plot
Definition: num_vars.f90:157
num_vars::post_output_sol
logical, public post_output_sol
POST has outputs of solution.
Definition: num_vars.f90:147
num_vars::min_zvac_plot
real(dp), public min_zvac_plot
min. of Z in which to plot vacuum
Definition: num_vars.f90:167
num_vars::max_theta_plot
real(dp), public max_theta_plot
max. of theta_plot
Definition: num_vars.f90:160
num_vars::n_procs
integer, public n_procs
nr. of MPI processes
Definition: num_vars.f90:69
eq_vars::n_alloc_eq_1s
integer, public n_alloc_eq_1s
nr. of allocated eq_1 variables
Definition: eq_vars.f90:53
num_vars::ev_guess
real(dp), public ev_guess
first guess for eigenvalue
Definition: num_vars.f90:117
str_utilities
Operations on strings.
Definition: str_utilities.f90:4
num_vars::plot_magn_grid
logical, public plot_magn_grid
whether to plot the grid in real coordinates
Definition: num_vars.f90:103
sol_vars::n_alloc_sols
integer, public n_alloc_sols
nr. of allocated grids
Definition: sol_vars.f90:22
grid_vars::grid_type
Type for grids.
Definition: grid_vars.f90:59
num_vars::prog_style
integer, public prog_style
program style (1: PB3D, 2: PB3D_POST)
Definition: num_vars.f90:53
eq_vars::eq_1_type
flux equilibrium type
Definition: eq_vars.f90:63
num_vars::ltest
logical, public ltest
whether or not to call the testing routines
Definition: num_vars.f90:112
mpi_vars
Variables pertaining to MPI.
Definition: MPI_vars.f90:4
num_vars::min_zeta_plot
real(dp), public min_zeta_plot
min. of zeta_plot
Definition: num_vars.f90:161
vac_vars
Variables pertaining to the vacuum quantities.
Definition: vac_vars.f90:4
sol_vars::sol_type
solution type
Definition: sol_vars.f90:30
x_vars::n_alloc_x_1s
integer, public n_alloc_x_1s
nr. of allocated X_1's
Definition: X_vars.f90:138
num_vars::max_it_slepc
integer, public max_it_slepc
maximum nr. of iterations for SLEPC
Definition: num_vars.f90:101
mpi_vars::lock_type
lock type
Definition: MPI_vars.f90:63
num_vars::compare_tor_pos
logical, public compare_tor_pos
compare quantities at toroidal positions (only for POST)
Definition: num_vars.f90:151
num_vars::max_zvac_plot
real(dp), public max_zvac_plot
max. of Z in which to plot vacuum
Definition: num_vars.f90:168
num_vars::min_theta_plot
real(dp), public min_theta_plot
min. of theta_plot
Definition: num_vars.f90:159
grid_vars::min_par_x
real(dp), public min_par_x
min. of parallel coordinate [ ] in field-aligned grid
Definition: grid_vars.f90:24
num_vars::rich_restart_lvl
integer, public rich_restart_lvl
starting Richardson level (0: none [default])
Definition: num_vars.f90:173
num_vars::export_hel
logical, public export_hel
export HELENA
Definition: num_vars.f90:142
num_vars::rz_0
real(dp), dimension(2), public rz_0
origin of geometrical poloidal coordinate
Definition: num_vars.f90:179
grid_vars::n_alloc_discs
integer, public n_alloc_discs
nr. of allocated discretizations
Definition: grid_vars.f90:31
x_vars::x_2_type
tensorial perturbation type
Definition: X_vars.f90:81
num_vars::print_mem_usage
logical, public print_mem_usage
print memory usage is printed
Definition: num_vars.f90:149
num_vars::max_nr_backtracks_hh
integer, public max_nr_backtracks_hh
maximum number of backtracks for Householder, relax. factors
Definition: num_vars.f90:132
num_vars::min_r_plot
real(dp), public min_r_plot
min. of r_plot
Definition: num_vars.f90:163
num_vars::plot_b
logical, public plot_b
whether to plot the magnetic field in real coordinates
Definition: num_vars.f90:104
num_vars::eq_style
integer, public eq_style
either 1 (VMEC) or 2 (HELENA)
Definition: num_vars.f90:89
num_vars::max_it_rich
integer, public max_it_rich
number of levels for Richardson extrapolation
Definition: num_vars.f90:127
num_vars::tol_slepc
real(dp), dimension(:), allocatable, public tol_slepc
tolerance for SLEPC for different Richardson levels
Definition: num_vars.f90:118
x_vars
Variables pertaining to the perturbation quantities.
Definition: X_vars.f90:4
num_vars::plot_j
logical, public plot_j
whether to plot the current in real coordinates
Definition: num_vars.f90:105
mpi_ops::start_mpi
integer function, public start_mpi()
Start MPI and gather information.
Definition: MPI_ops.f90:22
num_vars::plot_kappa
logical, public plot_kappa
whether to plot curvature
Definition: num_vars.f90:107
num_vars::tol_zero
real(dp), public tol_zero
tolerance for zeros
Definition: num_vars.f90:133
rich_vars::no_guess
logical, public no_guess
disable guessing Eigenfunction from previous level of Richardson
Definition: rich_vars.f90:24
messages::writo
subroutine, public writo(input_str, persistent, error, warning, alert)
Write output to file identified by output_i.
Definition: messages.f90:275
messages
Numerical utilities related to giving output.
Definition: messages.f90:4
num_vars::max_rvac_plot
real(dp), public max_rvac_plot
max. of R in which to plot vacuum
Definition: num_vars.f90:166
mpi_ops::broadcast_input_opts
integer function, public broadcast_input_opts()
Broadcasts options (e.g. user-prescribed) that are not passed through the HDF5 output file (i....
Definition: MPI_ops.f90:247
num_vars::plot_vmec_modes
logical, public plot_vmec_modes
plot VMEC modes
Definition: num_vars.f90:143
num_vars::pi
real(dp), parameter, public pi
Definition: num_vars.f90:83
num_vars::do_execute_command_line
logical, public do_execute_command_line
call "execute_command_line" inside program
Definition: num_vars.f90:148
num_vars::pb3d_name
character(len=max_str_ln), public pb3d_name
name of PB3D output file
Definition: num_vars.f90:139
vac_vars::vac_type
vacuum type
Definition: vac_vars.f90:46
num_vars::jump_to_sol
logical, public jump_to_sol
jump to solution
Definition: num_vars.f90:141
num_vars::time_start
integer(kind=8), public time_start
start time of simulation
Definition: num_vars.f90:71
grid_vars
Variables pertaining to the different grids used.
Definition: grid_vars.f90:4
num_vars::plot_vac_pot
logical, public plot_vac_pot
whether to plot vacuum potential in POST
Definition: num_vars.f90:110
messages::lvl_ud
subroutine, public lvl_ud(inc)
Increases/decreases lvl of output.
Definition: messages.f90:254
num_vars::max_r_plot
real(dp), public max_r_plot
max. of r_plot
Definition: num_vars.f90:164
input_utilities::pause_prog
subroutine, public pause_prog(ind)
Pauses the running of the program.
Definition: input_utilities.f90:226
num_vars::no_plots
logical, public no_plots
no plots made
Definition: num_vars.f90:140
x_vars::n_alloc_x_2s
integer, public n_alloc_x_2s
nr. of allocated X_2's
Definition: X_vars.f90:139
mpi_ops::sudden_stop
subroutine, public sudden_stop(ierr)
Suddenly stops the computations, aborting MPI, etc.
Definition: MPI_ops.f90:483
num_vars::plot_grid_style
integer, public plot_grid_style
style for POST plot grid (0: 3-D plots, 1: slab plots, 2: slab plots with folding,...
Definition: num_vars.f90:169
num_vars::min_rvac_plot
real(dp), public min_rvac_plot
min. of R in which to plot vacuum
Definition: num_vars.f90:165
num_vars::pert_mult_factor_post
real(dp), public pert_mult_factor_post
factor with which to multiply perturbation strength for POST
Definition: num_vars.f90:176
rich_vars::min_n_par_x
integer, public min_n_par_x
min. of n_par_X (e.g. first value in Richardson loop)
Definition: rich_vars.f90:22
mpi_vars::dealloc_lock
integer function, public dealloc_lock(lock_loc)
Deallocates a lock.
Definition: MPI_vars.f90:133
rich_vars::rich_lvl
integer, public rich_lvl
current level of Richardson extrapolation
Definition: rich_vars.f90:19
x_vars::x_1_type
vectorial perturbation type
Definition: X_vars.f90:51
sol_vars
Variables pertaining to the solution quantities.
Definition: sol_vars.f90:4
mpi_vars::hdf5_lock
type(lock_type), public hdf5_lock
HDF5 lock.
Definition: MPI_vars.f90:76
num_vars::post_output_full
logical, public post_output_full
POST has output on full grids.
Definition: num_vars.f90:146
grid_vars::n_alloc_grids
integer, public n_alloc_grids
nr. of allocated grids
Definition: grid_vars.f90:30
num_vars::plot_flux_q
logical, public plot_flux_q
whether to plot flux quantities in real coordinates
Definition: num_vars.f90:106
num_vars::solver_slepc_style
integer, public solver_slepc_style
style for solver (1: Krylov-Schur, 2: GD)
Definition: num_vars.f90:97
num_vars::sol_n_procs
integer, public sol_n_procs
nr. of MPI processes for solution with SLEPC
Definition: num_vars.f90:70
num_vars::max_zeta_plot
real(dp), public max_zeta_plot
max. of zeta_plot
Definition: num_vars.f90:162
num_vars::rank
integer, public rank
MPI rank.
Definition: num_vars.f90:68
num_vars::n_vac_plot
integer, dimension(2), public n_vac_plot
nr. of points in R and Z in vacuum
Definition: num_vars.f90:158
num_vars::max_tot_mem
real(dp), public max_tot_mem
maximum total memory for all processes [MB]
Definition: num_vars.f90:74
input_utilities
Numerical utilities related to input.
Definition: input_utilities.f90:4
eq_vars::n_alloc_eq_2s
integer, public n_alloc_eq_2s
nr. of allocated eq_2 variables
Definition: eq_vars.f90:55
num_vars::post_style
integer, public post_style
style for POST (1: extended grid, 2: B-aligned grid)
Definition: num_vars.f90:98
num_vars::tol_norm
real(dp), public tol_norm
tolerance for normal range (normalized to 0..1)
Definition: num_vars.f90:134
num_vars::max_x_mem
real(dp), public max_x_mem
maximum memory for perturbation calculations for all processes [MB]
Definition: num_vars.f90:75
eq_vars::eq_2_type
metric equilibrium type
Definition: eq_vars.f90:114
num_vars::n_theta_plot
integer, public n_theta_plot
nr. of poloidal points in plot
Definition: num_vars.f90:156
num_vars::tol_rich
real(dp), public tol_rich
tolerance for Richardson extrapolation
Definition: num_vars.f90:128