Skip to content
Snippets Groups Projects
Commit a7413073 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 01/09/2023: IO: bugfix: fix a memory leak for Z-split files

parent 4082f5cc
No related branches found
No related tags found
No related merge requests found
......@@ -593,6 +593,7 @@ SELECT CASE(TPFILE%CTYPE)
#ifdef MNH_IOCDF4
!Remark: IO_Coordvar_write_nc4 disabled (for the moment) for Z-split files
! because it introduce a serialization due to MPI communications inside the call
! WARNING: if uncommented, please modify IO_Coordvar_write_nc4 to enable block concerning gdealloc
! !Write coordinates variables in netCDF file
! IF (TZFILE_IOZ%CMODE == 'WRITE' .AND. (TZFILE_IOZ%CFORMAT=='NETCDF4' .OR. TZFILE_IOZ%CFORMAT=='LFICDF4')) THEN
! CALL IO_Coordvar_write_nc4(TZFILE_IOZ,HPROGRAM_ORIG=HPROGRAM_ORIG)
......
......@@ -1612,6 +1612,8 @@ call Write_hor_coord1d( tzdim_ni_v, 'x-dimension of the grid at v location', &
call Write_hor_coord1d( tzdim_nj_v, 'y-dimension of the grid at v location', &
trim(ystdnameprefix)//'_y_coordinate_at_v_location', 'Y', -0.5, jphext, 0, zyhat_glob )
!Warning: the following block has to be reenabled if IO_Coordvar_write_nc4 is again called for Z-split files
#if 0
!Deallocate only if it is a non Z-split file or the last Z-split subfile
gdealloc = .false.
if ( Associated( tpfile%tmainfile ) ) then
......@@ -1619,6 +1621,9 @@ if ( Associated( tpfile%tmainfile ) ) then
else if ( tpfile%nsubfiles_ioz == 0 .and. .not. Associated( tpfile%tmainfile ) ) then
gdealloc = .true.
end if
#else
gdealloc = .true.
#endif
if ( .not. lcartesian ) then
!Compute latitude/longitude for the Arakawa points
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment