Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_gyroaverage_2d_polar_pade_solver.F90
Go to the documentation of this file.
1 !**************************************************************
2 ! Copyright INRIA
3 ! Authors :
4 ! CALVI project team
5 !
6 ! This code SeLaLib (for Semi-Lagrangian-Library)
7 ! is a parallel library for simulating the plasma turbulence
8 ! in a tokamak.
9 !
10 ! This software is governed by the CeCILL-B license
11 ! under French law and abiding by the rules of distribution
12 ! of free software. You can use, modify and redistribute
13 ! the software under the terms of the CeCILL-B license as
14 ! circulated by CEA, CNRS and INRIA at the following URL
15 ! "http://www.cecill.info".
16 !**************************************************************
17 
19 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20 #include "sll_memory.h"
21 #include "sll_working_precision.h"
22 
23  use sll_m_gyroaverage_2d_base, only: &
25 
26  use sll_m_gyroaverage_2d_polar, only: &
31 
32  implicit none
33 
34  public :: &
36 
37  private
38 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39 
41 
42  type(sll_t_plan_gyroaverage_polar), pointer :: gyro
43  sll_int32 :: pade_case
44  ! pade_case
45  ! (/0,2/)
46  ! (/0,4/)
47  ! (/2,4/)
48 
49  contains
50  procedure, pass(gyroaverage) :: initialize => &
52  procedure, pass(gyroaverage) :: compute_gyroaverage => &
54 
56 
57 contains
59  eta_min, &
60  eta_max, &
61  Nc, &
62  pade_case) &
63  result(gyroaverage)
64 
65  type(gyroaverage_2d_polar_pade_solver), pointer :: gyroaverage
66  sll_real64, intent(in) :: eta_min(2)
67  sll_real64, intent(in) :: eta_max(2)
68  sll_int32, intent(in) :: nc(2)
69  sll_int32, optional :: pade_case(2)
70  sll_int32 :: ierr
71 
72  sll_allocate(gyroaverage, ierr)
74  gyroaverage, &
75  eta_min, &
76  eta_max, &
77  nc, &
78  pade_case)
79 
81 
83  gyroaverage, &
84  eta_min, &
85  eta_max, &
86  Nc, &
87  pade_case)
88  class(gyroaverage_2d_polar_pade_solver) :: gyroaverage
89  sll_real64, intent(in) :: eta_min(2)
90  sll_real64, intent(in) :: eta_max(2)
91  sll_int32, intent(in) :: nc(2)
92  sll_int32, optional :: pade_case(2)
93 
94  if (.not. (present(pade_case))) then
95  gyroaverage%pade_case = 0
96  elseif ((pade_case(1) == 0) .and. (pade_case(2) == 2)) then
97  gyroaverage%pade_case = 1
98  elseif ((pade_case(1) == 0) .and. (pade_case(2) == 4)) then
99  gyroaverage%pade_case = 2
100  elseif ((pade_case(1) == 2) .and. (pade_case(2) == 4)) then
101  gyroaverage%pade_case = 3
102  else
103  print *, '#bad value of pade_case=', gyroaverage%pade_case
104  print *, '#not implemented'
105  print *, '#in initialize_gyroaverage_2d_polar_pade_solver'
106  stop
107  end if
108 
109  gyroaverage%gyro => sll_f_new_plan_gyroaverage_polar_pade( &
110  eta_min, &
111  eta_max, &
112  nc)
113 
115 
116  subroutine compute_gyroaverage_2d_polar_pade(gyroaverage, larmor_rad, f)
117  class(gyroaverage_2d_polar_pade_solver), target :: gyroaverage
118  sll_real64, intent(in) :: larmor_rad
119  sll_real64, dimension(:, :), intent(inout) :: f
120 
121  select case (gyroaverage%pade_case)
122  case (0)
123  call sll_s_compute_gyroaverage_pade_polar(gyroaverage%gyro, f, larmor_rad)
124  case (1)
125  call sll_s_compute_gyroaverage_pade_high_order_polar(gyroaverage%gyro, f, larmor_rad, (/0, 2/))
126  case (2)
127  call sll_s_compute_gyroaverage_pade_high_order_polar(gyroaverage%gyro, f, larmor_rad, (/0, 4/))
128  case (3)
129  call sll_s_compute_gyroaverage_pade_high_order_polar(gyroaverage%gyro, f, larmor_rad, (/2, 4/))
130  case default
131  print *, '#bad value of pade_case=', gyroaverage%pade_case
132  print *, '#not implemented'
133  print *, 'compute_gyroaverage_2d_polar_pade'
134  stop
135  end select
136 
137  end subroutine compute_gyroaverage_2d_polar_pade
138 
type(gyroaverage_2d_polar_pade_solver) function, pointer, public sll_f_new_gyroaverage_2d_polar_pade_solver(eta_min, eta_max, Nc, pade_case)
subroutine initialize_gyroaverage_2d_polar_pade_solver(gyroaverage, eta_min, eta_max, Nc, pade_case)
subroutine compute_gyroaverage_2d_polar_pade(gyroaverage, larmor_rad, f)
subroutine, public sll_s_compute_gyroaverage_pade_polar(gyro, f, rho)
type(sll_t_plan_gyroaverage_polar) function, pointer, public sll_f_new_plan_gyroaverage_polar_pade(eta_min, eta_max, Nc)
subroutine, public sll_s_compute_gyroaverage_pade_high_order_polar(gyro, f, rho, order)
    Report Typos and Errors