Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

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.
 
Top