Updating both gw_sum (state) and gw_tau (parameter) can cause unstable and/or unrealistic water temperature predictions. This is because gw_sum and gw_tau are used to estimate average inflowing groundwater temperature (code), and adjusting both at the same time can cause instability.
Recommend updating state and keeping parameter constant