Skip to content

Commit

Permalink
and also update flag for sc1 now
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr-deltares committed Apr 22, 2020
1 parent 93b5cc9 commit c4ff085
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Model/GroundWaterFlow/gwf3sto8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module GwfStoModule
integer(I4B), dimension(:), pointer, contiguous :: iconvert => null() !confined (0) or convertible (1)
real(DP),dimension(:), pointer, contiguous :: sc1 => null() !primary storage capacity (when cell is fully saturated)
real(DP),dimension(:), pointer, contiguous :: sc2 => null() !secondary storage capacity (when cell is partially saturated)
integer(I4B), pointer :: iresetsc1 => null() !should be set to 1 whenever sc1 has been updated 'in-flight', this triggers the conversion
integer(I4B), pointer :: iresetsc2 => null() !should be set to 1 whenever sc2 has been updated 'in-flight', this triggers the conversion
real(DP), dimension(:), pointer, contiguous :: strgss => null() !vector of specific storage rates
real(DP), dimension(:), pointer, contiguous :: strgsy => null() !vector of specific yield rates
Expand Down Expand Up @@ -188,8 +189,12 @@ subroutine sto_rp(this)
readss = .false.
readsy = .false.

! when in-memory reset of coefficients, redo calculations
if (this%iresetsc1 == 1) then
call this%convert_sc1()
this%iresetsc1 = 0
end if
if (this%iresetsc2 == 1) then
! in-memory reset of coefficients, redo calculations
call this%convert_sc2()
this%iresetsc2 = 0
end if
Expand Down Expand Up @@ -630,6 +635,7 @@ subroutine sto_da(this)
call mem_deallocate(this%isseg)
call mem_deallocate(this%satomega)
call mem_deallocate(this%iusesy)
call mem_deallocate(this%iresetsc1)
call mem_deallocate(this%iresetsc2)
!
! -- deallocate parent
Expand Down Expand Up @@ -661,13 +667,15 @@ subroutine allocate_scalars(this)
call mem_allocate(this%isfac, 'ISFAC', this%origin)
call mem_allocate(this%isseg, 'ISSEG', this%origin)
call mem_allocate(this%satomega, 'SATOMEGA', this%origin)
call mem_allocate(this%iresetsc1, 'IRESETSC1', this%origin)
call mem_allocate(this%iresetsc2, 'IRESETSC2', this%origin)
!
! -- Initialize
this%iusesy = 0
this%isfac = 0
this%isseg = 0
this%satomega = DZERO
this%iresetsc1 = 0
this%iresetsc2 = 0
!
! -- Return
Expand Down

0 comments on commit c4ff085

Please sign in to comment.