def METHOD_NAME(MEE, outputfile, Z_max=86, realtype='real_t'):
    """
    Save data to C++ file.
    """
    s  = "/**\n"
    s += " * This file was automatically generated by 'tools/Generate_MeanExcitationEnergy.py'.\n"
    s += " */\n\n"
    s += "/*  List of mean excitation energies in units of eV  */\n"
    s += "const {0} MEAN_EXCITATION_ENERGY_EXTENDED[{1}][{1}] = {{\n".format(realtype, Z_max)
    for Z in range(1, Z_max+1):
        s += "/* {} */ {{".format(element_symbol(Z))
        for Z0 in range(1, Z_max+1):
            s += " {:.1F}".format(MEE[Z][Z0])
            if Z0<Z_max: s += ','
        if Z < Z_max:   s += ' },\n'
        else:           s += ' }\n'
    s += "};\n\n"
    if outputfile is not None:
        # Create directory if it doesn't already exist
        pathlib.Path(outputfile).parent.mkdir(parents=True, exist_ok=True)
        # Write C++ file
        with open(outputfile, 'w') as f:
            f.write(s)
    return s