def METHOD_NAME(frequency, dynamics, atoms, potential, logfile=None):
    """Thermodynamicsal data printout"""
    if dynamics.nsteps == frequency:
        header = "%5.5s %16.15s %16.15s %16.15s %16.15s %16.15s :thermo\n" % (
            "nsteps",
            "temperature",
            "potential_E",
            "kinetic_E",
            "total_E",
            "QM_atoms_no")
        if logfile is not None:
            logfile.write(header)
            logfile.flush()
        print(header)
    if "energy" in potential.classical_calculator.results:
        potential_energy = potential.classical_calculator.results["energy"]
    elif "potential_energy" in potential.classical_calculator.results:
        potential_energy = potential.classical_calculator.results["potential_energy"]
    else:
        potential_energy = potential.get_potential_energy(atoms)
    kinetic_energy = atoms.get_kinetic_energy()
    total_energy = potential_energy + kinetic_energy
    temp = kinetic_energy / (1.5 * units.kB * len(atoms))
    full_qm_atoms_no = len([item for sublist in potential.cluster_list for item in sublist])
    log = "%5.1f %16.5e %16.5e %16.5e %16.5e %5.0f :thermo" % (
        dynamics.nsteps,
        temp,
        potential_energy,
        kinetic_energy,
        total_energy,
        full_qm_atoms_no,
    )
    if logfile is not None:
        logfile.write(log + "\n")
        logfile.flush()
    print(log)