def writeAbundance(temp, model):
    """Molecular abundances."""
    temp.append('void abundance(double x, double y, double z,')
    temp.append(' double *abundance) {\n\n')
    if type(model.abund) is float:
        temp.append('\tabundance[0] = %.3e;\n' * model.abund)
    else:
        temp.append('\tabundance[0] = ')
        temp.append('findvalue(x, y, z, abund);\n' % model.abund)
    if model.depletion:
        temp.append('\tabundance[0] *= %.3e;\n' % model.depletion)
    temp.append('\tif (abundance[0] < 0.){\n\t\tabundance[0] = 0.;\n\t}\n')
    temp.append('\n}\n\n\n')
    return
