memory leak cam3.1 lf95

I am getting a serious memory leak with cam3.1 compiled with lf95 version 6.2. The memory used in a simulation increases 4-fold in a 30-day simulation.

Has anyone noticed this in later versions of lf95? It doesn't seem to be a problem with pgf90.
 

eaton

CSEG and Liaisons
I have tracked this memory leak to a change that was made to the vertical diffusion interfaces between cam3.0 and cam3.1. The fix involves 2 files:

models/atm/cam/src/physics/cam1/diffusion_solver.F90
models/atm/cam/src/physics/cam1/vertical_diffusion.F90

Briefly the problem is that the overloaded .not. operator returns an
object of type vdiff_selector for which memory was allocated. But this
operator is used as an actual argument in the call to compute_vdiff, and so
the memory is never assigned to a variable which can be deallocated.

I have attached two patch files that can be applied to the diffusion_solver.F90 and
the vertical_diffusion.F90 files from either cam3.1 or cam3.1.p1.
 
Back
Top