Hello All,
I recently found a problem when I looked at the source code of SWAT ver.670. In the rtday subroutine, the variable rtwtr, which stands for the volume of water leaving the reach on the day, seems to be incorrectly calculated. Here is the code:
!! calculate volume of water leaving reach on day
scoef = 0.
rtwtr = 0.
!scoef = 2. * det / (2. * rttime + det)
scoef = det / (rttime + det)
if (scoef > 1.) scoef = 1.
rtwtr = scoef * (wtrin + rchstor(jrch))
!new storage coefficient replacement
rtwtr = vc * rcharea * 86400.
rtwtr = dmin1 (rtwtr, wtrin)
The rtwtr is first calculated using the storage coefficient (scoef) and then overwritten immediately by the commend "rtwtr = vc * rcharea * 86400.". I don't know what does the comment "new storage coefficient replacement" mean but this replacement will result in rtwtr always equal to wtrin (amount of water flowing into reach on the day), and in turn, result in the variable rchstor(jrch) (water stored in reach) always equal to zero (if you track down how rchstor is calculated in the code). Since there should be water stored in the channel at some point, I think the rtwtr is incorrectly calculated.
Additionally, based on the documentation, the storage coefficient should be calculated as "scoef = 2. * det / (2. * rttime + det)", however, this line of code is comment-out, and the coefficient is actually calculated as "scoef = det / (rttime + det)".
Anyone know if this program is coded like that on purpose or it is a mistake?
Thank you!
Jiahua Zhou