aboutsummaryrefslogtreecommitdiff
path: root/src/Coefficients_6_3_min_err_coeff.F90
diff options
context:
space:
mode:
Diffstat (limited to 'src/Coefficients_6_3_min_err_coeff.F90')
-rw-r--r--src/Coefficients_6_3_min_err_coeff.F90106
1 files changed, 106 insertions, 0 deletions
diff --git a/src/Coefficients_6_3_min_err_coeff.F90 b/src/Coefficients_6_3_min_err_coeff.F90
index c0eef1e..04d4e4f 100644
--- a/src/Coefficients_6_3_min_err_coeff.F90
+++ b/src/Coefficients_6_3_min_err_coeff.F90
@@ -215,3 +215,109 @@ subroutine set_coeff_up_6_3_opt ( nsize, dir, loc_order, bb, gsize, imin, imax,
end if
end do
end subroutine set_coeff_up_6_3_opt
+
+subroutine set_coeff_up_6 ( nsize, dir, loc_order, bb, gsize, imin, imax, dd )
+
+ use All_Coeffs_mod
+
+ implicit none
+
+ DECLARE_CCTK_FUNCTIONS
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_INT, intent(IN) :: nsize, dir, loc_order
+ CCTK_INT, dimension(2), intent(IN) :: bb
+ CCTK_INT, intent(IN) :: gsize
+ CCTK_INT, dimension(nsize), intent(OUT) :: imin, imax
+ CCTK_REAL, dimension(nsize,nsize), intent(OUT) :: dd
+
+ CCTK_REAL, dimension(-4:4), save :: a1, a2
+ CCTK_REAL, dimension(5,4), save :: q1, q2
+
+ CCTK_INT :: i, il, ir
+
+ logical, save :: first = .true.
+
+ if ( .not. ( dir == -1 .or. dir == 1 ) ) then
+ call CCTK_WARN(0, 'Internal error: set_coeff_up_2 called with invalid dir value')
+ end if
+
+ if ( first ) then
+ call coeffs_up_6 ( a1, q1, a2, q2 )
+ first = .false.
+ end if
+
+ dd = zero
+ imin = 0
+ imax = -1
+
+ if ( bb(1) == 0 ) then
+ il = 1 + gsize
+ else
+ if ( dir == -1 ) then
+ dd(1,1) = q1(1,1);
+ imin(1) = 1; imax(1) = 1
+
+ dd(1:2,2) = q1(1:2,2);
+ imin(2) = 1; imax(2) = 2
+
+ dd(1:3,3) = q1(1:3,3);
+ imin(3) = 1; imax(3) = 3
+
+ dd(1:5,4) = q1(1:5,4);
+ imin(4) = 1; imax(4) = 5
+ else
+ dd(1,1) = q2(1,1);
+ imin(1) = 1; imax(1) = 1
+
+ dd(1:5,2) = q2(1:5,4);
+ imin(2) = 1; imax(2) = 5
+
+ dd(1:7,3) = a2(-2:4);
+ imin(3) = 1; imax(3) = 7
+
+ dd(2:8,4) = a2(-2:4);
+ imin(4) = 2; imax(4) = 8
+ end if
+ il = 5
+ end if
+ if ( bb(2) == 0 ) then
+ ir = nsize - gsize
+ else
+ if ( dir == -1 ) then
+ dd(nsize,nsize) = q1(1,1)
+ imin(nsize) = nsize; imax(nsize) = nsize
+
+ dd(nsize-4:nsize,nsize-1) = q1(1:5,4)
+ imin(nsize-1) = nsize-4; imax(nsize-1) = nsize
+
+ dd(nsize-6:nsize,nsize-2) = a1(-4:2)
+ imin(nsize-2) = nsize-6; imax(nsize-2) = nsize
+
+ dd(nsize-7:nsize-1,nsize-3) = a1(-4:2)
+ imin(nsize-3) = nsize-7; imax(nsize-3) = nsize-1
+ else
+ dd(nsize,nsize) = q2(1,1)
+ imin(nsize) = nsize; imax(nsize) = nsize
+
+ dd(nsize-1:nsize,nsize-1) = q2(4:5,2)
+ imin(nsize-1) = nsize-1; imax(nsize-1) = nsize
+
+ dd(nsize-2:nsize,nsize-2) = q2(3:5,3)
+ imin(nsize-2) = nsize-2; imax(nsize-2) = nsize
+
+ dd(nsize-4:nsize,nsize-3) = q2(1:5,4)
+ imin(nsize-3) = nsize-4; imax(nsize-3) = nsize
+ end if
+ ir = nsize - 4
+ end if
+ do i = il, ir
+ if ( dir == -1 ) then
+ dd(i-4:i+2,i) = a1(-4:2)
+ imin(i) = i-4; imax(i) = i+2
+ else
+ dd(i-2:i+4,i) = a2(-2:4)
+ imin(i) = i-2; imax(i) = i+4
+ end if
+ end do
+end subroutine set_coeff_up_6