Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_mudpack_curvilinear.F90
Go to the documentation of this file.
1 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2 
10 module sll_m_mudpack_curvilinear
11 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 #include "sll_working_precision.h"
13 
14 ! use F77_mudpack, only: &
15 ! muh24cr, &
16 ! muh2cr
17 
19  sll_p_dirichlet, &
20  sll_p_periodic
21 
24 
27 
28  use sll_m_interpolators_2d_base, only: &
30 
31  implicit none
32 
33  public :: &
34  sll_t_mudpack_2d, &
35  sll_o_create, &
36  sll_p_non_separable_with_cross_terms, &
37  sll_p_non_separable_without_cross_terms, &
38  sll_p_separable
39 
40  private
41 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
42 
44  type :: sll_t_mudpack_2d
45 
46  sll_real64, dimension(:), allocatable :: work
47  sll_int32 :: mgopt(4)
48  sll_int32 :: iprm(16)
49  sll_real64 :: fprm(6)
50  sll_int32 :: iguess
51  sll_int32, pointer :: iwork(:, :)
52 
53  end type sll_t_mudpack_2d
54 
55  integer, parameter :: sll_p_separable = 1
56  integer, parameter :: sll_p_non_separable_without_cross_terms = 2
57  integer, parameter :: sll_p_non_separable_with_cross_terms = 3
58 
60  class(sll_c_interpolator_2d), pointer :: cxx_interp
61  type(sll_t_cubic_spline_interpolator_2d), target :: cxx_cs2d
63  class(sll_c_interpolator_2d), pointer :: cyy_interp
64  type(sll_t_cubic_spline_interpolator_2d), target :: cyy_cs2d
66  class(sll_c_interpolator_2d), pointer :: cxy_interp
67  type(sll_t_cubic_spline_interpolator_2d), target :: cxy_cs2d
69  class(sll_c_interpolator_2d), pointer :: cx_interp
70  type(sll_t_cubic_spline_interpolator_2d), target :: cx_cs2d
72  class(sll_c_interpolator_2d), pointer :: cy_interp
73  type(sll_t_cubic_spline_interpolator_2d), target :: cy_cs2d
75  class(sll_c_interpolator_2d), pointer :: ce_interp
76  type(sll_t_cubic_spline_interpolator_2d), target :: ce_cs2d
78  class(sll_c_interpolator_2d), pointer :: a12_interp
79  type(sll_t_cubic_spline_interpolator_2d), target :: a12_cs2d
81  class(sll_c_interpolator_2d), pointer :: a21_interp
82  type(sll_t_cubic_spline_interpolator_2d), target :: a21_cs2d
83 
85  class(sll_c_coordinate_transformation_2d_base), pointer :: transformation
86 
87  interface sll_o_create
88  module procedure initialize_poisson_curvilinear_mudpack
89  end interface sll_o_create
90 
91 contains
92 
95  subroutine initialize_poisson_curvilinear_mudpack( &
96  self, &
97  transf, &
98  b11, &
99  b12, &
100  b21, &
101  b22, &
102  c, &
103  eta1_min, &
104  eta1_max, &
105  nc_eta1, &
106  eta2_min, &
107  eta2_max, &
108  nc_eta2, &
109  bc_eta1_left, &
110  bc_eta1_right, &
111  bc_eta2_left, &
112  bc_eta2_right)
113 
114  type(sll_t_mudpack_2d) :: self
115  sll_real64, intent(in) :: eta1_min
116  sll_real64, intent(in) :: eta1_max
117  sll_real64, intent(in) :: eta2_min
118  sll_real64, intent(in) :: eta2_max
119  sll_int32, intent(in) :: nc_eta1
120  sll_int32, intent(in) :: nc_eta2
121  sll_int32 :: icall
122  sll_int32 :: llwork
123  sll_int32 :: bc_eta1_left
124  sll_int32 :: bc_eta1_right
125  sll_int32 :: bc_eta2_left
126  sll_int32 :: bc_eta2_right
127 
128  sll_real64, pointer :: phi(:, :)
129  sll_real64, pointer :: rhs(:, :)
130 
131  sll_real64, dimension(:, :), pointer :: b11
132  sll_real64, dimension(:, :), pointer :: b12
133  sll_real64, dimension(:, :), pointer :: b21
134  sll_real64, dimension(:, :), pointer :: b22
135  sll_real64, dimension(:, :), pointer :: c
136 
137  class(sll_c_coordinate_transformation_2d_base), pointer :: transf
138 
139 ! put integer and floating point argument names in contiguous
140 ! storeage for labelling in vectors iprm,fprm
141  sll_int32 :: intl, nxa, nxb, nyc, nyd, ixp, jyq, iex, jey, nx, ny, &
142  iguess, maxcy, method, nwork, lwrkqd, itero
143  common/itmud2cr/intl, nxa, nxb, nyc, nyd, ixp, jyq, iex, jey, nx, ny, &
144  iguess, maxcy, method, nwork, lwrkqd, itero
145  sll_real64 :: xa, xb, yc, yd, tolmax, relmax
146  common/ftmud2cr/xa, xb, yc, yd, tolmax, relmax
147  sll_int32 :: i, ierror
148  sll_int32 :: iprm(16)
149  sll_real64 :: fprm(6)
150  sll_real64, dimension(:, :), allocatable :: cxx_array
151  sll_real64, dimension(:, :), allocatable :: cyy_array
152  sll_real64, dimension(:, :), allocatable :: cxy_array
153  sll_real64, dimension(:, :), allocatable :: cx_array
154  sll_real64, dimension(:, :), allocatable :: cy_array
155  sll_real64, dimension(:, :), allocatable :: ce_array
156  sll_real64, dimension(:, :), allocatable :: a12_array
157  sll_real64, dimension(:, :), allocatable :: a21_array
158  sll_real64 :: delta1, delta2
159  sll_int32, parameter :: iixp = 2, jjyq = 2
160 
161  equivalence(intl, iprm)
162  equivalence(xa, fprm)
163 
164  nx = nc_eta1 + 1
165  ny = nc_eta2 + 1
166 
167  delta1 = (eta1_max - eta1_min)/real(nc_eta1, f64)
168  delta2 = (eta2_max - eta2_min)/real(nc_eta2, f64)
169 ! set minimum required work space
170  llwork = (7*(nx + 2)*(ny + 2) + 44*nx*ny)/3
171 
172  allocate (cxx_array(nx, ny))
173  allocate (cyy_array(nx, ny))
174  allocate (cxy_array(nx, ny))
175  allocate (cx_array(nx, ny))
176  allocate (cy_array(nx, ny))
177  allocate (ce_array(nx, ny))
178  allocate (a12_array(nx, ny))
179  allocate (a21_array(nx, ny))
180  allocate (phi(nx, ny))
181 
182  transformation => transf
183  call cxx_cs2d%init( &
184  nx, &
185  ny, &
186  eta1_min, &
187  eta1_max, &
188  eta2_min, &
189  eta2_max, &
190  sll_p_periodic, &
191  sll_p_periodic)
192 
193  cxx_interp => cxx_cs2d
194 
195  call cyy_cs2d%init( &
196  nx, &
197  ny, &
198  eta1_min, &
199  eta1_max, &
200  eta2_min, &
201  eta2_max, &
202  sll_p_periodic, &
203  sll_p_periodic)
204 
205  cyy_interp => cyy_cs2d
206 
207  call cxy_cs2d%init( &
208  nx, &
209  ny, &
210  eta1_min, &
211  eta1_max, &
212  eta2_min, &
213  eta2_max, &
214  sll_p_periodic, &
215  sll_p_periodic)
216 
217  cxy_interp => cxy_cs2d
218 
219  call cx_cs2d%init( &
220  nx, &
221  ny, &
222  eta1_min, &
223  eta1_max, &
224  eta2_min, &
225  eta2_max, &
226  sll_p_periodic, &
227  sll_p_periodic)
228 
229  cx_interp => cx_cs2d
230 
231  call cy_cs2d%init( &
232  nx, &
233  ny, &
234  eta1_min, &
235  eta1_max, &
236  eta2_min, &
237  eta2_max, &
238  sll_p_periodic, &
239  sll_p_periodic)
240 
241  cy_interp => cy_cs2d
242 
243  call ce_cs2d%init( &
244  nx, &
245  ny, &
246  eta1_min, &
247  eta1_max, &
248  eta2_min, &
249  eta2_max, &
250  sll_p_periodic, &
251  sll_p_periodic)
252 
253  ce_interp => ce_cs2d
254 
255  call a12_cs2d%init( &
256  nx, &
257  ny, &
258  eta1_min, &
259  eta1_max, &
260  eta2_min, &
261  eta2_max, &
262  sll_p_periodic, &
263  sll_p_periodic)
264 
265  a12_interp => a12_cs2d
266 
267  call a21_cs2d%init( &
268  nx, &
269  ny, &
270  eta1_min, &
271  eta1_max, &
272  eta2_min, &
273  eta2_max, &
274  sll_p_periodic, &
275  sll_p_periodic)
276 
277  a21_interp => a21_cs2d
278 
279 !cxx_array = 1._f64
280  call coefxxyy_array(b11, b12, b21, b22, transf, eta1_min, eta2_min, delta1, delta2, nx, ny, cxx_array, cyy_array)
281  call cxx_interp%compute_interpolants(cxx_array)
282  call cyy_interp%compute_interpolants(cyy_array)
283 
284  call coefxy_array(b11, b12, b21, b22, transf, eta1_min, eta2_min, delta1, delta2, nx, ny, cxy_array)
285  call cxy_interp%compute_interpolants(cxy_array)
286 
287  call a12_a21_array(b11, b12, b21, b22, transf, eta1_min, eta2_min, delta1, delta2, nx, ny, a12_array, a21_array)
288  call a12_interp%compute_interpolants(a12_array)
289  call a21_interp%compute_interpolants(a21_array)
290 
291  call coefx_array(eta1_min, eta2_min, delta1, delta2, nx, ny, cx_array)
292  call cx_interp%compute_interpolants(cx_array)
293 
294  call coefy_array(eta1_min, eta2_min, delta1, delta2, nx, ny, cy_array)
295  call cy_interp%compute_interpolants(cy_array)
296  ce_array = -c
297  call ce_interp%compute_interpolants(ce_array)
298 
299  allocate (self%work(llwork))
300  icall = 0
301 
302 ! set input sll_int32 arguments
303  intl = 0
304 
305 ! set boundary condition flags
306  nxa = bc_eta1_left
307  nxb = bc_eta1_right
308  nyc = bc_eta2_left
309  nyd = bc_eta2_right
310  print *, nxa, nxb, nyc, nyd
311 ! set grid sizes from parameter statements
312  ixp = iixp
313  jyq = jjyq
314  iex = ceiling(log((nx - 1.)/ixp)/log(2.)) + 1
315  jey = ceiling(log((ny - 1.)/jyq)/log(2.)) + 1
316 
317  nx = ixp*(2**(iex - 1)) + 1
318  ny = jyq*(2**(jey - 1)) + 1
319  allocate (self%iwork(ixp + 1, jyq + 1))
320  if (nx /= nc_eta1 + 1 .or. ny /= nc_eta2 + 1) then
321  print *, "nx,nc_eta1+1=", nx, nc_eta1 + 1
322  print *, "ny,nc_eta2+1=", ny, nc_eta2 + 1
323  stop ' nx or ny different in sll_m_mudpack_curvilinear '
324  end if
325 
326 ! set multigrid arguments (w(2,1) cycling with fully weighted
327 ! residual restriction and cubic prolongation)
328  self%mgopt(1) = 2
329  self%mgopt(2) = 2
330  self%mgopt(3) = 1
331  self%mgopt(4) = 3
332 
333 ! set three cycles to ensure second-order approx
334  maxcy = 3
335 
336 ! set no initial guess forcing full multigrid cycling
337  iguess = 0 !1
338 
339 ! set work space length approximation from parameter statement
340  nwork = llwork
341 
342 ! set point relaxation
343  method = 0
344 
345 ! set mesh increments
346  xa = eta1_min
347  xb = eta1_max
348  yc = eta2_min
349  yd = eta2_max
350 
351 ! set for no error control flag
352  tolmax = 0.0_8
353 
354  write (*, 100)
355  write (*, 101) (iprm(i), i=1, 15)
356  write (*, 102) (self%mgopt(i), i=1, 4)
357  write (*, 103) xa, xb, yc, yd, tolmax
358  write (*, 104) intl
359 
360 !call mud2cr(iprm,fprm,self%work,coefcr,bndcr,rhs,phi,self%mgopt,ierror)
361  call muh2cr(iprm, fprm, self%work, self%iwork, coefcr, bndcr, rhs, phi, self%mgopt, ierror)
362 !call mud2sp(iprm,fprm,self%work,cofx,cofy,bndcr,rhs,phi,self%mgopt,ierror)
363  write (*, 200) ierror, iprm(16)
364  if (ierror > 0) stop 0
365 
366 100 format(//' multigrid poisson solver in polar coordinates ')
367 101 format(/' integer input arguments ', &
368  /'intl = ', i2, ' nxa = ', i2, ' nxb = ', i2, ' nyc = ', i2, ' nyd = ', i2, &
369  /' ixp = ', i2, ' jyq = ', i2, ' iex = ', i2, ' jey = ', i2 &
370  /' nx = ', i3, ' ny = ', i3, ' iguess = ', i2, ' maxcy = ', i2, &
371  /' method = ', i2, ' work space estimate = ', i7)
372 102 format(/' multigrid option arguments ', &
373  /' kcycle = ', i2, &
374  /' iprer = ', i2, &
375  /' ipost = ', i2 &
376  /' intpol = ', i2)
377 103 format(/' floating point input parameters ', &
378  /' xa = ', f6.3, ' xb = ', f6.3, ' yc = ', f6.3, ' yd = ', f6.3, &
379  /' tolerance (error control) = ', e10.3)
380 104 format(/' discretization call to mud2cr', ' intl = ', i2)
381 200 format(' ierror = ', i2, ' minimum work space = ', i7)
382 
383  end subroutine initialize_poisson_curvilinear_mudpack
384 
386  subroutine solve_poisson_curvilinear_mudpack(self, phi, rho)
387 ! set grid size params
388  type(sll_t_mudpack_2d) :: self
389  sll_int32 :: icall
390  sll_int32, parameter :: iixp = 2, jjyq = 2
391 
392  sll_real64, intent(inout) :: phi(:, :)
393  sll_real64, intent(inout) :: rho(:, :)
394  sll_real64, pointer :: rhs(:, :)
395 
396 ! put sll_int32 and floating point argument names in contiguous
397 ! storeage for labelling in vectors iprm,fprm
398 
399  sll_int32 :: intl, nxa, nxb, nyc, nyd, ixp, jyq, iex, jey, nx, ny
400  sll_int32 :: iguess, maxcy, method, nwork, lwrkqd, itero
401  sll_real64 :: xa, xb, yc, yd, tolmax, relmax
402  sll_int32 :: ierror
403  sll_int32 :: iprm(16)
404  sll_real64 :: fprm(6), eta1, eta2
405  sll_int32 :: i1, i2
406 
407  common/itmud2cr/intl, nxa, nxb, nyc, nyd, ixp, jyq, iex, jey, nx, ny, &
408  iguess, maxcy, method, nwork, lwrkqd, itero
409  common/ftmud2cr/xa, xb, yc, yd, tolmax, relmax
410 
411  equivalence(intl, iprm)
412  equivalence(xa, fprm)
413 
414  allocate (rhs(nx, ny))
415  rhs = 0._f64
416  do i2 = 1, ny
417  eta2 = yc + real(i2 - 1, f64)*(yd - yc)/real(ny - 1, 8)
418  do i1 = 1, nx
419  eta1 = xa + real(i1 - 1, f64)*(xb - xa)/real(nx - 1, 8)
420  rhs(i1, i2) = -rho(i1, i2)*transformation%jacobian(eta1, eta2)
421  end do
422  end do
423  if (nxa == sll_p_dirichlet) then
424  do i2 = 1, ny
425  phi(1, i2) = 0._f64
426  end do
427  end if
428  if (nxb == sll_p_dirichlet) then
429  do i2 = 1, ny
430  phi(nx, i2) = 0._f64
431  end do
432  end if
433  if (nyc == sll_p_dirichlet) then
434  do i1 = 1, nx
435  phi(i1, 1) = 0._f64
436  end do
437  end if
438  if (nyd == sll_p_dirichlet) then
439  do i1 = 1, nx
440  phi(i1, ny) = 0._f64
441  end do
442  end if
443 
444  icall = 1
445  intl = 1
446 !YG write(*,106) intl,method,iguess
447 
448 ! attempt solution
449 !call mud2cr(iprm,fprm,self%work,coefcr,bndcr,rhs,phi,self%mgopt,ierror)
450  call muh2cr(iprm, fprm, self%work, self%iwork, coefcr, bndcr, rhs, phi, self%mgopt, ierror)
451 !call mud2sp(iprm,fprm,self%work,cofx,cofy,bndcr,rhs,phi,self%mgopt,ierror)
452 !SLL_ASSERT(ierror == 0)
453 !YG write(*,107) ierror
454  if (ierror > 0) stop 0
455 
456 ! attempt fourth order approximation
457 !call mud24cr(self%work,coefcr,bndcr,phi,ierror)
458  call muh24cr(self%work, self%iwork, coefcr, bndcr, phi, ierror)
459 !call mud24sp(self%work,phi,ierror)
460 !SLL_ASSERT(ierror == 0)
461 !YG write (*,108) ierror
462  if (ierror > 0) stop 0
463 
464 !YG 106 format(/' approximation call to mud2sp', &
465 !YG &/' intl = ',i2, ' method = ',i2,' iguess = ',i2)
466 !YG 107 format(' error = ',i2)
467 !YG 108 format(/' mud24cr test ', ' error = ',i2)
468 
469  deallocate (rhs)
470  return
471  end subroutine solve_poisson_curvilinear_mudpack
472 
473  subroutine coefxxyy_array(b11, b12, b21, b22, transf, eta1_min, eta2_min, &
474  delta1, delta2, nx, ny, cxx_array, cyy_array)
475  implicit none
476  sll_real64 :: eta1, eta1_min, eta2_min
477  sll_real64 :: eta2, delta1, delta2
478  sll_int32 :: i, j, nx, ny
479  sll_real64, dimension(:, :):: cxx_array, cyy_array
480  sll_real64, dimension(1:2, 1:2) :: jac_m
481  class(sll_c_coordinate_transformation_2d_base), pointer :: transf
482  sll_real64, dimension(:, :) :: b11
483  sll_real64, dimension(:, :) :: b12
484  sll_real64, dimension(:, :) :: b21
485  sll_real64, dimension(:, :) :: b22
486 
487  do j = 1, ny
488  eta2 = eta2_min + real(j - 1, f64)*delta2
489  do i = 1, nx
490  eta1 = eta1_min + real(i - 1, f64)*delta1
491  jac_m = transf%jacobian_matrix(eta1, eta2)
492  cxx_array(i, j) = (b11(i, j)*(jac_m(1, 2)*jac_m(1, 2) + jac_m(2, 2)*jac_m(2, 2)) - &
493  & b12(i, j)*(jac_m(2, 1)*jac_m(2, 2) + jac_m(1, 1)*jac_m(1, 2))) &
494  /transf%jacobian(eta1, eta2)
495  cyy_array(i, j) = (b22(i, j)*(jac_m(2, 1)*jac_m(2, 1) + jac_m(1, 1)*jac_m(1, 1)) - &
496  & b21(i, j)*(jac_m(2, 1)*jac_m(2, 2) + jac_m(1, 1)*jac_m(1, 2))) &
497  /transf%jacobian(eta1, eta2)
498  end do
499  end do
500  end subroutine coefxxyy_array
501 
502  subroutine coefxy_array(b11, b12, b21, b22, transf, eta1_min, eta2_min, &
503  delta1, delta2, nx, ny, cxy_array)
504  implicit none
505  sll_real64 :: eta1, eta1_min, eta2_min
506  sll_real64 :: eta2, delta1, delta2
507  sll_real64 :: a12, a21
508  sll_int32 :: i, j, nx, ny
509  sll_real64, dimension(:, :):: cxy_array
510  sll_real64, dimension(1:2, 1:2) :: jac_m
511  class(sll_c_coordinate_transformation_2d_base), pointer :: transf
512  sll_real64, dimension(:, :) :: b11
513  sll_real64, dimension(:, :) :: b12
514  sll_real64, dimension(:, :) :: b21
515  sll_real64, dimension(:, :) :: b22
516 
517  do j = 1, ny
518  eta2 = eta2_min + real(j - 1, f64)*delta2
519  do i = 1, nx
520  eta1 = eta1_min + real(i - 1, f64)*delta1
521  jac_m = transf%jacobian_matrix(eta1, eta2)
522  a12 = b12(i, j)*(jac_m(2, 1)*jac_m(2, 1) + jac_m(1, 1)*jac_m(1, 1)) - &
523  & b11(i, j)*(jac_m(2, 1)*jac_m(2, 2) + jac_m(1, 1)*jac_m(1, 2))
524 
525  a21 = b21(i, j)*(jac_m(1, 2)*jac_m(1, 2) + jac_m(2, 2)*jac_m(2, 2)) - &
526  & b22(i, j)*(jac_m(2, 1)*jac_m(2, 2) + jac_m(1, 1)*jac_m(1, 2))
527  cxy_array(i, j) = (a12 + a21)/transf%jacobian(eta1, eta2)
528  end do
529  end do
530  end subroutine coefxy_array
531 
532  subroutine a12_a21_array(b11, b12, b21, b22, transf, eta1_min, eta2_min, delta1, delta2, nx, ny, a12_array, a21_array)
533  sll_real64 :: eta1, eta1_min, eta2_min
534  sll_real64 :: eta2, delta1, delta2
535  sll_real64 :: a12, a21
536  sll_int32 :: i, j, nx, ny
537  sll_real64, dimension(:, :):: a12_array
538  sll_real64, dimension(:, :):: a21_array
539  class(sll_c_coordinate_transformation_2d_base), pointer :: transf
540  sll_real64, dimension(:, :) :: b11
541  sll_real64, dimension(:, :) :: b12
542  sll_real64, dimension(:, :) :: b21
543  sll_real64, dimension(:, :) :: b22
544  sll_real64, dimension(1:2, 1:2) :: jac_m
545 
546  do j = 1, ny
547  eta2 = eta2_min + real(j - 1, f64)*delta2
548  do i = 1, nx
549  eta1 = eta1_min + real(i - 1, f64)*delta1
550  jac_m = transf%jacobian_matrix(eta1, eta2)
551  a12 = b12(i, j)*(jac_m(2, 1)*jac_m(2, 1) + jac_m(1, 1)*jac_m(1, 1)) - &
552  & b11(i, j)*(jac_m(2, 1)*jac_m(2, 2) + jac_m(1, 1)*jac_m(1, 2))
553  a12_array(i, j) = a12/transf%jacobian(eta1, eta2)
554  a21 = b21(i, j)*(jac_m(1, 2)*jac_m(1, 2) + jac_m(2, 2)*jac_m(2, 2)) - &
555  & b22(i, j)*(jac_m(2, 1)*jac_m(2, 2) + jac_m(1, 1)*jac_m(1, 2))
556  a21_array(i, j) = a21/transf%jacobian(eta1, eta2)
557  end do
558  end do
559  end subroutine a12_a21_array
560 
561  subroutine coefx_array(eta1_min, eta2_min, &
562  delta1, delta2, nx, ny, cx_array)
563  sll_real64 :: eta1, eta1_min, eta2_min
564  sll_real64 :: eta2, delta1, delta2
565  sll_int32 :: i, j, nx, ny
566  sll_real64, dimension(:, :):: cx_array
567 
568  do j = 1, ny
569  eta2 = eta2_min + real(j - 1, f64)*delta2
570  do i = 1, nx
571  eta1 = eta1_min + real(i - 1, f64)*delta1
572  cx_array(i, j) = cxx_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2) + &
573  a21_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2)
574  end do
575  end do
576  end subroutine coefx_array
577 
578  subroutine coefy_array(eta1_min, eta2_min, &
579  delta1, delta2, nx, ny, cy_array)
580  sll_real64 :: eta1, eta1_min, eta2_min
581  sll_real64 :: eta2, delta1, delta2
582  sll_int32 :: i, j, nx, ny
583  sll_real64, dimension(:, :):: cy_array
584 
585  do j = 1, ny
586  eta2 = eta2_min + real(j - 1, f64)*delta2
587  do i = 1, nx
588  eta1 = eta1_min + real(i - 1, f64)*delta1
589  cy_array(i, j) = cyy_interp%interpolate_from_interpolant_derivative_eta2(eta1, eta2) + &
590  a12_interp%interpolate_from_interpolant_derivative_eta1(eta1, eta2)
591  end do
592  end do
593  end subroutine coefy_array
594 
597  subroutine coefcr(x, y, cxx, cxy, cyy, cx, cy, ce)
598  real(8) :: x, cxx, cx, cxy
599  real(8) :: y, cyy, cy, ce
600  cxx = cxx_interp%interpolate_from_interpolant_value(x, y)
601  cxy = cxy_interp%interpolate_from_interpolant_value(x, y)
602  cyy = cyy_interp%interpolate_from_interpolant_value(x, y)
603  cx = cx_interp%interpolate_from_interpolant_value(x, y)
604  cy = cy_interp%interpolate_from_interpolant_value(x, y)
605  ce = ce_interp%interpolate_from_interpolant_value(x, y)
606  end subroutine coefcr
607 
608 !!> input x dependent coefficients
609 !subroutine cofx(x,cxx,cx,cex)
610 !implicit none
611 !real(8) :: x,cxx,cx,cex
612 !cxx = 1.0_8 !cxx_interp%interpolate_from_interpolant_value(x)
613 !cx = 0.0_8 + x - x
614 !cex = 0.0_8
615 !end subroutine cofx
616 !
617 !!> input y dependent coefficients
618 !subroutine cofy(y,cyy,cy,cey)
619 !real(8) :: y,cyy,cy,cey
620 !cyy = 1.0_8
621 !cy = 0.0_8 + y - y
622 !cey = 0.0_8
623 !end subroutine cofy
624 !
627  subroutine bndcr(kbdy, xory, alfa, beta, gama, gbdy)
628  integer :: kbdy
629  real(8) :: xory, alfa, beta, gama, gbdy
630 
631  if (kbdy .eq. 2) then
632 
633  ! x=xb boundary.
634  ! b.c. has the form alfxb(y)*px+betxb(y)*py+gamxb(y)*pe = gbdxb(y)
635  ! where xory= y. alfa,beta,gama,gbdxb corresponding to alfxb(y),
636  ! betxb(y),gamxb(y),gbdxb(y) must be output.
637 
638  alfa = 0.0_8 + 0_8*xory
639  beta = 0.0_8
640  gama = 1.0_8
641  gbdy = 0.0_8
642 
643  end if
644 
645  if (kbdy .eq. 1) then
646 
647  ! x=xa boundary.
648  ! b.c. has the form alfxa(y)*px+betxa(y)*py+gamxa(y)*pe = gbdxa(y)
649  ! where xory= y. alfa,beta,gama,gbdxb corresponding to alfxa(y),
650  ! betxa(y),gamxa(y),gbdxa(y) must be output.
651 
652  alfa = 0.0_8
653  beta = 0.0_8
654  gama = 1.0_8
655  gbdy = 0.0_8
656 
657  end if
658 
659  end subroutine bndcr
660 
661 end module sll_m_mudpack_curvilinear
662 
663 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
Abstract class for coordinate transformations.
Class for the cubic spline sll_c_interpolator_2d.
abstract data type for 2d interpolation
The spline-based interpolator is only a wrapper around the capabilities of the cubic splines.
Base class/basic interface for 2D interpolators.
    Report Typos and Errors