Reduce the memory usage of static field interpolation by deallocating tiles as they are used.
Static field interpolation occasionally failed by overflowing the memory of the compute nodes
when running core_init_atmosphere. Running valgrind revealed that this was not due to a
memory leak, but simply loading all of the required geotiles in to memory during the depth
first search for candidate tiles, and only deallocating them once the interpolation was finished.
This pull request deallocates the memory associated with the geotile each time that we
process a tile, leading to significant memory use reductions- on an x1.40962 grid, static field
interpolation peak memory usage has dropped from ~43GiB to ~6GiB.
Reduce the memory usage of static field interpolation by deallocating tiles as they are used.
Static field interpolation occasionally failed by overflowing the memory of the compute nodes when running core_init_atmosphere. Running valgrind revealed that this was not due to a memory leak, but simply loading all of the required geotiles in to memory during the depth first search for candidate tiles, and only deallocating them once the interpolation was finished. This pull request deallocates the memory associated with the geotile each time that we process a tile, leading to significant memory use reductions- on an x1.40962 grid, static field interpolation peak memory usage has dropped from ~43GiB to ~6GiB.