Skip to content

Commit

Permalink
reset d/f/fg/r/g after s because deallocation of s can use d in some …
Browse files Browse the repository at this point in the history
…cases
  • Loading branch information
lukasm91 committed Oct 17, 2024
1 parent 9be2c89 commit c9d0e9b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/trans/gpu/internal/dealloc_resol_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ SUBROUTINE DEALLOC_RESOL(KRESOL)
#ifdef OMPGPU
#endif

! Empty all fields (none of them has pointers; allocatable arrays implicitly deallocate)
D = D_
F = F_
FG = FG_
R = R_
G = G_

! TPM_FLD is more complex because it has pointers
IF( ALLOCATED(S%FA) ) THEN
DO JMLOC=1,D%NUMP,NPRTRV ! +++++++++++++++++++++ JMLOC LOOP ++++++++++
Expand All @@ -123,6 +116,13 @@ SUBROUTINE DEALLOC_RESOL(KRESOL)
ENDIF
S = S_

! Empty all fields (none of them has pointers; allocatable arrays implicitly deallocate)
D = D_
F = F_
FG = FG_
R = R_
G = G_

CALL CLEAN_FFT(KRESOL)
CALL CLEAN_GEMM(KRESOL)

Expand Down

0 comments on commit c9d0e9b

Please sign in to comment.