This record contains the input files to reproduce the simulations reported in *Multithermal-multibaric molecular simulations from a variational principle*, PM Piaggi, M Parrinello, Physical Review Letters **122** (5), 050601. The simulations were performed using Gromacs 2018.1 and a development version of Plumed v2.4. The files contained in the folder "PlumedSource" must be added to the source code of Plumed v2.4 and it must be recompiled. The output of the simulations is also included. The trajectory of water is especially valuable since all static quantities in the range 260-350 K and 0-300 MPa can be calculated from it. Example python scripts to analyze the simulations and to create the paper's figures are included The zip file "Sodium.zip" contains: - A simulation of liquid Na in the multicanonical ensemble (Multicanonical) - References computed in the canonical ensemble at different temperatures (References) - A Jupyter Notebook with the code used to generate the results shown in the paper. The zip file "Water.zip" contains: - A simulation of liquid TIP4P/Ice water in the multithermal-multibaric ensemble (Multithermal-Multibaric) - References computed in the isothermal-isobaric ensemble (References) - A Jupyter Notebook with the code used to generate the results shown in the paper The zip file "PlumedSource.zip" contains the files that should be added to Plumed v2.4 in order to perform and analyze the simulations.