-
Notifications
You must be signed in to change notification settings - Fork 3
/
addh.f
96 lines (84 loc) · 4.11 KB
/
addh.f
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
subroutine addh
!! ~ ~ ~ PURPOSE ~ ~ ~
!! this subroutine adds loadings from two sources for routing
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! hhvaroute(:,:,:)|varies |routing storage array for hourly time step
! ievent |none |rainfall/runoff code
!! |0 daily rainfall/curve number technique
!! |1 sub-daily rainfall/Green&Ampt/hourly
!! | routing
!! |3 sub-daily rainfall/Green&Ampt/hourly routing
!! ihout |none |outflow hydrograph storage location number
!! inum1 |none |hydrograph storage location number of
!! |first dataset to be added
!! inum2 |none |hydrograph storage location number of
!! |second dataset to be added
!! mvaro |none |max number of variables routed through the
!! |reach
!! varoute(:,:)|varies |routing storage array
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ OUTGOING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! hhvaroute(:,:,:)|varies |routing storage array for hourly time step
!! varoute(:,:) |varies |routing storage array for daily time step
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ii |none |counter
!! kk |none |counter
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
use parm
integer :: ii, kk
!! zero flow out variables
do ii = 1, mvaro
varoute(ii,ihout) = 0.
end do
!! add loadings and store in new hydrograph location
if (varoute(2,inum1) + varoute(2,inum2) > 0.1) then
varoute(1,ihout) = (varoute(1,inum1) * varoute(2,inum1) +
& varoute(1,inum2) * varoute(2,inum2)) /
& (varoute(2,inum1) + varoute(2,inum2))
varoute(18,ihout) = (varoute(18,inum1) * varoute(2,inum1) +
& varoute(18,inum2) * varoute(2,inum2)) /
& (varoute(2,inum1) + varoute(2,inum2))
varoute(19,ihout) = (varoute(19,inum1) * varoute(2,inum1) +
& varoute(19,inum2) * varoute(2,inum2)) /
& (varoute(2,inum1) + varoute(2,inum2))
end if
do ii = 2, 17
varoute(ii,ihout) = varoute(ii,inum1) + varoute(ii,inum2)
end do
do ii = 20, mvaro
varoute(ii,ihout) = varoute(ii,inum1) + varoute(ii,inum2)
end do
if (varoute(2,ihout) < 0.) varoute(2,ihout) = 0.
!! add hydrograph points (hourly time step)
if (ievent > 0) then
! do kk = 1, 24
do kk = 1, nstep ! modified for urban modeling by J.Jeong 4/15/2008
if (hhvaroute(2,inum1,kk) + hhvaroute(2,inum2,kk) > 0.1) then
hhvaroute(1,ihout,kk) = (hhvaroute(1,inum1,kk) *
& hhvaroute(2,inum1,kk) + hhvaroute(1,inum2,kk) *
& hhvaroute(2,inum2,kk)) / (hhvaroute(2,inum1,kk) +
& hhvaroute(2,inum2,kk))
end if
end do
do ii = 2, mvaro
! do kk = 1, 24
do kk = 1, nstep ! modified for urban modeling by J.Jeong 4/15/2008
hhvaroute(ii,ihout,kk) = hhvaroute(ii,inum1,kk) +
* hhvaroute(ii,inum2,kk)
end do
end do
endif
do ii = 29, mvaro
varoute(ii,inum1) = 0.
varoute(ii,inum2) = 0.
end do
return
end