def writeDoppler(temp, model):
    """Doppler broadening component."""
    temp.append('void doppler(double x, double y,')
    temp.append('double z, double *doppler) {\n\n')
    if type(model.turb) is float:
        temp.append('\t*doppler = %.3e;\n' % model.turb)
    else:
        temp.append('\t*doppler = findvalue(x, y, z, turb);\n')
    if model.turbtype == 'mach':
        temp.append('\tdouble val[2];\n')
        temp.append('\ttemperature(x, y, z, &val);\n')
        temp.append('\t*doppler *= sqrt(KBOLTZ * val[0] / 2.34 / AMU);\n')
    temp.append('\n}\n\n\n')
    return
