Quasiharmonic lattice dynamics is a simulation technique complementary to Monte Carlo and molecular dynamics. Quantum effects are readily taken into account, and high precision does not normally require long runs. Vibrational stability is a sensitive test of interatomic potentials, and details of the vibrational motion reveal mechanisms for phase transitions or for thermal expansion. The major computational task is usually to find the equilibrium geometry at a given T, P; done, calculating free energy, heat capacity, thermal expansion, etc., is rapid and accurate. For three-dimensional ionic crystals and slabs, our code SHELL calculates analytically first derivatives of the free energy with respect to all strains, internal us well as external, this gives a full minimization of the free energy so efficient that large unit cells can be used, allowing applications to defects and disordered systems. Various applications are discussed: MgF2, including the rutile/fluorite transition: negative thermal expansion in ZrW2O8; anisotropic expansion of polyethylene at very low temperatures; surface free energies for MgO; defect energies and volumes in MgO; and a new method for obtaining free energies and phase diagrams of disordered solids and solid solutions, applied to MnO/MgO and CaO/MgO.