SFEMaNS  version 4.1 (work in progress) Reference documentation for SFEMaNS
test_17.f90
Go to the documentation of this file.
1 MODULE test_17
2  IMPLICIT NONE
3  !test 17
4  REAL (KIND=8), PARAMETER, PRIVATE :: ratio_mu_T17 = 50.d0 ! the variation of mu
5  REAL (KIND=8), PRIVATE :: b_factor_T17_anal = (2**6) * (1.d0 - 1/ratio_mu_T17)
6
7 CONTAINS
8
9  !====================================================
10  !=======================Extra subroutines for test 17
11  FUNCTION f_test_t17(r,z) RESULT(vv)
12  IMPLICIT NONE
13  REAL(KIND=8), DIMENSION(:), INTENT(IN) :: r, z
14  REAL(KIND=8), DIMENSION(SIZE(r)) :: vv
15  vv = b_factor_t17_anal*(r*(1-r)*(z**2-1))**3
16  RETURN
17  END FUNCTION f_test_t17
18
19  FUNCTION dfdr_test_t17(r,z) RESULT(vv)
20  IMPLICIT NONE
21  REAL(KIND=8), INTENT(IN):: r, z
22  REAL(KIND=8) :: vv
23  vv = 3 * b_factor_t17_anal * (z**2-1)**3 * (r*(1-r))**2 * (1-2*r)
24  RETURN
25  END FUNCTION dfdr_test_t17
26
27  FUNCTION dfdz_test_t17(r,z) RESULT(vv)
28  IMPLICIT NONE
29  REAL(KIND=8), INTENT(IN):: r, z
30  REAL(KIND=8) :: vv
31  vv = 3*b_factor_t17_anal*(r*(1-r))**3*(z**2-1)**2*(2*z)
32  RETURN
33  END FUNCTION dfdz_test_t17
34
35  !===Analytical mu_in_fourier_space (if needed)
36  FUNCTION mu_bar_in_fourier_space_anal_t17(H_mesh,nb,ne,pts,pts_ids) RESULT(vv)
37  USE def_type_mesh
38  USE input_data
39  USE my_util
40  IMPLICIT NONE
41  TYPE(mesh_type) :: h_mesh
42  REAL(KIND=8), DIMENSION(ne-nb+1) :: vv
43  INTEGER :: nb, ne
44  REAL(KIND=8),DIMENSION(2,ne-nb+1),OPTIONAL :: pts
45  INTEGER, DIMENSION(ne-nb+1), OPTIONAL :: pts_ids
46  REAL(KIND=8),DIMENSION(ne-nb+1) :: r,z
47
48  IF( present(pts) .AND. present(pts_ids) ) THEN !Computing mu at pts
49  r=pts(1,nb:ne)
50  z=pts(2,nb:ne)
51  ELSE
52  r=h_mesh%rr(1,nb:ne) !Computing mu at nodes
53  z=h_mesh%rr(2,nb:ne)
54  END IF
55  vv=1.d0/(1.d0+f_test_t17(r,z))
56  RETURN
58
59  !===Analytical mu_in_fourier_space (if needed)
61  USE input_data
62  USE my_util
63  IMPLICIT NONE
64  REAL(KIND=8),DIMENSION(2) :: vv
65  REAL(KIND=8),DIMENSION(2) :: pt
66  INTEGER,DIMENSION(1) :: pt_id
67  REAL(KIND=8),DIMENSION(1) :: r,z, tmp
68  INTEGER :: n
69
70  r=pt(1)
71  z=pt(2)
72  tmp=(1.d0 +f_test_t17(r,z))**2
73  vv(1)=-dfdr_test_t17(r(1),z(1))/tmp(1)
74  vv(2)=-dfdz_test_t17(r(1),z(1))/tmp(1)
75  RETURN
76
77  !===Dummies variables to avoid warning
78  n=pt_id(1)
79  !===Dummies variables to avoid warning
81
82 END MODULE test_17
real(kind=8) function, dimension(size(r)) f_test_t17(r, z)
Definition: test_17.f90:11