























































































































 


































































































































































 






























































































































































































































































 



















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                



















































































subroutine EHFinder_FindSurface(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
  use EHFinder_fuzzy

  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, k, l, im, jm, sn
  REAL*8, parameter :: eps = 1.0d-10
  INTEGER*4 :: interp_handle, table_handle, status, coord_system_handle

  character(len=80) :: info_message
  character(len=128) :: warn_message
  character(len=200) :: surface_interp
  INTEGER*4 :: surface_interp_len
  character(len=7) :: surface_order
  character(len=15) :: vname

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

  REAL*8, dimension(3) :: center_loc
  INTEGER*4 :: nc_loc, nc
  REAL*8 :: ncinv, maxdr_loc, maxdr, maxf_loc, maxf
  REAL*8, dimension(3) :: crange_min_loc, crange_max_loc, &
                             crange_min_glob, crange_max_glob
  REAL*8 :: ltheta, utheta, lphi, uphi

  REAL*8 :: dtheta, dphi, dthetainv, dphiinv, min_delta, rloc
  integer*8, dimension(3) :: interp_coords
  integer*8, dimension(4) :: out_array
  INTEGER*4 :: in_array
  INTEGER*4, dimension(4), parameter :: op_indices = (/ 0, 0, 0, 0 /), &
                                       op_codes = (/ 0, 1, 2, 3 /), &
                                       out_types = (/ 130, &
                                                      130, &
                                                      130, &
                                                      130 /)
  









nx = cctk_lsh(1)
ny = cctk_lsh(2)
nz = cctk_lsh(3)




ngx = cctk_nghostzones(1)
ngy = cctk_nghostzones(2)
ngz = cctk_nghostzones(3)





symx = .false.; symy = .false.; symz = .false.;

ixl = 1
ixr = nx
jyl = 1
jyr = ny
kzl = 1
kzr = nz




if ( cctk_bbox(1) .eq. 0 ) ixl = ixl + ngx
if ( cctk_bbox(2) .eq. 0 ) ixr = ixr - ngx

if ( cctk_bbox(3) .eq. 0 ) jyl = jyl + ngy
if ( cctk_bbox(4) .eq. 0 ) jyr = jyr - ngy

if ( cctk_bbox(5) .eq. 0 ) kzl = kzl + ngz
if ( cctk_bbox(6) .eq. 0 ) kzr = kzr - ngz








if ( (CCTK_Equals( domain, 'octant' ) .ne. 0) ) then
  if (cctk_lbnd(1) .eq. 0 ) then
    ixl = ixl + ngx
    symx = .true.
  end if
  if (cctk_lbnd(2) .eq. 0 ) then
    jyl = jyl + ngy
    symy = .true.
  end if
  if (cctk_lbnd(3) .eq. 0 ) then
    kzl = kzl + ngz
    symz = .true.
  end if
end if




if ( (CCTK_Equals( domain, 'quadrant' ) .ne. 0) ) then
  if ( (CCTK_Equals( quadrant_direction, 'x' ) .ne. 0) ) then
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  end if
  if ( (CCTK_Equals( quadrant_direction, 'y' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  end if
  if ( (CCTK_Equals( quadrant_direction,'z' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
  end if
end if



if ( (CCTK_Equals( domain, 'bitant' ) .ne. 0) ) then
  if ( (CCTK_Equals( bitant_plane, 'xy' ) .ne. 0) ) then
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  endif
  if ( (CCTK_Equals( bitant_plane, 'xz' ) .ne. 0) ) then
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
  endif
  if ( (CCTK_Equals( bitant_plane, 'yz' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
  endif
end if







  find_surface_status = 0
  sn = surface_counter - integrate_counter + 1


  l = levelset_counter


  write(info_message,'(a26,i3,a14,i3)') 'Finding points on surface ', sn, &
                                 ' in level set ',l
  call CCTK_Info("EHFinder", trim(info_message) )



  call CCTK_GroupbboxGN ( status, cctkGH, 4, bbox, 'ehfinder::surface_arrays' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,73,"EHFinder_FindSurface.F90","EHFinder", 'cannot get bounding box for surface arrays' )
  end if
  call CCTK_GroupgshGN ( status, cctkGH, 2, gsh, 'ehfinder::surface_arrays' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,77,"EHFinder_FindSurface.F90","EHFinder", 'cannot get global size for surface arrays' )
  end if
  call CCTK_GrouplbndGN ( status, cctkGH, 2, lbnd, 'ehfinder::surface_arrays' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,81,"EHFinder_FindSurface.F90","EHFinder", 'cannot get lower bounds for surface arrays' )
  end if
  call CCTK_GroupubndGN ( status, cctkGH, 2, ubnd, 'ehfinder::surface_arrays' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,85,"EHFinder_FindSurface.F90","EHFinder", 'cannot get upper bounds for surface arrays' )
  end if
  call CCTK_GrouplshGN ( status, cctkGH, 2, lsh, 'ehfinder::surface_arrays' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,89,"EHFinder_FindSurface.F90","EHFinder", 'cannot get local size for surface arrays' )
  end if
  call CCTK_GroupnghostzonesGN ( status, cctkGH, 2, nghost, &
                                         'ehfinder::surface_arrays' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,94,"EHFinder_FindSurface.F90","EHFinder", 'cannot get local size for surface arrays' )
  end if
  

  if ( use_user_center .gt. 0 ) then
    center(1) = center_x
    center(2) = center_y
    center(3) = center_z
  else



    nc_loc = 0; center_loc = zero
    min_delta = minval ( cctk_delta_space )
    do k = kzl, kzr
      do j = jyl, jyr
        do i = ixl, ixr
          if ( eh_mask(i,j,k,l) .eq. 0 ) then
            if ( ( ( f(i,j,k,l) * f(i-1,j,k,l) .lt. zero ) .or. &
                   ( f(i,j,k,l) * f(i+1,j,k,l) .lt. zero ) .or. &
                   ( f(i,j,k,l) * f(i,j-1,k,l) .lt. zero ) .or. &
                   ( f(i,j,k,l) * f(i,j+1,k,l) .lt. zero ) .or. &
                   ( f(i,j,k,l) * f(i,j,k-1,l) .lt. zero ) .or. &
                   ( f(i,j,k,l) * f(i,j,k+1,l) .lt. zero ) ) .and. &
                 ( fuzzy_eq ( sc(i,j,k), real(sn,wp), small ) .or. &
                   fuzzy_eq ( sc(i-1,j,k), real(sn,wp), small ) .or. & 
                   fuzzy_eq ( sc(i+1,j,k), real(sn,wp), small ) .or. &
                   fuzzy_eq ( sc(i,j-1,k), real(sn,wp), small ) .or. &
                   fuzzy_eq ( sc(i,j+1,k), real(sn,wp), small ) .or. &
                   fuzzy_eq ( sc(i,j,k-1), real(sn,wp), small ) .or. &
                   fuzzy_eq ( sc(i,j,k+1), real(sn,wp), small ) ) ) then
              nc_loc = nc_loc + 1
              center_loc(1) = center_loc(1) + x(i,j,k)
              center_loc(2) = center_loc(2) + y(i,j,k)
              center_loc(3) = center_loc(3) + z(i,j,k)
            end if
          end if
        end do
      end do
    end do


    call CCTK_ReduceLocScalar ( status, cctkGH, -1, sum_handle, &
                                CCTK_PointerTo( nc_loc ), CCTK_PointerTo( nc ), &
                                120 )
    call CCTK_ReduceLocArrayToArray1D ( status, cctkGH, -1, sum_handle, &
                                        CCTK_PointerTo( center_loc ), &
                                        CCTK_PointerTo( center ) , 3, &
                                        130 )
    ncinv = one / nc
    center = ncinv * center
  end if



  crange_min_loc(1) = minval ( x, mask = fuzzy_eq ( sc, real(sn,wp), small ) )
  crange_min_loc(2) = minval ( y, mask = fuzzy_eq ( sc, real(sn,wp), small ) )
  crange_min_loc(3) = minval ( z, mask = fuzzy_eq ( sc, real(sn,wp), small ) )
  crange_max_loc(1) = maxval ( x, mask = fuzzy_eq ( sc, real(sn,wp), small ) )
  crange_max_loc(2) = maxval ( y, mask = fuzzy_eq ( sc, real(sn,wp), small ) )
  crange_max_loc(3) = maxval ( z, mask = fuzzy_eq ( sc, real(sn,wp), small ) )


  call CCTK_ReduceLocArrayToArray1D ( ierr, cctkGH, -1, min_handle, &
                                      CCTK_PointerTo( crange_min_loc ), &
                                      CCTK_PointerTo( crange_min_glob ), &
                                      3, 130 )
  call CCTK_ReduceLocArrayToArray1D ( ierr, cctkGH, -1, max_handle, &
                                      CCTK_PointerTo( crange_max_loc ), &
                                      CCTK_PointerTo( crange_max_glob ), &
                                      3, 130 )


  ltheta = zero; utheta = pi
  lphi = zero; uphi = two * pi
  sym_factor = one
  s_symx = .false.; s_symy = .false.; s_symz = .false.

  if ( (CCTK_Equals( domain, 'bitant' ) .ne. 0) ) then



    if ( (CCTK_Equals( bitant_plane, 'xy' ) .ne. 0) ) then



      if ( crange_min_glob(3) .lt. zero ) then
        ltheta = zero; utheta = half * pi
        lphi = zero; uphi = two * pi
        sym_factor = two
        center(3) = zero
        s_symz = .true.
      end if 
    end if


  
    if ( (CCTK_Equals( bitant_plane, 'xz' ) .ne. 0) ) then
      if ( crange_min_glob(2) .lt. zero ) then
        ltheta = zero; utheta = pi
        lphi = zero; uphi = pi
        sym_factor = two
        center(2) = zero
        s_symy = .true.
      end if 
    end if



    if ( (CCTK_Equals( bitant_plane, 'yz' ) .ne. 0) ) then
      if ( crange_min_glob(1) .lt. zero ) then
        ltheta = zero; utheta = pi
        lphi = -half * pi; uphi = half * pi
        sym_factor = two
        center(1) = zero
        s_symx = .true.
      end if 
    end if
  end if

  if ( (CCTK_Equals( domain, 'quadrant' ) .ne. 0) ) then



    if ( (CCTK_Equals( quadrant_direction, 'x' ) .ne. 0) ) then
      if ( ( crange_min_glob(3) .lt. zero ) .and. &
           ( crange_min_glob(2) .lt. zero ) ) then
        ltheta = zero; utheta = half * pi
        lphi = zero; uphi = pi
        sym_factor = four
        center(3) = zero; center(2) = zero
        s_symz = .true.; s_symy = .true.
      else if ( crange_min_glob(3) .lt. zero ) then
        ltheta = zero; utheta = half * pi
        lphi = zero; uphi = two * pi
        sym_factor = two
        center(3) = zero
        s_symz = .true.
      else if ( crange_min_glob(2) .lt. zero ) then
        ltheta = zero; utheta = pi
        lphi = zero; uphi = pi
        sym_factor = two
        center(2) = zero
        s_symy = .true.
      end if
    end if
    


    if ( (CCTK_Equals( quadrant_direction, 'y' ) .ne. 0) ) then
      if ( ( crange_min_glob(3) .lt. zero ) .and. &
           ( crange_min_glob(1) .lt. zero ) ) then
        ltheta = zero; utheta = half * pi
        lphi = -half * pi; uphi = half * pi
        sym_factor = four
        center(3) = zero; center(1) = zero
        s_symz = .true.; s_symx = .true.
      else if ( crange_min_glob(3) .lt. zero ) then
        ltheta = zero; utheta = half * pi
        lphi = zero; uphi = two * pi
        sym_factor = two
        center(3) = zero
        s_symz = .true.
      else if ( crange_min_glob(1) .lt. zero ) then
        ltheta = zero; utheta = pi
        lphi = -half * pi; uphi = half * pi
        sym_factor = two
        center(1) = zero
        s_symx = .true.
      end if
    end if



    if ( (CCTK_Equals( quadrant_direction,'z' ) .ne. 0) ) then
      if ( ( crange_min_glob(2) .lt. zero ) .and. &
           ( crange_min_glob(1) .lt. zero ) ) then
        ltheta = zero; utheta = pi
        lphi = zero; uphi = half * pi
        sym_factor = four
        center(2) = zero; center(1) = zero
        s_symy = .true.; s_symx = .true.
      else if ( crange_min_glob(2) .lt. zero ) then
        ltheta = zero; utheta = pi
        lphi = zero; uphi = pi
        sym_factor = two
        center(2) = zero
        s_symy = .true.
      else if ( crange_min_glob(1) .lt. zero ) then
        ltheta = zero; utheta = pi
        lphi = -half * pi; uphi = half * pi
        sym_factor = two
        center(1) = zero
        s_symx = .true.
      end if
    end if
  end if
    


  if ( (CCTK_Equals( domain, 'octant' ) .ne. 0) ) then
    if ( ( crange_min_glob(3) .lt. zero ) .and. &
         ( crange_min_glob(2) .lt. zero ) .and. &
         ( crange_min_glob(1) .lt. zero ) ) then
      ltheta = zero; utheta = half * pi
      lphi = zero; uphi = half * pi
      sym_factor = eight
      center(3) = zero; center(2) = zero; center(1) = zero
      s_symz = .true.; s_symy = .true.; s_symx = .true.
    else if ( ( crange_min_glob(3) .lt. zero ) .and. &
              ( crange_min_glob(2) .lt. zero ) ) then
      ltheta = zero; utheta = half * pi
      lphi = zero; uphi = pi
      sym_factor = four
      center(3) = zero; center(2) = zero
      s_symz = .true.; s_symy = .true.
    else if ( ( crange_min_glob(3) .lt. zero ) .and. &
              ( crange_min_glob(1) .lt. zero ) ) then
      ltheta = zero; utheta = half * pi
      lphi = -half * pi; uphi = half * pi
      sym_factor = four
      center(3) = zero; center(1) = zero
      s_symz = .true.; s_symx = .true.
    else if ( ( crange_min_glob(2) .lt. zero ) .and. &
              ( crange_min_glob(1) .lt. zero ) ) then
      ltheta = zero; utheta = pi
      lphi = zero; uphi = half * pi
      sym_factor = four
      center(2) = zero; center(1) = zero
      s_symy = .true.; s_symx = .true.
    else if ( crange_min_glob(3) .lt. zero ) then 
      ltheta = zero; utheta = half * pi
      lphi = zero; uphi = two * pi
      sym_factor = two
      center(3) = zero
      s_symz = .true.
    else if ( crange_min_glob(2) .lt. zero ) then 
      ltheta = zero; utheta = pi
      lphi = zero; uphi = pi
      sym_factor = two
      center(2) = zero
      s_symy = .true.
    else if ( crange_min_glob(1) .lt. zero ) then 
      ltheta = zero; utheta = pi
      lphi = -half * pi; uphi = half * pi
      sym_factor = two
      center(1) = zero
      s_symx = .true.
    end if
  end if



  if ( .not. s_symz ) then
    githeta = ( ntheta - 1 ) / 2 + 1
  else
    githeta = ntheta
  end if
  


  if ( ( .not. s_symy ) .and. ( s_symx ) ) then
    gjphi = ( nphi - 1 ) / 2 + 1
  else
    gjphi = 1
  end if



  theta_sym_factor = two * pi / ( utheta - ltheta )
  phi_sym_factor = two * pi / ( uphi - lphi )





  dtheta = ( utheta - ltheta ) / ( ntheta - 1 )
  dphi = ( uphi - lphi ) / ( nphi - 1 )
  dthetainv = one / dtheta
  dphiinv = one / dphi
  do i = 1, lsh(1)
    ctheta(i,:) = ltheta + dtheta * ( i + lbnd(1) - 1 )
  end do
  do j = 1, lsh(2)
    cphi(:,j) = lphi + dphi * ( j +lbnd(2) - 1 )
  end do



  sintheta = sin(ctheta)
  costheta = cos(ctheta)
  sinphi = sin(cphi)
  cosphi = cos(cphi)
  






  drsurf = two * min_delta
  rsurf = zero
  n_since_last_reduction = -1







  call CCTK_FortranString ( surface_interp_len, surface_interpolator, &
                                                surface_interp )


  call CCTK_InterpHandle ( interp_handle, surface_interp(1:surface_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,416,"EHFinder_FindSurface.F90","EHFinder", trim(warn_message) )
  end if


  write(surface_order,'(a6,i1)') 'order=',surface_interpolation_order


  call Util_TableCreateFromString ( table_handle, surface_order )
  if ( table_handle .lt. 0 ) then
    call CCTK_Warn( 0,425,"EHFinder_FindSurface.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,434,"EHFinder_FindSurface.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(f_interp)


  write(vname,'(a12,i1,a1)') 'ehfinder::f[', l-1, ']'
  call CCTK_VarIndex ( in_array, vname )







  find_starting_points: do

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


        rloc = rsurf(i,j) + drsurf(i,j)


        interp_x(i,j) = center(1) + rloc * sintheta(i,j) * cosphi(i,j)
        interp_y(i,j) = center(2) + rloc * sintheta(i,j) * sinphi(i,j)
        interp_z(i,j) = center(3) + rloc * costheta(i,j)


        if ( n_since_last_reduction(i,j) .ge. 0 ) then 
          n_since_last_reduction(i,j) = n_since_last_reduction(i,j) + 1
        end if
      end do
    end do


    call CCTK_InterpGridArrays ( status, cctkGH, 3, interp_handle, &
                                 table_handle, coord_system_handle, &
                                 lsh(1) * lsh(2), 130, &
                                 interp_coords, 1, in_array, &
                                 1, (/130/), out_array(1) )
    if ( status .lt. 0 ) then
       call CCTK_Info("EHFinder", 'Interpolation failed. Giving up on finding surfaces' )
       find_surface_status = -1
       integrate_counter = integrate_counter - 1
       return
    end if
                               

    maxdr_loc = maxval ( drsurf )
    call CCTK_ReduceLocScalar ( status, cctkGH, -1, max_handle, &
                                CCTK_PointerTo( maxdr_loc ), &
                                CCTK_PointerTo( maxdr ), 130 )


    maxf_loc = maxval ( abs ( f_interp ) )
    call CCTK_ReduceLocScalar ( status, cctkGH, -1, max_handle, &
                                CCTK_PointerTo( maxf_loc ), &
                                CCTK_PointerTo( maxf ), 130 )
    


    if ( maxdr .lt. min_delta ) exit find_starting_points



    do j = 1, lsh(2)
      do i = 1, lsh(1)
        if ( f_interp(i,j) .gt. zero ) then
          drsurf(i,j) = half * drsurf(i,j)
          n_since_last_reduction(i,j) = 0
        else
          rsurf(i,j) = rsurf(i,j) + drsurf(i,j)
          if ( n_since_last_reduction(i,j) .ge. 1 ) then
            drsurf(i,j) = half * drsurf(i,j)
          end if
        end if
      end do
    end do
    
  end do find_starting_points


  out_array(2) = CCTK_PointerTo(dfdx_interp)
  out_array(3) = CCTK_PointerTo(dfdy_interp)
  out_array(4) = CCTK_PointerTo(dfdz_interp)

  call Util_TableSetIntArray ( status, table_handle, 4, &
                               op_indices, 'operand_indices' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,530,"EHFinder_FindSurface.F90","EHFinder", 'Cannot set operand indices array in parameter table' )
  endif
  call Util_TableSetIntArray ( status, table_handle, 4, &
                               op_codes, 'operation_codes' )
  if ( status .lt. 0 ) then
    call CCTK_Warn( 0,535,"EHFinder_FindSurface.F90","EHFinder", 'Cannot set operation codes array in parameter table' )
  endif



  find_surface_points: do k = 1, 15


    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_InterpGridArrays ( status, cctkGH, 3, interp_handle, &
                                 table_handle, coord_system_handle, &
                                 lsh(1) * lsh(2), 130, &
                                 interp_coords, 1, in_array, &
                                 4, out_types, out_array )
    if ( status .lt. 0 ) then
       call CCTK_Info("EHFinder", 'Interpolation failed. Giving up on finding surfaces' )
       find_surface_status = -1
       integrate_counter = integrate_counter - 1
       return
    end if
 

    maxf_loc = maxval ( abs ( f_interp ) )
    call CCTK_ReduceLocScalar ( status, cctkGH, -1, max_handle, &
                                CCTK_PointerTo( maxf_loc ), &
                                CCTK_PointerTo( maxf ), 130 )
    


    if ( maxf .gt. eps ) then
      do j = 1, lsh(2)
        do i = 1, lsh(1)
          rsurf(i,j) = rsurf(i,j) - f_interp(i,j) / &
                       ( dfdx_interp(i,j) * sintheta(i,j) * cosphi(i,j) + &
                         dfdy_interp(i,j) * sintheta(i,j) * sinphi(i,j) + &
                         dfdz_interp(i,j) * costheta(i,j) )
        end do
      end do
    else

      exit find_surface_points
    end if

  end do find_surface_points



  if ( k .gt. 15 ) then
    warn_message = 'Newton iteration did not converge! Area may be inaccurate'
    call CCTK_Warn(1,592,"EHFinder_FindSurface.F90","EHFinder", trim(warn_message) )
  end if

  drdtheta = zero
  drdphi = zero




  do j = 2, lsh(2) - 1
    do i = 2, lsh(1) - 1
      drdtheta(i,j) = half * dthetainv * ( rsurf(i+1,j) - rsurf(i-1,j) )
      drdphi(i,j) = half * dphiinv * ( rsurf(i,j+1) - rsurf(i,j-1) )
    end do
  end do


  if ( bbox(1) .eq. 1 ) then
    do j = 2, lsh(2) - 1
      drdtheta(1,j) = half * dthetainv * ( - three * rsurf(1,j) + &
                                             four * rsurf(2,j) - &
                                             rsurf(3,j) )
      drdphi(1,j) = half * dphiinv * ( rsurf(1,j+1) - rsurf(1,j-1) )
    end do
  end if


  if ( bbox(2) .eq. 1 ) then
    im = lsh(1)
    do j = 2, lsh(2) - 1
      drdtheta(im,j) = half * dthetainv * ( three * rsurf(im,j) - &
                                            four * rsurf(im-1,j) + &
                                            rsurf(im-2,j) )
      drdphi(im,j) = half * dphiinv * ( rsurf(im,j+1) - rsurf(im,j-1) )
    end do
  end if


  if ( bbox(3) .eq. 1 ) then
    do i = 2, lsh(1) - 1
      drdtheta(i,1) = half * dthetainv * ( rsurf(i+1,1) - rsurf(i-1,1) )
      drdphi(i,1) = half * dphiinv * ( - three * rsurf(i,1) + &
                                         four * rsurf(i,2) - &
                                         rsurf(i,3) )
    end do
  end if


  if ( bbox(4) .eq. 1 ) then
    jm = lsh(2)
    do i = 2, lsh(1) - 1
      drdtheta(i,jm) = half * dthetainv * ( rsurf(i+1,jm) - rsurf(i-1,jm) )
      drdphi(i,jm) = half * dphiinv * ( three * rsurf(i,jm) - &
                                        four * rsurf(i,jm-1) + &
                                        rsurf(i,jm-2) )
    end do
  end if


  if ( bbox(1) .eq. 1 .and. bbox(3) .eq. 1 ) then
    drdtheta(1,1) = half * dthetainv * ( - three * rsurf(1,1) + &
                                             four * rsurf(2,1) - &
                                             rsurf(3,1) )
    drdphi(1,1) = half * dphiinv * ( - three * rsurf(1,1) + &
                                       four * rsurf(1,2) - &
                                       rsurf(1,3) )
  end if


  if ( bbox(1) .eq. 1 .and. bbox(4) .eq. 1 ) then
    jm = lsh(2)
    drdtheta(1,jm) = half * dthetainv * ( - three * rsurf(1,jm) + &
                                             four * rsurf(2,jm) - &
                                             rsurf(3,jm) )
    drdphi(1,jm) = half * dphiinv * ( three * rsurf(1,jm) - &
                                      four * rsurf(1,jm-1) + &
                                      rsurf(1,jm-2) )
  end if
 

  if ( bbox(2) .eq. 1 .and. bbox(3) .eq. 1 ) then
    im = lsh(1)
    drdtheta(im,1) = half * dthetainv * ( three * rsurf(im,1) - &
                                          four * rsurf(im-1,1) + &
                                          rsurf(im-2,1) )
    drdphi(im,1) = half * dphiinv * ( - three * rsurf(im,1) + &
                                        four * rsurf(im,2) - &
                                        rsurf(im,3) )
  end if
 

  if ( bbox(2) .eq. 1 .and. bbox(4) .eq. 1 ) then
    im = lsh(1)
    jm = lsh(2)
    drdtheta(im,jm) = half * dthetainv * ( three * rsurf(im,jm) - &
                                           four * rsurf(im-1,jm) + &
                                           rsurf(im-2,jm) )
    drdphi(im,jm) = half * dphiinv * ( three * rsurf(im,jm) - &
                                       four * rsurf(im,jm-1) + &
                                       rsurf(im,jm-2) )
  end if


  integrate_counter = integrate_counter - 1


  call Util_TableDestroy ( status, table_handle )
  
end subroutine EHFinder_FindSurface


subroutine EHFinder_LevelSetLoopInit(cctk_dim,cctk_gsh,cctk_lsh,cctk_lbnd,cctk_ubnd,cctk_tile_min,cctk_tile_max,cctk_ash,cctk_align&
  &ment,cctk_alignment_offset,cctk_from,cctk_to,cctk_bbox,cctk_delta_time,cctk_time,cctk_delta_space,cctk_origin_space,cctk_levfac,&
  &cctk_levoff,cctk_levoffdenom,cctk_timefac,cctk_convlevel,cctk_convfac,cctk_nghostzones,cctk_iteration,cctkGH,cctk_ash1,cctk_ash2&
  &,cctk_ash3, X0center_arrays,X0dxg,X0dxg2,X0dyg,X0dyg2,X0dzg,X0dzg2,X0eh_area,X0eh_area2,X0eh_centroid2_x,X0eh_centroid2_y,X0eh_c&
  &entroid2_z,X0eh_centroid_x,X0eh_centroid_y,X0eh_centroid_z,X0eh_circ_eq,X0eh_circ_eq2,X0eh_circ_pol,X0eh_circ_pol2,X0generator_a&
  &rrays,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,X1surfac&
  &e_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_centroid2_z_length,eh_centroid_x_length,eh_centroid_y_length,eh_centroid_z_length,eh_circ_eq2_length,eh_circ_eq_length,eh_ci&
  &rc_pol2_length,eh_circ_pol_length,eh_mask_bak_length,eh_mask_length,f_length,fbak_length,ftmp_length,sf_length,sftmp_length,tm_m&
  &ask_length,xg2_length,xg_length,yg2_length,yg_length,zg2_length,zg_length,alpg,alpg2,betaxg,betaxg2,betayg,betayg2,betazg,betazg&
  &2,center,cosphi,costheta,cphi,ctheta,da,dfdx_interp,dfdy_interp,dfdz_interp,dfsq,dfx,dfxg,dfxg2,dfy,dfyg,dfyg2,dfz,dfzg,dfzg2,dl&
  &phi,dltheta,drdphi,drdtheta,drsurf,dxg,dxg2,dyg,dyg2,dzg,dzg2,eh_area,eh_area2,eh_centroid2_x,eh_centroid2_y,eh_centroid2_z,eh_c&
  &entroid_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,f&
  &bak,find_surface_status,ftmp,g3xx,g3xy,g3xz,g3yy,g3yz,g3zz,gpp,gtp,gtt,gxxg,gxxg2,gxxi,gxyg,gxyg2,gxyi,gxzg,gxzg2,gxzi,gyyg,gyyg&
  &2,gyyi,gyzg,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_contr&
  &ol,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_slicing_hand&
  &le,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,confo&
  &rmal_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,dtl&
  &apse_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,&
  &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

  more_levelsets = 1
  levelset_counter = 1

end subroutine EHFinder_LevelSetLoopInit


subroutine EHFinder_UpdateCounter(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

  if ( levelset_counter .lt. eh_number_level_sets ) then
    levelset_counter = levelset_counter + 1
    more_levelsets = 1
  else
    more_levelsets = 0
  end if

end subroutine EHFinder_UpdateCounter


subroutine EHFinder_CountSurfacesInit(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

  more_surfaces = 1
  surface_counter = 0
  sc = zero

end subroutine EHFinder_CountSurfacesInit
  

subroutine EHFinder_CountSurfaces(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
  use EHFinder_fuzzy

  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, dimension(3) :: minl
  REAL*8 :: minf_loc, minf_glob
  INTEGER*4 :: procpos_loc, procpos_glob










nx = cctk_lsh(1)
ny = cctk_lsh(2)
nz = cctk_lsh(3)




ngx = cctk_nghostzones(1)
ngy = cctk_nghostzones(2)
ngz = cctk_nghostzones(3)





symx = .false.; symy = .false.; symz = .false.;

ixl = 1
ixr = nx
jyl = 1
jyr = ny
kzl = 1
kzr = nz




if ( cctk_bbox(1) .eq. 0 ) ixl = ixl + ngx
if ( cctk_bbox(2) .eq. 0 ) ixr = ixr - ngx

if ( cctk_bbox(3) .eq. 0 ) jyl = jyl + ngy
if ( cctk_bbox(4) .eq. 0 ) jyr = jyr - ngy

if ( cctk_bbox(5) .eq. 0 ) kzl = kzl + ngz
if ( cctk_bbox(6) .eq. 0 ) kzr = kzr - ngz








if ( (CCTK_Equals( domain, 'octant' ) .ne. 0) ) then
  if (cctk_lbnd(1) .eq. 0 ) then
    ixl = ixl + ngx
    symx = .true.
  end if
  if (cctk_lbnd(2) .eq. 0 ) then
    jyl = jyl + ngy
    symy = .true.
  end if
  if (cctk_lbnd(3) .eq. 0 ) then
    kzl = kzl + ngz
    symz = .true.
  end if
end if




if ( (CCTK_Equals( domain, 'quadrant' ) .ne. 0) ) then
  if ( (CCTK_Equals( quadrant_direction, 'x' ) .ne. 0) ) then
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  end if
  if ( (CCTK_Equals( quadrant_direction, 'y' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  end if
  if ( (CCTK_Equals( quadrant_direction,'z' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
  end if
end if



if ( (CCTK_Equals( domain, 'bitant' ) .ne. 0) ) then
  if ( (CCTK_Equals( bitant_plane, 'xy' ) .ne. 0) ) then
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  endif
  if ( (CCTK_Equals( bitant_plane, 'xz' ) .ne. 0) ) then
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
  endif
  if ( (CCTK_Equals( bitant_plane, 'yz' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
  endif
end if







  minl = minloc ( f(ixl:ixr,jyl:jyr,kzl:kzr,levelset_counter), &
                  fuzzy_eq ( sc(ixl:ixr,jyl:jyr,kzl:kzr), zero, small ) .and. &
                  ( eh_mask(ixl:ixr,jyl:jyr,kzl:kzr,levelset_counter) .ge. 0 ) )


  minf_loc = f(minl(1)+ixl-1,minl(2)+jyl-1,minl(3)+kzl-1,levelset_counter)


  call CCTK_ReduceLocScalar ( ierr, cctkGH, -1, min_handle, &
                              CCTK_PointerTo( minf_loc ), &
                              CCTK_PointerTo( minf_glob ), 130 )
  if ( ierr .ne. 0 ) then
    call CCTK_Warn(0,789,"EHFinder_FindSurface.F90","EHFinder",'Reduction of minf_glob failed')
  end if






  if ( minf_loc .eq. minf_glob ) then
    procpos_loc = CCTK_MyProc ( cctkGH )
  else
    procpos_loc = CCTK_nProcs ( cctkGH )
  end if
  
  call CCTK_ReduceLocScalar ( ierr, cctkGH, -1, min_handle, &
                              CCTK_PointerTo( procpos_loc ), &
                              CCTK_PointerTo( procpos_glob ), 120 )
  if ( ierr .ne. 0 ) then
    call CCTK_Warn(0,807,"EHFinder_FindSurface.F90","EHFinder",'Reduction of minf_glob failed')
  end if



  if ( minf_glob .lt. zero ) then
    surface_counter = surface_counter + 1
    points_counter = 0
    more_points = 1
    if ( procpos_loc .eq. procpos_glob ) then
      sc(minl(1)+ixl-1,minl(2)+jyl-1,minl(3)+kzl-1) = real(surface_counter,wp)
    end if
  else
    more_surfaces = 0
    more_points = 0
  end if

end subroutine EHFinder_CountSurfaces    



subroutine EHFinder_MarkSurfaces(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
  use EHFinder_fuzzy

  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 :: n_loc, n_glob, i, j, k
  INTEGER*4 :: i1, i2, j1, j2, k1, k2
  logical :: marked










nx = cctk_lsh(1)
ny = cctk_lsh(2)
nz = cctk_lsh(3)




ngx = cctk_nghostzones(1)
ngy = cctk_nghostzones(2)
ngz = cctk_nghostzones(3)





symx = .false.; symy = .false.; symz = .false.;

ixl = 1
ixr = nx
jyl = 1
jyr = ny
kzl = 1
kzr = nz




if ( cctk_bbox(1) .eq. 0 ) ixl = ixl + ngx
if ( cctk_bbox(2) .eq. 0 ) ixr = ixr - ngx

if ( cctk_bbox(3) .eq. 0 ) jyl = jyl + ngy
if ( cctk_bbox(4) .eq. 0 ) jyr = jyr - ngy

if ( cctk_bbox(5) .eq. 0 ) kzl = kzl + ngz
if ( cctk_bbox(6) .eq. 0 ) kzr = kzr - ngz








if ( (CCTK_Equals( domain, 'octant' ) .ne. 0) ) then
  if (cctk_lbnd(1) .eq. 0 ) then
    ixl = ixl + ngx
    symx = .true.
  end if
  if (cctk_lbnd(2) .eq. 0 ) then
    jyl = jyl + ngy
    symy = .true.
  end if
  if (cctk_lbnd(3) .eq. 0 ) then
    kzl = kzl + ngz
    symz = .true.
  end if
end if




if ( (CCTK_Equals( domain, 'quadrant' ) .ne. 0) ) then
  if ( (CCTK_Equals( quadrant_direction, 'x' ) .ne. 0) ) then
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  end if
  if ( (CCTK_Equals( quadrant_direction, 'y' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  end if
  if ( (CCTK_Equals( quadrant_direction,'z' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
  end if
end if



if ( (CCTK_Equals( domain, 'bitant' ) .ne. 0) ) then
  if ( (CCTK_Equals( bitant_plane, 'xy' ) .ne. 0) ) then
    if (cctk_lbnd(3) .eq. 0 ) then
      kzl = kzl + ngz
      symz = .true.
    end if
  endif
  if ( (CCTK_Equals( bitant_plane, 'xz' ) .ne. 0) ) then
    if (cctk_lbnd(2) .eq. 0 ) then
      jyl = jyl + ngy
      symy = .true.
    end if
  endif
  if ( (CCTK_Equals( bitant_plane, 'yz' ) .ne. 0) ) then
    if (cctk_lbnd(1) .eq. 0 ) then
      ixl = ixl + ngx
      symx = .true.
    end if
  endif
end if




  

  n_loc = 0





  do k = kzl, kzr
    do j = jyl, jyr
      do i = ixl, ixr
        marked = .false.
        if ( ( eh_mask(i,j,k,levelset_counter) .ge. 0 ) .and. &
             ( f(i,j,k,levelset_counter) .lt. 0 ) .and. &
             fuzzy_ne ( sc(i,j,k), real(surface_counter,wp), small ) ) then


          if ( i + cctk_lbnd(1) .eq. 1 ) then
            i1 = 0
          else
            i1 = -1
          end if
          if ( i + cctk_lbnd(1) .eq. cctk_gsh(1) ) then
            i2 = 0
          else
            i2 = 1
          end if
          if ( j + cctk_lbnd(2) .eq. 1 ) then
            j1 = 0
          else
            j1 = -1
          end if
          if ( j + cctk_lbnd(2) .eq. cctk_gsh(2) ) then
            j2 = 0
          else
            j2 = 1
          end if
          if ( k + cctk_lbnd(3) .eq. 1 ) then
            k1 = 0
          else
            k1 = -1
          end if
          if ( k + cctk_lbnd(3) .eq. cctk_gsh(3) ) then
            k2 = 0
          else
            k2 = 1
          end if


          if ( any ( fuzzy_eq ( sc(i+i1:i+i2,j+j1:j+j2,k), &
                     real(surface_counter,wp), small ) ) ) then
            marked = .true.
          end if
          if ( any ( fuzzy_eq ( sc(i+i1:i+i2,j,k+k1:k+k2), &
                     real(surface_counter,wp), small ) ) ) then
            marked = .true.
          end if
          if ( any ( fuzzy_eq ( sc(i,j+j1:j+j2,k+k1:k+k2), &
                     real(surface_counter,wp), small ) ) ) then
            marked = .true.
          end if

          if ( marked ) then
            sc(i,j,k) = real(surface_counter,wp)
            n_loc = n_loc + 1
          end if

        end if    
      end do
    end do
  end do


  call CCTK_ReduceLocScalar ( ierr, cctkGH, -1, sum_handle, &
                              CCTK_PointerTo( n_loc ), &
                              CCTK_PointerTo( n_glob ), 120 )
  if ( ierr .ne. 0 ) then
    call CCTK_Warn(0,923,"EHFinder_FindSurface.F90","EHFinder",'Reduction of n_glob failed')
  end if




  if ( n_glob .eq. 0 ) then
    more_points = 0
  end if
  points_counter = points_counter + n_glob

end subroutine EHFinder_MarkSurfaces



subroutine EHFinder_InfoSurfaces(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

  character(len=80) :: info_message


  if ( surface_counter .eq. 1 ) then
    write(info_message,'(a9,i3,a22,i3)') 'There is ',surface_counter, &
                                      ' surface in level set ',levelset_counter
  else
    write(info_message,'(a10,i3,a23,i3)') 'There are ',surface_counter, &
                                      ' surfaces in level set ',levelset_counter
  end if
  call CCTK_Info("EHFinder", trim(info_message) )

  integrate_counter = surface_counter

end subroutine EHFinder_InfoSurfaces
