























































































































 


































































































































































 




























































































































































































































































 





















































































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



























































































subroutine WavExtrL_SubtrSpherMetric(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_align&
  &ment,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,&
  &cctk_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2&
  &,cctk_ash3, X0MoncriefQ,X0MoncriefQ_Results_group,X0Schwarzschild_Mass_Radius_Results_group,X0gridsizes_group,X0interp_metric_ar&
  &rays,X0surface_arrays,X0surface_integrands,X1MoncriefQ,X1MoncriefQ_Results_group,X1interp_metric_arrays,X1surface_arrays,X1surfa&
  &ce_integrands,X2MoncriefQ_Results_group,my_out_every_det_length,Gi,H2i,Ki,Qeven_Im,Qeven_Im_Array,Qeven_Re,Qeven_Re_Array,Qodd_I&
  &m,Qodd_Im_Array,Qodd_Re,Qodd_Re_Array,S_factor,Schw_Masses,Schw_Radii,Schwarzschild_Mass,Schwarzschild_Radius,c1i,c2i,cosphi,cos&
  &theta,cphi,ctheta,current_detector,current_detector_radius,dGi,dKi,dc2i,do_nothing,dr_gpp,dr_gtp,dr_gtt,dr_gxxi,dr_gxyi,dr_gxzi,&
  &dr_gyyi,dr_gyzi,dr_gzzi,dr_psii,dri_drsch,drsch_dri,dtau_dt,dx_gxxi,dx_gxyi,dx_gxzi,dx_gyyi,dx_gyzi,dx_gzzi,dx_psii,dy_gxxi,dy_g&
  &xyi,dy_gxzi,dy_gyyi,dy_gyzi,dy_gzzi,dy_psii,dz_gxxi,dz_gxyi,dz_gxzi,dz_gyyi,dz_gyzi,dz_gzzi,dz_psii,gpp,grp,grr,grt,gtp,gtt,gxx_&
  &tmp,gxxi,gxy_tmp,gxyi,gxz_tmp,gxzi,gyy_tmp,gyyi,gyz_tmp,gyzi,gzz_tmp,gzzi,h1i,iGi,iH2i,iKi,ic1i,ic2i,idGi,idKi,idc2i,ih1i,int_np&
  &hi,int_ntheta,int_tmp1,int_tmp10,int_tmp11,int_tmp12,int_tmp13,int_tmp14,int_tmp15,int_tmp16,int_tmp17,int_tmp18,int_tmp2,int_tm&
  &p3,int_tmp4,int_tmp5,int_tmp6,int_tmp7,int_tmp8,int_tmp9,interp_x,interp_y,interp_z,l_max,l_min,l_step,m_max,m_min,m_step,max_de&
  &t_no_param,my_out_every_det,phiweights,psi_ext_deriv,psii,rsch,rsch2,sinphi,sintheta,sph_dr_gtt,sph_gpp,sph_grr,sph_gtt,sum_hand&
  &le,sym_factor,thetaweights,weights, X0sf_radius,X1sf_radius,sf_active_length,sf_coordinate_descriptors_length,sf_info_length,sf_&
  &maxreflevel_length,sf_minreflevel_length,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,betay,betay_p,betay_p_p,betaz,betaz_p,betaz_p_p,coarse_dx,coarse_dy,coarse_dz,conformal_state,d&
  &talp,dtalp_p,dtalp_p_p,dtbetax,dtbetax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,dtlapse_state,d&
  &tshift_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,kxz_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_active,sf_area,sf_centroid_x,sf_centroid_y,sf_centroid_z,sf_delta_phi,sf_delta_theta,sf_max_rad&
  &ius,sf_max_x,sf_max_y,sf_max_z,sf_maxreflevel,sf_mean_radius,sf_min_radius,sf_min_x,sf_min_y,sf_min_z,sf_minreflevel,sf_nghostsp&
  &hi,sf_nghoststheta,sf_nphi,sf_ntheta,sf_origin_phi,sf_origin_theta,sf_origin_x,sf_origin_y,sf_origin_z,sf_quadrupole_xx,sf_quadr&
  &upole_xy,sf_quadrupole_xz,sf_quadrupole_yy,sf_quadrupole_yz,sf_quadrupole_zz,sf_radius,sf_valid,shift_state,x,y,z)

  implicit none

  INTEGER*4 :: istat


  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)
  INTEGER X0MoncriefQ
  INTEGER X0MoncriefQ_Results_group
  INTEGER X0Schwarzschild_Mass_Radius_Results_group
  INTEGER X0gridsizes_group
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_integrands
  INTEGER X1MoncriefQ
  INTEGER X1MoncriefQ_Results_group
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_integrands
  INTEGER X2MoncriefQ_Results_group
  INTEGER my_out_every_det_length
  REAL*8 Gi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_Gi = kind(Gi)
  REAL*8 H2i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_H2i = kind(H2i)
  REAL*8 Ki (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_Ki = kind(Ki)
  REAL*8 Qeven_Im (X0MoncriefQ,X1MoncriefQ)
  integer, parameter :: cctki_use_Qeven_Im = kind(Qeven_Im)
  REAL*8 Qeven_Im_Array (X0MoncriefQ_Results_group,X1MoncriefQ_Results_group,X2MoncriefQ_Results_group)
  integer, parameter :: cctki_use_Qeven_Im_Array = kind(Qeven_Im_Array)
  REAL*8 Qeven_Re (X0MoncriefQ,X1MoncriefQ)
  integer, parameter :: cctki_use_Qeven_Re = kind(Qeven_Re)
  REAL*8 Qeven_Re_Array (X0MoncriefQ_Results_group,X1MoncriefQ_Results_group,X2MoncriefQ_Results_group)
  integer, parameter :: cctki_use_Qeven_Re_Array = kind(Qeven_Re_Array)
  REAL*8 Qodd_Im (X0MoncriefQ,X1MoncriefQ)
  integer, parameter :: cctki_use_Qodd_Im = kind(Qodd_Im)
  REAL*8 Qodd_Im_Array (X0MoncriefQ_Results_group,X1MoncriefQ_Results_group,X2MoncriefQ_Results_group)
  integer, parameter :: cctki_use_Qodd_Im_Array = kind(Qodd_Im_Array)
  REAL*8 Qodd_Re (X0MoncriefQ,X1MoncriefQ)
  integer, parameter :: cctki_use_Qodd_Re = kind(Qodd_Re)
  REAL*8 Qodd_Re_Array (X0MoncriefQ_Results_group,X1MoncriefQ_Results_group,X2MoncriefQ_Results_group)
  integer, parameter :: cctki_use_Qodd_Re_Array = kind(Qodd_Re_Array)
  REAL*8 S_factor
  integer, parameter :: cctki_use_S_factor = kind(S_factor)
  REAL*8 Schw_Masses (X0Schwarzschild_Mass_Radius_Results_group)
  integer, parameter :: cctki_use_Schw_Masses = kind(Schw_Masses)
  REAL*8 Schw_Radii (X0Schwarzschild_Mass_Radius_Results_group)
  integer, parameter :: cctki_use_Schw_Radii = kind(Schw_Radii)
  REAL*8 Schwarzschild_Mass
  integer, parameter :: cctki_use_Schwarzschild_Mass = kind(Schwarzschild_Mass)
  REAL*8 Schwarzschild_Radius
  integer, parameter :: cctki_use_Schwarzschild_Radius = kind(Schwarzschild_Radius)
  REAL*8 c1i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_c1i = kind(c1i)
  REAL*8 c2i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_c2i = kind(c2i)
  REAL*8 cosphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_cosphi = kind(cosphi)
  REAL*8 costheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_costheta = kind(costheta)
  REAL*8 cphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_cphi = kind(cphi)
  REAL*8 ctheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_ctheta = kind(ctheta)
  INTEGER*4 current_detector
  integer, parameter :: cctki_use_current_detector = kind(current_detector)
  REAL*8 current_detector_radius
  integer, parameter :: cctki_use_current_detector_radius = kind(current_detector_radius)
  REAL*8 dGi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dGi = kind(dGi)
  REAL*8 dKi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dKi = kind(dKi)
  REAL*8 dc2i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dc2i = kind(dc2i)
  INTEGER*4 do_nothing
  integer, parameter :: cctki_use_do_nothing = kind(do_nothing)
  REAL*8 dr_gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gpp = kind(dr_gpp)
  REAL*8 dr_gtp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gtp = kind(dr_gtp)
  REAL*8 dr_gtt (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gtt = kind(dr_gtt)
  REAL*8 dr_gxxi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gxxi = kind(dr_gxxi)
  REAL*8 dr_gxyi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gxyi = kind(dr_gxyi)
  REAL*8 dr_gxzi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gxzi = kind(dr_gxzi)
  REAL*8 dr_gyyi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gyyi = kind(dr_gyyi)
  REAL*8 dr_gyzi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gyzi = kind(dr_gyzi)
  REAL*8 dr_gzzi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_gzzi = kind(dr_gzzi)
  REAL*8 dr_psii (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dr_psii = kind(dr_psii)
  REAL*8 dri_drsch
  integer, parameter :: cctki_use_dri_drsch = kind(dri_drsch)
  REAL*8 drsch_dri
  integer, parameter :: cctki_use_drsch_dri = kind(drsch_dri)
  REAL*8 dtau_dt
  integer, parameter :: cctki_use_dtau_dt = kind(dtau_dt)
  REAL*8 dx_gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_gxxi = kind(dx_gxxi)
  REAL*8 dx_gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_gxyi = kind(dx_gxyi)
  REAL*8 dx_gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_gxzi = kind(dx_gxzi)
  REAL*8 dx_gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_gyyi = kind(dx_gyyi)
  REAL*8 dx_gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_gyzi = kind(dx_gyzi)
  REAL*8 dx_gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_gzzi = kind(dx_gzzi)
  REAL*8 dx_psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dx_psii = kind(dx_psii)
  REAL*8 dy_gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_gxxi = kind(dy_gxxi)
  REAL*8 dy_gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_gxyi = kind(dy_gxyi)
  REAL*8 dy_gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_gxzi = kind(dy_gxzi)
  REAL*8 dy_gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_gyyi = kind(dy_gyyi)
  REAL*8 dy_gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_gyzi = kind(dy_gyzi)
  REAL*8 dy_gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_gzzi = kind(dy_gzzi)
  REAL*8 dy_psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dy_psii = kind(dy_psii)
  REAL*8 dz_gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_gxxi = kind(dz_gxxi)
  REAL*8 dz_gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_gxyi = kind(dz_gxyi)
  REAL*8 dz_gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_gxzi = kind(dz_gxzi)
  REAL*8 dz_gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_gyyi = kind(dz_gyyi)
  REAL*8 dz_gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_gyzi = kind(dz_gyzi)
  REAL*8 dz_gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_gzzi = kind(dz_gzzi)
  REAL*8 dz_psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_dz_psii = kind(dz_psii)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  REAL*8 grp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_grp = kind(grp)
  REAL*8 grr (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_grr = kind(grr)
  REAL*8 grt (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_grt = kind(grt)
  REAL*8 gtp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gtp = kind(gtp)
  REAL*8 gtt (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gtt = kind(gtt)
  REAL*8 gxx_tmp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxx_tmp = kind(gxx_tmp)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxy_tmp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxy_tmp = kind(gxy_tmp)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxz_tmp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gxz_tmp = kind(gxz_tmp)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyy_tmp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyy_tmp = kind(gyy_tmp)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyz_tmp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gyz_tmp = kind(gyz_tmp)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzz_tmp (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_gzz_tmp = kind(gzz_tmp)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 h1i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_h1i = kind(h1i)
  REAL*8 iGi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_iGi = kind(iGi)
  REAL*8 iH2i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_iH2i = kind(iH2i)
  REAL*8 iKi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_iKi = kind(iKi)
  REAL*8 ic1i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_ic1i = kind(ic1i)
  REAL*8 ic2i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_ic2i = kind(ic2i)
  REAL*8 idGi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_idGi = kind(idGi)
  REAL*8 idKi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_idKi = kind(idKi)
  REAL*8 idc2i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_idc2i = kind(idc2i)
  REAL*8 ih1i (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_ih1i = kind(ih1i)
  INTEGER*4 int_nphi (X0gridsizes_group)
  integer, parameter :: cctki_use_int_nphi = kind(int_nphi)
  INTEGER*4 int_ntheta (X0gridsizes_group)
  integer, parameter :: cctki_use_int_ntheta = kind(int_ntheta)
  REAL*8 int_tmp1 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp1 = kind(int_tmp1)
  REAL*8 int_tmp10 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp10 = kind(int_tmp10)
  REAL*8 int_tmp11 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp11 = kind(int_tmp11)
  REAL*8 int_tmp12 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp12 = kind(int_tmp12)
  REAL*8 int_tmp13 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp13 = kind(int_tmp13)
  REAL*8 int_tmp14 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp14 = kind(int_tmp14)
  REAL*8 int_tmp15 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp15 = kind(int_tmp15)
  REAL*8 int_tmp16 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp16 = kind(int_tmp16)
  REAL*8 int_tmp17 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp17 = kind(int_tmp17)
  REAL*8 int_tmp18 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp18 = kind(int_tmp18)
  REAL*8 int_tmp2 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp2 = kind(int_tmp2)
  REAL*8 int_tmp3 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp3 = kind(int_tmp3)
  REAL*8 int_tmp4 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp4 = kind(int_tmp4)
  REAL*8 int_tmp5 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp5 = kind(int_tmp5)
  REAL*8 int_tmp6 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp6 = kind(int_tmp6)
  REAL*8 int_tmp7 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp7 = kind(int_tmp7)
  REAL*8 int_tmp8 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp8 = kind(int_tmp8)
  REAL*8 int_tmp9 (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_int_tmp9 = kind(int_tmp9)
  REAL*8 interp_x (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 l_max
  integer, parameter :: cctki_use_l_max = kind(l_max)
  INTEGER*4 l_min
  integer, parameter :: cctki_use_l_min = kind(l_min)
  INTEGER*4 l_step
  integer, parameter :: cctki_use_l_step = kind(l_step)
  INTEGER*4 m_max
  integer, parameter :: cctki_use_m_max = kind(m_max)
  INTEGER*4 m_min
  integer, parameter :: cctki_use_m_min = kind(m_min)
  INTEGER*4 m_step
  integer, parameter :: cctki_use_m_step = kind(m_step)
  INTEGER*4 max_det_no_param
  integer, parameter :: cctki_use_max_det_no_param = kind(max_det_no_param)
  INTEGER*4 my_out_every_det (my_out_every_det_length)
  integer, parameter :: cctki_use_my_out_every_det = kind(my_out_every_det)
  REAL*8 phiweights (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  REAL*8 psi_ext_deriv (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_psi_ext_deriv = kind(psi_ext_deriv)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  REAL*8 rsch
  integer, parameter :: cctki_use_rsch = kind(rsch)
  REAL*8 rsch2
  integer, parameter :: cctki_use_rsch2 = kind(rsch2)
  REAL*8 sinphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_sinphi = kind(sinphi)
  REAL*8 sintheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_sintheta = kind(sintheta)
  REAL*8 sph_dr_gtt
  integer, parameter :: cctki_use_sph_dr_gtt = kind(sph_dr_gtt)
  REAL*8 sph_gpp
  integer, parameter :: cctki_use_sph_gpp = kind(sph_gpp)
  REAL*8 sph_grr
  integer, parameter :: cctki_use_sph_grr = kind(sph_grr)
  REAL*8 sph_gtt
  integer, parameter :: cctki_use_sph_gtt = kind(sph_gtt)
  INTEGER*4 sum_handle
  integer, parameter :: cctki_use_sum_handle = kind(sum_handle)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 thetaweights (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  REAL*8 weights (X0surface_integrands,X1surface_integrands)
  integer, parameter :: cctki_use_weights = kind(weights)
  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)
  REAL*8 Cauchy_radius_dr
  integer, parameter :: cctki_use_Cauchy_radius_dr = kind(Cauchy_radius_dr)
  REAL*8 Cauchy_radius_end_coord
  integer, parameter :: cctki_use_Cauchy_radius_end_coord = kind(Cauchy_radius_end_coord)
  REAL*8 Cauchy_radius_end_factor
  integer, parameter :: cctki_use_Cauchy_radius_end_factor = kind(Cauchy_radius_end_factor)
  REAL*8 Cauchy_radius_start_coord
  integer, parameter :: cctki_use_Cauchy_radius_start_coord = kind(Cauchy_radius_start_coord)
  REAL*8 Cauchy_radius_start_factor
  integer, parameter :: cctki_use_Cauchy_radius_start_factor = kind(Cauchy_radius_start_factor)
  REAL*8 cartoon_grid_acc
  integer, parameter :: cctki_use_cartoon_grid_acc = kind(cartoon_grid_acc)
  REAL*8 detector_radius (100)
  integer, parameter :: cctki_use_detector_radius = kind(detector_radius)
  REAL*8 origin_x
  integer, parameter :: cctki_use_origin_x = kind(origin_x)
  REAL*8 origin_y
  integer, parameter :: cctki_use_origin_y = kind(origin_y)
  REAL*8 origin_z
  integer, parameter :: cctki_use_origin_z = kind(origin_z)
  REAL*8 ringdown_margin
  integer, parameter :: cctki_use_ringdown_margin = kind(ringdown_margin)
  REAL*8 rotation_omega
  integer, parameter :: cctki_use_rotation_omega = kind(rotation_omega)
  integer*8 detection_mode
  integer, parameter :: cctki_use_detection_mode = kind(detection_mode)
  integer*8 detector_metric (100)
  integer, parameter :: cctki_use_detector_metric = kind(detector_metric)
  integer*8 drsch_dri_computation
  integer, parameter :: cctki_use_drsch_dri_computation = kind(drsch_dri_computation)
  integer*8 integration_method
  integer, parameter :: cctki_use_integration_method = kind(integration_method)
  integer*8 interpolation_operator
  integer, parameter :: cctki_use_interpolation_operator = kind(interpolation_operator)
  integer*8 mode_type
  integer, parameter :: cctki_use_mode_type = kind(mode_type)
  integer*8 out_dir
  integer, parameter :: cctki_use_out_dir = kind(out_dir)
  integer*8 out_format
  integer, parameter :: cctki_use_out_format = kind(out_format)
  integer*8 out_style
  integer, parameter :: cctki_use_out_style = kind(out_style)
  integer*8 rsch2_computation
  integer, parameter :: cctki_use_rsch2_computation = kind(rsch2_computation)
  INTEGER*4 Cauchy_time_ID
  integer, parameter :: cctki_use_Cauchy_time_ID = kind(Cauchy_time_ID)
  INTEGER*4 active
  integer, parameter :: cctki_use_active = kind(active)
  INTEGER*4 calc_when_necessary
  integer, parameter :: cctki_use_calc_when_necessary = kind(calc_when_necessary)
  INTEGER*4 cartoon
  integer, parameter :: cctki_use_cartoon = kind(cartoon)
  INTEGER*4 cauchy_radius_extreme
  integer, parameter :: cctki_use_cauchy_radius_extreme = kind(cauchy_radius_extreme)
  INTEGER*4 check_rmax
  integer, parameter :: cctki_use_check_rmax = kind(check_rmax)
  INTEGER*4 corotate
  integer, parameter :: cctki_use_corotate = kind(corotate)
  INTEGER*4 corotate3d
  integer, parameter :: cctki_use_corotate3d = kind(corotate3d)
  INTEGER*4 interpolation_order
  integer, parameter :: cctki_use_interpolation_order = kind(interpolation_order)
  INTEGER*4 interpolation_stencil
  integer, parameter :: cctki_use_interpolation_stencil = kind(interpolation_stencil)
  INTEGER*4 l_mode
  integer, parameter :: cctki_use_l_mode = kind(l_mode)
  INTEGER*4 m_mode
  integer, parameter :: cctki_use_m_mode = kind(m_mode)
  INTEGER*4 make_interpolator_warnings_fatal
  integer, parameter :: cctki_use_make_interpolator_warnings_fatal = kind(make_interpolator_warnings_fatal)
  INTEGER*4 maximum_detector_number
  integer, parameter :: cctki_use_maximum_detector_number = kind(maximum_detector_number)
  INTEGER*4 maxnphi
  integer, parameter :: cctki_use_maxnphi = kind(maxnphi)
  INTEGER*4 maxntheta
  integer, parameter :: cctki_use_maxntheta = kind(maxntheta)
  INTEGER*4 nphi (100)
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta (100)
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 observers
  integer, parameter :: cctki_use_observers = kind(observers)
  INTEGER*4 out_every
  integer, parameter :: cctki_use_out_every = kind(out_every)
  INTEGER*4 out_every_det (100)
  integer, parameter :: cctki_use_out_every_det = kind(out_every_det)
  INTEGER*4 phicorotate
  integer, parameter :: cctki_use_phicorotate = kind(phicorotate)
  INTEGER*4 start_iteration
  integer, parameter :: cctki_use_start_iteration = kind(start_iteration)
  INTEGER*4 start_time
  integer, parameter :: cctki_use_start_time = kind(start_time)
  INTEGER*4 subtract_spherical_background
  integer, parameter :: cctki_use_subtract_spherical_background = kind(subtract_spherical_background)
  INTEGER*4 surface_index (100)
  integer, parameter :: cctki_use_surface_index = kind(surface_index)
  INTEGER*4 switch_output_format
  integer, parameter :: cctki_use_switch_output_format = kind(switch_output_format)
  INTEGER*4 use_conformal_factor (100)
  integer, parameter :: cctki_use_use_conformal_factor = kind(use_conformal_factor)
  INTEGER*4 use_spherical_surface
  integer, parameter :: cctki_use_use_spherical_surface = kind(use_spherical_surface)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  INTEGER*4 write_timer_info
  integer, parameter :: cctki_use_write_timer_info = kind(write_timer_info)
  COMMON /WaveExtractLpriv/Cauchy_radius_dr, Cauchy_radius_end_coord, Cauchy_radius_end_factor, Cauchy_radius_start_coord, Cauchy_r&
  &adius_start_factor, cartoon_grid_acc, detector_radius, origin_x, origin_y, origin_z, ringdown_margin, rotation_omega, detection_&
  &mode, detector_metric, drsch_dri_computation, integration_method, interpolation_operator, mode_type, out_dir, out_format, out_st&
  &yle, rsch2_computation, Cauchy_time_ID, active, calc_when_necessary, cartoon, cauchy_radius_extreme, check_rmax, corotate, corot&
  &ate3d, interpolation_order, interpolation_stencil, l_mode, m_mode, make_interpolator_warnings_fatal, maximum_detector_number, ma&
  &xnphi, maxntheta, nphi, ntheta, observers, out_every, out_every_det, phicorotate, start_iteration, start_time, subtract_spherica&
  &l_background, surface_index, switch_output_format, use_conformal_factor, use_spherical_surface, verbose, write_timer_info
  integer*8 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  integer*8 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  integer*8 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  integer*8 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  integer*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, CCTKH6, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH12, metric_type&
  &, CCTKH14, CCTKH15, CCTKH11, CCTKH13, CCTKH16
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  REAL*8 CCTKH29
  integer, parameter :: cctki_use_CCTKH29 = kind(CCTKH29)
  REAL*8 CCTKH30
  integer, parameter :: cctki_use_CCTKH30 = kind(CCTKH30)
  REAL*8 CCTKH31
  integer, parameter :: cctki_use_CCTKH31 = kind(CCTKH31)
  REAL*8 CCTKH32
  integer, parameter :: cctki_use_CCTKH32 = kind(CCTKH32)
  REAL*8 CCTKH33
  integer, parameter :: cctki_use_CCTKH33 = kind(CCTKH33)
  REAL*8 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  REAL*8 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  REAL*8 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  integer*8 bitant_plane
  integer, parameter :: cctki_use_bitant_plane = kind(bitant_plane)
  integer*8 domain
  integer, parameter :: cctki_use_domain = kind(domain)
  integer*8 quadrant_direction
  integer, parameter :: cctki_use_quadrant_direction = kind(quadrant_direction)
  integer*8 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  integer*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  INTEGER*4 CCTKH22
  integer, parameter :: cctki_use_CCTKH22 = kind(CCTKH22)
  INTEGER*4 CCTKH23
  integer, parameter :: cctki_use_CCTKH23 = kind(CCTKH23)
  INTEGER*4 CCTKH24
  integer, parameter :: cctki_use_CCTKH24 = kind(CCTKH24)
  INTEGER*4 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  INTEGER*4 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  COMMON /GRIDrest/CCTKH17, CCTKH18, CCTKH19, CCTKH20, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, CCTKH34, CCTKH35, CCTKH36, bita&
  &nt_plane, domain, quadrant_direction, CCTKH21, CCTKH28, CCTKH22, CCTKH23, CCTKH24, CCTKH25, CCTKH26, CCTKH27
  REAL*8 CCTKH42
  integer, parameter :: cctki_use_CCTKH42 = kind(CCTKH42)
  REAL*8 CCTKH55
  integer, parameter :: cctki_use_CCTKH55 = kind(CCTKH55)
  REAL*8 CCTKH63
  integer, parameter :: cctki_use_CCTKH63 = kind(CCTKH63)
  REAL*8 CCTKH65
  integer, parameter :: cctki_use_CCTKH65 = kind(CCTKH65)
  REAL*8 CCTKH67
  integer, parameter :: cctki_use_CCTKH67 = kind(CCTKH67)
  REAL*8 CCTKH69
  integer, parameter :: cctki_use_CCTKH69 = kind(CCTKH69)
  REAL*8 CCTKH71
  integer, parameter :: cctki_use_CCTKH71 = kind(CCTKH71)
  REAL*8 CCTKH73
  integer, parameter :: cctki_use_CCTKH73 = kind(CCTKH73)
  REAL*8 CCTKH75
  integer, parameter :: cctki_use_CCTKH75 = kind(CCTKH75)
  REAL*8 CCTKH77
  integer, parameter :: cctki_use_CCTKH77 = kind(CCTKH77)
  REAL*8 CCTKH79
  integer, parameter :: cctki_use_CCTKH79 = kind(CCTKH79)
  integer*8 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  integer*8 CCTKH40
  integer, parameter :: cctki_use_CCTKH40 = kind(CCTKH40)
  integer*8 CCTKH43
  integer, parameter :: cctki_use_CCTKH43 = kind(CCTKH43)
  integer*8 CCTKH46
  integer, parameter :: cctki_use_CCTKH46 = kind(CCTKH46)
  integer*8 CCTKH47
  integer, parameter :: cctki_use_CCTKH47 = kind(CCTKH47)
  integer*8 CCTKH48
  integer, parameter :: cctki_use_CCTKH48 = kind(CCTKH48)
  integer*8 CCTKH51
  integer, parameter :: cctki_use_CCTKH51 = kind(CCTKH51)
  integer*8 io_out_dir
  integer, parameter :: cctki_use_io_out_dir = kind(io_out_dir)
  integer*8 out_fileinfo
  integer, parameter :: cctki_use_out_fileinfo = kind(out_fileinfo)
  integer*8 CCTKH56
  integer, parameter :: cctki_use_CCTKH56 = kind(CCTKH56)
  integer*8 CCTKH57
  integer, parameter :: cctki_use_CCTKH57 = kind(CCTKH57)
  integer*8 CCTKH59
  integer, parameter :: cctki_use_CCTKH59 = kind(CCTKH59)
  integer*8 CCTKH81
  integer, parameter :: cctki_use_CCTKH81 = kind(CCTKH81)
  integer*8 CCTKH83
  integer, parameter :: cctki_use_CCTKH83 = kind(CCTKH83)
  integer*8 CCTKH85
  integer, parameter :: cctki_use_CCTKH85 = kind(CCTKH85)
  integer*8 CCTKH87
  integer, parameter :: cctki_use_CCTKH87 = kind(CCTKH87)
  integer*8 CCTKH88
  integer, parameter :: cctki_use_CCTKH88 = kind(CCTKH88)
  integer*8 CCTKH91
  integer, parameter :: cctki_use_CCTKH91 = kind(CCTKH91)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH41
  integer, parameter :: cctki_use_CCTKH41 = kind(CCTKH41)
  INTEGER*4 CCTKH44
  integer, parameter :: cctki_use_CCTKH44 = kind(CCTKH44)
  INTEGER*4 CCTKH45
  integer, parameter :: cctki_use_CCTKH45 = kind(CCTKH45)
  INTEGER*4 CCTKH49
  integer, parameter :: cctki_use_CCTKH49 = kind(CCTKH49)
  INTEGER*4 new_filename_scheme
  integer, parameter :: cctki_use_new_filename_scheme = kind(new_filename_scheme)
  INTEGER*4 CCTKH50
  integer, parameter :: cctki_use_CCTKH50 = kind(CCTKH50)
  INTEGER*4 CCTKH52
  integer, parameter :: cctki_use_CCTKH52 = kind(CCTKH52)
  INTEGER*4 CCTKH53
  integer, parameter :: cctki_use_CCTKH53 = kind(CCTKH53)
  INTEGER*4 CCTKH54
  integer, parameter :: cctki_use_CCTKH54 = kind(CCTKH54)
  INTEGER*4 io_out_every
  integer, parameter :: cctki_use_io_out_every = kind(io_out_every)
  INTEGER*4 CCTKH58
  integer, parameter :: cctki_use_CCTKH58 = kind(CCTKH58)
  INTEGER*4 CCTKH60
  integer, parameter :: cctki_use_CCTKH60 = kind(CCTKH60)
  INTEGER*4 CCTKH61
  integer, parameter :: cctki_use_CCTKH61 = kind(CCTKH61)
  INTEGER*4 CCTKH62
  integer, parameter :: cctki_use_CCTKH62 = kind(CCTKH62)
  INTEGER*4 CCTKH64
  integer, parameter :: cctki_use_CCTKH64 = kind(CCTKH64)
  INTEGER*4 CCTKH66
  integer, parameter :: cctki_use_CCTKH66 = kind(CCTKH66)
  INTEGER*4 CCTKH68
  integer, parameter :: cctki_use_CCTKH68 = kind(CCTKH68)
  INTEGER*4 CCTKH70
  integer, parameter :: cctki_use_CCTKH70 = kind(CCTKH70)
  INTEGER*4 CCTKH72
  integer, parameter :: cctki_use_CCTKH72 = kind(CCTKH72)
  INTEGER*4 CCTKH74
  integer, parameter :: cctki_use_CCTKH74 = kind(CCTKH74)
  INTEGER*4 CCTKH76
  integer, parameter :: cctki_use_CCTKH76 = kind(CCTKH76)
  INTEGER*4 CCTKH78
  integer, parameter :: cctki_use_CCTKH78 = kind(CCTKH78)
  INTEGER*4 CCTKH80
  integer, parameter :: cctki_use_CCTKH80 = kind(CCTKH80)
  INTEGER*4 CCTKH82
  integer, parameter :: cctki_use_CCTKH82 = kind(CCTKH82)
  INTEGER*4 CCTKH84
  integer, parameter :: cctki_use_CCTKH84 = kind(CCTKH84)
  INTEGER*4 CCTKH86
  integer, parameter :: cctki_use_CCTKH86 = kind(CCTKH86)
  INTEGER*4 CCTKH89
  integer, parameter :: cctki_use_CCTKH89 = kind(CCTKH89)
  INTEGER*4 CCTKH90
  integer, parameter :: cctki_use_CCTKH90 = kind(CCTKH90)
  COMMON /IOrest/CCTKH42, CCTKH55, CCTKH63, CCTKH65, CCTKH67, CCTKH69, CCTKH71, CCTKH73, CCTKH75, CCTKH77, CCTKH79, CCTKH39, CCTKH4&
  &0, CCTKH43, CCTKH46, CCTKH47, CCTKH48, CCTKH51, io_out_dir, out_fileinfo, CCTKH56, CCTKH57, CCTKH59, CCTKH81, CCTKH83, CCTKH85, &
  &CCTKH87, CCTKH88, CCTKH91, CCTKH37, CCTKH38, CCTKH41, CCTKH44, CCTKH45, CCTKH49, new_filename_scheme, CCTKH50, CCTKH52, CCTKH53,&
  & CCTKH54, io_out_every, CCTKH58, CCTKH60, CCTKH61, CCTKH62, CCTKH64, CCTKH66, CCTKH68, CCTKH70, CCTKH72, CCTKH74, CCTKH76, CCTKH&
  &78, CCTKH80, CCTKH82, CCTKH84, CCTKH86, CCTKH89, CCTKH90
  REAL*8 CCTKH94 (42)
  integer, parameter :: cctki_use_CCTKH94 = kind(CCTKH94)
  integer*8 CCTKH93 (42)
  integer, parameter :: cctki_use_CCTKH93 = kind(CCTKH93)
  integer*8 CCTKH95 (42)
  integer, parameter :: cctki_use_CCTKH95 = kind(CCTKH95)
  INTEGER*4 CCTKH92 (42)
  integer, parameter :: cctki_use_CCTKH92 = kind(CCTKH92)
  INTEGER*4 sfpar_maxnphi
  integer, parameter :: cctki_use_sfpar_maxnphi = kind(sfpar_maxnphi)
  INTEGER*4 sfpar_maxntheta
  integer, parameter :: cctki_use_sfpar_maxntheta = kind(sfpar_maxntheta)
  INTEGER*4 nghostsphi (42)
  integer, parameter :: cctki_use_nghostsphi = kind(nghostsphi)
  INTEGER*4 nghoststheta (42)
  integer, parameter :: cctki_use_nghoststheta = kind(nghoststheta)
  INTEGER*4 CCTKH96 (42)
  integer, parameter :: cctki_use_CCTKH96 = kind(CCTKH96)
  INTEGER*4 nsurfaces
  integer, parameter :: cctki_use_nsurfaces = kind(nsurfaces)
  INTEGER*4 CCTKH97 (42)
  integer, parameter :: cctki_use_CCTKH97 = kind(CCTKH97)
  INTEGER*4 symmetric_x (42)
  integer, parameter :: cctki_use_symmetric_x = kind(symmetric_x)
  INTEGER*4 symmetric_y (42)
  integer, parameter :: cctki_use_symmetric_y = kind(symmetric_y)
  INTEGER*4 symmetric_z (42)
  integer, parameter :: cctki_use_symmetric_z = kind(symmetric_z)
  INTEGER*4 CCTKH98
  integer, parameter :: cctki_use_CCTKH98 = kind(CCTKH98)
  COMMON /SPHERICALSURFACErest/CCTKH94, CCTKH93, CCTKH95, CCTKH92, sfpar_maxnphi, sfpar_maxntheta, nghostsphi, nghoststheta, CCTKH9&
  &6, nsurfaces, CCTKH97, symmetric_x, symmetric_y, symmetric_z, CCTKH98
  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
  REAL*8 function MergerHandler_MergerTime ()
  implicit none
  end function MergerHandler_MergerTime
  end interface
  interface
  INTEGER*4 function MergerHandler_WeHaveMerger ()
  implicit none
  end function MergerHandler_WeHaveMerger
  end interface


  if (verbose>2) &
    call CCTK_Info("WaveExtractL","Subtract Spherical Background")

  if (do_nothing==1) &
    return

  if (cctk_iteration .ne. 0) then
    if (mod(cctk_iteration,my_out_every_det(current_detector)).ne.0) then
      if (verbose>2) call CCTK_Info("WaveExtractL","No time for this detector")
      return
    end if
  end if

  if (calc_when_necessary .eq. 1) then
    if (cctk_time .lt. current_detector_radius-50) then
      if (verbose>2) call CCTK_Info("WaveExtractL","No time for this detector")
      return
    endif
    call CCTK_IsFunctionAliased(istat, "MergerHandler_WeHaveMerger")
    if (istat .eq. 1) then
      if (MergerHandler_WeHaveMerger() .eq. 1) then
        if (cctk_time .gt. MergerHandler_MergerTime()+current_detector_radius+ringdown_margin) then
          if (verbose>2) call CCTK_Info("WaveExtractL","No time for this detector")
          return
        endif
      endif
    endiF
  end if

  grr = grr - sph_grr
  gtt = gtt - sph_gtt
  gpp = gpp - sph_gtt*sintheta**2
  dr_gtt = dr_gtt - sph_dr_gtt
  dr_gpp = dr_gpp - sph_dr_gtt*sintheta**2

end subroutine WavExtrL_SubtrSpherMetric
