Skip to content

Commit

Permalink
Merge pull request #159 from GEOS-ESM/bugfix/cakelle2/fix-lightning-b…
Browse files Browse the repository at this point in the history
…ounds

Bug fix for issue #99: Edge level arrays out-of-bounds in Lighting_mod
  • Loading branch information
sdrabenh authored Mar 2, 2021
2 parents e8aa2a8 + b19bd7d commit f8ed4d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Fixed

- Fix for out-of-bounds error in lightning module (#99)

### Changed
### Added
### Removed
Expand Down
6 changes: 3 additions & 3 deletions GEOS_Shared/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 f8ed4d7

Please sign in to comment.