Data and python code for the manuscript "Emulator-based calibration of a dynamic grassland model using recurrent neural networks and Hamiltonian Monte Carlo", for performing emulator hyperparameter optimization and training. Python file optimize_LSTM_emulator.py can be used either for training an LSTM emulator with predefined hyperparameters or to optimize hyperparameters from a given hyperparameter space. The training data for each fold is included in the files of shape training_data_fold_{}.parquet. The data is obtained from model simulations, including model inputs (meteorological forcings obtained from ERA5 data), model parameters (sampled from distributions defined in the manuscript) and model (BASGRA) outputs. Text file examples.txt gives instructions and examples on running the script.