def METHOD_NAME(self, pefilename):
    """
    Write out a pe_file that can be used to implement the
    optimized layout
    """
    natm = self.X["Natm"].varValue
    nlnd = self.X["Nlnd"].varValue
    nice = self.X["Nice"].varValue
    nocn = self.X["Nocn"].varValue
    ncpl = self.X["Ncpl"].varValue
    nrof = self.X["Nrof"].varValue
    npart = max(natm, nrof, ncpl)
    ntasks = {
        "atm": natm,
        "lnd": nldn,
        "rof": nrof,
        "ice": nice,
        "ocn": nocn,
        "glc": 1,
        "wav": 1,
        "cpl": ncpl,
    }
    roots = {
        "atm": 0,
        "lnd": npart,
        "rof": 0,
        "ice": npart,
        "ocn": npart,
        "glc": 0,
        "wav": 0,
        "cpl": 0,
    }
    nthrds = {}
    for c in ["atm", "lnd", "rof", "ice", "ocn", "glc", "wav", "cpl"]:
        nthrds[c] = self.models[c.upper()].nthrds
    self.write_pe_template(pefilename, ntasks, nthrds, roots)