def writeINCAR(self):
        m = self.m
        npar = 1
        for i in range(1, int(np.sqrt(m.cores)) + 1):
            if m.cores % i == 0:
                npar = i
        if m.ispin:
            ispin = "ISPIN=2"
        else:
            ispin = ""
        if m.soc:
            soc = "LSORBIT=T"
        else:
            soc = ""
        if m.isym:
            sym = "ISYM = 1"
        else:
            sym = "ISYM = 0"
        s = """SYSTEM=calculate energy
        PREC = High
        IBRION = -1
        ENCUT = %f
        EDIFF = 1.0e-8
        ISMEAR = %d; SIGMA = 0.01
        IALGO = 38
        LREAL = .FALSE.
        ADDGRID = .TRUE.
        LWAVE = .FALSE.
        LCHARG = .FALSE.
        NPAR = %d
        %s
        %s
        %s
        """ % (self.m.ecut, m.ismear, npar, sym, ispin, soc)
        if m.vdw:
            s += """\nIVDW = 1
            VDW_RADIUS = 50
            VDW_S6 = 0.75
            VDW_SR = 1.00
            VDW_SCALING = 0.75
            VDW_D = 20.0
            VDW_C6 = 63.540 31.50
            VDW_R0 = 1.898 1.892
            """
        s = s.replace(r'^\s+', '')
        write(s, 'INCAR')