Skip to content

Commit

Permalink
Bugfix memory leak. Ticket NOAA-EMC#1340
Browse files Browse the repository at this point in the history
It appears that changing the file extension
from .ftn in v6.07 to .F90 in v7 triggered a memory leak in
Intel's Fortran compilers. The issue occurs when mapping
from a dynamically allocated array to a static array.
GCC gfortran on the other hand will make sure that allocated
arrays will be freed on exit of a subroutine.

The leak is about 250B per grid point and subroutine call.
This translates to 5MB per time step on a 2.5M proint grid.

Updates
-------
 [x] Change array type from static to allocatalbe.
 [x] Explicitely add DEALLOCATE statements.
 [x] Move arrays with constantes to MODULE level.
 [x] Add checks for allocation status.
  • Loading branch information
stefanzieger committed Jan 2, 2025
1 parent f6c5f19 commit de2f427
Show file tree
Hide file tree
Showing 2 changed files with 201 additions and 42 deletions.
Loading

0 comments on commit de2f427

Please sign in to comment.