




















































































































 


































































































































































 





































































































































































































 



















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                





















































































subroutine TestLoopFortran_all(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,c&
  &ctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_l&
  &evoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_&
  &ash3, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,&
  &x,y,z)
  implicit none

  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 csum_all
  integer, parameter :: cctki_use_csum_all = kind(csum_all)
  REAL*8 csum_bnd
  integer, parameter :: cctki_use_csum_bnd = kind(csum_bnd)
  REAL*8 csum_int
  integer, parameter :: cctki_use_csum_int = kind(csum_int)
  REAL*8 csum_intbnd
  integer, parameter :: cctki_use_csum_intbnd = kind(csum_intbnd)
  REAL*8 fsum_all
  integer, parameter :: cctki_use_fsum_all = kind(fsum_all)
  REAL*8 fsum_bnd
  integer, parameter :: cctki_use_fsum_bnd = kind(fsum_bnd)
  REAL*8 fsum_int
  integer, parameter :: cctki_use_fsum_int = kind(fsum_int)
  REAL*8 fsum_intbnd
  integer, parameter :: cctki_use_fsum_intbnd = kind(fsum_intbnd)
  INTEGER*4 pointtypes (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_pointtypes = kind(pointtypes)
  REAL*8 coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  REAL*8 coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  REAL*8 coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  REAL*8 r (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_r = kind(r)
  REAL*8 x (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_x = kind(x)
  REAL*8 y (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_y = kind(y)
  REAL*8 z (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_z = kind(z)
  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
  INTEGER*4 function GetBoundarySizesAndTypes (cctkGH, size, bndsize, is_ghostbnd, is_symbnd, is_physbnd)
  implicit none
  integer*8 cctkGH
  INTEGER*4 size
  INTEGER*4 bndsize(*)
  INTEGER*4 is_ghostbnd(*)
  INTEGER*4 is_symbnd(*)
  INTEGER*4 is_physbnd(*)
  end function GetBoundarySizesAndTypes
  end interface
  
  

  integer :: all3_all0_idir,all3_all0_jdir,all3_all0_kdir
  integer :: all3_all0_imin,all3_all0_jmin,all3_all0_kmin
  integer :: all3_all0_imax,all3_all0_jmax,all3_all0_kmax
  integer :: all3_all0_iash,all3_all0_jash,all3_all0_kash
  integer :: all3_all0_istr
  integer :: all3_all1_ni,all3_all1_nj,all3_all1_nk
  integer :: all33_dummy_imin, all33_dummy_imax
  integer   :: i,j,k
  REAL*8 :: fsum
  
  call CCTK_Info("TestLoop","TestLoopFortran_all")
  fsum = 0
  !$OMP PARALLEL &
  !$OMP private(all3_all0_idir,all3_all0_jdir,all3_all0_kdir) &
  !$omp private( i,j,k) &
  !$omp private( all3_all1_ni,all3_all1_nj,all3_all1_nk) &
  !$omp private(all3_all0_imin,all3_all0_jmin,all3_all0_kmin) &
  !$omp private(all3_all0_imax,all3_all0_jmax,all3_all0_kmax) &
  !$omp private(all3_all0_iash,all3_all0_jash,all3_all0_kash) &
  !$omp private(all3_all0_istr) &
  !$omp private(all33_dummy_imin, all33_dummy_imax) &
  !$OMP reduction(+: fsum) &
  !$OMP default(none) shared(cctkgh, cctk_ash, cctk_lsh, cctk_tile_min, cctk_tile_max, r)

  all3_all0_idir =                          0
  all3_all0_jdir = 0
  all3_all0_kdir = 0
  all3_all0_imin =                                            1
  all3_all0_jmin = 1
  all3_all0_kmin = 1
  all3_all0_imax =                                            cctk_lsh(1)
  all3_all0_jmax = cctk_lsh(2)
  all3_all0_kmax = cctk_lsh(3)
  all3_all0_iash =                                            cctk_ash(1)
  all3_all0_jash = cctk_ash(2)
  all3_all0_kash = cctk_ash(3)
  all3_all0_istr =    1
  all33_dummy_imin = all3_all0_imin
  all33_dummy_imax = all3_all0_imax
  !$omp do collapse(2)
  do k = all3_all0_kmin, all3_all0_kmax
  do j = all3_all0_jmin, all3_all0_jmax
  do                                                                   i = all3_all0_imin - modulo((                               &
  &                                  all33_dummy_imin+all3_all0_iash*(j+all3_all0_jash*(k))), all3_all0_istr), all3_all0_imax, all3&
  &_all0_istr
  all3_all1_ni = 0
  all3_all1_nj = 0
  all3_all1_nk = 0
  if (all3_all0_idir < 0)                          all3_all1_ni =                                                                  &
  & i
  if (all3_all0_jdir < 0) all3_all1_nj = j
  if (all3_all0_kdir < 0) all3_all1_nk = k
  if (all3_all0_idir > 0)                          all3_all1_ni = all3_all0_imax+1-                                                &
  &                  i
  if (all3_all0_jdir > 0) all3_all1_nj = all3_all0_jmax+1-j
  if (all3_all0_kdir > 0) all3_all1_nk = all3_all0_kmax+1-k
     fsum = fsum + r(i,j,k)

  end do
  end do
  end do
  !$OMP END PARALLEL
  fsum_all = fsum
end subroutine TestLoopFortran_all



subroutine TestLoopFortran_int(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,c&
  &ctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_l&
  &evoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_&
  &ash3, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,&
  &x,y,z)
  implicit none

  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 csum_all
  integer, parameter :: cctki_use_csum_all = kind(csum_all)
  REAL*8 csum_bnd
  integer, parameter :: cctki_use_csum_bnd = kind(csum_bnd)
  REAL*8 csum_int
  integer, parameter :: cctki_use_csum_int = kind(csum_int)
  REAL*8 csum_intbnd
  integer, parameter :: cctki_use_csum_intbnd = kind(csum_intbnd)
  REAL*8 fsum_all
  integer, parameter :: cctki_use_fsum_all = kind(fsum_all)
  REAL*8 fsum_bnd
  integer, parameter :: cctki_use_fsum_bnd = kind(fsum_bnd)
  REAL*8 fsum_int
  integer, parameter :: cctki_use_fsum_int = kind(fsum_int)
  REAL*8 fsum_intbnd
  integer, parameter :: cctki_use_fsum_intbnd = kind(fsum_intbnd)
  INTEGER*4 pointtypes (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_pointtypes = kind(pointtypes)
  REAL*8 coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  REAL*8 coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  REAL*8 coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  REAL*8 r (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_r = kind(r)
  REAL*8 x (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_x = kind(x)
  REAL*8 y (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_y = kind(y)
  REAL*8 z (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_z = kind(z)
  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
  INTEGER*4 function GetBoundarySizesAndTypes (cctkGH, size, bndsize, is_ghostbnd, is_symbnd, is_physbnd)
  implicit none
  integer*8 cctkGH
  INTEGER*4 size
  INTEGER*4 bndsize(*)
  INTEGER*4 is_ghostbnd(*)
  INTEGER*4 is_symbnd(*)
  INTEGER*4 is_physbnd(*)
  end function GetBoundarySizesAndTypes
  end interface
  
  

  integer :: int3_int_interior0_idir,int3_int_interior0_jdir,int3_int_interior0_kdir
  integer :: int3_int_interior0_imin,int3_int_interior0_jmin,int3_int_interior0_kmin
  integer :: int3_int_interior0_imax,int3_int_interior0_jmax,int3_int_interior0_kmax
  integer :: int3_int_interior0_iash,int3_int_interior0_jash,int3_int_interior0_kash
  integer :: int3_int_interior0_istr
  integer :: int3_int_interior1_ni,int3_int_interior1_nj,int3_int_interior1_nk
  INTEGER*4, parameter :: int33_isize = 6
  INTEGER*4 :: int33_bndsize    (6)
  INTEGER*4 :: int33_is_ghostbnd(6)
  INTEGER*4 :: int33_is_symbnd  (6)
  INTEGER*4 :: int33_is_physbnd (6)
  INTEGER*4 :: int33_ierr
  integer :: int33_dummy_imin, int33_dummy_imax
  integer   :: i,j,k
  REAL*8 :: fsum
  
  call CCTK_Info("TestLoop","TestLoopFortran_int")
  fsum = 0
  !$OMP PARALLEL reduction(+: fsum) private(int3_int_interior0_idir,int3_int_interior0_jdir,int3_int_interior0_kdir) &
  !$omp private( i,j,k) &
  !$omp private( int3_int_interior1_ni,int3_int_interior1_nj,int3_int_interior1_nk) &
  !$omp private(int3_int_interior0_imin,int3_int_interior0_jmin,int3_int_interior0_kmin) &
  !$omp private(int3_int_interior0_imax,int3_int_interior0_jmax,int3_int_interior0_kmax) &
  !$omp private(int3_int_interior0_iash,int3_int_interior0_jash,int3_int_interior0_kash) &
  !$omp private(int3_int_interior0_istr) &
  !$omp private(int33_bndsize) &
  !$omp private(int33_is_ghostbnd) &
  !$omp private(int33_is_symbnd) &
  !$omp private(int33_is_physbnd) &
  !$omp private(int33_ierr) &
  !$omp private(int33_dummy_imin, int33_dummy_imax) &
  !$OMP default(none) shared(cctkgh, cctk_ash, cctk_lsh, cctk_tile_min, cctk_tile_max, r)

  !$omp single
  int33_ierr = GetBoundarySizesAndTypes          (cctkGH, int33_isize, int33_bndsize, int33_is_ghostbnd, int33_is_symbnd, int33_is_&
  &physbnd)
  !$omp end single copyprivate(int33_bndsize)
  
  int3_int_interior0_idir =                          0
  int3_int_interior0_jdir = 0
  int3_int_interior0_kdir = 0
  int3_int_interior0_imin =                                            max(cctk_tile_min(1)+1, (                              int(i&
  &nt33_bndsize(1+1)))+1)
  int3_int_interior0_jmin =                   max(cctk_tile_min(2)+1, (int(int33_bndsize(3+1)))+1)
  int3_int_interior0_kmin =                   max(cctk_tile_min(3)+1, (int(int33_bndsize(5+1)))+1)
  int3_int_interior0_imax =                                            min(cctk_tile_max(1), cctk_lsh(1)-(                         &
  &      int(int33_bndsize(2))))
  int3_int_interior0_jmax =                   min(cctk_tile_max(2), cctk_lsh(2)-(int(int33_bndsize(4))))
  int3_int_interior0_kmax =                   min(cctk_tile_max(3), cctk_lsh(3)-(int(int33_bndsize(6))))
  int3_int_interior0_iash =                                            cctk_ash(1)
  int3_int_interior0_jash = cctk_ash(2)
  int3_int_interior0_kash = cctk_ash(3)
  int3_int_interior0_istr =    ( 1)
  int33_dummy_imin = int3_int_interior0_imin
  int33_dummy_imax = int3_int_interior0_imax
  !$omp do collapse(2)
  do k = int3_int_interior0_kmin, int3_int_interior0_kmax
  do j = int3_int_interior0_jmin, int3_int_interior0_jmax
  do                                                                                                  i = int3_int_interior0_imin -&
  & modulo((                                                                                                 int33_dummy_imin+int3_&
  &int_interior0_iash*(j+int3_int_interior0_jash*(k))), int3_int_interior0_istr), int3_int_interior0_imax, int3_int_interior0_istr
  int3_int_interior1_ni = 0
  int3_int_interior1_nj = 0
  int3_int_interior1_nk = 0
  if (int3_int_interior0_idir < 0)                          int3_int_interior1_ni =                                                &
  &                                                  i
  if (int3_int_interior0_jdir < 0) int3_int_interior1_nj = j
  if (int3_int_interior0_kdir < 0) int3_int_interior1_nk = k
  if (int3_int_interior0_idir > 0)                          int3_int_interior1_ni = int3_int_interior0_imax+1-                     &
  &                                                                            i
  if (int3_int_interior0_jdir > 0) int3_int_interior1_nj = int3_int_interior0_jmax+1-j
  if (int3_int_interior0_kdir > 0) int3_int_interior1_nk = int3_int_interior0_kmax+1-k
     fsum = fsum + r(i,j,k)

  end do
  end do
  end do
  !$OMP END PARALLEL
  fsum_int = fsum
end subroutine TestLoopFortran_int



subroutine TestLoopFortran_bnd(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,c&
  &ctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_l&
  &evoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_&
  &ash3, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,&
  &x,y,z)
  implicit none

  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 csum_all
  integer, parameter :: cctki_use_csum_all = kind(csum_all)
  REAL*8 csum_bnd
  integer, parameter :: cctki_use_csum_bnd = kind(csum_bnd)
  REAL*8 csum_int
  integer, parameter :: cctki_use_csum_int = kind(csum_int)
  REAL*8 csum_intbnd
  integer, parameter :: cctki_use_csum_intbnd = kind(csum_intbnd)
  REAL*8 fsum_all
  integer, parameter :: cctki_use_fsum_all = kind(fsum_all)
  REAL*8 fsum_bnd
  integer, parameter :: cctki_use_fsum_bnd = kind(fsum_bnd)
  REAL*8 fsum_int
  integer, parameter :: cctki_use_fsum_int = kind(fsum_int)
  REAL*8 fsum_intbnd
  integer, parameter :: cctki_use_fsum_intbnd = kind(fsum_intbnd)
  INTEGER*4 pointtypes (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_pointtypes = kind(pointtypes)
  REAL*8 coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  REAL*8 coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  REAL*8 coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  REAL*8 r (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_r = kind(r)
  REAL*8 x (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_x = kind(x)
  REAL*8 y (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_y = kind(y)
  REAL*8 z (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_z = kind(z)
  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
  INTEGER*4 function GetBoundarySizesAndTypes (cctkGH, size, bndsize, is_ghostbnd, is_symbnd, is_physbnd)
  implicit none
  integer*8 cctkGH
  INTEGER*4 size
  INTEGER*4 bndsize(*)
  INTEGER*4 is_ghostbnd(*)
  INTEGER*4 is_symbnd(*)
  INTEGER*4 is_physbnd(*)
  end function GetBoundarySizesAndTypes
  end interface
  
  

  integer :: bnd3_bnd_boundaries0_idir,bnd3_bnd_boundaries0_jdir,bnd3_bnd_boundaries0_kdir
  integer :: bnd3_bnd_boundaries0_imin,bnd3_bnd_boundaries0_jmin,bnd3_bnd_boundaries0_kmin
  integer :: bnd3_bnd_boundaries0_imax,bnd3_bnd_boundaries0_jmax,bnd3_bnd_boundaries0_kmax
  integer :: bnd3_bnd_boundaries0_iash,bnd3_bnd_boundaries0_jash,bnd3_bnd_boundaries0_kash
  integer :: bnd3_bnd_boundaries0_istr
  integer :: bnd3_bnd2_blo(3), bnd3_bnd2_bhi(3)
  integer :: bnd3_bnd2_bboxlo(3), bnd3_bnd2_bboxhi(3)
  integer :: bnd3_bnd2_istr
  integer :: bnd3_bnd2_idir,bnd3_bnd2_jdir,bnd3_bnd2_kdir
  logical :: bnd3_bnd2_any_bbox
  integer :: bnd3_bnd2_bmin(3), bnd3_bnd2_bmax(3)
  INTEGER*4, parameter :: bnd33_isize = 6
  INTEGER*4 :: bnd33_bndsize    (6)
  INTEGER*4 :: bnd33_is_ghostbnd(6)
  INTEGER*4 :: bnd33_is_symbnd  (6)
  INTEGER*4 :: bnd33_is_physbnd (6)
  INTEGER*4 :: bnd33_ierr
  integer :: bnd33_dummy_imin, bnd33_dummy_imax
  integer   :: i,j,k
  integer   :: n_i,n_j,n_k
  REAL*8 :: fsum
  
  call CCTK_Info("TestLoop","TestLoopFortran_bnd")
  fsum = 0
  !$omp parallel private(bnd3_bnd_boundaries0_idir,bnd3_bnd_boundaries0_jdir,bnd3_bnd_boundaries0_kdir) &
  !$omp private( i,j,k) &
  !$omp private( n_i,n_j,n_k) &
  !$omp private(bnd3_bnd_boundaries0_imin,bnd3_bnd_boundaries0_jmin,bnd3_bnd_boundaries0_kmin) &
  !$omp private(bnd3_bnd_boundaries0_imax,bnd3_bnd_boundaries0_jmax,bnd3_bnd_boundaries0_kmax) &
  !$omp private(bnd3_bnd_boundaries0_iash,bnd3_bnd_boundaries0_jash,bnd3_bnd_boundaries0_kash) &
  !$omp private(bnd3_bnd_boundaries0_istr) &
  !$omp private(bnd3_bnd2_blo, bnd3_bnd2_bhi) &
  !$omp private(bnd3_bnd2_bboxlo, bnd3_bnd2_bboxhi) &
  !$omp private(bnd3_bnd2_istr) &
  !$omp private(bnd3_bnd2_idir,bnd3_bnd2_jdir,bnd3_bnd2_kdir) &
  !$omp private(bnd3_bnd2_any_bbox) &
  !$omp private(bnd3_bnd2_bmin, bnd3_bnd2_bmax) &
  !$omp private(bnd33_bndsize) &
  !$omp private(bnd33_is_ghostbnd) &
  !$omp private(bnd33_is_symbnd) &
  !$omp private(bnd33_is_physbnd) &
  !$omp private(bnd33_ierr) &
  !$omp private(bnd33_dummy_imin, bnd33_dummy_imax) &
  !$OMP reduction(+: fsum) &
  !$OMP default(none) shared(cctkgh, cctk_ash, cctk_lsh, cctk_tile_min, cctk_tile_max, r)

  !$omp single
  bnd33_ierr = GetBoundarySizesAndTypes          (cctkGH, bnd33_isize, bnd33_bndsize, bnd33_is_ghostbnd, bnd33_is_symbnd, bnd33_is_&
  &physbnd)
  !$omp end single copyprivate(bnd33_bndsize, bnd33_is_physbnd)
  
  bnd3_bnd2_blo = (/                                 int(bnd33_bndsize(1)),int(bnd33_bndsize(3)),int(bnd33_bndsize(5)) /)
  bnd3_bnd2_bhi = (/                                  int(bnd33_bndsize(2)),int(bnd33_bndsize(4)),int(bnd33_bndsize(6)) /)
  bnd3_bnd2_bboxlo = (/                                  int(bnd33_is_physbnd(1)),int(bnd33_is_physbnd(3)),int(bnd33_is_physbnd(5))&
  & /)
  bnd3_bnd2_bboxhi = (/                                  int(bnd33_is_physbnd(2)),int(bnd33_is_physbnd(4)),int(bnd33_is_physbnd(6))&
  & /)
  bnd3_bnd2_istr = ( ( 1))
  do bnd3_bnd2_kdir=-1, +1
  do bnd3_bnd2_jdir=-1, +1
  do bnd3_bnd2_idir=-1, +1
  bnd3_bnd2_any_bbox = .false.
  if (bnd3_bnd2_idir<0) bnd3_bnd2_any_bbox = bnd3_bnd2_any_bbox .or. bnd3_bnd2_bboxlo(1) /= 0
  if (bnd3_bnd2_jdir<0) bnd3_bnd2_any_bbox = bnd3_bnd2_any_bbox .or. bnd3_bnd2_bboxlo(2) /= 0
  if (bnd3_bnd2_kdir<0) bnd3_bnd2_any_bbox = bnd3_bnd2_any_bbox .or. bnd3_bnd2_bboxlo(3) /= 0
  if (bnd3_bnd2_idir>0) bnd3_bnd2_any_bbox = bnd3_bnd2_any_bbox .or. bnd3_bnd2_bboxhi(1) /= 0
  if (bnd3_bnd2_jdir>0) bnd3_bnd2_any_bbox = bnd3_bnd2_any_bbox .or. bnd3_bnd2_bboxhi(2) /= 0
  if (bnd3_bnd2_kdir>0) bnd3_bnd2_any_bbox = bnd3_bnd2_any_bbox .or. bnd3_bnd2_bboxhi(3) /= 0
  if (bnd3_bnd2_any_bbox) then
  bnd3_bnd2_bmin(1) = bnd3_bnd2_blo(1) + 1
  bnd3_bnd2_bmin(2) = bnd3_bnd2_blo(2) + 1
  bnd3_bnd2_bmin(3) = bnd3_bnd2_blo(3) + 1
  if (bnd3_bnd2_idir<0) bnd3_bnd2_bmin(1) = 1
  if (bnd3_bnd2_jdir<0) bnd3_bnd2_bmin(2) = 1
  if (bnd3_bnd2_kdir<0) bnd3_bnd2_bmin(3) = 1
  if (bnd3_bnd2_idir>0) bnd3_bnd2_bmin(1) = cctk_lsh(1) - bnd3_bnd2_bhi(1) + 1
  if (bnd3_bnd2_jdir>0) bnd3_bnd2_bmin(2) = cctk_lsh(2) - bnd3_bnd2_bhi(2) + 1
  if (bnd3_bnd2_kdir>0) bnd3_bnd2_bmin(3) = cctk_lsh(3) - bnd3_bnd2_bhi(3) + 1
  bnd3_bnd2_bmax(1) = cctk_lsh(1) - bnd3_bnd2_bhi(1)
  bnd3_bnd2_bmax(2) = cctk_lsh(2) - bnd3_bnd2_bhi(2)
  bnd3_bnd2_bmax(3) = cctk_lsh(3) - bnd3_bnd2_bhi(3)
  if (bnd3_bnd2_idir<0) bnd3_bnd2_bmax(1) = bnd3_bnd2_blo(1)
  if (bnd3_bnd2_jdir<0) bnd3_bnd2_bmax(2) = bnd3_bnd2_blo(2)
  if (bnd3_bnd2_kdir<0) bnd3_bnd2_bmax(3) = bnd3_bnd2_blo(3)
  if (bnd3_bnd2_idir>0) bnd3_bnd2_bmax(1) = cctk_lsh(1)
  if (bnd3_bnd2_jdir>0) bnd3_bnd2_bmax(2) = cctk_lsh(2)
  if (bnd3_bnd2_kdir>0) bnd3_bnd2_bmax(3) = cctk_lsh(3)
  
  bnd3_bnd_boundaries0_idir =                                   bnd3_bnd2_idir
  bnd3_bnd_boundaries0_jdir = bnd3_bnd2_jdir
  bnd3_bnd_boundaries0_kdir = bnd3_bnd2_kdir
  bnd3_bnd_boundaries0_imin =                                   max(cctk_tile_min(1)+1, bnd3_bnd2_bmin(1))
  bnd3_bnd_boundaries0_jmin = max(cctk_tile_min(2)+1, bnd3_bnd2_bmin(2))
  bnd3_bnd_boundaries0_kmin = max(cctk_tile_min(3)+1, bnd3_bnd2_bmin(3))
  bnd3_bnd_boundaries0_imax =                                    min(cctk_tile_max(1), bnd3_bnd2_bmax(1))
  bnd3_bnd_boundaries0_jmax = min(cctk_tile_max(2), bnd3_bnd2_bmax(2))
  bnd3_bnd_boundaries0_kmax = min(cctk_tile_max(3), bnd3_bnd2_bmax(3))
  bnd3_bnd_boundaries0_iash =                                    cctk_ash(1)
  bnd3_bnd_boundaries0_jash = cctk_ash(2)
  bnd3_bnd_boundaries0_kash = cctk_ash(3)
  bnd3_bnd_boundaries0_istr =  bnd3_bnd2_istr
  bnd33_dummy_imin = bnd3_bnd_boundaries0_imin
  bnd33_dummy_imax = bnd3_bnd_boundaries0_imax
  !$omp do collapse(2)
  do k = bnd3_bnd_boundaries0_kmin, bnd3_bnd_boundaries0_kmax
  do j = bnd3_bnd_boundaries0_jmin, bnd3_bnd_boundaries0_jmax
  do                                                                                          i = bnd3_bnd_boundaries0_imin - modul&
  &o((                                                                                         bnd33_dummy_imin+bnd3_bnd_boundaries&
  &0_iash*(j+bnd3_bnd_boundaries0_jash*(k))), bnd3_bnd_boundaries0_istr), bnd3_bnd_boundaries0_imax, bnd3_bnd_boundaries0_istr
  n_i = 0
  n_j = 0
  n_k = 0
  if (bnd3_bnd_boundaries0_idir < 0)                                                                                          n_i =&
  &                                                                                          i
  if (bnd3_bnd_boundaries0_jdir < 0) n_j = j
  if (bnd3_bnd_boundaries0_kdir < 0) n_k = k
  if (bnd3_bnd_boundaries0_idir > 0)                                                                                          n_i =&
  & bnd3_bnd_boundaries0_imax+1-                                                                                         i
  if (bnd3_bnd_boundaries0_jdir > 0) n_j = bnd3_bnd_boundaries0_jmax+1-j
  if (bnd3_bnd_boundaries0_kdir > 0) n_k = bnd3_bnd_boundaries0_kmax+1-k
     fsum = fsum + r(i,j,k)

  end do
  end do
  end do
  end if
  end do
  end do
  end do
  !$omp end parallel
  fsum_bnd = fsum
end subroutine TestLoopFortran_bnd



subroutine TestLoopFortran_intbnd(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignmen&
  &t,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cct&
  &k_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cc&
  &tk_ash3, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz&
  &,r,x,y,z)
  implicit none

  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 csum_all
  integer, parameter :: cctki_use_csum_all = kind(csum_all)
  REAL*8 csum_bnd
  integer, parameter :: cctki_use_csum_bnd = kind(csum_bnd)
  REAL*8 csum_int
  integer, parameter :: cctki_use_csum_int = kind(csum_int)
  REAL*8 csum_intbnd
  integer, parameter :: cctki_use_csum_intbnd = kind(csum_intbnd)
  REAL*8 fsum_all
  integer, parameter :: cctki_use_fsum_all = kind(fsum_all)
  REAL*8 fsum_bnd
  integer, parameter :: cctki_use_fsum_bnd = kind(fsum_bnd)
  REAL*8 fsum_int
  integer, parameter :: cctki_use_fsum_int = kind(fsum_int)
  REAL*8 fsum_intbnd
  integer, parameter :: cctki_use_fsum_intbnd = kind(fsum_intbnd)
  INTEGER*4 pointtypes (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_pointtypes = kind(pointtypes)
  REAL*8 coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  REAL*8 coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  REAL*8 coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  REAL*8 r (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_r = kind(r)
  REAL*8 x (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_x = kind(x)
  REAL*8 y (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_y = kind(y)
  REAL*8 z (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_z = kind(z)
  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
  INTEGER*4 function GetBoundarySizesAndTypes (cctkGH, size, bndsize, is_ghostbnd, is_symbnd, is_physbnd)
  implicit none
  integer*8 cctkGH
  INTEGER*4 size
  INTEGER*4 bndsize(*)
  INTEGER*4 is_ghostbnd(*)
  INTEGER*4 is_symbnd(*)
  INTEGER*4 is_physbnd(*)
  end function GetBoundarySizesAndTypes
  end interface
  
  

  integer :: intbnd3_bnd_intboundaries0_idir,intbnd3_bnd_intboundaries0_jdir,intbnd3_bnd_intboundaries0_kdir
  integer :: intbnd3_bnd_intboundaries0_imin,intbnd3_bnd_intboundaries0_jmin,intbnd3_bnd_intboundaries0_kmin
  integer :: intbnd3_bnd_intboundaries0_imax,intbnd3_bnd_intboundaries0_jmax,intbnd3_bnd_intboundaries0_kmax
  integer :: intbnd3_bnd_intboundaries0_iash,intbnd3_bnd_intboundaries0_jash,intbnd3_bnd_intboundaries0_kash
  integer :: intbnd3_bnd_intboundaries0_istr
  integer :: intbnd3_bnd2_blo(3), intbnd3_bnd2_bhi(3)
  integer :: intbnd3_bnd2_bboxlo(3), intbnd3_bnd2_bboxhi(3)
  integer :: intbnd3_bnd2_istr
  integer :: intbnd3_bnd2_idir,intbnd3_bnd2_jdir,intbnd3_bnd2_kdir
  logical :: intbnd3_bnd2_any_bbox, intbnd3_bnd2_all_bbox
  integer :: intbnd3_bnd2_bmin(3), intbnd3_bnd2_bmax(3)
  INTEGER*4, parameter :: intbnd33_isize = 6
  INTEGER*4 :: intbnd33_bndsize    (6)
  INTEGER*4 :: intbnd33_is_ghostbnd(6)
  INTEGER*4 :: intbnd33_is_symbnd  (6)
  INTEGER*4 :: intbnd33_is_physbnd (6)
  INTEGER*4 :: intbnd33_ierr
  integer :: intbnd33_dummy_imin, intbnd33_dummy_imax
  integer   :: i,j,k
  integer   :: n_i,n_j,n_k
  REAL*8 :: fsum
  
  call CCTK_Info("TestLoop","TestLoopFortran_intbnd")
  fsum = 0
  !$OMP PARALLEL &
  !$OMP default(none) shared(cctkgh, cctk_ash, cctk_lsh, cctk_tile_min, cctk_tile_max, r) &
  !$OMP reduction(+: fsum) &
  !$omp private(intbnd3_bnd_intboundaries0_idir,intbnd3_bnd_intboundaries0_jdir,intbnd3_bnd_intboundaries0_kdir) &
  !$omp private( i,j,k) &
  !$omp private( n_i,n_j,n_k) &
  !$omp private(intbnd3_bnd_intboundaries0_imin,intbnd3_bnd_intboundaries0_jmin,intbnd3_bnd_intboundaries0_kmin) &
  !$omp private(intbnd3_bnd_intboundaries0_imax,intbnd3_bnd_intboundaries0_jmax,intbnd3_bnd_intboundaries0_kmax) &
  !$omp private(intbnd3_bnd_intboundaries0_iash,intbnd3_bnd_intboundaries0_jash,intbnd3_bnd_intboundaries0_kash) &
  !$omp private(intbnd3_bnd_intboundaries0_istr) &
  !$omp private(intbnd3_bnd2_blo, intbnd3_bnd2_bhi) &
  !$omp private(intbnd3_bnd2_bboxlo, intbnd3_bnd2_bboxhi) &
  !$omp private(intbnd3_bnd2_istr) &
  !$omp private(intbnd3_bnd2_idir,intbnd3_bnd2_jdir,intbnd3_bnd2_kdir) &
  !$omp private(intbnd3_bnd2_any_bbox, intbnd3_bnd2_all_bbox) &
  !$omp private(intbnd3_bnd2_bmin, intbnd3_bnd2_bmax) &
  !$omp private(intbnd33_bndsize) &
  !$omp private(intbnd33_is_ghostbnd) &
  !$omp private(intbnd33_is_symbnd) &
  !$omp private(intbnd33_is_physbnd) &
  !$omp private(intbnd33_ierr) &
  !$omp private(intbnd33_dummy_imin, intbnd33_dummy_imax)

  !$omp single
  intbnd33_ierr = GetBoundarySizesAndTypes          (cctkGH, intbnd33_isize, intbnd33_bndsize, intbnd33_is_ghostbnd, intbnd33_is_sy&
  &mbnd, intbnd33_is_physbnd)
  !$omp end single copyprivate(intbnd33_bndsize, intbnd33_is_physbnd)
  
  intbnd3_bnd2_blo = (/                                    int(intbnd33_bndsize(1)),int(intbnd33_bndsize(3)),int(intbnd33_bndsize(5&
  &)) /)
  intbnd3_bnd2_bhi = (/                                     int(intbnd33_bndsize(2)),int(intbnd33_bndsize(4)),int(intbnd33_bndsize(&
  &6)) /)
  intbnd3_bnd2_bboxlo = (/                                     int(intbnd33_is_physbnd(1)),int(intbnd33_is_physbnd(3)),int(intbnd33&
  &_is_physbnd(5)) /)
  intbnd3_bnd2_bboxhi = (/                                     int(intbnd33_is_physbnd(2)),int(intbnd33_is_physbnd(4)),int(intbnd33&
  &_is_physbnd(6)) /)
  intbnd3_bnd2_istr = ( ( 1))
  do intbnd3_bnd2_kdir=-1, +1
  do intbnd3_bnd2_jdir=-1, +1
  do intbnd3_bnd2_idir=-1, +1
  intbnd3_bnd2_any_bbox = .false.
  if (intbnd3_bnd2_idir<0) intbnd3_bnd2_any_bbox = intbnd3_bnd2_any_bbox .or. intbnd3_bnd2_bboxlo(1) /= 0
  if (intbnd3_bnd2_jdir<0) intbnd3_bnd2_any_bbox = intbnd3_bnd2_any_bbox .or. intbnd3_bnd2_bboxlo(2) /= 0
  if (intbnd3_bnd2_kdir<0) intbnd3_bnd2_any_bbox = intbnd3_bnd2_any_bbox .or. intbnd3_bnd2_bboxlo(3) /= 0
  if (intbnd3_bnd2_idir>0) intbnd3_bnd2_any_bbox = intbnd3_bnd2_any_bbox .or. intbnd3_bnd2_bboxhi(1) /= 0
  if (intbnd3_bnd2_jdir>0) intbnd3_bnd2_any_bbox = intbnd3_bnd2_any_bbox .or. intbnd3_bnd2_bboxhi(2) /= 0
  if (intbnd3_bnd2_kdir>0) intbnd3_bnd2_any_bbox = intbnd3_bnd2_any_bbox .or. intbnd3_bnd2_bboxhi(3) /= 0
  intbnd3_bnd2_all_bbox = .true.
  if (intbnd3_bnd2_idir<0) intbnd3_bnd2_all_bbox = intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_bboxlo(1) /= 0
  if (intbnd3_bnd2_jdir<0) intbnd3_bnd2_all_bbox = intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_bboxlo(2) /= 0
  if (intbnd3_bnd2_kdir<0) intbnd3_bnd2_all_bbox = intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_bboxlo(3) /= 0
  if (intbnd3_bnd2_idir>0) intbnd3_bnd2_all_bbox = intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_bboxhi(1) /= 0
  if (intbnd3_bnd2_jdir>0) intbnd3_bnd2_all_bbox = intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_bboxhi(2) /= 0
  if (intbnd3_bnd2_kdir>0) intbnd3_bnd2_all_bbox = intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_bboxhi(3) /= 0
  if (intbnd3_bnd2_all_bbox .and. intbnd3_bnd2_any_bbox) then
  intbnd3_bnd2_bmin(1) = intbnd3_bnd2_blo(1) + 1
  intbnd3_bnd2_bmin(2) = intbnd3_bnd2_blo(2) + 1
  intbnd3_bnd2_bmin(3) = intbnd3_bnd2_blo(3) + 1
  if (intbnd3_bnd2_idir<0) intbnd3_bnd2_bmin(1) = 1
  if (intbnd3_bnd2_jdir<0) intbnd3_bnd2_bmin(2) = 1
  if (intbnd3_bnd2_kdir<0) intbnd3_bnd2_bmin(3) = 1
  if (intbnd3_bnd2_idir>0) intbnd3_bnd2_bmin(1) = cctk_lsh(1) - intbnd3_bnd2_bhi(1) + 1
  if (intbnd3_bnd2_jdir>0) intbnd3_bnd2_bmin(2) = cctk_lsh(2) - intbnd3_bnd2_bhi(2) + 1
  if (intbnd3_bnd2_kdir>0) intbnd3_bnd2_bmin(3) = cctk_lsh(3) - intbnd3_bnd2_bhi(3) + 1
  intbnd3_bnd2_bmax(1) = cctk_lsh(1) - intbnd3_bnd2_bhi(1)
  intbnd3_bnd2_bmax(2) = cctk_lsh(2) - intbnd3_bnd2_bhi(2)
  intbnd3_bnd2_bmax(3) = cctk_lsh(3) - intbnd3_bnd2_bhi(3)
  if (intbnd3_bnd2_idir<0) intbnd3_bnd2_bmax(1) = intbnd3_bnd2_blo(1)
  if (intbnd3_bnd2_jdir<0) intbnd3_bnd2_bmax(2) = intbnd3_bnd2_blo(2)
  if (intbnd3_bnd2_kdir<0) intbnd3_bnd2_bmax(3) = intbnd3_bnd2_blo(3)
  if (intbnd3_bnd2_idir>0) intbnd3_bnd2_bmax(1) = cctk_lsh(1)
  if (intbnd3_bnd2_jdir>0) intbnd3_bnd2_bmax(2) = cctk_lsh(2)
  if (intbnd3_bnd2_kdir>0) intbnd3_bnd2_bmax(3) = cctk_lsh(3)
  
  intbnd3_bnd_intboundaries0_idir =                                   intbnd3_bnd2_idir
  intbnd3_bnd_intboundaries0_jdir = intbnd3_bnd2_jdir
  intbnd3_bnd_intboundaries0_kdir = intbnd3_bnd2_kdir
  intbnd3_bnd_intboundaries0_imin =                                   max(cctk_tile_min(1)+1, intbnd3_bnd2_bmin(1))
  intbnd3_bnd_intboundaries0_jmin = max(cctk_tile_min(2)+1, intbnd3_bnd2_bmin(2))
  intbnd3_bnd_intboundaries0_kmin = max(cctk_tile_min(3)+1, intbnd3_bnd2_bmin(3))
  intbnd3_bnd_intboundaries0_imax =                                    min(cctk_Tile_max(1), intbnd3_bnd2_bmax(1))
  intbnd3_bnd_intboundaries0_jmax = min(cctk_Tile_max(2), intbnd3_bnd2_bmax(2))
  intbnd3_bnd_intboundaries0_kmax = min(cctk_Tile_max(3), intbnd3_bnd2_bmax(3))
  intbnd3_bnd_intboundaries0_iash =                                    cctk_ash(1)
  intbnd3_bnd_intboundaries0_jash = cctk_ash(2)
  intbnd3_bnd_intboundaries0_kash = cctk_ash(3)
  intbnd3_bnd_intboundaries0_istr =  intbnd3_bnd2_istr
  intbnd33_dummy_imin = intbnd3_bnd_intboundaries0_imin
  intbnd33_dummy_imax = intbnd3_bnd_intboundaries0_imax
  !$omp do collapse(2)
  do k = intbnd3_bnd_intboundaries0_kmin, intbnd3_bnd_intboundaries0_kmax
  do j = intbnd3_bnd_intboundaries0_jmin, intbnd3_bnd_intboundaries0_jmax
  do                                                                                                i = intbnd3_bnd_intboundaries0_&
  &imin - modulo((                                                                                               intbnd33_dummy_imi&
  &n+intbnd3_bnd_intboundaries0_iash*(j+intbnd3_bnd_intboundaries0_jash*(k))), intbnd3_bnd_intboundaries0_istr), intbnd3_bnd_intbou&
  &ndaries0_imax, intbnd3_bnd_intboundaries0_istr
  n_i = 0
  n_j = 0
  n_k = 0
  if (intbnd3_bnd_intboundaries0_idir < 0)                                                                                         &
  &       n_i =                                                                                                i
  if (intbnd3_bnd_intboundaries0_jdir < 0) n_j = j
  if (intbnd3_bnd_intboundaries0_kdir < 0) n_k = k
  if (intbnd3_bnd_intboundaries0_idir > 0)                                                                                         &
  &       n_i = intbnd3_bnd_intboundaries0_imax+1-                                                                                 &
  &              i
  if (intbnd3_bnd_intboundaries0_jdir > 0) n_j = intbnd3_bnd_intboundaries0_jmax+1-j
  if (intbnd3_bnd_intboundaries0_kdir > 0) n_k = intbnd3_bnd_intboundaries0_kmax+1-k
     fsum = fsum + r(i,j,k)

  end do
  end do
  end do
  end if
  end do
  end do
  end do
  !$OMP END PARALLEL
  fsum_intbnd = fsum
end subroutine TestLoopFortran_intbnd



subroutine TestLoopFortran(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_levof&
  &f,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_ash3&
  &, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,x,y,&
  &z)
  implicit none

  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 csum_all
  integer, parameter :: cctki_use_csum_all = kind(csum_all)
  REAL*8 csum_bnd
  integer, parameter :: cctki_use_csum_bnd = kind(csum_bnd)
  REAL*8 csum_int
  integer, parameter :: cctki_use_csum_int = kind(csum_int)
  REAL*8 csum_intbnd
  integer, parameter :: cctki_use_csum_intbnd = kind(csum_intbnd)
  REAL*8 fsum_all
  integer, parameter :: cctki_use_fsum_all = kind(fsum_all)
  REAL*8 fsum_bnd
  integer, parameter :: cctki_use_fsum_bnd = kind(fsum_bnd)
  REAL*8 fsum_int
  integer, parameter :: cctki_use_fsum_int = kind(fsum_int)
  REAL*8 fsum_intbnd
  integer, parameter :: cctki_use_fsum_intbnd = kind(fsum_intbnd)
  INTEGER*4 pointtypes (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_pointtypes = kind(pointtypes)
  REAL*8 coarse_dx
  integer, parameter :: cctki_use_coarse_dx = kind(coarse_dx)
  REAL*8 coarse_dy
  integer, parameter :: cctki_use_coarse_dy = kind(coarse_dy)
  REAL*8 coarse_dz
  integer, parameter :: cctki_use_coarse_dz = kind(coarse_dz)
  REAL*8 r (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_r = kind(r)
  REAL*8 x (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_x = kind(x)
  REAL*8 y (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_y = kind(y)
  REAL*8 z (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_z = kind(z)
  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
  INTEGER*4 function GetBoundarySizesAndTypes (cctkGH, size, bndsize, is_ghostbnd, is_symbnd, is_physbnd)
  implicit none
  integer*8 cctkGH
  INTEGER*4 size
  INTEGER*4 bndsize(*)
  INTEGER*4 is_ghostbnd(*)
  INTEGER*4 is_symbnd(*)
  INTEGER*4 is_physbnd(*)
  end function GetBoundarySizesAndTypes
  end interface
  
  
  call TestLoopFortran_all(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_levof&
  &f,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_ash3&
  &, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,x,y,&
  &z)
  call TestLoopFortran_int(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_levof&
  &f,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_ash3&
  &, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,x,y,&
  &z)
  call TestLoopFortran_bnd(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_levof&
  &f,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_ash3&
  &, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,x,y,&
  &z)
  call TestLoopFortran_intbnd(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,cc&
  &tk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_le&
  &voff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_a&
  &sh3, csum_all,csum_bnd,csum_int,csum_intbnd,fsum_all,fsum_bnd,fsum_int,fsum_intbnd,pointtypes, coarse_dx,coarse_dy,coarse_dz,r,x&
  &,y,z)
end subroutine TestLoopFortran
