PyFishPack 0.1.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PyFishPack/__init__.py +86 -0
- PyFishPack/__pycache__/__init__.cpython-313.pyc +0 -0
- PyFishPack/__pycache__/apps.cpython-313.pyc +0 -0
- PyFishPack/_dummy.c +23 -0
- PyFishPack/_dummy.cp313-win_amd64.pyd +0 -0
- PyFishPack/apps.py +3640 -0
- PyFishPack/fishpack.cp313-win_amd64.dll.a +0 -0
- PyFishPack/fishpack.cp313-win_amd64.pyd +0 -0
- PyFishPack/meson.build +213 -0
- PyFishPack/src/archive/f77/Makefile +19 -0
- PyFishPack/src/archive/f77/blktri.f +1404 -0
- PyFishPack/src/archive/f77/cblktri.f +1414 -0
- PyFishPack/src/archive/f77/cmgnbn.f +1592 -0
- PyFishPack/src/archive/f77/comf.f +186 -0
- PyFishPack/src/archive/f77/fftpack.f +2968 -0
- PyFishPack/src/archive/f77/genbun.f +1335 -0
- PyFishPack/src/archive/f77/gnbnaux.f +314 -0
- PyFishPack/src/archive/f77/hstcrt.f +443 -0
- PyFishPack/src/archive/f77/hstcsp.f +683 -0
- PyFishPack/src/archive/f77/hstcyl.f +485 -0
- PyFishPack/src/archive/f77/hstplr.f +538 -0
- PyFishPack/src/archive/f77/hstssp.f +634 -0
- PyFishPack/src/archive/f77/hw3crt.f +687 -0
- PyFishPack/src/archive/f77/hwscrt.f +512 -0
- PyFishPack/src/archive/f77/hwscsp.f +728 -0
- PyFishPack/src/archive/f77/hwscyl.f +538 -0
- PyFishPack/src/archive/f77/hwsplr.f +602 -0
- PyFishPack/src/archive/f77/hwsssp.f +780 -0
- PyFishPack/src/archive/f77/pois3d.f +550 -0
- PyFishPack/src/archive/f77/poistg.f +875 -0
- PyFishPack/src/archive/f77/sepaux.f +361 -0
- PyFishPack/src/archive/f77/sepeli.f +1029 -0
- PyFishPack/src/archive/f77/sepx4.f +958 -0
- PyFishPack/src/centered_axisymmetric_spherical_solver.f90 +1002 -0
- PyFishPack/src/centered_cartesian_helmholtz_solver_3d.f90 +819 -0
- PyFishPack/src/centered_cartesian_solver.f90 +583 -0
- PyFishPack/src/centered_cylindrical_solver.f90 +634 -0
- PyFishPack/src/centered_helmholtz_solvers.f90 +156 -0
- PyFishPack/src/centered_polar_solver.f90 +746 -0
- PyFishPack/src/centered_real_linear_systems_solver.f90 +280 -0
- PyFishPack/src/centered_spherical_solver.f90 +928 -0
- PyFishPack/src/complex_block_tridiagonal_linear_systems_solver.f90 +1947 -0
- PyFishPack/src/complex_linear_systems_solver.f90 +1787 -0
- PyFishPack/src/fftpack_c_api.f90 +86 -0
- PyFishPack/src/fishpack.f90 +191 -0
- PyFishPack/src/fishpack.pyf +504 -0
- PyFishPack/src/fishpack_c_api.f90 +365 -0
- PyFishPack/src/fishpack_original.pyf +2119 -0
- PyFishPack/src/fishpack_precision.f90 +53 -0
- PyFishPack/src/general_linear_systems_solver_3d.f90 +296 -0
- PyFishPack/src/iterative_solvers.f90 +969 -0
- PyFishPack/src/main.f90 +10 -0
- PyFishPack/src/pyfishpack_module.c +1302 -0
- PyFishPack/src/real_block_tridiagonal_linear_systems_solver.f90 +319 -0
- PyFishPack/src/sepeli.f90 +1454 -0
- PyFishPack/src/sepx4.f90 +1338 -0
- PyFishPack/src/staggered_axisymmetric_spherical_solver.f90 +908 -0
- PyFishPack/src/staggered_cartesian_solver.f90 +553 -0
- PyFishPack/src/staggered_cylindrical_solver.f90 +630 -0
- PyFishPack/src/staggered_helmholtz_solvers.f90 +172 -0
- PyFishPack/src/staggered_polar_solver.f90 +651 -0
- PyFishPack/src/staggered_real_linear_systems_solver.f90 +258 -0
- PyFishPack/src/staggered_spherical_solver.f90 +758 -0
- PyFishPack/src/three_dimensional_solvers.f90 +602 -0
- PyFishPack/src/type_CenteredCyclicReductionUtility.f90 +1714 -0
- PyFishPack/src/type_CyclicReductionUtility.f90 +472 -0
- PyFishPack/src/type_FishpackWorkspace.f90 +290 -0
- PyFishPack/src/type_GeneralizedCyclicReductionUtility.f90 +1980 -0
- PyFishPack/src/type_PeriodicFastFourierTransform.f90 +3789 -0
- PyFishPack/src/type_SepAux.f90 +586 -0
- PyFishPack/src/type_StaggeredCyclicReductionUtility.f90 +893 -0
- pyfishpack-0.1.0.dist-info/DELVEWHEEL +2 -0
- pyfishpack-0.1.0.dist-info/METADATA +81 -0
- pyfishpack-0.1.0.dist-info/RECORD +81 -0
- pyfishpack-0.1.0.dist-info/WHEEL +5 -0
- pyfishpack-0.1.0.dist-info/licenses/LICENSE +21 -0
- pyfishpack-0.1.0.dist-info/top_level.txt +1 -0
- pyfishpack.libs/libgcc_s_seh-1-25d59ccffa1a9009644065b069829e07.dll +0 -0
- pyfishpack.libs/libgfortran-5-08f2195cfa0d823e13371c5c3186a82a.dll +0 -0
- pyfishpack.libs/libquadmath-0-c5abb9113f1ee64b87a889958e4b7418.dll +0 -0
- pyfishpack.libs/libwinpthread-1-83908d14abfafb8b3bfa38cf51ecee56.dll +0 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
!
|
|
2
|
+
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
3
|
+
! * *
|
|
4
|
+
! * copyright (c) 2005 by UCAR *
|
|
5
|
+
! * *
|
|
6
|
+
! * University Corporation for Atmospheric Research *
|
|
7
|
+
! * *
|
|
8
|
+
! * all rights reserved *
|
|
9
|
+
! * *
|
|
10
|
+
! * Fishpack *
|
|
11
|
+
! * *
|
|
12
|
+
! * A Package of Fortran *
|
|
13
|
+
! * *
|
|
14
|
+
! * Subroutines and Example Programs *
|
|
15
|
+
! * *
|
|
16
|
+
! * for Modeling Geophysical Processes *
|
|
17
|
+
! * *
|
|
18
|
+
! * by *
|
|
19
|
+
! * *
|
|
20
|
+
! * John Adams, Paul Swarztrauber and Roland Sweet *
|
|
21
|
+
! * *
|
|
22
|
+
! * of *
|
|
23
|
+
! * *
|
|
24
|
+
! * the National Center for Atmospheric Research *
|
|
25
|
+
! * *
|
|
26
|
+
! * Boulder, Colorado (80307) U.S.A. *
|
|
27
|
+
! * *
|
|
28
|
+
! * which is sponsored by *
|
|
29
|
+
! * *
|
|
30
|
+
! * the National Science Foundation *
|
|
31
|
+
! * *
|
|
32
|
+
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
33
|
+
!
|
|
34
|
+
|
|
35
|
+
module centered_real_linear_systems_solver
|
|
36
|
+
|
|
37
|
+
use fishpack_precision, only: &
|
|
38
|
+
wp, & ! Working precision
|
|
39
|
+
ip ! Integer precision
|
|
40
|
+
|
|
41
|
+
use type_FishpackWorkspace, only: &
|
|
42
|
+
FishpackWorkspace
|
|
43
|
+
|
|
44
|
+
use type_CenteredCyclicReductionUtility, only: &
|
|
45
|
+
CenteredCyclicReductionUtility
|
|
46
|
+
|
|
47
|
+
! Explicit typing only
|
|
48
|
+
implicit none
|
|
49
|
+
|
|
50
|
+
! Everything is private unless stated otherwise
|
|
51
|
+
private
|
|
52
|
+
public :: genbun
|
|
53
|
+
|
|
54
|
+
contains
|
|
55
|
+
|
|
56
|
+
! SUBROUTINE genbun(nperod, n, mperod, m, a, b, c, idimy, y, ierror)
|
|
57
|
+
!
|
|
58
|
+
!
|
|
59
|
+
! DIMENSION OF a(m), b(m), c(m), y(idimy, n)
|
|
60
|
+
! ARGUMENTS
|
|
61
|
+
!
|
|
62
|
+
! PURPOSE The name of this package is a mnemonic for the
|
|
63
|
+
! generalized buneman algorithm.
|
|
64
|
+
!
|
|
65
|
+
! It solves the real linear system of equations
|
|
66
|
+
!
|
|
67
|
+
! a(i)*x(i-1, j) + b(i)*x(i, j) + c(i)*x(i+1, j)
|
|
68
|
+
! + x(i, j-1) - 2.0*x(i, j) + x(i, j+1) = y(i, j)
|
|
69
|
+
!
|
|
70
|
+
! for i = 1, 2, ..., m and j = 1, 2, ..., n.
|
|
71
|
+
!
|
|
72
|
+
! indices i+1 and i-1 are evaluated modulo m,
|
|
73
|
+
! i.e., x(0, j) = x(m, j) and x(m+1, j) = x(1, j),
|
|
74
|
+
! and x(i, 0) may equal 0, x(i, 2), or x(i, n),
|
|
75
|
+
! and x(i, n+1) may equal 0, x(i, n-1), or x(i, 1)
|
|
76
|
+
! depending on an input parameter.
|
|
77
|
+
!
|
|
78
|
+
! USAGE call genbun(nperod, n, mperod, m, a, b, c, idimy, y, ierror)
|
|
79
|
+
!
|
|
80
|
+
! ARGUMENTS
|
|
81
|
+
!
|
|
82
|
+
! ON INPUT nperod
|
|
83
|
+
!
|
|
84
|
+
! Indicates the values that x(i, 0) and
|
|
85
|
+
! x(i, n+1) are assumed to have.
|
|
86
|
+
!
|
|
87
|
+
! = 0 if x(i, 0) = x(i, n) and x(i, n+1) =
|
|
88
|
+
! x(i, 1).
|
|
89
|
+
! = 1 if x(i, 0) = x(i, n+1) = 0 .
|
|
90
|
+
! = 2 if x(i, 0) = 0 and x(i, n+1) = x(i, n-1).
|
|
91
|
+
! = 3 if x(i, 0) = x(i, 2) and x(i, n+1) =
|
|
92
|
+
! x(i, n-1).
|
|
93
|
+
! = 4 if x(i, 0) = x(i, 2) and x(i, n+1) = 0.
|
|
94
|
+
!
|
|
95
|
+
! n
|
|
96
|
+
! The number of unknowns in the j-direction.
|
|
97
|
+
! n must be greater than 2.
|
|
98
|
+
!
|
|
99
|
+
! mperod
|
|
100
|
+
! = 0 if a(1) and c(m) are not zero
|
|
101
|
+
! = 1 if a(1) = c(m) = 0
|
|
102
|
+
!
|
|
103
|
+
! m
|
|
104
|
+
! The number of unknowns in the i-direction.
|
|
105
|
+
! n must be greater than 2.
|
|
106
|
+
!
|
|
107
|
+
! a, b, c
|
|
108
|
+
! One-dimensional arrays of length m that
|
|
109
|
+
! specify the coefficients in the linear
|
|
110
|
+
! equations given above. if mperod = 0
|
|
111
|
+
! the array elements must not depend upon
|
|
112
|
+
! the index i, but must be constant.
|
|
113
|
+
! specifically, the subroutine checks the
|
|
114
|
+
! following condition .
|
|
115
|
+
!
|
|
116
|
+
! a(i) = c(1)
|
|
117
|
+
! c(i) = c(1)
|
|
118
|
+
! b(i) = b(1)
|
|
119
|
+
!
|
|
120
|
+
! for i=1, 2, ..., m.
|
|
121
|
+
!
|
|
122
|
+
! idimy
|
|
123
|
+
! The row (or first) dimension of the
|
|
124
|
+
! two-dimensional array y as it appears
|
|
125
|
+
! in the program calling genbun.
|
|
126
|
+
! this parameter is used to specify the
|
|
127
|
+
! variable dimension of y.
|
|
128
|
+
! idimy must be at least m.
|
|
129
|
+
!
|
|
130
|
+
! y
|
|
131
|
+
! A two-dimensional complex array that
|
|
132
|
+
! specifies the values of the right side
|
|
133
|
+
! of the linear system of equations given
|
|
134
|
+
! above.
|
|
135
|
+
! y must be dimensioned at least m*n.
|
|
136
|
+
!
|
|
137
|
+
!
|
|
138
|
+
! ON OUTPUT y
|
|
139
|
+
!
|
|
140
|
+
! Contains the solution x.
|
|
141
|
+
!
|
|
142
|
+
! ierror
|
|
143
|
+
! An error flag which indicates invalid
|
|
144
|
+
! input parameters except for number
|
|
145
|
+
! zero, a solution is not attempted.
|
|
146
|
+
!
|
|
147
|
+
! = 0 no error
|
|
148
|
+
! = 1 m <= 2
|
|
149
|
+
! = 2 n <= 2
|
|
150
|
+
! = 3 idimy <= m
|
|
151
|
+
! = 4 nperod <= 0 or nperod > 4
|
|
152
|
+
! = 5 mperod < 0 or mperod > 1
|
|
153
|
+
! = 6 a(i) /= c(1) or c(i) /= c(1) or
|
|
154
|
+
! b(i) /= b(1) for
|
|
155
|
+
! some i=1, 2, ..., m.
|
|
156
|
+
! = 7 a(1) /= 0 or c(m) /= 0 and
|
|
157
|
+
! mperod = 1
|
|
158
|
+
! = 20 If the dynamic allocation of real and
|
|
159
|
+
! complex workspace required for solution
|
|
160
|
+
! fails (for example if n, m are too large
|
|
161
|
+
! for your computer)
|
|
162
|
+
!
|
|
163
|
+
! HISTORY Written in 1979 by Roland Sweet of NCAR'S
|
|
164
|
+
! scientific computing division. made available
|
|
165
|
+
! on NCAR'S public libraries in January, 1980.
|
|
166
|
+
!
|
|
167
|
+
! Revised in June 2004 by John Adams using
|
|
168
|
+
! Fortran 90 dynamically allocated workspace.
|
|
169
|
+
!
|
|
170
|
+
! ALGORITHM The linear system is solved by a cyclic
|
|
171
|
+
! reduction algorithm described in the
|
|
172
|
+
! reference.
|
|
173
|
+
!
|
|
174
|
+
! REFERENCES Sweet, R., "A cyclic reduction algorithm for
|
|
175
|
+
! solving block tridiagonal systems of arbitrary
|
|
176
|
+
! dimensions, " SIAM J. On Numer. Anal., 14 (1977)
|
|
177
|
+
! PP. 706-720.
|
|
178
|
+
!
|
|
179
|
+
! ACCURACY This test was performed on a platform with
|
|
180
|
+
! 64 bit floating point arithmetic.
|
|
181
|
+
! a uniform random number generator was used
|
|
182
|
+
! to create a solution array x for the system
|
|
183
|
+
! given in the 'purpose' description above
|
|
184
|
+
! with
|
|
185
|
+
! a(i) = c(i) = -HALF *b(i) = 1, i=1, 2, ..., m
|
|
186
|
+
!
|
|
187
|
+
! and, when mperod = 1
|
|
188
|
+
!
|
|
189
|
+
! a(1) = c(m) = 0
|
|
190
|
+
! a(m) = c(1) = 2.
|
|
191
|
+
!
|
|
192
|
+
! The solution x was substituted into the
|
|
193
|
+
! given system and, using double precision
|
|
194
|
+
! a right side y was computed.
|
|
195
|
+
! using this array y, subroutine genbun
|
|
196
|
+
! was called to produce approximate
|
|
197
|
+
! solution z. then relative error
|
|
198
|
+
! e = max(abs(z(i, j)-x(i, j)))/
|
|
199
|
+
! max(abs(x(i, j)))
|
|
200
|
+
! was computed, where the two maxima are taken
|
|
201
|
+
! over i=1, 2, ..., m and j=1, ..., n.
|
|
202
|
+
!
|
|
203
|
+
! The value of e is given in the table
|
|
204
|
+
! below for some typical values of m and n.
|
|
205
|
+
!
|
|
206
|
+
! m (=n) mperod nperod e
|
|
207
|
+
! ------ ------ ------ ------
|
|
208
|
+
!
|
|
209
|
+
! 31 0 0 6.e-14
|
|
210
|
+
! 31 1 1 4.e-13
|
|
211
|
+
! 31 1 3 3.e-13
|
|
212
|
+
! 32 0 0 9.e-14
|
|
213
|
+
! 32 1 1 3.e-13
|
|
214
|
+
! 32 1 3 1.e-13
|
|
215
|
+
! 33 0 0 9.e-14
|
|
216
|
+
! 33 1 1 4.e-13
|
|
217
|
+
! 33 1 3 1.e-13
|
|
218
|
+
! 63 0 0 1.e-13
|
|
219
|
+
! 63 1 1 1.e-12
|
|
220
|
+
! 63 1 3 2.e-13
|
|
221
|
+
! 64 0 0 1.e-13
|
|
222
|
+
! 64 1 1 1.e-12
|
|
223
|
+
! 64 1 3 6.e-13
|
|
224
|
+
! 65 0 0 2.e-13
|
|
225
|
+
! 65 1 1 1.e-12
|
|
226
|
+
! 65 1 3 4.e-13
|
|
227
|
+
!
|
|
228
|
+
subroutine genbun(nperod, n, mperod, m, a, b, c, idimy, y, ierror)
|
|
229
|
+
|
|
230
|
+
! Dummy arguments
|
|
231
|
+
integer(ip), intent(in) :: nperod
|
|
232
|
+
integer(ip), intent(in) :: n
|
|
233
|
+
integer(ip), intent(in) :: mperod
|
|
234
|
+
integer(ip), intent(in) :: m
|
|
235
|
+
integer(ip), intent(in) :: idimy
|
|
236
|
+
integer(ip), intent(out) :: ierror
|
|
237
|
+
real(wp), intent(in) :: a(:)
|
|
238
|
+
real(wp), intent(in) :: b(:)
|
|
239
|
+
real(wp), intent(in) :: c(:)
|
|
240
|
+
real(wp), intent(inout) :: y(idimy,n)
|
|
241
|
+
|
|
242
|
+
! Local variables
|
|
243
|
+
type(FishpackWorkspace) :: workspace
|
|
244
|
+
type(CenteredCyclicReductionUtility) :: util
|
|
245
|
+
|
|
246
|
+
! Allocate memory
|
|
247
|
+
workspace = genbun_get_workspace(n, m)
|
|
248
|
+
|
|
249
|
+
! Solve system
|
|
250
|
+
associate( rew => workspace%real_workspace )
|
|
251
|
+
call util%genbun_lower_routine(nperod, n, mperod, m, a, b, c, idimy, y, ierror, rew)
|
|
252
|
+
end associate
|
|
253
|
+
|
|
254
|
+
! Release memory
|
|
255
|
+
call workspace%destroy()
|
|
256
|
+
|
|
257
|
+
end subroutine genbun
|
|
258
|
+
|
|
259
|
+
function genbun_get_workspace(n, m) &
|
|
260
|
+
result (return_value)
|
|
261
|
+
|
|
262
|
+
! Dummy arguments
|
|
263
|
+
integer(ip), intent(in) :: n, m
|
|
264
|
+
type(FishpackWorkspace) :: return_value
|
|
265
|
+
|
|
266
|
+
! Local variables
|
|
267
|
+
integer(ip) :: irwk, icwk
|
|
268
|
+
|
|
269
|
+
! Get workspace dimensions for genbun
|
|
270
|
+
call return_value%compute_genbun_workspace_lengths(n, m, irwk)
|
|
271
|
+
|
|
272
|
+
! No need to allocate complex arrays
|
|
273
|
+
icwk = 0
|
|
274
|
+
|
|
275
|
+
! Allocate memory
|
|
276
|
+
call return_value%create(irwk, icwk)
|
|
277
|
+
|
|
278
|
+
end function genbun_get_workspace
|
|
279
|
+
|
|
280
|
+
end module centered_real_linear_systems_solver
|