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,290 @@
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
+ ! Purpose:
36
+ !
37
+ ! This module is used by all fishpack solvers
38
+ ! to allocate real and complex workspace arrays
39
+ !
40
+ module type_FishpackWorkspace
41
+
42
+ use fishpack_precision, only: &
43
+ wp, & ! Working precision
44
+ ip ! Integer precision
45
+
46
+ ! Explicit typing only
47
+ implicit none
48
+
49
+ ! Everything is private unless stated otherwise
50
+ private
51
+ public :: FishpackWorkspace
52
+
53
+ ! Parameters confined to the module
54
+ real(wp), parameter :: TWO = 2.0_wp
55
+ real(wp), parameter :: LOG_TWO = log(TWO)
56
+
57
+ type, public :: FishpackWorkspace
58
+ ! Type components
59
+ real(wp), allocatable :: real_workspace(:)
60
+ complex(wp), allocatable :: complex_workspace(:)
61
+ integer(ip), allocatable :: workspace_indices(:)
62
+ contains
63
+ ! Type-bound procedures
64
+ procedure, public :: create => create_fishpack_workspace
65
+ procedure, public :: destroy => destroy_fishpack_workspace
66
+ procedure, public, nopass :: compute_blktri_workspace_lengths
67
+ procedure, public, nopass :: compute_genbun_workspace_lengths
68
+ procedure, public :: initialize_staggered_workspace
69
+ procedure, public :: initialize_centered_workspace
70
+ end type FishpackWorkspace
71
+
72
+ ! Declare user-defined constructor
73
+ interface FishpackWorkspace
74
+ module procedure fishpack_workspace_constructor
75
+ end interface
76
+
77
+ contains
78
+
79
+ function fishpack_workspace_constructor(irwk, icwk, iiwk) &
80
+ result (return_value)
81
+
82
+ ! Dummy arguments
83
+ integer(ip), intent(in) :: irwk ! required real workspace length
84
+ integer(ip), intent(in) :: icwk ! required integer workspace length
85
+ integer(ip), optional, intent(in) :: iiwk
86
+ type(FishpackWorkspace) :: return_value
87
+
88
+ ! Local variables
89
+ integer(ip) :: iiwk_op
90
+
91
+ ! Address optional argument
92
+ if (present(iiwk)) then
93
+ iiwk_op = iiwk
94
+ else
95
+ iiwk_op = -1
96
+ end if
97
+
98
+ ! Initialize workspace
99
+ call return_value%create(irwk, icwk, iiwk_op)
100
+
101
+ end function fishpack_workspace_constructor
102
+
103
+ subroutine create_fishpack_workspace(self, irwk, icwk, iiwk)
104
+
105
+ ! Dummy arguments
106
+ class(FishpackWorkspace), intent(inout) :: self
107
+ integer(ip), intent(in) :: irwk ! required real workspace length
108
+ integer(ip), intent(in) :: icwk ! required integer workspace length
109
+ integer(ip), optional, intent(in) :: iiwk
110
+
111
+ ! Local variables
112
+ integer(ip) :: allocation_status
113
+
114
+ ! Ensure that object is usable
115
+ call self%destroy()
116
+
117
+ if (irwk > 0) then
118
+ ! Allocate irwk words of real workspace
119
+ allocate( self%real_workspace(irwk), stat=allocation_status )
120
+
121
+ ! Check if real allocation was successful
122
+ if (allocation_status /= 0 ) then
123
+ error stop 'Object of class(FishpackWorkspace): '&
124
+ //'failed to allocate real_workspace array '&
125
+ //'in create_fishpack_workspace'
126
+ end if
127
+ end if
128
+
129
+ if (icwk > 0) then
130
+ ! Allocate icwk words of complex workspace
131
+ allocate( self%complex_workspace(icwk), stat=allocation_status )
132
+
133
+ ! Check if complex allocation was successful
134
+ if (allocation_status /= 0 ) then
135
+ error stop 'Object of class(FishpackWorkspace): '&
136
+ //'failed to allocate complex_workspace array '&
137
+ //'in create_fishpack_workspace'
138
+ end if
139
+ end if
140
+
141
+ ! Address optional argument
142
+ if (present(iiwk)) then
143
+ if (iiwk > 0) then
144
+ ! Allocate iwwk words of integer workspace
145
+ allocate( self%workspace_indices(iiwk), stat=allocation_status )
146
+
147
+ ! Check if integer allocation was successful
148
+ if (allocation_status /= 0 ) then
149
+ error stop 'Object of class(FishpackWorkspace): '&
150
+ //'failed to allocate workspace_indices array '&
151
+ //'in create_fishpack_workspace'
152
+ end if
153
+ end if
154
+ end if
155
+
156
+ end subroutine create_fishpack_workspace
157
+
158
+ subroutine initialize_staggered_workspace(self, n, m)
159
+
160
+ ! Dummy arguments
161
+ class(FishpackWorkspace), intent(inout) :: self
162
+ integer(ip), intent(in) :: n
163
+ integer(ip), intent(in) :: m
164
+
165
+ ! Local variables
166
+ integer(ip) :: irwk, icwk
167
+
168
+ ! Ensure that object is usable
169
+ call self%destroy()
170
+
171
+ ! Get workspace dimensions for genbun
172
+ call self%compute_genbun_workspace_lengths(n, m, irwk)
173
+
174
+ ! Adjust workspace for hstcyl, hstplr
175
+ irwk = irwk + 3 * m
176
+ icwk = 0
177
+
178
+ ! Allocate memory
179
+ call self%create(irwk, icwk)
180
+
181
+ end subroutine initialize_staggered_workspace
182
+
183
+ subroutine initialize_centered_workspace(self, n, m)
184
+
185
+ ! Dummy arguments
186
+ class(FishpackWorkspace), intent(inout) :: self
187
+ integer(ip), intent(in) :: n
188
+ integer(ip), intent(in) :: m
189
+
190
+ ! Local variables
191
+ integer(ip) :: irwk, icwk
192
+
193
+ ! Ensure that object is usable
194
+ call self%destroy()
195
+
196
+ ! Compute workspace lengths for hwscrt, hwsplr
197
+ irwk = (4 * (n + 1)) + (m + 1) * (13 + int(log(real(n + 1, kind=wp))/LOG_TWO))
198
+ icwk = 0
199
+
200
+ ! Allocate memory
201
+ call self%create(irwk, icwk)
202
+
203
+ end subroutine initialize_centered_workspace
204
+
205
+ ! Purpose:
206
+ !
207
+ ! Compute nearest integer greater than or equal to
208
+ ! logarithm base 2 of (n + 1), i.e.,
209
+ ! log2n is smallest integer such that
210
+ ! (n + 1) < 2**log2n
211
+ !
212
+ pure function get_log2n(n) &
213
+ result (return_value)
214
+
215
+ ! Dummy arguments
216
+ integer(ip), intent(in) :: n
217
+ integer(ip) :: return_value
218
+
219
+ associate( log2n => return_value )
220
+ log2n = 1
221
+ do while (n + 1 > 2**log2n)
222
+ log2n = log2n + 1
223
+ end do
224
+ end associate
225
+
226
+ end function
227
+
228
+ ! Purpose:
229
+ !
230
+ ! This subroutine computes the real and complex workspace
231
+ ! requirements (generous estimate) of blktri for n,m values
232
+ !
233
+ pure subroutine compute_blktri_workspace_lengths(n, m, irwk, icwk)
234
+
235
+ ! Dummy arguments
236
+ integer(ip), intent(in) :: n
237
+ integer(ip), intent(in) :: m
238
+ integer(ip), intent(out) :: irwk
239
+ integer(ip), intent(out) :: icwk
240
+
241
+ ! Local variables
242
+ integer(ip) :: log2n
243
+
244
+ log2n = get_log2n(n)
245
+
246
+ associate( k => (log2n - 2) * (2**(log2n + 1)) + 5 )
247
+ irwk = k + max(2 * n, 6 * m) + log2n + (2 * n)
248
+ icwk = (k + log2n)/2 + (3 * m) + n
249
+ end associate
250
+
251
+ end subroutine compute_blktri_workspace_lengths
252
+
253
+ ! Purpose:
254
+ !
255
+ ! This subroutine computes the real workspace
256
+ ! requirement (generously) of genbun for the current n,m
257
+ !
258
+ pure subroutine compute_genbun_workspace_lengths(n, m, irwk)
259
+
260
+ ! Dummy arguments
261
+ integer(ip), intent(in) :: n
262
+ integer(ip), intent(in) :: m
263
+ integer(ip), intent(out) :: irwk
264
+
265
+ ! Local variables
266
+ integer(ip) :: log2n
267
+
268
+ log2n = get_log2n(n)
269
+ irwk = 4*n + (10 + log2n)*m
270
+
271
+ end subroutine compute_genbun_workspace_lengths
272
+
273
+ ! Purpose:
274
+ !
275
+ ! This subroutine releases dynamically allocated workspace.
276
+ ! It should be called after a fishpack solver has finished
277
+ !
278
+ ! Remark:
279
+ !
280
+ ! When intent(out) is used with a derived type, any component
281
+ ! not assigned in a procedure will automatically deallocate on exit.
282
+ !
283
+ subroutine destroy_fishpack_workspace(self)
284
+
285
+ ! Dummy arguments
286
+ class(FishpackWorkspace), intent(out) :: self
287
+
288
+ end subroutine destroy_fishpack_workspace
289
+
290
+ end module type_FishpackWorkspace