Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_3d_coordinate_transformations.F90
Go to the documentation of this file.
1 
8  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 #include "sll_assert.h"
10 #include "sll_working_precision.h"
11 
12  use sll_m_constants, only: &
13  sll_p_pi, &
15 
16  implicit none
17 
18  public :: &
268 
269 
270 
271  private
272  !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
273  sll_real64, parameter :: a = 0.5_f64*sll_p_pi!sll_p_twopi !
274  sll_real64, parameter :: b = sll_p_twopi !sll_p_pi !
275 contains
276 
277  ! ***************************************************************************
278  !
279  ! <b> "Colella transformation with Boundary"; </b>
280  ! sinusoidal product (see P. Colella et al. JCP 230 (2011) formula
281  ! (102) p 2968):
282  !
283  ! X1 = L1 * (\xi(1) + \alpha1 * \xi(2) )
284  ! X2 = L2 * \xi(2)
285  ! X3 = L3 * \xi(3)
286  !
287  ! The parameters are:
288  ! - L1 = params(1)
289  ! - L2 = params(2)
290  ! - L3 = params(3)
291  ! - alpha1 = params(4)
292  !
293  ! ***************************************************************************
294 
295 
297  function sll_f_parallelogram_x1( xi, params )
298  sll_real64 :: sll_f_parallelogram_x1
299  sll_real64, intent(in) :: xi(3)
300  sll_real64, dimension(:), intent(in) :: params
301  !local variables
302  sll_real64 :: l1
303  sll_real64 :: alpha1
304 
305  sll_assert(size(params) >= 4)
306  l1 = params(1)
307  alpha1 = params(4)
308  sll_f_parallelogram_x1 = l1*(xi(1)+alpha1*xi(2) )
309  end function sll_f_parallelogram_x1
310 
312  function sll_f_parallelogram_x2( xi, params )
313  sll_real64 :: sll_f_parallelogram_x2
314  sll_real64, intent(in) :: xi(3)
315  sll_real64, dimension(:), intent(in) :: params
316  !local variables
317  sll_real64 :: l2
318  sll_real64 :: alpha2
319 
320  sll_assert(size(params) >= 4)
321  l2 = params(2)
322  alpha2 = params(4)
323  sll_f_parallelogram_x2 = l2*(xi(2))
324  end function sll_f_parallelogram_x2
325 
327  function sll_f_parallelogram_x3( xi, params )
328  sll_real64 :: sll_f_parallelogram_x3
329  sll_real64, intent(in) :: xi(3)
330  sll_real64, dimension(:), intent(in) :: params
331  !local variables
332  sll_real64 :: l3
333 
334  sll_assert(size(params) >= 4)
335  l3 = params(3)
336  sll_f_parallelogram_x3 = l3*xi(3)
337  end function sll_f_parallelogram_x3
338 
340  function sll_f_parallelogram_jac11 ( xi, params )
341  sll_real64 :: sll_f_parallelogram_jac11
342  sll_real64, intent(in) :: xi(3)
343  sll_real64, dimension(:), intent(in) :: params
344  !local variables
345  sll_real64 :: l1
346  sll_real64 :: alpha1
347 
348  sll_assert(size(params) >= 4)
349  l1 = params(1)
350  alpha1 = params(4)
352  end function sll_f_parallelogram_jac11
353 
355  function sll_f_parallelogram_jac12 ( xi, params )
356  sll_real64 :: sll_f_parallelogram_jac12
357  sll_real64, intent(in) :: xi(3)
358  sll_real64, dimension(:), intent(in) :: params
359  !local variables
360  sll_real64 :: alpha1, l1
361 
362  sll_assert(size(params) >= 4)
363  l1 = params(1)
364  alpha1 = params(4)
365  sll_f_parallelogram_jac12 = l1*alpha1
366  end function sll_f_parallelogram_jac12
367 
369  function sll_f_parallelogram_jac13 ( xi, params )
370  sll_real64 :: sll_f_parallelogram_jac13
371  sll_real64, intent(in) :: xi(3)
372  sll_real64, dimension(:), intent(in) :: params
373 
375  end function sll_f_parallelogram_jac13
376 
378  function sll_f_parallelogram_jac21 ( xi, params )
379  sll_real64 :: sll_f_parallelogram_jac21
380  sll_real64, intent(in) :: xi(3)
381  sll_real64, dimension(:), intent(in) :: params
382  !local variables
383  sll_real64 :: alpha2, l2
384 
385  sll_assert(size(params) >= 4)
386  l2 = params(2)
387  alpha2 = params(4)
389  end function sll_f_parallelogram_jac21
390 
392  function sll_f_parallelogram_jac22 ( xi, params )
393  sll_real64 :: sll_f_parallelogram_jac22
394  sll_real64, intent(in) :: xi(3)
395  sll_real64, dimension(:), intent(in) :: params
396  !local variables
397  sll_real64 :: l2
398  sll_real64 :: alpha2
399 
400  sll_assert(size(params) >= 4)
401  l2 = params(2)
402  alpha2 = params(4)
404  end function sll_f_parallelogram_jac22
405 
407  function sll_f_parallelogram_jac23 ( xi, params )
408  sll_real64 :: sll_f_parallelogram_jac23
409  sll_real64, intent(in) :: xi(3)
410  sll_real64, dimension(:), intent(in) :: params
411 
413  end function sll_f_parallelogram_jac23
414 
416  function sll_f_parallelogram_jac31 ( xi, params )
417  sll_real64 :: sll_f_parallelogram_jac31
418  sll_real64, intent(in) :: xi(3)
419  sll_real64, dimension(:), intent(in) :: params
421  end function sll_f_parallelogram_jac31
422 
424  function sll_f_parallelogram_jac32 ( xi, params )
425  sll_real64 :: sll_f_parallelogram_jac32
426  sll_real64, intent(in) :: xi(3)
427  sll_real64, dimension(:), intent(in) :: params
428 
430  end function sll_f_parallelogram_jac32
431 
433  function sll_f_parallelogram_jac33 ( xi, params )
434  sll_real64 :: sll_f_parallelogram_jac33
435  sll_real64, intent(in) :: xi(3)
436  sll_real64, dimension(:), intent(in) :: params
437  !local variables
438  sll_real64 :: l3
439 
440  sll_assert(size(params) >= 4)
441  l3 = params(3)
443  end function sll_f_parallelogram_jac33
444 
446  function sll_f_parallelogram_jacobian ( xi, params )
447  sll_real64 :: sll_f_parallelogram_jacobian
448  sll_real64, intent(in) :: xi(3)
449  sll_real64, dimension(:), intent(in) :: params
450  !local variables
451  sll_real64 :: l1, l2, l3
452  sll_real64 :: alpha1
453 
454  sll_assert(size(params) >= 4)
455  l1 = params(1)
456  l2 = params(2)
457  l3 = params(3)
458  alpha1 = params(4)
460  end function sll_f_parallelogram_jacobian
461 
462 
463  ! ***************************************************************************
464  !
465  ! <b> "Colella transformation with Boundary"; </b>
466  ! sinusoidal product (see P. Colella et al. JCP 230 (2011) formula
467  ! (102) p 2968):
468  !
469  ! X1 = L1 * (\xi(1) + \alpha1 * sin(a * \xi(1)) * sin(b * \xi(2)) )
470  ! X2 = L2 * (\xi(2) + \alpha2 * sin(a * \xi(1)) * sin(b * \xi(2)) )
471  ! X3 = L3 * (\xi(3) + \alpha3 * sin(2*\pi * \xi(3)) )
472  !
473  ! The parameters are:
474  ! - L1 = params(1)
475  ! - L2 = params(2)
476  ! - L3 = params(3)
477  ! - alpha1 = params(4)
478  ! - alpha2 = params(5)
479  ! - alpha3 = params(6)
480  ! - a = \pi/2
481  ! - b = 2*\pi
482  !
483  ! ***************************************************************************
484 
485 
487  function sll_f_colbound_x1( xi, params )
488  sll_real64 :: sll_f_colbound_x1
489  sll_real64, intent(in) :: xi(3)
490  sll_real64, dimension(:), intent(in) :: params
491  !local variables
492  sll_real64 :: l1
493  sll_real64 :: alpha1
494 
495  sll_assert(size(params) >= 6)
496  l1 = params(1)
497  alpha1 = params(4)
498  sll_f_colbound_x1 = l1*(xi(1)+alpha1*sin(a*xi(1))*sin(b*xi(2)))
499  end function sll_f_colbound_x1
500 
502  function sll_f_colbound_x2( xi, params )
503  sll_real64 :: sll_f_colbound_x2
504  sll_real64, intent(in) :: xi(3)
505  sll_real64, dimension(:), intent(in) :: params
506  !local variables
507  sll_real64 :: l2
508  sll_real64 :: alpha2
509 
510  sll_assert(size(params) >= 6)
511  l2 = params(2)
512  alpha2 = params(5)
513  sll_f_colbound_x2 = l2*(xi(2)+alpha2*sin(a*xi(1))*sin(b*xi(2)))
514  end function sll_f_colbound_x2
515 
517  function sll_f_colbound_x3( xi, params )
518  sll_real64 :: sll_f_colbound_x3
519  sll_real64, intent(in) :: xi(3)
520  sll_real64, dimension(:), intent(in) :: params
521  !local variables
522  sll_real64 :: l3
523  sll_real64 :: alpha3
524 
525  sll_assert(size(params) >= 6)
526  l3 = params(3)
527  alpha3 = params(6)
528  sll_f_colbound_x3 = l3*(xi(3)+alpha3*sin(sll_p_twopi*xi(3)))
529  end function sll_f_colbound_x3
530 
532  function sll_f_colbound_jac11 ( xi, params )
533  sll_real64 :: sll_f_colbound_jac11
534  sll_real64, intent(in) :: xi(3)
535  sll_real64, dimension(:), intent(in) :: params
536  !local variables
537  sll_real64 :: l1
538  sll_real64 :: alpha1
539 
540  sll_assert(size(params) >= 6)
541  l1 = params(1)
542  alpha1 = params(4)
543  sll_f_colbound_jac11 = l1*(1._f64+alpha1*a*cos(a*xi(1))*sin(b*xi(2)))
544  end function sll_f_colbound_jac11
545 
547  function sll_f_colbound_jac12 ( xi, params )
548  sll_real64 :: sll_f_colbound_jac12
549  sll_real64, intent(in) :: xi(3)
550  sll_real64, dimension(:), intent(in) :: params
551  !local variables
552  sll_real64 :: alpha1, l1
553 
554  sll_assert(size(params) >= 6)
555  l1 = params(1)
556  alpha1 = params(4)
557  sll_f_colbound_jac12 = l1*alpha1*sin(a*xi(1))*cos(b*xi(2))*b
558  end function sll_f_colbound_jac12
559 
561  function sll_f_colbound_jac13 ( xi, params )
562  sll_real64 :: sll_f_colbound_jac13
563  sll_real64, intent(in) :: xi(3)
564  sll_real64, dimension(:), intent(in) :: params
565 
566  sll_f_colbound_jac13 =0._f64
567  end function sll_f_colbound_jac13
568 
570  function sll_f_colbound_jac21 ( xi, params )
571  sll_real64 :: sll_f_colbound_jac21
572  sll_real64, intent(in) :: xi(3)
573  sll_real64, dimension(:), intent(in) :: params
574  !local variables
575  sll_real64 :: alpha2, l2
576 
577  sll_assert(size(params) >= 6)
578  l2 = params(2)
579  alpha2 = params(5)
580  sll_f_colbound_jac21 = l2*alpha2*a*cos(a*xi(1))*sin(b*xi(2))
581  end function sll_f_colbound_jac21
582 
584  function sll_f_colbound_jac22 ( xi, params )
585  sll_real64 :: sll_f_colbound_jac22
586  sll_real64, intent(in) :: xi(3)
587  sll_real64, dimension(:), intent(in) :: params
588  !local variables
589  sll_real64 :: l2
590  sll_real64 :: alpha2
591 
592  sll_assert(size(params) >= 6)
593  l2 = params(2)
594  alpha2 = params(5)
595  sll_f_colbound_jac22 =l2*(1._f64+alpha2*sin(a*xi(1))*cos(b*xi(2))*b)
596  end function sll_f_colbound_jac22
597 
599  function sll_f_colbound_jac23 ( xi, params )
600  sll_real64 :: sll_f_colbound_jac23
601  sll_real64, intent(in) :: xi(3)
602  sll_real64, dimension(:), intent(in) :: params
603 
604  sll_f_colbound_jac23 = 0._f64
605  end function sll_f_colbound_jac23
606 
608  function sll_f_colbound_jac31 ( xi, params )
609  sll_real64 :: sll_f_colbound_jac31
610  sll_real64, intent(in) :: xi(3)
611  sll_real64, dimension(:), intent(in) :: params
612  sll_f_colbound_jac31 = 0._f64
613  end function sll_f_colbound_jac31
614 
616  function sll_f_colbound_jac32 ( xi, params )
617  sll_real64 :: sll_f_colbound_jac32
618  sll_real64, intent(in) :: xi(3)
619  sll_real64, dimension(:), intent(in) :: params
620 
621  sll_f_colbound_jac32 = 0._f64
622  end function sll_f_colbound_jac32
623 
625  function sll_f_colbound_jac33 ( xi, params )
626  sll_real64 :: sll_f_colbound_jac33
627  sll_real64, intent(in) :: xi(3)
628  sll_real64, dimension(:), intent(in) :: params
629  !local variables
630  sll_real64 :: l3
631  sll_real64 :: alpha3
632 
633  sll_assert(size(params) >= 6)
634  l3 = params(3)
635  alpha3 = params(6)
636  sll_f_colbound_jac33 = l3*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi)
637  end function sll_f_colbound_jac33
638 
640  function sll_f_colbound_jacobian ( xi, params )
641  sll_real64 :: sll_f_colbound_jacobian
642  sll_real64, intent(in) :: xi(3)
643  sll_real64, dimension(:), intent(in) :: params
644  !local variables
645  sll_real64 :: l1, l2, l3
646  sll_real64 :: alpha1, alpha2, alpha3
647 
648  sll_assert(size(params) >= 6)
649  l1 = params(1)
650  l2 = params(2)
651  l3 = params(3)
652  alpha1 = params(4)
653  alpha2 = params(5)
654  alpha3 = params(6)
655  sll_f_colbound_jacobian = l3*l1*l2*(1._f64+b*alpha2*sin(a*xi(1))*cos(b*xi(2))+a*alpha1*cos(a*xi(1))*sin(b*xi(2)))*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi)
656  end function sll_f_colbound_jacobian
657 
658 
659 
660  ! ***************************************************************************
661  !
662  ! <b> "Colella transformation"; </b>
663  ! sinusoidal product (see P. Colella et al. JCP 230 (2011) formula
664  ! (102) p 2968):
665  !
666  ! X1 = L1 * (\xi(1) + \alpha1 * sin(2*\pi * \xi(1)) * sin(2*\pi * \xi(2)) )
667  ! X2 = L2 * (\xi(2) + \alpha2 * sin(2*\pi * \xi(1)) * sin(2*\pi * \xi(2)) )
668  ! X3 = L3 * (\xi(3) + \alpha3 * sin(2*\pi * \xi(3)) )
669  !
670  ! The parameters are:
671  ! - L1 = params(1)
672  ! - L2 = params(2)
673  ! - L3 = params(3)
674  ! - alpha1 = params(4)
675  ! - alpha2 = params(5)
676  ! - alpha3 = params(6)
677  !
678  ! ***************************************************************************
679 
680 
682  function sll_f_colella_x1( xi, params )
683  sll_real64 :: sll_f_colella_x1
684  sll_real64, intent(in) :: xi(3)
685  sll_real64, dimension(:), intent(in) :: params
686  !local variables
687  sll_real64 :: l1
688  sll_real64 :: alpha1
689 
690  sll_assert(size(params) >= 6)
691  l1 = params(1)
692  alpha1 = params(4)
693  sll_f_colella_x1 = l1*(xi(1)+alpha1*sin(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2)))
694  end function sll_f_colella_x1
695 
697  function sll_f_colella_x2( xi, params )
698  sll_real64 :: sll_f_colella_x2
699  sll_real64, intent(in) :: xi(3)
700  sll_real64, dimension(:), intent(in) :: params
701  !local variables
702  sll_real64 :: l2
703  sll_real64 :: alpha2
704 
705  sll_assert(size(params) >= 6)
706  l2 = params(2)
707  alpha2 = params(5)
708  sll_f_colella_x2 = l2*(xi(2)+alpha2*sin(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2)))
709  end function sll_f_colella_x2
710 
712  function sll_f_colella_x3( xi, params )
713  sll_real64 :: sll_f_colella_x3
714  sll_real64, intent(in) :: xi(3)
715  sll_real64, dimension(:), intent(in) :: params
716  !local variables
717  sll_real64 :: l3
718  sll_real64 :: alpha3
719 
720  sll_assert(size(params) >= 6)
721  l3 = params(3)
722  alpha3 = params(6)
723  sll_f_colella_x3 = l3*(xi(3)+alpha3*sin(sll_p_twopi*xi(3)))
724  end function sll_f_colella_x3
725 
727  function sll_f_colella_jac11 ( xi, params )
728  sll_real64 :: sll_f_colella_jac11
729  sll_real64, intent(in) :: xi(3)
730  sll_real64, dimension(:), intent(in) :: params
731  !local variables
732  sll_real64 :: l1
733  sll_real64 :: alpha1
734 
735  sll_assert(size(params) >= 6)
736  l1 = params(1)
737  alpha1 = params(4)
738  sll_f_colella_jac11 = l1*(1._f64+alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))*sll_p_twopi)
739  end function sll_f_colella_jac11
740 
742  function sll_f_colella_jac12 ( xi, params )
743  sll_real64 :: sll_f_colella_jac12
744  sll_real64, intent(in) :: xi(3)
745  sll_real64, dimension(:), intent(in) :: params
746  !local variables
747  sll_real64 :: alpha1, l1
748 
749  sll_assert(size(params) >= 6)
750  l1 = params(1)
751  alpha1 = params(4)
752  sll_f_colella_jac12 = l1*alpha1*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))*sll_p_twopi
753  end function sll_f_colella_jac12
754 
756  function sll_f_colella_jac13 ( xi, params )
757  sll_real64 :: sll_f_colella_jac13
758  sll_real64, intent(in) :: xi(3)
759  sll_real64, dimension(:), intent(in) :: params
760 
761  sll_f_colella_jac13 =0._f64
762  end function sll_f_colella_jac13
763 
765  function sll_f_colella_jac21 ( xi, params )
766  sll_real64 :: sll_f_colella_jac21
767  sll_real64, intent(in) :: xi(3)
768  sll_real64, dimension(:), intent(in) :: params
769  !local variables
770  sll_real64 :: alpha2, l2
771 
772  sll_assert(size(params) >= 6)
773  l2 = params(2)
774  alpha2 = params(5)
775  sll_f_colella_jac21 = l2*alpha2*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))*sll_p_twopi
776  end function sll_f_colella_jac21
777 
779  function sll_f_colella_jac22 ( xi, params )
780  sll_real64 :: sll_f_colella_jac22
781  sll_real64, intent(in) :: xi(3)
782  sll_real64, dimension(:), intent(in) :: params
783  !local variables
784  sll_real64 :: l2
785  sll_real64 :: alpha2
786 
787  sll_assert(size(params) >= 6)
788  l2 = params(2)
789  alpha2 = params(5)
790  sll_f_colella_jac22 =l2*(1._f64+alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))*sll_p_twopi)
791  end function sll_f_colella_jac22
792 
794  function sll_f_colella_jac23 ( xi, params )
795  sll_real64 :: sll_f_colella_jac23
796  sll_real64, intent(in) :: xi(3)
797  sll_real64, dimension(:), intent(in) :: params
798 
799  sll_f_colella_jac23 = 0._f64
800  end function sll_f_colella_jac23
801 
803  function sll_f_colella_jac31 ( xi, params )
804  sll_real64 :: sll_f_colella_jac31
805  sll_real64, intent(in) :: xi(3)
806  sll_real64, dimension(:), intent(in) :: params
807  sll_f_colella_jac31 = 0._f64
808  end function sll_f_colella_jac31
809 
811  function sll_f_colella_jac32 ( xi, params )
812  sll_real64 :: sll_f_colella_jac32
813  sll_real64, intent(in) :: xi(3)
814  sll_real64, dimension(:), intent(in) :: params
815 
816  sll_f_colella_jac32 = 0._f64
817  end function sll_f_colella_jac32
818 
820  function sll_f_colella_jac33 ( xi, params )
821  sll_real64 :: sll_f_colella_jac33
822  sll_real64, intent(in) :: xi(3)
823  sll_real64, dimension(:), intent(in) :: params
824  !local variables
825  sll_real64 :: l3
826  sll_real64 :: alpha3
827 
828  sll_assert(size(params) >= 6)
829  l3 = params(3)
830  alpha3 = params(6)
831  sll_f_colella_jac33 = l3*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi)
832  end function sll_f_colella_jac33
833 
835  function sll_f_colella_jacobian ( xi, params )
836  sll_real64 :: sll_f_colella_jacobian
837  sll_real64, intent(in) :: xi(3)
838  sll_real64, dimension(:), intent(in) :: params
839  !local variables
840  sll_real64 :: l1, l2, l3
841  sll_real64 :: alpha1, alpha2, alpha3
842 
843  sll_assert(size(params) >= 6)
844  l1 = params(1)
845  l2 = params(2)
846  l3 = params(3)
847  alpha1 = params(4)
848  alpha2 = params(5)
849  alpha3 = params(6)
850  sll_f_colella_jacobian = l3*l1*l2*(1._f64+sll_p_twopi*alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))+sll_p_twopi*alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2)))*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi)
851  end function sll_f_colella_jacobian
852 
854  function sll_f_colella_jacinv11 ( xi, params )
855  sll_real64 :: sll_f_colella_jacinv11
856  sll_real64, intent(in) :: xi(3)
857  sll_real64, dimension(:), intent(in) :: params
858  sll_real64 :: l1, l2
859  sll_real64 :: alpha1, alpha2
860 
861  sll_assert(size(params) >= 6)
862  l1 = params(1)
863  l2 = params(2)
864  alpha1 = params(4)
865  alpha2 = params(5)
866  sll_f_colella_jacinv11 = (1._f64/sll_p_twopi+alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2)))/(l1*(1._f64/sll_p_twopi+alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))+alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))))
867  end function sll_f_colella_jacinv11
868 
870  function sll_f_colella_jacinv12 ( xi, params )
871  sll_real64 :: sll_f_colella_jacinv12
872  sll_real64, intent(in) :: xi(3)
873  sll_real64, dimension(:), intent(in) :: params
874  !local variables
875  sll_real64 :: l1, l2
876  sll_real64 :: alpha1, alpha2
877 
878  sll_assert(size(params) >= 6)
879  l1 = params(1)
880  l2 = params(2)
881  alpha1 = params(4)
882  alpha2 = params(5)
883  sll_f_colella_jacinv12 = - alpha1*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))/(l2*(1._f64/sll_p_twopi+alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))+alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))))
884  end function sll_f_colella_jacinv12
885 
887  function sll_f_colella_jacinv13 ( xi, params )
888  sll_real64 :: sll_f_colella_jacinv13
889  sll_real64, intent(in) :: xi(3)
890  sll_real64, dimension(:), intent(in) :: params
891 
892  sll_f_colella_jacinv13 = 0._f64
893  end function sll_f_colella_jacinv13
894 
896  function sll_f_colella_jacinv21 ( xi, params )
897  sll_real64 :: sll_f_colella_jacinv21
898  sll_real64, intent(in) :: xi(3)
899  sll_real64, dimension(:), intent(in) :: params
900  !local variables
901  sll_real64 :: l1, l2
902  sll_real64 :: alpha1, alpha2
903 
904  sll_assert(size(params) >= 6)
905  l1 = params(1)
906  l2 = params(2)
907  alpha1 = params(4)
908  alpha2 = params(5)
909  sll_f_colella_jacinv21 = -alpha2*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))/(l1*(1._f64/sll_p_twopi+alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))+alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))))
910  end function sll_f_colella_jacinv21
911 
913  function sll_f_colella_jacinv22 ( xi, params )
914  sll_real64 :: sll_f_colella_jacinv22
915  sll_real64, intent(in) :: xi(3)
916  sll_real64, dimension(:), intent(in) :: params
917  !local variables
918  sll_real64 :: l1, l2
919  sll_real64 :: alpha1, alpha2
920 
921  sll_assert(size(params) >= 6)
922  l1 = params(1)
923  l2 = params(2)
924  alpha1 = params(4)
925  alpha2 = params(5)
926  sll_f_colella_jacinv22 = (1._f64/sll_p_twopi+alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2)))/(l2*(1._f64/sll_p_twopi+alpha2*sin(sll_p_twopi*xi(1))*cos(sll_p_twopi*xi(2))+alpha1*cos(sll_p_twopi*xi(1))*sin(sll_p_twopi*xi(2))))
927  end function sll_f_colella_jacinv22
928 
930  function sll_f_colella_jacinv23 ( xi, params )
931  sll_real64 :: sll_f_colella_jacinv23
932  sll_real64, intent(in) :: xi(3)
933  sll_real64, dimension(:), intent(in) :: params
934 
935  sll_f_colella_jacinv23 = 0._f64
936  end function sll_f_colella_jacinv23
937 
939  function sll_f_colella_jacinv31 ( xi, params )
940  sll_real64 :: sll_f_colella_jacinv31
941  sll_real64, intent(in) :: xi(3)
942  sll_real64, dimension(:), intent(in) :: params
943 
944  sll_f_colella_jacinv31 =0._f64
945  end function sll_f_colella_jacinv31
946 
948  function sll_f_colella_jacinv32 ( xi, params )
949  sll_real64 :: sll_f_colella_jacinv32
950  sll_real64, intent(in) :: xi(3)
951  sll_real64, dimension(:), intent(in) :: params
952 
953  sll_f_colella_jacinv32 = 0._f64
954  end function sll_f_colella_jacinv32
955 
957  function sll_f_colella_jacinv33 ( xi, params )
958  sll_real64 :: sll_f_colella_jacinv33
959  sll_real64, intent(in) :: xi(3)
960  sll_real64, dimension(:), intent(in) :: params
961  !local variables
962  sll_real64 :: l3
963  sll_assert(size(params) >= 6)
964 
965  l3 = params(3)
966  sll_f_colella_jacinv33 = 1._f64/l3
967  end function sll_f_colella_jacinv33
968 
969 
970  ! ***************************************************************************
971  !
972  ! <b> "Orthogonal transformation"; </b>
973  !
974  ! X1 = L1 * (\xi(1) + \alpha1 * sin(2*\pi * \xi(1)) )
975  ! X2 = L2 * (\xi(2) + \alpha2 * sin(2*\pi * \xi(2)) )
976  ! X3 = L3 * (\xi(3) + \alpha3 * sin(2*\pi * \xi(3)) )
977  !
978  ! The parameters are:
979  ! - L1 = params(1)
980  ! - L2 = params(2)
981  ! - L3 = params(3)
982  ! - alpha1 = params(4)
983  ! - alpha2 = params(5)
984  ! - alpha3 = params(6)
985  !
986  ! ***************************************************************************
987 
988 
990  function sll_f_orthogonal_x1( xi, params )result(res)
991  sll_real64, intent(in) :: xi(3)
992  sll_real64, dimension(:), intent(in) :: params
993  sll_real64 :: res !Output
994  !local variables
995  sll_real64 :: l1
996  sll_real64 :: alpha1
997 
998  sll_assert(size(params) >= 6)
999  l1 = params(1)
1000  alpha1 = params(4)
1001  res = l1*(xi(1)+alpha1*sin(sll_p_twopi*xi(1)))
1002  end function sll_f_orthogonal_x1
1003 
1005  function sll_f_orthogonal_x2( xi, params )result(res)
1006  sll_real64, intent(in) :: xi(3)
1007  sll_real64, dimension(:), intent(in) :: params
1008  sll_real64 :: res !Output
1009  !local variables
1010  sll_real64 :: l2
1011  sll_real64 :: alpha2
1012 
1013  sll_assert(size(params) >= 6)
1014  l2 = params(2)
1015  alpha2 = params(5)
1016  res = l2*(xi(2)+alpha2*sin(sll_p_twopi*xi(2)))
1017  end function sll_f_orthogonal_x2
1018 
1020  function sll_f_orthogonal_x3( xi, params )result(res)
1021  sll_real64, intent(in) :: xi(3)
1022  sll_real64, dimension(:), intent(in) :: params
1023  sll_real64 :: res !Output
1024  !local variables
1025  sll_real64 :: l3
1026  sll_real64 :: alpha3
1027 
1028  sll_assert(size(params) >= 6)
1029  l3 = params(3)
1030  alpha3 = params(6)
1031  res= l3*(xi(3)+alpha3*sin(sll_p_twopi*xi(3)))
1032  end function sll_f_orthogonal_x3
1033 
1035  function sll_f_orthogonal_jac11 ( xi, params )result(res)
1036  sll_real64, intent(in) :: xi(3)
1037  sll_real64, dimension(:), intent(in) :: params
1038  sll_real64 :: res !Output
1039  !local variables
1040  sll_real64 :: l1
1041  sll_real64 :: alpha1
1042 
1043  sll_assert(size(params) >= 6)
1044  l1 = params(1)
1045  alpha1 = params(4)
1046  res = l1*(1._f64+alpha1*cos(sll_p_twopi*xi(1))*sll_p_twopi)
1047  end function sll_f_orthogonal_jac11
1048 
1050  function sll_f_orthogonal_jac12 ( xi, params )result(res)
1051  sll_real64, intent(in) :: xi(3)
1052  sll_real64, dimension(:), intent(in) :: params
1053  sll_real64 :: res !Output
1054 
1055  res = 0.0_f64
1056  end function sll_f_orthogonal_jac12
1057 
1059  function sll_f_orthogonal_jac13 ( xi, params )result(res)
1060  sll_real64, intent(in) :: xi(3)
1061  sll_real64, dimension(:), intent(in) :: params
1062  sll_real64 :: res !Output
1063 
1064  res =0._f64
1065  end function sll_f_orthogonal_jac13
1066 
1068  function sll_f_orthogonal_jac21 ( xi, params )result(res)
1069  sll_real64, intent(in) :: xi(3)
1070  sll_real64, dimension(:), intent(in) :: params
1071  sll_real64 :: res !Output
1072 
1073  res = 0._f64
1074  end function sll_f_orthogonal_jac21
1075 
1077  function sll_f_orthogonal_jac22 ( xi, params )result(res)
1078  sll_real64, intent(in) :: xi(3)
1079  sll_real64, dimension(:), intent(in) :: params
1080  sll_real64 :: res !Output
1081  !local variables
1082  sll_real64 :: l2
1083  sll_real64 :: alpha2
1084 
1085  sll_assert(size(params) >= 6)
1086  l2 = params(2)
1087  alpha2 = params(5)
1088  res = l2*(1._f64+alpha2*cos(sll_p_twopi*xi(2))*sll_p_twopi)
1089  end function sll_f_orthogonal_jac22
1090 
1092  function sll_f_orthogonal_jac23 ( xi, params )result(res)
1093  sll_real64, intent(in) :: xi(3)
1094  sll_real64, dimension(:), intent(in) :: params
1095  sll_real64 :: res !Output
1096 
1097  res = 0._f64
1098  end function sll_f_orthogonal_jac23
1099 
1101  function sll_f_orthogonal_jac31 ( xi, params )result(res)
1102  sll_real64, intent(in) :: xi(3)
1103  sll_real64, dimension(:), intent(in) :: params
1104  sll_real64 :: res !Output
1105 
1106  res = 0._f64
1107  end function sll_f_orthogonal_jac31
1108 
1110  function sll_f_orthogonal_jac32 ( xi, params )result( res )
1111  sll_real64, intent(in) :: xi(3)
1112  sll_real64, dimension(:), intent(in) :: params
1113  sll_real64 :: res !Output
1114 
1115  res = 0._f64
1116  end function sll_f_orthogonal_jac32
1117 
1119  function sll_f_orthogonal_jac33 ( xi, params )result(res)
1120  sll_real64, intent(in) :: xi(3)
1121  sll_real64, dimension(:), intent(in) :: params
1122  sll_real64 :: res !Output
1123  !local variables
1124  sll_real64 :: l3
1125  sll_real64 :: alpha3
1126 
1127  sll_assert(size(params) >= 6)
1128  l3 = params(3)
1129  alpha3 = params(6)
1130  res = l3*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi)
1131  end function sll_f_orthogonal_jac33
1132 
1134  function sll_f_orthogonal_jacobian ( xi, params )result(res)
1135  sll_real64, intent(in) :: xi(3)
1136  sll_real64, dimension(:), intent(in) :: params
1137  sll_real64 :: res !Output
1138  !local variables
1139  sll_real64 :: l1, l2, l3
1140  sll_real64 :: alpha1, alpha2, alpha3
1141 
1142  sll_assert(size(params) >= 6)
1143  l1 = params(1)
1144  l2 = params(2)
1145  l3 = params(3)
1146  alpha1 = params(4)
1147  alpha2 = params(5)
1148  alpha3 = params(6)
1149  res = l3*l2*l1*(1._f64+alpha1*cos(sll_p_twopi*xi(1))*sll_p_twopi)*(1._f64+alpha2*cos(sll_p_twopi*xi(2))*sll_p_twopi)*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi)
1150  end function sll_f_orthogonal_jacobian
1151 
1153  function sll_f_orthogonal_jacinv11 ( xi, params )result(res)
1154  sll_real64, intent(in) :: xi(3)
1155  sll_real64, dimension(:), intent(in) :: params
1156  sll_real64 :: res !Output
1157  !local variables
1158  sll_real64 :: l1
1159  sll_real64 :: alpha1
1160 
1161  sll_assert(size(params) >= 6)
1162  l1 = params(1)
1163  alpha1 = params(4)
1164 
1165  res = 1._f64/(l1*(1._f64+alpha1*cos(sll_p_twopi*xi(1))*sll_p_twopi))
1166  end function sll_f_orthogonal_jacinv11
1167 
1169  function sll_f_orthogonal_jacinv12 ( xi, params )result(res)
1170  sll_real64, intent(in) :: xi(3)
1171  sll_real64, dimension(:), intent(in) :: params
1172  sll_real64 :: res !Output
1173 
1174  res = 0.0_f64
1175  end function sll_f_orthogonal_jacinv12
1176 
1178  function sll_f_orthogonal_jacinv13 ( xi, params )result(res)
1179  sll_real64, intent(in) :: xi(3)
1180  sll_real64, dimension(:), intent(in) :: params
1181  sll_real64 :: res !Output
1182 
1183  res =0._f64
1184  end function sll_f_orthogonal_jacinv13
1185 
1187  function sll_f_orthogonal_jacinv21 ( xi, params )result(res)
1188  sll_real64, intent(in) :: xi(3)
1189  sll_real64, dimension(:), intent(in) :: params
1190  sll_real64 :: res !Output
1191 
1192  res = 0._f64
1193  end function sll_f_orthogonal_jacinv21
1194 
1196  function sll_f_orthogonal_jacinv22 ( xi, params )result(res)
1197  sll_real64, intent(in) :: xi(3)
1198  sll_real64, dimension(:), intent(in) :: params
1199  sll_real64 :: res !Output
1200  !local variables
1201  sll_real64 :: l2
1202  sll_real64 :: alpha2
1203 
1204  sll_assert(size(params) >= 6)
1205  l2 = params(2)
1206  alpha2 = params(5)
1207  res = 1._f64/(l2*(1._f64+alpha2*cos(sll_p_twopi*xi(2))*sll_p_twopi))
1208  end function sll_f_orthogonal_jacinv22
1209 
1211  function sll_f_orthogonal_jacinv23 ( xi, params )result(res)
1212  sll_real64, intent(in) :: xi(3)
1213  sll_real64, dimension(:), intent(in) :: params
1214  sll_real64 :: res !Output
1215 
1216  res = 0._f64
1217  end function sll_f_orthogonal_jacinv23
1218 
1220  function sll_f_orthogonal_jacinv31 ( xi, params )result(res)
1221  sll_real64, intent(in) :: xi(3)
1222  sll_real64, dimension(:), intent(in) :: params
1223  sll_real64 :: res !Output
1224 
1225  res = 0._f64
1226  end function sll_f_orthogonal_jacinv31
1227 
1229  function sll_f_orthogonal_jacinv32 ( xi, params )result(res)
1230  sll_real64, intent(in) :: xi(3)
1231  sll_real64, dimension(:), intent(in) :: params
1232  sll_real64 :: res !Output
1233 
1234  res = 0._f64
1235  end function sll_f_orthogonal_jacinv32
1236 
1238  function sll_f_orthogonal_jacinv33 ( xi, params ) result(res)
1239  sll_real64, intent(in) :: xi(3)
1240  sll_real64, dimension(:), intent(in) :: params
1241  sll_real64 :: res !Output
1242  !local variables
1243  sll_real64 :: l3
1244  sll_real64 :: alpha3
1245  sll_assert(size(params) >= 6)
1246 
1247  l3 = params(3)
1248  alpha3 = params(6)
1249  res = 1._f64/(l3*(1._f64+alpha3*cos(sll_p_twopi*xi(3))*sll_p_twopi))
1250  end function sll_f_orthogonal_jacinv33
1251 
1252 
1253  ! ***************************************************************************
1254  !
1255  ! <b> "Polynomial transformation"; </b>
1256  !
1257  ! X1 = L1 * (\xi(1) + \alpha11*\xi(1)**2) ) + \alpha12 *\xi(1)**3)
1258  ! X2 = L2 * (\xi(2) + \alpha21*\xi(2)**2) ) + \alpha22 *\xi(2)**3)
1259  ! X3 = L3 * (\xi(3) + \alpha31*\xi(3)**2) ) + \alpha32 *\xi(3)**3)
1260  !
1261  ! The parameters are:
1262  ! - L1 = params(1)
1263  ! - L2 = params(2)
1264  ! - L3 = params(3)
1265  ! - alpha11 = params(4)
1266  ! - alpha21 = params(5)
1267  ! - alpha31 = params(6)
1268  ! - alpha12 = params(7)
1269  ! - alpha22 = params(8)
1270  ! - alpha32 = params(9)
1271  !
1272  ! ***************************************************************************
1273 
1274 
1276  function sll_f_polynomial_x1( xi, params )result(res)
1277  sll_real64, intent(in) :: xi(3)
1278  sll_real64, dimension(:), intent(in) :: params
1279  sll_real64 :: res !Output
1280  !local variables
1281  sll_real64 :: l1
1282  sll_real64 :: alpha1, alpha2
1283 
1284  sll_assert(size(params) >= 9)
1285  l1 = params(1)
1286  alpha1 = params(4)
1287  alpha2 = params(7)
1288  res = l1 * (xi(1) + alpha1*xi(1)**2 + alpha2 *xi(1)**3)
1289  end function sll_f_polynomial_x1
1290 
1292  function sll_f_polynomial_x2( xi, params )result(res)
1293  sll_real64, intent(in) :: xi(3)
1294  sll_real64, dimension(:), intent(in) :: params
1295  sll_real64 :: res !Output
1296  !local variables
1297  sll_real64 :: l2
1298  sll_real64 :: alpha1, alpha2
1299 
1300  sll_assert(size(params) >= 9)
1301  l2 = params(2)
1302  alpha1 = params(5)
1303  alpha2 = params(8)
1304 
1305  res = l2 * (xi(2) + alpha1*xi(2)**2 + alpha2 *xi(2)**3)
1306  end function sll_f_polynomial_x2
1307 
1309  function sll_f_polynomial_x3( xi, params )result(res)
1310  sll_real64, intent(in) :: xi(3)
1311  sll_real64, dimension(:), intent(in) :: params
1312  sll_real64 :: res !Output
1313  !local variables
1314  sll_real64 :: l3
1315  sll_real64 :: alpha1, alpha2
1316 
1317  sll_assert(size(params) >= 9)
1318  l3 = params(3)
1319  alpha1 = params(6)
1320  alpha2 = params(9)
1321 
1322  res = l3 * (xi(3) + alpha1*xi(3)**2 + alpha2*xi(3)**3)
1323  end function sll_f_polynomial_x3
1324 
1326  function sll_f_polynomial_jac11 ( xi, params )result(res)
1327  sll_real64, intent(in) :: xi(3)
1328  sll_real64, dimension(:), intent(in) :: params
1329  sll_real64 :: res !Output
1330  !local variables
1331  sll_real64 :: l1
1332  sll_real64 :: alpha1, alpha2
1333 
1334  sll_assert(size(params) >= 9)
1335  l1 = params(1)
1336  alpha1 = params(4)
1337  alpha2 = params(7)
1338 
1339  res = l1*(1._f64+alpha1*2._f64*xi(1)+alpha2*3._f64*xi(1)**2)
1340  end function sll_f_polynomial_jac11
1341 
1343  function sll_f_polynomial_jac12 ( xi, params )result(res)
1344  sll_real64, intent(in) :: xi(3)
1345  sll_real64, dimension(:), intent(in) :: params
1346  sll_real64 :: res !Output
1347 
1348  res = 0.0_f64
1349  end function sll_f_polynomial_jac12
1350 
1352  function sll_f_polynomial_jac13 ( xi, params )result(res)
1353  sll_real64, intent(in) :: xi(3)
1354  sll_real64, dimension(:), intent(in) :: params
1355  sll_real64 :: res !Output
1356 
1357  res =0._f64
1358  end function sll_f_polynomial_jac13
1359 
1361  function sll_f_polynomial_jac21 ( xi, params )result(res)
1362  sll_real64, intent(in) :: xi(3)
1363  sll_real64, dimension(:), intent(in) :: params
1364  sll_real64 :: res !Output
1365 
1366  res = 0._f64
1367  end function sll_f_polynomial_jac21
1368 
1370  function sll_f_polynomial_jac22 ( xi, params )result(res)
1371  sll_real64, intent(in) :: xi(3)
1372  sll_real64, dimension(:), intent(in) :: params
1373  sll_real64 :: res !Output
1374  !local variables
1375  sll_real64 :: l2
1376  sll_real64 :: alpha1, alpha2
1377 
1378  sll_assert(size(params) >= 9)
1379  l2 = params(2)
1380  alpha1 = params(5)
1381  alpha2 = params(8)
1382 
1383  res = l2*(1._f64+alpha1*2._f64*xi(2)+alpha2*3._f64*xi(2)**2)
1384  end function sll_f_polynomial_jac22
1385 
1387  function sll_f_polynomial_jac23 ( xi, params )result(res)
1388  sll_real64, intent(in) :: xi(3)
1389  sll_real64, dimension(:), intent(in) :: params
1390  sll_real64 :: res !Output
1391 
1392  res = 0._f64
1393  end function sll_f_polynomial_jac23
1394 
1396  function sll_f_polynomial_jac31 ( xi, params )result(res)
1397  sll_real64, intent(in) :: xi(3)
1398  sll_real64, dimension(:), intent(in) :: params
1399  sll_real64 :: res !Output
1400 
1401  res = 0._f64
1402  end function sll_f_polynomial_jac31
1403 
1405  function sll_f_polynomial_jac32 ( xi, params )result( res )
1406  sll_real64, intent(in) :: xi(3)
1407  sll_real64, dimension(:), intent(in) :: params
1408  sll_real64 :: res !Output
1409 
1410  res = 0._f64
1411  end function sll_f_polynomial_jac32
1412 
1414  function sll_f_polynomial_jac33 ( xi, params )result(res)
1415  sll_real64, intent(in) :: xi(3)
1416  sll_real64, dimension(:), intent(in) :: params
1417  sll_real64 :: res !Output
1418  !local variables
1419  sll_real64 :: l3
1420  sll_real64 :: alpha1, alpha2
1421 
1422  sll_assert(size(params) >= 9)
1423  l3 = params(3)
1424  alpha1 = params(6)
1425  alpha2 = params(9)
1426 
1427  res = l3*(1._f64+alpha1*2._f64*xi(3)+alpha2*3._f64*xi(3)**2)
1428  end function sll_f_polynomial_jac33
1429 
1431  function sll_f_polynomial_jacobian ( xi, params )result(res)
1432  sll_real64, intent(in) :: xi(3)
1433  sll_real64, dimension(:), intent(in) :: params
1434  sll_real64 :: res !Output
1435  !local variables
1436  sll_real64 :: l1, l2, l3
1437  sll_real64 :: alpha11, alpha21, alpha31, alpha12, alpha22, alpha32
1438 
1439  sll_assert(size(params) >= 9)
1440  l1 = params(1)
1441  l2 = params(2)
1442  l3 = params(3)
1443  alpha11 = params(4)
1444  alpha21 = params(5)
1445  alpha31 = params(6)
1446  alpha12 = params(7)
1447  alpha22 = params(8)
1448  alpha32 = params(9)
1449 
1450 
1451  res = l3*l2*l1*(1._f64+alpha11*2._f64*xi(1)+alpha12*3._f64*xi(1)**2)*(1._f64+alpha21*2._f64*xi(2)+alpha22*3._f64*xi(2)**2)*(1._f64+alpha31*2._f64*xi(3)+alpha32*3._f64*xi(3)**2)
1452  end function sll_f_polynomial_jacobian
1453 
1455  function sll_f_polynomial_jacinv11 ( xi, params )result(res)
1456  sll_real64, intent(in) :: xi(3)
1457  sll_real64, dimension(:), intent(in) :: params
1458  sll_real64 :: res !Output
1459  !local variables
1460  sll_real64 :: l1
1461  sll_real64 :: alpha1, alpha2, alpha3
1462 
1463  sll_assert(size(params) >= 12)
1464  l1 = params(1)
1465  alpha1 = params(4)
1466  alpha2 = params(7)
1467  alpha3 = params(10)
1468  res = 1._f64/(l1*(alpha1+alpha2*xi(1)+alpha3*0.5_f64*xi(1)**2))
1469  end function sll_f_polynomial_jacinv11
1470 
1472  function sll_f_polynomial_jacinv12 ( xi, params )result(res)
1473  sll_real64, intent(in) :: xi(3)
1474  sll_real64, dimension(:), intent(in) :: params
1475  sll_real64 :: res !Output
1476 
1477  res = 0.0_f64
1478  end function sll_f_polynomial_jacinv12
1479 
1481  function sll_f_polynomial_jacinv13 ( xi, params )result(res)
1482  sll_real64, intent(in) :: xi(3)
1483  sll_real64, dimension(:), intent(in) :: params
1484  sll_real64 :: res !Output
1485 
1486  res =0._f64
1487  end function sll_f_polynomial_jacinv13
1488 
1490  function sll_f_polynomial_jacinv21 ( xi, params )result(res)
1491  sll_real64, intent(in) :: xi(3)
1492  sll_real64, dimension(:), intent(in) :: params
1493  sll_real64 :: res !Output
1494 
1495  res = 0._f64
1496  end function sll_f_polynomial_jacinv21
1497 
1499  function sll_f_polynomial_jacinv22 ( xi, params )result(res)
1500  sll_real64, intent(in) :: xi(3)
1501  sll_real64, dimension(:), intent(in) :: params
1502  sll_real64 :: res !Output
1503  !local variables
1504  sll_real64 :: l2
1505  sll_real64 :: alpha1, alpha2, alpha3
1506 
1507  sll_assert(size(params) >= 12)
1508  l2 = params(2)
1509  alpha1 = params(5)
1510  alpha2 = params(8)
1511  alpha3 = params(11)
1512  res = 1._f64/(l2*(alpha1+alpha2*xi(2)+alpha3*0.5_f64*xi(2)**2))
1513  end function sll_f_polynomial_jacinv22
1514 
1516  function sll_f_polynomial_jacinv23 ( xi, params )result(res)
1517  sll_real64, intent(in) :: xi(3)
1518  sll_real64, dimension(:), intent(in) :: params
1519  sll_real64 :: res !Output
1520 
1521  res = 0._f64
1522  end function sll_f_polynomial_jacinv23
1523 
1525  function sll_f_polynomial_jacinv31 ( xi, params )result(res)
1526  sll_real64, intent(in) :: xi(3)
1527  sll_real64, dimension(:), intent(in) :: params
1528  sll_real64 :: res !Output
1529 
1530  res = 0._f64
1531  end function sll_f_polynomial_jacinv31
1532 
1534  function sll_f_polynomial_jacinv32 ( xi, params )result(res)
1535  sll_real64, intent(in) :: xi(3)
1536  sll_real64, dimension(:), intent(in) :: params
1537  sll_real64 :: res !Output
1538 
1539  res = 0._f64
1540  end function sll_f_polynomial_jacinv32
1541 
1543  function sll_f_polynomial_jacinv33 ( xi, params ) result(res)
1544  sll_real64, intent(in) :: xi(3)
1545  sll_real64, dimension(:), intent(in) :: params
1546  sll_real64 :: res !Output
1547  !local variables
1548  sll_real64 :: l3
1549  sll_real64 :: alpha1, alpha2, alpha3
1550 
1551  sll_assert(size(params) >= 12)
1552  l3 = params(3)
1553  alpha1 = params(6)
1554  alpha2 = params(9)
1555  alpha3 = params(12)
1556  res = 1._f64/(l3*(alpha1+alpha2*xi(3)+alpha3*0.5_f64*xi(3)**2))
1557  end function sll_f_polynomial_jacinv33
1558 
1559 
1560 
1561  ! ***************************************************************************
1562  !
1563  ! Cylindrical coordinate transformation:
1564  !
1565  ! X1 = (Rmin + (Rmax-Rmin)*xi(1))*cos(2*pi*xi(2))
1566  ! X2 = (Rmin + (Rmax-Rmin)*xi(1))*sin(2*pi*xi(2))
1567  ! X3 = L*xi(3)
1568  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
1569  ! contains the information (Rmin, Rmax, L). Typically:
1570  !
1571  ! Rmin = 0.0
1572  ! Rmax = 2 *pi
1573  ! L = 2 *pi
1574  !
1575  ! ***************************************************************************
1576 
1577 
1579  function sll_f_cylindrical_x1( xi, params )
1580  sll_real64 :: sll_f_cylindrical_x1
1581  sll_real64, intent(in) :: xi(3)
1582  sll_real64, dimension(:), intent(in) :: params
1583  sll_real64 :: r1
1584  sll_real64 :: r2
1585 
1586  sll_assert(size(params) >= 3)
1587  r1 = params(1)
1588  r2 = params(2)
1589  sll_f_cylindrical_x1 = (r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(2))
1590  end function sll_f_cylindrical_x1
1591 
1593  function sll_f_cylindrical_x2( xi, params )
1594  sll_real64 :: sll_f_cylindrical_x2
1595  sll_real64, intent(in) :: xi(3)
1596  sll_real64, dimension(:), intent(in) :: params
1597  sll_real64 :: r1
1598  sll_real64 :: r2
1599 
1600  sll_assert(size(params) >= 3)
1601  r1 = params(1)
1602  r2 = params(2)
1603  sll_f_cylindrical_x2 = (r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))
1604  end function sll_f_cylindrical_x2
1605 
1607  function sll_f_cylindrical_x3( xi, params )
1608  sll_real64 :: sll_f_cylindrical_x3
1609  sll_real64, intent(in) :: xi(3)
1610  sll_real64, dimension(:), intent(in) :: params
1611  sll_real64 :: r1
1612  sll_real64 :: r2
1613  sll_real64 :: l
1614  sll_assert(size(params) >= 3)
1615  r1 = params(1)
1616  r2 = params(2)
1617  l=params(3)
1618  sll_f_cylindrical_x3 = l*xi(3)
1619  end function sll_f_cylindrical_x3
1620 
1622  function sll_f_cylindrical_xi1( x, params )
1623  sll_real64 :: sll_f_cylindrical_xi1
1624  sll_real64, intent(in) :: x(3)
1625  sll_real64, dimension(:), intent(in) :: params
1626  sll_real64 :: r1
1627  sll_real64 :: r2
1628 
1629  sll_assert(size(params) >= 3)
1630  r1 = params(1)
1631  r2 = params(2)
1632  sll_f_cylindrical_xi1 = (sqrt(x(1)**2+x(2)**2)-r1)/(r2-r1)
1633  end function sll_f_cylindrical_xi1
1634 
1636  function sll_f_cylindrical_xi2( x, params )
1637  sll_real64 :: sll_f_cylindrical_xi2
1638  sll_real64, intent(in) :: x(3)
1639  sll_real64, dimension(:), intent(in) :: params
1640  sll_real64 :: r1
1641  sll_real64 :: r2
1642 
1643  sll_assert(size(params) >= 3)
1644  r1 = params(1)
1645  r2 = params(2)
1646  sll_f_cylindrical_xi2 = modulo(atan2(x(2), x(1))/sll_p_twopi, 1._f64) !atan2 gives a value between [-pi,pi], which we transform to [0,1]
1647  end function sll_f_cylindrical_xi2
1648 
1650  function sll_f_cylindrical_xi3( x, params )
1651  sll_real64 :: sll_f_cylindrical_xi3
1652  sll_real64, intent(in) :: x(3)
1653  sll_real64, dimension(:), intent(in) :: params
1654  sll_real64 :: r1
1655  sll_real64 :: r2
1656  sll_real64 :: l
1657  sll_assert(size(params) >= 3)
1658  r1 = params(1)
1659  r2 = params(2)
1660  l = params(3)
1661  sll_f_cylindrical_xi3 = x(3)/l
1662  end function sll_f_cylindrical_xi3
1663 
1665  function sll_f_cylindrical_jac11 ( xi, params )
1666  sll_real64 :: sll_f_cylindrical_jac11
1667  sll_real64, intent(in) :: xi(3)
1668  sll_real64, dimension(:), intent(in) :: params
1669  sll_real64 :: r1
1670  sll_real64 :: r2
1671  sll_assert(size(params) >= 3)
1672  r1 = params(1)
1673  r2 = params(2)
1674  sll_f_cylindrical_jac11 = (r2-r1)*cos(sll_p_twopi*xi(2))
1675  end function sll_f_cylindrical_jac11
1676 
1678  function sll_f_cylindrical_jac12 ( xi, params )
1679  sll_real64 :: sll_f_cylindrical_jac12
1680  sll_real64, intent(in) :: xi(3)
1681  sll_real64, dimension(:), intent(in) :: params
1682  sll_real64 :: r1
1683  sll_real64 :: r2
1684  sll_assert(size(params) >= 3)
1685  r1 = params(1)
1686  r2 = params(2)
1687  sll_f_cylindrical_jac12 = -(r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))*sll_p_twopi
1688  end function sll_f_cylindrical_jac12
1689 
1691  function sll_f_cylindrical_jac13 ( xi, params )
1692  sll_real64 :: sll_f_cylindrical_jac13
1693  sll_real64, intent(in) :: xi(3)
1694  sll_real64, dimension(:), intent(in) :: params
1695  sll_real64 :: r1
1696  sll_real64 :: r2
1697  sll_assert(size(params) >= 3)
1698  r1 = params(1)
1699  r2 = params(2)
1700  sll_f_cylindrical_jac13 =0._f64
1701  end function sll_f_cylindrical_jac13
1702 
1704  function sll_f_cylindrical_jac21 ( xi, params )
1705  sll_real64 :: sll_f_cylindrical_jac21
1706  sll_real64, intent(in) :: xi(3)
1707  sll_real64, dimension(:), intent(in) :: params
1708  sll_real64 :: r1
1709  sll_real64 :: r2
1710  sll_assert(size(params) >= 3)
1711  r1 = params(1)
1712  r2 = params(2)
1713  sll_f_cylindrical_jac21 = (r2-r1)*sin(sll_p_twopi*xi(2))
1714  end function sll_f_cylindrical_jac21
1715 
1717  function sll_f_cylindrical_jac22 ( xi, params )
1718  sll_real64 :: sll_f_cylindrical_jac22
1719  sll_real64, intent(in) :: xi(3)
1720  sll_real64, dimension(:), intent(in) :: params
1721  sll_real64 :: r1
1722  sll_real64 :: r2
1723  sll_assert(size(params) >= 3)
1724  r1 = params(1)
1725  r2 = params(2)
1726  sll_f_cylindrical_jac22 = (r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(2))*sll_p_twopi
1727  end function sll_f_cylindrical_jac22
1728 
1730  function sll_f_cylindrical_jac23 ( xi, params )
1731  sll_real64 :: sll_f_cylindrical_jac23
1732  sll_real64, intent(in) :: xi(3)
1733  sll_real64, dimension(:), intent(in) :: params
1734  sll_real64 :: r1
1735  sll_real64 :: r2
1736  sll_assert(size(params) >= 3)
1737  r1 = params(1)
1738  r2 = params(2)
1739  sll_f_cylindrical_jac23 = 0._f64
1740  end function sll_f_cylindrical_jac23
1741 
1743  function sll_f_cylindrical_jac31 ( xi, params )
1744  sll_real64 :: sll_f_cylindrical_jac31
1745  sll_real64, intent(in) :: xi(3)
1746  sll_real64, dimension(:), intent(in) :: params
1747  sll_real64 :: r1
1748  sll_real64 :: r2
1749  sll_assert(size(params) >= 3)
1750  r1 = params(1)
1751  r2 = params(2)
1752  sll_f_cylindrical_jac31 =0._f64
1753  end function sll_f_cylindrical_jac31
1754 
1756  function sll_f_cylindrical_jac32 ( xi, params )
1757  sll_real64 :: sll_f_cylindrical_jac32
1758  sll_real64, intent(in) :: xi(3)
1759  sll_real64, dimension(:), intent(in) :: params
1760  sll_real64 :: r1
1761  sll_real64 :: r2
1762  sll_assert(size(params) >= 3)
1763  r1 = params(1)
1764  r2 = params(2)
1765  sll_f_cylindrical_jac32 = 0._f64
1766  end function sll_f_cylindrical_jac32
1767 
1769  function sll_f_cylindrical_jac33 ( xi, params )
1770  sll_real64 :: sll_f_cylindrical_jac33
1771  sll_real64, intent(in) :: xi(3)
1772  sll_real64, dimension(:), intent(in) :: params
1773  sll_real64 :: r1
1774  sll_real64 :: r2
1775  sll_real64 :: l
1776  sll_assert(size(params) >= 3)
1777  r1 = params(1)
1778  r2 = params(2)
1779  l = params(3)
1781  end function sll_f_cylindrical_jac33
1782 
1784  function sll_f_cylindrical_jacinv11 ( xi, params )
1785  sll_real64 :: sll_f_cylindrical_jacinv11
1786  sll_real64, intent(in) :: xi(3)
1787  sll_real64, dimension(:), intent(in) :: params
1788  sll_real64 :: r1
1789  sll_real64 :: r2
1790  sll_assert(size(params) >= 3)
1791  r1 = params(1)
1792  r2 = params(2)
1793  sll_f_cylindrical_jacinv11 = cos(sll_p_twopi*xi(2))/(r2-r1)
1794  end function sll_f_cylindrical_jacinv11
1795 
1797  function sll_f_cylindrical_jacinv12 ( xi, params )
1798  sll_real64 :: sll_f_cylindrical_jacinv12
1799  sll_real64, intent(in) :: xi(3)
1800  sll_real64, dimension(:), intent(in) :: params
1801  sll_real64 :: r1
1802  sll_real64 :: r2
1803  sll_assert(size(params) >= 3)
1804  r1 = params(1)
1805  r2 = params(2)
1806  sll_f_cylindrical_jacinv12 = sin(sll_p_twopi*xi(2))/(r2-r1)
1807  end function sll_f_cylindrical_jacinv12
1808 
1810  function sll_f_cylindrical_jacinv13 ( xi, params )
1811  sll_real64 :: sll_f_cylindrical_jacinv13
1812  sll_real64, intent(in) :: xi(3)
1813  sll_real64, dimension(:), intent(in) :: params
1814  sll_real64 :: r1
1815  sll_real64 :: r2
1816  sll_assert(size(params) >= 3)
1817  r1 = params(1)
1818  r2 = params(2)
1820  end function sll_f_cylindrical_jacinv13
1821 
1823  function sll_f_cylindrical_jacinv21 ( xi, params )
1824  sll_real64 :: sll_f_cylindrical_jacinv21
1825  sll_real64, intent(in) :: xi(3)
1826  sll_real64, dimension(:), intent(in) :: params
1827  sll_real64 :: r1
1828  sll_real64 :: r2
1829  sll_assert(size(params) >= 3)
1830  r1 = params(1)
1831  r2 = params(2)
1832  sll_f_cylindrical_jacinv21 = -sin(sll_p_twopi*xi(2))/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))
1833  end function sll_f_cylindrical_jacinv21
1834 
1836  function sll_f_cylindrical_jacinv22 ( xi, params )
1837  sll_real64 :: sll_f_cylindrical_jacinv22
1838  sll_real64, intent(in) :: xi(3)
1839  sll_real64, dimension(:), intent(in) :: params
1840  sll_real64 :: r1
1841  sll_real64 :: r2
1842  sll_assert(size(params) >= 3)
1843  r1 = params(1)
1844  r2 = params(2)
1845  sll_f_cylindrical_jacinv22 = cos(sll_p_twopi*xi(2))/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))
1846  end function sll_f_cylindrical_jacinv22
1847 
1849  function sll_f_cylindrical_jacinv23 ( xi, params )
1850  sll_real64 :: sll_f_cylindrical_jacinv23
1851  sll_real64, intent(in) :: xi(3)
1852  sll_real64, dimension(:), intent(in) :: params
1853  sll_real64 :: r1
1854  sll_real64 :: r2
1855  sll_assert(size(params) >= 3)
1856  r1 = params(1)
1857  r2 = params(2)
1859  end function sll_f_cylindrical_jacinv23
1860 
1862  function sll_f_cylindrical_jacinv31 ( xi, params )
1863  sll_real64 :: sll_f_cylindrical_jacinv31
1864  sll_real64, intent(in) :: xi(3)
1865  sll_real64, dimension(:), intent(in) :: params
1866  sll_real64 :: r1
1867  sll_real64 :: r2
1868  sll_assert(size(params) >= 3)
1869  r1 = params(1)
1870  r2 = params(2)
1872  end function sll_f_cylindrical_jacinv31
1873 
1875  function sll_f_cylindrical_jacinv32 ( xi, params )
1876  sll_real64 :: sll_f_cylindrical_jacinv32
1877  sll_real64, intent(in) :: xi(3)
1878  sll_real64, dimension(:), intent(in) :: params
1879  sll_real64 :: r1
1880  sll_real64 :: r2
1881  sll_assert(size(params) >= 3)
1882  r1 = params(1)
1883  r2 = params(2)
1885  end function sll_f_cylindrical_jacinv32
1886 
1888  function sll_f_cylindrical_jacinv33 ( xi, params )
1889  sll_real64 :: sll_f_cylindrical_jacinv33
1890  sll_real64, intent(in) :: xi(3)
1891  sll_real64, dimension(:), intent(in) :: params
1892  sll_real64 :: r1
1893  sll_real64 :: r2
1894  sll_real64 :: l
1895  sll_assert(size(params) >= 3)
1896  r1 = params(1)
1897  r2 = params(2)
1898  l = params(3)
1899  sll_f_cylindrical_jacinv33 = 1._f64/l
1900  end function sll_f_cylindrical_jacinv33
1901 
1903  function sll_f_cylindrical_jacobian ( xi, params )
1904  sll_real64 :: sll_f_cylindrical_jacobian
1905  sll_real64, intent(in) :: xi(3)
1906  sll_real64, dimension(:), intent(in) :: params
1907  sll_real64 :: r1
1908  sll_real64 :: r2
1909  sll_real64 :: l
1910  sll_assert(size(params) >= 3)
1911  r1 = params(1)
1912  r2 = params(2)
1913  l = params(3)
1914  sll_f_cylindrical_jacobian = sll_p_twopi*(r2-r1)*(r1 + (r2-r1)*xi(1))*l
1915  end function sll_f_cylindrical_jacobian
1916 
1917  ! ***************************************************************************
1918  !
1919  ! Cylindrical coordinate transformation:
1920  !
1921  ! X1 = (Rmin + (Rmax-Rmin)*sqrt(xi(1)))*cos(2*pi*xi(2))
1922  ! X2 = (Rmin + (Rmax-Rmin)*sqrt(xi(1)))*sin(2*pi*xi(2))
1923  ! X3 = L*xi(3)
1924  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
1925  ! contains the information (Rmin, Rmax, L). Typically:
1926  !
1927  ! Rmin = 0.0
1928  ! Rmax = 2 *pi
1929  ! L = 2 *pi
1930  !
1931  ! ***************************************************************************
1932 
1933 
1935  function sll_f_cylindrical_sqrt_x1( xi, params )
1936  sll_real64 :: sll_f_cylindrical_sqrt_x1
1937  sll_real64, intent(in) :: xi(3)
1938  sll_real64, dimension(:), intent(in) :: params
1939  sll_real64 :: r1
1940  sll_real64 :: r2
1941 
1942  sll_assert(size(params) >= 3)
1943  r1 = params(1)
1944  r2 = params(2)
1945  sll_f_cylindrical_sqrt_x1 = (r1 + (r2-r1)*sqrt(xi(1)))*cos(sll_p_twopi*xi(2))
1946  end function sll_f_cylindrical_sqrt_x1
1947 
1949  function sll_f_cylindrical_sqrt_x2( xi, params )
1950  sll_real64 :: sll_f_cylindrical_sqrt_x2
1951  sll_real64, intent(in) :: xi(3)
1952  sll_real64, dimension(:), intent(in) :: params
1953  sll_real64 :: r1
1954  sll_real64 :: r2
1955 
1956  sll_assert(size(params) >= 3)
1957  r1 = params(1)
1958  r2 = params(2)
1959  sll_f_cylindrical_sqrt_x2 = (r1 + (r2-r1)*sqrt(xi(1)))*sin(sll_p_twopi*xi(2))
1960  end function sll_f_cylindrical_sqrt_x2
1961 
1963  function sll_f_cylindrical_sqrt_x3( xi, params )
1964  sll_real64 :: sll_f_cylindrical_sqrt_x3
1965  sll_real64, intent(in) :: xi(3)
1966  sll_real64, dimension(:), intent(in) :: params
1967  sll_real64 :: r1
1968  sll_real64 :: r2
1969  sll_real64 :: l
1970  sll_assert(size(params) >= 3)
1971  r1 = params(1)
1972  r2 = params(2)
1973  l=params(3)
1974  sll_f_cylindrical_sqrt_x3 = l*xi(3)
1975  end function sll_f_cylindrical_sqrt_x3
1976 
1978  function sll_f_cylindrical_sqrt_xi1( x, params )
1979  sll_real64 :: sll_f_cylindrical_sqrt_xi1
1980  sll_real64, intent(in) :: x(3)
1981  sll_real64, dimension(:), intent(in) :: params
1982  sll_real64 :: r1
1983  sll_real64 :: r2
1984 
1985  sll_assert(size(params) >= 3)
1986  r1 = params(1)
1987  r2 = params(2)
1988  sll_f_cylindrical_sqrt_xi1 = ((sqrt(x(1)**2+x(2)**2)-r1)/(r2-r1))**2
1989  end function sll_f_cylindrical_sqrt_xi1
1990 
1992  function sll_f_cylindrical_sqrt_xi2( x, params )
1993  sll_real64 :: sll_f_cylindrical_sqrt_xi2
1994  sll_real64, intent(in) :: x(3)
1995  sll_real64, dimension(:), intent(in) :: params
1996  sll_real64 :: r1
1997  sll_real64 :: r2
1998 
1999  sll_assert(size(params) >= 3)
2000  r1 = params(1)
2001  r2 = params(2)
2002  sll_f_cylindrical_sqrt_xi2 = modulo(atan2(x(2), x(1))/sll_p_twopi, 1._f64)!atan2 gives a value between [-pi,pi], which we transform to [0,1]
2003  end function sll_f_cylindrical_sqrt_xi2
2004 
2006  function sll_f_cylindrical_sqrt_xi3( x, params )
2007  sll_real64 :: sll_f_cylindrical_sqrt_xi3
2008  sll_real64, intent(in) :: x(3)
2009  sll_real64, dimension(:), intent(in) :: params
2010  sll_real64 :: r1
2011  sll_real64 :: r2
2012  sll_real64 :: l
2013  sll_assert(size(params) >= 3)
2014  r1 = params(1)
2015  r2 = params(2)
2016  l = params(3)
2018  end function sll_f_cylindrical_sqrt_xi3
2019 
2021  function sll_f_cylindrical_sqrt_jac11 ( xi, params )
2022  sll_real64 :: sll_f_cylindrical_sqrt_jac11
2023  sll_real64, intent(in) :: xi(3)
2024  sll_real64, dimension(:), intent(in) :: params
2025  sll_real64 :: r1
2026  sll_real64 :: r2
2027  sll_assert(size(params) >= 3)
2028  r1 = params(1)
2029  r2 = params(2)
2030  sll_f_cylindrical_sqrt_jac11 = (r2-r1)/( 2._f64*sqrt(xi(1)) )*cos(sll_p_twopi*xi(2))
2031  end function sll_f_cylindrical_sqrt_jac11
2032 
2034  function sll_f_cylindrical_sqrt_jac12 ( xi, params )
2035  sll_real64 :: sll_f_cylindrical_sqrt_jac12
2036  sll_real64, intent(in) :: xi(3)
2037  sll_real64, dimension(:), intent(in) :: params
2038  sll_real64 :: r1
2039  sll_real64 :: r2
2040  sll_assert(size(params) >= 3)
2041  r1 = params(1)
2042  r2 = params(2)
2043  sll_f_cylindrical_sqrt_jac12 = -(r1 + (r2-r1)*sqrt(xi(1)))*sin(sll_p_twopi*xi(2))*sll_p_twopi
2044  end function sll_f_cylindrical_sqrt_jac12
2045 
2047  function sll_f_cylindrical_sqrt_jac13 ( xi, params )
2048  sll_real64 :: sll_f_cylindrical_sqrt_jac13
2049  sll_real64, intent(in) :: xi(3)
2050  sll_real64, dimension(:), intent(in) :: params
2051  sll_real64 :: r1
2052  sll_real64 :: r2
2053  sll_assert(size(params) >= 3)
2054  r1 = params(1)
2055  r2 = params(2)
2057  end function sll_f_cylindrical_sqrt_jac13
2058 
2060  function sll_f_cylindrical_sqrt_jac21 ( xi, params )
2061  sll_real64 :: sll_f_cylindrical_sqrt_jac21
2062  sll_real64, intent(in) :: xi(3)
2063  sll_real64, dimension(:), intent(in) :: params
2064  sll_real64 :: r1
2065  sll_real64 :: r2
2066  sll_assert(size(params) >= 3)
2067  r1 = params(1)
2068  r2 = params(2)
2069  sll_f_cylindrical_sqrt_jac21 = (r2-r1)/( 2._f64*sqrt(xi(1)) )*sin(sll_p_twopi*xi(2))
2070  end function sll_f_cylindrical_sqrt_jac21
2071 
2073  function sll_f_cylindrical_sqrt_jac22 ( xi, params )
2074  sll_real64 :: sll_f_cylindrical_sqrt_jac22
2075  sll_real64, intent(in) :: xi(3)
2076  sll_real64, dimension(:), intent(in) :: params
2077  sll_real64 :: r1
2078  sll_real64 :: r2
2079  sll_assert(size(params) >= 3)
2080  r1 = params(1)
2081  r2 = params(2)
2082  sll_f_cylindrical_sqrt_jac22 = (r1 + (r2-r1)*sqrt(xi(1)))*cos(sll_p_twopi*xi(2))*sll_p_twopi
2083  end function sll_f_cylindrical_sqrt_jac22
2084 
2086  function sll_f_cylindrical_sqrt_jac23 ( xi, params )
2087  sll_real64 :: sll_f_cylindrical_sqrt_jac23
2088  sll_real64, intent(in) :: xi(3)
2089  sll_real64, dimension(:), intent(in) :: params
2090  sll_real64 :: r1
2091  sll_real64 :: r2
2092  sll_assert(size(params) >= 3)
2093  r1 = params(1)
2094  r2 = params(2)
2096  end function sll_f_cylindrical_sqrt_jac23
2097 
2099  function sll_f_cylindrical_sqrt_jac31 ( xi, params )
2100  sll_real64 :: sll_f_cylindrical_sqrt_jac31
2101  sll_real64, intent(in) :: xi(3)
2102  sll_real64, dimension(:), intent(in) :: params
2103  sll_real64 :: r1
2104  sll_real64 :: r2
2105  sll_assert(size(params) >= 3)
2106  r1 = params(1)
2107  r2 = params(2)
2109  end function sll_f_cylindrical_sqrt_jac31
2110 
2112  function sll_f_cylindrical_sqrt_jac32 ( xi, params )
2113  sll_real64 :: sll_f_cylindrical_sqrt_jac32
2114  sll_real64, intent(in) :: xi(3)
2115  sll_real64, dimension(:), intent(in) :: params
2116  sll_real64 :: r1
2117  sll_real64 :: r2
2118  sll_assert(size(params) >= 3)
2119  r1 = params(1)
2120  r2 = params(2)
2122  end function sll_f_cylindrical_sqrt_jac32
2123 
2125  function sll_f_cylindrical_sqrt_jac33 ( xi, params )
2126  sll_real64 :: sll_f_cylindrical_sqrt_jac33
2127  sll_real64, intent(in) :: xi(3)
2128  sll_real64, dimension(:), intent(in) :: params
2129  sll_real64 :: r1
2130  sll_real64 :: r2
2131  sll_real64 :: l
2132  sll_assert(size(params) >= 3)
2133  r1 = params(1)
2134  r2 = params(2)
2135  l = params(3)
2137  end function sll_f_cylindrical_sqrt_jac33
2138 
2140  function sll_f_cylindrical_sqrt_jacobian ( xi, params )
2141  sll_real64 :: sll_f_cylindrical_sqrt_jacobian
2142  sll_real64, intent(in) :: xi(3)
2143  sll_real64, dimension(:), intent(in) :: params
2144  sll_real64 :: r1
2145  sll_real64 :: r2
2146  sll_real64 :: l
2147  sll_assert(size(params) >= 3)
2148  r1 = params(1)
2149  r2 = params(2)
2150  l = params(3)
2151  sll_f_cylindrical_sqrt_jacobian = sll_p_pi*(r2-r1)*(r1/sqrt(xi(1)) + (r2-r1))*l
2152  end function sll_f_cylindrical_sqrt_jacobian
2153 
2154 
2155 
2156 
2157  ! ***************************************************************************
2158  !
2159  ! Elliptical coordinate transformation:
2160  !
2161  ! X1 = R*cosh(xi(1)+rmin)*cos(2*pi*xi(2))
2162  ! X2 = R*sinh(xi(1)+rmin)*sin(2*pi*xi(2))
2163  ! X3 = L*xi(3)
2164  ! Where xi are defined in the interval [0,1]. The 'params' array
2165  ! contains the information (rmin, R, L). Typically:
2166  !
2167  ! rmin = 0.0
2168  ! R = 2 *pi
2169  ! L = 2 *pi
2170  !
2171  ! ***************************************************************************
2172 
2173 
2175  function sll_f_elliptical_x1( xi, params )
2176  sll_real64 :: sll_f_elliptical_x1
2177  sll_real64, intent(in) :: xi(3)
2178  sll_real64, dimension(:), intent(in) :: params
2179  sll_real64 :: rmin, r
2180 
2181  sll_assert(size(params) >= 3)
2182  rmin = params(1)
2183  r = params(2)
2184  sll_f_elliptical_x1 = r*cosh(xi(1)+rmin)*cos(sll_p_twopi*xi(2))
2185  end function sll_f_elliptical_x1
2186 
2188  function sll_f_elliptical_x2( xi, params )
2189  sll_real64 :: sll_f_elliptical_x2
2190  sll_real64, intent(in) :: xi(3)
2191  sll_real64, dimension(:), intent(in) :: params
2192  sll_real64 :: rmin, r
2193 
2194  sll_assert(size(params) >= 3)
2195  rmin = params(1)
2196  r = params(2)
2197  sll_f_elliptical_x2 = r*sinh(xi(1)+rmin)*sin(sll_p_twopi*xi(2))
2198  end function sll_f_elliptical_x2
2199 
2201  function sll_f_elliptical_x3( xi, params )
2202  sll_real64 :: sll_f_elliptical_x3
2203  sll_real64, intent(in) :: xi(3)
2204  sll_real64, dimension(:), intent(in) :: params
2205  sll_real64 :: l
2206  sll_assert(size(params) >= 3)
2207  l=params(3)
2208  sll_f_elliptical_x3 = l*xi(3)
2209  end function sll_f_elliptical_x3
2210 
2211 
2213  function sll_f_elliptical_jac11 ( xi, params )
2214  sll_real64 :: sll_f_elliptical_jac11
2215  sll_real64, intent(in) :: xi(3)
2216  sll_real64, dimension(:), intent(in) :: params
2217  sll_real64 :: rmin, r
2218 
2219  sll_assert(size(params) >= 3)
2220  rmin = params(1)
2221  r = params(2)
2222  sll_f_elliptical_jac11 = r*sinh(xi(1)+rmin)*cos(sll_p_twopi*xi(2))
2223  end function sll_f_elliptical_jac11
2224 
2226  function sll_f_elliptical_jac12 ( xi, params )
2227  sll_real64 :: sll_f_elliptical_jac12
2228  sll_real64, intent(in) :: xi(3)
2229  sll_real64, dimension(:), intent(in) :: params
2230  sll_real64 :: rmin, r
2231 
2232  sll_assert(size(params) >= 3)
2233  rmin = params(1)
2234  r = params(2)
2235  sll_f_elliptical_jac12 = - r*cosh(xi(1)+rmin)*sin(sll_p_twopi*xi(2))*sll_p_twopi
2236  end function sll_f_elliptical_jac12
2237 
2239  function sll_f_elliptical_jac13 ( xi, params )
2240  sll_real64 :: sll_f_elliptical_jac13
2241  sll_real64, intent(in) :: xi(3)
2242  sll_real64, dimension(:), intent(in) :: params
2243 
2244  sll_f_elliptical_jac13 = 0._f64
2245  end function sll_f_elliptical_jac13
2246 
2248  function sll_f_elliptical_jac21 ( xi, params )
2249  sll_real64 :: sll_f_elliptical_jac21
2250  sll_real64, intent(in) :: xi(3)
2251  sll_real64, dimension(:), intent(in) :: params
2252  sll_real64 :: rmin, r
2253 
2254  sll_assert(size(params) >= 3)
2255  rmin = params(1)
2256  r = params(2)
2257  sll_f_elliptical_jac21 = r*cosh(xi(1)+rmin)*sin(sll_p_twopi*xi(2))
2258  end function sll_f_elliptical_jac21
2259 
2261  function sll_f_elliptical_jac22 ( xi, params )
2262  sll_real64 :: sll_f_elliptical_jac22
2263  sll_real64, intent(in) :: xi(3)
2264  sll_real64, dimension(:), intent(in) :: params
2265  sll_real64 :: rmin, r
2266 
2267  sll_assert(size(params) >= 3)
2268  rmin = params(1)
2269  r = params(2)
2270  sll_f_elliptical_jac22 = r*sinh(xi(1)+rmin)*cos(sll_p_twopi*xi(2))*sll_p_twopi
2271  end function sll_f_elliptical_jac22
2272 
2274  function sll_f_elliptical_jac23 ( xi, params )
2275  sll_real64 :: sll_f_elliptical_jac23
2276  sll_real64, intent(in) :: xi(3)
2277  sll_real64, dimension(:), intent(in) :: params
2278 
2279  sll_f_elliptical_jac23 = 0._f64
2280  end function sll_f_elliptical_jac23
2281 
2283  function sll_f_elliptical_jac31 ( xi, params )
2284  sll_real64 :: sll_f_elliptical_jac31
2285  sll_real64, intent(in) :: xi(3)
2286  sll_real64, dimension(:), intent(in) :: params
2287 
2288  sll_f_elliptical_jac31 = 0._f64
2289  end function sll_f_elliptical_jac31
2290 
2292  function sll_f_elliptical_jac32 ( xi, params )
2293  sll_real64 :: sll_f_elliptical_jac32
2294  sll_real64, intent(in) :: xi(3)
2295  sll_real64, dimension(:), intent(in) :: params
2296 
2297  sll_f_elliptical_jac32 = 0._f64
2298  end function sll_f_elliptical_jac32
2299 
2301  function sll_f_elliptical_jac33 ( xi, params )
2302  sll_real64 :: sll_f_elliptical_jac33
2303  sll_real64, intent(in) :: xi(3)
2304  sll_real64, dimension(:), intent(in) :: params
2305  sll_real64 :: l
2306  sll_assert(size(params) >= 3)
2307 
2308  l = params(3)
2310  end function sll_f_elliptical_jac33
2311 
2312 
2313 
2315  function sll_f_elliptical_jacobian ( xi, params )
2316  sll_real64 :: sll_f_elliptical_jacobian
2317  sll_real64, intent(in) :: xi(3)
2318  sll_real64, dimension(:), intent(in) :: params
2319  sll_real64 :: rmin, r
2320  sll_real64 :: l
2321  sll_assert(size(params) >= 3)
2322  rmin = params(1)
2323  r = params(2)
2324  l = params(3)
2325  sll_f_elliptical_jacobian = l*r**2*sll_p_twopi*(sinh(xi(1)+rmin )**2+sin(sll_p_twopi*xi(2))**2 )
2326  end function sll_f_elliptical_jacobian
2327 
2328 
2329  ! ***************************************************************************
2330  !
2331  ! Dshaped_Singular coordinate transformation:
2332  !
2333  ! X1 = 1/eps*(1 - sqrt(1+eps*(eps+2*xi(1))*cos(2*pi*xi(2)) )
2334  ! X2 = y_0 + (e*(1/sqrt(1-eps^2/4))*xi(1)*sin(2*pi*xi(2)))/(1+eps*X1(xi))
2335  ! X3 = L*xi(3)
2336  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
2337  ! contains the information ( eps, e, Lz, y_0 ). Typically:
2338  !
2339  ! eps = 0.3
2340  ! e = 1.4
2341  ! L = 2 *pi
2342  ! y_0 = 0
2343  !
2344  ! ***************************************************************************
2345 
2346 
2348  function sll_f_dshaped_singular_x1( xi, params )
2349  sll_real64 :: sll_f_dshaped_singular_x1
2350  sll_real64, intent(in) :: xi(3)
2351  sll_real64, dimension(:), intent(in) :: params
2352  sll_real64 :: eps
2353  sll_real64 :: e
2354 
2355  sll_assert(size(params) >= 4)
2356  eps = params(1)
2357  e = params(2)
2358  sll_f_dshaped_singular_x1 = (1-sqrt(1+eps*(eps+2._f64*xi(1)*cos( sll_p_twopi*xi(2) ) ) ) )/eps
2359  end function sll_f_dshaped_singular_x1
2360 
2362  function sll_f_dshaped_singular_x2( xi, params )
2363  sll_real64 :: sll_f_dshaped_singular_x2
2364  sll_real64, intent(in) :: xi(3)
2365  sll_real64, dimension(:), intent(in) :: params
2366  sll_real64 :: eps
2367  sll_real64 :: e
2368  sll_real64 :: y_0
2369 
2370  sll_assert(size(params) >= 4)
2371  eps = params(1)
2372  e = params(2)
2373  y_0 = params(4)
2374  sll_f_dshaped_singular_x2 = y_0+ e*(1._f64/sqrt(1._f64-eps**2/4._f64) )*xi(1)*sin(sll_p_twopi*xi(2)) / (1+eps*sll_f_dshaped_singular_x1( xi, params ) )
2375  end function sll_f_dshaped_singular_x2
2376 
2378  function sll_f_dshaped_singular_x3( xi, params )
2379  sll_real64 :: sll_f_dshaped_singular_x3
2380  sll_real64, intent(in) :: xi(3)
2381  sll_real64, dimension(:), intent(in) :: params
2382  sll_real64 :: l
2383  sll_assert(size(params) >= 4)
2384  l=params(3)
2385  sll_f_dshaped_singular_x3 = l*xi(3)
2386  end function sll_f_dshaped_singular_x3
2387 
2388 
2390  function sll_f_dshaped_singular_jac11 ( xi, params )
2391  sll_real64 :: sll_f_dshaped_singular_jac11
2392  sll_real64, intent(in) :: xi(3)
2393  sll_real64, dimension(:), intent(in) :: params
2394  sll_real64 :: eps
2395 
2396  sll_assert(size(params) >= 4)
2397  eps = params(1)
2398  sll_f_dshaped_singular_jac11 = -cos(sll_p_twopi*xi(2))/(1-eps*sll_f_dshaped_singular_x1( xi, params ) )
2399  end function sll_f_dshaped_singular_jac11
2400 
2402  function sll_f_dshaped_singular_jac12 ( xi, params )
2403  sll_real64 :: sll_f_dshaped_singular_jac12
2404  sll_real64, intent(in) :: xi(3)
2405  sll_real64, dimension(:), intent(in) :: params
2406  sll_real64 :: eps
2407 
2408  sll_assert(size(params) >= 4)
2409  eps = params(1)
2411  end function sll_f_dshaped_singular_jac12
2412 
2414  function sll_f_dshaped_singular_jac13 ( xi, params )
2415  sll_real64 :: sll_f_dshaped_singular_jac13
2416  sll_real64, intent(in) :: xi(3)
2417  sll_real64, dimension(:), intent(in) :: params
2418 
2420  end function sll_f_dshaped_singular_jac13
2421 
2423  function sll_f_dshaped_singular_jac21 ( xi, params )
2424  sll_real64 :: sll_f_dshaped_singular_jac21
2425  sll_real64, intent(in) :: xi(3)
2426  sll_real64, dimension(:), intent(in) :: params
2427  sll_real64 :: eps
2428  sll_real64 :: e
2429  sll_real64 :: x1
2430  sll_assert(size(params) >= 4)
2431  eps = params(1)
2432  e = params(2)
2433  x1 = sll_f_dshaped_singular_x1( xi, params )
2434  sll_f_dshaped_singular_jac21 = (e*(1/sqrt(1-eps**2/4._f64)) )/(1+eps*x1 ) * ( sin(sll_p_twopi*xi(2)) + (eps*xi(1)*sin(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(2)) ) / (1-eps**2 * x1**2 ) )
2435  end function sll_f_dshaped_singular_jac21
2436 
2438  function sll_f_dshaped_singular_jac22 ( xi, params )
2439  sll_real64 :: sll_f_dshaped_singular_jac22
2440  sll_real64, intent(in) :: xi(3)
2441  sll_real64, dimension(:), intent(in) :: params
2442  sll_real64 :: eps
2443  sll_real64 :: e
2444  sll_real64 :: x1
2445  sll_assert(size(params) >= 4)
2446  eps = params(1)
2447  e = params(2)
2448  x1 = sll_f_dshaped_singular_x1( xi, params )
2449  sll_f_dshaped_singular_jac22 = (sll_p_twopi*e*(1/sqrt(1-eps**2/4._f64)) )/(1+eps*x1 ) * ( xi(1)*cos(sll_p_twopi*xi(2)) - (eps*xi(1)**2 * sin(sll_p_twopi*xi(2))**2 ) / (1-eps**2 * x1**2 ) )
2450  end function sll_f_dshaped_singular_jac22
2451 
2453  function sll_f_dshaped_singular_jac23 ( xi, params )
2454  sll_real64 :: sll_f_dshaped_singular_jac23
2455  sll_real64, intent(in) :: xi(3)
2456  sll_real64, dimension(:), intent(in) :: params
2458  end function sll_f_dshaped_singular_jac23
2459 
2461  function sll_f_dshaped_singular_jac31 ( xi, params )
2462  sll_real64 :: sll_f_dshaped_singular_jac31
2463  sll_real64, intent(in) :: xi(3)
2464  sll_real64, dimension(:), intent(in) :: params
2466  end function sll_f_dshaped_singular_jac31
2467 
2469  function sll_f_dshaped_singular_jac32 ( xi, params )
2470  sll_real64 :: sll_f_dshaped_singular_jac32
2471  sll_real64, intent(in) :: xi(3)
2472  sll_real64, dimension(:), intent(in) :: params
2474  end function sll_f_dshaped_singular_jac32
2475 
2477  function sll_f_dshaped_singular_jac33 ( xi, params )
2478  sll_real64 :: sll_f_dshaped_singular_jac33
2479  sll_real64, intent(in) :: xi(3)
2480  sll_real64, dimension(:), intent(in) :: params
2481  sll_real64 :: l
2482  sll_assert(size(params) >= 4)
2483  l = params(3)
2485  end function sll_f_dshaped_singular_jac33
2486 
2487 
2488 
2490  function sll_f_dshaped_singular_jacobian ( xi, params )
2491  sll_real64 :: sll_f_dshaped_singular_jacobian
2492  sll_real64, intent(in) :: xi(3)
2493  sll_real64, dimension(:), intent(in) :: params
2494  sll_real64 :: eps
2495  sll_real64 :: l
2496  sll_assert(size(params) >= 4)
2497  eps = params(1)
2498  l = params(3)
2499  sll_f_dshaped_singular_jacobian = l*sll_p_twopi*xi(1)/(eps*sll_f_dshaped_singular_x1( xi, params ) -1._f64)
2500  end function sll_f_dshaped_singular_jacobian
2501 
2503  function sll_f_dshaped_singular_pseudoinv11 ( xi, params )
2505  sll_real64, intent(in) :: xi(3)
2506  sll_real64, dimension(:), intent(in) :: params
2507  sll_real64 :: eps
2508 
2509  sll_assert(size(params) >= 4)
2510  eps = params(1)
2513 
2515  function sll_f_dshaped_singular_pseudoinv12 ( xi, params )
2517  sll_real64, intent(in) :: xi(3)
2518  sll_real64, dimension(:), intent(in) :: params
2521 
2523  function sll_f_dshaped_singular_pseudoinv13 ( xi, params )
2525  sll_real64, intent(in) :: xi(3)
2526  sll_real64, dimension(:), intent(in) :: params
2529 
2531  function sll_f_dshaped_singular_pseudoinv21 ( xi, params )
2533  sll_real64, intent(in) :: xi(3)
2534  sll_real64, dimension(:), intent(in) :: params
2535  sll_real64 :: eps
2536  sll_real64 :: e
2537  sll_real64 :: x1
2538  sll_assert(size(params) >= 4)
2539  eps = params(1)
2540  e = params(2)
2541  x1 = sll_f_dshaped_singular_x1( xi, params )
2542  sll_f_dshaped_singular_pseudoinv21 = eps*xi(1) * sin(sll_p_twopi*xi(2)) /(1._f64 + eps*sll_f_dshaped_singular_x1( xi, params ) )
2544 
2546  function sll_f_dshaped_singular_pseudoinv22 ( xi, params )
2548  sll_real64, intent(in) :: xi(3)
2549  sll_real64, dimension(:), intent(in) :: params
2550  sll_real64 :: eps
2551  sll_real64 :: e
2552  sll_real64 :: x1
2553  sll_assert(size(params) >= 4)
2554  eps = params(1)
2555  e = params(2)
2556  x1 = sll_f_dshaped_singular_x1( xi, params )
2557  sll_f_dshaped_singular_pseudoinv22 = (1._f64 + eps*sll_f_dshaped_singular_x1( xi, params ) )/ (e*(1/sqrt(1-eps**2/4._f64)) )
2559 
2561  function sll_f_dshaped_singular_pseudoinv23 ( xi, params )
2563  sll_real64, intent(in) :: xi(3)
2564  sll_real64, dimension(:), intent(in) :: params
2567 
2569  function sll_f_dshaped_singular_pseudoinv31 ( xi, params )
2571  sll_real64, intent(in) :: xi(3)
2572  sll_real64, dimension(:), intent(in) :: params
2575 
2577  function sll_f_dshaped_singular_pseudoinv32 ( xi, params )
2579  sll_real64, intent(in) :: xi(3)
2580  sll_real64, dimension(:), intent(in) :: params
2583 
2585  function sll_f_dshaped_singular_pseudoinv33 ( xi, params )
2587  sll_real64, intent(in) :: xi(3)
2588  sll_real64, dimension(:), intent(in) :: params
2591 
2592 
2593  ! ***************************************************************************
2594  !
2595  ! Rotated rotated singular coordinate transformation:
2596  !
2597  ! X1 = x_0 + (1-kappa)*xi(1))*cos(2*pi*xi(2)) - delta xi(1)^2
2598  ! X2 = y_0 + (1+kappa)*xi(1))*sin(2*pi*xi(2))
2599  ! X3 = Lz*xi(3)
2600  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
2601  ! contains the information (kappa, delta, Lz, x_0, y_0). Typically:
2602  !
2603  ! kappa = 0.3
2604  ! delta = 0.2
2605  ! Lz = 2 *pi
2606  ! x_0 = 0
2607  ! y_0 = 0
2608  !
2609  ! ***************************************************************************
2610 
2611 
2613  function sll_f_rotated_singular_x1( xi, params )
2614  sll_real64 :: sll_f_rotated_singular_x1
2615  sll_real64, intent(in) :: xi(3)
2616  sll_real64, dimension(:), intent(in) :: params
2617  sll_real64 :: kappa, delta
2618  sll_real64 :: x_0
2619 
2620  sll_assert(size(params) >= 5)
2621  kappa = params(1)
2622  delta = params(2)
2623  x_0 = params(4)
2624  sll_f_rotated_singular_x1 = x_0 + (1-kappa)*xi(1)*cos(sll_p_twopi*xi(2))-delta*xi(1)**2
2625  end function sll_f_rotated_singular_x1
2626 
2628  function sll_f_rotated_singular_x2( xi, params )
2629  sll_real64 :: sll_f_rotated_singular_x2
2630  sll_real64, intent(in) :: xi(3)
2631  sll_real64, dimension(:), intent(in) :: params
2632  sll_real64 :: kappa
2633  sll_real64 :: y_0
2634 
2635  sll_assert(size(params) >= 5)
2636  kappa = params(1)
2637  y_0 = params(5)
2638  sll_f_rotated_singular_x2 = y_0+(1+kappa)*xi(1)*sin(sll_p_twopi*xi(2))
2639  end function sll_f_rotated_singular_x2
2640 
2642  function sll_f_rotated_singular_x3( xi, params )
2643  sll_real64 :: sll_f_rotated_singular_x3
2644  sll_real64, intent(in) :: xi(3)
2645  sll_real64, dimension(:), intent(in) :: params
2646  sll_real64 :: l
2647  sll_assert(size(params) >= 5)
2648  l=params(3)
2649  sll_f_rotated_singular_x3 = l*xi(3)
2650  end function sll_f_rotated_singular_x3
2651 
2653  function sll_f_rotated_singular_jac11 ( xi, params )
2654  sll_real64 :: sll_f_rotated_singular_jac11
2655  sll_real64, intent(in) :: xi(3)
2656  sll_real64, dimension(:), intent(in) :: params
2657  sll_real64 :: kappa, delta
2658 
2659  sll_assert(size(params) >= 5)
2660  kappa = params(1)
2661  delta = params(2)
2662  sll_f_rotated_singular_jac11 = (1-kappa)*xi(1)*cos(sll_p_twopi*xi(2))-2._f64*delta*xi(1)
2663  end function sll_f_rotated_singular_jac11
2664 
2666  function sll_f_rotated_singular_jac12 ( xi, params )
2667  sll_real64 :: sll_f_rotated_singular_jac12
2668  sll_real64, intent(in) :: xi(3)
2669  sll_real64, dimension(:), intent(in) :: params
2670  sll_real64 :: kappa, delta
2671 
2672  sll_assert(size(params) >= 5)
2673  kappa = params(1)
2674  delta = params(2)
2675  sll_f_rotated_singular_jac12 = -(1-kappa)*xi(1)*sin(sll_p_twopi*xi(2))*sll_p_twopi
2676  end function sll_f_rotated_singular_jac12
2677 
2679  function sll_f_rotated_singular_jac13 ( xi, params )
2680  sll_real64 :: sll_f_rotated_singular_jac13
2681  sll_real64, intent(in) :: xi(3)
2682  sll_real64, dimension(:), intent(in) :: params
2683 
2685  end function sll_f_rotated_singular_jac13
2686 
2688  function sll_f_rotated_singular_jac21 ( xi, params )
2689  sll_real64 :: sll_f_rotated_singular_jac21
2690  sll_real64, intent(in) :: xi(3)
2691  sll_real64, dimension(:), intent(in) :: params
2692  sll_real64 :: kappa
2693 
2694  sll_assert(size(params) >= 5)
2695  kappa = params(1)
2696  sll_f_rotated_singular_jac21 = (1+kappa)*sin(sll_p_twopi*xi(2))
2697  end function sll_f_rotated_singular_jac21
2698 
2700  function sll_f_rotated_singular_jac22 ( xi, params )
2701  sll_real64 :: sll_f_rotated_singular_jac22
2702  sll_real64, intent(in) :: xi(3)
2703  sll_real64, dimension(:), intent(in) :: params
2704  sll_real64 :: kappa
2705 
2706  sll_assert(size(params) >= 5)
2707  kappa = params(1)
2708  sll_f_rotated_singular_jac22 = (1+kappa)*xi(1)*cos(sll_p_twopi*xi(2)) *sll_p_twopi
2709  end function sll_f_rotated_singular_jac22
2710 
2712  function sll_f_rotated_singular_jac23 ( xi, params )
2713  sll_real64 :: sll_f_rotated_singular_jac23
2714  sll_real64, intent(in) :: xi(3)
2715  sll_real64, dimension(:), intent(in) :: params
2716 
2718  end function sll_f_rotated_singular_jac23
2719 
2721  function sll_f_rotated_singular_jac31 ( xi, params )
2722  sll_real64 :: sll_f_rotated_singular_jac31
2723  sll_real64, intent(in) :: xi(3)
2724  sll_real64, dimension(:), intent(in) :: params
2725 
2727  end function sll_f_rotated_singular_jac31
2728 
2730  function sll_f_rotated_singular_jac32 ( xi, params )
2731  sll_real64 :: sll_f_rotated_singular_jac32
2732  sll_real64, intent(in) :: xi(3)
2733  sll_real64, dimension(:), intent(in) :: params
2734 
2736  end function sll_f_rotated_singular_jac32
2737 
2739  function sll_f_rotated_singular_jac33 ( xi, params )
2740  sll_real64 :: sll_f_rotated_singular_jac33
2741  sll_real64, intent(in) :: xi(3)
2742  sll_real64, dimension(:), intent(in) :: params
2743  sll_real64 :: l
2744  sll_assert(size(params) >= 5)
2745 
2746  l = params(3)
2748  end function sll_f_rotated_singular_jac33
2749 
2750 
2752  function sll_f_rotated_singular_jacobian ( xi, params )
2753  sll_real64 :: sll_f_rotated_singular_jacobian
2754  sll_real64, intent(in) :: xi(3)
2755  sll_real64, dimension(:), intent(in) :: params
2756  sll_real64 :: kappa, delta
2757  sll_real64 :: l
2758 
2759  sll_assert(size(params) >= 5)
2760  kappa = params(1)
2761  delta = params(2)
2762  l = params(3)
2763  sll_f_rotated_singular_jacobian = sll_p_twopi*xi(1)*(1+kappa) *((1-kappa)-2*delta*xi(1)*cos(sll_p_twopi*xi(2)))*l
2764  end function sll_f_rotated_singular_jacobian
2765 
2767  function sll_f_rotated_singular_pseudoinv11 ( xi, params )
2769  sll_real64, intent(in) :: xi(3)
2770  sll_real64, dimension(:), intent(in) :: params
2771  sll_real64 :: kappa, delta
2772 
2773  sll_assert(size(params) >= 5)
2774  kappa = params(1)
2775  delta = params(2)
2776  sll_f_rotated_singular_pseudoinv11 = 1._f64/(1-kappa-2._f64*delta*xi(1)*cos(sll_p_twopi*xi(2)) )
2778 
2780  function sll_f_rotated_singular_pseudoinv12 ( xi, params )
2782  sll_real64, intent(in) :: xi(3)
2783  sll_real64, dimension(:), intent(in) :: params
2784  sll_real64 :: kappa, delta
2785 
2786  sll_assert(size(params) >= 5)
2787  kappa = params(1)
2788  delta = params(2)
2789  sll_f_rotated_singular_pseudoinv12 = 2._f64*delta*xi(1)*sin(sll_p_twopi*xi(2)) /((1-kappa-2._f64*delta*xi(1)*cos(sll_p_twopi*xi(2)) )*(1+kappa) )
2791 
2793  function sll_f_rotated_singular_pseudoinv13 ( xi, params )
2795  sll_real64, intent(in) :: xi(3)
2796  sll_real64, dimension(:), intent(in) :: params
2797 
2800 
2802  function sll_f_rotated_singular_pseudoinv21 ( xi, params )
2804  sll_real64, intent(in) :: xi(3)
2805  sll_real64, dimension(:), intent(in) :: params
2806 
2809 
2811  function sll_f_rotated_singular_pseudoinv22 ( xi, params )
2813  sll_real64, intent(in) :: xi(3)
2814  sll_real64, dimension(:), intent(in) :: params
2815  sll_real64 :: kappa
2816 
2817  sll_assert(size(params) >= 5)
2818  kappa = params(1)
2819  sll_f_rotated_singular_pseudoinv22 = 1._f64/(1+kappa)
2821 
2823  function sll_f_rotated_singular_pseudoinv23 ( xi, params )
2825  sll_real64, intent(in) :: xi(3)
2826  sll_real64, dimension(:), intent(in) :: params
2827 
2830 
2832  function sll_f_rotated_singular_pseudoinv31 ( xi, params )
2834  sll_real64, intent(in) :: xi(3)
2835  sll_real64, dimension(:), intent(in) :: params
2836 
2839 
2841  function sll_f_rotated_singular_pseudoinv32 ( xi, params )
2843  sll_real64, intent(in) :: xi(3)
2844  sll_real64, dimension(:), intent(in) :: params
2845 
2848 
2850  function sll_f_rotated_singular_pseudoinv33 ( xi, params )
2852  sll_real64, intent(in) :: xi(3)
2853  sll_real64, dimension(:), intent(in) :: params
2854 
2857 
2858 
2859  ! ***************************************************************************
2860  !
2861  ! Rotation coordinate transformation:
2862  !
2863  ! X1 = L1*(xi(1)*cos(thxi)-xi(2)*sin(thxi))
2864  ! X2 = L2*(xi(1)*sin(thxi)+xi(2)*cos(thxi))
2865  ! X3 = L3*xi(3)
2866  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
2867  ! contains the information (L1,L2,L3,thxi).
2868  !
2869  ! ***************************************************************************
2870 
2871 
2873  function sll_f_rotation_x1( xi, params )
2874  sll_real64 :: sll_f_rotation_x1
2875  sll_real64, intent(in) :: xi(3)
2876  sll_real64, dimension(:), intent(in) :: params
2877 
2878  sll_assert(size(params) >= 4)
2879  sll_f_rotation_x1 = params(1)*modulo(xi(1)*cos(params(4))-xi(2)*sin(params(4)),1._f64)
2880  end function sll_f_rotation_x1
2881 
2883  function sll_f_rotation_x2( xi, params )
2884  sll_real64 :: sll_f_rotation_x2
2885  sll_real64, intent(in) :: xi(3)
2886  sll_real64, dimension(:), intent(in) :: params
2887 
2888  sll_assert(size(params) >= 4)
2889  sll_f_rotation_x2 = params(2)*modulo(xi(1)*sin(params(4))+xi(2)*cos(params(4)),1._f64)
2890  end function sll_f_rotation_x2
2891 
2893  function sll_f_rotation_x3( xi, params )
2894  sll_real64 :: sll_f_rotation_x3
2895  sll_real64, intent(in) :: xi(3)
2896  sll_real64, dimension(:), intent(in) :: params
2897 
2898  sll_assert(size(params) >= 4)
2899  sll_f_rotation_x3 = params(3)*modulo(xi(3),1._f64)
2900  end function sll_f_rotation_x3
2901 
2903  function sll_f_rotation_jac11 ( xi, params )
2904  sll_real64 :: sll_f_rotation_jac11
2905  sll_real64, intent(in) :: xi(3)
2906  sll_real64, dimension(:), intent(in) :: params
2907  sll_f_rotation_jac11 =params(1)*cos(params(4))
2908  end function sll_f_rotation_jac11
2909 
2911  function sll_f_rotation_jac12 ( xi, params )
2912  sll_real64 :: sll_f_rotation_jac12
2913  sll_real64, intent(in) :: xi(3)
2914  sll_real64, dimension(:), intent(in) :: params
2915  sll_f_rotation_jac12 = params(1)*sin(params(4))
2916  end function sll_f_rotation_jac12
2917 
2919  function sll_f_rotation_jac13 ( xi, params )
2920  sll_real64 :: sll_f_rotation_jac13
2921  sll_real64, intent(in) :: xi(3)
2922  sll_real64, dimension(:), intent(in) :: params
2923 
2924  sll_assert(size(params) >= 4)
2925  sll_f_rotation_jac13 =0._f64
2926  end function sll_f_rotation_jac13
2927 
2929  function sll_f_rotation_jac21 ( xi, params )
2930  sll_real64 :: sll_f_rotation_jac21
2931  sll_real64, intent(in) :: xi(3)
2932  sll_real64, dimension(:), intent(in) :: params
2933 
2934  sll_assert(size(params) >= 4)
2935  sll_f_rotation_jac21 = params(2)*sin(params(4))
2936  end function sll_f_rotation_jac21
2937 
2939  function sll_f_rotation_jac22 ( xi, params )
2940  sll_real64 :: sll_f_rotation_jac22
2941  sll_real64, intent(in) :: xi(3)
2942  sll_real64, dimension(:), intent(in) :: params
2943 
2944  sll_assert(size(params) >= 4)
2945  sll_f_rotation_jac22 = params(2)*cos(params(4))
2946  end function sll_f_rotation_jac22
2947 
2949  function sll_f_rotation_jac23 ( xi, params )
2950  sll_real64 :: sll_f_rotation_jac23
2951  sll_real64, intent(in) :: xi(3)
2952  sll_real64, dimension(:), intent(in) :: params
2953 
2954  sll_assert(size(params) >= 4)
2955  sll_f_rotation_jac23 = 0._f64
2956  end function sll_f_rotation_jac23
2957 
2959  function sll_f_rotation_jac31 ( xi, params )
2960  sll_real64 :: sll_f_rotation_jac31
2961  sll_real64, intent(in) :: xi(3)
2962  sll_real64, dimension(:), intent(in) :: params
2963 
2964  sll_assert(size(params) >= 4)
2965  sll_f_rotation_jac31 =0._f64
2966  end function sll_f_rotation_jac31
2967 
2969  function sll_f_rotation_jac32 ( xi, params )
2970  sll_real64 :: sll_f_rotation_jac32
2971  sll_real64, intent(in) :: xi(3)
2972  sll_real64, dimension(:), intent(in) :: params
2973 
2974  sll_assert(size(params) >= 4)
2975  sll_f_rotation_jac32 = 0._f64
2976  end function sll_f_rotation_jac32
2977 
2979  function sll_f_rotation_jac33 ( xi, params )
2980  sll_real64 :: sll_f_rotation_jac33
2981  sll_real64, intent(in) :: xi(3)
2982  sll_real64, dimension(:), intent(in) :: params
2983 
2984  sll_assert(size(params) >= 4)
2985  sll_f_rotation_jac33 = params(3)
2986  end function sll_f_rotation_jac33
2987 
2989  function sll_f_rotation_jacinv11 ( xi, params )
2990  sll_real64 :: sll_f_rotation_jacinv11
2991  sll_real64, intent(in) :: xi(3)
2992  sll_real64, dimension(:), intent(in) :: params
2993 
2994  sll_assert(size(params) >= 4)
2995  sll_f_rotation_jacinv11 = cos(params(4))/params(1)
2996  end function sll_f_rotation_jacinv11
2997 
2999  function sll_f_rotation_jacinv12 ( xi, params )
3000  sll_real64 :: sll_f_rotation_jacinv12
3001  sll_real64, intent(in) :: xi(3)
3002  sll_real64, dimension(:), intent(in) :: params
3003 
3004  sll_assert(size(params) >= 4)
3005  sll_f_rotation_jacinv12 = sin(params(4))/params(1)
3006  end function sll_f_rotation_jacinv12
3007 
3009  function sll_f_rotation_jacinv13 ( xi, params )
3010  sll_real64 :: sll_f_rotation_jacinv13
3011  sll_real64, intent(in) :: xi(3)
3012  sll_real64, dimension(:), intent(in) :: params
3013 
3014  sll_assert(size(params) >= 4)
3015  sll_f_rotation_jacinv13 =0._f64
3016  end function sll_f_rotation_jacinv13
3017 
3019  function sll_f_rotation_jacinv21 ( xi, params )
3020  sll_real64 :: sll_f_rotation_jacinv21
3021  sll_real64, intent(in) :: xi(3)
3022  sll_real64, dimension(:), intent(in) :: params
3023 
3024  sll_assert(size(params) >= 4)
3025  sll_f_rotation_jacinv21 = -sin(params(4))/params(2)
3026  end function sll_f_rotation_jacinv21
3027 
3029  function sll_f_rotation_jacinv22 ( xi, params )
3030  sll_real64 :: sll_f_rotation_jacinv22
3031  sll_real64, intent(in) :: xi(3)
3032  sll_real64, dimension(:), intent(in) :: params
3033 
3034  sll_assert(size(params) >= 4)
3035  sll_f_rotation_jacinv22 = cos(params(4))/params(2)
3036  end function sll_f_rotation_jacinv22
3037 
3039  function sll_f_rotation_jacinv23 ( xi, params )
3040  sll_real64 :: sll_f_rotation_jacinv23
3041  sll_real64, intent(in) :: xi(3)
3042  sll_real64, dimension(:), intent(in) :: params
3043 
3044  sll_assert(size(params) >= 4)
3045  sll_f_rotation_jacinv23 = 0._f64
3046  end function sll_f_rotation_jacinv23
3047 
3049  function sll_f_rotation_jacinv31 ( xi, params )
3050  sll_real64 :: sll_f_rotation_jacinv31
3051  sll_real64, intent(in) :: xi(3)
3052  sll_real64, dimension(:), intent(in) :: params
3053 
3054  sll_assert(size(params) >= 4)
3055  sll_f_rotation_jacinv31 =0._f64
3056  end function sll_f_rotation_jacinv31
3057 
3059  function sll_f_rotation_jacinv32 ( xi, params )
3060  sll_real64 :: sll_f_rotation_jacinv32
3061  sll_real64, intent(in) :: xi(3)
3062  sll_real64, dimension(:), intent(in) :: params
3063 
3064  sll_assert(size(params) >= 4)
3065  sll_f_rotation_jacinv32 = 0._f64
3066  end function sll_f_rotation_jacinv32
3067 
3069  function sll_f_rotation_jacinv33 ( xi, params )
3070  sll_real64 :: sll_f_rotation_jacinv33
3071  sll_real64, intent(in) :: xi(3)
3072  sll_real64, dimension(:), intent(in) :: params
3073 
3074  sll_assert(size(params) >= 4)
3075  sll_f_rotation_jacinv33 = 1._f64/params(3)
3076  end function sll_f_rotation_jacinv33
3077 
3079  function sll_f_rotation_jacobian ( xi, params )
3080  sll_real64 :: sll_f_rotation_jacobian
3081  sll_real64, intent(in) :: xi(3)
3082  sll_real64, dimension(:), intent(in) :: params
3083 
3084  sll_assert(size(params) >= 4)
3085  sll_f_rotation_jacobian = params(1)*params(2)*params(3)
3086  end function sll_f_rotation_jacobian
3087 
3088 
3089  ! ***************************************************************************
3090  !
3091  ! Toroidal_Cylinder coordinate transformation:
3092  !
3093  ! X1 = (R0 + (Rmin + (Rmax-Rmin)*xi(1))*cos(2*pi*xi(3))) * cos(xi(2))
3094  ! X2 = (R0 + (Rmin + (Rmax-Rmin)*xi(1))*cos(2*pi*xi(3))) * sin(xi(2))
3095  ! X3 = (Rmin + (Rmax-Rmin)*xi(1))*sin(2*pi*xi(3))
3096  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
3097  ! contains the information (Rmin, Rmax, R0). Typically:
3098  ! Rmin <= Rmax < R0
3099  ! R0 = 2.0
3100  ! R1 = 0.0
3101  ! R2 = 1.0
3102  !
3103  ! ***************************************************************************
3104 
3105 
3107  function sll_f_toroidal_cylinder_x1( xi, params )
3108  sll_real64 :: sll_f_toroidal_cylinder_x1
3109  sll_real64, intent(in) :: xi(3)
3110  sll_real64, dimension(:), intent(in) :: params
3111  sll_real64 :: r1
3112  sll_real64 :: r2
3113  sll_real64 :: r0
3114 
3115  sll_assert(size(params) >= 3)
3116  r1 = params(1)
3117  r2 = params(2)
3118  r0 = params(3)
3119  sll_f_toroidal_cylinder_x1 = (r0+(r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(3))) * cos(sll_p_twopi*xi(2))
3120  end function sll_f_toroidal_cylinder_x1
3121 
3123  function sll_f_toroidal_cylinder_x2( xi, params )
3124  sll_real64 :: sll_f_toroidal_cylinder_x2
3125  sll_real64, intent(in) :: xi(3)
3126  sll_real64, dimension(:), intent(in) :: params
3127  sll_real64 :: r1
3128  sll_real64 :: r2
3129  sll_real64 :: r0
3130 
3131  sll_assert(size(params) >= 3)
3132  r1 = params(1)
3133  r2 = params(2)
3134  r0 = params(3)
3135  sll_f_toroidal_cylinder_x2 = (r0+(r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(3)))*sin(sll_p_twopi*xi(2))
3136  end function sll_f_toroidal_cylinder_x2
3137 
3139  function sll_f_toroidal_cylinder_x3( xi, params )
3140  sll_real64 :: sll_f_toroidal_cylinder_x3
3141  sll_real64, intent(in) :: xi(3)
3142  sll_real64, dimension(:), intent(in) :: params
3143  sll_real64 :: r1
3144  sll_real64 :: r2
3145  sll_real64 :: r0
3146 
3147  sll_assert(size(params) >= 3)
3148  r1 = params(1)
3149  r2 = params(2)
3150  r0 = params(3)
3151  sll_f_toroidal_cylinder_x3 = (r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(3))
3152  end function sll_f_toroidal_cylinder_x3
3153 
3155  function sll_f_toroidal_cylinder_jac11 ( xi, params )
3156  sll_real64 :: sll_f_toroidal_cylinder_jac11
3157  sll_real64, intent(in) :: xi(3)
3158  sll_real64, dimension(:), intent(in) :: params
3159  sll_real64 :: r1
3160  sll_real64 :: r2
3161  sll_real64 :: r0
3162 
3163  sll_assert(size(params) >= 3)
3164  r1 = params(1)
3165  r2 = params(2)
3166  r0 = params(3)
3167  sll_f_toroidal_cylinder_jac11 = (r2-r1)*cos(sll_p_twopi*xi(3))*cos(sll_p_twopi*xi(2))
3168  end function sll_f_toroidal_cylinder_jac11
3169 
3171  function sll_f_toroidal_cylinder_jac12 ( xi, params )
3172  sll_real64 :: sll_f_toroidal_cylinder_jac12
3173  sll_real64, intent(in) :: xi(3)
3174  sll_real64, dimension(:), intent(in) :: params
3175  sll_real64 :: r1
3176  sll_real64 :: r2
3177  sll_real64 :: r0
3178 
3179  sll_assert(size(params) >= 3)
3180  r1 = params(1)
3181  r2 = params(2)
3182  r0 = params(3)
3183  sll_f_toroidal_cylinder_jac12 = -(r0+(r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(3)))*sin(sll_p_twopi*xi(2)) *sll_p_twopi
3184  end function sll_f_toroidal_cylinder_jac12
3185 
3187  function sll_f_toroidal_cylinder_jac13 ( xi, params )
3188  sll_real64 :: sll_f_toroidal_cylinder_jac13
3189  sll_real64, intent(in) :: xi(3)
3190  sll_real64, dimension(:), intent(in) :: params
3191  sll_real64 :: r1
3192  sll_real64 :: r2
3193  sll_real64 :: r0
3194 
3195  sll_assert(size(params) >= 3)
3196  r1 = params(1)
3197  r2 = params(2)
3198  r0 = params(3)
3199  sll_f_toroidal_cylinder_jac13 = -(r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(3))*cos(sll_p_twopi*xi(2))*sll_p_twopi
3200  end function sll_f_toroidal_cylinder_jac13
3201 
3203  function sll_f_toroidal_cylinder_jac21 ( xi, params )
3204  sll_real64 :: sll_f_toroidal_cylinder_jac21
3205  sll_real64, intent(in) :: xi(3)
3206  sll_real64, dimension(:), intent(in) :: params
3207  sll_real64 :: r1
3208  sll_real64 :: r2
3209  sll_real64 :: r0
3210 
3211  sll_assert(size(params) >= 3)
3212  r1 = params(1)
3213  r2 = params(2)
3214  r0 = params(3)
3215  sll_f_toroidal_cylinder_jac21 = (r2-r1)*cos(sll_p_twopi*xi(3))*sin(sll_p_twopi*xi(2))
3216  end function sll_f_toroidal_cylinder_jac21
3217 
3219  function sll_f_toroidal_cylinder_jac22 ( xi, params )
3220  sll_real64 :: sll_f_toroidal_cylinder_jac22
3221  sll_real64, intent(in) :: xi(3)
3222  sll_real64, dimension(:), intent(in) :: params
3223  sll_real64 :: r1
3224  sll_real64 :: r2
3225  sll_real64 :: r0
3226 
3227  sll_assert(size(params) >= 3)
3228  r1 = params(1)
3229  r2 = params(2)
3230  r0 = params(3)
3231  sll_f_toroidal_cylinder_jac22 = (r0+(r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(3)))*cos(sll_p_twopi*xi(2))*sll_p_twopi
3232  end function sll_f_toroidal_cylinder_jac22
3233 
3235  function sll_f_toroidal_cylinder_jac23 ( xi, params )
3236  sll_real64 :: sll_f_toroidal_cylinder_jac23
3237  sll_real64, intent(in) :: xi(3)
3238  sll_real64, dimension(:), intent(in) :: params
3239  sll_real64 :: r1
3240  sll_real64 :: r2
3241  sll_real64 :: r0
3242 
3243  sll_assert(size(params) >= 3)
3244  r1 = params(1)
3245  r2 = params(2)
3246  r0 = params(3)
3247  sll_f_toroidal_cylinder_jac23 = -(r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(3))*sin(sll_p_twopi*xi(2))*sll_p_twopi
3248  end function sll_f_toroidal_cylinder_jac23
3249 
3251  function sll_f_toroidal_cylinder_jac31 ( xi, params )
3252  sll_real64 :: sll_f_toroidal_cylinder_jac31
3253  sll_real64, intent(in) :: xi(3)
3254  sll_real64, dimension(:), intent(in) :: params
3255  sll_real64 :: r1
3256  sll_real64 :: r2
3257  sll_real64 :: r0
3258 
3259  sll_assert(size(params) >= 3)
3260  r1 = params(1)
3261  r2 = params(2)
3262  r0 = params(3)
3263  sll_f_toroidal_cylinder_jac31 = (r2-r1)*sin(sll_p_twopi*xi(3))
3264  end function sll_f_toroidal_cylinder_jac31
3265 
3267  function sll_f_toroidal_cylinder_jac32 ( xi, params )
3268  sll_real64 :: sll_f_toroidal_cylinder_jac32
3269  sll_real64, intent(in) :: xi(3)
3270  sll_real64, dimension(:), intent(in) :: params
3271  sll_real64 :: r1
3272  sll_real64 :: r2
3273  sll_real64 :: r0
3274 
3275  sll_assert(size(params) >= 3)
3276  r1 = params(1)
3277  r2 = params(2)
3278  r0 = params(3)
3280  end function sll_f_toroidal_cylinder_jac32
3281 
3283  function sll_f_toroidal_cylinder_jac33 ( xi, params )
3284  sll_real64 :: sll_f_toroidal_cylinder_jac33
3285  sll_real64, intent(in) :: xi(3)
3286  sll_real64, dimension(:), intent(in) :: params
3287  sll_real64 :: r1
3288  sll_real64 :: r2
3289  sll_real64 :: r0
3290 
3291  sll_assert(size(params) >= 3)
3292  r1 = params(1)
3293  r2 = params(2)
3294  r0 = params(3)
3295  sll_f_toroidal_cylinder_jac33 = (r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(3))*sll_p_twopi
3296  end function sll_f_toroidal_cylinder_jac33
3297 
3299  function sll_f_toroidal_cylinder_jacobian ( xi, params )
3300  sll_real64 :: sll_f_toroidal_cylinder_jacobian
3301  sll_real64, intent(in) :: xi(3)
3302  sll_real64, dimension(:), intent(in) :: params
3303  sll_real64 :: r1
3304  sll_real64 :: r2
3305  sll_real64 :: r0
3306 
3307  sll_assert(size(params) >= 3)
3308  r1 = params(1)
3309  r2 = params(2)
3310  r0 = params(3)
3311  sll_f_toroidal_cylinder_jacobian = r0*(r1 + (r2-r1)*xi(1))*sll_p_twopi+(r1 + (r2-r1)*xi(1))**2*cos(sll_p_twopi*xi(3))*sll_p_twopi**2
3312  !r*R0+xi(1)^2 cos(xi(3))
3314 !!$
3315 !!$ !> jacobian matrix inverse
3316 !!$ function sll_f_toroidal_cylinder_jacinv11 ( xi, params )
3317 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv11
3318 !!$ sll_real64, intent(in) :: xi(3)
3319 !!$ sll_real64, dimension(:), intent(in) :: params
3320 !!$ sll_real64 :: r1
3321 !!$ sll_real64 :: r2
3322 !!$ SLL_ASSERT(size(params) >= 2)
3323 !!$ r1 = params(1)
3324 !!$ r2 = params(2)
3325 !!$ sll_f_toroidal_cylinder_jacinv11 = cos(sll_p_twopi*xi(2))/(r2-r1)
3326 !!$ end function sll_f_toroidal_cylinder_jacinv11
3327 !!$
3328 !!$ !> jacobian matrix inverse
3329 !!$ function sll_f_toroidal_cylinder_jacinv12 ( xi, params )
3330 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv12
3331 !!$ sll_real64, intent(in) :: xi(3)
3332 !!$ sll_real64, dimension(:), intent(in) :: params
3333 !!$ sll_real64 :: r1
3334 !!$ sll_real64 :: r2
3335 !!$ SLL_ASSERT(size(params) >= 2)
3336 !!$ r1 = params(1)
3337 !!$ r2 = params(2)
3338 !!$ sll_f_toroidal_cylinder_jacinv12 = sin(sll_p_twopi*xi(2))/(r2-r1)
3339 !!$ end function sll_f_toroidal_cylinder_jacinv12
3340 !!$
3341 !!$ !> jacobian matrix inverse
3342 !!$ function sll_f_toroidal_cylinder_jacinv13 ( xi, params )
3343 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv13
3344 !!$ sll_real64, intent(in) :: xi(3)
3345 !!$ sll_real64, dimension(:), intent(in) :: params
3346 !!$ sll_real64 :: r1
3347 !!$ sll_real64 :: r2
3348 !!$ SLL_ASSERT(size(params) >= 2)
3349 !!$ r1 = params(1)
3350 !!$ r2 = params(2)
3351 !!$ sll_f_toroidal_cylinder_jacinv13 =0._f64
3352 !!$ end function sll_f_toroidal_cylinder_jacinv13
3353 !!$
3354 !!$ !> jacobian matrix inverse
3355 !!$ function sll_f_toroidal_cylinder_jacinv21 ( xi, params )
3356 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv21
3357 !!$ sll_real64, intent(in) :: xi(3)
3358 !!$ sll_real64, dimension(:), intent(in) :: params
3359 !!$ sll_real64 :: r1
3360 !!$ sll_real64 :: r2
3361 !!$ SLL_ASSERT(size(params) >= 2)
3362 !!$ r1 = params(1)
3363 !!$ r2 = params(2)
3364 !!$ sll_f_toroidal_cylinder_jacinv21 = -sin(sll_p_twopi*xi(2))/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))
3365 !!$ end function sll_f_toroidal_cylinder_jacinv21
3366 !!$
3367 !!$ !> jacobian matrix inverse
3368 !!$ function sll_f_toroidal_cylinder_jacinv22 ( xi, params )
3369 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv22
3370 !!$ sll_real64, intent(in) :: xi(3)
3371 !!$ sll_real64, dimension(:), intent(in) :: params
3372 !!$ sll_real64 :: r1
3373 !!$ sll_real64 :: r2
3374 !!$ SLL_ASSERT(size(params) >= 2)
3375 !!$ r1 = params(1)
3376 !!$ r2 = params(2)
3377 !!$ sll_f_toroidal_cylinder_jacinv22 = cos(sll_p_twopi*xi(2))/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))
3378 !!$ end function sll_f_toroidal_cylinder_jacinv22
3379 !!$
3380 !!$ !> jacobian matrix inverse
3381 !!$ function sll_f_toroidal_cylinder_jacinv23 ( xi, params )
3382 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv23
3383 !!$ sll_real64, intent(in) :: xi(3)
3384 !!$ sll_real64, dimension(:), intent(in) :: params
3385 !!$ sll_real64 :: r1
3386 !!$ sll_real64 :: r2
3387 !!$ SLL_ASSERT(size(params) >= 2)
3388 !!$ r1 = params(1)
3389 !!$ r2 = params(2)
3390 !!$ sll_f_toroidal_cylinder_jacinv23 = 0._f64
3391 !!$ end function sll_f_toroidal_cylinder_jacinv23
3392 !!$
3393 !!$ !> jacobian matrix inverse
3394 !!$ function sll_f_toroidal_cylinder_jacinv31 ( xi, params )
3395 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv31
3396 !!$ sll_real64, intent(in) :: xi(3)
3397 !!$ sll_real64, dimension(:), intent(in) :: params
3398 !!$ sll_real64 :: r1
3399 !!$ sll_real64 :: r2
3400 !!$ SLL_ASSERT(size(params) >= 2)
3401 !!$ r1 = params(1)
3402 !!$ r2 = params(2)
3403 !!$ sll_f_toroidal_cylinder_jacinv31 =0._f64
3404 !!$ end function sll_f_toroidal_cylinder_jacinv31
3405 !!$
3406 !!$ !> jacobian matrix inverse
3407 !!$ function sll_f_toroidal_cylinder_jacinv32 ( xi, params )
3408 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv32
3409 !!$ sll_real64, intent(in) :: xi(3)
3410 !!$ sll_real64, dimension(:), intent(in) :: params
3411 !!$ sll_real64 :: r1
3412 !!$ sll_real64 :: r2
3413 !!$ SLL_ASSERT(size(params) >= 2)
3414 !!$ r1 = params(1)
3415 !!$ r2 = params(2)
3416 !!$ sll_f_toroidal_cylinder_jacinv32 = 0._f64
3417 !!$ end function sll_f_toroidal_cylinder_jacinv32
3418 !!$
3419 !!$ !> jacobian matrix inverse
3420 !!$ function sll_f_toroidal_cylinder_jacinv33 ( xi, params )
3421 !!$ sll_real64 :: sll_f_toroidal_cylinder_jacinv33
3422 !!$ sll_real64, intent(in) :: xi(3)
3423 !!$ sll_real64, dimension(:), intent(in) :: params
3424 !!$ sll_real64 :: r1
3425 !!$ sll_real64 :: r2
3426 !!$ SLL_ASSERT(size(params) >= 2)
3427 !!$ r1 = params(1)
3428 !!$ r2 = params(2)
3429 !!$ sll_f_toroidal_cylinder_jacinv33 = 1._f64
3430 !!$ end function sll_f_toroidal_cylinder_jacinv33
3431 
3432 
3433 
3434 
3435 
3436  ! ***************************************************************************
3437  !
3438  ! Spherical coordinate transformation:
3439  !
3440  ! X1 = (Rmin + (Rmax-Rmin)*xi(1))*sin(2*pi*xi(2))*cos(2*pi*xi(3))
3441  ! X2 = (Rmin + (Rmax-Rmin)*xi(1))*sin(2*pi*xi(2))*sin(2*pi*xi(3))
3442  ! X3 = (Rmin + (Rmax-Rmin)*xi(1))*cos(2*pi*xi(2))
3443  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
3444  ! contains the information (Rmin, Rmax). Typically:
3445  !
3446  ! Rmin = 0.0
3447  ! Rmax = 1.0
3448  !
3449  ! ***************************************************************************
3450 
3451 
3453  function sll_f_spherical_x1( xi, params )
3454  sll_real64 :: sll_f_spherical_x1
3455  sll_real64, intent(in) :: xi(3)
3456  sll_real64, dimension(:), intent(in) :: params
3457  sll_real64 :: r1
3458  sll_real64 :: r2
3459  sll_assert(size(params) >= 2)
3460  r1 = params(1)
3461  r2 = params(2)
3462  sll_f_spherical_x1 = (r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(3))
3463  end function sll_f_spherical_x1
3464 
3466  function sll_f_spherical_x2( xi, params )
3467  sll_real64 :: sll_f_spherical_x2
3468  sll_real64, intent(in) :: xi(3)
3469  sll_real64, dimension(:), intent(in) :: params
3470  sll_real64 :: r1
3471  sll_real64 :: r2
3472  sll_assert(size(params) >= 2)
3473  r1 = params(1)
3474  r2 = params(2)
3475  sll_f_spherical_x2= (r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))*sin(sll_p_twopi*xi(3))
3476  end function sll_f_spherical_x2
3477 
3479  function sll_f_spherical_x3( xi, params )
3480  sll_real64 :: sll_f_spherical_x3
3481  sll_real64, intent(in) :: xi(3)
3482  sll_real64, dimension(:), intent(in) :: params
3483  sll_real64 :: r1
3484  sll_real64 :: r2
3485  sll_assert(size(params) >= 2)
3486  r1 = params(1)
3487  r2 = params(2)
3488  sll_f_spherical_x3 = (r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(2))
3489  end function sll_f_spherical_x3
3490 
3492  function sll_f_spherical_jac11 ( xi, params )
3493  sll_real64 :: sll_f_spherical_jac11
3494  sll_real64, intent(in) :: xi(3)
3495  sll_real64, dimension(:), intent(in) :: params
3496  sll_real64 :: r1
3497  sll_real64 :: r2
3498  sll_assert(size(params) >= 2)
3499  r1 = params(1)
3500  r2 = params(2)
3501  sll_f_spherical_jac11 = (r2-r1)*sin(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(3))
3502  end function sll_f_spherical_jac11
3503 
3505  function sll_f_spherical_jac12 ( xi, params )
3506  sll_real64 :: sll_f_spherical_jac12
3507  sll_real64, intent(in) :: xi(3)
3508  sll_real64, dimension(:), intent(in) :: params
3509  sll_real64 :: r1
3510  sll_real64 :: r2
3511  sll_assert(size(params) >= 2)
3512  r1 = params(1)
3513  r2 = params(2)
3514  sll_f_spherical_jac12 = (r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(3))*sll_p_twopi
3515  end function sll_f_spherical_jac12
3516 
3518  function sll_f_spherical_jac13 ( xi, params )
3519  sll_real64 :: sll_f_spherical_jac13
3520  sll_real64, intent(in) :: xi(3)
3521  sll_real64, dimension(:), intent(in) :: params
3522  sll_real64 :: r1
3523  sll_real64 :: r2
3524  sll_assert(size(params) >= 2)
3525  r1 = params(1)
3526  r2 = params(2)
3527  sll_f_spherical_jac13 = -(r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))*sin(sll_p_twopi*xi(3))*sll_p_twopi
3528  end function sll_f_spherical_jac13
3529 
3531  function sll_f_spherical_jac21 ( xi, params )
3532  sll_real64 :: sll_f_spherical_jac21
3533  sll_real64, intent(in) :: xi(3)
3534  sll_real64, dimension(:), intent(in) :: params
3535  sll_real64 :: r1
3536  sll_real64 :: r2
3537  sll_assert(size(params) >= 2)
3538  r1 = params(1)
3539  r2 = params(2)
3540  sll_f_spherical_jac21 = (r2-r1)*sin(sll_p_twopi*xi(2))*sin(sll_p_twopi*xi(3))
3541  end function sll_f_spherical_jac21
3542 
3544  function sll_f_spherical_jac22 ( xi, params )
3545  sll_real64 :: sll_f_spherical_jac22
3546  sll_real64, intent(in) :: xi(3)
3547  sll_real64, dimension(:), intent(in) :: params
3548  sll_real64 :: r1
3549  sll_real64 :: r2
3550  sll_assert(size(params) >= 2)
3551  r1 = params(1)
3552  r2 = params(2)
3553  sll_f_spherical_jac22 = (r1 + (r2-r1)*xi(1))*cos(sll_p_twopi*xi(2))*sin(sll_p_twopi*xi(3))*sll_p_twopi
3554  end function sll_f_spherical_jac22
3555 
3557  function sll_f_spherical_jac23 ( xi, params )
3558  sll_real64 :: sll_f_spherical_jac23
3559  sll_real64, intent(in) :: xi(3)
3560  sll_real64, dimension(:), intent(in) :: params
3561  sll_real64 :: r1
3562  sll_real64 :: r2
3563  sll_assert(size(params) >= 2)
3564  r1 = params(1)
3565  r2 = params(2)
3566  sll_f_spherical_jac23 = (r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(3))*sll_p_twopi
3567  end function sll_f_spherical_jac23
3568 
3570  function sll_f_spherical_jac31 ( xi, params )
3571  sll_real64 :: sll_f_spherical_jac31
3572  sll_real64, intent(in) :: xi(3)
3573  sll_real64, dimension(:), intent(in) :: params
3574  sll_real64 :: r1
3575  sll_real64 :: r2
3576  sll_assert(size(params) >= 2)
3577  r1 = params(1)
3578  r2 = params(2)
3579  sll_f_spherical_jac31 = (r2-r1)*cos(sll_p_twopi*xi(2))
3580  end function sll_f_spherical_jac31
3581 
3583  function sll_f_spherical_jac32 ( xi, params )
3584  sll_real64 :: sll_f_spherical_jac32
3585  sll_real64, intent(in) :: xi(3)
3586  sll_real64, dimension(:), intent(in) :: params
3587  sll_real64 :: r1
3588  sll_real64 :: r2
3589  sll_assert(size(params) >= 2)
3590  r1 = params(1)
3591  r2 = params(2)
3592  sll_f_spherical_jac32 = -(r1 + (r2-r1)*xi(1))*sin(sll_p_twopi*xi(2))*sll_p_twopi
3593  end function sll_f_spherical_jac32
3594 
3596  function sll_f_spherical_jac33 ( xi, params )
3597  sll_real64 :: sll_f_spherical_jac33
3598  sll_real64, intent(in) :: xi(3)
3599  sll_real64, dimension(:), intent(in) :: params
3600  sll_real64 :: r1
3601  sll_real64 :: r2
3602  sll_assert(size(params) >= 2)
3603  r1 = params(1)
3604  r2 = params(2)
3605  sll_f_spherical_jac33 = 0._f64
3606  end function sll_f_spherical_jac33
3607 
3609  function sll_f_spherical_jacinv11 ( xi, params )
3610  sll_real64 :: sll_f_spherical_jacinv11
3611  sll_real64, intent(in) :: xi(3)
3612  sll_real64, dimension(:), intent(in) :: params
3613  sll_real64 :: r1
3614  sll_real64 :: r2
3615  sll_assert(size(params) >= 2)
3616  r1 = params(1)
3617  r2 = params(2)
3618  sll_f_spherical_jacinv11 = sin(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(3))/(r2-r1)
3619  end function sll_f_spherical_jacinv11
3620 
3622  function sll_f_spherical_jacinv12 ( xi, params )
3623  sll_real64 :: sll_f_spherical_jacinv12
3624  sll_real64, intent(in) :: xi(3)
3625  sll_real64, dimension(:), intent(in) :: params
3626  sll_real64 :: r1
3627  sll_real64 :: r2
3628  sll_assert(size(params) >= 2)
3629  r1 = params(1)
3630  r2 = params(2)
3631  sll_f_spherical_jacinv12 = sin(sll_p_twopi*xi(2))*sin(sll_p_twopi*xi(3))/(r2-r1)
3632  end function sll_f_spherical_jacinv12
3633 
3635  function sll_f_spherical_jacinv13 ( xi, params )
3636  sll_real64 :: sll_f_spherical_jacinv13
3637  sll_real64, intent(in) :: xi(3)
3638  sll_real64, dimension(:), intent(in) :: params
3639  sll_real64 :: r1
3640  sll_real64 :: r2
3641  sll_assert(size(params) >= 2)
3642  r1 = params(1)
3643  r2 = params(2)
3644  sll_f_spherical_jacinv13 = cos(sll_p_twopi*xi(2))/(r2-r1)
3645  end function sll_f_spherical_jacinv13
3646 
3648  function sll_f_spherical_jacinv21 ( xi, params )
3649  sll_real64 :: sll_f_spherical_jacinv21
3650  sll_real64, intent(in) :: xi(3)
3651  sll_real64, dimension(:), intent(in) :: params
3652  sll_real64 :: r1
3653  sll_real64 :: r2
3654  sll_assert(size(params) >= 2)
3655  r1 = params(1)
3656  r2 = params(2)
3657  sll_f_spherical_jacinv21 = 1._f64/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))*cos(sll_p_twopi*xi(2))*cos(sll_p_twopi*xi(3))
3658  end function sll_f_spherical_jacinv21
3659 
3661  function sll_f_spherical_jacinv22 ( xi, params )
3662  sll_real64 :: sll_f_spherical_jacinv22
3663  sll_real64, intent(in) :: xi(3)
3664  sll_real64, dimension(:), intent(in) :: params
3665  sll_real64 :: r1
3666  sll_real64 :: r2
3667  sll_assert(size(params) >= 2)
3668  r1 = params(1)
3669  r2 = params(2)
3670  sll_f_spherical_jacinv22 = 1._f64/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))*cos(sll_p_twopi*xi(2))*sin(sll_p_twopi*xi(3))
3671  end function sll_f_spherical_jacinv22
3672 
3674  function sll_f_spherical_jacinv23 ( xi, params )
3675  sll_real64 :: sll_f_spherical_jacinv23
3676  sll_real64, intent(in) :: xi(3)
3677  sll_real64, dimension(:), intent(in) :: params
3678  sll_real64 :: r1
3679  sll_real64 :: r2
3680  sll_assert(size(params) >= 2)
3681  r1 = params(1)
3682  r2 = params(2)
3683  sll_f_spherical_jacinv23 = -1._f64/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))*sin(sll_p_twopi*xi(2))
3684  end function sll_f_spherical_jacinv23
3685 
3687  function sll_f_spherical_jacinv31 ( xi, params )
3688  sll_real64 :: sll_f_spherical_jacinv31
3689  sll_real64, intent(in) :: xi(3)
3690  sll_real64, dimension(:), intent(in) :: params
3691  sll_real64 :: r1
3692  sll_real64 :: r2
3693  sll_assert(size(params) >= 2)
3694  r1 = params(1)
3695  r2 = params(2)
3696  sll_f_spherical_jacinv31 = -1._f64/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))*sin(sll_p_twopi*xi(3))/sin(sll_p_twopi*xi(2))
3697  end function sll_f_spherical_jacinv31
3698 
3700  function sll_f_spherical_jacinv32 ( xi, params )
3701  sll_real64 :: sll_f_spherical_jacinv32
3702  sll_real64, intent(in) :: xi(3)
3703  sll_real64, dimension(:), intent(in) :: params
3704  sll_real64 :: r1
3705  sll_real64 :: r2
3706  sll_assert(size(params) >= 2)
3707  r1 = params(1)
3708  r2 = params(2)
3709  sll_f_spherical_jacinv32 = 1._f64/(sll_p_twopi*(r1 + (r2-r1)*xi(1)))*cos(sll_p_twopi*xi(3))/sin(sll_p_twopi*xi(2))
3710  end function sll_f_spherical_jacinv32
3711 
3713  function sll_f_spherical_jacinv33 ( xi, params )
3714  sll_real64 :: sll_f_spherical_jacinv33
3715  sll_real64, intent(in) :: xi(3)
3716  sll_real64, dimension(:), intent(in) :: params
3717  sll_real64 :: r1
3718  sll_real64 :: r2
3719  sll_assert(size(params) >= 2)
3720  r1 = params(1)
3721  r2 = params(2)
3722  sll_f_spherical_jacinv33 = 0._f64
3723  end function sll_f_spherical_jacinv33
3724 
3726  function sll_f_spherical_jacobian ( xi, params )
3727  sll_real64 :: sll_f_spherical_jacobian
3728  sll_real64, intent(in) :: xi(3)
3729  sll_real64, dimension(:), intent(in) :: params
3730  sll_real64 :: r1
3731  sll_real64 :: r2
3732  sll_assert(size(params) >= 2)
3733  r1 = params(1)
3734  r2 = params(2)
3735  sll_f_spherical_jacobian =(r1 + (r2-r1)*xi(1))**2._f64 *sin(sll_p_twopi*xi(2))*sll_p_twopi**2._f64*(r2-r1)
3736  end function sll_f_spherical_jacobian
3737 
3738 
3739 
3740  ! ***************************************************************************
3741  !
3742  !Identity mapping:
3743  !
3744  ! X1 = xi(1)
3745  ! X2 = xi(2)
3746  ! X3 = xi(3)
3747  ! Where xi(3) are defined in the interval [0,1].
3748  !
3749  ! ***************************************************************************
3750 
3751 
3753  function sll_f_identity_x1( xi, params )
3754  sll_real64 :: sll_f_identity_x1
3755  sll_real64, intent(in) :: xi(3)
3756  sll_real64, dimension(:), intent(in) :: params
3757  sll_f_identity_x1 = xi(1)
3758  end function sll_f_identity_x1
3759 
3761  function sll_f_identity_x2( xi, params )
3762  sll_real64 :: sll_f_identity_x2
3763  sll_real64, intent(in) :: xi(3)
3764  sll_real64, dimension(:), intent(in) :: params
3765  sll_f_identity_x2= xi(2)
3766  end function sll_f_identity_x2
3767 
3769  function sll_f_identity_x3( xi, params )
3770  sll_real64 :: sll_f_identity_x3
3771  sll_real64, intent(in) :: xi(3)
3772  sll_real64, dimension(:), intent(in) :: params
3773  sll_f_identity_x3 = xi(3)
3774  end function sll_f_identity_x3
3775 
3777  function sll_f_identity_xi1( x, params )
3778  sll_real64 :: sll_f_identity_xi1
3779  sll_real64, intent(in) :: x(3)
3780  sll_real64, dimension(:), intent(in) :: params
3781  sll_f_identity_xi1 = x(1)
3782  end function sll_f_identity_xi1
3783 
3785  function sll_f_identity_xi2( x, params )
3786  sll_real64 :: sll_f_identity_xi2
3787  sll_real64, intent(in) :: x(3)
3788  sll_real64, dimension(:), intent(in) :: params
3789  sll_f_identity_xi2= x(2)
3790  end function sll_f_identity_xi2
3791 
3793  function sll_f_identity_xi3( x, params )
3794  sll_real64 :: sll_f_identity_xi3
3795  sll_real64, intent(in) :: x(3)
3796  sll_real64, dimension(:), intent(in) :: params
3797  sll_f_identity_xi3 = x(3)
3798  end function sll_f_identity_xi3
3799 
3801  function sll_f_identity_jac11 ( xi, params )
3802  sll_real64 :: sll_f_identity_jac11
3803  sll_real64, intent(in) :: xi(3)
3804  sll_real64, dimension(:), intent(in) :: params
3805  sll_f_identity_jac11 = 1._f64
3806  end function sll_f_identity_jac11
3807 
3809  function sll_f_identity_jac12 ( xi, params )
3810  sll_real64 :: sll_f_identity_jac12
3811  sll_real64, intent(in) :: xi(3)
3812  sll_real64, dimension(:), intent(in) :: params
3813  sll_f_identity_jac12 = 0._f64
3814  end function sll_f_identity_jac12
3815 
3817  function sll_f_identity_jac13 ( xi, params )
3818  sll_real64 :: sll_f_identity_jac13
3819  sll_real64, intent(in) :: xi(3)
3820  sll_real64, dimension(:), intent(in) :: params
3821  sll_f_identity_jac13 = 0._f64
3822  end function sll_f_identity_jac13
3823 
3825  function sll_f_identity_jac21 ( xi, params )
3826  sll_real64 :: sll_f_identity_jac21
3827  sll_real64, intent(in) :: xi(3)
3828  sll_real64, dimension(:), intent(in) :: params
3829  sll_f_identity_jac21 = 0._f64
3830  end function sll_f_identity_jac21
3831 
3833  function sll_f_identity_jac22 ( xi, params )
3834  sll_real64 :: sll_f_identity_jac22
3835  sll_real64, intent(in) :: xi(3)
3836  sll_real64, dimension(:), intent(in) :: params
3837  sll_f_identity_jac22 = 1._f64
3838  end function sll_f_identity_jac22
3839 
3841  function sll_f_identity_jac23 ( xi, params )
3842  sll_real64 :: sll_f_identity_jac23
3843  sll_real64, intent(in) :: xi(3)
3844  sll_real64, dimension(:), intent(in) :: params
3845  sll_f_identity_jac23 = 0._f64
3846  end function sll_f_identity_jac23
3847 
3849  function sll_f_identity_jac31 ( xi, params )
3850  sll_real64 :: sll_f_identity_jac31
3851  sll_real64, intent(in) :: xi(3)
3852  sll_real64, dimension(:), intent(in) :: params
3853  sll_f_identity_jac31 = 0._f64
3854  end function sll_f_identity_jac31
3855 
3857  function sll_f_identity_jac32 ( xi, params )
3858  sll_real64 :: sll_f_identity_jac32
3859  sll_real64, intent(in) :: xi(3)
3860  sll_real64, dimension(:), intent(in) :: params
3861  sll_f_identity_jac32 = 0._f64
3862  end function sll_f_identity_jac32
3863 
3865  function sll_f_identity_jac33 ( xi, params )
3866  sll_real64 :: sll_f_identity_jac33
3867  sll_real64, intent(in) :: xi(3)
3868  sll_real64, dimension(:), intent(in) :: params
3869  sll_f_identity_jac33 = 1._f64
3870  end function sll_f_identity_jac33
3871 
3872 
3873  ! ***************************************************************************
3874  !
3875  ! Affine coordinate transformation:
3876  !
3877  ! X1 = a1*xi(1)+a2*xi(2)+a3*xi(3)+b1
3878  ! X2 = a4*xi(1)+a5*xi(2)+a6*xi(3)+b2
3879  ! X3 = a7*xi(1)+a8*xi(2)+a9*xi(3)+b3
3880  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
3881  ! contains the information (a1,a2,a3,a4,a5,a,a7,a8,a9,b1,b2,b3).
3882  !
3883  ! ***************************************************************************
3884 
3885 
3887  function sll_f_affine_x1( xi, params )
3888  sll_real64 :: sll_f_affine_x1
3889  sll_real64, intent(in) :: xi(3)
3890  sll_real64, dimension(:), intent(in) :: params
3891  sll_assert(size(params) >= 12)
3892  sll_f_affine_x1 = params(1)*xi(1)+params(2)*xi(2)+params(3)*xi(3)+params(10)
3893  end function sll_f_affine_x1
3894 
3896  function sll_f_affine_x2( xi, params )
3897  sll_real64 :: sll_f_affine_x2
3898  sll_real64, intent(in) :: xi(3)
3899  sll_real64, dimension(:), intent(in) :: params
3900  sll_assert(size(params) >= 12)
3901  sll_f_affine_x2= params(4)*xi(1)+params(5)*xi(2)+params(6)*xi(3)+params(11)
3902  end function sll_f_affine_x2
3903 
3905  function sll_f_affine_x3( xi, params )
3906  sll_real64 :: sll_f_affine_x3
3907  sll_real64, intent(in) :: xi(3)
3908  sll_real64, dimension(:), intent(in) :: params
3909  sll_assert(size(params) >= 12)
3910  sll_f_affine_x3 = params(7)*xi(1)+params(8)*xi(2)+params(9)*xi(3)+params(12)
3911  end function sll_f_affine_x3
3912 
3914  function sll_f_affine_jac11 ( xi, params )
3915  sll_real64 :: sll_f_affine_jac11
3916  sll_real64, intent(in) :: xi(3)
3917  sll_real64, dimension(:), intent(in) :: params
3918  sll_assert(size(params) >= 12)
3919  sll_f_affine_jac11 = params(1)
3920  end function sll_f_affine_jac11
3921 
3923  function sll_f_affine_jac12 ( xi, params )
3924  sll_real64 :: sll_f_affine_jac12
3925  sll_real64, intent(in) :: xi(3)
3926  sll_real64, dimension(:), intent(in) :: params
3927  sll_assert(size(params) >= 12)
3928  sll_f_affine_jac12 = params(2)
3929  end function sll_f_affine_jac12
3930 
3932  function sll_f_affine_jac13 ( xi, params )
3933  sll_real64 :: sll_f_affine_jac13
3934  sll_real64, intent(in) :: xi(3)
3935  sll_real64, dimension(:), intent(in) :: params
3936  sll_assert(size(params) >= 12)
3937  sll_f_affine_jac13 = params(3)
3938  end function sll_f_affine_jac13
3939 
3941  function sll_f_affine_jac21 ( xi, params )
3942  sll_real64 :: sll_f_affine_jac21
3943  sll_real64, intent(in) :: xi(3)
3944  sll_real64, dimension(:), intent(in) :: params
3945  sll_assert(size(params) >= 12)
3946  sll_f_affine_jac21 = params(4)
3947  end function sll_f_affine_jac21
3948 
3950  function sll_f_affine_jac22 ( xi, params )
3951  sll_real64 :: sll_f_affine_jac22
3952  sll_real64, intent(in) :: xi(3)
3953  sll_real64, dimension(:), intent(in) :: params
3954  sll_assert(size(params) >= 12)
3955  sll_f_affine_jac22 = params(5)
3956  end function sll_f_affine_jac22
3957 
3959  function sll_f_affine_jac23 ( xi, params )
3960  sll_real64 :: sll_f_affine_jac23
3961  sll_real64, intent(in) :: xi(3)
3962  sll_real64, dimension(:), intent(in) :: params
3963  sll_assert(size(params) >= 12)
3964  sll_f_affine_jac23 = params(6)
3965  end function sll_f_affine_jac23
3966 
3968  function sll_f_affine_jac31 ( xi, params )
3969  sll_real64 :: sll_f_affine_jac31
3970  sll_real64, intent(in) :: xi(3)
3971  sll_real64, dimension(:), intent(in) :: params
3972  sll_assert(size(params) >= 12)
3973  sll_f_affine_jac31 = params(7)
3974  end function sll_f_affine_jac31
3975 
3977  function sll_f_affine_jac32 ( xi, params )
3978  sll_real64 :: sll_f_affine_jac32
3979  sll_real64, intent(in) :: xi(3)
3980  sll_real64, dimension(:), intent(in) :: params
3981  sll_f_affine_jac32 = params(8)
3982  end function sll_f_affine_jac32
3983 
3985  function sll_f_affine_jac33 ( xi, params )
3986  sll_real64 :: sll_f_affine_jac33
3987  sll_real64, intent(in) :: xi(3)
3988  sll_real64, dimension(:), intent(in) :: params
3989  sll_assert(size(params) >= 12)
3990  sll_f_affine_jac33 = params(9)
3991  end function sll_f_affine_jac33
3992 
3993 
3994  ! ***************************************************************************
3995  !
3996  ! Scaling coordinate transformation:
3997  !
3998  ! X1 = a1*xi(1)+b1
3999  ! X2 = a2*xi(2)+b2
4000  ! X3 = a3*xi(3)+b3
4001  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
4002  ! contains the information (a1,a2,a3,b1,b2,b3).
4003  !
4004  ! ***************************************************************************
4005 
4006 
4008  function sll_f_scaling_x1( xi, params )
4009  sll_real64 :: sll_f_scaling_x1
4010  sll_real64, intent(in) :: xi(3)
4011  sll_real64, dimension(:), intent(in) :: params
4012  sll_assert(size(params) >= 6)
4013  sll_f_scaling_x1 = params(1)*xi(1)+params(4)
4014  end function sll_f_scaling_x1
4015 
4017  function sll_f_scaling_x2( xi, params )
4018  sll_real64 :: sll_f_scaling_x2
4019  sll_real64, intent(in) :: xi(3)
4020  sll_real64, dimension(:), intent(in) :: params
4021  sll_assert(size(params) >= 6)
4022  sll_f_scaling_x2= params(2)*xi(2)+params(5)
4023  end function sll_f_scaling_x2
4024 
4026  function sll_f_scaling_x3( xi, params )
4027  sll_real64 :: sll_f_scaling_x3
4028  sll_real64, intent(in) :: xi(3)
4029  sll_real64, dimension(:), intent(in) :: params
4030  sll_assert(size(params) >= 6)
4031  sll_f_scaling_x3 = params(3)*xi(3)+params(6)
4032  end function sll_f_scaling_x3
4033 
4035  function sll_f_scaling_xi1( x, params )
4036  sll_real64 :: sll_f_scaling_xi1
4037  sll_real64, intent(in) :: x(3)
4038  sll_real64, dimension(:), intent(in) :: params
4039  sll_assert(size(params) >= 6)
4040  sll_f_scaling_xi1 = (x(1)-params(4))/params(1)
4041  end function sll_f_scaling_xi1
4042 
4044  function sll_f_scaling_xi2( x, params )
4045  sll_real64 :: sll_f_scaling_xi2
4046  sll_real64, intent(in) :: x(3)
4047  sll_real64, dimension(:), intent(in) :: params
4048  sll_assert(size(params) >= 6)
4049  sll_f_scaling_xi2 = (x(2)-params(5))/params(2)
4050  end function sll_f_scaling_xi2
4051 
4053  function sll_f_scaling_xi3( x, params )
4054  sll_real64 :: sll_f_scaling_xi3
4055  sll_real64, intent(in) :: x(3)
4056  sll_real64, dimension(:), intent(in) :: params
4057  sll_assert(size(params) >= 6)
4058  sll_f_scaling_xi3 = (x(3)-params(6))/params(3)
4059  end function sll_f_scaling_xi3
4060 
4062  function sll_f_scaling_jac11 ( xi, params )
4063  sll_real64 :: sll_f_scaling_jac11
4064  sll_real64, intent(in) :: xi(3)
4065  sll_real64, dimension(:), intent(in) :: params
4066  sll_assert(size(params) >= 6)
4067  sll_f_scaling_jac11 = params(1)
4068  end function sll_f_scaling_jac11
4069 
4071  function sll_f_scaling_jac12 ( xi, params )
4072  sll_real64 :: sll_f_scaling_jac12
4073  sll_real64, intent(in) :: xi(3)
4074  sll_real64, dimension(:), intent(in) :: params
4075  sll_assert(size(params) >= 6)
4076  sll_f_scaling_jac12 = 0._f64
4077  end function sll_f_scaling_jac12
4078 
4080  function sll_f_scaling_jac13 ( xi, params )
4081  sll_real64 :: sll_f_scaling_jac13
4082  sll_real64, intent(in) :: xi(3)
4083  sll_real64, dimension(:), intent(in) :: params
4084  sll_assert(size(params) >= 6)
4085  sll_f_scaling_jac13 = 0._f64
4086  end function sll_f_scaling_jac13
4087 
4089  function sll_f_scaling_jac21 ( xi, params )
4090  sll_real64 :: sll_f_scaling_jac21
4091  sll_real64, intent(in) :: xi(3)
4092  sll_real64, dimension(:), intent(in) :: params
4093  sll_assert(size(params) >= 6)
4094  sll_f_scaling_jac21 = 0._f64
4095  end function sll_f_scaling_jac21
4096 
4098  function sll_f_scaling_jac22 ( xi, params )
4099  sll_real64 :: sll_f_scaling_jac22
4100  sll_real64, intent(in) :: xi(3)
4101  sll_real64, dimension(:), intent(in) :: params
4102  sll_assert(size(params) >= 6)
4103  sll_f_scaling_jac22 = params(2)
4104  end function sll_f_scaling_jac22
4105 
4107  function sll_f_scaling_jac23 ( xi, params )
4108  sll_real64 :: sll_f_scaling_jac23
4109  sll_real64, intent(in) :: xi(3)
4110  sll_real64, dimension(:), intent(in) :: params
4111  sll_assert(size(params) >= 6)
4112  sll_f_scaling_jac23 = 0._f64
4113  end function sll_f_scaling_jac23
4114 
4116  function sll_f_scaling_jac31 ( xi, params )
4117  sll_real64 :: sll_f_scaling_jac31
4118  sll_real64, intent(in) :: xi(3)
4119  sll_real64, dimension(:), intent(in) :: params
4120  sll_assert(size(params) >= 6)
4121  sll_f_scaling_jac31 = 0._f64
4122  end function sll_f_scaling_jac31
4123 
4125  function sll_f_scaling_jac32 ( xi, params )
4126  sll_real64 :: sll_f_scaling_jac32
4127  sll_real64, intent(in) :: xi(3)
4128  sll_real64, dimension(:), intent(in) :: params
4129  sll_assert(size(params) >= 6)
4130  sll_f_scaling_jac32 = 0._f64
4131  end function sll_f_scaling_jac32
4132 
4134  function sll_f_scaling_jac33 ( xi, params )
4135  sll_real64 :: sll_f_scaling_jac33
4136  sll_real64, intent(in) :: xi(3)
4137  sll_real64, dimension(:), intent(in) :: params
4138  sll_assert(size(params) >= 6)
4139  sll_f_scaling_jac33 = params(3)
4140  end function sll_f_scaling_jac33
4141 
4143  function sll_f_scaling_jacinv11 ( xi, params )
4144  sll_real64 :: sll_f_scaling_jacinv11
4145  sll_real64, intent(in) :: xi(3)
4146  sll_real64, dimension(:), intent(in) :: params
4147  sll_assert(size(params) >= 6)
4148  sll_f_scaling_jacinv11 = 1._f64/params(1)
4149  end function sll_f_scaling_jacinv11
4150 
4152  function sll_f_scaling_jacinv12 ( xi, params )
4153  sll_real64 :: sll_f_scaling_jacinv12
4154  sll_real64, intent(in) :: xi(3)
4155  sll_real64, dimension(:), intent(in) :: params
4156  sll_assert(size(params) >= 6)
4157  sll_f_scaling_jacinv12 = 0._f64
4158  end function sll_f_scaling_jacinv12
4159 
4161  function sll_f_scaling_jacinv13 ( xi, params )
4162  sll_real64 :: sll_f_scaling_jacinv13
4163  sll_real64, intent(in) :: xi(3)
4164  sll_real64, dimension(:), intent(in) :: params
4165  sll_assert(size(params) >= 6)
4166  sll_f_scaling_jacinv13 = 0._f64
4167  end function sll_f_scaling_jacinv13
4168 
4170  function sll_f_scaling_jacinv21 ( xi, params )
4171  sll_real64 :: sll_f_scaling_jacinv21
4172  sll_real64, intent(in) :: xi(3)
4173  sll_real64, dimension(:), intent(in) :: params
4174  sll_assert(size(params) >= 6)
4175  sll_f_scaling_jacinv21 = 0._f64
4176  end function sll_f_scaling_jacinv21
4177 
4179  function sll_f_scaling_jacinv22 ( xi, params )
4180  sll_real64 :: sll_f_scaling_jacinv22
4181  sll_real64, intent(in) :: xi(3)
4182  sll_real64, dimension(:), intent(in) :: params
4183  sll_assert(size(params) >= 6)
4184  sll_f_scaling_jacinv22 = 1._f64/params(2)
4185  end function sll_f_scaling_jacinv22
4186 
4188  function sll_f_scaling_jacinv23 ( xi, params )
4189  sll_real64 :: sll_f_scaling_jacinv23
4190  sll_real64, intent(in) :: xi(3)
4191  sll_real64, dimension(:), intent(in) :: params
4192  sll_assert(size(params) >= 6)
4193  sll_f_scaling_jacinv23 = 0._f64
4194  end function sll_f_scaling_jacinv23
4195 
4197  function sll_f_scaling_jacinv31 ( xi, params )
4198  sll_real64 :: sll_f_scaling_jacinv31
4199  sll_real64, intent(in) :: xi(3)
4200  sll_real64, dimension(:), intent(in) :: params
4201  sll_assert(size(params) >= 6)
4202  sll_f_scaling_jacinv31 = 0._f64
4203  end function sll_f_scaling_jacinv31
4204 
4206  function sll_f_scaling_jacinv32 ( xi, params )
4207  sll_real64 :: sll_f_scaling_jacinv32
4208  sll_real64, intent(in) :: xi(3)
4209  sll_real64, dimension(:), intent(in) :: params
4210  sll_assert(size(params) >= 6)
4211  sll_f_scaling_jacinv32 = 0._f64
4212  end function sll_f_scaling_jacinv32
4213 
4215  function sll_f_scaling_jacinv33 ( xi, params )
4216  sll_real64 :: sll_f_scaling_jacinv33
4217  sll_real64, intent(in) :: xi(3)
4218  sll_real64, dimension(:), intent(in) :: params
4219  sll_assert(size(params) >= 6)
4220  sll_f_scaling_jacinv33 = 1._f64/params(3)
4221  end function sll_f_scaling_jacinv33
4222 
4224  function sll_f_scaling_jacobian ( xi, params )
4225  sll_real64 :: sll_f_scaling_jacobian
4226  sll_real64, intent(in) :: xi(3)
4227  sll_real64, dimension(:), intent(in) :: params
4228  sll_assert(size(params) >= 6)
4229  sll_f_scaling_jacobian = params(1)*params(2)*params(3)
4230  end function sll_f_scaling_jacobian
4231 
4232 
4233  ! ***************************************************************************
4234  !
4235  ! Periodic coordinate transformation:
4236  !
4237  ! X1 = L1*xi(1)
4238  ! X2 = L2*xi(2)+alpha*sin(2*\pi*xi(1))
4239  ! X3 = L3*xi(3)
4240  ! Where xi(3) are defined in the interval [0,1]. The 'params' array
4241  ! contains the information (L1,L2,L3,alpha).
4242  !
4243  ! ***************************************************************************
4244 
4245 
4247  function sll_f_periodic_x1( xi, params )
4248  sll_real64 :: sll_f_periodic_x1
4249  sll_real64, intent(in) :: xi(3)
4250  sll_real64, dimension(:), intent(in) :: params
4251  sll_assert(size(params) >= 4)
4252  sll_f_periodic_x1 = modulo(params(1)*xi(1), params(1))
4253  end function sll_f_periodic_x1
4254 
4256  function sll_f_periodic_x2( xi, params )
4257  sll_real64 :: sll_f_periodic_x2
4258  sll_real64, intent(in) :: xi(3)
4259  sll_real64, dimension(:), intent(in) :: params
4260  sll_assert(size(params) >= 4)
4261  sll_f_periodic_x2= modulo(params(2)*xi(2)+params(4)*sin(sll_p_twopi*xi(1)),params(2))
4262  end function sll_f_periodic_x2
4263 
4265  function sll_f_periodic_x3( xi, params )
4266  sll_real64 :: sll_f_periodic_x3
4267  sll_real64, intent(in) :: xi(3)
4268  sll_real64, dimension(:), intent(in) :: params
4269  sll_assert(size(params) >= 4)
4270  sll_f_periodic_x3 = modulo(params(3)*xi(3), params(3))
4271  end function sll_f_periodic_x3
4272 
4274  function sll_f_periodic_jac11 ( xi, params )
4275  sll_real64 :: sll_f_periodic_jac11
4276  sll_real64, intent(in) :: xi(3)
4277  sll_real64, dimension(:), intent(in) :: params
4278  sll_assert(size(params) >= 4)
4279  sll_f_periodic_jac11 = params(1)
4280  end function sll_f_periodic_jac11
4281 
4283  function sll_f_periodic_jac12 ( xi, params )
4284  sll_real64 :: sll_f_periodic_jac12
4285  sll_real64, intent(in) :: xi(3)
4286  sll_real64, dimension(:), intent(in) :: params
4287  sll_assert(size(params) >= 4)
4288  sll_f_periodic_jac12 = 0._f64
4289  end function sll_f_periodic_jac12
4290 
4292  function sll_f_periodic_jac13 ( xi, params )
4293  sll_real64 :: sll_f_periodic_jac13
4294  sll_real64, intent(in) :: xi(3)
4295  sll_real64, dimension(:), intent(in) :: params
4296  sll_assert(size(params) >= 4)
4297  sll_f_periodic_jac13 = 0._f64
4298  end function sll_f_periodic_jac13
4299 
4301  function sll_f_periodic_jac21 ( xi, params )
4302  sll_real64 :: sll_f_periodic_jac21
4303  sll_real64, intent(in) :: xi(3)
4304  sll_real64, dimension(:), intent(in) :: params
4305  sll_assert(size(params) >= 4)
4306  sll_f_periodic_jac21 = params(4)*sll_p_twopi*cos(sll_p_twopi*xi(1))
4307  end function sll_f_periodic_jac21
4308 
4310  function sll_f_periodic_jac22 ( xi, params )
4311  sll_real64 :: sll_f_periodic_jac22
4312  sll_real64, intent(in) :: xi(3)
4313  sll_real64, dimension(:), intent(in) :: params
4314  sll_assert(size(params) >= 4)
4315  sll_f_periodic_jac22 = params(2)
4316  end function sll_f_periodic_jac22
4317 
4319  function sll_f_periodic_jac23 ( xi, params )
4320  sll_real64 :: sll_f_periodic_jac23
4321  sll_real64, intent(in) :: xi(3)
4322  sll_real64, dimension(:), intent(in) :: params
4323  sll_assert(size(params) >= 4)
4324  sll_f_periodic_jac23 = 0._f64
4325  end function sll_f_periodic_jac23
4326 
4328  function sll_f_periodic_jac31 ( xi, params )
4329  sll_real64 :: sll_f_periodic_jac31
4330  sll_real64, intent(in) :: xi(3)
4331  sll_real64, dimension(:), intent(in) :: params
4332  sll_assert(size(params) >= 4)
4333  sll_f_periodic_jac31 = 0._f64
4334  end function sll_f_periodic_jac31
4335 
4337  function sll_f_periodic_jac32 ( xi, params )
4338  sll_real64 :: sll_f_periodic_jac32
4339  sll_real64, intent(in) :: xi(3)
4340  sll_real64, dimension(:), intent(in) :: params
4341  sll_assert(size(params) >= 4)
4342  sll_f_periodic_jac32 = 0._f64
4343  end function sll_f_periodic_jac32
4344 
4346  function sll_f_periodic_jac33 ( xi, params )
4347  sll_real64 :: sll_f_periodic_jac33
4348  sll_real64, intent(in) :: xi(3)
4349  sll_real64, dimension(:), intent(in) :: params
4350  sll_assert(size(params) >= 4)
4351  sll_f_periodic_jac33 = params(3)
4352  end function sll_f_periodic_jac33
4353 
4355  function sll_f_periodic_jacinv11 ( xi, params )
4356  sll_real64 :: sll_f_periodic_jacinv11
4357  sll_real64, intent(in) :: xi(3)
4358  sll_real64, dimension(:), intent(in) :: params
4359  sll_assert(size(params) >= 4)
4360  sll_f_periodic_jacinv11 = 1._f64/params(1)
4361  end function sll_f_periodic_jacinv11
4362 
4364  function sll_f_periodic_jacinv12 ( xi, params )
4365  sll_real64 :: sll_f_periodic_jacinv12
4366  sll_real64, intent(in) :: xi(3)
4367  sll_real64, dimension(:), intent(in) :: params
4368  sll_assert(size(params) >= 4)
4369  sll_f_periodic_jacinv12 = 0._f64
4370  end function sll_f_periodic_jacinv12
4371 
4373  function sll_f_periodic_jacinv13 ( xi, params )
4374  sll_real64 :: sll_f_periodic_jacinv13
4375  sll_real64, intent(in) :: xi(3)
4376  sll_real64, dimension(:), intent(in) :: params
4377  sll_assert(size(params) >= 4)
4378  sll_f_periodic_jacinv13 = 0._f64
4379  end function sll_f_periodic_jacinv13
4380 
4382  function sll_f_periodic_jacinv21 ( xi, params )
4383  sll_real64 :: sll_f_periodic_jacinv21
4384  sll_real64, intent(in) :: xi(3)
4385  sll_real64, dimension(:), intent(in) :: params
4386  sll_assert(size(params) >= 4)
4387  sll_f_periodic_jacinv21 = - params(4)*sll_p_twopi*cos(sll_p_twopi*xi(1))/params(1)
4388  end function sll_f_periodic_jacinv21
4389 
4391  function sll_f_periodic_jacinv22 ( xi, params )
4392  sll_real64 :: sll_f_periodic_jacinv22
4393  sll_real64, intent(in) :: xi(3)
4394  sll_real64, dimension(:), intent(in) :: params
4395  sll_assert(size(params) >= 4)
4396  sll_f_periodic_jacinv22 = 1._f64/params(2)
4397  end function sll_f_periodic_jacinv22
4398 
4400  function sll_f_periodic_jacinv23 ( xi, params )
4401  sll_real64 :: sll_f_periodic_jacinv23
4402  sll_real64, intent(in) :: xi(3)
4403  sll_real64, dimension(:), intent(in) :: params
4404  sll_assert(size(params) >= 4)
4405  sll_f_periodic_jacinv23 = 0._f64
4406  end function sll_f_periodic_jacinv23
4407 
4409  function sll_f_periodic_jacinv31 ( xi, params )
4410  sll_real64 :: sll_f_periodic_jacinv31
4411  sll_real64, intent(in) :: xi(3)
4412  sll_real64, dimension(:), intent(in) :: params
4413  sll_assert(size(params) >= 4)
4414  sll_f_periodic_jacinv31 = 0._f64
4415  end function sll_f_periodic_jacinv31
4416 
4418  function sll_f_periodic_jacinv32 ( xi, params )
4419  sll_real64 :: sll_f_periodic_jacinv32
4420  sll_real64, intent(in) :: xi(3)
4421  sll_real64, dimension(:), intent(in) :: params
4422  sll_assert(size(params) >= 4)
4423  sll_f_periodic_jacinv32 = 0._f64
4424  end function sll_f_periodic_jacinv32
4425 
4427  function sll_f_periodic_jacinv33 ( xi, params )
4428  sll_real64 :: sll_f_periodic_jacinv33
4429  sll_real64, intent(in) :: xi(3)
4430  sll_real64, dimension(:), intent(in) :: params
4431  sll_assert(size(params) >= 4)
4432  sll_f_periodic_jacinv33 = 1._f64/params(3)
4433  end function sll_f_periodic_jacinv33
4434 
4436  function sll_f_periodic_jacobian ( xi, params )
4437  sll_real64 :: sll_f_periodic_jacobian
4438  sll_real64, intent(in) :: xi(3)
4439  sll_real64, dimension(:), intent(in) :: params
4440  sll_assert(size(params) >= 4)
4441  sll_f_periodic_jacobian = params(1)*params(2)*params(3)
4442  end function sll_f_periodic_jacobian
4443 
4444 
4445 
4446 
4447 
4448 
definition of analytical coordinate transformations and their jacobi matrix, inverse jacobi matrix an...
real(kind=f64) function, public sll_f_periodic_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_polynomial_jac11(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_toroidal_cylinder_x2(xi, params)
direct mapping
real(kind=f64) function sll_f_rotation_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_parallelogram_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colella_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac32(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_affine_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_polynomial_jacobian(xi, params)
jacobian
real(kind=f64) function sll_f_rotation_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_periodic_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_polynomial_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_x3(xi, params)
direct mapping
real(kind=f64) function sll_f_rotation_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_orthogonal_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotated_singular_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_periodic_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_orthogonal_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_spherical_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac12(xi, params)
jacobian matrix
real(kind=f64) function sll_f_polynomial_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_toroidal_cylinder_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_rotated_singular_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_periodic_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_parallelogram_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_spherical_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_identity_jac32(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_orthogonal_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_colella_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotation_jac22(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_scaling_xi3(x, params)
direct mapping
real(kind=f64) function, public sll_f_parallelogram_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colella_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_parallelogram_x3(xi, params)
direct mapping
real(kind=f64) function sll_f_cylindrical_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_cylindrical_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_scaling_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv22(xi, params)
pseudoinvobian matrix
real(kind=f64) function sll_f_orthogonal_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_parallelogram_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_jac31(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_orthogonal_jac32(xi, params)
jacobian matrix
real(kind=f64) function sll_f_cylindrical_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_polynomial_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_parallelogram_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_orthogonal_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_polynomial_jac33(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_cylindrical_sqrt_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotation_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_orthogonal_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colella_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_orthogonal_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_xi2(x, params)
direct mapping
real(kind=f64) function, public sll_f_polynomial_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_toroidal_cylinder_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv13(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_scaling_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colella_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_orthogonal_x1(xi, params)
direct mapping
real(kind=f64) function sll_f_polynomial_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_affine_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_orthogonal_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_scaling_jac21(xi, params)
jacobian matrix
real(kind=f64) function sll_f_colella_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv32(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_orthogonal_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_affine_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_affine_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colella_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_polynomial_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_identity_jac31(xi, params)
jacobian matrix
real(kind=f64) function sll_f_rotation_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_rotation_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_affine_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv31(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv12(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_cylindrical_xi2(x, params)
direct mapping
real(kind=f64) function, public sll_f_periodic_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_periodic_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_spherical_jac11(xi, params)
jacobian matrix
real(kind=f64) function sll_f_polynomial_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_scaling_xi1(x, params)
direct mapping
real(kind=f64) function, public sll_f_parallelogram_jac33(xi, params)
jacobian matrix
real(kind=f64) function sll_f_orthogonal_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_polynomial_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_polynomial_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv33(xi, params)
pseudoinvobian matrix
real(kind=f64) function sll_f_cylindrical_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_rotation_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_colella_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_xi1(x, params)
direct mapping
real(kind=f64) function, public sll_f_dshaped_singular_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_jac33(xi, params)
jacobian matrix
real(kind=f64) function sll_f_polynomial_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_cylindrical_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_affine_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_polynomial_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_cylindrical_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_jacobian(xi, params)
jacobian
real(kind=f64) function sll_f_cylindrical_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_colella_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_toroidal_cylinder_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_orthogonal_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_rotation_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_toroidal_cylinder_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_parallelogram_jac13(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv21(xi, params)
pseudoinvobian matrix
real(kind=f64) function sll_f_spherical_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_cylindrical_x3(xi, params)
direct mapping
real(kind=f64) function sll_f_scaling_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_colella_jac32(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_spherical_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_identity_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_jac13(xi, params)
jacobian matrix
real(kind=f64) function sll_f_polynomial_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_colella_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_orthogonal_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv21(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac22(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotation_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_polynomial_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_periodic_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_polynomial_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_spherical_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_spherical_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_x3(xi, params)
direct mapping
real(kind=f64) function sll_f_cylindrical_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv13(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_affine_jac13(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_identity_xi3(x, params)
inverse mapping
real(kind=f64) function sll_f_periodic_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_spherical_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_jac32(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_periodic_jac22(xi, params)
jacobian matrix
real(kind=f64) function sll_f_colella_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv12(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_orthogonal_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_dshaped_singular_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_affine_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotated_singular_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_polynomial_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_xi2(x, params)
inverse mapping
real(kind=f64) function, public sll_f_parallelogram_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_scaling_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_cylindrical_sqrt_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac32(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac21(xi, params)
jacobian matrix
real(kind=f64) function sll_f_cylindrical_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_periodic_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotated_singular_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_dshaped_singular_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_polynomial_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colella_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac31(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv23(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_scaling_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_parallelogram_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_orthogonal_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_polynomial_jac13(xi, params)
jacobian matrix
real(kind=f64) function sll_f_orthogonal_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_periodic_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_parallelogram_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_xi1(x, params)
direct mapping
real(kind=f64) function, public sll_f_elliptical_jac11(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_identity_x2(xi, params)
direct mapping
real(kind=f64) function sll_f_orthogonal_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotation_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_parallelogram_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_rotation_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colbound_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_dshaped_singular_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_colella_jacinv22(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_elliptical_jac21(xi, params)
jacobian matrix
real(kind=f64) function sll_f_rotation_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_colella_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv22(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv23(xi, params)
pseudoinvobian matrix
real(kind=f64) function sll_f_cylindrical_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv33(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_xi2(x, params)
direct mapping
real(kind=f64) function, public sll_f_affine_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_periodic_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_spherical_jac13(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_periodic_jac21(xi, params)
jacobian matrix
real(kind=f64) function sll_f_orthogonal_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_rotated_singular_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_xi1(x, params)
inverse mapping
real(kind=f64) function, public sll_f_parallelogram_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_elliptical_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colbound_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv31(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_affine_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_cylindrical_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv32(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_affine_jac31(xi, params)
jacobian matrix
real(kind=f64) function sll_f_rotation_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_colella_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colella_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_scaling_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_pseudoinv32(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_identity_jac23(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_xi3(x, params)
direct mapping
real(kind=f64) function, public sll_f_cylindrical_x2(xi, params)
direct mapping
real(kind=f64) function sll_f_cylindrical_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_orthogonal_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_spherical_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colbound_jac31(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_jac23(xi, params)
jacobian matrix
real(kind=f64) function sll_f_orthogonal_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_periodic_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_dshaped_singular_x3(xi, params)
direct mapping
real(kind=f64) function sll_f_colella_jacinv13(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_spherical_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_spherical_x2(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colella_jac33(xi, params)
jacobian matrix
real(kind=f64) function sll_f_periodic_jacinv31(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_affine_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_spherical_x3(xi, params)
direct mapping
real(kind=f64) function sll_f_cylindrical_jacinv12(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_colella_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_polynomial_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_spherical_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_dshaped_singular_pseudoinv23(xi, params)
pseudoinvobian matrix
real(kind=f64) function, public sll_f_toroidal_cylinder_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotation_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jac22(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_identity_jac12(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_scaling_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_rotated_singular_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_cylindrical_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colella_x3(xi, params)
direct mapping
real(kind=f64) function, public sll_f_colbound_jac13(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_polynomial_jac21(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_sqrt_x1(xi, params)
direct mapping
real(kind=f64) function, public sll_f_rotation_jac11(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_periodic_jac11(xi, params)
jacobian matrix
real(kind=f64) function sll_f_colella_jacinv11(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_cylindrical_jac33(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_colbound_jac32(xi, params)
jacobian matrix
real(kind=f64) function, public sll_f_cylindrical_xi3(x, params)
direct mapping
real(kind=f64) function, public sll_f_toroidal_cylinder_jac22(xi, params)
jacobian matrix
real(kind=f64) function sll_f_spherical_jacinv21(xi, params)
jacobian matrix inverse
real(kind=f64) function, public sll_f_spherical_jacobian(xi, params)
jacobian
real(kind=f64) function, public sll_f_scaling_jac22(xi, params)
jacobian matrix
real(kind=f64) function sll_f_scaling_jacinv33(xi, params)
jacobian matrix inverse
real(kind=f64) function sll_f_orthogonal_jacinv11(xi, params)
jacobian matrix inverse
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
real(kind=f64), parameter, public sll_p_twopi
    Report Typos and Errors