ENcloseQ function

Close water quality analysis and free allocated memory