在该行中If infl > (fc - WC(j)) * dz(j) Then
,我不断收到错误“类型不匹配”,它突出显示了-
该行。我现在知道什么会导致这个错误?
Option Explicit
Dim dz() As Double
Dim WC() As Double
Dim fc() As Double
Dim NL, i As Integer
Dim sumdrain As Double
Dim infl As Double
Sub infilt()
Dim j As Integer
j = 1
While (infl > 0) And (j <= NL)
If infl > (fc - WC(j)) * dz(j) Then
infl = infl - (fc - WC(j)) * dz(j)
WC(j) = fc
Else
WC(j) = WC(j) + infl / dz(j): infl = 0
End If
j = j + 1
Wend
If infl > 0 Then
sumdrain = sumdrain + infl
infl = 0
End If
End Sub