3 #include "sll_assert.h"
4 #include "sll_working_precision.h"
31 sll_int32 :: is_delta_f
40 kx_val, v0_val, is_delta_f)
43 sll_int32 :: data_position
44 sll_real64,
intent(in),
optional :: eps_val
45 sll_real64,
intent(in),
optional :: kx_val
46 sll_real64,
intent(in),
optional :: v0_val
47 sll_int32,
intent(in),
optional :: is_delta_f
49 init_obj%data_position = data_position
50 if (
present(eps_val))
then
51 init_obj%eps = eps_val
53 init_obj%eps = 0.01_f64
55 if (
present(kx_val))
then
60 if (
present(v0_val))
then
65 if (
present(is_delta_f))
then
66 init_obj%is_delta_f = is_delta_f
68 init_obj%is_delta_f = 1
70 init_obj%transf => transf
76 sll_real64,
dimension(:, :),
intent(out) :: data_out
90 transf => init_obj%transf
93 num_pts1 = transf%mesh%num_cells1 + 1
94 num_pts2 = transf%mesh%num_cells2 + 1
96 num_pts1 = transf%mesh%num_cells1
97 num_pts2 = transf%mesh%num_cells2
100 sll_assert(
size(data_out, 1) .ge. num_pts1)
101 sll_assert(
size(data_out, 2) .ge. num_pts2)
105 v = transf%x2_at_node(i, j)
106 x = transf%x1_at_node(i, j)
108 v = transf%x2_at_cell(i, j)
109 x = transf%x1_at_cell(i, j)
111 print *,
'f_x1x2_tsi_2d:', init_obj%data_position,
'not defined'
113 if (init_obj%is_delta_f == 0)
then
114 data_out(i, j) = (1.0_f64 + eps*cos(kx*x))*0.5_f64/sqrt(2*
sll_p_pi) &
115 *(exp(-.5_f64*(v - v0)**2) + exp(-.5_f64*(v + v0)**2))
117 data_out(i, j) = (1.0_f64 + eps*cos(kx*x))*0.5_f64/sqrt(2*
sll_p_pi) &
118 *(exp(-.5_f64*(v - v0)**2) + exp(-.5_f64*(v + v0)**2))
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
integer, parameter, public sll_p_node_centered_field
subroutine f_x1x2_tsi_2d(init_obj, data_out)
subroutine initialize_tsi_2d(init_obj, transf, data_position, eps_val, kx_val, v0_val, is_delta_f)