Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_k_make_cos_twogaussian_init.F90
Go to the documentation of this file.
1  read(file_id, cos_twogaussian)
2  allocate( params%kx(params%dims(1),params%n_cos) )
3  allocate( params%modnum(params%dims(1),params%n_cos) )
4  allocate( params%alpha(params%n_cos) );
5  allocate( params%phase_shift(params%n_cos) )
6  allocate( params%v_thermal(params%dims(2),2) )
7  allocate( params%v_mean(params%dims(2),2) )
8  allocate( params%normal(2) )
9  allocate( params%delta(2) )
10 
11  params%n_gaussians = 2
12  if ( params%n_cos == 1 ) then
13  params%kx(:,1) = kx
14  params%modnum(:,1) = modnum
15  else
16  params%modnum = 0.0_f64
17  do j=1, params%n_cos
18  params%kx(j,j) = kx(j)
19  params%modnum(j,j) = modnum(j)
20  end do
21  end if
22  params%alpha = alpha
23  params%phase_shift=phase_shift
24  params%v_thermal(:,1) = v_thermal_1
25  params%v_mean(:,1) = v_mean_1
26  params%v_thermal(:,2) = v_thermal_2
27  params%v_mean(:,2) = v_mean_2
28  params%delta(1) = delta
29  params%delta(2) = 1.0_f64 - delta
30 
31  do j=1,2
32  params%normal(j) = 1.0_f64/(sll_p_twopi**(0.5_f64*real(params%dims(2),f64))*&
33  product(params%v_thermal(:,j)))
34 
35  end do
36 
37  end subroutine
    Report Typos and Errors