Skip to content

Commit 71e8e6f

Browse files
Moved deallocate statement: error when setting diag_nwp2 = 1 due to memory deallocation (#2240)
TYPE: Bug fix KEYWORDS: seg fault, diag_nwp2 SOURCE: Menda Chasteen DESCRIPTION OF CHANGES: Running with `diag_nwp2 = 1` leads to a segmentation fault related to prematurely deallocating `dz8w` in [start_em.F](https://github.com/wrf-model/WRF/blob/f52c197ed39d12e087d02c50f412d90d418f6186/dyn_em/start_em.F#L2004). This PR fixes the error by moving the deallocate statement to after the `trad_fields` call. LIST OF MODIFIED FILES: dyn_em/start_em.F TESTS CONDUCTED: The regression tests are all passing. RELEASE NOTE: This PR fixes a seg fault error due to early deallocation of array dz8w for diag_nwp2=2 option in start_em.F.
1 parent 7329170 commit 71e8e6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dyn_em/start_em.F

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,6 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
20012001
#endif
20022002
20032003
DEALLOCATE(z_at_q)
2004-
DEALLOCATE(dz8w)
20052004
20062005
IF (config_flags%p_lev_diags == PRESS_DIAGS ) THEN
20072006
CALL wrf_debug ( 200 , ' PLD: pressure level diags' )
@@ -2167,6 +2166,7 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read &
21672166
,ITS=its,ITE=ite, JTS=jts,JTE=jte, KTS=kts,KTE=kte )
21682167
ENDIF
21692168
2169+
DEALLOCATE(dz8w)
21702170
21712171
! FIRE
21722172
if(config_flags%ifire.eq.2)then

0 commit comments

Comments
 (0)