Closed edwardhartnett closed 3 years ago
@edwardhartnett Thanks for finding and fixing that. I thought I had made sure to deallocate arrays where necessary, but my brain clearly forgot some that I added as I got the code to work. I'll do my best to make sure they all get deallocated in future tests.
@LarissaReames-NOAA you won't have to count on your memory. ;-) We are adding checking for this to the CI system, which is how I found this leak.
After we merge #488, PRs will not pass CI if they contain any memory issues.
@edwardhartnett I saw that, and it will definitely help. FWIW, in the feature/check_canopy PR I did add in deallocate statements for the check_soilt test when adding in the check_canopy test. So that PR should pass the memory test.
BTW to run these checks on the desktop, do a clean build with GNU with this CMake option:
-DCMAKE_Fortran_FLAGS="-fsanitize=address -fno-omit-frame-pointer"
Then run tests as usual. Memory issues will cause the test to error out.
When adding the address santitizer run I find some problems in ftst_sfc_input_data()
There are some allocated vars in this test that are not deallocated. I have added the deallocate and will put up a PR shortly.
@LarissaReames-NOAA note that any memory allocated in a test has to be deallocated. In this way we can test for memory leaks in the library.