-
Notifications
You must be signed in to change notification settings - Fork 1
/
INFIL.for
184 lines (161 loc) · 7.61 KB
/
INFIL.for
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
C=======================================================================
C INFIL, Subroutine, J.T. Ritchie
C Calculates infiltration rate.
C-----------------------------------------------------------------------
C REVISION HISTORY
C 01/01/1989 JR Written
C 01/11/1987 GH Infiltration distr. according to capacity of each horz.
C 12/05/1993 NBP Made into subroutine
C 06/13/1997 WDB Added tile drainage
! 10/13/1997 CHP Modified for modular format
! 01/05/1999 CHP Removed tile drainage
! 10/29/2001 CHP Removed read stmts for soil info. These variables
! now come from soil module.
! 08/12/2003 CHP Reset EXCS to zero daily.
!-----------------------------------------------------------------------
! Called by: WATBAL
! Calls: None
!-----------------------------------------------------------------------
C Notes : Infiltration is distributed according to the holding
C capacity of each horizon (SAT(L)-DUL(L)). If the soil
C water content of a layer reaches saturation, the excess
C amount of infiltration is added to the next soil layer(s),
C depending on their water holding capacity and actual soil
C water content. Then saturated flow is calculated.
C=======================================================================
SUBROUTINE INFIL(
& DLAYR, DS, DUL, NLAYR, PINF, SAT, SW, !Input
& SWCN, SWCON, MgmtWTD, !Input
& DRAIN, DRN, EXCS, SWDELTS) !Output
! ------------------------------------------------------------------
USE ModuleDefs !Definitions of constructed variable types,
! which contain control information, soil
! parameters, hourly weather data.
! NL defined in ModuleDefs.for
IMPLICIT NONE
SAVE
INTEGER L, LK, NLAYR
REAL DRAIN, DRCM, EXCS, HOLD, PINF, SWCON, TMPEXCS
REAL MgmtWTD
REAL DLAYR(NL), DRN(NL), DS(NL), DUL(NL), SAT(NL), SW(NL)
REAL SWCN(NL), SWDELTS(NL), SWTEMP(NL)
!-----------------------------------------------------------------------
DO L = 1, NLAYR
DRN(L) = 0.0
SWDELTS(L) = 0.0
SWTEMP(L) = SW(L)
ENDDO
EXCS = 0.0
TMPEXCS = 0.0
DO L = 1,NLAYR
HOLD = (SAT(L) - SWTEMP(L)) * DLAYR(L)
IF (PINF .GT. 1.E-4 .AND. PINF .GT. HOLD) THEN
! 11/30/2006 JTR/CHP reduce SWCON in top layer to allow for
! increased evaporation for wet soils
IF (DS(L) > MgmtWTD) THEN
DRN(L) = 0.0
DRCM = 0.0
ELSE
IF (L == 1) THEN !JTR
DRCM = 0.9 * SWCON * (SAT(L) - DUL(L)) * DLAYR(L) !JTR
ELSE !JTR
DRCM = SWCON * (SAT(L) - DUL(L)) * DLAYR(L)
ENDIF !JTR
DRN(L) = PINF - HOLD + DRCM
! Failed experiment -- too many problems with zero SWCN and
! historic soil profiles
! IF (SWCN(L) .GE. 0.0 .AND. DRN(L) .GT. SWCN(L)*24.0) THEN
IF (SWCN(L) .GT. 0.0 .AND. DRN(L) .GT. SWCN(L)*24.0) THEN
DRN(L) = SWCN(L) * 24.0
DRCM = DRN(L) + HOLD - PINF
ENDIF
ENDIF
SWTEMP(L) = SWTEMP(L) + (PINF - DRN(L)) / DLAYR(L)
IF (SWTEMP(L) .GT. SAT(L)) THEN
TMPEXCS = (SWTEMP(L) - SAT(L)) * DLAYR(L) ! US FEB 2004
SWTEMP(L) = SAT(L)
IF (L .EQ. 1 .AND. TMPEXCS .GT. 0.0) THEN
EXCS = EXCS + TMPEXCS
!Allow for ponding of water on surface and flooding with
! presence of bund -- US Feb04
ENDIF
C If there is excess water, redistribute it in layers above.
IF (L .GT. 1) THEN
DO LK = L-1,1,-1
IF (TMPEXCS .LT. 0.0001) GOTO 760
HOLD = MIN((SAT(LK) - SWTEMP(LK)) * DLAYR(LK),TMPEXCS)
SWTEMP(LK) = SWTEMP(LK) + HOLD / DLAYR(LK)
DRN(LK) = MAX((DRN(LK) - TMPEXCS), 0.0)
TMPEXCS = TMPEXCS - HOLD
IF (LK. EQ. 1 .AND. TMPEXCS .GT. 0.0) THEN
EXCS = EXCS + TMPEXCS
ENDIF
ENDDO
ENDIF
760 CONTINUE
ENDIF
PINF = DRN(L)
ELSE
SWTEMP(L) = SWTEMP(L) + PINF / DLAYR(L)
IF (SWTEMP(L) .GE. DUL(L) + 0.003 .AND.
& DS(L) < MgmtWTD) THEN
! 11/30/2006 JTR/CHP reduce SWCON in top layer to allow for
! increased evaporation for wet soils
IF (L == 1) THEN !JTR
DRCM = 0.9 * (SWTEMP(L) - DUL(L)) * SWCON * DLAYR(L) !JTR
ELSE !JTR
DRCM = (SWTEMP(L) - DUL(L)) * SWCON * DLAYR(L)
ENDIF !JTR
DRN(L) = DRCM
! IF (SWCN(L) .GE. 0.0 .AND. DRN(L) .GT. SWCN(L)*24.0) THEN
IF (SWCN(L) .GT. 0.0 .AND. DRN(L) .GT. SWCN(L)*24.0) THEN
DRN(L) = SWCN(L) * 24.0
DRCM = DRN(L)
ENDIF
SWTEMP(L) = SWTEMP(L) - DRCM / DLAYR(L)
PINF = DRCM
ELSE
PINF = 0.0
DRN(L) = 0.0
ENDIF
ENDIF
ENDDO
DRAIN = PINF * 10.0
!-----------------------------------------------------------------------
DO L = 1, NLAYR
SWDELTS(L) = SWTEMP(L) - SW(L)
ENDDO
!-----------------------------------------------------------------------
RETURN
END SUBROUTINE INFIL
!-----------------------------------------------------------------------
! INFIL VARIABLE DEFINITIONS: (updated 2/12/2004)
!-----------------------------------------------------------------------
! DLAYR(L) Thickness of soil layer L (cm)
! DRAIN Drainage rate from soil profile (mm/d)
! DRCM Drainage rate from soil profile (cm/d)
! DRN(L) Drainage rate through soil layer L (cm/d)
! DUL(L) Volumetric soil water content at Drained Upper Limit in soil
! layer L (cm3[water]/cm3[soil])
! EXCS Excess water to be added to runoff (cm/d)
! HOLD Amount of water a soil layer will hold above it's present
! level, used to calculate downward flow; also, temporary
! variable/ intermediate calculation (cm)
! MgmtWTD Managed depth to water table (cm)
! NLAYR Actual number of soil layers
! PINF Potential water available for infiltration (cm)
! SAT(L) Volumetric soil water content in layer L at saturation
! (cm3 [water] / cm3 [soil])
! SW(L) Volumetric soil water content in layer L
! (cm3 [water] / cm3 [soil])
! SWCN(L) Saturated hydraulic conductivity in layer L (cm/hr)
! SWCON Soil water conductivity constant; whole profile drainage rate
! coefficient (1/d)
! SWDELTS(L) Change in soil water content due to drainage in layer L
! (cm3 [water] / cm3 [soil])
! SWTEMP(L) Soil water content in layer L (temporary value to be modified
! based on drainage, root uptake and upward flow through soil
! layers). (cm3/cm3)
!-----------------------------------------------------------------------
! END SUBROUTINE INFIL
!-----------------------------------------------------------------------