














































 







  









































































 


































































































































































 




























































































































































































 





















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                








































 

      subroutine WaveToy1DF77_Evolve(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbn
     &d,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,cc
     &tk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_levoff
     &,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_ng
     &hostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_ash3, phi
     &,phi_p,phi_p_p,phi_temp,timederiv,x)

      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)
      integer, parameter :: cctki_use_phi = kind(phi)
      REAL*8 phi_p (cctk_ash1)
      integer, parameter :: cctki_use_phi_p = kind(phi_p)
      REAL*8 phi_p_p (cctk_ash1)
      integer, parameter :: cctki_use_phi_p_p = kind(phi_p_p)
      REAL*8 phi_temp (cctk_ash1)
      integer, parameter :: cctki_use_phi_temp = kind(phi_temp)
      REAL*8 timederiv (cctk_ash1)
      integer, parameter :: cctki_use_timederiv = kind(timederiv)
      REAL*8 x (cctk_ash1)
      integer, parameter :: cctki_use_x = kind(x)

      INTEGER   i
      integer   istart, iend
      REAL*8 dt,dx
      REAL*8 fac1,fac2

      dx     = (cctk_delta_space(1)/cctk_levfac(1))
      dt     = (cctk_delta_time/cctk_timefac)

      istart = 2
      iend   = cctk_lsh(1)-1

      fac2   = (dt*dt)/(dx*dx)
      fac1   = 2.0d0*(1.0d0 - fac2)

      do i = istart, iend
         phi(i) = fac1*phi_p(i)-phi_p_p(i)+fac2*(phi_p(i+1)+phi_p(i-1))
      end do

      return
      end 








