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.
Files changed (81) hide show
  1. PyFishPack/__init__.py +86 -0
  2. PyFishPack/__pycache__/__init__.cpython-313.pyc +0 -0
  3. PyFishPack/__pycache__/apps.cpython-313.pyc +0 -0
  4. PyFishPack/_dummy.c +23 -0
  5. PyFishPack/_dummy.cp313-win_amd64.pyd +0 -0
  6. PyFishPack/apps.py +3640 -0
  7. PyFishPack/fishpack.cp313-win_amd64.dll.a +0 -0
  8. PyFishPack/fishpack.cp313-win_amd64.pyd +0 -0
  9. PyFishPack/meson.build +213 -0
  10. PyFishPack/src/archive/f77/Makefile +19 -0
  11. PyFishPack/src/archive/f77/blktri.f +1404 -0
  12. PyFishPack/src/archive/f77/cblktri.f +1414 -0
  13. PyFishPack/src/archive/f77/cmgnbn.f +1592 -0
  14. PyFishPack/src/archive/f77/comf.f +186 -0
  15. PyFishPack/src/archive/f77/fftpack.f +2968 -0
  16. PyFishPack/src/archive/f77/genbun.f +1335 -0
  17. PyFishPack/src/archive/f77/gnbnaux.f +314 -0
  18. PyFishPack/src/archive/f77/hstcrt.f +443 -0
  19. PyFishPack/src/archive/f77/hstcsp.f +683 -0
  20. PyFishPack/src/archive/f77/hstcyl.f +485 -0
  21. PyFishPack/src/archive/f77/hstplr.f +538 -0
  22. PyFishPack/src/archive/f77/hstssp.f +634 -0
  23. PyFishPack/src/archive/f77/hw3crt.f +687 -0
  24. PyFishPack/src/archive/f77/hwscrt.f +512 -0
  25. PyFishPack/src/archive/f77/hwscsp.f +728 -0
  26. PyFishPack/src/archive/f77/hwscyl.f +538 -0
  27. PyFishPack/src/archive/f77/hwsplr.f +602 -0
  28. PyFishPack/src/archive/f77/hwsssp.f +780 -0
  29. PyFishPack/src/archive/f77/pois3d.f +550 -0
  30. PyFishPack/src/archive/f77/poistg.f +875 -0
  31. PyFishPack/src/archive/f77/sepaux.f +361 -0
  32. PyFishPack/src/archive/f77/sepeli.f +1029 -0
  33. PyFishPack/src/archive/f77/sepx4.f +958 -0
  34. PyFishPack/src/centered_axisymmetric_spherical_solver.f90 +1002 -0
  35. PyFishPack/src/centered_cartesian_helmholtz_solver_3d.f90 +819 -0
  36. PyFishPack/src/centered_cartesian_solver.f90 +583 -0
  37. PyFishPack/src/centered_cylindrical_solver.f90 +634 -0
  38. PyFishPack/src/centered_helmholtz_solvers.f90 +156 -0
  39. PyFishPack/src/centered_polar_solver.f90 +746 -0
  40. PyFishPack/src/centered_real_linear_systems_solver.f90 +280 -0
  41. PyFishPack/src/centered_spherical_solver.f90 +928 -0
  42. PyFishPack/src/complex_block_tridiagonal_linear_systems_solver.f90 +1947 -0
  43. PyFishPack/src/complex_linear_systems_solver.f90 +1787 -0
  44. PyFishPack/src/fftpack_c_api.f90 +86 -0
  45. PyFishPack/src/fishpack.f90 +191 -0
  46. PyFishPack/src/fishpack.pyf +504 -0
  47. PyFishPack/src/fishpack_c_api.f90 +365 -0
  48. PyFishPack/src/fishpack_original.pyf +2119 -0
  49. PyFishPack/src/fishpack_precision.f90 +53 -0
  50. PyFishPack/src/general_linear_systems_solver_3d.f90 +296 -0
  51. PyFishPack/src/iterative_solvers.f90 +969 -0
  52. PyFishPack/src/main.f90 +10 -0
  53. PyFishPack/src/pyfishpack_module.c +1302 -0
  54. PyFishPack/src/real_block_tridiagonal_linear_systems_solver.f90 +319 -0
  55. PyFishPack/src/sepeli.f90 +1454 -0
  56. PyFishPack/src/sepx4.f90 +1338 -0
  57. PyFishPack/src/staggered_axisymmetric_spherical_solver.f90 +908 -0
  58. PyFishPack/src/staggered_cartesian_solver.f90 +553 -0
  59. PyFishPack/src/staggered_cylindrical_solver.f90 +630 -0
  60. PyFishPack/src/staggered_helmholtz_solvers.f90 +172 -0
  61. PyFishPack/src/staggered_polar_solver.f90 +651 -0
  62. PyFishPack/src/staggered_real_linear_systems_solver.f90 +258 -0
  63. PyFishPack/src/staggered_spherical_solver.f90 +758 -0
  64. PyFishPack/src/three_dimensional_solvers.f90 +602 -0
  65. PyFishPack/src/type_CenteredCyclicReductionUtility.f90 +1714 -0
  66. PyFishPack/src/type_CyclicReductionUtility.f90 +472 -0
  67. PyFishPack/src/type_FishpackWorkspace.f90 +290 -0
  68. PyFishPack/src/type_GeneralizedCyclicReductionUtility.f90 +1980 -0
  69. PyFishPack/src/type_PeriodicFastFourierTransform.f90 +3789 -0
  70. PyFishPack/src/type_SepAux.f90 +586 -0
  71. PyFishPack/src/type_StaggeredCyclicReductionUtility.f90 +893 -0
  72. pyfishpack-0.1.0.dist-info/DELVEWHEEL +2 -0
  73. pyfishpack-0.1.0.dist-info/METADATA +81 -0
  74. pyfishpack-0.1.0.dist-info/RECORD +81 -0
  75. pyfishpack-0.1.0.dist-info/WHEEL +5 -0
  76. pyfishpack-0.1.0.dist-info/licenses/LICENSE +21 -0
  77. pyfishpack-0.1.0.dist-info/top_level.txt +1 -0
  78. pyfishpack.libs/libgcc_s_seh-1-25d59ccffa1a9009644065b069829e07.dll +0 -0
  79. pyfishpack.libs/libgfortran-5-08f2195cfa0d823e13371c5c3186a82a.dll +0 -0
  80. pyfishpack.libs/libquadmath-0-c5abb9113f1ee64b87a889958e4b7418.dll +0 -0
  81. pyfishpack.libs/libwinpthread-1-83908d14abfafb8b3bfa38cf51ecee56.dll +0 -0
