The finalization of the library is done by deallocating the memory which is occupied by the model object, the state object, and the electrostatics container. These deallocations are done in Fortran by respectively calling deallocate_model, deallocate_state and deallocate_electrostatics. In C, the library provides the corresponding functions, whereas in Python the deallocation is handled by the garbage collector.