  We study the thermodynamics of clean, layered superconductor/ferromagnet
nanostructures using fully self consistent methods to solve the microscopic
Bogoliubov-deGennes equations. From these self-consistent solutions the
condensation free energies are obtained. The trilayer SFS junction is studied
in particular detail: first order transitions between 0 and $\pi$ states as a
function of the temperature $T$ are located by finding where the free energies
of the two phases cross. The occurrence of these transitions is mapped as a
function of the thickness $d_F$ of the F layer and of the Fermi wavevector
mismatch parameter $\Lambda$. Similar first order transitions are found for
systems with a larger number of layers: examples are given in the 7 layer (3
junction) case. The latent heats associated with these phase transitions are
evaluated and found to be experimentally accessible. The transition temperature
to the normal state is calculated from the linearized Bogoliubov-deGennes
equations and found to be in good agreement with experiment. Thus, the whole
three dimensional phase diagram in $T,d_F,\Lambda$ space can be found. The
first order transitions are associated with dips in the transition temperature
$T_c$ to the non-superconducting state, which should facilitate locating them.
Results are given also for the magnetic moment and the local density of states
(DOS) at the first order transition.
