


















































































































 


































































































































































 










































































































































































































 



















































 










 








































































































































































































































 










                                
                                

                                
                                

                                
                                

                                

















































































module NullExact_Analytic

  use cctk
  implicit none

contains

  
  
  
  
  
  
  
  




   function R01_out(s,l_in_Ylm,C1r,C1i,C2r,C2i,b0r,b0i,omm,time) result(R01)

      INTEGER*4,  intent(in)  :: l_in_Ylm
      REAL*8, intent(in)  :: s,C1r,C1i,C2r,C2i,b0r,b0i,omm,time
      REAL*8 :: R01, inv_r
      COMPLEX*16  :: C1,C2,b0,einuu,ii, W,W_r,rW_rr, ethbU, ethbU_r
      COMPLEX*16, parameter  :: czero = (0.0d0,0.0d0)
      logical :: first
      data       first /.true./
      save first

      call complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)
      inv_r = x_to_r_inverse(s)

      if( first .and. (b0.ne.czero .or. abs(C2-3.0d0*C1/omm**2).gt.1d-14) ) then
	 call CCTK_Warn(1,40,"NullExact_Analytic.F90","NullExact", "INVALID PARAMETERS FOR LINEARIZED SOLN OF R01")
         first = .false.
      end if

      select case (l_in_Ylm)
      case (2)
         W    = 3.0d0*C1*(ii*inv_r**3/omm - inv_r**2 + 0.5d0*inv_r**4/omm**2)
	 W_r  = 6.0d0*C1*(inv_r**3 - 1.5d0*ii*inv_r**4/omm - inv_r**5/omm**2)
         rW_rr = 18.0d0*C1*(2*ii*inv_r**4/omm - inv_r**3 + 5.0d0/3.0d0*inv_r**5/omm**2)
         ethbU   = -3.0d0*C1*(inv_r**2 + 2.0d0*ii*inv_r**3/omm + 1.5d0*inv_r**4/omm**2)
         ethbU_r = 6.0d0*C1*(inv_r**3+3.0d0*ii*inv_r**4/omm + 3.0d0*inv_r**5/omm**2)
	 R01 = dble((W*inv_r + 2.0d0*W_r + 0.5d0*rW_rr - inv_r*ethbU - 0.5d0*ethbU_r)*einuu)

      case default
	 call CCTK_Warn(1,54,"NullExact_Analytic.F90","NullExact", "unencoded value for l_in_Ylm")
      end select

   end function R01_out


   subroutine NullExact_Analytic_R01_2D(patchID,n1,n2,qs,ps,s,time,R01,Ylm)

      INTEGER*4,  intent(in)  :: n1, n2, patchID
      REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
      COMPLEX*16, intent(in) :: Ylm(n1,n2,2)
      REAL*8, intent(out) :: R01(n1,n2)
      REAL*8 :: R01_i
      INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news
      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 MoLRegisterEvolvedGroup (EvolvedIndex, RHSIndex)
  implicit none
  INTEGER*4 EvolvedIndex
  INTEGER*4 RHSIndex
  end function MoLRegisterEvolvedGroup
  end interface

      select case (testbed_ID)
      case (2) 
	 R01_i = R01_out(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
			 ,beta0r,beta0i,omm,time)
	 R01 = R01_i*Ylm(:,:,patchID)
      case default
	 R01 = 0
	 call CCTK_Warn(1,77,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
      end select

   end subroutine NullExact_Analytic_R01_2D


  function eth2fac(i) result(e2)

    INTEGER*4, intent(in)  :: i
    REAL*8 :: e2

      e2 = dsqrt(1.0d0*(i-1)*i*(i+1)*(i+2))

  end function eth2fac

  function eth1fac(i) result(e1)

    INTEGER*4, intent(in)  :: i
    REAL*8 :: e1

      e1 = dsqrt(1.0d0*i*(i+1))

  end function eth1fac

  subroutine complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)

    REAL*8, intent(in)  :: C1r,C1i,C2r,C2i,b0r,b0i,omm,time
    COMPLEX*16, intent(out)  :: C1,C2,b0,einuu,ii
      C1=dcmplx(C1r,C1i)
      C2=dcmplx(C2r,C2i)
      b0=dcmplx(b0r,b0i)
      einuu=dcmplx(cos(omm*time),sin(omm*time))
      ii=dcmplx(0.0d0,1.0d0)

  end subroutine complexify

  function x_to_r_inverse(x) result(i_r)

    use NullGrid_Vars
    REAL*8, intent(in)  :: x
    REAL*8 :: i_r

      i_r = (1-x)/(x*rwt)

  end function x_to_r_inverse


  
  
  
  
  
  
  


  function jout(s,l_in_Ylm,C1r,C1i,C2r,C2i,b0r,b0i,omm,time) result(J)

    INTEGER*4,  intent(in)  :: l_in_Ylm
    REAL*8, intent(in)  :: s,C1r,C1i,C2r,C2i,b0r,b0i,omm,time
    REAL*8 :: J, inv_r
    COMPLEX*16  :: C1,C2,b0,einuu,ii

      call complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)
      inv_r = x_to_r_inverse(s)

      select case (l_in_Ylm)
      case (2)
        J = dble(einuu*(24*b0+3*ii*omm*C1-omm**3*C2*ii-3*C2*inv_r**3+9*C1*inv_r)/36)
      case (3)
        J = dble(-ii*einuu*(-3*omm*C1+omm**4*C2*ii+60*ii*b0+18*ii*C1*inv_r-45*ii*C2*inv_r**4+30*omm*C2*inv_r**3)/180)
      case default
       call CCTK_Warn(1,149,"NullExact_Analytic.F90","NullExact", "unencoded value for l_in_Ylm")
      end select

  end function jout

  function bout(s,l_in_Ylm,C1r,C1i,C2r,C2i,b0r,b0i,omm,time) result(B)

    INTEGER*4,  intent(in)  :: l_in_Ylm
    REAL*8, intent(in)  :: s,C1r,C1i,C2r,C2i,b0r,b0i,omm,time
    REAL*8 :: B
    COMPLEX*16  :: C1,C2,b0,einuu,ii

      call complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)
      B=dble(einuu*b0)

  end function bout

  function uout(s,l_in_Ylm,C1r,C1i,C2r,C2i,b0r,b0i,omm,time) result(U)

    use NullGrid_Vars
    INTEGER*4,  intent(in)  :: l_in_Ylm
    REAL*8, intent(in)  :: s,C1r,C1i,C2r,C2i,b0r,b0i,omm,time
    REAL*8 :: U, inv_r
    COMPLEX*16  :: C1,C2,b0,einuu,ii
    INTEGER*4 :: i1

      call complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)
      inv_r = x_to_r_inverse(s)




      i1 = 1
      If (inv_r<0) THEN
        inv_r = x_to_r_inverse(s-dx)
        i1 = -1
      end if

      select case (l_in_Ylm)
      case (2)
        U = dble(-einuu*( i1*(-18*C1*inv_r**2-12*ii*omm*C2*inv_r**3-9*C2*inv_r**4-72*b0*inv_r) &
                 +24*ii*omm*b0-3*omm**2*C1+omm**4*C2)/36)
        
        
      case (3)
        U = dble(-einuu*( i1*(-180*C2*inv_r**5-225*ii*omm*C2*inv_r**4+120*omm**2*C2*inv_r**3 &
                -90*C1*inv_r**2-360*b0*inv_r) &
                 -3*omm**2*C1+omm**5*C2*ii+60*ii*omm*b0)/180)
      case default
       call CCTK_Warn(1,198,"NullExact_Analytic.F90","NullExact", "unencoded value for l_in_Ylm")
      end select

  end function uout

  function druout(s,l_in_Ylm,C1r,C1i,C2r,C2i,b0r,b0i,omm,time) result(drU)

    use NullGrid_Vars
    INTEGER*4,  intent(in)  :: l_in_Ylm
    REAL*8, intent(in)  :: s,C1r,C1i,C2r,C2i,b0r,b0i,omm,time
    REAL*8 :: drU, inv_r
    COMPLEX*16  :: C1,C2,b0,einuu,ii
    INTEGER*4 :: i1

      call complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)
      inv_r = x_to_r_inverse(s)

      i1 = 1
      If (inv_r<0) THEN
        inv_r = x_to_r_inverse(s-dx)
        i1 = -1
      end if

      select case (l_in_Ylm)
      case (2)
        drU = dble(-einuu*(i1*(2*b0*inv_r**2+C1*inv_r**3+ii*omm*C2*inv_r**4+C2*inv_r**5)))
      case (3)
        drU = dble(-einuu*(i1*(2*b0*inv_r**2+C1*inv_r**3-2*omm**2*C2*inv_r**4&
                              +5*ii*omm*C2*inv_r**5+5*C2*inv_r**6)))
      case default
       call CCTK_Warn(1,228,"NullExact_Analytic.F90","NullExact", "unencoded value for l_in_Ylm")
      end select

  end function druout

  function wout(s,l_in_Ylm,C1r,C1i,C2r,C2i,b0r,b0i,omm,time) result(W)

    INTEGER*4,  intent(in)  :: l_in_Ylm
    REAL*8, intent(in)  :: s,C1r,C1i,C2r,C2i,b0r,b0i,omm,time
    REAL*8 :: W, inv_r
    COMPLEX*16  :: C1,C2,b0,einuu,ii

      call complexify(C1r,C1i,C2r,C2i,b0r,b0i,omm,time,C1,C2,b0,einuu,ii)
      inv_r = x_to_r_inverse(s)
      

      select case (l_in_Ylm)
      case (2)
        W = dble(einuu*(-12*b0*inv_r+3*C2*inv_r**4+6*ii*omm*C2*inv_r**3+24*ii*omm*b0 &
                  -3*omm**2*C1+omm**4*C2+6*ii*omm*C1*inv_r &
                  -2*ii*omm**3*C2*inv_r-6*omm**2*C2*inv_r**2)/6)
        
        
        
      case (3)
        W = dble(einuu*(-30*b0*inv_r+45*C2*inv_r**5+75*ii*omm*C2*inv_r**4-60*omm**2*C2*inv_r**3 &
                 +60*ii*omm*b0-3*omm**2*C1+ii*omm**5*C2 &
                 +15*ii*omm*C1*inv_r+5*omm**4*C2*inv_r-30*ii*omm**3*C2*inv_r**2)/15)
      case default
       call CCTK_Warn(1,257,"NullExact_Analytic.F90","NullExact", "unencoded value for l_in_Ylm")
      end select

  end function wout


  function NullExact_Analytic_J_pt(patchID,q,p,s,time) result(J)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    COMPLEX*16 :: J
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

    REAL*8 :: rand(2)

       call random_number(rand)
       J = amplitude * dcmplx(rand(1)-0.5, rand(2)-0.5)

  end function NullExact_Analytic_J_pt

  function NullExact_Analytic_beta_pt(patchID,q,p,s,time) result(beta)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    REAL*8 :: beta
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

       call random_number(beta)
       beta = amplitude * (beta-0.5)

  end function NullExact_Analytic_beta_pt

  function NullExact_Analytic_U_pt(patchID,q,p,s,time) result(U)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    COMPLEX*16 :: U

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

    REAL*8 :: rand(2)

    select case (testbed_ID)
    case (0) 
       U = 0
    case (1) 
       call random_number(rand)
       U = amplitude * dcmplx(rand(1)-0.5, rand(2)-0.5)
    case default
       U = 0
       call CCTK_Warn(1,313,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end function NullExact_Analytic_U_pt

  function NullExact_Analytic_W_pt(patchID,q,p,s,time) result(W)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    REAL*8 :: W

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

       call random_number(W)
       W = amplitude * (W-0.5)

  end function NullExact_Analytic_W_pt

  function NullExact_Analytic_nu_pt(patchID,q,p,s,time) result(nu)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    COMPLEX*16 :: nu

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

    REAL*8 :: rand(2)

       call random_number(rand)
       nu = amplitude * dcmplx(rand(1)-0.5, rand(2)-0.5)

  end function NullExact_Analytic_nu_pt

  function NullExact_Analytic_cb_pt(patchID,q,p,s,time) result(cb)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    COMPLEX*16 :: cb

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

    REAL*8 :: rand(2)

       call random_number(rand)
       cb = amplitude * dcmplx(rand(1)-0.5, rand(2)-0.5)

  end function NullExact_Analytic_cb_pt

  function NullExact_Analytic_ck_pt(patchID,q,p,s,time) result(ck)

    INTEGER*4,  intent(in)  :: patchID
    REAL*8, intent(in)  :: q, p, s, time
    COMPLEX*16 :: ck

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    

    REAL*8 :: rand(2)

       call random_number(rand)
       ck = amplitude * dcmplx(rand(1)-0.5, rand(2)-0.5)

  end function NullExact_Analytic_ck_pt


  
  
  

  subroutine NullExact_Analytic_J_2D(patchID,n1,n2,qs,ps,s,time,J,Ylm_2)

    INTEGER*4,  intent(in)  :: n1, n2,patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_2(n1,n2,2)
    COMPLEX*16, intent(out) :: J(n1,n2)
    INTEGER*4 :: i1, i2
    REAL*8 :: j1
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news
    select case (testbed_ID)
    case (0) 
       J = 0
    case (1) 

    do i2 = 1, n2
       do i1 = 1, n1
          J(i1,i2) = NullExact_Analytic_J_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do

    case (2) 
       j1 = jout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       J = j1*Ylm_2(:,:,patchID)*eth2fac(l_in_Ylm)
    case (3) 
       J = Ylm_2(:,:,patchID)
    case default
       J = 0
       call CCTK_Warn(1,417,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_J_2D


  subroutine NullExact_Analytic_beta_2D(patchID,n1,n2,qs,ps,s,time,beta,Ylm)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm(n1,n2,2)
    REAL*8, intent(out) :: beta(n1,n2)
    REAL*8 :: b1
    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       beta = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          beta(i1,i2) = NullExact_Analytic_beta_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       b1 = bout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       beta = b1*Ylm(:,:,patchID)
    case (3) 
       beta = Ylm(:,:,patchID)
    case default
       beta = 0
       call CCTK_Warn(1,450,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_beta_2D

  subroutine NullExact_Analytic_U_2D(patchID,n1,n2,qs,ps,s,time,U,Ylm_1)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_1(n1,n2,2)
    COMPLEX*16, intent(out) :: U(n1,n2)
    REAL*8 :: u1
    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       U = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          U(i1,i2) = NullExact_Analytic_U_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       u1 = uout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       U = u1*Ylm_1(:,:,patchID)*eth1fac(l_in_Ylm)
    case (3) 
       U = Ylm_1(:,:,patchID)
    case default
       U = 0
       call CCTK_Warn(1,482,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_U_2D

  subroutine NullExact_Analytic_drU_2D(patchID,n1,n2,qs,ps,s,time,drU,Ylm_1)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_1(n1,n2,2)
    COMPLEX*16, intent(out) :: drU(n1,n2)
    REAL*8 :: dru1
    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       drU = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          drU(i1,i2) = NullExact_Analytic_U_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       dru1 = druout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       drU = dru1*Ylm_1(:,:,patchID)*eth1fac(l_in_Ylm)
    case (3) 
       drU = Ylm_1(:,:,patchID)
    case default
       drU = 0
       call CCTK_Warn(1,514,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_drU_2D

  subroutine NullExact_Analytic_W_2D(patchID,n1,n2,qs,ps,s,time,W,Ylm)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm(n1,n2,2)
    REAL*8, intent(out) :: W(n1,n2)
    REAL*8 :: w1
    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       W = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          W(i1,i2) = NullExact_Analytic_W_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       w1 = wout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       W = w1*Ylm(:,:,patchID)
    case (3) 
       W = Ylm(:,:,patchID)
    case default
       W = 0
       call CCTK_Warn(1,546,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_W_2D

  subroutine NullExact_Analytic_nu_2D(patchID,n1,n2,qs,ps,s,time,nu,Ylm_1)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_1(n1,n2,2)
    COMPLEX*16, intent(out) :: nu(n1,n2)
    REAL*8 :: j1
    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       nu = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          nu(i1,i2) = NullExact_Analytic_nu_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       j1 = jout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       nu = j1*Ylm_1(:,:,patchID)*eth1fac(l_in_Ylm)*(2-l_in_Ylm*(l_in_Ylm+1))
    case (3) 
       nu = Ylm_1(:,:,patchID)
    case default
       nu = 0
       call CCTK_Warn(1,578,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_nu_2D

  subroutine NullExact_Analytic_cb_2D(patchID,n1,n2,qs,ps,s,time,cb,Ylm_1)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_1(n1,n2,2)
    COMPLEX*16, intent(out) :: cb(n1,n2)
    REAL*8 :: b1
    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       cb = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          cb(i1,i2) = NullExact_Analytic_cb_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       b1 = bout(s,l_in_Ylm,Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i &
                ,beta0r,beta0i,omm,time)
       cb = b1*Ylm_1(:,:,patchID)*eth1fac(l_in_Ylm)
    case (3) 
       cb = Ylm_1(:,:,patchID)
    case default
       cb = 0
       call CCTK_Warn(1,610,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select


  end subroutine NullExact_Analytic_cb_2D

  subroutine NullExact_Analytic_ck_2D(patchID,n1,n2,qs,ps,s,time,ck,Ylm_1)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_1(n1,n2,2)
    COMPLEX*16, intent(out) :: ck(n1,n2)

    INTEGER*4 :: i1, i2
    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       ck = 0
    case (1) 
    do i2 = 1, n2
       do i1 = 1, n1
          ck(i1,i2) = NullExact_Analytic_ck_pt(patchID,qs(i1,i2),ps(i1,i2),s,time)
       end do
    end do
    case (2) 
       ck = 0
    case (3) 
       ck = Ylm_1(:,:,patchID)
    case default
       ck = 0
       call CCTK_Warn(1,641,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select


  end subroutine NullExact_Analytic_ck_2D





























  subroutine NullExact_Analytic_BondiNews_2D(patchID,n1,n2,qs,ps,s,time,News,Psi4e,Ylm_2)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_2(n1,n2,2)
    COMPLEX*16, intent(out) :: News(n1,n2),Psi4e(n1,n2)
    REAL*8 :: nn,npsi
    COMPLEX*16  :: C1,C2,b0,einuu,ii

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news

    select case (testbed_ID)
    case (0) 
       News = 0
    case (1) 
       News = 1.e+10
    case (2) 
      call complexify(Constant_C1r,Constant_C1i,Constant_C2r,Constant_C2i,beta0r,beta0i,omm,time,C1,C2,b0,einuu,ii)
      select case (l_in_Ylm)
        case (2)
          nn = dble(ii*einuu*omm**3*C2/24)
          npsi = dble(-einuu*omm**4*C2/24)
        case (3)
          nn = dble(-einuu*omm**4*C2/60)
          npsi = dble(-ii*einuu*omm**5*C2/60)
        case default
          call CCTK_Warn(1,701,"NullExact_Analytic.F90","NullExact", "unencoded vale for l_in_Ylm")
          nn = 0
      end select
      News = nn*Ylm_2(:,:,patchID)*eth2fac(l_in_Ylm)
      Psi4e = npsi*Ylm_2(:,:,patchID)*eth2fac(l_in_Ylm)
    case (3) 
       News = Ylm_2(:,:,patchID)
    case default
       News = 0
       Psi4e = 0
       call CCTK_Warn(1,711,"NullExact_Analytic.F90","NullExact", "unrecognized value for testbed_ID")
    end select

  end subroutine NullExact_Analytic_BondiNews_2D

  subroutine NullExact_Analytic_BondiTime_2D(patchID,n1,n2,qs,ps,s,time,BondiTime,Ylm_0)

    INTEGER*4,  intent(in)  :: n1, n2, patchID
    REAL*8, intent(in)  :: qs(n1,n2), ps(n1,n2), s, time
    COMPLEX*16, intent(in) :: Ylm_0(n1,n2,2)
    REAL*8,    intent(out) :: BondiTime(n1,n2)

    INTEGER*4 NullExact_MaxEvolvedArraySize
  integer, parameter :: cctki_use_NullExact_MaxEvolvedArraySize = kind(NullExact_MaxEvolvedArraySize)
  INTEGER*4 NullExact_NumArrayEvolvedVars
  integer, parameter :: cctki_use_NullExact_NumArrayEvolvedVars = kind(NullExact_NumArrayEvolvedVars)
  INTEGER*4 l_in_Ylm
  integer, parameter :: cctki_use_l_in_Ylm = kind(l_in_Ylm)
  INTEGER*4 m_in_Ylm
  integer, parameter :: cctki_use_m_in_Ylm = kind(m_in_Ylm)
  COMMON /NullExactrest/NullExact_MaxEvolvedArraySize, NullExact_NumArrayEvolvedVars, l_in_Ylm, m_in_Ylm
  REAL*8 A_r0
  integer, parameter :: cctki_use_A_r0 = kind(A_r0)
  REAL*8 Constant_C1i
  integer, parameter :: cctki_use_Constant_C1i = kind(Constant_C1i)
  REAL*8 Constant_C1r
  integer, parameter :: cctki_use_Constant_C1r = kind(Constant_C1r)
  REAL*8 Constant_C2i
  integer, parameter :: cctki_use_Constant_C2i = kind(Constant_C2i)
  REAL*8 Constant_C2r
  integer, parameter :: cctki_use_Constant_C2r = kind(Constant_C2r)
  REAL*8 F_r0
  integer, parameter :: cctki_use_F_r0 = kind(F_r0)
  REAL*8 amplitude
  integer, parameter :: cctki_use_amplitude = kind(amplitude)
  REAL*8 beta0i
  integer, parameter :: cctki_use_beta0i = kind(beta0i)
  REAL*8 beta0r
  integer, parameter :: cctki_use_beta0r = kind(beta0r)
  REAL*8 omm
  integer, parameter :: cctki_use_omm = kind(omm)
  integer*8 error_mask_type
  integer, parameter :: cctki_use_error_mask_type = kind(error_mask_type)
  INTEGER*4 analytic_fields
  integer, parameter :: cctki_use_analytic_fields = kind(analytic_fields)
  INTEGER*4 testbed_ID
  integer, parameter :: cctki_use_testbed_ID = kind(testbed_ID)
  INTEGER*4 verbose
  integer, parameter :: cctki_use_verbose = kind(verbose)
  COMMON /NullExactpriv/A_r0, Constant_C1i, Constant_C1r, Constant_C2i, Constant_C2r, F_r0, amplitude, beta0i, beta0r, omm, error_m&
  &ask_type, analytic_fields, testbed_ID, verbose
  INTEGER*4 MoL_Max_Evolved_Array_Size
  integer, parameter :: cctki_use_MoL_Max_Evolved_Array_Size = kind(MoL_Max_Evolved_Array_Size)
  INTEGER*4 CCTKH0
  integer, parameter :: cctki_use_CCTKH0 = kind(CCTKH0)
  INTEGER*4 MoL_Num_ArrayEvolved_Vars
  integer, parameter :: cctki_use_MoL_Num_ArrayEvolved_Vars = kind(MoL_Num_ArrayEvolved_Vars)
  INTEGER*4 CCTKH1
  integer, parameter :: cctki_use_CCTKH1 = kind(CCTKH1)
  INTEGER*4 CCTKH2
  integer, parameter :: cctki_use_CCTKH2 = kind(CCTKH2)
  INTEGER*4 CCTKH3
  integer, parameter :: cctki_use_CCTKH3 = kind(CCTKH3)
  INTEGER*4 CCTKH4
  integer, parameter :: cctki_use_CCTKH4 = kind(CCTKH4)
  INTEGER*4 CCTKH5
  integer, parameter :: cctki_use_CCTKH5 = kind(CCTKH5)
  INTEGER*4 CCTKH6
  integer, parameter :: cctki_use_CCTKH6 = kind(CCTKH6)
  COMMON /METHODOFLINESrest/MoL_Max_Evolved_Array_Size, CCTKH0, MoL_Num_ArrayEvolved_Vars, CCTKH1, CCTKH2, CCTKH3, CCTKH4, CCTKH5, &
  &CCTKH6
  REAL*8 CCTKH16
  integer, parameter :: cctki_use_CCTKH16 = kind(CCTKH16)
  integer*8 boundary_data
  integer, parameter :: cctki_use_boundary_data = kind(boundary_data)
  integer*8 initial_J_data
  integer, parameter :: cctki_use_initial_J_data = kind(initial_J_data)
  INTEGER*4 CCTKH7
  integer, parameter :: cctki_use_CCTKH7 = kind(CCTKH7)
  INTEGER*4 CCTKH8
  integer, parameter :: cctki_use_CCTKH8 = kind(CCTKH8)
  INTEGER*4 CCTKH9
  integer, parameter :: cctki_use_CCTKH9 = kind(CCTKH9)
  INTEGER*4 CCTKH10
  integer, parameter :: cctki_use_CCTKH10 = kind(CCTKH10)
  INTEGER*4 CCTKH11
  integer, parameter :: cctki_use_CCTKH11 = kind(CCTKH11)
  INTEGER*4 CCTKH12
  integer, parameter :: cctki_use_CCTKH12 = kind(CCTKH12)
  INTEGER*4 CCTKH13
  integer, parameter :: cctki_use_CCTKH13 = kind(CCTKH13)
  INTEGER*4 CCTKH14
  integer, parameter :: cctki_use_CCTKH14 = kind(CCTKH14)
  INTEGER*4 CCTKH15
  integer, parameter :: cctki_use_CCTKH15 = kind(CCTKH15)
  INTEGER*4 CCTKH17
  integer, parameter :: cctki_use_CCTKH17 = kind(CCTKH17)
  INTEGER*4 first_order_scheme
  integer, parameter :: cctki_use_first_order_scheme = kind(first_order_scheme)
  INTEGER*4 CCTKH18
  integer, parameter :: cctki_use_CCTKH18 = kind(CCTKH18)
  COMMON /NULLEVOLVErest/CCTKH16, boundary_data, initial_J_data, CCTKH7, CCTKH8, CCTKH9, CCTKH10, CCTKH11, CCTKH12, CCTKH13, CCTKH1&
  &4, CCTKH15, CCTKH17, first_order_scheme, CCTKH18
  REAL*8 CCTKH19
  integer, parameter :: cctki_use_CCTKH19 = kind(CCTKH19)
  REAL*8 null_xin
  integer, parameter :: cctki_use_null_xin = kind(null_xin)
  INTEGER*4 N_ang_ev_outside_eq
  integer, parameter :: cctki_use_N_ang_ev_outside_eq = kind(N_ang_ev_outside_eq)
  INTEGER*4 N_ang_ghost_pts
  integer, parameter :: cctki_use_N_ang_ghost_pts = kind(N_ang_ghost_pts)
  INTEGER*4 N_ang_pts_inside_eq
  integer, parameter :: cctki_use_N_ang_pts_inside_eq = kind(N_ang_pts_inside_eq)
  INTEGER*4 N_ang_stencil_size
  integer, parameter :: cctki_use_N_ang_stencil_size = kind(N_ang_stencil_size)
  INTEGER*4 N_radial_pts
  integer, parameter :: cctki_use_N_radial_pts = kind(N_radial_pts)
  INTEGER*4 CCTKH20
  integer, parameter :: cctki_use_CCTKH20 = kind(CCTKH20)
  COMMON /NULLGRIDrest/CCTKH19, null_xin, N_ang_ev_outside_eq, N_ang_ghost_pts, N_ang_pts_inside_eq, N_ang_stencil_size, N_radial_p&
  &ts, CCTKH20
  INTEGER*4 linearized_news
  integer, parameter :: cctki_use_linearized_news = kind(linearized_news)
  COMMON /NULLNEWSrest/linearized_news


    BondiTime = 1.e+10

  end subroutine NullExact_Analytic_BondiTime_2D


end module NullExact_Analytic
