結合規模指標の計算プログラム
‘ エクセルシート1の1列4行目から1~24時間を入力。
‘ エクセルシート1の2列4行目から時間雨量を入力。
‘ エクセルシート1の3列4行目から時間雨量を入力。
‘ ・
‘ 日数分の列を4行目から繰り返す。
‘ ・
‘ 入力日数をシート1のセル(2,2)へ入力。
‘ データの読み取りは日数と時間データのみ。
Option Explicit
Dim rdat(240, 20) As Double
Dim komoku(12) As String
Dim nd1 As Integer, nd2 As Integer, md1 AsInteger
Dim r1h As Double, r24h As Double, r10d AsDouble
Dim am1(3, 3) As Double, an(3, 3) As Double
Dim a1(3) As Double, a2 As Double, a3(3) AsDouble
Dim bm As Double, delb As Double, beta AsDouble
Dim zr1h As Double, zr24h As Double,zr24h1h As Double
Sub rdatain()
Dim i As Integer, j As Integer, k AsInteger
Dim rsum As Single, r1hmax As Single,r24hmax As Single
'
nd2 = Sheet1.Cells(2, 2).Value
nd1 = nd2 * 24
k = 0
For i = 1 To nd2
For j = 1 To 24
k = k + 1
rdat(k, 1) = Sheet1.Cells(j + 3, i + 1).Value
Next
Next
'
rsum = 0
For i = 1 To k
rsum = rsum + rdat(i, 1)
rdat(i, 2) = rsum
Next
rsum = 0
For i = 1 To 24
rsum = rsum + rdat(i, 1)
rdat(i,3) = rsum
Next
For i = 25 To k
rsum = rsum - rdat(i - 24, 1) + rdat(i, 1)
rdat(i, 3) = rsum
Next
'
r1hmax = rdat(1, 1)
rdat(1, 4) = r1hmax
For i = 2 To 24
Ifr1hmax < rdat(i, 1) Then
r1hmax = rdat(i, 1)
rdat(i, 4) = r1hmax
Else
rdat(i, 4) = r1hmax
End If
Next
If k > 25 Then
For i = 25 To k
r1hmax = rdat(i - 24, 1)
For j = i - 24 To i
If r1hmax < rdat(j, 1) Then
r1hmax = rdat(j, 1)
End If
Next
rdat(i, 4) = r1hmax
Next
End If
'
For i = 1 To 24
rdat(i, 5) = rdat(i, 3)
rdat(i, 6) = rdat(i, 4)
Next