  Wang-Landau sampling (WLS) of large systems requires dividing the energy
range into "windows" and joining the results of simulations in each window. The
resulting density of states (and associated thermodynamic functions) are shown
to suffer from boundary effects in simulations of lattice polymers and the
five-state Potts model. Here, we implement WLS using adaptive windows. Instead
of defining fixed energy windows (or windows in the energy-magnetization plane
for the Potts model), the boundary positions depend on the set of energy values
on which the histogram is flat at a given stage of the simulation. Shifting the
windows each time the modification factor f is reduced, we eliminate border
effects that arise in simulations using fixed windows. Adaptive windows extend
significantly the range of system sizes that may be studied reliably using WLS.
