PB3D [2.47]
Ideal linear high-n MHD stability in 3-D
Loading...
Searching...
No Matches
MPI_ops.f90
Go to the documentation of this file.
1!------------------------------------------------------------------------------!
2!> Operations related to MPI.
3!------------------------------------------------------------------------------!
4module mpi_ops
5#include <PB3D_macros.h>
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
17contains
18 !> Start MPI and gather information.
19 !!
20 !! \return ierr
21 integer function start_mpi() result(ierr)
22 use num_vars, only: rank, n_procs, time_start
23 use mpi_vars, only: hdf5_lock
25#if ldebug
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
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
64 !> Stop MPI.
65 !!
66 !! Also deallocates:
67 !! - \c grid_eq
68 !! - \c grid_eq_B
69 !! - \c grid_X
70 !! - \c grid_X_B
71 !! - \c grid_sol
72 !! - \c eq_1
73 !! - \c eq_2
74 !! - \c X_1
75 !! - \c X_2
76 !! - \c sol
77 !!
78 !! \return ierr
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, &
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
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 !< equilibrium grid
104 type(grid_type), intent(inout), pointer, optional :: grid_eq_b !< field-aligned equilibrium grid
105 type(grid_type), intent(inout), optional :: grid_x !< perturbation grid
106 type(grid_type), intent(inout), pointer, optional :: grid_x_b !< field-aligned perturbation grid
107 type(grid_type), intent(inout), optional :: grid_sol !< solution grid
108 type(eq_1_type), intent(inout), optional :: eq_1 !< Flux equilibrium variables
109 type(eq_2_type), intent(inout), optional :: eq_2 !< metric equilibrium variables
110 type(x_1_type), intent(inout), optional :: x_1 !< vectorial perturbation variables
111 type(x_2_type), intent(inout), optional :: x_2 !< integrated tensorial perturbation variables
112 type(vac_type), intent(inout), optional :: vac !< vacuum variables
113 type(sol_type), intent(inout), optional :: sol !< solution variables
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
223 !> Abort MPI suddenly.
224 !!
225 !! \return ierr
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
236 !> Broadcasts options (e.g. user-prescribed) that are not passed through the
237 !! HDF5 output file (i.e. \c ltest, \c no_plots, ...).
238 !!
239 !! \see read_input_opts()
240 !!
241 !! \note Some variables (e.g. \c eq_style, ...) are not passed over MPI.
242 !! Every process should call its own reconstruct_pb3d_in() in order to
243 !! obtain them.
244 !!
245 !! \return ierr
246 integer function broadcast_input_opts() result(ierr)
247 use num_vars, only: max_str_ln, ltest, max_it_zero, rank, &
262 &pb3d_name, &
263 &rz_0, &
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
477 !> Suddenly stops the computations, aborting MPI, etc.
478 !!
479 !! As a special case, if \c ierr = 66, no error message is printed.
480 !!
481 !! \return ierr
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
509end module mpi_ops
Gather parallel variable in serial version on group master.
Variables that have to do with equilibrium quantities and the grid used in the calculations:
Definition eq_vars.f90:27
integer, public n_alloc_eq_1s
nr. of allocated eq_1 variables
Definition eq_vars.f90:53
integer, public n_alloc_eq_2s
nr. of allocated eq_2 variables
Definition eq_vars.f90:55
Variables pertaining to the different grids used.
Definition grid_vars.f90:4
integer, public n_alloc_discs
nr. of allocated discretizations
Definition grid_vars.f90:31
real(dp), public min_par_x
min. of parallel coordinate [ ] in field-aligned grid
Definition grid_vars.f90:24
integer, public n_alloc_grids
nr. of allocated grids
Definition grid_vars.f90:30
real(dp), public max_par_x
max. of parallel coordinate [ ] in field-aligned grid
Definition grid_vars.f90:25
Numerical utilities related to input.
subroutine, public pause_prog(ind)
Pauses the running of the program.
Numerical utilities related to giving output.
Definition messages.f90:4
subroutine, public lvl_ud(inc)
Increases/decreases lvl of output.
Definition messages.f90:254
subroutine, public writo(input_str, persistent, error, warning, alert)
Write output to file identified by output_i.
Definition messages.f90:275
Operations related to MPI.
Definition MPI_ops.f90:4
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
subroutine, public sudden_stop(ierr)
Suddenly stops the computations, aborting MPI, etc.
Definition MPI_ops.f90:483
integer function, public abort_mpi()
Abort MPI suddenly.
Definition MPI_ops.f90:227
integer function, public start_mpi()
Start MPI and gather information.
Definition MPI_ops.f90:22
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
Numerical utilities related to MPI.
integer, public n_waits
number of waits
Variables pertaining to MPI.
Definition MPI_vars.f90:4
type(lock_type), public hdf5_lock
HDF5 lock.
Definition MPI_vars.f90:76
integer function, public dealloc_lock(lock_loc)
Deallocates a lock.
Definition MPI_vars.f90:133
Numerical variables used by most other modules.
Definition num_vars.f90:4
integer, public sol_n_procs
nr. of MPI processes for solution with SLEPC
Definition num_vars.f90:70
integer, parameter, public dp
double precision
Definition num_vars.f90:46
logical, public ltest
whether or not to call the testing routines
Definition num_vars.f90:112
integer, public post_style
style for POST (1: extended grid, 2: B-aligned grid)
Definition num_vars.f90:98
logical, public plot_b
whether to plot the magnetic field in real coordinates
Definition num_vars.f90:104
integer, public n_theta_plot
nr. of poloidal points in plot
Definition num_vars.f90:156
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
logical, public plot_kappa
whether to plot curvature
Definition num_vars.f90:107
real(dp), public max_r_plot
max. of r_plot
Definition num_vars.f90:164
real(dp), public min_theta_plot
min. of theta_plot
Definition num_vars.f90:159
real(dp), parameter, public pi
Definition num_vars.f90:83
logical, public print_mem_usage
print memory usage is printed
Definition num_vars.f90:149
real(dp), public max_zeta_plot
max. of zeta_plot
Definition num_vars.f90:162
logical, public compare_tor_pos
compare quantities at toroidal positions (only for POST)
Definition num_vars.f90:151
real(dp), public tol_norm
tolerance for normal range (normalized to 0..1)
Definition num_vars.f90:134
integer, public n_procs
nr. of MPI processes
Definition num_vars.f90:69
logical, public plot_flux_q
whether to plot flux quantities in real coordinates
Definition num_vars.f90:106
integer, dimension(2), public plot_size
size of plot in inches
Definition num_vars.f90:172
integer, public n_sol_requested
how many solutions requested
Definition num_vars.f90:170
integer, parameter, public max_str_ln
maximum length of strings
Definition num_vars.f90:50
logical, public plot_sol_q
whether to plot magnetic perturbation of solution in POST
Definition num_vars.f90:109
real(dp), public ev_guess
first guess for eigenvalue
Definition num_vars.f90:117
logical, public post_output_sol
POST has outputs of solution.
Definition num_vars.f90:147
integer, public prog_style
program style (1: PB3D, 2: PB3D_POST)
Definition num_vars.f90:53
integer, dimension(2), public n_vac_plot
nr. of points in R and Z in vacuum
Definition num_vars.f90:158
real(dp), public max_zvac_plot
max. of Z in which to plot vacuum
Definition num_vars.f90:168
logical, public plot_vac_pot
whether to plot vacuum potential in POST
Definition num_vars.f90:110
integer, public n_zeta_plot
nr. of toroidal points in plot
Definition num_vars.f90:157
real(dp), public max_rvac_plot
max. of R in which to plot vacuum
Definition num_vars.f90:166
integer(kind=8), public time_start
start time of simulation
Definition num_vars.f90:71
logical, public plot_resonance
whether to plot the q-profile or iota-profile with resonances
Definition num_vars.f90:102
real(dp), public min_zeta_plot
min. of zeta_plot
Definition num_vars.f90:161
logical, public post_output_full
POST has output on full grids.
Definition num_vars.f90:146
integer, public eq_style
either 1 (VMEC) or 2 (HELENA)
Definition num_vars.f90:89
integer, public max_it_slepc
maximum nr. of iterations for SLEPC
Definition num_vars.f90:101
logical, public plot_vmec_modes
plot VMEC modes
Definition num_vars.f90:143
character(len=max_str_ln), public pb3d_name
name of PB3D output file
Definition num_vars.f90:139
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
logical, public invert_top_bottom_h
invert top and bottom for HELENA equilibria
Definition num_vars.f90:144
real(dp), public min_rvac_plot
min. of R in which to plot vacuum
Definition num_vars.f90:165
real(dp), public tol_rich
tolerance for Richardson extrapolation
Definition num_vars.f90:128
logical, public export_hel
export HELENA
Definition num_vars.f90:142
real(dp), public pert_mult_factor_post
factor with which to multiply perturbation strength for POST
Definition num_vars.f90:176
logical, public plot_j
whether to plot the current in real coordinates
Definition num_vars.f90:105
integer, public max_nr_backtracks_hh
maximum number of backtracks for Householder, relax. factors
Definition num_vars.f90:132
integer, public ex_plot_style
external plot style (1: GNUPlot, 2: Bokeh for 2D, Mayavi for 3D)
Definition num_vars.f90:175
real(dp), dimension(2), public rz_0
origin of geometrical poloidal coordinate
Definition num_vars.f90:179
real(dp), public min_r_plot
min. of r_plot
Definition num_vars.f90:163
integer, public rank
MPI rank.
Definition num_vars.f90:68
real(dp), public min_zvac_plot
min. of Z in which to plot vacuum
Definition num_vars.f90:167
integer, public rich_restart_lvl
starting Richardson level (0: none [default])
Definition num_vars.f90:173
logical, public plot_sol_xi
whether to plot plasma perturbation of solution in POST
Definition num_vars.f90:108
real(dp), dimension(:), allocatable, public tol_slepc
tolerance for SLEPC for different Richardson levels
Definition num_vars.f90:118
logical, public jump_to_sol
jump to solution
Definition num_vars.f90:141
integer, public max_it_zero
maximum number of iterations to find zeros
Definition num_vars.f90:131
logical, public do_execute_command_line
call "execute_command_line" inside program
Definition num_vars.f90:148
logical, public plot_magn_grid
whether to plot the grid in real coordinates
Definition num_vars.f90:103
logical, public swap_angles
swap angles theta and zeta in plots (only for POST)
Definition num_vars.f90:150
logical, public retain_all_sol
retain also faulty solutions
Definition num_vars.f90:152
real(dp), public max_theta_plot
max. of theta_plot
Definition num_vars.f90:160
real(dp), public tol_zero
tolerance for zeros
Definition num_vars.f90:133
real(dp), public max_tot_mem
maximum total memory for all processes [MB]
Definition num_vars.f90:74
logical, public plot_e_rec
whether to plot energy reconstruction in POST
Definition num_vars.f90:111
real(dp), public max_x_mem
maximum memory for perturbation calculations for all processes [MB]
Definition num_vars.f90:75
integer, public max_it_rich
number of levels for Richardson extrapolation
Definition num_vars.f90:127
logical, public no_plots
no plots made
Definition num_vars.f90:140
integer, public solver_slepc_style
style for solver (1: Krylov-Schur, 2: GD)
Definition num_vars.f90:97
Variables concerning Richardson extrapolation.
Definition rich_vars.f90:4
integer, public min_n_par_x
min. of n_par_X (e.g. first value in Richardson loop)
Definition rich_vars.f90:22
logical, public no_guess
disable guessing Eigenfunction from previous level of Richardson
Definition rich_vars.f90:24
integer, public rich_lvl
current level of Richardson extrapolation
Definition rich_vars.f90:19
Variables pertaining to the solution quantities.
Definition sol_vars.f90:4
integer, public n_alloc_sols
nr. of allocated grids
Definition sol_vars.f90:22
Operations on strings.
elemental character(len=max_str_ln) function, public i2str(k)
Convert an integer to string.
Variables pertaining to the vacuum quantities.
Definition vac_vars.f90:4
Variables pertaining to the perturbation quantities.
Definition X_vars.f90:4
integer, public n_alloc_x_2s
nr. of allocated X_2's
Definition X_vars.f90:139
integer, public n_alloc_x_1s
nr. of allocated X_1's
Definition X_vars.f90:138
flux equilibrium type
Definition eq_vars.f90:63
metric equilibrium type
Definition eq_vars.f90:114
Type for grids.
Definition grid_vars.f90:59
solution type
Definition sol_vars.f90:30
vacuum type
Definition vac_vars.f90:46
vectorial perturbation type
Definition X_vars.f90:51
tensorial perturbation type
Definition X_vars.f90:81