PB3D
[2.45]
Ideal linear high-n MHD stability in 3-D
|
Go to the documentation of this file.
5 #include <PB3D_macros.h>
32 integer :: lim_sec_x(2)
33 integer,
allocatable :: n(:,:)
34 integer,
allocatable :: m(:,:)
35 complex(dp),
allocatable :: vec(:,:,:)
36 complex(dp),
allocatable :: val(:)
38 real(
dp) :: estim_mem_usage
59 subroutine init_sol(sol,mds,grid_sol,n_EV,lim_sec_X)
66 class(
sol_type),
intent(inout) :: sol
69 integer,
intent(in) :: n_EV
70 integer,
intent(in),
optional :: lim_sec_X(2)
78 call set_nm_x(mds,grid_sol,sol%lim_sec_X,sol%n,sol%m,lim_sec_x)
81 sol%n_mod =
size(sol%n,2)
84 allocate(sol%val(1:n_ev))
87 allocate(sol%vec(1:sol%n_mod,1:grid_sol%loc_n_r,1:n_ev))
92 &n_ev * (1 + sol%n_mod*grid_sol%loc_n_r)
97 &
' - Expected memory usage of sol: '//&
98 &trim(
r2strt(sol%estim_mem_usage*weight_dp*2))//
' kB]',alert=.true.)
111 class(
sol_type),
intent(inout) :: sol
116 real(dp) :: estim_mem_usage
121 estim_mem_usage = sol%estim_mem_usage
126 call dealloc_sol_final(sol)
136 &trim(
i2str(mem_diff))//
'kB deallocating sol ('//&
137 &trim(
i2str(nint(100*mem_diff/&
138 &(estim_mem_usage*weight_dp*2))))//&
139 &
'% of estimated)]',alert=.true.)
145 subroutine dealloc_sol_final(sol)
148 end subroutine dealloc_sol_final
integer, parameter, public dp
double precision
Numerical variables used by most other modules.
integer, parameter, public max_str_ln
maximum length of strings
elemental character(len=max_str_ln) function, public i2str(k)
Convert an integer to string.
integer function, public get_mem_usage()
Returns the memory usage in kilobytes.
complex(dp), parameter, public iu
complex unit
subroutine init_sol(sol, mds, grid_sol, n_EV, lim_sec_X)
Initialize a solution type and allocate the variables.
integer, public n_alloc_sols
nr. of allocated grids
elemental character(len=max_str_ln) function, public r2strt(k)
Convert a real (double) to string.
real(dp), parameter, public weight_dp
size of double precision in kB
logical, public print_mem_usage
print memory usage is printed
Variables pertaining to the perturbation quantities.
subroutine, public writo(input_str, persistent, error, warning, alert)
Write output to file identified by output_i.
Numerical utilities related to giving output.
Variables pertaining to the different grids used.
Variables pertaining to the solution quantities.
Operations concerning giving output, on the screen as well as in output files.
integer, public rank
MPI rank.
subroutine dealloc_sol(sol)
Deallocates solution variables.