Task: Implement WeylScal4_invars_calc_Nth.cc for EinsteinAnalysis/WeylScal4 thorn

thorn_name: EinsteinAnalysis/WeylScal4
src_filename: WeylScal4_invars_calc_Nth.cc
interface: # File produced by Kranc

implements: WeylScal4

inherits:   admbase Boundary GenericFD Grid methodoflines



USES INCLUDE: loopcontrol.h
USES INCLUDE: Symmetry.h
USES INCLUDE: vectors.h
USES INCLUDE: Boundary.h

CCTK_INT FUNCTION MoLRegisterEvolved(CCTK_INT IN EvolvedIndex, CCTK_INT IN RHSIndex)
USES FUNCTION MoLRegisterEvolved

SUBROUTINE Diff_coeff(CCTK_POINTER_TO_CONST IN cctkGH, CCTK_INT IN dir, CCTK_INT IN nsize, CCTK_INT OUT ARRAY imin, CCTK_INT OUT ARRAY imax, CCTK_REAL OUT ARRAY q, CCTK_INT IN table_handle)
USES FUNCTION Diff_coeff

CCTK_INT FUNCTION MultiPatch_GetMap(CCTK_POINTER_TO_CONST IN cctkGH)
USES FUNCTION MultiPatch_GetMap

CCTK_INT FUNCTION MultiPatch_GetBbox(CCTK_POINTER_TO_CONST IN cctkGH, CCTK_INT IN size, CCTK_INT OUT ARRAY bbox)
USES FUNCTION MultiPatch_GetBbox

CCTK_INT FUNCTION GetBoundarySpecification(CCTK_INT IN size, CCTK_INT OUT ARRAY nboundaryzones, CCTK_INT OUT ARRAY is_internal, CCTK_INT OUT ARRAY is_staggered, CCTK_INT OUT ARRAY shiftout)
USES FUNCTION GetBoundarySpecification

CCTK_INT FUNCTION MultiPatch_GetBoundarySpecification(CCTK_INT IN map, CCTK_INT IN size, CCTK_INT OUT ARRAY nboundaryzones, CCTK_INT OUT ARRAY is_internal, CCTK_INT OUT ARRAY is_staggered, CCTK_INT OUT ARRAY shiftout)
USES FUNCTION MultiPatch_GetBoundarySpecification

CCTK_INT FUNCTION SymmetryTableHandleForGrid(CCTK_POINTER_TO_CONST IN cctkGH)
USES FUNCTION SymmetryTableHandleForGrid

CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN group_name, CCTK_STRING IN bc_name)
USES FUNCTION Boundary_SelectGroupForBC

CCTK_INT FUNCTION Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN var_name, CCTK_STRING IN bc_name)
USES FUNCTION Boundary_SelectVarForBC

public:
CCTK_REAL Psi0r_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=1'
{
  Psi0r
} "Psi0r_group"

public:
CCTK_REAL Psi0i_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=-1'
{
  Psi0i
} "Psi0i_group"

public:
CCTK_REAL Psi1r_group type=GF timelevels=3 tags='tensortypealias="ManualCartesian" tensorweight=0 cartesianreflectionparities="++-"'
{
  Psi1r
} "Psi1r_group"

public:
CCTK_REAL Psi1i_group type=GF timelevels=3 tags='tensortypealias="ManualCartesian" tensorweight=0 cartesianreflectionparities="--+"'
{
  Psi1i
} "Psi1i_group"

public:
CCTK_REAL Psi2r_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=1'
{
  Psi2r
} "Psi2r_group"

public:
CCTK_REAL Psi2i_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=-1'
{
  Psi2i
} "Psi2i_group"

public:
CCTK_REAL Psi3r_group type=GF timelevels=3 tags='tensortypealias="ManualCartesian" tensorweight=0 cartesianreflectionparities="++-"'
{
  Psi3r
} "Psi3r_group"

public:
CCTK_REAL Psi3i_group type=GF timelevels=3 tags='tensortypealias="ManualCartesian" tensorweight=0 cartesianreflectionparities="--+"'
{
  Psi3i
} "Psi3i_group"

public:
CCTK_REAL Psi4r_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=1'
{
  Psi4r
} "Psi4r_group"

public:
CCTK_REAL Psi4i_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=-1'
{
  Psi4i
} "Psi4i_group"

public:
CCTK_REAL curvIr_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=1'
{
  curvIr
} "curvIr_group"

public:
CCTK_REAL curvIi_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=-1'
{
  curvIi
} "curvIi_group"

public:
CCTK_REAL curvJr_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=1'
{
  curvJr
} "curvJr_group"

public:
CCTK_REAL curvJi_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0 tensorparity=-1'
{
  curvJi
} "curvJi_group"

public:
CCTK_REAL curvJ1_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
  curvJ1
} "curvJ1_group"

public:
CCTK_REAL curvJ2_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
  curvJ2
} "curvJ2_group"

public:
CCTK_REAL curvJ3_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
  curvJ3
} "curvJ3_group"

public:
CCTK_REAL curvJ4_group type=GF timelevels=3 tags='tensortypealias="Scalar" tensorweight=0'
{
  curvJ4
} "curvJ4_group"

schedule: # File produced by Kranc

STORAGE: Psi0r_group[timelevels]

STORAGE: Psi0i_group[timelevels]

STORAGE: Psi1r_group[timelevels]

STORAGE: Psi1i_group[timelevels]

STORAGE: Psi2r_group[timelevels]

STORAGE: Psi2i_group[timelevels]

STORAGE: Psi3r_group[timelevels]

STORAGE: Psi3i_group[timelevels]

STORAGE: Psi4r_group[timelevels]

STORAGE: Psi4i_group[timelevels]

STORAGE: curvIr_group[timelevels]

STORAGE: curvIi_group[timelevels]

STORAGE: curvJr_group[timelevels]

STORAGE: curvJi_group[timelevels]

STORAGE: curvJ1_group[timelevels]

STORAGE: curvJ2_group[timelevels]

STORAGE: curvJ3_group[timelevels]

STORAGE: curvJ4_group[timelevels]
schedule WeylScal4_Startup at STARTUP
{
  LANG: C
  OPTIONS: meta
} "create banner"

schedule WeylScal4_RegisterSymmetries in SymmetryRegister
{
  LANG: C
  OPTIONS: meta
} "register symmetries"

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "Nth"))
  {
    schedule group WeylScal4_psi4_calc_Nth_group in MoL_PseudoEvolution after ADMBase_SetADMVars
    {
    } "WeylScal4_psi4_calc_Nth"
  }
}

schedule WeylScal4_psi4_calc_Nth in WeylScal4_psi4_calc_Nth_group
{
  LANG: C
  READS: admbase::kxx(Everywhere)
  READS: admbase::kxy(Everywhere)
  READS: admbase::kxz(Everywhere)
  READS: admbase::kyy(Everywhere)
  READS: admbase::kyz(Everywhere)
  READS: admbase::kzz(Everywhere)
  READS: admbase::gxx(Everywhere)
  READS: admbase::gxy(Everywhere)
  READS: admbase::gxz(Everywhere)
  READS: admbase::gyy(Everywhere)
  READS: admbase::gyz(Everywhere)
  READS: admbase::gzz(Everywhere)
  READS: grid::x(Everywhere)
  READS: grid::y(Everywhere)
  READS: grid::z(Everywhere)
  WRITES: WeylScal4::Psi4i(Interior)
  WRITES: WeylScal4::Psi4r(Interior)
} "WeylScal4_psi4_calc_Nth"

schedule WeylScal4_psi4_calc_Nth_SelectBCs in WeylScal4_psi4_calc_Nth_bc_group
{
  LANG: C
  OPTIONS: level
  SYNC: Psi4i_group
  SYNC: Psi4r_group
} "WeylScal4_psi4_calc_Nth_SelectBCs"

schedule group ApplyBCs as WeylScal4_psi4_calc_Nth_ApplyBCs in WeylScal4_psi4_calc_Nth_bc_group after WeylScal4_psi4_calc_Nth_SelectBCs
{
} "Apply BCs for groups set in WeylScal4_psi4_calc_Nth"

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "Nth"))
  {
    schedule group WeylScal4_psi4_calc_Nth_bc_group in WeylScal4_psi4_calc_Nth_group after WeylScal4_psi4_calc_Nth
    {
    } "WeylScal4_psi4_calc_Nth"
  }
}

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "Nth"))
  {
    schedule group WeylScal4_psi4_calc_Nth_bc_group in MoL_PseudoEvolutionBoundaries after MoL_PostStep
    {
    } "WeylScal4_psi4_calc_Nth"
  }
}

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "2nd"))
  {
    schedule group WeylScal4_psi4_calc_2nd_group in MoL_PseudoEvolution after ADMBase_SetADMVars
    {
    } "WeylScal4_psi4_calc_2nd"
  }
}

schedule WeylScal4_psi4_calc_2nd in WeylScal4_psi4_calc_2nd_group
{
  LANG: C
  READS: admbase::kxx(Everywhere)
  READS: admbase::kxy(Everywhere)
  READS: admbase::kxz(Everywhere)
  READS: admbase::kyy(Everywhere)
  READS: admbase::kyz(Everywhere)
  READS: admbase::kzz(Everywhere)
  READS: admbase::gxx(Everywhere)
  READS: admbase::gxy(Everywhere)
  READS: admbase::gxz(Everywhere)
  READS: admbase::gyy(Everywhere)
  READS: admbase::gyz(Everywhere)
  READS: admbase::gzz(Everywhere)
  READS: grid::x(Everywhere)
  READS: grid::y(Everywhere)
  READS: grid::z(Everywhere)
  WRITES: WeylScal4::Psi4i(Interior)
  WRITES: WeylScal4::Psi4r(Interior)
} "WeylScal4_psi4_calc_2nd"

schedule WeylScal4_psi4_calc_2nd_SelectBCs in WeylScal4_psi4_calc_2nd_bc_group
{
  LANG: C
  OPTIONS: level
  SYNC: Psi4i_group
  SYNC: Psi4r_group
} "WeylScal4_psi4_calc_2nd_SelectBCs"

schedule group ApplyBCs as WeylScal4_psi4_calc_2nd_ApplyBCs in WeylScal4_psi4_calc_2nd_bc_group after WeylScal4_psi4_calc_2nd_SelectBCs
{
} "Apply BCs for groups set in WeylScal4_psi4_calc_2nd"

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "2nd"))
  {
    schedule group WeylScal4_psi4_calc_2nd_bc_group in WeylScal4_psi4_calc_2nd_group after WeylScal4_psi4_calc_2nd
    {
    } "WeylScal4_psi4_calc_2nd"
  }
}

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "2nd"))
  {
    schedule group WeylScal4_psi4_calc_2nd_bc_group in MoL_PseudoEvolutionBoundaries after MoL_PostStep
    {
    } "WeylScal4_psi4_calc_2nd"
  }
}

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "4th"))
  {
    schedule group WeylScal4_psi4_calc_4th_group in MoL_PseudoEvolution after ADMBase_SetADMVars
    {
    } "WeylScal4_psi4_calc_4th"
  }
}

schedule WeylScal4_psi4_calc_4th in WeylScal4_psi4_calc_4th_group
{
  LANG: C
  READS: admbase::kxx(Everywhere)
  READS: admbase::kxy(Everywhere)
  READS: admbase::kxz(Everywhere)
  READS: admbase::kyy(Everywhere)
  READS: admbase::kyz(Everywhere)
  READS: admbase::kzz(Everywhere)
  READS: admbase::gxx(Everywhere)
  READS: admbase::gxy(Everywhere)
  READS: admbase::gxz(Everywhere)
  READS: admbase::gyy(Everywhere)
  READS: admbase::gyz(Everywhere)
  READS: admbase::gzz(Everywhere)
  READS: grid::x(Everywhere)
  READS: grid::y(Everywhere)
  READS: grid::z(Everywhere)
  WRITES: WeylScal4::Psi4i(Interior)
  WRITES: WeylScal4::Psi4r(Interior)
} "WeylScal4_psi4_calc_4th"

schedule WeylScal4_psi4_calc_4th_SelectBCs in WeylScal4_psi4_calc_4th_bc_group
{
  LANG: C
  OPTIONS: level
  SYNC: Psi4i_group
  SYNC: Psi4r_group
} "WeylScal4_psi4_calc_4th_SelectBCs"

schedule group ApplyBCs as WeylScal4_psi4_calc_4th_ApplyBCs in WeylScal4_psi4_calc_4th_bc_group after WeylScal4_psi4_calc_4th_SelectBCs
{
} "Apply BCs for groups set in WeylScal4_psi4_calc_4th"

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "4th"))
  {
    schedule group WeylScal4_psi4_calc_4th_bc_group in WeylScal4_psi4_calc_4th_group after WeylScal4_psi4_calc_4th
    {
    } "WeylScal4_psi4_calc_4th"
  }
}

if (CCTK_EQUALS(calc_scalars, "psi4"))
{
  if (CCTK_EQUALS(fd_order, "4th"))
  {
    schedule group WeylScal4_psi4_calc_4th_bc_group in MoL_PseudoEvolutionBoundaries after MoL_PostStep
    {
    } "WeylScal4_psi4_calc_4th"
  }
}

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "Nth"))
  {
    schedule group WeylScal4_psis_calc_Nth_group in MoL_PseudoEvolution after ADMBase_SetADMVars
    {
    } "WeylScal4_psis_calc_Nth"
  }
}

schedule WeylScal4_psis_calc_Nth in WeylScal4_psis_calc_Nth_group
{
  LANG: C
  READS: admbase::kxx(Everywhere)
  READS: admbase::kxy(Everywhere)
  READS: admbase::kxz(Everywhere)
  READS: admbase::kyy(Everywhere)
  READS: admbase::kyz(Everywhere)
  READS: admbase::kzz(Everywhere)
  READS: admbase::gxx(Everywhere)
  READS: admbase::gxy(Everywhere)
  READS: admbase::gxz(Everywhere)
  READS: admbase::gyy(Everywhere)
  READS: admbase::gyz(Everywhere)
  READS: admbase::gzz(Everywhere)
  READS: grid::x(Everywhere)
  READS: grid::y(Everywhere)
  READS: grid::z(Everywhere)
  WRITES: WeylScal4::Psi0i(Interior)
  WRITES: WeylScal4::Psi0r(Interior)
  WRITES: WeylScal4::Psi1i(Interior)
  WRITES: WeylScal4::Psi1r(Interior)
  WRITES: WeylScal4::Psi2i(Interior)
  WRITES: WeylScal4::Psi2r(Interior)
  WRITES: WeylScal4::Psi3i(Interior)
  WRITES: WeylScal4::Psi3r(Interior)
  WRITES: WeylScal4::Psi4i(Interior)
  WRITES: WeylScal4::Psi4r(Interior)
} "WeylScal4_psis_calc_Nth"

schedule WeylScal4_psis_calc_Nth_SelectBCs in WeylScal4_psis_calc_Nth_bc_group
{
  LANG: C
  OPTIONS: level
  SYNC: Psi0i_group
  SYNC: Psi0r_group
  SYNC: Psi1i_group
  SYNC: Psi1r_group
  SYNC: Psi2i_group
  SYNC: Psi2r_group
  SYNC: Psi3i_group
  SYNC: Psi3r_group
  SYNC: Psi4i_group
  SYNC: Psi4r_group
} "WeylScal4_psis_calc_Nth_SelectBCs"

schedule group ApplyBCs as WeylScal4_psis_calc_Nth_ApplyBCs in WeylScal4_psis_calc_Nth_bc_group after WeylScal4_psis_calc_Nth_SelectBCs
{
} "Apply BCs for groups set in WeylScal4_psis_calc_Nth"

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "Nth"))
  {
    schedule group WeylScal4_psis_calc_Nth_bc_group in WeylScal4_psis_calc_Nth_group after WeylScal4_psis_calc_Nth
    {
    } "WeylScal4_psis_calc_Nth"
  }
}

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "Nth"))
  {
    schedule group WeylScal4_psis_calc_Nth_bc_group in MoL_PseudoEvolutionBoundaries after MoL_PostStep
    {
    } "WeylScal4_psis_calc_Nth"
  }
}

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "2nd"))
  {
    schedule group WeylScal4_psis_calc_2nd_group in MoL_PseudoEvolution after ADMBase_SetADMVars
    {
    } "WeylScal4_psis_calc_2nd"
  }
}

schedule WeylScal4_psis_calc_2nd in WeylScal4_psis_calc_2nd_group
{
  LANG: C
  READS: admbase::kxx(Everywhere)
  READS: admbase::kxy(Everywhere)
  READS: admbase::kxz(Everywhere)
  READS: admbase::kyy(Everywhere)
  READS: admbase::kyz(Everywhere)
  READS: admbase::kzz(Everywhere)
  READS: admbase::gxx(Everywhere)
  READS: admbase::gxy(Everywhere)
  READS: admbase::gxz(Everywhere)
  READS: admbase::gyy(Everywhere)
  READS: admbase::gyz(Everywhere)
  READS: admbase::gzz(Everywhere)
  READS: grid::x(Everywhere)
  READS: grid::y(Everywhere)
  READS: grid::z(Everywhere)
  WRITES: WeylScal4::Psi0i(Interior)
  WRITES: WeylScal4::Psi0r(Interior)
  WRITES: WeylScal4::Psi1i(Interior)
  WRITES: WeylScal4::Psi1r(Interior)
  WRITES: WeylScal4::Psi2i(Interior)
  WRITES: WeylScal4::Psi2r(Interior)
  WRITES: WeylScal4::Psi3i(Interior)
  WRITES: WeylScal4::Psi3r(Interior)
  WRITES: WeylScal4::Psi4i(Interior)
  WRITES: WeylScal4::Psi4r(Interior)
} "WeylScal4_psis_calc_2nd"

schedule WeylScal4_psis_calc_2nd_SelectBCs in WeylScal4_psis_calc_2nd_bc_group
{
  LANG: C
  OPTIONS: level
  SYNC: Psi0i_group
  SYNC: Psi0r_group
  SYNC: Psi1i_group
  SYNC: Psi1r_group
  SYNC: Psi2i_group
  SYNC: Psi2r_group
  SYNC: Psi3i_group
  SYNC: Psi3r_group
  SYNC: Psi4i_group
  SYNC: Psi4r_group
} "WeylScal4_psis_calc_2nd_SelectBCs"

schedule group ApplyBCs as WeylScal4_psis_calc_2nd_ApplyBCs in WeylScal4_psis_calc_2nd_bc_group after WeylScal4_psis_calc_2nd_SelectBCs
{
} "Apply BCs for groups set in WeylScal4_psis_calc_2nd"

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "2nd"))
  {
    schedule group WeylScal4_psis_calc_2nd_bc_group in WeylScal4_psis_calc_2nd_group after WeylScal4_psis_calc_2nd
    {
    } "WeylScal4_psis_calc_2nd"
  }
}

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "2nd"))
  {
    schedule group WeylScal4_psis_calc_2nd_bc_group in MoL_PseudoEvolutionBoundaries after MoL_PostStep
    {
    } "WeylScal4_psis_calc_2nd"
  }
}

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "4th"))
  {
    schedule group WeylScal4_psis_calc_4th_group in MoL_PseudoEvolution after ADMBase_SetADMVars
    {
    } "WeylScal4_psis_calc_4th"
  }
}

schedule WeylScal4_psis_calc_4th in WeylScal4_psis_calc_4th_group
{
  LANG: C
  READS: admbase::kxx(Everywhere)
  READS: admbase::kxy(Everywhere)
  READS: admbase::kxz(Everywhere)
  READS: admbase::kyy(Everywhere)
  READS: admbase::kyz(Everywhere)
  READS: admbase::kzz(Everywhere)
  READS: admbase::gxx(Everywhere)
  READS: admbase::gxy(Everywhere)
  READS: admbase::gxz(Everywhere)
  READS: admbase::gyy(Everywhere)
  READS: admbase::gyz(Everywhere)
  READS: admbase::gzz(Everywhere)
  READS: grid::x(Everywhere)
  READS: grid::y(Everywhere)
  READS: grid::z(Everywhere)
  WRITES: WeylScal4::Psi0i(Interior)
  WRITES: WeylScal4::Psi0r(Interior)
  WRITES: WeylScal4::Psi1i(Interior)
  WRITES: WeylScal4::Psi1r(Interior)
  WRITES: WeylScal4::Psi2i(Interior)
  WRITES: WeylScal4::Psi2r(Interior)
  WRITES: WeylScal4::Psi3i(Interior)
  WRITES: WeylScal4::Psi3r(Interior)
  WRITES: WeylScal4::Psi4i(Interior)
  WRITES: WeylScal4::Psi4r(Interior)
} "WeylScal4_psis_calc_4th"

schedule WeylScal4_psis_calc_4th_SelectBCs in WeylScal4_psis_calc_4th_bc_group
{
  LANG: C
  OPTIONS: level
  SYNC: Psi0i_group
  SYNC: Psi0r_group
  SYNC: Psi1i_group
  SYNC: Psi1r_group
  SYNC: Psi2i_group
  SYNC: Psi2r_group
  SYNC: Psi3i_group
  SYNC: Psi3r_group
  SYNC: Psi4i_group
  SYNC: Psi4r_group
} "WeylScal4_psis_calc_4th_SelectBCs"

schedule group ApplyBCs as WeylScal4_psis_calc_4th_ApplyBCs in WeylScal4_psis_calc_4th_bc_group after WeylScal4_psis_calc_4th_SelectBCs
{
} "Apply BCs for groups set in WeylScal4_psis_calc_4th"

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "4th"))
  {
    schedule group WeylScal4_psis_calc_4th_bc_group in WeylScal4_psis_calc_4th_group after WeylScal4_psis_calc_4th
    {
    } "WeylScal4_psis_calc_4th"
  }
}

if (CCTK_EQUALS(calc_scalars, "psis"))
{
  if (CCTK_EQUALS(fd_order, "4th"))
  {
    schedule group WeylScal4_psis_calc_4th_bc_group in MoL_PseudoEvolutionBoundaries after MoL_PostStep
    {
    } "WeylScal4_psis_calc_4th"
  }
}

if (CCTK_EQUALS(calc_invariants, "always"))
{
  if (CCTK_EQUALS(calc_scalars, "psis"))
  {
    if (CCTK_EQUALS(fd_order, "Nth"))
    {
      schedule group WeylScal4_invars_calc_Nth_group in MoL_PseudoEvolution after WeylScal4_psis_calc_Nth_group
      {
      } "WeylScal4_invars_calc_Nth"
    }
  }
}

schedule WeylScal4_invars_calc_Nth in WeylScal4_invars_calc_Nth_group
{
  LANG: C
  READS: WeylScal4::Psi0i(Everywhere)
  READS: WeylScal4::Psi0r(Everywhere)
  READS: WeylScal4::Psi1i(Everywhere)
  READS: WeylScal4::Psi1r(Everywhere)
  READS: WeylScal4::Psi2i(Everywhere)
  READS: WeylScal4::Psi2r(Everywhere)
  READS: WeylScal4::Psi3i(Everywhere)
  READS: WeylScal4::Psi3r(Everywhere)
  READS: WeylScal4::Psi4i(Everywhere)
  READS: WeylScal4::Psi4r(Everywhere)
  WRITES: WeylScal4::curvIi(Interior)
  WRITES: WeylScal4::curvIr(Interior)
  WRITES: WeylScal4::curvJ1(Interior)
  WRITES: WeylScal4::curvJ2(Interior)
  WRITES: WeylScal4::curvJ3(Interior)
  WRITES: WeylScal4::curvJ4(Interior)
  WRITES: WeylScal4::curvJi(Interior)
  WRITES: WeylScal4::curvJr(Interior)
} "WeylScal4_invars_calc_Nth"

if (CCTK_EQUALS(calc_invariants, "always"))
{
  if (CCTK_EQUALS(calc_scalars, "psis"))
  {
    if (CCTK_EQUALS(fd_order, "2nd"))
    {
      schedule group WeylScal4_invars_calc_2nd_group in MoL_PseudoEvolution after WeylScal4_psis_calc_2nd_group
      {
      } "WeylScal4_invars_calc_2nd"
    }
  }
}

schedule WeylScal4_invars_calc_2nd in WeylScal4_invars_calc_2nd_group
{
  LANG: C
  READS: WeylScal4::Psi0i(Everywhere)
  READS: WeylScal4::Psi0r(Everywhere)
  READS: WeylScal4::Psi1i(Everywhere)
  READS: WeylScal4::Psi1r(Everywhere)
  READS: WeylScal4::Psi2i(Everywhere)
  READS: WeylScal4::Psi2r(Everywhere)
  READS: WeylScal4::Psi3i(Everywhere)
  READS: WeylScal4::Psi3r(Everywhere)
  READS: WeylScal4::Psi4i(Everywhere)
  READS: WeylScal4::Psi4r(Everywhere)
  WRITES: WeylScal4::curvIi(Interior)
  WRITES: WeylScal4::curvIr(Interior)
  WRITES: WeylScal4::curvJ1(Interior)
  WRITES: WeylScal4::curvJ2(Interior)
  WRITES: WeylScal4::curvJ3(Interior)
  WRITES: WeylScal4::curvJ4(Interior)
  WRITES: WeylScal4::curvJi(Interior)
  WRITES: WeylScal4::curvJr(Interior)
} "WeylScal4_invars_calc_2nd"

if (CCTK_EQUALS(calc_invariants, "always"))
{
  if (CCTK_EQUALS(calc_scalars, "psis"))
  {
    if (CCTK_EQUALS(fd_order, "4th"))
    {
      schedule group WeylScal4_invars_calc_4th_group in MoL_PseudoEvolution after WeylScal4_psis_calc_4th_group
      {
      } "WeylScal4_invars_calc_4th"
    }
  }
}

schedule WeylScal4_invars_calc_4th in WeylScal4_invars_calc_4th_group
{
  LANG: C
  READS: WeylScal4::Psi0i(Everywhere)
  READS: WeylScal4::Psi0r(Everywhere)
  READS: WeylScal4::Psi1i(Everywhere)
  READS: WeylScal4::Psi1r(Everywhere)
  READS: WeylScal4::Psi2i(Everywhere)
  READS: WeylScal4::Psi2r(Everywhere)
  READS: WeylScal4::Psi3i(Everywhere)
  READS: WeylScal4::Psi3r(Everywhere)
  READS: WeylScal4::Psi4i(Everywhere)
  READS: WeylScal4::Psi4r(Everywhere)
  WRITES: WeylScal4::curvIi(Interior)
  WRITES: WeylScal4::curvIr(Interior)
  WRITES: WeylScal4::curvJ1(Interior)
  WRITES: WeylScal4::curvJ2(Interior)
  WRITES: WeylScal4::curvJ3(Interior)
  WRITES: WeylScal4::curvJ4(Interior)
  WRITES: WeylScal4::curvJi(Interior)
  WRITES: WeylScal4::curvJr(Interior)
} "WeylScal4_invars_calc_4th"

schedule WeylScal4_SelectBoundConds in MoL_PostStep
{
  LANG: C
  OPTIONS: level
} "select boundary conditions"

schedule WeylScal4_CheckBoundaries at BASEGRID
{
  LANG: C
  OPTIONS: meta
} "check boundaries treatment"

schedule WeylScal4_RegisterVars in MoL_Register
{
  LANG: C
  OPTIONS: meta
} "Register Variables for MoL"
schedule group ApplyBCs as WeylScal4_ApplyBCs in MoL_PostStep after WeylScal4_SelectBoundConds
{
} "Apply boundary conditions controlled by thorn Boundary"

param: # File produced by Kranc


shares: GenericFD

USES CCTK_INT assume_stress_energy_state
USES CCTK_INT assume_use_jacobian
USES CCTK_STRING jacobian_group
USES CCTK_STRING jacobian_determinant_group
USES CCTK_STRING jacobian_inverse_group
USES CCTK_STRING jacobian_derivative_group
USES CCTK_INT jacobian_identity_map


shares: MethodOfLines

USES CCTK_INT MoL_Num_Evolved_Vars
USES CCTK_INT MoL_Num_ArrayEvolved_Vars

restricted:
CCTK_INT verbose "verbose" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT other_timelevels "Number of active timelevels for non-evolved grid functions" STEERABLE=RECOVER
{
  0:3 :: ""
} 1

restricted:
CCTK_REAL offset "offset"
{
  *:* :: ""
} 1.e-15

restricted:
CCTK_REAL xorig "xorig"
{
  *:* :: ""
} 0

restricted:
CCTK_REAL yorig "yorig"
{
  *:* :: ""
} 0

restricted:
CCTK_REAL zorig "zorig"
{
  *:* :: ""
} 0

restricted:
CCTK_INT fdOrder "fdOrder"
{
  2 :: ""
  4 :: ""
  6 :: ""
  8 :: ""
} 2

restricted:
CCTK_INT tile_size "Loop tile size"
{
  *:* :: ""
} -1

private:
CCTK_KEYWORD fd_order "fd_order"
{
  "Nth" :: ""
  "2nd" :: ""
  "4th" :: ""
} "Nth"

private:
CCTK_KEYWORD calc_scalars "Which scalars to calculate"
{
  "psi4" :: ""
  "psis" :: ""
} "psi4"

private:
CCTK_KEYWORD calc_invariants "Compute invariants"
{
  "always" :: ""
  "never" :: ""
} "never"

restricted:
CCTK_INT WeylScal4_MaxNumEvolvedVars "Number of evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_Evolved_Vars STEERABLE=RECOVER
{
  0:0 :: "Number of evolved variables used by this thorn"
} 0

restricted:
CCTK_INT WeylScal4_MaxNumArrayEvolvedVars "Number of Array evolved variables used by this thorn" ACCUMULATOR-BASE=MethodofLines::MoL_Num_ArrayEvolved_Vars STEERABLE=RECOVER
{
  0:0 :: "Number of Array evolved variables used by this thorn"
} 0

restricted:
CCTK_INT timelevels "Number of active timelevels" STEERABLE=RECOVER
{
  0:3 :: ""
} 3

restricted:
CCTK_INT rhs_timelevels "Number of active RHS timelevels" STEERABLE=RECOVER
{
  0:3 :: ""
} 1

restricted:
CCTK_INT WeylScal4_psi4_calc_Nth_calc_every "WeylScal4_psi4_calc_Nth_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_psi4_calc_2nd_calc_every "WeylScal4_psi4_calc_2nd_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_psi4_calc_4th_calc_every "WeylScal4_psi4_calc_4th_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_psis_calc_Nth_calc_every "WeylScal4_psis_calc_Nth_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_psis_calc_2nd_calc_every "WeylScal4_psis_calc_2nd_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_psis_calc_4th_calc_every "WeylScal4_psis_calc_4th_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_invars_calc_Nth_calc_every "WeylScal4_invars_calc_Nth_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_invars_calc_2nd_calc_every "WeylScal4_invars_calc_2nd_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_invars_calc_4th_calc_every "WeylScal4_invars_calc_4th_calc_every" STEERABLE=ALWAYS
{
  *:* :: ""
} 1

restricted:
CCTK_INT WeylScal4_psi4_calc_Nth_calc_offset "WeylScal4_psi4_calc_Nth_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_psi4_calc_2nd_calc_offset "WeylScal4_psi4_calc_2nd_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_psi4_calc_4th_calc_offset "WeylScal4_psi4_calc_4th_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_psis_calc_Nth_calc_offset "WeylScal4_psis_calc_Nth_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_psis_calc_2nd_calc_offset "WeylScal4_psis_calc_2nd_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_psis_calc_4th_calc_offset "WeylScal4_psis_calc_4th_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_invars_calc_Nth_calc_offset "WeylScal4_invars_calc_Nth_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_invars_calc_2nd_calc_offset "WeylScal4_invars_calc_2nd_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0

restricted:
CCTK_INT WeylScal4_invars_calc_4th_calc_offset "WeylScal4_invars_calc_4th_calc_offset" STEERABLE=ALWAYS
{
  *:* :: ""
} 0


configuration: # File produced by Kranc

REQUIRES GenericFD
REQUIRES LoopControl
REQUIRES Vectors

context: Kranc.cc:
```

/*  Copyright 2014 Ian Hinder

    This file is part of Kranc.

    Kranc is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    Kranc is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Kranc; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
                                             
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#include <cctk.h>
#include <cctk_Arguments.h>
#include <cctk_Parameters.h>
#include <util_Table.h>

#include <Symmetry.h>
            
#include "Kranc.hh"

namespace WeylScal4 {

/*********************************************************************
 * GetBoundaryWidths
 *********************************************************************/

void GetBoundaryWidths(cGH const * restrict const cctkGH, CCTK_INT nboundaryzones[6])
{
  CCTK_INT is_internal[6];
  CCTK_INT is_staggered[6];
  CCTK_INT shiftout[6];
  int ierr = -1;

  if (CCTK_IsFunctionAliased ("MultiPatch_GetBoundarySpecification")) {
    int const map = MultiPatch_GetMap (cctkGH);
    /* This doesn't make sense in level mode */
    if (map < 0)
    {
      static int have_warned = 0;
      if (!have_warned)
      {
        CCTK_WARN(1, "GetBoundaryWidths: Could not determine current map (can be caused by calling in LEVEL mode)");
        have_warned = 1;
      }
      for (int i = 0; i < 6; i++)
        nboundaryzones[i] = 0;
      return;
    }
    ierr = MultiPatch_GetBoundarySpecification
      (map, 6, nboundaryzones, is_internal, is_staggered, shiftout);
    if (ierr != 0)
      CCTK_WARN(0, "Could not obtain boundary specification");
  } else if (CCTK_IsFunctionAliased ("GetBoundarySpecification")) {
    ierr = GetBoundarySpecification
      (6, nboundaryzones, is_internal, is_staggered, shiftout);
    if (ierr != 0)
      CCTK_WARN(0, "Could not obtain boundary specification");
  } else {
    CCTK_WARN(0, "Could not obtain boundary specification");
  }
}

/*********************************************************************
 * GetBoundaryWidth
 *********************************************************************/

int GetBoundaryWidth(cGH const * restrict const cctkGH)
{
  CCTK_INT nboundaryzones[6];
  GetBoundaryWidths(cctkGH, nboundaryzones);

  int bw = nboundaryzones[0];

  for (int i = 1; i < 6; i++)
    if (nboundaryzones[i] != bw)
    CCTK_WARN(0, "Number of boundary points is different on different faces");

  return bw;
}

/*********************************************************************
 * GetBoundaryInfo
 *********************************************************************/

/* Return the array indices in imin and imax for looping over the
   interior of the grid. imin is the index of the first grid point.
   imax is the index of the last grid point plus 1.  So a loop over
   the interior of the grid would be

   for (i = imin; i < imax; i++)

   The indexing is C-style. Also return whether the boundary is a
   symmetry, physical or interprocessor boundary.  Carpet refinement
   boundaries are treated as interprocessor boundaries.
*/
void GetBoundaryInfo(cGH const * restrict const cctkGH,
                               int const * restrict const cctk_ash,
                               int const * restrict const cctk_lsh,
                               int const * restrict const cctk_bbox,
			       int const * restrict const cctk_nghostzones,
                               int * restrict const imin, 
			       int * restrict const imax,
                               int * restrict const is_symbnd, 
			       int * restrict const is_physbnd,
                               int * restrict const is_ipbnd)
{
  CCTK_INT bbox[6];
  CCTK_INT nboundaryzones[6];
  CCTK_INT is_internal[6];
  CCTK_INT is_staggered[6];
  CCTK_INT shiftout[6];
  CCTK_INT symbnd[6];

  int symtable = 0;
  int dir = 0;
  int face = 0;
  int npoints = 0;
  int iret = 0;
  int ierr = 0;

  if (CCTK_IsFunctionAliased ("MultiPatch_GetBbox")) {
    ierr = MultiPatch_GetBbox (cctkGH, 6, bbox);
    if (ierr != 0)
      CCTK_WARN(0, "Could not obtain bbox specification");
  } else {
    for (dir = 0; dir < 6; dir++)
    {
      bbox[dir] = 0;
    }
  }

  if (CCTK_IsFunctionAliased ("MultiPatch_GetBoundarySpecification")) {
    int const map = MultiPatch_GetMap (cctkGH);
    if (map < 0)
      CCTK_WARN(0, "Could not obtain boundary specification");
    ierr = MultiPatch_GetBoundarySpecification
      (map, 6, nboundaryzones, is_internal, is_staggered, shiftout);
    if (ierr != 0)
      CCTK_WARN(0, "Could not obtain boundary specification");
  } else if (CCTK_IsFunctionAliased ("GetBoundarySpecification")) {
    ierr = GetBoundarySpecification
      (6, nboundaryzones, is_internal, is_staggered, shiftout);
    if (ierr != 0)
      CCTK_WARN(0, "Could not obtain boundary specification");
  } else {
    CCTK_WARN(0, "Could not obtain boundary specification");
  }

  symtable = SymmetryTableHandleForGrid(cctkGH);
  if (symtable < 0) 
  {
    CCTK_WARN(0, "Could not obtain symmetry table");
  }  
  
  iret = Util_TableGetIntArray(symtable, 6, symbnd, "symmetry_handle");
  if (iret != 6) CCTK_WARN (0, "Could not obtain symmetry information");

  for (dir = 0; dir < 6; dir++)
  {
    is_ipbnd[dir] = (!cctk_bbox[dir]);
    is_symbnd[dir] = (!is_ipbnd[dir] && symbnd[dir] >= 0 && !bbox[dir]);
    is_physbnd[dir] = (!is_ipbnd[dir] && !is_symbnd[dir]);
  }

  for (dir = 0; dir < 3; dir++)
  {
    for (face = 0; face < 2; face++)
    {
      int index = dir*2 + face;
      if (is_ipbnd[index])
      {
	/* Inter-processor boundary */
	npoints = cctk_nghostzones[dir];
      }
      else
      {
	/* Symmetry or physical boundary */
	npoints = nboundaryzones[index];
             
	if (is_symbnd[index])
	{
	  /* Ensure that the number of symmetry zones is the same
	     as the number of ghost zones */
	  if (npoints != cctk_nghostzones[dir])
	  {
	    CCTK_WARN (1, "The number of symmetry points is different from the number of ghost points; this is probably an error");
	  }
	}
      }

      switch(face)
      {
      case 0: /* Lower boundary */
	imin[dir] = npoints;
	break;
      case 1: /* Upper boundary */
	imax[dir] = cctk_lsh[dir] - npoints;
	break;
      default:
	CCTK_WARN(0, "internal error");
      }
    }
  }
}

/*********************************************************************
 * LoopOverEverything
 *********************************************************************/

void LoopOverEverything(cGH const * restrict const cctkGH, Kranc_Calculation const calc)
{
  DECLARE_CCTK_ARGUMENTS

  int   dir = 0;
  int   face = 0;
  CCTK_REAL  normal[] = {0,0,0};
  CCTK_REAL  tangentA[] = {0,0,0};
  CCTK_REAL  tangentB[] = {0,0,0};
  int   bmin[] = {0,0,0};
  int   bmax[] = {cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]};

  calc(cctkGH, dir, face, normal, tangentA, tangentB, bmin, bmax, 0, NULL);
  return;
}

/*********************************************************************
 * LoopOverBoundary
 *********************************************************************/

void LoopOverBoundary(cGH const * restrict const cctkGH, Kranc_Calculation const calc)
{
  DECLARE_CCTK_ARGUMENTS

  int   dir1, dir2, dir3;
  int   dir[3];
  CCTK_REAL  normal[3];
  CCTK_REAL  tangentA[3];
  CCTK_REAL  tangentB[3];
  int   bmin[3];
  int   bmax[3];
  int   have_bnd;
  int   all_physbnd;
  int   d;

  int   is_symbnd[6], is_physbnd[6], is_ipbnd[6];
  int   imin[3], imax[3];
  int        old_dir = 0;
  int        old_face = 0;

  GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
                  cctk_nghostzones, 
                  imin, imax, is_symbnd, is_physbnd, is_ipbnd);

 /* Loop over all faces */
  for (dir3 = -1; dir3 <= +1; dir3++)
  {
    for (dir2 = -1; dir2 <= +1; dir2++)
    {
      for (dir1 = -1; dir1 <= +1; dir1++)
      {
        dir[0] = dir1;
        dir[1] = dir2;
        dir[2] = dir3;

        have_bnd = 0;          /* one of the faces is a boundary */
        all_physbnd = 1;       /* all boundary faces are physical
                                  boundaries */

        for (d = 0; d < 3; d++)
        {
          switch(dir[d])
          {
          case -1:
            bmin[d] = 0;
            bmax[d] = imin[d];
            have_bnd = 1;
            all_physbnd = all_physbnd && is_physbnd[2*d+0];
            break;
          case 0:
            bmin[d] = imin[d];
            bmax[d] = imax[d];
            break;
          case +1:
            bmin[d] = imax[d];
            bmax[d] = cctk_lsh[d];
            have_bnd = 1;
            all_physbnd = all_physbnd && is_physbnd[2*d+1];
            break;
          }

          /* Choose a basis */
          normal[d] = dir[d];
          tangentA[d] = dir[(d+1)%3];
          tangentB[d] = dir[(d+2)%3];
        }

        if (have_bnd && all_physbnd)
        {
#if 0
          CCTK_REAL normal_norm = 0.0;
          for (d = 0; d < 3; d++)
          {
            normal_norm += pow(normal[d], 2);
          }
          normal_norm = sqrt(normal_norm);
          for (d = 0; d < 3; d++)
          {
            normal[d] /= normal_norm;
          }
#endif
          
          calc(cctkGH, old_dir, old_face, normal, tangentA, tangentB, bmin, bmax, 0, NULL);
        }

      }
    }
  }
  
  return;
}

/*********************************************************************
 * LoopOverBoundaryWithGhosts
 *********************************************************************/

void LoopOverBoundaryWithGhosts(cGH const * restrict const cctkGH, Kranc_Calculation const calc)
{
  DECLARE_CCTK_ARGUMENTS

  int   dir1, dir2, dir3;
  int   dir[3];
  CCTK_REAL  normal[3];
  CCTK_REAL  tangentA[3];
  CCTK_REAL  tangentB[3];
  int   bmin[3];
  int   bmax[3];
  int   have_bnd;
  int   have_physbnd;
  int   d;

  int   is_symbnd[6], is_physbnd[6], is_ipbnd[6];
  int   imin[3], imax[3];
  int        old_dir = 0;
  int        old_face = 0;

  GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
                  cctk_nghostzones, 
                  imin, imax, is_symbnd, is_physbnd, is_ipbnd);

 /* Loop over all faces */
  for (dir3 = -1; dir3 <= +1; dir3++)
  {
    for (dir2 = -1; dir2 <= +1; dir2++)
    {
      for (dir1 = -1; dir1 <= +1; dir1++)
      {
        dir[0] = dir1;
        dir[1] = dir2;
        dir[2] = dir3;

        have_bnd = 0;          /* one of the faces is a boundary */
        have_physbnd = 0;      /* one of the boundary faces is a physical
                                  boundary */

        for (d = 0; d < 3; d++)
        {
          switch(dir[d])
          {
          case -1:
            bmin[d] = 0;
            bmax[d] = imin[d];
            have_bnd = 1;
            have_physbnd = have_physbnd || is_physbnd[2*d+0];
            break;
          case 0:
            bmin[d] = imin[d];
            bmax[d] = imax[d];
            break;
          case +1:
            bmin[d] = imax[d];
            bmax[d] = cctk_lsh[d];
            have_bnd = 1;
            have_physbnd = have_physbnd || is_physbnd[2*d+1];
            break;
          }

          /* Choose a basis */
          normal[d] = dir[d];
          tangentA[d] = dir[(d+1)%3];
          tangentB[d] = dir[(d+2)%3];
        }

        if (have_bnd && have_physbnd)
        {
#if 0
          CCTK_REAL normal_norm = 0.0;
          for (d = 0; d < 3; d++)
          {
            normal_norm += pow(normal[d], 2);
          }
          normal_norm = sqrt(normal_norm);
          for (d = 0; d < 3; d++)
          {
            normal[d] /= normal_norm;
          }
#endif
          
          calc(cctkGH, old_dir, old_face, normal, tangentA, tangentB, bmin, bmax, 0, NULL);
        }

      }
    }
  }
  
  return;
}

/*********************************************************************
 * LoopOverInterior
 *********************************************************************/

void LoopOverInterior(cGH const * restrict const cctkGH, Kranc_Calculation const calc)
{
  DECLARE_CCTK_ARGUMENTS

  CCTK_REAL  normal[] = {0,0,0};
  CCTK_REAL  tangentA[] = {0,0,0};
  CCTK_REAL  tangentB[] = {0,0,0};

  int   is_symbnd[6], is_physbnd[6], is_ipbnd[6];
  int   imin[3], imax[3];
  int        dir = 0;
  int        face = 0;

  GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
                            cctk_nghostzones, 
                            imin, imax, is_symbnd, is_physbnd, is_ipbnd);

  calc(cctkGH, dir, face, normal, tangentA, tangentB, imin, imax, 0, NULL);
  
  return;
}

/*********************************************************************
 * AssertGroupStorage
 *********************************************************************/

void AssertGroupStorage(cGH const * restrict const cctkGH, const char *calc,
                                  int ngroups, const char *const group_names[])
{
  for (int i = 0; i < ngroups; i++)
  {
    int result = CCTK_QueryGroupStorage(cctkGH, group_names[i]);
    if (result == 0)
    {
      CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
                 "Error in %s: Group \"%s\" does not have storage", calc, group_names[i]);
    }
    else if (result < 0)
    {
      CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
                 "Error in %s: Invalid group name \"%s\"", calc, group_names[i]);
    }
  }
}

/*********************************************************************
 * GroupDataPointers
 *********************************************************************/

/* Return a list of pointers to the members of a named group */
void GroupDataPointers(cGH const * restrict const cctkGH, const char *group_name,
                                 int nvars, CCTK_REAL const *restrict *ptrs)
{
  int group_index, status;
  cGroup  group_info;

  group_index = CCTK_GroupIndex(group_name);
  if (group_index < 0)
    CCTK_VWarn(CCTK_WARN_ABORT,   __LINE__, __FILE__, CCTK_THORNSTRING,
               "Error return %d trying to get group index for group \'%s\'",
               group_index,
               group_name);

  status = CCTK_GroupData(group_index, &group_info);
  if (status < 0)
    CCTK_VWarn(CCTK_WARN_ABORT,   __LINE__, __FILE__, CCTK_THORNSTRING,
               "Error return %d trying to get info for group \'%s\'",
               status,
               group_name);

  if (group_info.numvars != nvars)
  {
    CCTK_VWarn(CCTK_WARN_ABORT,   __LINE__, __FILE__, CCTK_THORNSTRING,
               "Group \'%s\' has %d variables but %d were expected",
               group_name, group_info.numvars, nvars);
  }

  int v1 = CCTK_FirstVarIndex(group_name);

  for (int v = 0; v < nvars; v++)
  {
    ptrs[v] = (CCTK_REAL const *) CCTK_VarDataPtrI(cctkGH, 0 /* timelevel */, v1+v);
  }
}

/*********************************************************************
 * EnsureStencilFits
 *********************************************************************/

void EnsureStencilFits(cGH const * restrict const cctkGH, const char *calc, int ni, int nj, int nk)
{
  DECLARE_CCTK_ARGUMENTS

  CCTK_INT bws[6];
  GetBoundaryWidths(cctkGH, bws);

  int ns[] = {ni, nj, nk};
  const char *dirs[] = {"x", "y", "z"};
  const char *faces[] = {"lower", "upper"};
  int abort = 0;

  for (int dir = 0; dir < 3; dir++)
  {
    for (int face = 0; face < 2; face++)
    {
      int bw = bws[2*dir+face];
      if (bw < ns[dir])
      {
        CCTK_VInfo(CCTK_THORNSTRING,
                   "The stencil for %s requires %d points, but the %s %s boundary has only %d points.",
                   calc, ns[dir], faces[face], dirs[dir], bw);
        abort = 1;
      }
    }
    int gz = cctk_nghostzones[dir];
    if (gz < ns[dir])
    {
      CCTK_VInfo(CCTK_THORNSTRING,
                 "The stencil for %s requires %d points, but there are only %d ghost zones in the %s direction.",
                 calc, ns[dir], gz, dirs[dir]);
      abort = 1;
    }
  }

  if (abort)
  {
    CCTK_VWarn(CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
               "Insufficient ghost or boundary points for %s", calc);
  }
}

/*********************************************************************
 * idiv
 *********************************************************************/

// Divide, rounding to minus infinity
static int idiv(int x, int y)
{
  // round down manually if the result is negative
  return (x^y) >= 0 ? x/y : (x-y+1)/y;
}

/*********************************************************************
 * imod
 *********************************************************************/

// // Modulo, rounding to minus infinity
// static int imod(int x, int y)
// {
//   return (x^y) >= 0 ? x%y : (x-y+1)%y + y-1;
// }

/*********************************************************************
 * ialign
 *********************************************************************/

// Align x to a multiple of y
static int ialign(int x, int y)
{
  return idiv(x, y) * y;
}

/*********************************************************************
 * TiledLoop
 *********************************************************************/

void TiledLoop(
  cGH const * restrict const cctkGH,
  const KrancData & restrict kd_coarse,
  void (calc)(const cGH* restrict const cctkGH,
              const KrancData & restrict kd))
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;

  // Interior region
  int imin[3], imax[3];
  // Boundary types
  int is_symbnd[6], is_physbnd[6], is_ipbnd[6];

  GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
                            cctk_nghostzones, 
                            imin, imax, is_symbnd, is_physbnd, is_ipbnd);

  // Tile size
  int tile_size_l[3];
  // Loop bounds covered by tiles (may be larger)
  int tiled_imin[3];
  int tiled_imax[3];

  if (tile_size == -1)
  {
    for (int d = 0; d < 3; d++)
    {
      // Loop in a single tile
      tiled_imin[d] = kd_coarse.imin[d];
      tiled_imax[d] = kd_coarse.imax[d];
      tile_size_l[d] = tiled_imax[d] - tiled_imin[d];
    }
  }
  else
  {
    for (int d = 0; d < 3; d++)
    {
      tile_size_l[d] = tile_size;
      // Align with beginning of interior of domain
      tiled_imin[d] =
        imin[d] + ialign(kd_coarse.imin[d] - imin[d], tile_size_l[d]);
      tiled_imax[d] = kd_coarse.imax[d];
    }
  }

  const int dti = tile_size_l[0];
  const int dtj = tile_size_l[1];
  const int dtk = tile_size_l[2];
#pragma omp parallel for collapse(3)
  for (int tk = tiled_imin[2]; tk < tiled_imax[2]; tk += dtk)
  {
    for (int tj = tiled_imin[1]; tj < tiled_imax[1]; tj += dtj)
    {
      for (int ti = tiled_imin[0]; ti < tiled_imax[0]; ti += dti)
      {
        KrancData kd = kd_coarse;

        kd.dir = 0;
        kd.face = 0;
        // TODO: initialise the rest, or use a constructor

        kd.tile_imin[0] = ti;
        kd.tile_imax[0] = ti + dti;
        kd.tile_imin[1] = tj;
        kd.tile_imax[1] = tj + dtj;
        kd.tile_imin[2] = tk;
        kd.tile_imax[2] = tk + dtk;

        calc(cctkGH, kd);
      }
    }
  }
}

/*********************************************************************
 * TiledLoopOverEverything
 *********************************************************************/

void TiledLoopOverEverything(
  cGH const * restrict const cctkGH,
  void (calc)(const cGH* restrict const cctkGH,
              const KrancData & restrict kd))
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;

  KrancData kd_coarse;

  for (int d = 0; d < 3; d++)
  {
    kd_coarse.imin[d] = 0;
    kd_coarse.imax[d] = cctk_lsh[d];
  }

  TiledLoop(cctkGH, kd_coarse, calc);
}

/*********************************************************************
 * TiledLoopOverInterior
 *********************************************************************/

void TiledLoopOverInterior(
  cGH const * restrict const cctkGH,
  void (calc)(const cGH* restrict const cctkGH,
              const KrancData & restrict kd))
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;

  // Interior region
  int imin[3], imax[3];
  // Boundary types
  int is_symbnd[6], is_physbnd[6], is_ipbnd[6];

  GetBoundaryInfo(cctkGH, cctk_ash, cctk_lsh, cctk_bbox,
                            cctk_nghostzones, 
                            imin, imax, is_symbnd, is_physbnd, is_ipbnd);

  KrancData kd_coarse;

  for (int d = 0; d < 3; d++)
  {
    kd_coarse.imin[d] = imin[d];
    kd_coarse.imax[d] = imax[d];
  }

  TiledLoop(cctkGH, kd_coarse, calc);
}

} // namespace WeylScal4
```

WeylScal4_invars_calc_2nd.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {


static void WeylScal4_invars_calc_2nd_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_invars_calc_2nd,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC Psi0iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi0i[index]);
    CCTK_REAL_VEC Psi0rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi0r[index]);
    CCTK_REAL_VEC Psi1iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi1i[index]);
    CCTK_REAL_VEC Psi1rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi1r[index]);
    CCTK_REAL_VEC Psi2iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi2i[index]);
    CCTK_REAL_VEC Psi2rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi2r[index]);
    CCTK_REAL_VEC Psi3iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi3i[index]);
    CCTK_REAL_VEC Psi3rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi3r[index]);
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi4i[index]);
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi4r[index]);
    
    
    /* Include user supplied include files */
    /* Precompute derivatives */
    
    switch (fdOrder)
    {
      case 2:
      {
        break;
      }
      
      case 4:
      {
        break;
      }
      
      case 6:
      {
        break;
      }
      
      case 8:
      {
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC curvIrL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmadd(ToReal(-3),kmul(Psi2iL,Psi2iL),kmul(kmul(Psi2rL,Psi2rL),ToReal(3)))))));
    
    CCTK_REAL_VEC curvIiL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(6),kmul(Psi2iL,Psi2rL),kmadd(ToReal(-4),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))));
    
    CCTK_REAL_VEC curvJrL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(Psi0iL,kmul(Psi3iL,Psi3rL)),kmadd(ToReal(2),kmul(Psi1iL,kmul(Psi1rL,Psi4iL)),knmsub(Psi2iL,kmadd(ToReal(2),kmul(Psi1rL,Psi3iL),kmadd(ToReal(2),kmul(Psi1iL,Psi3rL),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL)))),kmadd(Psi4rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmadd(Psi2rL,kmadd(ToReal(-2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(2),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(kmul(Psi2iL,Psi2iL),ToReal(3)))))),kmsub(Psi0rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmul(Psi2rL,kmul(Psi2rL,Psi2rL))))))));
    
    CCTK_REAL_VEC curvJiL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(Psi2rL,kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL))),kmadd(Psi0rL,kmadd(ToReal(-2),kmul(Psi3iL,Psi3rL),kmul(Psi2rL,Psi4iL)),kmadd(ToReal(-2),kmul(Psi1iL,kmul(Psi1rL,Psi4rL)),kmadd(Psi4iL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmadd(Psi2iL,kmul(Psi2iL,Psi2iL),kmadd(Psi2iL,kmadd(ToReal(-2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(2),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(kmul(Psi2rL,Psi2rL),ToReal(-3)))))),kmul(Psi0iL,kmadd(Psi2rL,Psi4rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL))))))))));
    
    CCTK_REAL_VEC curvJ1L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(-4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(4),kmul(Psi1rL,Psi3rL),kmadd(Psi0iL,Psi4iL,knmsub(Psi0rL,Psi4rL,kmadd(ToReal(3),kmul(Psi2iL,Psi2iL),kmul(ToReal(-3),kmul(Psi2rL,Psi2rL))))))),ToReal(-16));
    
    CCTK_REAL_VEC curvJ2L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(-2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(Psi2iL,kmadd(ToReal(2),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))),kmadd(Psi4rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)),kmadd(Psi2rL,kmadd(ToReal(2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-2),kmul(Psi1rL,Psi3rL),kmadd(Psi0iL,Psi4iL,kmsub(ToReal(-3),kmul(Psi2iL,Psi2iL),kmul(Psi0rL,Psi4rL))))),kmadd(Psi2rL,kmul(Psi2rL,Psi2rL),kmul(Psi0rL,kmsub(Psi3rL,Psi3rL,kmul(Psi3iL,Psi3iL)))))))),ToReal(96));
    
    CCTK_REAL_VEC curvJ3L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmadd(kmadd(ToReal(8),kmul(Psi0iL,Psi1iL),kmul(ToReal(-8),kmul(Psi0rL,Psi1rL))),Psi3rL,kmul(ToReal(-4),kmul(Psi0iL,kmul(Psi0rL,Psi4iL)))),Psi4rL,kmadd(ToReal(12),kmul(Psi2iL,kmul(Psi2rL,kmsub(ToReal(4),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0iL,Psi4rL,kmul(Psi0rL,Psi4iL))))),kmadd(Psi1iL,kmul(Psi3iL,kmadd(ToReal(-64),kmul(Psi1rL,Psi3rL),kmadd(ToReal(-8),kmul(Psi0iL,Psi4iL),kmul(ToReal(8),kmul(Psi0rL,Psi4rL))))),kmadd(ToReal(8),kmadd(Psi0rL,kmul(kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),Psi4iL),kmul(Psi0iL,kmul(Psi1rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL))))),kmadd(ToReal(6),kmul(kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),kmsub(Psi0rL,Psi4rL,kmul(Psi0iL,Psi4iL)))),kmul(Psi2rL,Psi2rL)),kmadd(ToReal(-6),kmul(kmul(Psi2iL,Psi2iL),kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(ToReal(9),kmul(Psi2rL,Psi2rL))))))),kmadd(ToReal(9),kmadd(kmul(Psi2iL,Psi2iL),kmul(Psi2iL,Psi2iL),kmul(kmul(Psi2rL,Psi2rL),kmul(Psi2rL,Psi2rL))),kmadd(kmadd(ToReal(16),kmul(Psi1iL,Psi1iL),kmul(ToReal(-16),kmul(Psi1rL,Psi1rL))),kmul(Psi3iL,Psi3iL),kmadd(kmadd(ToReal(-16),kmul(Psi1iL,Psi1iL),kmul(ToReal(16),kmul(Psi1rL,Psi1rL))),kmul(Psi3rL,Psi3rL),kmadd(kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(Psi4iL,Psi4iL),kmul(kmsub(Psi0rL,Psi0rL,kmul(Psi0iL,Psi0iL)),kmul(Psi4rL,Psi4rL)))))))))))),ToReal(64));
    
    CCTK_REAL_VEC curvJ4L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(Psi3iL,kmadd(Psi4iL,kmadd(ToReal(-2),kmul(Psi3rL,kmul(Psi0iL,Psi0iL)),kmul(ToReal(12),kmul(Psi1rL,kmul(Psi1iL,Psi1iL)))),kmul(ToReal(4),kmul(Psi4rL,kmul(Psi1iL,kmul(Psi1iL,Psi1iL))))),kmadd(ToReal(-2),kmul(kmadd(ToReal(5),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-5),kmul(Psi1rL,Psi3rL),kmsub(Psi0iL,Psi4iL,kmul(Psi0rL,Psi4rL)))),kmul(Psi2rL,kmul(Psi2rL,Psi2rL))),kmadd(ToReal(-3),kmul(Psi2rL,kmul(kmul(Psi2rL,Psi2rL),kmul(Psi2rL,Psi2rL))),kmadd(kmadd(kmadd(ToReal(12),kmul(Psi0iL,Psi1iL),kmul(ToReal(-12),kmul(Psi0rL,Psi1rL))),Psi3rL,kmsub(ToReal(-2),kmul(Psi0iL,kmul(Psi0rL,Psi4iL)),kmul(Psi4rL,kmul(Psi0iL,Psi0iL)))),kmul(Psi3iL,Psi3iL),kmadd(Psi4rL,kmadd(Psi4iL,kmadd(ToReal(4),kmul(Psi0rL,kmul(Psi1iL,Psi1rL)),kmul(ToReal(-2),kmul(Psi0iL,kmul(Psi1iL,Psi1iL)))),kmadd(Psi3rL,kmadd(ToReal(4),kmul(Psi0iL,kmul(Psi0rL,Psi3iL)),kmul(ToReal(-12),kmul(Psi1rL,kmul(Psi1iL,Psi1iL)))),kmadd(kmul(Psi0rL,Psi0rL),kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmul(kmul(Psi0iL,Psi0iL),kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(-12),kmadd(Psi1iL,kmul(Psi3rL,kmul(Psi4iL,kmul(Psi1rL,Psi1rL))),kmul(Psi3iL,kmadd(Psi1iL,kmul(Psi4rL,kmul(Psi1rL,Psi1rL)),kmul(kmadd(Psi0rL,Psi1iL,kmul(Psi0iL,Psi1rL)),kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(3),kmadd(kmul(Psi2rL,Psi2rL),kmadd(ToReal(2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(Psi4rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmul(Psi0rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL))))),kmul(kmul(Psi2iL,Psi2iL),kmadd(ToReal(-2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(ToReal(2),kmul(Psi2rL,kmadd(ToReal(5),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-5),kmul(Psi1rL,Psi3rL),kmsub(Psi0iL,Psi4iL,kmul(Psi0rL,Psi4rL))))),kmadd(Psi4rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)),kmadd(ToReal(10),kmul(Psi2rL,kmul(Psi2rL,Psi2rL)),kmul(Psi0rL,kmsub(Psi3rL,Psi3rL,kmul(Psi3iL,Psi3iL))))))))),kmadd(ToReal(-4),kmadd(Psi3iL,kmul(Psi4iL,kmul(Psi1rL,kmul(Psi1rL,Psi1rL))),kmul(Psi0iL,kmul(Psi1iL,kmul(Psi3rL,kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(4),kmadd(Psi3rL,kmadd(Psi4iL,kmul(Psi1iL,kmul(Psi1iL,Psi1iL)),kmul(Psi4rL,kmul(Psi1rL,kmul(Psi1rL,Psi1rL)))),kmadd(kmadd(Psi0rL,Psi1iL,kmul(Psi0iL,Psi1rL)),kmul(Psi3iL,kmul(Psi3iL,Psi3iL)),kmul(Psi0rL,kmul(Psi1rL,kmul(Psi3rL,kmul(Psi3rL,Psi3rL)))))),kmadd(kmadd(ToReal(-2),kmul(Psi0iL,kmul(Psi1iL,Psi1rL)),kmul(Psi0rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)))),kmul(Psi4iL,Psi4iL),kmadd(kmadd(ToReal(2),kmul(Psi0iL,kmul(Psi1iL,Psi1rL)),kmul(Psi0rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)))),kmul(Psi4rL,Psi4rL),kmadd(Psi2rL,kmadd(ToReal(-4),kmul(Psi0iL,kmul(Psi0rL,kmul(Psi4iL,Psi4rL))),kmadd(ToReal(2),kmadd(Psi1rL,kmadd(kmadd(Psi0rL,Psi3iL,kmul(Psi0iL,Psi3rL)),Psi4iL,kmul(kmsub(Psi0iL,Psi3iL,kmul(Psi0rL,Psi3rL)),Psi4rL)),kmul(Psi1iL,kmadd(Psi3iL,kmsub(ToReal(16),kmul(Psi1rL,Psi3rL),kmul(Psi0iL,Psi4iL)),kmadd(Psi0iL,kmul(Psi3rL,Psi4rL),kmul(Psi0rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL))))))),kmadd(ToReal(-15),kmul(kmul(Psi2iL,Psi2iL),kmul(Psi2iL,Psi2iL)),kmadd(kmadd(ToReal(-8),kmul(Psi1iL,Psi1iL),kmul(ToReal(8),kmul(Psi1rL,Psi1rL))),kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmadd(kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(Psi4iL,Psi4iL),kmul(kmsub(Psi0rL,Psi0rL,kmul(Psi0iL,Psi0iL)),kmul(Psi4rL,Psi4rL))))))),kmul(ToReal(2),kmadd(kmadd(ToReal(5),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))),kmul(Psi2iL,kmul(Psi2iL,Psi2iL)),kmadd(Psi4iL,kmadd(Psi3iL,kmul(Psi3rL,kmul(Psi0rL,Psi0rL)),kmul(Psi0iL,kmadd(Psi4rL,kmul(Psi1rL,Psi1rL),kmul(Psi0rL,kmul(Psi3rL,Psi3rL))))),kmul(Psi2iL,kmadd(kmadd(ToReal(8),kmul(Psi3iL,Psi3rL),kmul(ToReal(3),kmul(Psi2rL,Psi4iL))),kmul(Psi1rL,Psi1rL),kmadd(Psi3rL,kmadd(Psi3iL,kmadd(ToReal(6),kmul(Psi0rL,Psi2rL),kmul(ToReal(-8),kmul(Psi1iL,Psi1iL))),kmul(Psi1iL,kmadd(Psi0rL,Psi4rL,kmul(ToReal(-15),kmul(Psi2rL,Psi2rL))))),kmadd(Psi4iL,knmsub(Psi0rL,kmul(Psi1iL,Psi3iL),kmadd(Psi4rL,kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(ToReal(-3),kmadd(Psi2rL,kmul(Psi1iL,Psi1iL),kmul(Psi0rL,kmul(Psi2rL,Psi2rL)))))),kmsub(Psi1rL,kmadd(Psi0iL,kmul(Psi3rL,Psi4rL),kmadd(Psi0rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL)),kmadd(Psi3iL,kmsub(ToReal(-15),kmul(Psi2rL,Psi2rL),kmul(Psi0iL,Psi4iL)),kmul(Psi1iL,kmadd(ToReal(6),kmul(Psi2rL,Psi4rL),kmadd(ToReal(-8),kmul(Psi3iL,Psi3iL),kmul(ToReal(8),kmul(Psi3rL,Psi3rL)))))))),kmul(Psi0iL,kmadd(Psi1iL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL)),kmadd(ToReal(3),kmul(Psi4rL,kmul(Psi2rL,Psi2rL)),kmadd(Psi2rL,kmadd(ToReal(3),kmul(Psi3iL,Psi3iL),kmul(ToReal(-3),kmul(Psi3rL,Psi3rL))),kmul(Psi0rL,kmsub(Psi4rL,Psi4rL,kmul(Psi4iL,Psi4iL))))))))))))))))))))))))))),ToReal(-640));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(curvIi[index],curvIiL);
    vec_store_nta_partial(curvIr[index],curvIrL);
    vec_store_nta_partial(curvJ1[index],curvJ1L);
    vec_store_nta_partial(curvJ2[index],curvJ2L);
    vec_store_nta_partial(curvJ3[index],curvJ3L);
    vec_store_nta_partial(curvJ4[index],curvJ4L);
    vec_store_nta_partial(curvJi[index],curvJiL);
    vec_store_nta_partial(curvJr[index],curvJrL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_invars_calc_2nd);
}
extern "C" void WeylScal4_invars_calc_2nd(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_invars_calc_2nd_Body");
  }
  if (cctk_iteration % WeylScal4_invars_calc_2nd_calc_every != WeylScal4_invars_calc_2nd_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "WeylScal4::curvIi_group",
    "WeylScal4::curvIr_group",
    "WeylScal4::curvJ1_group",
    "WeylScal4::curvJ2_group",
    "WeylScal4::curvJ3_group",
    "WeylScal4::curvJ4_group",
    "WeylScal4::curvJi_group",
    "WeylScal4::curvJr_group",
    "WeylScal4::Psi0i_group",
    "WeylScal4::Psi0r_group",
    "WeylScal4::Psi1i_group",
    "WeylScal4::Psi1r_group",
    "WeylScal4::Psi2i_group",
    "WeylScal4::Psi2r_group",
    "WeylScal4::Psi3i_group",
    "WeylScal4::Psi3r_group",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_invars_calc_2nd", 18, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      break;
    }
    
    case 4:
    {
      break;
    }
    
    case 6:
    {
      break;
    }
    
    case 8:
    {
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverEverything(cctkGH, WeylScal4_invars_calc_2nd_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_invars_calc_2nd_Body");
  }
}

} // namespace WeylScal4

```

Kranc.hh:
```
#ifndef KRANC_HH
#define KRANC_HH

#include <cmath>
#include <math.h>
#include <sys/time.h>

#include <cctk.h>

namespace WeylScal4 {

/*********************************************************************
 * Types
 *********************************************************************/

struct KrancData
{
  // Actual loop bounds
  int imin[3];
  int imax[3];
  // Region covered by this tile
  int tile_imin[3];
  int tile_imax[3];
  // Boundary information
  int dir;
  int face;
  CCTK_REAL normal[3];
  CCTK_REAL tangentA[3];
  CCTK_REAL tangentB[3];
};

typedef void(*Kranc_Calculation)(cGH const * restrict cctkGH,
                                 int eir,
                                 int face,
                                 CCTK_REAL const normal[3],
                                 CCTK_REAL const tangentA[3],
                                 CCTK_REAL const tangentB[3],
                                 int const min[3],
                                 int const max[3], 
                                 int n_subblock_gfs, 
                                 CCTK_REAL * restrict const subblock_gfs[]);

/*********************************************************************
 * Function declarations
 *********************************************************************/

// Boundary information

int GetBoundaryWidth(cGH const * restrict const cctkGH);

void GetBoundaryInfo(cGH const * restrict cctkGH,
                                  int const * restrict cctk_ash,
                                  int const * restrict cctk_lsh,
                                  int const * restrict cctk_bbox,
                                  int const * restrict cctk_nghostzones,
                                  int * restrict imin, 
                                  int * restrict imax,
                                  int * restrict is_symbnd, 
                                  int * restrict is_physbnd,
                                  int * restrict is_ipbnd);

// Looping

void LoopOverEverything(cGH const * restrict cctkGH,
                                     Kranc_Calculation calc);
void LoopOverBoundary(cGH const * restrict cctkGH,
                                   Kranc_Calculation calc);
void LoopOverBoundaryWithGhosts(cGH const * restrict cctkGH,
                                             Kranc_Calculation calc);
void LoopOverInterior(cGH const * restrict cctkGH,
                                   Kranc_Calculation calc);

// Tiled looping

void TiledLoop(
  cGH const * restrict const cctkGH,
  const KrancData & restrict kd_coarse,
  void (calc)(const cGH* restrict const cctkGH,
              const KrancData & restrict kd));

void TiledLoopOverEverything(
  cGH const * restrict const cctkGH,
  void (calc)(const cGH* restrict const cctkGH,
              const KrancData & restrict kd));

void TiledLoopOverInterior(
  cGH const * restrict const cctkGH,
  void (calc)(const cGH* restrict const cctkGH,
              const KrancData & restrict kd));

// void TiledLoopOverBoundary(
//   cGH const * restrict const cctkGH,
//   void (calc)(const cGH* restrict const cctkGH,
//               const KrancData & restrict kd));

// Runtime checks

void EnsureStencilFits(cGH const * restrict const cctkGH,
                                    const char *calc, int ni, int nj, int nk);
void GroupDataPointers(cGH const * restrict const cctkGH,
                                    const char *group_name, int nvars,
                                    CCTK_REAL const *restrict *ptrs);
void AssertGroupStorage(cGH const * restrict const cctkGH,
                                     const char *calc, int ngroups,
                                     const char *const group_names[]);


/*********************************************************************
 * Gridfunction access macros
 *********************************************************************/

  /* Grid function access */
  /* var is a pointer to a grid point, i,j,k are offsets with respect
     to that point.
     For example: KRANC_GFINDEX3D_OFFSET(&u[ind3d],-1,-1,0) */
  /* simple implementation */
  /* #define KRANC_GFOFFSET3D(var,i,j,k) ((var)[di*(i)+dj*(j)+dk*(k)]) */
  /* more efficient implementation for some compilers */
#define KRANC_GFOFFSET3D(var,i,j,k)                                     \
  (*(CCTK_REAL const*)&((char const*)(var))[cdi*(i)+cdj*(j)+cdk*(k)])

#define GFOffset(u,di,dj,dk) KRANC_GFOFFSET3D(&(u)[index],di,dj,dk)

/*********************************************************************
 * Macros used in Kranc expressions
 *********************************************************************/

#define IfThen(x,y,z) ((x) ? (y) : (z))
#define MinMod(x, y)  ((x) * (y) < 0 ? 0 : (fabs((x)) < fabs((y)) ? (x) : (y)))
#define VanLeer(x, y)  ((x) * (y) < 0 ? 0 : (Min3(2*fabs(x),2*fabs(y),0.5*(fabs(x)+fabs(y)))*Sign((x)+(y))))
#define StepFunction(x) ((x)>0)

/*********************************************************************
 * Numerical constants not defined in C++
 *********************************************************************/

#define E           M_E
#define Pi          M_PI

/*********************************************************************
 * Declare functions on the device if compiled for CUDA
 *********************************************************************/

#ifdef __CUDACC__
#define KRANC_WHERE __device__
#else
#define KRANC_WHERE
#endif

/*********************************************************************
 * Implement the signum function, used for Mathematica's Sign function
 *********************************************************************/

KRANC_WHERE static inline CCTK_REAL sgn(CCTK_REAL x)
{
#ifdef __cplusplus
  using namespace std;
#endif
  return x==(CCTK_REAL)0.0 ? (CCTK_REAL)0.0 : copysign((CCTK_REAL)1.0, x);
}

KRANC_WHERE static inline int isgn(CCTK_REAL x)
{
  if (x == (CCTK_REAL)0.0) return 0;
#ifdef __cplusplus
  using namespace std;
  int s = signbit(x);
#else
  int s = signbit(x);
#endif
  return s ? -1 : +1;
}

} // namespace WeylScal4

#endif  // #ifndef KRANC_HH
```

WeylScal4_invars_calc_4th.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {


static void WeylScal4_invars_calc_4th_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_invars_calc_4th,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC Psi0iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi0i[index]);
    CCTK_REAL_VEC Psi0rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi0r[index]);
    CCTK_REAL_VEC Psi1iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi1i[index]);
    CCTK_REAL_VEC Psi1rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi1r[index]);
    CCTK_REAL_VEC Psi2iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi2i[index]);
    CCTK_REAL_VEC Psi2rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi2r[index]);
    CCTK_REAL_VEC Psi3iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi3i[index]);
    CCTK_REAL_VEC Psi3rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi3r[index]);
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi4i[index]);
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi4r[index]);
    
    
    /* Include user supplied include files */
    /* Precompute derivatives */
    
    switch (fdOrder)
    {
      case 2:
      {
        break;
      }
      
      case 4:
      {
        break;
      }
      
      case 6:
      {
        break;
      }
      
      case 8:
      {
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC curvIrL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmadd(ToReal(-3),kmul(Psi2iL,Psi2iL),kmul(kmul(Psi2rL,Psi2rL),ToReal(3)))))));
    
    CCTK_REAL_VEC curvIiL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(6),kmul(Psi2iL,Psi2rL),kmadd(ToReal(-4),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))));
    
    CCTK_REAL_VEC curvJrL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(Psi0iL,kmul(Psi3iL,Psi3rL)),kmadd(ToReal(2),kmul(Psi1iL,kmul(Psi1rL,Psi4iL)),knmsub(Psi2iL,kmadd(ToReal(2),kmul(Psi1rL,Psi3iL),kmadd(ToReal(2),kmul(Psi1iL,Psi3rL),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL)))),kmadd(Psi4rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmadd(Psi2rL,kmadd(ToReal(-2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(2),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(kmul(Psi2iL,Psi2iL),ToReal(3)))))),kmsub(Psi0rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmul(Psi2rL,kmul(Psi2rL,Psi2rL))))))));
    
    CCTK_REAL_VEC curvJiL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(Psi2rL,kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL))),kmadd(Psi0rL,kmadd(ToReal(-2),kmul(Psi3iL,Psi3rL),kmul(Psi2rL,Psi4iL)),kmadd(ToReal(-2),kmul(Psi1iL,kmul(Psi1rL,Psi4rL)),kmadd(Psi4iL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmadd(Psi2iL,kmul(Psi2iL,Psi2iL),kmadd(Psi2iL,kmadd(ToReal(-2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(2),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(kmul(Psi2rL,Psi2rL),ToReal(-3)))))),kmul(Psi0iL,kmadd(Psi2rL,Psi4rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL))))))))));
    
    CCTK_REAL_VEC curvJ1L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(-4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(4),kmul(Psi1rL,Psi3rL),kmadd(Psi0iL,Psi4iL,knmsub(Psi0rL,Psi4rL,kmadd(ToReal(3),kmul(Psi2iL,Psi2iL),kmul(ToReal(-3),kmul(Psi2rL,Psi2rL))))))),ToReal(-16));
    
    CCTK_REAL_VEC curvJ2L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(-2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(Psi2iL,kmadd(ToReal(2),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))),kmadd(Psi4rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)),kmadd(Psi2rL,kmadd(ToReal(2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-2),kmul(Psi1rL,Psi3rL),kmadd(Psi0iL,Psi4iL,kmsub(ToReal(-3),kmul(Psi2iL,Psi2iL),kmul(Psi0rL,Psi4rL))))),kmadd(Psi2rL,kmul(Psi2rL,Psi2rL),kmul(Psi0rL,kmsub(Psi3rL,Psi3rL,kmul(Psi3iL,Psi3iL)))))))),ToReal(96));
    
    CCTK_REAL_VEC curvJ3L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmadd(kmadd(ToReal(8),kmul(Psi0iL,Psi1iL),kmul(ToReal(-8),kmul(Psi0rL,Psi1rL))),Psi3rL,kmul(ToReal(-4),kmul(Psi0iL,kmul(Psi0rL,Psi4iL)))),Psi4rL,kmadd(ToReal(12),kmul(Psi2iL,kmul(Psi2rL,kmsub(ToReal(4),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0iL,Psi4rL,kmul(Psi0rL,Psi4iL))))),kmadd(Psi1iL,kmul(Psi3iL,kmadd(ToReal(-64),kmul(Psi1rL,Psi3rL),kmadd(ToReal(-8),kmul(Psi0iL,Psi4iL),kmul(ToReal(8),kmul(Psi0rL,Psi4rL))))),kmadd(ToReal(8),kmadd(Psi0rL,kmul(kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),Psi4iL),kmul(Psi0iL,kmul(Psi1rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL))))),kmadd(ToReal(6),kmul(kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),kmsub(Psi0rL,Psi4rL,kmul(Psi0iL,Psi4iL)))),kmul(Psi2rL,Psi2rL)),kmadd(ToReal(-6),kmul(kmul(Psi2iL,Psi2iL),kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(ToReal(9),kmul(Psi2rL,Psi2rL))))))),kmadd(ToReal(9),kmadd(kmul(Psi2iL,Psi2iL),kmul(Psi2iL,Psi2iL),kmul(kmul(Psi2rL,Psi2rL),kmul(Psi2rL,Psi2rL))),kmadd(kmadd(ToReal(16),kmul(Psi1iL,Psi1iL),kmul(ToReal(-16),kmul(Psi1rL,Psi1rL))),kmul(Psi3iL,Psi3iL),kmadd(kmadd(ToReal(-16),kmul(Psi1iL,Psi1iL),kmul(ToReal(16),kmul(Psi1rL,Psi1rL))),kmul(Psi3rL,Psi3rL),kmadd(kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(Psi4iL,Psi4iL),kmul(kmsub(Psi0rL,Psi0rL,kmul(Psi0iL,Psi0iL)),kmul(Psi4rL,Psi4rL)))))))))))),ToReal(64));
    
    CCTK_REAL_VEC curvJ4L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(Psi3iL,kmadd(Psi4iL,kmadd(ToReal(-2),kmul(Psi3rL,kmul(Psi0iL,Psi0iL)),kmul(ToReal(12),kmul(Psi1rL,kmul(Psi1iL,Psi1iL)))),kmul(ToReal(4),kmul(Psi4rL,kmul(Psi1iL,kmul(Psi1iL,Psi1iL))))),kmadd(ToReal(-2),kmul(kmadd(ToReal(5),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-5),kmul(Psi1rL,Psi3rL),kmsub(Psi0iL,Psi4iL,kmul(Psi0rL,Psi4rL)))),kmul(Psi2rL,kmul(Psi2rL,Psi2rL))),kmadd(ToReal(-3),kmul(Psi2rL,kmul(kmul(Psi2rL,Psi2rL),kmul(Psi2rL,Psi2rL))),kmadd(kmadd(kmadd(ToReal(12),kmul(Psi0iL,Psi1iL),kmul(ToReal(-12),kmul(Psi0rL,Psi1rL))),Psi3rL,kmsub(ToReal(-2),kmul(Psi0iL,kmul(Psi0rL,Psi4iL)),kmul(Psi4rL,kmul(Psi0iL,Psi0iL)))),kmul(Psi3iL,Psi3iL),kmadd(Psi4rL,kmadd(Psi4iL,kmadd(ToReal(4),kmul(Psi0rL,kmul(Psi1iL,Psi1rL)),kmul(ToReal(-2),kmul(Psi0iL,kmul(Psi1iL,Psi1iL)))),kmadd(Psi3rL,kmadd(ToReal(4),kmul(Psi0iL,kmul(Psi0rL,Psi3iL)),kmul(ToReal(-12),kmul(Psi1rL,kmul(Psi1iL,Psi1iL)))),kmadd(kmul(Psi0rL,Psi0rL),kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmul(kmul(Psi0iL,Psi0iL),kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(-12),kmadd(Psi1iL,kmul(Psi3rL,kmul(Psi4iL,kmul(Psi1rL,Psi1rL))),kmul(Psi3iL,kmadd(Psi1iL,kmul(Psi4rL,kmul(Psi1rL,Psi1rL)),kmul(kmadd(Psi0rL,Psi1iL,kmul(Psi0iL,Psi1rL)),kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(3),kmadd(kmul(Psi2rL,Psi2rL),kmadd(ToReal(2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(Psi4rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmul(Psi0rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL))))),kmul(kmul(Psi2iL,Psi2iL),kmadd(ToReal(-2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(ToReal(2),kmul(Psi2rL,kmadd(ToReal(5),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-5),kmul(Psi1rL,Psi3rL),kmsub(Psi0iL,Psi4iL,kmul(Psi0rL,Psi4rL))))),kmadd(Psi4rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)),kmadd(ToReal(10),kmul(Psi2rL,kmul(Psi2rL,Psi2rL)),kmul(Psi0rL,kmsub(Psi3rL,Psi3rL,kmul(Psi3iL,Psi3iL))))))))),kmadd(ToReal(-4),kmadd(Psi3iL,kmul(Psi4iL,kmul(Psi1rL,kmul(Psi1rL,Psi1rL))),kmul(Psi0iL,kmul(Psi1iL,kmul(Psi3rL,kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(4),kmadd(Psi3rL,kmadd(Psi4iL,kmul(Psi1iL,kmul(Psi1iL,Psi1iL)),kmul(Psi4rL,kmul(Psi1rL,kmul(Psi1rL,Psi1rL)))),kmadd(kmadd(Psi0rL,Psi1iL,kmul(Psi0iL,Psi1rL)),kmul(Psi3iL,kmul(Psi3iL,Psi3iL)),kmul(Psi0rL,kmul(Psi1rL,kmul(Psi3rL,kmul(Psi3rL,Psi3rL)))))),kmadd(kmadd(ToReal(-2),kmul(Psi0iL,kmul(Psi1iL,Psi1rL)),kmul(Psi0rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)))),kmul(Psi4iL,Psi4iL),kmadd(kmadd(ToReal(2),kmul(Psi0iL,kmul(Psi1iL,Psi1rL)),kmul(Psi0rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)))),kmul(Psi4rL,Psi4rL),kmadd(Psi2rL,kmadd(ToReal(-4),kmul(Psi0iL,kmul(Psi0rL,kmul(Psi4iL,Psi4rL))),kmadd(ToReal(2),kmadd(Psi1rL,kmadd(kmadd(Psi0rL,Psi3iL,kmul(Psi0iL,Psi3rL)),Psi4iL,kmul(kmsub(Psi0iL,Psi3iL,kmul(Psi0rL,Psi3rL)),Psi4rL)),kmul(Psi1iL,kmadd(Psi3iL,kmsub(ToReal(16),kmul(Psi1rL,Psi3rL),kmul(Psi0iL,Psi4iL)),kmadd(Psi0iL,kmul(Psi3rL,Psi4rL),kmul(Psi0rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL))))))),kmadd(ToReal(-15),kmul(kmul(Psi2iL,Psi2iL),kmul(Psi2iL,Psi2iL)),kmadd(kmadd(ToReal(-8),kmul(Psi1iL,Psi1iL),kmul(ToReal(8),kmul(Psi1rL,Psi1rL))),kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmadd(kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(Psi4iL,Psi4iL),kmul(kmsub(Psi0rL,Psi0rL,kmul(Psi0iL,Psi0iL)),kmul(Psi4rL,Psi4rL))))))),kmul(ToReal(2),kmadd(kmadd(ToReal(5),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))),kmul(Psi2iL,kmul(Psi2iL,Psi2iL)),kmadd(Psi4iL,kmadd(Psi3iL,kmul(Psi3rL,kmul(Psi0rL,Psi0rL)),kmul(Psi0iL,kmadd(Psi4rL,kmul(Psi1rL,Psi1rL),kmul(Psi0rL,kmul(Psi3rL,Psi3rL))))),kmul(Psi2iL,kmadd(kmadd(ToReal(8),kmul(Psi3iL,Psi3rL),kmul(ToReal(3),kmul(Psi2rL,Psi4iL))),kmul(Psi1rL,Psi1rL),kmadd(Psi3rL,kmadd(Psi3iL,kmadd(ToReal(6),kmul(Psi0rL,Psi2rL),kmul(ToReal(-8),kmul(Psi1iL,Psi1iL))),kmul(Psi1iL,kmadd(Psi0rL,Psi4rL,kmul(ToReal(-15),kmul(Psi2rL,Psi2rL))))),kmadd(Psi4iL,knmsub(Psi0rL,kmul(Psi1iL,Psi3iL),kmadd(Psi4rL,kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(ToReal(-3),kmadd(Psi2rL,kmul(Psi1iL,Psi1iL),kmul(Psi0rL,kmul(Psi2rL,Psi2rL)))))),kmsub(Psi1rL,kmadd(Psi0iL,kmul(Psi3rL,Psi4rL),kmadd(Psi0rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL)),kmadd(Psi3iL,kmsub(ToReal(-15),kmul(Psi2rL,Psi2rL),kmul(Psi0iL,Psi4iL)),kmul(Psi1iL,kmadd(ToReal(6),kmul(Psi2rL,Psi4rL),kmadd(ToReal(-8),kmul(Psi3iL,Psi3iL),kmul(ToReal(8),kmul(Psi3rL,Psi3rL)))))))),kmul(Psi0iL,kmadd(Psi1iL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL)),kmadd(ToReal(3),kmul(Psi4rL,kmul(Psi2rL,Psi2rL)),kmadd(Psi2rL,kmadd(ToReal(3),kmul(Psi3iL,Psi3iL),kmul(ToReal(-3),kmul(Psi3rL,Psi3rL))),kmul(Psi0rL,kmsub(Psi4rL,Psi4rL,kmul(Psi4iL,Psi4iL))))))))))))))))))))))))))),ToReal(-640));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(curvIi[index],curvIiL);
    vec_store_nta_partial(curvIr[index],curvIrL);
    vec_store_nta_partial(curvJ1[index],curvJ1L);
    vec_store_nta_partial(curvJ2[index],curvJ2L);
    vec_store_nta_partial(curvJ3[index],curvJ3L);
    vec_store_nta_partial(curvJ4[index],curvJ4L);
    vec_store_nta_partial(curvJi[index],curvJiL);
    vec_store_nta_partial(curvJr[index],curvJrL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_invars_calc_4th);
}
extern "C" void WeylScal4_invars_calc_4th(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_invars_calc_4th_Body");
  }
  if (cctk_iteration % WeylScal4_invars_calc_4th_calc_every != WeylScal4_invars_calc_4th_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "WeylScal4::curvIi_group",
    "WeylScal4::curvIr_group",
    "WeylScal4::curvJ1_group",
    "WeylScal4::curvJ2_group",
    "WeylScal4::curvJ3_group",
    "WeylScal4::curvJ4_group",
    "WeylScal4::curvJi_group",
    "WeylScal4::curvJr_group",
    "WeylScal4::Psi0i_group",
    "WeylScal4::Psi0r_group",
    "WeylScal4::Psi1i_group",
    "WeylScal4::Psi1r_group",
    "WeylScal4::Psi2i_group",
    "WeylScal4::Psi2r_group",
    "WeylScal4::Psi3i_group",
    "WeylScal4::Psi3r_group",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_invars_calc_4th", 18, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      break;
    }
    
    case 4:
    {
      break;
    }
    
    case 6:
    {
      break;
    }
    
    case 8:
    {
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverEverything(cctkGH, WeylScal4_invars_calc_4th_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_invars_calc_4th_Body");
  }
}

} // namespace WeylScal4

```

Differencing.h:
```
#include <assert.h>
#include "vectors.h"

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd1(u) (kmul(p1o2dx,ksub(KRANC_GFOFFSET3D(u,1,0,0),KRANC_GFOFFSET3D(u,-1,0,0))))
#else
#  define PDstandard2nd1(u) (PDstandard2nd1_impl(u,p1o2dx,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd1_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dx, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd1_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dx, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o2dx,ksub(KRANC_GFOFFSET3D(u,1,0,0),KRANC_GFOFFSET3D(u,-1,0,0)));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd2(u) (kmul(p1o2dy,ksub(KRANC_GFOFFSET3D(u,0,1,0),KRANC_GFOFFSET3D(u,0,-1,0))))
#else
#  define PDstandard2nd2(u) (PDstandard2nd2_impl(u,p1o2dy,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd2_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd2_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o2dy,ksub(KRANC_GFOFFSET3D(u,0,1,0),KRANC_GFOFFSET3D(u,0,-1,0)));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd3(u) (kmul(p1o2dz,ksub(KRANC_GFOFFSET3D(u,0,0,1),KRANC_GFOFFSET3D(u,0,0,-1))))
#else
#  define PDstandard2nd3(u) (PDstandard2nd3_impl(u,p1o2dz,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd3_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd3_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard2nd2_impl(u, p1o2dz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd11(u) (kmul(p1odx2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)))))
#else
#  define PDstandard2nd11(u) (PDstandard2nd11_impl(u,p1odx2,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd11_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odx2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd11_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odx2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1odx2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd22(u) (kmul(p1ody2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)))))
#else
#  define PDstandard2nd22(u) (PDstandard2nd22_impl(u,p1ody2,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1ody2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1ody2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1ody2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd33(u) (kmul(p1odz2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,0,0,-1),KRANC_GFOFFSET3D(u,0,0,1)))))
#else
#  define PDstandard2nd33(u) (PDstandard2nd33_impl(u,p1odz2,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd33_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odz2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd33_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odz2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard2nd22_impl(u, p1odz2, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd12(u) (kmul(p1o4dxdy,kadd(KRANC_GFOFFSET3D(u,-1,-1,0),ksub(ksub(KRANC_GFOFFSET3D(u,1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),KRANC_GFOFFSET3D(u,-1,1,0)))))
#else
#  define PDstandard2nd12(u) (PDstandard2nd12_impl(u,p1o4dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd12_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd12_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o4dxdy,kadd(KRANC_GFOFFSET3D(u,-1,-1,0),ksub(ksub(KRANC_GFOFFSET3D(u,1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),KRANC_GFOFFSET3D(u,-1,1,0))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd13(u) (kmul(p1o4dxdz,kadd(KRANC_GFOFFSET3D(u,-1,0,-1),ksub(ksub(KRANC_GFOFFSET3D(u,1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),KRANC_GFOFFSET3D(u,-1,0,1)))))
#else
#  define PDstandard2nd13(u) (PDstandard2nd13_impl(u,p1o4dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd13_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd13_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard2nd12_impl(u, p1o4dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd21(u) (kmul(p1o4dxdy,kadd(KRANC_GFOFFSET3D(u,-1,-1,0),ksub(ksub(KRANC_GFOFFSET3D(u,1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),KRANC_GFOFFSET3D(u,-1,1,0)))))
#else
#  define PDstandard2nd21(u) (PDstandard2nd21_impl(u,p1o4dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd21_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd21_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard2nd12_impl(u, p1o4dxdy, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd23(u) (kmul(p1o4dydz,kadd(KRANC_GFOFFSET3D(u,0,-1,-1),ksub(ksub(KRANC_GFOFFSET3D(u,0,1,1),KRANC_GFOFFSET3D(u,0,1,-1)),KRANC_GFOFFSET3D(u,0,-1,1)))))
#else
#  define PDstandard2nd23(u) (PDstandard2nd23_impl(u,p1o4dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd23_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd23_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o4dydz,kadd(KRANC_GFOFFSET3D(u,0,-1,-1),ksub(ksub(KRANC_GFOFFSET3D(u,0,1,1),KRANC_GFOFFSET3D(u,0,1,-1)),KRANC_GFOFFSET3D(u,0,-1,1))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd31(u) (kmul(p1o4dxdz,kadd(KRANC_GFOFFSET3D(u,-1,0,-1),ksub(ksub(KRANC_GFOFFSET3D(u,1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),KRANC_GFOFFSET3D(u,-1,0,1)))))
#else
#  define PDstandard2nd31(u) (PDstandard2nd31_impl(u,p1o4dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd31_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd31_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard2nd12_impl(u, p1o4dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard2nd32(u) (kmul(p1o4dydz,kadd(KRANC_GFOFFSET3D(u,0,-1,-1),ksub(ksub(KRANC_GFOFFSET3D(u,0,1,1),KRANC_GFOFFSET3D(u,0,1,-1)),KRANC_GFOFFSET3D(u,0,-1,1)))))
#else
#  define PDstandard2nd32(u) (PDstandard2nd32_impl(u,p1o4dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandard2nd32_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard2nd32_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard2nd23_impl(u, p1o4dydz, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th1(u) (kmul(p1o12dx,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,1,0,0),ksub(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0))))))
#else
#  define PDstandard4th1(u) (PDstandard4th1_impl(u,p1o12dx,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th1_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dx, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th1_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dx, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o12dx,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,1,0,0),ksub(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th2(u) (kmul(p1o12dy,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,0,1,0),ksub(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0))))))
#else
#  define PDstandard4th2(u) (PDstandard4th2_impl(u,p1o12dy,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th2_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th2_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o12dy,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,0,1,0),ksub(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th3(u) (kmul(p1o12dz,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,0,0,-1),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,0,0,1),ksub(KRANC_GFOFFSET3D(u,0,0,-2),KRANC_GFOFFSET3D(u,0,0,2))))))
#else
#  define PDstandard4th3(u) (PDstandard4th3_impl(u,p1o12dz,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th3_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th3_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard4th2_impl(u, p1o12dz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th11(u) (kmul(pm1o12dx2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0))))))
#else
#  define PDstandard4th11(u) (PDstandard4th11_impl(u,pm1o12dx2,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th11_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dx2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th11_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dx2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(pm1o12dx2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th22(u) (kmul(pm1o12dy2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0))))))
#else
#  define PDstandard4th22(u) (PDstandard4th22_impl(u,pm1o12dy2,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dy2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dy2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(pm1o12dy2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th33(u) (kmul(pm1o12dz2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,0,0,-1),KRANC_GFOFFSET3D(u,0,0,1)),kadd(KRANC_GFOFFSET3D(u,0,0,-2),KRANC_GFOFFSET3D(u,0,0,2))))))
#else
#  define PDstandard4th33(u) (PDstandard4th33_impl(u,pm1o12dz2,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th33_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dz2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th33_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dz2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard4th22_impl(u, pm1o12dz2, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th12(u) (kmul(p1o144dxdy,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),ksub(ksub(KRANC_GFOFFSET3D(u,2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),KRANC_GFOFFSET3D(u,-2,2,0)))))))))
#else
#  define PDstandard4th12(u) (PDstandard4th12_impl(u,p1o144dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th12_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th12_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o144dxdy,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),ksub(ksub(KRANC_GFOFFSET3D(u,2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),KRANC_GFOFFSET3D(u,-2,2,0))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th13(u) (kmul(p1o144dxdz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),ksub(ksub(KRANC_GFOFFSET3D(u,2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),KRANC_GFOFFSET3D(u,-2,0,2)))))))))
#else
#  define PDstandard4th13(u) (PDstandard4th13_impl(u,p1o144dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th13_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th13_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard4th12_impl(u, p1o144dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th21(u) (kmul(p1o144dxdy,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),ksub(ksub(KRANC_GFOFFSET3D(u,2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),KRANC_GFOFFSET3D(u,-2,2,0)))))))))
#else
#  define PDstandard4th21(u) (PDstandard4th21_impl(u,p1o144dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th21_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th21_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard4th12_impl(u, p1o144dxdy, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th23(u) (kmul(p1o144dydz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),ksub(ksub(KRANC_GFOFFSET3D(u,0,2,2),KRANC_GFOFFSET3D(u,0,2,-2)),KRANC_GFOFFSET3D(u,0,-2,2)))))))))
#else
#  define PDstandard4th23(u) (PDstandard4th23_impl(u,p1o144dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th23_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th23_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o144dydz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),ksub(ksub(KRANC_GFOFFSET3D(u,0,2,2),KRANC_GFOFFSET3D(u,0,2,-2)),KRANC_GFOFFSET3D(u,0,-2,2))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th31(u) (kmul(p1o144dxdz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),ksub(ksub(KRANC_GFOFFSET3D(u,2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),KRANC_GFOFFSET3D(u,-2,0,2)))))))))
#else
#  define PDstandard4th31(u) (PDstandard4th31_impl(u,p1o144dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th31_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th31_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard4th12_impl(u, p1o144dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandard4th32(u) (kmul(p1o144dydz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),ksub(ksub(KRANC_GFOFFSET3D(u,0,2,2),KRANC_GFOFFSET3D(u,0,2,-2)),KRANC_GFOFFSET3D(u,0,-2,2)))))))))
#else
#  define PDstandard4th32(u) (PDstandard4th32_impl(u,p1o144dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandard4th32_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandard4th32_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandard4th23_impl(u, p1o144dydz, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder21(u) (kmul(p1o2dx,ksub(KRANC_GFOFFSET3D(u,1,0,0),KRANC_GFOFFSET3D(u,-1,0,0))))
#else
#  define PDstandardfdOrder21(u) (PDstandardfdOrder21_impl(u,p1o2dx,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder21_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dx, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder21_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dx, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o2dx,ksub(KRANC_GFOFFSET3D(u,1,0,0),KRANC_GFOFFSET3D(u,-1,0,0)));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder22(u) (kmul(p1o2dy,ksub(KRANC_GFOFFSET3D(u,0,1,0),KRANC_GFOFFSET3D(u,0,-1,0))))
#else
#  define PDstandardfdOrder22(u) (PDstandardfdOrder22_impl(u,p1o2dy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o2dy,ksub(KRANC_GFOFFSET3D(u,0,1,0),KRANC_GFOFFSET3D(u,0,-1,0)));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder23(u) (kmul(p1o2dz,ksub(KRANC_GFOFFSET3D(u,0,0,1),KRANC_GFOFFSET3D(u,0,0,-1))))
#else
#  define PDstandardfdOrder23(u) (PDstandardfdOrder23_impl(u,p1o2dz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder23_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder23_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o2dz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder22_impl(u, p1o2dz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder41(u) (kmul(p1o12dx,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,1,0,0),ksub(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0))))))
#else
#  define PDstandardfdOrder41(u) (PDstandardfdOrder41_impl(u,p1o12dx,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder41_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dx, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder41_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dx, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o12dx,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,1,0,0),ksub(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder42(u) (kmul(p1o12dy,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,0,1,0),ksub(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0))))))
#else
#  define PDstandardfdOrder42(u) (PDstandardfdOrder42_impl(u,p1o12dy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder42_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder42_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o12dy,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,0,1,0),ksub(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder43(u) (kmul(p1o12dz,kmadd(ToReal(-8),KRANC_GFOFFSET3D(u,0,0,-1),kmadd(ToReal(8),KRANC_GFOFFSET3D(u,0,0,1),ksub(KRANC_GFOFFSET3D(u,0,0,-2),KRANC_GFOFFSET3D(u,0,0,2))))))
#else
#  define PDstandardfdOrder43(u) (PDstandardfdOrder43_impl(u,p1o12dz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder43_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder43_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o12dz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder42_impl(u, p1o12dz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder61(u) (kmul(p1o60dx,kmadd(ToReal(-45),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(45),KRANC_GFOFFSET3D(u,1,0,0),kmadd(ToReal(9),KRANC_GFOFFSET3D(u,-2,0,0),kmadd(ToReal(-9),KRANC_GFOFFSET3D(u,2,0,0),ksub(KRANC_GFOFFSET3D(u,3,0,0),KRANC_GFOFFSET3D(u,-3,0,0))))))))
#else
#  define PDstandardfdOrder61(u) (PDstandardfdOrder61_impl(u,p1o60dx,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder61_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o60dx, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder61_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o60dx, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o60dx,kmadd(ToReal(-45),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(45),KRANC_GFOFFSET3D(u,1,0,0),kmadd(ToReal(9),KRANC_GFOFFSET3D(u,-2,0,0),kmadd(ToReal(-9),KRANC_GFOFFSET3D(u,2,0,0),ksub(KRANC_GFOFFSET3D(u,3,0,0),KRANC_GFOFFSET3D(u,-3,0,0)))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder62(u) (kmul(p1o60dy,kmadd(ToReal(-45),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(45),KRANC_GFOFFSET3D(u,0,1,0),kmadd(ToReal(9),KRANC_GFOFFSET3D(u,0,-2,0),kmadd(ToReal(-9),KRANC_GFOFFSET3D(u,0,2,0),ksub(KRANC_GFOFFSET3D(u,0,3,0),KRANC_GFOFFSET3D(u,0,-3,0))))))))
#else
#  define PDstandardfdOrder62(u) (PDstandardfdOrder62_impl(u,p1o60dy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder62_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o60dy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder62_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o60dy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o60dy,kmadd(ToReal(-45),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(45),KRANC_GFOFFSET3D(u,0,1,0),kmadd(ToReal(9),KRANC_GFOFFSET3D(u,0,-2,0),kmadd(ToReal(-9),KRANC_GFOFFSET3D(u,0,2,0),ksub(KRANC_GFOFFSET3D(u,0,3,0),KRANC_GFOFFSET3D(u,0,-3,0)))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder63(u) (kmul(p1o60dz,kmadd(ToReal(-45),KRANC_GFOFFSET3D(u,0,0,-1),kmadd(ToReal(45),KRANC_GFOFFSET3D(u,0,0,1),kmadd(ToReal(9),KRANC_GFOFFSET3D(u,0,0,-2),kmadd(ToReal(-9),KRANC_GFOFFSET3D(u,0,0,2),ksub(KRANC_GFOFFSET3D(u,0,0,3),KRANC_GFOFFSET3D(u,0,0,-3))))))))
#else
#  define PDstandardfdOrder63(u) (PDstandardfdOrder63_impl(u,p1o60dz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder63_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o60dz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder63_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o60dz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder62_impl(u, p1o60dz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder81(u) (kmul(p1o840dx,kmadd(ToReal(-672),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(672),KRANC_GFOFFSET3D(u,1,0,0),kmadd(ToReal(168),KRANC_GFOFFSET3D(u,-2,0,0),kmadd(ToReal(-168),KRANC_GFOFFSET3D(u,2,0,0),kmadd(ToReal(-32),KRANC_GFOFFSET3D(u,-3,0,0),kmadd(ToReal(32),KRANC_GFOFFSET3D(u,3,0,0),kmadd(ToReal(3),KRANC_GFOFFSET3D(u,-4,0,0),kmul(ToReal(-3),KRANC_GFOFFSET3D(u,4,0,0)))))))))))
#else
#  define PDstandardfdOrder81(u) (PDstandardfdOrder81_impl(u,p1o840dx,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder81_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o840dx, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder81_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o840dx, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o840dx,kmadd(ToReal(-672),KRANC_GFOFFSET3D(u,-1,0,0),kmadd(ToReal(672),KRANC_GFOFFSET3D(u,1,0,0),kmadd(ToReal(168),KRANC_GFOFFSET3D(u,-2,0,0),kmadd(ToReal(-168),KRANC_GFOFFSET3D(u,2,0,0),kmadd(ToReal(-32),KRANC_GFOFFSET3D(u,-3,0,0),kmadd(ToReal(32),KRANC_GFOFFSET3D(u,3,0,0),kmadd(ToReal(3),KRANC_GFOFFSET3D(u,-4,0,0),kmul(ToReal(-3),KRANC_GFOFFSET3D(u,4,0,0))))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder82(u) (kmul(p1o840dy,kmadd(ToReal(-672),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(672),KRANC_GFOFFSET3D(u,0,1,0),kmadd(ToReal(168),KRANC_GFOFFSET3D(u,0,-2,0),kmadd(ToReal(-168),KRANC_GFOFFSET3D(u,0,2,0),kmadd(ToReal(-32),KRANC_GFOFFSET3D(u,0,-3,0),kmadd(ToReal(32),KRANC_GFOFFSET3D(u,0,3,0),kmadd(ToReal(3),KRANC_GFOFFSET3D(u,0,-4,0),kmul(ToReal(-3),KRANC_GFOFFSET3D(u,0,4,0)))))))))))
#else
#  define PDstandardfdOrder82(u) (PDstandardfdOrder82_impl(u,p1o840dy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder82_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o840dy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder82_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o840dy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o840dy,kmadd(ToReal(-672),KRANC_GFOFFSET3D(u,0,-1,0),kmadd(ToReal(672),KRANC_GFOFFSET3D(u,0,1,0),kmadd(ToReal(168),KRANC_GFOFFSET3D(u,0,-2,0),kmadd(ToReal(-168),KRANC_GFOFFSET3D(u,0,2,0),kmadd(ToReal(-32),KRANC_GFOFFSET3D(u,0,-3,0),kmadd(ToReal(32),KRANC_GFOFFSET3D(u,0,3,0),kmadd(ToReal(3),KRANC_GFOFFSET3D(u,0,-4,0),kmul(ToReal(-3),KRANC_GFOFFSET3D(u,0,4,0))))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder83(u) (kmul(p1o840dz,kmadd(ToReal(-672),KRANC_GFOFFSET3D(u,0,0,-1),kmadd(ToReal(672),KRANC_GFOFFSET3D(u,0,0,1),kmadd(ToReal(168),KRANC_GFOFFSET3D(u,0,0,-2),kmadd(ToReal(-168),KRANC_GFOFFSET3D(u,0,0,2),kmadd(ToReal(-32),KRANC_GFOFFSET3D(u,0,0,-3),kmadd(ToReal(32),KRANC_GFOFFSET3D(u,0,0,3),kmadd(ToReal(3),KRANC_GFOFFSET3D(u,0,0,-4),kmul(ToReal(-3),KRANC_GFOFFSET3D(u,0,0,4)))))))))))
#else
#  define PDstandardfdOrder83(u) (PDstandardfdOrder83_impl(u,p1o840dz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder83_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o840dz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder83_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o840dz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder82_impl(u, p1o840dz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder211(u) (kmul(p1odx2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)))))
#else
#  define PDstandardfdOrder211(u) (PDstandardfdOrder211_impl(u,p1odx2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder211_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odx2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder211_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odx2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1odx2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder222(u) (kmul(p1ody2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)))))
#else
#  define PDstandardfdOrder222(u) (PDstandardfdOrder222_impl(u,p1ody2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder222_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1ody2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder222_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1ody2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1ody2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder233(u) (kmul(p1odz2,kmadd(ToReal(-2),KRANC_GFOFFSET3D(u,0,0,0),kadd(KRANC_GFOFFSET3D(u,0,0,-1),KRANC_GFOFFSET3D(u,0,0,1)))))
#else
#  define PDstandardfdOrder233(u) (PDstandardfdOrder233_impl(u,p1odz2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder233_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odz2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder233_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1odz2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder222_impl(u, p1odz2, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder411(u) (kmul(pm1o12dx2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0))))))
#else
#  define PDstandardfdOrder411(u) (PDstandardfdOrder411_impl(u,pm1o12dx2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder411_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dx2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder411_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dx2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(pm1o12dx2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder422(u) (kmul(pm1o12dy2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0))))))
#else
#  define PDstandardfdOrder422(u) (PDstandardfdOrder422_impl(u,pm1o12dy2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder422_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dy2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder422_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dy2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(pm1o12dy2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder433(u) (kmul(pm1o12dz2,kmadd(ToReal(30),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(-16),kadd(KRANC_GFOFFSET3D(u,0,0,-1),KRANC_GFOFFSET3D(u,0,0,1)),kadd(KRANC_GFOFFSET3D(u,0,0,-2),KRANC_GFOFFSET3D(u,0,0,2))))))
#else
#  define PDstandardfdOrder433(u) (PDstandardfdOrder433_impl(u,pm1o12dz2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder433_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dz2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder433_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC pm1o12dz2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder422_impl(u, pm1o12dz2, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder611(u) (kmul(p1o180dx2,kmadd(ToReal(-490),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(270),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kmadd(ToReal(-27),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)),kmul(ToReal(2),kadd(KRANC_GFOFFSET3D(u,-3,0,0),KRANC_GFOFFSET3D(u,3,0,0))))))))
#else
#  define PDstandardfdOrder611(u) (PDstandardfdOrder611_impl(u,p1o180dx2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder611_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o180dx2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder611_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o180dx2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o180dx2,kmadd(ToReal(-490),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(270),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kmadd(ToReal(-27),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)),kmul(ToReal(2),kadd(KRANC_GFOFFSET3D(u,-3,0,0),KRANC_GFOFFSET3D(u,3,0,0)))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder622(u) (kmul(p1o180dy2,kmadd(ToReal(-490),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(270),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kmadd(ToReal(-27),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)),kmul(ToReal(2),kadd(KRANC_GFOFFSET3D(u,0,-3,0),KRANC_GFOFFSET3D(u,0,3,0))))))))
#else
#  define PDstandardfdOrder622(u) (PDstandardfdOrder622_impl(u,p1o180dy2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder622_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o180dy2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder622_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o180dy2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o180dy2,kmadd(ToReal(-490),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(270),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kmadd(ToReal(-27),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)),kmul(ToReal(2),kadd(KRANC_GFOFFSET3D(u,0,-3,0),KRANC_GFOFFSET3D(u,0,3,0)))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder633(u) (kmul(p1o180dz2,kmadd(ToReal(-490),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(270),kadd(KRANC_GFOFFSET3D(u,0,0,-1),KRANC_GFOFFSET3D(u,0,0,1)),kmadd(ToReal(-27),kadd(KRANC_GFOFFSET3D(u,0,0,-2),KRANC_GFOFFSET3D(u,0,0,2)),kmul(ToReal(2),kadd(KRANC_GFOFFSET3D(u,0,0,-3),KRANC_GFOFFSET3D(u,0,0,3))))))))
#else
#  define PDstandardfdOrder633(u) (PDstandardfdOrder633_impl(u,p1o180dz2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder633_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o180dz2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder633_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o180dz2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder622_impl(u, p1o180dz2, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder811(u) (kmul(p1o5040dx2,kmadd(ToReal(-14350),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(8064),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kmadd(ToReal(-1008),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)),kmadd(ToReal(128),kadd(KRANC_GFOFFSET3D(u,-3,0,0),KRANC_GFOFFSET3D(u,3,0,0)),kmul(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,0,0),KRANC_GFOFFSET3D(u,4,0,0)))))))))
#else
#  define PDstandardfdOrder811(u) (PDstandardfdOrder811_impl(u,p1o5040dx2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder811_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o5040dx2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder811_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o5040dx2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o5040dx2,kmadd(ToReal(-14350),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(8064),kadd(KRANC_GFOFFSET3D(u,-1,0,0),KRANC_GFOFFSET3D(u,1,0,0)),kmadd(ToReal(-1008),kadd(KRANC_GFOFFSET3D(u,-2,0,0),KRANC_GFOFFSET3D(u,2,0,0)),kmadd(ToReal(128),kadd(KRANC_GFOFFSET3D(u,-3,0,0),KRANC_GFOFFSET3D(u,3,0,0)),kmul(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,0,0),KRANC_GFOFFSET3D(u,4,0,0))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder822(u) (kmul(p1o5040dy2,kmadd(ToReal(-14350),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(8064),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kmadd(ToReal(-1008),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)),kmadd(ToReal(128),kadd(KRANC_GFOFFSET3D(u,0,-3,0),KRANC_GFOFFSET3D(u,0,3,0)),kmul(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-4,0),KRANC_GFOFFSET3D(u,0,4,0)))))))))
#else
#  define PDstandardfdOrder822(u) (PDstandardfdOrder822_impl(u,p1o5040dy2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder822_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o5040dy2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder822_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o5040dy2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o5040dy2,kmadd(ToReal(-14350),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(8064),kadd(KRANC_GFOFFSET3D(u,0,-1,0),KRANC_GFOFFSET3D(u,0,1,0)),kmadd(ToReal(-1008),kadd(KRANC_GFOFFSET3D(u,0,-2,0),KRANC_GFOFFSET3D(u,0,2,0)),kmadd(ToReal(128),kadd(KRANC_GFOFFSET3D(u,0,-3,0),KRANC_GFOFFSET3D(u,0,3,0)),kmul(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-4,0),KRANC_GFOFFSET3D(u,0,4,0))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder833(u) (kmul(p1o5040dz2,kmadd(ToReal(-14350),KRANC_GFOFFSET3D(u,0,0,0),kmadd(ToReal(8064),kadd(KRANC_GFOFFSET3D(u,0,0,-1),KRANC_GFOFFSET3D(u,0,0,1)),kmadd(ToReal(-1008),kadd(KRANC_GFOFFSET3D(u,0,0,-2),KRANC_GFOFFSET3D(u,0,0,2)),kmadd(ToReal(128),kadd(KRANC_GFOFFSET3D(u,0,0,-3),KRANC_GFOFFSET3D(u,0,0,3)),kmul(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,0,-4),KRANC_GFOFFSET3D(u,0,0,4)))))))))
#else
#  define PDstandardfdOrder833(u) (PDstandardfdOrder833_impl(u,p1o5040dz2,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder833_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o5040dz2, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder833_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o5040dz2, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder822_impl(u, p1o5040dz2, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder212(u) (kmul(p1o4dxdy,kadd(KRANC_GFOFFSET3D(u,-1,-1,0),ksub(ksub(KRANC_GFOFFSET3D(u,1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),KRANC_GFOFFSET3D(u,-1,1,0)))))
#else
#  define PDstandardfdOrder212(u) (PDstandardfdOrder212_impl(u,p1o4dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder212_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder212_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o4dxdy,kadd(KRANC_GFOFFSET3D(u,-1,-1,0),ksub(ksub(KRANC_GFOFFSET3D(u,1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),KRANC_GFOFFSET3D(u,-1,1,0))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder213(u) (kmul(p1o4dxdz,kadd(KRANC_GFOFFSET3D(u,-1,0,-1),ksub(ksub(KRANC_GFOFFSET3D(u,1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),KRANC_GFOFFSET3D(u,-1,0,1)))))
#else
#  define PDstandardfdOrder213(u) (PDstandardfdOrder213_impl(u,p1o4dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder213_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder213_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder212_impl(u, p1o4dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder221(u) (kmul(p1o4dxdy,kadd(KRANC_GFOFFSET3D(u,-1,-1,0),ksub(ksub(KRANC_GFOFFSET3D(u,1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),KRANC_GFOFFSET3D(u,-1,1,0)))))
#else
#  define PDstandardfdOrder221(u) (PDstandardfdOrder221_impl(u,p1o4dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder221_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder221_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder212_impl(u, p1o4dxdy, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder223(u) (kmul(p1o4dydz,kadd(KRANC_GFOFFSET3D(u,0,-1,-1),ksub(ksub(KRANC_GFOFFSET3D(u,0,1,1),KRANC_GFOFFSET3D(u,0,1,-1)),KRANC_GFOFFSET3D(u,0,-1,1)))))
#else
#  define PDstandardfdOrder223(u) (PDstandardfdOrder223_impl(u,p1o4dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder223_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder223_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o4dydz,kadd(KRANC_GFOFFSET3D(u,0,-1,-1),ksub(ksub(KRANC_GFOFFSET3D(u,0,1,1),KRANC_GFOFFSET3D(u,0,1,-1)),KRANC_GFOFFSET3D(u,0,-1,1))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder231(u) (kmul(p1o4dxdz,kadd(KRANC_GFOFFSET3D(u,-1,0,-1),ksub(ksub(KRANC_GFOFFSET3D(u,1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),KRANC_GFOFFSET3D(u,-1,0,1)))))
#else
#  define PDstandardfdOrder231(u) (PDstandardfdOrder231_impl(u,p1o4dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder231_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder231_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder212_impl(u, p1o4dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder232(u) (kmul(p1o4dydz,kadd(KRANC_GFOFFSET3D(u,0,-1,-1),ksub(ksub(KRANC_GFOFFSET3D(u,0,1,1),KRANC_GFOFFSET3D(u,0,1,-1)),KRANC_GFOFFSET3D(u,0,-1,1)))))
#else
#  define PDstandardfdOrder232(u) (PDstandardfdOrder232_impl(u,p1o4dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder232_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder232_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o4dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder223_impl(u, p1o4dydz, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder412(u) (kmul(p1o144dxdy,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),ksub(ksub(KRANC_GFOFFSET3D(u,2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),KRANC_GFOFFSET3D(u,-2,2,0)))))))))
#else
#  define PDstandardfdOrder412(u) (PDstandardfdOrder412_impl(u,p1o144dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder412_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder412_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o144dxdy,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),ksub(ksub(KRANC_GFOFFSET3D(u,2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),KRANC_GFOFFSET3D(u,-2,2,0))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder413(u) (kmul(p1o144dxdz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),ksub(ksub(KRANC_GFOFFSET3D(u,2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),KRANC_GFOFFSET3D(u,-2,0,2)))))))))
#else
#  define PDstandardfdOrder413(u) (PDstandardfdOrder413_impl(u,p1o144dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder413_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder413_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder412_impl(u, p1o144dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder421(u) (kmul(p1o144dxdy,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),ksub(ksub(KRANC_GFOFFSET3D(u,2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),KRANC_GFOFFSET3D(u,-2,2,0)))))))))
#else
#  define PDstandardfdOrder421(u) (PDstandardfdOrder421_impl(u,p1o144dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder421_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder421_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder412_impl(u, p1o144dxdy, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder423(u) (kmul(p1o144dydz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),ksub(ksub(KRANC_GFOFFSET3D(u,0,2,2),KRANC_GFOFFSET3D(u,0,2,-2)),KRANC_GFOFFSET3D(u,0,-2,2)))))))))
#else
#  define PDstandardfdOrder423(u) (PDstandardfdOrder423_impl(u,p1o144dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder423_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder423_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o144dydz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),ksub(ksub(KRANC_GFOFFSET3D(u,0,2,2),KRANC_GFOFFSET3D(u,0,2,-2)),KRANC_GFOFFSET3D(u,0,-2,2))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder431(u) (kmul(p1o144dxdz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),ksub(ksub(KRANC_GFOFFSET3D(u,2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),KRANC_GFOFFSET3D(u,-2,0,2)))))))))
#else
#  define PDstandardfdOrder431(u) (PDstandardfdOrder431_impl(u,p1o144dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder431_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder431_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder412_impl(u, p1o144dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder432(u) (kmul(p1o144dydz,kmadd(ToReal(-64),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(64),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(8),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-8),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),ksub(ksub(KRANC_GFOFFSET3D(u,0,2,2),KRANC_GFOFFSET3D(u,0,2,-2)),KRANC_GFOFFSET3D(u,0,-2,2)))))))))
#else
#  define PDstandardfdOrder432(u) (PDstandardfdOrder432_impl(u,p1o144dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder432_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder432_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o144dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder423_impl(u, p1o144dydz, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder612(u) (kmul(p1o3600dxdy,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,-2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),KRANC_GFOFFSET3D(u,2,2,0)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,-1,3,0),kadd(KRANC_GFOFFSET3D(u,1,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,1,0),KRANC_GFOFFSET3D(u,3,-1,0)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,-1,-3,0),kadd(KRANC_GFOFFSET3D(u,1,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-1,0),KRANC_GFOFFSET3D(u,3,1,0)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-2,3,0),kadd(KRANC_GFOFFSET3D(u,2,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,2,0),KRANC_GFOFFSET3D(u,3,-2,0)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-2,-3,0),kadd(KRANC_GFOFFSET3D(u,2,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-2,0),KRANC_GFOFFSET3D(u,3,2,0)))),kadd(KRANC_GFOFFSET3D(u,-3,-3,0),ksub(ksub(KRANC_GFOFFSET3D(u,3,3,0),KRANC_GFOFFSET3D(u,3,-3,0)),KRANC_GFOFFSET3D(u,-3,3,0)))))))))))))))
#else
#  define PDstandardfdOrder612(u) (PDstandardfdOrder612_impl(u,p1o3600dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder612_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder612_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o3600dxdy,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,-2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),KRANC_GFOFFSET3D(u,2,2,0)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,-1,3,0),kadd(KRANC_GFOFFSET3D(u,1,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,1,0),KRANC_GFOFFSET3D(u,3,-1,0)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,-1,-3,0),kadd(KRANC_GFOFFSET3D(u,1,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-1,0),KRANC_GFOFFSET3D(u,3,1,0)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-2,3,0),kadd(KRANC_GFOFFSET3D(u,2,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,2,0),KRANC_GFOFFSET3D(u,3,-2,0)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-2,-3,0),kadd(KRANC_GFOFFSET3D(u,2,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-2,0),KRANC_GFOFFSET3D(u,3,2,0)))),kadd(KRANC_GFOFFSET3D(u,-3,-3,0),ksub(ksub(KRANC_GFOFFSET3D(u,3,3,0),KRANC_GFOFFSET3D(u,3,-3,0)),KRANC_GFOFFSET3D(u,-3,3,0))))))))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder613(u) (kmul(p1o3600dxdz,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,-2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),KRANC_GFOFFSET3D(u,2,0,2)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,-1,0,3),kadd(KRANC_GFOFFSET3D(u,1,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,1),KRANC_GFOFFSET3D(u,3,0,-1)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,-1,0,-3),kadd(KRANC_GFOFFSET3D(u,1,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-1),KRANC_GFOFFSET3D(u,3,0,1)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-2,0,3),kadd(KRANC_GFOFFSET3D(u,2,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,2),KRANC_GFOFFSET3D(u,3,0,-2)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-2,0,-3),kadd(KRANC_GFOFFSET3D(u,2,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-2),KRANC_GFOFFSET3D(u,3,0,2)))),kadd(KRANC_GFOFFSET3D(u,-3,0,-3),ksub(ksub(KRANC_GFOFFSET3D(u,3,0,3),KRANC_GFOFFSET3D(u,3,0,-3)),KRANC_GFOFFSET3D(u,-3,0,3)))))))))))))))
#else
#  define PDstandardfdOrder613(u) (PDstandardfdOrder613_impl(u,p1o3600dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder613_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder613_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder612_impl(u, p1o3600dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder621(u) (kmul(p1o3600dxdy,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,-2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),KRANC_GFOFFSET3D(u,2,2,0)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,-1,3,0),kadd(KRANC_GFOFFSET3D(u,1,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,1,0),KRANC_GFOFFSET3D(u,3,-1,0)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,-1,-3,0),kadd(KRANC_GFOFFSET3D(u,1,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-1,0),KRANC_GFOFFSET3D(u,3,1,0)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-2,3,0),kadd(KRANC_GFOFFSET3D(u,2,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,2,0),KRANC_GFOFFSET3D(u,3,-2,0)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-2,-3,0),kadd(KRANC_GFOFFSET3D(u,2,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-2,0),KRANC_GFOFFSET3D(u,3,2,0)))),kadd(KRANC_GFOFFSET3D(u,-3,-3,0),ksub(ksub(KRANC_GFOFFSET3D(u,3,3,0),KRANC_GFOFFSET3D(u,3,-3,0)),KRANC_GFOFFSET3D(u,-3,3,0)))))))))))))))
#else
#  define PDstandardfdOrder621(u) (PDstandardfdOrder621_impl(u,p1o3600dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder621_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder621_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder612_impl(u, p1o3600dxdy, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder623(u) (kmul(p1o3600dydz,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,0,-2,2),KRANC_GFOFFSET3D(u,0,2,-2)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),KRANC_GFOFFSET3D(u,0,2,2)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,0,-1,3),kadd(KRANC_GFOFFSET3D(u,0,1,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,1),KRANC_GFOFFSET3D(u,0,3,-1)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,0,-1,-3),kadd(KRANC_GFOFFSET3D(u,0,1,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-1),KRANC_GFOFFSET3D(u,0,3,1)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,0,-2,3),kadd(KRANC_GFOFFSET3D(u,0,2,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,2),KRANC_GFOFFSET3D(u,0,3,-2)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-2,-3),kadd(KRANC_GFOFFSET3D(u,0,2,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-2),KRANC_GFOFFSET3D(u,0,3,2)))),kadd(KRANC_GFOFFSET3D(u,0,-3,-3),ksub(ksub(KRANC_GFOFFSET3D(u,0,3,3),KRANC_GFOFFSET3D(u,0,3,-3)),KRANC_GFOFFSET3D(u,0,-3,3)))))))))))))))
#else
#  define PDstandardfdOrder623(u) (PDstandardfdOrder623_impl(u,p1o3600dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder623_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder623_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o3600dydz,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,0,-2,2),KRANC_GFOFFSET3D(u,0,2,-2)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),KRANC_GFOFFSET3D(u,0,2,2)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,0,-1,3),kadd(KRANC_GFOFFSET3D(u,0,1,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,1),KRANC_GFOFFSET3D(u,0,3,-1)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,0,-1,-3),kadd(KRANC_GFOFFSET3D(u,0,1,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-1),KRANC_GFOFFSET3D(u,0,3,1)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,0,-2,3),kadd(KRANC_GFOFFSET3D(u,0,2,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,2),KRANC_GFOFFSET3D(u,0,3,-2)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-2,-3),kadd(KRANC_GFOFFSET3D(u,0,2,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-2),KRANC_GFOFFSET3D(u,0,3,2)))),kadd(KRANC_GFOFFSET3D(u,0,-3,-3),ksub(ksub(KRANC_GFOFFSET3D(u,0,3,3),KRANC_GFOFFSET3D(u,0,3,-3)),KRANC_GFOFFSET3D(u,0,-3,3))))))))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder631(u) (kmul(p1o3600dxdz,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,-2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),KRANC_GFOFFSET3D(u,2,0,2)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,-1,0,3),kadd(KRANC_GFOFFSET3D(u,1,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,1),KRANC_GFOFFSET3D(u,3,0,-1)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,-1,0,-3),kadd(KRANC_GFOFFSET3D(u,1,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-1),KRANC_GFOFFSET3D(u,3,0,1)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-2,0,3),kadd(KRANC_GFOFFSET3D(u,2,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,2),KRANC_GFOFFSET3D(u,3,0,-2)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-2,0,-3),kadd(KRANC_GFOFFSET3D(u,2,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-2),KRANC_GFOFFSET3D(u,3,0,2)))),kadd(KRANC_GFOFFSET3D(u,-3,0,-3),ksub(ksub(KRANC_GFOFFSET3D(u,3,0,3),KRANC_GFOFFSET3D(u,3,0,-3)),KRANC_GFOFFSET3D(u,-3,0,3)))))))))))))))
#else
#  define PDstandardfdOrder631(u) (PDstandardfdOrder631_impl(u,p1o3600dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder631_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder631_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder612_impl(u, p1o3600dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder632(u) (kmul(p1o3600dydz,kmadd(ToReal(-2025),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(2025),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(405),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-405),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kmadd(ToReal(-81),kadd(KRANC_GFOFFSET3D(u,0,-2,2),KRANC_GFOFFSET3D(u,0,2,-2)),kmadd(ToReal(81),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),KRANC_GFOFFSET3D(u,0,2,2)),kmadd(ToReal(-45),kadd(KRANC_GFOFFSET3D(u,0,-1,3),kadd(KRANC_GFOFFSET3D(u,0,1,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,1),KRANC_GFOFFSET3D(u,0,3,-1)))),kmadd(ToReal(45),kadd(KRANC_GFOFFSET3D(u,0,-1,-3),kadd(KRANC_GFOFFSET3D(u,0,1,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-1),KRANC_GFOFFSET3D(u,0,3,1)))),kmadd(ToReal(9),kadd(KRANC_GFOFFSET3D(u,0,-2,3),kadd(KRANC_GFOFFSET3D(u,0,2,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,2),KRANC_GFOFFSET3D(u,0,3,-2)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-2,-3),kadd(KRANC_GFOFFSET3D(u,0,2,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-2),KRANC_GFOFFSET3D(u,0,3,2)))),kadd(KRANC_GFOFFSET3D(u,0,-3,-3),ksub(ksub(KRANC_GFOFFSET3D(u,0,3,3),KRANC_GFOFFSET3D(u,0,3,-3)),KRANC_GFOFFSET3D(u,0,-3,3)))))))))))))))
#else
#  define PDstandardfdOrder632(u) (PDstandardfdOrder632_impl(u,p1o3600dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder632_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder632_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o3600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder623_impl(u, p1o3600dydz, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder812(u) (kmul(p1o705600dxdy,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,-2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),KRANC_GFOFFSET3D(u,2,2,0)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,-1,3,0),kadd(KRANC_GFOFFSET3D(u,1,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,1,0),KRANC_GFOFFSET3D(u,3,-1,0)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,-1,-3,0),kadd(KRANC_GFOFFSET3D(u,1,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-1,0),KRANC_GFOFFSET3D(u,3,1,0)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,-2,3,0),kadd(KRANC_GFOFFSET3D(u,2,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,2,0),KRANC_GFOFFSET3D(u,3,-2,0)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,-2,-3,0),kadd(KRANC_GFOFFSET3D(u,2,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-2,0),KRANC_GFOFFSET3D(u,3,2,0)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,-3,3,0),KRANC_GFOFFSET3D(u,3,-3,0)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,-3,-3,0),KRANC_GFOFFSET3D(u,3,3,0)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,-1,4,0),kadd(KRANC_GFOFFSET3D(u,1,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,1,0),KRANC_GFOFFSET3D(u,4,-1,0)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,-1,-4,0),kadd(KRANC_GFOFFSET3D(u,1,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-1,0),KRANC_GFOFFSET3D(u,4,1,0)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,-2,4,0),kadd(KRANC_GFOFFSET3D(u,2,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,2,0),KRANC_GFOFFSET3D(u,4,-2,0)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,-2,-4,0),kadd(KRANC_GFOFFSET3D(u,2,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-2,0),KRANC_GFOFFSET3D(u,4,2,0)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,-3,4,0),kadd(KRANC_GFOFFSET3D(u,3,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,3,0),KRANC_GFOFFSET3D(u,4,-3,0)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,-3,-4,0),kadd(KRANC_GFOFFSET3D(u,3,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-3,0),KRANC_GFOFFSET3D(u,4,3,0)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,4,0),KRANC_GFOFFSET3D(u,4,-4,0)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-4,-4,0),KRANC_GFOFFSET3D(u,4,4,0))))))))))))))))))))))))
#else
#  define PDstandardfdOrder812(u) (PDstandardfdOrder812_impl(u,p1o705600dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder812_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder812_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o705600dxdy,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,-2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),KRANC_GFOFFSET3D(u,2,2,0)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,-1,3,0),kadd(KRANC_GFOFFSET3D(u,1,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,1,0),KRANC_GFOFFSET3D(u,3,-1,0)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,-1,-3,0),kadd(KRANC_GFOFFSET3D(u,1,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-1,0),KRANC_GFOFFSET3D(u,3,1,0)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,-2,3,0),kadd(KRANC_GFOFFSET3D(u,2,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,2,0),KRANC_GFOFFSET3D(u,3,-2,0)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,-2,-3,0),kadd(KRANC_GFOFFSET3D(u,2,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-2,0),KRANC_GFOFFSET3D(u,3,2,0)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,-3,3,0),KRANC_GFOFFSET3D(u,3,-3,0)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,-3,-3,0),KRANC_GFOFFSET3D(u,3,3,0)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,-1,4,0),kadd(KRANC_GFOFFSET3D(u,1,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,1,0),KRANC_GFOFFSET3D(u,4,-1,0)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,-1,-4,0),kadd(KRANC_GFOFFSET3D(u,1,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-1,0),KRANC_GFOFFSET3D(u,4,1,0)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,-2,4,0),kadd(KRANC_GFOFFSET3D(u,2,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,2,0),KRANC_GFOFFSET3D(u,4,-2,0)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,-2,-4,0),kadd(KRANC_GFOFFSET3D(u,2,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-2,0),KRANC_GFOFFSET3D(u,4,2,0)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,-3,4,0),kadd(KRANC_GFOFFSET3D(u,3,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,3,0),KRANC_GFOFFSET3D(u,4,-3,0)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,-3,-4,0),kadd(KRANC_GFOFFSET3D(u,3,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-3,0),KRANC_GFOFFSET3D(u,4,3,0)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,4,0),KRANC_GFOFFSET3D(u,4,-4,0)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-4,-4,0),KRANC_GFOFFSET3D(u,4,4,0)))))))))))))))))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder813(u) (kmul(p1o705600dxdz,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,-2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),KRANC_GFOFFSET3D(u,2,0,2)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,-1,0,3),kadd(KRANC_GFOFFSET3D(u,1,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,1),KRANC_GFOFFSET3D(u,3,0,-1)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,-1,0,-3),kadd(KRANC_GFOFFSET3D(u,1,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-1),KRANC_GFOFFSET3D(u,3,0,1)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,-2,0,3),kadd(KRANC_GFOFFSET3D(u,2,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,2),KRANC_GFOFFSET3D(u,3,0,-2)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,-2,0,-3),kadd(KRANC_GFOFFSET3D(u,2,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-2),KRANC_GFOFFSET3D(u,3,0,2)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,-3,0,3),KRANC_GFOFFSET3D(u,3,0,-3)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,-3,0,-3),KRANC_GFOFFSET3D(u,3,0,3)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,-1,0,4),kadd(KRANC_GFOFFSET3D(u,1,0,-4),kadd(KRANC_GFOFFSET3D(u,-4,0,1),KRANC_GFOFFSET3D(u,4,0,-1)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,-1,0,-4),kadd(KRANC_GFOFFSET3D(u,1,0,4),kadd(KRANC_GFOFFSET3D(u,-4,0,-1),KRANC_GFOFFSET3D(u,4,0,1)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,-2,0,4),kadd(KRANC_GFOFFSET3D(u,2,0,-4),kadd(KRANC_GFOFFSET3D(u,-4,0,2),KRANC_GFOFFSET3D(u,4,0,-2)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,-2,0,-4),kadd(KRANC_GFOFFSET3D(u,2,0,4),kadd(KRANC_GFOFFSET3D(u,-4,0,-2),KRANC_GFOFFSET3D(u,4,0,2)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,-3,0,4),kadd(KRANC_GFOFFSET3D(u,3,0,-4),kadd(KRANC_GFOFFSET3D(u,-4,0,3),KRANC_GFOFFSET3D(u,4,0,-3)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,-3,0,-4),kadd(KRANC_GFOFFSET3D(u,3,0,4),kadd(KRANC_GFOFFSET3D(u,-4,0,-3),KRANC_GFOFFSET3D(u,4,0,3)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,0,4),KRANC_GFOFFSET3D(u,4,0,-4)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-4,0,-4),KRANC_GFOFFSET3D(u,4,0,4))))))))))))))))))))))))
#else
#  define PDstandardfdOrder813(u) (PDstandardfdOrder813_impl(u,p1o705600dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder813_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder813_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder812_impl(u, p1o705600dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder821(u) (kmul(p1o705600dxdy,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,-1,1,0),KRANC_GFOFFSET3D(u,1,-1,0)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,-1,-1,0),KRANC_GFOFFSET3D(u,1,1,0)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,-1,2,0),kadd(KRANC_GFOFFSET3D(u,1,-2,0),kadd(KRANC_GFOFFSET3D(u,-2,1,0),KRANC_GFOFFSET3D(u,2,-1,0)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,-1,-2,0),kadd(KRANC_GFOFFSET3D(u,1,2,0),kadd(KRANC_GFOFFSET3D(u,-2,-1,0),KRANC_GFOFFSET3D(u,2,1,0)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,-2,2,0),KRANC_GFOFFSET3D(u,2,-2,0)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,-2,-2,0),KRANC_GFOFFSET3D(u,2,2,0)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,-1,3,0),kadd(KRANC_GFOFFSET3D(u,1,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,1,0),KRANC_GFOFFSET3D(u,3,-1,0)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,-1,-3,0),kadd(KRANC_GFOFFSET3D(u,1,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-1,0),KRANC_GFOFFSET3D(u,3,1,0)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,-2,3,0),kadd(KRANC_GFOFFSET3D(u,2,-3,0),kadd(KRANC_GFOFFSET3D(u,-3,2,0),KRANC_GFOFFSET3D(u,3,-2,0)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,-2,-3,0),kadd(KRANC_GFOFFSET3D(u,2,3,0),kadd(KRANC_GFOFFSET3D(u,-3,-2,0),KRANC_GFOFFSET3D(u,3,2,0)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,-3,3,0),KRANC_GFOFFSET3D(u,3,-3,0)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,-3,-3,0),KRANC_GFOFFSET3D(u,3,3,0)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,-1,4,0),kadd(KRANC_GFOFFSET3D(u,1,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,1,0),KRANC_GFOFFSET3D(u,4,-1,0)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,-1,-4,0),kadd(KRANC_GFOFFSET3D(u,1,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-1,0),KRANC_GFOFFSET3D(u,4,1,0)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,-2,4,0),kadd(KRANC_GFOFFSET3D(u,2,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,2,0),KRANC_GFOFFSET3D(u,4,-2,0)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,-2,-4,0),kadd(KRANC_GFOFFSET3D(u,2,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-2,0),KRANC_GFOFFSET3D(u,4,2,0)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,-3,4,0),kadd(KRANC_GFOFFSET3D(u,3,-4,0),kadd(KRANC_GFOFFSET3D(u,-4,3,0),KRANC_GFOFFSET3D(u,4,-3,0)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,-3,-4,0),kadd(KRANC_GFOFFSET3D(u,3,4,0),kadd(KRANC_GFOFFSET3D(u,-4,-3,0),KRANC_GFOFFSET3D(u,4,3,0)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,4,0),KRANC_GFOFFSET3D(u,4,-4,0)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-4,-4,0),KRANC_GFOFFSET3D(u,4,4,0))))))))))))))))))))))))
#else
#  define PDstandardfdOrder821(u) (PDstandardfdOrder821_impl(u,p1o705600dxdy,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder821_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder821_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdy, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder812_impl(u, p1o705600dxdy, cdj, cdk);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder823(u) (kmul(p1o705600dydz,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,0,-2,2),KRANC_GFOFFSET3D(u,0,2,-2)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),KRANC_GFOFFSET3D(u,0,2,2)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,0,-1,3),kadd(KRANC_GFOFFSET3D(u,0,1,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,1),KRANC_GFOFFSET3D(u,0,3,-1)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,0,-1,-3),kadd(KRANC_GFOFFSET3D(u,0,1,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-1),KRANC_GFOFFSET3D(u,0,3,1)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,0,-2,3),kadd(KRANC_GFOFFSET3D(u,0,2,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,2),KRANC_GFOFFSET3D(u,0,3,-2)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,0,-2,-3),kadd(KRANC_GFOFFSET3D(u,0,2,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-2),KRANC_GFOFFSET3D(u,0,3,2)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,0,-3,3),KRANC_GFOFFSET3D(u,0,3,-3)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,0,-3,-3),KRANC_GFOFFSET3D(u,0,3,3)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,0,-1,4),kadd(KRANC_GFOFFSET3D(u,0,1,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,1),KRANC_GFOFFSET3D(u,0,4,-1)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,0,-1,-4),kadd(KRANC_GFOFFSET3D(u,0,1,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-1),KRANC_GFOFFSET3D(u,0,4,1)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,0,-2,4),kadd(KRANC_GFOFFSET3D(u,0,2,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,2),KRANC_GFOFFSET3D(u,0,4,-2)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,0,-2,-4),kadd(KRANC_GFOFFSET3D(u,0,2,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-2),KRANC_GFOFFSET3D(u,0,4,2)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,0,-3,4),kadd(KRANC_GFOFFSET3D(u,0,3,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,3),KRANC_GFOFFSET3D(u,0,4,-3)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,0,-3,-4),kadd(KRANC_GFOFFSET3D(u,0,3,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-3),KRANC_GFOFFSET3D(u,0,4,3)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-4,4),KRANC_GFOFFSET3D(u,0,4,-4)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,0,-4,-4),KRANC_GFOFFSET3D(u,0,4,4))))))))))))))))))))))))
#else
#  define PDstandardfdOrder823(u) (PDstandardfdOrder823_impl(u,p1o705600dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder823_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder823_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return kmul(p1o705600dydz,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,0,-2,2),KRANC_GFOFFSET3D(u,0,2,-2)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),KRANC_GFOFFSET3D(u,0,2,2)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,0,-1,3),kadd(KRANC_GFOFFSET3D(u,0,1,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,1),KRANC_GFOFFSET3D(u,0,3,-1)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,0,-1,-3),kadd(KRANC_GFOFFSET3D(u,0,1,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-1),KRANC_GFOFFSET3D(u,0,3,1)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,0,-2,3),kadd(KRANC_GFOFFSET3D(u,0,2,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,2),KRANC_GFOFFSET3D(u,0,3,-2)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,0,-2,-3),kadd(KRANC_GFOFFSET3D(u,0,2,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-2),KRANC_GFOFFSET3D(u,0,3,2)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,0,-3,3),KRANC_GFOFFSET3D(u,0,3,-3)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,0,-3,-3),KRANC_GFOFFSET3D(u,0,3,3)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,0,-1,4),kadd(KRANC_GFOFFSET3D(u,0,1,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,1),KRANC_GFOFFSET3D(u,0,4,-1)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,0,-1,-4),kadd(KRANC_GFOFFSET3D(u,0,1,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-1),KRANC_GFOFFSET3D(u,0,4,1)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,0,-2,4),kadd(KRANC_GFOFFSET3D(u,0,2,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,2),KRANC_GFOFFSET3D(u,0,4,-2)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,0,-2,-4),kadd(KRANC_GFOFFSET3D(u,0,2,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-2),KRANC_GFOFFSET3D(u,0,4,2)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,0,-3,4),kadd(KRANC_GFOFFSET3D(u,0,3,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,3),KRANC_GFOFFSET3D(u,0,4,-3)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,0,-3,-4),kadd(KRANC_GFOFFSET3D(u,0,3,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-3),KRANC_GFOFFSET3D(u,0,4,3)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-4,4),KRANC_GFOFFSET3D(u,0,4,-4)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,0,-4,-4),KRANC_GFOFFSET3D(u,0,4,4)))))))))))))))))))))));
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder831(u) (kmul(p1o705600dxdz,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,-1,0,1),KRANC_GFOFFSET3D(u,1,0,-1)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,-1,0,-1),KRANC_GFOFFSET3D(u,1,0,1)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,-1,0,2),kadd(KRANC_GFOFFSET3D(u,1,0,-2),kadd(KRANC_GFOFFSET3D(u,-2,0,1),KRANC_GFOFFSET3D(u,2,0,-1)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,-1,0,-2),kadd(KRANC_GFOFFSET3D(u,1,0,2),kadd(KRANC_GFOFFSET3D(u,-2,0,-1),KRANC_GFOFFSET3D(u,2,0,1)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,-2,0,2),KRANC_GFOFFSET3D(u,2,0,-2)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,-2,0,-2),KRANC_GFOFFSET3D(u,2,0,2)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,-1,0,3),kadd(KRANC_GFOFFSET3D(u,1,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,1),KRANC_GFOFFSET3D(u,3,0,-1)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,-1,0,-3),kadd(KRANC_GFOFFSET3D(u,1,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-1),KRANC_GFOFFSET3D(u,3,0,1)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,-2,0,3),kadd(KRANC_GFOFFSET3D(u,2,0,-3),kadd(KRANC_GFOFFSET3D(u,-3,0,2),KRANC_GFOFFSET3D(u,3,0,-2)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,-2,0,-3),kadd(KRANC_GFOFFSET3D(u,2,0,3),kadd(KRANC_GFOFFSET3D(u,-3,0,-2),KRANC_GFOFFSET3D(u,3,0,2)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,-3,0,3),KRANC_GFOFFSET3D(u,3,0,-3)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,-3,0,-3),KRANC_GFOFFSET3D(u,3,0,3)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,-1,0,4),kadd(KRANC_GFOFFSET3D(u,1,0,-4),kadd(KRANC_GFOFFSET3D(u,-4,0,1),KRANC_GFOFFSET3D(u,4,0,-1)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,-1,0,-4),kadd(KRANC_GFOFFSET3D(u,1,0,4),kadd(KRANC_GFOFFSET3D(u,-4,0,-1),KRANC_GFOFFSET3D(u,4,0,1)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,-2,0,4),kadd(KRANC_GFOFFSET3D(u,2,0,-4),kadd(KRANC_GFOFFSET3D(u,-4,0,2),KRANC_GFOFFSET3D(u,4,0,-2)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,-2,0,-4),kadd(KRANC_GFOFFSET3D(u,2,0,4),kadd(KRANC_GFOFFSET3D(u,-4,0,-2),KRANC_GFOFFSET3D(u,4,0,2)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,-3,0,4),kadd(KRANC_GFOFFSET3D(u,3,0,-4),kadd(KRANC_GFOFFSET3D(u,-4,0,3),KRANC_GFOFFSET3D(u,4,0,-3)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,-3,0,-4),kadd(KRANC_GFOFFSET3D(u,3,0,4),kadd(KRANC_GFOFFSET3D(u,-4,0,-3),KRANC_GFOFFSET3D(u,4,0,3)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,-4,0,4),KRANC_GFOFFSET3D(u,4,0,-4)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,-4,0,-4),KRANC_GFOFFSET3D(u,4,0,4))))))))))))))))))))))))
#else
#  define PDstandardfdOrder831(u) (PDstandardfdOrder831_impl(u,p1o705600dxdz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder831_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder831_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dxdz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder812_impl(u, p1o705600dxdz, cdk, cdj);
}
#endif

#ifndef KRANC_DIFF_FUNCTIONS
#  define PDstandardfdOrder832(u) (kmul(p1o705600dydz,kmadd(ToReal(-451584),kadd(KRANC_GFOFFSET3D(u,0,-1,1),KRANC_GFOFFSET3D(u,0,1,-1)),kmadd(ToReal(451584),kadd(KRANC_GFOFFSET3D(u,0,-1,-1),KRANC_GFOFFSET3D(u,0,1,1)),kmadd(ToReal(112896),kadd(KRANC_GFOFFSET3D(u,0,-1,2),kadd(KRANC_GFOFFSET3D(u,0,1,-2),kadd(KRANC_GFOFFSET3D(u,0,-2,1),KRANC_GFOFFSET3D(u,0,2,-1)))),kmadd(ToReal(-112896),kadd(KRANC_GFOFFSET3D(u,0,-1,-2),kadd(KRANC_GFOFFSET3D(u,0,1,2),kadd(KRANC_GFOFFSET3D(u,0,-2,-1),KRANC_GFOFFSET3D(u,0,2,1)))),kmadd(ToReal(-28224),kadd(KRANC_GFOFFSET3D(u,0,-2,2),KRANC_GFOFFSET3D(u,0,2,-2)),kmadd(ToReal(28224),kadd(KRANC_GFOFFSET3D(u,0,-2,-2),KRANC_GFOFFSET3D(u,0,2,2)),kmadd(ToReal(-21504),kadd(KRANC_GFOFFSET3D(u,0,-1,3),kadd(KRANC_GFOFFSET3D(u,0,1,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,1),KRANC_GFOFFSET3D(u,0,3,-1)))),kmadd(ToReal(21504),kadd(KRANC_GFOFFSET3D(u,0,-1,-3),kadd(KRANC_GFOFFSET3D(u,0,1,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-1),KRANC_GFOFFSET3D(u,0,3,1)))),kmadd(ToReal(5376),kadd(KRANC_GFOFFSET3D(u,0,-2,3),kadd(KRANC_GFOFFSET3D(u,0,2,-3),kadd(KRANC_GFOFFSET3D(u,0,-3,2),KRANC_GFOFFSET3D(u,0,3,-2)))),kmadd(ToReal(-5376),kadd(KRANC_GFOFFSET3D(u,0,-2,-3),kadd(KRANC_GFOFFSET3D(u,0,2,3),kadd(KRANC_GFOFFSET3D(u,0,-3,-2),KRANC_GFOFFSET3D(u,0,3,2)))),kmadd(ToReal(-1024),kadd(KRANC_GFOFFSET3D(u,0,-3,3),KRANC_GFOFFSET3D(u,0,3,-3)),kmadd(ToReal(1024),kadd(KRANC_GFOFFSET3D(u,0,-3,-3),KRANC_GFOFFSET3D(u,0,3,3)),kmadd(ToReal(2016),kadd(KRANC_GFOFFSET3D(u,0,-1,4),kadd(KRANC_GFOFFSET3D(u,0,1,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,1),KRANC_GFOFFSET3D(u,0,4,-1)))),kmadd(ToReal(-2016),kadd(KRANC_GFOFFSET3D(u,0,-1,-4),kadd(KRANC_GFOFFSET3D(u,0,1,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-1),KRANC_GFOFFSET3D(u,0,4,1)))),kmadd(ToReal(-504),kadd(KRANC_GFOFFSET3D(u,0,-2,4),kadd(KRANC_GFOFFSET3D(u,0,2,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,2),KRANC_GFOFFSET3D(u,0,4,-2)))),kmadd(ToReal(504),kadd(KRANC_GFOFFSET3D(u,0,-2,-4),kadd(KRANC_GFOFFSET3D(u,0,2,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-2),KRANC_GFOFFSET3D(u,0,4,2)))),kmadd(ToReal(96),kadd(KRANC_GFOFFSET3D(u,0,-3,4),kadd(KRANC_GFOFFSET3D(u,0,3,-4),kadd(KRANC_GFOFFSET3D(u,0,-4,3),KRANC_GFOFFSET3D(u,0,4,-3)))),kmadd(ToReal(-96),kadd(KRANC_GFOFFSET3D(u,0,-3,-4),kadd(KRANC_GFOFFSET3D(u,0,3,4),kadd(KRANC_GFOFFSET3D(u,0,-4,-3),KRANC_GFOFFSET3D(u,0,4,3)))),kmadd(ToReal(-9),kadd(KRANC_GFOFFSET3D(u,0,-4,4),KRANC_GFOFFSET3D(u,0,4,-4)),kmul(ToReal(9),kadd(KRANC_GFOFFSET3D(u,0,-4,-4),KRANC_GFOFFSET3D(u,0,4,4))))))))))))))))))))))))
#else
#  define PDstandardfdOrder832(u) (PDstandardfdOrder832_impl(u,p1o705600dydz,cdj,cdk))
static CCTK_REAL_VEC PDstandardfdOrder832_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk) CCTK_ATTRIBUTE_NOINLINE CCTK_ATTRIBUTE_UNUSED;
static CCTK_REAL_VEC PDstandardfdOrder832_impl(const CCTK_REAL* restrict const u, const CCTK_REAL_VEC p1o705600dydz, const ptrdiff_t cdj, const ptrdiff_t cdk)
{
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL);
  return PDstandardfdOrder823_impl(u, p1o705600dydz, cdj, cdk);
}
#endif


```

WeylScal4_psis_calc_Nth.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {

extern "C" void WeylScal4_psis_calc_Nth_SelectBCs(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (cctk_iteration % WeylScal4_psis_calc_Nth_calc_every != WeylScal4_psis_calc_Nth_calc_offset)
    return;
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi0i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi0i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi0r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi0r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi1i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi1i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi1r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi1r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi2i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi2i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi2r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi2r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi3i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi3i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi3r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi3r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4r_group.");
  return;
}

static void WeylScal4_psis_calc_Nth_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_psis_calc_Nth,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC gxxL CCTK_ATTRIBUTE_UNUSED = vec_load(gxx[index]);
    CCTK_REAL_VEC gxyL CCTK_ATTRIBUTE_UNUSED = vec_load(gxy[index]);
    CCTK_REAL_VEC gxzL CCTK_ATTRIBUTE_UNUSED = vec_load(gxz[index]);
    CCTK_REAL_VEC gyyL CCTK_ATTRIBUTE_UNUSED = vec_load(gyy[index]);
    CCTK_REAL_VEC gyzL CCTK_ATTRIBUTE_UNUSED = vec_load(gyz[index]);
    CCTK_REAL_VEC gzzL CCTK_ATTRIBUTE_UNUSED = vec_load(gzz[index]);
    CCTK_REAL_VEC kxxL CCTK_ATTRIBUTE_UNUSED = vec_load(kxx[index]);
    CCTK_REAL_VEC kxyL CCTK_ATTRIBUTE_UNUSED = vec_load(kxy[index]);
    CCTK_REAL_VEC kxzL CCTK_ATTRIBUTE_UNUSED = vec_load(kxz[index]);
    CCTK_REAL_VEC kyyL CCTK_ATTRIBUTE_UNUSED = vec_load(kyy[index]);
    CCTK_REAL_VEC kyzL CCTK_ATTRIBUTE_UNUSED = vec_load(kyz[index]);
    CCTK_REAL_VEC kzzL CCTK_ATTRIBUTE_UNUSED = vec_load(kzz[index]);
    CCTK_REAL_VEC xL CCTK_ATTRIBUTE_UNUSED = vec_load(x[index]);
    CCTK_REAL_VEC yL CCTK_ATTRIBUTE_UNUSED = vec_load(y[index]);
    CCTK_REAL_VEC zL CCTK_ATTRIBUTE_UNUSED = vec_load(z[index]);
    
    
    CCTK_REAL_VEC dJ111L, dJ112L, dJ113L, dJ122L, dJ123L, dJ133L, dJ211L, dJ212L, dJ213L, dJ222L, dJ223L, dJ233L, dJ311L, dJ312L, dJ313L, dJ322L, dJ323L, dJ333L, J11L, J12L, J13L, J21L, J22L, J23L, J31L, J32L, J33L CCTK_ATTRIBUTE_UNUSED ;
    
    if (usejacobian)
    {
      dJ111L = vec_load(dJ111[index]);
      dJ112L = vec_load(dJ112[index]);
      dJ113L = vec_load(dJ113[index]);
      dJ122L = vec_load(dJ122[index]);
      dJ123L = vec_load(dJ123[index]);
      dJ133L = vec_load(dJ133[index]);
      dJ211L = vec_load(dJ211[index]);
      dJ212L = vec_load(dJ212[index]);
      dJ213L = vec_load(dJ213[index]);
      dJ222L = vec_load(dJ222[index]);
      dJ223L = vec_load(dJ223[index]);
      dJ233L = vec_load(dJ233[index]);
      dJ311L = vec_load(dJ311[index]);
      dJ312L = vec_load(dJ312[index]);
      dJ313L = vec_load(dJ313[index]);
      dJ322L = vec_load(dJ322[index]);
      dJ323L = vec_load(dJ323[index]);
      dJ333L = vec_load(dJ333[index]);
      J11L = vec_load(J11[index]);
      J12L = vec_load(J12[index]);
      J13L = vec_load(J13[index]);
      J21L = vec_load(J21[index]);
      J22L = vec_load(J22[index]);
      J23L = vec_load(J23[index]);
      J31L = vec_load(J31[index]);
      J32L = vec_load(J32[index]);
      J33L = vec_load(J33[index]);
    }
    /* Include user supplied include files */
    /* Precompute derivatives */
    CCTK_REAL_VEC PDstandard1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kzz CCTK_ATTRIBUTE_UNUSED;
    
    switch (fdOrder)
    {
      case 2:
      {
        PDstandard1gxx = PDstandardfdOrder21(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder22(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder23(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder211(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder222(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder233(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder212(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder213(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder223(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder21(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder22(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder23(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder211(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder222(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder233(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder212(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder213(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder223(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder21(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder22(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder23(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder211(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder222(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder233(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder212(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder213(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder223(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder21(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder22(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder23(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder211(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder222(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder233(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder212(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder213(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder223(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder21(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder22(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder23(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder211(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder222(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder233(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder212(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder213(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder223(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder21(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder22(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder23(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder211(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder222(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder233(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder212(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder213(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder223(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder21(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder22(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder23(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder21(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder22(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder23(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder21(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder22(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder23(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder21(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder22(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder23(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder21(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder22(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder23(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder21(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder22(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder23(&kzz[index]);
        break;
      }
      
      case 4:
      {
        PDstandard1gxx = PDstandardfdOrder41(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder42(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder43(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder411(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder422(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder433(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder412(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder413(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder423(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder41(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder42(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder43(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder411(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder422(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder433(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder412(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder413(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder423(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder41(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder42(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder43(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder411(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder422(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder433(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder412(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder413(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder423(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder41(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder42(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder43(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder411(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder422(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder433(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder412(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder413(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder423(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder41(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder42(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder43(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder411(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder422(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder433(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder412(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder413(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder423(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder41(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder42(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder43(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder411(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder422(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder433(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder412(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder413(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder423(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder41(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder42(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder43(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder41(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder42(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder43(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder41(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder42(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder43(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder41(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder42(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder43(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder41(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder42(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder43(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder41(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder42(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder43(&kzz[index]);
        break;
      }
      
      case 6:
      {
        PDstandard1gxx = PDstandardfdOrder61(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder62(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder63(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder611(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder622(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder633(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder612(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder613(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder623(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder61(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder62(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder63(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder611(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder622(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder633(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder612(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder613(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder623(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder61(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder62(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder63(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder611(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder622(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder633(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder612(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder613(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder623(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder61(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder62(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder63(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder611(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder622(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder633(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder612(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder613(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder623(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder61(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder62(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder63(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder611(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder622(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder633(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder612(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder613(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder623(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder61(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder62(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder63(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder611(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder622(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder633(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder612(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder613(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder623(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder61(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder62(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder63(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder61(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder62(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder63(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder61(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder62(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder63(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder61(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder62(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder63(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder61(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder62(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder63(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder61(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder62(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder63(&kzz[index]);
        break;
      }
      
      case 8:
      {
        PDstandard1gxx = PDstandardfdOrder81(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder82(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder83(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder811(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder822(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder833(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder812(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder813(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder823(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder81(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder82(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder83(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder811(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder822(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder833(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder812(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder813(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder823(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder81(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder82(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder83(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder811(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder822(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder833(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder812(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder813(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder823(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder81(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder82(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder83(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder811(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder822(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder833(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder812(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder813(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder823(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder81(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder82(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder83(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder811(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder822(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder833(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder812(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder813(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder823(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder81(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder82(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder83(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder811(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder822(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder833(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder812(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder813(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder823(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder81(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder82(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder83(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder81(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder82(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder83(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder81(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder82(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder83(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder81(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder82(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder83(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder81(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder82(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder83(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder81(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder82(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder83(&kzz[index]);
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC JacPDstandard11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard21gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard32gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kyz CCTK_ATTRIBUTE_UNUSED;
    
    if (usejacobian)
    {
      JacPDstandard1gxx = 
        kmadd(J11L,PDstandard1gxx,kmadd(J21L,PDstandard2gxx,kmul(J31L,PDstandard3gxx)));
      
      JacPDstandard1gxy = 
        kmadd(J11L,PDstandard1gxy,kmadd(J21L,PDstandard2gxy,kmul(J31L,PDstandard3gxy)));
      
      JacPDstandard1gxz = 
        kmadd(J11L,PDstandard1gxz,kmadd(J21L,PDstandard2gxz,kmul(J31L,PDstandard3gxz)));
      
      JacPDstandard1gyy = 
        kmadd(J11L,PDstandard1gyy,kmadd(J21L,PDstandard2gyy,kmul(J31L,PDstandard3gyy)));
      
      JacPDstandard1gyz = 
        kmadd(J11L,PDstandard1gyz,kmadd(J21L,PDstandard2gyz,kmul(J31L,PDstandard3gyz)));
      
      JacPDstandard1gzz = 
        kmadd(J11L,PDstandard1gzz,kmadd(J21L,PDstandard2gzz,kmul(J31L,PDstandard3gzz)));
      
      JacPDstandard1kxy = 
        kmadd(J11L,PDstandard1kxy,kmadd(J21L,PDstandard2kxy,kmul(J31L,PDstandard3kxy)));
      
      JacPDstandard1kxz = 
        kmadd(J11L,PDstandard1kxz,kmadd(J21L,PDstandard2kxz,kmul(J31L,PDstandard3kxz)));
      
      JacPDstandard1kyy = 
        kmadd(J11L,PDstandard1kyy,kmadd(J21L,PDstandard2kyy,kmul(J31L,PDstandard3kyy)));
      
      JacPDstandard1kyz = 
        kmadd(J11L,PDstandard1kyz,kmadd(J21L,PDstandard2kyz,kmul(J31L,PDstandard3kyz)));
      
      JacPDstandard1kzz = 
        kmadd(J11L,PDstandard1kzz,kmadd(J21L,PDstandard2kzz,kmul(J31L,PDstandard3kzz)));
      
      JacPDstandard2gxx = 
        kmadd(J12L,PDstandard1gxx,kmadd(J22L,PDstandard2gxx,kmul(J32L,PDstandard3gxx)));
      
      JacPDstandard2gxy = 
        kmadd(J12L,PDstandard1gxy,kmadd(J22L,PDstandard2gxy,kmul(J32L,PDstandard3gxy)));
      
      JacPDstandard2gxz = 
        kmadd(J12L,PDstandard1gxz,kmadd(J22L,PDstandard2gxz,kmul(J32L,PDstandard3gxz)));
      
      JacPDstandard2gyy = 
        kmadd(J12L,PDstandard1gyy,kmadd(J22L,PDstandard2gyy,kmul(J32L,PDstandard3gyy)));
      
      JacPDstandard2gyz = 
        kmadd(J12L,PDstandard1gyz,kmadd(J22L,PDstandard2gyz,kmul(J32L,PDstandard3gyz)));
      
      JacPDstandard2gzz = 
        kmadd(J12L,PDstandard1gzz,kmadd(J22L,PDstandard2gzz,kmul(J32L,PDstandard3gzz)));
      
      JacPDstandard2kxx = 
        kmadd(J12L,PDstandard1kxx,kmadd(J22L,PDstandard2kxx,kmul(J32L,PDstandard3kxx)));
      
      JacPDstandard2kxy = 
        kmadd(J12L,PDstandard1kxy,kmadd(J22L,PDstandard2kxy,kmul(J32L,PDstandard3kxy)));
      
      JacPDstandard2kxz = 
        kmadd(J12L,PDstandard1kxz,kmadd(J22L,PDstandard2kxz,kmul(J32L,PDstandard3kxz)));
      
      JacPDstandard2kyz = 
        kmadd(J12L,PDstandard1kyz,kmadd(J22L,PDstandard2kyz,kmul(J32L,PDstandard3kyz)));
      
      JacPDstandard2kzz = 
        kmadd(J12L,PDstandard1kzz,kmadd(J22L,PDstandard2kzz,kmul(J32L,PDstandard3kzz)));
      
      JacPDstandard3gxx = 
        kmadd(J13L,PDstandard1gxx,kmadd(J23L,PDstandard2gxx,kmul(J33L,PDstandard3gxx)));
      
      JacPDstandard3gxy = 
        kmadd(J13L,PDstandard1gxy,kmadd(J23L,PDstandard2gxy,kmul(J33L,PDstandard3gxy)));
      
      JacPDstandard3gxz = 
        kmadd(J13L,PDstandard1gxz,kmadd(J23L,PDstandard2gxz,kmul(J33L,PDstandard3gxz)));
      
      JacPDstandard3gyy = 
        kmadd(J13L,PDstandard1gyy,kmadd(J23L,PDstandard2gyy,kmul(J33L,PDstandard3gyy)));
      
      JacPDstandard3gyz = 
        kmadd(J13L,PDstandard1gyz,kmadd(J23L,PDstandard2gyz,kmul(J33L,PDstandard3gyz)));
      
      JacPDstandard3gzz = 
        kmadd(J13L,PDstandard1gzz,kmadd(J23L,PDstandard2gzz,kmul(J33L,PDstandard3gzz)));
      
      JacPDstandard3kxx = 
        kmadd(J13L,PDstandard1kxx,kmadd(J23L,PDstandard2kxx,kmul(J33L,PDstandard3kxx)));
      
      JacPDstandard3kxy = 
        kmadd(J13L,PDstandard1kxy,kmadd(J23L,PDstandard2kxy,kmul(J33L,PDstandard3kxy)));
      
      JacPDstandard3kxz = 
        kmadd(J13L,PDstandard1kxz,kmadd(J23L,PDstandard2kxz,kmul(J33L,PDstandard3kxz)));
      
      JacPDstandard3kyy = 
        kmadd(J13L,PDstandard1kyy,kmadd(J23L,PDstandard2kyy,kmul(J33L,PDstandard3kyy)));
      
      JacPDstandard3kyz = 
        kmadd(J13L,PDstandard1kyz,kmadd(J23L,PDstandard2kyz,kmul(J33L,PDstandard3kyz)));
      
      JacPDstandard11gyy = 
        kmadd(dJ111L,PDstandard1gyy,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard12gyy,kmul(J31L,PDstandard13gyy)),kmul(J21L,kmul(J31L,PDstandard23gyy))),kmadd(dJ211L,PDstandard2gyy,kmadd(dJ311L,PDstandard3gyy,kmadd(PDstandard11gyy,kmul(J11L,J11L),kmadd(PDstandard22gyy,kmul(J21L,J21L),kmul(PDstandard33gyy,kmul(J31L,J31L))))))));
      
      JacPDstandard11gyz = 
        kmadd(dJ111L,PDstandard1gyz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard12gyz,kmul(J31L,PDstandard13gyz)),kmul(J21L,kmul(J31L,PDstandard23gyz))),kmadd(dJ211L,PDstandard2gyz,kmadd(dJ311L,PDstandard3gyz,kmadd(PDstandard11gyz,kmul(J11L,J11L),kmadd(PDstandard22gyz,kmul(J21L,J21L),kmul(PDstandard33gyz,kmul(J31L,J31L))))))));
      
      JacPDstandard11gzz = 
        kmadd(dJ111L,PDstandard1gzz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard12gzz,kmul(J31L,PDstandard13gzz)),kmul(J21L,kmul(J31L,PDstandard23gzz))),kmadd(dJ211L,PDstandard2gzz,kmadd(dJ311L,PDstandard3gzz,kmadd(PDstandard11gzz,kmul(J11L,J11L),kmadd(PDstandard22gzz,kmul(J21L,J21L),kmul(PDstandard33gzz,kmul(J31L,J31L))))))));
      
      JacPDstandard22gxx = 
        kmadd(dJ122L,PDstandard1gxx,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard12gxx,kmul(J32L,PDstandard13gxx)),kmul(J22L,kmul(J32L,PDstandard23gxx))),kmadd(dJ222L,PDstandard2gxx,kmadd(dJ322L,PDstandard3gxx,kmadd(PDstandard11gxx,kmul(J12L,J12L),kmadd(PDstandard22gxx,kmul(J22L,J22L),kmul(PDstandard33gxx,kmul(J32L,J32L))))))));
      
      JacPDstandard22gxz = 
        kmadd(dJ122L,PDstandard1gxz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard12gxz,kmul(J32L,PDstandard13gxz)),kmul(J22L,kmul(J32L,PDstandard23gxz))),kmadd(dJ222L,PDstandard2gxz,kmadd(dJ322L,PDstandard3gxz,kmadd(PDstandard11gxz,kmul(J12L,J12L),kmadd(PDstandard22gxz,kmul(J22L,J22L),kmul(PDstandard33gxz,kmul(J32L,J32L))))))));
      
      JacPDstandard22gzz = 
        kmadd(dJ122L,PDstandard1gzz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard12gzz,kmul(J32L,PDstandard13gzz)),kmul(J22L,kmul(J32L,PDstandard23gzz))),kmadd(dJ222L,PDstandard2gzz,kmadd(dJ322L,PDstandard3gzz,kmadd(PDstandard11gzz,kmul(J12L,J12L),kmadd(PDstandard22gzz,kmul(J22L,J22L),kmul(PDstandard33gzz,kmul(J32L,J32L))))))));
      
      JacPDstandard33gxx = 
        kmadd(dJ133L,PDstandard1gxx,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard12gxx,kmul(J33L,PDstandard13gxx)),kmul(J23L,kmul(J33L,PDstandard23gxx))),kmadd(dJ233L,PDstandard2gxx,kmadd(dJ333L,PDstandard3gxx,kmadd(PDstandard11gxx,kmul(J13L,J13L),kmadd(PDstandard22gxx,kmul(J23L,J23L),kmul(PDstandard33gxx,kmul(J33L,J33L))))))));
      
      JacPDstandard33gxy = 
        kmadd(dJ133L,PDstandard1gxy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard12gxy,kmul(J33L,PDstandard13gxy)),kmul(J23L,kmul(J33L,PDstandard23gxy))),kmadd(dJ233L,PDstandard2gxy,kmadd(dJ333L,PDstandard3gxy,kmadd(PDstandard11gxy,kmul(J13L,J13L),kmadd(PDstandard22gxy,kmul(J23L,J23L),kmul(PDstandard33gxy,kmul(J33L,J33L))))))));
      
      JacPDstandard33gyy = 
        kmadd(dJ133L,PDstandard1gyy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard12gyy,kmul(J33L,PDstandard13gyy)),kmul(J23L,kmul(J33L,PDstandard23gyy))),kmadd(dJ233L,PDstandard2gyy,kmadd(dJ333L,PDstandard3gyy,kmadd(PDstandard11gyy,kmul(J13L,J13L),kmadd(PDstandard22gyy,kmul(J23L,J23L),kmul(PDstandard33gyy,kmul(J33L,J33L))))))));
      
      JacPDstandard12gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard11gxy,kmadd(J21L,PDstandard12gxy,kmul(J31L,PDstandard13gxy))),kmadd(J11L,kmadd(J22L,PDstandard12gxy,kmul(J32L,PDstandard13gxy)),kmadd(dJ112L,PDstandard1gxy,kmadd(J22L,kmadd(J21L,PDstandard22gxy,kmul(J31L,PDstandard23gxy)),kmadd(dJ212L,PDstandard2gxy,kmadd(J32L,kmadd(J21L,PDstandard23gxy,kmul(J31L,PDstandard33gxy)),kmul(dJ312L,PDstandard3gxy)))))));
      
      JacPDstandard12gxz = 
        kmadd(J12L,kmadd(J11L,PDstandard11gxz,kmadd(J21L,PDstandard12gxz,kmul(J31L,PDstandard13gxz))),kmadd(J11L,kmadd(J22L,PDstandard12gxz,kmul(J32L,PDstandard13gxz)),kmadd(dJ112L,PDstandard1gxz,kmadd(J22L,kmadd(J21L,PDstandard22gxz,kmul(J31L,PDstandard23gxz)),kmadd(dJ212L,PDstandard2gxz,kmadd(J32L,kmadd(J21L,PDstandard23gxz,kmul(J31L,PDstandard33gxz)),kmul(dJ312L,PDstandard3gxz)))))));
      
      JacPDstandard12gyz = 
        kmadd(J12L,kmadd(J11L,PDstandard11gyz,kmadd(J21L,PDstandard12gyz,kmul(J31L,PDstandard13gyz))),kmadd(J11L,kmadd(J22L,PDstandard12gyz,kmul(J32L,PDstandard13gyz)),kmadd(dJ112L,PDstandard1gyz,kmadd(J22L,kmadd(J21L,PDstandard22gyz,kmul(J31L,PDstandard23gyz)),kmadd(dJ212L,PDstandard2gyz,kmadd(J32L,kmadd(J21L,PDstandard23gyz,kmul(J31L,PDstandard33gyz)),kmul(dJ312L,PDstandard3gyz)))))));
      
      JacPDstandard12gzz = 
        kmadd(J12L,kmadd(J11L,PDstandard11gzz,kmadd(J21L,PDstandard12gzz,kmul(J31L,PDstandard13gzz))),kmadd(J11L,kmadd(J22L,PDstandard12gzz,kmul(J32L,PDstandard13gzz)),kmadd(dJ112L,PDstandard1gzz,kmadd(J22L,kmadd(J21L,PDstandard22gzz,kmul(J31L,PDstandard23gzz)),kmadd(dJ212L,PDstandard2gzz,kmadd(J32L,kmadd(J21L,PDstandard23gzz,kmul(J31L,PDstandard33gzz)),kmul(dJ312L,PDstandard3gzz)))))));
      
      JacPDstandard13gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard11gxz,kmadd(J21L,PDstandard12gxz,kmul(J31L,PDstandard13gxz))),kmadd(J11L,kmadd(J23L,PDstandard12gxz,kmul(J33L,PDstandard13gxz)),kmadd(dJ113L,PDstandard1gxz,kmadd(J23L,kmadd(J21L,PDstandard22gxz,kmul(J31L,PDstandard23gxz)),kmadd(dJ213L,PDstandard2gxz,kmadd(J33L,kmadd(J21L,PDstandard23gxz,kmul(J31L,PDstandard33gxz)),kmul(dJ313L,PDstandard3gxz)))))));
      
      JacPDstandard21gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard11gxy,kmadd(J21L,PDstandard12gxy,kmul(J31L,PDstandard13gxy))),kmadd(J11L,kmadd(J22L,PDstandard12gxy,kmul(J32L,PDstandard13gxy)),kmadd(dJ112L,PDstandard1gxy,kmadd(J22L,kmadd(J21L,PDstandard22gxy,kmul(J31L,PDstandard23gxy)),kmadd(dJ212L,PDstandard2gxy,kmadd(J32L,kmadd(J21L,PDstandard23gxy,kmul(J31L,PDstandard33gxy)),kmul(dJ312L,PDstandard3gxy)))))));
      
      JacPDstandard23gxx = 
        kmadd(J13L,kmadd(J12L,PDstandard11gxx,kmadd(J22L,PDstandard12gxx,kmul(J32L,PDstandard13gxx))),kmadd(J12L,kmadd(J23L,PDstandard12gxx,kmul(J33L,PDstandard13gxx)),kmadd(dJ123L,PDstandard1gxx,kmadd(J23L,kmadd(J22L,PDstandard22gxx,kmul(J32L,PDstandard23gxx)),kmadd(dJ223L,PDstandard2gxx,kmadd(J33L,kmadd(J22L,PDstandard23gxx,kmul(J32L,PDstandard33gxx)),kmul(dJ323L,PDstandard3gxx)))))));
      
      JacPDstandard23gxy = 
        kmadd(J13L,kmadd(J12L,PDstandard11gxy,kmadd(J22L,PDstandard12gxy,kmul(J32L,PDstandard13gxy))),kmadd(J12L,kmadd(J23L,PDstandard12gxy,kmul(J33L,PDstandard13gxy)),kmadd(dJ123L,PDstandard1gxy,kmadd(J23L,kmadd(J22L,PDstandard22gxy,kmul(J32L,PDstandard23gxy)),kmadd(dJ223L,PDstandard2gxy,kmadd(J33L,kmadd(J22L,PDstandard23gxy,kmul(J32L,PDstandard33gxy)),kmul(dJ323L,PDstandard3gxy)))))));
      
      JacPDstandard23gxz = 
        kmadd(J13L,kmadd(J12L,PDstandard11gxz,kmadd(J22L,PDstandard12gxz,kmul(J32L,PDstandard13gxz))),kmadd(J12L,kmadd(J23L,PDstandard12gxz,kmul(J33L,PDstandard13gxz)),kmadd(dJ123L,PDstandard1gxz,kmadd(J23L,kmadd(J22L,PDstandard22gxz,kmul(J32L,PDstandard23gxz)),kmadd(dJ223L,PDstandard2gxz,kmadd(J33L,kmadd(J22L,PDstandard23gxz,kmul(J32L,PDstandard33gxz)),kmul(dJ323L,PDstandard3gxz)))))));
      
      JacPDstandard23gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard11gyz,kmadd(J22L,PDstandard12gyz,kmul(J32L,PDstandard13gyz))),kmadd(J12L,kmadd(J23L,PDstandard12gyz,kmul(J33L,PDstandard13gyz)),kmadd(dJ123L,PDstandard1gyz,kmadd(J23L,kmadd(J22L,PDstandard22gyz,kmul(J32L,PDstandard23gyz)),kmadd(dJ223L,PDstandard2gyz,kmadd(J33L,kmadd(J22L,PDstandard23gyz,kmul(J32L,PDstandard33gyz)),kmul(dJ323L,PDstandard3gyz)))))));
      
      JacPDstandard31gxy = 
        kmadd(J13L,kmadd(J11L,PDstandard11gxy,kmadd(J21L,PDstandard12gxy,kmul(J31L,PDstandard13gxy))),kmadd(J11L,kmadd(J23L,PDstandard12gxy,kmul(J33L,PDstandard13gxy)),kmadd(dJ113L,PDstandard1gxy,kmadd(J23L,kmadd(J21L,PDstandard22gxy,kmul(J31L,PDstandard23gxy)),kmadd(dJ213L,PDstandard2gxy,kmadd(J33L,kmadd(J21L,PDstandard23gxy,kmul(J31L,PDstandard33gxy)),kmul(dJ313L,PDstandard3gxy)))))));
      
      JacPDstandard31gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard11gxz,kmadd(J21L,PDstandard12gxz,kmul(J31L,PDstandard13gxz))),kmadd(J11L,kmadd(J23L,PDstandard12gxz,kmul(J33L,PDstandard13gxz)),kmadd(dJ113L,PDstandard1gxz,kmadd(J23L,kmadd(J21L,PDstandard22gxz,kmul(J31L,PDstandard23gxz)),kmadd(dJ213L,PDstandard2gxz,kmadd(J33L,kmadd(J21L,PDstandard23gxz,kmul(J31L,PDstandard33gxz)),kmul(dJ313L,PDstandard3gxz)))))));
      
      JacPDstandard31gyy = 
        kmadd(J13L,kmadd(J11L,PDstandard11gyy,kmadd(J21L,PDstandard12gyy,kmul(J31L,PDstandard13gyy))),kmadd(J11L,kmadd(J23L,PDstandard12gyy,kmul(J33L,PDstandard13gyy)),kmadd(dJ113L,PDstandard1gyy,kmadd(J23L,kmadd(J21L,PDstandard22gyy,kmul(J31L,PDstandard23gyy)),kmadd(dJ213L,PDstandard2gyy,kmadd(J33L,kmadd(J21L,PDstandard23gyy,kmul(J31L,PDstandard33gyy)),kmul(dJ313L,PDstandard3gyy)))))));
      
      JacPDstandard31gyz = 
        kmadd(J13L,kmadd(J11L,PDstandard11gyz,kmadd(J21L,PDstandard12gyz,kmul(J31L,PDstandard13gyz))),kmadd(J11L,kmadd(J23L,PDstandard12gyz,kmul(J33L,PDstandard13gyz)),kmadd(dJ113L,PDstandard1gyz,kmadd(J23L,kmadd(J21L,PDstandard22gyz,kmul(J31L,PDstandard23gyz)),kmadd(dJ213L,PDstandard2gyz,kmadd(J33L,kmadd(J21L,PDstandard23gyz,kmul(J31L,PDstandard33gyz)),kmul(dJ313L,PDstandard3gyz)))))));
      
      JacPDstandard32gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard11gyz,kmadd(J22L,PDstandard12gyz,kmul(J32L,PDstandard13gyz))),kmadd(J12L,kmadd(J23L,PDstandard12gyz,kmul(J33L,PDstandard13gyz)),kmadd(dJ123L,PDstandard1gyz,kmadd(J23L,kmadd(J22L,PDstandard22gyz,kmul(J32L,PDstandard23gyz)),kmadd(dJ223L,PDstandard2gyz,kmadd(J33L,kmadd(J22L,PDstandard23gyz,kmul(J32L,PDstandard33gyz)),kmul(dJ323L,PDstandard3gyz)))))));
    }
    else
    {
      JacPDstandard1gxx = PDstandard1gxx;
      
      JacPDstandard1gxy = PDstandard1gxy;
      
      JacPDstandard1gxz = PDstandard1gxz;
      
      JacPDstandard1gyy = PDstandard1gyy;
      
      JacPDstandard1gyz = PDstandard1gyz;
      
      JacPDstandard1gzz = PDstandard1gzz;
      
      JacPDstandard1kxy = PDstandard1kxy;
      
      JacPDstandard1kxz = PDstandard1kxz;
      
      JacPDstandard1kyy = PDstandard1kyy;
      
      JacPDstandard1kyz = PDstandard1kyz;
      
      JacPDstandard1kzz = PDstandard1kzz;
      
      JacPDstandard2gxx = PDstandard2gxx;
      
      JacPDstandard2gxy = PDstandard2gxy;
      
      JacPDstandard2gxz = PDstandard2gxz;
      
      JacPDstandard2gyy = PDstandard2gyy;
      
      JacPDstandard2gyz = PDstandard2gyz;
      
      JacPDstandard2gzz = PDstandard2gzz;
      
      JacPDstandard2kxx = PDstandard2kxx;
      
      JacPDstandard2kxy = PDstandard2kxy;
      
      JacPDstandard2kxz = PDstandard2kxz;
      
      JacPDstandard2kyz = PDstandard2kyz;
      
      JacPDstandard2kzz = PDstandard2kzz;
      
      JacPDstandard3gxx = PDstandard3gxx;
      
      JacPDstandard3gxy = PDstandard3gxy;
      
      JacPDstandard3gxz = PDstandard3gxz;
      
      JacPDstandard3gyy = PDstandard3gyy;
      
      JacPDstandard3gyz = PDstandard3gyz;
      
      JacPDstandard3gzz = PDstandard3gzz;
      
      JacPDstandard3kxx = PDstandard3kxx;
      
      JacPDstandard3kxy = PDstandard3kxy;
      
      JacPDstandard3kxz = PDstandard3kxz;
      
      JacPDstandard3kyy = PDstandard3kyy;
      
      JacPDstandard3kyz = PDstandard3kyz;
      
      JacPDstandard11gyy = PDstandard11gyy;
      
      JacPDstandard11gyz = PDstandard11gyz;
      
      JacPDstandard11gzz = PDstandard11gzz;
      
      JacPDstandard22gxx = PDstandard22gxx;
      
      JacPDstandard22gxz = PDstandard22gxz;
      
      JacPDstandard22gzz = PDstandard22gzz;
      
      JacPDstandard33gxx = PDstandard33gxx;
      
      JacPDstandard33gxy = PDstandard33gxy;
      
      JacPDstandard33gyy = PDstandard33gyy;
      
      JacPDstandard12gxy = PDstandard12gxy;
      
      JacPDstandard12gxz = PDstandard12gxz;
      
      JacPDstandard12gyz = PDstandard12gyz;
      
      JacPDstandard12gzz = PDstandard12gzz;
      
      JacPDstandard13gxz = PDstandard13gxz;
      
      JacPDstandard21gxy = PDstandard12gxy;
      
      JacPDstandard23gxx = PDstandard23gxx;
      
      JacPDstandard23gxy = PDstandard23gxy;
      
      JacPDstandard23gxz = PDstandard23gxz;
      
      JacPDstandard23gyz = PDstandard23gyz;
      
      JacPDstandard31gxy = PDstandard13gxy;
      
      JacPDstandard31gxz = PDstandard13gxz;
      
      JacPDstandard31gyy = PDstandard13gyy;
      
      JacPDstandard31gyz = PDstandard13gyz;
      
      JacPDstandard32gyz = PDstandard23gyz;
    }
    
    CCTK_REAL_VEC detg CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(gxyL,kmul(gxzL,gyzL)),knmsub(gzzL,kmul(gxyL,gxyL),kmsub(gyyL,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)),kmul(gxxL,kmul(gyzL,gyzL)))));
    
    CCTK_REAL_VEC invdetg CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),detg);
    
    CCTK_REAL_VEC gInv11 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gyyL,gzzL,kmul(gyzL,gyzL)));
    
    CCTK_REAL_VEC gInv12 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv13 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv21 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv22 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)));
    
    CCTK_REAL_VEC gInv23 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv31 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv32 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv33 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gyyL,kmul(gxyL,gxyL)));
    
    CCTK_REAL_VEC gamma111 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,JacPDstandard1gxx,kmsub(ToReal(2),kmadd(gInv12,JacPDstandard1gxy,kmul(gInv13,JacPDstandard1gxz)),kmadd(gInv13,JacPDstandard3gxx,kmul(gInv12,JacPDstandard2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma211 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,JacPDstandard1gxx,kmsub(ToReal(2),kmadd(gInv22,JacPDstandard1gxy,kmul(gInv23,JacPDstandard1gxz)),kmadd(gInv23,JacPDstandard3gxx,kmul(gInv22,JacPDstandard2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma311 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,JacPDstandard1gxx,kmsub(ToReal(2),kmadd(gInv32,JacPDstandard1gxy,kmul(gInv33,JacPDstandard1gxz)),kmadd(gInv33,JacPDstandard3gxx,kmul(gInv32,JacPDstandard2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma121 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv12,JacPDstandard1gyy,kmadd(gInv11,JacPDstandard2gxx,kmul(gInv13,kadd(JacPDstandard1gyz,ksub(JacPDstandard2gxz,JacPDstandard3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma221 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv22,JacPDstandard1gyy,kmadd(gInv21,JacPDstandard2gxx,kmul(gInv23,kadd(JacPDstandard1gyz,ksub(JacPDstandard2gxz,JacPDstandard3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma321 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv32,JacPDstandard1gyy,kmadd(gInv31,JacPDstandard2gxx,kmul(gInv33,kadd(JacPDstandard1gyz,ksub(JacPDstandard2gxz,JacPDstandard3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma131 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard1gzz,kmadd(gInv11,JacPDstandard3gxx,kmul(gInv12,kadd(JacPDstandard1gyz,ksub(JacPDstandard3gxy,JacPDstandard2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma231 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard1gzz,kmadd(gInv21,JacPDstandard3gxx,kmul(gInv22,kadd(JacPDstandard1gyz,ksub(JacPDstandard3gxy,JacPDstandard2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma331 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard1gzz,kmadd(gInv31,JacPDstandard3gxx,kmul(gInv32,kadd(JacPDstandard1gyz,ksub(JacPDstandard3gxy,JacPDstandard2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma122 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard2gxy,JacPDstandard1gyy),kmadd(gInv12,JacPDstandard2gyy,kmul(gInv13,kmsub(ToReal(2),JacPDstandard2gyz,JacPDstandard3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma222 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard2gxy,JacPDstandard1gyy),kmadd(gInv22,JacPDstandard2gyy,kmul(gInv23,kmsub(ToReal(2),JacPDstandard2gyz,JacPDstandard3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma322 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard2gxy,JacPDstandard1gyy),kmadd(gInv32,JacPDstandard2gyy,kmul(gInv33,kmsub(ToReal(2),JacPDstandard2gyz,JacPDstandard3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma132 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard2gzz,kmadd(gInv11,ksub(kadd(JacPDstandard2gxz,JacPDstandard3gxy),JacPDstandard1gyz),kmul(gInv12,JacPDstandard3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma232 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard2gzz,kmadd(gInv21,ksub(kadd(JacPDstandard2gxz,JacPDstandard3gxy),JacPDstandard1gyz),kmul(gInv22,JacPDstandard3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma332 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard2gzz,kmadd(gInv31,ksub(kadd(JacPDstandard2gxz,JacPDstandard3gxy),JacPDstandard1gyz),kmul(gInv32,JacPDstandard3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma133 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard3gxz,JacPDstandard1gzz),kmadd(gInv12,kmsub(ToReal(2),JacPDstandard3gyz,JacPDstandard2gzz),kmul(gInv13,JacPDstandard3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma233 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard3gxz,JacPDstandard1gzz),kmadd(gInv22,kmsub(ToReal(2),JacPDstandard3gyz,JacPDstandard2gzz),kmul(gInv23,JacPDstandard3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma333 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard3gxz,JacPDstandard1gzz),kmadd(gInv32,kmsub(ToReal(2),JacPDstandard3gyz,JacPDstandard2gzz),kmul(gInv33,JacPDstandard3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC xmoved CCTK_ATTRIBUTE_UNUSED = ksub(xL,ToReal(xorig));
    
    CCTK_REAL_VEC ymoved CCTK_ATTRIBUTE_UNUSED = ksub(yL,ToReal(yorig));
    
    CCTK_REAL_VEC zmoved CCTK_ATTRIBUTE_UNUSED = ksub(zL,ToReal(zorig));
    
    CCTK_REAL_VEC va1 CCTK_ATTRIBUTE_UNUSED = kneg(ymoved);
    
    CCTK_REAL_VEC va2 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC va3 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC vb1 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC vb2 CCTK_ATTRIBUTE_UNUSED = ymoved;
    
    CCTK_REAL_VEC vb3 CCTK_ATTRIBUTE_UNUSED = zmoved;
    
    CCTK_REAL_VEC vc1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv12,va3,kmul(gInv13,va2)),vb1,kmadd(kmsub(gInv13,va1,kmul(gInv11,va3)),vb2,kmul(vb3,kmsub(gInv11,va2,kmul(gInv12,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv22,va3,kmul(gInv23,va2)),vb1,kmadd(kmsub(gInv23,va1,kmul(gInv21,va3)),vb2,kmul(vb3,kmsub(gInv21,va2,kmul(gInv22,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv32,va3,kmul(gInv33,va2)),vb1,kmadd(kmsub(gInv33,va1,kmul(gInv31,va3)),vb2,kmul(vb3,kmsub(gInv31,va2,kmul(gInv32,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC wa1 CCTK_ATTRIBUTE_UNUSED = va1;
    
    CCTK_REAL_VEC wa2 CCTK_ATTRIBUTE_UNUSED = va2;
    
    CCTK_REAL_VEC wa3 CCTK_ATTRIBUTE_UNUSED = va3;
    
    CCTK_REAL_VEC omega11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wa2,wa3),kmul(wa1,kmadd(gxyL,wa2,kmul(gxzL,wa3)))),kmadd(gxxL,kmul(wa1,wa1),kmadd(gyyL,kmul(wa2,wa2),kmul(gzzL,kmul(wa3,wa3)))));
    
    CCTK_REAL_VEC ea1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa1,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa2,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa3,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC omega12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vb1,kmadd(gxyL,vb2,kmul(gxzL,vb3))),kmadd(ea2,kmadd(gxyL,vb1,kmadd(gyyL,vb2,kmul(gyzL,vb3))),kmul(ea3,kmadd(gxzL,vb1,kmadd(gyzL,vb2,kmul(gzzL,vb3))))));
    
    CCTK_REAL_VEC wb1 CCTK_ATTRIBUTE_UNUSED = knmsub(ea1,omega12,vb1);
    
    CCTK_REAL_VEC wb2 CCTK_ATTRIBUTE_UNUSED = knmsub(ea2,omega12,vb2);
    
    CCTK_REAL_VEC wb3 CCTK_ATTRIBUTE_UNUSED = knmsub(ea3,omega12,vb3);
    
    CCTK_REAL_VEC omega22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wb2,wb3),kmul(wb1,kmadd(gxyL,wb2,kmul(gxzL,wb3)))),kmadd(gxxL,kmul(wb1,wb1),kmadd(gyyL,kmul(wb2,wb2),kmul(gzzL,kmul(wb3,wb3)))));
    
    CCTK_REAL_VEC eb1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb1,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb2,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb3,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC omega13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(ea2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(ea3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC omega23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(eb1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(eb2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(eb3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC wc1 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea1,omega13,knmsub(eb1,omega23,vc1));
    
    CCTK_REAL_VEC wc2 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea2,omega13,knmsub(eb2,omega23,vc2));
    
    CCTK_REAL_VEC wc3 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea3,omega13,knmsub(eb3,omega23,vc3));
    
    CCTK_REAL_VEC omega33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wc2,wc3),kmul(wc1,kmadd(gxyL,wc2,kmul(gxzL,wc3)))),kmadd(gxxL,kmul(wc1,wc1),kmadd(gyyL,kmul(wc2,wc2),kmul(gzzL,kmul(wc3,wc3)))));
    
    CCTK_REAL_VEC ec1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc1,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc2,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc3,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC isqrt2 CCTK_ATTRIBUTE_UNUSED = 
      ToReal(0.707106781186547524);
    
    CCTK_REAL_VEC ltet1 CCTK_ATTRIBUTE_UNUSED = kmul(eb1,isqrt2);
    
    CCTK_REAL_VEC ltet2 CCTK_ATTRIBUTE_UNUSED = kmul(eb2,isqrt2);
    
    CCTK_REAL_VEC ltet3 CCTK_ATTRIBUTE_UNUSED = kmul(eb3,isqrt2);
    
    CCTK_REAL_VEC n1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb1,isqrt2));
    
    CCTK_REAL_VEC n2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb2,isqrt2));
    
    CCTK_REAL_VEC n3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb3,isqrt2));
    
    CCTK_REAL_VEC rm1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rm2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rm3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC im1 CCTK_ATTRIBUTE_UNUSED = kmul(ea1,isqrt2);
    
    CCTK_REAL_VEC im2 CCTK_ATTRIBUTE_UNUSED = kmul(ea2,isqrt2);
    
    CCTK_REAL_VEC im3 CCTK_ATTRIBUTE_UNUSED = kmul(ea3,isqrt2);
    
    CCTK_REAL_VEC rmbar1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rmbar2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rmbar3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC imbar1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea1,isqrt2));
    
    CCTK_REAL_VEC imbar2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea2,isqrt2));
    
    CCTK_REAL_VEC imbar3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea3,isqrt2));
    
    CCTK_REAL_VEC nn CCTK_ATTRIBUTE_UNUSED = isqrt2;
    
    CCTK_REAL_VEC R1212 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma221,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(gamma321,kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321)))))),kmadd(ToReal(-2),kmadd(gamma122,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma222,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma322))),ksub(kadd(JacPDstandard12gxy,ksub(JacPDstandard21gxy,JacPDstandard22gxx)),JacPDstandard11gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC R1213 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma221,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma321,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma232,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma332))),ksub(kadd(JacPDstandard12gxz,ksub(JacPDstandard31gxy,JacPDstandard23gxx)),JacPDstandard11gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1223 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma122,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma222,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma322,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma232,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma332))),ksub(kadd(JacPDstandard22gxz,ksub(JacPDstandard31gyy,JacPDstandard23gxy)),JacPDstandard12gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1313 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma131,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma231,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma331,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma233,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma333))),ksub(kadd(JacPDstandard13gxz,ksub(JacPDstandard31gxz,JacPDstandard33gxx)),JacPDstandard11gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma232,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331))),gamma332))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma233,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma333))),ksub(kadd(JacPDstandard23gxz,ksub(JacPDstandard31gyz,JacPDstandard33gxy)),JacPDstandard12gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R2323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma132,kmadd(gxyL,gamma232,kmul(gxzL,gamma332))),kmadd(gamma232,kmadd(gxyL,gamma132,kmadd(gyyL,gamma232,kmul(gyzL,gamma332))),kmul(gamma332,kmadd(gxzL,gamma132,kmadd(gyzL,gamma232,kmul(gzzL,gamma332)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma122,kmadd(gxyL,gamma222,kmul(gxzL,gamma322))),kmadd(gamma233,kmadd(gxyL,gamma122,kmadd(gyyL,gamma222,kmul(gyzL,gamma322))),kmul(kmadd(gxzL,gamma122,kmadd(gyzL,gamma222,kmul(gzzL,gamma322))),gamma333))),ksub(kadd(JacPDstandard23gyz,ksub(JacPDstandard32gyz,JacPDstandard33gyy)),JacPDstandard22gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R4p1212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212));
    
    CCTK_REAL_VEC R4p1213 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213));
    
    CCTK_REAL_VEC R4p1223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223));
    
    CCTK_REAL_VEC R4p1313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313));
    
    CCTK_REAL_VEC R4p1323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323));
    
    CCTK_REAL_VEC R4p2323 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323));
    
    CCTK_REAL_VEC Ro111 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro112 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma121,knmsub(kyyL,gamma211,kmadd(kxyL,ksub(gamma221,gamma111),knmsub(kyzL,gamma311,kmadd(kxzL,gamma321,ksub(JacPDstandard1kxy,JacPDstandard2kxx))))));
    
    CCTK_REAL_VEC Ro113 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma131,knmsub(kyzL,gamma211,kmadd(kxyL,gamma231,knmsub(kzzL,gamma311,kmadd(kxzL,ksub(gamma331,gamma111),ksub(JacPDstandard1kxz,JacPDstandard3kxx))))));
    
    CCTK_REAL_VEC Ro121 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma121,kmadd(kyyL,gamma211,kmadd(kxyL,ksub(gamma111,gamma221),kmadd(kyzL,gamma311,knmsub(kxzL,gamma321,ksub(JacPDstandard2kxx,JacPDstandard1kxy))))));
    
    CCTK_REAL_VEC Ro122 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro123 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma121,kmadd(kxyL,gamma131,kmadd(kyyL,gamma231,knmsub(kzzL,gamma321,kmadd(kyzL,ksub(gamma331,gamma221),ksub(JacPDstandard2kxz,JacPDstandard3kxy))))));
    
    CCTK_REAL_VEC Ro131 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma131,kmadd(kyzL,gamma211,knmsub(kxyL,gamma231,kmadd(kzzL,gamma311,kmadd(kxzL,ksub(gamma111,gamma331),ksub(JacPDstandard3kxx,JacPDstandard1kxz))))));
    
    CCTK_REAL_VEC Ro132 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma121,knmsub(kxyL,gamma131,knmsub(kyyL,gamma231,kmadd(kzzL,gamma321,kmadd(kyzL,ksub(gamma221,gamma331),ksub(JacPDstandard3kxy,JacPDstandard2kxz))))));
    
    CCTK_REAL_VEC Ro133 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro211 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma122,knmsub(kyyL,gamma221,kmadd(kxyL,ksub(gamma222,gamma121),knmsub(kyzL,gamma321,kmadd(kxzL,gamma322,ksub(JacPDstandard1kyy,JacPDstandard2kxy))))));
    
    CCTK_REAL_VEC Ro213 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyzL,gamma221,kmadd(kxyL,gamma232,knmsub(kzzL,gamma321,kmadd(kxzL,ksub(gamma332,gamma121),ksub(JacPDstandard1kyz,JacPDstandard3kxy))))));
    
    CCTK_REAL_VEC Ro221 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma122,kmadd(kyyL,gamma221,kmadd(kxyL,ksub(gamma121,gamma222),kmadd(kyzL,gamma321,knmsub(kxzL,gamma322,ksub(JacPDstandard2kxy,JacPDstandard1kyy))))));
    
    CCTK_REAL_VEC Ro222 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma122,kmadd(kxyL,gamma132,kmadd(kyyL,gamma232,knmsub(kzzL,gamma322,kmadd(kyzL,ksub(gamma332,gamma222),ksub(JacPDstandard2kyz,JacPDstandard3kyy))))));
    
    CCTK_REAL_VEC Ro231 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyzL,gamma221,knmsub(kxyL,gamma232,kmadd(kzzL,gamma321,kmadd(kxzL,ksub(gamma121,gamma332),ksub(JacPDstandard3kxy,JacPDstandard1kyz))))));
    
    CCTK_REAL_VEC Ro232 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma122,knmsub(kxyL,gamma132,knmsub(kyyL,gamma232,kmadd(kzzL,gamma322,kmadd(kyzL,ksub(gamma222,gamma332),ksub(JacPDstandard3kyy,JacPDstandard2kyz))))));
    
    CCTK_REAL_VEC Ro233 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro311 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro312 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyyL,gamma231,kmadd(kxyL,ksub(gamma232,gamma131),knmsub(kyzL,gamma331,kmadd(kxzL,gamma332,ksub(JacPDstandard1kyz,JacPDstandard2kxz))))));
    
    CCTK_REAL_VEC Ro313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma133,knmsub(kyzL,gamma231,kmadd(kxyL,gamma233,knmsub(kzzL,gamma331,kmadd(kxzL,ksub(gamma333,gamma131),ksub(JacPDstandard1kzz,JacPDstandard3kxz))))));
    
    CCTK_REAL_VEC Ro321 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyyL,gamma231,kmadd(kxyL,ksub(gamma131,gamma232),kmadd(kyzL,gamma331,knmsub(kxzL,gamma332,ksub(JacPDstandard2kxz,JacPDstandard1kyz))))));
    
    CCTK_REAL_VEC Ro322 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma132,kmadd(kxyL,gamma133,kmadd(kyyL,gamma233,knmsub(kzzL,gamma332,kmadd(kyzL,ksub(gamma333,gamma232),ksub(JacPDstandard2kzz,JacPDstandard3kyz))))));
    
    CCTK_REAL_VEC Ro331 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma133,kmadd(kyzL,gamma231,knmsub(kxyL,gamma233,kmadd(kzzL,gamma331,kmadd(kxzL,ksub(gamma131,gamma333),ksub(JacPDstandard3kxz,JacPDstandard1kzz))))));
    
    CCTK_REAL_VEC Ro332 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma132,knmsub(kxyL,gamma133,knmsub(kyyL,gamma233,kmadd(kzzL,gamma332,kmadd(kyzL,ksub(gamma232,gamma333),ksub(JacPDstandard3kyz,JacPDstandard2kzz))))));
    
    CCTK_REAL_VEC Ro333 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Rojo11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv23,gInv32),knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv22,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)))));
    
    CCTK_REAL_VEC Rojo12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv32,knmsub(gInv21,R1212,knmsub(gInv31,R1213,kmadd(gInv23,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv12,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv23,knmsub(gInv21,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv31,R1313,kmsub(gInv13,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv32,R1323)))))));
    
    CCTK_REAL_VEC Rojo21 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv23,kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv31,knmsub(gInv12,R1212,knmsub(gInv13,R1213,kmadd(gInv32,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv21,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv13,gInv31),kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),kmadd(gInv11,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Rojo23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv21,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv12,R1223,knmsub(gInv31,R1323,kmsub(gInv23,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv32,R2323)))))));
    
    CCTK_REAL_VEC Rojo31 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv21,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv32,knmsub(gInv12,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv13,R1313,kmsub(gInv31,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv23,R1323)))))));
    
    CCTK_REAL_VEC Rojo32 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv31,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv21,R1223,knmsub(gInv13,R1323,kmsub(gInv32,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv23,R2323)))))));
    
    CCTK_REAL_VEC Rojo33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv12,gInv21),knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmadd(gInv11,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)),kmul(gInv22,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(imbar1,imbar2,kmul(rmbar1,rmbar2)),kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3))),kmadd(ToReal(2),kmul(kmadd(n1,kmul(n2,R4p1213),kmadd(n1,kmul(n3,R4p1313),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))),kmsub(imbar1,imbar3,kmul(rmbar1,rmbar3))),knmsub(kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3)))),kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),knmsub(kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3)))),kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),knmsub(kmul(nn,nn),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo23,kmadd(imbar1,kmadd(imbar2,kadd(Rojo12,Rojo21),kmul(imbar3,kadd(Rojo13,Rojo31))),knmsub(rmbar1,kmadd(rmbar2,kadd(Rojo12,Rojo21),kmul(rmbar3,kadd(Rojo13,Rojo31))),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo32,kmadd(Rojo11,kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),kmadd(Rojo22,kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),kmul(Rojo33,kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro112,kmadd(n2,Ro122,kmul(n3,Ro132))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro113,kmadd(n2,Ro123,kmul(n3,Ro133))),kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro211,kmadd(n2,Ro221,kmul(n3,Ro231))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro213,kmadd(n2,Ro223,kmul(n3,Ro233))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro311,kmadd(n2,Ro321,kmul(n3,Ro331))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro312,kmadd(n2,Ro322,kmul(n3,Ro332))),kmadd(kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131))),kmsub(rmbar1,rmbar1,kmul(imbar1,imbar1)),kmadd(kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232))),kmsub(rmbar2,rmbar2,kmul(imbar2,imbar2)),kmul(kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))),kmsub(rmbar3,rmbar3,kmul(imbar3,imbar3)))))))))))),kmul(kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2)))),kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))));
    
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,knmsub(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(n1,kadd(Ro112,Ro211),kmadd(n3,kadd(Ro132,Ro231),kmul(n2,kadd(Ro122,Ro221)))),kmadd(ToReal(-2),kmadd(im1,kmul(rm1,kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131)))),kmul(im2,kmul(rm2,kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232)))))),knmsub(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kadd(Ro113,Ro311),kmadd(n3,kadd(Ro133,Ro331),kmul(n2,kadd(Ro123,Ro321)))),kmsub(ToReal(-2),kmul(im3,kmul(rm3,kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))))),kmul(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kadd(Ro213,Ro312),kmadd(n3,kadd(Ro233,Ro332),kmul(n2,kadd(Ro223,Ro322))))))))),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kmadd(n2,R4p1213,kmul(n3,R4p1313)),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))))),kmsub(ToReal(-2),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    
    CCTK_REAL_VEC Psi3rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(n1,knmsub(ltet1,kmadd(n2,kmul(R4p1212,rm2),kmadd(n3,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1213,rm3),kmul(n3,kmul(R4p1313,rm3))))),kmadd(ltet3,kmadd(n1,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1223,rm2),kmadd(n1,kmul(R4p1313,rm3),kmul(n2,kmul(R4p1323,rm3))))),kmadd(ltet2,kmsub(n1,kmadd(R4p1212,rm2,kmul(R4p1213,rm3)),kmul(n3,kmadd(R4p1223,rm2,kmul(R4p1323,rm3)))),kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(nn,kmul(rm2,Ro221)),kmadd(nn,kmsub(kmsub(ksub(n1,ltet1),rm2,kmul(ltet2,rm1)),Ro121,kmul(Ro231,kmadd(ltet3,rm2,kmul(ksub(ltet2,n2),rm3)))),kmadd(nn,kmsub(kmsub(ksub(n1,ltet1),rm3,kmul(ltet3,rm1)),Ro131,kmul(Ro311,kmadd(ksub(ltet3,n3),rm1,kmul(ltet1,rm3)))),kmadd(nn,kmsub(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro111),kmadd(kmadd(ksub(ltet3,n3),rm2,kmul(ltet2,rm3)),Ro321,kmul(Ro211,kmadd(ksub(ltet2,n2),rm1,kmul(ltet1,rm2))))),kmul(kmadd(ToReal(-2),ltet3,n3),kmul(nn,kmul(rm3,Ro331)))))))))),kmadd(n2,kmadd(ltet1,kmsub(kmadd(n2,R4p1212,kmul(n3,R4p1213)),rm1,kmul(rm3,kmadd(n3,R4p1323,kmul(n2,R4p1223)))),kmadd(ltet3,knmsub(kmadd(n2,R4p1223,kmul(n1,R4p1213)),rm1,kmadd(n1,kmul(R4p1323,rm3),kmul(n2,kmul(R4p2323,rm3)))),kmadd(ltet2,kmadd(kmsub(n3,R4p1223,kmul(n1,R4p1212)),rm1,kmul(rm3,kmsub(n1,R4p1223,kmul(n3,R4p2323)))),kmul(nn,kmadd(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro112),knmsub(kmadd(ltet2,rm1,kmul(rm2,ksub(ltet1,n1))),Ro122,knmsub(kmadd(ltet3,rm1,kmul(rm3,ksub(ltet1,n1))),Ro132,kmadd(kmsub(ksub(n2,ltet2),rm1,kmul(ltet1,rm2)),Ro212,kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(rm2,Ro222),kmadd(kmsub(ksub(n2,ltet2),rm3,kmul(ltet3,rm2)),Ro232,knmsub(kmadd(ksub(ltet3,n3),rm1,kmul(ltet1,rm3)),Ro312,kmsub(kmadd(ToReal(-2),ltet3,n3),kmul(rm3,Ro332),kmul(Ro322,kmadd(ksub(ltet3,n3),rm2,kmul(ltet2,rm3))))))))))))))),kmsub(n3,kmadd(ltet1,kmadd(n2,kmul(R4p1213,rm1),kmadd(n3,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1223,rm2),kmul(n3,kmul(R4p1323,rm2))))),knmsub(ltet3,kmadd(n1,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1323,rm1),kmadd(n1,kmul(R4p1323,rm2),kmul(n2,kmul(R4p2323,rm2))))),kmadd(ltet2,kmsub(n3,kmadd(R4p1323,rm1,kmul(R4p2323,rm2)),kmul(n1,kmadd(R4p1213,rm1,kmul(R4p1223,rm2)))),kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(nn,kmul(rm2,Ro223)),kmadd(nn,kmsub(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro113),kmadd(kmadd(ltet2,rm1,kmul(rm2,ksub(ltet1,n1))),Ro123,kmadd(kmadd(ltet3,rm1,kmul(rm3,ksub(ltet1,n1))),Ro133,kmadd(kmadd(ltet3,rm2,kmul(rm3,ksub(ltet2,n2))),Ro233,kmul(Ro213,kmadd(ksub(ltet2,n2),rm1,kmul(ltet1,rm2))))))),kmadd(nn,kmul(Ro313,kmsub(ksub(n3,ltet3),rm1,kmul(ltet1,rm3))),kmadd(nn,kmul(Ro323,kmsub(ksub(n3,ltet3),rm2,kmul(ltet2,rm3))),kmul(kmadd(ToReal(-2),ltet3,n3),kmul(nn,kmul(rm3,Ro333)))))))))),kmul(kmadd(ksub(n1,ltet1),kmadd(rm1,Rojo11,kmadd(rm2,Rojo12,kmul(rm3,Rojo13))),kmadd(ksub(n2,ltet2),kmadd(rm1,Rojo21,kmadd(rm2,Rojo22,kmul(rm3,Rojo23))),kmul(kmadd(rm1,Rojo31,kmadd(rm2,Rojo32,kmul(rm3,Rojo33))),ksub(n3,ltet3)))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi3iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(n1,knmsub(im2,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmul(R4p1223,kmsub(ltet3,n2,kmul(ltet2,n3))))),kmsub(im1,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro111)),kmul(im3,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmul(R4p1323,kmsub(ltet3,n2,kmul(ltet2,n3)))))))),kmadd(n2,kmsub(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1223,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro112))))),kmul(im3,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1223,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1323,kmul(R4p2323,kmsub(ltet3,n2,kmul(ltet2,n3))))))),kmadd(n3,kmsub(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1323,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro113))))),kmul(im2,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1223,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1323,kmul(R4p2323,kmsub(ltet2,n3,kmul(ltet3,n2))))))),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n1,kmul(nn,Ro121)),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n2,kmul(nn,Ro122)),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n3,kmul(nn,Ro123)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n1,kmul(nn,Ro131)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n2,kmul(nn,Ro132)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n3,kmul(nn,Ro133)),kmadd(n1,kmul(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(nn,Ro211)),kmadd(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(n2,kmul(nn,Ro212)),kmadd(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(n3,kmul(nn,Ro213)),kmadd(im2,kmul(n1,kmul(kmsub(ToReal(2),ltet2,n2),kmul(nn,Ro221))),kmadd(im2,kmul(kmsub(ToReal(2),ltet2,n2),kmul(n2,kmul(nn,Ro222))),kmadd(im2,kmul(kmsub(ToReal(2),ltet2,n2),kmul(n3,kmul(nn,Ro223))),kmadd(n1,kmul(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(nn,Ro231)),kmadd(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(n2,kmul(nn,Ro232)),kmadd(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(n3,kmul(nn,Ro233)),kmadd(n1,kmul(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(nn,Ro311)),kmadd(n2,kmul(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(nn,Ro312)),kmadd(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(n3,kmul(nn,Ro313)),kmadd(n1,kmul(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(nn,Ro321)),kmadd(n2,kmul(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(nn,Ro322)),kmadd(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(n3,kmul(nn,Ro323)),kmadd(im3,kmul(n1,kmul(kmsub(ToReal(2),ltet3,n3),kmul(nn,Ro331))),kmadd(im3,kmul(n2,kmul(kmsub(ToReal(2),ltet3,n3),kmul(nn,Ro332))),kmadd(im3,kmul(kmsub(ToReal(2),ltet3,n3),kmul(n3,kmul(nn,Ro333))),kmul(kmadd(ksub(n1,ltet1),kmadd(im1,Rojo11,kmadd(im2,Rojo12,kmul(im3,Rojo13))),kmadd(ksub(n2,ltet2),kmadd(im1,Rojo21,kmadd(im2,Rojo22,kmul(im3,Rojo23))),kmul(kmadd(im1,Rojo31,kmadd(im2,Rojo32,kmul(im3,Rojo33))),ksub(n3,ltet3)))),kmul(nn,nn)))))))))))))))))))))))))))));
    
    CCTK_REAL_VEC Psi2rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmadd(ltet2,kmsub(n1,R4p1212,kmul(n3,R4p1223)),kmul(ltet3,kmsub(n1,R4p1213,kmul(n3,R4p1323)))),kmadd(im1,im2,kmul(rm1,rm2)),kmadd(kmsub(ltet1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(ltet3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im1,im2,kmul(rm1,rm2)),kmadd(kmadd(ltet2,kmul(n1,R4p1213),kmadd(ltet2,kmul(n2,R4p1223),kmadd(ltet3,kmul(n1,R4p1313),kmul(ltet3,kmul(n2,R4p1323))))),kmadd(im1,im3,kmul(rm1,rm3)),kmadd(kmadd(ltet1,kmul(n2,R4p1213),kmadd(ltet2,kmul(n2,R4p1223),kmadd(ltet1,kmul(n3,R4p1313),kmul(ltet2,kmul(n3,R4p1323))))),kmadd(im1,im3,kmul(rm1,rm3)),kmadd(knmsub(n1,kmadd(ltet2,R4p1223,kmul(ltet1,R4p1213)),kmadd(ltet1,knmsub(n1,R4p1213,kmsub(n3,R4p1323,kmul(n2,R4p1223))),kmadd(ltet2,kmul(n3,R4p2323),kmul(ltet3,kmadd(n1,R4p1323,kmul(n2,R4p2323)))))),kmadd(im2,im3,kmul(rm2,rm3)),knmsub(kmadd(ltet2,kmul(n2,R4p1212),kmadd(ltet3,kmul(n2,R4p1213),kmadd(ltet2,kmul(n3,R4p1213),kmul(ltet3,kmul(n3,R4p1313))))),kmadd(im1,im1,kmul(rm1,rm1)),knmsub(kmadd(n1,kmsub(ltet1,R4p1212,kmul(ltet3,R4p1223)),kmul(n3,kmsub(ltet3,R4p2323,kmul(ltet1,R4p1223)))),kmadd(im2,im2,kmul(rm2,rm2)),knmsub(kmadd(ltet1,kmul(n1,R4p1313),kmadd(ltet2,kmul(n1,R4p1323),kmadd(ltet1,kmul(n2,R4p1323),kmul(ltet2,kmul(n2,R4p2323))))),kmadd(im3,im3,kmul(rm3,rm3)),kmsub(nn,kmadd(ksub(n2,ltet2),kmul(Ro122,kmadd(im1,im2,kmul(rm1,rm2))),kmadd(kmadd(im1,kmsub(im2,n3,kmul(im3,ltet2)),kmul(rm1,kmsub(n3,rm2,kmul(ltet2,rm3)))),Ro123,kmadd(kmadd(im1,kmsub(im3,n2,kmul(im2,ltet3)),kmul(rm1,kmsub(n2,rm3,kmul(ltet3,rm2)))),Ro132,kmadd(ksub(n3,ltet3),kmul(Ro133,kmadd(im1,im3,kmul(rm1,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro211,kmadd(im1,im2,kmul(rm1,rm2))),kmadd(kmadd(im2,kmsub(im1,n3,kmul(im3,ltet1)),kmul(rm2,kmsub(n3,rm1,kmul(ltet1,rm3)))),Ro213,kmadd(kmadd(im2,kmsub(im3,n1,kmul(im1,ltet3)),kmul(rm2,kmsub(n1,rm3,kmul(ltet3,rm1)))),Ro231,kmadd(ksub(n3,ltet3),kmul(Ro233,kmadd(im2,im3,kmul(rm2,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro311,kmadd(im1,im3,kmul(rm1,rm3))),kmadd(kmadd(im3,kmsub(im1,n2,kmul(im2,ltet1)),kmul(rm3,kmsub(n2,rm1,kmul(ltet1,rm2)))),Ro312,kmadd(kmadd(im3,kmsub(im2,n1,kmul(im1,ltet2)),kmul(rm3,kmsub(n1,rm2,kmul(ltet2,rm1)))),Ro321,kmadd(ksub(n2,ltet2),kmul(Ro322,kmadd(im2,im3,kmul(rm2,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro111,kmadd(im1,im1,kmul(rm1,rm1))),kmadd(Ro121,kmsub(n1,kmadd(im1,im2,kmul(rm1,rm2)),kmul(ltet2,kmadd(im1,im1,kmul(rm1,rm1)))),kmadd(Ro131,kmsub(n1,kmadd(im1,im3,kmul(rm1,rm3)),kmul(ltet3,kmadd(im1,im1,kmul(rm1,rm1)))),kmadd(Ro112,kmsub(n2,kmadd(im1,im1,kmul(rm1,rm1)),kmul(ltet1,kmadd(im1,im2,kmul(rm1,rm2)))),kmadd(Ro113,kmsub(n3,kmadd(im1,im1,kmul(rm1,rm1)),kmul(ltet1,kmadd(im1,im3,kmul(rm1,rm3)))),kmadd(ksub(n2,ltet2),kmul(Ro222,kmadd(im2,im2,kmul(rm2,rm2))),kmadd(Ro212,kmsub(n2,kmadd(im1,im2,kmul(rm1,rm2)),kmul(ltet1,kmadd(im2,im2,kmul(rm2,rm2)))),kmadd(Ro232,kmsub(n2,kmadd(im2,im3,kmul(rm2,rm3)),kmul(ltet3,kmadd(im2,im2,kmul(rm2,rm2)))),kmadd(Ro221,kmsub(n1,kmadd(im2,im2,kmul(rm2,rm2)),kmul(ltet2,kmadd(im1,im2,kmul(rm1,rm2)))),kmadd(Ro223,kmsub(n3,kmadd(im2,im2,kmul(rm2,rm2)),kmul(ltet2,kmadd(im2,im3,kmul(rm2,rm3)))),kmadd(ksub(n3,ltet3),kmul(Ro333,kmadd(im3,im3,kmul(rm3,rm3))),kmadd(Ro313,kmsub(n3,kmadd(im1,im3,kmul(rm1,rm3)),kmul(ltet1,kmadd(im3,im3,kmul(rm3,rm3)))),kmadd(Ro323,kmsub(n3,kmadd(im2,im3,kmul(rm2,rm3)),kmul(ltet2,kmadd(im3,im3,kmul(rm3,rm3)))),kmadd(Ro331,kmsub(n1,kmadd(im3,im3,kmul(rm3,rm3)),kmul(ltet3,kmadd(im1,im3,kmul(rm1,rm3)))),kmul(Ro332,kmsub(n2,kmadd(im3,im3,kmul(rm3,rm3)),kmul(ltet3,kmadd(im2,im3,kmul(rm2,rm3))))))))))))))))))))))))))))))),kmul(kmadd(im2,kmul(im3,Rojo23),kmadd(rm2,kmul(rm3,Rojo23),kmadd(im1,kmadd(im2,kadd(Rojo12,Rojo21),kmul(im3,kadd(Rojo13,Rojo31))),kmadd(rm1,kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31))),kmadd(im2,kmul(im3,Rojo32),kmadd(rm2,kmul(rm3,Rojo32),kmadd(Rojo11,kmul(im1,im1),kmadd(Rojo22,kmul(im2,im2),kmadd(Rojo33,kmul(im3,im3),kmadd(Rojo11,kmul(rm1,rm1),kmadd(Rojo22,kmul(rm2,rm2),kmul(Rojo33,kmul(rm3,rm3))))))))))))),kmul(nn,nn)))))))))));
    
    CCTK_REAL_VEC Psi2iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(knmsub(n1,kmadd(ltet3,R4p1213,kmul(ltet2,R4p1212)),kmadd(ltet1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(R4p1223,kmsub(ltet2,n3,kmul(ltet3,n2))))),kmsub(im2,rm1,kmul(im1,rm2)),kmadd(kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1213,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1313,kmul(R4p1323,kmsub(ltet2,n3,kmul(ltet3,n2))))),kmsub(im3,rm1,kmul(im1,rm3)),kmadd(knmsub(n1,kmadd(ltet2,R4p1223,kmul(ltet1,R4p1213)),kmadd(ltet1,kmadd(n1,R4p1213,kmul(n2,R4p1223)),kmadd(ltet1,kmul(n3,R4p1323),kmsub(ltet2,kmul(n3,R4p2323),kmul(ltet3,kmadd(n1,R4p1323,kmul(n2,R4p2323))))))),kmsub(im3,rm2,kmul(im2,rm3)),kmsub(kmadd(im1,kmadd(rm2,ksub(Rojo21,Rojo12),kmul(rm3,ksub(Rojo31,Rojo13))),kmadd(im3,kmadd(rm1,ksub(Rojo13,Rojo31),kmul(rm2,ksub(Rojo23,Rojo32))),kmul(im2,kmadd(rm1,ksub(Rojo12,Rojo21),kmul(rm3,ksub(Rojo32,Rojo23)))))),kmul(nn,nn),kmul(nn,kmadd(im1,knmsub(rm2,kmadd(kadd(ltet2,n2),Ro122,kmadd(ltet3,Ro132,kmul(n3,Ro123))),knmsub(rm3,kmadd(ltet2,Ro123,kmadd(kadd(ltet3,n3),Ro133,kmul(n2,Ro132))),kmadd(n2,kmul(rm2,Ro212),kmadd(n3,kmul(rm2,Ro213),kmadd(ltet2,kmul(rm2,Ro221),kmadd(ltet3,kmul(rm2,Ro231),kmadd(ltet1,kmadd(rm2,ksub(Ro211,Ro112),kmul(rm3,ksub(Ro311,Ro113))),kmadd(n1,kmadd(rm2,ksub(Ro211,Ro121),kmul(rm3,ksub(Ro311,Ro131))),kmadd(n2,kmul(rm3,Ro312),kmadd(n3,kmul(rm3,Ro313),kmadd(ltet2,kmul(rm3,Ro321),kmul(ltet3,kmul(rm3,Ro331))))))))))))),kmadd(im2,kmadd(rm1,kmadd(n2,ksub(Ro122,Ro212),kmadd(n3,ksub(Ro123,Ro213),kmadd(ltet2,ksub(Ro122,Ro221),kmul(ltet3,ksub(Ro132,Ro231))))),knmsub(rm3,kmadd(ltet2,Ro223,kmadd(kadd(ltet3,n3),Ro233,kmul(n2,Ro232))),kmadd(ltet1,kmadd(rm1,ksub(Ro112,Ro211),kmul(rm3,ksub(Ro312,Ro213))),kmadd(n1,kmadd(rm1,ksub(Ro121,Ro211),kmul(rm3,ksub(Ro321,Ro231))),kmadd(ltet2,kmul(rm3,Ro322),kmadd(n2,kmul(rm3,Ro322),kmadd(n3,kmul(rm3,Ro323),kmul(ltet3,kmul(rm3,Ro332))))))))),kmul(im3,kmadd(ltet1,kmadd(rm1,ksub(Ro113,Ro311),kmul(rm2,ksub(Ro213,Ro312))),kmadd(ltet2,kmadd(rm1,ksub(Ro123,Ro321),kmul(rm2,ksub(Ro223,Ro322))),kmadd(rm1,kmadd(kadd(ltet3,n3),Ro133,kmadd(n1,ksub(Ro131,Ro311),kmsub(n2,ksub(Ro132,Ro312),kmadd(ltet3,Ro331,kmul(n3,Ro313))))),kmul(rm2,kmadd(kadd(ltet3,n3),Ro233,kmadd(n1,ksub(Ro231,Ro321),kmsub(n2,ksub(Ro232,Ro322),kmadd(ltet3,Ro332,kmul(n3,Ro323)))))))))))))))));
    
    CCTK_REAL_VEC Psi1rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ltet1,kmadd(ltet1,kmadd(n2,kmul(R4p1212,rm2),kmadd(n3,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1213,rm3),kmul(n3,kmul(R4p1313,rm3))))),knmsub(ltet3,kmadd(n1,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1223,rm2),kmadd(n1,kmul(R4p1313,rm3),kmul(n2,kmul(R4p1323,rm3))))),kmadd(ltet2,kmsub(n3,kmadd(R4p1223,rm2,kmul(R4p1323,rm3)),kmul(n1,kmadd(R4p1212,rm2,kmul(R4p1213,rm3)))),kmadd(nn,kmul(Ro121,kmsub(ksub(ltet1,n1),rm2,kmul(n2,rm1))),kmadd(nn,kmul(Ro131,kmsub(ksub(ltet1,n1),rm3,kmul(n3,rm1))),kmadd(nn,kmul(Ro211,kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2))),kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(nn,kmul(rm2,Ro221)),kmadd(nn,kmsub(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro111),kmul(Ro231,kmadd(n3,rm2,kmul(ksub(n2,ltet2),rm3)))),kmadd(nn,kmul(Ro311,kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3))),kmadd(nn,kmul(Ro321,kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3))),kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,kmul(rm3,Ro331))))))))))))),kmadd(ltet2,kmadd(ltet1,knmsub(kmadd(n3,R4p1213,kmul(n2,R4p1212)),rm1,kmadd(n2,kmul(R4p1223,rm3),kmul(n3,kmul(R4p1323,rm3)))),kmadd(ltet3,kmsub(kmadd(n1,R4p1213,kmul(n2,R4p1223)),rm1,kmul(rm3,kmadd(n2,R4p2323,kmul(n1,R4p1323)))),kmadd(ltet2,kmadd(kmsub(n1,R4p1212,kmul(n3,R4p1223)),rm1,kmul(rm3,kmsub(n3,R4p2323,kmul(n1,R4p1223)))),kmul(nn,kmadd(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro112),knmsub(kmadd(n2,rm1,kmul(rm2,ksub(n1,ltet1))),Ro122,knmsub(kmadd(n3,rm1,kmul(rm3,ksub(n1,ltet1))),Ro132,kmadd(kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2)),Ro212,kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(rm2,Ro222),kmadd(kmsub(ksub(ltet2,n2),rm3,kmul(n3,rm2)),Ro232,kmadd(kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3)),Ro312,kmadd(kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3)),Ro322,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(rm3,Ro332)))))))))))))),kmsub(ltet3,knmsub(ltet1,kmadd(n2,kmul(R4p1213,rm1),kmadd(n3,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1223,rm2),kmul(n3,kmul(R4p1323,rm2))))),kmadd(ltet3,kmadd(n1,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1323,rm1),kmadd(n1,kmul(R4p1323,rm2),kmul(n2,kmul(R4p2323,rm2))))),kmadd(ltet2,kmsub(n1,kmadd(R4p1213,rm1,kmul(R4p1223,rm2)),kmul(n3,kmadd(R4p1323,rm1,kmul(R4p2323,rm2)))),kmadd(nn,kmul(Ro213,kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2))),kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(nn,kmul(rm2,Ro223)),kmadd(nn,kmsub(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro113),kmadd(kmadd(n2,rm1,kmul(rm2,ksub(n1,ltet1))),Ro123,kmadd(kmadd(n3,rm2,kmul(rm3,ksub(n2,ltet2))),Ro233,kmul(Ro133,kmadd(n3,rm1,kmul(ksub(n1,ltet1),rm3)))))),kmadd(nn,kmul(Ro313,kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3))),kmadd(nn,kmul(Ro323,kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3))),kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,kmul(rm3,Ro333))))))))))),kmul(kmadd(ksub(ltet1,n1),kmadd(rm1,Rojo11,kmadd(rm2,Rojo12,kmul(rm3,Rojo13))),kmadd(rm1,kmadd(ksub(ltet2,n2),Rojo21,kmul(Rojo31,ksub(ltet3,n3))),kmadd(rm2,kmadd(ksub(ltet2,n2),Rojo22,kmul(Rojo32,ksub(ltet3,n3))),kmul(rm3,kmadd(ksub(ltet2,n2),Rojo23,kmul(Rojo33,ksub(ltet3,n3))))))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi1iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ltet1,kmadd(im2,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1212,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1213,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p1223,kmul(kmadd(ToReal(-2),n2,ltet2),kmul(nn,Ro221))))),kmadd(nn,kmadd(im1,kmul(Ro111,kmadd(ToReal(-2),n1,ltet1)),kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro121,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro131,knmsub(kmadd(im2,n1,kmul(im1,ksub(n2,ltet2))),Ro211,kmsub(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro231,kmadd(kmadd(im3,n2,kmul(im2,ksub(n3,ltet3))),Ro321,kmul(Ro311,kmadd(im3,n1,kmul(im1,ksub(n3,ltet3)))))))))),kmul(im3,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1213,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1313,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p1323,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,Ro331)))))))),kmadd(ltet2,kmadd(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1223,kmul(kmadd(ToReal(-2),n1,ltet1),kmul(nn,Ro112))))),kmadd(nn,kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro122,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro132,kmadd(kmsub(im1,ksub(ltet2,n2),kmul(im2,n1)),Ro212,kmadd(im2,kmul(Ro222,kmadd(ToReal(-2),n2,ltet2)),kmsub(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro232,kmadd(kmadd(im3,n2,kmul(im2,ksub(n3,ltet3))),Ro322,kmul(Ro312,kmadd(im3,n1,kmul(im1,ksub(n3,ltet3)))))))))),kmul(im3,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1223,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1323,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p2323,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,Ro332)))))))),kmsub(ltet3,kmadd(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1323,kmul(kmadd(ToReal(-2),n1,ltet1),kmul(nn,Ro113))))),kmadd(im2,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1223,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1323,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p2323,kmul(kmadd(ToReal(-2),n2,ltet2),kmul(nn,Ro223))))),kmul(nn,kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro123,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro133,knmsub(kmadd(im2,n1,kmul(im1,ksub(n2,ltet2))),Ro213,kmadd(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro233,kmadd(kmsub(im1,ksub(ltet3,n3),kmul(im3,n1)),Ro313,kmadd(kmsub(im2,ksub(ltet3,n3),kmul(im3,n2)),Ro323,kmul(im3,kmul(Ro333,kmadd(ToReal(-2),n3,ltet3)))))))))))),kmul(kmadd(im1,kmadd(ksub(ltet1,n1),Rojo11,kmadd(ksub(ltet2,n2),Rojo21,kmul(Rojo31,ksub(ltet3,n3)))),kmadd(im2,kmadd(ksub(ltet1,n1),Rojo12,kmadd(ksub(ltet2,n2),Rojo22,kmul(Rojo32,ksub(ltet3,n3)))),kmul(im3,kmadd(ksub(ltet1,n1),Rojo13,kmadd(ksub(ltet2,n2),Rojo23,kmul(Rojo33,ksub(ltet3,n3))))))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi0rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(im1,im2,kmul(rm1,rm2)),kmsub(ltet1,kmadd(ltet2,R4p1212,kmul(ltet3,R4p1213)),kmul(ltet3,kmadd(ltet2,R4p1223,kmul(ltet3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(ltet1,kmsub(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmsub(R4p1213,kmul(ltet1,ltet1),kmul(ltet2,kmul(ltet3,R4p2323)))),kmsub(rm2,rm3,kmul(im2,im3))),kmadd(ToReal(2),kmul(kmadd(ltet1,kmul(ltet2,R4p1213),kmadd(ltet1,kmul(ltet3,R4p1313),kmadd(ltet2,kmul(ltet3,R4p1323),kmul(R4p1223,kmul(ltet2,ltet2))))),kmsub(im1,im3,kmul(rm1,rm3))),knmsub(kmadd(ToReal(2),kmul(ltet2,kmul(ltet3,R4p1213)),kmadd(R4p1212,kmul(ltet2,ltet2),kmul(R4p1313,kmul(ltet3,ltet3)))),kmsub(im1,im1,kmul(rm1,rm1)),knmsub(kmadd(ToReal(-2),kmul(ltet1,kmul(ltet3,R4p1223)),kmadd(R4p1212,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet3,ltet3)))),kmsub(im2,im2,kmul(rm2,rm2)),knmsub(kmul(nn,nn),kmadd(kmsub(im2,im3,kmul(rm2,rm3)),Rojo23,kmadd(im1,kmadd(im2,kadd(Rojo12,Rojo21),kmul(im3,kadd(Rojo13,Rojo31))),knmsub(rm1,kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31))),kmadd(kmsub(im2,im3,kmul(rm2,rm3)),Rojo32,kmadd(Rojo11,kmsub(im1,im1,kmul(rm1,rm1)),kmadd(Rojo22,kmsub(im2,im2,kmul(rm2,rm2)),kmul(Rojo33,kmsub(im3,im3,kmul(rm3,rm3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rm1,rm2,kmul(im1,im2)),kmadd(ltet1,Ro112,kmadd(ltet2,Ro122,kmul(ltet3,Ro132))),kmadd(kmsub(rm1,rm3,kmul(im1,im3)),kmadd(ltet1,Ro113,kmadd(ltet2,Ro123,kmul(ltet3,Ro133))),kmadd(kmsub(rm1,rm2,kmul(im1,im2)),kmadd(ltet1,Ro211,kmadd(ltet2,Ro221,kmul(ltet3,Ro231))),kmadd(kmsub(rm2,rm3,kmul(im2,im3)),kmadd(ltet1,Ro213,kmadd(ltet2,Ro223,kmul(ltet3,Ro233))),kmadd(kmsub(rm1,rm3,kmul(im1,im3)),kmadd(ltet1,Ro311,kmadd(ltet2,Ro321,kmul(ltet3,Ro331))),kmadd(kmsub(rm2,rm3,kmul(im2,im3)),kmadd(ltet1,Ro312,kmadd(ltet2,Ro322,kmul(ltet3,Ro332))),kmadd(kmadd(ltet1,Ro111,kmadd(ltet2,Ro121,kmul(ltet3,Ro131))),kmsub(rm1,rm1,kmul(im1,im1)),kmadd(kmadd(ltet1,Ro212,kmadd(ltet2,Ro222,kmul(ltet3,Ro232))),kmsub(rm2,rm2,kmul(im2,im2)),kmul(kmadd(ltet1,Ro313,kmadd(ltet2,Ro323,kmul(ltet3,Ro333))),kmsub(rm3,rm3,kmul(im3,im3)))))))))))),kmul(kmadd(ToReal(2),kmul(ltet1,kmul(ltet2,R4p1323)),kmadd(R4p1313,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet2,ltet2)))),kmsub(im3,im3,kmul(rm3,rm3))))))))));
    
    CCTK_REAL_VEC Psi0iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(-2),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(ltet1,kmadd(ltet2,R4p1213,kmul(ltet3,R4p1313)),kmadd(ltet2,kmul(ltet3,R4p1323),kmul(R4p1223,kmul(ltet2,ltet2))))),kmadd(ToReal(2),kmadd(kmsub(ltet3,kmadd(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmul(ltet1,kmadd(ltet2,R4p1212,kmul(ltet3,R4p1213)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,kmadd(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(ltet1,kadd(Ro112,Ro211),kmadd(ltet2,kadd(Ro122,Ro221),kmul(ltet3,kadd(Ro132,Ro231)))),kmadd(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(ltet1,kadd(Ro113,Ro311),kmadd(ltet2,kadd(Ro123,Ro321),kmul(ltet3,kadd(Ro133,Ro331)))),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(ltet1,kadd(Ro213,Ro312),kmadd(ltet2,kadd(Ro223,Ro322),kmul(ltet3,kadd(Ro233,Ro332)))),kmul(kmadd(im1,kmul(rm1,kmadd(ltet1,Ro111,kmadd(ltet2,Ro121,kmul(ltet3,Ro131)))),kmadd(im2,kmul(rm2,kmadd(ltet1,Ro212,kmadd(ltet2,Ro222,kmul(ltet3,Ro232)))),kmul(im3,kmul(rm3,kmadd(ltet1,Ro313,kmadd(ltet2,Ro323,kmul(ltet3,Ro333))))))),ToReal(2))))),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(ltet1,kmsub(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmsub(R4p1213,kmul(ltet1,ltet1),kmul(ltet2,kmul(ltet3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(ltet1,kmul(ltet2,R4p1323)),kmadd(R4p1313,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet2,ltet2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(ltet2,kmul(ltet3,R4p1213)),kmadd(R4p1212,kmul(ltet2,ltet2),kmul(R4p1313,kmul(ltet3,ltet3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(ltet1,kmul(ltet3,R4p1223)),kmadd(R4p1212,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet3,ltet3))))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(Psi0i[index],Psi0iL);
    vec_store_nta_partial(Psi0r[index],Psi0rL);
    vec_store_nta_partial(Psi1i[index],Psi1iL);
    vec_store_nta_partial(Psi1r[index],Psi1rL);
    vec_store_nta_partial(Psi2i[index],Psi2iL);
    vec_store_nta_partial(Psi2r[index],Psi2rL);
    vec_store_nta_partial(Psi3i[index],Psi3iL);
    vec_store_nta_partial(Psi3r[index],Psi3rL);
    vec_store_nta_partial(Psi4i[index],Psi4iL);
    vec_store_nta_partial(Psi4r[index],Psi4rL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_psis_calc_Nth);
}
extern "C" void WeylScal4_psis_calc_Nth(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_psis_calc_Nth_Body");
  }
  if (cctk_iteration % WeylScal4_psis_calc_Nth_calc_every != WeylScal4_psis_calc_Nth_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "admbase::curv",
    "admbase::metric",
    "grid::coordinates",
    "WeylScal4::Psi0i_group",
    "WeylScal4::Psi0r_group",
    "WeylScal4::Psi1i_group",
    "WeylScal4::Psi1r_group",
    "WeylScal4::Psi2i_group",
    "WeylScal4::Psi2r_group",
    "WeylScal4::Psi3i_group",
    "WeylScal4::Psi3r_group",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_psis_calc_Nth", 13, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_Nth", 1, 1, 1);
      break;
    }
    
    case 4:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_Nth", 2, 2, 2);
      break;
    }
    
    case 6:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_Nth", 3, 3, 3);
      break;
    }
    
    case 8:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_Nth", 4, 4, 4);
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverInterior(cctkGH, WeylScal4_psis_calc_Nth_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_psis_calc_Nth_Body");
  }
}

} // namespace WeylScal4

```

WeylScal4_psi4_calc_Nth.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {

extern "C" void WeylScal4_psi4_calc_Nth_SelectBCs(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (cctk_iteration % WeylScal4_psi4_calc_Nth_calc_every != WeylScal4_psi4_calc_Nth_calc_offset)
    return;
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4r_group.");
  return;
}

static void WeylScal4_psi4_calc_Nth_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_psi4_calc_Nth,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC gxxL CCTK_ATTRIBUTE_UNUSED = vec_load(gxx[index]);
    CCTK_REAL_VEC gxyL CCTK_ATTRIBUTE_UNUSED = vec_load(gxy[index]);
    CCTK_REAL_VEC gxzL CCTK_ATTRIBUTE_UNUSED = vec_load(gxz[index]);
    CCTK_REAL_VEC gyyL CCTK_ATTRIBUTE_UNUSED = vec_load(gyy[index]);
    CCTK_REAL_VEC gyzL CCTK_ATTRIBUTE_UNUSED = vec_load(gyz[index]);
    CCTK_REAL_VEC gzzL CCTK_ATTRIBUTE_UNUSED = vec_load(gzz[index]);
    CCTK_REAL_VEC kxxL CCTK_ATTRIBUTE_UNUSED = vec_load(kxx[index]);
    CCTK_REAL_VEC kxyL CCTK_ATTRIBUTE_UNUSED = vec_load(kxy[index]);
    CCTK_REAL_VEC kxzL CCTK_ATTRIBUTE_UNUSED = vec_load(kxz[index]);
    CCTK_REAL_VEC kyyL CCTK_ATTRIBUTE_UNUSED = vec_load(kyy[index]);
    CCTK_REAL_VEC kyzL CCTK_ATTRIBUTE_UNUSED = vec_load(kyz[index]);
    CCTK_REAL_VEC kzzL CCTK_ATTRIBUTE_UNUSED = vec_load(kzz[index]);
    CCTK_REAL_VEC xL CCTK_ATTRIBUTE_UNUSED = vec_load(x[index]);
    CCTK_REAL_VEC yL CCTK_ATTRIBUTE_UNUSED = vec_load(y[index]);
    CCTK_REAL_VEC zL CCTK_ATTRIBUTE_UNUSED = vec_load(z[index]);
    
    
    CCTK_REAL_VEC dJ111L, dJ112L, dJ113L, dJ122L, dJ123L, dJ133L, dJ211L, dJ212L, dJ213L, dJ222L, dJ223L, dJ233L, dJ311L, dJ312L, dJ313L, dJ322L, dJ323L, dJ333L, J11L, J12L, J13L, J21L, J22L, J23L, J31L, J32L, J33L CCTK_ATTRIBUTE_UNUSED ;
    
    if (usejacobian)
    {
      dJ111L = vec_load(dJ111[index]);
      dJ112L = vec_load(dJ112[index]);
      dJ113L = vec_load(dJ113[index]);
      dJ122L = vec_load(dJ122[index]);
      dJ123L = vec_load(dJ123[index]);
      dJ133L = vec_load(dJ133[index]);
      dJ211L = vec_load(dJ211[index]);
      dJ212L = vec_load(dJ212[index]);
      dJ213L = vec_load(dJ213[index]);
      dJ222L = vec_load(dJ222[index]);
      dJ223L = vec_load(dJ223[index]);
      dJ233L = vec_load(dJ233[index]);
      dJ311L = vec_load(dJ311[index]);
      dJ312L = vec_load(dJ312[index]);
      dJ313L = vec_load(dJ313[index]);
      dJ322L = vec_load(dJ322[index]);
      dJ323L = vec_load(dJ323[index]);
      dJ333L = vec_load(dJ333[index]);
      J11L = vec_load(J11[index]);
      J12L = vec_load(J12[index]);
      J13L = vec_load(J13[index]);
      J21L = vec_load(J21[index]);
      J22L = vec_load(J22[index]);
      J23L = vec_load(J23[index]);
      J31L = vec_load(J31[index]);
      J32L = vec_load(J32[index]);
      J33L = vec_load(J33[index]);
    }
    /* Include user supplied include files */
    /* Precompute derivatives */
    CCTK_REAL_VEC PDstandard1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard33gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard13gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard23gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard3kzz CCTK_ATTRIBUTE_UNUSED;
    
    switch (fdOrder)
    {
      case 2:
      {
        PDstandard1gxx = PDstandardfdOrder21(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder22(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder23(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder211(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder222(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder233(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder212(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder213(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder223(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder21(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder22(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder23(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder211(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder222(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder233(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder212(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder213(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder223(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder21(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder22(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder23(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder211(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder222(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder233(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder212(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder213(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder223(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder21(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder22(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder23(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder211(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder222(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder233(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder212(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder213(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder223(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder21(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder22(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder23(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder211(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder222(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder233(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder212(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder213(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder223(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder21(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder22(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder23(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder211(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder222(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder233(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder212(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder213(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder223(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder21(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder22(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder23(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder21(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder22(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder23(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder21(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder22(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder23(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder21(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder22(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder23(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder21(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder22(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder23(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder21(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder22(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder23(&kzz[index]);
        break;
      }
      
      case 4:
      {
        PDstandard1gxx = PDstandardfdOrder41(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder42(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder43(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder411(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder422(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder433(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder412(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder413(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder423(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder41(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder42(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder43(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder411(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder422(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder433(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder412(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder413(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder423(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder41(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder42(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder43(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder411(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder422(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder433(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder412(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder413(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder423(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder41(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder42(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder43(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder411(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder422(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder433(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder412(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder413(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder423(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder41(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder42(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder43(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder411(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder422(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder433(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder412(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder413(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder423(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder41(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder42(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder43(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder411(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder422(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder433(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder412(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder413(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder423(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder41(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder42(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder43(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder41(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder42(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder43(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder41(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder42(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder43(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder41(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder42(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder43(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder41(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder42(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder43(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder41(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder42(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder43(&kzz[index]);
        break;
      }
      
      case 6:
      {
        PDstandard1gxx = PDstandardfdOrder61(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder62(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder63(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder611(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder622(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder633(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder612(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder613(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder623(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder61(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder62(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder63(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder611(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder622(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder633(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder612(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder613(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder623(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder61(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder62(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder63(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder611(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder622(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder633(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder612(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder613(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder623(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder61(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder62(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder63(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder611(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder622(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder633(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder612(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder613(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder623(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder61(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder62(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder63(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder611(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder622(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder633(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder612(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder613(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder623(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder61(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder62(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder63(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder611(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder622(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder633(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder612(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder613(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder623(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder61(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder62(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder63(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder61(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder62(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder63(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder61(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder62(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder63(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder61(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder62(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder63(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder61(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder62(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder63(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder61(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder62(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder63(&kzz[index]);
        break;
      }
      
      case 8:
      {
        PDstandard1gxx = PDstandardfdOrder81(&gxx[index]);
        PDstandard2gxx = PDstandardfdOrder82(&gxx[index]);
        PDstandard3gxx = PDstandardfdOrder83(&gxx[index]);
        PDstandard11gxx = PDstandardfdOrder811(&gxx[index]);
        PDstandard22gxx = PDstandardfdOrder822(&gxx[index]);
        PDstandard33gxx = PDstandardfdOrder833(&gxx[index]);
        PDstandard12gxx = PDstandardfdOrder812(&gxx[index]);
        PDstandard13gxx = PDstandardfdOrder813(&gxx[index]);
        PDstandard23gxx = PDstandardfdOrder823(&gxx[index]);
        PDstandard1gxy = PDstandardfdOrder81(&gxy[index]);
        PDstandard2gxy = PDstandardfdOrder82(&gxy[index]);
        PDstandard3gxy = PDstandardfdOrder83(&gxy[index]);
        PDstandard11gxy = PDstandardfdOrder811(&gxy[index]);
        PDstandard22gxy = PDstandardfdOrder822(&gxy[index]);
        PDstandard33gxy = PDstandardfdOrder833(&gxy[index]);
        PDstandard12gxy = PDstandardfdOrder812(&gxy[index]);
        PDstandard13gxy = PDstandardfdOrder813(&gxy[index]);
        PDstandard23gxy = PDstandardfdOrder823(&gxy[index]);
        PDstandard1gxz = PDstandardfdOrder81(&gxz[index]);
        PDstandard2gxz = PDstandardfdOrder82(&gxz[index]);
        PDstandard3gxz = PDstandardfdOrder83(&gxz[index]);
        PDstandard11gxz = PDstandardfdOrder811(&gxz[index]);
        PDstandard22gxz = PDstandardfdOrder822(&gxz[index]);
        PDstandard33gxz = PDstandardfdOrder833(&gxz[index]);
        PDstandard12gxz = PDstandardfdOrder812(&gxz[index]);
        PDstandard13gxz = PDstandardfdOrder813(&gxz[index]);
        PDstandard23gxz = PDstandardfdOrder823(&gxz[index]);
        PDstandard1gyy = PDstandardfdOrder81(&gyy[index]);
        PDstandard2gyy = PDstandardfdOrder82(&gyy[index]);
        PDstandard3gyy = PDstandardfdOrder83(&gyy[index]);
        PDstandard11gyy = PDstandardfdOrder811(&gyy[index]);
        PDstandard22gyy = PDstandardfdOrder822(&gyy[index]);
        PDstandard33gyy = PDstandardfdOrder833(&gyy[index]);
        PDstandard12gyy = PDstandardfdOrder812(&gyy[index]);
        PDstandard13gyy = PDstandardfdOrder813(&gyy[index]);
        PDstandard23gyy = PDstandardfdOrder823(&gyy[index]);
        PDstandard1gyz = PDstandardfdOrder81(&gyz[index]);
        PDstandard2gyz = PDstandardfdOrder82(&gyz[index]);
        PDstandard3gyz = PDstandardfdOrder83(&gyz[index]);
        PDstandard11gyz = PDstandardfdOrder811(&gyz[index]);
        PDstandard22gyz = PDstandardfdOrder822(&gyz[index]);
        PDstandard33gyz = PDstandardfdOrder833(&gyz[index]);
        PDstandard12gyz = PDstandardfdOrder812(&gyz[index]);
        PDstandard13gyz = PDstandardfdOrder813(&gyz[index]);
        PDstandard23gyz = PDstandardfdOrder823(&gyz[index]);
        PDstandard1gzz = PDstandardfdOrder81(&gzz[index]);
        PDstandard2gzz = PDstandardfdOrder82(&gzz[index]);
        PDstandard3gzz = PDstandardfdOrder83(&gzz[index]);
        PDstandard11gzz = PDstandardfdOrder811(&gzz[index]);
        PDstandard22gzz = PDstandardfdOrder822(&gzz[index]);
        PDstandard33gzz = PDstandardfdOrder833(&gzz[index]);
        PDstandard12gzz = PDstandardfdOrder812(&gzz[index]);
        PDstandard13gzz = PDstandardfdOrder813(&gzz[index]);
        PDstandard23gzz = PDstandardfdOrder823(&gzz[index]);
        PDstandard1kxx = PDstandardfdOrder81(&kxx[index]);
        PDstandard2kxx = PDstandardfdOrder82(&kxx[index]);
        PDstandard3kxx = PDstandardfdOrder83(&kxx[index]);
        PDstandard1kxy = PDstandardfdOrder81(&kxy[index]);
        PDstandard2kxy = PDstandardfdOrder82(&kxy[index]);
        PDstandard3kxy = PDstandardfdOrder83(&kxy[index]);
        PDstandard1kxz = PDstandardfdOrder81(&kxz[index]);
        PDstandard2kxz = PDstandardfdOrder82(&kxz[index]);
        PDstandard3kxz = PDstandardfdOrder83(&kxz[index]);
        PDstandard1kyy = PDstandardfdOrder81(&kyy[index]);
        PDstandard2kyy = PDstandardfdOrder82(&kyy[index]);
        PDstandard3kyy = PDstandardfdOrder83(&kyy[index]);
        PDstandard1kyz = PDstandardfdOrder81(&kyz[index]);
        PDstandard2kyz = PDstandardfdOrder82(&kyz[index]);
        PDstandard3kyz = PDstandardfdOrder83(&kyz[index]);
        PDstandard1kzz = PDstandardfdOrder81(&kzz[index]);
        PDstandard2kzz = PDstandardfdOrder82(&kzz[index]);
        PDstandard3kzz = PDstandardfdOrder83(&kzz[index]);
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC JacPDstandard11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard21gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard31gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard32gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard3kyz CCTK_ATTRIBUTE_UNUSED;
    
    if (usejacobian)
    {
      JacPDstandard1gxx = 
        kmadd(J11L,PDstandard1gxx,kmadd(J21L,PDstandard2gxx,kmul(J31L,PDstandard3gxx)));
      
      JacPDstandard1gxy = 
        kmadd(J11L,PDstandard1gxy,kmadd(J21L,PDstandard2gxy,kmul(J31L,PDstandard3gxy)));
      
      JacPDstandard1gxz = 
        kmadd(J11L,PDstandard1gxz,kmadd(J21L,PDstandard2gxz,kmul(J31L,PDstandard3gxz)));
      
      JacPDstandard1gyy = 
        kmadd(J11L,PDstandard1gyy,kmadd(J21L,PDstandard2gyy,kmul(J31L,PDstandard3gyy)));
      
      JacPDstandard1gyz = 
        kmadd(J11L,PDstandard1gyz,kmadd(J21L,PDstandard2gyz,kmul(J31L,PDstandard3gyz)));
      
      JacPDstandard1gzz = 
        kmadd(J11L,PDstandard1gzz,kmadd(J21L,PDstandard2gzz,kmul(J31L,PDstandard3gzz)));
      
      JacPDstandard1kxy = 
        kmadd(J11L,PDstandard1kxy,kmadd(J21L,PDstandard2kxy,kmul(J31L,PDstandard3kxy)));
      
      JacPDstandard1kxz = 
        kmadd(J11L,PDstandard1kxz,kmadd(J21L,PDstandard2kxz,kmul(J31L,PDstandard3kxz)));
      
      JacPDstandard1kyy = 
        kmadd(J11L,PDstandard1kyy,kmadd(J21L,PDstandard2kyy,kmul(J31L,PDstandard3kyy)));
      
      JacPDstandard1kyz = 
        kmadd(J11L,PDstandard1kyz,kmadd(J21L,PDstandard2kyz,kmul(J31L,PDstandard3kyz)));
      
      JacPDstandard1kzz = 
        kmadd(J11L,PDstandard1kzz,kmadd(J21L,PDstandard2kzz,kmul(J31L,PDstandard3kzz)));
      
      JacPDstandard2gxx = 
        kmadd(J12L,PDstandard1gxx,kmadd(J22L,PDstandard2gxx,kmul(J32L,PDstandard3gxx)));
      
      JacPDstandard2gxy = 
        kmadd(J12L,PDstandard1gxy,kmadd(J22L,PDstandard2gxy,kmul(J32L,PDstandard3gxy)));
      
      JacPDstandard2gxz = 
        kmadd(J12L,PDstandard1gxz,kmadd(J22L,PDstandard2gxz,kmul(J32L,PDstandard3gxz)));
      
      JacPDstandard2gyy = 
        kmadd(J12L,PDstandard1gyy,kmadd(J22L,PDstandard2gyy,kmul(J32L,PDstandard3gyy)));
      
      JacPDstandard2gyz = 
        kmadd(J12L,PDstandard1gyz,kmadd(J22L,PDstandard2gyz,kmul(J32L,PDstandard3gyz)));
      
      JacPDstandard2gzz = 
        kmadd(J12L,PDstandard1gzz,kmadd(J22L,PDstandard2gzz,kmul(J32L,PDstandard3gzz)));
      
      JacPDstandard2kxx = 
        kmadd(J12L,PDstandard1kxx,kmadd(J22L,PDstandard2kxx,kmul(J32L,PDstandard3kxx)));
      
      JacPDstandard2kxy = 
        kmadd(J12L,PDstandard1kxy,kmadd(J22L,PDstandard2kxy,kmul(J32L,PDstandard3kxy)));
      
      JacPDstandard2kxz = 
        kmadd(J12L,PDstandard1kxz,kmadd(J22L,PDstandard2kxz,kmul(J32L,PDstandard3kxz)));
      
      JacPDstandard2kyz = 
        kmadd(J12L,PDstandard1kyz,kmadd(J22L,PDstandard2kyz,kmul(J32L,PDstandard3kyz)));
      
      JacPDstandard2kzz = 
        kmadd(J12L,PDstandard1kzz,kmadd(J22L,PDstandard2kzz,kmul(J32L,PDstandard3kzz)));
      
      JacPDstandard3gxx = 
        kmadd(J13L,PDstandard1gxx,kmadd(J23L,PDstandard2gxx,kmul(J33L,PDstandard3gxx)));
      
      JacPDstandard3gxy = 
        kmadd(J13L,PDstandard1gxy,kmadd(J23L,PDstandard2gxy,kmul(J33L,PDstandard3gxy)));
      
      JacPDstandard3gxz = 
        kmadd(J13L,PDstandard1gxz,kmadd(J23L,PDstandard2gxz,kmul(J33L,PDstandard3gxz)));
      
      JacPDstandard3gyy = 
        kmadd(J13L,PDstandard1gyy,kmadd(J23L,PDstandard2gyy,kmul(J33L,PDstandard3gyy)));
      
      JacPDstandard3gyz = 
        kmadd(J13L,PDstandard1gyz,kmadd(J23L,PDstandard2gyz,kmul(J33L,PDstandard3gyz)));
      
      JacPDstandard3gzz = 
        kmadd(J13L,PDstandard1gzz,kmadd(J23L,PDstandard2gzz,kmul(J33L,PDstandard3gzz)));
      
      JacPDstandard3kxx = 
        kmadd(J13L,PDstandard1kxx,kmadd(J23L,PDstandard2kxx,kmul(J33L,PDstandard3kxx)));
      
      JacPDstandard3kxy = 
        kmadd(J13L,PDstandard1kxy,kmadd(J23L,PDstandard2kxy,kmul(J33L,PDstandard3kxy)));
      
      JacPDstandard3kxz = 
        kmadd(J13L,PDstandard1kxz,kmadd(J23L,PDstandard2kxz,kmul(J33L,PDstandard3kxz)));
      
      JacPDstandard3kyy = 
        kmadd(J13L,PDstandard1kyy,kmadd(J23L,PDstandard2kyy,kmul(J33L,PDstandard3kyy)));
      
      JacPDstandard3kyz = 
        kmadd(J13L,PDstandard1kyz,kmadd(J23L,PDstandard2kyz,kmul(J33L,PDstandard3kyz)));
      
      JacPDstandard11gyy = 
        kmadd(dJ111L,PDstandard1gyy,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard12gyy,kmul(J31L,PDstandard13gyy)),kmul(J21L,kmul(J31L,PDstandard23gyy))),kmadd(dJ211L,PDstandard2gyy,kmadd(dJ311L,PDstandard3gyy,kmadd(PDstandard11gyy,kmul(J11L,J11L),kmadd(PDstandard22gyy,kmul(J21L,J21L),kmul(PDstandard33gyy,kmul(J31L,J31L))))))));
      
      JacPDstandard11gyz = 
        kmadd(dJ111L,PDstandard1gyz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard12gyz,kmul(J31L,PDstandard13gyz)),kmul(J21L,kmul(J31L,PDstandard23gyz))),kmadd(dJ211L,PDstandard2gyz,kmadd(dJ311L,PDstandard3gyz,kmadd(PDstandard11gyz,kmul(J11L,J11L),kmadd(PDstandard22gyz,kmul(J21L,J21L),kmul(PDstandard33gyz,kmul(J31L,J31L))))))));
      
      JacPDstandard11gzz = 
        kmadd(dJ111L,PDstandard1gzz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard12gzz,kmul(J31L,PDstandard13gzz)),kmul(J21L,kmul(J31L,PDstandard23gzz))),kmadd(dJ211L,PDstandard2gzz,kmadd(dJ311L,PDstandard3gzz,kmadd(PDstandard11gzz,kmul(J11L,J11L),kmadd(PDstandard22gzz,kmul(J21L,J21L),kmul(PDstandard33gzz,kmul(J31L,J31L))))))));
      
      JacPDstandard22gxx = 
        kmadd(dJ122L,PDstandard1gxx,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard12gxx,kmul(J32L,PDstandard13gxx)),kmul(J22L,kmul(J32L,PDstandard23gxx))),kmadd(dJ222L,PDstandard2gxx,kmadd(dJ322L,PDstandard3gxx,kmadd(PDstandard11gxx,kmul(J12L,J12L),kmadd(PDstandard22gxx,kmul(J22L,J22L),kmul(PDstandard33gxx,kmul(J32L,J32L))))))));
      
      JacPDstandard22gxz = 
        kmadd(dJ122L,PDstandard1gxz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard12gxz,kmul(J32L,PDstandard13gxz)),kmul(J22L,kmul(J32L,PDstandard23gxz))),kmadd(dJ222L,PDstandard2gxz,kmadd(dJ322L,PDstandard3gxz,kmadd(PDstandard11gxz,kmul(J12L,J12L),kmadd(PDstandard22gxz,kmul(J22L,J22L),kmul(PDstandard33gxz,kmul(J32L,J32L))))))));
      
      JacPDstandard22gzz = 
        kmadd(dJ122L,PDstandard1gzz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard12gzz,kmul(J32L,PDstandard13gzz)),kmul(J22L,kmul(J32L,PDstandard23gzz))),kmadd(dJ222L,PDstandard2gzz,kmadd(dJ322L,PDstandard3gzz,kmadd(PDstandard11gzz,kmul(J12L,J12L),kmadd(PDstandard22gzz,kmul(J22L,J22L),kmul(PDstandard33gzz,kmul(J32L,J32L))))))));
      
      JacPDstandard33gxx = 
        kmadd(dJ133L,PDstandard1gxx,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard12gxx,kmul(J33L,PDstandard13gxx)),kmul(J23L,kmul(J33L,PDstandard23gxx))),kmadd(dJ233L,PDstandard2gxx,kmadd(dJ333L,PDstandard3gxx,kmadd(PDstandard11gxx,kmul(J13L,J13L),kmadd(PDstandard22gxx,kmul(J23L,J23L),kmul(PDstandard33gxx,kmul(J33L,J33L))))))));
      
      JacPDstandard33gxy = 
        kmadd(dJ133L,PDstandard1gxy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard12gxy,kmul(J33L,PDstandard13gxy)),kmul(J23L,kmul(J33L,PDstandard23gxy))),kmadd(dJ233L,PDstandard2gxy,kmadd(dJ333L,PDstandard3gxy,kmadd(PDstandard11gxy,kmul(J13L,J13L),kmadd(PDstandard22gxy,kmul(J23L,J23L),kmul(PDstandard33gxy,kmul(J33L,J33L))))))));
      
      JacPDstandard33gyy = 
        kmadd(dJ133L,PDstandard1gyy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard12gyy,kmul(J33L,PDstandard13gyy)),kmul(J23L,kmul(J33L,PDstandard23gyy))),kmadd(dJ233L,PDstandard2gyy,kmadd(dJ333L,PDstandard3gyy,kmadd(PDstandard11gyy,kmul(J13L,J13L),kmadd(PDstandard22gyy,kmul(J23L,J23L),kmul(PDstandard33gyy,kmul(J33L,J33L))))))));
      
      JacPDstandard12gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard11gxy,kmadd(J21L,PDstandard12gxy,kmul(J31L,PDstandard13gxy))),kmadd(J11L,kmadd(J22L,PDstandard12gxy,kmul(J32L,PDstandard13gxy)),kmadd(dJ112L,PDstandard1gxy,kmadd(J22L,kmadd(J21L,PDstandard22gxy,kmul(J31L,PDstandard23gxy)),kmadd(dJ212L,PDstandard2gxy,kmadd(J32L,kmadd(J21L,PDstandard23gxy,kmul(J31L,PDstandard33gxy)),kmul(dJ312L,PDstandard3gxy)))))));
      
      JacPDstandard12gxz = 
        kmadd(J12L,kmadd(J11L,PDstandard11gxz,kmadd(J21L,PDstandard12gxz,kmul(J31L,PDstandard13gxz))),kmadd(J11L,kmadd(J22L,PDstandard12gxz,kmul(J32L,PDstandard13gxz)),kmadd(dJ112L,PDstandard1gxz,kmadd(J22L,kmadd(J21L,PDstandard22gxz,kmul(J31L,PDstandard23gxz)),kmadd(dJ212L,PDstandard2gxz,kmadd(J32L,kmadd(J21L,PDstandard23gxz,kmul(J31L,PDstandard33gxz)),kmul(dJ312L,PDstandard3gxz)))))));
      
      JacPDstandard12gyz = 
        kmadd(J12L,kmadd(J11L,PDstandard11gyz,kmadd(J21L,PDstandard12gyz,kmul(J31L,PDstandard13gyz))),kmadd(J11L,kmadd(J22L,PDstandard12gyz,kmul(J32L,PDstandard13gyz)),kmadd(dJ112L,PDstandard1gyz,kmadd(J22L,kmadd(J21L,PDstandard22gyz,kmul(J31L,PDstandard23gyz)),kmadd(dJ212L,PDstandard2gyz,kmadd(J32L,kmadd(J21L,PDstandard23gyz,kmul(J31L,PDstandard33gyz)),kmul(dJ312L,PDstandard3gyz)))))));
      
      JacPDstandard12gzz = 
        kmadd(J12L,kmadd(J11L,PDstandard11gzz,kmadd(J21L,PDstandard12gzz,kmul(J31L,PDstandard13gzz))),kmadd(J11L,kmadd(J22L,PDstandard12gzz,kmul(J32L,PDstandard13gzz)),kmadd(dJ112L,PDstandard1gzz,kmadd(J22L,kmadd(J21L,PDstandard22gzz,kmul(J31L,PDstandard23gzz)),kmadd(dJ212L,PDstandard2gzz,kmadd(J32L,kmadd(J21L,PDstandard23gzz,kmul(J31L,PDstandard33gzz)),kmul(dJ312L,PDstandard3gzz)))))));
      
      JacPDstandard13gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard11gxz,kmadd(J21L,PDstandard12gxz,kmul(J31L,PDstandard13gxz))),kmadd(J11L,kmadd(J23L,PDstandard12gxz,kmul(J33L,PDstandard13gxz)),kmadd(dJ113L,PDstandard1gxz,kmadd(J23L,kmadd(J21L,PDstandard22gxz,kmul(J31L,PDstandard23gxz)),kmadd(dJ213L,PDstandard2gxz,kmadd(J33L,kmadd(J21L,PDstandard23gxz,kmul(J31L,PDstandard33gxz)),kmul(dJ313L,PDstandard3gxz)))))));
      
      JacPDstandard21gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard11gxy,kmadd(J21L,PDstandard12gxy,kmul(J31L,PDstandard13gxy))),kmadd(J11L,kmadd(J22L,PDstandard12gxy,kmul(J32L,PDstandard13gxy)),kmadd(dJ112L,PDstandard1gxy,kmadd(J22L,kmadd(J21L,PDstandard22gxy,kmul(J31L,PDstandard23gxy)),kmadd(dJ212L,PDstandard2gxy,kmadd(J32L,kmadd(J21L,PDstandard23gxy,kmul(J31L,PDstandard33gxy)),kmul(dJ312L,PDstandard3gxy)))))));
      
      JacPDstandard23gxx = 
        kmadd(J13L,kmadd(J12L,PDstandard11gxx,kmadd(J22L,PDstandard12gxx,kmul(J32L,PDstandard13gxx))),kmadd(J12L,kmadd(J23L,PDstandard12gxx,kmul(J33L,PDstandard13gxx)),kmadd(dJ123L,PDstandard1gxx,kmadd(J23L,kmadd(J22L,PDstandard22gxx,kmul(J32L,PDstandard23gxx)),kmadd(dJ223L,PDstandard2gxx,kmadd(J33L,kmadd(J22L,PDstandard23gxx,kmul(J32L,PDstandard33gxx)),kmul(dJ323L,PDstandard3gxx)))))));
      
      JacPDstandard23gxy = 
        kmadd(J13L,kmadd(J12L,PDstandard11gxy,kmadd(J22L,PDstandard12gxy,kmul(J32L,PDstandard13gxy))),kmadd(J12L,kmadd(J23L,PDstandard12gxy,kmul(J33L,PDstandard13gxy)),kmadd(dJ123L,PDstandard1gxy,kmadd(J23L,kmadd(J22L,PDstandard22gxy,kmul(J32L,PDstandard23gxy)),kmadd(dJ223L,PDstandard2gxy,kmadd(J33L,kmadd(J22L,PDstandard23gxy,kmul(J32L,PDstandard33gxy)),kmul(dJ323L,PDstandard3gxy)))))));
      
      JacPDstandard23gxz = 
        kmadd(J13L,kmadd(J12L,PDstandard11gxz,kmadd(J22L,PDstandard12gxz,kmul(J32L,PDstandard13gxz))),kmadd(J12L,kmadd(J23L,PDstandard12gxz,kmul(J33L,PDstandard13gxz)),kmadd(dJ123L,PDstandard1gxz,kmadd(J23L,kmadd(J22L,PDstandard22gxz,kmul(J32L,PDstandard23gxz)),kmadd(dJ223L,PDstandard2gxz,kmadd(J33L,kmadd(J22L,PDstandard23gxz,kmul(J32L,PDstandard33gxz)),kmul(dJ323L,PDstandard3gxz)))))));
      
      JacPDstandard23gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard11gyz,kmadd(J22L,PDstandard12gyz,kmul(J32L,PDstandard13gyz))),kmadd(J12L,kmadd(J23L,PDstandard12gyz,kmul(J33L,PDstandard13gyz)),kmadd(dJ123L,PDstandard1gyz,kmadd(J23L,kmadd(J22L,PDstandard22gyz,kmul(J32L,PDstandard23gyz)),kmadd(dJ223L,PDstandard2gyz,kmadd(J33L,kmadd(J22L,PDstandard23gyz,kmul(J32L,PDstandard33gyz)),kmul(dJ323L,PDstandard3gyz)))))));
      
      JacPDstandard31gxy = 
        kmadd(J13L,kmadd(J11L,PDstandard11gxy,kmadd(J21L,PDstandard12gxy,kmul(J31L,PDstandard13gxy))),kmadd(J11L,kmadd(J23L,PDstandard12gxy,kmul(J33L,PDstandard13gxy)),kmadd(dJ113L,PDstandard1gxy,kmadd(J23L,kmadd(J21L,PDstandard22gxy,kmul(J31L,PDstandard23gxy)),kmadd(dJ213L,PDstandard2gxy,kmadd(J33L,kmadd(J21L,PDstandard23gxy,kmul(J31L,PDstandard33gxy)),kmul(dJ313L,PDstandard3gxy)))))));
      
      JacPDstandard31gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard11gxz,kmadd(J21L,PDstandard12gxz,kmul(J31L,PDstandard13gxz))),kmadd(J11L,kmadd(J23L,PDstandard12gxz,kmul(J33L,PDstandard13gxz)),kmadd(dJ113L,PDstandard1gxz,kmadd(J23L,kmadd(J21L,PDstandard22gxz,kmul(J31L,PDstandard23gxz)),kmadd(dJ213L,PDstandard2gxz,kmadd(J33L,kmadd(J21L,PDstandard23gxz,kmul(J31L,PDstandard33gxz)),kmul(dJ313L,PDstandard3gxz)))))));
      
      JacPDstandard31gyy = 
        kmadd(J13L,kmadd(J11L,PDstandard11gyy,kmadd(J21L,PDstandard12gyy,kmul(J31L,PDstandard13gyy))),kmadd(J11L,kmadd(J23L,PDstandard12gyy,kmul(J33L,PDstandard13gyy)),kmadd(dJ113L,PDstandard1gyy,kmadd(J23L,kmadd(J21L,PDstandard22gyy,kmul(J31L,PDstandard23gyy)),kmadd(dJ213L,PDstandard2gyy,kmadd(J33L,kmadd(J21L,PDstandard23gyy,kmul(J31L,PDstandard33gyy)),kmul(dJ313L,PDstandard3gyy)))))));
      
      JacPDstandard31gyz = 
        kmadd(J13L,kmadd(J11L,PDstandard11gyz,kmadd(J21L,PDstandard12gyz,kmul(J31L,PDstandard13gyz))),kmadd(J11L,kmadd(J23L,PDstandard12gyz,kmul(J33L,PDstandard13gyz)),kmadd(dJ113L,PDstandard1gyz,kmadd(J23L,kmadd(J21L,PDstandard22gyz,kmul(J31L,PDstandard23gyz)),kmadd(dJ213L,PDstandard2gyz,kmadd(J33L,kmadd(J21L,PDstandard23gyz,kmul(J31L,PDstandard33gyz)),kmul(dJ313L,PDstandard3gyz)))))));
      
      JacPDstandard32gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard11gyz,kmadd(J22L,PDstandard12gyz,kmul(J32L,PDstandard13gyz))),kmadd(J12L,kmadd(J23L,PDstandard12gyz,kmul(J33L,PDstandard13gyz)),kmadd(dJ123L,PDstandard1gyz,kmadd(J23L,kmadd(J22L,PDstandard22gyz,kmul(J32L,PDstandard23gyz)),kmadd(dJ223L,PDstandard2gyz,kmadd(J33L,kmadd(J22L,PDstandard23gyz,kmul(J32L,PDstandard33gyz)),kmul(dJ323L,PDstandard3gyz)))))));
    }
    else
    {
      JacPDstandard1gxx = PDstandard1gxx;
      
      JacPDstandard1gxy = PDstandard1gxy;
      
      JacPDstandard1gxz = PDstandard1gxz;
      
      JacPDstandard1gyy = PDstandard1gyy;
      
      JacPDstandard1gyz = PDstandard1gyz;
      
      JacPDstandard1gzz = PDstandard1gzz;
      
      JacPDstandard1kxy = PDstandard1kxy;
      
      JacPDstandard1kxz = PDstandard1kxz;
      
      JacPDstandard1kyy = PDstandard1kyy;
      
      JacPDstandard1kyz = PDstandard1kyz;
      
      JacPDstandard1kzz = PDstandard1kzz;
      
      JacPDstandard2gxx = PDstandard2gxx;
      
      JacPDstandard2gxy = PDstandard2gxy;
      
      JacPDstandard2gxz = PDstandard2gxz;
      
      JacPDstandard2gyy = PDstandard2gyy;
      
      JacPDstandard2gyz = PDstandard2gyz;
      
      JacPDstandard2gzz = PDstandard2gzz;
      
      JacPDstandard2kxx = PDstandard2kxx;
      
      JacPDstandard2kxy = PDstandard2kxy;
      
      JacPDstandard2kxz = PDstandard2kxz;
      
      JacPDstandard2kyz = PDstandard2kyz;
      
      JacPDstandard2kzz = PDstandard2kzz;
      
      JacPDstandard3gxx = PDstandard3gxx;
      
      JacPDstandard3gxy = PDstandard3gxy;
      
      JacPDstandard3gxz = PDstandard3gxz;
      
      JacPDstandard3gyy = PDstandard3gyy;
      
      JacPDstandard3gyz = PDstandard3gyz;
      
      JacPDstandard3gzz = PDstandard3gzz;
      
      JacPDstandard3kxx = PDstandard3kxx;
      
      JacPDstandard3kxy = PDstandard3kxy;
      
      JacPDstandard3kxz = PDstandard3kxz;
      
      JacPDstandard3kyy = PDstandard3kyy;
      
      JacPDstandard3kyz = PDstandard3kyz;
      
      JacPDstandard11gyy = PDstandard11gyy;
      
      JacPDstandard11gyz = PDstandard11gyz;
      
      JacPDstandard11gzz = PDstandard11gzz;
      
      JacPDstandard22gxx = PDstandard22gxx;
      
      JacPDstandard22gxz = PDstandard22gxz;
      
      JacPDstandard22gzz = PDstandard22gzz;
      
      JacPDstandard33gxx = PDstandard33gxx;
      
      JacPDstandard33gxy = PDstandard33gxy;
      
      JacPDstandard33gyy = PDstandard33gyy;
      
      JacPDstandard12gxy = PDstandard12gxy;
      
      JacPDstandard12gxz = PDstandard12gxz;
      
      JacPDstandard12gyz = PDstandard12gyz;
      
      JacPDstandard12gzz = PDstandard12gzz;
      
      JacPDstandard13gxz = PDstandard13gxz;
      
      JacPDstandard21gxy = PDstandard12gxy;
      
      JacPDstandard23gxx = PDstandard23gxx;
      
      JacPDstandard23gxy = PDstandard23gxy;
      
      JacPDstandard23gxz = PDstandard23gxz;
      
      JacPDstandard23gyz = PDstandard23gyz;
      
      JacPDstandard31gxy = PDstandard13gxy;
      
      JacPDstandard31gxz = PDstandard13gxz;
      
      JacPDstandard31gyy = PDstandard13gyy;
      
      JacPDstandard31gyz = PDstandard13gyz;
      
      JacPDstandard32gyz = PDstandard23gyz;
    }
    
    CCTK_REAL_VEC detg CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(gxyL,kmul(gxzL,gyzL)),knmsub(gzzL,kmul(gxyL,gxyL),kmsub(gyyL,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)),kmul(gxxL,kmul(gyzL,gyzL)))));
    
    CCTK_REAL_VEC invdetg CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),detg);
    
    CCTK_REAL_VEC gInv11 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gyyL,gzzL,kmul(gyzL,gyzL)));
    
    CCTK_REAL_VEC gInv12 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv13 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv21 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv22 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)));
    
    CCTK_REAL_VEC gInv23 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv31 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv32 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv33 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gyyL,kmul(gxyL,gxyL)));
    
    CCTK_REAL_VEC gamma111 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,JacPDstandard1gxx,kmsub(ToReal(2),kmadd(gInv12,JacPDstandard1gxy,kmul(gInv13,JacPDstandard1gxz)),kmadd(gInv13,JacPDstandard3gxx,kmul(gInv12,JacPDstandard2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma211 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,JacPDstandard1gxx,kmsub(ToReal(2),kmadd(gInv22,JacPDstandard1gxy,kmul(gInv23,JacPDstandard1gxz)),kmadd(gInv23,JacPDstandard3gxx,kmul(gInv22,JacPDstandard2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma311 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,JacPDstandard1gxx,kmsub(ToReal(2),kmadd(gInv32,JacPDstandard1gxy,kmul(gInv33,JacPDstandard1gxz)),kmadd(gInv33,JacPDstandard3gxx,kmul(gInv32,JacPDstandard2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma121 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv12,JacPDstandard1gyy,kmadd(gInv11,JacPDstandard2gxx,kmul(gInv13,kadd(JacPDstandard1gyz,ksub(JacPDstandard2gxz,JacPDstandard3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma221 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv22,JacPDstandard1gyy,kmadd(gInv21,JacPDstandard2gxx,kmul(gInv23,kadd(JacPDstandard1gyz,ksub(JacPDstandard2gxz,JacPDstandard3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma321 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv32,JacPDstandard1gyy,kmadd(gInv31,JacPDstandard2gxx,kmul(gInv33,kadd(JacPDstandard1gyz,ksub(JacPDstandard2gxz,JacPDstandard3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma131 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard1gzz,kmadd(gInv11,JacPDstandard3gxx,kmul(gInv12,kadd(JacPDstandard1gyz,ksub(JacPDstandard3gxy,JacPDstandard2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma231 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard1gzz,kmadd(gInv21,JacPDstandard3gxx,kmul(gInv22,kadd(JacPDstandard1gyz,ksub(JacPDstandard3gxy,JacPDstandard2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma331 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard1gzz,kmadd(gInv31,JacPDstandard3gxx,kmul(gInv32,kadd(JacPDstandard1gyz,ksub(JacPDstandard3gxy,JacPDstandard2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma122 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard2gxy,JacPDstandard1gyy),kmadd(gInv12,JacPDstandard2gyy,kmul(gInv13,kmsub(ToReal(2),JacPDstandard2gyz,JacPDstandard3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma222 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard2gxy,JacPDstandard1gyy),kmadd(gInv22,JacPDstandard2gyy,kmul(gInv23,kmsub(ToReal(2),JacPDstandard2gyz,JacPDstandard3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma322 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard2gxy,JacPDstandard1gyy),kmadd(gInv32,JacPDstandard2gyy,kmul(gInv33,kmsub(ToReal(2),JacPDstandard2gyz,JacPDstandard3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma132 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard2gzz,kmadd(gInv11,ksub(kadd(JacPDstandard2gxz,JacPDstandard3gxy),JacPDstandard1gyz),kmul(gInv12,JacPDstandard3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma232 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard2gzz,kmadd(gInv21,ksub(kadd(JacPDstandard2gxz,JacPDstandard3gxy),JacPDstandard1gyz),kmul(gInv22,JacPDstandard3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma332 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard2gzz,kmadd(gInv31,ksub(kadd(JacPDstandard2gxz,JacPDstandard3gxy),JacPDstandard1gyz),kmul(gInv32,JacPDstandard3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma133 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard3gxz,JacPDstandard1gzz),kmadd(gInv12,kmsub(ToReal(2),JacPDstandard3gyz,JacPDstandard2gzz),kmul(gInv13,JacPDstandard3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma233 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard3gxz,JacPDstandard1gzz),kmadd(gInv22,kmsub(ToReal(2),JacPDstandard3gyz,JacPDstandard2gzz),kmul(gInv23,JacPDstandard3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma333 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard3gxz,JacPDstandard1gzz),kmadd(gInv32,kmsub(ToReal(2),JacPDstandard3gyz,JacPDstandard2gzz),kmul(gInv33,JacPDstandard3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC xmoved CCTK_ATTRIBUTE_UNUSED = ksub(xL,ToReal(xorig));
    
    CCTK_REAL_VEC ymoved CCTK_ATTRIBUTE_UNUSED = ksub(yL,ToReal(yorig));
    
    CCTK_REAL_VEC zmoved CCTK_ATTRIBUTE_UNUSED = ksub(zL,ToReal(zorig));
    
    CCTK_REAL_VEC va1 CCTK_ATTRIBUTE_UNUSED = kneg(ymoved);
    
    CCTK_REAL_VEC va2 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC va3 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC vb1 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC vb2 CCTK_ATTRIBUTE_UNUSED = ymoved;
    
    CCTK_REAL_VEC vb3 CCTK_ATTRIBUTE_UNUSED = zmoved;
    
    CCTK_REAL_VEC vc1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv12,va3,kmul(gInv13,va2)),vb1,kmadd(kmsub(gInv13,va1,kmul(gInv11,va3)),vb2,kmul(vb3,kmsub(gInv11,va2,kmul(gInv12,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv22,va3,kmul(gInv23,va2)),vb1,kmadd(kmsub(gInv23,va1,kmul(gInv21,va3)),vb2,kmul(vb3,kmsub(gInv21,va2,kmul(gInv22,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv32,va3,kmul(gInv33,va2)),vb1,kmadd(kmsub(gInv33,va1,kmul(gInv31,va3)),vb2,kmul(vb3,kmsub(gInv31,va2,kmul(gInv32,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC wa1 CCTK_ATTRIBUTE_UNUSED = va1;
    
    CCTK_REAL_VEC wa2 CCTK_ATTRIBUTE_UNUSED = va2;
    
    CCTK_REAL_VEC wa3 CCTK_ATTRIBUTE_UNUSED = va3;
    
    CCTK_REAL_VEC omega11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wa2,wa3),kmul(wa1,kmadd(gxyL,wa2,kmul(gxzL,wa3)))),kmadd(gxxL,kmul(wa1,wa1),kmadd(gyyL,kmul(wa2,wa2),kmul(gzzL,kmul(wa3,wa3)))));
    
    CCTK_REAL_VEC ea1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa1,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa2,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa3,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC omega12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vb1,kmadd(gxyL,vb2,kmul(gxzL,vb3))),kmadd(ea2,kmadd(gxyL,vb1,kmadd(gyyL,vb2,kmul(gyzL,vb3))),kmul(ea3,kmadd(gxzL,vb1,kmadd(gyzL,vb2,kmul(gzzL,vb3))))));
    
    CCTK_REAL_VEC wb1 CCTK_ATTRIBUTE_UNUSED = knmsub(ea1,omega12,vb1);
    
    CCTK_REAL_VEC wb2 CCTK_ATTRIBUTE_UNUSED = knmsub(ea2,omega12,vb2);
    
    CCTK_REAL_VEC wb3 CCTK_ATTRIBUTE_UNUSED = knmsub(ea3,omega12,vb3);
    
    CCTK_REAL_VEC omega22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wb2,wb3),kmul(wb1,kmadd(gxyL,wb2,kmul(gxzL,wb3)))),kmadd(gxxL,kmul(wb1,wb1),kmadd(gyyL,kmul(wb2,wb2),kmul(gzzL,kmul(wb3,wb3)))));
    
    CCTK_REAL_VEC eb1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb1,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb2,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb3,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC omega13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(ea2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(ea3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC omega23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(eb1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(eb2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(eb3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC wc1 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea1,omega13,knmsub(eb1,omega23,vc1));
    
    CCTK_REAL_VEC wc2 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea2,omega13,knmsub(eb2,omega23,vc2));
    
    CCTK_REAL_VEC wc3 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea3,omega13,knmsub(eb3,omega23,vc3));
    
    CCTK_REAL_VEC omega33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wc2,wc3),kmul(wc1,kmadd(gxyL,wc2,kmul(gxzL,wc3)))),kmadd(gxxL,kmul(wc1,wc1),kmadd(gyyL,kmul(wc2,wc2),kmul(gzzL,kmul(wc3,wc3)))));
    
    CCTK_REAL_VEC ec1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc1,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc2,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc3,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC isqrt2 CCTK_ATTRIBUTE_UNUSED = 
      ToReal(0.707106781186547524);
    
    CCTK_REAL_VEC n1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb1,isqrt2));
    
    CCTK_REAL_VEC n2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb2,isqrt2));
    
    CCTK_REAL_VEC n3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb3,isqrt2));
    
    CCTK_REAL_VEC rm1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rm2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rm3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC im1 CCTK_ATTRIBUTE_UNUSED = kmul(ea1,isqrt2);
    
    CCTK_REAL_VEC im2 CCTK_ATTRIBUTE_UNUSED = kmul(ea2,isqrt2);
    
    CCTK_REAL_VEC im3 CCTK_ATTRIBUTE_UNUSED = kmul(ea3,isqrt2);
    
    CCTK_REAL_VEC rmbar1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rmbar2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rmbar3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC imbar1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea1,isqrt2));
    
    CCTK_REAL_VEC imbar2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea2,isqrt2));
    
    CCTK_REAL_VEC imbar3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea3,isqrt2));
    
    CCTK_REAL_VEC nn CCTK_ATTRIBUTE_UNUSED = isqrt2;
    
    CCTK_REAL_VEC R1212 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma221,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(gamma321,kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321)))))),kmadd(ToReal(-2),kmadd(gamma122,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma222,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma322))),ksub(kadd(JacPDstandard12gxy,ksub(JacPDstandard21gxy,JacPDstandard22gxx)),JacPDstandard11gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC R1213 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma221,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma321,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma232,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma332))),ksub(kadd(JacPDstandard12gxz,ksub(JacPDstandard31gxy,JacPDstandard23gxx)),JacPDstandard11gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1223 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma122,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma222,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma322,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma232,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma332))),ksub(kadd(JacPDstandard22gxz,ksub(JacPDstandard31gyy,JacPDstandard23gxy)),JacPDstandard12gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1313 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma131,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma231,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma331,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma233,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma333))),ksub(kadd(JacPDstandard13gxz,ksub(JacPDstandard31gxz,JacPDstandard33gxx)),JacPDstandard11gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma232,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331))),gamma332))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma233,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma333))),ksub(kadd(JacPDstandard23gxz,ksub(JacPDstandard31gyz,JacPDstandard33gxy)),JacPDstandard12gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R2323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma132,kmadd(gxyL,gamma232,kmul(gxzL,gamma332))),kmadd(gamma232,kmadd(gxyL,gamma132,kmadd(gyyL,gamma232,kmul(gyzL,gamma332))),kmul(gamma332,kmadd(gxzL,gamma132,kmadd(gyzL,gamma232,kmul(gzzL,gamma332)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma122,kmadd(gxyL,gamma222,kmul(gxzL,gamma322))),kmadd(gamma233,kmadd(gxyL,gamma122,kmadd(gyyL,gamma222,kmul(gyzL,gamma322))),kmul(kmadd(gxzL,gamma122,kmadd(gyzL,gamma222,kmul(gzzL,gamma322))),gamma333))),ksub(kadd(JacPDstandard23gyz,ksub(JacPDstandard32gyz,JacPDstandard33gyy)),JacPDstandard22gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R4p1212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212));
    
    CCTK_REAL_VEC R4p1213 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213));
    
    CCTK_REAL_VEC R4p1223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223));
    
    CCTK_REAL_VEC R4p1313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313));
    
    CCTK_REAL_VEC R4p1323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323));
    
    CCTK_REAL_VEC R4p2323 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323));
    
    CCTK_REAL_VEC Ro111 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro112 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma121,knmsub(kyyL,gamma211,kmadd(kxyL,ksub(gamma221,gamma111),knmsub(kyzL,gamma311,kmadd(kxzL,gamma321,ksub(JacPDstandard1kxy,JacPDstandard2kxx))))));
    
    CCTK_REAL_VEC Ro113 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma131,knmsub(kyzL,gamma211,kmadd(kxyL,gamma231,knmsub(kzzL,gamma311,kmadd(kxzL,ksub(gamma331,gamma111),ksub(JacPDstandard1kxz,JacPDstandard3kxx))))));
    
    CCTK_REAL_VEC Ro121 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma121,kmadd(kyyL,gamma211,kmadd(kxyL,ksub(gamma111,gamma221),kmadd(kyzL,gamma311,knmsub(kxzL,gamma321,ksub(JacPDstandard2kxx,JacPDstandard1kxy))))));
    
    CCTK_REAL_VEC Ro122 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro123 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma121,kmadd(kxyL,gamma131,kmadd(kyyL,gamma231,knmsub(kzzL,gamma321,kmadd(kyzL,ksub(gamma331,gamma221),ksub(JacPDstandard2kxz,JacPDstandard3kxy))))));
    
    CCTK_REAL_VEC Ro131 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma131,kmadd(kyzL,gamma211,knmsub(kxyL,gamma231,kmadd(kzzL,gamma311,kmadd(kxzL,ksub(gamma111,gamma331),ksub(JacPDstandard3kxx,JacPDstandard1kxz))))));
    
    CCTK_REAL_VEC Ro132 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma121,knmsub(kxyL,gamma131,knmsub(kyyL,gamma231,kmadd(kzzL,gamma321,kmadd(kyzL,ksub(gamma221,gamma331),ksub(JacPDstandard3kxy,JacPDstandard2kxz))))));
    
    CCTK_REAL_VEC Ro133 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro211 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma122,knmsub(kyyL,gamma221,kmadd(kxyL,ksub(gamma222,gamma121),knmsub(kyzL,gamma321,kmadd(kxzL,gamma322,ksub(JacPDstandard1kyy,JacPDstandard2kxy))))));
    
    CCTK_REAL_VEC Ro213 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyzL,gamma221,kmadd(kxyL,gamma232,knmsub(kzzL,gamma321,kmadd(kxzL,ksub(gamma332,gamma121),ksub(JacPDstandard1kyz,JacPDstandard3kxy))))));
    
    CCTK_REAL_VEC Ro221 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma122,kmadd(kyyL,gamma221,kmadd(kxyL,ksub(gamma121,gamma222),kmadd(kyzL,gamma321,knmsub(kxzL,gamma322,ksub(JacPDstandard2kxy,JacPDstandard1kyy))))));
    
    CCTK_REAL_VEC Ro222 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma122,kmadd(kxyL,gamma132,kmadd(kyyL,gamma232,knmsub(kzzL,gamma322,kmadd(kyzL,ksub(gamma332,gamma222),ksub(JacPDstandard2kyz,JacPDstandard3kyy))))));
    
    CCTK_REAL_VEC Ro231 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyzL,gamma221,knmsub(kxyL,gamma232,kmadd(kzzL,gamma321,kmadd(kxzL,ksub(gamma121,gamma332),ksub(JacPDstandard3kxy,JacPDstandard1kyz))))));
    
    CCTK_REAL_VEC Ro232 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma122,knmsub(kxyL,gamma132,knmsub(kyyL,gamma232,kmadd(kzzL,gamma322,kmadd(kyzL,ksub(gamma222,gamma332),ksub(JacPDstandard3kyy,JacPDstandard2kyz))))));
    
    CCTK_REAL_VEC Ro233 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro311 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro312 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyyL,gamma231,kmadd(kxyL,ksub(gamma232,gamma131),knmsub(kyzL,gamma331,kmadd(kxzL,gamma332,ksub(JacPDstandard1kyz,JacPDstandard2kxz))))));
    
    CCTK_REAL_VEC Ro313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma133,knmsub(kyzL,gamma231,kmadd(kxyL,gamma233,knmsub(kzzL,gamma331,kmadd(kxzL,ksub(gamma333,gamma131),ksub(JacPDstandard1kzz,JacPDstandard3kxz))))));
    
    CCTK_REAL_VEC Ro321 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyyL,gamma231,kmadd(kxyL,ksub(gamma131,gamma232),kmadd(kyzL,gamma331,knmsub(kxzL,gamma332,ksub(JacPDstandard2kxz,JacPDstandard1kyz))))));
    
    CCTK_REAL_VEC Ro322 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma132,kmadd(kxyL,gamma133,kmadd(kyyL,gamma233,knmsub(kzzL,gamma332,kmadd(kyzL,ksub(gamma333,gamma232),ksub(JacPDstandard2kzz,JacPDstandard3kyz))))));
    
    CCTK_REAL_VEC Ro331 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma133,kmadd(kyzL,gamma231,knmsub(kxyL,gamma233,kmadd(kzzL,gamma331,kmadd(kxzL,ksub(gamma131,gamma333),ksub(JacPDstandard3kxz,JacPDstandard1kzz))))));
    
    CCTK_REAL_VEC Ro332 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma132,knmsub(kxyL,gamma133,knmsub(kyyL,gamma233,kmadd(kzzL,gamma332,kmadd(kyzL,ksub(gamma232,gamma333),ksub(JacPDstandard3kyz,JacPDstandard2kzz))))));
    
    CCTK_REAL_VEC Ro333 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Rojo11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv23,gInv32),knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv22,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)))));
    
    CCTK_REAL_VEC Rojo12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv32,knmsub(gInv21,R1212,knmsub(gInv31,R1213,kmadd(gInv23,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv12,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv23,knmsub(gInv21,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv31,R1313,kmsub(gInv13,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv32,R1323)))))));
    
    CCTK_REAL_VEC Rojo21 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv23,kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv31,knmsub(gInv12,R1212,knmsub(gInv13,R1213,kmadd(gInv32,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv21,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv13,gInv31),kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),kmadd(gInv11,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Rojo23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv21,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv12,R1223,knmsub(gInv31,R1323,kmsub(gInv23,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv32,R2323)))))));
    
    CCTK_REAL_VEC Rojo31 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv21,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv32,knmsub(gInv12,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv13,R1313,kmsub(gInv31,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv23,R1323)))))));
    
    CCTK_REAL_VEC Rojo32 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv31,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv21,R1223,knmsub(gInv13,R1323,kmsub(gInv32,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv23,R2323)))))));
    
    CCTK_REAL_VEC Rojo33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv12,gInv21),knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmadd(gInv11,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)),kmul(gInv22,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(imbar1,imbar2,kmul(rmbar1,rmbar2)),kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3))),kmadd(ToReal(2),kmul(kmadd(n1,kmul(n2,R4p1213),kmadd(n1,kmul(n3,R4p1313),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))),kmsub(imbar1,imbar3,kmul(rmbar1,rmbar3))),knmsub(kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3)))),kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),knmsub(kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3)))),kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),knmsub(kmul(nn,nn),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo23,kmadd(imbar1,kmadd(imbar2,kadd(Rojo12,Rojo21),kmul(imbar3,kadd(Rojo13,Rojo31))),knmsub(rmbar1,kmadd(rmbar2,kadd(Rojo12,Rojo21),kmul(rmbar3,kadd(Rojo13,Rojo31))),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo32,kmadd(Rojo11,kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),kmadd(Rojo22,kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),kmul(Rojo33,kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro112,kmadd(n2,Ro122,kmul(n3,Ro132))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro113,kmadd(n2,Ro123,kmul(n3,Ro133))),kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro211,kmadd(n2,Ro221,kmul(n3,Ro231))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro213,kmadd(n2,Ro223,kmul(n3,Ro233))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro311,kmadd(n2,Ro321,kmul(n3,Ro331))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro312,kmadd(n2,Ro322,kmul(n3,Ro332))),kmadd(kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131))),kmsub(rmbar1,rmbar1,kmul(imbar1,imbar1)),kmadd(kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232))),kmsub(rmbar2,rmbar2,kmul(imbar2,imbar2)),kmul(kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))),kmsub(rmbar3,rmbar3,kmul(imbar3,imbar3)))))))))))),kmul(kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2)))),kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))));
    
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,knmsub(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(n1,kadd(Ro112,Ro211),kmadd(n3,kadd(Ro132,Ro231),kmul(n2,kadd(Ro122,Ro221)))),kmadd(ToReal(-2),kmadd(im1,kmul(rm1,kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131)))),kmul(im2,kmul(rm2,kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232)))))),knmsub(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kadd(Ro113,Ro311),kmadd(n3,kadd(Ro133,Ro331),kmul(n2,kadd(Ro123,Ro321)))),kmsub(ToReal(-2),kmul(im3,kmul(rm3,kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))))),kmul(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kadd(Ro213,Ro312),kmadd(n3,kadd(Ro233,Ro332),kmul(n2,kadd(Ro223,Ro322))))))))),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kmadd(n2,R4p1213,kmul(n3,R4p1313)),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))))),kmsub(ToReal(-2),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(Psi4i[index],Psi4iL);
    vec_store_nta_partial(Psi4r[index],Psi4rL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_psi4_calc_Nth);
}
extern "C" void WeylScal4_psi4_calc_Nth(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_psi4_calc_Nth_Body");
  }
  if (cctk_iteration % WeylScal4_psi4_calc_Nth_calc_every != WeylScal4_psi4_calc_Nth_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "admbase::curv",
    "admbase::metric",
    "grid::coordinates",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_psi4_calc_Nth", 5, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_Nth", 1, 1, 1);
      break;
    }
    
    case 4:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_Nth", 2, 2, 2);
      break;
    }
    
    case 6:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_Nth", 3, 3, 3);
      break;
    }
    
    case 8:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_Nth", 4, 4, 4);
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverInterior(cctkGH, WeylScal4_psi4_calc_Nth_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_psi4_calc_Nth_Body");
  }
}

} // namespace WeylScal4

```

RegisterMoL.cc:
```
/*  File produced by Kranc */

#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"

extern "C" void WeylScal4_RegisterVars(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  /* Register all the evolved grid functions with MoL */
  /* Register all the evolved Array functions with MoL */
  return;
}

```

WeylScal4_psi4_calc_2nd.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {

extern "C" void WeylScal4_psi4_calc_2nd_SelectBCs(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (cctk_iteration % WeylScal4_psi4_calc_2nd_calc_every != WeylScal4_psi4_calc_2nd_calc_offset)
    return;
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4r_group.");
  return;
}

static void WeylScal4_psi4_calc_2nd_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_psi4_calc_2nd,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC gxxL CCTK_ATTRIBUTE_UNUSED = vec_load(gxx[index]);
    CCTK_REAL_VEC gxyL CCTK_ATTRIBUTE_UNUSED = vec_load(gxy[index]);
    CCTK_REAL_VEC gxzL CCTK_ATTRIBUTE_UNUSED = vec_load(gxz[index]);
    CCTK_REAL_VEC gyyL CCTK_ATTRIBUTE_UNUSED = vec_load(gyy[index]);
    CCTK_REAL_VEC gyzL CCTK_ATTRIBUTE_UNUSED = vec_load(gyz[index]);
    CCTK_REAL_VEC gzzL CCTK_ATTRIBUTE_UNUSED = vec_load(gzz[index]);
    CCTK_REAL_VEC kxxL CCTK_ATTRIBUTE_UNUSED = vec_load(kxx[index]);
    CCTK_REAL_VEC kxyL CCTK_ATTRIBUTE_UNUSED = vec_load(kxy[index]);
    CCTK_REAL_VEC kxzL CCTK_ATTRIBUTE_UNUSED = vec_load(kxz[index]);
    CCTK_REAL_VEC kyyL CCTK_ATTRIBUTE_UNUSED = vec_load(kyy[index]);
    CCTK_REAL_VEC kyzL CCTK_ATTRIBUTE_UNUSED = vec_load(kyz[index]);
    CCTK_REAL_VEC kzzL CCTK_ATTRIBUTE_UNUSED = vec_load(kzz[index]);
    CCTK_REAL_VEC xL CCTK_ATTRIBUTE_UNUSED = vec_load(x[index]);
    CCTK_REAL_VEC yL CCTK_ATTRIBUTE_UNUSED = vec_load(y[index]);
    CCTK_REAL_VEC zL CCTK_ATTRIBUTE_UNUSED = vec_load(z[index]);
    
    
    CCTK_REAL_VEC dJ111L, dJ112L, dJ113L, dJ122L, dJ123L, dJ133L, dJ211L, dJ212L, dJ213L, dJ222L, dJ223L, dJ233L, dJ311L, dJ312L, dJ313L, dJ322L, dJ323L, dJ333L, J11L, J12L, J13L, J21L, J22L, J23L, J31L, J32L, J33L CCTK_ATTRIBUTE_UNUSED ;
    
    if (usejacobian)
    {
      dJ111L = vec_load(dJ111[index]);
      dJ112L = vec_load(dJ112[index]);
      dJ113L = vec_load(dJ113[index]);
      dJ122L = vec_load(dJ122[index]);
      dJ123L = vec_load(dJ123[index]);
      dJ133L = vec_load(dJ133[index]);
      dJ211L = vec_load(dJ211[index]);
      dJ212L = vec_load(dJ212[index]);
      dJ213L = vec_load(dJ213[index]);
      dJ222L = vec_load(dJ222[index]);
      dJ223L = vec_load(dJ223[index]);
      dJ233L = vec_load(dJ233[index]);
      dJ311L = vec_load(dJ311[index]);
      dJ312L = vec_load(dJ312[index]);
      dJ313L = vec_load(dJ313[index]);
      dJ322L = vec_load(dJ322[index]);
      dJ323L = vec_load(dJ323[index]);
      dJ333L = vec_load(dJ333[index]);
      J11L = vec_load(J11[index]);
      J12L = vec_load(J12[index]);
      J13L = vec_load(J13[index]);
      J21L = vec_load(J21[index]);
      J22L = vec_load(J22[index]);
      J23L = vec_load(J23[index]);
      J31L = vec_load(J31[index]);
      J32L = vec_load(J32[index]);
      J33L = vec_load(J33[index]);
    }
    /* Include user supplied include files */
    /* Precompute derivatives */
    CCTK_REAL_VEC PDstandard2nd1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kzz CCTK_ATTRIBUTE_UNUSED;
    
    switch (fdOrder)
    {
      case 2:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      
      case 4:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      
      case 6:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      
      case 8:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC JacPDstandard2nd11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd21gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd32gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kyz CCTK_ATTRIBUTE_UNUSED;
    
    if (usejacobian)
    {
      JacPDstandard2nd1gxx = 
        kmadd(J11L,PDstandard2nd1gxx,kmadd(J21L,PDstandard2nd2gxx,kmul(J31L,PDstandard2nd3gxx)));
      
      JacPDstandard2nd1gxy = 
        kmadd(J11L,PDstandard2nd1gxy,kmadd(J21L,PDstandard2nd2gxy,kmul(J31L,PDstandard2nd3gxy)));
      
      JacPDstandard2nd1gxz = 
        kmadd(J11L,PDstandard2nd1gxz,kmadd(J21L,PDstandard2nd2gxz,kmul(J31L,PDstandard2nd3gxz)));
      
      JacPDstandard2nd1gyy = 
        kmadd(J11L,PDstandard2nd1gyy,kmadd(J21L,PDstandard2nd2gyy,kmul(J31L,PDstandard2nd3gyy)));
      
      JacPDstandard2nd1gyz = 
        kmadd(J11L,PDstandard2nd1gyz,kmadd(J21L,PDstandard2nd2gyz,kmul(J31L,PDstandard2nd3gyz)));
      
      JacPDstandard2nd1gzz = 
        kmadd(J11L,PDstandard2nd1gzz,kmadd(J21L,PDstandard2nd2gzz,kmul(J31L,PDstandard2nd3gzz)));
      
      JacPDstandard2nd1kxy = 
        kmadd(J11L,PDstandard2nd1kxy,kmadd(J21L,PDstandard2nd2kxy,kmul(J31L,PDstandard2nd3kxy)));
      
      JacPDstandard2nd1kxz = 
        kmadd(J11L,PDstandard2nd1kxz,kmadd(J21L,PDstandard2nd2kxz,kmul(J31L,PDstandard2nd3kxz)));
      
      JacPDstandard2nd1kyy = 
        kmadd(J11L,PDstandard2nd1kyy,kmadd(J21L,PDstandard2nd2kyy,kmul(J31L,PDstandard2nd3kyy)));
      
      JacPDstandard2nd1kyz = 
        kmadd(J11L,PDstandard2nd1kyz,kmadd(J21L,PDstandard2nd2kyz,kmul(J31L,PDstandard2nd3kyz)));
      
      JacPDstandard2nd1kzz = 
        kmadd(J11L,PDstandard2nd1kzz,kmadd(J21L,PDstandard2nd2kzz,kmul(J31L,PDstandard2nd3kzz)));
      
      JacPDstandard2nd2gxx = 
        kmadd(J12L,PDstandard2nd1gxx,kmadd(J22L,PDstandard2nd2gxx,kmul(J32L,PDstandard2nd3gxx)));
      
      JacPDstandard2nd2gxy = 
        kmadd(J12L,PDstandard2nd1gxy,kmadd(J22L,PDstandard2nd2gxy,kmul(J32L,PDstandard2nd3gxy)));
      
      JacPDstandard2nd2gxz = 
        kmadd(J12L,PDstandard2nd1gxz,kmadd(J22L,PDstandard2nd2gxz,kmul(J32L,PDstandard2nd3gxz)));
      
      JacPDstandard2nd2gyy = 
        kmadd(J12L,PDstandard2nd1gyy,kmadd(J22L,PDstandard2nd2gyy,kmul(J32L,PDstandard2nd3gyy)));
      
      JacPDstandard2nd2gyz = 
        kmadd(J12L,PDstandard2nd1gyz,kmadd(J22L,PDstandard2nd2gyz,kmul(J32L,PDstandard2nd3gyz)));
      
      JacPDstandard2nd2gzz = 
        kmadd(J12L,PDstandard2nd1gzz,kmadd(J22L,PDstandard2nd2gzz,kmul(J32L,PDstandard2nd3gzz)));
      
      JacPDstandard2nd2kxx = 
        kmadd(J12L,PDstandard2nd1kxx,kmadd(J22L,PDstandard2nd2kxx,kmul(J32L,PDstandard2nd3kxx)));
      
      JacPDstandard2nd2kxy = 
        kmadd(J12L,PDstandard2nd1kxy,kmadd(J22L,PDstandard2nd2kxy,kmul(J32L,PDstandard2nd3kxy)));
      
      JacPDstandard2nd2kxz = 
        kmadd(J12L,PDstandard2nd1kxz,kmadd(J22L,PDstandard2nd2kxz,kmul(J32L,PDstandard2nd3kxz)));
      
      JacPDstandard2nd2kyz = 
        kmadd(J12L,PDstandard2nd1kyz,kmadd(J22L,PDstandard2nd2kyz,kmul(J32L,PDstandard2nd3kyz)));
      
      JacPDstandard2nd2kzz = 
        kmadd(J12L,PDstandard2nd1kzz,kmadd(J22L,PDstandard2nd2kzz,kmul(J32L,PDstandard2nd3kzz)));
      
      JacPDstandard2nd3gxx = 
        kmadd(J13L,PDstandard2nd1gxx,kmadd(J23L,PDstandard2nd2gxx,kmul(J33L,PDstandard2nd3gxx)));
      
      JacPDstandard2nd3gxy = 
        kmadd(J13L,PDstandard2nd1gxy,kmadd(J23L,PDstandard2nd2gxy,kmul(J33L,PDstandard2nd3gxy)));
      
      JacPDstandard2nd3gxz = 
        kmadd(J13L,PDstandard2nd1gxz,kmadd(J23L,PDstandard2nd2gxz,kmul(J33L,PDstandard2nd3gxz)));
      
      JacPDstandard2nd3gyy = 
        kmadd(J13L,PDstandard2nd1gyy,kmadd(J23L,PDstandard2nd2gyy,kmul(J33L,PDstandard2nd3gyy)));
      
      JacPDstandard2nd3gyz = 
        kmadd(J13L,PDstandard2nd1gyz,kmadd(J23L,PDstandard2nd2gyz,kmul(J33L,PDstandard2nd3gyz)));
      
      JacPDstandard2nd3gzz = 
        kmadd(J13L,PDstandard2nd1gzz,kmadd(J23L,PDstandard2nd2gzz,kmul(J33L,PDstandard2nd3gzz)));
      
      JacPDstandard2nd3kxx = 
        kmadd(J13L,PDstandard2nd1kxx,kmadd(J23L,PDstandard2nd2kxx,kmul(J33L,PDstandard2nd3kxx)));
      
      JacPDstandard2nd3kxy = 
        kmadd(J13L,PDstandard2nd1kxy,kmadd(J23L,PDstandard2nd2kxy,kmul(J33L,PDstandard2nd3kxy)));
      
      JacPDstandard2nd3kxz = 
        kmadd(J13L,PDstandard2nd1kxz,kmadd(J23L,PDstandard2nd2kxz,kmul(J33L,PDstandard2nd3kxz)));
      
      JacPDstandard2nd3kyy = 
        kmadd(J13L,PDstandard2nd1kyy,kmadd(J23L,PDstandard2nd2kyy,kmul(J33L,PDstandard2nd3kyy)));
      
      JacPDstandard2nd3kyz = 
        kmadd(J13L,PDstandard2nd1kyz,kmadd(J23L,PDstandard2nd2kyz,kmul(J33L,PDstandard2nd3kyz)));
      
      JacPDstandard2nd11gyy = 
        kmadd(dJ111L,PDstandard2nd1gyy,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard2nd12gyy,kmul(J31L,PDstandard2nd13gyy)),kmul(J21L,kmul(J31L,PDstandard2nd23gyy))),kmadd(dJ211L,PDstandard2nd2gyy,kmadd(dJ311L,PDstandard2nd3gyy,kmadd(PDstandard2nd11gyy,kmul(J11L,J11L),kmadd(PDstandard2nd22gyy,kmul(J21L,J21L),kmul(PDstandard2nd33gyy,kmul(J31L,J31L))))))));
      
      JacPDstandard2nd11gyz = 
        kmadd(dJ111L,PDstandard2nd1gyz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard2nd12gyz,kmul(J31L,PDstandard2nd13gyz)),kmul(J21L,kmul(J31L,PDstandard2nd23gyz))),kmadd(dJ211L,PDstandard2nd2gyz,kmadd(dJ311L,PDstandard2nd3gyz,kmadd(PDstandard2nd11gyz,kmul(J11L,J11L),kmadd(PDstandard2nd22gyz,kmul(J21L,J21L),kmul(PDstandard2nd33gyz,kmul(J31L,J31L))))))));
      
      JacPDstandard2nd11gzz = 
        kmadd(dJ111L,PDstandard2nd1gzz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard2nd12gzz,kmul(J31L,PDstandard2nd13gzz)),kmul(J21L,kmul(J31L,PDstandard2nd23gzz))),kmadd(dJ211L,PDstandard2nd2gzz,kmadd(dJ311L,PDstandard2nd3gzz,kmadd(PDstandard2nd11gzz,kmul(J11L,J11L),kmadd(PDstandard2nd22gzz,kmul(J21L,J21L),kmul(PDstandard2nd33gzz,kmul(J31L,J31L))))))));
      
      JacPDstandard2nd22gxx = 
        kmadd(dJ122L,PDstandard2nd1gxx,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard2nd12gxx,kmul(J32L,PDstandard2nd13gxx)),kmul(J22L,kmul(J32L,PDstandard2nd23gxx))),kmadd(dJ222L,PDstandard2nd2gxx,kmadd(dJ322L,PDstandard2nd3gxx,kmadd(PDstandard2nd11gxx,kmul(J12L,J12L),kmadd(PDstandard2nd22gxx,kmul(J22L,J22L),kmul(PDstandard2nd33gxx,kmul(J32L,J32L))))))));
      
      JacPDstandard2nd22gxz = 
        kmadd(dJ122L,PDstandard2nd1gxz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard2nd12gxz,kmul(J32L,PDstandard2nd13gxz)),kmul(J22L,kmul(J32L,PDstandard2nd23gxz))),kmadd(dJ222L,PDstandard2nd2gxz,kmadd(dJ322L,PDstandard2nd3gxz,kmadd(PDstandard2nd11gxz,kmul(J12L,J12L),kmadd(PDstandard2nd22gxz,kmul(J22L,J22L),kmul(PDstandard2nd33gxz,kmul(J32L,J32L))))))));
      
      JacPDstandard2nd22gzz = 
        kmadd(dJ122L,PDstandard2nd1gzz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard2nd12gzz,kmul(J32L,PDstandard2nd13gzz)),kmul(J22L,kmul(J32L,PDstandard2nd23gzz))),kmadd(dJ222L,PDstandard2nd2gzz,kmadd(dJ322L,PDstandard2nd3gzz,kmadd(PDstandard2nd11gzz,kmul(J12L,J12L),kmadd(PDstandard2nd22gzz,kmul(J22L,J22L),kmul(PDstandard2nd33gzz,kmul(J32L,J32L))))))));
      
      JacPDstandard2nd33gxx = 
        kmadd(dJ133L,PDstandard2nd1gxx,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard2nd12gxx,kmul(J33L,PDstandard2nd13gxx)),kmul(J23L,kmul(J33L,PDstandard2nd23gxx))),kmadd(dJ233L,PDstandard2nd2gxx,kmadd(dJ333L,PDstandard2nd3gxx,kmadd(PDstandard2nd11gxx,kmul(J13L,J13L),kmadd(PDstandard2nd22gxx,kmul(J23L,J23L),kmul(PDstandard2nd33gxx,kmul(J33L,J33L))))))));
      
      JacPDstandard2nd33gxy = 
        kmadd(dJ133L,PDstandard2nd1gxy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard2nd12gxy,kmul(J33L,PDstandard2nd13gxy)),kmul(J23L,kmul(J33L,PDstandard2nd23gxy))),kmadd(dJ233L,PDstandard2nd2gxy,kmadd(dJ333L,PDstandard2nd3gxy,kmadd(PDstandard2nd11gxy,kmul(J13L,J13L),kmadd(PDstandard2nd22gxy,kmul(J23L,J23L),kmul(PDstandard2nd33gxy,kmul(J33L,J33L))))))));
      
      JacPDstandard2nd33gyy = 
        kmadd(dJ133L,PDstandard2nd1gyy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard2nd12gyy,kmul(J33L,PDstandard2nd13gyy)),kmul(J23L,kmul(J33L,PDstandard2nd23gyy))),kmadd(dJ233L,PDstandard2nd2gyy,kmadd(dJ333L,PDstandard2nd3gyy,kmadd(PDstandard2nd11gyy,kmul(J13L,J13L),kmadd(PDstandard2nd22gyy,kmul(J23L,J23L),kmul(PDstandard2nd33gyy,kmul(J33L,J33L))))))));
      
      JacPDstandard2nd12gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gxy,kmadd(J21L,PDstandard2nd12gxy,kmul(J31L,PDstandard2nd13gxy))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gxy,kmul(J32L,PDstandard2nd13gxy)),kmadd(dJ112L,PDstandard2nd1gxy,kmadd(J22L,kmadd(J21L,PDstandard2nd22gxy,kmul(J31L,PDstandard2nd23gxy)),kmadd(dJ212L,PDstandard2nd2gxy,kmadd(J32L,kmadd(J21L,PDstandard2nd23gxy,kmul(J31L,PDstandard2nd33gxy)),kmul(dJ312L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd12gxz = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gxz,kmadd(J21L,PDstandard2nd12gxz,kmul(J31L,PDstandard2nd13gxz))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gxz,kmul(J32L,PDstandard2nd13gxz)),kmadd(dJ112L,PDstandard2nd1gxz,kmadd(J22L,kmadd(J21L,PDstandard2nd22gxz,kmul(J31L,PDstandard2nd23gxz)),kmadd(dJ212L,PDstandard2nd2gxz,kmadd(J32L,kmadd(J21L,PDstandard2nd23gxz,kmul(J31L,PDstandard2nd33gxz)),kmul(dJ312L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd12gyz = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gyz,kmadd(J21L,PDstandard2nd12gyz,kmul(J31L,PDstandard2nd13gyz))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gyz,kmul(J32L,PDstandard2nd13gyz)),kmadd(dJ112L,PDstandard2nd1gyz,kmadd(J22L,kmadd(J21L,PDstandard2nd22gyz,kmul(J31L,PDstandard2nd23gyz)),kmadd(dJ212L,PDstandard2nd2gyz,kmadd(J32L,kmadd(J21L,PDstandard2nd23gyz,kmul(J31L,PDstandard2nd33gyz)),kmul(dJ312L,PDstandard2nd3gyz)))))));
      
      JacPDstandard2nd12gzz = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gzz,kmadd(J21L,PDstandard2nd12gzz,kmul(J31L,PDstandard2nd13gzz))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gzz,kmul(J32L,PDstandard2nd13gzz)),kmadd(dJ112L,PDstandard2nd1gzz,kmadd(J22L,kmadd(J21L,PDstandard2nd22gzz,kmul(J31L,PDstandard2nd23gzz)),kmadd(dJ212L,PDstandard2nd2gzz,kmadd(J32L,kmadd(J21L,PDstandard2nd23gzz,kmul(J31L,PDstandard2nd33gzz)),kmul(dJ312L,PDstandard2nd3gzz)))))));
      
      JacPDstandard2nd13gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gxz,kmadd(J21L,PDstandard2nd12gxz,kmul(J31L,PDstandard2nd13gxz))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gxz,kmul(J33L,PDstandard2nd13gxz)),kmadd(dJ113L,PDstandard2nd1gxz,kmadd(J23L,kmadd(J21L,PDstandard2nd22gxz,kmul(J31L,PDstandard2nd23gxz)),kmadd(dJ213L,PDstandard2nd2gxz,kmadd(J33L,kmadd(J21L,PDstandard2nd23gxz,kmul(J31L,PDstandard2nd33gxz)),kmul(dJ313L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd21gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gxy,kmadd(J21L,PDstandard2nd12gxy,kmul(J31L,PDstandard2nd13gxy))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gxy,kmul(J32L,PDstandard2nd13gxy)),kmadd(dJ112L,PDstandard2nd1gxy,kmadd(J22L,kmadd(J21L,PDstandard2nd22gxy,kmul(J31L,PDstandard2nd23gxy)),kmadd(dJ212L,PDstandard2nd2gxy,kmadd(J32L,kmadd(J21L,PDstandard2nd23gxy,kmul(J31L,PDstandard2nd33gxy)),kmul(dJ312L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd23gxx = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gxx,kmadd(J22L,PDstandard2nd12gxx,kmul(J32L,PDstandard2nd13gxx))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gxx,kmul(J33L,PDstandard2nd13gxx)),kmadd(dJ123L,PDstandard2nd1gxx,kmadd(J23L,kmadd(J22L,PDstandard2nd22gxx,kmul(J32L,PDstandard2nd23gxx)),kmadd(dJ223L,PDstandard2nd2gxx,kmadd(J33L,kmadd(J22L,PDstandard2nd23gxx,kmul(J32L,PDstandard2nd33gxx)),kmul(dJ323L,PDstandard2nd3gxx)))))));
      
      JacPDstandard2nd23gxy = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gxy,kmadd(J22L,PDstandard2nd12gxy,kmul(J32L,PDstandard2nd13gxy))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gxy,kmul(J33L,PDstandard2nd13gxy)),kmadd(dJ123L,PDstandard2nd1gxy,kmadd(J23L,kmadd(J22L,PDstandard2nd22gxy,kmul(J32L,PDstandard2nd23gxy)),kmadd(dJ223L,PDstandard2nd2gxy,kmadd(J33L,kmadd(J22L,PDstandard2nd23gxy,kmul(J32L,PDstandard2nd33gxy)),kmul(dJ323L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd23gxz = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gxz,kmadd(J22L,PDstandard2nd12gxz,kmul(J32L,PDstandard2nd13gxz))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gxz,kmul(J33L,PDstandard2nd13gxz)),kmadd(dJ123L,PDstandard2nd1gxz,kmadd(J23L,kmadd(J22L,PDstandard2nd22gxz,kmul(J32L,PDstandard2nd23gxz)),kmadd(dJ223L,PDstandard2nd2gxz,kmadd(J33L,kmadd(J22L,PDstandard2nd23gxz,kmul(J32L,PDstandard2nd33gxz)),kmul(dJ323L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd23gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gyz,kmadd(J22L,PDstandard2nd12gyz,kmul(J32L,PDstandard2nd13gyz))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gyz,kmul(J33L,PDstandard2nd13gyz)),kmadd(dJ123L,PDstandard2nd1gyz,kmadd(J23L,kmadd(J22L,PDstandard2nd22gyz,kmul(J32L,PDstandard2nd23gyz)),kmadd(dJ223L,PDstandard2nd2gyz,kmadd(J33L,kmadd(J22L,PDstandard2nd23gyz,kmul(J32L,PDstandard2nd33gyz)),kmul(dJ323L,PDstandard2nd3gyz)))))));
      
      JacPDstandard2nd31gxy = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gxy,kmadd(J21L,PDstandard2nd12gxy,kmul(J31L,PDstandard2nd13gxy))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gxy,kmul(J33L,PDstandard2nd13gxy)),kmadd(dJ113L,PDstandard2nd1gxy,kmadd(J23L,kmadd(J21L,PDstandard2nd22gxy,kmul(J31L,PDstandard2nd23gxy)),kmadd(dJ213L,PDstandard2nd2gxy,kmadd(J33L,kmadd(J21L,PDstandard2nd23gxy,kmul(J31L,PDstandard2nd33gxy)),kmul(dJ313L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd31gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gxz,kmadd(J21L,PDstandard2nd12gxz,kmul(J31L,PDstandard2nd13gxz))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gxz,kmul(J33L,PDstandard2nd13gxz)),kmadd(dJ113L,PDstandard2nd1gxz,kmadd(J23L,kmadd(J21L,PDstandard2nd22gxz,kmul(J31L,PDstandard2nd23gxz)),kmadd(dJ213L,PDstandard2nd2gxz,kmadd(J33L,kmadd(J21L,PDstandard2nd23gxz,kmul(J31L,PDstandard2nd33gxz)),kmul(dJ313L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd31gyy = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gyy,kmadd(J21L,PDstandard2nd12gyy,kmul(J31L,PDstandard2nd13gyy))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gyy,kmul(J33L,PDstandard2nd13gyy)),kmadd(dJ113L,PDstandard2nd1gyy,kmadd(J23L,kmadd(J21L,PDstandard2nd22gyy,kmul(J31L,PDstandard2nd23gyy)),kmadd(dJ213L,PDstandard2nd2gyy,kmadd(J33L,kmadd(J21L,PDstandard2nd23gyy,kmul(J31L,PDstandard2nd33gyy)),kmul(dJ313L,PDstandard2nd3gyy)))))));
      
      JacPDstandard2nd31gyz = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gyz,kmadd(J21L,PDstandard2nd12gyz,kmul(J31L,PDstandard2nd13gyz))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gyz,kmul(J33L,PDstandard2nd13gyz)),kmadd(dJ113L,PDstandard2nd1gyz,kmadd(J23L,kmadd(J21L,PDstandard2nd22gyz,kmul(J31L,PDstandard2nd23gyz)),kmadd(dJ213L,PDstandard2nd2gyz,kmadd(J33L,kmadd(J21L,PDstandard2nd23gyz,kmul(J31L,PDstandard2nd33gyz)),kmul(dJ313L,PDstandard2nd3gyz)))))));
      
      JacPDstandard2nd32gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gyz,kmadd(J22L,PDstandard2nd12gyz,kmul(J32L,PDstandard2nd13gyz))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gyz,kmul(J33L,PDstandard2nd13gyz)),kmadd(dJ123L,PDstandard2nd1gyz,kmadd(J23L,kmadd(J22L,PDstandard2nd22gyz,kmul(J32L,PDstandard2nd23gyz)),kmadd(dJ223L,PDstandard2nd2gyz,kmadd(J33L,kmadd(J22L,PDstandard2nd23gyz,kmul(J32L,PDstandard2nd33gyz)),kmul(dJ323L,PDstandard2nd3gyz)))))));
    }
    else
    {
      JacPDstandard2nd1gxx = PDstandard2nd1gxx;
      
      JacPDstandard2nd1gxy = PDstandard2nd1gxy;
      
      JacPDstandard2nd1gxz = PDstandard2nd1gxz;
      
      JacPDstandard2nd1gyy = PDstandard2nd1gyy;
      
      JacPDstandard2nd1gyz = PDstandard2nd1gyz;
      
      JacPDstandard2nd1gzz = PDstandard2nd1gzz;
      
      JacPDstandard2nd1kxy = PDstandard2nd1kxy;
      
      JacPDstandard2nd1kxz = PDstandard2nd1kxz;
      
      JacPDstandard2nd1kyy = PDstandard2nd1kyy;
      
      JacPDstandard2nd1kyz = PDstandard2nd1kyz;
      
      JacPDstandard2nd1kzz = PDstandard2nd1kzz;
      
      JacPDstandard2nd2gxx = PDstandard2nd2gxx;
      
      JacPDstandard2nd2gxy = PDstandard2nd2gxy;
      
      JacPDstandard2nd2gxz = PDstandard2nd2gxz;
      
      JacPDstandard2nd2gyy = PDstandard2nd2gyy;
      
      JacPDstandard2nd2gyz = PDstandard2nd2gyz;
      
      JacPDstandard2nd2gzz = PDstandard2nd2gzz;
      
      JacPDstandard2nd2kxx = PDstandard2nd2kxx;
      
      JacPDstandard2nd2kxy = PDstandard2nd2kxy;
      
      JacPDstandard2nd2kxz = PDstandard2nd2kxz;
      
      JacPDstandard2nd2kyz = PDstandard2nd2kyz;
      
      JacPDstandard2nd2kzz = PDstandard2nd2kzz;
      
      JacPDstandard2nd3gxx = PDstandard2nd3gxx;
      
      JacPDstandard2nd3gxy = PDstandard2nd3gxy;
      
      JacPDstandard2nd3gxz = PDstandard2nd3gxz;
      
      JacPDstandard2nd3gyy = PDstandard2nd3gyy;
      
      JacPDstandard2nd3gyz = PDstandard2nd3gyz;
      
      JacPDstandard2nd3gzz = PDstandard2nd3gzz;
      
      JacPDstandard2nd3kxx = PDstandard2nd3kxx;
      
      JacPDstandard2nd3kxy = PDstandard2nd3kxy;
      
      JacPDstandard2nd3kxz = PDstandard2nd3kxz;
      
      JacPDstandard2nd3kyy = PDstandard2nd3kyy;
      
      JacPDstandard2nd3kyz = PDstandard2nd3kyz;
      
      JacPDstandard2nd11gyy = PDstandard2nd11gyy;
      
      JacPDstandard2nd11gyz = PDstandard2nd11gyz;
      
      JacPDstandard2nd11gzz = PDstandard2nd11gzz;
      
      JacPDstandard2nd22gxx = PDstandard2nd22gxx;
      
      JacPDstandard2nd22gxz = PDstandard2nd22gxz;
      
      JacPDstandard2nd22gzz = PDstandard2nd22gzz;
      
      JacPDstandard2nd33gxx = PDstandard2nd33gxx;
      
      JacPDstandard2nd33gxy = PDstandard2nd33gxy;
      
      JacPDstandard2nd33gyy = PDstandard2nd33gyy;
      
      JacPDstandard2nd12gxy = PDstandard2nd12gxy;
      
      JacPDstandard2nd12gxz = PDstandard2nd12gxz;
      
      JacPDstandard2nd12gyz = PDstandard2nd12gyz;
      
      JacPDstandard2nd12gzz = PDstandard2nd12gzz;
      
      JacPDstandard2nd13gxz = PDstandard2nd13gxz;
      
      JacPDstandard2nd21gxy = PDstandard2nd12gxy;
      
      JacPDstandard2nd23gxx = PDstandard2nd23gxx;
      
      JacPDstandard2nd23gxy = PDstandard2nd23gxy;
      
      JacPDstandard2nd23gxz = PDstandard2nd23gxz;
      
      JacPDstandard2nd23gyz = PDstandard2nd23gyz;
      
      JacPDstandard2nd31gxy = PDstandard2nd13gxy;
      
      JacPDstandard2nd31gxz = PDstandard2nd13gxz;
      
      JacPDstandard2nd31gyy = PDstandard2nd13gyy;
      
      JacPDstandard2nd31gyz = PDstandard2nd13gyz;
      
      JacPDstandard2nd32gyz = PDstandard2nd23gyz;
    }
    
    CCTK_REAL_VEC detg CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(gxyL,kmul(gxzL,gyzL)),knmsub(gzzL,kmul(gxyL,gxyL),kmsub(gyyL,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)),kmul(gxxL,kmul(gyzL,gyzL)))));
    
    CCTK_REAL_VEC invdetg CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),detg);
    
    CCTK_REAL_VEC gInv11 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gyyL,gzzL,kmul(gyzL,gyzL)));
    
    CCTK_REAL_VEC gInv12 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv13 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv21 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv22 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)));
    
    CCTK_REAL_VEC gInv23 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv31 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv32 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv33 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gyyL,kmul(gxyL,gxyL)));
    
    CCTK_REAL_VEC gamma111 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,JacPDstandard2nd1gxx,kmsub(ToReal(2),kmadd(gInv12,JacPDstandard2nd1gxy,kmul(gInv13,JacPDstandard2nd1gxz)),kmadd(gInv13,JacPDstandard2nd3gxx,kmul(gInv12,JacPDstandard2nd2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma211 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,JacPDstandard2nd1gxx,kmsub(ToReal(2),kmadd(gInv22,JacPDstandard2nd1gxy,kmul(gInv23,JacPDstandard2nd1gxz)),kmadd(gInv23,JacPDstandard2nd3gxx,kmul(gInv22,JacPDstandard2nd2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma311 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,JacPDstandard2nd1gxx,kmsub(ToReal(2),kmadd(gInv32,JacPDstandard2nd1gxy,kmul(gInv33,JacPDstandard2nd1gxz)),kmadd(gInv33,JacPDstandard2nd3gxx,kmul(gInv32,JacPDstandard2nd2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma121 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv12,JacPDstandard2nd1gyy,kmadd(gInv11,JacPDstandard2nd2gxx,kmul(gInv13,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma221 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv22,JacPDstandard2nd1gyy,kmadd(gInv21,JacPDstandard2nd2gxx,kmul(gInv23,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma321 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv32,JacPDstandard2nd1gyy,kmadd(gInv31,JacPDstandard2nd2gxx,kmul(gInv33,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma131 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard2nd1gzz,kmadd(gInv11,JacPDstandard2nd3gxx,kmul(gInv12,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd3gxy,JacPDstandard2nd2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma231 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard2nd1gzz,kmadd(gInv21,JacPDstandard2nd3gxx,kmul(gInv22,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd3gxy,JacPDstandard2nd2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma331 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard2nd1gzz,kmadd(gInv31,JacPDstandard2nd3gxx,kmul(gInv32,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd3gxy,JacPDstandard2nd2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma122 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard2nd2gxy,JacPDstandard2nd1gyy),kmadd(gInv12,JacPDstandard2nd2gyy,kmul(gInv13,kmsub(ToReal(2),JacPDstandard2nd2gyz,JacPDstandard2nd3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma222 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard2nd2gxy,JacPDstandard2nd1gyy),kmadd(gInv22,JacPDstandard2nd2gyy,kmul(gInv23,kmsub(ToReal(2),JacPDstandard2nd2gyz,JacPDstandard2nd3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma322 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard2nd2gxy,JacPDstandard2nd1gyy),kmadd(gInv32,JacPDstandard2nd2gyy,kmul(gInv33,kmsub(ToReal(2),JacPDstandard2nd2gyz,JacPDstandard2nd3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma132 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard2nd2gzz,kmadd(gInv11,ksub(kadd(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy),JacPDstandard2nd1gyz),kmul(gInv12,JacPDstandard2nd3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma232 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard2nd2gzz,kmadd(gInv21,ksub(kadd(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy),JacPDstandard2nd1gyz),kmul(gInv22,JacPDstandard2nd3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma332 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard2nd2gzz,kmadd(gInv31,ksub(kadd(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy),JacPDstandard2nd1gyz),kmul(gInv32,JacPDstandard2nd3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma133 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard2nd3gxz,JacPDstandard2nd1gzz),kmadd(gInv12,kmsub(ToReal(2),JacPDstandard2nd3gyz,JacPDstandard2nd2gzz),kmul(gInv13,JacPDstandard2nd3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma233 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard2nd3gxz,JacPDstandard2nd1gzz),kmadd(gInv22,kmsub(ToReal(2),JacPDstandard2nd3gyz,JacPDstandard2nd2gzz),kmul(gInv23,JacPDstandard2nd3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma333 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard2nd3gxz,JacPDstandard2nd1gzz),kmadd(gInv32,kmsub(ToReal(2),JacPDstandard2nd3gyz,JacPDstandard2nd2gzz),kmul(gInv33,JacPDstandard2nd3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC xmoved CCTK_ATTRIBUTE_UNUSED = ksub(xL,ToReal(xorig));
    
    CCTK_REAL_VEC ymoved CCTK_ATTRIBUTE_UNUSED = ksub(yL,ToReal(yorig));
    
    CCTK_REAL_VEC zmoved CCTK_ATTRIBUTE_UNUSED = ksub(zL,ToReal(zorig));
    
    CCTK_REAL_VEC va1 CCTK_ATTRIBUTE_UNUSED = kneg(ymoved);
    
    CCTK_REAL_VEC va2 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC va3 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC vb1 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC vb2 CCTK_ATTRIBUTE_UNUSED = ymoved;
    
    CCTK_REAL_VEC vb3 CCTK_ATTRIBUTE_UNUSED = zmoved;
    
    CCTK_REAL_VEC vc1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv12,va3,kmul(gInv13,va2)),vb1,kmadd(kmsub(gInv13,va1,kmul(gInv11,va3)),vb2,kmul(vb3,kmsub(gInv11,va2,kmul(gInv12,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv22,va3,kmul(gInv23,va2)),vb1,kmadd(kmsub(gInv23,va1,kmul(gInv21,va3)),vb2,kmul(vb3,kmsub(gInv21,va2,kmul(gInv22,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv32,va3,kmul(gInv33,va2)),vb1,kmadd(kmsub(gInv33,va1,kmul(gInv31,va3)),vb2,kmul(vb3,kmsub(gInv31,va2,kmul(gInv32,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC wa1 CCTK_ATTRIBUTE_UNUSED = va1;
    
    CCTK_REAL_VEC wa2 CCTK_ATTRIBUTE_UNUSED = va2;
    
    CCTK_REAL_VEC wa3 CCTK_ATTRIBUTE_UNUSED = va3;
    
    CCTK_REAL_VEC omega11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wa2,wa3),kmul(wa1,kmadd(gxyL,wa2,kmul(gxzL,wa3)))),kmadd(gxxL,kmul(wa1,wa1),kmadd(gyyL,kmul(wa2,wa2),kmul(gzzL,kmul(wa3,wa3)))));
    
    CCTK_REAL_VEC ea1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa1,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa2,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa3,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC omega12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vb1,kmadd(gxyL,vb2,kmul(gxzL,vb3))),kmadd(ea2,kmadd(gxyL,vb1,kmadd(gyyL,vb2,kmul(gyzL,vb3))),kmul(ea3,kmadd(gxzL,vb1,kmadd(gyzL,vb2,kmul(gzzL,vb3))))));
    
    CCTK_REAL_VEC wb1 CCTK_ATTRIBUTE_UNUSED = knmsub(ea1,omega12,vb1);
    
    CCTK_REAL_VEC wb2 CCTK_ATTRIBUTE_UNUSED = knmsub(ea2,omega12,vb2);
    
    CCTK_REAL_VEC wb3 CCTK_ATTRIBUTE_UNUSED = knmsub(ea3,omega12,vb3);
    
    CCTK_REAL_VEC omega22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wb2,wb3),kmul(wb1,kmadd(gxyL,wb2,kmul(gxzL,wb3)))),kmadd(gxxL,kmul(wb1,wb1),kmadd(gyyL,kmul(wb2,wb2),kmul(gzzL,kmul(wb3,wb3)))));
    
    CCTK_REAL_VEC eb1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb1,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb2,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb3,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC omega13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(ea2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(ea3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC omega23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(eb1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(eb2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(eb3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC wc1 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea1,omega13,knmsub(eb1,omega23,vc1));
    
    CCTK_REAL_VEC wc2 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea2,omega13,knmsub(eb2,omega23,vc2));
    
    CCTK_REAL_VEC wc3 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea3,omega13,knmsub(eb3,omega23,vc3));
    
    CCTK_REAL_VEC omega33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wc2,wc3),kmul(wc1,kmadd(gxyL,wc2,kmul(gxzL,wc3)))),kmadd(gxxL,kmul(wc1,wc1),kmadd(gyyL,kmul(wc2,wc2),kmul(gzzL,kmul(wc3,wc3)))));
    
    CCTK_REAL_VEC ec1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc1,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc2,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc3,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC isqrt2 CCTK_ATTRIBUTE_UNUSED = 
      ToReal(0.707106781186547524);
    
    CCTK_REAL_VEC n1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb1,isqrt2));
    
    CCTK_REAL_VEC n2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb2,isqrt2));
    
    CCTK_REAL_VEC n3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb3,isqrt2));
    
    CCTK_REAL_VEC rm1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rm2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rm3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC im1 CCTK_ATTRIBUTE_UNUSED = kmul(ea1,isqrt2);
    
    CCTK_REAL_VEC im2 CCTK_ATTRIBUTE_UNUSED = kmul(ea2,isqrt2);
    
    CCTK_REAL_VEC im3 CCTK_ATTRIBUTE_UNUSED = kmul(ea3,isqrt2);
    
    CCTK_REAL_VEC rmbar1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rmbar2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rmbar3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC imbar1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea1,isqrt2));
    
    CCTK_REAL_VEC imbar2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea2,isqrt2));
    
    CCTK_REAL_VEC imbar3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea3,isqrt2));
    
    CCTK_REAL_VEC nn CCTK_ATTRIBUTE_UNUSED = isqrt2;
    
    CCTK_REAL_VEC R1212 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma221,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(gamma321,kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321)))))),kmadd(ToReal(-2),kmadd(gamma122,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma222,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma322))),ksub(kadd(JacPDstandard2nd12gxy,ksub(JacPDstandard2nd21gxy,JacPDstandard2nd22gxx)),JacPDstandard2nd11gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC R1213 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma221,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma321,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma232,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma332))),ksub(kadd(JacPDstandard2nd12gxz,ksub(JacPDstandard2nd31gxy,JacPDstandard2nd23gxx)),JacPDstandard2nd11gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1223 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma122,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma222,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma322,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma232,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma332))),ksub(kadd(JacPDstandard2nd22gxz,ksub(JacPDstandard2nd31gyy,JacPDstandard2nd23gxy)),JacPDstandard2nd12gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1313 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma131,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma231,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma331,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma233,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma333))),ksub(kadd(JacPDstandard2nd13gxz,ksub(JacPDstandard2nd31gxz,JacPDstandard2nd33gxx)),JacPDstandard2nd11gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma232,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331))),gamma332))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma233,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma333))),ksub(kadd(JacPDstandard2nd23gxz,ksub(JacPDstandard2nd31gyz,JacPDstandard2nd33gxy)),JacPDstandard2nd12gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R2323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma132,kmadd(gxyL,gamma232,kmul(gxzL,gamma332))),kmadd(gamma232,kmadd(gxyL,gamma132,kmadd(gyyL,gamma232,kmul(gyzL,gamma332))),kmul(gamma332,kmadd(gxzL,gamma132,kmadd(gyzL,gamma232,kmul(gzzL,gamma332)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma122,kmadd(gxyL,gamma222,kmul(gxzL,gamma322))),kmadd(gamma233,kmadd(gxyL,gamma122,kmadd(gyyL,gamma222,kmul(gyzL,gamma322))),kmul(kmadd(gxzL,gamma122,kmadd(gyzL,gamma222,kmul(gzzL,gamma322))),gamma333))),ksub(kadd(JacPDstandard2nd23gyz,ksub(JacPDstandard2nd32gyz,JacPDstandard2nd33gyy)),JacPDstandard2nd22gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R4p1212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212));
    
    CCTK_REAL_VEC R4p1213 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213));
    
    CCTK_REAL_VEC R4p1223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223));
    
    CCTK_REAL_VEC R4p1313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313));
    
    CCTK_REAL_VEC R4p1323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323));
    
    CCTK_REAL_VEC R4p2323 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323));
    
    CCTK_REAL_VEC Ro111 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro112 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma121,knmsub(kyyL,gamma211,kmadd(kxyL,ksub(gamma221,gamma111),knmsub(kyzL,gamma311,kmadd(kxzL,gamma321,ksub(JacPDstandard2nd1kxy,JacPDstandard2nd2kxx))))));
    
    CCTK_REAL_VEC Ro113 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma131,knmsub(kyzL,gamma211,kmadd(kxyL,gamma231,knmsub(kzzL,gamma311,kmadd(kxzL,ksub(gamma331,gamma111),ksub(JacPDstandard2nd1kxz,JacPDstandard2nd3kxx))))));
    
    CCTK_REAL_VEC Ro121 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma121,kmadd(kyyL,gamma211,kmadd(kxyL,ksub(gamma111,gamma221),kmadd(kyzL,gamma311,knmsub(kxzL,gamma321,ksub(JacPDstandard2nd2kxx,JacPDstandard2nd1kxy))))));
    
    CCTK_REAL_VEC Ro122 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro123 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma121,kmadd(kxyL,gamma131,kmadd(kyyL,gamma231,knmsub(kzzL,gamma321,kmadd(kyzL,ksub(gamma331,gamma221),ksub(JacPDstandard2nd2kxz,JacPDstandard2nd3kxy))))));
    
    CCTK_REAL_VEC Ro131 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma131,kmadd(kyzL,gamma211,knmsub(kxyL,gamma231,kmadd(kzzL,gamma311,kmadd(kxzL,ksub(gamma111,gamma331),ksub(JacPDstandard2nd3kxx,JacPDstandard2nd1kxz))))));
    
    CCTK_REAL_VEC Ro132 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma121,knmsub(kxyL,gamma131,knmsub(kyyL,gamma231,kmadd(kzzL,gamma321,kmadd(kyzL,ksub(gamma221,gamma331),ksub(JacPDstandard2nd3kxy,JacPDstandard2nd2kxz))))));
    
    CCTK_REAL_VEC Ro133 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro211 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma122,knmsub(kyyL,gamma221,kmadd(kxyL,ksub(gamma222,gamma121),knmsub(kyzL,gamma321,kmadd(kxzL,gamma322,ksub(JacPDstandard2nd1kyy,JacPDstandard2nd2kxy))))));
    
    CCTK_REAL_VEC Ro213 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyzL,gamma221,kmadd(kxyL,gamma232,knmsub(kzzL,gamma321,kmadd(kxzL,ksub(gamma332,gamma121),ksub(JacPDstandard2nd1kyz,JacPDstandard2nd3kxy))))));
    
    CCTK_REAL_VEC Ro221 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma122,kmadd(kyyL,gamma221,kmadd(kxyL,ksub(gamma121,gamma222),kmadd(kyzL,gamma321,knmsub(kxzL,gamma322,ksub(JacPDstandard2nd2kxy,JacPDstandard2nd1kyy))))));
    
    CCTK_REAL_VEC Ro222 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma122,kmadd(kxyL,gamma132,kmadd(kyyL,gamma232,knmsub(kzzL,gamma322,kmadd(kyzL,ksub(gamma332,gamma222),ksub(JacPDstandard2nd2kyz,JacPDstandard2nd3kyy))))));
    
    CCTK_REAL_VEC Ro231 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyzL,gamma221,knmsub(kxyL,gamma232,kmadd(kzzL,gamma321,kmadd(kxzL,ksub(gamma121,gamma332),ksub(JacPDstandard2nd3kxy,JacPDstandard2nd1kyz))))));
    
    CCTK_REAL_VEC Ro232 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma122,knmsub(kxyL,gamma132,knmsub(kyyL,gamma232,kmadd(kzzL,gamma322,kmadd(kyzL,ksub(gamma222,gamma332),ksub(JacPDstandard2nd3kyy,JacPDstandard2nd2kyz))))));
    
    CCTK_REAL_VEC Ro233 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro311 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro312 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyyL,gamma231,kmadd(kxyL,ksub(gamma232,gamma131),knmsub(kyzL,gamma331,kmadd(kxzL,gamma332,ksub(JacPDstandard2nd1kyz,JacPDstandard2nd2kxz))))));
    
    CCTK_REAL_VEC Ro313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma133,knmsub(kyzL,gamma231,kmadd(kxyL,gamma233,knmsub(kzzL,gamma331,kmadd(kxzL,ksub(gamma333,gamma131),ksub(JacPDstandard2nd1kzz,JacPDstandard2nd3kxz))))));
    
    CCTK_REAL_VEC Ro321 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyyL,gamma231,kmadd(kxyL,ksub(gamma131,gamma232),kmadd(kyzL,gamma331,knmsub(kxzL,gamma332,ksub(JacPDstandard2nd2kxz,JacPDstandard2nd1kyz))))));
    
    CCTK_REAL_VEC Ro322 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma132,kmadd(kxyL,gamma133,kmadd(kyyL,gamma233,knmsub(kzzL,gamma332,kmadd(kyzL,ksub(gamma333,gamma232),ksub(JacPDstandard2nd2kzz,JacPDstandard2nd3kyz))))));
    
    CCTK_REAL_VEC Ro331 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma133,kmadd(kyzL,gamma231,knmsub(kxyL,gamma233,kmadd(kzzL,gamma331,kmadd(kxzL,ksub(gamma131,gamma333),ksub(JacPDstandard2nd3kxz,JacPDstandard2nd1kzz))))));
    
    CCTK_REAL_VEC Ro332 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma132,knmsub(kxyL,gamma133,knmsub(kyyL,gamma233,kmadd(kzzL,gamma332,kmadd(kyzL,ksub(gamma232,gamma333),ksub(JacPDstandard2nd3kyz,JacPDstandard2nd2kzz))))));
    
    CCTK_REAL_VEC Ro333 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Rojo11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv23,gInv32),knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv22,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)))));
    
    CCTK_REAL_VEC Rojo12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv32,knmsub(gInv21,R1212,knmsub(gInv31,R1213,kmadd(gInv23,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv12,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv23,knmsub(gInv21,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv31,R1313,kmsub(gInv13,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv32,R1323)))))));
    
    CCTK_REAL_VEC Rojo21 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv23,kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv31,knmsub(gInv12,R1212,knmsub(gInv13,R1213,kmadd(gInv32,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv21,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv13,gInv31),kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),kmadd(gInv11,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Rojo23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv21,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv12,R1223,knmsub(gInv31,R1323,kmsub(gInv23,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv32,R2323)))))));
    
    CCTK_REAL_VEC Rojo31 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv21,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv32,knmsub(gInv12,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv13,R1313,kmsub(gInv31,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv23,R1323)))))));
    
    CCTK_REAL_VEC Rojo32 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv31,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv21,R1223,knmsub(gInv13,R1323,kmsub(gInv32,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv23,R2323)))))));
    
    CCTK_REAL_VEC Rojo33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv12,gInv21),knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmadd(gInv11,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)),kmul(gInv22,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(imbar1,imbar2,kmul(rmbar1,rmbar2)),kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3))),kmadd(ToReal(2),kmul(kmadd(n1,kmul(n2,R4p1213),kmadd(n1,kmul(n3,R4p1313),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))),kmsub(imbar1,imbar3,kmul(rmbar1,rmbar3))),knmsub(kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3)))),kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),knmsub(kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3)))),kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),knmsub(kmul(nn,nn),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo23,kmadd(imbar1,kmadd(imbar2,kadd(Rojo12,Rojo21),kmul(imbar3,kadd(Rojo13,Rojo31))),knmsub(rmbar1,kmadd(rmbar2,kadd(Rojo12,Rojo21),kmul(rmbar3,kadd(Rojo13,Rojo31))),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo32,kmadd(Rojo11,kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),kmadd(Rojo22,kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),kmul(Rojo33,kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro112,kmadd(n2,Ro122,kmul(n3,Ro132))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro113,kmadd(n2,Ro123,kmul(n3,Ro133))),kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro211,kmadd(n2,Ro221,kmul(n3,Ro231))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro213,kmadd(n2,Ro223,kmul(n3,Ro233))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro311,kmadd(n2,Ro321,kmul(n3,Ro331))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro312,kmadd(n2,Ro322,kmul(n3,Ro332))),kmadd(kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131))),kmsub(rmbar1,rmbar1,kmul(imbar1,imbar1)),kmadd(kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232))),kmsub(rmbar2,rmbar2,kmul(imbar2,imbar2)),kmul(kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))),kmsub(rmbar3,rmbar3,kmul(imbar3,imbar3)))))))))))),kmul(kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2)))),kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))));
    
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,knmsub(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(n1,kadd(Ro112,Ro211),kmadd(n3,kadd(Ro132,Ro231),kmul(n2,kadd(Ro122,Ro221)))),kmadd(ToReal(-2),kmadd(im1,kmul(rm1,kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131)))),kmul(im2,kmul(rm2,kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232)))))),knmsub(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kadd(Ro113,Ro311),kmadd(n3,kadd(Ro133,Ro331),kmul(n2,kadd(Ro123,Ro321)))),kmsub(ToReal(-2),kmul(im3,kmul(rm3,kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))))),kmul(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kadd(Ro213,Ro312),kmadd(n3,kadd(Ro233,Ro332),kmul(n2,kadd(Ro223,Ro322))))))))),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kmadd(n2,R4p1213,kmul(n3,R4p1313)),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))))),kmsub(ToReal(-2),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(Psi4i[index],Psi4iL);
    vec_store_nta_partial(Psi4r[index],Psi4rL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_psi4_calc_2nd);
}
extern "C" void WeylScal4_psi4_calc_2nd(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_psi4_calc_2nd_Body");
  }
  if (cctk_iteration % WeylScal4_psi4_calc_2nd_calc_every != WeylScal4_psi4_calc_2nd_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "admbase::curv",
    "admbase::metric",
    "grid::coordinates",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_psi4_calc_2nd", 5, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_2nd", 1, 1, 1);
      break;
    }
    
    case 4:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_2nd", 1, 1, 1);
      break;
    }
    
    case 6:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_2nd", 1, 1, 1);
      break;
    }
    
    case 8:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_2nd", 1, 1, 1);
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverInterior(cctkGH, WeylScal4_psi4_calc_2nd_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_psi4_calc_2nd_Body");
  }
}

} // namespace WeylScal4

```

WeylScal4_psis_calc_2nd.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {

extern "C" void WeylScal4_psis_calc_2nd_SelectBCs(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (cctk_iteration % WeylScal4_psis_calc_2nd_calc_every != WeylScal4_psis_calc_2nd_calc_offset)
    return;
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi0i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi0i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi0r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi0r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi1i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi1i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi1r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi1r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi2i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi2i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi2r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi2r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi3i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi3i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi3r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi3r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4r_group.");
  return;
}

static void WeylScal4_psis_calc_2nd_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_psis_calc_2nd,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC gxxL CCTK_ATTRIBUTE_UNUSED = vec_load(gxx[index]);
    CCTK_REAL_VEC gxyL CCTK_ATTRIBUTE_UNUSED = vec_load(gxy[index]);
    CCTK_REAL_VEC gxzL CCTK_ATTRIBUTE_UNUSED = vec_load(gxz[index]);
    CCTK_REAL_VEC gyyL CCTK_ATTRIBUTE_UNUSED = vec_load(gyy[index]);
    CCTK_REAL_VEC gyzL CCTK_ATTRIBUTE_UNUSED = vec_load(gyz[index]);
    CCTK_REAL_VEC gzzL CCTK_ATTRIBUTE_UNUSED = vec_load(gzz[index]);
    CCTK_REAL_VEC kxxL CCTK_ATTRIBUTE_UNUSED = vec_load(kxx[index]);
    CCTK_REAL_VEC kxyL CCTK_ATTRIBUTE_UNUSED = vec_load(kxy[index]);
    CCTK_REAL_VEC kxzL CCTK_ATTRIBUTE_UNUSED = vec_load(kxz[index]);
    CCTK_REAL_VEC kyyL CCTK_ATTRIBUTE_UNUSED = vec_load(kyy[index]);
    CCTK_REAL_VEC kyzL CCTK_ATTRIBUTE_UNUSED = vec_load(kyz[index]);
    CCTK_REAL_VEC kzzL CCTK_ATTRIBUTE_UNUSED = vec_load(kzz[index]);
    CCTK_REAL_VEC xL CCTK_ATTRIBUTE_UNUSED = vec_load(x[index]);
    CCTK_REAL_VEC yL CCTK_ATTRIBUTE_UNUSED = vec_load(y[index]);
    CCTK_REAL_VEC zL CCTK_ATTRIBUTE_UNUSED = vec_load(z[index]);
    
    
    CCTK_REAL_VEC dJ111L, dJ112L, dJ113L, dJ122L, dJ123L, dJ133L, dJ211L, dJ212L, dJ213L, dJ222L, dJ223L, dJ233L, dJ311L, dJ312L, dJ313L, dJ322L, dJ323L, dJ333L, J11L, J12L, J13L, J21L, J22L, J23L, J31L, J32L, J33L CCTK_ATTRIBUTE_UNUSED ;
    
    if (usejacobian)
    {
      dJ111L = vec_load(dJ111[index]);
      dJ112L = vec_load(dJ112[index]);
      dJ113L = vec_load(dJ113[index]);
      dJ122L = vec_load(dJ122[index]);
      dJ123L = vec_load(dJ123[index]);
      dJ133L = vec_load(dJ133[index]);
      dJ211L = vec_load(dJ211[index]);
      dJ212L = vec_load(dJ212[index]);
      dJ213L = vec_load(dJ213[index]);
      dJ222L = vec_load(dJ222[index]);
      dJ223L = vec_load(dJ223[index]);
      dJ233L = vec_load(dJ233[index]);
      dJ311L = vec_load(dJ311[index]);
      dJ312L = vec_load(dJ312[index]);
      dJ313L = vec_load(dJ313[index]);
      dJ322L = vec_load(dJ322[index]);
      dJ323L = vec_load(dJ323[index]);
      dJ333L = vec_load(dJ333[index]);
      J11L = vec_load(J11[index]);
      J12L = vec_load(J12[index]);
      J13L = vec_load(J13[index]);
      J21L = vec_load(J21[index]);
      J22L = vec_load(J22[index]);
      J23L = vec_load(J23[index]);
      J31L = vec_load(J31[index]);
      J32L = vec_load(J32[index]);
      J33L = vec_load(J33[index]);
    }
    /* Include user supplied include files */
    /* Precompute derivatives */
    CCTK_REAL_VEC PDstandard2nd1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd33gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd13gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd23gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard2nd3kzz CCTK_ATTRIBUTE_UNUSED;
    
    switch (fdOrder)
    {
      case 2:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      
      case 4:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      
      case 6:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      
      case 8:
      {
        PDstandard2nd1gxx = PDstandard2nd1(&gxx[index]);
        PDstandard2nd2gxx = PDstandard2nd2(&gxx[index]);
        PDstandard2nd3gxx = PDstandard2nd3(&gxx[index]);
        PDstandard2nd11gxx = PDstandard2nd11(&gxx[index]);
        PDstandard2nd22gxx = PDstandard2nd22(&gxx[index]);
        PDstandard2nd33gxx = PDstandard2nd33(&gxx[index]);
        PDstandard2nd12gxx = PDstandard2nd12(&gxx[index]);
        PDstandard2nd13gxx = PDstandard2nd13(&gxx[index]);
        PDstandard2nd23gxx = PDstandard2nd23(&gxx[index]);
        PDstandard2nd1gxy = PDstandard2nd1(&gxy[index]);
        PDstandard2nd2gxy = PDstandard2nd2(&gxy[index]);
        PDstandard2nd3gxy = PDstandard2nd3(&gxy[index]);
        PDstandard2nd11gxy = PDstandard2nd11(&gxy[index]);
        PDstandard2nd22gxy = PDstandard2nd22(&gxy[index]);
        PDstandard2nd33gxy = PDstandard2nd33(&gxy[index]);
        PDstandard2nd12gxy = PDstandard2nd12(&gxy[index]);
        PDstandard2nd13gxy = PDstandard2nd13(&gxy[index]);
        PDstandard2nd23gxy = PDstandard2nd23(&gxy[index]);
        PDstandard2nd1gxz = PDstandard2nd1(&gxz[index]);
        PDstandard2nd2gxz = PDstandard2nd2(&gxz[index]);
        PDstandard2nd3gxz = PDstandard2nd3(&gxz[index]);
        PDstandard2nd11gxz = PDstandard2nd11(&gxz[index]);
        PDstandard2nd22gxz = PDstandard2nd22(&gxz[index]);
        PDstandard2nd33gxz = PDstandard2nd33(&gxz[index]);
        PDstandard2nd12gxz = PDstandard2nd12(&gxz[index]);
        PDstandard2nd13gxz = PDstandard2nd13(&gxz[index]);
        PDstandard2nd23gxz = PDstandard2nd23(&gxz[index]);
        PDstandard2nd1gyy = PDstandard2nd1(&gyy[index]);
        PDstandard2nd2gyy = PDstandard2nd2(&gyy[index]);
        PDstandard2nd3gyy = PDstandard2nd3(&gyy[index]);
        PDstandard2nd11gyy = PDstandard2nd11(&gyy[index]);
        PDstandard2nd22gyy = PDstandard2nd22(&gyy[index]);
        PDstandard2nd33gyy = PDstandard2nd33(&gyy[index]);
        PDstandard2nd12gyy = PDstandard2nd12(&gyy[index]);
        PDstandard2nd13gyy = PDstandard2nd13(&gyy[index]);
        PDstandard2nd23gyy = PDstandard2nd23(&gyy[index]);
        PDstandard2nd1gyz = PDstandard2nd1(&gyz[index]);
        PDstandard2nd2gyz = PDstandard2nd2(&gyz[index]);
        PDstandard2nd3gyz = PDstandard2nd3(&gyz[index]);
        PDstandard2nd11gyz = PDstandard2nd11(&gyz[index]);
        PDstandard2nd22gyz = PDstandard2nd22(&gyz[index]);
        PDstandard2nd33gyz = PDstandard2nd33(&gyz[index]);
        PDstandard2nd12gyz = PDstandard2nd12(&gyz[index]);
        PDstandard2nd13gyz = PDstandard2nd13(&gyz[index]);
        PDstandard2nd23gyz = PDstandard2nd23(&gyz[index]);
        PDstandard2nd1gzz = PDstandard2nd1(&gzz[index]);
        PDstandard2nd2gzz = PDstandard2nd2(&gzz[index]);
        PDstandard2nd3gzz = PDstandard2nd3(&gzz[index]);
        PDstandard2nd11gzz = PDstandard2nd11(&gzz[index]);
        PDstandard2nd22gzz = PDstandard2nd22(&gzz[index]);
        PDstandard2nd33gzz = PDstandard2nd33(&gzz[index]);
        PDstandard2nd12gzz = PDstandard2nd12(&gzz[index]);
        PDstandard2nd13gzz = PDstandard2nd13(&gzz[index]);
        PDstandard2nd23gzz = PDstandard2nd23(&gzz[index]);
        PDstandard2nd1kxx = PDstandard2nd1(&kxx[index]);
        PDstandard2nd2kxx = PDstandard2nd2(&kxx[index]);
        PDstandard2nd3kxx = PDstandard2nd3(&kxx[index]);
        PDstandard2nd1kxy = PDstandard2nd1(&kxy[index]);
        PDstandard2nd2kxy = PDstandard2nd2(&kxy[index]);
        PDstandard2nd3kxy = PDstandard2nd3(&kxy[index]);
        PDstandard2nd1kxz = PDstandard2nd1(&kxz[index]);
        PDstandard2nd2kxz = PDstandard2nd2(&kxz[index]);
        PDstandard2nd3kxz = PDstandard2nd3(&kxz[index]);
        PDstandard2nd1kyy = PDstandard2nd1(&kyy[index]);
        PDstandard2nd2kyy = PDstandard2nd2(&kyy[index]);
        PDstandard2nd3kyy = PDstandard2nd3(&kyy[index]);
        PDstandard2nd1kyz = PDstandard2nd1(&kyz[index]);
        PDstandard2nd2kyz = PDstandard2nd2(&kyz[index]);
        PDstandard2nd3kyz = PDstandard2nd3(&kyz[index]);
        PDstandard2nd1kzz = PDstandard2nd1(&kzz[index]);
        PDstandard2nd2kzz = PDstandard2nd2(&kzz[index]);
        PDstandard2nd3kzz = PDstandard2nd3(&kzz[index]);
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC JacPDstandard2nd11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd21gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd31gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd32gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard2nd3kyz CCTK_ATTRIBUTE_UNUSED;
    
    if (usejacobian)
    {
      JacPDstandard2nd1gxx = 
        kmadd(J11L,PDstandard2nd1gxx,kmadd(J21L,PDstandard2nd2gxx,kmul(J31L,PDstandard2nd3gxx)));
      
      JacPDstandard2nd1gxy = 
        kmadd(J11L,PDstandard2nd1gxy,kmadd(J21L,PDstandard2nd2gxy,kmul(J31L,PDstandard2nd3gxy)));
      
      JacPDstandard2nd1gxz = 
        kmadd(J11L,PDstandard2nd1gxz,kmadd(J21L,PDstandard2nd2gxz,kmul(J31L,PDstandard2nd3gxz)));
      
      JacPDstandard2nd1gyy = 
        kmadd(J11L,PDstandard2nd1gyy,kmadd(J21L,PDstandard2nd2gyy,kmul(J31L,PDstandard2nd3gyy)));
      
      JacPDstandard2nd1gyz = 
        kmadd(J11L,PDstandard2nd1gyz,kmadd(J21L,PDstandard2nd2gyz,kmul(J31L,PDstandard2nd3gyz)));
      
      JacPDstandard2nd1gzz = 
        kmadd(J11L,PDstandard2nd1gzz,kmadd(J21L,PDstandard2nd2gzz,kmul(J31L,PDstandard2nd3gzz)));
      
      JacPDstandard2nd1kxy = 
        kmadd(J11L,PDstandard2nd1kxy,kmadd(J21L,PDstandard2nd2kxy,kmul(J31L,PDstandard2nd3kxy)));
      
      JacPDstandard2nd1kxz = 
        kmadd(J11L,PDstandard2nd1kxz,kmadd(J21L,PDstandard2nd2kxz,kmul(J31L,PDstandard2nd3kxz)));
      
      JacPDstandard2nd1kyy = 
        kmadd(J11L,PDstandard2nd1kyy,kmadd(J21L,PDstandard2nd2kyy,kmul(J31L,PDstandard2nd3kyy)));
      
      JacPDstandard2nd1kyz = 
        kmadd(J11L,PDstandard2nd1kyz,kmadd(J21L,PDstandard2nd2kyz,kmul(J31L,PDstandard2nd3kyz)));
      
      JacPDstandard2nd1kzz = 
        kmadd(J11L,PDstandard2nd1kzz,kmadd(J21L,PDstandard2nd2kzz,kmul(J31L,PDstandard2nd3kzz)));
      
      JacPDstandard2nd2gxx = 
        kmadd(J12L,PDstandard2nd1gxx,kmadd(J22L,PDstandard2nd2gxx,kmul(J32L,PDstandard2nd3gxx)));
      
      JacPDstandard2nd2gxy = 
        kmadd(J12L,PDstandard2nd1gxy,kmadd(J22L,PDstandard2nd2gxy,kmul(J32L,PDstandard2nd3gxy)));
      
      JacPDstandard2nd2gxz = 
        kmadd(J12L,PDstandard2nd1gxz,kmadd(J22L,PDstandard2nd2gxz,kmul(J32L,PDstandard2nd3gxz)));
      
      JacPDstandard2nd2gyy = 
        kmadd(J12L,PDstandard2nd1gyy,kmadd(J22L,PDstandard2nd2gyy,kmul(J32L,PDstandard2nd3gyy)));
      
      JacPDstandard2nd2gyz = 
        kmadd(J12L,PDstandard2nd1gyz,kmadd(J22L,PDstandard2nd2gyz,kmul(J32L,PDstandard2nd3gyz)));
      
      JacPDstandard2nd2gzz = 
        kmadd(J12L,PDstandard2nd1gzz,kmadd(J22L,PDstandard2nd2gzz,kmul(J32L,PDstandard2nd3gzz)));
      
      JacPDstandard2nd2kxx = 
        kmadd(J12L,PDstandard2nd1kxx,kmadd(J22L,PDstandard2nd2kxx,kmul(J32L,PDstandard2nd3kxx)));
      
      JacPDstandard2nd2kxy = 
        kmadd(J12L,PDstandard2nd1kxy,kmadd(J22L,PDstandard2nd2kxy,kmul(J32L,PDstandard2nd3kxy)));
      
      JacPDstandard2nd2kxz = 
        kmadd(J12L,PDstandard2nd1kxz,kmadd(J22L,PDstandard2nd2kxz,kmul(J32L,PDstandard2nd3kxz)));
      
      JacPDstandard2nd2kyz = 
        kmadd(J12L,PDstandard2nd1kyz,kmadd(J22L,PDstandard2nd2kyz,kmul(J32L,PDstandard2nd3kyz)));
      
      JacPDstandard2nd2kzz = 
        kmadd(J12L,PDstandard2nd1kzz,kmadd(J22L,PDstandard2nd2kzz,kmul(J32L,PDstandard2nd3kzz)));
      
      JacPDstandard2nd3gxx = 
        kmadd(J13L,PDstandard2nd1gxx,kmadd(J23L,PDstandard2nd2gxx,kmul(J33L,PDstandard2nd3gxx)));
      
      JacPDstandard2nd3gxy = 
        kmadd(J13L,PDstandard2nd1gxy,kmadd(J23L,PDstandard2nd2gxy,kmul(J33L,PDstandard2nd3gxy)));
      
      JacPDstandard2nd3gxz = 
        kmadd(J13L,PDstandard2nd1gxz,kmadd(J23L,PDstandard2nd2gxz,kmul(J33L,PDstandard2nd3gxz)));
      
      JacPDstandard2nd3gyy = 
        kmadd(J13L,PDstandard2nd1gyy,kmadd(J23L,PDstandard2nd2gyy,kmul(J33L,PDstandard2nd3gyy)));
      
      JacPDstandard2nd3gyz = 
        kmadd(J13L,PDstandard2nd1gyz,kmadd(J23L,PDstandard2nd2gyz,kmul(J33L,PDstandard2nd3gyz)));
      
      JacPDstandard2nd3gzz = 
        kmadd(J13L,PDstandard2nd1gzz,kmadd(J23L,PDstandard2nd2gzz,kmul(J33L,PDstandard2nd3gzz)));
      
      JacPDstandard2nd3kxx = 
        kmadd(J13L,PDstandard2nd1kxx,kmadd(J23L,PDstandard2nd2kxx,kmul(J33L,PDstandard2nd3kxx)));
      
      JacPDstandard2nd3kxy = 
        kmadd(J13L,PDstandard2nd1kxy,kmadd(J23L,PDstandard2nd2kxy,kmul(J33L,PDstandard2nd3kxy)));
      
      JacPDstandard2nd3kxz = 
        kmadd(J13L,PDstandard2nd1kxz,kmadd(J23L,PDstandard2nd2kxz,kmul(J33L,PDstandard2nd3kxz)));
      
      JacPDstandard2nd3kyy = 
        kmadd(J13L,PDstandard2nd1kyy,kmadd(J23L,PDstandard2nd2kyy,kmul(J33L,PDstandard2nd3kyy)));
      
      JacPDstandard2nd3kyz = 
        kmadd(J13L,PDstandard2nd1kyz,kmadd(J23L,PDstandard2nd2kyz,kmul(J33L,PDstandard2nd3kyz)));
      
      JacPDstandard2nd11gyy = 
        kmadd(dJ111L,PDstandard2nd1gyy,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard2nd12gyy,kmul(J31L,PDstandard2nd13gyy)),kmul(J21L,kmul(J31L,PDstandard2nd23gyy))),kmadd(dJ211L,PDstandard2nd2gyy,kmadd(dJ311L,PDstandard2nd3gyy,kmadd(PDstandard2nd11gyy,kmul(J11L,J11L),kmadd(PDstandard2nd22gyy,kmul(J21L,J21L),kmul(PDstandard2nd33gyy,kmul(J31L,J31L))))))));
      
      JacPDstandard2nd11gyz = 
        kmadd(dJ111L,PDstandard2nd1gyz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard2nd12gyz,kmul(J31L,PDstandard2nd13gyz)),kmul(J21L,kmul(J31L,PDstandard2nd23gyz))),kmadd(dJ211L,PDstandard2nd2gyz,kmadd(dJ311L,PDstandard2nd3gyz,kmadd(PDstandard2nd11gyz,kmul(J11L,J11L),kmadd(PDstandard2nd22gyz,kmul(J21L,J21L),kmul(PDstandard2nd33gyz,kmul(J31L,J31L))))))));
      
      JacPDstandard2nd11gzz = 
        kmadd(dJ111L,PDstandard2nd1gzz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard2nd12gzz,kmul(J31L,PDstandard2nd13gzz)),kmul(J21L,kmul(J31L,PDstandard2nd23gzz))),kmadd(dJ211L,PDstandard2nd2gzz,kmadd(dJ311L,PDstandard2nd3gzz,kmadd(PDstandard2nd11gzz,kmul(J11L,J11L),kmadd(PDstandard2nd22gzz,kmul(J21L,J21L),kmul(PDstandard2nd33gzz,kmul(J31L,J31L))))))));
      
      JacPDstandard2nd22gxx = 
        kmadd(dJ122L,PDstandard2nd1gxx,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard2nd12gxx,kmul(J32L,PDstandard2nd13gxx)),kmul(J22L,kmul(J32L,PDstandard2nd23gxx))),kmadd(dJ222L,PDstandard2nd2gxx,kmadd(dJ322L,PDstandard2nd3gxx,kmadd(PDstandard2nd11gxx,kmul(J12L,J12L),kmadd(PDstandard2nd22gxx,kmul(J22L,J22L),kmul(PDstandard2nd33gxx,kmul(J32L,J32L))))))));
      
      JacPDstandard2nd22gxz = 
        kmadd(dJ122L,PDstandard2nd1gxz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard2nd12gxz,kmul(J32L,PDstandard2nd13gxz)),kmul(J22L,kmul(J32L,PDstandard2nd23gxz))),kmadd(dJ222L,PDstandard2nd2gxz,kmadd(dJ322L,PDstandard2nd3gxz,kmadd(PDstandard2nd11gxz,kmul(J12L,J12L),kmadd(PDstandard2nd22gxz,kmul(J22L,J22L),kmul(PDstandard2nd33gxz,kmul(J32L,J32L))))))));
      
      JacPDstandard2nd22gzz = 
        kmadd(dJ122L,PDstandard2nd1gzz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard2nd12gzz,kmul(J32L,PDstandard2nd13gzz)),kmul(J22L,kmul(J32L,PDstandard2nd23gzz))),kmadd(dJ222L,PDstandard2nd2gzz,kmadd(dJ322L,PDstandard2nd3gzz,kmadd(PDstandard2nd11gzz,kmul(J12L,J12L),kmadd(PDstandard2nd22gzz,kmul(J22L,J22L),kmul(PDstandard2nd33gzz,kmul(J32L,J32L))))))));
      
      JacPDstandard2nd33gxx = 
        kmadd(dJ133L,PDstandard2nd1gxx,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard2nd12gxx,kmul(J33L,PDstandard2nd13gxx)),kmul(J23L,kmul(J33L,PDstandard2nd23gxx))),kmadd(dJ233L,PDstandard2nd2gxx,kmadd(dJ333L,PDstandard2nd3gxx,kmadd(PDstandard2nd11gxx,kmul(J13L,J13L),kmadd(PDstandard2nd22gxx,kmul(J23L,J23L),kmul(PDstandard2nd33gxx,kmul(J33L,J33L))))))));
      
      JacPDstandard2nd33gxy = 
        kmadd(dJ133L,PDstandard2nd1gxy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard2nd12gxy,kmul(J33L,PDstandard2nd13gxy)),kmul(J23L,kmul(J33L,PDstandard2nd23gxy))),kmadd(dJ233L,PDstandard2nd2gxy,kmadd(dJ333L,PDstandard2nd3gxy,kmadd(PDstandard2nd11gxy,kmul(J13L,J13L),kmadd(PDstandard2nd22gxy,kmul(J23L,J23L),kmul(PDstandard2nd33gxy,kmul(J33L,J33L))))))));
      
      JacPDstandard2nd33gyy = 
        kmadd(dJ133L,PDstandard2nd1gyy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard2nd12gyy,kmul(J33L,PDstandard2nd13gyy)),kmul(J23L,kmul(J33L,PDstandard2nd23gyy))),kmadd(dJ233L,PDstandard2nd2gyy,kmadd(dJ333L,PDstandard2nd3gyy,kmadd(PDstandard2nd11gyy,kmul(J13L,J13L),kmadd(PDstandard2nd22gyy,kmul(J23L,J23L),kmul(PDstandard2nd33gyy,kmul(J33L,J33L))))))));
      
      JacPDstandard2nd12gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gxy,kmadd(J21L,PDstandard2nd12gxy,kmul(J31L,PDstandard2nd13gxy))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gxy,kmul(J32L,PDstandard2nd13gxy)),kmadd(dJ112L,PDstandard2nd1gxy,kmadd(J22L,kmadd(J21L,PDstandard2nd22gxy,kmul(J31L,PDstandard2nd23gxy)),kmadd(dJ212L,PDstandard2nd2gxy,kmadd(J32L,kmadd(J21L,PDstandard2nd23gxy,kmul(J31L,PDstandard2nd33gxy)),kmul(dJ312L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd12gxz = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gxz,kmadd(J21L,PDstandard2nd12gxz,kmul(J31L,PDstandard2nd13gxz))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gxz,kmul(J32L,PDstandard2nd13gxz)),kmadd(dJ112L,PDstandard2nd1gxz,kmadd(J22L,kmadd(J21L,PDstandard2nd22gxz,kmul(J31L,PDstandard2nd23gxz)),kmadd(dJ212L,PDstandard2nd2gxz,kmadd(J32L,kmadd(J21L,PDstandard2nd23gxz,kmul(J31L,PDstandard2nd33gxz)),kmul(dJ312L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd12gyz = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gyz,kmadd(J21L,PDstandard2nd12gyz,kmul(J31L,PDstandard2nd13gyz))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gyz,kmul(J32L,PDstandard2nd13gyz)),kmadd(dJ112L,PDstandard2nd1gyz,kmadd(J22L,kmadd(J21L,PDstandard2nd22gyz,kmul(J31L,PDstandard2nd23gyz)),kmadd(dJ212L,PDstandard2nd2gyz,kmadd(J32L,kmadd(J21L,PDstandard2nd23gyz,kmul(J31L,PDstandard2nd33gyz)),kmul(dJ312L,PDstandard2nd3gyz)))))));
      
      JacPDstandard2nd12gzz = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gzz,kmadd(J21L,PDstandard2nd12gzz,kmul(J31L,PDstandard2nd13gzz))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gzz,kmul(J32L,PDstandard2nd13gzz)),kmadd(dJ112L,PDstandard2nd1gzz,kmadd(J22L,kmadd(J21L,PDstandard2nd22gzz,kmul(J31L,PDstandard2nd23gzz)),kmadd(dJ212L,PDstandard2nd2gzz,kmadd(J32L,kmadd(J21L,PDstandard2nd23gzz,kmul(J31L,PDstandard2nd33gzz)),kmul(dJ312L,PDstandard2nd3gzz)))))));
      
      JacPDstandard2nd13gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gxz,kmadd(J21L,PDstandard2nd12gxz,kmul(J31L,PDstandard2nd13gxz))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gxz,kmul(J33L,PDstandard2nd13gxz)),kmadd(dJ113L,PDstandard2nd1gxz,kmadd(J23L,kmadd(J21L,PDstandard2nd22gxz,kmul(J31L,PDstandard2nd23gxz)),kmadd(dJ213L,PDstandard2nd2gxz,kmadd(J33L,kmadd(J21L,PDstandard2nd23gxz,kmul(J31L,PDstandard2nd33gxz)),kmul(dJ313L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd21gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard2nd11gxy,kmadd(J21L,PDstandard2nd12gxy,kmul(J31L,PDstandard2nd13gxy))),kmadd(J11L,kmadd(J22L,PDstandard2nd12gxy,kmul(J32L,PDstandard2nd13gxy)),kmadd(dJ112L,PDstandard2nd1gxy,kmadd(J22L,kmadd(J21L,PDstandard2nd22gxy,kmul(J31L,PDstandard2nd23gxy)),kmadd(dJ212L,PDstandard2nd2gxy,kmadd(J32L,kmadd(J21L,PDstandard2nd23gxy,kmul(J31L,PDstandard2nd33gxy)),kmul(dJ312L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd23gxx = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gxx,kmadd(J22L,PDstandard2nd12gxx,kmul(J32L,PDstandard2nd13gxx))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gxx,kmul(J33L,PDstandard2nd13gxx)),kmadd(dJ123L,PDstandard2nd1gxx,kmadd(J23L,kmadd(J22L,PDstandard2nd22gxx,kmul(J32L,PDstandard2nd23gxx)),kmadd(dJ223L,PDstandard2nd2gxx,kmadd(J33L,kmadd(J22L,PDstandard2nd23gxx,kmul(J32L,PDstandard2nd33gxx)),kmul(dJ323L,PDstandard2nd3gxx)))))));
      
      JacPDstandard2nd23gxy = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gxy,kmadd(J22L,PDstandard2nd12gxy,kmul(J32L,PDstandard2nd13gxy))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gxy,kmul(J33L,PDstandard2nd13gxy)),kmadd(dJ123L,PDstandard2nd1gxy,kmadd(J23L,kmadd(J22L,PDstandard2nd22gxy,kmul(J32L,PDstandard2nd23gxy)),kmadd(dJ223L,PDstandard2nd2gxy,kmadd(J33L,kmadd(J22L,PDstandard2nd23gxy,kmul(J32L,PDstandard2nd33gxy)),kmul(dJ323L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd23gxz = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gxz,kmadd(J22L,PDstandard2nd12gxz,kmul(J32L,PDstandard2nd13gxz))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gxz,kmul(J33L,PDstandard2nd13gxz)),kmadd(dJ123L,PDstandard2nd1gxz,kmadd(J23L,kmadd(J22L,PDstandard2nd22gxz,kmul(J32L,PDstandard2nd23gxz)),kmadd(dJ223L,PDstandard2nd2gxz,kmadd(J33L,kmadd(J22L,PDstandard2nd23gxz,kmul(J32L,PDstandard2nd33gxz)),kmul(dJ323L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd23gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gyz,kmadd(J22L,PDstandard2nd12gyz,kmul(J32L,PDstandard2nd13gyz))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gyz,kmul(J33L,PDstandard2nd13gyz)),kmadd(dJ123L,PDstandard2nd1gyz,kmadd(J23L,kmadd(J22L,PDstandard2nd22gyz,kmul(J32L,PDstandard2nd23gyz)),kmadd(dJ223L,PDstandard2nd2gyz,kmadd(J33L,kmadd(J22L,PDstandard2nd23gyz,kmul(J32L,PDstandard2nd33gyz)),kmul(dJ323L,PDstandard2nd3gyz)))))));
      
      JacPDstandard2nd31gxy = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gxy,kmadd(J21L,PDstandard2nd12gxy,kmul(J31L,PDstandard2nd13gxy))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gxy,kmul(J33L,PDstandard2nd13gxy)),kmadd(dJ113L,PDstandard2nd1gxy,kmadd(J23L,kmadd(J21L,PDstandard2nd22gxy,kmul(J31L,PDstandard2nd23gxy)),kmadd(dJ213L,PDstandard2nd2gxy,kmadd(J33L,kmadd(J21L,PDstandard2nd23gxy,kmul(J31L,PDstandard2nd33gxy)),kmul(dJ313L,PDstandard2nd3gxy)))))));
      
      JacPDstandard2nd31gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gxz,kmadd(J21L,PDstandard2nd12gxz,kmul(J31L,PDstandard2nd13gxz))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gxz,kmul(J33L,PDstandard2nd13gxz)),kmadd(dJ113L,PDstandard2nd1gxz,kmadd(J23L,kmadd(J21L,PDstandard2nd22gxz,kmul(J31L,PDstandard2nd23gxz)),kmadd(dJ213L,PDstandard2nd2gxz,kmadd(J33L,kmadd(J21L,PDstandard2nd23gxz,kmul(J31L,PDstandard2nd33gxz)),kmul(dJ313L,PDstandard2nd3gxz)))))));
      
      JacPDstandard2nd31gyy = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gyy,kmadd(J21L,PDstandard2nd12gyy,kmul(J31L,PDstandard2nd13gyy))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gyy,kmul(J33L,PDstandard2nd13gyy)),kmadd(dJ113L,PDstandard2nd1gyy,kmadd(J23L,kmadd(J21L,PDstandard2nd22gyy,kmul(J31L,PDstandard2nd23gyy)),kmadd(dJ213L,PDstandard2nd2gyy,kmadd(J33L,kmadd(J21L,PDstandard2nd23gyy,kmul(J31L,PDstandard2nd33gyy)),kmul(dJ313L,PDstandard2nd3gyy)))))));
      
      JacPDstandard2nd31gyz = 
        kmadd(J13L,kmadd(J11L,PDstandard2nd11gyz,kmadd(J21L,PDstandard2nd12gyz,kmul(J31L,PDstandard2nd13gyz))),kmadd(J11L,kmadd(J23L,PDstandard2nd12gyz,kmul(J33L,PDstandard2nd13gyz)),kmadd(dJ113L,PDstandard2nd1gyz,kmadd(J23L,kmadd(J21L,PDstandard2nd22gyz,kmul(J31L,PDstandard2nd23gyz)),kmadd(dJ213L,PDstandard2nd2gyz,kmadd(J33L,kmadd(J21L,PDstandard2nd23gyz,kmul(J31L,PDstandard2nd33gyz)),kmul(dJ313L,PDstandard2nd3gyz)))))));
      
      JacPDstandard2nd32gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard2nd11gyz,kmadd(J22L,PDstandard2nd12gyz,kmul(J32L,PDstandard2nd13gyz))),kmadd(J12L,kmadd(J23L,PDstandard2nd12gyz,kmul(J33L,PDstandard2nd13gyz)),kmadd(dJ123L,PDstandard2nd1gyz,kmadd(J23L,kmadd(J22L,PDstandard2nd22gyz,kmul(J32L,PDstandard2nd23gyz)),kmadd(dJ223L,PDstandard2nd2gyz,kmadd(J33L,kmadd(J22L,PDstandard2nd23gyz,kmul(J32L,PDstandard2nd33gyz)),kmul(dJ323L,PDstandard2nd3gyz)))))));
    }
    else
    {
      JacPDstandard2nd1gxx = PDstandard2nd1gxx;
      
      JacPDstandard2nd1gxy = PDstandard2nd1gxy;
      
      JacPDstandard2nd1gxz = PDstandard2nd1gxz;
      
      JacPDstandard2nd1gyy = PDstandard2nd1gyy;
      
      JacPDstandard2nd1gyz = PDstandard2nd1gyz;
      
      JacPDstandard2nd1gzz = PDstandard2nd1gzz;
      
      JacPDstandard2nd1kxy = PDstandard2nd1kxy;
      
      JacPDstandard2nd1kxz = PDstandard2nd1kxz;
      
      JacPDstandard2nd1kyy = PDstandard2nd1kyy;
      
      JacPDstandard2nd1kyz = PDstandard2nd1kyz;
      
      JacPDstandard2nd1kzz = PDstandard2nd1kzz;
      
      JacPDstandard2nd2gxx = PDstandard2nd2gxx;
      
      JacPDstandard2nd2gxy = PDstandard2nd2gxy;
      
      JacPDstandard2nd2gxz = PDstandard2nd2gxz;
      
      JacPDstandard2nd2gyy = PDstandard2nd2gyy;
      
      JacPDstandard2nd2gyz = PDstandard2nd2gyz;
      
      JacPDstandard2nd2gzz = PDstandard2nd2gzz;
      
      JacPDstandard2nd2kxx = PDstandard2nd2kxx;
      
      JacPDstandard2nd2kxy = PDstandard2nd2kxy;
      
      JacPDstandard2nd2kxz = PDstandard2nd2kxz;
      
      JacPDstandard2nd2kyz = PDstandard2nd2kyz;
      
      JacPDstandard2nd2kzz = PDstandard2nd2kzz;
      
      JacPDstandard2nd3gxx = PDstandard2nd3gxx;
      
      JacPDstandard2nd3gxy = PDstandard2nd3gxy;
      
      JacPDstandard2nd3gxz = PDstandard2nd3gxz;
      
      JacPDstandard2nd3gyy = PDstandard2nd3gyy;
      
      JacPDstandard2nd3gyz = PDstandard2nd3gyz;
      
      JacPDstandard2nd3gzz = PDstandard2nd3gzz;
      
      JacPDstandard2nd3kxx = PDstandard2nd3kxx;
      
      JacPDstandard2nd3kxy = PDstandard2nd3kxy;
      
      JacPDstandard2nd3kxz = PDstandard2nd3kxz;
      
      JacPDstandard2nd3kyy = PDstandard2nd3kyy;
      
      JacPDstandard2nd3kyz = PDstandard2nd3kyz;
      
      JacPDstandard2nd11gyy = PDstandard2nd11gyy;
      
      JacPDstandard2nd11gyz = PDstandard2nd11gyz;
      
      JacPDstandard2nd11gzz = PDstandard2nd11gzz;
      
      JacPDstandard2nd22gxx = PDstandard2nd22gxx;
      
      JacPDstandard2nd22gxz = PDstandard2nd22gxz;
      
      JacPDstandard2nd22gzz = PDstandard2nd22gzz;
      
      JacPDstandard2nd33gxx = PDstandard2nd33gxx;
      
      JacPDstandard2nd33gxy = PDstandard2nd33gxy;
      
      JacPDstandard2nd33gyy = PDstandard2nd33gyy;
      
      JacPDstandard2nd12gxy = PDstandard2nd12gxy;
      
      JacPDstandard2nd12gxz = PDstandard2nd12gxz;
      
      JacPDstandard2nd12gyz = PDstandard2nd12gyz;
      
      JacPDstandard2nd12gzz = PDstandard2nd12gzz;
      
      JacPDstandard2nd13gxz = PDstandard2nd13gxz;
      
      JacPDstandard2nd21gxy = PDstandard2nd12gxy;
      
      JacPDstandard2nd23gxx = PDstandard2nd23gxx;
      
      JacPDstandard2nd23gxy = PDstandard2nd23gxy;
      
      JacPDstandard2nd23gxz = PDstandard2nd23gxz;
      
      JacPDstandard2nd23gyz = PDstandard2nd23gyz;
      
      JacPDstandard2nd31gxy = PDstandard2nd13gxy;
      
      JacPDstandard2nd31gxz = PDstandard2nd13gxz;
      
      JacPDstandard2nd31gyy = PDstandard2nd13gyy;
      
      JacPDstandard2nd31gyz = PDstandard2nd13gyz;
      
      JacPDstandard2nd32gyz = PDstandard2nd23gyz;
    }
    
    CCTK_REAL_VEC detg CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(gxyL,kmul(gxzL,gyzL)),knmsub(gzzL,kmul(gxyL,gxyL),kmsub(gyyL,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)),kmul(gxxL,kmul(gyzL,gyzL)))));
    
    CCTK_REAL_VEC invdetg CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),detg);
    
    CCTK_REAL_VEC gInv11 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gyyL,gzzL,kmul(gyzL,gyzL)));
    
    CCTK_REAL_VEC gInv12 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv13 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv21 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv22 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)));
    
    CCTK_REAL_VEC gInv23 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv31 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv32 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv33 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gyyL,kmul(gxyL,gxyL)));
    
    CCTK_REAL_VEC gamma111 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,JacPDstandard2nd1gxx,kmsub(ToReal(2),kmadd(gInv12,JacPDstandard2nd1gxy,kmul(gInv13,JacPDstandard2nd1gxz)),kmadd(gInv13,JacPDstandard2nd3gxx,kmul(gInv12,JacPDstandard2nd2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma211 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,JacPDstandard2nd1gxx,kmsub(ToReal(2),kmadd(gInv22,JacPDstandard2nd1gxy,kmul(gInv23,JacPDstandard2nd1gxz)),kmadd(gInv23,JacPDstandard2nd3gxx,kmul(gInv22,JacPDstandard2nd2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma311 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,JacPDstandard2nd1gxx,kmsub(ToReal(2),kmadd(gInv32,JacPDstandard2nd1gxy,kmul(gInv33,JacPDstandard2nd1gxz)),kmadd(gInv33,JacPDstandard2nd3gxx,kmul(gInv32,JacPDstandard2nd2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma121 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv12,JacPDstandard2nd1gyy,kmadd(gInv11,JacPDstandard2nd2gxx,kmul(gInv13,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma221 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv22,JacPDstandard2nd1gyy,kmadd(gInv21,JacPDstandard2nd2gxx,kmul(gInv23,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma321 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv32,JacPDstandard2nd1gyy,kmadd(gInv31,JacPDstandard2nd2gxx,kmul(gInv33,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma131 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard2nd1gzz,kmadd(gInv11,JacPDstandard2nd3gxx,kmul(gInv12,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd3gxy,JacPDstandard2nd2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma231 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard2nd1gzz,kmadd(gInv21,JacPDstandard2nd3gxx,kmul(gInv22,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd3gxy,JacPDstandard2nd2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma331 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard2nd1gzz,kmadd(gInv31,JacPDstandard2nd3gxx,kmul(gInv32,kadd(JacPDstandard2nd1gyz,ksub(JacPDstandard2nd3gxy,JacPDstandard2nd2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma122 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard2nd2gxy,JacPDstandard2nd1gyy),kmadd(gInv12,JacPDstandard2nd2gyy,kmul(gInv13,kmsub(ToReal(2),JacPDstandard2nd2gyz,JacPDstandard2nd3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma222 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard2nd2gxy,JacPDstandard2nd1gyy),kmadd(gInv22,JacPDstandard2nd2gyy,kmul(gInv23,kmsub(ToReal(2),JacPDstandard2nd2gyz,JacPDstandard2nd3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma322 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard2nd2gxy,JacPDstandard2nd1gyy),kmadd(gInv32,JacPDstandard2nd2gyy,kmul(gInv33,kmsub(ToReal(2),JacPDstandard2nd2gyz,JacPDstandard2nd3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma132 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard2nd2gzz,kmadd(gInv11,ksub(kadd(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy),JacPDstandard2nd1gyz),kmul(gInv12,JacPDstandard2nd3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma232 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard2nd2gzz,kmadd(gInv21,ksub(kadd(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy),JacPDstandard2nd1gyz),kmul(gInv22,JacPDstandard2nd3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma332 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard2nd2gzz,kmadd(gInv31,ksub(kadd(JacPDstandard2nd2gxz,JacPDstandard2nd3gxy),JacPDstandard2nd1gyz),kmul(gInv32,JacPDstandard2nd3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma133 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard2nd3gxz,JacPDstandard2nd1gzz),kmadd(gInv12,kmsub(ToReal(2),JacPDstandard2nd3gyz,JacPDstandard2nd2gzz),kmul(gInv13,JacPDstandard2nd3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma233 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard2nd3gxz,JacPDstandard2nd1gzz),kmadd(gInv22,kmsub(ToReal(2),JacPDstandard2nd3gyz,JacPDstandard2nd2gzz),kmul(gInv23,JacPDstandard2nd3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma333 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard2nd3gxz,JacPDstandard2nd1gzz),kmadd(gInv32,kmsub(ToReal(2),JacPDstandard2nd3gyz,JacPDstandard2nd2gzz),kmul(gInv33,JacPDstandard2nd3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC xmoved CCTK_ATTRIBUTE_UNUSED = ksub(xL,ToReal(xorig));
    
    CCTK_REAL_VEC ymoved CCTK_ATTRIBUTE_UNUSED = ksub(yL,ToReal(yorig));
    
    CCTK_REAL_VEC zmoved CCTK_ATTRIBUTE_UNUSED = ksub(zL,ToReal(zorig));
    
    CCTK_REAL_VEC va1 CCTK_ATTRIBUTE_UNUSED = kneg(ymoved);
    
    CCTK_REAL_VEC va2 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC va3 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC vb1 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC vb2 CCTK_ATTRIBUTE_UNUSED = ymoved;
    
    CCTK_REAL_VEC vb3 CCTK_ATTRIBUTE_UNUSED = zmoved;
    
    CCTK_REAL_VEC vc1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv12,va3,kmul(gInv13,va2)),vb1,kmadd(kmsub(gInv13,va1,kmul(gInv11,va3)),vb2,kmul(vb3,kmsub(gInv11,va2,kmul(gInv12,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv22,va3,kmul(gInv23,va2)),vb1,kmadd(kmsub(gInv23,va1,kmul(gInv21,va3)),vb2,kmul(vb3,kmsub(gInv21,va2,kmul(gInv22,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv32,va3,kmul(gInv33,va2)),vb1,kmadd(kmsub(gInv33,va1,kmul(gInv31,va3)),vb2,kmul(vb3,kmsub(gInv31,va2,kmul(gInv32,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC wa1 CCTK_ATTRIBUTE_UNUSED = va1;
    
    CCTK_REAL_VEC wa2 CCTK_ATTRIBUTE_UNUSED = va2;
    
    CCTK_REAL_VEC wa3 CCTK_ATTRIBUTE_UNUSED = va3;
    
    CCTK_REAL_VEC omega11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wa2,wa3),kmul(wa1,kmadd(gxyL,wa2,kmul(gxzL,wa3)))),kmadd(gxxL,kmul(wa1,wa1),kmadd(gyyL,kmul(wa2,wa2),kmul(gzzL,kmul(wa3,wa3)))));
    
    CCTK_REAL_VEC ea1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa1,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa2,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa3,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC omega12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vb1,kmadd(gxyL,vb2,kmul(gxzL,vb3))),kmadd(ea2,kmadd(gxyL,vb1,kmadd(gyyL,vb2,kmul(gyzL,vb3))),kmul(ea3,kmadd(gxzL,vb1,kmadd(gyzL,vb2,kmul(gzzL,vb3))))));
    
    CCTK_REAL_VEC wb1 CCTK_ATTRIBUTE_UNUSED = knmsub(ea1,omega12,vb1);
    
    CCTK_REAL_VEC wb2 CCTK_ATTRIBUTE_UNUSED = knmsub(ea2,omega12,vb2);
    
    CCTK_REAL_VEC wb3 CCTK_ATTRIBUTE_UNUSED = knmsub(ea3,omega12,vb3);
    
    CCTK_REAL_VEC omega22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wb2,wb3),kmul(wb1,kmadd(gxyL,wb2,kmul(gxzL,wb3)))),kmadd(gxxL,kmul(wb1,wb1),kmadd(gyyL,kmul(wb2,wb2),kmul(gzzL,kmul(wb3,wb3)))));
    
    CCTK_REAL_VEC eb1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb1,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb2,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb3,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC omega13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(ea2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(ea3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC omega23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(eb1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(eb2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(eb3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC wc1 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea1,omega13,knmsub(eb1,omega23,vc1));
    
    CCTK_REAL_VEC wc2 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea2,omega13,knmsub(eb2,omega23,vc2));
    
    CCTK_REAL_VEC wc3 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea3,omega13,knmsub(eb3,omega23,vc3));
    
    CCTK_REAL_VEC omega33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wc2,wc3),kmul(wc1,kmadd(gxyL,wc2,kmul(gxzL,wc3)))),kmadd(gxxL,kmul(wc1,wc1),kmadd(gyyL,kmul(wc2,wc2),kmul(gzzL,kmul(wc3,wc3)))));
    
    CCTK_REAL_VEC ec1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc1,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc2,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc3,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC isqrt2 CCTK_ATTRIBUTE_UNUSED = 
      ToReal(0.707106781186547524);
    
    CCTK_REAL_VEC ltet1 CCTK_ATTRIBUTE_UNUSED = kmul(eb1,isqrt2);
    
    CCTK_REAL_VEC ltet2 CCTK_ATTRIBUTE_UNUSED = kmul(eb2,isqrt2);
    
    CCTK_REAL_VEC ltet3 CCTK_ATTRIBUTE_UNUSED = kmul(eb3,isqrt2);
    
    CCTK_REAL_VEC n1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb1,isqrt2));
    
    CCTK_REAL_VEC n2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb2,isqrt2));
    
    CCTK_REAL_VEC n3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb3,isqrt2));
    
    CCTK_REAL_VEC rm1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rm2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rm3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC im1 CCTK_ATTRIBUTE_UNUSED = kmul(ea1,isqrt2);
    
    CCTK_REAL_VEC im2 CCTK_ATTRIBUTE_UNUSED = kmul(ea2,isqrt2);
    
    CCTK_REAL_VEC im3 CCTK_ATTRIBUTE_UNUSED = kmul(ea3,isqrt2);
    
    CCTK_REAL_VEC rmbar1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rmbar2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rmbar3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC imbar1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea1,isqrt2));
    
    CCTK_REAL_VEC imbar2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea2,isqrt2));
    
    CCTK_REAL_VEC imbar3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea3,isqrt2));
    
    CCTK_REAL_VEC nn CCTK_ATTRIBUTE_UNUSED = isqrt2;
    
    CCTK_REAL_VEC R1212 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma221,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(gamma321,kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321)))))),kmadd(ToReal(-2),kmadd(gamma122,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma222,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma322))),ksub(kadd(JacPDstandard2nd12gxy,ksub(JacPDstandard2nd21gxy,JacPDstandard2nd22gxx)),JacPDstandard2nd11gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC R1213 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma221,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma321,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma232,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma332))),ksub(kadd(JacPDstandard2nd12gxz,ksub(JacPDstandard2nd31gxy,JacPDstandard2nd23gxx)),JacPDstandard2nd11gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1223 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma122,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma222,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma322,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma232,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma332))),ksub(kadd(JacPDstandard2nd22gxz,ksub(JacPDstandard2nd31gyy,JacPDstandard2nd23gxy)),JacPDstandard2nd12gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1313 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma131,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma231,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma331,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma233,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma333))),ksub(kadd(JacPDstandard2nd13gxz,ksub(JacPDstandard2nd31gxz,JacPDstandard2nd33gxx)),JacPDstandard2nd11gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma232,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331))),gamma332))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma233,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma333))),ksub(kadd(JacPDstandard2nd23gxz,ksub(JacPDstandard2nd31gyz,JacPDstandard2nd33gxy)),JacPDstandard2nd12gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R2323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma132,kmadd(gxyL,gamma232,kmul(gxzL,gamma332))),kmadd(gamma232,kmadd(gxyL,gamma132,kmadd(gyyL,gamma232,kmul(gyzL,gamma332))),kmul(gamma332,kmadd(gxzL,gamma132,kmadd(gyzL,gamma232,kmul(gzzL,gamma332)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma122,kmadd(gxyL,gamma222,kmul(gxzL,gamma322))),kmadd(gamma233,kmadd(gxyL,gamma122,kmadd(gyyL,gamma222,kmul(gyzL,gamma322))),kmul(kmadd(gxzL,gamma122,kmadd(gyzL,gamma222,kmul(gzzL,gamma322))),gamma333))),ksub(kadd(JacPDstandard2nd23gyz,ksub(JacPDstandard2nd32gyz,JacPDstandard2nd33gyy)),JacPDstandard2nd22gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R4p1212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212));
    
    CCTK_REAL_VEC R4p1213 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213));
    
    CCTK_REAL_VEC R4p1223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223));
    
    CCTK_REAL_VEC R4p1313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313));
    
    CCTK_REAL_VEC R4p1323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323));
    
    CCTK_REAL_VEC R4p2323 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323));
    
    CCTK_REAL_VEC Ro111 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro112 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma121,knmsub(kyyL,gamma211,kmadd(kxyL,ksub(gamma221,gamma111),knmsub(kyzL,gamma311,kmadd(kxzL,gamma321,ksub(JacPDstandard2nd1kxy,JacPDstandard2nd2kxx))))));
    
    CCTK_REAL_VEC Ro113 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma131,knmsub(kyzL,gamma211,kmadd(kxyL,gamma231,knmsub(kzzL,gamma311,kmadd(kxzL,ksub(gamma331,gamma111),ksub(JacPDstandard2nd1kxz,JacPDstandard2nd3kxx))))));
    
    CCTK_REAL_VEC Ro121 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma121,kmadd(kyyL,gamma211,kmadd(kxyL,ksub(gamma111,gamma221),kmadd(kyzL,gamma311,knmsub(kxzL,gamma321,ksub(JacPDstandard2nd2kxx,JacPDstandard2nd1kxy))))));
    
    CCTK_REAL_VEC Ro122 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro123 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma121,kmadd(kxyL,gamma131,kmadd(kyyL,gamma231,knmsub(kzzL,gamma321,kmadd(kyzL,ksub(gamma331,gamma221),ksub(JacPDstandard2nd2kxz,JacPDstandard2nd3kxy))))));
    
    CCTK_REAL_VEC Ro131 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma131,kmadd(kyzL,gamma211,knmsub(kxyL,gamma231,kmadd(kzzL,gamma311,kmadd(kxzL,ksub(gamma111,gamma331),ksub(JacPDstandard2nd3kxx,JacPDstandard2nd1kxz))))));
    
    CCTK_REAL_VEC Ro132 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma121,knmsub(kxyL,gamma131,knmsub(kyyL,gamma231,kmadd(kzzL,gamma321,kmadd(kyzL,ksub(gamma221,gamma331),ksub(JacPDstandard2nd3kxy,JacPDstandard2nd2kxz))))));
    
    CCTK_REAL_VEC Ro133 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro211 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma122,knmsub(kyyL,gamma221,kmadd(kxyL,ksub(gamma222,gamma121),knmsub(kyzL,gamma321,kmadd(kxzL,gamma322,ksub(JacPDstandard2nd1kyy,JacPDstandard2nd2kxy))))));
    
    CCTK_REAL_VEC Ro213 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyzL,gamma221,kmadd(kxyL,gamma232,knmsub(kzzL,gamma321,kmadd(kxzL,ksub(gamma332,gamma121),ksub(JacPDstandard2nd1kyz,JacPDstandard2nd3kxy))))));
    
    CCTK_REAL_VEC Ro221 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma122,kmadd(kyyL,gamma221,kmadd(kxyL,ksub(gamma121,gamma222),kmadd(kyzL,gamma321,knmsub(kxzL,gamma322,ksub(JacPDstandard2nd2kxy,JacPDstandard2nd1kyy))))));
    
    CCTK_REAL_VEC Ro222 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma122,kmadd(kxyL,gamma132,kmadd(kyyL,gamma232,knmsub(kzzL,gamma322,kmadd(kyzL,ksub(gamma332,gamma222),ksub(JacPDstandard2nd2kyz,JacPDstandard2nd3kyy))))));
    
    CCTK_REAL_VEC Ro231 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyzL,gamma221,knmsub(kxyL,gamma232,kmadd(kzzL,gamma321,kmadd(kxzL,ksub(gamma121,gamma332),ksub(JacPDstandard2nd3kxy,JacPDstandard2nd1kyz))))));
    
    CCTK_REAL_VEC Ro232 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma122,knmsub(kxyL,gamma132,knmsub(kyyL,gamma232,kmadd(kzzL,gamma322,kmadd(kyzL,ksub(gamma222,gamma332),ksub(JacPDstandard2nd3kyy,JacPDstandard2nd2kyz))))));
    
    CCTK_REAL_VEC Ro233 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro311 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro312 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyyL,gamma231,kmadd(kxyL,ksub(gamma232,gamma131),knmsub(kyzL,gamma331,kmadd(kxzL,gamma332,ksub(JacPDstandard2nd1kyz,JacPDstandard2nd2kxz))))));
    
    CCTK_REAL_VEC Ro313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma133,knmsub(kyzL,gamma231,kmadd(kxyL,gamma233,knmsub(kzzL,gamma331,kmadd(kxzL,ksub(gamma333,gamma131),ksub(JacPDstandard2nd1kzz,JacPDstandard2nd3kxz))))));
    
    CCTK_REAL_VEC Ro321 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyyL,gamma231,kmadd(kxyL,ksub(gamma131,gamma232),kmadd(kyzL,gamma331,knmsub(kxzL,gamma332,ksub(JacPDstandard2nd2kxz,JacPDstandard2nd1kyz))))));
    
    CCTK_REAL_VEC Ro322 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma132,kmadd(kxyL,gamma133,kmadd(kyyL,gamma233,knmsub(kzzL,gamma332,kmadd(kyzL,ksub(gamma333,gamma232),ksub(JacPDstandard2nd2kzz,JacPDstandard2nd3kyz))))));
    
    CCTK_REAL_VEC Ro331 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma133,kmadd(kyzL,gamma231,knmsub(kxyL,gamma233,kmadd(kzzL,gamma331,kmadd(kxzL,ksub(gamma131,gamma333),ksub(JacPDstandard2nd3kxz,JacPDstandard2nd1kzz))))));
    
    CCTK_REAL_VEC Ro332 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma132,knmsub(kxyL,gamma133,knmsub(kyyL,gamma233,kmadd(kzzL,gamma332,kmadd(kyzL,ksub(gamma232,gamma333),ksub(JacPDstandard2nd3kyz,JacPDstandard2nd2kzz))))));
    
    CCTK_REAL_VEC Ro333 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Rojo11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv23,gInv32),knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv22,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)))));
    
    CCTK_REAL_VEC Rojo12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv32,knmsub(gInv21,R1212,knmsub(gInv31,R1213,kmadd(gInv23,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv12,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv23,knmsub(gInv21,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv31,R1313,kmsub(gInv13,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv32,R1323)))))));
    
    CCTK_REAL_VEC Rojo21 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv23,kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv31,knmsub(gInv12,R1212,knmsub(gInv13,R1213,kmadd(gInv32,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv21,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv13,gInv31),kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),kmadd(gInv11,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Rojo23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv21,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv12,R1223,knmsub(gInv31,R1323,kmsub(gInv23,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv32,R2323)))))));
    
    CCTK_REAL_VEC Rojo31 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv21,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv32,knmsub(gInv12,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv13,R1313,kmsub(gInv31,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv23,R1323)))))));
    
    CCTK_REAL_VEC Rojo32 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv31,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv21,R1223,knmsub(gInv13,R1323,kmsub(gInv32,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv23,R2323)))))));
    
    CCTK_REAL_VEC Rojo33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv12,gInv21),knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmadd(gInv11,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)),kmul(gInv22,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(imbar1,imbar2,kmul(rmbar1,rmbar2)),kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3))),kmadd(ToReal(2),kmul(kmadd(n1,kmul(n2,R4p1213),kmadd(n1,kmul(n3,R4p1313),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))),kmsub(imbar1,imbar3,kmul(rmbar1,rmbar3))),knmsub(kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3)))),kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),knmsub(kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3)))),kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),knmsub(kmul(nn,nn),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo23,kmadd(imbar1,kmadd(imbar2,kadd(Rojo12,Rojo21),kmul(imbar3,kadd(Rojo13,Rojo31))),knmsub(rmbar1,kmadd(rmbar2,kadd(Rojo12,Rojo21),kmul(rmbar3,kadd(Rojo13,Rojo31))),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo32,kmadd(Rojo11,kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),kmadd(Rojo22,kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),kmul(Rojo33,kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro112,kmadd(n2,Ro122,kmul(n3,Ro132))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro113,kmadd(n2,Ro123,kmul(n3,Ro133))),kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro211,kmadd(n2,Ro221,kmul(n3,Ro231))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro213,kmadd(n2,Ro223,kmul(n3,Ro233))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro311,kmadd(n2,Ro321,kmul(n3,Ro331))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro312,kmadd(n2,Ro322,kmul(n3,Ro332))),kmadd(kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131))),kmsub(rmbar1,rmbar1,kmul(imbar1,imbar1)),kmadd(kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232))),kmsub(rmbar2,rmbar2,kmul(imbar2,imbar2)),kmul(kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))),kmsub(rmbar3,rmbar3,kmul(imbar3,imbar3)))))))))))),kmul(kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2)))),kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))));
    
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,knmsub(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(n1,kadd(Ro112,Ro211),kmadd(n3,kadd(Ro132,Ro231),kmul(n2,kadd(Ro122,Ro221)))),kmadd(ToReal(-2),kmadd(im1,kmul(rm1,kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131)))),kmul(im2,kmul(rm2,kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232)))))),knmsub(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kadd(Ro113,Ro311),kmadd(n3,kadd(Ro133,Ro331),kmul(n2,kadd(Ro123,Ro321)))),kmsub(ToReal(-2),kmul(im3,kmul(rm3,kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))))),kmul(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kadd(Ro213,Ro312),kmadd(n3,kadd(Ro233,Ro332),kmul(n2,kadd(Ro223,Ro322))))))))),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kmadd(n2,R4p1213,kmul(n3,R4p1313)),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))))),kmsub(ToReal(-2),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    
    CCTK_REAL_VEC Psi3rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(n1,knmsub(ltet1,kmadd(n2,kmul(R4p1212,rm2),kmadd(n3,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1213,rm3),kmul(n3,kmul(R4p1313,rm3))))),kmadd(ltet3,kmadd(n1,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1223,rm2),kmadd(n1,kmul(R4p1313,rm3),kmul(n2,kmul(R4p1323,rm3))))),kmadd(ltet2,kmsub(n1,kmadd(R4p1212,rm2,kmul(R4p1213,rm3)),kmul(n3,kmadd(R4p1223,rm2,kmul(R4p1323,rm3)))),kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(nn,kmul(rm2,Ro221)),kmadd(nn,kmsub(kmsub(ksub(n1,ltet1),rm2,kmul(ltet2,rm1)),Ro121,kmul(Ro231,kmadd(ltet3,rm2,kmul(ksub(ltet2,n2),rm3)))),kmadd(nn,kmsub(kmsub(ksub(n1,ltet1),rm3,kmul(ltet3,rm1)),Ro131,kmul(Ro311,kmadd(ksub(ltet3,n3),rm1,kmul(ltet1,rm3)))),kmadd(nn,kmsub(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro111),kmadd(kmadd(ksub(ltet3,n3),rm2,kmul(ltet2,rm3)),Ro321,kmul(Ro211,kmadd(ksub(ltet2,n2),rm1,kmul(ltet1,rm2))))),kmul(kmadd(ToReal(-2),ltet3,n3),kmul(nn,kmul(rm3,Ro331)))))))))),kmadd(n2,kmadd(ltet1,kmsub(kmadd(n2,R4p1212,kmul(n3,R4p1213)),rm1,kmul(rm3,kmadd(n3,R4p1323,kmul(n2,R4p1223)))),kmadd(ltet3,knmsub(kmadd(n2,R4p1223,kmul(n1,R4p1213)),rm1,kmadd(n1,kmul(R4p1323,rm3),kmul(n2,kmul(R4p2323,rm3)))),kmadd(ltet2,kmadd(kmsub(n3,R4p1223,kmul(n1,R4p1212)),rm1,kmul(rm3,kmsub(n1,R4p1223,kmul(n3,R4p2323)))),kmul(nn,kmadd(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro112),knmsub(kmadd(ltet2,rm1,kmul(rm2,ksub(ltet1,n1))),Ro122,knmsub(kmadd(ltet3,rm1,kmul(rm3,ksub(ltet1,n1))),Ro132,kmadd(kmsub(ksub(n2,ltet2),rm1,kmul(ltet1,rm2)),Ro212,kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(rm2,Ro222),kmadd(kmsub(ksub(n2,ltet2),rm3,kmul(ltet3,rm2)),Ro232,knmsub(kmadd(ksub(ltet3,n3),rm1,kmul(ltet1,rm3)),Ro312,kmsub(kmadd(ToReal(-2),ltet3,n3),kmul(rm3,Ro332),kmul(Ro322,kmadd(ksub(ltet3,n3),rm2,kmul(ltet2,rm3))))))))))))))),kmsub(n3,kmadd(ltet1,kmadd(n2,kmul(R4p1213,rm1),kmadd(n3,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1223,rm2),kmul(n3,kmul(R4p1323,rm2))))),knmsub(ltet3,kmadd(n1,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1323,rm1),kmadd(n1,kmul(R4p1323,rm2),kmul(n2,kmul(R4p2323,rm2))))),kmadd(ltet2,kmsub(n3,kmadd(R4p1323,rm1,kmul(R4p2323,rm2)),kmul(n1,kmadd(R4p1213,rm1,kmul(R4p1223,rm2)))),kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(nn,kmul(rm2,Ro223)),kmadd(nn,kmsub(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro113),kmadd(kmadd(ltet2,rm1,kmul(rm2,ksub(ltet1,n1))),Ro123,kmadd(kmadd(ltet3,rm1,kmul(rm3,ksub(ltet1,n1))),Ro133,kmadd(kmadd(ltet3,rm2,kmul(rm3,ksub(ltet2,n2))),Ro233,kmul(Ro213,kmadd(ksub(ltet2,n2),rm1,kmul(ltet1,rm2))))))),kmadd(nn,kmul(Ro313,kmsub(ksub(n3,ltet3),rm1,kmul(ltet1,rm3))),kmadd(nn,kmul(Ro323,kmsub(ksub(n3,ltet3),rm2,kmul(ltet2,rm3))),kmul(kmadd(ToReal(-2),ltet3,n3),kmul(nn,kmul(rm3,Ro333)))))))))),kmul(kmadd(ksub(n1,ltet1),kmadd(rm1,Rojo11,kmadd(rm2,Rojo12,kmul(rm3,Rojo13))),kmadd(ksub(n2,ltet2),kmadd(rm1,Rojo21,kmadd(rm2,Rojo22,kmul(rm3,Rojo23))),kmul(kmadd(rm1,Rojo31,kmadd(rm2,Rojo32,kmul(rm3,Rojo33))),ksub(n3,ltet3)))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi3iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(n1,knmsub(im2,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmul(R4p1223,kmsub(ltet3,n2,kmul(ltet2,n3))))),kmsub(im1,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro111)),kmul(im3,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmul(R4p1323,kmsub(ltet3,n2,kmul(ltet2,n3)))))))),kmadd(n2,kmsub(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1223,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro112))))),kmul(im3,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1223,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1323,kmul(R4p2323,kmsub(ltet3,n2,kmul(ltet2,n3))))))),kmadd(n3,kmsub(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1323,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro113))))),kmul(im2,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1223,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1323,kmul(R4p2323,kmsub(ltet2,n3,kmul(ltet3,n2))))))),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n1,kmul(nn,Ro121)),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n2,kmul(nn,Ro122)),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n3,kmul(nn,Ro123)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n1,kmul(nn,Ro131)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n2,kmul(nn,Ro132)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n3,kmul(nn,Ro133)),kmadd(n1,kmul(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(nn,Ro211)),kmadd(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(n2,kmul(nn,Ro212)),kmadd(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(n3,kmul(nn,Ro213)),kmadd(im2,kmul(n1,kmul(kmsub(ToReal(2),ltet2,n2),kmul(nn,Ro221))),kmadd(im2,kmul(kmsub(ToReal(2),ltet2,n2),kmul(n2,kmul(nn,Ro222))),kmadd(im2,kmul(kmsub(ToReal(2),ltet2,n2),kmul(n3,kmul(nn,Ro223))),kmadd(n1,kmul(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(nn,Ro231)),kmadd(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(n2,kmul(nn,Ro232)),kmadd(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(n3,kmul(nn,Ro233)),kmadd(n1,kmul(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(nn,Ro311)),kmadd(n2,kmul(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(nn,Ro312)),kmadd(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(n3,kmul(nn,Ro313)),kmadd(n1,kmul(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(nn,Ro321)),kmadd(n2,kmul(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(nn,Ro322)),kmadd(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(n3,kmul(nn,Ro323)),kmadd(im3,kmul(n1,kmul(kmsub(ToReal(2),ltet3,n3),kmul(nn,Ro331))),kmadd(im3,kmul(n2,kmul(kmsub(ToReal(2),ltet3,n3),kmul(nn,Ro332))),kmadd(im3,kmul(kmsub(ToReal(2),ltet3,n3),kmul(n3,kmul(nn,Ro333))),kmul(kmadd(ksub(n1,ltet1),kmadd(im1,Rojo11,kmadd(im2,Rojo12,kmul(im3,Rojo13))),kmadd(ksub(n2,ltet2),kmadd(im1,Rojo21,kmadd(im2,Rojo22,kmul(im3,Rojo23))),kmul(kmadd(im1,Rojo31,kmadd(im2,Rojo32,kmul(im3,Rojo33))),ksub(n3,ltet3)))),kmul(nn,nn)))))))))))))))))))))))))))));
    
    CCTK_REAL_VEC Psi2rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmadd(ltet2,kmsub(n1,R4p1212,kmul(n3,R4p1223)),kmul(ltet3,kmsub(n1,R4p1213,kmul(n3,R4p1323)))),kmadd(im1,im2,kmul(rm1,rm2)),kmadd(kmsub(ltet1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(ltet3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im1,im2,kmul(rm1,rm2)),kmadd(kmadd(ltet2,kmul(n1,R4p1213),kmadd(ltet2,kmul(n2,R4p1223),kmadd(ltet3,kmul(n1,R4p1313),kmul(ltet3,kmul(n2,R4p1323))))),kmadd(im1,im3,kmul(rm1,rm3)),kmadd(kmadd(ltet1,kmul(n2,R4p1213),kmadd(ltet2,kmul(n2,R4p1223),kmadd(ltet1,kmul(n3,R4p1313),kmul(ltet2,kmul(n3,R4p1323))))),kmadd(im1,im3,kmul(rm1,rm3)),kmadd(knmsub(n1,kmadd(ltet2,R4p1223,kmul(ltet1,R4p1213)),kmadd(ltet1,knmsub(n1,R4p1213,kmsub(n3,R4p1323,kmul(n2,R4p1223))),kmadd(ltet2,kmul(n3,R4p2323),kmul(ltet3,kmadd(n1,R4p1323,kmul(n2,R4p2323)))))),kmadd(im2,im3,kmul(rm2,rm3)),knmsub(kmadd(ltet2,kmul(n2,R4p1212),kmadd(ltet3,kmul(n2,R4p1213),kmadd(ltet2,kmul(n3,R4p1213),kmul(ltet3,kmul(n3,R4p1313))))),kmadd(im1,im1,kmul(rm1,rm1)),knmsub(kmadd(n1,kmsub(ltet1,R4p1212,kmul(ltet3,R4p1223)),kmul(n3,kmsub(ltet3,R4p2323,kmul(ltet1,R4p1223)))),kmadd(im2,im2,kmul(rm2,rm2)),knmsub(kmadd(ltet1,kmul(n1,R4p1313),kmadd(ltet2,kmul(n1,R4p1323),kmadd(ltet1,kmul(n2,R4p1323),kmul(ltet2,kmul(n2,R4p2323))))),kmadd(im3,im3,kmul(rm3,rm3)),kmsub(nn,kmadd(ksub(n2,ltet2),kmul(Ro122,kmadd(im1,im2,kmul(rm1,rm2))),kmadd(kmadd(im1,kmsub(im2,n3,kmul(im3,ltet2)),kmul(rm1,kmsub(n3,rm2,kmul(ltet2,rm3)))),Ro123,kmadd(kmadd(im1,kmsub(im3,n2,kmul(im2,ltet3)),kmul(rm1,kmsub(n2,rm3,kmul(ltet3,rm2)))),Ro132,kmadd(ksub(n3,ltet3),kmul(Ro133,kmadd(im1,im3,kmul(rm1,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro211,kmadd(im1,im2,kmul(rm1,rm2))),kmadd(kmadd(im2,kmsub(im1,n3,kmul(im3,ltet1)),kmul(rm2,kmsub(n3,rm1,kmul(ltet1,rm3)))),Ro213,kmadd(kmadd(im2,kmsub(im3,n1,kmul(im1,ltet3)),kmul(rm2,kmsub(n1,rm3,kmul(ltet3,rm1)))),Ro231,kmadd(ksub(n3,ltet3),kmul(Ro233,kmadd(im2,im3,kmul(rm2,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro311,kmadd(im1,im3,kmul(rm1,rm3))),kmadd(kmadd(im3,kmsub(im1,n2,kmul(im2,ltet1)),kmul(rm3,kmsub(n2,rm1,kmul(ltet1,rm2)))),Ro312,kmadd(kmadd(im3,kmsub(im2,n1,kmul(im1,ltet2)),kmul(rm3,kmsub(n1,rm2,kmul(ltet2,rm1)))),Ro321,kmadd(ksub(n2,ltet2),kmul(Ro322,kmadd(im2,im3,kmul(rm2,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro111,kmadd(im1,im1,kmul(rm1,rm1))),kmadd(Ro121,kmsub(n1,kmadd(im1,im2,kmul(rm1,rm2)),kmul(ltet2,kmadd(im1,im1,kmul(rm1,rm1)))),kmadd(Ro131,kmsub(n1,kmadd(im1,im3,kmul(rm1,rm3)),kmul(ltet3,kmadd(im1,im1,kmul(rm1,rm1)))),kmadd(Ro112,kmsub(n2,kmadd(im1,im1,kmul(rm1,rm1)),kmul(ltet1,kmadd(im1,im2,kmul(rm1,rm2)))),kmadd(Ro113,kmsub(n3,kmadd(im1,im1,kmul(rm1,rm1)),kmul(ltet1,kmadd(im1,im3,kmul(rm1,rm3)))),kmadd(ksub(n2,ltet2),kmul(Ro222,kmadd(im2,im2,kmul(rm2,rm2))),kmadd(Ro212,kmsub(n2,kmadd(im1,im2,kmul(rm1,rm2)),kmul(ltet1,kmadd(im2,im2,kmul(rm2,rm2)))),kmadd(Ro232,kmsub(n2,kmadd(im2,im3,kmul(rm2,rm3)),kmul(ltet3,kmadd(im2,im2,kmul(rm2,rm2)))),kmadd(Ro221,kmsub(n1,kmadd(im2,im2,kmul(rm2,rm2)),kmul(ltet2,kmadd(im1,im2,kmul(rm1,rm2)))),kmadd(Ro223,kmsub(n3,kmadd(im2,im2,kmul(rm2,rm2)),kmul(ltet2,kmadd(im2,im3,kmul(rm2,rm3)))),kmadd(ksub(n3,ltet3),kmul(Ro333,kmadd(im3,im3,kmul(rm3,rm3))),kmadd(Ro313,kmsub(n3,kmadd(im1,im3,kmul(rm1,rm3)),kmul(ltet1,kmadd(im3,im3,kmul(rm3,rm3)))),kmadd(Ro323,kmsub(n3,kmadd(im2,im3,kmul(rm2,rm3)),kmul(ltet2,kmadd(im3,im3,kmul(rm3,rm3)))),kmadd(Ro331,kmsub(n1,kmadd(im3,im3,kmul(rm3,rm3)),kmul(ltet3,kmadd(im1,im3,kmul(rm1,rm3)))),kmul(Ro332,kmsub(n2,kmadd(im3,im3,kmul(rm3,rm3)),kmul(ltet3,kmadd(im2,im3,kmul(rm2,rm3))))))))))))))))))))))))))))))),kmul(kmadd(im2,kmul(im3,Rojo23),kmadd(rm2,kmul(rm3,Rojo23),kmadd(im1,kmadd(im2,kadd(Rojo12,Rojo21),kmul(im3,kadd(Rojo13,Rojo31))),kmadd(rm1,kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31))),kmadd(im2,kmul(im3,Rojo32),kmadd(rm2,kmul(rm3,Rojo32),kmadd(Rojo11,kmul(im1,im1),kmadd(Rojo22,kmul(im2,im2),kmadd(Rojo33,kmul(im3,im3),kmadd(Rojo11,kmul(rm1,rm1),kmadd(Rojo22,kmul(rm2,rm2),kmul(Rojo33,kmul(rm3,rm3))))))))))))),kmul(nn,nn)))))))))));
    
    CCTK_REAL_VEC Psi2iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(knmsub(n1,kmadd(ltet3,R4p1213,kmul(ltet2,R4p1212)),kmadd(ltet1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(R4p1223,kmsub(ltet2,n3,kmul(ltet3,n2))))),kmsub(im2,rm1,kmul(im1,rm2)),kmadd(kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1213,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1313,kmul(R4p1323,kmsub(ltet2,n3,kmul(ltet3,n2))))),kmsub(im3,rm1,kmul(im1,rm3)),kmadd(knmsub(n1,kmadd(ltet2,R4p1223,kmul(ltet1,R4p1213)),kmadd(ltet1,kmadd(n1,R4p1213,kmul(n2,R4p1223)),kmadd(ltet1,kmul(n3,R4p1323),kmsub(ltet2,kmul(n3,R4p2323),kmul(ltet3,kmadd(n1,R4p1323,kmul(n2,R4p2323))))))),kmsub(im3,rm2,kmul(im2,rm3)),kmsub(kmadd(im1,kmadd(rm2,ksub(Rojo21,Rojo12),kmul(rm3,ksub(Rojo31,Rojo13))),kmadd(im3,kmadd(rm1,ksub(Rojo13,Rojo31),kmul(rm2,ksub(Rojo23,Rojo32))),kmul(im2,kmadd(rm1,ksub(Rojo12,Rojo21),kmul(rm3,ksub(Rojo32,Rojo23)))))),kmul(nn,nn),kmul(nn,kmadd(im1,knmsub(rm2,kmadd(kadd(ltet2,n2),Ro122,kmadd(ltet3,Ro132,kmul(n3,Ro123))),knmsub(rm3,kmadd(ltet2,Ro123,kmadd(kadd(ltet3,n3),Ro133,kmul(n2,Ro132))),kmadd(n2,kmul(rm2,Ro212),kmadd(n3,kmul(rm2,Ro213),kmadd(ltet2,kmul(rm2,Ro221),kmadd(ltet3,kmul(rm2,Ro231),kmadd(ltet1,kmadd(rm2,ksub(Ro211,Ro112),kmul(rm3,ksub(Ro311,Ro113))),kmadd(n1,kmadd(rm2,ksub(Ro211,Ro121),kmul(rm3,ksub(Ro311,Ro131))),kmadd(n2,kmul(rm3,Ro312),kmadd(n3,kmul(rm3,Ro313),kmadd(ltet2,kmul(rm3,Ro321),kmul(ltet3,kmul(rm3,Ro331))))))))))))),kmadd(im2,kmadd(rm1,kmadd(n2,ksub(Ro122,Ro212),kmadd(n3,ksub(Ro123,Ro213),kmadd(ltet2,ksub(Ro122,Ro221),kmul(ltet3,ksub(Ro132,Ro231))))),knmsub(rm3,kmadd(ltet2,Ro223,kmadd(kadd(ltet3,n3),Ro233,kmul(n2,Ro232))),kmadd(ltet1,kmadd(rm1,ksub(Ro112,Ro211),kmul(rm3,ksub(Ro312,Ro213))),kmadd(n1,kmadd(rm1,ksub(Ro121,Ro211),kmul(rm3,ksub(Ro321,Ro231))),kmadd(ltet2,kmul(rm3,Ro322),kmadd(n2,kmul(rm3,Ro322),kmadd(n3,kmul(rm3,Ro323),kmul(ltet3,kmul(rm3,Ro332))))))))),kmul(im3,kmadd(ltet1,kmadd(rm1,ksub(Ro113,Ro311),kmul(rm2,ksub(Ro213,Ro312))),kmadd(ltet2,kmadd(rm1,ksub(Ro123,Ro321),kmul(rm2,ksub(Ro223,Ro322))),kmadd(rm1,kmadd(kadd(ltet3,n3),Ro133,kmadd(n1,ksub(Ro131,Ro311),kmsub(n2,ksub(Ro132,Ro312),kmadd(ltet3,Ro331,kmul(n3,Ro313))))),kmul(rm2,kmadd(kadd(ltet3,n3),Ro233,kmadd(n1,ksub(Ro231,Ro321),kmsub(n2,ksub(Ro232,Ro322),kmadd(ltet3,Ro332,kmul(n3,Ro323)))))))))))))))));
    
    CCTK_REAL_VEC Psi1rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ltet1,kmadd(ltet1,kmadd(n2,kmul(R4p1212,rm2),kmadd(n3,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1213,rm3),kmul(n3,kmul(R4p1313,rm3))))),knmsub(ltet3,kmadd(n1,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1223,rm2),kmadd(n1,kmul(R4p1313,rm3),kmul(n2,kmul(R4p1323,rm3))))),kmadd(ltet2,kmsub(n3,kmadd(R4p1223,rm2,kmul(R4p1323,rm3)),kmul(n1,kmadd(R4p1212,rm2,kmul(R4p1213,rm3)))),kmadd(nn,kmul(Ro121,kmsub(ksub(ltet1,n1),rm2,kmul(n2,rm1))),kmadd(nn,kmul(Ro131,kmsub(ksub(ltet1,n1),rm3,kmul(n3,rm1))),kmadd(nn,kmul(Ro211,kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2))),kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(nn,kmul(rm2,Ro221)),kmadd(nn,kmsub(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro111),kmul(Ro231,kmadd(n3,rm2,kmul(ksub(n2,ltet2),rm3)))),kmadd(nn,kmul(Ro311,kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3))),kmadd(nn,kmul(Ro321,kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3))),kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,kmul(rm3,Ro331))))))))))))),kmadd(ltet2,kmadd(ltet1,knmsub(kmadd(n3,R4p1213,kmul(n2,R4p1212)),rm1,kmadd(n2,kmul(R4p1223,rm3),kmul(n3,kmul(R4p1323,rm3)))),kmadd(ltet3,kmsub(kmadd(n1,R4p1213,kmul(n2,R4p1223)),rm1,kmul(rm3,kmadd(n2,R4p2323,kmul(n1,R4p1323)))),kmadd(ltet2,kmadd(kmsub(n1,R4p1212,kmul(n3,R4p1223)),rm1,kmul(rm3,kmsub(n3,R4p2323,kmul(n1,R4p1223)))),kmul(nn,kmadd(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro112),knmsub(kmadd(n2,rm1,kmul(rm2,ksub(n1,ltet1))),Ro122,knmsub(kmadd(n3,rm1,kmul(rm3,ksub(n1,ltet1))),Ro132,kmadd(kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2)),Ro212,kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(rm2,Ro222),kmadd(kmsub(ksub(ltet2,n2),rm3,kmul(n3,rm2)),Ro232,kmadd(kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3)),Ro312,kmadd(kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3)),Ro322,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(rm3,Ro332)))))))))))))),kmsub(ltet3,knmsub(ltet1,kmadd(n2,kmul(R4p1213,rm1),kmadd(n3,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1223,rm2),kmul(n3,kmul(R4p1323,rm2))))),kmadd(ltet3,kmadd(n1,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1323,rm1),kmadd(n1,kmul(R4p1323,rm2),kmul(n2,kmul(R4p2323,rm2))))),kmadd(ltet2,kmsub(n1,kmadd(R4p1213,rm1,kmul(R4p1223,rm2)),kmul(n3,kmadd(R4p1323,rm1,kmul(R4p2323,rm2)))),kmadd(nn,kmul(Ro213,kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2))),kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(nn,kmul(rm2,Ro223)),kmadd(nn,kmsub(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro113),kmadd(kmadd(n2,rm1,kmul(rm2,ksub(n1,ltet1))),Ro123,kmadd(kmadd(n3,rm2,kmul(rm3,ksub(n2,ltet2))),Ro233,kmul(Ro133,kmadd(n3,rm1,kmul(ksub(n1,ltet1),rm3)))))),kmadd(nn,kmul(Ro313,kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3))),kmadd(nn,kmul(Ro323,kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3))),kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,kmul(rm3,Ro333))))))))))),kmul(kmadd(ksub(ltet1,n1),kmadd(rm1,Rojo11,kmadd(rm2,Rojo12,kmul(rm3,Rojo13))),kmadd(rm1,kmadd(ksub(ltet2,n2),Rojo21,kmul(Rojo31,ksub(ltet3,n3))),kmadd(rm2,kmadd(ksub(ltet2,n2),Rojo22,kmul(Rojo32,ksub(ltet3,n3))),kmul(rm3,kmadd(ksub(ltet2,n2),Rojo23,kmul(Rojo33,ksub(ltet3,n3))))))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi1iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ltet1,kmadd(im2,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1212,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1213,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p1223,kmul(kmadd(ToReal(-2),n2,ltet2),kmul(nn,Ro221))))),kmadd(nn,kmadd(im1,kmul(Ro111,kmadd(ToReal(-2),n1,ltet1)),kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro121,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro131,knmsub(kmadd(im2,n1,kmul(im1,ksub(n2,ltet2))),Ro211,kmsub(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro231,kmadd(kmadd(im3,n2,kmul(im2,ksub(n3,ltet3))),Ro321,kmul(Ro311,kmadd(im3,n1,kmul(im1,ksub(n3,ltet3)))))))))),kmul(im3,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1213,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1313,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p1323,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,Ro331)))))))),kmadd(ltet2,kmadd(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1223,kmul(kmadd(ToReal(-2),n1,ltet1),kmul(nn,Ro112))))),kmadd(nn,kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro122,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro132,kmadd(kmsub(im1,ksub(ltet2,n2),kmul(im2,n1)),Ro212,kmadd(im2,kmul(Ro222,kmadd(ToReal(-2),n2,ltet2)),kmsub(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro232,kmadd(kmadd(im3,n2,kmul(im2,ksub(n3,ltet3))),Ro322,kmul(Ro312,kmadd(im3,n1,kmul(im1,ksub(n3,ltet3)))))))))),kmul(im3,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1223,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1323,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p2323,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,Ro332)))))))),kmsub(ltet3,kmadd(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1323,kmul(kmadd(ToReal(-2),n1,ltet1),kmul(nn,Ro113))))),kmadd(im2,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1223,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1323,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p2323,kmul(kmadd(ToReal(-2),n2,ltet2),kmul(nn,Ro223))))),kmul(nn,kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro123,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro133,knmsub(kmadd(im2,n1,kmul(im1,ksub(n2,ltet2))),Ro213,kmadd(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro233,kmadd(kmsub(im1,ksub(ltet3,n3),kmul(im3,n1)),Ro313,kmadd(kmsub(im2,ksub(ltet3,n3),kmul(im3,n2)),Ro323,kmul(im3,kmul(Ro333,kmadd(ToReal(-2),n3,ltet3)))))))))))),kmul(kmadd(im1,kmadd(ksub(ltet1,n1),Rojo11,kmadd(ksub(ltet2,n2),Rojo21,kmul(Rojo31,ksub(ltet3,n3)))),kmadd(im2,kmadd(ksub(ltet1,n1),Rojo12,kmadd(ksub(ltet2,n2),Rojo22,kmul(Rojo32,ksub(ltet3,n3)))),kmul(im3,kmadd(ksub(ltet1,n1),Rojo13,kmadd(ksub(ltet2,n2),Rojo23,kmul(Rojo33,ksub(ltet3,n3))))))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi0rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(im1,im2,kmul(rm1,rm2)),kmsub(ltet1,kmadd(ltet2,R4p1212,kmul(ltet3,R4p1213)),kmul(ltet3,kmadd(ltet2,R4p1223,kmul(ltet3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(ltet1,kmsub(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmsub(R4p1213,kmul(ltet1,ltet1),kmul(ltet2,kmul(ltet3,R4p2323)))),kmsub(rm2,rm3,kmul(im2,im3))),kmadd(ToReal(2),kmul(kmadd(ltet1,kmul(ltet2,R4p1213),kmadd(ltet1,kmul(ltet3,R4p1313),kmadd(ltet2,kmul(ltet3,R4p1323),kmul(R4p1223,kmul(ltet2,ltet2))))),kmsub(im1,im3,kmul(rm1,rm3))),knmsub(kmadd(ToReal(2),kmul(ltet2,kmul(ltet3,R4p1213)),kmadd(R4p1212,kmul(ltet2,ltet2),kmul(R4p1313,kmul(ltet3,ltet3)))),kmsub(im1,im1,kmul(rm1,rm1)),knmsub(kmadd(ToReal(-2),kmul(ltet1,kmul(ltet3,R4p1223)),kmadd(R4p1212,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet3,ltet3)))),kmsub(im2,im2,kmul(rm2,rm2)),knmsub(kmul(nn,nn),kmadd(kmsub(im2,im3,kmul(rm2,rm3)),Rojo23,kmadd(im1,kmadd(im2,kadd(Rojo12,Rojo21),kmul(im3,kadd(Rojo13,Rojo31))),knmsub(rm1,kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31))),kmadd(kmsub(im2,im3,kmul(rm2,rm3)),Rojo32,kmadd(Rojo11,kmsub(im1,im1,kmul(rm1,rm1)),kmadd(Rojo22,kmsub(im2,im2,kmul(rm2,rm2)),kmul(Rojo33,kmsub(im3,im3,kmul(rm3,rm3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rm1,rm2,kmul(im1,im2)),kmadd(ltet1,Ro112,kmadd(ltet2,Ro122,kmul(ltet3,Ro132))),kmadd(kmsub(rm1,rm3,kmul(im1,im3)),kmadd(ltet1,Ro113,kmadd(ltet2,Ro123,kmul(ltet3,Ro133))),kmadd(kmsub(rm1,rm2,kmul(im1,im2)),kmadd(ltet1,Ro211,kmadd(ltet2,Ro221,kmul(ltet3,Ro231))),kmadd(kmsub(rm2,rm3,kmul(im2,im3)),kmadd(ltet1,Ro213,kmadd(ltet2,Ro223,kmul(ltet3,Ro233))),kmadd(kmsub(rm1,rm3,kmul(im1,im3)),kmadd(ltet1,Ro311,kmadd(ltet2,Ro321,kmul(ltet3,Ro331))),kmadd(kmsub(rm2,rm3,kmul(im2,im3)),kmadd(ltet1,Ro312,kmadd(ltet2,Ro322,kmul(ltet3,Ro332))),kmadd(kmadd(ltet1,Ro111,kmadd(ltet2,Ro121,kmul(ltet3,Ro131))),kmsub(rm1,rm1,kmul(im1,im1)),kmadd(kmadd(ltet1,Ro212,kmadd(ltet2,Ro222,kmul(ltet3,Ro232))),kmsub(rm2,rm2,kmul(im2,im2)),kmul(kmadd(ltet1,Ro313,kmadd(ltet2,Ro323,kmul(ltet3,Ro333))),kmsub(rm3,rm3,kmul(im3,im3)))))))))))),kmul(kmadd(ToReal(2),kmul(ltet1,kmul(ltet2,R4p1323)),kmadd(R4p1313,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet2,ltet2)))),kmsub(im3,im3,kmul(rm3,rm3))))))))));
    
    CCTK_REAL_VEC Psi0iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(-2),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(ltet1,kmadd(ltet2,R4p1213,kmul(ltet3,R4p1313)),kmadd(ltet2,kmul(ltet3,R4p1323),kmul(R4p1223,kmul(ltet2,ltet2))))),kmadd(ToReal(2),kmadd(kmsub(ltet3,kmadd(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmul(ltet1,kmadd(ltet2,R4p1212,kmul(ltet3,R4p1213)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,kmadd(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(ltet1,kadd(Ro112,Ro211),kmadd(ltet2,kadd(Ro122,Ro221),kmul(ltet3,kadd(Ro132,Ro231)))),kmadd(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(ltet1,kadd(Ro113,Ro311),kmadd(ltet2,kadd(Ro123,Ro321),kmul(ltet3,kadd(Ro133,Ro331)))),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(ltet1,kadd(Ro213,Ro312),kmadd(ltet2,kadd(Ro223,Ro322),kmul(ltet3,kadd(Ro233,Ro332)))),kmul(kmadd(im1,kmul(rm1,kmadd(ltet1,Ro111,kmadd(ltet2,Ro121,kmul(ltet3,Ro131)))),kmadd(im2,kmul(rm2,kmadd(ltet1,Ro212,kmadd(ltet2,Ro222,kmul(ltet3,Ro232)))),kmul(im3,kmul(rm3,kmadd(ltet1,Ro313,kmadd(ltet2,Ro323,kmul(ltet3,Ro333))))))),ToReal(2))))),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(ltet1,kmsub(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmsub(R4p1213,kmul(ltet1,ltet1),kmul(ltet2,kmul(ltet3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(ltet1,kmul(ltet2,R4p1323)),kmadd(R4p1313,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet2,ltet2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(ltet2,kmul(ltet3,R4p1213)),kmadd(R4p1212,kmul(ltet2,ltet2),kmul(R4p1313,kmul(ltet3,ltet3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(ltet1,kmul(ltet3,R4p1223)),kmadd(R4p1212,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet3,ltet3))))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(Psi0i[index],Psi0iL);
    vec_store_nta_partial(Psi0r[index],Psi0rL);
    vec_store_nta_partial(Psi1i[index],Psi1iL);
    vec_store_nta_partial(Psi1r[index],Psi1rL);
    vec_store_nta_partial(Psi2i[index],Psi2iL);
    vec_store_nta_partial(Psi2r[index],Psi2rL);
    vec_store_nta_partial(Psi3i[index],Psi3iL);
    vec_store_nta_partial(Psi3r[index],Psi3rL);
    vec_store_nta_partial(Psi4i[index],Psi4iL);
    vec_store_nta_partial(Psi4r[index],Psi4rL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_psis_calc_2nd);
}
extern "C" void WeylScal4_psis_calc_2nd(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_psis_calc_2nd_Body");
  }
  if (cctk_iteration % WeylScal4_psis_calc_2nd_calc_every != WeylScal4_psis_calc_2nd_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "admbase::curv",
    "admbase::metric",
    "grid::coordinates",
    "WeylScal4::Psi0i_group",
    "WeylScal4::Psi0r_group",
    "WeylScal4::Psi1i_group",
    "WeylScal4::Psi1r_group",
    "WeylScal4::Psi2i_group",
    "WeylScal4::Psi2r_group",
    "WeylScal4::Psi3i_group",
    "WeylScal4::Psi3r_group",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_psis_calc_2nd", 13, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_2nd", 1, 1, 1);
      break;
    }
    
    case 4:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_2nd", 1, 1, 1);
      break;
    }
    
    case 6:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_2nd", 1, 1, 1);
      break;
    }
    
    case 8:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_2nd", 1, 1, 1);
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverInterior(cctkGH, WeylScal4_psis_calc_2nd_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_psis_calc_2nd_Body");
  }
}

} // namespace WeylScal4

```

make.code.defn:
```
# File produced by Kranc

SRCS = Boundaries.cc Kranc.cc RegisterMoL.cc RegisterSymmetries.cc Startup.cc WeylScal4_invars_calc_2nd.cc WeylScal4_invars_calc_4th.cc WeylScal4_invars_calc_Nth.cc WeylScal4_psi4_calc_2nd.cc WeylScal4_psi4_calc_4th.cc WeylScal4_psi4_calc_Nth.cc WeylScal4_psis_calc_2nd.cc WeylScal4_psis_calc_4th.cc WeylScal4_psis_calc_Nth.cc 

```

WeylScal4_psis_calc_4th.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {

extern "C" void WeylScal4_psis_calc_4th_SelectBCs(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (cctk_iteration % WeylScal4_psis_calc_4th_calc_every != WeylScal4_psis_calc_4th_calc_offset)
    return;
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi0i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi0i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi0r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi0r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi1i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi1i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi1r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi1r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi2i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi2i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi2r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi2r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi3i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi3i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi3r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi3r_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4r_group.");
  return;
}

static void WeylScal4_psis_calc_4th_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_psis_calc_4th,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC gxxL CCTK_ATTRIBUTE_UNUSED = vec_load(gxx[index]);
    CCTK_REAL_VEC gxyL CCTK_ATTRIBUTE_UNUSED = vec_load(gxy[index]);
    CCTK_REAL_VEC gxzL CCTK_ATTRIBUTE_UNUSED = vec_load(gxz[index]);
    CCTK_REAL_VEC gyyL CCTK_ATTRIBUTE_UNUSED = vec_load(gyy[index]);
    CCTK_REAL_VEC gyzL CCTK_ATTRIBUTE_UNUSED = vec_load(gyz[index]);
    CCTK_REAL_VEC gzzL CCTK_ATTRIBUTE_UNUSED = vec_load(gzz[index]);
    CCTK_REAL_VEC kxxL CCTK_ATTRIBUTE_UNUSED = vec_load(kxx[index]);
    CCTK_REAL_VEC kxyL CCTK_ATTRIBUTE_UNUSED = vec_load(kxy[index]);
    CCTK_REAL_VEC kxzL CCTK_ATTRIBUTE_UNUSED = vec_load(kxz[index]);
    CCTK_REAL_VEC kyyL CCTK_ATTRIBUTE_UNUSED = vec_load(kyy[index]);
    CCTK_REAL_VEC kyzL CCTK_ATTRIBUTE_UNUSED = vec_load(kyz[index]);
    CCTK_REAL_VEC kzzL CCTK_ATTRIBUTE_UNUSED = vec_load(kzz[index]);
    CCTK_REAL_VEC xL CCTK_ATTRIBUTE_UNUSED = vec_load(x[index]);
    CCTK_REAL_VEC yL CCTK_ATTRIBUTE_UNUSED = vec_load(y[index]);
    CCTK_REAL_VEC zL CCTK_ATTRIBUTE_UNUSED = vec_load(z[index]);
    
    
    CCTK_REAL_VEC dJ111L, dJ112L, dJ113L, dJ122L, dJ123L, dJ133L, dJ211L, dJ212L, dJ213L, dJ222L, dJ223L, dJ233L, dJ311L, dJ312L, dJ313L, dJ322L, dJ323L, dJ333L, J11L, J12L, J13L, J21L, J22L, J23L, J31L, J32L, J33L CCTK_ATTRIBUTE_UNUSED ;
    
    if (usejacobian)
    {
      dJ111L = vec_load(dJ111[index]);
      dJ112L = vec_load(dJ112[index]);
      dJ113L = vec_load(dJ113[index]);
      dJ122L = vec_load(dJ122[index]);
      dJ123L = vec_load(dJ123[index]);
      dJ133L = vec_load(dJ133[index]);
      dJ211L = vec_load(dJ211[index]);
      dJ212L = vec_load(dJ212[index]);
      dJ213L = vec_load(dJ213[index]);
      dJ222L = vec_load(dJ222[index]);
      dJ223L = vec_load(dJ223[index]);
      dJ233L = vec_load(dJ233[index]);
      dJ311L = vec_load(dJ311[index]);
      dJ312L = vec_load(dJ312[index]);
      dJ313L = vec_load(dJ313[index]);
      dJ322L = vec_load(dJ322[index]);
      dJ323L = vec_load(dJ323[index]);
      dJ333L = vec_load(dJ333[index]);
      J11L = vec_load(J11[index]);
      J12L = vec_load(J12[index]);
      J13L = vec_load(J13[index]);
      J21L = vec_load(J21[index]);
      J22L = vec_load(J22[index]);
      J23L = vec_load(J23[index]);
      J31L = vec_load(J31[index]);
      J32L = vec_load(J32[index]);
      J33L = vec_load(J33[index]);
    }
    /* Include user supplied include files */
    /* Precompute derivatives */
    CCTK_REAL_VEC PDstandard4th1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kzz CCTK_ATTRIBUTE_UNUSED;
    
    switch (fdOrder)
    {
      case 2:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      
      case 4:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      
      case 6:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      
      case 8:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC JacPDstandard4th11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th21gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th32gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kyz CCTK_ATTRIBUTE_UNUSED;
    
    if (usejacobian)
    {
      JacPDstandard4th1gxx = 
        kmadd(J11L,PDstandard4th1gxx,kmadd(J21L,PDstandard4th2gxx,kmul(J31L,PDstandard4th3gxx)));
      
      JacPDstandard4th1gxy = 
        kmadd(J11L,PDstandard4th1gxy,kmadd(J21L,PDstandard4th2gxy,kmul(J31L,PDstandard4th3gxy)));
      
      JacPDstandard4th1gxz = 
        kmadd(J11L,PDstandard4th1gxz,kmadd(J21L,PDstandard4th2gxz,kmul(J31L,PDstandard4th3gxz)));
      
      JacPDstandard4th1gyy = 
        kmadd(J11L,PDstandard4th1gyy,kmadd(J21L,PDstandard4th2gyy,kmul(J31L,PDstandard4th3gyy)));
      
      JacPDstandard4th1gyz = 
        kmadd(J11L,PDstandard4th1gyz,kmadd(J21L,PDstandard4th2gyz,kmul(J31L,PDstandard4th3gyz)));
      
      JacPDstandard4th1gzz = 
        kmadd(J11L,PDstandard4th1gzz,kmadd(J21L,PDstandard4th2gzz,kmul(J31L,PDstandard4th3gzz)));
      
      JacPDstandard4th1kxy = 
        kmadd(J11L,PDstandard4th1kxy,kmadd(J21L,PDstandard4th2kxy,kmul(J31L,PDstandard4th3kxy)));
      
      JacPDstandard4th1kxz = 
        kmadd(J11L,PDstandard4th1kxz,kmadd(J21L,PDstandard4th2kxz,kmul(J31L,PDstandard4th3kxz)));
      
      JacPDstandard4th1kyy = 
        kmadd(J11L,PDstandard4th1kyy,kmadd(J21L,PDstandard4th2kyy,kmul(J31L,PDstandard4th3kyy)));
      
      JacPDstandard4th1kyz = 
        kmadd(J11L,PDstandard4th1kyz,kmadd(J21L,PDstandard4th2kyz,kmul(J31L,PDstandard4th3kyz)));
      
      JacPDstandard4th1kzz = 
        kmadd(J11L,PDstandard4th1kzz,kmadd(J21L,PDstandard4th2kzz,kmul(J31L,PDstandard4th3kzz)));
      
      JacPDstandard4th2gxx = 
        kmadd(J12L,PDstandard4th1gxx,kmadd(J22L,PDstandard4th2gxx,kmul(J32L,PDstandard4th3gxx)));
      
      JacPDstandard4th2gxy = 
        kmadd(J12L,PDstandard4th1gxy,kmadd(J22L,PDstandard4th2gxy,kmul(J32L,PDstandard4th3gxy)));
      
      JacPDstandard4th2gxz = 
        kmadd(J12L,PDstandard4th1gxz,kmadd(J22L,PDstandard4th2gxz,kmul(J32L,PDstandard4th3gxz)));
      
      JacPDstandard4th2gyy = 
        kmadd(J12L,PDstandard4th1gyy,kmadd(J22L,PDstandard4th2gyy,kmul(J32L,PDstandard4th3gyy)));
      
      JacPDstandard4th2gyz = 
        kmadd(J12L,PDstandard4th1gyz,kmadd(J22L,PDstandard4th2gyz,kmul(J32L,PDstandard4th3gyz)));
      
      JacPDstandard4th2gzz = 
        kmadd(J12L,PDstandard4th1gzz,kmadd(J22L,PDstandard4th2gzz,kmul(J32L,PDstandard4th3gzz)));
      
      JacPDstandard4th2kxx = 
        kmadd(J12L,PDstandard4th1kxx,kmadd(J22L,PDstandard4th2kxx,kmul(J32L,PDstandard4th3kxx)));
      
      JacPDstandard4th2kxy = 
        kmadd(J12L,PDstandard4th1kxy,kmadd(J22L,PDstandard4th2kxy,kmul(J32L,PDstandard4th3kxy)));
      
      JacPDstandard4th2kxz = 
        kmadd(J12L,PDstandard4th1kxz,kmadd(J22L,PDstandard4th2kxz,kmul(J32L,PDstandard4th3kxz)));
      
      JacPDstandard4th2kyz = 
        kmadd(J12L,PDstandard4th1kyz,kmadd(J22L,PDstandard4th2kyz,kmul(J32L,PDstandard4th3kyz)));
      
      JacPDstandard4th2kzz = 
        kmadd(J12L,PDstandard4th1kzz,kmadd(J22L,PDstandard4th2kzz,kmul(J32L,PDstandard4th3kzz)));
      
      JacPDstandard4th3gxx = 
        kmadd(J13L,PDstandard4th1gxx,kmadd(J23L,PDstandard4th2gxx,kmul(J33L,PDstandard4th3gxx)));
      
      JacPDstandard4th3gxy = 
        kmadd(J13L,PDstandard4th1gxy,kmadd(J23L,PDstandard4th2gxy,kmul(J33L,PDstandard4th3gxy)));
      
      JacPDstandard4th3gxz = 
        kmadd(J13L,PDstandard4th1gxz,kmadd(J23L,PDstandard4th2gxz,kmul(J33L,PDstandard4th3gxz)));
      
      JacPDstandard4th3gyy = 
        kmadd(J13L,PDstandard4th1gyy,kmadd(J23L,PDstandard4th2gyy,kmul(J33L,PDstandard4th3gyy)));
      
      JacPDstandard4th3gyz = 
        kmadd(J13L,PDstandard4th1gyz,kmadd(J23L,PDstandard4th2gyz,kmul(J33L,PDstandard4th3gyz)));
      
      JacPDstandard4th3gzz = 
        kmadd(J13L,PDstandard4th1gzz,kmadd(J23L,PDstandard4th2gzz,kmul(J33L,PDstandard4th3gzz)));
      
      JacPDstandard4th3kxx = 
        kmadd(J13L,PDstandard4th1kxx,kmadd(J23L,PDstandard4th2kxx,kmul(J33L,PDstandard4th3kxx)));
      
      JacPDstandard4th3kxy = 
        kmadd(J13L,PDstandard4th1kxy,kmadd(J23L,PDstandard4th2kxy,kmul(J33L,PDstandard4th3kxy)));
      
      JacPDstandard4th3kxz = 
        kmadd(J13L,PDstandard4th1kxz,kmadd(J23L,PDstandard4th2kxz,kmul(J33L,PDstandard4th3kxz)));
      
      JacPDstandard4th3kyy = 
        kmadd(J13L,PDstandard4th1kyy,kmadd(J23L,PDstandard4th2kyy,kmul(J33L,PDstandard4th3kyy)));
      
      JacPDstandard4th3kyz = 
        kmadd(J13L,PDstandard4th1kyz,kmadd(J23L,PDstandard4th2kyz,kmul(J33L,PDstandard4th3kyz)));
      
      JacPDstandard4th11gyy = 
        kmadd(dJ111L,PDstandard4th1gyy,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard4th12gyy,kmul(J31L,PDstandard4th13gyy)),kmul(J21L,kmul(J31L,PDstandard4th23gyy))),kmadd(dJ211L,PDstandard4th2gyy,kmadd(dJ311L,PDstandard4th3gyy,kmadd(PDstandard4th11gyy,kmul(J11L,J11L),kmadd(PDstandard4th22gyy,kmul(J21L,J21L),kmul(PDstandard4th33gyy,kmul(J31L,J31L))))))));
      
      JacPDstandard4th11gyz = 
        kmadd(dJ111L,PDstandard4th1gyz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard4th12gyz,kmul(J31L,PDstandard4th13gyz)),kmul(J21L,kmul(J31L,PDstandard4th23gyz))),kmadd(dJ211L,PDstandard4th2gyz,kmadd(dJ311L,PDstandard4th3gyz,kmadd(PDstandard4th11gyz,kmul(J11L,J11L),kmadd(PDstandard4th22gyz,kmul(J21L,J21L),kmul(PDstandard4th33gyz,kmul(J31L,J31L))))))));
      
      JacPDstandard4th11gzz = 
        kmadd(dJ111L,PDstandard4th1gzz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard4th12gzz,kmul(J31L,PDstandard4th13gzz)),kmul(J21L,kmul(J31L,PDstandard4th23gzz))),kmadd(dJ211L,PDstandard4th2gzz,kmadd(dJ311L,PDstandard4th3gzz,kmadd(PDstandard4th11gzz,kmul(J11L,J11L),kmadd(PDstandard4th22gzz,kmul(J21L,J21L),kmul(PDstandard4th33gzz,kmul(J31L,J31L))))))));
      
      JacPDstandard4th22gxx = 
        kmadd(dJ122L,PDstandard4th1gxx,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard4th12gxx,kmul(J32L,PDstandard4th13gxx)),kmul(J22L,kmul(J32L,PDstandard4th23gxx))),kmadd(dJ222L,PDstandard4th2gxx,kmadd(dJ322L,PDstandard4th3gxx,kmadd(PDstandard4th11gxx,kmul(J12L,J12L),kmadd(PDstandard4th22gxx,kmul(J22L,J22L),kmul(PDstandard4th33gxx,kmul(J32L,J32L))))))));
      
      JacPDstandard4th22gxz = 
        kmadd(dJ122L,PDstandard4th1gxz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard4th12gxz,kmul(J32L,PDstandard4th13gxz)),kmul(J22L,kmul(J32L,PDstandard4th23gxz))),kmadd(dJ222L,PDstandard4th2gxz,kmadd(dJ322L,PDstandard4th3gxz,kmadd(PDstandard4th11gxz,kmul(J12L,J12L),kmadd(PDstandard4th22gxz,kmul(J22L,J22L),kmul(PDstandard4th33gxz,kmul(J32L,J32L))))))));
      
      JacPDstandard4th22gzz = 
        kmadd(dJ122L,PDstandard4th1gzz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard4th12gzz,kmul(J32L,PDstandard4th13gzz)),kmul(J22L,kmul(J32L,PDstandard4th23gzz))),kmadd(dJ222L,PDstandard4th2gzz,kmadd(dJ322L,PDstandard4th3gzz,kmadd(PDstandard4th11gzz,kmul(J12L,J12L),kmadd(PDstandard4th22gzz,kmul(J22L,J22L),kmul(PDstandard4th33gzz,kmul(J32L,J32L))))))));
      
      JacPDstandard4th33gxx = 
        kmadd(dJ133L,PDstandard4th1gxx,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard4th12gxx,kmul(J33L,PDstandard4th13gxx)),kmul(J23L,kmul(J33L,PDstandard4th23gxx))),kmadd(dJ233L,PDstandard4th2gxx,kmadd(dJ333L,PDstandard4th3gxx,kmadd(PDstandard4th11gxx,kmul(J13L,J13L),kmadd(PDstandard4th22gxx,kmul(J23L,J23L),kmul(PDstandard4th33gxx,kmul(J33L,J33L))))))));
      
      JacPDstandard4th33gxy = 
        kmadd(dJ133L,PDstandard4th1gxy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard4th12gxy,kmul(J33L,PDstandard4th13gxy)),kmul(J23L,kmul(J33L,PDstandard4th23gxy))),kmadd(dJ233L,PDstandard4th2gxy,kmadd(dJ333L,PDstandard4th3gxy,kmadd(PDstandard4th11gxy,kmul(J13L,J13L),kmadd(PDstandard4th22gxy,kmul(J23L,J23L),kmul(PDstandard4th33gxy,kmul(J33L,J33L))))))));
      
      JacPDstandard4th33gyy = 
        kmadd(dJ133L,PDstandard4th1gyy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard4th12gyy,kmul(J33L,PDstandard4th13gyy)),kmul(J23L,kmul(J33L,PDstandard4th23gyy))),kmadd(dJ233L,PDstandard4th2gyy,kmadd(dJ333L,PDstandard4th3gyy,kmadd(PDstandard4th11gyy,kmul(J13L,J13L),kmadd(PDstandard4th22gyy,kmul(J23L,J23L),kmul(PDstandard4th33gyy,kmul(J33L,J33L))))))));
      
      JacPDstandard4th12gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gxy,kmadd(J21L,PDstandard4th12gxy,kmul(J31L,PDstandard4th13gxy))),kmadd(J11L,kmadd(J22L,PDstandard4th12gxy,kmul(J32L,PDstandard4th13gxy)),kmadd(dJ112L,PDstandard4th1gxy,kmadd(J22L,kmadd(J21L,PDstandard4th22gxy,kmul(J31L,PDstandard4th23gxy)),kmadd(dJ212L,PDstandard4th2gxy,kmadd(J32L,kmadd(J21L,PDstandard4th23gxy,kmul(J31L,PDstandard4th33gxy)),kmul(dJ312L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th12gxz = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gxz,kmadd(J21L,PDstandard4th12gxz,kmul(J31L,PDstandard4th13gxz))),kmadd(J11L,kmadd(J22L,PDstandard4th12gxz,kmul(J32L,PDstandard4th13gxz)),kmadd(dJ112L,PDstandard4th1gxz,kmadd(J22L,kmadd(J21L,PDstandard4th22gxz,kmul(J31L,PDstandard4th23gxz)),kmadd(dJ212L,PDstandard4th2gxz,kmadd(J32L,kmadd(J21L,PDstandard4th23gxz,kmul(J31L,PDstandard4th33gxz)),kmul(dJ312L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th12gyz = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gyz,kmadd(J21L,PDstandard4th12gyz,kmul(J31L,PDstandard4th13gyz))),kmadd(J11L,kmadd(J22L,PDstandard4th12gyz,kmul(J32L,PDstandard4th13gyz)),kmadd(dJ112L,PDstandard4th1gyz,kmadd(J22L,kmadd(J21L,PDstandard4th22gyz,kmul(J31L,PDstandard4th23gyz)),kmadd(dJ212L,PDstandard4th2gyz,kmadd(J32L,kmadd(J21L,PDstandard4th23gyz,kmul(J31L,PDstandard4th33gyz)),kmul(dJ312L,PDstandard4th3gyz)))))));
      
      JacPDstandard4th12gzz = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gzz,kmadd(J21L,PDstandard4th12gzz,kmul(J31L,PDstandard4th13gzz))),kmadd(J11L,kmadd(J22L,PDstandard4th12gzz,kmul(J32L,PDstandard4th13gzz)),kmadd(dJ112L,PDstandard4th1gzz,kmadd(J22L,kmadd(J21L,PDstandard4th22gzz,kmul(J31L,PDstandard4th23gzz)),kmadd(dJ212L,PDstandard4th2gzz,kmadd(J32L,kmadd(J21L,PDstandard4th23gzz,kmul(J31L,PDstandard4th33gzz)),kmul(dJ312L,PDstandard4th3gzz)))))));
      
      JacPDstandard4th13gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gxz,kmadd(J21L,PDstandard4th12gxz,kmul(J31L,PDstandard4th13gxz))),kmadd(J11L,kmadd(J23L,PDstandard4th12gxz,kmul(J33L,PDstandard4th13gxz)),kmadd(dJ113L,PDstandard4th1gxz,kmadd(J23L,kmadd(J21L,PDstandard4th22gxz,kmul(J31L,PDstandard4th23gxz)),kmadd(dJ213L,PDstandard4th2gxz,kmadd(J33L,kmadd(J21L,PDstandard4th23gxz,kmul(J31L,PDstandard4th33gxz)),kmul(dJ313L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th21gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gxy,kmadd(J21L,PDstandard4th12gxy,kmul(J31L,PDstandard4th13gxy))),kmadd(J11L,kmadd(J22L,PDstandard4th12gxy,kmul(J32L,PDstandard4th13gxy)),kmadd(dJ112L,PDstandard4th1gxy,kmadd(J22L,kmadd(J21L,PDstandard4th22gxy,kmul(J31L,PDstandard4th23gxy)),kmadd(dJ212L,PDstandard4th2gxy,kmadd(J32L,kmadd(J21L,PDstandard4th23gxy,kmul(J31L,PDstandard4th33gxy)),kmul(dJ312L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th23gxx = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gxx,kmadd(J22L,PDstandard4th12gxx,kmul(J32L,PDstandard4th13gxx))),kmadd(J12L,kmadd(J23L,PDstandard4th12gxx,kmul(J33L,PDstandard4th13gxx)),kmadd(dJ123L,PDstandard4th1gxx,kmadd(J23L,kmadd(J22L,PDstandard4th22gxx,kmul(J32L,PDstandard4th23gxx)),kmadd(dJ223L,PDstandard4th2gxx,kmadd(J33L,kmadd(J22L,PDstandard4th23gxx,kmul(J32L,PDstandard4th33gxx)),kmul(dJ323L,PDstandard4th3gxx)))))));
      
      JacPDstandard4th23gxy = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gxy,kmadd(J22L,PDstandard4th12gxy,kmul(J32L,PDstandard4th13gxy))),kmadd(J12L,kmadd(J23L,PDstandard4th12gxy,kmul(J33L,PDstandard4th13gxy)),kmadd(dJ123L,PDstandard4th1gxy,kmadd(J23L,kmadd(J22L,PDstandard4th22gxy,kmul(J32L,PDstandard4th23gxy)),kmadd(dJ223L,PDstandard4th2gxy,kmadd(J33L,kmadd(J22L,PDstandard4th23gxy,kmul(J32L,PDstandard4th33gxy)),kmul(dJ323L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th23gxz = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gxz,kmadd(J22L,PDstandard4th12gxz,kmul(J32L,PDstandard4th13gxz))),kmadd(J12L,kmadd(J23L,PDstandard4th12gxz,kmul(J33L,PDstandard4th13gxz)),kmadd(dJ123L,PDstandard4th1gxz,kmadd(J23L,kmadd(J22L,PDstandard4th22gxz,kmul(J32L,PDstandard4th23gxz)),kmadd(dJ223L,PDstandard4th2gxz,kmadd(J33L,kmadd(J22L,PDstandard4th23gxz,kmul(J32L,PDstandard4th33gxz)),kmul(dJ323L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th23gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gyz,kmadd(J22L,PDstandard4th12gyz,kmul(J32L,PDstandard4th13gyz))),kmadd(J12L,kmadd(J23L,PDstandard4th12gyz,kmul(J33L,PDstandard4th13gyz)),kmadd(dJ123L,PDstandard4th1gyz,kmadd(J23L,kmadd(J22L,PDstandard4th22gyz,kmul(J32L,PDstandard4th23gyz)),kmadd(dJ223L,PDstandard4th2gyz,kmadd(J33L,kmadd(J22L,PDstandard4th23gyz,kmul(J32L,PDstandard4th33gyz)),kmul(dJ323L,PDstandard4th3gyz)))))));
      
      JacPDstandard4th31gxy = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gxy,kmadd(J21L,PDstandard4th12gxy,kmul(J31L,PDstandard4th13gxy))),kmadd(J11L,kmadd(J23L,PDstandard4th12gxy,kmul(J33L,PDstandard4th13gxy)),kmadd(dJ113L,PDstandard4th1gxy,kmadd(J23L,kmadd(J21L,PDstandard4th22gxy,kmul(J31L,PDstandard4th23gxy)),kmadd(dJ213L,PDstandard4th2gxy,kmadd(J33L,kmadd(J21L,PDstandard4th23gxy,kmul(J31L,PDstandard4th33gxy)),kmul(dJ313L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th31gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gxz,kmadd(J21L,PDstandard4th12gxz,kmul(J31L,PDstandard4th13gxz))),kmadd(J11L,kmadd(J23L,PDstandard4th12gxz,kmul(J33L,PDstandard4th13gxz)),kmadd(dJ113L,PDstandard4th1gxz,kmadd(J23L,kmadd(J21L,PDstandard4th22gxz,kmul(J31L,PDstandard4th23gxz)),kmadd(dJ213L,PDstandard4th2gxz,kmadd(J33L,kmadd(J21L,PDstandard4th23gxz,kmul(J31L,PDstandard4th33gxz)),kmul(dJ313L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th31gyy = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gyy,kmadd(J21L,PDstandard4th12gyy,kmul(J31L,PDstandard4th13gyy))),kmadd(J11L,kmadd(J23L,PDstandard4th12gyy,kmul(J33L,PDstandard4th13gyy)),kmadd(dJ113L,PDstandard4th1gyy,kmadd(J23L,kmadd(J21L,PDstandard4th22gyy,kmul(J31L,PDstandard4th23gyy)),kmadd(dJ213L,PDstandard4th2gyy,kmadd(J33L,kmadd(J21L,PDstandard4th23gyy,kmul(J31L,PDstandard4th33gyy)),kmul(dJ313L,PDstandard4th3gyy)))))));
      
      JacPDstandard4th31gyz = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gyz,kmadd(J21L,PDstandard4th12gyz,kmul(J31L,PDstandard4th13gyz))),kmadd(J11L,kmadd(J23L,PDstandard4th12gyz,kmul(J33L,PDstandard4th13gyz)),kmadd(dJ113L,PDstandard4th1gyz,kmadd(J23L,kmadd(J21L,PDstandard4th22gyz,kmul(J31L,PDstandard4th23gyz)),kmadd(dJ213L,PDstandard4th2gyz,kmadd(J33L,kmadd(J21L,PDstandard4th23gyz,kmul(J31L,PDstandard4th33gyz)),kmul(dJ313L,PDstandard4th3gyz)))))));
      
      JacPDstandard4th32gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gyz,kmadd(J22L,PDstandard4th12gyz,kmul(J32L,PDstandard4th13gyz))),kmadd(J12L,kmadd(J23L,PDstandard4th12gyz,kmul(J33L,PDstandard4th13gyz)),kmadd(dJ123L,PDstandard4th1gyz,kmadd(J23L,kmadd(J22L,PDstandard4th22gyz,kmul(J32L,PDstandard4th23gyz)),kmadd(dJ223L,PDstandard4th2gyz,kmadd(J33L,kmadd(J22L,PDstandard4th23gyz,kmul(J32L,PDstandard4th33gyz)),kmul(dJ323L,PDstandard4th3gyz)))))));
    }
    else
    {
      JacPDstandard4th1gxx = PDstandard4th1gxx;
      
      JacPDstandard4th1gxy = PDstandard4th1gxy;
      
      JacPDstandard4th1gxz = PDstandard4th1gxz;
      
      JacPDstandard4th1gyy = PDstandard4th1gyy;
      
      JacPDstandard4th1gyz = PDstandard4th1gyz;
      
      JacPDstandard4th1gzz = PDstandard4th1gzz;
      
      JacPDstandard4th1kxy = PDstandard4th1kxy;
      
      JacPDstandard4th1kxz = PDstandard4th1kxz;
      
      JacPDstandard4th1kyy = PDstandard4th1kyy;
      
      JacPDstandard4th1kyz = PDstandard4th1kyz;
      
      JacPDstandard4th1kzz = PDstandard4th1kzz;
      
      JacPDstandard4th2gxx = PDstandard4th2gxx;
      
      JacPDstandard4th2gxy = PDstandard4th2gxy;
      
      JacPDstandard4th2gxz = PDstandard4th2gxz;
      
      JacPDstandard4th2gyy = PDstandard4th2gyy;
      
      JacPDstandard4th2gyz = PDstandard4th2gyz;
      
      JacPDstandard4th2gzz = PDstandard4th2gzz;
      
      JacPDstandard4th2kxx = PDstandard4th2kxx;
      
      JacPDstandard4th2kxy = PDstandard4th2kxy;
      
      JacPDstandard4th2kxz = PDstandard4th2kxz;
      
      JacPDstandard4th2kyz = PDstandard4th2kyz;
      
      JacPDstandard4th2kzz = PDstandard4th2kzz;
      
      JacPDstandard4th3gxx = PDstandard4th3gxx;
      
      JacPDstandard4th3gxy = PDstandard4th3gxy;
      
      JacPDstandard4th3gxz = PDstandard4th3gxz;
      
      JacPDstandard4th3gyy = PDstandard4th3gyy;
      
      JacPDstandard4th3gyz = PDstandard4th3gyz;
      
      JacPDstandard4th3gzz = PDstandard4th3gzz;
      
      JacPDstandard4th3kxx = PDstandard4th3kxx;
      
      JacPDstandard4th3kxy = PDstandard4th3kxy;
      
      JacPDstandard4th3kxz = PDstandard4th3kxz;
      
      JacPDstandard4th3kyy = PDstandard4th3kyy;
      
      JacPDstandard4th3kyz = PDstandard4th3kyz;
      
      JacPDstandard4th11gyy = PDstandard4th11gyy;
      
      JacPDstandard4th11gyz = PDstandard4th11gyz;
      
      JacPDstandard4th11gzz = PDstandard4th11gzz;
      
      JacPDstandard4th22gxx = PDstandard4th22gxx;
      
      JacPDstandard4th22gxz = PDstandard4th22gxz;
      
      JacPDstandard4th22gzz = PDstandard4th22gzz;
      
      JacPDstandard4th33gxx = PDstandard4th33gxx;
      
      JacPDstandard4th33gxy = PDstandard4th33gxy;
      
      JacPDstandard4th33gyy = PDstandard4th33gyy;
      
      JacPDstandard4th12gxy = PDstandard4th12gxy;
      
      JacPDstandard4th12gxz = PDstandard4th12gxz;
      
      JacPDstandard4th12gyz = PDstandard4th12gyz;
      
      JacPDstandard4th12gzz = PDstandard4th12gzz;
      
      JacPDstandard4th13gxz = PDstandard4th13gxz;
      
      JacPDstandard4th21gxy = PDstandard4th12gxy;
      
      JacPDstandard4th23gxx = PDstandard4th23gxx;
      
      JacPDstandard4th23gxy = PDstandard4th23gxy;
      
      JacPDstandard4th23gxz = PDstandard4th23gxz;
      
      JacPDstandard4th23gyz = PDstandard4th23gyz;
      
      JacPDstandard4th31gxy = PDstandard4th13gxy;
      
      JacPDstandard4th31gxz = PDstandard4th13gxz;
      
      JacPDstandard4th31gyy = PDstandard4th13gyy;
      
      JacPDstandard4th31gyz = PDstandard4th13gyz;
      
      JacPDstandard4th32gyz = PDstandard4th23gyz;
    }
    
    CCTK_REAL_VEC detg CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(gxyL,kmul(gxzL,gyzL)),knmsub(gzzL,kmul(gxyL,gxyL),kmsub(gyyL,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)),kmul(gxxL,kmul(gyzL,gyzL)))));
    
    CCTK_REAL_VEC invdetg CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),detg);
    
    CCTK_REAL_VEC gInv11 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gyyL,gzzL,kmul(gyzL,gyzL)));
    
    CCTK_REAL_VEC gInv12 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv13 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv21 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv22 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)));
    
    CCTK_REAL_VEC gInv23 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv31 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv32 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv33 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gyyL,kmul(gxyL,gxyL)));
    
    CCTK_REAL_VEC gamma111 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,JacPDstandard4th1gxx,kmsub(ToReal(2),kmadd(gInv12,JacPDstandard4th1gxy,kmul(gInv13,JacPDstandard4th1gxz)),kmadd(gInv13,JacPDstandard4th3gxx,kmul(gInv12,JacPDstandard4th2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma211 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,JacPDstandard4th1gxx,kmsub(ToReal(2),kmadd(gInv22,JacPDstandard4th1gxy,kmul(gInv23,JacPDstandard4th1gxz)),kmadd(gInv23,JacPDstandard4th3gxx,kmul(gInv22,JacPDstandard4th2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma311 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,JacPDstandard4th1gxx,kmsub(ToReal(2),kmadd(gInv32,JacPDstandard4th1gxy,kmul(gInv33,JacPDstandard4th1gxz)),kmadd(gInv33,JacPDstandard4th3gxx,kmul(gInv32,JacPDstandard4th2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma121 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv12,JacPDstandard4th1gyy,kmadd(gInv11,JacPDstandard4th2gxx,kmul(gInv13,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th2gxz,JacPDstandard4th3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma221 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv22,JacPDstandard4th1gyy,kmadd(gInv21,JacPDstandard4th2gxx,kmul(gInv23,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th2gxz,JacPDstandard4th3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma321 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv32,JacPDstandard4th1gyy,kmadd(gInv31,JacPDstandard4th2gxx,kmul(gInv33,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th2gxz,JacPDstandard4th3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma131 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard4th1gzz,kmadd(gInv11,JacPDstandard4th3gxx,kmul(gInv12,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th3gxy,JacPDstandard4th2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma231 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard4th1gzz,kmadd(gInv21,JacPDstandard4th3gxx,kmul(gInv22,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th3gxy,JacPDstandard4th2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma331 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard4th1gzz,kmadd(gInv31,JacPDstandard4th3gxx,kmul(gInv32,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th3gxy,JacPDstandard4th2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma122 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard4th2gxy,JacPDstandard4th1gyy),kmadd(gInv12,JacPDstandard4th2gyy,kmul(gInv13,kmsub(ToReal(2),JacPDstandard4th2gyz,JacPDstandard4th3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma222 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard4th2gxy,JacPDstandard4th1gyy),kmadd(gInv22,JacPDstandard4th2gyy,kmul(gInv23,kmsub(ToReal(2),JacPDstandard4th2gyz,JacPDstandard4th3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma322 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard4th2gxy,JacPDstandard4th1gyy),kmadd(gInv32,JacPDstandard4th2gyy,kmul(gInv33,kmsub(ToReal(2),JacPDstandard4th2gyz,JacPDstandard4th3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma132 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard4th2gzz,kmadd(gInv11,ksub(kadd(JacPDstandard4th2gxz,JacPDstandard4th3gxy),JacPDstandard4th1gyz),kmul(gInv12,JacPDstandard4th3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma232 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard4th2gzz,kmadd(gInv21,ksub(kadd(JacPDstandard4th2gxz,JacPDstandard4th3gxy),JacPDstandard4th1gyz),kmul(gInv22,JacPDstandard4th3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma332 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard4th2gzz,kmadd(gInv31,ksub(kadd(JacPDstandard4th2gxz,JacPDstandard4th3gxy),JacPDstandard4th1gyz),kmul(gInv32,JacPDstandard4th3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma133 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard4th3gxz,JacPDstandard4th1gzz),kmadd(gInv12,kmsub(ToReal(2),JacPDstandard4th3gyz,JacPDstandard4th2gzz),kmul(gInv13,JacPDstandard4th3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma233 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard4th3gxz,JacPDstandard4th1gzz),kmadd(gInv22,kmsub(ToReal(2),JacPDstandard4th3gyz,JacPDstandard4th2gzz),kmul(gInv23,JacPDstandard4th3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma333 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard4th3gxz,JacPDstandard4th1gzz),kmadd(gInv32,kmsub(ToReal(2),JacPDstandard4th3gyz,JacPDstandard4th2gzz),kmul(gInv33,JacPDstandard4th3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC xmoved CCTK_ATTRIBUTE_UNUSED = ksub(xL,ToReal(xorig));
    
    CCTK_REAL_VEC ymoved CCTK_ATTRIBUTE_UNUSED = ksub(yL,ToReal(yorig));
    
    CCTK_REAL_VEC zmoved CCTK_ATTRIBUTE_UNUSED = ksub(zL,ToReal(zorig));
    
    CCTK_REAL_VEC va1 CCTK_ATTRIBUTE_UNUSED = kneg(ymoved);
    
    CCTK_REAL_VEC va2 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC va3 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC vb1 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC vb2 CCTK_ATTRIBUTE_UNUSED = ymoved;
    
    CCTK_REAL_VEC vb3 CCTK_ATTRIBUTE_UNUSED = zmoved;
    
    CCTK_REAL_VEC vc1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv12,va3,kmul(gInv13,va2)),vb1,kmadd(kmsub(gInv13,va1,kmul(gInv11,va3)),vb2,kmul(vb3,kmsub(gInv11,va2,kmul(gInv12,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv22,va3,kmul(gInv23,va2)),vb1,kmadd(kmsub(gInv23,va1,kmul(gInv21,va3)),vb2,kmul(vb3,kmsub(gInv21,va2,kmul(gInv22,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv32,va3,kmul(gInv33,va2)),vb1,kmadd(kmsub(gInv33,va1,kmul(gInv31,va3)),vb2,kmul(vb3,kmsub(gInv31,va2,kmul(gInv32,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC wa1 CCTK_ATTRIBUTE_UNUSED = va1;
    
    CCTK_REAL_VEC wa2 CCTK_ATTRIBUTE_UNUSED = va2;
    
    CCTK_REAL_VEC wa3 CCTK_ATTRIBUTE_UNUSED = va3;
    
    CCTK_REAL_VEC omega11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wa2,wa3),kmul(wa1,kmadd(gxyL,wa2,kmul(gxzL,wa3)))),kmadd(gxxL,kmul(wa1,wa1),kmadd(gyyL,kmul(wa2,wa2),kmul(gzzL,kmul(wa3,wa3)))));
    
    CCTK_REAL_VEC ea1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa1,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa2,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa3,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC omega12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vb1,kmadd(gxyL,vb2,kmul(gxzL,vb3))),kmadd(ea2,kmadd(gxyL,vb1,kmadd(gyyL,vb2,kmul(gyzL,vb3))),kmul(ea3,kmadd(gxzL,vb1,kmadd(gyzL,vb2,kmul(gzzL,vb3))))));
    
    CCTK_REAL_VEC wb1 CCTK_ATTRIBUTE_UNUSED = knmsub(ea1,omega12,vb1);
    
    CCTK_REAL_VEC wb2 CCTK_ATTRIBUTE_UNUSED = knmsub(ea2,omega12,vb2);
    
    CCTK_REAL_VEC wb3 CCTK_ATTRIBUTE_UNUSED = knmsub(ea3,omega12,vb3);
    
    CCTK_REAL_VEC omega22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wb2,wb3),kmul(wb1,kmadd(gxyL,wb2,kmul(gxzL,wb3)))),kmadd(gxxL,kmul(wb1,wb1),kmadd(gyyL,kmul(wb2,wb2),kmul(gzzL,kmul(wb3,wb3)))));
    
    CCTK_REAL_VEC eb1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb1,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb2,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb3,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC omega13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(ea2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(ea3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC omega23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(eb1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(eb2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(eb3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC wc1 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea1,omega13,knmsub(eb1,omega23,vc1));
    
    CCTK_REAL_VEC wc2 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea2,omega13,knmsub(eb2,omega23,vc2));
    
    CCTK_REAL_VEC wc3 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea3,omega13,knmsub(eb3,omega23,vc3));
    
    CCTK_REAL_VEC omega33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wc2,wc3),kmul(wc1,kmadd(gxyL,wc2,kmul(gxzL,wc3)))),kmadd(gxxL,kmul(wc1,wc1),kmadd(gyyL,kmul(wc2,wc2),kmul(gzzL,kmul(wc3,wc3)))));
    
    CCTK_REAL_VEC ec1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc1,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc2,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc3,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC isqrt2 CCTK_ATTRIBUTE_UNUSED = 
      ToReal(0.707106781186547524);
    
    CCTK_REAL_VEC ltet1 CCTK_ATTRIBUTE_UNUSED = kmul(eb1,isqrt2);
    
    CCTK_REAL_VEC ltet2 CCTK_ATTRIBUTE_UNUSED = kmul(eb2,isqrt2);
    
    CCTK_REAL_VEC ltet3 CCTK_ATTRIBUTE_UNUSED = kmul(eb3,isqrt2);
    
    CCTK_REAL_VEC n1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb1,isqrt2));
    
    CCTK_REAL_VEC n2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb2,isqrt2));
    
    CCTK_REAL_VEC n3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb3,isqrt2));
    
    CCTK_REAL_VEC rm1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rm2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rm3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC im1 CCTK_ATTRIBUTE_UNUSED = kmul(ea1,isqrt2);
    
    CCTK_REAL_VEC im2 CCTK_ATTRIBUTE_UNUSED = kmul(ea2,isqrt2);
    
    CCTK_REAL_VEC im3 CCTK_ATTRIBUTE_UNUSED = kmul(ea3,isqrt2);
    
    CCTK_REAL_VEC rmbar1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rmbar2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rmbar3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC imbar1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea1,isqrt2));
    
    CCTK_REAL_VEC imbar2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea2,isqrt2));
    
    CCTK_REAL_VEC imbar3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea3,isqrt2));
    
    CCTK_REAL_VEC nn CCTK_ATTRIBUTE_UNUSED = isqrt2;
    
    CCTK_REAL_VEC R1212 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma221,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(gamma321,kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321)))))),kmadd(ToReal(-2),kmadd(gamma122,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma222,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma322))),ksub(kadd(JacPDstandard4th12gxy,ksub(JacPDstandard4th21gxy,JacPDstandard4th22gxx)),JacPDstandard4th11gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC R1213 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma221,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma321,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma232,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma332))),ksub(kadd(JacPDstandard4th12gxz,ksub(JacPDstandard4th31gxy,JacPDstandard4th23gxx)),JacPDstandard4th11gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1223 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma122,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma222,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma322,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma232,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma332))),ksub(kadd(JacPDstandard4th22gxz,ksub(JacPDstandard4th31gyy,JacPDstandard4th23gxy)),JacPDstandard4th12gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1313 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma131,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma231,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma331,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma233,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma333))),ksub(kadd(JacPDstandard4th13gxz,ksub(JacPDstandard4th31gxz,JacPDstandard4th33gxx)),JacPDstandard4th11gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma232,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331))),gamma332))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma233,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma333))),ksub(kadd(JacPDstandard4th23gxz,ksub(JacPDstandard4th31gyz,JacPDstandard4th33gxy)),JacPDstandard4th12gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R2323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma132,kmadd(gxyL,gamma232,kmul(gxzL,gamma332))),kmadd(gamma232,kmadd(gxyL,gamma132,kmadd(gyyL,gamma232,kmul(gyzL,gamma332))),kmul(gamma332,kmadd(gxzL,gamma132,kmadd(gyzL,gamma232,kmul(gzzL,gamma332)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma122,kmadd(gxyL,gamma222,kmul(gxzL,gamma322))),kmadd(gamma233,kmadd(gxyL,gamma122,kmadd(gyyL,gamma222,kmul(gyzL,gamma322))),kmul(kmadd(gxzL,gamma122,kmadd(gyzL,gamma222,kmul(gzzL,gamma322))),gamma333))),ksub(kadd(JacPDstandard4th23gyz,ksub(JacPDstandard4th32gyz,JacPDstandard4th33gyy)),JacPDstandard4th22gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R4p1212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212));
    
    CCTK_REAL_VEC R4p1213 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213));
    
    CCTK_REAL_VEC R4p1223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223));
    
    CCTK_REAL_VEC R4p1313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313));
    
    CCTK_REAL_VEC R4p1323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323));
    
    CCTK_REAL_VEC R4p2323 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323));
    
    CCTK_REAL_VEC Ro111 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro112 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma121,knmsub(kyyL,gamma211,kmadd(kxyL,ksub(gamma221,gamma111),knmsub(kyzL,gamma311,kmadd(kxzL,gamma321,ksub(JacPDstandard4th1kxy,JacPDstandard4th2kxx))))));
    
    CCTK_REAL_VEC Ro113 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma131,knmsub(kyzL,gamma211,kmadd(kxyL,gamma231,knmsub(kzzL,gamma311,kmadd(kxzL,ksub(gamma331,gamma111),ksub(JacPDstandard4th1kxz,JacPDstandard4th3kxx))))));
    
    CCTK_REAL_VEC Ro121 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma121,kmadd(kyyL,gamma211,kmadd(kxyL,ksub(gamma111,gamma221),kmadd(kyzL,gamma311,knmsub(kxzL,gamma321,ksub(JacPDstandard4th2kxx,JacPDstandard4th1kxy))))));
    
    CCTK_REAL_VEC Ro122 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro123 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma121,kmadd(kxyL,gamma131,kmadd(kyyL,gamma231,knmsub(kzzL,gamma321,kmadd(kyzL,ksub(gamma331,gamma221),ksub(JacPDstandard4th2kxz,JacPDstandard4th3kxy))))));
    
    CCTK_REAL_VEC Ro131 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma131,kmadd(kyzL,gamma211,knmsub(kxyL,gamma231,kmadd(kzzL,gamma311,kmadd(kxzL,ksub(gamma111,gamma331),ksub(JacPDstandard4th3kxx,JacPDstandard4th1kxz))))));
    
    CCTK_REAL_VEC Ro132 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma121,knmsub(kxyL,gamma131,knmsub(kyyL,gamma231,kmadd(kzzL,gamma321,kmadd(kyzL,ksub(gamma221,gamma331),ksub(JacPDstandard4th3kxy,JacPDstandard4th2kxz))))));
    
    CCTK_REAL_VEC Ro133 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro211 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma122,knmsub(kyyL,gamma221,kmadd(kxyL,ksub(gamma222,gamma121),knmsub(kyzL,gamma321,kmadd(kxzL,gamma322,ksub(JacPDstandard4th1kyy,JacPDstandard4th2kxy))))));
    
    CCTK_REAL_VEC Ro213 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyzL,gamma221,kmadd(kxyL,gamma232,knmsub(kzzL,gamma321,kmadd(kxzL,ksub(gamma332,gamma121),ksub(JacPDstandard4th1kyz,JacPDstandard4th3kxy))))));
    
    CCTK_REAL_VEC Ro221 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma122,kmadd(kyyL,gamma221,kmadd(kxyL,ksub(gamma121,gamma222),kmadd(kyzL,gamma321,knmsub(kxzL,gamma322,ksub(JacPDstandard4th2kxy,JacPDstandard4th1kyy))))));
    
    CCTK_REAL_VEC Ro222 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma122,kmadd(kxyL,gamma132,kmadd(kyyL,gamma232,knmsub(kzzL,gamma322,kmadd(kyzL,ksub(gamma332,gamma222),ksub(JacPDstandard4th2kyz,JacPDstandard4th3kyy))))));
    
    CCTK_REAL_VEC Ro231 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyzL,gamma221,knmsub(kxyL,gamma232,kmadd(kzzL,gamma321,kmadd(kxzL,ksub(gamma121,gamma332),ksub(JacPDstandard4th3kxy,JacPDstandard4th1kyz))))));
    
    CCTK_REAL_VEC Ro232 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma122,knmsub(kxyL,gamma132,knmsub(kyyL,gamma232,kmadd(kzzL,gamma322,kmadd(kyzL,ksub(gamma222,gamma332),ksub(JacPDstandard4th3kyy,JacPDstandard4th2kyz))))));
    
    CCTK_REAL_VEC Ro233 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro311 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro312 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyyL,gamma231,kmadd(kxyL,ksub(gamma232,gamma131),knmsub(kyzL,gamma331,kmadd(kxzL,gamma332,ksub(JacPDstandard4th1kyz,JacPDstandard4th2kxz))))));
    
    CCTK_REAL_VEC Ro313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma133,knmsub(kyzL,gamma231,kmadd(kxyL,gamma233,knmsub(kzzL,gamma331,kmadd(kxzL,ksub(gamma333,gamma131),ksub(JacPDstandard4th1kzz,JacPDstandard4th3kxz))))));
    
    CCTK_REAL_VEC Ro321 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyyL,gamma231,kmadd(kxyL,ksub(gamma131,gamma232),kmadd(kyzL,gamma331,knmsub(kxzL,gamma332,ksub(JacPDstandard4th2kxz,JacPDstandard4th1kyz))))));
    
    CCTK_REAL_VEC Ro322 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma132,kmadd(kxyL,gamma133,kmadd(kyyL,gamma233,knmsub(kzzL,gamma332,kmadd(kyzL,ksub(gamma333,gamma232),ksub(JacPDstandard4th2kzz,JacPDstandard4th3kyz))))));
    
    CCTK_REAL_VEC Ro331 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma133,kmadd(kyzL,gamma231,knmsub(kxyL,gamma233,kmadd(kzzL,gamma331,kmadd(kxzL,ksub(gamma131,gamma333),ksub(JacPDstandard4th3kxz,JacPDstandard4th1kzz))))));
    
    CCTK_REAL_VEC Ro332 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma132,knmsub(kxyL,gamma133,knmsub(kyyL,gamma233,kmadd(kzzL,gamma332,kmadd(kyzL,ksub(gamma232,gamma333),ksub(JacPDstandard4th3kyz,JacPDstandard4th2kzz))))));
    
    CCTK_REAL_VEC Ro333 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Rojo11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv23,gInv32),knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv22,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)))));
    
    CCTK_REAL_VEC Rojo12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv32,knmsub(gInv21,R1212,knmsub(gInv31,R1213,kmadd(gInv23,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv12,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv23,knmsub(gInv21,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv31,R1313,kmsub(gInv13,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv32,R1323)))))));
    
    CCTK_REAL_VEC Rojo21 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv23,kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv31,knmsub(gInv12,R1212,knmsub(gInv13,R1213,kmadd(gInv32,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv21,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv13,gInv31),kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),kmadd(gInv11,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Rojo23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv21,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv12,R1223,knmsub(gInv31,R1323,kmsub(gInv23,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv32,R2323)))))));
    
    CCTK_REAL_VEC Rojo31 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv21,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv32,knmsub(gInv12,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv13,R1313,kmsub(gInv31,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv23,R1323)))))));
    
    CCTK_REAL_VEC Rojo32 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv31,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv21,R1223,knmsub(gInv13,R1323,kmsub(gInv32,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv23,R2323)))))));
    
    CCTK_REAL_VEC Rojo33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv12,gInv21),knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmadd(gInv11,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)),kmul(gInv22,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(imbar1,imbar2,kmul(rmbar1,rmbar2)),kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3))),kmadd(ToReal(2),kmul(kmadd(n1,kmul(n2,R4p1213),kmadd(n1,kmul(n3,R4p1313),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))),kmsub(imbar1,imbar3,kmul(rmbar1,rmbar3))),knmsub(kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3)))),kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),knmsub(kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3)))),kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),knmsub(kmul(nn,nn),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo23,kmadd(imbar1,kmadd(imbar2,kadd(Rojo12,Rojo21),kmul(imbar3,kadd(Rojo13,Rojo31))),knmsub(rmbar1,kmadd(rmbar2,kadd(Rojo12,Rojo21),kmul(rmbar3,kadd(Rojo13,Rojo31))),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo32,kmadd(Rojo11,kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),kmadd(Rojo22,kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),kmul(Rojo33,kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro112,kmadd(n2,Ro122,kmul(n3,Ro132))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro113,kmadd(n2,Ro123,kmul(n3,Ro133))),kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro211,kmadd(n2,Ro221,kmul(n3,Ro231))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro213,kmadd(n2,Ro223,kmul(n3,Ro233))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro311,kmadd(n2,Ro321,kmul(n3,Ro331))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro312,kmadd(n2,Ro322,kmul(n3,Ro332))),kmadd(kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131))),kmsub(rmbar1,rmbar1,kmul(imbar1,imbar1)),kmadd(kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232))),kmsub(rmbar2,rmbar2,kmul(imbar2,imbar2)),kmul(kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))),kmsub(rmbar3,rmbar3,kmul(imbar3,imbar3)))))))))))),kmul(kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2)))),kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))));
    
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,knmsub(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(n1,kadd(Ro112,Ro211),kmadd(n3,kadd(Ro132,Ro231),kmul(n2,kadd(Ro122,Ro221)))),kmadd(ToReal(-2),kmadd(im1,kmul(rm1,kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131)))),kmul(im2,kmul(rm2,kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232)))))),knmsub(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kadd(Ro113,Ro311),kmadd(n3,kadd(Ro133,Ro331),kmul(n2,kadd(Ro123,Ro321)))),kmsub(ToReal(-2),kmul(im3,kmul(rm3,kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))))),kmul(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kadd(Ro213,Ro312),kmadd(n3,kadd(Ro233,Ro332),kmul(n2,kadd(Ro223,Ro322))))))))),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kmadd(n2,R4p1213,kmul(n3,R4p1313)),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))))),kmsub(ToReal(-2),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    
    CCTK_REAL_VEC Psi3rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(n1,knmsub(ltet1,kmadd(n2,kmul(R4p1212,rm2),kmadd(n3,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1213,rm3),kmul(n3,kmul(R4p1313,rm3))))),kmadd(ltet3,kmadd(n1,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1223,rm2),kmadd(n1,kmul(R4p1313,rm3),kmul(n2,kmul(R4p1323,rm3))))),kmadd(ltet2,kmsub(n1,kmadd(R4p1212,rm2,kmul(R4p1213,rm3)),kmul(n3,kmadd(R4p1223,rm2,kmul(R4p1323,rm3)))),kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(nn,kmul(rm2,Ro221)),kmadd(nn,kmsub(kmsub(ksub(n1,ltet1),rm2,kmul(ltet2,rm1)),Ro121,kmul(Ro231,kmadd(ltet3,rm2,kmul(ksub(ltet2,n2),rm3)))),kmadd(nn,kmsub(kmsub(ksub(n1,ltet1),rm3,kmul(ltet3,rm1)),Ro131,kmul(Ro311,kmadd(ksub(ltet3,n3),rm1,kmul(ltet1,rm3)))),kmadd(nn,kmsub(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro111),kmadd(kmadd(ksub(ltet3,n3),rm2,kmul(ltet2,rm3)),Ro321,kmul(Ro211,kmadd(ksub(ltet2,n2),rm1,kmul(ltet1,rm2))))),kmul(kmadd(ToReal(-2),ltet3,n3),kmul(nn,kmul(rm3,Ro331)))))))))),kmadd(n2,kmadd(ltet1,kmsub(kmadd(n2,R4p1212,kmul(n3,R4p1213)),rm1,kmul(rm3,kmadd(n3,R4p1323,kmul(n2,R4p1223)))),kmadd(ltet3,knmsub(kmadd(n2,R4p1223,kmul(n1,R4p1213)),rm1,kmadd(n1,kmul(R4p1323,rm3),kmul(n2,kmul(R4p2323,rm3)))),kmadd(ltet2,kmadd(kmsub(n3,R4p1223,kmul(n1,R4p1212)),rm1,kmul(rm3,kmsub(n1,R4p1223,kmul(n3,R4p2323)))),kmul(nn,kmadd(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro112),knmsub(kmadd(ltet2,rm1,kmul(rm2,ksub(ltet1,n1))),Ro122,knmsub(kmadd(ltet3,rm1,kmul(rm3,ksub(ltet1,n1))),Ro132,kmadd(kmsub(ksub(n2,ltet2),rm1,kmul(ltet1,rm2)),Ro212,kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(rm2,Ro222),kmadd(kmsub(ksub(n2,ltet2),rm3,kmul(ltet3,rm2)),Ro232,knmsub(kmadd(ksub(ltet3,n3),rm1,kmul(ltet1,rm3)),Ro312,kmsub(kmadd(ToReal(-2),ltet3,n3),kmul(rm3,Ro332),kmul(Ro322,kmadd(ksub(ltet3,n3),rm2,kmul(ltet2,rm3))))))))))))))),kmsub(n3,kmadd(ltet1,kmadd(n2,kmul(R4p1213,rm1),kmadd(n3,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1223,rm2),kmul(n3,kmul(R4p1323,rm2))))),knmsub(ltet3,kmadd(n1,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1323,rm1),kmadd(n1,kmul(R4p1323,rm2),kmul(n2,kmul(R4p2323,rm2))))),kmadd(ltet2,kmsub(n3,kmadd(R4p1323,rm1,kmul(R4p2323,rm2)),kmul(n1,kmadd(R4p1213,rm1,kmul(R4p1223,rm2)))),kmadd(kmadd(ToReal(-2),ltet2,n2),kmul(nn,kmul(rm2,Ro223)),kmadd(nn,kmsub(kmadd(ToReal(-2),ltet1,n1),kmul(rm1,Ro113),kmadd(kmadd(ltet2,rm1,kmul(rm2,ksub(ltet1,n1))),Ro123,kmadd(kmadd(ltet3,rm1,kmul(rm3,ksub(ltet1,n1))),Ro133,kmadd(kmadd(ltet3,rm2,kmul(rm3,ksub(ltet2,n2))),Ro233,kmul(Ro213,kmadd(ksub(ltet2,n2),rm1,kmul(ltet1,rm2))))))),kmadd(nn,kmul(Ro313,kmsub(ksub(n3,ltet3),rm1,kmul(ltet1,rm3))),kmadd(nn,kmul(Ro323,kmsub(ksub(n3,ltet3),rm2,kmul(ltet2,rm3))),kmul(kmadd(ToReal(-2),ltet3,n3),kmul(nn,kmul(rm3,Ro333)))))))))),kmul(kmadd(ksub(n1,ltet1),kmadd(rm1,Rojo11,kmadd(rm2,Rojo12,kmul(rm3,Rojo13))),kmadd(ksub(n2,ltet2),kmadd(rm1,Rojo21,kmadd(rm2,Rojo22,kmul(rm3,Rojo23))),kmul(kmadd(rm1,Rojo31,kmadd(rm2,Rojo32,kmul(rm3,Rojo33))),ksub(n3,ltet3)))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi3iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(n1,knmsub(im2,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmul(R4p1223,kmsub(ltet3,n2,kmul(ltet2,n3))))),kmsub(im1,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro111)),kmul(im3,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmul(R4p1323,kmsub(ltet3,n2,kmul(ltet2,n3)))))))),kmadd(n2,kmsub(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1223,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro112))))),kmul(im3,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1223,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1323,kmul(R4p2323,kmsub(ltet3,n2,kmul(ltet2,n3))))))),kmadd(n3,kmsub(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1323,kmul(kmsub(ToReal(2),ltet1,n1),kmul(nn,Ro113))))),kmul(im2,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1223,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1323,kmul(R4p2323,kmsub(ltet2,n3,kmul(ltet3,n2))))))),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n1,kmul(nn,Ro121)),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n2,kmul(nn,Ro122)),kmadd(kmadd(im1,ltet2,kmul(im2,ksub(ltet1,n1))),kmul(n3,kmul(nn,Ro123)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n1,kmul(nn,Ro131)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n2,kmul(nn,Ro132)),kmadd(kmadd(im1,ltet3,kmul(im3,ksub(ltet1,n1))),kmul(n3,kmul(nn,Ro133)),kmadd(n1,kmul(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(nn,Ro211)),kmadd(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(n2,kmul(nn,Ro212)),kmadd(kmadd(im2,ltet1,kmul(im1,ksub(ltet2,n2))),kmul(n3,kmul(nn,Ro213)),kmadd(im2,kmul(n1,kmul(kmsub(ToReal(2),ltet2,n2),kmul(nn,Ro221))),kmadd(im2,kmul(kmsub(ToReal(2),ltet2,n2),kmul(n2,kmul(nn,Ro222))),kmadd(im2,kmul(kmsub(ToReal(2),ltet2,n2),kmul(n3,kmul(nn,Ro223))),kmadd(n1,kmul(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(nn,Ro231)),kmadd(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(n2,kmul(nn,Ro232)),kmadd(kmadd(im2,ltet3,kmul(im3,ksub(ltet2,n2))),kmul(n3,kmul(nn,Ro233)),kmadd(n1,kmul(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(nn,Ro311)),kmadd(n2,kmul(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(nn,Ro312)),kmadd(kmadd(im3,ltet1,kmul(im1,ksub(ltet3,n3))),kmul(n3,kmul(nn,Ro313)),kmadd(n1,kmul(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(nn,Ro321)),kmadd(n2,kmul(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(nn,Ro322)),kmadd(kmadd(im3,ltet2,kmul(im2,ksub(ltet3,n3))),kmul(n3,kmul(nn,Ro323)),kmadd(im3,kmul(n1,kmul(kmsub(ToReal(2),ltet3,n3),kmul(nn,Ro331))),kmadd(im3,kmul(n2,kmul(kmsub(ToReal(2),ltet3,n3),kmul(nn,Ro332))),kmadd(im3,kmul(kmsub(ToReal(2),ltet3,n3),kmul(n3,kmul(nn,Ro333))),kmul(kmadd(ksub(n1,ltet1),kmadd(im1,Rojo11,kmadd(im2,Rojo12,kmul(im3,Rojo13))),kmadd(ksub(n2,ltet2),kmadd(im1,Rojo21,kmadd(im2,Rojo22,kmul(im3,Rojo23))),kmul(kmadd(im1,Rojo31,kmadd(im2,Rojo32,kmul(im3,Rojo33))),ksub(n3,ltet3)))),kmul(nn,nn)))))))))))))))))))))))))))));
    
    CCTK_REAL_VEC Psi2rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmadd(ltet2,kmsub(n1,R4p1212,kmul(n3,R4p1223)),kmul(ltet3,kmsub(n1,R4p1213,kmul(n3,R4p1323)))),kmadd(im1,im2,kmul(rm1,rm2)),kmadd(kmsub(ltet1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(ltet3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im1,im2,kmul(rm1,rm2)),kmadd(kmadd(ltet2,kmul(n1,R4p1213),kmadd(ltet2,kmul(n2,R4p1223),kmadd(ltet3,kmul(n1,R4p1313),kmul(ltet3,kmul(n2,R4p1323))))),kmadd(im1,im3,kmul(rm1,rm3)),kmadd(kmadd(ltet1,kmul(n2,R4p1213),kmadd(ltet2,kmul(n2,R4p1223),kmadd(ltet1,kmul(n3,R4p1313),kmul(ltet2,kmul(n3,R4p1323))))),kmadd(im1,im3,kmul(rm1,rm3)),kmadd(knmsub(n1,kmadd(ltet2,R4p1223,kmul(ltet1,R4p1213)),kmadd(ltet1,knmsub(n1,R4p1213,kmsub(n3,R4p1323,kmul(n2,R4p1223))),kmadd(ltet2,kmul(n3,R4p2323),kmul(ltet3,kmadd(n1,R4p1323,kmul(n2,R4p2323)))))),kmadd(im2,im3,kmul(rm2,rm3)),knmsub(kmadd(ltet2,kmul(n2,R4p1212),kmadd(ltet3,kmul(n2,R4p1213),kmadd(ltet2,kmul(n3,R4p1213),kmul(ltet3,kmul(n3,R4p1313))))),kmadd(im1,im1,kmul(rm1,rm1)),knmsub(kmadd(n1,kmsub(ltet1,R4p1212,kmul(ltet3,R4p1223)),kmul(n3,kmsub(ltet3,R4p2323,kmul(ltet1,R4p1223)))),kmadd(im2,im2,kmul(rm2,rm2)),knmsub(kmadd(ltet1,kmul(n1,R4p1313),kmadd(ltet2,kmul(n1,R4p1323),kmadd(ltet1,kmul(n2,R4p1323),kmul(ltet2,kmul(n2,R4p2323))))),kmadd(im3,im3,kmul(rm3,rm3)),kmsub(nn,kmadd(ksub(n2,ltet2),kmul(Ro122,kmadd(im1,im2,kmul(rm1,rm2))),kmadd(kmadd(im1,kmsub(im2,n3,kmul(im3,ltet2)),kmul(rm1,kmsub(n3,rm2,kmul(ltet2,rm3)))),Ro123,kmadd(kmadd(im1,kmsub(im3,n2,kmul(im2,ltet3)),kmul(rm1,kmsub(n2,rm3,kmul(ltet3,rm2)))),Ro132,kmadd(ksub(n3,ltet3),kmul(Ro133,kmadd(im1,im3,kmul(rm1,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro211,kmadd(im1,im2,kmul(rm1,rm2))),kmadd(kmadd(im2,kmsub(im1,n3,kmul(im3,ltet1)),kmul(rm2,kmsub(n3,rm1,kmul(ltet1,rm3)))),Ro213,kmadd(kmadd(im2,kmsub(im3,n1,kmul(im1,ltet3)),kmul(rm2,kmsub(n1,rm3,kmul(ltet3,rm1)))),Ro231,kmadd(ksub(n3,ltet3),kmul(Ro233,kmadd(im2,im3,kmul(rm2,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro311,kmadd(im1,im3,kmul(rm1,rm3))),kmadd(kmadd(im3,kmsub(im1,n2,kmul(im2,ltet1)),kmul(rm3,kmsub(n2,rm1,kmul(ltet1,rm2)))),Ro312,kmadd(kmadd(im3,kmsub(im2,n1,kmul(im1,ltet2)),kmul(rm3,kmsub(n1,rm2,kmul(ltet2,rm1)))),Ro321,kmadd(ksub(n2,ltet2),kmul(Ro322,kmadd(im2,im3,kmul(rm2,rm3))),kmadd(ksub(n1,ltet1),kmul(Ro111,kmadd(im1,im1,kmul(rm1,rm1))),kmadd(Ro121,kmsub(n1,kmadd(im1,im2,kmul(rm1,rm2)),kmul(ltet2,kmadd(im1,im1,kmul(rm1,rm1)))),kmadd(Ro131,kmsub(n1,kmadd(im1,im3,kmul(rm1,rm3)),kmul(ltet3,kmadd(im1,im1,kmul(rm1,rm1)))),kmadd(Ro112,kmsub(n2,kmadd(im1,im1,kmul(rm1,rm1)),kmul(ltet1,kmadd(im1,im2,kmul(rm1,rm2)))),kmadd(Ro113,kmsub(n3,kmadd(im1,im1,kmul(rm1,rm1)),kmul(ltet1,kmadd(im1,im3,kmul(rm1,rm3)))),kmadd(ksub(n2,ltet2),kmul(Ro222,kmadd(im2,im2,kmul(rm2,rm2))),kmadd(Ro212,kmsub(n2,kmadd(im1,im2,kmul(rm1,rm2)),kmul(ltet1,kmadd(im2,im2,kmul(rm2,rm2)))),kmadd(Ro232,kmsub(n2,kmadd(im2,im3,kmul(rm2,rm3)),kmul(ltet3,kmadd(im2,im2,kmul(rm2,rm2)))),kmadd(Ro221,kmsub(n1,kmadd(im2,im2,kmul(rm2,rm2)),kmul(ltet2,kmadd(im1,im2,kmul(rm1,rm2)))),kmadd(Ro223,kmsub(n3,kmadd(im2,im2,kmul(rm2,rm2)),kmul(ltet2,kmadd(im2,im3,kmul(rm2,rm3)))),kmadd(ksub(n3,ltet3),kmul(Ro333,kmadd(im3,im3,kmul(rm3,rm3))),kmadd(Ro313,kmsub(n3,kmadd(im1,im3,kmul(rm1,rm3)),kmul(ltet1,kmadd(im3,im3,kmul(rm3,rm3)))),kmadd(Ro323,kmsub(n3,kmadd(im2,im3,kmul(rm2,rm3)),kmul(ltet2,kmadd(im3,im3,kmul(rm3,rm3)))),kmadd(Ro331,kmsub(n1,kmadd(im3,im3,kmul(rm3,rm3)),kmul(ltet3,kmadd(im1,im3,kmul(rm1,rm3)))),kmul(Ro332,kmsub(n2,kmadd(im3,im3,kmul(rm3,rm3)),kmul(ltet3,kmadd(im2,im3,kmul(rm2,rm3))))))))))))))))))))))))))))))),kmul(kmadd(im2,kmul(im3,Rojo23),kmadd(rm2,kmul(rm3,Rojo23),kmadd(im1,kmadd(im2,kadd(Rojo12,Rojo21),kmul(im3,kadd(Rojo13,Rojo31))),kmadd(rm1,kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31))),kmadd(im2,kmul(im3,Rojo32),kmadd(rm2,kmul(rm3,Rojo32),kmadd(Rojo11,kmul(im1,im1),kmadd(Rojo22,kmul(im2,im2),kmadd(Rojo33,kmul(im3,im3),kmadd(Rojo11,kmul(rm1,rm1),kmadd(Rojo22,kmul(rm2,rm2),kmul(Rojo33,kmul(rm3,rm3))))))))))))),kmul(nn,nn)))))))))));
    
    CCTK_REAL_VEC Psi2iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(knmsub(n1,kmadd(ltet3,R4p1213,kmul(ltet2,R4p1212)),kmadd(ltet1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(R4p1223,kmsub(ltet2,n3,kmul(ltet3,n2))))),kmsub(im2,rm1,kmul(im1,rm2)),kmadd(kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1213,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1313,kmul(R4p1323,kmsub(ltet2,n3,kmul(ltet3,n2))))),kmsub(im3,rm1,kmul(im1,rm3)),kmadd(knmsub(n1,kmadd(ltet2,R4p1223,kmul(ltet1,R4p1213)),kmadd(ltet1,kmadd(n1,R4p1213,kmul(n2,R4p1223)),kmadd(ltet1,kmul(n3,R4p1323),kmsub(ltet2,kmul(n3,R4p2323),kmul(ltet3,kmadd(n1,R4p1323,kmul(n2,R4p2323))))))),kmsub(im3,rm2,kmul(im2,rm3)),kmsub(kmadd(im1,kmadd(rm2,ksub(Rojo21,Rojo12),kmul(rm3,ksub(Rojo31,Rojo13))),kmadd(im3,kmadd(rm1,ksub(Rojo13,Rojo31),kmul(rm2,ksub(Rojo23,Rojo32))),kmul(im2,kmadd(rm1,ksub(Rojo12,Rojo21),kmul(rm3,ksub(Rojo32,Rojo23)))))),kmul(nn,nn),kmul(nn,kmadd(im1,knmsub(rm2,kmadd(kadd(ltet2,n2),Ro122,kmadd(ltet3,Ro132,kmul(n3,Ro123))),knmsub(rm3,kmadd(ltet2,Ro123,kmadd(kadd(ltet3,n3),Ro133,kmul(n2,Ro132))),kmadd(n2,kmul(rm2,Ro212),kmadd(n3,kmul(rm2,Ro213),kmadd(ltet2,kmul(rm2,Ro221),kmadd(ltet3,kmul(rm2,Ro231),kmadd(ltet1,kmadd(rm2,ksub(Ro211,Ro112),kmul(rm3,ksub(Ro311,Ro113))),kmadd(n1,kmadd(rm2,ksub(Ro211,Ro121),kmul(rm3,ksub(Ro311,Ro131))),kmadd(n2,kmul(rm3,Ro312),kmadd(n3,kmul(rm3,Ro313),kmadd(ltet2,kmul(rm3,Ro321),kmul(ltet3,kmul(rm3,Ro331))))))))))))),kmadd(im2,kmadd(rm1,kmadd(n2,ksub(Ro122,Ro212),kmadd(n3,ksub(Ro123,Ro213),kmadd(ltet2,ksub(Ro122,Ro221),kmul(ltet3,ksub(Ro132,Ro231))))),knmsub(rm3,kmadd(ltet2,Ro223,kmadd(kadd(ltet3,n3),Ro233,kmul(n2,Ro232))),kmadd(ltet1,kmadd(rm1,ksub(Ro112,Ro211),kmul(rm3,ksub(Ro312,Ro213))),kmadd(n1,kmadd(rm1,ksub(Ro121,Ro211),kmul(rm3,ksub(Ro321,Ro231))),kmadd(ltet2,kmul(rm3,Ro322),kmadd(n2,kmul(rm3,Ro322),kmadd(n3,kmul(rm3,Ro323),kmul(ltet3,kmul(rm3,Ro332))))))))),kmul(im3,kmadd(ltet1,kmadd(rm1,ksub(Ro113,Ro311),kmul(rm2,ksub(Ro213,Ro312))),kmadd(ltet2,kmadd(rm1,ksub(Ro123,Ro321),kmul(rm2,ksub(Ro223,Ro322))),kmadd(rm1,kmadd(kadd(ltet3,n3),Ro133,kmadd(n1,ksub(Ro131,Ro311),kmsub(n2,ksub(Ro132,Ro312),kmadd(ltet3,Ro331,kmul(n3,Ro313))))),kmul(rm2,kmadd(kadd(ltet3,n3),Ro233,kmadd(n1,ksub(Ro231,Ro321),kmsub(n2,ksub(Ro232,Ro322),kmadd(ltet3,Ro332,kmul(n3,Ro323)))))))))))))))));
    
    CCTK_REAL_VEC Psi1rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ltet1,kmadd(ltet1,kmadd(n2,kmul(R4p1212,rm2),kmadd(n3,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1213,rm3),kmul(n3,kmul(R4p1313,rm3))))),knmsub(ltet3,kmadd(n1,kmul(R4p1213,rm2),kmadd(n2,kmul(R4p1223,rm2),kmadd(n1,kmul(R4p1313,rm3),kmul(n2,kmul(R4p1323,rm3))))),kmadd(ltet2,kmsub(n3,kmadd(R4p1223,rm2,kmul(R4p1323,rm3)),kmul(n1,kmadd(R4p1212,rm2,kmul(R4p1213,rm3)))),kmadd(nn,kmul(Ro121,kmsub(ksub(ltet1,n1),rm2,kmul(n2,rm1))),kmadd(nn,kmul(Ro131,kmsub(ksub(ltet1,n1),rm3,kmul(n3,rm1))),kmadd(nn,kmul(Ro211,kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2))),kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(nn,kmul(rm2,Ro221)),kmadd(nn,kmsub(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro111),kmul(Ro231,kmadd(n3,rm2,kmul(ksub(n2,ltet2),rm3)))),kmadd(nn,kmul(Ro311,kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3))),kmadd(nn,kmul(Ro321,kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3))),kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,kmul(rm3,Ro331))))))))))))),kmadd(ltet2,kmadd(ltet1,knmsub(kmadd(n3,R4p1213,kmul(n2,R4p1212)),rm1,kmadd(n2,kmul(R4p1223,rm3),kmul(n3,kmul(R4p1323,rm3)))),kmadd(ltet3,kmsub(kmadd(n1,R4p1213,kmul(n2,R4p1223)),rm1,kmul(rm3,kmadd(n2,R4p2323,kmul(n1,R4p1323)))),kmadd(ltet2,kmadd(kmsub(n1,R4p1212,kmul(n3,R4p1223)),rm1,kmul(rm3,kmsub(n3,R4p2323,kmul(n1,R4p1223)))),kmul(nn,kmadd(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro112),knmsub(kmadd(n2,rm1,kmul(rm2,ksub(n1,ltet1))),Ro122,knmsub(kmadd(n3,rm1,kmul(rm3,ksub(n1,ltet1))),Ro132,kmadd(kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2)),Ro212,kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(rm2,Ro222),kmadd(kmsub(ksub(ltet2,n2),rm3,kmul(n3,rm2)),Ro232,kmadd(kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3)),Ro312,kmadd(kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3)),Ro322,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(rm3,Ro332)))))))))))))),kmsub(ltet3,knmsub(ltet1,kmadd(n2,kmul(R4p1213,rm1),kmadd(n3,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1223,rm2),kmul(n3,kmul(R4p1323,rm2))))),kmadd(ltet3,kmadd(n1,kmul(R4p1313,rm1),kmadd(n2,kmul(R4p1323,rm1),kmadd(n1,kmul(R4p1323,rm2),kmul(n2,kmul(R4p2323,rm2))))),kmadd(ltet2,kmsub(n1,kmadd(R4p1213,rm1,kmul(R4p1223,rm2)),kmul(n3,kmadd(R4p1323,rm1,kmul(R4p2323,rm2)))),kmadd(nn,kmul(Ro213,kmsub(ksub(ltet2,n2),rm1,kmul(n1,rm2))),kmadd(kmadd(ToReal(-2),n2,ltet2),kmul(nn,kmul(rm2,Ro223)),kmadd(nn,kmsub(kmadd(ToReal(-2),n1,ltet1),kmul(rm1,Ro113),kmadd(kmadd(n2,rm1,kmul(rm2,ksub(n1,ltet1))),Ro123,kmadd(kmadd(n3,rm2,kmul(rm3,ksub(n2,ltet2))),Ro233,kmul(Ro133,kmadd(n3,rm1,kmul(ksub(n1,ltet1),rm3)))))),kmadd(nn,kmul(Ro313,kmsub(ksub(ltet3,n3),rm1,kmul(n1,rm3))),kmadd(nn,kmul(Ro323,kmsub(ksub(ltet3,n3),rm2,kmul(n2,rm3))),kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,kmul(rm3,Ro333))))))))))),kmul(kmadd(ksub(ltet1,n1),kmadd(rm1,Rojo11,kmadd(rm2,Rojo12,kmul(rm3,Rojo13))),kmadd(rm1,kmadd(ksub(ltet2,n2),Rojo21,kmul(Rojo31,ksub(ltet3,n3))),kmadd(rm2,kmadd(ksub(ltet2,n2),Rojo22,kmul(Rojo32,ksub(ltet3,n3))),kmul(rm3,kmadd(ksub(ltet2,n2),Rojo23,kmul(Rojo33,ksub(ltet3,n3))))))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi1iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ltet1,kmadd(im2,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1212,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1213,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p1223,kmul(kmadd(ToReal(-2),n2,ltet2),kmul(nn,Ro221))))),kmadd(nn,kmadd(im1,kmul(Ro111,kmadd(ToReal(-2),n1,ltet1)),kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro121,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro131,knmsub(kmadd(im2,n1,kmul(im1,ksub(n2,ltet2))),Ro211,kmsub(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro231,kmadd(kmadd(im3,n2,kmul(im2,ksub(n3,ltet3))),Ro321,kmul(Ro311,kmadd(im3,n1,kmul(im1,ksub(n3,ltet3)))))))))),kmul(im3,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1213,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1313,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p1323,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,Ro331)))))))),kmadd(ltet2,kmadd(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1212,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1213,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1223,kmul(kmadd(ToReal(-2),n1,ltet1),kmul(nn,Ro112))))),kmadd(nn,kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro122,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro132,kmadd(kmsub(im1,ksub(ltet2,n2),kmul(im2,n1)),Ro212,kmadd(im2,kmul(Ro222,kmadd(ToReal(-2),n2,ltet2)),kmsub(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro232,kmadd(kmadd(im3,n2,kmul(im2,ksub(n3,ltet3))),Ro322,kmul(Ro312,kmadd(im3,n1,kmul(im1,ksub(n3,ltet3)))))))))),kmul(im3,kmadd(kmsub(ltet1,n2,kmul(ltet2,n1)),R4p1223,kmadd(kmsub(ltet1,n3,kmul(ltet3,n1)),R4p1323,kmadd(kmsub(ltet2,n3,kmul(ltet3,n2)),R4p2323,kmul(kmadd(ToReal(-2),n3,ltet3),kmul(nn,Ro332)))))))),kmsub(ltet3,kmadd(im1,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1213,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1313,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p1323,kmul(kmadd(ToReal(-2),n1,ltet1),kmul(nn,Ro113))))),kmadd(im2,kmadd(kmsub(ltet2,n1,kmul(ltet1,n2)),R4p1223,kmadd(kmsub(ltet3,n1,kmul(ltet1,n3)),R4p1323,kmadd(kmsub(ltet3,n2,kmul(ltet2,n3)),R4p2323,kmul(kmadd(ToReal(-2),n2,ltet2),kmul(nn,Ro223))))),kmul(nn,kmadd(kmsub(im2,ksub(ltet1,n1),kmul(im1,n2)),Ro123,kmadd(kmsub(im3,ksub(ltet1,n1),kmul(im1,n3)),Ro133,knmsub(kmadd(im2,n1,kmul(im1,ksub(n2,ltet2))),Ro213,kmadd(kmsub(im3,ksub(ltet2,n2),kmul(im2,n3)),Ro233,kmadd(kmsub(im1,ksub(ltet3,n3),kmul(im3,n1)),Ro313,kmadd(kmsub(im2,ksub(ltet3,n3),kmul(im3,n2)),Ro323,kmul(im3,kmul(Ro333,kmadd(ToReal(-2),n3,ltet3)))))))))))),kmul(kmadd(im1,kmadd(ksub(ltet1,n1),Rojo11,kmadd(ksub(ltet2,n2),Rojo21,kmul(Rojo31,ksub(ltet3,n3)))),kmadd(im2,kmadd(ksub(ltet1,n1),Rojo12,kmadd(ksub(ltet2,n2),Rojo22,kmul(Rojo32,ksub(ltet3,n3)))),kmul(im3,kmadd(ksub(ltet1,n1),Rojo13,kmadd(ksub(ltet2,n2),Rojo23,kmul(Rojo33,ksub(ltet3,n3))))))),kmul(nn,nn)))));
    
    CCTK_REAL_VEC Psi0rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(im1,im2,kmul(rm1,rm2)),kmsub(ltet1,kmadd(ltet2,R4p1212,kmul(ltet3,R4p1213)),kmul(ltet3,kmadd(ltet2,R4p1223,kmul(ltet3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(ltet1,kmsub(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmsub(R4p1213,kmul(ltet1,ltet1),kmul(ltet2,kmul(ltet3,R4p2323)))),kmsub(rm2,rm3,kmul(im2,im3))),kmadd(ToReal(2),kmul(kmadd(ltet1,kmul(ltet2,R4p1213),kmadd(ltet1,kmul(ltet3,R4p1313),kmadd(ltet2,kmul(ltet3,R4p1323),kmul(R4p1223,kmul(ltet2,ltet2))))),kmsub(im1,im3,kmul(rm1,rm3))),knmsub(kmadd(ToReal(2),kmul(ltet2,kmul(ltet3,R4p1213)),kmadd(R4p1212,kmul(ltet2,ltet2),kmul(R4p1313,kmul(ltet3,ltet3)))),kmsub(im1,im1,kmul(rm1,rm1)),knmsub(kmadd(ToReal(-2),kmul(ltet1,kmul(ltet3,R4p1223)),kmadd(R4p1212,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet3,ltet3)))),kmsub(im2,im2,kmul(rm2,rm2)),knmsub(kmul(nn,nn),kmadd(kmsub(im2,im3,kmul(rm2,rm3)),Rojo23,kmadd(im1,kmadd(im2,kadd(Rojo12,Rojo21),kmul(im3,kadd(Rojo13,Rojo31))),knmsub(rm1,kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31))),kmadd(kmsub(im2,im3,kmul(rm2,rm3)),Rojo32,kmadd(Rojo11,kmsub(im1,im1,kmul(rm1,rm1)),kmadd(Rojo22,kmsub(im2,im2,kmul(rm2,rm2)),kmul(Rojo33,kmsub(im3,im3,kmul(rm3,rm3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rm1,rm2,kmul(im1,im2)),kmadd(ltet1,Ro112,kmadd(ltet2,Ro122,kmul(ltet3,Ro132))),kmadd(kmsub(rm1,rm3,kmul(im1,im3)),kmadd(ltet1,Ro113,kmadd(ltet2,Ro123,kmul(ltet3,Ro133))),kmadd(kmsub(rm1,rm2,kmul(im1,im2)),kmadd(ltet1,Ro211,kmadd(ltet2,Ro221,kmul(ltet3,Ro231))),kmadd(kmsub(rm2,rm3,kmul(im2,im3)),kmadd(ltet1,Ro213,kmadd(ltet2,Ro223,kmul(ltet3,Ro233))),kmadd(kmsub(rm1,rm3,kmul(im1,im3)),kmadd(ltet1,Ro311,kmadd(ltet2,Ro321,kmul(ltet3,Ro331))),kmadd(kmsub(rm2,rm3,kmul(im2,im3)),kmadd(ltet1,Ro312,kmadd(ltet2,Ro322,kmul(ltet3,Ro332))),kmadd(kmadd(ltet1,Ro111,kmadd(ltet2,Ro121,kmul(ltet3,Ro131))),kmsub(rm1,rm1,kmul(im1,im1)),kmadd(kmadd(ltet1,Ro212,kmadd(ltet2,Ro222,kmul(ltet3,Ro232))),kmsub(rm2,rm2,kmul(im2,im2)),kmul(kmadd(ltet1,Ro313,kmadd(ltet2,Ro323,kmul(ltet3,Ro333))),kmsub(rm3,rm3,kmul(im3,im3)))))))))))),kmul(kmadd(ToReal(2),kmul(ltet1,kmul(ltet2,R4p1323)),kmadd(R4p1313,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet2,ltet2)))),kmsub(im3,im3,kmul(rm3,rm3))))))))));
    
    CCTK_REAL_VEC Psi0iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(-2),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(ltet1,kmadd(ltet2,R4p1213,kmul(ltet3,R4p1313)),kmadd(ltet2,kmul(ltet3,R4p1323),kmul(R4p1223,kmul(ltet2,ltet2))))),kmadd(ToReal(2),kmadd(kmsub(ltet3,kmadd(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmul(ltet1,kmadd(ltet2,R4p1212,kmul(ltet3,R4p1213)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,kmadd(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(ltet1,kadd(Ro112,Ro211),kmadd(ltet2,kadd(Ro122,Ro221),kmul(ltet3,kadd(Ro132,Ro231)))),kmadd(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(ltet1,kadd(Ro113,Ro311),kmadd(ltet2,kadd(Ro123,Ro321),kmul(ltet3,kadd(Ro133,Ro331)))),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(ltet1,kadd(Ro213,Ro312),kmadd(ltet2,kadd(Ro223,Ro322),kmul(ltet3,kadd(Ro233,Ro332)))),kmul(kmadd(im1,kmul(rm1,kmadd(ltet1,Ro111,kmadd(ltet2,Ro121,kmul(ltet3,Ro131)))),kmadd(im2,kmul(rm2,kmadd(ltet1,Ro212,kmadd(ltet2,Ro222,kmul(ltet3,Ro232)))),kmul(im3,kmul(rm3,kmadd(ltet1,Ro313,kmadd(ltet2,Ro323,kmul(ltet3,Ro333))))))),ToReal(2))))),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(ltet1,kmsub(ltet2,R4p1223,kmul(ltet3,R4p1323)),kmsub(R4p1213,kmul(ltet1,ltet1),kmul(ltet2,kmul(ltet3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(ltet1,kmul(ltet2,R4p1323)),kmadd(R4p1313,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet2,ltet2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(ltet2,kmul(ltet3,R4p1213)),kmadd(R4p1212,kmul(ltet2,ltet2),kmul(R4p1313,kmul(ltet3,ltet3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(ltet1,kmul(ltet3,R4p1223)),kmadd(R4p1212,kmul(ltet1,ltet1),kmul(R4p2323,kmul(ltet3,ltet3))))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(Psi0i[index],Psi0iL);
    vec_store_nta_partial(Psi0r[index],Psi0rL);
    vec_store_nta_partial(Psi1i[index],Psi1iL);
    vec_store_nta_partial(Psi1r[index],Psi1rL);
    vec_store_nta_partial(Psi2i[index],Psi2iL);
    vec_store_nta_partial(Psi2r[index],Psi2rL);
    vec_store_nta_partial(Psi3i[index],Psi3iL);
    vec_store_nta_partial(Psi3r[index],Psi3rL);
    vec_store_nta_partial(Psi4i[index],Psi4iL);
    vec_store_nta_partial(Psi4r[index],Psi4rL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_psis_calc_4th);
}
extern "C" void WeylScal4_psis_calc_4th(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_psis_calc_4th_Body");
  }
  if (cctk_iteration % WeylScal4_psis_calc_4th_calc_every != WeylScal4_psis_calc_4th_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "admbase::curv",
    "admbase::metric",
    "grid::coordinates",
    "WeylScal4::Psi0i_group",
    "WeylScal4::Psi0r_group",
    "WeylScal4::Psi1i_group",
    "WeylScal4::Psi1r_group",
    "WeylScal4::Psi2i_group",
    "WeylScal4::Psi2r_group",
    "WeylScal4::Psi3i_group",
    "WeylScal4::Psi3r_group",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_psis_calc_4th", 13, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_4th", 2, 2, 2);
      break;
    }
    
    case 4:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_4th", 2, 2, 2);
      break;
    }
    
    case 6:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_4th", 2, 2, 2);
      break;
    }
    
    case 8:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psis_calc_4th", 2, 2, 2);
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverInterior(cctkGH, WeylScal4_psis_calc_4th_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_psis_calc_4th_Body");
  }
}

} // namespace WeylScal4

```

RegisterSymmetries.cc:
```
/*  File produced by Kranc */

#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Symmetry.h"

extern "C" void WeylScal4_RegisterSymmetries(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* array holding symmetry definitions */
  int sym[3];
  
  /* Register symmetries of grid functions */
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi0r");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi0i");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi1r");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi1i");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi2r");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi2i");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi3r");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi3i");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi4r");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::Psi4i");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvIr");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvIi");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvJr");
  
  sym[0] = -1;
  sym[1] = -1;
  sym[2] = -1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvJi");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvJ1");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvJ2");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvJ3");
  
  sym[0] = 1;
  sym[1] = 1;
  sym[2] = 1;
  SetCartSymVN(cctkGH, sym, "WeylScal4::curvJ4");
  
}

```

WeylScal4_psi4_calc_4th.cc:
```
/*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {

extern "C" void WeylScal4_psi4_calc_4th_SelectBCs(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (cctk_iteration % WeylScal4_psi4_calc_4th_calc_every != WeylScal4_psi4_calc_4th_calc_offset)
    return;
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4i_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4i_group.");
  ierr = Boundary_SelectGroupForBC(cctkGH, CCTK_ALL_FACES, GetBoundaryWidth(cctkGH), -1 /* no table */, "WeylScal4::Psi4r_group","flat");
  if (ierr < 0)
    CCTK_WARN(CCTK_WARN_ALERT, "Failed to register flat BC for WeylScal4::Psi4r_group.");
  return;
}

static void WeylScal4_psi4_calc_4th_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_psi4_calc_4th,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC gxxL CCTK_ATTRIBUTE_UNUSED = vec_load(gxx[index]);
    CCTK_REAL_VEC gxyL CCTK_ATTRIBUTE_UNUSED = vec_load(gxy[index]);
    CCTK_REAL_VEC gxzL CCTK_ATTRIBUTE_UNUSED = vec_load(gxz[index]);
    CCTK_REAL_VEC gyyL CCTK_ATTRIBUTE_UNUSED = vec_load(gyy[index]);
    CCTK_REAL_VEC gyzL CCTK_ATTRIBUTE_UNUSED = vec_load(gyz[index]);
    CCTK_REAL_VEC gzzL CCTK_ATTRIBUTE_UNUSED = vec_load(gzz[index]);
    CCTK_REAL_VEC kxxL CCTK_ATTRIBUTE_UNUSED = vec_load(kxx[index]);
    CCTK_REAL_VEC kxyL CCTK_ATTRIBUTE_UNUSED = vec_load(kxy[index]);
    CCTK_REAL_VEC kxzL CCTK_ATTRIBUTE_UNUSED = vec_load(kxz[index]);
    CCTK_REAL_VEC kyyL CCTK_ATTRIBUTE_UNUSED = vec_load(kyy[index]);
    CCTK_REAL_VEC kyzL CCTK_ATTRIBUTE_UNUSED = vec_load(kyz[index]);
    CCTK_REAL_VEC kzzL CCTK_ATTRIBUTE_UNUSED = vec_load(kzz[index]);
    CCTK_REAL_VEC xL CCTK_ATTRIBUTE_UNUSED = vec_load(x[index]);
    CCTK_REAL_VEC yL CCTK_ATTRIBUTE_UNUSED = vec_load(y[index]);
    CCTK_REAL_VEC zL CCTK_ATTRIBUTE_UNUSED = vec_load(z[index]);
    
    
    CCTK_REAL_VEC dJ111L, dJ112L, dJ113L, dJ122L, dJ123L, dJ133L, dJ211L, dJ212L, dJ213L, dJ222L, dJ223L, dJ233L, dJ311L, dJ312L, dJ313L, dJ322L, dJ323L, dJ333L, J11L, J12L, J13L, J21L, J22L, J23L, J31L, J32L, J33L CCTK_ATTRIBUTE_UNUSED ;
    
    if (usejacobian)
    {
      dJ111L = vec_load(dJ111[index]);
      dJ112L = vec_load(dJ112[index]);
      dJ113L = vec_load(dJ113[index]);
      dJ122L = vec_load(dJ122[index]);
      dJ123L = vec_load(dJ123[index]);
      dJ133L = vec_load(dJ133[index]);
      dJ211L = vec_load(dJ211[index]);
      dJ212L = vec_load(dJ212[index]);
      dJ213L = vec_load(dJ213[index]);
      dJ222L = vec_load(dJ222[index]);
      dJ223L = vec_load(dJ223[index]);
      dJ233L = vec_load(dJ233[index]);
      dJ311L = vec_load(dJ311[index]);
      dJ312L = vec_load(dJ312[index]);
      dJ313L = vec_load(dJ313[index]);
      dJ322L = vec_load(dJ322[index]);
      dJ323L = vec_load(dJ323[index]);
      dJ333L = vec_load(dJ333[index]);
      J11L = vec_load(J11[index]);
      J12L = vec_load(J12[index]);
      J13L = vec_load(J13[index]);
      J21L = vec_load(J21[index]);
      J22L = vec_load(J22[index]);
      J23L = vec_load(J23[index]);
      J31L = vec_load(J31[index]);
      J32L = vec_load(J32[index]);
      J33L = vec_load(J33[index]);
    }
    /* Include user supplied include files */
    /* Precompute derivatives */
    CCTK_REAL_VEC PDstandard4th1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th33gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th13gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th23gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC PDstandard4th3kzz CCTK_ATTRIBUTE_UNUSED;
    
    switch (fdOrder)
    {
      case 2:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      
      case 4:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      
      case 6:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      
      case 8:
      {
        PDstandard4th1gxx = PDstandard4th1(&gxx[index]);
        PDstandard4th2gxx = PDstandard4th2(&gxx[index]);
        PDstandard4th3gxx = PDstandard4th3(&gxx[index]);
        PDstandard4th11gxx = PDstandard4th11(&gxx[index]);
        PDstandard4th22gxx = PDstandard4th22(&gxx[index]);
        PDstandard4th33gxx = PDstandard4th33(&gxx[index]);
        PDstandard4th12gxx = PDstandard4th12(&gxx[index]);
        PDstandard4th13gxx = PDstandard4th13(&gxx[index]);
        PDstandard4th23gxx = PDstandard4th23(&gxx[index]);
        PDstandard4th1gxy = PDstandard4th1(&gxy[index]);
        PDstandard4th2gxy = PDstandard4th2(&gxy[index]);
        PDstandard4th3gxy = PDstandard4th3(&gxy[index]);
        PDstandard4th11gxy = PDstandard4th11(&gxy[index]);
        PDstandard4th22gxy = PDstandard4th22(&gxy[index]);
        PDstandard4th33gxy = PDstandard4th33(&gxy[index]);
        PDstandard4th12gxy = PDstandard4th12(&gxy[index]);
        PDstandard4th13gxy = PDstandard4th13(&gxy[index]);
        PDstandard4th23gxy = PDstandard4th23(&gxy[index]);
        PDstandard4th1gxz = PDstandard4th1(&gxz[index]);
        PDstandard4th2gxz = PDstandard4th2(&gxz[index]);
        PDstandard4th3gxz = PDstandard4th3(&gxz[index]);
        PDstandard4th11gxz = PDstandard4th11(&gxz[index]);
        PDstandard4th22gxz = PDstandard4th22(&gxz[index]);
        PDstandard4th33gxz = PDstandard4th33(&gxz[index]);
        PDstandard4th12gxz = PDstandard4th12(&gxz[index]);
        PDstandard4th13gxz = PDstandard4th13(&gxz[index]);
        PDstandard4th23gxz = PDstandard4th23(&gxz[index]);
        PDstandard4th1gyy = PDstandard4th1(&gyy[index]);
        PDstandard4th2gyy = PDstandard4th2(&gyy[index]);
        PDstandard4th3gyy = PDstandard4th3(&gyy[index]);
        PDstandard4th11gyy = PDstandard4th11(&gyy[index]);
        PDstandard4th22gyy = PDstandard4th22(&gyy[index]);
        PDstandard4th33gyy = PDstandard4th33(&gyy[index]);
        PDstandard4th12gyy = PDstandard4th12(&gyy[index]);
        PDstandard4th13gyy = PDstandard4th13(&gyy[index]);
        PDstandard4th23gyy = PDstandard4th23(&gyy[index]);
        PDstandard4th1gyz = PDstandard4th1(&gyz[index]);
        PDstandard4th2gyz = PDstandard4th2(&gyz[index]);
        PDstandard4th3gyz = PDstandard4th3(&gyz[index]);
        PDstandard4th11gyz = PDstandard4th11(&gyz[index]);
        PDstandard4th22gyz = PDstandard4th22(&gyz[index]);
        PDstandard4th33gyz = PDstandard4th33(&gyz[index]);
        PDstandard4th12gyz = PDstandard4th12(&gyz[index]);
        PDstandard4th13gyz = PDstandard4th13(&gyz[index]);
        PDstandard4th23gyz = PDstandard4th23(&gyz[index]);
        PDstandard4th1gzz = PDstandard4th1(&gzz[index]);
        PDstandard4th2gzz = PDstandard4th2(&gzz[index]);
        PDstandard4th3gzz = PDstandard4th3(&gzz[index]);
        PDstandard4th11gzz = PDstandard4th11(&gzz[index]);
        PDstandard4th22gzz = PDstandard4th22(&gzz[index]);
        PDstandard4th33gzz = PDstandard4th33(&gzz[index]);
        PDstandard4th12gzz = PDstandard4th12(&gzz[index]);
        PDstandard4th13gzz = PDstandard4th13(&gzz[index]);
        PDstandard4th23gzz = PDstandard4th23(&gzz[index]);
        PDstandard4th1kxx = PDstandard4th1(&kxx[index]);
        PDstandard4th2kxx = PDstandard4th2(&kxx[index]);
        PDstandard4th3kxx = PDstandard4th3(&kxx[index]);
        PDstandard4th1kxy = PDstandard4th1(&kxy[index]);
        PDstandard4th2kxy = PDstandard4th2(&kxy[index]);
        PDstandard4th3kxy = PDstandard4th3(&kxy[index]);
        PDstandard4th1kxz = PDstandard4th1(&kxz[index]);
        PDstandard4th2kxz = PDstandard4th2(&kxz[index]);
        PDstandard4th3kxz = PDstandard4th3(&kxz[index]);
        PDstandard4th1kyy = PDstandard4th1(&kyy[index]);
        PDstandard4th2kyy = PDstandard4th2(&kyy[index]);
        PDstandard4th3kyy = PDstandard4th3(&kyy[index]);
        PDstandard4th1kyz = PDstandard4th1(&kyz[index]);
        PDstandard4th2kyz = PDstandard4th2(&kyz[index]);
        PDstandard4th3kyz = PDstandard4th3(&kyz[index]);
        PDstandard4th1kzz = PDstandard4th1(&kzz[index]);
        PDstandard4th2kzz = PDstandard4th2(&kzz[index]);
        PDstandard4th3kzz = PDstandard4th3(&kzz[index]);
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC JacPDstandard4th11gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th11gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th11gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th12gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th13gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th1kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th21gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th22gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th22gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th22gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th23gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th2kzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th31gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th32gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th33gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th33gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th33gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gyz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3gzz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kxx CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kxy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kxz CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kyy CCTK_ATTRIBUTE_UNUSED;
    CCTK_REAL_VEC JacPDstandard4th3kyz CCTK_ATTRIBUTE_UNUSED;
    
    if (usejacobian)
    {
      JacPDstandard4th1gxx = 
        kmadd(J11L,PDstandard4th1gxx,kmadd(J21L,PDstandard4th2gxx,kmul(J31L,PDstandard4th3gxx)));
      
      JacPDstandard4th1gxy = 
        kmadd(J11L,PDstandard4th1gxy,kmadd(J21L,PDstandard4th2gxy,kmul(J31L,PDstandard4th3gxy)));
      
      JacPDstandard4th1gxz = 
        kmadd(J11L,PDstandard4th1gxz,kmadd(J21L,PDstandard4th2gxz,kmul(J31L,PDstandard4th3gxz)));
      
      JacPDstandard4th1gyy = 
        kmadd(J11L,PDstandard4th1gyy,kmadd(J21L,PDstandard4th2gyy,kmul(J31L,PDstandard4th3gyy)));
      
      JacPDstandard4th1gyz = 
        kmadd(J11L,PDstandard4th1gyz,kmadd(J21L,PDstandard4th2gyz,kmul(J31L,PDstandard4th3gyz)));
      
      JacPDstandard4th1gzz = 
        kmadd(J11L,PDstandard4th1gzz,kmadd(J21L,PDstandard4th2gzz,kmul(J31L,PDstandard4th3gzz)));
      
      JacPDstandard4th1kxy = 
        kmadd(J11L,PDstandard4th1kxy,kmadd(J21L,PDstandard4th2kxy,kmul(J31L,PDstandard4th3kxy)));
      
      JacPDstandard4th1kxz = 
        kmadd(J11L,PDstandard4th1kxz,kmadd(J21L,PDstandard4th2kxz,kmul(J31L,PDstandard4th3kxz)));
      
      JacPDstandard4th1kyy = 
        kmadd(J11L,PDstandard4th1kyy,kmadd(J21L,PDstandard4th2kyy,kmul(J31L,PDstandard4th3kyy)));
      
      JacPDstandard4th1kyz = 
        kmadd(J11L,PDstandard4th1kyz,kmadd(J21L,PDstandard4th2kyz,kmul(J31L,PDstandard4th3kyz)));
      
      JacPDstandard4th1kzz = 
        kmadd(J11L,PDstandard4th1kzz,kmadd(J21L,PDstandard4th2kzz,kmul(J31L,PDstandard4th3kzz)));
      
      JacPDstandard4th2gxx = 
        kmadd(J12L,PDstandard4th1gxx,kmadd(J22L,PDstandard4th2gxx,kmul(J32L,PDstandard4th3gxx)));
      
      JacPDstandard4th2gxy = 
        kmadd(J12L,PDstandard4th1gxy,kmadd(J22L,PDstandard4th2gxy,kmul(J32L,PDstandard4th3gxy)));
      
      JacPDstandard4th2gxz = 
        kmadd(J12L,PDstandard4th1gxz,kmadd(J22L,PDstandard4th2gxz,kmul(J32L,PDstandard4th3gxz)));
      
      JacPDstandard4th2gyy = 
        kmadd(J12L,PDstandard4th1gyy,kmadd(J22L,PDstandard4th2gyy,kmul(J32L,PDstandard4th3gyy)));
      
      JacPDstandard4th2gyz = 
        kmadd(J12L,PDstandard4th1gyz,kmadd(J22L,PDstandard4th2gyz,kmul(J32L,PDstandard4th3gyz)));
      
      JacPDstandard4th2gzz = 
        kmadd(J12L,PDstandard4th1gzz,kmadd(J22L,PDstandard4th2gzz,kmul(J32L,PDstandard4th3gzz)));
      
      JacPDstandard4th2kxx = 
        kmadd(J12L,PDstandard4th1kxx,kmadd(J22L,PDstandard4th2kxx,kmul(J32L,PDstandard4th3kxx)));
      
      JacPDstandard4th2kxy = 
        kmadd(J12L,PDstandard4th1kxy,kmadd(J22L,PDstandard4th2kxy,kmul(J32L,PDstandard4th3kxy)));
      
      JacPDstandard4th2kxz = 
        kmadd(J12L,PDstandard4th1kxz,kmadd(J22L,PDstandard4th2kxz,kmul(J32L,PDstandard4th3kxz)));
      
      JacPDstandard4th2kyz = 
        kmadd(J12L,PDstandard4th1kyz,kmadd(J22L,PDstandard4th2kyz,kmul(J32L,PDstandard4th3kyz)));
      
      JacPDstandard4th2kzz = 
        kmadd(J12L,PDstandard4th1kzz,kmadd(J22L,PDstandard4th2kzz,kmul(J32L,PDstandard4th3kzz)));
      
      JacPDstandard4th3gxx = 
        kmadd(J13L,PDstandard4th1gxx,kmadd(J23L,PDstandard4th2gxx,kmul(J33L,PDstandard4th3gxx)));
      
      JacPDstandard4th3gxy = 
        kmadd(J13L,PDstandard4th1gxy,kmadd(J23L,PDstandard4th2gxy,kmul(J33L,PDstandard4th3gxy)));
      
      JacPDstandard4th3gxz = 
        kmadd(J13L,PDstandard4th1gxz,kmadd(J23L,PDstandard4th2gxz,kmul(J33L,PDstandard4th3gxz)));
      
      JacPDstandard4th3gyy = 
        kmadd(J13L,PDstandard4th1gyy,kmadd(J23L,PDstandard4th2gyy,kmul(J33L,PDstandard4th3gyy)));
      
      JacPDstandard4th3gyz = 
        kmadd(J13L,PDstandard4th1gyz,kmadd(J23L,PDstandard4th2gyz,kmul(J33L,PDstandard4th3gyz)));
      
      JacPDstandard4th3gzz = 
        kmadd(J13L,PDstandard4th1gzz,kmadd(J23L,PDstandard4th2gzz,kmul(J33L,PDstandard4th3gzz)));
      
      JacPDstandard4th3kxx = 
        kmadd(J13L,PDstandard4th1kxx,kmadd(J23L,PDstandard4th2kxx,kmul(J33L,PDstandard4th3kxx)));
      
      JacPDstandard4th3kxy = 
        kmadd(J13L,PDstandard4th1kxy,kmadd(J23L,PDstandard4th2kxy,kmul(J33L,PDstandard4th3kxy)));
      
      JacPDstandard4th3kxz = 
        kmadd(J13L,PDstandard4th1kxz,kmadd(J23L,PDstandard4th2kxz,kmul(J33L,PDstandard4th3kxz)));
      
      JacPDstandard4th3kyy = 
        kmadd(J13L,PDstandard4th1kyy,kmadd(J23L,PDstandard4th2kyy,kmul(J33L,PDstandard4th3kyy)));
      
      JacPDstandard4th3kyz = 
        kmadd(J13L,PDstandard4th1kyz,kmadd(J23L,PDstandard4th2kyz,kmul(J33L,PDstandard4th3kyz)));
      
      JacPDstandard4th11gyy = 
        kmadd(dJ111L,PDstandard4th1gyy,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard4th12gyy,kmul(J31L,PDstandard4th13gyy)),kmul(J21L,kmul(J31L,PDstandard4th23gyy))),kmadd(dJ211L,PDstandard4th2gyy,kmadd(dJ311L,PDstandard4th3gyy,kmadd(PDstandard4th11gyy,kmul(J11L,J11L),kmadd(PDstandard4th22gyy,kmul(J21L,J21L),kmul(PDstandard4th33gyy,kmul(J31L,J31L))))))));
      
      JacPDstandard4th11gyz = 
        kmadd(dJ111L,PDstandard4th1gyz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard4th12gyz,kmul(J31L,PDstandard4th13gyz)),kmul(J21L,kmul(J31L,PDstandard4th23gyz))),kmadd(dJ211L,PDstandard4th2gyz,kmadd(dJ311L,PDstandard4th3gyz,kmadd(PDstandard4th11gyz,kmul(J11L,J11L),kmadd(PDstandard4th22gyz,kmul(J21L,J21L),kmul(PDstandard4th33gyz,kmul(J31L,J31L))))))));
      
      JacPDstandard4th11gzz = 
        kmadd(dJ111L,PDstandard4th1gzz,kmadd(ToReal(2),kmadd(J11L,kmadd(J21L,PDstandard4th12gzz,kmul(J31L,PDstandard4th13gzz)),kmul(J21L,kmul(J31L,PDstandard4th23gzz))),kmadd(dJ211L,PDstandard4th2gzz,kmadd(dJ311L,PDstandard4th3gzz,kmadd(PDstandard4th11gzz,kmul(J11L,J11L),kmadd(PDstandard4th22gzz,kmul(J21L,J21L),kmul(PDstandard4th33gzz,kmul(J31L,J31L))))))));
      
      JacPDstandard4th22gxx = 
        kmadd(dJ122L,PDstandard4th1gxx,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard4th12gxx,kmul(J32L,PDstandard4th13gxx)),kmul(J22L,kmul(J32L,PDstandard4th23gxx))),kmadd(dJ222L,PDstandard4th2gxx,kmadd(dJ322L,PDstandard4th3gxx,kmadd(PDstandard4th11gxx,kmul(J12L,J12L),kmadd(PDstandard4th22gxx,kmul(J22L,J22L),kmul(PDstandard4th33gxx,kmul(J32L,J32L))))))));
      
      JacPDstandard4th22gxz = 
        kmadd(dJ122L,PDstandard4th1gxz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard4th12gxz,kmul(J32L,PDstandard4th13gxz)),kmul(J22L,kmul(J32L,PDstandard4th23gxz))),kmadd(dJ222L,PDstandard4th2gxz,kmadd(dJ322L,PDstandard4th3gxz,kmadd(PDstandard4th11gxz,kmul(J12L,J12L),kmadd(PDstandard4th22gxz,kmul(J22L,J22L),kmul(PDstandard4th33gxz,kmul(J32L,J32L))))))));
      
      JacPDstandard4th22gzz = 
        kmadd(dJ122L,PDstandard4th1gzz,kmadd(ToReal(2),kmadd(J12L,kmadd(J22L,PDstandard4th12gzz,kmul(J32L,PDstandard4th13gzz)),kmul(J22L,kmul(J32L,PDstandard4th23gzz))),kmadd(dJ222L,PDstandard4th2gzz,kmadd(dJ322L,PDstandard4th3gzz,kmadd(PDstandard4th11gzz,kmul(J12L,J12L),kmadd(PDstandard4th22gzz,kmul(J22L,J22L),kmul(PDstandard4th33gzz,kmul(J32L,J32L))))))));
      
      JacPDstandard4th33gxx = 
        kmadd(dJ133L,PDstandard4th1gxx,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard4th12gxx,kmul(J33L,PDstandard4th13gxx)),kmul(J23L,kmul(J33L,PDstandard4th23gxx))),kmadd(dJ233L,PDstandard4th2gxx,kmadd(dJ333L,PDstandard4th3gxx,kmadd(PDstandard4th11gxx,kmul(J13L,J13L),kmadd(PDstandard4th22gxx,kmul(J23L,J23L),kmul(PDstandard4th33gxx,kmul(J33L,J33L))))))));
      
      JacPDstandard4th33gxy = 
        kmadd(dJ133L,PDstandard4th1gxy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard4th12gxy,kmul(J33L,PDstandard4th13gxy)),kmul(J23L,kmul(J33L,PDstandard4th23gxy))),kmadd(dJ233L,PDstandard4th2gxy,kmadd(dJ333L,PDstandard4th3gxy,kmadd(PDstandard4th11gxy,kmul(J13L,J13L),kmadd(PDstandard4th22gxy,kmul(J23L,J23L),kmul(PDstandard4th33gxy,kmul(J33L,J33L))))))));
      
      JacPDstandard4th33gyy = 
        kmadd(dJ133L,PDstandard4th1gyy,kmadd(ToReal(2),kmadd(J13L,kmadd(J23L,PDstandard4th12gyy,kmul(J33L,PDstandard4th13gyy)),kmul(J23L,kmul(J33L,PDstandard4th23gyy))),kmadd(dJ233L,PDstandard4th2gyy,kmadd(dJ333L,PDstandard4th3gyy,kmadd(PDstandard4th11gyy,kmul(J13L,J13L),kmadd(PDstandard4th22gyy,kmul(J23L,J23L),kmul(PDstandard4th33gyy,kmul(J33L,J33L))))))));
      
      JacPDstandard4th12gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gxy,kmadd(J21L,PDstandard4th12gxy,kmul(J31L,PDstandard4th13gxy))),kmadd(J11L,kmadd(J22L,PDstandard4th12gxy,kmul(J32L,PDstandard4th13gxy)),kmadd(dJ112L,PDstandard4th1gxy,kmadd(J22L,kmadd(J21L,PDstandard4th22gxy,kmul(J31L,PDstandard4th23gxy)),kmadd(dJ212L,PDstandard4th2gxy,kmadd(J32L,kmadd(J21L,PDstandard4th23gxy,kmul(J31L,PDstandard4th33gxy)),kmul(dJ312L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th12gxz = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gxz,kmadd(J21L,PDstandard4th12gxz,kmul(J31L,PDstandard4th13gxz))),kmadd(J11L,kmadd(J22L,PDstandard4th12gxz,kmul(J32L,PDstandard4th13gxz)),kmadd(dJ112L,PDstandard4th1gxz,kmadd(J22L,kmadd(J21L,PDstandard4th22gxz,kmul(J31L,PDstandard4th23gxz)),kmadd(dJ212L,PDstandard4th2gxz,kmadd(J32L,kmadd(J21L,PDstandard4th23gxz,kmul(J31L,PDstandard4th33gxz)),kmul(dJ312L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th12gyz = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gyz,kmadd(J21L,PDstandard4th12gyz,kmul(J31L,PDstandard4th13gyz))),kmadd(J11L,kmadd(J22L,PDstandard4th12gyz,kmul(J32L,PDstandard4th13gyz)),kmadd(dJ112L,PDstandard4th1gyz,kmadd(J22L,kmadd(J21L,PDstandard4th22gyz,kmul(J31L,PDstandard4th23gyz)),kmadd(dJ212L,PDstandard4th2gyz,kmadd(J32L,kmadd(J21L,PDstandard4th23gyz,kmul(J31L,PDstandard4th33gyz)),kmul(dJ312L,PDstandard4th3gyz)))))));
      
      JacPDstandard4th12gzz = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gzz,kmadd(J21L,PDstandard4th12gzz,kmul(J31L,PDstandard4th13gzz))),kmadd(J11L,kmadd(J22L,PDstandard4th12gzz,kmul(J32L,PDstandard4th13gzz)),kmadd(dJ112L,PDstandard4th1gzz,kmadd(J22L,kmadd(J21L,PDstandard4th22gzz,kmul(J31L,PDstandard4th23gzz)),kmadd(dJ212L,PDstandard4th2gzz,kmadd(J32L,kmadd(J21L,PDstandard4th23gzz,kmul(J31L,PDstandard4th33gzz)),kmul(dJ312L,PDstandard4th3gzz)))))));
      
      JacPDstandard4th13gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gxz,kmadd(J21L,PDstandard4th12gxz,kmul(J31L,PDstandard4th13gxz))),kmadd(J11L,kmadd(J23L,PDstandard4th12gxz,kmul(J33L,PDstandard4th13gxz)),kmadd(dJ113L,PDstandard4th1gxz,kmadd(J23L,kmadd(J21L,PDstandard4th22gxz,kmul(J31L,PDstandard4th23gxz)),kmadd(dJ213L,PDstandard4th2gxz,kmadd(J33L,kmadd(J21L,PDstandard4th23gxz,kmul(J31L,PDstandard4th33gxz)),kmul(dJ313L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th21gxy = 
        kmadd(J12L,kmadd(J11L,PDstandard4th11gxy,kmadd(J21L,PDstandard4th12gxy,kmul(J31L,PDstandard4th13gxy))),kmadd(J11L,kmadd(J22L,PDstandard4th12gxy,kmul(J32L,PDstandard4th13gxy)),kmadd(dJ112L,PDstandard4th1gxy,kmadd(J22L,kmadd(J21L,PDstandard4th22gxy,kmul(J31L,PDstandard4th23gxy)),kmadd(dJ212L,PDstandard4th2gxy,kmadd(J32L,kmadd(J21L,PDstandard4th23gxy,kmul(J31L,PDstandard4th33gxy)),kmul(dJ312L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th23gxx = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gxx,kmadd(J22L,PDstandard4th12gxx,kmul(J32L,PDstandard4th13gxx))),kmadd(J12L,kmadd(J23L,PDstandard4th12gxx,kmul(J33L,PDstandard4th13gxx)),kmadd(dJ123L,PDstandard4th1gxx,kmadd(J23L,kmadd(J22L,PDstandard4th22gxx,kmul(J32L,PDstandard4th23gxx)),kmadd(dJ223L,PDstandard4th2gxx,kmadd(J33L,kmadd(J22L,PDstandard4th23gxx,kmul(J32L,PDstandard4th33gxx)),kmul(dJ323L,PDstandard4th3gxx)))))));
      
      JacPDstandard4th23gxy = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gxy,kmadd(J22L,PDstandard4th12gxy,kmul(J32L,PDstandard4th13gxy))),kmadd(J12L,kmadd(J23L,PDstandard4th12gxy,kmul(J33L,PDstandard4th13gxy)),kmadd(dJ123L,PDstandard4th1gxy,kmadd(J23L,kmadd(J22L,PDstandard4th22gxy,kmul(J32L,PDstandard4th23gxy)),kmadd(dJ223L,PDstandard4th2gxy,kmadd(J33L,kmadd(J22L,PDstandard4th23gxy,kmul(J32L,PDstandard4th33gxy)),kmul(dJ323L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th23gxz = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gxz,kmadd(J22L,PDstandard4th12gxz,kmul(J32L,PDstandard4th13gxz))),kmadd(J12L,kmadd(J23L,PDstandard4th12gxz,kmul(J33L,PDstandard4th13gxz)),kmadd(dJ123L,PDstandard4th1gxz,kmadd(J23L,kmadd(J22L,PDstandard4th22gxz,kmul(J32L,PDstandard4th23gxz)),kmadd(dJ223L,PDstandard4th2gxz,kmadd(J33L,kmadd(J22L,PDstandard4th23gxz,kmul(J32L,PDstandard4th33gxz)),kmul(dJ323L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th23gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gyz,kmadd(J22L,PDstandard4th12gyz,kmul(J32L,PDstandard4th13gyz))),kmadd(J12L,kmadd(J23L,PDstandard4th12gyz,kmul(J33L,PDstandard4th13gyz)),kmadd(dJ123L,PDstandard4th1gyz,kmadd(J23L,kmadd(J22L,PDstandard4th22gyz,kmul(J32L,PDstandard4th23gyz)),kmadd(dJ223L,PDstandard4th2gyz,kmadd(J33L,kmadd(J22L,PDstandard4th23gyz,kmul(J32L,PDstandard4th33gyz)),kmul(dJ323L,PDstandard4th3gyz)))))));
      
      JacPDstandard4th31gxy = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gxy,kmadd(J21L,PDstandard4th12gxy,kmul(J31L,PDstandard4th13gxy))),kmadd(J11L,kmadd(J23L,PDstandard4th12gxy,kmul(J33L,PDstandard4th13gxy)),kmadd(dJ113L,PDstandard4th1gxy,kmadd(J23L,kmadd(J21L,PDstandard4th22gxy,kmul(J31L,PDstandard4th23gxy)),kmadd(dJ213L,PDstandard4th2gxy,kmadd(J33L,kmadd(J21L,PDstandard4th23gxy,kmul(J31L,PDstandard4th33gxy)),kmul(dJ313L,PDstandard4th3gxy)))))));
      
      JacPDstandard4th31gxz = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gxz,kmadd(J21L,PDstandard4th12gxz,kmul(J31L,PDstandard4th13gxz))),kmadd(J11L,kmadd(J23L,PDstandard4th12gxz,kmul(J33L,PDstandard4th13gxz)),kmadd(dJ113L,PDstandard4th1gxz,kmadd(J23L,kmadd(J21L,PDstandard4th22gxz,kmul(J31L,PDstandard4th23gxz)),kmadd(dJ213L,PDstandard4th2gxz,kmadd(J33L,kmadd(J21L,PDstandard4th23gxz,kmul(J31L,PDstandard4th33gxz)),kmul(dJ313L,PDstandard4th3gxz)))))));
      
      JacPDstandard4th31gyy = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gyy,kmadd(J21L,PDstandard4th12gyy,kmul(J31L,PDstandard4th13gyy))),kmadd(J11L,kmadd(J23L,PDstandard4th12gyy,kmul(J33L,PDstandard4th13gyy)),kmadd(dJ113L,PDstandard4th1gyy,kmadd(J23L,kmadd(J21L,PDstandard4th22gyy,kmul(J31L,PDstandard4th23gyy)),kmadd(dJ213L,PDstandard4th2gyy,kmadd(J33L,kmadd(J21L,PDstandard4th23gyy,kmul(J31L,PDstandard4th33gyy)),kmul(dJ313L,PDstandard4th3gyy)))))));
      
      JacPDstandard4th31gyz = 
        kmadd(J13L,kmadd(J11L,PDstandard4th11gyz,kmadd(J21L,PDstandard4th12gyz,kmul(J31L,PDstandard4th13gyz))),kmadd(J11L,kmadd(J23L,PDstandard4th12gyz,kmul(J33L,PDstandard4th13gyz)),kmadd(dJ113L,PDstandard4th1gyz,kmadd(J23L,kmadd(J21L,PDstandard4th22gyz,kmul(J31L,PDstandard4th23gyz)),kmadd(dJ213L,PDstandard4th2gyz,kmadd(J33L,kmadd(J21L,PDstandard4th23gyz,kmul(J31L,PDstandard4th33gyz)),kmul(dJ313L,PDstandard4th3gyz)))))));
      
      JacPDstandard4th32gyz = 
        kmadd(J13L,kmadd(J12L,PDstandard4th11gyz,kmadd(J22L,PDstandard4th12gyz,kmul(J32L,PDstandard4th13gyz))),kmadd(J12L,kmadd(J23L,PDstandard4th12gyz,kmul(J33L,PDstandard4th13gyz)),kmadd(dJ123L,PDstandard4th1gyz,kmadd(J23L,kmadd(J22L,PDstandard4th22gyz,kmul(J32L,PDstandard4th23gyz)),kmadd(dJ223L,PDstandard4th2gyz,kmadd(J33L,kmadd(J22L,PDstandard4th23gyz,kmul(J32L,PDstandard4th33gyz)),kmul(dJ323L,PDstandard4th3gyz)))))));
    }
    else
    {
      JacPDstandard4th1gxx = PDstandard4th1gxx;
      
      JacPDstandard4th1gxy = PDstandard4th1gxy;
      
      JacPDstandard4th1gxz = PDstandard4th1gxz;
      
      JacPDstandard4th1gyy = PDstandard4th1gyy;
      
      JacPDstandard4th1gyz = PDstandard4th1gyz;
      
      JacPDstandard4th1gzz = PDstandard4th1gzz;
      
      JacPDstandard4th1kxy = PDstandard4th1kxy;
      
      JacPDstandard4th1kxz = PDstandard4th1kxz;
      
      JacPDstandard4th1kyy = PDstandard4th1kyy;
      
      JacPDstandard4th1kyz = PDstandard4th1kyz;
      
      JacPDstandard4th1kzz = PDstandard4th1kzz;
      
      JacPDstandard4th2gxx = PDstandard4th2gxx;
      
      JacPDstandard4th2gxy = PDstandard4th2gxy;
      
      JacPDstandard4th2gxz = PDstandard4th2gxz;
      
      JacPDstandard4th2gyy = PDstandard4th2gyy;
      
      JacPDstandard4th2gyz = PDstandard4th2gyz;
      
      JacPDstandard4th2gzz = PDstandard4th2gzz;
      
      JacPDstandard4th2kxx = PDstandard4th2kxx;
      
      JacPDstandard4th2kxy = PDstandard4th2kxy;
      
      JacPDstandard4th2kxz = PDstandard4th2kxz;
      
      JacPDstandard4th2kyz = PDstandard4th2kyz;
      
      JacPDstandard4th2kzz = PDstandard4th2kzz;
      
      JacPDstandard4th3gxx = PDstandard4th3gxx;
      
      JacPDstandard4th3gxy = PDstandard4th3gxy;
      
      JacPDstandard4th3gxz = PDstandard4th3gxz;
      
      JacPDstandard4th3gyy = PDstandard4th3gyy;
      
      JacPDstandard4th3gyz = PDstandard4th3gyz;
      
      JacPDstandard4th3gzz = PDstandard4th3gzz;
      
      JacPDstandard4th3kxx = PDstandard4th3kxx;
      
      JacPDstandard4th3kxy = PDstandard4th3kxy;
      
      JacPDstandard4th3kxz = PDstandard4th3kxz;
      
      JacPDstandard4th3kyy = PDstandard4th3kyy;
      
      JacPDstandard4th3kyz = PDstandard4th3kyz;
      
      JacPDstandard4th11gyy = PDstandard4th11gyy;
      
      JacPDstandard4th11gyz = PDstandard4th11gyz;
      
      JacPDstandard4th11gzz = PDstandard4th11gzz;
      
      JacPDstandard4th22gxx = PDstandard4th22gxx;
      
      JacPDstandard4th22gxz = PDstandard4th22gxz;
      
      JacPDstandard4th22gzz = PDstandard4th22gzz;
      
      JacPDstandard4th33gxx = PDstandard4th33gxx;
      
      JacPDstandard4th33gxy = PDstandard4th33gxy;
      
      JacPDstandard4th33gyy = PDstandard4th33gyy;
      
      JacPDstandard4th12gxy = PDstandard4th12gxy;
      
      JacPDstandard4th12gxz = PDstandard4th12gxz;
      
      JacPDstandard4th12gyz = PDstandard4th12gyz;
      
      JacPDstandard4th12gzz = PDstandard4th12gzz;
      
      JacPDstandard4th13gxz = PDstandard4th13gxz;
      
      JacPDstandard4th21gxy = PDstandard4th12gxy;
      
      JacPDstandard4th23gxx = PDstandard4th23gxx;
      
      JacPDstandard4th23gxy = PDstandard4th23gxy;
      
      JacPDstandard4th23gxz = PDstandard4th23gxz;
      
      JacPDstandard4th23gyz = PDstandard4th23gyz;
      
      JacPDstandard4th31gxy = PDstandard4th13gxy;
      
      JacPDstandard4th31gxz = PDstandard4th13gxz;
      
      JacPDstandard4th31gyy = PDstandard4th13gyy;
      
      JacPDstandard4th31gyz = PDstandard4th13gyz;
      
      JacPDstandard4th32gyz = PDstandard4th23gyz;
    }
    
    CCTK_REAL_VEC detg CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(gxyL,kmul(gxzL,gyzL)),knmsub(gzzL,kmul(gxyL,gxyL),kmsub(gyyL,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)),kmul(gxxL,kmul(gyzL,gyzL)))));
    
    CCTK_REAL_VEC invdetg CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),detg);
    
    CCTK_REAL_VEC gInv11 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gyyL,gzzL,kmul(gyzL,gyzL)));
    
    CCTK_REAL_VEC gInv12 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv13 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv21 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxzL,gyzL,kmul(gxyL,gzzL)));
    
    CCTK_REAL_VEC gInv22 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gzzL,kmul(gxzL,gxzL)));
    
    CCTK_REAL_VEC gInv23 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv31 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gyzL,kmul(gxzL,gyyL)));
    
    CCTK_REAL_VEC gInv32 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxyL,gxzL,kmul(gxxL,gyzL)));
    
    CCTK_REAL_VEC gInv33 CCTK_ATTRIBUTE_UNUSED = 
      kmul(invdetg,kmsub(gxxL,gyyL,kmul(gxyL,gxyL)));
    
    CCTK_REAL_VEC gamma111 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,JacPDstandard4th1gxx,kmsub(ToReal(2),kmadd(gInv12,JacPDstandard4th1gxy,kmul(gInv13,JacPDstandard4th1gxz)),kmadd(gInv13,JacPDstandard4th3gxx,kmul(gInv12,JacPDstandard4th2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma211 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,JacPDstandard4th1gxx,kmsub(ToReal(2),kmadd(gInv22,JacPDstandard4th1gxy,kmul(gInv23,JacPDstandard4th1gxz)),kmadd(gInv23,JacPDstandard4th3gxx,kmul(gInv22,JacPDstandard4th2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma311 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,JacPDstandard4th1gxx,kmsub(ToReal(2),kmadd(gInv32,JacPDstandard4th1gxy,kmul(gInv33,JacPDstandard4th1gxz)),kmadd(gInv33,JacPDstandard4th3gxx,kmul(gInv32,JacPDstandard4th2gxx)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma121 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv12,JacPDstandard4th1gyy,kmadd(gInv11,JacPDstandard4th2gxx,kmul(gInv13,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th2gxz,JacPDstandard4th3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma221 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv22,JacPDstandard4th1gyy,kmadd(gInv21,JacPDstandard4th2gxx,kmul(gInv23,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th2gxz,JacPDstandard4th3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma321 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv32,JacPDstandard4th1gyy,kmadd(gInv31,JacPDstandard4th2gxx,kmul(gInv33,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th2gxz,JacPDstandard4th3gxy))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma131 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard4th1gzz,kmadd(gInv11,JacPDstandard4th3gxx,kmul(gInv12,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th3gxy,JacPDstandard4th2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma231 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard4th1gzz,kmadd(gInv21,JacPDstandard4th3gxx,kmul(gInv22,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th3gxy,JacPDstandard4th2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma331 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard4th1gzz,kmadd(gInv31,JacPDstandard4th3gxx,kmul(gInv32,kadd(JacPDstandard4th1gyz,ksub(JacPDstandard4th3gxy,JacPDstandard4th2gxz))))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma122 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard4th2gxy,JacPDstandard4th1gyy),kmadd(gInv12,JacPDstandard4th2gyy,kmul(gInv13,kmsub(ToReal(2),JacPDstandard4th2gyz,JacPDstandard4th3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma222 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard4th2gxy,JacPDstandard4th1gyy),kmadd(gInv22,JacPDstandard4th2gyy,kmul(gInv23,kmsub(ToReal(2),JacPDstandard4th2gyz,JacPDstandard4th3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma322 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard4th2gxy,JacPDstandard4th1gyy),kmadd(gInv32,JacPDstandard4th2gyy,kmul(gInv33,kmsub(ToReal(2),JacPDstandard4th2gyz,JacPDstandard4th3gyy)))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma132 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv13,JacPDstandard4th2gzz,kmadd(gInv11,ksub(kadd(JacPDstandard4th2gxz,JacPDstandard4th3gxy),JacPDstandard4th1gyz),kmul(gInv12,JacPDstandard4th3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma232 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv23,JacPDstandard4th2gzz,kmadd(gInv21,ksub(kadd(JacPDstandard4th2gxz,JacPDstandard4th3gxy),JacPDstandard4th1gyz),kmul(gInv22,JacPDstandard4th3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma332 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv33,JacPDstandard4th2gzz,kmadd(gInv31,ksub(kadd(JacPDstandard4th2gxz,JacPDstandard4th3gxy),JacPDstandard4th1gyz),kmul(gInv32,JacPDstandard4th3gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma133 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv11,kmsub(ToReal(2),JacPDstandard4th3gxz,JacPDstandard4th1gzz),kmadd(gInv12,kmsub(ToReal(2),JacPDstandard4th3gyz,JacPDstandard4th2gzz),kmul(gInv13,JacPDstandard4th3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma233 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv21,kmsub(ToReal(2),JacPDstandard4th3gxz,JacPDstandard4th1gzz),kmadd(gInv22,kmsub(ToReal(2),JacPDstandard4th3gyz,JacPDstandard4th2gzz),kmul(gInv23,JacPDstandard4th3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC gamma333 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(gInv31,kmsub(ToReal(2),JacPDstandard4th3gxz,JacPDstandard4th1gzz),kmadd(gInv32,kmsub(ToReal(2),JacPDstandard4th3gyz,JacPDstandard4th2gzz),kmul(gInv33,JacPDstandard4th3gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC xmoved CCTK_ATTRIBUTE_UNUSED = ksub(xL,ToReal(xorig));
    
    CCTK_REAL_VEC ymoved CCTK_ATTRIBUTE_UNUSED = ksub(yL,ToReal(yorig));
    
    CCTK_REAL_VEC zmoved CCTK_ATTRIBUTE_UNUSED = ksub(zL,ToReal(zorig));
    
    CCTK_REAL_VEC va1 CCTK_ATTRIBUTE_UNUSED = kneg(ymoved);
    
    CCTK_REAL_VEC va2 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC va3 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC vb1 CCTK_ATTRIBUTE_UNUSED = kadd(xmoved,ToReal(offset));
    
    CCTK_REAL_VEC vb2 CCTK_ATTRIBUTE_UNUSED = ymoved;
    
    CCTK_REAL_VEC vb3 CCTK_ATTRIBUTE_UNUSED = zmoved;
    
    CCTK_REAL_VEC vc1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv12,va3,kmul(gInv13,va2)),vb1,kmadd(kmsub(gInv13,va1,kmul(gInv11,va3)),vb2,kmul(vb3,kmsub(gInv11,va2,kmul(gInv12,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv22,va3,kmul(gInv23,va2)),vb1,kmadd(kmsub(gInv23,va1,kmul(gInv21,va3)),vb2,kmul(vb3,kmsub(gInv21,va2,kmul(gInv22,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC vc3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmsub(gInv32,va3,kmul(gInv33,va2)),vb1,kmadd(kmsub(gInv33,va1,kmul(gInv31,va3)),vb2,kmul(vb3,kmsub(gInv31,va2,kmul(gInv32,va1))))),kpow(detg,0.5));
    
    CCTK_REAL_VEC wa1 CCTK_ATTRIBUTE_UNUSED = va1;
    
    CCTK_REAL_VEC wa2 CCTK_ATTRIBUTE_UNUSED = va2;
    
    CCTK_REAL_VEC wa3 CCTK_ATTRIBUTE_UNUSED = va3;
    
    CCTK_REAL_VEC omega11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wa2,wa3),kmul(wa1,kmadd(gxyL,wa2,kmul(gxzL,wa3)))),kmadd(gxxL,kmul(wa1,wa1),kmadd(gyyL,kmul(wa2,wa2),kmul(gzzL,kmul(wa3,wa3)))));
    
    CCTK_REAL_VEC ea1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa1,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa2,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC ea3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wa3,kpow(omega11,-0.5));
    
    CCTK_REAL_VEC omega12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vb1,kmadd(gxyL,vb2,kmul(gxzL,vb3))),kmadd(ea2,kmadd(gxyL,vb1,kmadd(gyyL,vb2,kmul(gyzL,vb3))),kmul(ea3,kmadd(gxzL,vb1,kmadd(gyzL,vb2,kmul(gzzL,vb3))))));
    
    CCTK_REAL_VEC wb1 CCTK_ATTRIBUTE_UNUSED = knmsub(ea1,omega12,vb1);
    
    CCTK_REAL_VEC wb2 CCTK_ATTRIBUTE_UNUSED = knmsub(ea2,omega12,vb2);
    
    CCTK_REAL_VEC wb3 CCTK_ATTRIBUTE_UNUSED = knmsub(ea3,omega12,vb3);
    
    CCTK_REAL_VEC omega22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wb2,wb3),kmul(wb1,kmadd(gxyL,wb2,kmul(gxzL,wb3)))),kmadd(gxxL,kmul(wb1,wb1),kmadd(gyyL,kmul(wb2,wb2),kmul(gzzL,kmul(wb3,wb3)))));
    
    CCTK_REAL_VEC eb1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb1,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb2,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC eb3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wb3,kpow(omega22,-0.5));
    
    CCTK_REAL_VEC omega13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ea1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(ea2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(ea3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC omega23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(eb1,kmadd(gxxL,vc1,kmadd(gxyL,vc2,kmul(gxzL,vc3))),kmadd(eb2,kmadd(gxyL,vc1,kmadd(gyyL,vc2,kmul(gyzL,vc3))),kmul(eb3,kmadd(gxzL,vc1,kmadd(gyzL,vc2,kmul(gzzL,vc3))))));
    
    CCTK_REAL_VEC wc1 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea1,omega13,knmsub(eb1,omega23,vc1));
    
    CCTK_REAL_VEC wc2 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea2,omega13,knmsub(eb2,omega23,vc2));
    
    CCTK_REAL_VEC wc3 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(ea3,omega13,knmsub(eb3,omega23,vc3));
    
    CCTK_REAL_VEC omega33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(gyzL,kmul(wc2,wc3),kmul(wc1,kmadd(gxyL,wc2,kmul(gxzL,wc3)))),kmadd(gxxL,kmul(wc1,wc1),kmadd(gyyL,kmul(wc2,wc2),kmul(gzzL,kmul(wc3,wc3)))));
    
    CCTK_REAL_VEC ec1 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc1,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec2 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc2,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC ec3 CCTK_ATTRIBUTE_UNUSED = 
      kmul(wc3,kpow(omega33,-0.5));
    
    CCTK_REAL_VEC isqrt2 CCTK_ATTRIBUTE_UNUSED = 
      ToReal(0.707106781186547524);
    
    CCTK_REAL_VEC n1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb1,isqrt2));
    
    CCTK_REAL_VEC n2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb2,isqrt2));
    
    CCTK_REAL_VEC n3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(eb3,isqrt2));
    
    CCTK_REAL_VEC rm1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rm2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rm3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC im1 CCTK_ATTRIBUTE_UNUSED = kmul(ea1,isqrt2);
    
    CCTK_REAL_VEC im2 CCTK_ATTRIBUTE_UNUSED = kmul(ea2,isqrt2);
    
    CCTK_REAL_VEC im3 CCTK_ATTRIBUTE_UNUSED = kmul(ea3,isqrt2);
    
    CCTK_REAL_VEC rmbar1 CCTK_ATTRIBUTE_UNUSED = kmul(ec1,isqrt2);
    
    CCTK_REAL_VEC rmbar2 CCTK_ATTRIBUTE_UNUSED = kmul(ec2,isqrt2);
    
    CCTK_REAL_VEC rmbar3 CCTK_ATTRIBUTE_UNUSED = kmul(ec3,isqrt2);
    
    CCTK_REAL_VEC imbar1 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea1,isqrt2));
    
    CCTK_REAL_VEC imbar2 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea2,isqrt2));
    
    CCTK_REAL_VEC imbar3 CCTK_ATTRIBUTE_UNUSED = kneg(kmul(ea3,isqrt2));
    
    CCTK_REAL_VEC nn CCTK_ATTRIBUTE_UNUSED = isqrt2;
    
    CCTK_REAL_VEC R1212 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma221,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(gamma321,kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321)))))),kmadd(ToReal(-2),kmadd(gamma122,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma222,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma322))),ksub(kadd(JacPDstandard4th12gxy,ksub(JacPDstandard4th21gxy,JacPDstandard4th22gxx)),JacPDstandard4th11gyy))),ToReal(0.5));
    
    CCTK_REAL_VEC R1213 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma121,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma221,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma321,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma232,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma332))),ksub(kadd(JacPDstandard4th12gxz,ksub(JacPDstandard4th31gxy,JacPDstandard4th23gxx)),JacPDstandard4th11gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1223 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma122,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma222,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma322,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma132,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma232,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma332))),ksub(kadd(JacPDstandard4th22gxz,ksub(JacPDstandard4th31gyy,JacPDstandard4th23gxy)),JacPDstandard4th12gyz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1313 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma131,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma231,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(gamma331,kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma111,kmadd(gxyL,gamma211,kmul(gxzL,gamma311))),kmadd(gamma233,kmadd(gxyL,gamma111,kmadd(gyyL,gamma211,kmul(gyzL,gamma311))),kmul(kmadd(gxzL,gamma111,kmadd(gyzL,gamma211,kmul(gzzL,gamma311))),gamma333))),ksub(kadd(JacPDstandard4th13gxz,ksub(JacPDstandard4th31gxz,JacPDstandard4th33gxx)),JacPDstandard4th11gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R1323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma131,kmadd(gxyL,gamma231,kmul(gxzL,gamma331))),kmadd(gamma232,kmadd(gxyL,gamma131,kmadd(gyyL,gamma231,kmul(gyzL,gamma331))),kmul(kmadd(gxzL,gamma131,kmadd(gyzL,gamma231,kmul(gzzL,gamma331))),gamma332))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma121,kmadd(gxyL,gamma221,kmul(gxzL,gamma321))),kmadd(gamma233,kmadd(gxyL,gamma121,kmadd(gyyL,gamma221,kmul(gyzL,gamma321))),kmul(kmadd(gxzL,gamma121,kmadd(gyzL,gamma221,kmul(gzzL,gamma321))),gamma333))),ksub(kadd(JacPDstandard4th23gxz,ksub(JacPDstandard4th31gyz,JacPDstandard4th33gxy)),JacPDstandard4th12gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R2323 CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(2),kmadd(gamma132,kmadd(gxxL,gamma132,kmadd(gxyL,gamma232,kmul(gxzL,gamma332))),kmadd(gamma232,kmadd(gxyL,gamma132,kmadd(gyyL,gamma232,kmul(gyzL,gamma332))),kmul(gamma332,kmadd(gxzL,gamma132,kmadd(gyzL,gamma232,kmul(gzzL,gamma332)))))),kmadd(ToReal(-2),kmadd(gamma133,kmadd(gxxL,gamma122,kmadd(gxyL,gamma222,kmul(gxzL,gamma322))),kmadd(gamma233,kmadd(gxyL,gamma122,kmadd(gyyL,gamma222,kmul(gyzL,gamma322))),kmul(kmadd(gxzL,gamma122,kmadd(gyzL,gamma222,kmul(gzzL,gamma322))),gamma333))),ksub(kadd(JacPDstandard4th23gyz,ksub(JacPDstandard4th32gyz,JacPDstandard4th33gyy)),JacPDstandard4th22gzz))),ToReal(0.5));
    
    CCTK_REAL_VEC R4p1212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212));
    
    CCTK_REAL_VEC R4p1213 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213));
    
    CCTK_REAL_VEC R4p1223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223));
    
    CCTK_REAL_VEC R4p1313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313));
    
    CCTK_REAL_VEC R4p1323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323));
    
    CCTK_REAL_VEC R4p2323 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323));
    
    CCTK_REAL_VEC Ro111 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro112 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma121,knmsub(kyyL,gamma211,kmadd(kxyL,ksub(gamma221,gamma111),knmsub(kyzL,gamma311,kmadd(kxzL,gamma321,ksub(JacPDstandard4th1kxy,JacPDstandard4th2kxx))))));
    
    CCTK_REAL_VEC Ro113 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma131,knmsub(kyzL,gamma211,kmadd(kxyL,gamma231,knmsub(kzzL,gamma311,kmadd(kxzL,ksub(gamma331,gamma111),ksub(JacPDstandard4th1kxz,JacPDstandard4th3kxx))))));
    
    CCTK_REAL_VEC Ro121 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma121,kmadd(kyyL,gamma211,kmadd(kxyL,ksub(gamma111,gamma221),kmadd(kyzL,gamma311,knmsub(kxzL,gamma321,ksub(JacPDstandard4th2kxx,JacPDstandard4th1kxy))))));
    
    CCTK_REAL_VEC Ro122 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro123 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma121,kmadd(kxyL,gamma131,kmadd(kyyL,gamma231,knmsub(kzzL,gamma321,kmadd(kyzL,ksub(gamma331,gamma221),ksub(JacPDstandard4th2kxz,JacPDstandard4th3kxy))))));
    
    CCTK_REAL_VEC Ro131 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma131,kmadd(kyzL,gamma211,knmsub(kxyL,gamma231,kmadd(kzzL,gamma311,kmadd(kxzL,ksub(gamma111,gamma331),ksub(JacPDstandard4th3kxx,JacPDstandard4th1kxz))))));
    
    CCTK_REAL_VEC Ro132 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma121,knmsub(kxyL,gamma131,knmsub(kyyL,gamma231,kmadd(kzzL,gamma321,kmadd(kyzL,ksub(gamma221,gamma331),ksub(JacPDstandard4th3kxy,JacPDstandard4th2kxz))))));
    
    CCTK_REAL_VEC Ro133 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro211 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro212 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma122,knmsub(kyyL,gamma221,kmadd(kxyL,ksub(gamma222,gamma121),knmsub(kyzL,gamma321,kmadd(kxzL,gamma322,ksub(JacPDstandard4th1kyy,JacPDstandard4th2kxy))))));
    
    CCTK_REAL_VEC Ro213 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyzL,gamma221,kmadd(kxyL,gamma232,knmsub(kzzL,gamma321,kmadd(kxzL,ksub(gamma332,gamma121),ksub(JacPDstandard4th1kyz,JacPDstandard4th3kxy))))));
    
    CCTK_REAL_VEC Ro221 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma122,kmadd(kyyL,gamma221,kmadd(kxyL,ksub(gamma121,gamma222),kmadd(kyzL,gamma321,knmsub(kxzL,gamma322,ksub(JacPDstandard4th2kxy,JacPDstandard4th1kyy))))));
    
    CCTK_REAL_VEC Ro222 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro223 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma122,kmadd(kxyL,gamma132,kmadd(kyyL,gamma232,knmsub(kzzL,gamma322,kmadd(kyzL,ksub(gamma332,gamma222),ksub(JacPDstandard4th2kyz,JacPDstandard4th3kyy))))));
    
    CCTK_REAL_VEC Ro231 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyzL,gamma221,knmsub(kxyL,gamma232,kmadd(kzzL,gamma321,kmadd(kxzL,ksub(gamma121,gamma332),ksub(JacPDstandard4th3kxy,JacPDstandard4th1kyz))))));
    
    CCTK_REAL_VEC Ro232 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma122,knmsub(kxyL,gamma132,knmsub(kyyL,gamma232,kmadd(kzzL,gamma322,kmadd(kyzL,ksub(gamma222,gamma332),ksub(JacPDstandard4th3kyy,JacPDstandard4th2kyz))))));
    
    CCTK_REAL_VEC Ro233 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro311 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro312 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma132,knmsub(kyyL,gamma231,kmadd(kxyL,ksub(gamma232,gamma131),knmsub(kyzL,gamma331,kmadd(kxzL,gamma332,ksub(JacPDstandard4th1kyz,JacPDstandard4th2kxz))))));
    
    CCTK_REAL_VEC Ro313 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxxL,gamma133,knmsub(kyzL,gamma231,kmadd(kxyL,gamma233,knmsub(kzzL,gamma331,kmadd(kxzL,ksub(gamma333,gamma131),ksub(JacPDstandard4th1kzz,JacPDstandard4th3kxz))))));
    
    CCTK_REAL_VEC Ro321 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma132,kmadd(kyyL,gamma231,kmadd(kxyL,ksub(gamma131,gamma232),kmadd(kyzL,gamma331,knmsub(kxzL,gamma332,ksub(JacPDstandard4th2kxz,JacPDstandard4th1kyz))))));
    
    CCTK_REAL_VEC Ro322 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Ro323 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxzL,gamma132,kmadd(kxyL,gamma133,kmadd(kyyL,gamma233,knmsub(kzzL,gamma332,kmadd(kyzL,ksub(gamma333,gamma232),ksub(JacPDstandard4th2kzz,JacPDstandard4th3kyz))))));
    
    CCTK_REAL_VEC Ro331 CCTK_ATTRIBUTE_UNUSED = 
      knmsub(kxxL,gamma133,kmadd(kyzL,gamma231,knmsub(kxyL,gamma233,kmadd(kzzL,gamma331,kmadd(kxzL,ksub(gamma131,gamma333),ksub(JacPDstandard4th3kxz,JacPDstandard4th1kzz))))));
    
    CCTK_REAL_VEC Ro332 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kxzL,gamma132,knmsub(kxyL,gamma133,knmsub(kyyL,gamma233,kmadd(kzzL,gamma332,kmadd(kyzL,ksub(gamma232,gamma333),ksub(JacPDstandard4th3kyz,JacPDstandard4th2kzz))))));
    
    CCTK_REAL_VEC Ro333 CCTK_ATTRIBUTE_UNUSED = ToReal(0);
    
    CCTK_REAL_VEC Rojo11 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv23,gInv32),knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv22,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)))));
    
    CCTK_REAL_VEC Rojo12 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv32,knmsub(gInv21,R1212,knmsub(gInv31,R1213,kmadd(gInv23,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv12,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo13 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv23,knmsub(gInv21,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv31,R1313,kmsub(gInv13,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv32,R1323)))))));
    
    CCTK_REAL_VEC Rojo21 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv23,kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv31,knmsub(gInv12,R1212,knmsub(gInv13,R1213,kmadd(gInv32,R1223,kmadd(gInv33,knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmul(gInv21,kmsub(kxyL,kxyL,kmul(kxxL,kyyL)))))))));
    
    CCTK_REAL_VEC Rojo22 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv13,gInv31),kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),kmadd(gInv11,kmadd(kxxL,kyyL,knmsub(kxyL,kxyL,R1212)),kmul(gInv33,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Rojo23 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv13,kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv21,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv12,R1223,knmsub(gInv31,R1323,kmsub(gInv23,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv32,R2323)))))));
    
    CCTK_REAL_VEC Rojo31 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kxzL,kmul(kxxL,kyzL)),gInv21,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv32,knmsub(gInv12,R1213,kmadd(gInv22,kmsub(kxzL,kyyL,kmadd(kxyL,kyzL,R1223)),knmsub(gInv13,R1313,kmsub(gInv31,kmsub(kxzL,kxzL,kmul(kxxL,kzzL)),kmul(gInv23,R1323)))))));
    
    CCTK_REAL_VEC Rojo32 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kmsub(kxyL,kyzL,kmul(kxzL,kyyL)),gInv12,kmadd(kmsub(kxzL,kyzL,kmul(kxyL,kzzL)),gInv31,kmadd(gInv11,knmsub(kxyL,kxzL,kmadd(kxxL,kyzL,R1213)),kmadd(gInv21,R1223,knmsub(gInv13,R1323,kmsub(gInv32,kmsub(kyzL,kyzL,kmul(kyyL,kzzL)),kmul(gInv23,R2323)))))));
    
    CCTK_REAL_VEC Rojo33 CCTK_ATTRIBUTE_UNUSED = 
      kmadd(kadd(gInv12,gInv21),knmsub(kxzL,kyzL,kmadd(kxyL,kzzL,R1323)),kmadd(gInv11,kmadd(kxxL,kzzL,knmsub(kxzL,kxzL,R1313)),kmul(gInv22,kmadd(kyyL,kzzL,knmsub(kyzL,kyzL,R2323)))));
    
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(kmsub(imbar1,imbar2,kmul(rmbar1,rmbar2)),kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323))))),kmadd(ToReal(2),kmul(kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3))),kmadd(ToReal(2),kmul(kmadd(n1,kmul(n2,R4p1213),kmadd(n1,kmul(n3,R4p1313),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))),kmsub(imbar1,imbar3,kmul(rmbar1,rmbar3))),knmsub(kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3)))),kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),knmsub(kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3)))),kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),knmsub(kmul(nn,nn),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo23,kmadd(imbar1,kmadd(imbar2,kadd(Rojo12,Rojo21),kmul(imbar3,kadd(Rojo13,Rojo31))),knmsub(rmbar1,kmadd(rmbar2,kadd(Rojo12,Rojo21),kmul(rmbar3,kadd(Rojo13,Rojo31))),kmadd(kmsub(imbar2,imbar3,kmul(rmbar2,rmbar3)),Rojo32,kmadd(Rojo11,kmsub(imbar1,imbar1,kmul(rmbar1,rmbar1)),kmadd(Rojo22,kmsub(imbar2,imbar2,kmul(rmbar2,rmbar2)),kmul(Rojo33,kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))),kmsub(ToReal(2),kmul(nn,kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro112,kmadd(n2,Ro122,kmul(n3,Ro132))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro113,kmadd(n2,Ro123,kmul(n3,Ro133))),kmadd(kmsub(rmbar1,rmbar2,kmul(imbar1,imbar2)),kmadd(n1,Ro211,kmadd(n2,Ro221,kmul(n3,Ro231))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro213,kmadd(n2,Ro223,kmul(n3,Ro233))),kmadd(kmsub(rmbar1,rmbar3,kmul(imbar1,imbar3)),kmadd(n1,Ro311,kmadd(n2,Ro321,kmul(n3,Ro331))),kmadd(kmsub(rmbar2,rmbar3,kmul(imbar2,imbar3)),kmadd(n1,Ro312,kmadd(n2,Ro322,kmul(n3,Ro332))),kmadd(kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131))),kmsub(rmbar1,rmbar1,kmul(imbar1,imbar1)),kmadd(kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232))),kmsub(rmbar2,rmbar2,kmul(imbar2,imbar2)),kmul(kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))),kmsub(rmbar3,rmbar3,kmul(imbar3,imbar3)))))))))))),kmul(kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2)))),kmsub(imbar3,imbar3,kmul(rmbar3,rmbar3))))))))));
    
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmadd(kmsub(n1,kmadd(n2,R4p1212,kmul(n3,R4p1213)),kmul(n3,kmadd(n2,R4p1223,kmul(n3,R4p1323)))),kmadd(im2,rm1,kmul(im1,rm2)),kmadd(nn,knmsub(kmadd(im2,rm1,kmul(im1,rm2)),kmadd(n1,kadd(Ro112,Ro211),kmadd(n3,kadd(Ro132,Ro231),kmul(n2,kadd(Ro122,Ro221)))),kmadd(ToReal(-2),kmadd(im1,kmul(rm1,kmadd(n1,Ro111,kmadd(n2,Ro121,kmul(n3,Ro131)))),kmul(im2,kmul(rm2,kmadd(n1,Ro212,kmadd(n2,Ro222,kmul(n3,Ro232)))))),knmsub(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kadd(Ro113,Ro311),kmadd(n3,kadd(Ro133,Ro331),kmul(n2,kadd(Ro123,Ro321)))),kmsub(ToReal(-2),kmul(im3,kmul(rm3,kmadd(n1,Ro313,kmadd(n2,Ro323,kmul(n3,Ro333))))),kmul(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kadd(Ro213,Ro312),kmadd(n3,kadd(Ro233,Ro332),kmul(n2,kadd(Ro223,Ro322))))))))),kmul(kmadd(im3,rm1,kmul(im1,rm3)),kmadd(n1,kmadd(n2,R4p1213,kmul(n3,R4p1313)),kmadd(n2,kmul(n3,R4p1323),kmul(R4p1223,kmul(n2,n2))))))),kmsub(ToReal(-2),kmadd(kmadd(im3,rm2,kmul(im2,rm3)),kmadd(n1,kmsub(n2,R4p1223,kmul(n3,R4p1323)),kmsub(R4p1213,kmul(n1,n1),kmul(n2,kmul(n3,R4p2323)))),kmadd(im3,kmul(rm3,kmadd(ToReal(2),kmul(n1,kmul(n2,R4p1323)),kmadd(R4p1313,kmul(n1,n1),kmul(R4p2323,kmul(n2,n2))))),kmadd(im1,kmul(rm1,kmadd(ToReal(2),kmul(n2,kmul(n3,R4p1213)),kmadd(R4p1212,kmul(n2,n2),kmul(R4p1313,kmul(n3,n3))))),kmul(im2,kmul(rm2,kmadd(ToReal(-2),kmul(n1,kmul(n3,R4p1223)),kmadd(R4p1212,kmul(n1,n1),kmul(R4p2323,kmul(n3,n3))))))))),kmul(kmadd(im1,kmadd(ToReal(2),kmul(rm1,Rojo11),kmadd(rm2,kadd(Rojo12,Rojo21),kmul(rm3,kadd(Rojo13,Rojo31)))),kmadd(im2,kmadd(rm1,kadd(Rojo12,Rojo21),kmadd(ToReal(2),kmul(rm2,Rojo22),kmul(rm3,kadd(Rojo23,Rojo32)))),kmul(im3,kmadd(rm1,kadd(Rojo13,Rojo31),kmadd(rm2,kadd(Rojo23,Rojo32),kmul(kmul(rm3,Rojo33),ToReal(2))))))),kmul(nn,nn))));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(Psi4i[index],Psi4iL);
    vec_store_nta_partial(Psi4r[index],Psi4rL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_psi4_calc_4th);
}
extern "C" void WeylScal4_psi4_calc_4th(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_psi4_calc_4th_Body");
  }
  if (cctk_iteration % WeylScal4_psi4_calc_4th_calc_every != WeylScal4_psi4_calc_4th_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "admbase::curv",
    "admbase::metric",
    "grid::coordinates",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_psi4_calc_4th", 5, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_4th", 2, 2, 2);
      break;
    }
    
    case 4:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_4th", 2, 2, 2);
      break;
    }
    
    case 6:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_4th", 2, 2, 2);
      break;
    }
    
    case 8:
    {
      EnsureStencilFits(cctkGH, "WeylScal4_psi4_calc_4th", 2, 2, 2);
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverInterior(cctkGH, WeylScal4_psi4_calc_4th_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_psi4_calc_4th_Body");
  }
}

} // namespace WeylScal4

```

Startup.cc:
```
/*  File produced by Kranc */

#include "cctk.h"

extern "C" int WeylScal4_Startup(void)
{
  const char* banner CCTK_ATTRIBUTE_UNUSED = "WeylScal4";
  CCTK_RegisterBanner(banner);
  return 0;
}

```

Boundaries.cc:
```
/*  File produced by Kranc */

#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "cctk_Faces.h"
#include "util_Table.h"
#include "Symmetry.h"


/* the boundary treatment is split into 3 steps:    */
/* 1. excision                                      */
/* 2. symmetries                                    */
/* 3. "other" boundary conditions, e.g. radiative */

/* to simplify scheduling and testing, the 3 steps  */
/* are currently applied in separate functions      */


extern "C" void WeylScal4_CheckBoundaries(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  return;
}

extern "C" void WeylScal4_SelectBoundConds(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  CCTK_INT ierr CCTK_ATTRIBUTE_UNUSED = 0;
  return;
}



/* template for entries in parameter file:
*/


```


combined_doc_context: ## README (README):
```
Cactus Code Thorn WeylScal4
Author(s)    : Tanja Bode
               Ian Hinder
               Roland Haas
               Erik Schnetter
Maintainer(s): Cactus team
Licence      : LGPL
--------------------------------------------------------------------------

1. Purpose

Calculate the Weyl Scalars for a given metric given the fiducial tetrad of
Baker, Campanelli, and Lousto. PRD 65,044001 (2002) without the final null
rotations.


2. Implementation

The code is generated automatically with Mathematica.  The Mathematica
scripts are in the subdirectory "m", and the Makefile in there
re-generates the code.  This requires Mathematica and Kranc to be installed.

The scripts look for a Kranc installation in the "m" directory, in the Cactus
root directory and in $HOME as well as in the location where they find the
kranc shell-script if it is in the $PATH. If your Kranc (or kranc) directory is
in neither of these places, then you can set the environment variable KRANCPATH
to the location of your Kranc installation.

This thorn was generated using Kranc from http://github.com/ianhinder/Kranc

```



Reference answer:
src_code: /*  File produced by Kranc */

#define KRANC_C

#include <algorithm>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cctk.h"
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
#include "Kranc.hh"
#include "Differencing.h"
#include "loopcontrol.h"
#include "vectors.h"

namespace WeylScal4 {


static void WeylScal4_invars_calc_Nth_Body(const cGH* restrict const cctkGH, const int dir, const int face, const CCTK_REAL normal[3], const CCTK_REAL tangentA[3], const CCTK_REAL tangentB[3], const int imin[3], const int imax[3], const int n_subblock_gfs, CCTK_REAL* restrict const subblock_gfs[])
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  /* Include user-supplied include files */
  /* Initialise finite differencing variables */
  const ptrdiff_t di CCTK_ATTRIBUTE_UNUSED = 1;
  const ptrdiff_t dj CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t dk CCTK_ATTRIBUTE_UNUSED = 
    CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0);
  const ptrdiff_t cdi CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * di;
  const ptrdiff_t cdj CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dj;
  const ptrdiff_t cdk CCTK_ATTRIBUTE_UNUSED = sizeof(CCTK_REAL) * dk;
  const ptrdiff_t cctkLbnd1 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[0];
  const ptrdiff_t cctkLbnd2 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[1];
  const ptrdiff_t cctkLbnd3 CCTK_ATTRIBUTE_UNUSED = cctk_lbnd[2];
  const CCTK_REAL_VEC t CCTK_ATTRIBUTE_UNUSED = ToReal(cctk_time);
  const CCTK_REAL_VEC cctkOriginSpace1 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(0));
  const CCTK_REAL_VEC cctkOriginSpace2 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(1));
  const CCTK_REAL_VEC cctkOriginSpace3 CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_ORIGIN_SPACE(2));
  const CCTK_REAL_VEC dt CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_TIME);
  const CCTK_REAL_VEC dx CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(0));
  const CCTK_REAL_VEC dy CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(1));
  const CCTK_REAL_VEC dz CCTK_ATTRIBUTE_UNUSED = 
    ToReal(CCTK_DELTA_SPACE(2));
  const CCTK_REAL_VEC dxi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dx);
  const CCTK_REAL_VEC dyi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dy);
  const CCTK_REAL_VEC dzi CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),dz);
  const CCTK_REAL_VEC khalf CCTK_ATTRIBUTE_UNUSED = ToReal(0.5);
  const CCTK_REAL_VEC kthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.333333333333333333333333333333);
  const CCTK_REAL_VEC ktwothird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(0.666666666666666666666666666667);
  const CCTK_REAL_VEC kfourthird CCTK_ATTRIBUTE_UNUSED = 
    ToReal(1.33333333333333333333333333333);
  const CCTK_REAL_VEC hdxi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dxi,ToReal(0.5));
  const CCTK_REAL_VEC hdyi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dyi,ToReal(0.5));
  const CCTK_REAL_VEC hdzi CCTK_ATTRIBUTE_UNUSED = 
    kmul(dzi,ToReal(0.5));
  /* Initialize predefined quantities */
  const CCTK_REAL_VEC p1o12dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dx);
  const CCTK_REAL_VEC p1o12dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dy);
  const CCTK_REAL_VEC p1o12dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0833333333333333333333333333333),dz);
  const CCTK_REAL_VEC p1o144dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dy));
  const CCTK_REAL_VEC p1o144dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dx,dz));
  const CCTK_REAL_VEC p1o144dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00694444444444444444444444444444),kmul(dy,dz));
  const CCTK_REAL_VEC p1o180dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dx,dx));
  const CCTK_REAL_VEC p1o180dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dy,dy));
  const CCTK_REAL_VEC p1o180dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00555555555555555555555555555556),kmul(dz,dz));
  const CCTK_REAL_VEC p1o2dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dx);
  const CCTK_REAL_VEC p1o2dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dy);
  const CCTK_REAL_VEC p1o2dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.5),dz);
  const CCTK_REAL_VEC p1o3600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dy));
  const CCTK_REAL_VEC p1o3600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dx,dz));
  const CCTK_REAL_VEC p1o3600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000277777777777777777777777777778),kmul(dy,dz));
  const CCTK_REAL_VEC p1o4dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dy));
  const CCTK_REAL_VEC p1o4dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dx,dz));
  const CCTK_REAL_VEC p1o4dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.25),kmul(dy,dz));
  const CCTK_REAL_VEC p1o5040dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dx,dx));
  const CCTK_REAL_VEC p1o5040dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dy,dy));
  const CCTK_REAL_VEC p1o5040dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.000198412698412698412698412698413),kmul(dz,dz));
  const CCTK_REAL_VEC p1o60dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dx);
  const CCTK_REAL_VEC p1o60dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dy);
  const CCTK_REAL_VEC p1o60dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.0166666666666666666666666666667),dz);
  const CCTK_REAL_VEC p1o705600dxdy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dy));
  const CCTK_REAL_VEC p1o705600dxdz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dx,dz));
  const CCTK_REAL_VEC p1o705600dydz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1.41723356009070294784580498866e-6),kmul(dy,dz));
  const CCTK_REAL_VEC p1o840dx CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dx);
  const CCTK_REAL_VEC p1o840dy CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dy);
  const CCTK_REAL_VEC p1o840dz CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(0.00119047619047619047619047619048),dz);
  const CCTK_REAL_VEC p1odx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dx,dx));
  const CCTK_REAL_VEC p1ody2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dy,dy));
  const CCTK_REAL_VEC p1odz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(1),kmul(dz,dz));
  const CCTK_REAL_VEC pm1o12dx2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dx,dx));
  const CCTK_REAL_VEC pm1o12dy2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dy,dy));
  const CCTK_REAL_VEC pm1o12dz2 CCTK_ATTRIBUTE_UNUSED = kdiv(ToReal(-0.0833333333333333333333333333333),kmul(dz,dz));
  /* Jacobian variable pointers */
  const bool usejacobian1 = (!CCTK_IsFunctionAliased("MultiPatch_GetMap") || MultiPatch_GetMap(cctkGH) != jacobian_identity_map)
                        && strlen(jacobian_group) > 0;
  const bool usejacobian = assume_use_jacobian>=0 ? assume_use_jacobian : usejacobian1;
  if (usejacobian && (strlen(jacobian_derivative_group) == 0))
  {
    CCTK_WARN(CCTK_WARN_ALERT, "GenericFD::jacobian_group and GenericFD::jacobian_derivative_group must both be set to valid group names");
  }
  
  const CCTK_REAL* restrict jacobian_ptrs[9];
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_group,
                                                9, jacobian_ptrs);
  
  const CCTK_REAL* restrict const J11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[0] : 0;
  const CCTK_REAL* restrict const J12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[1] : 0;
  const CCTK_REAL* restrict const J13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[2] : 0;
  const CCTK_REAL* restrict const J21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[3] : 0;
  const CCTK_REAL* restrict const J22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[4] : 0;
  const CCTK_REAL* restrict const J23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[5] : 0;
  const CCTK_REAL* restrict const J31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[6] : 0;
  const CCTK_REAL* restrict const J32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[7] : 0;
  const CCTK_REAL* restrict const J33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_determinant_ptrs[1] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_determinant_group) > 0) GroupDataPointers(cctkGH, jacobian_determinant_group,
                                                1, jacobian_determinant_ptrs);
  
  const CCTK_REAL* restrict const detJ CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_determinant_ptrs[0] : 0;
  
  const CCTK_REAL* restrict jacobian_inverse_ptrs[9] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian && strlen(jacobian_inverse_group) > 0) GroupDataPointers(cctkGH, jacobian_inverse_group,
                                                9, jacobian_inverse_ptrs);
  
  const CCTK_REAL* restrict const iJ11 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[0] : 0;
  const CCTK_REAL* restrict const iJ12 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[1] : 0;
  const CCTK_REAL* restrict const iJ13 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[2] : 0;
  const CCTK_REAL* restrict const iJ21 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[3] : 0;
  const CCTK_REAL* restrict const iJ22 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[4] : 0;
  const CCTK_REAL* restrict const iJ23 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[5] : 0;
  const CCTK_REAL* restrict const iJ31 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[6] : 0;
  const CCTK_REAL* restrict const iJ32 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[7] : 0;
  const CCTK_REAL* restrict const iJ33 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_inverse_ptrs[8] : 0;
  
  const CCTK_REAL* restrict jacobian_derivative_ptrs[18] CCTK_ATTRIBUTE_UNUSED;
  if (usejacobian) GroupDataPointers(cctkGH, jacobian_derivative_group,
                                      18, jacobian_derivative_ptrs);
  
  const CCTK_REAL* restrict const dJ111 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[0] : 0;
  const CCTK_REAL* restrict const dJ112 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[1] : 0;
  const CCTK_REAL* restrict const dJ113 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[2] : 0;
  const CCTK_REAL* restrict const dJ122 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[3] : 0;
  const CCTK_REAL* restrict const dJ123 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[4] : 0;
  const CCTK_REAL* restrict const dJ133 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[5] : 0;
  const CCTK_REAL* restrict const dJ211 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[6] : 0;
  const CCTK_REAL* restrict const dJ212 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[7] : 0;
  const CCTK_REAL* restrict const dJ213 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[8] : 0;
  const CCTK_REAL* restrict const dJ222 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[9] : 0;
  const CCTK_REAL* restrict const dJ223 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[10] : 0;
  const CCTK_REAL* restrict const dJ233 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[11] : 0;
  const CCTK_REAL* restrict const dJ311 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[12] : 0;
  const CCTK_REAL* restrict const dJ312 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[13] : 0;
  const CCTK_REAL* restrict const dJ313 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[14] : 0;
  const CCTK_REAL* restrict const dJ322 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[15] : 0;
  const CCTK_REAL* restrict const dJ323 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[16] : 0;
  const CCTK_REAL* restrict const dJ333 CCTK_ATTRIBUTE_UNUSED = usejacobian ? jacobian_derivative_ptrs[17] : 0;
  /* Assign local copies of arrays functions */
  
  
  /* Calculate temporaries and arrays functions */
  /* Copy local copies back to grid functions */
  /* Loop over the grid points */
  const int imin0=imin[0];
  const int imin1=imin[1];
  const int imin2=imin[2];
  const int imax0=imax[0];
  const int imax1=imax[1];
  const int imax2=imax[2];
  #pragma omp parallel
  CCTK_LOOP3STR(WeylScal4_invars_calc_Nth,
    i,j,k, imin0,imin1,imin2, imax0,imax1,imax2,
    cctk_ash[0],cctk_ash[1],cctk_ash[2],
    vecimin,vecimax, CCTK_REAL_VEC_SIZE)
  {
    const ptrdiff_t index CCTK_ATTRIBUTE_UNUSED = di*i + dj*j + dk*k;
    /* Assign local copies of grid functions */
    
    CCTK_REAL_VEC Psi0iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi0i[index]);
    CCTK_REAL_VEC Psi0rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi0r[index]);
    CCTK_REAL_VEC Psi1iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi1i[index]);
    CCTK_REAL_VEC Psi1rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi1r[index]);
    CCTK_REAL_VEC Psi2iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi2i[index]);
    CCTK_REAL_VEC Psi2rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi2r[index]);
    CCTK_REAL_VEC Psi3iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi3i[index]);
    CCTK_REAL_VEC Psi3rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi3r[index]);
    CCTK_REAL_VEC Psi4iL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi4i[index]);
    CCTK_REAL_VEC Psi4rL CCTK_ATTRIBUTE_UNUSED = vec_load(Psi4r[index]);
    
    
    /* Include user supplied include files */
    /* Precompute derivatives */
    
    switch (fdOrder)
    {
      case 2:
      {
        break;
      }
      
      case 4:
      {
        break;
      }
      
      case 6:
      {
        break;
      }
      
      case 8:
      {
        break;
      }
      default:
        CCTK_BUILTIN_UNREACHABLE();
    }
    /* Calculate temporaries and grid functions */
    CCTK_REAL_VEC curvIrL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmadd(ToReal(-3),kmul(Psi2iL,Psi2iL),kmul(kmul(Psi2rL,Psi2rL),ToReal(3)))))));
    
    CCTK_REAL_VEC curvIiL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(6),kmul(Psi2iL,Psi2rL),kmadd(ToReal(-4),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))));
    
    CCTK_REAL_VEC curvJrL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(Psi0iL,kmul(Psi3iL,Psi3rL)),kmadd(ToReal(2),kmul(Psi1iL,kmul(Psi1rL,Psi4iL)),knmsub(Psi2iL,kmadd(ToReal(2),kmul(Psi1rL,Psi3iL),kmadd(ToReal(2),kmul(Psi1iL,Psi3rL),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL)))),kmadd(Psi4rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmadd(Psi2rL,kmadd(ToReal(-2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(2),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(kmul(Psi2iL,Psi2iL),ToReal(3)))))),kmsub(Psi0rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmul(Psi2rL,kmul(Psi2rL,Psi2rL))))))));
    
    CCTK_REAL_VEC curvJiL CCTK_ATTRIBUTE_UNUSED = 
      kmadd(ToReal(2),kmul(Psi2rL,kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL))),kmadd(Psi0rL,kmadd(ToReal(-2),kmul(Psi3iL,Psi3rL),kmul(Psi2rL,Psi4iL)),kmadd(ToReal(-2),kmul(Psi1iL,kmul(Psi1rL,Psi4rL)),kmadd(Psi4iL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmadd(Psi2iL,kmul(Psi2iL,Psi2iL),kmadd(Psi2iL,kmadd(ToReal(-2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(2),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(kmul(Psi2rL,Psi2rL),ToReal(-3)))))),kmul(Psi0iL,kmadd(Psi2rL,Psi4rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL))))))))));
    
    CCTK_REAL_VEC curvJ1L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(-4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(4),kmul(Psi1rL,Psi3rL),kmadd(Psi0iL,Psi4iL,knmsub(Psi0rL,Psi4rL,kmadd(ToReal(3),kmul(Psi2iL,Psi2iL),kmul(ToReal(-3),kmul(Psi2rL,Psi2rL))))))),ToReal(-16));
    
    CCTK_REAL_VEC curvJ2L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(ToReal(-2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(Psi2iL,kmadd(ToReal(2),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))),kmadd(Psi4rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)),kmadd(Psi2rL,kmadd(ToReal(2),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-2),kmul(Psi1rL,Psi3rL),kmadd(Psi0iL,Psi4iL,kmsub(ToReal(-3),kmul(Psi2iL,Psi2iL),kmul(Psi0rL,Psi4rL))))),kmadd(Psi2rL,kmul(Psi2rL,Psi2rL),kmul(Psi0rL,kmsub(Psi3rL,Psi3rL,kmul(Psi3iL,Psi3iL)))))))),ToReal(96));
    
    CCTK_REAL_VEC curvJ3L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(kmadd(kmadd(ToReal(8),kmul(Psi0iL,Psi1iL),kmul(ToReal(-8),kmul(Psi0rL,Psi1rL))),Psi3rL,kmul(ToReal(-4),kmul(Psi0iL,kmul(Psi0rL,Psi4iL)))),Psi4rL,kmadd(ToReal(12),kmul(Psi2iL,kmul(Psi2rL,kmsub(ToReal(4),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0iL,Psi4rL,kmul(Psi0rL,Psi4iL))))),kmadd(Psi1iL,kmul(Psi3iL,kmadd(ToReal(-64),kmul(Psi1rL,Psi3rL),kmadd(ToReal(-8),kmul(Psi0iL,Psi4iL),kmul(ToReal(8),kmul(Psi0rL,Psi4rL))))),kmadd(ToReal(8),kmadd(Psi0rL,kmul(kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),Psi4iL),kmul(Psi0iL,kmul(Psi1rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL))))),kmadd(ToReal(6),kmul(kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),kmsub(Psi0rL,Psi4rL,kmul(Psi0iL,Psi4iL)))),kmul(Psi2rL,Psi2rL)),kmadd(ToReal(-6),kmul(kmul(Psi2iL,Psi2iL),kmadd(ToReal(4),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-4),kmul(Psi1rL,Psi3rL),knmsub(Psi0iL,Psi4iL,kmadd(Psi0rL,Psi4rL,kmul(ToReal(9),kmul(Psi2rL,Psi2rL))))))),kmadd(ToReal(9),kmadd(kmul(Psi2iL,Psi2iL),kmul(Psi2iL,Psi2iL),kmul(kmul(Psi2rL,Psi2rL),kmul(Psi2rL,Psi2rL))),kmadd(kmadd(ToReal(16),kmul(Psi1iL,Psi1iL),kmul(ToReal(-16),kmul(Psi1rL,Psi1rL))),kmul(Psi3iL,Psi3iL),kmadd(kmadd(ToReal(-16),kmul(Psi1iL,Psi1iL),kmul(ToReal(16),kmul(Psi1rL,Psi1rL))),kmul(Psi3rL,Psi3rL),kmadd(kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(Psi4iL,Psi4iL),kmul(kmsub(Psi0rL,Psi0rL,kmul(Psi0iL,Psi0iL)),kmul(Psi4rL,Psi4rL)))))))))))),ToReal(64));
    
    CCTK_REAL_VEC curvJ4L CCTK_ATTRIBUTE_UNUSED = 
      kmul(kmadd(Psi3iL,kmadd(Psi4iL,kmadd(ToReal(-2),kmul(Psi3rL,kmul(Psi0iL,Psi0iL)),kmul(ToReal(12),kmul(Psi1rL,kmul(Psi1iL,Psi1iL)))),kmul(ToReal(4),kmul(Psi4rL,kmul(Psi1iL,kmul(Psi1iL,Psi1iL))))),kmadd(ToReal(-2),kmul(kmadd(ToReal(5),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-5),kmul(Psi1rL,Psi3rL),kmsub(Psi0iL,Psi4iL,kmul(Psi0rL,Psi4rL)))),kmul(Psi2rL,kmul(Psi2rL,Psi2rL))),kmadd(ToReal(-3),kmul(Psi2rL,kmul(kmul(Psi2rL,Psi2rL),kmul(Psi2rL,Psi2rL))),kmadd(kmadd(kmadd(ToReal(12),kmul(Psi0iL,Psi1iL),kmul(ToReal(-12),kmul(Psi0rL,Psi1rL))),Psi3rL,kmsub(ToReal(-2),kmul(Psi0iL,kmul(Psi0rL,Psi4iL)),kmul(Psi4rL,kmul(Psi0iL,Psi0iL)))),kmul(Psi3iL,Psi3iL),kmadd(Psi4rL,kmadd(Psi4iL,kmadd(ToReal(4),kmul(Psi0rL,kmul(Psi1iL,Psi1rL)),kmul(ToReal(-2),kmul(Psi0iL,kmul(Psi1iL,Psi1iL)))),kmadd(Psi3rL,kmadd(ToReal(4),kmul(Psi0iL,kmul(Psi0rL,Psi3iL)),kmul(ToReal(-12),kmul(Psi1rL,kmul(Psi1iL,Psi1iL)))),kmadd(kmul(Psi0rL,Psi0rL),kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmul(kmul(Psi0iL,Psi0iL),kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(-12),kmadd(Psi1iL,kmul(Psi3rL,kmul(Psi4iL,kmul(Psi1rL,Psi1rL))),kmul(Psi3iL,kmadd(Psi1iL,kmul(Psi4rL,kmul(Psi1rL,Psi1rL)),kmul(kmadd(Psi0rL,Psi1iL,kmul(Psi0iL,Psi1rL)),kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(3),kmadd(kmul(Psi2rL,Psi2rL),kmadd(ToReal(2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(Psi4rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)),kmul(Psi0rL,kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL))))),kmul(kmul(Psi2iL,Psi2iL),kmadd(ToReal(-2),kmadd(Psi0iL,kmul(Psi3iL,Psi3rL),kmul(Psi1iL,kmul(Psi1rL,Psi4iL))),kmadd(ToReal(2),kmul(Psi2rL,kmadd(ToReal(5),kmul(Psi1iL,Psi3iL),kmadd(ToReal(-5),kmul(Psi1rL,Psi3rL),kmsub(Psi0iL,Psi4iL,kmul(Psi0rL,Psi4rL))))),kmadd(Psi4rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)),kmadd(ToReal(10),kmul(Psi2rL,kmul(Psi2rL,Psi2rL)),kmul(Psi0rL,kmsub(Psi3rL,Psi3rL,kmul(Psi3iL,Psi3iL))))))))),kmadd(ToReal(-4),kmadd(Psi3iL,kmul(Psi4iL,kmul(Psi1rL,kmul(Psi1rL,Psi1rL))),kmul(Psi0iL,kmul(Psi1iL,kmul(Psi3rL,kmul(Psi3rL,Psi3rL))))),kmadd(ToReal(4),kmadd(Psi3rL,kmadd(Psi4iL,kmul(Psi1iL,kmul(Psi1iL,Psi1iL)),kmul(Psi4rL,kmul(Psi1rL,kmul(Psi1rL,Psi1rL)))),kmadd(kmadd(Psi0rL,Psi1iL,kmul(Psi0iL,Psi1rL)),kmul(Psi3iL,kmul(Psi3iL,Psi3iL)),kmul(Psi0rL,kmul(Psi1rL,kmul(Psi3rL,kmul(Psi3rL,Psi3rL)))))),kmadd(kmadd(ToReal(-2),kmul(Psi0iL,kmul(Psi1iL,Psi1rL)),kmul(Psi0rL,kmsub(Psi1rL,Psi1rL,kmul(Psi1iL,Psi1iL)))),kmul(Psi4iL,Psi4iL),kmadd(kmadd(ToReal(2),kmul(Psi0iL,kmul(Psi1iL,Psi1rL)),kmul(Psi0rL,kmsub(Psi1iL,Psi1iL,kmul(Psi1rL,Psi1rL)))),kmul(Psi4rL,Psi4rL),kmadd(Psi2rL,kmadd(ToReal(-4),kmul(Psi0iL,kmul(Psi0rL,kmul(Psi4iL,Psi4rL))),kmadd(ToReal(2),kmadd(Psi1rL,kmadd(kmadd(Psi0rL,Psi3iL,kmul(Psi0iL,Psi3rL)),Psi4iL,kmul(kmsub(Psi0iL,Psi3iL,kmul(Psi0rL,Psi3rL)),Psi4rL)),kmul(Psi1iL,kmadd(Psi3iL,kmsub(ToReal(16),kmul(Psi1rL,Psi3rL),kmul(Psi0iL,Psi4iL)),kmadd(Psi0iL,kmul(Psi3rL,Psi4rL),kmul(Psi0rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL))))))),kmadd(ToReal(-15),kmul(kmul(Psi2iL,Psi2iL),kmul(Psi2iL,Psi2iL)),kmadd(kmadd(ToReal(-8),kmul(Psi1iL,Psi1iL),kmul(ToReal(8),kmul(Psi1rL,Psi1rL))),kmsub(Psi3iL,Psi3iL,kmul(Psi3rL,Psi3rL)),kmadd(kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(Psi4iL,Psi4iL),kmul(kmsub(Psi0rL,Psi0rL,kmul(Psi0iL,Psi0iL)),kmul(Psi4rL,Psi4rL))))))),kmul(ToReal(2),kmadd(kmadd(ToReal(5),kmadd(Psi1rL,Psi3iL,kmul(Psi1iL,Psi3rL)),kmadd(Psi0rL,Psi4iL,kmul(Psi0iL,Psi4rL))),kmul(Psi2iL,kmul(Psi2iL,Psi2iL)),kmadd(Psi4iL,kmadd(Psi3iL,kmul(Psi3rL,kmul(Psi0rL,Psi0rL)),kmul(Psi0iL,kmadd(Psi4rL,kmul(Psi1rL,Psi1rL),kmul(Psi0rL,kmul(Psi3rL,Psi3rL))))),kmul(Psi2iL,kmadd(kmadd(ToReal(8),kmul(Psi3iL,Psi3rL),kmul(ToReal(3),kmul(Psi2rL,Psi4iL))),kmul(Psi1rL,Psi1rL),kmadd(Psi3rL,kmadd(Psi3iL,kmadd(ToReal(6),kmul(Psi0rL,Psi2rL),kmul(ToReal(-8),kmul(Psi1iL,Psi1iL))),kmul(Psi1iL,kmadd(Psi0rL,Psi4rL,kmul(ToReal(-15),kmul(Psi2rL,Psi2rL))))),kmadd(Psi4iL,knmsub(Psi0rL,kmul(Psi1iL,Psi3iL),kmadd(Psi4rL,kmsub(Psi0iL,Psi0iL,kmul(Psi0rL,Psi0rL)),kmul(ToReal(-3),kmadd(Psi2rL,kmul(Psi1iL,Psi1iL),kmul(Psi0rL,kmul(Psi2rL,Psi2rL)))))),kmsub(Psi1rL,kmadd(Psi0iL,kmul(Psi3rL,Psi4rL),kmadd(Psi0rL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL)),kmadd(Psi3iL,kmsub(ToReal(-15),kmul(Psi2rL,Psi2rL),kmul(Psi0iL,Psi4iL)),kmul(Psi1iL,kmadd(ToReal(6),kmul(Psi2rL,Psi4rL),kmadd(ToReal(-8),kmul(Psi3iL,Psi3iL),kmul(ToReal(8),kmul(Psi3rL,Psi3rL)))))))),kmul(Psi0iL,kmadd(Psi1iL,kmadd(Psi3rL,Psi4iL,kmul(Psi3iL,Psi4rL)),kmadd(ToReal(3),kmul(Psi4rL,kmul(Psi2rL,Psi2rL)),kmadd(Psi2rL,kmadd(ToReal(3),kmul(Psi3iL,Psi3iL),kmul(ToReal(-3),kmul(Psi3rL,Psi3rL))),kmul(Psi0rL,kmsub(Psi4rL,Psi4rL,kmul(Psi4iL,Psi4iL))))))))))))))))))))))))))),ToReal(-640));
    /* Copy local copies back to grid functions */
    vec_store_partial_prepare(i,vecimin,vecimax);
    vec_store_nta_partial(curvIi[index],curvIiL);
    vec_store_nta_partial(curvIr[index],curvIrL);
    vec_store_nta_partial(curvJ1[index],curvJ1L);
    vec_store_nta_partial(curvJ2[index],curvJ2L);
    vec_store_nta_partial(curvJ3[index],curvJ3L);
    vec_store_nta_partial(curvJ4[index],curvJ4L);
    vec_store_nta_partial(curvJi[index],curvJiL);
    vec_store_nta_partial(curvJr[index],curvJrL);
  }
  CCTK_ENDLOOP3STR(WeylScal4_invars_calc_Nth);
}
extern "C" void WeylScal4_invars_calc_Nth(CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;
  
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Entering WeylScal4_invars_calc_Nth_Body");
  }
  if (cctk_iteration % WeylScal4_invars_calc_Nth_calc_every != WeylScal4_invars_calc_Nth_calc_offset)
  {
    return;
  }
  
  const char* const groups[] = {
    "WeylScal4::curvIi_group",
    "WeylScal4::curvIr_group",
    "WeylScal4::curvJ1_group",
    "WeylScal4::curvJ2_group",
    "WeylScal4::curvJ3_group",
    "WeylScal4::curvJ4_group",
    "WeylScal4::curvJi_group",
    "WeylScal4::curvJr_group",
    "WeylScal4::Psi0i_group",
    "WeylScal4::Psi0r_group",
    "WeylScal4::Psi1i_group",
    "WeylScal4::Psi1r_group",
    "WeylScal4::Psi2i_group",
    "WeylScal4::Psi2r_group",
    "WeylScal4::Psi3i_group",
    "WeylScal4::Psi3r_group",
    "WeylScal4::Psi4i_group",
    "WeylScal4::Psi4r_group"};
  AssertGroupStorage(cctkGH, "WeylScal4_invars_calc_Nth", 18, groups);
  
  switch (fdOrder)
  {
    case 2:
    {
      break;
    }
    
    case 4:
    {
      break;
    }
    
    case 6:
    {
      break;
    }
    
    case 8:
    {
      break;
    }
    default:
      CCTK_BUILTIN_UNREACHABLE();
  }
  
  LoopOverEverything(cctkGH, WeylScal4_invars_calc_Nth_Body);
  if (verbose > 1)
  {
    CCTK_VInfo(CCTK_THORNSTRING,"Leaving WeylScal4_invars_calc_Nth_Body");
  }
}

} // namespace WeylScal4