Skip to content

Commit

Permalink
Move MODEL_WRF return to top of INIT_DRYDEP.
Browse files Browse the repository at this point in the history
This change for MODEL_WRF fixes the issue that an allocation check and
return was not early enough, resulting in a second function call
zeroing out internal species indices and breaking dry deposition instead.

NOTE: This update was originally made by Haipeng Lin for 12.9.0, but
was manually applied by Bob Yantosca for 12.8.2, in order to avoid
pulling in other 12.9.0 modifications.

Signed-off-by: Haipeng Lin <[email protected]>
Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed May 26, 2020
1 parent 4ad1815 commit 286745c
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions GeosCore/drydep_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4047,10 +4047,20 @@ SUBROUTINE INIT_DRYDEP( Input_Opt, State_Chm, State_Diag, State_Grid, RC )

! Initialize
RC = GC_SUCCESS

ErrMsg = ''
ThisLoc = ' -> at Init_Drydep (in module GeosCore/drydep_mod.F)'

#ifdef MODEL_WRF
! If the dry deposition module has already been initialized,
! the arrays do not need to be allocated again, as they are only
! dependent on the chemistry configuration (State_Chm%nDryDep)
!
! This is necessary for integrating GEOS-Chem with a variable
! domain model like WRF-GC, where multiple instances of GEOS-Chem
! run in the same CPU. (hplin, 2/16/2019)
IF ( ALLOCATED( A_DEN ) ) RETURN
#endif

!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!%%% NOTE: Because READ_DRYDEP_INPUTS reads info from a netCDF %%%
!%%% file, we may have to broadcast these. However, the file %%%
Expand Down Expand Up @@ -4097,17 +4107,6 @@ SUBROUTINE INIT_DRYDEP( Input_Opt, State_Chm, State_Diag, State_Grid, RC )
id_PAN = IND_('PAN' )
id_IHN1 = IND_('IHN1' )

#ifdef MODEL_WRF
! If the dry deposition module has already been initialized,
! the arrays do not need to be allocated again, as they are only
! dependent on the chemistry configuration (State_Chm%nDryDep)
!
! This is necessary for integrating GEOS-Chem with a variable
! domain model like WRF-GC, where multiple instances of GEOS-Chem
! run in the same CPU. (hplin, 2/16/2019)
IF ( ALLOCATED( A_DEN ) ) RETURN
#endif

!===================================================================
! Arrays that hold information about dry-depositing species
! Only allocate these if dry deposition is activated
Expand Down

0 comments on commit 286745c

Please sign in to comment.