Cleaning algae from your rain barrel
Use and drain the barrel regularly. This is the easiest method. Regular use and/or draining of the barrel will snuff out any possible algae growth. So, use your barrel regularly. If you're going to be gone for an extended period, then drain the barrel!
Use bleach. The EPA gives guidance on how to use bleach to disinfect drinking water. The EPA states, "Add 1⁄8 teaspoon (or 8 drops) of regular, unscented, liquid household bleach for each gallon of water, stir it well and let it stand for 30 minutes before you use it. Store disinfected water in clean containers with covers." Bleach will keep the algae at bay.
Paint the barrel a dark color, or a few layers of a light color. Keeping the sun out of the barrel will stifle the algae growth.Use paints recommended for plastics or metals, depending on the type of barrel or cistern you have. If you are using a wood barrel, the algae is not likely to be an issue, but you can use an oil coating on the outside such as linseed or tung oil.
Keep it out of the sun. Simple enough. The shadier the location of your barrel the less algae growth that will occur. Consider growing plants on top of or near the rain barrel to provide additional shade.
Live with it. There's nothing wrong with a little algae in the barrel. If it can grow, then at least you know the water doesn't kill plant life. That's typically important for a rain barrel's contents. So, you can always just live with it and clean it at the end of the season.