-
Notifications
You must be signed in to change notification settings - Fork 0
/
initialisation.f90
46 lines (32 loc) · 974 Bytes
/
initialisation.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module initialisation
use zone
implicit none
integer, private :: i, j
contains
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!Initialisation des champs
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine init( tm )
type (mesh_fields) :: tm
real(kind=prec) :: time, aux1, aux2
select case (nomcas)
case("faisce")
tm%ex = 0.d0; tm%ey = 0.d0; tm%bz = 0.d0
tm%jx = 0.d0; tm%jy = 0.d0; tm%r0 = 0.d0; tm%r1 = 0.d0
case("gaussv")
tm%ex = 0.d0; tm%ey = 0.d0; tm%bz = 0.d0
tm%jx = 0.d0; tm%jy = 0.d0; tm%r0 = 0.d0; tm%r1 = 0.d0
case("plasma")
tm%ex = 0.d0; tm%ey = 0.d0; tm%bz = 0.d0
tm%jx = 0.d0; tm%jy = 0.d0; tm%r0 = 0.d0; tm%r1 = 0.d0
do i=0,nx-1
aux1 = alpha/kx * sin(kx*x(i))
aux2 = alpha * cos(kx*x(i))
do j=0,ny
tm%ex(i,j) = aux1
tm%r1(i,j) = aux2
enddo
enddo
end select
end subroutine init
end module initialisation