def Emax(calc, val):
    """https://www.quantum-espresso.org/Doc/INPUT_PROJWFC.html#emax
    """
    assert isinstance(val, (float, int))
    efermi = calc.get_fermi_level()
    if efermi is not None:
        return val + efermi
