Modular Implementation Of Program Adaptation With Existing Scientific Codes