































































































































 


































































































































































 
































































































































































































 



















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



















































































subroutine SBP_DeltaInitial(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,cctk&
  &_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_levo&
  &ff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_ash&
  &3, nmask,sbp_dx,sbp_dy,sbp_dz)

  implicit none

  REAL*8 diss_fraction (3)
  integer, parameter :: cctki_use_diss_fraction = kind(diss_fraction)
  REAL*8 epsdis
  integer, parameter :: cctki_use_epsdis = kind(epsdis)
  REAL*8 h_scaling (3)
  integer, parameter :: cctki_use_h_scaling = kind(h_scaling)
  REAL*8 poison_value
  integer, parameter :: cctki_use_poison_value = kind(poison_value)
  integer*8 dissipation_type
  integer, parameter :: cctki_use_dissipation_type = kind(dissipation_type)
  integer*8 norm_type
  integer, parameter :: cctki_use_norm_type = kind(norm_type)
  integer*8 operator_type
  integer, parameter :: cctki_use_operator_type = kind(operator_type)
  integer*8 vars
  integer, parameter :: cctki_use_vars = kind(vars)
  INTEGER*4 check_grid_sizes
  integer, parameter :: cctki_use_check_grid_sizes = kind(check_grid_sizes)
  INTEGER*4 onesided_interpatch_boundaries
  integer, parameter :: cctki_use_onesided_interpatch_boundaries = kind(onesided_interpatch_boundaries)
  INTEGER*4 onesided_outer_boundaries
  integer, parameter :: cctki_use_onesided_outer_boundaries = kind(onesided_outer_boundaries)
  INTEGER*4 order
  integer, parameter :: cctki_use_order = kind(order)
  INTEGER*4 poison_derivatives
  integer, parameter :: cctki_use_poison_derivatives = kind(poison_derivatives)
  INTEGER*4 poison_dissipation
  integer, parameter :: cctki_use_poison_dissipation = kind(poison_dissipation)
  INTEGER*4 sbp_1st_deriv
  integer, parameter :: cctki_use_sbp_1st_deriv = kind(sbp_1st_deriv)
  INTEGER*4 sbp_2nd_deriv
  integer, parameter :: cctki_use_sbp_2nd_deriv = kind(sbp_2nd_deriv)
  INTEGER*4 sbp_upwind_deriv
  integer, parameter :: cctki_use_sbp_upwind_deriv = kind(sbp_upwind_deriv)
  INTEGER*4 scale_with_h
  integer, parameter :: cctki_use_scale_with_h = kind(scale_with_h)
  INTEGER*4 use_dissipation
  integer, parameter :: cctki_use_use_dissipation = kind(use_dissipation)
  INTEGER*4 use_shiftout
  integer, parameter :: cctki_use_use_shiftout = kind(use_shiftout)
  INTEGER*4 use_variable_deltas
  integer, parameter :: cctki_use_use_variable_deltas = kind(use_variable_deltas)
  INTEGER*4 zero_derivs_y
  integer, parameter :: cctki_use_zero_derivs_y = kind(zero_derivs_y)
  INTEGER*4 zero_derivs_z
  integer, parameter :: cctki_use_zero_derivs_z = kind(zero_derivs_z)
  COMMON /SummationByPartsrest/diss_fraction, epsdis, h_scaling, poison_value, dissipation_type, norm_type, operator_type, vars, ch&
  &eck_grid_sizes, onesided_interpatch_boundaries, onesided_outer_boundaries, order, poison_derivatives, poison_dissipation, sbp_1s&
  &t_deriv, sbp_2nd_deriv, sbp_upwind_deriv, scale_with_h, use_dissipation, use_shiftout, use_variable_deltas, zero_derivs_y, zero_&
  &derivs_z

  INTEGER cctk_dim
  integer, parameter :: cctki_use_cctk_dim = kind(cctk_dim)
  INTEGER cctk_gsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_gsh = kind(cctk_gsh)
  INTEGER cctk_lsh (cctk_dim)
  integer, parameter :: cctki_use_cctk_lsh = kind(cctk_lsh)
  INTEGER cctk_lbnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_lbnd = kind(cctk_lbnd)
  INTEGER cctk_ubnd (cctk_dim)
  integer, parameter :: cctki_use_cctk_ubnd = kind(cctk_ubnd)
  INTEGER cctk_tile_min (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_min = kind(cctk_tile_min)
  INTEGER cctk_tile_max (cctk_dim)
  integer, parameter :: cctki_use_cctk_tile_max = kind(cctk_tile_max)
  INTEGER cctk_ash (cctk_dim)
  integer, parameter :: cctki_use_cctk_ash = kind(cctk_ash)
  INTEGER cctk_alignment
  integer, parameter :: cctki_use_cctk_alignment = kind(cctk_alignment)
  INTEGER cctk_alignment_offset
  integer, parameter :: cctki_use_cctk_alignment_offset = kind(cctk_alignment_offset)
  INTEGER cctk_from (cctk_dim)
  integer, parameter :: cctki_use_cctk_from = kind(cctk_from)
  INTEGER cctk_to (cctk_dim)
  integer, parameter :: cctki_use_cctk_to = kind(cctk_to)
  INTEGER cctk_bbox (2*cctk_dim)
  integer, parameter :: cctki_use_cctk_bbox = kind(cctk_bbox)
  REAL*8 cctk_delta_time
  integer, parameter :: cctki_use_cctk_delta_time = kind(cctk_delta_time)
  REAL*8 cctk_time
  integer, parameter :: cctki_use_cctk_time = kind(cctk_time)
  REAL*8 cctk_delta_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_delta_space = kind(cctk_delta_space)
  REAL*8 cctk_origin_space (cctk_dim)
  integer, parameter :: cctki_use_cctk_origin_space = kind(cctk_origin_space)
  INTEGER cctk_levfac (cctk_dim)
  integer, parameter :: cctki_use_cctk_levfac = kind(cctk_levfac)
  INTEGER cctk_levoff (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoff = kind(cctk_levoff)
  INTEGER cctk_levoffdenom (cctk_dim)
  integer, parameter :: cctki_use_cctk_levoffdenom = kind(cctk_levoffdenom)
  INTEGER cctk_timefac
  integer, parameter :: cctki_use_cctk_timefac = kind(cctk_timefac)
  INTEGER cctk_convlevel
  integer, parameter :: cctki_use_cctk_convlevel = kind(cctk_convlevel)
  INTEGER cctk_convfac
  integer, parameter :: cctki_use_cctk_convfac = kind(cctk_convfac)
  INTEGER cctk_nghostzones (cctk_dim)
  integer, parameter :: cctki_use_cctk_nghostzones = kind(cctk_nghostzones)
  INTEGER cctk_iteration
  integer, parameter :: cctki_use_cctk_iteration = kind(cctk_iteration)
  integer*8 cctkGH
  integer, parameter :: cctki_use_cctkGH = kind(cctkGH)
  INTEGER cctk_ash1
  integer, parameter :: cctki_use_cctk_ash1 = kind(cctk_ash1)
  INTEGER cctk_ash2
  integer, parameter :: cctki_use_cctk_ash2 = kind(cctk_ash2)
  INTEGER cctk_ash3
  integer, parameter :: cctki_use_cctk_ash3 = kind(cctk_ash3)
  REAL*8 :: sbp_dx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sbp_dx = kind(sbp_dx)
  REAL*8 :: sbp_dy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sbp_dy = kind(sbp_dy)
  REAL*8 :: sbp_dz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sbp_dz = kind(sbp_dz)
  characTer*8, intent(IN) :: nmask
  integer, parameter :: cctki_use_nmask = kind(nmask)
  interface
  integer*8 function CCTK_PointerTo (var)
  implicit none
  type(*),dimension(..),TARGET :: var
  end function CCTK_PointerTo
  end interface
  interface
  integer function CCTK_Equals (arg1, arg2)
  implicit none
  integer*8 arg1
  character(*) arg2
  end function CCTK_Equals
  integer function CCTK_MyProc (cctkGH)
  implicit none
  integer*8 cctkGH
  end function CCTK_MyProc
  integer function CCTK_nProcs (cctkGH)
  implicit none
  integer*8 cctkGH
  end function CCTK_nProcs
  integer function CCTK_IsThornActive (name)
  implicit none
  character(*) name
  end function CCTK_IsThornActive
  integer*8 function CCTK_NullPointer ()
  implicit none
  end function CCTK_NullPointer
  end interface
  interface
  subroutine Diff2_coeff (cctkGH, dir, nsize, imin, imax, q, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  INTEGER*4 nsize
  INTEGER*4 imin(*)
  INTEGER*4 imax(*)
  REAL*8 q(*)
  INTEGER*4 table_handle
  end subroutine Diff2_coeff
  end interface
  interface
  subroutine Diff2_gv (cctkGH, dir1, dir2, var, dvar, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir1
  INTEGER*4 dir2
  REAL*8 var(*)
  REAL*8 dvar(*)
  INTEGER*4 table_handle
  end subroutine Diff2_gv
  end interface
  interface
  subroutine Diff_coeff (cctkGH, dir, nsize, imin, imax, q, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  INTEGER*4 nsize
  INTEGER*4 imin(*)
  INTEGER*4 imax(*)
  REAL*8 q(*)
  INTEGER*4 table_handle
  end subroutine Diff_coeff
  end interface
  interface
  subroutine Diff_gf (cctkGH, dir, var_name, dvar_name)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  character(*) var_name
  character(*) dvar_name
  end subroutine Diff_gf
  end interface
  interface
  subroutine Diff_gv (cctkGH, dir, var, dvar, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  REAL*8 var(*)
  REAL*8 dvar(*)
  INTEGER*4 table_handle
  end subroutine Diff_gv
  end interface
  interface
  subroutine Diff_up_coeff (cctkGH, dir, nsize, imin, imax, q, up, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  INTEGER*4 nsize
  INTEGER*4 imin(*)
  INTEGER*4 imax(*)
  REAL*8 q(*)
  INTEGER*4 up
  INTEGER*4 table_handle
  end subroutine Diff_up_coeff
  end interface
  interface
  subroutine Diff_up_gv (cctkGH, dir, var, dvar, up, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  REAL*8 var(*)
  REAL*8 dvar(*)
  REAL*8 up(*)
  INTEGER*4 table_handle
  end subroutine Diff_up_gv
  end interface
  interface
  subroutine GetBoundWidth (cctkGH, bsize, table_handle)
  implicit none
  integer*8 cctkGH
  INTEGER*4 bsize(*)
  INTEGER*4 table_handle
  end subroutine GetBoundWidth
  end interface
  interface
  INTEGER*4 function GetBoundarySpecification (size, nboundaryzones, is_internal, is_staggered, shiftout)
  implicit none
  INTEGER*4 size
  INTEGER*4 nboundaryzones(*)
  INTEGER*4 is_internal(*)
  INTEGER*4 is_staggered(*)
  INTEGER*4 shiftout(*)
  end function GetBoundarySpecification
  end interface
  interface
  INTEGER*4 function GetDomainSpecification (size, physical_min, physical_max, interior_min, interior_max, exterior_min, exterior_m&
  &ax, spacing)
  implicit none
  INTEGER*4 size
  REAL*8 physical_min(*)
  REAL*8 physical_max(*)
  REAL*8 interior_min(*)
  REAL*8 interior_max(*)
  REAL*8 exterior_min(*)
  REAL*8 exterior_max(*)
  REAL*8 spacing(*)
  end function GetDomainSpecification
  end interface
  interface
  subroutine GetLshIndexRanges (cctkGH, imin, imax)
  implicit none
  integer*8 cctkGH
  INTEGER*4 imin(*)
  INTEGER*4 imax(*)
  end subroutine GetLshIndexRanges
  end interface
  interface
  REAL*8 function GetScalProdCoeff ()
  implicit none
  end function GetScalProdCoeff
  end interface
  interface
  subroutine GetScalProdDiag (cctkGH, dir, nsize, sigmad)
  implicit none
  integer*8 cctkGH
  INTEGER*4 dir
  INTEGER*4 nsize
  REAL*8 sigmad(*)
  end subroutine GetScalProdDiag
  end interface
  interface
  INTEGER*4 function MoLQueryEvolvedRHS (EvolvedIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  end function MoLQueryEvolvedRHS
  end interface
  interface
  INTEGER*4 function MultiPatch_GetBbox (cctkGH, size, bbox)
  implicit none
  integer*8 cctkGH
  INTEGER*4 size
  INTEGER*4 bbox(*)
  end function MultiPatch_GetBbox
  end interface
  interface
  INTEGER*4 function MultiPatch_GetBoundarySpecification (map, size, nboundaryzones, is_internal, is_staggered, shiftout)
  implicit none
  INTEGER*4 map
  INTEGER*4 size
  INTEGER*4 nboundaryzones(*)
  INTEGER*4 is_internal(*)
  INTEGER*4 is_staggered(*)
  INTEGER*4 shiftout(*)
  end function MultiPatch_GetBoundarySpecification
  end interface
  interface
  INTEGER*4 function MultiPatch_GetMap (cctkGH)
  implicit none
  integer*8 cctkGH
  end function MultiPatch_GetMap
  end interface
  interface
  INTEGER*4 function MultiPatch_GetMaps (cctkGH)
  implicit none
  integer*8 cctkGH
  end function MultiPatch_GetMaps
  end interface
  interface
  INTEGER*4 function SymmetryHandleOfName (sym_name)
  implicit none
  character(*) sym_name
  end function SymmetryHandleOfName
  end interface
  interface
  INTEGER*4 function SymmetryTableHandleForGrid (cctkGH)
  implicit none
  integer*8 cctkGH
  end function SymmetryTableHandleForGrid
  end interface

!$OMP PARALLEL WORKSHARE
  sbp_dx = (cctk_delta_space(1)/cctk_levfac(1))*h_scaling(1)
  sbp_dy = (cctk_delta_space(2)/cctk_levfac(2))*h_scaling(2)
  sbp_dz = (cctk_delta_space(3)/cctk_levfac(3))*h_scaling(3)
!$OMP END PARALLEL WORKSHARE

end subroutine SBP_DeltaInitial
