






















































































































 


































































































































































 



















































































































































































































 





















































































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



















































































subroutine NoExcision_Smooth (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, d,dgxx,dgxy,dgxz,dgyy,dgyz,dgzz,dkxx,dkxy,dkxz,dkyy,dkyz,dkzz,dx,dy,dz,loop_control,nes_mask,q,qgxx,qgxy,qgxz,qgyy,qgyz,qgz&
  &z,qkxx,qkxy,qkxz,qkyy,qkyz,qkzz,qx,qy,qz,red,red_mask,redgxx,redgxy,redgxz,redgyy,redgyz,redgzz,redkxx,redkxy,redkxz,redkyy,redk&
  &yz,redkzz,redx,redy,redz,res,resgxx,resgxy,resgxz,resgyy,resgyz,resgzz,reskxx,reskxy,reskxz,reskyy,reskyz,reskzz,resx,resy,resz,&
  & X0sf_radius,X1sf_radius,sf_active_length,sf_coordinate_descriptors_length,sf_info_length,sf_maxreflevel_length,sf_minreflevel_l&
  &ength,sf_origin_length,sf_radius_length,sf_shape_descriptors_length,sf_valid_length,alp,alp_p,alp_p_p,betax,betax_p,betax_p_p,be&
  &tay,betay_p,betay_p_p,betaz,betaz_p,betaz_p_p,coarse_dx,coarse_dy,coarse_dz,conformal_state,dtalp,dtalp_p,dtalp_p_p,dtbetax,dtbe&
  &tax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,dtlapse_state,dtshift_state,gxx,gxx_p,gxx_p_p,gxy,&
  &gxy_p,gxy_p_p,gxz,gxz_p,gxz_p_p,gyy,gyy_p,gyy_p_p,gyz,gyz_p,gyz_p_p,gzz,gzz_p,gzz_p_p,kxx,kxx_p,kxx_p_p,kxy,kxy_p,kxy_p_p,kxz,kx&
  &z_p,kxz_p_p,kyy,kyy_p,kyy_p_p,kyz,kyz_p,kyz_p_p,kzz,kzz_p,kzz_p_p,psi,psix,psixx,psixy,psixz,psiy,psiyy,psiyz,psiz,psizz,r,sf_ac&
  &tive,sf_area,sf_centroid_x,sf_centroid_y,sf_centroid_z,sf_delta_phi,sf_delta_theta,sf_max_radius,sf_max_x,sf_max_y,sf_max_z,sf_m&
  &axreflevel,sf_mean_radius,sf_min_radius,sf_min_x,sf_min_y,sf_min_z,sf_minreflevel,sf_nghostsphi,sf_nghoststheta,sf_nphi,sf_nthet&
  &a,sf_origin_phi,sf_origin_theta,sf_origin_x,sf_origin_y,sf_origin_z,sf_quadrupole_xx,sf_quadrupole_xy,sf_quadrupole_xz,sf_quadru&
  &pole_yy,sf_quadrupole_yz,sf_quadrupole_zz,sf_radius,sf_valid,shift_state,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 d (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_d = kind(d)
  REAL*8 dgxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dgxx = kind(dgxx)
  REAL*8 dgxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dgxy = kind(dgxy)
  REAL*8 dgxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dgxz = kind(dgxz)
  REAL*8 dgyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dgyy = kind(dgyy)
  REAL*8 dgyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dgyz = kind(dgyz)
  REAL*8 dgzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dgzz = kind(dgzz)
  REAL*8 dkxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dkxx = kind(dkxx)
  REAL*8 dkxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dkxy = kind(dkxy)
  REAL*8 dkxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dkxz = kind(dkxz)
  REAL*8 dkyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dkyy = kind(dkyy)
  REAL*8 dkyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dkyz = kind(dkyz)
  REAL*8 dkzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dkzz = kind(dkzz)
  REAL*8 dx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dx = kind(dx)
  REAL*8 dy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dy = kind(dy)
  REAL*8 dz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dz = kind(dz)
  INTEGER*4 loop_control
  integer, parameter :: cctki_use_loop_control = kind(loop_control)
  INTEGER*4 nes_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_nes_mask = kind(nes_mask)
  REAL*8 q (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_q = kind(q)
  REAL*8 qgxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qgxx = kind(qgxx)
  REAL*8 qgxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qgxy = kind(qgxy)
  REAL*8 qgxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qgxz = kind(qgxz)
  REAL*8 qgyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qgyy = kind(qgyy)
  REAL*8 qgyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qgyz = kind(qgyz)
  REAL*8 qgzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qgzz = kind(qgzz)
  REAL*8 qkxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qkxx = kind(qkxx)
  REAL*8 qkxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qkxy = kind(qkxy)
  REAL*8 qkxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qkxz = kind(qkxz)
  REAL*8 qkyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qkyy = kind(qkyy)
  REAL*8 qkyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qkyz = kind(qkyz)
  REAL*8 qkzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qkzz = kind(qkzz)
  REAL*8 qx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qx = kind(qx)
  REAL*8 qy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qy = kind(qy)
  REAL*8 qz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_qz = kind(qz)
  REAL*8 red (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_red = kind(red)
  REAL*8 red_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_red_mask = kind(red_mask)
  REAL*8 redgxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redgxx = kind(redgxx)
  REAL*8 redgxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redgxy = kind(redgxy)
  REAL*8 redgxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redgxz = kind(redgxz)
  REAL*8 redgyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redgyy = kind(redgyy)
  REAL*8 redgyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redgyz = kind(redgyz)
  REAL*8 redgzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redgzz = kind(redgzz)
  REAL*8 redkxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redkxx = kind(redkxx)
  REAL*8 redkxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redkxy = kind(redkxy)
  REAL*8 redkxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redkxz = kind(redkxz)
  REAL*8 redkyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redkyy = kind(redkyy)
  REAL*8 redkyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redkyz = kind(redkyz)
  REAL*8 redkzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redkzz = kind(redkzz)
  REAL*8 redx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redx = kind(redx)
  REAL*8 redy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redy = kind(redy)
  REAL*8 redz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_redz = kind(redz)
  REAL*8 res (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_res = kind(res)
  REAL*8 resgxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resgxx = kind(resgxx)
  REAL*8 resgxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resgxy = kind(resgxy)
  REAL*8 resgxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resgxz = kind(resgxz)
  REAL*8 resgyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resgyy = kind(resgyy)
  REAL*8 resgyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resgyz = kind(resgyz)
  REAL*8 resgzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resgzz = kind(resgzz)
  REAL*8 reskxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_reskxx = kind(reskxx)
  REAL*8 reskxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_reskxy = kind(reskxy)
  REAL*8 reskxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_reskxz = kind(reskxz)
  REAL*8 reskyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_reskyy = kind(reskyy)
  REAL*8 reskyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_reskyz = kind(reskyz)
  REAL*8 reskzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_reskzz = kind(reskzz)
  REAL*8 resx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resx = kind(resx)
  REAL*8 resy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resy = kind(resy)
  REAL*8 resz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_resz = kind(resz)
  INTEGER X0sf_radius
  INTEGER X1sf_radius
  INTEGER sf_active_length
  INTEGER sf_coordinate_descriptors_length
  INTEGER sf_info_length
  INTEGER sf_maxreflevel_length
  INTEGER sf_minreflevel_length
  INTEGER sf_origin_length
  INTEGER sf_radius_length
  INTEGER sf_shape_descriptors_length
  INTEGER sf_valid_length
  REAL*8 alp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_alp = kind(alp)
  REAL*8 alp_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_alp_p = kind(alp_p)
  REAL*8 alp_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_alp_p_p = kind(alp_p_p)
  REAL*8 betax (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betax = kind(betax)
  REAL*8 betax_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betax_p = kind(betax_p)
  REAL*8 betax_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betax_p_p = kind(betax_p_p)
  REAL*8 betay (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betay = kind(betay)
  REAL*8 betay_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betay_p = kind(betay_p)
  REAL*8 betay_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betay_p_p = kind(betay_p_p)
  REAL*8 betaz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betaz = kind(betaz)
  REAL*8 betaz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betaz_p = kind(betaz_p)
  REAL*8 betaz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_betaz_p_p = kind(betaz_p_p)
  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)
  INTEGER*4 conformal_state
  integer, parameter :: cctki_use_conformal_state = kind(conformal_state)
  REAL*8 dtalp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtalp = kind(dtalp)
  REAL*8 dtalp_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtalp_p = kind(dtalp_p)
  REAL*8 dtalp_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtalp_p_p = kind(dtalp_p_p)
  REAL*8 dtbetax (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetax = kind(dtbetax)
  REAL*8 dtbetax_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetax_p = kind(dtbetax_p)
  REAL*8 dtbetax_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetax_p_p = kind(dtbetax_p_p)
  REAL*8 dtbetay (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetay = kind(dtbetay)
  REAL*8 dtbetay_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetay_p = kind(dtbetay_p)
  REAL*8 dtbetay_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetay_p_p = kind(dtbetay_p_p)
  REAL*8 dtbetaz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetaz = kind(dtbetaz)
  REAL*8 dtbetaz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetaz_p = kind(dtbetaz_p)
  REAL*8 dtbetaz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_dtbetaz_p_p = kind(dtbetaz_p_p)
  INTEGER*4 dtlapse_state
  integer, parameter :: cctki_use_dtlapse_state = kind(dtlapse_state)
  INTEGER*4 dtshift_state
  integer, parameter :: cctki_use_dtshift_state = kind(dtshift_state)
  REAL*8 gxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxx = kind(gxx)
  REAL*8 gxx_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxx_p = kind(gxx_p)
  REAL*8 gxx_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxx_p_p = kind(gxx_p_p)
  REAL*8 gxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxy = kind(gxy)
  REAL*8 gxy_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxy_p = kind(gxy_p)
  REAL*8 gxy_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxy_p_p = kind(gxy_p_p)
  REAL*8 gxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxz = kind(gxz)
  REAL*8 gxz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxz_p = kind(gxz_p)
  REAL*8 gxz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxz_p_p = kind(gxz_p_p)
  REAL*8 gyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyy = kind(gyy)
  REAL*8 gyy_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyy_p = kind(gyy_p)
  REAL*8 gyy_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyy_p_p = kind(gyy_p_p)
  REAL*8 gyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyz = kind(gyz)
  REAL*8 gyz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyz_p = kind(gyz_p)
  REAL*8 gyz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyz_p_p = kind(gyz_p_p)
  REAL*8 gzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gzz = kind(gzz)
  REAL*8 gzz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gzz_p = kind(gzz_p)
  REAL*8 gzz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gzz_p_p = kind(gzz_p_p)
  REAL*8 kxx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxx = kind(kxx)
  REAL*8 kxx_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxx_p = kind(kxx_p)
  REAL*8 kxx_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxx_p_p = kind(kxx_p_p)
  REAL*8 kxy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxy = kind(kxy)
  REAL*8 kxy_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxy_p = kind(kxy_p)
  REAL*8 kxy_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxy_p_p = kind(kxy_p_p)
  REAL*8 kxz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxz = kind(kxz)
  REAL*8 kxz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxz_p = kind(kxz_p)
  REAL*8 kxz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kxz_p_p = kind(kxz_p_p)
  REAL*8 kyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kyy = kind(kyy)
  REAL*8 kyy_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kyy_p = kind(kyy_p)
  REAL*8 kyy_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kyy_p_p = kind(kyy_p_p)
  REAL*8 kyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kyz = kind(kyz)
  REAL*8 kyz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kyz_p = kind(kyz_p)
  REAL*8 kyz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kyz_p_p = kind(kyz_p_p)
  REAL*8 kzz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kzz = kind(kzz)
  REAL*8 kzz_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kzz_p = kind(kzz_p)
  REAL*8 kzz_p_p (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_kzz_p_p = kind(kzz_p_p)
  REAL*8 psi (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psi = kind(psi)
  REAL*8 psix (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psix = kind(psix)
  REAL*8 psixx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psixx = kind(psixx)
  REAL*8 psixy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psixy = kind(psixy)
  REAL*8 psixz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psixz = kind(psixz)
  REAL*8 psiy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psiy = kind(psiy)
  REAL*8 psiyy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psiyy = kind(psiyy)
  REAL*8 psiyz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psiyz = kind(psiyz)
  REAL*8 psiz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psiz = kind(psiz)
  REAL*8 psizz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_psizz = kind(psizz)
  REAL*8 r (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_r = kind(r)
  INTEGER*4 sf_active (sf_active_length)
  integer, parameter :: cctki_use_sf_active = kind(sf_active)
  REAL*8 sf_area (sf_info_length)
  integer, parameter :: cctki_use_sf_area = kind(sf_area)
  REAL*8 sf_centroid_x (sf_info_length)
  integer, parameter :: cctki_use_sf_centroid_x = kind(sf_centroid_x)
  REAL*8 sf_centroid_y (sf_info_length)
  integer, parameter :: cctki_use_sf_centroid_y = kind(sf_centroid_y)
  REAL*8 sf_centroid_z (sf_info_length)
  integer, parameter :: cctki_use_sf_centroid_z = kind(sf_centroid_z)
  REAL*8 sf_delta_phi (sf_coordinate_descriptors_length)
  integer, parameter :: cctki_use_sf_delta_phi = kind(sf_delta_phi)
  REAL*8 sf_delta_theta (sf_coordinate_descriptors_length)
  integer, parameter :: cctki_use_sf_delta_theta = kind(sf_delta_theta)
  REAL*8 sf_max_radius (sf_info_length)
  integer, parameter :: cctki_use_sf_max_radius = kind(sf_max_radius)
  REAL*8 sf_max_x (sf_info_length)
  integer, parameter :: cctki_use_sf_max_x = kind(sf_max_x)
  REAL*8 sf_max_y (sf_info_length)
  integer, parameter :: cctki_use_sf_max_y = kind(sf_max_y)
  REAL*8 sf_max_z (sf_info_length)
  integer, parameter :: cctki_use_sf_max_z = kind(sf_max_z)
  INTEGER*4 sf_maxreflevel (sf_maxreflevel_length)
  integer, parameter :: cctki_use_sf_maxreflevel = kind(sf_maxreflevel)
  REAL*8 sf_mean_radius (sf_info_length)
  integer, parameter :: cctki_use_sf_mean_radius = kind(sf_mean_radius)
  REAL*8 sf_min_radius (sf_info_length)
  integer, parameter :: cctki_use_sf_min_radius = kind(sf_min_radius)
  REAL*8 sf_min_x (sf_info_length)
  integer, parameter :: cctki_use_sf_min_x = kind(sf_min_x)
  REAL*8 sf_min_y (sf_info_length)
  integer, parameter :: cctki_use_sf_min_y = kind(sf_min_y)
  REAL*8 sf_min_z (sf_info_length)
  integer, parameter :: cctki_use_sf_min_z = kind(sf_min_z)
  INTEGER*4 sf_minreflevel (sf_minreflevel_length)
  integer, parameter :: cctki_use_sf_minreflevel = kind(sf_minreflevel)
  INTEGER*4 sf_nghostsphi (sf_shape_descriptors_length)
  integer, parameter :: cctki_use_sf_nghostsphi = kind(sf_nghostsphi)
  INTEGER*4 sf_nghoststheta (sf_shape_descriptors_length)
  integer, parameter :: cctki_use_sf_nghoststheta = kind(sf_nghoststheta)
  INTEGER*4 sf_nphi (sf_shape_descriptors_length)
  integer, parameter :: cctki_use_sf_nphi = kind(sf_nphi)
  INTEGER*4 sf_ntheta (sf_shape_descriptors_length)
  integer, parameter :: cctki_use_sf_ntheta = kind(sf_ntheta)
  REAL*8 sf_origin_phi (sf_coordinate_descriptors_length)
  integer, parameter :: cctki_use_sf_origin_phi = kind(sf_origin_phi)
  REAL*8 sf_origin_theta (sf_coordinate_descriptors_length)
  integer, parameter :: cctki_use_sf_origin_theta = kind(sf_origin_theta)
  REAL*8 sf_origin_x (sf_origin_length)
  integer, parameter :: cctki_use_sf_origin_x = kind(sf_origin_x)
  REAL*8 sf_origin_y (sf_origin_length)
  integer, parameter :: cctki_use_sf_origin_y = kind(sf_origin_y)
  REAL*8 sf_origin_z (sf_origin_length)
  integer, parameter :: cctki_use_sf_origin_z = kind(sf_origin_z)
  REAL*8 sf_quadrupole_xx (sf_info_length)
  integer, parameter :: cctki_use_sf_quadrupole_xx = kind(sf_quadrupole_xx)
  REAL*8 sf_quadrupole_xy (sf_info_length)
  integer, parameter :: cctki_use_sf_quadrupole_xy = kind(sf_quadrupole_xy)
  REAL*8 sf_quadrupole_xz (sf_info_length)
  integer, parameter :: cctki_use_sf_quadrupole_xz = kind(sf_quadrupole_xz)
  REAL*8 sf_quadrupole_yy (sf_info_length)
  integer, parameter :: cctki_use_sf_quadrupole_yy = kind(sf_quadrupole_yy)
  REAL*8 sf_quadrupole_yz (sf_info_length)
  integer, parameter :: cctki_use_sf_quadrupole_yz = kind(sf_quadrupole_yz)
  REAL*8 sf_quadrupole_zz (sf_info_length)
  integer, parameter :: cctki_use_sf_quadrupole_zz = kind(sf_quadrupole_zz)
  REAL*8 sf_radius (X0sf_radius,X1sf_radius,sf_radius_length)
  integer, parameter :: cctki_use_sf_radius = kind(sf_radius)
  INTEGER*4 sf_valid (sf_valid_length)
  integer, parameter :: cctki_use_sf_valid = kind(sf_valid)
  INTEGER*4 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  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 Boundary_SelectGroupForBC (GH, faces, boundary_width, table_handle, var_name, bc_name)
  implicit none
  integer*8 GH
  INTEGER*4 faces
  INTEGER*4 boundary_width
  INTEGER*4 table_handle
  character(*) var_name
  character(*) bc_name
  end function Boundary_SelectGroupForBC
  end interface
  interface
  INTEGER*4 function MoLQueryEvolvedRHS (EvolvedIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  end function MoLQueryEvolvedRHS
  end interface
  REAL*8 Minkowski_scale (10)
  integer, parameter :: cctki_use_Minkowski_scale = kind(Minkowski_scale)
  REAL*8 centre_x (10)
  integer, parameter :: cctki_use_centre_x = kind(centre_x)
  REAL*8 centre_y (10)
  integer, parameter :: cctki_use_centre_y = kind(centre_y)
  REAL*8 centre_z (10)
  integer, parameter :: cctki_use_centre_z = kind(centre_z)
  REAL*8 lapse_scale (10)
  integer, parameter :: cctki_use_lapse_scale = kind(lapse_scale)
  REAL*8 radius (10)
  integer, parameter :: cctki_use_radius = kind(radius)
  REAL*8 radius_x (10)
  integer, parameter :: cctki_use_radius_x = kind(radius_x)
  REAL*8 radius_y (10)
  integer, parameter :: cctki_use_radius_y = kind(radius_y)
  REAL*8 radius_z (10)
  integer, parameter :: cctki_use_radius_z = kind(radius_z)
  REAL*8 reduction_factor (10)
  integer, parameter :: cctki_use_reduction_factor = kind(reduction_factor)
  REAL*8 smoothing_eps
  integer, parameter :: cctki_use_smoothing_eps = kind(smoothing_eps)
  REAL*8 smoothing_factor
  integer, parameter :: cctki_use_smoothing_factor = kind(smoothing_factor)
  REAL*8 smoothing_zone_width (10)
  integer, parameter :: cctki_use_smoothing_zone_width = kind(smoothing_zone_width)
  integer*8 method
  integer, parameter :: cctki_use_method = kind(method)
  integer*8 region_shape (10)
  integer, parameter :: cctki_use_region_shape = kind(region_shape)
  integer*8 smoothing_function (10)
  integer, parameter :: cctki_use_smoothing_function = kind(smoothing_function)
  INTEGER*4 num_regions
  integer, parameter :: cctki_use_num_regions = kind(num_regions)
  INTEGER*4 overwrite_geometry (10)
  integer, parameter :: cctki_use_overwrite_geometry = kind(overwrite_geometry)
  INTEGER*4 overwrite_lapse (10)
  integer, parameter :: cctki_use_overwrite_lapse = kind(overwrite_lapse)
  INTEGER*4 overwrite_shift (10)
  integer, parameter :: cctki_use_overwrite_shift = kind(overwrite_shift)
  INTEGER*4 reduce_rhs (10)
  integer, parameter :: cctki_use_reduce_rhs = kind(reduce_rhs)
  INTEGER*4 smooth_regions
  integer, parameter :: cctki_use_smooth_regions = kind(smooth_regions)
  INTEGER*4 smoothing_iterations
  integer, parameter :: cctki_use_smoothing_iterations = kind(smoothing_iterations)
  INTEGER*4 smoothing_order
  integer, parameter :: cctki_use_smoothing_order = kind(smoothing_order)
  INTEGER*4 surface_index (10)
  integer, parameter :: cctki_use_surface_index = kind(surface_index)
  INTEGER*4 use_user_regions
  integer, parameter :: cctki_use_use_user_regions = kind(use_user_regions)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NoExcisionpriv/Minkowski_scale, centre_x, centre_y, centre_z, lapse_scale, radius, radius_x, radius_y, radius_z, reductio&
  &n_factor, smoothing_eps, smoothing_factor, smoothing_zone_width, method, region_shape, smoothing_function, num_regions, overwrit&
  &e_geometry, overwrite_lapse, overwrite_shift, reduce_rhs, smooth_regions, smoothing_iterations, smoothing_order, surface_index, &
  &use_user_regions, verbose

  REAL*8, parameter :: zero=0
  REAL*8 :: mask (cctk_lsh(1), cctk_lsh(2), cctk_lsh(3))
  REAL*8 :: cx, cy, cz, radx, rady, radz
  integer   :: n
  integer   :: iter
  integer   :: ierr
  
  do iter = 1, smoothing_iterations
     
     do n = 1, num_regions
        
        cx = centre_x(n)
        cy = centre_y(n)
        cz = centre_z(n)
        if ((CCTK_Equals(region_shape(n), "sphere") .ne. 0)) then
           radx = radius(n)
           rady = radius(n)
           radz = radius(n)
        else if ((CCTK_Equals(region_shape(n), "ellipsoid") .ne. 0)) then
           radx = radius_x(n)
           rady = radius_y(n)
           radz = radius_z(n)
        else
           call CCTK_Warn(0,37,"smooth.F90","NoExcision", "internal error")
        end if
        
        mask = 1 - sqrt (((x - cx) / radx)**2 + &
             &           ((y - cy) / rady)**2 + &
             &           ((z - cz) / radz)**2)
        where (mask <= 0)
           mask = 0             
        elsewhere (mask >= smoothing_zone_width(n))
           mask = 1             
        elsewhere
           mask = mask / smoothing_zone_width(n) 
        end where
        
        if (overwrite_geometry(n) /= 0) then
           
           if (conformal_state >= 1) then
              call smooth (psi)
           end if
           if (conformal_state >= 2) then
              call smooth (psix)
              call smooth (psiy)
              call smooth (psiz)
           end if
           if (conformal_state >= 3) then
              call smooth (psixx)
              call smooth (psixy)
              call smooth (psixz)
              call smooth (psiyy)
              call smooth (psiyz)
              call smooth (psizz)
           end if
           
           call smooth (gxx)
           call smooth (gxy)
           call smooth (gxz)
           call smooth (gyy)
           call smooth (gyz)
           call smooth (gzz)
           call smooth (kxx)
           call smooth (kxy)
           call smooth (kxz)
           call smooth (kyy)
           call smooth (kyz)
           call smooth (kzz)
           
        end if
        
        if (overwrite_lapse(n) /= 0) then
           
           call smooth (alp)
           
        end if
        
        if (overwrite_shift(n) /= 0) then
           
           if (shift_state /= 0) then
              call smooth (betax)
              call smooth (betay)
              call smooth (betaz)
           end if
           
        end if
        
     end do
     
     if (overwrite_geometry(n) /= 0) then
        
        if (conformal_state >= 1) then
           call CCTK_SyncGroup (ierr, cctkGH, "StaticConformal::confac")
        end if
        if (conformal_state >= 2) then
           call CCTK_SyncGroup (ierr, cctkGH, "StaticConformal::confac_1derivs")
        end if
        if (conformal_state >= 3) then
           call CCTK_SyncGroup (ierr, cctkGH, "StaticConformal::confac_2derivs")
        end if
        
        call CCTK_SyncGroup (ierr, cctkGH, "ADMBase::metric")
        call CCTK_SyncGroup (ierr, cctkGH, "ADMBase::curv")
        
     end if
     
     if (overwrite_lapse(n) /= 0) then
        
        call CCTK_SyncGroup (ierr, cctkGH, "ADMBase::lapse")
        
     end if
     
     if (overwrite_shift(n) /= 0) then
        
        if (shift_state /= 0) then
           call CCTK_SyncGroup (ierr, cctkGH, "ADMBase::shift")
        end if
        
     end if
     
  end do
  
contains
  
  subroutine smooth (val)
    REAL*8, intent(inout) :: val(:,:,:)
    
    where (mask > 0)
       val =  (1 - mask * smoothing_factor) * val &
            & + (mask * smoothing_factor / 6) &
            &   * (+ eoshift(val, +1, dim=1) + eoshift(val, -1, dim=1) &
            &      + eoshift(val, +1, dim=2) + eoshift(val, -1, dim=2) &
            &      + eoshift(val, +1, dim=3) + eoshift(val, -1, dim=3))
    end where
  end subroutine smooth
  
end subroutine NoExcision_Smooth
