























































































































 


































































































































































 






























































































































































































































































 



















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



















































































subroutine EHFinder_FindSurfaceElement(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_ali&
  &gnment,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfa&
  &c,cctk_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_as&
  &h2,cctk_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh&
  &_centroid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator&
  &_arrays,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_arra&
  &ys,X0xg,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surf&
  &ace_arrays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,d&
  &xg_length,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_leng&
  &th,eh_centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_&
  &circ_pol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm&
  &_mask_length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,beta&
  &zg2,center,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,&
  &dlphi,dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh&
  &_centroid_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp&
  &,fbak,find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gy&
  &yg2,gyyi,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,mo&
  &re_points,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_con&
  &trol,rsurf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,x&
  &g2,xg2_p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_ha&
  &ndle,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,con&
  &formal_state,dtalp,dtalp_p,dtalp_p_p,dtbetax,dtbetax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,d&
  &tlapse_state,dtshift_state,emask,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,g&
  &zz_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,psi&
  &x,psixx,psixy,psixz,psiy,psiyy,psiyz,psiz,psizz,r,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

  INTEGER*4 :: i, j, l
  INTEGER*4 :: interp_handle, table_handle, coord_system_handle

  character(len=200) :: area_interp
  character(len=128) :: warn_message
  INTEGER*4 :: area_interp_len
  character(len=7) :: area_order

  INTEGER*4, dimension(4) :: bbox
  INTEGER*4, dimension(2) :: gsh, lsh, lbnd, ubnd, nghost

  REAL*8 :: dtheta, dphi, dthetainv, dphiinv
  REAL*8 :: dxdth, dxdph, dydth, dydph, dzdth, dzdph
  integer*8, dimension(3) :: interp_coords
  integer*8, dimension(7) :: out_array
  INTEGER*4, dimension(7) :: in_array
  INTEGER*4, dimension(7), parameter :: out_types = (/ 130, &
                                                      130, &
                                                      130, &
                                                      130, &
                                                      130, &
                                                      130, &
                                                      130 /)
  

  if ( find_surface_status .lt. 0 ) then
    return
  endif


  l = levelset_counter


  call CCTK_Info("EHFinder", 'Finding surface element' )


  call CCTK_GroupbboxGN ( ierr, cctkGH, 4, bbox, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,57,"EHFinder_Integrate.F90","EHFinder", 'cannot get bounding box for surface arrays' )
  end if
  call CCTK_GroupgshGN ( ierr, cctkGH, 2, gsh, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,61,"EHFinder_Integrate.F90","EHFinder", 'cannot get global size for surface arrays' )
  end if
  call CCTK_GrouplbndGN ( ierr, cctkGH, 2, lbnd, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,65,"EHFinder_Integrate.F90","EHFinder", 'cannot get lower bounds for surface arrays' )
  end if
  call CCTK_GroupubndGN ( ierr, cctkGH, 2, ubnd, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,69,"EHFinder_Integrate.F90","EHFinder", 'cannot get upper bounds for surface arrays' )
  end if
  call CCTK_GrouplshGN ( ierr, cctkGH, 2, lsh, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,73,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for surface arrays' )
  end if
  call CCTK_GroupnghostzonesGN ( ierr, cctkGH, 2, nghost, &
                                           'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,78,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for surface arrays' )
  end if


  dtheta = ctheta(2,1) - ctheta(1,1)
  dphi = cphi(1,2) - cphi(1,1)
  dthetainv = one / dtheta
  dphiinv = one / dphi


  call CCTK_FortranString ( area_interp_len, area_interpolator, &
                                             area_interp )


  call CCTK_InterpHandle ( interp_handle, area_interp(1:area_interp_len) )

  if ( interp_handle .lt. 0 ) then
    warn_message = 'Cannot get handle for interpolation. '
    warn_message = trim(warn_message)//'Forgot to activate an implementation '
    warn_message = trim(warn_message)//'providing interpolation operators?'
    call CCTK_Warn( 0,98,"EHFinder_Integrate.F90","EHFinder", trim(warn_message) )
  end if


  write(area_order,'(a6,i1)') 'order=',area_interpolation_order


  call Util_TableCreateFromString ( table_handle, area_order )
  if ( table_handle .lt. 0 ) then
    call CCTK_Warn( 0,107,"EHFinder_Integrate.F90","EHFinder", 'Cannot create parameter table for interpolator' )
  end if


  call CCTK_CoordSystemHandle ( coord_system_handle, 'cart3d' )
  if ( coord_system_handle .lt. 0) then
    warn_message = 'Cannot get handle for cart3d coordinate system. '
    warn_message = trim(warn_message)//'Forgot to activate an implementation '
    warn_message = trim(warn_message)//'providing coordinates?'
    call CCTK_Warn( 0,116,"EHFinder_Integrate.F90","EHFinder", trim(warn_message) )
  endif


  interp_coords(1) = CCTK_PointerTo(interp_x)
  interp_coords(2) = CCTK_PointerTo(interp_y)
  interp_coords(3) = CCTK_PointerTo(interp_z)


  out_array(1) = CCTK_PointerTo(gxxi)
  out_array(2) = CCTK_PointerTo(gxyi)
  out_array(3) = CCTK_PointerTo(gxzi)
  out_array(4) = CCTK_PointerTo(gyyi)
  out_array(5) = CCTK_PointerTo(gyzi)
  out_array(6) = CCTK_PointerTo(gzzi)
  out_array(7) = CCTK_PointerTo(psii)


  do j = 1, lsh(2)
    do i = 1, lsh(1)
      interp_x(i,j) = center(1) + rsurf(i,j) * sintheta(i,j) * cosphi(i,j)
      interp_y(i,j) = center(2) + rsurf(i,j) * sintheta(i,j) * sinphi(i,j)
      interp_z(i,j) = center(3) + rsurf(i,j) * costheta(i,j)
    end do
  end do


  call CCTK_VarIndex ( in_array(1), 'admbase::gxx' )
  call CCTK_VarIndex ( in_array(2), 'admbase::gxy' )
  call CCTK_VarIndex ( in_array(3), 'admbase::gxz' )
  call CCTK_VarIndex ( in_array(4), 'admbase::gyy' )
  call CCTK_VarIndex ( in_array(5), 'admbase::gyz' )
  call CCTK_VarIndex ( in_array(6), 'admbase::gzz' )


  if ( (CCTK_Equals( metric_type, 'static conformal' ) .ne. 0) ) then
    call CCTK_VarIndex ( in_array(7), 'staticconformal::psi' )


    call CCTK_InterpGridArrays ( ierr, cctkGH, 3, interp_handle, &
                                 table_handle, coord_system_handle, &
                                 lsh(1) * lsh(2), 130, &
                                 interp_coords, 7, in_array, &
                                 7, out_types, out_array )


    gxxi = psii**4 * gxxi
    gxyi = psii**4 * gxyi
    gxzi = psii**4 * gxzi
    gyyi = psii**4 * gyyi
    gyzi = psii**4 * gyzi
    gzzi = psii**4 * gzzi
  else

    call CCTK_InterpGridArrays ( ierr, cctkGH, 3, interp_handle, &
                                 table_handle, coord_system_handle, &
                                 lsh(1) * lsh(2), 130, &
                                 interp_coords, 6, in_array(1:6), &
                                 6, out_types(1:6), out_array(1:6) )
  end if


  do j = 1, lsh(2)
    do i = 1, lsh(1)



      dxdth = ( drdtheta(i,j) * sintheta(i,j) + &
                rsurf(i,j) * costheta(i,j) ) * cosphi(i,j)
      dydth = ( drdtheta(i,j) * sintheta(i,j) + &
                rsurf(i,j) * costheta(i,j) ) * sinphi(i,j)
      dzdth = drdtheta(i,j) * costheta(i,j) - rsurf(i,j) * sintheta(i,j)
      dxdph = ( drdphi(i,j) * cosphi(i,j) - &
                rsurf(i,j) * sinphi(i,j) ) * sintheta(i,j)
      dydph = ( drdphi(i,j) * sinphi(i,j) + &
                rsurf(i,j) * cosphi(i,j) ) * sintheta(i,j)
      dzdph = drdphi(i,j) * costheta(i,j)



      gtt(i,j) = dxdth**2 * gxxi(i,j) + dydth**2 * gyyi(i,j) + &
            dzdth**2 * gzzi(i,j) + &
            two * ( dxdth * dydth * gxyi(i,j) + &
                    dxdth * dzdth * gxzi(i,j) + &
                    dydth * dzdth * gyzi(i,j) )
      gtp(i,j) = dxdth * dxdph * gxxi(i,j) + &
            ( dxdth * dydph + dydth * dxdph ) * gxyi(i,j) + &
            ( dxdth * dzdph + dzdth * dxdph ) * gxzi(i,j) + &
            dydth * dydph * gyyi(i,j) + &
            ( dydth * dzdph + dzdth * dydph ) * gyzi(i,j) + &
            dzdth * dzdph * gzzi(i,j)
      gpp(i,j) = dxdph**2 * gxxi(i,j) + dydph**2 * gyyi(i,j) + &
            dzdph**2 * gzzi(i,j) + &
            two * ( dxdph * dydph * gxyi(i,j) + &
                    dxdph * dzdph * gxzi(i,j) + &
                    dydph * dzdph * gyzi(i,j) )



      da(i,j) = dtheta * dphi * sqrt ( gtt(i,j) * gpp(i,j) - gtp(i,j)**2 )


      dltheta(i,j) = dtheta * sqrt ( gtt(i,j) )



      dlphi(i,j) = dphi * sqrt ( gpp(i,j) )

    end do
  end do
 
end subroutine EHFinder_FindSurfaceElement


subroutine EHFinder_IntegrateArea(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignmen&
  &t,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cct&
  &k_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cc&
  &tk_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_cent&
  &roid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_arra&
  &ys,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_arrays,X0&
  &xg,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surface_a&
  &rrays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,dxg_le&
  &ngth,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_length,eh&
  &_centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_circ_&
  &pol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_mask&
  &_length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betazg2,c&
  &enter,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,dlphi&
  &,dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_cent&
  &roid_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp,fbak&
  &,find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyyg2,g&
  &yyi,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,more_po&
  &ints,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_control,&
  &rsurf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,xg2,xg&
  &2_p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_handle,&
  &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,conforma&
  &l_state,dtalp,dtalp_p,dtalp_p_p,dtbetax,dtbetax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,dtlaps&
  &e_state,dtshift_state,emask,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,psi&
  &xx,psixy,psixz,psiy,psiyy,psiyz,psiz,psizz,r,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

  INTEGER*4 :: int_var, sn, l
  REAL*8 :: eh_area_tmp
  character(len=30) :: info_message
  INTEGER*4, dimension(1) :: lbnd, ubnd, lsh


  if ( find_surface_status .lt. 0 ) then
    return
  endif


  l = levelset_counter


  call CCTK_Info("EHFinder", 'Integrating area' )

  sn = surface_counter - integrate_counter



  int_tmp = sym_factor * weights * da


  call CCTK_VarIndex ( int_var, 'ehfinder::int_tmp' )
  if ( int_var .lt. 0 ) then
    call CCTK_Warn( 0,265,"EHFinder_Integrate.F90","EHFinder", 'Could not get index to grid array int_tmp' )
  end if


  call CCTK_Reduce ( ierr, cctkGH, -1, sum_handle, 1, 130, &
                     eh_area_tmp, 1, int_var )


  write(info_message,'(a15,f10.5)') 'Horizon area = ',eh_area_tmp

  call CCTK_Info("EHFinder", trim(info_message) )


  call CCTK_GrouplbndGN ( ierr, cctkGH, 1, lbnd, 'ehfinder::eh_area2' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,280,"EHFinder_Integrate.F90","EHFinder", 'cannot get lower bounds for area array' )
  end if
  call CCTK_GroupubndGN ( ierr, cctkGH, 1, ubnd, 'ehfinder::eh_area2' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,284,"EHFinder_Integrate.F90","EHFinder", 'cannot get upper bounds for area array' )
  end if
  call CCTK_GrouplshGN ( ierr, cctkGH, 1, lsh, 'ehfinder::eh_area2' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,288,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for area array' )
  end if



  if ( ( sn .ge. lbnd(1) + 1 ) .and. ( sn .le. ubnd(1) + 1 ) ) then
    eh_area2(sn-lbnd(1),l) = eh_area_tmp
  end if

end subroutine EHFinder_IntegrateArea


subroutine EHFinder_IntegrateCentroid(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alig&
  &nment,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_ash&
  &2,cctk_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_&
  &centroid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_&
  &arrays,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_array&
  &s,X0xg,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surfa&
  &ce_arrays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,dx&
  &g_length,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_lengt&
  &h,eh_centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_c&
  &irc_pol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_&
  &mask_length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betaz&
  &g2,center,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,d&
  &lphi,dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_&
  &centroid_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp,&
  &fbak,find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyy&
  &g2,gyyi,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,mor&
  &e_points,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_cont&
  &rol,rsurf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,xg&
  &2,xg2_p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_han&
  &dle,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,conf&
  &ormal_state,dtalp,dtalp_p,dtalp_p_p,dtbetax,dtbetax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,dt&
  &lapse_state,dtshift_state,emask,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,gz&
  &z_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,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

  INTEGER*4 :: int_var, sn, k, l
  character(len=50) :: info_message
  INTEGER*4, dimension(1) :: lbnd, ubnd, lsh
  REAL*8 :: centroid_x, centroid_y, centroid_z


  if ( find_surface_status .lt. 0 ) then
    return
  endif


  l = levelset_counter


  call CCTK_Info("EHFinder", 'Integrating centroid' )

  sn = surface_counter - integrate_counter


  interp_x = center(1) + rsurf * sintheta * cosphi
  interp_y = center(2) + rsurf * sintheta * sinphi
  interp_z = center(3) + rsurf * costheta


  call CCTK_VarIndex ( int_var, 'ehfinder::int_tmp' )
  if ( int_var .lt. 0 ) then
    call CCTK_Warn( 0,336,"EHFinder_Integrate.F90","EHFinder", 'Could not get index to grid array int_tmp' )
  end if




  int_tmp = sym_factor * interp_x * weights * da


  call CCTK_Reduce ( ierr, cctkGH, -1, sum_handle, 1, 130, &
                     centroid_x, 1, int_var )




  int_tmp = sym_factor * interp_y * weights * da


  call CCTK_Reduce ( ierr, cctkGH, -1, sum_handle, 1, 130, &
                     centroid_y, 1, int_var )




  int_tmp = sym_factor * interp_z * weights * da


  call CCTK_Reduce ( ierr, cctkGH, -1, sum_handle, 1, 130, &
                     centroid_z, 1, int_var )

  if ( s_symx ) centroid_x = zero
  if ( s_symy ) centroid_y = zero
  if ( s_symz ) centroid_z = zero



  call CCTK_GrouplbndGN ( ierr, cctkGH, 1, lbnd, 'ehfinder::eh_centroid2_x' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,374,"EHFinder_Integrate.F90","EHFinder", 'cannot get lower bounds for centroid array' )
  end if
  call CCTK_GroupubndGN ( ierr, cctkGH, 1, ubnd, 'ehfinder::eh_centroid2_x' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,378,"EHFinder_Integrate.F90","EHFinder", 'cannot get upper bounds for centroid array' )
  end if
  call CCTK_GrouplshGN ( ierr, cctkGH, 1, lsh, 'ehfinder::eh_centroid2_x' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,382,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for centroid array' )
  end if


  if ( ( sn .ge. lbnd(1) + 1 ) .and. ( sn .le. ubnd(1) + 1 ) ) then
    k = sn - lbnd(1)
    eh_centroid2_x(k,l) = centroid_x / eh_area2(k,l)
    eh_centroid2_y(k,l) = centroid_y / eh_area2(k,l)
    eh_centroid2_z(k,l) = centroid_z / eh_area2(k,l)
  end if


  write(info_message,'(a19,3(f10.5))') 'Horizon centroid = ', &
                                       eh_centroid2_x(sn,l), &
                                       eh_centroid2_y(sn,l), &
                                       eh_centroid2_z(sn,l)
  call CCTK_Info("EHFinder", trim(info_message) )

end subroutine EHFinder_IntegrateCentroid


subroutine EHFinder_IntegrateCircumference(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk&
  &_alignment,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_l&
  &evfac,cctk_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cct&
  &k_ash2,cctk_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,&
  &X0eh_centroid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0gener&
  &ator_arrays,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_&
  &arrays,X0xg,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1&
  &surface_arrays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_leng&
  &th,dxg_length,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_&
  &length,eh_centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length&
  &,eh_circ_pol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_lengt&
  &h,tm_mask_length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,&
  &betazg2,center,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,df&
  &zg2,dlphi,dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_&
  &z,eh_centroid_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_in&
  &terp,fbak,find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyy&
  &g,gyyg2,gyyi,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelset&
  &s,more_points,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init&
  &_control,rsurf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p&
  &_p,xg2,xg2_p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicin&
  &g_handle,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,dtalp,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,dtshift_state,emask,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,g&
  &zz,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,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

  INTEGER*4 :: sn, k, l
  character(len=50) :: info_message
  INTEGER*4, dimension(1) :: lbnd1, ubnd1, lsh1
  INTEGER*4, dimension(2) :: lbnd, lsh, nghost
  INTEGER*4, dimension(4) :: bbox
  INTEGER*4 :: ithl, ithr, jphl, jphr, itha, jpha
  REAL*8 :: eq_circ_loc, eq_circ, pol_circ_loc, pol_circ


  if ( find_surface_status .lt. 0 ) then
    return
  endif


  l = levelset_counter

  sn = surface_counter - integrate_counter

  
  call CCTK_GrouplbndGN ( ierr, cctkGH, 2, lbnd, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,434,"EHFinder_Integrate.F90","EHFinder", 'cannot get lower bounds for surface arrays' )
  end if

  
  call CCTK_GrouplshGN ( ierr, cctkGH, 2, lsh, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,440,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for surface arrays' )
  end if

  
  call CCTK_GroupbboxGN ( ierr, cctkGH, 4, bbox, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,446,"EHFinder_Integrate.F90","EHFinder", 'cannot get bounding box for surface arrays' )
  end if

  
  call CCTK_GroupnghostzonesGN ( ierr, cctkGH, 2, nghost, &
                                       'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,453,"EHFinder_Integrate.F90","EHFinder", 'cannot get ghost zones for surface arrays' )
  end if
 

  ithl = 1; ithr = lsh(1)
  jphl = 1; jphr = lsh(2)
  


  if ( bbox(1) .eq. 0 ) ithl = ithl + nghost(1)
  if ( bbox(2) .eq. 0 ) ithr = ithr - nghost(1)
  if ( bbox(3) .eq. 0 ) jphl = jphl + nghost(2)
  if ( bbox(4) .eq. 0 ) jphr = jphr - nghost(2)


  call CCTK_Info("EHFinder", 'Integrating equatorial circumference' )




  int_tmp = phi_sym_factor * phiweights * dlphi




  if ( ( ithl+lbnd(1) .le. githeta ) .and. ( githeta .le. ithr+lbnd(1) ) ) then
    itha = githeta - lbnd(1)
    eq_circ_loc = sum ( int_tmp(itha,jphl:jphr) )
  else
    eq_circ_loc = zero
  end if



  call CCTK_ReduceLocScalar ( ierr, cctkGH, -1, sum_handle, &
                              eq_circ_loc, eq_circ, 130 )


  call CCTK_GrouplbndGN ( ierr, cctkGH, 1, lbnd1, 'ehfinder::eh_circ_eq2' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,493,"EHFinder_Integrate.F90","EHFinder", 'cannot get lower bounds for area array' )
  end if
  call CCTK_GroupubndGN ( ierr, cctkGH, 1, ubnd1, 'ehfinder::eh_circ_eq2' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,497,"EHFinder_Integrate.F90","EHFinder", 'cannot get upper bounds for area array' )
  end if
  call CCTK_GrouplshGN ( ierr, cctkGH, 1, lsh1, 'ehfinder::eh_circ_eq2' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,501,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for area array' )
  end if


  if ( ( sn .ge. lbnd1(1) + 1 ) .and. ( sn .le. ubnd1(1) + 1 ) ) then
    k = sn - lbnd1(1)
    eh_circ_eq2(k,l) = eq_circ
  end if


  write(info_message,'(a35,f10.5)') 'Horizon equatorial circumference = ', &
                                    eq_circ
  call CCTK_Info("EHFinder", trim(info_message) )


  call CCTK_Info("EHFinder", 'Integrating polar circumference' )




  int_tmp = theta_sym_factor * thetaweights * dltheta




  if ( ( jphl+lbnd(2) .le. gjphi ) .and. ( gjphi .le. jphr+lbnd(2) ) ) then
    jpha = gjphi - lbnd(2)
    pol_circ_loc = sum ( int_tmp(ithl:ithr,jpha) )
  else
    pol_circ_loc = zero
  end if



  call CCTK_ReduceLocScalar ( ierr, cctkGH, -1, sum_handle, &
                              pol_circ_loc, pol_circ, 130 )



  if ( ( sn .ge. lbnd1(1) + 1 ) .and. ( sn .le. ubnd1(1) + 1 ) ) then
    k = sn - lbnd1(1)
    eh_circ_pol2(k,l) = pol_circ
  end if


  write(info_message,'(a30,f10.5)') 'Horizon polar circumference = ',pol_circ
  call CCTK_Info("EHFinder", trim(info_message) )
  
end subroutine EHFinder_IntegrateCircumference




subroutine EHFinder_InitWeights(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,&
  &cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_&
  &levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk&
  &_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_centro&
  &id2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_arrays&
  &,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_arrays,X0xg&
  &,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surface_arr&
  &ays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,dxg_leng&
  &th,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_length,eh_c&
  &entroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_circ_po&
  &l2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_mask_l&
  &ength,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betazg2,cen&
  &ter,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,dlphi,d&
  &ltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_centro&
  &id_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp,fbak,f&
  &ind_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyyg2,gyy&
  &i,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,more_poin&
  &ts,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_control,rs&
  &urf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,xg2,xg2_&
  &p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_handle,al&
  &p,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,dtalp,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,dtshift_state,emask,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,gz&
  &z_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,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

  INTEGER*4 :: i, j

  INTEGER*4, dimension(2) :: lsh, lbnd


  call CCTK_GrouplbndGN ( ierr, cctkGH, 2, lbnd, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,571,"EHFinder_Integrate.F90","EHFinder", 'cannot get lower bounds for surface arrays' )
  end if


  call CCTK_GrouplshGN ( ierr, cctkGH, 2, lsh, 'ehfinder::surface_arrays' )
  if ( ierr .lt. 0 ) then
    call CCTK_Warn( 0,577,"EHFinder_Integrate.F90","EHFinder", 'cannot get local size for surface arrays' )
  end if

  weights = one







  do j = 1, lsh(2)



    if ( ( lbnd(2)+j .eq. 1 ) .or. ( lbnd(2)+j .eq. nphi ) ) then
      weights(:,j) = onethird
      phiweights(:,j) = onethird
    else if ( mod(lbnd(2)+j,2) .eq. 0 ) then
      weights(:,j) = fourthirds
      phiweights(:,j) = fourthirds
    else
      weights(:,j) = twothirds
      phiweights(:,j) = twothirds
    end if



    do i = 1, lsh(1)
      if ( ( lbnd(1)+i .eq. 1 ) .or. ( lbnd(1)+i .eq. ntheta ) ) then
        weights(i,j) = onethird * weights(i,j)
        thetaweights(i,j) = onethird
      else if ( mod(lbnd(1)+i,2) .eq. 0 ) then
        weights(i,j) = fourthirds * weights(i,j)
        thetaweights(i,j) = fourthirds
      else
        weights(i,j) = twothirds * weights(i,j)
        thetaweights(i,j) = twothirds
      end if
    end do
  end do










end subroutine EHFinder_InitWeights




subroutine EHFinder_CopyArea(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment,cct&
  &k_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk_lev&
  &off,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cctk_as&
  &h3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_centroid2&
  &_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_arrays,X0&
  &generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_arrays,X0xg,X0&
  &xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surface_arrays&
  &,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,dxg_length,&
  &dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_length,eh_cent&
  &roid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_circ_pol2_&
  &length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_mask_leng&
  &th,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betazg2,center&
  &,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,dlphi,dlth&
  &eta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_centroid_&
  &x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp,fbak,find&
  &_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyyg2,gyyi,g&
  &yzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,more_points,&
  &more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_control,rsurf&
  &,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,xg2,xg2_p,x&
  &g2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_handle,alp,a&
  &lp_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_sta&
  &te,dtalp,dtalp_p,dtalp_p_p,dtbetax,dtbetax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,dtlapse_sta&
  &te,dtshift_state,emask,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,ps&
  &ixy,psixz,psiy,psiyy,psiyz,psiz,psizz,r,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface


  if ( find_surface_status .lt. 0 ) then
    eh_area = zero
    return
  else
    call CCTK_Info("EHFinder",'Copying area data')
    eh_area = eh_area2
  endif
end subroutine EHFinder_CopyArea




subroutine EHFinder_CopyCentroid(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alignment&
  &,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,cctk&
  &_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2,cct&
  &k_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_centr&
  &oid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_array&
  &s,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_arrays,X0x&
  &g,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surface_ar&
  &rays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,dxg_len&
  &gth,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_length,eh_&
  &centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_circ_p&
  &ol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_mask_&
  &length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betazg2,ce&
  &nter,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,dlphi,&
  &dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_centr&
  &oid_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp,fbak,&
  &find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyyg2,gy&
  &yi,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,more_poi&
  &nts,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_control,r&
  &surf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,xg2,xg2&
  &_p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_handle,a&
  &lp,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,dtalp,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,dtshift_state,emask,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,g&
  &zz_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,psix&
  &x,psixy,psixz,psiy,psiyy,psiyz,psiz,psizz,r,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface


  if ( find_surface_status .lt. 0 ) then
    eh_centroid_x = zero
    eh_centroid_y = zero
    eh_centroid_z = zero
    return
  else
    call CCTK_Info("EHFinder",'Copying centroid data')
    eh_centroid_x = eh_centroid2_x
    eh_centroid_y = eh_centroid2_y
    eh_centroid_z = eh_centroid2_z
  end if

end subroutine EHFinder_CopyCentroid




subroutine EHFinder_CopyCircumference(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_alig&
  &nment,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_ash&
  &2,cctk_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_&
  &centroid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_&
  &arrays,X0generator_arrays2,X0integrate_tmp_array,X0interp_metric_arrays,X0surface_arrays,X0surface_int_array,X0surface_tmp_array&
  &s,X0xg,X0xg2,X0yg,X0yg2,X0zg,X0zg2,X1dxg2,X1dyg2,X1dzg2,X1generator_arrays2,X1integrate_tmp_array,X1interp_metric_arrays,X1surfa&
  &ce_arrays,X1surface_int_array,X1surface_tmp_arrays,X1xg2,X1yg2,X1zg2,dfsq_length,dfx_length,dfy_length,dfz_length,dxg2_length,dx&
  &g_length,dyg2_length,dyg_length,dzg2_length,dzg_length,eh_area2_length,eh_area_length,eh_centroid2_x_length,eh_centroid2_y_lengt&
  &h,eh_centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_c&
  &irc_pol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_&
  &mask_length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betaz&
  &g2,center,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,d&
  &lphi,dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_&
  &centroid_x,eh_centroid_y,eh_centroid_z,eh_circ_eq,eh_circ_eq2,eh_circ_pol,eh_circ_pol2,eh_mask,eh_mask_bak,f,f_p,f_p_p,f_interp,&
  &fbak,find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyy&
  &g2,gyyi,gyzg,gyzg2,gyzi,gzzg,gzzg2,gzzi,int_tmp,integrate_counter,interp_x,interp_y,interp_z,levelset_counter,more_levelsets,mor&
  &e_points,more_surfaces,n_since_last_reduction,niter_reinit,phi_sym_factor,phiweights,points_counter,psig,psig2,psii,re_init_cont&
  &rol,rsurf,sc,sf,sftmp,sinphi,sintheta,surface_counter,sym_factor,theta_sym_factor,thetaweights,tm_mask,weights,xg,xg_p,xg_p_p,xg&
  &2,xg2_p,xg2_p_p,xgf,xgf2,yg,yg_p,yg_p_p,yg2,yg2_p,yg2_p_p,ygf,ygf2,zg,zg_p,zg_p_p,zg2,zg2_p,zg2_p_p,zgf,zgf2, active_slicing_han&
  &dle,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,conf&
  &ormal_state,dtalp,dtalp_p,dtalp_p_p,dtbetax,dtbetax_p,dtbetax_p_p,dtbetay,dtbetay_p,dtbetay_p_p,dtbetaz,dtbetaz_p,dtbetaz_p_p,dt&
  &lapse_state,dtshift_state,emask,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,gz&
  &z_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,shift_state,space_mask,x,y,z)

  use EHFinder_mod

  implicit none

  INTEGER*4 EHFinder_MaxNumEvolvedVars
  integer, parameter :: cctki_use_EHFinder_MaxNumEvolvedVars = kind(EHFinder_MaxNumEvolvedVars)
  INTEGER*4 EHFinder_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_EHFinder_Max_Evolved_Array_Size = kind(EHFinder_Max_Evolved_Array_Size)
  INTEGER*4 EHFinder_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_EHFinder_Num_ArrayEvolved_Vars = kind(EHFinder_Num_ArrayEvolved_Vars)
  COMMON /ehfinderrest/EHFinder_MaxNumEvolvedVars, EHFinder_Max_Evolved_Array_Size, EHFinder_Num_ArrayEvolved_Vars
  REAL*8 cas_a (10)
  integer, parameter :: cctki_use_cas_a = kind(cas_a)
  REAL*8 cas_b (10)
  integer, parameter :: cctki_use_cas_b = kind(cas_b)
  REAL*8 center_x
  integer, parameter :: cctki_use_center_x = kind(center_x)
  REAL*8 center_y
  integer, parameter :: cctki_use_center_y = kind(center_y)
  REAL*8 center_z
  integer, parameter :: cctki_use_center_z = kind(center_z)
  REAL*8 initial_a (10)
  integer, parameter :: cctki_use_initial_a = kind(initial_a)
  REAL*8 initial_b (10)
  integer, parameter :: cctki_use_initial_b = kind(initial_b)
  REAL*8 initial_c (10)
  integer, parameter :: cctki_use_initial_c = kind(initial_c)
  REAL*8 initial_rad (10)
  integer, parameter :: cctki_use_initial_rad = kind(initial_rad)
  REAL*8 rotation_alpha (10)
  integer, parameter :: cctki_use_rotation_alpha = kind(rotation_alpha)
  REAL*8 rotation_beta (10)
  integer, parameter :: cctki_use_rotation_beta = kind(rotation_beta)
  REAL*8 rotation_gamma (10)
  integer, parameter :: cctki_use_rotation_gamma = kind(rotation_gamma)
  REAL*8 shell_width
  integer, parameter :: cctki_use_shell_width = kind(shell_width)
  REAL*8 translate_x (10)
  integer, parameter :: cctki_use_translate_x = kind(translate_x)
  REAL*8 translate_y (10)
  integer, parameter :: cctki_use_translate_y = kind(translate_y)
  REAL*8 translate_z (10)
  integer, parameter :: cctki_use_translate_z = kind(translate_z)
  integer*8 area_calculation_method
  integer, parameter :: cctki_use_area_calculation_method = kind(area_calculation_method)
  integer*8 area_interpolator
  integer, parameter :: cctki_use_area_interpolator = kind(area_interpolator)
  integer*8 eh_lapse_type
  integer, parameter :: cctki_use_eh_lapse_type = kind(eh_lapse_type)
  integer*8 eh_metric_type
  integer, parameter :: cctki_use_eh_metric_type = kind(eh_metric_type)
  integer*8 eh_shift_type
  integer, parameter :: cctki_use_eh_shift_type = kind(eh_shift_type)
  integer*8 file_type
  integer, parameter :: cctki_use_file_type = kind(file_type)
  integer*8 generator_distribution
  integer, parameter :: cctki_use_generator_distribution = kind(generator_distribution)
  integer*8 generator_interpolator
  integer, parameter :: cctki_use_generator_interpolator = kind(generator_interpolator)
  integer*8 generator_tracking_method
  integer, parameter :: cctki_use_generator_tracking_method = kind(generator_tracking_method)
  integer*8 initial_f (10)
  integer, parameter :: cctki_use_initial_f = kind(initial_f)
  integer*8 mode
  integer, parameter :: cctki_use_mode = kind(mode)
  integer*8 pde_differences
  integer, parameter :: cctki_use_pde_differences = kind(pde_differences)
  integer*8 re_init_int_method
  integer, parameter :: cctki_use_re_init_int_method = kind(re_init_int_method)
  integer*8 surface_direction
  integer, parameter :: cctki_use_surface_direction = kind(surface_direction)
  integer*8 surface_interpolator
  integer, parameter :: cctki_use_surface_interpolator = kind(surface_interpolator)
  integer*8 upwind_type
  integer, parameter :: cctki_use_upwind_type = kind(upwind_type)
  INTEGER*4 area_interpolation_order
  integer, parameter :: cctki_use_area_interpolation_order = kind(area_interpolation_order)
  INTEGER*4 cheat
  integer, parameter :: cctki_use_cheat = kind(cheat)
  INTEGER*4 cheat_iterations
  integer, parameter :: cctki_use_cheat_iterations = kind(cheat_iterations)
  INTEGER*4 eh_number_level_sets
  integer, parameter :: cctki_use_eh_number_level_sets = kind(eh_number_level_sets)
  INTEGER*4 evolve_generators
  integer, parameter :: cctki_use_evolve_generators = kind(evolve_generators)
  INTEGER*4 generator_interpolation_order
  integer, parameter :: cctki_use_generator_interpolation_order = kind(generator_interpolation_order)
  INTEGER*4 last_iteration_number
  integer, parameter :: cctki_use_last_iteration_number = kind(last_iteration_number)
  INTEGER*4 maximum_surface_number
  integer, parameter :: cctki_use_maximum_surface_number = kind(maximum_surface_number)
  INTEGER*4 n_array_ghosts
  integer, parameter :: cctki_use_n_array_ghosts = kind(n_array_ghosts)
  INTEGER*4 nphi
  integer, parameter :: cctki_use_nphi = kind(nphi)
  INTEGER*4 ntheta
  integer, parameter :: cctki_use_ntheta = kind(ntheta)
  INTEGER*4 number_of_generators
  integer, parameter :: cctki_use_number_of_generators = kind(number_of_generators)
  INTEGER*4 number_of_generators_phi
  integer, parameter :: cctki_use_number_of_generators_phi = kind(number_of_generators_phi)
  INTEGER*4 number_of_generators_theta
  integer, parameter :: cctki_use_number_of_generators_theta = kind(number_of_generators_theta)
  INTEGER*4 re_init_max_iter
  integer, parameter :: cctki_use_re_init_max_iter = kind(re_init_max_iter)
  INTEGER*4 re_init_undo
  integer, parameter :: cctki_use_re_init_undo = kind(re_init_undo)
  INTEGER*4 re_init_verbose
  integer, parameter :: cctki_use_re_init_verbose = kind(re_init_verbose)
  INTEGER*4 re_initialize_every
  integer, parameter :: cctki_use_re_initialize_every = kind(re_initialize_every)
  INTEGER*4 read_conformal_factor_once
  integer, parameter :: cctki_use_read_conformal_factor_once = kind(read_conformal_factor_once)
  INTEGER*4 saved_iteration_every
  integer, parameter :: cctki_use_saved_iteration_every = kind(saved_iteration_every)
  INTEGER*4 surface_interpolation_order
  integer, parameter :: cctki_use_surface_interpolation_order = kind(surface_interpolation_order)
  INTEGER*4 use_inner_excision
  integer, parameter :: cctki_use_use_inner_excision = kind(use_inner_excision)
  INTEGER*4 use_outer_excision
  integer, parameter :: cctki_use_use_outer_excision = kind(use_outer_excision)
  INTEGER*4 use_user_center
  integer, parameter :: cctki_use_use_user_center = kind(use_user_center)
  COMMON /EHFinderpriv/cas_a, cas_b, center_x, center_y, center_z, initial_a, initial_b, initial_c, initial_rad, rotation_alpha, ro&
  &tation_beta, rotation_gamma, shell_width, translate_x, translate_y, translate_z, area_calculation_method, area_interpolator, eh_&
  &lapse_type, eh_metric_type, eh_shift_type, file_type, generator_distribution, generator_interpolator, generator_tracking_method,&
  & initial_f, mode, pde_differences, re_init_int_method, surface_direction, surface_interpolator, upwind_type, area_interpolation_&
  &order, cheat, cheat_iterations, eh_number_level_sets, evolve_generators, generator_interpolation_order, last_iteration_number, m&
  &aximum_surface_number, n_array_ghosts, nphi, ntheta, number_of_generators, number_of_generators_phi, number_of_generators_theta,&
  & re_init_max_iter, re_init_undo, re_init_verbose, re_initialize_every, read_conformal_factor_once, saved_iteration_every, surfac&
  &e_interpolation_order, use_inner_excision, use_outer_excision, use_user_center
  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 initial_data
  integer, parameter :: cctki_use_initial_data = kind(initial_data)
  integer*8 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  integer*8 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  integer*8 initial_lapse
  integer, parameter :: cctki_use_initial_lapse = kind(initial_lapse)
  integer*8 initial_shift
  integer, parameter :: cctki_use_initial_shift = kind(initial_shift)
  integer*8 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  integer*8 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  integer*8 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  integer*8 metric_type
  integer, parameter :: cctki_use_metric_type = kind(metric_type)
  integer*8 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  integer*8 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  COMMON /ADMBASErest/CCTKH0, CCTKH1, CCTKH2, CCTKH3, initial_data, CCTKH4, CCTKH5, initial_lapse, initial_shift, CCTKH6, CCTKH7, C&
  &CTKH9, metric_type, CCTKH11, CCTKH12, CCTKH8, CCTKH10, CCTKH13
  REAL*8 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  REAL*8 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  REAL*8 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  REAL*8 CCTKH26
  integer, parameter :: cctki_use_CCTKH26 = kind(CCTKH26)
  REAL*8 CCTKH27
  integer, parameter :: cctki_use_CCTKH27 = kind(CCTKH27)
  REAL*8 CCTKH28
  integer, parameter :: cctki_use_CCTKH28 = kind(CCTKH28)
  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)
  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 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  integer*8 CCTKH25
  integer, parameter :: cctki_use_CCTKH25 = kind(CCTKH25)
  INTEGER*4 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  INTEGER*4 CCTKH21
  integer, parameter :: cctki_use_CCTKH21 = kind(CCTKH21)
  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)
  COMMON /GRIDrest/CCTKH14, CCTKH15, CCTKH16, CCTKH17, CCTKH26, CCTKH27, CCTKH28, CCTKH29, CCTKH30, CCTKH31, CCTKH32, CCTKH33, bita&
  &nt_plane, domain, quadrant_direction, CCTKH18, CCTKH25, CCTKH19, CCTKH20, CCTKH21, CCTKH22, CCTKH23, CCTKH24
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH34
  integer, parameter :: cctki_use_CCTKH34 = kind(CCTKH34)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH35
  integer, parameter :: cctki_use_CCTKH35 = kind(CCTKH35)
  INTEGER*4 CCTKH36
  integer, parameter :: cctki_use_CCTKH36 = kind(CCTKH36)
  INTEGER*4 MoL_Num_Evolved_Vars
  integer, parameter :: cctki_use_MoL_Num_Evolved_Vars = kind(MoL_Num_Evolved_Vars)
  INTEGER*4 CCTKH37
  integer, parameter :: cctki_use_CCTKH37 = kind(CCTKH37)
  INTEGER*4 CCTKH38
  integer, parameter :: cctki_use_CCTKH38 = kind(CCTKH38)
  INTEGER*4 CCTKH39
  integer, parameter :: cctki_use_CCTKH39 = kind(CCTKH39)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH34, MoL_Num_ArrayEvolved_Vars, CCTKH35, CCTKH36, MoL_Num_Evolved_Vars,&
  & CCTKH37, CCTKH38, CCTKH39
  INTEGER*4 use_mask
  integer, parameter :: cctki_use_use_mask = kind(use_mask)
  COMMON /SPACEMASKrest/use_mask

  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 X0center_arrays
  INTEGER X0dxg
  INTEGER X0dxg2
  INTEGER X0dyg
  INTEGER X0dyg2
  INTEGER X0dzg
  INTEGER X0dzg2
  INTEGER X0eh_area
  INTEGER X0eh_area2
  INTEGER X0eh_centroid2_x
  INTEGER X0eh_centroid2_y
  INTEGER X0eh_centroid2_z
  INTEGER X0eh_centroid_x
  INTEGER X0eh_centroid_y
  INTEGER X0eh_centroid_z
  INTEGER X0eh_circ_eq
  INTEGER X0eh_circ_eq2
  INTEGER X0eh_circ_pol
  INTEGER X0eh_circ_pol2
  INTEGER X0generator_arrays
  INTEGER X0generator_arrays2
  INTEGER X0integrate_tmp_array
  INTEGER X0interp_metric_arrays
  INTEGER X0surface_arrays
  INTEGER X0surface_int_array
  INTEGER X0surface_tmp_arrays
  INTEGER X0xg
  INTEGER X0xg2
  INTEGER X0yg
  INTEGER X0yg2
  INTEGER X0zg
  INTEGER X0zg2
  INTEGER X1dxg2
  INTEGER X1dyg2
  INTEGER X1dzg2
  INTEGER X1generator_arrays2
  INTEGER X1integrate_tmp_array
  INTEGER X1interp_metric_arrays
  INTEGER X1surface_arrays
  INTEGER X1surface_int_array
  INTEGER X1surface_tmp_arrays
  INTEGER X1xg2
  INTEGER X1yg2
  INTEGER X1zg2
  INTEGER dfsq_length
  INTEGER dfx_length
  INTEGER dfy_length
  INTEGER dfz_length
  INTEGER dxg2_length
  INTEGER dxg_length
  INTEGER dyg2_length
  INTEGER dyg_length
  INTEGER dzg2_length
  INTEGER dzg_length
  INTEGER eh_area2_length
  INTEGER eh_area_length
  INTEGER eh_centroid2_x_length
  INTEGER eh_centroid2_y_length
  INTEGER eh_centroid2_z_length
  INTEGER eh_centroid_x_length
  INTEGER eh_centroid_y_length
  INTEGER eh_centroid_z_length
  INTEGER eh_circ_eq2_length
  INTEGER eh_circ_eq_length
  INTEGER eh_circ_pol2_length
  INTEGER eh_circ_pol_length
  INTEGER eh_mask_bak_length
  INTEGER eh_mask_length
  INTEGER f_length
  INTEGER fbak_length
  INTEGER ftmp_length
  INTEGER sf_length
  INTEGER sftmp_length
  INTEGER tm_mask_length
  INTEGER xg2_length
  INTEGER xg_length
  INTEGER yg2_length
  INTEGER yg_length
  INTEGER zg2_length
  INTEGER zg_length
  REAL*8 alpg (X0generator_arrays)
  integer, parameter :: cctki_use_alpg = kind(alpg)
  REAL*8 alpg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_alpg2 = kind(alpg2)
  REAL*8 betaxg (X0generator_arrays)
  integer, parameter :: cctki_use_betaxg = kind(betaxg)
  REAL*8 betaxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betaxg2 = kind(betaxg2)
  REAL*8 betayg (X0generator_arrays)
  integer, parameter :: cctki_use_betayg = kind(betayg)
  REAL*8 betayg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betayg2 = kind(betayg2)
  REAL*8 betazg (X0generator_arrays)
  integer, parameter :: cctki_use_betazg = kind(betazg)
  REAL*8 betazg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_betazg2 = kind(betazg2)
  REAL*8 center (X0center_arrays)
  integer, parameter :: cctki_use_center = kind(center)
  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)
  REAL*8 da (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_da = kind(da)
  REAL*8 dfdx_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdx_interp = kind(dfdx_interp)
  REAL*8 dfdy_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdy_interp = kind(dfdy_interp)
  REAL*8 dfdz_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_dfdz_interp = kind(dfdz_interp)
  REAL*8 dfsq (cctk_ash1,cctk_ash2,cctk_ash3,dfsq_length)
  integer, parameter :: cctki_use_dfsq = kind(dfsq)
  REAL*8 dfx (cctk_ash1,cctk_ash2,cctk_ash3,dfx_length)
  integer, parameter :: cctki_use_dfx = kind(dfx)
  REAL*8 dfxg (X0generator_arrays)
  integer, parameter :: cctki_use_dfxg = kind(dfxg)
  REAL*8 dfxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfxg2 = kind(dfxg2)
  REAL*8 dfy (cctk_ash1,cctk_ash2,cctk_ash3,dfy_length)
  integer, parameter :: cctki_use_dfy = kind(dfy)
  REAL*8 dfyg (X0generator_arrays)
  integer, parameter :: cctki_use_dfyg = kind(dfyg)
  REAL*8 dfyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfyg2 = kind(dfyg2)
  REAL*8 dfz (cctk_ash1,cctk_ash2,cctk_ash3,dfz_length)
  integer, parameter :: cctki_use_dfz = kind(dfz)
  REAL*8 dfzg (X0generator_arrays)
  integer, parameter :: cctki_use_dfzg = kind(dfzg)
  REAL*8 dfzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_dfzg2 = kind(dfzg2)
  REAL*8 dlphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dlphi = kind(dlphi)
  REAL*8 dltheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_dltheta = kind(dltheta)
  REAL*8 drdphi (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdphi = kind(drdphi)
  REAL*8 drdtheta (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_drdtheta = kind(drdtheta)
  REAL*8 drsurf (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_drsurf = kind(drsurf)
  REAL*8 dxg (X0dxg,dxg_length)
  integer, parameter :: cctki_use_dxg = kind(dxg)
  REAL*8 dxg2 (X0dxg2,X1dxg2,dxg2_length)
  integer, parameter :: cctki_use_dxg2 = kind(dxg2)
  REAL*8 dyg (X0dyg,dyg_length)
  integer, parameter :: cctki_use_dyg = kind(dyg)
  REAL*8 dyg2 (X0dyg2,X1dyg2,dyg2_length)
  integer, parameter :: cctki_use_dyg2 = kind(dyg2)
  REAL*8 dzg (X0dzg,dzg_length)
  integer, parameter :: cctki_use_dzg = kind(dzg)
  REAL*8 dzg2 (X0dzg2,X1dzg2,dzg2_length)
  integer, parameter :: cctki_use_dzg2 = kind(dzg2)
  REAL*8 eh_area (X0eh_area,eh_area_length)
  integer, parameter :: cctki_use_eh_area = kind(eh_area)
  REAL*8 eh_area2 (X0eh_area2,eh_area2_length)
  integer, parameter :: cctki_use_eh_area2 = kind(eh_area2)
  REAL*8 eh_centroid2_x (X0eh_centroid2_x,eh_centroid2_x_length)
  integer, parameter :: cctki_use_eh_centroid2_x = kind(eh_centroid2_x)
  REAL*8 eh_centroid2_y (X0eh_centroid2_y,eh_centroid2_y_length)
  integer, parameter :: cctki_use_eh_centroid2_y = kind(eh_centroid2_y)
  REAL*8 eh_centroid2_z (X0eh_centroid2_z,eh_centroid2_z_length)
  integer, parameter :: cctki_use_eh_centroid2_z = kind(eh_centroid2_z)
  REAL*8 eh_centroid_x (X0eh_centroid_x,eh_centroid_x_length)
  integer, parameter :: cctki_use_eh_centroid_x = kind(eh_centroid_x)
  REAL*8 eh_centroid_y (X0eh_centroid_y,eh_centroid_y_length)
  integer, parameter :: cctki_use_eh_centroid_y = kind(eh_centroid_y)
  REAL*8 eh_centroid_z (X0eh_centroid_z,eh_centroid_z_length)
  integer, parameter :: cctki_use_eh_centroid_z = kind(eh_centroid_z)
  REAL*8 eh_circ_eq (X0eh_circ_eq,eh_circ_eq_length)
  integer, parameter :: cctki_use_eh_circ_eq = kind(eh_circ_eq)
  REAL*8 eh_circ_eq2 (X0eh_circ_eq2,eh_circ_eq2_length)
  integer, parameter :: cctki_use_eh_circ_eq2 = kind(eh_circ_eq2)
  REAL*8 eh_circ_pol (X0eh_circ_pol,eh_circ_pol_length)
  integer, parameter :: cctki_use_eh_circ_pol = kind(eh_circ_pol)
  REAL*8 eh_circ_pol2 (X0eh_circ_pol2,eh_circ_pol2_length)
  integer, parameter :: cctki_use_eh_circ_pol2 = kind(eh_circ_pol2)
  INTEGER*4 eh_mask (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_length)
  integer, parameter :: cctki_use_eh_mask = kind(eh_mask)
  INTEGER*4 eh_mask_bak (cctk_ash1,cctk_ash2,cctk_ash3,eh_mask_bak_length)
  integer, parameter :: cctki_use_eh_mask_bak = kind(eh_mask_bak)
  REAL*8 f (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f = kind(f)
  REAL*8 f_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p = kind(f_p)
  REAL*8 f_p_p (cctk_ash1,cctk_ash2,cctk_ash3,f_length)
  integer, parameter :: cctki_use_f_p_p = kind(f_p_p)
  REAL*8 f_interp (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_f_interp = kind(f_interp)
  REAL*8 fbak (cctk_ash1,cctk_ash2,cctk_ash3,fbak_length)
  integer, parameter :: cctki_use_fbak = kind(fbak)
  INTEGER*4 find_surface_status
  integer, parameter :: cctki_use_find_surface_status = kind(find_surface_status)
  REAL*8 ftmp (cctk_ash1,cctk_ash2,cctk_ash3,ftmp_length)
  integer, parameter :: cctki_use_ftmp = kind(ftmp)
  REAL*8 g3xx (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xx = kind(g3xx)
  REAL*8 g3xy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xy = kind(g3xy)
  REAL*8 g3xz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3xz = kind(g3xz)
  REAL*8 g3yy (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yy = kind(g3yy)
  REAL*8 g3yz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3yz = kind(g3yz)
  REAL*8 g3zz (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_g3zz = kind(g3zz)
  REAL*8 gpp (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_gpp = kind(gpp)
  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 gxxg (X0generator_arrays)
  integer, parameter :: cctki_use_gxxg = kind(gxxg)
  REAL*8 gxxg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxxg2 = kind(gxxg2)
  REAL*8 gxxi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxxi = kind(gxxi)
  REAL*8 gxyg (X0generator_arrays)
  integer, parameter :: cctki_use_gxyg = kind(gxyg)
  REAL*8 gxyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxyg2 = kind(gxyg2)
  REAL*8 gxyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxyi = kind(gxyi)
  REAL*8 gxzg (X0generator_arrays)
  integer, parameter :: cctki_use_gxzg = kind(gxzg)
  REAL*8 gxzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gxzg2 = kind(gxzg2)
  REAL*8 gxzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gxzi = kind(gxzi)
  REAL*8 gyyg (X0generator_arrays)
  integer, parameter :: cctki_use_gyyg = kind(gyyg)
  REAL*8 gyyg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyyg2 = kind(gyyg2)
  REAL*8 gyyi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyyi = kind(gyyi)
  REAL*8 gyzg (X0generator_arrays)
  integer, parameter :: cctki_use_gyzg = kind(gyzg)
  REAL*8 gyzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gyzg2 = kind(gyzg2)
  REAL*8 gyzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gyzi = kind(gyzi)
  REAL*8 gzzg (X0generator_arrays)
  integer, parameter :: cctki_use_gzzg = kind(gzzg)
  REAL*8 gzzg2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_gzzg2 = kind(gzzg2)
  REAL*8 gzzi (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_gzzi = kind(gzzi)
  REAL*8 int_tmp (X0integrate_tmp_array,X1integrate_tmp_array)
  integer, parameter :: cctki_use_int_tmp = kind(int_tmp)
  INTEGER*4 integrate_counter
  integer, parameter :: cctki_use_integrate_counter = kind(integrate_counter)
  REAL*8 interp_x (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_x = kind(interp_x)
  REAL*8 interp_y (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_y = kind(interp_y)
  REAL*8 interp_z (X0surface_tmp_arrays,X1surface_tmp_arrays)
  integer, parameter :: cctki_use_interp_z = kind(interp_z)
  INTEGER*4 levelset_counter
  integer, parameter :: cctki_use_levelset_counter = kind(levelset_counter)
  INTEGER*4 more_levelsets
  integer, parameter :: cctki_use_more_levelsets = kind(more_levelsets)
  INTEGER*4 more_points
  integer, parameter :: cctki_use_more_points = kind(more_points)
  INTEGER*4 more_surfaces
  integer, parameter :: cctki_use_more_surfaces = kind(more_surfaces)
  INTEGER*4 n_since_last_reduction (X0surface_int_array,X1surface_int_array)
  integer, parameter :: cctki_use_n_since_last_reduction = kind(n_since_last_reduction)
  INTEGER*4 niter_reinit
  integer, parameter :: cctki_use_niter_reinit = kind(niter_reinit)
  REAL*8 phi_sym_factor
  integer, parameter :: cctki_use_phi_sym_factor = kind(phi_sym_factor)
  REAL*8 phiweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_phiweights = kind(phiweights)
  INTEGER*4 points_counter
  integer, parameter :: cctki_use_points_counter = kind(points_counter)
  REAL*8 psig (X0generator_arrays)
  integer, parameter :: cctki_use_psig = kind(psig)
  REAL*8 psig2 (X0generator_arrays2,X1generator_arrays2)
  integer, parameter :: cctki_use_psig2 = kind(psig2)
  REAL*8 psii (X0interp_metric_arrays,X1interp_metric_arrays)
  integer, parameter :: cctki_use_psii = kind(psii)
  INTEGER*4 re_init_control
  integer, parameter :: cctki_use_re_init_control = kind(re_init_control)
  REAL*8 rsurf (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_rsurf = kind(rsurf)
  REAL*8 sc (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_sc = kind(sc)
  REAL*8 sf (cctk_ash1,cctk_ash2,cctk_ash3,sf_length)
  integer, parameter :: cctki_use_sf = kind(sf)
  REAL*8 sftmp (cctk_ash1,cctk_ash2,cctk_ash3,sftmp_length)
  integer, parameter :: cctki_use_sftmp = kind(sftmp)
  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)
  INTEGER*4 surface_counter
  integer, parameter :: cctki_use_surface_counter = kind(surface_counter)
  REAL*8 sym_factor
  integer, parameter :: cctki_use_sym_factor = kind(sym_factor)
  REAL*8 theta_sym_factor
  integer, parameter :: cctki_use_theta_sym_factor = kind(theta_sym_factor)
  REAL*8 thetaweights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_thetaweights = kind(thetaweights)
  INTEGER*4 tm_mask (cctk_ash1,cctk_ash2,cctk_ash3,tm_mask_length)
  integer, parameter :: cctki_use_tm_mask = kind(tm_mask)
  REAL*8 weights (X0surface_arrays,X1surface_arrays)
  integer, parameter :: cctki_use_weights = kind(weights)
  REAL*8 xg (X0xg,xg_length)
  integer, parameter :: cctki_use_xg = kind(xg)
  REAL*8 xg_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p = kind(xg_p)
  REAL*8 xg_p_p (X0xg,xg_length)
  integer, parameter :: cctki_use_xg_p_p = kind(xg_p_p)
  REAL*8 xg2 (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2 = kind(xg2)
  REAL*8 xg2_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p = kind(xg2_p)
  REAL*8 xg2_p_p (X0xg2,X1xg2,xg2_length)
  integer, parameter :: cctki_use_xg2_p_p = kind(xg2_p_p)
  REAL*8 xgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf = kind(xgf)
  REAL*8 xgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_xgf2 = kind(xgf2)
  REAL*8 yg (X0yg,yg_length)
  integer, parameter :: cctki_use_yg = kind(yg)
  REAL*8 yg_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p = kind(yg_p)
  REAL*8 yg_p_p (X0yg,yg_length)
  integer, parameter :: cctki_use_yg_p_p = kind(yg_p_p)
  REAL*8 yg2 (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2 = kind(yg2)
  REAL*8 yg2_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p = kind(yg2_p)
  REAL*8 yg2_p_p (X0yg2,X1yg2,yg2_length)
  integer, parameter :: cctki_use_yg2_p_p = kind(yg2_p_p)
  REAL*8 ygf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf = kind(ygf)
  REAL*8 ygf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_ygf2 = kind(ygf2)
  REAL*8 zg (X0zg,zg_length)
  integer, parameter :: cctki_use_zg = kind(zg)
  REAL*8 zg_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p = kind(zg_p)
  REAL*8 zg_p_p (X0zg,zg_length)
  integer, parameter :: cctki_use_zg_p_p = kind(zg_p_p)
  REAL*8 zg2 (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2 = kind(zg2)
  REAL*8 zg2_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p = kind(zg2_p)
  REAL*8 zg2_p_p (X0zg2,X1zg2,zg2_length)
  integer, parameter :: cctki_use_zg2_p_p = kind(zg2_p_p)
  REAL*8 zgf (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf = kind(zgf)
  REAL*8 zgf2 (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_zgf2 = kind(zgf2)
  INTEGER*4 active_slicing_handle
  integer, parameter :: cctki_use_active_slicing_handle = kind(active_slicing_handle)
  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 emask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_emask = kind(emask)
  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 shift_state
  integer, parameter :: cctki_use_shift_state = kind(shift_state)
  INTEGER*4 space_mask (cctk_ash1,cctk_ash2,cctk_ash3)
  integer, parameter :: cctki_use_space_mask = kind(space_mask)
  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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

  if ( find_surface_status .lt. 0 ) then
    eh_circ_eq = zero
    eh_circ_pol = zero
    return
  else
    call CCTK_Info("EHFinder",'Copying circumference data')
    eh_circ_eq = eh_circ_eq2
    eh_circ_pol = eh_circ_pol2
  end if

end subroutine EHFinder_CopyCircumference
