Skip to content

Commit e9b1520

Browse files
Kateryna Yakymenkokyakymenko
authored andcommitted
Deallocate all arrays that might have been allocated in ModRamWPI
1 parent 1e862a6 commit e9b1520

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/ModRamInit.f90

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ subroutine ram_deallocate
178178
! ModRamWPI Variables
179179
DEALLOCATE(WALOS1, WALOS2, WALOS3, fpofc, NDVVJ, NDAAJ, ENOR, ECHOR, BDAAR, &
180180
CDAAR, CDAER, CDEER)
181-
if (DoUseBASDiff) DEALLOCATE(CDAAR_chorus, CDAER_chorus, CDEER_chorus)
182181
DEALLOCATE(Daa_emic_h, Daa_emic_he, EKEV_emic, fp2c_emic, Ihs_emic, Ihes_emic)
183182
! ModRamLoss Variables
184183
! DEALLOCATE(ATLOS, ACHAR)
@@ -193,7 +192,13 @@ subroutine ram_deallocate
193192
DEALLOCATE(SETRC, ELORC, LSDR, LSCHA, LSATM, LSCOE, LSCSC, LSWAE, XNN, XND, &
194193
LNCN, LNCD, LECN, LECD, ENERN, ENERD, ATEW, ATAW, ATAC, ATEC, &
195194
XNE, ATMC, ATAW_emic_h, ATAW_emic_he,ESUM, NSUM)
195+
! Variables that may not have been allocated:
196+
if (ALLOCATED(CDAAR_chorus)) then
197+
DEALLOCATE(CDAAR_chorus, CDAER_chorus, CDEER_chorus, RCHOR_Dxx, &
198+
TCHOR_Dxx, ECHOR_Dxx, PACHOR_Dxx)
199+
endif
196200
!!!!!!!!!
201+
197202

198203

199204
end subroutine ram_deallocate

0 commit comments

Comments
 (0)