Skip to content

Commit

Permalink
relevant for docud=TRUE and doreservoir=FALSE: fixed crash due to una…
Browse files Browse the repository at this point in the history
…llocated array
  • Loading branch information
TillF committed Jul 2, 2021
1 parent 0056ce4 commit 40f2097
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/General/allocate_h.f90
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,16 @@ subroutine allocate_reservoir()
END IF


IF (doreservoir .or. doacud) THEN
allocate( &
damareaact(subasin), &
STAT = istate)

if (istate/=0) then
write(*,'(A,i0,a)')'ERROR: Memory allocation error (',istate,') in reservoir-module.'
stop
end if
end if

IF (doreservoir) THEN
allocate( &
Expand Down Expand Up @@ -435,7 +444,6 @@ subroutine allocate_reservoir()
! evapdam(366*nt,subasin), &
! infdam(366*nt,subasin), &
maxdamarea(subasin), &
damareaact(subasin), &
dama(subasin), &
damb(subasin), &
damc(subasin), &
Expand Down
2 changes: 1 addition & 1 deletion src/Reservoir/reservoir_h.f90
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module reservoir_h
!real, allocatable :: infdam(:,:)
!initial maximum reservoir area in subbasin [ha]
real, allocatable :: maxdamarea(:)
!actual reservoir area [m**2]
!actual reservoir area (including small ones) [m**2]
real, allocatable :: damareaact(:)
!!volume=k*Hv**alpha (Volume/heigth) relationship parameters
real, allocatable :: alpha_over(:)
Expand Down

0 comments on commit 40f2097

Please sign in to comment.