The first three subroutines called in lines 2, 3, and 4 are novel additions to Tinker and mostly take care of converting Tinker quantities to ddX quantities, both in terms of format and units of measure. ddx_build_multipoles takes care of reading the multipoles from the Tinker arrays and converting them to real spherical harmonics in atomic units. ddx_build_cavity uses the atom types and positions to create a list of sphere centers and radii in atomic units. ddx_add_sph adds optional user-specified spheres to the list.