-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathch_rtpath.f90
More file actions
105 lines (87 loc) · 4.45 KB
/
ch_rtpath.f90
File metadata and controls
105 lines (87 loc) · 4.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
subroutine ch_rtpath
!! ~ ~ ~ PURPOSE ~ ~ ~
!! this subroutine routes bacteria through the stream network
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! hrchwtr(:) |m^3 H2O |water stored in reach at beginning of hour
!! rch_bactlp(:) |# cfu/100ml |less persistent bacteria stored in reach
!! rch_bactp(:) |# cfu/100ml |persistent bacteria stored in reach
!! rchwtr |m^3 H2O |water stored in reach at beginning of day
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ OUTGOING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! hbactlp(:) |# cfu/100mL |less persistent bacteria in reach/outflow
!! |during hour
!! hbactp(:) |# cfu/100mL |persistent bacteria in reach/outflow during
!! |hour
!! rch_bactlp(:)|# cfu/100ml |less persistent bacteria in reach/outflow
!! |at end of day
!! rch_bactp(:) |# cfu/100ml |persistent bacteria in reach/outflow at end
!! |of day
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ii |none |counter
!! initlp |# cfu/100mL |bacteria concentration in reach at beginning
!! |of hour (less persistent)
!! initp |# cfu/100mL |bacteria concentration in reach at beginning
!! |of hour (persistent)
!! jrch |none |reach number
!! netwtr |m^3 H2O |net amount of water in reach during time step
!! tday |day |routing time for the reach
!! totbactlp |10^4 cfu |mass less persistent bacteria
!! totbactp |10^4 cfu |mass persistent bacteria
!! wtmp |deg C |temperature of water in reach
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~
!! Intrinsic: Exp, Max
!! SWAT: Theta
!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
use basin_module
use time_module
use pathogen_data_module
use channel_module
use hydrograph_module, only : ob
use climate_module
use constituent_mass_module
implicit none
real, external :: Theta !units |description
real :: path_tot = 0. !10^4 cfu |mass persistent bacteria
real :: netwtr = 0. !m^3 H2O |net amount of water in reach during time step
real :: tday = 0. !day |routing time for the reach
real :: wtmp = 0. !deg C |temperature of water in reach
real :: rchwtr = 0. !m^3 H2O |water stored in reach at beginning of day
integer :: iwst = 0 !units |description
integer :: ipath = 0 !none |pathogen counter
integer :: jrch = 0 !none |reach number
integer :: iob = 0 !none |
integer :: icmd = 0 !none |
if (rtwtr > 0. .and. rchdep > 0.) then
wtmp = 5.0 + 0.75 * wst(iwst)%weat%tave
if (wtmp <= 0.) wtmp = 0.1
do ipath = 1, cs_db%num_paths
!isp_ini = hru(ihru)%dbs%soil_plant_init
!ipath_db = sol_plt_ini(isp_ini)%path
!! total pathogen mass in reach
path_tot = obcs(iob)%hd(1)%path(ipath) * ob(icmd)%hin%flo + ch(jrch)%bactp * rchwtr
!! compute pathogen die-off
tday = rttime / 24.0 !! calculate flow duration
if (tday > 1.0) tday = 1.0
path_tot = path_tot * Exp(-Theta(path_db(ipath)%do_stream, path_db(ipath)%t_adj,wtmp) * tday)
path_tot = Max(0., path_tot)
!! new concentration
netwtr = ob(icmd)%hin%flo + rchwtr
!! change made by CS while running region 4; date 2 jan 2006
if (path_tot < 1.e-6) path_tot = 0.0
if (netwtr >= 1.) then
ch_water(jrch)%path(ipath) = path_tot / netwtr
else
ch_water(jrch)%path(ipath) = 0.
end if
end do
end if
return
end subroutine ch_rtpath