@@ -0,0 +1,319 @@
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
+ module real_block_tridiagonal_linear_systems_solver
35
+
36
+ use fishpack_precision, only: &
37
+ wp, & ! Working precision
38
+ ip ! Integer precision
39
+
40
+ use type_FishpackWorkspace, only: &
41
+ FishpackWorkspace
42
+
43
+ use type_GeneralizedCyclicReductionUtility, only: &
44
+ GeneralizedCyclicReductionUtility
45
+
46
+ ! Explicit typing only
47
+ implicit none
48
+
49
+ ! Everything is private unless stated otherwise
50
+ private
51
+ public :: blktri
52
+
53
+ contains
54
+
55
+ !
56
+ ! SUBROUTINE blktri(iflg, np, n, an, bn, cn, mp, m, am, bm, cm,
57
+ ! idimy, y, ierror, workspace)
58
+ !
59
+ !
60
+ !
61
+ ! DIMENSION OF an(n), bn(n), cn(n), am(m), bm(m), cm(m), y(idimy, n)
62
+ ! ARGUMENTS
63
+ !
64
+ ! USAGE call blktri(iflg, np, n, an, bn, cn, mp, m, &
65
+ ! am, bm, cm, idimy, y, ierror, workspace)
66
+ !
67
+ ! PURPOSE blktri solves a system of linear equations
68
+ ! of the form
69
+ !
70
+ ! an(j)*x(i, j-1) + am(i)*x(i-1, j) +
71
+ ! (bn(j)+bm(i))*x(i, j) + cn(j)*x(i, j+1) +
72
+ ! cm(i)*x(i+1, j) = y(i, j)
73
+ !
74
+ ! for i = 1, 2, ..., m and j = 1, 2, ..., n.
75
+ !
76
+ ! i+1 and i-1 are evaluated modulo m and
77
+ ! j+1 and j-1 modulo n, i.e.,
78
+ !
79
+ ! x(i, 0) = x(i, n), x(i, n+1) = x(i, 1),
80
+ ! x(0, j) = x(m, j), x(m+1, j) = x(1, j).
81
+ !
82
+ ! These equations usually result from the
83
+ ! discretization of separable elliptic
84
+ ! equations. Boundary conditions may be
85
+ ! dirichlet, neumann, or periodic.
86
+ !
87
+ ! ARGUMENTS
88
+ !
89
+ ! ON INPUT iflg
90
+ !
91
+ ! = 0 Unitialization only.
92
+ ! certain quantities that depend on np,
93
+ ! n, an, bn, and cn are computed and
94
+ ! stored in derived data type w (see
95
+ ! description of w below)
96
+ !
97
+ ! = 1 The quantities that were computed
98
+ ! in the initialization are used
99
+ ! to obtain the solution x(i, j).
100
+ !
101
+ ! note:
102
+ ! A call with iflg=0 takes
103
+ ! approximately one half the time
104
+ ! as a call with iflg = 1.
105
+ ! however, the initialization does
106
+ ! not have to be repeated unless np,
107
+ ! n, an, bn, or cn change.
108
+ !
109
+ ! np
110
+ ! = 0 If an(1) and cn(n) are not zero,
111
+ ! which corresponds to periodic
112
+ ! bounary conditions.
113
+ !
114
+ ! = 1 If an(1) and cn(n) are zero.
115
+ !
116
+ ! n
117
+ ! The number of unknowns in the j-direction.
118
+ ! n must be greater than 4.
119
+ ! The operation count is proportional to
120
+ ! m*n*log2(n), hence n should be selected
121
+ ! less than or equal to m.
122
+ !
123
+ ! an, bn, cn
124
+ ! One-dimensional arrays of length n
125
+ ! that specify the coefficients in the
126
+ ! linear equations given above.
127
+ !
128
+ ! mp
129
+ ! = 0 If am(1) and cm(m) are not zero,
130
+ ! which corresponds to periodic
131
+ ! boundary conditions.
132
+ !
133
+ ! = 1 If am(1) = cm(m) = 0 .
134
+ !
135
+ ! m
136
+ ! The number of unknowns in the i-direction.
137
+ ! m must be greater than 4.
138
+ !
139
+ ! am, bm, cm
140
+ ! One-dimensional arrays of length m that
141
+ ! specify the coefficients in the linear
142
+ ! equations given above.
143
+ !
144
+ ! idimy
145
+ ! The row (or first) dimension of the
146
+ ! two-dimensional array y as it appears
147
+ ! in the program calling blktri.
148
+ ! This parameter is used to specify the
149
+ ! variable dimension of y.
150
+ ! idimy must be at least m.
151
+ !
152
+ ! y
153
+ ! A two-dimensional array that specifies
154
+ ! the values of the right side of the linear
155
+ ! system of equations given above.
156
+ ! y must be dimensioned at least m*n.
157
+ !
158
+ ! workspace
159
+ ! A FishpackWorkspace derived data type
160
+ ! that must be declared by the user which is used
161
+ ! internally in blktri to dynamically allocate real
162
+ ! and complex workspace arrays used in calls to lower routines.
163
+ ! An error flag (ierror = 20) is set if the required
164
+ ! workspace allocation fails (for example if n, m
165
+ ! are too large). Real and complex values are set in
166
+ ! the components of workspace on a initial (iflg=0)
167
+ ! call to blktri. These must be preserved on
168
+ ! non-initial calls (iflg=1) to blktri.
169
+ ! This eliminates redundant calculations
170
+ ! and saves compute time.
171
+ !
172
+ ! **** IMPORTANT! The user program calling blktri should
173
+ ! include the statement:
174
+ !
175
+ ! call workspace%destroy()
176
+ !
177
+ ! after the final approximation is generated by
178
+ ! blktri. This will deallocate the real and complex
179
+ ! array components of workspace. Failure to include this
180
+ ! statement could result in serious memory leakage.
181
+ !
182
+ !
183
+ ! ARGUMENTS
184
+ !
185
+ ! ON OUTPUT y
186
+ ! Contains the solution x.
187
+ !
188
+ ! ierror
189
+ ! An error flag that indicates invalid
190
+ ! input parameters. except for number zer0,
191
+ ! a solution is not attempted.
192
+ !
193
+ ! = 0 no error.
194
+ ! = 1 m < than 5
195
+ ! = 2 n < than 5
196
+ ! = 3 idimy < m.
197
+ ! = 4 blktri failed while computing results
198
+ ! that depend on the coefficient arrays
199
+ ! an, bn, cn. Check these arrays.
200
+ ! = 5 an(j)*cn(j-1) is less than 0 for some j.
201
+ !
202
+ ! Possible reasons for this condition are
203
+ ! 1. The arrays an and cn are not correct
204
+ ! 2. Too large a grid spacing was used
205
+ ! in the discretization of the elliptic
206
+ ! equation.
207
+ ! 3. The linear equations resulted from a
208
+ ! partial differential equation which
209
+ ! was not elliptic.
210
+ !
211
+ ! = 20 If the dynamic allocation of real and
212
+ ! complex workspace in the derived type
213
+ ! (FishpackWorkspace) variable W fails (e.g.,
214
+ ! if N, M are too large for the platform used)
215
+ !
216
+ !
217
+ ! workspace
218
+ ! The derived type(FishpackWorkspace) variable
219
+ ! contains real and complex array components that
220
+ ! must not be destroyed if blktri is called again with
221
+ ! iflg=1.
222
+ !
223
+ !
224
+ ! SPECIAL CONDITIONS The algorithm may fail if abs(bm(i)+bn(j))
225
+ ! is less than abs(am(i))+abs(an(j))+
226
+ ! abs(cm(i))+abs(cn(j))
227
+ ! for some i and j. the algorithm will also
228
+ ! fail if an(j)*cn(j-1) is less than zero for
229
+ ! some j.
230
+ ! see the description of the output parameter
231
+ ! ierror.
232
+ !
233
+ !
234
+ ! HISTORY * Written by Paul Swarztrauber at NCAR in the
235
+ ! early 1970's.
236
+ ! * Rewritten and released in libraries in January 1980.
237
+ ! * Revised in June 2004 using Fortan 90 dynamically
238
+ ! allocated workspace and derived data types to
239
+ ! eliminate mixed mode conflicts in the earlier versions.
240
+ ! * Revised in April 2016 to implement features of
241
+ ! Fortran 2008+
242
+ !
243
+ ! ALGORITHM Generalized cyclic reduction
244
+ !
245
+ ! PORTABILITY Approximate machine accuracy is obtained
246
+ ! using EPS which is set by the intrinsic epsilon function
247
+ !
248
+ ! REFERENCES Swarztrauber, P. and R. Sweet, 'Efficient
249
+ ! fortran subprograms for the solution of
250
+ ! elliptic equations'
251
+ ! NCAR TN/IA-109, July, 1975, 138 pp.
252
+ !
253
+ ! Swarztrauber P. N., A direct method for
254
+ ! the discrete solution of separable
255
+ ! elliptic equations, SIAM
256
+ ! J. Numer. Anal., 11(1974) pp. 1136-1150.
257
+ !
258
+ subroutine blktri(iflg, np, n, an, bn, cn, mp, m, am, bm, cm, &
259
+ idimy, y, ierror, workspace)
260
+
261
+ ! Dummy arguments
262
+ integer(ip), intent(in) :: iflg
263
+ integer(ip), intent(in) :: np
264
+ integer(ip), intent(in) :: n
265
+ integer(ip), intent(in) :: mp
266
+ integer(ip), intent(in) :: m
267
+ integer(ip), intent(in) :: idimy
268
+ integer(ip), intent(out) :: ierror
269
+ real(wp), intent(in) :: an(:)
270
+ real(wp), intent(in) :: bn(:)
271
+ real(wp), intent(in) :: cn(:)
272
+ real(wp), intent(in) :: am(:)
273
+ real(wp), intent(in) :: bm(:)
274
+ real(wp), intent(in) :: cm(:)
275
+ real(wp), intent(inout) :: y(:,:)
276
+ class(FishpackWorkspace), intent(inout) :: workspace
277
+
278
+ ! Local variables
279
+ type(GeneralizedCyclicReductionUtility), save :: blktri_aux
280
+
281
+ ! Check input arguments
282
+ call blktri_aux%check_input_arguments(n, m, idimy, ierror)
283
+
284
+ ! Check error flag
285
+ if (ierror /= 0) return
286
+
287
+ ! Allocate memory on first call only
288
+ if (iflg == 0) call initialize_blktri_workspace(n, m, workspace)
289
+
290
+ ! Solve system
291
+ associate( &
292
+ rew => workspace%real_workspace, &
293
+ cxw => workspace%complex_workspace &
294
+ )
295
+ call blktri_aux%blktrii(iflg, np, n, an, bn, cn, &
296
+ mp, m, am, bm, cm, idimy, y, ierror, rew, cxw)
297
+ end associate
298
+
299
+ end subroutine blktri
300
+
301
+ subroutine initialize_blktri_workspace(n, m, workspace)
302
+
303
+ ! Dummy arguments
304
+ integer(ip), intent(in) :: n
305
+ integer(ip), intent(in) :: m
306
+ class(FishpackWorkspace), intent(out) :: workspace
307
+
308
+ ! Local variables
309
+ integer(ip) :: irwk, icwk
310
+
311
+ ! compute real and complex required workspace sizes
312
+ call workspace%compute_blktri_workspace_lengths(n, m, irwk, icwk)
313
+
314
+ ! Allocate memory
315
+ call workspace%create(irwk, icwk)
316
+
317
+ end subroutine initialize_blktri_workspace
318
+
319
+ end module real_block_tridiagonal_linear_systems_solver