Skip to content

Commit

Permalink
Add bug fix to make sure that arrays on level edges are not going out…
Browse files Browse the repository at this point in the history
… of bounds (issue GEOS-ESM/GMAO_Shared#99)
  • Loading branch information
Christoph Keller committed Feb 16, 2021
1 parent f4d8957 commit 5a5247b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lightning_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,8 @@ subroutine hemcoFlashrate (cellArea, lwi, lonslocal, latslocal, airTemp, ple, ge
ALLOCATE(ltop2d (1:IM, 1:JM), STAT=RC)

! edge layer fields
pleHemco(:,:,1:KM) = ple(:,:,KM:1:-1)
cnvMfcHemco(:,:,1:KM) = cnvMfc(:,:,KM:1:-1)
pleHemco(:,:,1:KM) = ple(:,:,LM:0:-1)
cnvMfcHemco(:,:,1:KM) = cnvMfc(:,:,LM:0:-1)

! fields at grid box center
airTempHemco(:,:,1:LM) = airTemp(:,:,LM:1:-1)
Expand All @@ -925,7 +925,7 @@ subroutine hemcoFlashrate (cellArea, lwi, lonslocal, latslocal, airTemp, ple, ge


do levCount=1,LM
gridBoxHeightHemco(:,:,levCount) = geoPotHeight(:,:,levCount) - geoPotHeight(:,:,levCount+1)
gridBoxHeightHemco(:,:,levCount) = geoPotHeight(:,:,levCount-1) - geoPotHeight(:,:,levCount)
enddo
gridBoxHeightHemco2(:,:,1:LM) = gridBoxHeightHemco(:,:,LM:1:-1)

Expand Down

0 comments on commit 5a5247b

Please sign in to comment.