























































































































 


































































































































































 




























































































































































































 





















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



















































































      subroutine WaveToy2DF77_Boundary(cctk_dim,cctk_gsh,cctk_lsh,cctk_l
     &bnd,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_ash3, p
     &hi,phi_p,phi_p_p,phi_temp,timederiv,x,y)

      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_alignme
     &nt)
      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_orig
     &in_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_levof
     &fdenom)
      INTEGER cctk_timefac
      integer, parameter :: cctki_use_cctk_timefac = kind(cctk_timefac)
      INTEGER cctk_convlevel
      integer, parameter :: cctki_use_cctk_convlevel = kind(cctk_convlev
     &el)
      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_nghos
     &tzones)
      INTEGER cctk_iteration
      integer, parameter :: cctki_use_cctk_iteration = kind(cctk_iterati
     &on)
      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 phi (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_phi = kind(phi)
      REAL*8 phi_p (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_phi_p = kind(phi_p)
      REAL*8 phi_p_p (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_phi_p_p = kind(phi_p_p)
      REAL*8 phi_temp (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_phi_temp = kind(phi_temp)
      REAL*8 timederiv (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_timederiv = kind(timederiv)
      REAL*8 x (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_x = kind(x)
      REAL*8 y (cctk_ash1,cctk_ash2)
      integer, parameter :: cctki_use_y = kind(y)
      REAL*8 amplitude
      integer, parameter :: cctki_use_amplitude = kind(amplitude)
      REAL*8 sigma
      integer, parameter :: cctki_use_sigma = kind(sigma)
      REAL*8 xcenter
      integer, parameter :: cctki_use_xcenter = kind(xcenter)
      REAL*8 ycenter
      integer, parameter :: cctki_use_ycenter = kind(ycenter)
      integer*8 bound
      integer, parameter :: cctki_use_bound = kind(bound)
      COMMON /WaveToy2DF77priv/amplitude, sigma, xcenter, ycenter, bound
     &
      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 Coord_CoordHandle (GH, coordname, systemname)
      implicit none
      integer*8 GH
      character(*) coordname
      character(*) systemname
      end function Coord_CoordHandle
      end interface
      interface
      INTEGER*4 function Coord_CoordRegister (GH, systemhandle, directio
     &n, coordname)
      implicit none
      integer*8 GH
      INTEGER*4 systemhandle
      INTEGER*4 direction
      character(*) coordname
      end function Coord_CoordRegister
      end interface
      interface
      INTEGER*4 function Coord_GroupSystem (GH, groupname)
      implicit none
      integer*8 GH
      character(*) groupname
      end function Coord_GroupSystem
      end interface
      interface
      INTEGER*4 function Coord_SetDefaultSystem (GH, systemname)
      implicit none
      integer*8 GH
      character(*) systemname
      end function Coord_SetDefaultSystem
      end interface
      interface
      INTEGER*4 function Coord_SystemHandle (GH, systemname)
      implicit none
      integer*8 GH
      character(*) systemname
      end function Coord_SystemHandle
      end interface
      interface
      INTEGER*4 function Coord_SystemRegister (GH, dim, systemname)
      implicit none
      integer*8 GH
      INTEGER*4 dim
      character(*) systemname
      end function Coord_SystemRegister
      end interface

      integer ierr
      integer sw(2)
      REAL*8 zero
      
      sw(1) = 1
      sw(2) = 1

      zero = 0.0d0 

      if ((CCTK_Equals(bound,"zero") .ne. 0)) then
        call BndScalarVN(ierr,cctkGH, sw, zero,"wavetoy2df77::phi")
      end if

      return
      end
