def METHOD_NAME(lmp, ntimestep, nlocal, tag, x, f):
    lmp.fix_external_set_virial_global("ext",[1.0, 1.0, 1.0, 0.0, 0.0, 0.0])
    for i in range(nlocal):
        f[i][0] = float(ntimestep)
        f[i][1] = float(ntimestep)
        f[i][2] = float(ntimestep)
    if ntimestep < 10:
        lmp.fix_external_set_energy_global("ext", 0.5)
        lmp.fix_external_set_vector("ext", 1, ntimestep)
        lmp.fix_external_set_vector("ext", 3, 1.0)
        lmp.fix_external_set_vector("ext", 4, -0.25)
    else:
        lmp.fix_external_set_energy_global("ext", 1.0)
        lmp.fix_external_set_vector("ext", 2, ntimestep)
        lmp.fix_external_set_vector("ext", 5, -1.0)
        lmp.fix_external_set_vector("ext", 6, 0.25)
    eatom = [0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7]
    vatom = [ [0.1,0.0,0.0,0.0,0.0,0.0],
              [0.0,0.2,0.0,0.0,0.0,0.0],
              [0.0,0.0,0.3,0.0,0.0,0.0],
              [0.0,0.0,0.0,0.4,0.0,0.0],
              [0.0,0.0,0.0,0.0,0.5,0.0],
              [0.0,0.0,0.0,0.0,0.0,0.6],
              [0.0,0.0,0.0,0.0,-7.0,0.0],
              [0.0,-8.0,0.0,0.0,0.0,0.0] ]
    if ntimestep < 5:
        lmp.fix_external_set_energy_peratom("ext",eatom)
        lmp.fix_external_set_virial_peratom("ext",vatom)
    else:
        import numpy as np
        eng = np.array(eatom)
        vir = np.array(vatom)
        lmp.numpy.fix_external_set_energy_peratom("ext",eng)
        lmp.numpy.fix_external_set_virial_peratom("ext",vir)
    # ------------------------------------------------------------------------