guohanghui commited on
Commit
c7f5be4
·
verified ·
1 Parent(s): 40c1d5f

Upload 357 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. pyPDAF/mcp_output/README_MCP.md +75 -0
  2. pyPDAF/mcp_output/analysis.json +594 -0
  3. pyPDAF/mcp_output/env_info.json +15 -0
  4. pyPDAF/mcp_output/mcp_logs/llm_statistics.json +11 -0
  5. pyPDAF/mcp_output/mcp_logs/run_log.json +55 -0
  6. pyPDAF/mcp_output/mcp_plugin/__init__.py +0 -0
  7. pyPDAF/mcp_output/mcp_plugin/__pycache__/adapter.cpython-310.pyc +0 -0
  8. pyPDAF/mcp_output/mcp_plugin/__pycache__/mcp_service.cpython-310.pyc +0 -0
  9. pyPDAF/mcp_output/mcp_plugin/adapter.py +152 -0
  10. pyPDAF/mcp_output/mcp_plugin/main.py +13 -0
  11. pyPDAF/mcp_output/mcp_plugin/mcp_service.py +1622 -0
  12. pyPDAF/mcp_output/requirements.txt +2 -0
  13. pyPDAF/mcp_output/simple_revise_error_analysis.json +6 -0
  14. pyPDAF/mcp_output/start_mcp.py +33 -0
  15. pyPDAF/mcp_output/tests_mcp/test_mcp_basic.py +49 -0
  16. pyPDAF/mcp_output/tests_smoke/test_smoke.py +29 -0
  17. pyPDAF/source/.github/workflows/conda_build_linux.yaml +31 -0
  18. pyPDAF/source/.github/workflows/conda_build_mac_intel.yaml +34 -0
  19. pyPDAF/source/.github/workflows/conda_build_mac_m1.yaml +34 -0
  20. pyPDAF/source/.github/workflows/conda_build_win.yaml +45 -0
  21. pyPDAF/source/.gitignore +138 -0
  22. pyPDAF/source/.gitmodules +4 -0
  23. pyPDAF/source/LICENSE +674 -0
  24. pyPDAF/source/README.md +94 -0
  25. pyPDAF/source/__init__.py +4 -0
  26. pyPDAF/source/build/cp310/.gitignore +3 -0
  27. pyPDAF/source/build/cp310/.hgignore +4 -0
  28. pyPDAF/source/build/cp310/meson-info/meson-info.json +1 -0
  29. pyPDAF/source/build/cp310/meson-logs/meson-log.txt +505 -0
  30. pyPDAF/source/build/cp310/meson-logs/meson-setup.txt +32 -0
  31. pyPDAF/source/build/cp310/meson-private/meson.lock +0 -0
  32. pyPDAF/source/build/cp310/meson-private/sanitycheckc.c +1 -0
  33. pyPDAF/source/build/cp310/meson-private/sanitycheckc.exe +0 -0
  34. pyPDAF/source/build/cp310/meson-private/sanitycheckf.exe +0 -0
  35. pyPDAF/source/build/cp310/meson-private/sanitycheckf.f +3 -0
  36. pyPDAF/source/build/cp310/meson-python-native-file.ini +3 -0
  37. pyPDAF/source/conda.recipe/bld.bat +14 -0
  38. pyPDAF/source/conda.recipe/build.sh +11 -0
  39. pyPDAF/source/conda.recipe/conda_build_config.yaml +31 -0
  40. pyPDAF/source/conda.recipe/meta.yaml +49 -0
  41. pyPDAF/source/docs/Makefile +20 -0
  42. pyPDAF/source/docs/make.bat +35 -0
  43. pyPDAF/source/docs/source/API.rst +306 -0
  44. pyPDAF/source/docs/source/conf.py +71 -0
  45. pyPDAF/source/docs/source/develop.md +327 -0
  46. pyPDAF/source/docs/source/figs/communicators_PDAFonline.png +0 -0
  47. pyPDAF/source/docs/source/hidden_functions.md +749 -0
  48. pyPDAF/source/docs/source/index.rst +21 -0
  49. pyPDAF/source/docs/source/install.md +74 -0
  50. pyPDAF/source/docs/source/introduction.md +39 -0
pyPDAF/mcp_output/README_MCP.md ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # pyPDAF
2
+
3
+ Welcome to the `pyPDAF` project! This repository provides a Python interface for the Parallel Data Assimilation Framework (PDAF), enabling efficient data assimilation in numerical models.
4
+
5
+ ## Project Overview
6
+
7
+ `pyPDAF` is designed to facilitate the integration of data assimilation techniques into numerical models. It supports both offline and online data assimilation processes, providing a flexible and scalable solution for various applications. The project includes a comprehensive set of tools and examples to help users get started quickly.
8
+
9
+ ### Repository
10
+
11
+ - **GitHub Repository**: [pyPDAF](https://github.com/yumengch/pyPDAF)
12
+
13
+ ## Installation Instructions
14
+
15
+ To install `pyPDAF`, ensure you have Python installed on your system. The project uses a `pyproject.toml` file for configuration, which means you can install it using a tool like `pip` or `poetry`.
16
+
17
+ ### Using pip
18
+
19
+ 1. Clone the repository:
20
+ ```
21
+ git clone https://github.com/yumengch/pyPDAF.git
22
+ cd pyPDAF
23
+ ```
24
+
25
+ 2. Install the package:
26
+ ```
27
+ pip install .
28
+ ```
29
+
30
+ ### Using Poetry
31
+
32
+ 1. Clone the repository:
33
+ ```
34
+ git clone https://github.com/yumengch/pyPDAF.git
35
+ cd pyPDAF
36
+ ```
37
+
38
+ 2. Install the package:
39
+ ```
40
+ poetry install
41
+ ```
42
+
43
+ ## Usage Methods
44
+
45
+ `pyPDAF` provides several examples to demonstrate its capabilities. These examples are located in the `example` directory and are divided into `offline` and `online` modes.
46
+
47
+ ### Running Examples
48
+
49
+ - **Offline Mode**: Navigate to `example/offline` and run the `main.py` script to see offline data assimilation in action.
50
+ - **Online Mode**: Navigate to `example/online` and execute the `main.py` script to observe online data assimilation.
51
+
52
+ ## Available Tool Endpoints
53
+
54
+ The `pyPDAF` package includes several tools and scripts to assist with data assimilation tasks:
55
+
56
+ - **Collector**: Collects data for assimilation.
57
+ - **Config**: Configuration files for setting up assimilation parameters.
58
+ - **Filter Options**: Defines options for the assimilation filter.
59
+ - **Localisation**: Handles localisation of data.
60
+ - **Parallelisation**: Manages parallel execution of assimilation tasks.
61
+ - **Prepost Processing**: Prepares data before and after assimilation.
62
+
63
+ ## Notes and Troubleshooting
64
+
65
+ - Ensure all dependencies are installed correctly. If you encounter issues, verify your Python environment and package installations.
66
+ - For detailed documentation on each module and function, refer to the `docs/source` directory.
67
+ - If you experience performance issues, consider adjusting the parallelisation settings in the configuration files.
68
+
69
+ ## Troubleshooting Common Issues
70
+
71
+ - **Installation Errors**: Ensure you have the latest version of `pip` or `poetry` and that your Python environment is correctly set up.
72
+ - **Runtime Errors**: Check the configuration files for any incorrect settings or paths.
73
+ - **Performance Issues**: Review the parallelisation settings and adjust them according to your system's capabilities.
74
+
75
+ For further assistance, please refer to the [GitHub Issues](https://github.com/yumengch/pyPDAF/issues) page to report bugs or request features.
pyPDAF/mcp_output/analysis.json ADDED
@@ -0,0 +1,594 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "summary": {
3
+ "repository_url": "https://github.com/yumengch/pyPDAF",
4
+ "summary": "Imported via zip fallback, file count: 165",
5
+ "file_tree": {
6
+ ".github/workflows/conda_build_linux.yaml": {
7
+ "size": 1029
8
+ },
9
+ ".github/workflows/conda_build_mac_intel.yaml": {
10
+ "size": 1018
11
+ },
12
+ ".github/workflows/conda_build_mac_m1.yaml": {
13
+ "size": 1010
14
+ },
15
+ ".github/workflows/conda_build_win.yaml": {
16
+ "size": 1297
17
+ },
18
+ "README.md": {
19
+ "size": 4185
20
+ },
21
+ "conda.recipe/conda_build_config.yaml": {
22
+ "size": 533
23
+ },
24
+ "conda.recipe/meta.yaml": {
25
+ "size": 946
26
+ },
27
+ "docs/source/conf.py": {
28
+ "size": 2529
29
+ },
30
+ "docs/source/develop.md": {
31
+ "size": 14515
32
+ },
33
+ "docs/source/hidden_functions.md": {
34
+ "size": 31818
35
+ },
36
+ "docs/source/install.md": {
37
+ "size": 3251
38
+ },
39
+ "docs/source/introduction.md": {
40
+ "size": 2573
41
+ },
42
+ "docs/source/links.md": {
43
+ "size": 1071
44
+ },
45
+ "docs/source/naming_convention.md": {
46
+ "size": 1775
47
+ },
48
+ "docs/source/parallel.md": {
49
+ "size": 6287
50
+ },
51
+ "example/inputs_offline/ens_1.txt": {
52
+ "size": 9090
53
+ },
54
+ "example/inputs_offline/ens_2.txt": {
55
+ "size": 9090
56
+ },
57
+ "example/inputs_offline/ens_3.txt": {
58
+ "size": 9090
59
+ },
60
+ "example/inputs_offline/ens_4.txt": {
61
+ "size": 9090
62
+ },
63
+ "example/inputs_offline/ens_5.txt": {
64
+ "size": 9090
65
+ },
66
+ "example/inputs_offline/ens_6.txt": {
67
+ "size": 9090
68
+ },
69
+ "example/inputs_offline/ens_7.txt": {
70
+ "size": 9090
71
+ },
72
+ "example/inputs_offline/ens_8.txt": {
73
+ "size": 9090
74
+ },
75
+ "example/inputs_offline/ens_9.txt": {
76
+ "size": 9090
77
+ },
78
+ "example/inputs_offline/obs.txt": {
79
+ "size": 9090
80
+ },
81
+ "example/inputs_offline/obsB.txt": {
82
+ "size": 9090
83
+ },
84
+ "example/inputs_offline/obsC.txt": {
85
+ "size": 479
86
+ },
87
+ "example/inputs_offline/state_ini.txt": {
88
+ "size": 9090
89
+ },
90
+ "example/inputs_offline/true.txt": {
91
+ "size": 9090
92
+ },
93
+ "example/inputs_online/ensB_1.txt": {
94
+ "size": 9090
95
+ },
96
+ "example/inputs_online/ensB_2.txt": {
97
+ "size": 9090
98
+ },
99
+ "example/inputs_online/ensB_3.txt": {
100
+ "size": 9090
101
+ },
102
+ "example/inputs_online/ensB_4.txt": {
103
+ "size": 9090
104
+ },
105
+ "example/inputs_online/ensB_5.txt": {
106
+ "size": 9090
107
+ },
108
+ "example/inputs_online/ensB_6.txt": {
109
+ "size": 9090
110
+ },
111
+ "example/inputs_online/ensB_7.txt": {
112
+ "size": 9090
113
+ },
114
+ "example/inputs_online/ensB_8.txt": {
115
+ "size": 9090
116
+ },
117
+ "example/inputs_online/ensB_9.txt": {
118
+ "size": 9090
119
+ },
120
+ "example/inputs_online/ens_1.txt": {
121
+ "size": 9090
122
+ },
123
+ "example/inputs_online/ens_2.txt": {
124
+ "size": 9090
125
+ },
126
+ "example/inputs_online/ens_3.txt": {
127
+ "size": 9090
128
+ },
129
+ "example/inputs_online/ens_4.txt": {
130
+ "size": 9090
131
+ },
132
+ "example/inputs_online/ens_5.txt": {
133
+ "size": 9090
134
+ },
135
+ "example/inputs_online/ens_6.txt": {
136
+ "size": 9090
137
+ },
138
+ "example/inputs_online/ens_7.txt": {
139
+ "size": 9090
140
+ },
141
+ "example/inputs_online/ens_8.txt": {
142
+ "size": 9090
143
+ },
144
+ "example/inputs_online/ens_9.txt": {
145
+ "size": 9090
146
+ },
147
+ "example/inputs_online/iobs_step1.txt": {
148
+ "size": 479
149
+ },
150
+ "example/inputs_online/iobs_step10.txt": {
151
+ "size": 479
152
+ },
153
+ "example/inputs_online/iobs_step11.txt": {
154
+ "size": 479
155
+ },
156
+ "example/inputs_online/iobs_step12.txt": {
157
+ "size": 479
158
+ },
159
+ "example/inputs_online/iobs_step13.txt": {
160
+ "size": 479
161
+ },
162
+ "example/inputs_online/iobs_step14.txt": {
163
+ "size": 479
164
+ },
165
+ "example/inputs_online/iobs_step15.txt": {
166
+ "size": 479
167
+ },
168
+ "example/inputs_online/iobs_step16.txt": {
169
+ "size": 479
170
+ },
171
+ "example/inputs_online/iobs_step17.txt": {
172
+ "size": 479
173
+ },
174
+ "example/inputs_online/iobs_step18.txt": {
175
+ "size": 479
176
+ },
177
+ "example/inputs_online/iobs_step2.txt": {
178
+ "size": 479
179
+ },
180
+ "example/inputs_online/iobs_step3.txt": {
181
+ "size": 479
182
+ },
183
+ "example/inputs_online/iobs_step4.txt": {
184
+ "size": 479
185
+ },
186
+ "example/inputs_online/iobs_step5.txt": {
187
+ "size": 479
188
+ },
189
+ "example/inputs_online/iobs_step6.txt": {
190
+ "size": 479
191
+ },
192
+ "example/inputs_online/iobs_step7.txt": {
193
+ "size": 479
194
+ },
195
+ "example/inputs_online/iobs_step8.txt": {
196
+ "size": 479
197
+ },
198
+ "example/inputs_online/iobs_step9.txt": {
199
+ "size": 479
200
+ },
201
+ "example/inputs_online/obs_step1.txt": {
202
+ "size": 9090
203
+ },
204
+ "example/inputs_online/obs_step10.txt": {
205
+ "size": 9090
206
+ },
207
+ "example/inputs_online/obs_step11.txt": {
208
+ "size": 9090
209
+ },
210
+ "example/inputs_online/obs_step12.txt": {
211
+ "size": 9090
212
+ },
213
+ "example/inputs_online/obs_step13.txt": {
214
+ "size": 9090
215
+ },
216
+ "example/inputs_online/obs_step14.txt": {
217
+ "size": 9090
218
+ },
219
+ "example/inputs_online/obs_step15.txt": {
220
+ "size": 9090
221
+ },
222
+ "example/inputs_online/obs_step16.txt": {
223
+ "size": 9090
224
+ },
225
+ "example/inputs_online/obs_step17.txt": {
226
+ "size": 9090
227
+ },
228
+ "example/inputs_online/obs_step18.txt": {
229
+ "size": 9090
230
+ },
231
+ "example/inputs_online/obs_step2.txt": {
232
+ "size": 9090
233
+ },
234
+ "example/inputs_online/obs_step3.txt": {
235
+ "size": 9090
236
+ },
237
+ "example/inputs_online/obs_step4.txt": {
238
+ "size": 9090
239
+ },
240
+ "example/inputs_online/obs_step5.txt": {
241
+ "size": 9090
242
+ },
243
+ "example/inputs_online/obs_step6.txt": {
244
+ "size": 9090
245
+ },
246
+ "example/inputs_online/obs_step7.txt": {
247
+ "size": 9090
248
+ },
249
+ "example/inputs_online/obs_step8.txt": {
250
+ "size": 9090
251
+ },
252
+ "example/inputs_online/obs_step9.txt": {
253
+ "size": 9090
254
+ },
255
+ "example/inputs_online/state_ini.txt": {
256
+ "size": 9090
257
+ },
258
+ "example/inputs_online/true_initial.txt": {
259
+ "size": 9090
260
+ },
261
+ "example/inputs_online/true_step1.txt": {
262
+ "size": 9090
263
+ },
264
+ "example/inputs_online/true_step10.txt": {
265
+ "size": 9090
266
+ },
267
+ "example/inputs_online/true_step11.txt": {
268
+ "size": 9090
269
+ },
270
+ "example/inputs_online/true_step12.txt": {
271
+ "size": 9090
272
+ },
273
+ "example/inputs_online/true_step13.txt": {
274
+ "size": 9090
275
+ },
276
+ "example/inputs_online/true_step14.txt": {
277
+ "size": 9090
278
+ },
279
+ "example/inputs_online/true_step15.txt": {
280
+ "size": 9090
281
+ },
282
+ "example/inputs_online/true_step16.txt": {
283
+ "size": 9090
284
+ },
285
+ "example/inputs_online/true_step17.txt": {
286
+ "size": 9090
287
+ },
288
+ "example/inputs_online/true_step18.txt": {
289
+ "size": 9090
290
+ },
291
+ "example/inputs_online/true_step2.txt": {
292
+ "size": 9090
293
+ },
294
+ "example/inputs_online/true_step3.txt": {
295
+ "size": 9090
296
+ },
297
+ "example/inputs_online/true_step4.txt": {
298
+ "size": 9090
299
+ },
300
+ "example/inputs_online/true_step5.txt": {
301
+ "size": 9090
302
+ },
303
+ "example/inputs_online/true_step6.txt": {
304
+ "size": 9090
305
+ },
306
+ "example/inputs_online/true_step7.txt": {
307
+ "size": 9090
308
+ },
309
+ "example/inputs_online/true_step8.txt": {
310
+ "size": 9090
311
+ },
312
+ "example/inputs_online/true_step9.txt": {
313
+ "size": 9090
314
+ },
315
+ "example/offline/collector.py": {
316
+ "size": 2839
317
+ },
318
+ "example/offline/config.py": {
319
+ "size": 3345
320
+ },
321
+ "example/offline/config_obsA.py": {
322
+ "size": 2409
323
+ },
324
+ "example/offline/config_obsB.py": {
325
+ "size": 2403
326
+ },
327
+ "example/offline/filter_options.py": {
328
+ "size": 2692
329
+ },
330
+ "example/offline/localisation.py": {
331
+ "size": 4961
332
+ },
333
+ "example/offline/log.py": {
334
+ "size": 982
335
+ },
336
+ "example/offline/main.py": {
337
+ "size": 1486
338
+ },
339
+ "example/offline/model.py": {
340
+ "size": 3062
341
+ },
342
+ "example/offline/obs_a.py": {
343
+ "size": 13595
344
+ },
345
+ "example/offline/obs_b.py": {
346
+ "size": 12620
347
+ },
348
+ "example/offline/obs_factory.py": {
349
+ "size": 4945
350
+ },
351
+ "example/offline/parallelisation.py": {
352
+ "size": 11633
353
+ },
354
+ "example/offline/pdaf_system.py": {
355
+ "size": 4891
356
+ },
357
+ "example/offline/prepost_processing.py": {
358
+ "size": 7523
359
+ },
360
+ "example/offline/state_vector.py": {
361
+ "size": 1527
362
+ },
363
+ "example/online/collector.py": {
364
+ "size": 3219
365
+ },
366
+ "example/online/config.py": {
367
+ "size": 3421
368
+ },
369
+ "example/online/config_obsA.py": {
370
+ "size": 2416
371
+ },
372
+ "example/online/config_obsB.py": {
373
+ "size": 2410
374
+ },
375
+ "example/online/distributor.py": {
376
+ "size": 2449
377
+ },
378
+ "example/online/filter_options.py": {
379
+ "size": 2702
380
+ },
381
+ "example/online/localisation.py": {
382
+ "size": 4958
383
+ },
384
+ "example/online/log.py": {
385
+ "size": 982
386
+ },
387
+ "example/online/main.py": {
388
+ "size": 1799
389
+ },
390
+ "example/online/model.py": {
391
+ "size": 4492
392
+ },
393
+ "example/online/model_integrator.py": {
394
+ "size": 2846
395
+ },
396
+ "example/online/obs_a.py": {
397
+ "size": 13587
398
+ },
399
+ "example/online/obs_b.py": {
400
+ "size": 12612
401
+ },
402
+ "example/online/obs_factory.py": {
403
+ "size": 4937
404
+ },
405
+ "example/online/parallelisation.py": {
406
+ "size": 11700
407
+ },
408
+ "example/online/pdaf_system.py": {
409
+ "size": 5094
410
+ },
411
+ "example/online/prepost_processing.py": {
412
+ "size": 7018
413
+ },
414
+ "example/online/state_vector.py": {
415
+ "size": 1481
416
+ },
417
+ "pyproject.toml": {
418
+ "size": 464
419
+ },
420
+ "src/pyPDAF/PDAF/__init__.py": {
421
+ "size": 1474
422
+ },
423
+ "src/pyPDAF/PDAF3/__init__.py": {
424
+ "size": 1393
425
+ },
426
+ "src/pyPDAF/PDAFlocal/__init__.py": {
427
+ "size": 119
428
+ },
429
+ "src/pyPDAF/PDAFlocalomi/__init__.py": {
430
+ "size": 36
431
+ },
432
+ "src/pyPDAF/PDAFomi/__init__.py": {
433
+ "size": 1467
434
+ },
435
+ "src/pyPDAF/README.md": {
436
+ "size": 102
437
+ },
438
+ "src/pyPDAF/__init__.py": {
439
+ "size": 4136
440
+ },
441
+ "tests/test_example.py": {
442
+ "size": 2042
443
+ },
444
+ "tests/test_init.py": {
445
+ "size": 4467
446
+ },
447
+ "tool/compare_subroutines.py": {
448
+ "size": 4014
449
+ },
450
+ "tool/docstring/__init__.py": {
451
+ "size": 11
452
+ },
453
+ "tool/docstring/docstrings.py": {
454
+ "size": 55894
455
+ },
456
+ "tool/docstring/pdaf_assimilate_docstrings.py": {
457
+ "size": 47100
458
+ },
459
+ "tool/docstring/pdaf_diag_docstrings.py": {
460
+ "size": 4040
461
+ },
462
+ "tool/docstring/pdaf_put_state_docstrings.py": {
463
+ "size": 53643
464
+ },
465
+ "tool/docstring/pdaflocal_assimilate_docstrings.py": {
466
+ "size": 44589
467
+ },
468
+ "tool/docstring/pdaflocalomi_assimilate_docstrings.py": {
469
+ "size": 15307
470
+ },
471
+ "tool/docstring/pdaflocalomi_put_state_docstrings.py": {
472
+ "size": 19539
473
+ },
474
+ "tool/docstring/pdafomi_assimilate_docstrings.py": {
475
+ "size": 43817
476
+ },
477
+ "tool/docstring/pdafomi_put_state_docstrings.py": {
478
+ "size": 54897
479
+ },
480
+ "tool/get_decls.py": {
481
+ "size": 6809
482
+ },
483
+ "tool/get_decls_cb.py": {
484
+ "size": 8181
485
+ },
486
+ "tool/write_binding.py": {
487
+ "size": 16180
488
+ },
489
+ "tool/write_cb_pxd.py": {
490
+ "size": 3050
491
+ },
492
+ "tool/write_cb_pyx.py": {
493
+ "size": 11250
494
+ },
495
+ "tool/write_pdaf_pxd.py": {
496
+ "size": 5172
497
+ },
498
+ "tool/write_pdaf_pyx.py": {
499
+ "size": 20775
500
+ }
501
+ },
502
+ "processed_by": "zip_fallback",
503
+ "success": true
504
+ },
505
+ "structure": {
506
+ "packages": [
507
+ "source.src.pyPDAF",
508
+ "source.tool.docstring"
509
+ ]
510
+ },
511
+ "dependencies": {
512
+ "has_environment_yml": false,
513
+ "has_requirements_txt": false,
514
+ "pyproject": true,
515
+ "setup_cfg": false,
516
+ "setup_py": false
517
+ },
518
+ "entry_points": {
519
+ "imports": [],
520
+ "cli": [],
521
+ "modules": []
522
+ },
523
+ "llm_analysis": {
524
+ "core_modules": [
525
+ {
526
+ "package": "source.src.pyPDAF",
527
+ "module": "PDAF",
528
+ "functions": [],
529
+ "classes": [],
530
+ "description": "Core module for PDAF functionalities."
531
+ },
532
+ {
533
+ "package": "source.src.pyPDAF",
534
+ "module": "PDAF3",
535
+ "functions": [],
536
+ "classes": [],
537
+ "description": "Module for PDAF3 functionalities."
538
+ },
539
+ {
540
+ "package": "source.src.pyPDAF",
541
+ "module": "PDAFlocal",
542
+ "functions": [],
543
+ "classes": [],
544
+ "description": "Module for local PDAF functionalities."
545
+ },
546
+ {
547
+ "package": "source.src.pyPDAF",
548
+ "module": "PDAFlocalomi",
549
+ "functions": [],
550
+ "classes": [],
551
+ "description": "Module for local OMI PDAF functionalities."
552
+ },
553
+ {
554
+ "package": "source.src.pyPDAF",
555
+ "module": "PDAFomi",
556
+ "functions": [],
557
+ "classes": [],
558
+ "description": "Module for OMI PDAF functionalities."
559
+ }
560
+ ],
561
+ "cli_commands": [],
562
+ "import_strategy": {
563
+ "primary": "import",
564
+ "fallback": "blackbox",
565
+ "confidence": 0.8
566
+ },
567
+ "dependencies": {
568
+ "required": [],
569
+ "optional": []
570
+ },
571
+ "risk_assessment": {
572
+ "import_feasibility": 0.8,
573
+ "intrusiveness_risk": "low",
574
+ "complexity": "medium"
575
+ }
576
+ },
577
+ "deepwiki_analysis": {
578
+ "repo_url": "https://github.com/yumengch/pyPDAF",
579
+ "repo_name": "pyPDAF",
580
+ "content": null,
581
+ "model": "gpt-4o",
582
+ "source": "selenium",
583
+ "success": true
584
+ },
585
+ "deepwiki_options": {
586
+ "enabled": true,
587
+ "model": "gpt-4o"
588
+ },
589
+ "risk": {
590
+ "import_feasibility": 0.8,
591
+ "intrusiveness_risk": "low",
592
+ "complexity": "medium"
593
+ }
594
+ }
pyPDAF/mcp_output/env_info.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "environment": {
3
+ "type": "conda",
4
+ "name": "pyPDAF_294797_env",
5
+ "files": {},
6
+ "python": "3.10",
7
+ "exec_prefix": []
8
+ },
9
+ "original_tests": {
10
+ "passed": false,
11
+ "report_path": null
12
+ },
13
+ "timestamp": 1765295006.3769076,
14
+ "conda_available": true
15
+ }
pyPDAF/mcp_output/mcp_logs/llm_statistics.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "total_calls": 5,
3
+ "failed_calls": 0,
4
+ "retry_count": 0,
5
+ "total_prompt_tokens": 16659,
6
+ "total_completion_tokens": 3952,
7
+ "total_tokens": 20611,
8
+ "average_prompt_tokens": 3331.8,
9
+ "average_completion_tokens": 790.4,
10
+ "average_tokens": 4122.2
11
+ }
pyPDAF/mcp_output/mcp_logs/run_log.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "timestamp": 1765295196.2013648,
3
+ "node": "RunNode",
4
+ "test_result": {
5
+ "passed": false,
6
+ "report_path": null,
7
+ "stdout": "",
8
+ "stderr": "ERROR conda.cli.main_run:execute(41): `conda run python mcp_output/start_mcp.py` failed. (See above for error)\nTraceback (most recent call last):\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/start_mcp.py\", line 17, in <module>\n from mcp_service import create_app\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/mcp_service.py\", line 8, in <module>\n from src.pyPDAF import PDAF, PDAF3, PDAFlocal, PDAFlocalomi, PDAFomi\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/src/pyPDAF/__init__.py\", line 7, in <module>\n import mpi4py\nModuleNotFoundError: No module named 'mpi4py'\n\n"
9
+ },
10
+ "run_result": {
11
+ "success": false,
12
+ "test_passed": false,
13
+ "exit_code": 1,
14
+ "stdout": "",
15
+ "stderr": "ERROR conda.cli.main_run:execute(41): `conda run python mcp_output/start_mcp.py` failed. (See above for error)\nTraceback (most recent call last):\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/start_mcp.py\", line 17, in <module>\n from mcp_service import create_app\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/mcp_service.py\", line 8, in <module>\n from src.pyPDAF import PDAF, PDAF3, PDAFlocal, PDAFlocalomi, PDAFomi\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/src/pyPDAF/__init__.py\", line 7, in <module>\n import mpi4py\nModuleNotFoundError: No module named 'mpi4py'\n\n",
16
+ "timestamp": 1765295196.201337,
17
+ "error_type": "ImportError",
18
+ "error": "Module import failed: ERROR conda.cli.main_run:execute(41): `conda run python mcp_output/start_mcp.py` failed. (See above for error)\nTraceback (most recent call last):\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/start_mcp.py\", line 17, in <module>\n from mcp_service import create_app\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/mcp_service.py\", line 8, in <module>\n from src.pyPDAF import PDAF, PDAF3, PDAFlocal, PDAFlocalomi, PDAFomi\n File \"/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/src/pyPDAF/__init__.py\", line 7, in <module>\n import mpi4py\nModuleNotFoundError: No module named 'mpi4py'\n\n",
19
+ "details": {
20
+ "command": "/home/wshiah/code/miniconda3/bin/conda run -n pyPDAF_294797_env --cwd /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF python mcp_output/start_mcp.py",
21
+ "working_directory": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF",
22
+ "environment_type": "conda"
23
+ }
24
+ },
25
+ "environment": {
26
+ "type": "conda",
27
+ "name": "pyPDAF_294797_env",
28
+ "files": {},
29
+ "python": "3.10",
30
+ "exec_prefix": []
31
+ },
32
+ "plugin_info": {
33
+ "files": {
34
+ "mcp_output/start_mcp.py": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/start_mcp.py",
35
+ "mcp_output/mcp_plugin/__init__.py": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/__init__.py",
36
+ "mcp_output/mcp_plugin/mcp_service.py": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/mcp_service.py",
37
+ "mcp_output/mcp_plugin/adapter.py": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/adapter.py",
38
+ "mcp_output/mcp_plugin/main.py": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin/main.py",
39
+ "mcp_output/requirements.txt": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/requirements.txt",
40
+ "mcp_output/README_MCP.md": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/README_MCP.md",
41
+ "mcp_output/tests_mcp/test_mcp_basic.py": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/tests_mcp/test_mcp_basic.py"
42
+ },
43
+ "adapter_mode": "import",
44
+ "endpoints": [],
45
+ "mcp_dir": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/mcp_plugin",
46
+ "tests_dir": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/tests_mcp",
47
+ "main_entry": "start_mcp.py",
48
+ "readme_path": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/mcp_output/README_MCP.md",
49
+ "requirements": [
50
+ "fastmcp>=0.1.0",
51
+ "pydantic>=2.0.0"
52
+ ]
53
+ },
54
+ "fastmcp_installed": false
55
+ }
pyPDAF/mcp_output/mcp_plugin/__init__.py ADDED
File without changes
pyPDAF/mcp_output/mcp_plugin/__pycache__/adapter.cpython-310.pyc ADDED
Binary file (3.74 kB). View file
 
pyPDAF/mcp_output/mcp_plugin/__pycache__/mcp_service.cpython-310.pyc ADDED
Binary file (2.64 kB). View file
 
pyPDAF/mcp_output/mcp_plugin/adapter.py ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+
4
+ # Path settings
5
+ source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "source")
6
+ sys.path.insert(0, source_path)
7
+
8
+ # Import statements
9
+ try:
10
+ from src.pyPDAF.PDAF import *
11
+ from src.pyPDAF.PDAF3 import *
12
+ from src.pyPDAF.PDAFlocal import *
13
+ from src.pyPDAF.PDAFlocalomi import *
14
+ from src.pyPDAF.PDAFomi import *
15
+ from src.pyPDAF import *
16
+ from tool.docstring import *
17
+ except ImportError as e:
18
+ print(f"Import failed: {e}. Ensure the source directory is correctly set.")
19
+ # Fallback handling can be implemented here if necessary
20
+
21
+ class Adapter:
22
+ """
23
+ Adapter class for MCP plugin, utilizing the pyPDAF library.
24
+ """
25
+
26
+ def __init__(self):
27
+ """
28
+ Initialize the Adapter with default mode set to 'import'.
29
+ """
30
+ self.mode = "import"
31
+
32
+ # -------------------------------------------------------------------------
33
+ # PDAF Module Methods
34
+ # -------------------------------------------------------------------------
35
+
36
+ def initialize_pdaf(self):
37
+ """
38
+ Initialize the PDAF module.
39
+
40
+ Returns:
41
+ dict: Status of the initialization.
42
+ """
43
+ try:
44
+ # Assuming there's an initialization function in PDAF
45
+ # This is a placeholder for actual initialization logic
46
+ status = "PDAF initialized successfully."
47
+ return {"status": status}
48
+ except Exception as e:
49
+ return {"status": f"Initialization failed: {e}"}
50
+
51
+ # -------------------------------------------------------------------------
52
+ # PDAF3 Module Methods
53
+ # -------------------------------------------------------------------------
54
+
55
+ def initialize_pdaf3(self):
56
+ """
57
+ Initialize the PDAF3 module.
58
+
59
+ Returns:
60
+ dict: Status of the initialization.
61
+ """
62
+ try:
63
+ # Placeholder for actual initialization logic
64
+ status = "PDAF3 initialized successfully."
65
+ return {"status": status}
66
+ except Exception as e:
67
+ return {"status": f"Initialization failed: {e}"}
68
+
69
+ # -------------------------------------------------------------------------
70
+ # PDAFlocal Module Methods
71
+ # -------------------------------------------------------------------------
72
+
73
+ def initialize_pdaf_local(self):
74
+ """
75
+ Initialize the PDAFlocal module.
76
+
77
+ Returns:
78
+ dict: Status of the initialization.
79
+ """
80
+ try:
81
+ # Placeholder for actual initialization logic
82
+ status = "PDAFlocal initialized successfully."
83
+ return {"status": status}
84
+ except Exception as e:
85
+ return {"status": f"Initialization failed: {e}"}
86
+
87
+ # -------------------------------------------------------------------------
88
+ # PDAFlocalomi Module Methods
89
+ # -------------------------------------------------------------------------
90
+
91
+ def initialize_pdaf_localomi(self):
92
+ """
93
+ Initialize the PDAFlocalomi module.
94
+
95
+ Returns:
96
+ dict: Status of the initialization.
97
+ """
98
+ try:
99
+ # Placeholder for actual initialization logic
100
+ status = "PDAFlocalomi initialized successfully."
101
+ return {"status": status}
102
+ except Exception as e:
103
+ return {"status": f"Initialization failed: {e}"}
104
+
105
+ # -------------------------------------------------------------------------
106
+ # PDAFomi Module Methods
107
+ # -------------------------------------------------------------------------
108
+
109
+ def initialize_pdaf_omi(self):
110
+ """
111
+ Initialize the PDAFomi module.
112
+
113
+ Returns:
114
+ dict: Status of the initialization.
115
+ """
116
+ try:
117
+ # Placeholder for actual initialization logic
118
+ status = "PDAFomi initialized successfully."
119
+ return {"status": status}
120
+ except Exception as e:
121
+ return {"status": f"Initialization failed: {e}"}
122
+
123
+ # -------------------------------------------------------------------------
124
+ # General Methods
125
+ # -------------------------------------------------------------------------
126
+
127
+ def execute_function(self, function_name, *args, **kwargs):
128
+ """
129
+ Execute a function from the imported modules.
130
+
131
+ Parameters:
132
+ function_name (str): The name of the function to execute.
133
+ *args: Positional arguments for the function.
134
+ **kwargs: Keyword arguments for the function.
135
+
136
+ Returns:
137
+ dict: Result of the function execution.
138
+ """
139
+ try:
140
+ func = globals().get(function_name)
141
+ if not func:
142
+ raise ValueError(f"Function {function_name} not found.")
143
+ result = func(*args, **kwargs)
144
+ return {"status": "success", "result": result}
145
+ except Exception as e:
146
+ return {"status": f"Execution failed: {e}"}
147
+
148
+ # Example usage
149
+ if __name__ == "__main__":
150
+ adapter = Adapter()
151
+ print(adapter.initialize_pdaf())
152
+ print(adapter.execute_function('some_function', 1, 2, key='value'))
pyPDAF/mcp_output/mcp_plugin/main.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ MCP Service Auto-Wrapper - Auto-generated
3
+ """
4
+ from mcp_service import create_app
5
+
6
+ def main():
7
+ """Main entry point"""
8
+ app = create_app()
9
+ return app
10
+
11
+ if __name__ == "__main__":
12
+ app = main()
13
+ app.run()
pyPDAF/mcp_output/mcp_plugin/mcp_service.py ADDED
@@ -0,0 +1,1622 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ MCP Service for pyPDAF - Parallel Data Assimilation Framework
3
+
4
+ This module provides MCP (Model Context Protocol) tools for interacting with
5
+ the pyPDAF library, which is a Python interface to the PDAF (Parallel Data
6
+ Assimilation Framework) library for ensemble-based data assimilation.
7
+ """
8
+
9
+ import os
10
+ import sys
11
+ from typing import List, Optional
12
+
13
+ import numpy as np
14
+
15
+ source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "source")
16
+ sys.path.insert(0, source_path)
17
+
18
+ from fastmcp import FastMCP
19
+ from src.pyPDAF import PDAF, PDAF3, PDAFlocal, PDAFlocalomi, PDAFomi
20
+
21
+ mcp = FastMCP("pyPDAF_service")
22
+
23
+
24
+ # ============================================================================
25
+ # PDAF Core Module Tools
26
+ # ============================================================================
27
+
28
+ @mcp.tool(name="pdaf_correlation_function", description="Calculate the value of a correlation function at a given distance")
29
+ def pdaf_correlation_function(ctype: int, length: float, distance: float) -> dict:
30
+ """
31
+ Calculate the value of the chosen correlation function according to the specified length scale.
32
+
33
+ Args:
34
+ ctype: Type of correlation function
35
+ 1: Gaussian with f(0)=1.0
36
+ 2: 5th-order polynomial (Gaspari/Cohn, 1999)
37
+ length: Length scale of function
38
+ ctype=1: standard deviation
39
+ ctype=2: support length (f=0 for distance>length)
40
+ distance: Distance at which the function is evaluated
41
+
42
+ Returns:
43
+ dict: A dictionary containing the success status and the correlation value.
44
+ """
45
+ try:
46
+ value = PDAF.correlation_function(ctype, length, distance)
47
+ return {"success": True, "result": {"value": float(value)}, "error": None}
48
+ except Exception as e:
49
+ return {"success": False, "result": None, "error": str(e)}
50
+
51
+
52
+ @mcp.tool(name="pdaf_deallocate", description="Finalize the PDAF system and free allocated memory")
53
+ def pdaf_deallocate() -> dict:
54
+ """
55
+ Finalise the PDAF system including freeing some of the memory used by PDAF.
56
+
57
+ Note: This function cannot free all allocated PDAF memory.
58
+ Therefore, one should not use PDAF.init afterwards.
59
+
60
+ Returns:
61
+ dict: A dictionary containing the success status.
62
+ """
63
+ try:
64
+ PDAF.deallocate()
65
+ return {"success": True, "result": "PDAF memory deallocated successfully", "error": None}
66
+ except Exception as e:
67
+ return {"success": False, "result": None, "error": str(e)}
68
+
69
+
70
+ @mcp.tool(name="pdaf_eofcovar", description="Perform EOF analysis of an ensemble of state vectors by SVD")
71
+ def pdaf_eofcovar(
72
+ dim: int,
73
+ nstates: int,
74
+ nfields: int,
75
+ dim_fields: List[int],
76
+ offsets: List[int],
77
+ remove_mstate: int,
78
+ do_mv: int,
79
+ states: List[List[float]],
80
+ meanstate: List[float],
81
+ verbose: int
82
+ ) -> dict:
83
+ """
84
+ EOF analysis of an ensemble of state vectors by singular value decomposition.
85
+
86
+ This function performs a singular value decomposition of the ensemble anomaly.
87
+ The singular values and corresponding singular vectors can be used to
88
+ construct a covariance matrix for the initial ensemble.
89
+
90
+ Args:
91
+ dim: Dimension of state vector
92
+ nstates: Number of state vectors
93
+ nfields: Number of fields in state vector
94
+ dim_fields: Size of each field (list of length nfields)
95
+ offsets: Start position of each field (list of length nfields)
96
+ remove_mstate: 1 to subtract mean state from states
97
+ do_mv: 1 for multivariate scaling; 0 for no scaling
98
+ states: State perturbations (2D list of shape [dim, nstates])
99
+ meanstate: Mean state (list of length dim)
100
+ verbose: Verbosity flag
101
+
102
+ Returns:
103
+ dict: A dictionary containing:
104
+ - states: Updated state perturbations
105
+ - stddev: Standard deviation of field variability
106
+ - svals: Singular values divided by sqrt(nstates-1)
107
+ - svec: Singular vectors
108
+ - meanstate: Updated mean state
109
+ - status: Status flag
110
+ """
111
+ try:
112
+ states_np = np.array(states, dtype=np.float64)
113
+ meanstate_np = np.array(meanstate, dtype=np.float64)
114
+ dim_fields_np = np.array(dim_fields, dtype=np.int32)
115
+ offsets_np = np.array(offsets, dtype=np.int32)
116
+
117
+ result = PDAF.eofcovar(
118
+ dim, nstates, nfields, dim_fields_np, offsets_np,
119
+ remove_mstate, do_mv, states_np, meanstate_np, verbose
120
+ )
121
+
122
+ states_out, stddev, svals, svec, meanstate_out, status = result
123
+ return {
124
+ "success": True,
125
+ "result": {
126
+ "states": states_out.tolist(),
127
+ "stddev": stddev.tolist(),
128
+ "svals": svals.tolist(),
129
+ "svec": svec.tolist(),
130
+ "meanstate": meanstate_out.tolist(),
131
+ "status": int(status)
132
+ },
133
+ "error": None
134
+ }
135
+ except Exception as e:
136
+ return {"success": False, "result": None, "error": str(e)}
137
+
138
+
139
+ @mcp.tool(name="pdaf_force_analysis", description="Force PDAF to perform analysis at next assimilation call")
140
+ def pdaf_force_analysis() -> dict:
141
+ """
142
+ Force PDAF to perform assimilation at the next function call.
143
+
144
+ This function overwrites member index of the ensemble state
145
+ and forces that the analysis step is executed at the next call
146
+ to PDAF assimilation functions.
147
+
148
+ Returns:
149
+ dict: A dictionary containing the success status.
150
+ """
151
+ try:
152
+ PDAF.force_analysis()
153
+ return {"success": True, "result": "Analysis forced successfully", "error": None}
154
+ except Exception as e:
155
+ return {"success": False, "result": None, "error": str(e)}
156
+
157
+
158
+ @mcp.tool(name="pdaf_get_fcst_info", description="Get forecast information including time steps and exit flag")
159
+ def pdaf_get_fcst_info(steps: int = 0, time: float = 0.0, doexit: int = 0) -> dict:
160
+ """
161
+ Return the number of time steps, current model time, and exit flag.
162
+
163
+ This is used when the flexible parallelization mode is used with
164
+ PDAF3.assimilate. This is also relevant for legacy assimilation functions.
165
+
166
+ Args:
167
+ steps: Number of forecast time steps (input can be arbitrary)
168
+ time: Current model time
169
+ doexit: Whether to exit from forecasts
170
+
171
+ Returns:
172
+ dict: A dictionary containing:
173
+ - steps: Number of forecast time steps for next assimilation
174
+ - time: Current model time
175
+ - doexit: Whether to exit from forecasts
176
+ """
177
+ try:
178
+ steps_out, time_out, doexit_out = PDAF.get_fcst_info(steps, time, doexit)
179
+ return {
180
+ "success": True,
181
+ "result": {
182
+ "steps": int(steps_out),
183
+ "time": float(time_out),
184
+ "doexit": int(doexit_out)
185
+ },
186
+ "error": None
187
+ }
188
+ except Exception as e:
189
+ return {"success": False, "result": None, "error": str(e)}
190
+
191
+
192
+ @mcp.tool(name="pdaf_print_filter_types", description="Print available filter types in PDAF")
193
+ def pdaf_print_filter_types(verbose: int = 1) -> dict:
194
+ """
195
+ Print all available filter types in PDAF to the console.
196
+
197
+ Args:
198
+ verbose: Verbosity flag. If 0, no output; if > 0, prints list to stdout.
199
+
200
+ Returns:
201
+ dict: A dictionary containing the success status.
202
+ """
203
+ try:
204
+ PDAF.print_filter_types(verbose)
205
+ return {"success": True, "result": "Filter types printed to console", "error": None}
206
+ except Exception as e:
207
+ return {"success": False, "result": None, "error": str(e)}
208
+
209
+
210
+ @mcp.tool(name="pdaf_print_da_types", description="Print available DA method types in PDAF")
211
+ def pdaf_print_da_types(verbose: int = 1) -> dict:
212
+ """
213
+ Print all available data assimilation method types in PDAF to the console.
214
+
215
+ Args:
216
+ verbose: Verbosity flag. If 0, no output; if > 0, prints list to stdout.
217
+
218
+ Returns:
219
+ dict: A dictionary containing the success status.
220
+ """
221
+ try:
222
+ PDAF.print_da_types(verbose)
223
+ return {"success": True, "result": "DA types printed to console", "error": None}
224
+ except Exception as e:
225
+ return {"success": False, "result": None, "error": str(e)}
226
+
227
+
228
+ @mcp.tool(name="pdaf_print_info", description="Print PDAF configuration and status information")
229
+ def pdaf_print_info(printtype: int) -> dict:
230
+ """
231
+ Print PDAF configuration and status information.
232
+
233
+ Args:
234
+ printtype: Type of information to print
235
+ 1: Print filter type and settings
236
+ 2: Print timing information
237
+ 3: Print memory usage
238
+
239
+ Returns:
240
+ dict: A dictionary containing the success status.
241
+ """
242
+ try:
243
+ PDAF.print_info(printtype)
244
+ return {"success": True, "result": f"Info type {printtype} printed to console", "error": None}
245
+ except Exception as e:
246
+ return {"success": False, "result": None, "error": str(e)}
247
+
248
+
249
+ @mcp.tool(name="pdaf_reset_forget", description="Reset the forgetting factor in PDAF")
250
+ def pdaf_reset_forget(forget_in: float) -> dict:
251
+ """
252
+ Reset the forgetting factor used in ensemble filters.
253
+
254
+ The forgetting factor is used for covariance inflation.
255
+ A value less than 1.0 inflates the ensemble spread.
256
+
257
+ For local ensemble Kalman filters, the forgetting factor can be set
258
+ either globally (outside the loop over local domains) or differently
259
+ for each local analysis domain (within the loop).
260
+
261
+ Args:
262
+ forget_in: New forgetting factor value
263
+
264
+ Returns:
265
+ dict: A dictionary containing the success status.
266
+ """
267
+ try:
268
+ PDAF.reset_forget(forget_in)
269
+ return {"success": True, "result": f"Forgetting factor reset to {forget_in}", "error": None}
270
+ except Exception as e:
271
+ return {"success": False, "result": None, "error": str(e)}
272
+
273
+
274
+ @mcp.tool(name="pdaf_set_debug_flag", description="Activate or deactivate PDAF debug output")
275
+ def pdaf_set_debug_flag(debugval: int) -> dict:
276
+ """
277
+ Activate or deactivate debug output for PDAF.
278
+
279
+ When activated, debug information is sent to screen output.
280
+ The output ends when the debug flag is set to 0.
281
+
282
+ Args:
283
+ debugval: Value for debugging flag (0 to disable, non-zero to enable)
284
+
285
+ Returns:
286
+ dict: A dictionary containing the success status.
287
+ """
288
+ try:
289
+ PDAF.set_debug_flag(debugval)
290
+ return {"success": True, "result": f"Debug flag set to {debugval}", "error": None}
291
+ except Exception as e:
292
+ return {"success": False, "result": None, "error": str(e)}
293
+
294
+
295
+ @mcp.tool(name="pdaf_set_offline_mode", description="Set PDAF to offline mode")
296
+ def pdaf_set_offline_mode(screen: int) -> dict:
297
+ """
298
+ Set PDAF to offline mode for offline data assimilation.
299
+
300
+ Args:
301
+ screen: Screen output level (0 for no output)
302
+
303
+ Returns:
304
+ dict: A dictionary containing the success status.
305
+ """
306
+ try:
307
+ PDAF.set_offline_mode(screen)
308
+ return {"success": True, "result": f"Offline mode set with screen={screen}", "error": None}
309
+ except Exception as e:
310
+ return {"success": False, "result": None, "error": str(e)}
311
+
312
+
313
+ @mcp.tool(name="pdaf_get_assim_flag", description="Get the flag indicating if DA was performed in last time step")
314
+ def pdaf_get_assim_flag() -> dict:
315
+ """
316
+ Return the flag that indicates if the DA is performed in the last time step.
317
+ This only works for online DA systems.
318
+
319
+ Returns:
320
+ dict: A dictionary containing:
321
+ - did_assim: 1 for assimilation performed, 0 otherwise
322
+ """
323
+ try:
324
+ did_assim = PDAF.get_assim_flag()
325
+ return {"success": True, "result": {"did_assim": int(did_assim)}, "error": None}
326
+ except Exception as e:
327
+ return {"success": False, "result": None, "error": str(e)}
328
+
329
+
330
+ @mcp.tool(name="pdaf_get_localfilter", description="Check whether a local filter is used")
331
+ def pdaf_get_localfilter() -> dict:
332
+ """
333
+ Return whether a local filter is used.
334
+
335
+ Returns:
336
+ dict: A dictionary containing:
337
+ - lfilter: 1 for local filters (domain-localized), 0 for global filters
338
+ """
339
+ try:
340
+ lfilter = PDAF.get_localfilter()
341
+ return {"success": True, "result": {"lfilter": int(lfilter)}, "error": None}
342
+ except Exception as e:
343
+ return {"success": False, "result": None, "error": str(e)}
344
+
345
+
346
+ @mcp.tool(name="pdaf_get_memberid", description="Get the ensemble member ID on the current process")
347
+ def pdaf_get_memberid(memberid: int = 0) -> dict:
348
+ """
349
+ Return the ensemble member ID on the current process.
350
+
351
+ This can be called during ensemble integration if ensemble-specific
352
+ forcing is read. It can also be used in user-supplied functions.
353
+
354
+ Args:
355
+ memberid: Input member ID (can be any value)
356
+
357
+ Returns:
358
+ dict: A dictionary containing:
359
+ - memberid: Index in the local ensemble
360
+ """
361
+ try:
362
+ result = PDAF.get_memberid(memberid)
363
+ return {"success": True, "result": {"memberid": int(result)}, "error": None}
364
+ except Exception as e:
365
+ return {"success": False, "result": None, "error": str(e)}
366
+
367
+
368
+ # ============================================================================
369
+ # PDAF Diagnostic Tools
370
+ # ============================================================================
371
+
372
+ @mcp.tool(name="pdaf_diag_ensmean", description="Compute ensemble mean of state vectors")
373
+ def pdaf_diag_ensmean(dim: int, dim_ens: int, ens: List[List[float]]) -> dict:
374
+ """
375
+ Compute the ensemble mean of the state ensemble.
376
+
377
+ Args:
378
+ dim: State dimension
379
+ dim_ens: Ensemble size
380
+ ens: State ensemble (2D list of shape [dim, dim_ens])
381
+
382
+ Returns:
383
+ dict: A dictionary containing:
384
+ - state: Ensemble mean (list of length dim)
385
+ - status: Status flag (0=success)
386
+ """
387
+ try:
388
+ ens_np = np.array(ens, dtype=np.float64)
389
+ state = np.zeros(dim, dtype=np.float64)
390
+
391
+ state_out, status = PDAF.diag_ensmean(dim, dim_ens, state, ens_np)
392
+ return {
393
+ "success": True,
394
+ "result": {
395
+ "state": state_out.tolist(),
396
+ "status": int(status)
397
+ },
398
+ "error": None
399
+ }
400
+ except Exception as e:
401
+ return {"success": False, "result": None, "error": str(e)}
402
+
403
+
404
+ @mcp.tool(name="pdaf_diag_effsample", description="Compute effective sample size for particle filter")
405
+ def pdaf_diag_effsample(dim_sample: int, weights: List[float]) -> dict:
406
+ """
407
+ Compute effective ensemble size from particle filter weights.
408
+
409
+ This is a diagnostic for particle filters that measures how many
410
+ particles are effectively contributing to the estimate.
411
+
412
+ Based on Doucet et al. (2001), it is defined as:
413
+ N_eff = 1 / sum(w_i^2)
414
+ where w_i is the weight of particle i.
415
+
416
+ If N_eff = N, all weights are identical and the filter has no influence.
417
+ If N_eff = 0, the filter is collapsed.
418
+
419
+ Args:
420
+ dim_sample: Sample size (number of particles)
421
+ weights: Particle weights (list of length dim_sample)
422
+
423
+ Returns:
424
+ dict: A dictionary containing:
425
+ - n_eff: Effective sample size
426
+ """
427
+ try:
428
+ weights_np = np.array(weights, dtype=np.float64)
429
+ n_eff = PDAF.diag_effsample(dim_sample, weights_np)
430
+ return {"success": True, "result": {"n_eff": float(n_eff)}, "error": None}
431
+ except Exception as e:
432
+ return {"success": False, "result": None, "error": str(e)}
433
+
434
+
435
+ # ============================================================================
436
+ # PDAFomi Module Tools
437
+ # ============================================================================
438
+
439
+ @mcp.tool(name="pdafomi_init", description="Initialize PDAFomi with number of observation types")
440
+ def pdafomi_init(n_obs: int) -> dict:
441
+ """
442
+ Allocate an array of obs_f derived type instances.
443
+
444
+ This function initializes the number of observation types,
445
+ which should be called at the start of the DA system after PDAF.init.
446
+
447
+ Args:
448
+ n_obs: Number of observation types
449
+
450
+ Returns:
451
+ dict: A dictionary containing the success status.
452
+ """
453
+ try:
454
+ PDAFomi.init(n_obs)
455
+ return {"success": True, "result": f"PDAFomi initialized with {n_obs} observation types", "error": None}
456
+ except Exception as e:
457
+ return {"success": False, "result": None, "error": str(e)}
458
+
459
+
460
+ @mcp.tool(name="pdafomi_init_local", description="Initialize local observation types for local analysis")
461
+ def pdafomi_init_local() -> dict:
462
+ """
463
+ Allocate an array of obs_l derived type instances for local analysis.
464
+
465
+ This function initializes the number of observation types for each
466
+ local analysis domain, which should be called at the start of the
467
+ local analysis loop.
468
+
469
+ Returns:
470
+ dict: A dictionary containing the success status.
471
+ """
472
+ try:
473
+ PDAFomi.init_local()
474
+ return {"success": True, "result": "PDAFomi local initialized", "error": None}
475
+ except Exception as e:
476
+ return {"success": False, "result": None, "error": str(e)}
477
+
478
+
479
+ @mcp.tool(name="pdafomi_check_error", description="Check PDAFomi internal error flag")
480
+ def pdafomi_check_error(flag: int = 0) -> dict:
481
+ """
482
+ Check the value of the PDAF-OMI internal error flag.
483
+
484
+ Since PDAF-OMI executes internal routines in which errors could occur
485
+ due to inconsistent configuration of observations, this function
486
+ allows checking for such errors.
487
+
488
+ Args:
489
+ flag: Error flag input (can be any value)
490
+
491
+ Returns:
492
+ dict: A dictionary containing:
493
+ - flag: Error flag value (0 = no error)
494
+ """
495
+ try:
496
+ result = PDAFomi.check_error(flag)
497
+ return {"success": True, "result": {"flag": int(result)}, "error": None}
498
+ except Exception as e:
499
+ return {"success": False, "result": None, "error": str(e)}
500
+
501
+
502
+ @mcp.tool(name="pdafomi_set_debug_flag", description="Activate or deactivate PDAFomi debug output")
503
+ def pdafomi_set_debug_flag(debugval: int) -> dict:
504
+ """
505
+ Activate or deactivate debug output for PDAFomi.
506
+
507
+ Args:
508
+ debugval: Value for debugging flag (0 to disable, non-zero to enable)
509
+
510
+ Returns:
511
+ dict: A dictionary containing the success status.
512
+ """
513
+ try:
514
+ PDAFomi.set_debug_flag(debugval)
515
+ return {"success": True, "result": f"PDAFomi debug flag set to {debugval}", "error": None}
516
+ except Exception as e:
517
+ return {"success": False, "result": None, "error": str(e)}
518
+
519
+
520
+ @mcp.tool(name="pdafomi_set_doassim", description="Set whether to assimilate a given observation type")
521
+ def pdafomi_set_doassim(i_obs: int, doassim: int) -> dict:
522
+ """
523
+ Set the doassim attribute for a given observation type.
524
+
525
+ Args:
526
+ i_obs: Index of observation type
527
+ doassim: 0) do not assimilate; 1) assimilate the observation type
528
+
529
+ Returns:
530
+ dict: A dictionary containing the success status.
531
+ """
532
+ try:
533
+ PDAFomi.set_doassim(i_obs, doassim)
534
+ return {"success": True, "result": f"Observation type {i_obs} doassim set to {doassim}", "error": None}
535
+ except Exception as e:
536
+ return {"success": False, "result": None, "error": str(e)}
537
+
538
+
539
+ @mcp.tool(name="pdafomi_set_disttype", description="Set distance calculation method for observation localization")
540
+ def pdafomi_set_disttype(i_obs: int, disttype: int) -> dict:
541
+ """
542
+ Set the observation localization distance calculation method.
543
+
544
+ Args:
545
+ i_obs: Index of observation type
546
+ disttype: Type of distance calculation:
547
+ 0) Cartesian (any units)
548
+ 1) Cartesian periodic (any units)
549
+ 2) Geographic distance in metres (lat/lon in radians)
550
+ 3) Haversine formula for distance on sphere
551
+ 10) 3D Cartesian with separate horizontal/vertical
552
+ 11) 3D Cartesian periodic with separate horizontal/vertical
553
+ 12) Geographic horizontal + user vertical
554
+ 13) Haversine horizontal + user vertical
555
+
556
+ Returns:
557
+ dict: A dictionary containing the success status.
558
+ """
559
+ try:
560
+ PDAFomi.set_disttype(i_obs, disttype)
561
+ return {"success": True, "result": f"Observation type {i_obs} disttype set to {disttype}", "error": None}
562
+ except Exception as e:
563
+ return {"success": False, "result": None, "error": str(e)}
564
+
565
+
566
+ @mcp.tool(name="pdafomi_set_ncoord", description="Set number of spatial dimensions for observations")
567
+ def pdafomi_set_ncoord(i_obs: int, ncoord: int) -> dict:
568
+ """
569
+ Set the number of spatial dimensions of observations.
570
+
571
+ Args:
572
+ i_obs: Index of observation type
573
+ ncoord: Dimension of the observation coordinate (e.g., 2 for 2D)
574
+
575
+ Returns:
576
+ dict: A dictionary containing the success status.
577
+ """
578
+ try:
579
+ PDAFomi.set_ncoord(i_obs, ncoord)
580
+ return {"success": True, "result": f"Observation type {i_obs} ncoord set to {ncoord}", "error": None}
581
+ except Exception as e:
582
+ return {"success": False, "result": None, "error": str(e)}
583
+
584
+
585
+ @mcp.tool(name="pdafomi_diag_nobstypes", description="Get number of active observation types")
586
+ def pdafomi_diag_nobstypes(nobs: int = 0) -> dict:
587
+ """
588
+ Get the number of observation types that are active in an assimilation run.
589
+
590
+ Args:
591
+ nobs: Number of observation types (input can be arbitrary)
592
+
593
+ Returns:
594
+ dict: A dictionary containing:
595
+ - nobs: Number of active observation types
596
+ """
597
+ try:
598
+ result = PDAFomi.diag_nobstypes(nobs)
599
+ return {"success": True, "result": {"nobs": int(result)}, "error": None}
600
+ except Exception as e:
601
+ return {"success": False, "result": None, "error": str(e)}
602
+
603
+
604
+ @mcp.tool(name="pdafomi_diag_dimobs", description="Get observation dimensions for each observation type")
605
+ def pdafomi_diag_dimobs() -> dict:
606
+ """
607
+ Get observation dimension for each observation type.
608
+
609
+ Returns:
610
+ dict: A dictionary containing:
611
+ - dim_obs: Observation dimension for each type (list)
612
+ """
613
+ try:
614
+ result = PDAFomi.diag_dimobs()
615
+ return {"success": True, "result": {"dim_obs": result.tolist()}, "error": None}
616
+ except Exception as e:
617
+ return {"success": False, "result": None, "error": str(e)}
618
+
619
+
620
+ # ============================================================================
621
+ # PDAFlocal Module Tools
622
+ # ============================================================================
623
+
624
+ @mcp.tool(name="pdaflocal_set_indices", description="Set index mapping from local to global state vector")
625
+ def pdaflocal_set_indices(dim_l: int, map_indices: List[int]) -> dict:
626
+ """
627
+ Set index vector to map local state vector to global state vectors.
628
+
629
+ This is called in the user-supplied function py__init_dim_l_pdaf.
630
+ Each element of map is an index of the global state vector (1-based).
631
+
632
+ E.g., map[0] = 2 means that the first element of local state vector
633
+ is the 2nd element of the global state vector.
634
+
635
+ Args:
636
+ dim_l: Dimension of local state vector
637
+ map_indices: Index array for mapping between local and global state vector
638
+
639
+ Returns:
640
+ dict: A dictionary containing the success status.
641
+ """
642
+ try:
643
+ map_np = np.array(map_indices, dtype=np.int32)
644
+ PDAFlocal.set_indices(dim_l, map_np)
645
+ return {"success": True, "result": f"Local indices set for dim_l={dim_l}", "error": None}
646
+ except Exception as e:
647
+ return {"success": False, "result": None, "error": str(e)}
648
+
649
+
650
+ @mcp.tool(name="pdaflocal_set_increment_weights", description="Set local increment weights for vertical localization")
651
+ def pdaflocal_set_increment_weights(dim_l: int, weights: List[float]) -> dict:
652
+ """
653
+ Initialize a PDAF-internal local array of increment weights.
654
+
655
+ The weights are applied where the local state vector is weighted.
656
+ These can be used to apply vertical localization or implement
657
+ weakly-coupled assimilation.
658
+
659
+ Args:
660
+ dim_l: Dimension of local state vector
661
+ weights: Weights array (list of length dim_l)
662
+
663
+ Returns:
664
+ dict: A dictionary containing the success status.
665
+ """
666
+ try:
667
+ weights_np = np.array(weights, dtype=np.float64)
668
+ PDAFlocal.set_increment_weights(dim_l, weights_np)
669
+ return {"success": True, "result": f"Increment weights set for dim_l={dim_l}", "error": None}
670
+ except Exception as e:
671
+ return {"success": False, "result": None, "error": str(e)}
672
+
673
+
674
+ @mcp.tool(name="pdaflocal_clear_increment_weights", description="Deallocate local increment weight vector")
675
+ def pdaflocal_clear_increment_weights() -> dict:
676
+ """
677
+ Deallocate the local increment weight vector set by set_increment_weights.
678
+
679
+ Returns:
680
+ dict: A dictionary containing the success status.
681
+ """
682
+ try:
683
+ PDAFlocal.clear_increment_weights()
684
+ return {"success": True, "result": "Increment weights cleared", "error": None}
685
+ except Exception as e:
686
+ return {"success": False, "result": None, "error": str(e)}
687
+
688
+
689
+ # ============================================================================
690
+ # Additional PDAF Diagnostic Tools
691
+ # ============================================================================
692
+
693
+ @mcp.tool(name="pdaf_diag_stddev_nompi", description="Compute ensemble standard deviation without MPI")
694
+ def pdaf_diag_stddev_nompi(
695
+ dim: int,
696
+ dim_ens: int,
697
+ ens: List[List[float]],
698
+ do_mean: int
699
+ ) -> dict:
700
+ """
701
+ Compute ensemble standard deviation and ensemble mean without MPI.
702
+
703
+ Args:
704
+ dim: State dimension
705
+ dim_ens: Ensemble size
706
+ ens: State ensemble (2D list of shape [dim, dim_ens])
707
+ do_mean: Whether to compute ensemble mean (1=yes, 0=no)
708
+
709
+ Returns:
710
+ dict: A dictionary containing:
711
+ - state: State vector (ensemble mean if do_mean=1)
712
+ - stddev: Standard deviation of ensemble
713
+ - status: Status flag (0=success)
714
+ """
715
+ try:
716
+ ens_np = np.array(ens, dtype=np.float64)
717
+ state = np.zeros(dim, dtype=np.float64)
718
+
719
+ state_out, stddev, status = PDAF.diag_stddev_nompi(dim, dim_ens, state, ens_np, do_mean)
720
+ return {
721
+ "success": True,
722
+ "result": {
723
+ "state": state_out.tolist(),
724
+ "stddev": float(stddev),
725
+ "status": int(status)
726
+ },
727
+ "error": None
728
+ }
729
+ except Exception as e:
730
+ return {"success": False, "result": None, "error": str(e)}
731
+
732
+
733
+ @mcp.tool(name="pdaf_diag_variance_nompi", description="Compute ensemble variance without MPI")
734
+ def pdaf_diag_variance_nompi(
735
+ dim: int,
736
+ dim_ens: int,
737
+ ens: List[List[float]],
738
+ do_mean: int,
739
+ do_stddev: int
740
+ ) -> dict:
741
+ """
742
+ Compute ensemble variance/standard deviation and mean without MPI.
743
+
744
+ Args:
745
+ dim: State dimension
746
+ dim_ens: Ensemble size
747
+ ens: State ensemble (2D list of shape [dim, dim_ens])
748
+ do_mean: Whether to compute ensemble mean (1=yes, 0=no)
749
+ do_stddev: Whether to compute the ensemble mean standard deviation (1=yes, 0=no)
750
+
751
+ Returns:
752
+ dict: A dictionary containing:
753
+ - state: State vector (ensemble mean if do_mean=1)
754
+ - variance: Variance state vector
755
+ - stddev: Standard deviation of ensemble
756
+ - status: Status flag (0=success)
757
+ """
758
+ try:
759
+ ens_np = np.array(ens, dtype=np.float64)
760
+ state = np.zeros(dim, dtype=np.float64)
761
+
762
+ state_out, variance, stddev, status = PDAF.diag_variance_nompi(
763
+ dim, dim_ens, state, ens_np, do_mean, do_stddev
764
+ )
765
+ return {
766
+ "success": True,
767
+ "result": {
768
+ "state": state_out.tolist(),
769
+ "variance": variance.tolist(),
770
+ "stddev": float(stddev),
771
+ "status": int(status)
772
+ },
773
+ "error": None
774
+ }
775
+ except Exception as e:
776
+ return {"success": False, "result": None, "error": str(e)}
777
+
778
+
779
+ @mcp.tool(name="pdaf_diag_rmsd_nompi", description="Compute RMSD between two vectors without MPI")
780
+ def pdaf_diag_rmsd_nompi(
781
+ dim_p: int,
782
+ statea_p: List[float],
783
+ stateb_p: List[float]
784
+ ) -> dict:
785
+ """
786
+ Compute the root mean squared distance between two vectors without MPI.
787
+
788
+ Args:
789
+ dim_p: State dimension
790
+ statea_p: State vector A (list of length dim_p)
791
+ stateb_p: State vector B (list of length dim_p)
792
+
793
+ Returns:
794
+ dict: A dictionary containing:
795
+ - rmsd_p: Root mean squared distance
796
+ - status: Status flag (0=success)
797
+ """
798
+ try:
799
+ statea_np = np.array(statea_p, dtype=np.float64)
800
+ stateb_np = np.array(stateb_p, dtype=np.float64)
801
+
802
+ rmsd_p, status = PDAF.diag_rmsd_nompi(dim_p, statea_np, stateb_np)
803
+ return {
804
+ "success": True,
805
+ "result": {
806
+ "rmsd_p": float(rmsd_p),
807
+ "status": int(status)
808
+ },
809
+ "error": None
810
+ }
811
+ except Exception as e:
812
+ return {"success": False, "result": None, "error": str(e)}
813
+
814
+
815
+ @mcp.tool(name="pdaf_diag_ensstats", description="Compute ensemble skewness and kurtosis")
816
+ def pdaf_diag_ensstats(
817
+ dim: int,
818
+ dim_ens: int,
819
+ element: int,
820
+ ens: List[List[float]]
821
+ ) -> dict:
822
+ """
823
+ Compute the skewness and kurtosis of the ensemble for a given state vector element.
824
+
825
+ The definition used for kurtosis follows Lawson & Hansen (2004).
826
+
827
+ Args:
828
+ dim: PE-local state dimension
829
+ dim_ens: Ensemble size
830
+ element: ID of element to be used
831
+ ens: State ensemble (2D list of shape [dim, dim_ens])
832
+
833
+ Returns:
834
+ dict: A dictionary containing:
835
+ - skewness: Skewness of ensemble
836
+ - kurtosis: Kurtosis of ensemble
837
+ - status: Status flag (0=success)
838
+ """
839
+ try:
840
+ ens_np = np.array(ens, dtype=np.float64)
841
+ state = np.zeros(dim, dtype=np.float64)
842
+
843
+ skewness, kurtosis, status = PDAF.diag_ensstats(dim, dim_ens, element, state, ens_np)
844
+ return {
845
+ "success": True,
846
+ "result": {
847
+ "skewness": float(skewness),
848
+ "kurtosis": float(kurtosis),
849
+ "status": int(status)
850
+ },
851
+ "error": None
852
+ }
853
+ except Exception as e:
854
+ return {"success": False, "result": None, "error": str(e)}
855
+
856
+
857
+ @mcp.tool(name="pdaf_sample_ens", description="Generate ensemble from EOF modes and singular values")
858
+ def pdaf_sample_ens(
859
+ dim: int,
860
+ dim_ens: int,
861
+ modes: List[List[float]],
862
+ svals: List[float],
863
+ state: List[float],
864
+ verbose: int,
865
+ flag: int = 0
866
+ ) -> dict:
867
+ """
868
+ Generate an ensemble from singular values and their vectors (EOF modes).
869
+
870
+ The singular values and vectors are derived from ensemble anomalies.
871
+ This ensemble anomaly can be obtained from a time anomaly of a model
872
+ trajectory using PDAF.eofcovar.
873
+
874
+ Args:
875
+ dim: Size of the state vector
876
+ dim_ens: Ensemble size
877
+ modes: Array of EOF modes/matrix of singular vectors (shape [dim, dim_ens-1])
878
+ svals: Singular values (list of length dim_ens-1)
879
+ state: PE-local model mean state (list of length dim)
880
+ verbose: Verbosity flag
881
+ flag: Status flag input
882
+
883
+ Returns:
884
+ dict: A dictionary containing:
885
+ - modes: Updated EOF modes
886
+ - state: Updated mean state
887
+ - ens: Generated state ensemble (shape [dim, dim_ens])
888
+ - flag: Status flag
889
+ """
890
+ try:
891
+ modes_np = np.array(modes, dtype=np.float64)
892
+ svals_np = np.array(svals, dtype=np.float64)
893
+ state_np = np.array(state, dtype=np.float64)
894
+
895
+ modes_out, state_out, ens, flag_out = PDAF.sample_ens(
896
+ dim, dim_ens, modes_np, svals_np, state_np, verbose, flag
897
+ )
898
+ return {
899
+ "success": True,
900
+ "result": {
901
+ "modes": modes_out.tolist(),
902
+ "state": state_out.tolist(),
903
+ "ens": ens.tolist(),
904
+ "flag": int(flag_out)
905
+ },
906
+ "error": None
907
+ }
908
+ except Exception as e:
909
+ return {"success": False, "result": None, "error": str(e)}
910
+
911
+
912
+ @mcp.tool(name="pdaf_local_weight", description="Compute localization weight for a given distance")
913
+ def pdaf_local_weight(
914
+ wtype: int,
915
+ rtype: int,
916
+ cradius: float,
917
+ sradius: float,
918
+ distance: float,
919
+ nrows: int,
920
+ ncols: int,
921
+ a: List[List[float]],
922
+ var_obs: float,
923
+ verbose: int
924
+ ) -> dict:
925
+ """
926
+ Get localization weight for given distance, cut-off radius, support radius,
927
+ weighting type, and weighting function.
928
+
929
+ Args:
930
+ wtype: Type of weight function:
931
+ 0: unit weight (weight=1 up to distance=cradius)
932
+ 1: exponential decrease (weight=1/e at distance=sradius)
933
+ 2: 5th order polynomial (Gaspari and Cohn 1999)
934
+ rtype: Type of regulated weighting:
935
+ !=1: no regulation
936
+ 1: regulated by variance of matrix A and observation variance
937
+ cradius: Cut-off radius where weight=0 beyond it
938
+ sradius: Support radius of localization function
939
+ distance: Distance to observation
940
+ nrows: Number of rows in matrix A
941
+ ncols: Number of columns in matrix A
942
+ a: Ensemble perturbation/anomaly matrix (shape [nrows, ncols])
943
+ var_obs: Observation variance
944
+ verbose: Verbosity flag
945
+
946
+ Returns:
947
+ dict: A dictionary containing:
948
+ - weight: Localization weight
949
+ """
950
+ try:
951
+ a_np = np.array(a, dtype=np.float64)
952
+
953
+ weight = PDAF.local_weight(
954
+ wtype, rtype, cradius, sradius, distance,
955
+ nrows, ncols, a_np, var_obs, verbose
956
+ )
957
+ return {"success": True, "result": {"weight": float(weight)}, "error": None}
958
+ except Exception as e:
959
+ return {"success": False, "result": None, "error": str(e)}
960
+
961
+
962
+ @mcp.tool(name="pdaf_get_local_type", description="Get the localization type of the selected filter")
963
+ def pdaf_get_local_type() -> dict:
964
+ """
965
+ Return the information on the localization type of the selected filter.
966
+
967
+ Returns:
968
+ dict: A dictionary containing:
969
+ - localtype: Localization type
970
+ 0: no localization; global filter
971
+ 1: domain localization (LESTKF, LETKF, LNETF, LSEIK)
972
+ 2: covariance localization (LEnKF)
973
+ 3: covariance loc. but observation handling like domain localization (ENSRF)
974
+ """
975
+ try:
976
+ localtype = PDAF.get_local_type()
977
+ return {"success": True, "result": {"localtype": int(localtype)}, "error": None}
978
+ except Exception as e:
979
+ return {"success": False, "result": None, "error": str(e)}
980
+
981
+
982
+ @mcp.tool(name="pdaf_set_ens_pointer", description="Get a numpy array view of the internal ensemble array")
983
+ def pdaf_set_ens_pointer() -> dict:
984
+ """
985
+ Return the ensemble in a numpy array with the same memory address as
986
+ PDAF's internal ensemble array, allowing for manual ensemble modification.
987
+
988
+ Returns:
989
+ dict: A dictionary containing:
990
+ - ens_shape: Shape of the ensemble array [dim, dim_ens]
991
+ - status: Status flag
992
+ """
993
+ try:
994
+ ens_ptr, status = PDAF.set_ens_pointer()
995
+ return {
996
+ "success": True,
997
+ "result": {
998
+ "ens_shape": list(ens_ptr.shape),
999
+ "ens": ens_ptr.tolist(),
1000
+ "status": int(status)
1001
+ },
1002
+ "error": None
1003
+ }
1004
+ except Exception as e:
1005
+ return {"success": False, "result": None, "error": str(e)}
1006
+
1007
+
1008
+ # ============================================================================
1009
+ # Additional PDAFomi Tools
1010
+ # ============================================================================
1011
+
1012
+ @mcp.tool(name="pdafomi_set_obs_err_type", description="Set observation error distribution type")
1013
+ def pdafomi_set_obs_err_type(i_obs: int, obs_err_type: int) -> dict:
1014
+ """
1015
+ Set the type of observation error distribution for a given observation type.
1016
+
1017
+ Args:
1018
+ i_obs: Index of observation type
1019
+ obs_err_type: Type of observation error distribution:
1020
+ 0: Gaussian (default)
1021
+ 1: double exponential (Laplacian)
1022
+
1023
+ Returns:
1024
+ dict: A dictionary containing the success status.
1025
+ """
1026
+ try:
1027
+ PDAFomi.set_obs_err_type(i_obs, obs_err_type)
1028
+ return {"success": True, "result": f"Observation type {i_obs} error type set to {obs_err_type}", "error": None}
1029
+ except Exception as e:
1030
+ return {"success": False, "result": None, "error": str(e)}
1031
+
1032
+
1033
+ @mcp.tool(name="pdafomi_set_use_global_obs", description="Set whether to use global or process-local observations")
1034
+ def pdafomi_set_use_global_obs(i_obs: int, use_global_obs: int) -> dict:
1035
+ """
1036
+ Set switch for using process-local or global observations.
1037
+
1038
+ By default (use_global_obs=1), PDAF-OMI gathers the entire observation
1039
+ vector for all processes. Setting use_global_obs=0 uses only process-local
1040
+ observations, which can save computational cost.
1041
+
1042
+ Args:
1043
+ i_obs: Index of observation type
1044
+ use_global_obs: 0: Using process-local observations
1045
+ 1: Using cross-process observations (default)
1046
+
1047
+ Returns:
1048
+ dict: A dictionary containing the success status.
1049
+ """
1050
+ try:
1051
+ PDAFomi.set_use_global_obs(i_obs, use_global_obs)
1052
+ return {"success": True, "result": f"Observation type {i_obs} use_global_obs set to {use_global_obs}", "error": None}
1053
+ except Exception as e:
1054
+ return {"success": False, "result": None, "error": str(e)}
1055
+
1056
+
1057
+ @mcp.tool(name="pdafomi_diag_obs_rmsd", description="Compute RMSD between observations and observed model state")
1058
+ def pdafomi_diag_obs_rmsd(nobs: int, verbose: int) -> dict:
1059
+ """
1060
+ Compute root mean squared distance between observations and observed
1061
+ model state for each observation type.
1062
+
1063
+ Args:
1064
+ nobs: Number of observation types
1065
+ verbose: Verbosity flag
1066
+
1067
+ Returns:
1068
+ dict: A dictionary containing:
1069
+ - nobs: Number of observation types
1070
+ - rmsd: Vector of RMSD values for each observation type
1071
+ """
1072
+ try:
1073
+ nobs_out, rmsd = PDAFomi.diag_obs_rmsd(nobs, verbose)
1074
+ return {
1075
+ "success": True,
1076
+ "result": {
1077
+ "nobs": int(nobs_out),
1078
+ "rmsd": rmsd.tolist()
1079
+ },
1080
+ "error": None
1081
+ }
1082
+ except Exception as e:
1083
+ return {"success": False, "result": None, "error": str(e)}
1084
+
1085
+
1086
+ @mcp.tool(name="pdafomi_diag_stats", description="Compute statistics comparing observations and observed ensemble mean")
1087
+ def pdafomi_diag_stats(nobs: int, verbose: int) -> dict:
1088
+ """
1089
+ Compute a selection of 6 statistics comparing observations and
1090
+ observed ensemble mean for each observation type.
1091
+
1092
+ Statistics include:
1093
+ - (1,:) correlations between observation and observed ensemble mean
1094
+ - (2,:) centered RMS difference
1095
+ - (3,:) mean bias (observation minus observed ensemble mean)
1096
+ - (4,:) mean absolute difference
1097
+ - (5,:) variance of observations
1098
+ - (6,:) variance of observed ensemble mean
1099
+
1100
+ Args:
1101
+ nobs: Number of observation types
1102
+ verbose: Verbosity flag
1103
+
1104
+ Returns:
1105
+ dict: A dictionary containing:
1106
+ - nobs: Number of observation types
1107
+ - obsstats: Array of observation statistics (shape [6, nobs])
1108
+ """
1109
+ try:
1110
+ nobs_out, obsstats = PDAFomi.diag_stats(nobs, verbose)
1111
+ return {
1112
+ "success": True,
1113
+ "result": {
1114
+ "nobs": int(nobs_out),
1115
+ "obsstats": obsstats.tolist()
1116
+ },
1117
+ "error": None
1118
+ }
1119
+ except Exception as e:
1120
+ return {"success": False, "result": None, "error": str(e)}
1121
+
1122
+
1123
+ # ============================================================================
1124
+ # Additional PDAF Setter Functions (不需要回调和MPI)
1125
+ # ============================================================================
1126
+
1127
+ @mcp.tool(name="pdaf_set_comm_pdaf", description="Set the MPI communicator used by PDAF")
1128
+ def pdaf_set_comm_pdaf(in_comm_pdaf: int) -> dict:
1129
+ """
1130
+ Set the MPI communicator used by PDAF.
1131
+
1132
+ By default, PDAF assumes it can use all available processes (MPI_COMM_WORLD).
1133
+ By using this function, we limit the number of processes that can be used
1134
+ by PDAF to the given MPI communicator.
1135
+
1136
+ Args:
1137
+ in_comm_pdaf: MPI communicator for PDAF (integer handle)
1138
+
1139
+ Returns:
1140
+ dict: A dictionary containing the success status.
1141
+ """
1142
+ try:
1143
+ PDAF.set_comm_pdaf(in_comm_pdaf)
1144
+ return {"success": True, "result": f"PDAF communicator set to {in_comm_pdaf}", "error": None}
1145
+ except Exception as e:
1146
+ return {"success": False, "result": None, "error": str(e)}
1147
+
1148
+
1149
+ @mcp.tool(name="pdaf_set_iparam", description="Set integer parameters for PDAF")
1150
+ def pdaf_set_iparam(idval: int, value: int, flag: int = 0) -> dict:
1151
+ """
1152
+ Set integer parameters for PDAF.
1153
+
1154
+ This function provides an alternative way to set integer parameters
1155
+ instead of providing all parameters in the call to PDAF.init.
1156
+
1157
+ Args:
1158
+ idval: Index of parameter
1159
+ value: Parameter value
1160
+ flag: Status flag input (default 0)
1161
+
1162
+ Returns:
1163
+ dict: A dictionary containing:
1164
+ - flag: Status flag (0 for no error)
1165
+ """
1166
+ try:
1167
+ result = PDAF.set_iparam(idval, value, flag)
1168
+ return {"success": True, "result": {"flag": int(result)}, "error": None}
1169
+ except Exception as e:
1170
+ return {"success": False, "result": None, "error": str(e)}
1171
+
1172
+
1173
+ @mcp.tool(name="pdaf_set_rparam", description="Set floating-point parameters for PDAF")
1174
+ def pdaf_set_rparam(idval: int, value: float, flag: int = 0) -> dict:
1175
+ """
1176
+ Set floating-point parameters for PDAF.
1177
+
1178
+ This function provides an alternative way to set real parameters
1179
+ instead of providing all parameters in the call to PDAF.init.
1180
+
1181
+ Args:
1182
+ idval: Index of parameter
1183
+ value: Parameter value (float)
1184
+ flag: Status flag input (default 0)
1185
+
1186
+ Returns:
1187
+ dict: A dictionary containing:
1188
+ - flag: Status flag (0 for no error)
1189
+ """
1190
+ try:
1191
+ result = PDAF.set_rparam(idval, value, flag)
1192
+ return {"success": True, "result": {"flag": int(result)}, "error": None}
1193
+ except Exception as e:
1194
+ return {"success": False, "result": None, "error": str(e)}
1195
+
1196
+
1197
+ @mcp.tool(name="pdaf_set_memberid", description="Set the ensemble member index to a given value")
1198
+ def pdaf_set_memberid(memberid: int) -> dict:
1199
+ """
1200
+ Set the ensemble member index to a given value.
1201
+
1202
+ Args:
1203
+ memberid: Index in the local ensemble
1204
+
1205
+ Returns:
1206
+ dict: A dictionary containing:
1207
+ - memberid: The set member index
1208
+ """
1209
+ try:
1210
+ result = PDAF.set_memberid(memberid)
1211
+ return {"success": True, "result": {"memberid": int(result)}, "error": None}
1212
+ except Exception as e:
1213
+ return {"success": False, "result": None, "error": str(e)}
1214
+
1215
+
1216
+ @mcp.tool(name="pdaf_set_seedset", description="Choose a seedset for the random number generator")
1217
+ def pdaf_set_seedset(seedset_in: int) -> dict:
1218
+ """
1219
+ Choose a seedset for the random number generator used in PDAF.
1220
+
1221
+ Args:
1222
+ seedset_in: Seedset index (1-20)
1223
+
1224
+ Returns:
1225
+ dict: A dictionary containing the success status.
1226
+ """
1227
+ try:
1228
+ PDAF.set_seedset(seedset_in)
1229
+ return {"success": True, "result": f"Seedset set to {seedset_in}", "error": None}
1230
+ except Exception as e:
1231
+ return {"success": False, "result": None, "error": str(e)}
1232
+
1233
+
1234
+ @mcp.tool(name="pdaf_get_obsmemberid", description="Get ensemble member ID when observation operator is applied")
1235
+ def pdaf_get_obsmemberid(memberid: int = 0) -> dict:
1236
+ """
1237
+ Return the ensemble member ID when observation operator is being applied.
1238
+
1239
+ This function is used specifically for user-supplied function py__obs_op_pdaf.
1240
+
1241
+ Args:
1242
+ memberid: Input member ID (can be any value)
1243
+
1244
+ Returns:
1245
+ dict: A dictionary containing:
1246
+ - memberid: Index in the local ensemble
1247
+ """
1248
+ try:
1249
+ result = PDAF.get_obsmemberid(memberid)
1250
+ return {"success": True, "result": {"memberid": int(result)}, "error": None}
1251
+ except Exception as e:
1252
+ return {"success": False, "result": None, "error": str(e)}
1253
+
1254
+
1255
+ @mcp.tool(name="pdaf_local_weights", description="Get a vector of localization weights for given distances")
1256
+ def pdaf_local_weights(
1257
+ wtype: int,
1258
+ cradius: float,
1259
+ sradius: float,
1260
+ dim: int,
1261
+ distance: List[float],
1262
+ verbose: int
1263
+ ) -> dict:
1264
+ """
1265
+ Get a vector of localization weights for given distances.
1266
+
1267
+ This is a vectorized version of pdaf_local_weight without regulation.
1268
+
1269
+ Args:
1270
+ wtype: Type of weight function:
1271
+ 0: unit weight (weight=1 up to distance=cradius)
1272
+ 1: exponential decrease (weight=1/e at distance=sradius)
1273
+ 2: 5th order polynomial (Gaspari and Cohn 1999)
1274
+ cradius: Cut-off radius where weight=0 beyond it
1275
+ sradius: Support radius of localization function
1276
+ dim: Size of distance and weight arrays
1277
+ distance: Array of distances to observations (list of length dim)
1278
+ verbose: Verbosity flag
1279
+
1280
+ Returns:
1281
+ dict: A dictionary containing:
1282
+ - weights: Array of localization weights (list of length dim)
1283
+ """
1284
+ try:
1285
+ distance_np = np.array(distance, dtype=np.float64)
1286
+ weights = PDAF.local_weights(wtype, cradius, sradius, dim, distance_np, verbose)
1287
+ return {"success": True, "result": {"weights": weights.tolist()}, "error": None}
1288
+ except Exception as e:
1289
+ return {"success": False, "result": None, "error": str(e)}
1290
+
1291
+
1292
+ @mcp.tool(name="pdaf_diag_crps_nompi", description="Compute Continuous Ranked Probability Score without MPI")
1293
+ def pdaf_diag_crps_nompi(
1294
+ dim: int,
1295
+ dim_ens: int,
1296
+ element: int,
1297
+ oens: List[List[float]],
1298
+ obs: List[float]
1299
+ ) -> dict:
1300
+ """
1301
+ Obtain a Continuous Ranked Probability Score (CRPS) for an ensemble without MPI.
1302
+
1303
+ Based on Hersbach (2000) decomposition of CRPS.
1304
+
1305
+ Args:
1306
+ dim: Dimension of state vector
1307
+ dim_ens: Ensemble size
1308
+ element: ID of element to be used (0 for mean over all elements)
1309
+ oens: State ensemble (2D list of shape [dim, dim_ens])
1310
+ obs: Observation/true state (list of length dim)
1311
+
1312
+ Returns:
1313
+ dict: A dictionary containing:
1314
+ - CRPS: Continuous Ranked Probability Score
1315
+ - reli: Reliability
1316
+ - resol: Resolution
1317
+ - uncert: Uncertainty
1318
+ - status: Status flag (0=success)
1319
+ """
1320
+ try:
1321
+ oens_np = np.array(oens, dtype=np.float64)
1322
+ obs_np = np.array(obs, dtype=np.float64)
1323
+
1324
+ crps, reli, resol, uncert, status = PDAF.diag_crps_nompi(
1325
+ dim, dim_ens, element, oens_np, obs_np
1326
+ )
1327
+ return {
1328
+ "success": True,
1329
+ "result": {
1330
+ "CRPS": float(crps),
1331
+ "reli": float(reli),
1332
+ "resol": float(resol),
1333
+ "uncert": float(uncert),
1334
+ "status": int(status)
1335
+ },
1336
+ "error": None
1337
+ }
1338
+ except Exception as e:
1339
+ return {"success": False, "result": None, "error": str(e)}
1340
+
1341
+
1342
+ @mcp.tool(name="pdaf_diag_compute_moments", description="Compute statistical moments from an ensemble")
1343
+ def pdaf_diag_compute_moments(
1344
+ dim_p: int,
1345
+ dim_ens: int,
1346
+ ens: List[List[float]],
1347
+ kmax: int,
1348
+ bias: int
1349
+ ) -> dict:
1350
+ """
1351
+ Compute the mean, variance, skewness, and excess kurtosis from an ensemble.
1352
+
1353
+ Args:
1354
+ dim_p: PE-local state dimension
1355
+ dim_ens: Ensemble size
1356
+ ens: State ensemble (2D list of shape [dim_p, dim_ens])
1357
+ kmax: Maximum moment to compute (1=mean, 2=variance, 3=skewness, 4=kurtosis)
1358
+ bias: 0 for unbiased estimates, 1 for biased estimates
1359
+
1360
+ Returns:
1361
+ dict: A dictionary containing:
1362
+ - moments: Array of moments (shape [kmax, dim_p])
1363
+ """
1364
+ try:
1365
+ ens_np = np.array(ens, dtype=np.float64)
1366
+ moments = PDAF.diag_compute_moments(dim_p, dim_ens, ens_np, kmax, bias)
1367
+ return {"success": True, "result": {"moments": moments.tolist()}, "error": None}
1368
+ except Exception as e:
1369
+ return {"success": False, "result": None, "error": str(e)}
1370
+
1371
+
1372
+ # ============================================================================
1373
+ # Additional PDAFomi Setter Functions
1374
+ # ============================================================================
1375
+
1376
+ @mcp.tool(name="pdafomi_set_inno_omit", description="Set innovation threshold for removing observation outliers")
1377
+ def pdafomi_set_inno_omit(i_obs: int, inno_omit: float) -> dict:
1378
+ """
1379
+ Set innovation threshold for removing observation outliers.
1380
+
1381
+ By default, no observations are omitted. Observation omission is only
1382
+ activated when inno_omit > 0.0. PDAF will omit observations where
1383
+ the squared innovation of the ensemble mean is larger than the product
1384
+ of inno_omit and observation error variance.
1385
+
1386
+ Args:
1387
+ i_obs: Index of observation type
1388
+ inno_omit: Threshold of innovation to be omitted
1389
+
1390
+ Returns:
1391
+ dict: A dictionary containing the success status.
1392
+ """
1393
+ try:
1394
+ PDAFomi.set_inno_omit(i_obs, inno_omit)
1395
+ return {"success": True, "result": f"Observation type {i_obs} inno_omit set to {inno_omit}", "error": None}
1396
+ except Exception as e:
1397
+ return {"success": False, "result": None, "error": str(e)}
1398
+
1399
+
1400
+ @mcp.tool(name="pdafomi_set_inno_omit_ivar", description="Set inverse variance for omitted observations")
1401
+ def pdafomi_set_inno_omit_ivar(i_obs: int, inno_omit_ivar: float) -> dict:
1402
+ """
1403
+ Set the inverse of observation error variance for omitted observations.
1404
+
1405
+ This should be set to a very small value relative to assimilated observations.
1406
+ By default, it is set to 1e-12.
1407
+
1408
+ Args:
1409
+ i_obs: Index of observation type
1410
+ inno_omit_ivar: Inverse of observation variance for omitted observations
1411
+
1412
+ Returns:
1413
+ dict: A dictionary containing the success status.
1414
+ """
1415
+ try:
1416
+ PDAFomi.set_inno_omit_ivar(i_obs, inno_omit_ivar)
1417
+ return {"success": True, "result": f"Observation type {i_obs} inno_omit_ivar set to {inno_omit_ivar}", "error": None}
1418
+ except Exception as e:
1419
+ return {"success": False, "result": None, "error": str(e)}
1420
+
1421
+
1422
+ @mcp.tool(name="pdafomi_set_domainsize", description="Set domain size for observation type")
1423
+ def pdafomi_set_domainsize(i_obs: int, domainsize: List[float]) -> dict:
1424
+ """
1425
+ Set the domain size for periodic boundary conditions.
1426
+
1427
+ This is used when disttype is set to periodic distance calculation.
1428
+
1429
+ Args:
1430
+ i_obs: Index of observation type
1431
+ domainsize: Domain size array (list of floats)
1432
+
1433
+ Returns:
1434
+ dict: A dictionary containing the success status.
1435
+ """
1436
+ try:
1437
+ domainsize_np = np.array(domainsize, dtype=np.float64)
1438
+ PDAFomi.set_domainsize(i_obs, domainsize_np)
1439
+ return {"success": True, "result": f"Observation type {i_obs} domainsize set", "error": None}
1440
+ except Exception as e:
1441
+ return {"success": False, "result": None, "error": str(e)}
1442
+
1443
+
1444
+ @mcp.tool(name="pdafomi_set_name", description="Set the name of an observation type")
1445
+ def pdafomi_set_name(i_obs: int, name: str) -> dict:
1446
+ """
1447
+ Set the name identifier for an observation type.
1448
+
1449
+ This name is used in diagnostic output to identify the observation type.
1450
+
1451
+ Args:
1452
+ i_obs: Index of observation type
1453
+ name: Name string for the observation type
1454
+
1455
+ Returns:
1456
+ dict: A dictionary containing the success status.
1457
+ """
1458
+ try:
1459
+ PDAFomi.set_name(i_obs, name)
1460
+ return {"success": True, "result": f"Observation type {i_obs} name set to '{name}'", "error": None}
1461
+ except Exception as e:
1462
+ return {"success": False, "result": None, "error": str(e)}
1463
+
1464
+
1465
+ @mcp.tool(name="pdafomi_diag_get_obs", description="Get observation vector and coordinates for an observation type")
1466
+ def pdafomi_diag_get_obs(id_obs: int) -> dict:
1467
+ """
1468
+ Get observation vector and corresponding coordinates for specified observation type.
1469
+
1470
+ Args:
1471
+ id_obs: Index of observation type to return
1472
+
1473
+ Returns:
1474
+ dict: A dictionary containing:
1475
+ - dim_obs_diag: Observation dimension
1476
+ - ncoord: Number of observation dimensions
1477
+ - obs_p: Observation vector
1478
+ - ocoord_p: Coordinate array
1479
+ """
1480
+ try:
1481
+ dim_obs_diag, ncoord, obs_p, ocoord_p = PDAFomi.diag_get_obs(id_obs)
1482
+ return {
1483
+ "success": True,
1484
+ "result": {
1485
+ "dim_obs_diag": int(dim_obs_diag),
1486
+ "ncoord": int(ncoord),
1487
+ "obs_p": obs_p.tolist(),
1488
+ "ocoord_p": ocoord_p.tolist()
1489
+ },
1490
+ "error": None
1491
+ }
1492
+ except Exception as e:
1493
+ return {"success": False, "result": None, "error": str(e)}
1494
+
1495
+
1496
+ @mcp.tool(name="pdafomi_diag_get_hxmean", description="Get observed ensemble mean for an observation type")
1497
+ def pdafomi_diag_get_hxmean(id_obs: int) -> dict:
1498
+ """
1499
+ Get observed ensemble mean for a given observation type.
1500
+
1501
+ Args:
1502
+ id_obs: Index of observation type to return
1503
+
1504
+ Returns:
1505
+ dict: A dictionary containing:
1506
+ - dim_obs_diag: Observation dimension
1507
+ - hxmean_p: Observed ensemble mean
1508
+ """
1509
+ try:
1510
+ dim_obs_diag, hxmean_p = PDAFomi.diag_get_hxmean(id_obs)
1511
+ return {
1512
+ "success": True,
1513
+ "result": {
1514
+ "dim_obs_diag": int(dim_obs_diag),
1515
+ "hxmean_p": hxmean_p.tolist()
1516
+ },
1517
+ "error": None
1518
+ }
1519
+ except Exception as e:
1520
+ return {"success": False, "result": None, "error": str(e)}
1521
+
1522
+
1523
+ @mcp.tool(name="pdafomi_diag_get_ivar", description="Get inverse observation error variance for an observation type")
1524
+ def pdafomi_diag_get_ivar(id_obs: int) -> dict:
1525
+ """
1526
+ Get inverse of observation error variance for a given observation type.
1527
+
1528
+ Args:
1529
+ id_obs: Index of observation type to return
1530
+
1531
+ Returns:
1532
+ dict: A dictionary containing:
1533
+ - dim_obs_diag: Observation dimension
1534
+ - ivar: Inverse observation error variances
1535
+ """
1536
+ try:
1537
+ dim_obs_diag, ivar = PDAFomi.diag_get_ivar(id_obs)
1538
+ return {
1539
+ "success": True,
1540
+ "result": {
1541
+ "dim_obs_diag": int(dim_obs_diag),
1542
+ "ivar": ivar.tolist()
1543
+ },
1544
+ "error": None
1545
+ }
1546
+ except Exception as e:
1547
+ return {"success": False, "result": None, "error": str(e)}
1548
+
1549
+
1550
+ # ============================================================================
1551
+ # Utility Functions
1552
+ # ============================================================================
1553
+
1554
+ @mcp.tool(name="get_pdaf_module_info", description="Get information about available pyPDAF modules and their functions")
1555
+ def get_pdaf_module_info() -> dict:
1556
+ """
1557
+ Get information about available pyPDAF modules and their main functions.
1558
+
1559
+ Returns:
1560
+ dict: A dictionary containing module information.
1561
+ """
1562
+ try:
1563
+ info = {
1564
+ "PDAF": {
1565
+ "description": "Core PDAF module with filter functions and utilities",
1566
+ "main_functions": [
1567
+ "correlation_function", "deallocate", "eofcovar", "force_analysis",
1568
+ "get_fcst_info", "print_filter_types", "print_da_types", "print_info",
1569
+ "reset_forget", "set_debug_flag", "set_offline_mode", "sample_ens",
1570
+ "local_weight", "local_weights", "set_ens_pointer",
1571
+ "get_assim_flag", "get_localfilter", "get_local_type", "get_memberid",
1572
+ "diag_ensmean", "diag_stddev_nompi", "diag_stddev",
1573
+ "diag_variance_nompi", "diag_variance",
1574
+ "diag_rmsd_nompi", "diag_rmsd",
1575
+ "diag_effsample", "diag_ensstats", "diag_compute_moments"
1576
+ ]
1577
+ },
1578
+ "PDAF3": {
1579
+ "description": "PDAF3 module with initialization and assimilation functions",
1580
+ "main_functions": [
1581
+ "init", "init_forecast", "set_parallel",
1582
+ "assimilate", "assim_offline",
1583
+ "assimilate_3dvar_all", "assim_offline_3dvar_all",
1584
+ "assimilate_local_nondiagr", "assimilate_global_nondiagr",
1585
+ "generate_obs", "generate_obs_offline"
1586
+ ]
1587
+ },
1588
+ "PDAFomi": {
1589
+ "description": "PDAF Observation Module Interface for flexible observation handling",
1590
+ "main_functions": [
1591
+ "init", "init_local", "check_error", "gather_obs",
1592
+ "set_debug_flag", "set_doassim", "set_disttype", "set_ncoord",
1593
+ "set_obs_err_type", "set_use_global_obs",
1594
+ "set_inno_omit", "set_inno_omit_ivar",
1595
+ "diag_nobstypes", "diag_dimobs", "diag_obs_rmsd", "diag_stats",
1596
+ "diag_get_hx", "diag_get_hxmean", "diag_get_obs"
1597
+ ]
1598
+ },
1599
+ "PDAFlocal": {
1600
+ "description": "PDAF local analysis module for domain localization",
1601
+ "main_functions": [
1602
+ "set_indices", "set_increment_weights", "clear_increment_weights"
1603
+ ]
1604
+ },
1605
+ "PDAFlocalomi": {
1606
+ "description": "PDAF local analysis with OMI observation handling",
1607
+ "main_functions": []
1608
+ }
1609
+ }
1610
+ return {"success": True, "result": info, "error": None}
1611
+ except Exception as e:
1612
+ return {"success": False, "result": None, "error": str(e)}
1613
+
1614
+
1615
+ def create_app() -> FastMCP:
1616
+ """
1617
+ Creates and returns the FastMCP application instance.
1618
+
1619
+ Returns:
1620
+ FastMCP: The FastMCP application instance.
1621
+ """
1622
+ return mcp
pyPDAF/mcp_output/requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastmcp>=0.1.0
2
+ pydantic>=2.0.0
pyPDAF/mcp_output/simple_revise_error_analysis.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "status": "FAIL",
3
+ "next_action": "fix_directly",
4
+ "confidence": 0.9,
5
+ "summary": "The error is due to a missing Python module 'mpi4py'. This can be fixed directly by installing the missing module. Use the command 'conda install mpi4py' or 'pip install mpi4py' within the appropriate conda environment to resolve the issue. Ensure that the environment where the script is being executed has access to the 'mpi4py' module."
6
+ }
pyPDAF/mcp_output/start_mcp.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ MCP Service Startup Entry
3
+ """
4
+ import sys
5
+ import os
6
+
7
+ project_root = os.path.dirname(os.path.abspath(__file__))
8
+ mcp_plugin_dir = os.path.join(project_root, "mcp_plugin")
9
+ if mcp_plugin_dir not in sys.path:
10
+ sys.path.insert(0, mcp_plugin_dir)
11
+
12
+ # Set path to source directory
13
+ source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "source", "src")
14
+ sys.path.insert(0, source_path)
15
+
16
+ from mcp_service import create_app
17
+
18
+ def main():
19
+ """Start FastMCP service"""
20
+ app = create_app()
21
+ # Use environment variable to configure port, default 8000
22
+ port = int(os.environ.get("MCP_PORT", "8000"))
23
+
24
+ # Choose transport mode based on environment variable
25
+ transport = os.environ.get("MCP_TRANSPORT", "stdio")
26
+ if transport == "http":
27
+ app.run(transport="http", host="0.0.0.0", port=port)
28
+ else:
29
+ # Default to STDIO mode
30
+ app.run()
31
+
32
+ if __name__ == "__main__":
33
+ main()
pyPDAF/mcp_output/tests_mcp/test_mcp_basic.py ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ MCP Service Basic Test
3
+ """
4
+ import sys
5
+ import os
6
+
7
+ project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
8
+ mcp_plugin_dir = os.path.join(project_root, "mcp_plugin")
9
+ if mcp_plugin_dir not in sys.path:
10
+ sys.path.insert(0, mcp_plugin_dir)
11
+
12
+ source_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), "source")
13
+ sys.path.insert(0, source_path)
14
+
15
+ def test_import_mcp_service():
16
+ """Test if MCP service can be imported normally"""
17
+ try:
18
+ from mcp_service import create_app
19
+ app = create_app()
20
+ assert app is not None
21
+ print("MCP service imported successfully")
22
+ return True
23
+ except Exception as e:
24
+ print("MCP service import failed: " + str(e))
25
+ return False
26
+
27
+ def test_adapter_init():
28
+ """Test if adapter can be initialized normally"""
29
+ try:
30
+ from adapter import Adapter
31
+ adapter = Adapter()
32
+ assert adapter is not None
33
+ print("Adapter initialized successfully")
34
+ return True
35
+ except Exception as e:
36
+ print("Adapter initialization failed: " + str(e))
37
+ return False
38
+
39
+ if __name__ == "__main__":
40
+ print("Running MCP service basic test...")
41
+ test1 = test_import_mcp_service()
42
+ test2 = test_adapter_init()
43
+
44
+ if test1 and test2:
45
+ print("All basic tests passed")
46
+ sys.exit(0)
47
+ else:
48
+ print("Some tests failed")
49
+ sys.exit(1)
pyPDAF/mcp_output/tests_smoke/test_smoke.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import importlib, sys
2
+ import os
3
+
4
+ # Add current directory to Python path
5
+ sys.path.insert(0, os.getcwd())
6
+
7
+ source_dir = os.path.join(os.getcwd(), "source")
8
+ if os.path.exists(source_dir):
9
+ sys.path.insert(0, source_dir)
10
+
11
+
12
+ try:
13
+ importlib.import_module("src.pyPDAF")
14
+ print("OK - Successfully imported src.pyPDAF")
15
+ except ImportError as e:
16
+ print(f"Failed to import src.pyPDAF: {e}")
17
+ fallback_packages = []
18
+
19
+ fallback_packages = ['pyPDAF', 'src.pyPDAF']
20
+
21
+ for pkg in fallback_packages:
22
+ try:
23
+ importlib.import_module(pkg)
24
+ print(f"OK - Successfully imported {pkg}")
25
+ break
26
+ except ImportError:
27
+ continue
28
+ else:
29
+ print("All import attempts failed")
pyPDAF/source/.github/workflows/conda_build_linux.yaml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: conda_build_linux
2
+ on: [workflow_dispatch]
3
+ jobs:
4
+ upload_conda_linux:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v4
8
+ with:
9
+ submodules: 'true'
10
+
11
+ - uses: conda-incubator/setup-miniconda@v3
12
+ with:
13
+ auto-activate-base: true
14
+ auto-update-conda: true
15
+ activate-environment: ""
16
+
17
+ - name: install pyPDAF
18
+ shell: bash -el {0}
19
+ run: |
20
+ conda install python anaconda-client conda-build conda-verify
21
+ anaconda logout --at anaconda.org
22
+ anaconda login --at anaconda.org --hostname "$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER" --username yumengch --password ${{ secrets.ANACONDA }}
23
+ conda config --set anaconda_upload yes
24
+ conda-build -c conda-forge conda.recipe/
25
+ conda install -y -c conda-forge --use-local pypdaf
26
+ cd example
27
+ mpiexec -n 4 python -u online/main.py
28
+
29
+ - name: Setup tmate session
30
+ if: ${{ failure() }}
31
+ uses: mxschmitt/action-tmate@v3
pyPDAF/source/.github/workflows/conda_build_mac_intel.yaml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: conda_build_mac_intel
2
+ on: [workflow_dispatch]
3
+ jobs:
4
+ upload_conda_mac_intel:
5
+ runs-on: macos-15-intel
6
+ steps:
7
+ - uses: actions/checkout@v4
8
+ with:
9
+ submodules: 'true'
10
+
11
+ - uses: conda-incubator/setup-miniconda@v3
12
+ with:
13
+ auto-activate-base: true
14
+ auto-update-conda: true
15
+ activate-environment: ""
16
+
17
+ - name: build pyPDAF
18
+ shell: bash -el {0}
19
+ run: |
20
+ conda install python anaconda-client conda-build conda-verify
21
+ anaconda login --at anaconda.org --username yumengch --password ${{ secrets.ANACONDA }}
22
+ conda config --set anaconda_upload yes
23
+ conda-build -c conda-forge conda.recipe/
24
+
25
+ - name: install pyPDAF
26
+ shell: bash -el {0}
27
+ run: |
28
+ conda install -y -c conda-forge --use-local pypdaf
29
+ cd example
30
+ mpiexec -n 4 python -u online/main.py
31
+
32
+ - name: Setup tmate session
33
+ if: ${{ failure() }}
34
+ uses: mxschmitt/action-tmate@v3
pyPDAF/source/.github/workflows/conda_build_mac_m1.yaml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: conda_build_mac_m1
2
+ on: [workflow_dispatch]
3
+ jobs:
4
+ upload_conda_mac_m1:
5
+ runs-on: macos-latest
6
+ steps:
7
+ - uses: actions/checkout@v4
8
+ with:
9
+ submodules: 'true'
10
+
11
+ - uses: conda-incubator/setup-miniconda@v3
12
+ with:
13
+ auto-activate-base: true
14
+ auto-update-conda: true
15
+ activate-environment: ""
16
+
17
+ - name: build pyPDAF
18
+ shell: bash -el {0}
19
+ run: |
20
+ conda install python anaconda-client conda-build conda-verify
21
+ anaconda login --at anaconda.org --username yumengch --password ${{ secrets.ANACONDA }}
22
+ conda config --set anaconda_upload yes
23
+ conda-build -c conda-forge conda.recipe/
24
+
25
+ - name: install pyPDAF
26
+ shell: bash -el {0}
27
+ run: |
28
+ conda install -y -c conda-forge --use-local pypdaf
29
+ cd example
30
+ mpiexec -n 4 python -u online/main.py
31
+
32
+ - name: Setup tmate session
33
+ if: ${{ failure() }}
34
+ uses: mxschmitt/action-tmate@v3
pyPDAF/source/.github/workflows/conda_build_win.yaml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: conda_build_win
2
+ on: [workflow_dispatch]
3
+ jobs:
4
+ upload_conda_win:
5
+ runs-on: windows-latest
6
+ steps:
7
+ - uses: actions/checkout@v4
8
+ with:
9
+ submodules: 'true'
10
+
11
+ - uses: conda-incubator/setup-miniconda@v3
12
+ with:
13
+ auto-activate-base: true
14
+ activate-environment: ""
15
+
16
+ - name: setup anaconda
17
+ shell: cmd /C CALL {0}
18
+ run: |
19
+ conda install -n base python anaconda-client conda-build conda-verify
20
+
21
+
22
+ - name: anaconda login
23
+ shell: cmd /C CALL {0}
24
+ run: |
25
+ call conda activate base
26
+ anaconda login --at anaconda.org --hostname "$GITHUB_RUN_ID-$GITHUB_RUN_NUMBER" --username yumengch --password ${{ secrets.ANACONDA }}
27
+
28
+ - name: set anaconda upload
29
+ shell: cmd /C CALL {0}
30
+ run: |
31
+ call conda activate base
32
+ conda config --set anaconda_upload yes
33
+
34
+ - name: build pyPDAF
35
+ shell: cmd /C CALL {0}
36
+ run: |
37
+ call conda activate base
38
+ conda build -c conda-forge conda.recipe/
39
+ conda install -y -c conda-forge --use-local pypdaf
40
+ cd example
41
+ mpiexec -n 4 python -u online/main.py
42
+
43
+ - name: Setup tmate session
44
+ if: ${{ failure() }}
45
+ uses: mxschmitt/action-tmate@v3
pyPDAF/source/.gitignore ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ *.o
132
+ *.mod
133
+ *.pyc
134
+ *.npz
135
+ *.a
136
+ *.c
137
+ docs/build/
138
+ docs/source/_autosummary
pyPDAF/source/.gitmodules ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [submodule "PDAF"]
2
+ branch = PDAF_V3.0
3
+ path = PDAF
4
+ url = https://github.com/PDAF/PDAF.git
pyPDAF/source/LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ <program> Copyright (C) <year> <name of author>
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
pyPDAF/source/README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # pyPDAF - A Python interface to the Fortran-written data assimilation library
2
+
3
+ pyPDAF provides a Python interface to the established
4
+ [Parallel Data Assimilation Framework (PDAF)](https://pdaf.awi.de/trac/wiki).
5
+ The original framework is used with various regional and global
6
+ climate models including atmosphere, ocean, hydrology, land surface
7
+ and sea ice models. These models are typically written in Fortran
8
+ which can be easily used with PDAF. pyPDAF can become useful
9
+ in the following scenarios:
10
+ - With an increasing number of Python-coded numerical models,
11
+ especially machine learning models, pyPDAF is a convenient tool
12
+ to implement data assimilation (DA) systems purely in Python.
13
+ - Alternatively, pyPDAF can be used to set up offline
14
+ data assimilation system. In such a system, the model fields in
15
+ restart files are replaced by analyses generated by pyPDAF.
16
+ This can be an attractive alternative to the original Fortran
17
+ implementations considering the simplicity of code implementation
18
+ and package management in Python.
19
+
20
+ The interface inherits the efficiency of the data assimilation
21
+ algorithms in Fortran, and the flexibility to be applied to different
22
+ models and observations. This means that users of pyPDAF can couple
23
+ the DA algorithms with any types of model and observations without
24
+ the need to coding the actual DA algorithms. This allows the users
25
+ to focus on the specific research problems. The framework includes
26
+ various ensemble DA algorithms including many variants of ensemble
27
+ Kalman filters, particle filters and other non-linear filters.
28
+ It also provides framework for variants of 3DVar. A full list of
29
+ supported methods can be found
30
+ [here](https://pdaf.awi.de/trac/wiki/AvailableOptionsforInitPDAF)
31
+
32
+ ## Getting Started
33
+ It is recommended to install pyPDAF via `conda`:
34
+ ```bash
35
+ conda create -n pypdaf -c conda-forge yumengch::pypdaf
36
+ ```
37
+ You can also install from the source code using `pip` and `meson`. One can
38
+ find the information in .
39
+
40
+ ## Building a DA system with pyPDAF
41
+ To construct a data assimilation system, only 7 pyPDAF functions are necessary:
42
+ ### Initialise PDAF
43
+ - pyPDAF.set_parallel - one can omit it without parallelisation
44
+ - pyPDAF.init
45
+ - pyPDAF.PDAFomi.init
46
+ - pyPDAF.PDAFomi.init_local - only used in domain localisation
47
+ - pyPDAF.PDAFomi.set_domain_limits - only used in domain localisation
48
+ - pyPDAF.init_forecast
49
+
50
+ ### Data assimilation
51
+ - pyPDAF.assimilate
52
+
53
+ ### Finalise PDAF
54
+ - pyPDAF.deallocate
55
+
56
+ However, users have to implement user-supplied functions to provide state vector
57
+ and observation information.
58
+
59
+ For users without prior experience with PDAF, we highly recommend to
60
+ start with the tutorial here:
61
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/yumengch/pyPDAF/).
62
+
63
+ To construct a parallel ensemble DA system,
64
+ in [example](example) directory, we provide both `online`
65
+ and `offline` examples.
66
+ pyPDAF and PDAF both utilise `Message Passing Interface (MPI)`
67
+ parallelisation. Hence, to run the example, it needs to be executed
68
+ from commandline using `mpiexec`. For example,
69
+ ```bash
70
+ cd example
71
+ mpiexec -n 4 python -u online/main.py
72
+ ```
73
+ will run the example with 4 processes.
74
+ The example is based on
75
+ the [tutorials](http://pdaf.awi.de/trac/wiki/FirstSteps) of the original PDAF.
76
+
77
+
78
+ ## Documentation:
79
+ The most up-to-date pyPDAF has interface with ```PDAF-V3.0```.
80
+ A [documentation](https://yumengch.github.io/pyPDAF/index.html) is provided.
81
+ The interface follows the naming convention of PDAF. We divide PDAF subroutines
82
+ into several subpackages including `PDAF`, `PDAF3`, `PDAFomi`, `PDAFlocal`, and
83
+ `PDAFlocalomi`. These provide
84
+
85
+
86
+ ## Having questions?
87
+ We welcome issues, pull requests, feature requests and any other discussions in the issues section.
88
+
89
+ ## Contributors:
90
+ Yumeng Chen, Lars Nerger
91
+
92
+ pyPDAF is mainly developed and maintained by National Centre for Earth Observation and University of Reading.
93
+
94
+ <img src="https://github.com/nansencenter/DAPPER/blob/master/docs/images/logos/UoR-logo.png?raw=true" height="50" /> <img src="https://github.com/nansencenter/DAPPER/blob/master/docs/images/logos/nceologo1000.png?raw=true" height="50"/>
pyPDAF/source/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ pyPDAF Project Package Initialization File
4
+ """
pyPDAF/source/build/cp310/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+
2
+ # This file is generated by meson-python. It will not be recreated if deleted or modified.
3
+ *
pyPDAF/source/build/cp310/.hgignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+
2
+ # This file is generated by meson-python. It will not be recreated if deleted or modified.
3
+ syntax: glob
4
+ **/*
pyPDAF/source/build/cp310/meson-info/meson-info.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"meson_version": {"full": "1.10.0", "major": 1, "minor": 10, "patch": 0}, "directories": {"source": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source", "build": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310", "info": "/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-info"}, "introspection": {"version": {"full": "1.0.0", "major": 1, "minor": 0, "patch": 0}, "information": {"benchmarks": {"file": "intro-benchmarks.json", "updated": false}, "buildoptions": {"file": "intro-buildoptions.json", "updated": false}, "buildsystem_files": {"file": "intro-buildsystem_files.json", "updated": false}, "compilers": {"file": "intro-compilers.json", "updated": false}, "dependencies": {"file": "intro-dependencies.json", "updated": false}, "installed": {"file": "intro-installed.json", "updated": false}, "install_plan": {"file": "intro-install_plan.json", "updated": false}, "machines": {"file": "intro-machines.json", "updated": false}, "projectinfo": {"file": "intro-projectinfo.json", "updated": false}, "targets": {"file": "intro-targets.json", "updated": false}, "tests": {"file": "intro-tests.json", "updated": false}}}, "build_files_updated": false, "error": true, "error_list": ["File PDAF/src/PDAF3_init.F90 does not exist."]}
pyPDAF/source/build/cp310/meson-logs/meson-log.txt ADDED
@@ -0,0 +1,505 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Build started at 2025-12-09T23:43:18.387370
2
+ Main binary: /home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/bin/python3.10
3
+ Build Options: -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-python-native-file.ini
4
+ Python system: Linux
5
+ The Meson build system
6
+ Version: 1.10.0
7
+ Source dir: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source
8
+ Build dir: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310
9
+ Build type: native build
10
+ Project name: pyPDAF
11
+ Project version: 1.0.4
12
+ -----------
13
+ Detecting compiler via: `gfortran --help` -> 0
14
+ stdout:
15
+ Usage: gfortran [options] file...
16
+ Options:
17
+ -pass-exit-codes Exit with highest error code from a phase.
18
+ --help Display this information.
19
+ --target-help Display target specific command line options.
20
+ --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
21
+ Display specific types of command line options.
22
+ (Use '-v --help' to display command line options of sub-processes).
23
+ --version Display compiler version information.
24
+ -dumpspecs Display all of the built in spec strings.
25
+ -dumpversion Display the version of the compiler.
26
+ -dumpmachine Display the compiler's target processor.
27
+ -print-search-dirs Display the directories in the compiler's search path.
28
+ -print-libgcc-file-name Display the name of the compiler's companion library.
29
+ -print-file-name=<lib> Display the full path to library <lib>.
30
+ -print-prog-name=<prog> Display the full path to compiler component <prog>.
31
+ -print-multiarch Display the target's normalized GNU triplet, used as
32
+ a component in the library path.
33
+ -print-multi-directory Display the root directory for versions of libgcc.
34
+ -print-multi-lib Display the mapping between command line options and
35
+ multiple library search directories.
36
+ -print-multi-os-directory Display the relative path to OS libraries.
37
+ -print-sysroot Display the target libraries directory.
38
+ -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
39
+ -Wa,<options> Pass comma-separated <options> on to the assembler.
40
+ -Wp,<options> Pass comma-separated <options> on to the preprocessor.
41
+ -Wl,<options> Pass comma-separated <options> on to the linker.
42
+ -Xassembler <arg> Pass <arg> on to the assembler.
43
+ -Xpreprocessor <arg> Pass <arg> on to the preprocessor.
44
+ -Xlinker <arg> Pass <arg> on to the linker.
45
+ -save-temps Do not delete intermediate files.
46
+ -save-temps=<arg> Do not delete intermediate files.
47
+ -no-canonical-prefixes Do not canonicalize paths when building relative
48
+ prefixes to other gcc components.
49
+ -pipe Use pipes rather than intermediate files.
50
+ -time Time the execution of each subprocess.
51
+ -specs=<file> Override built-in specs with the contents of <file>.
52
+ -std=<standard> Assume that the input sources are for <standard>.
53
+ --sysroot=<directory> Use <directory> as the root directory for headers
54
+ and libraries.
55
+ -B <directory> Add <directory> to the compiler's search paths.
56
+ -v Display the programs invoked by the compiler.
57
+ -### Like -v but options quoted and commands not executed.
58
+ -E Preprocess only; do not compile, assemble or link.
59
+ -S Compile only; do not assemble or link.
60
+ -c Compile and assemble, but do not link.
61
+ -o <file> Place the output into <file>.
62
+ -pie Create a dynamically linked position independent
63
+ executable.
64
+ -shared Create a shared library.
65
+ -x <language> Specify the language of the following input files.
66
+ Permissible languages include: c c++ assembler none
67
+ 'none' means revert to the default behavior of
68
+ guessing the language based on the file's extension.
69
+
70
+ Options starting with -g, -f, -m, -O, -W, or --param are automatically
71
+ passed on to the various sub-processes invoked by gfortran. In order to pass
72
+ other options on to these processes the -W<letter> options must be used.
73
+
74
+ For bug reporting instructions, please see:
75
+ <file:///usr/share/doc/gcc-11/README.Bugs>.
76
+ -----------
77
+ -----------
78
+ Detecting compiler via: `gfortran --version` -> 0
79
+ stdout:
80
+ GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0
81
+ Copyright (C) 2021 Free Software Foundation, Inc.
82
+ This is free software; see the source for copying conditions. There is NO
83
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
84
+ -----------
85
+ pre-processor extraction using -cpp -x fortran failed, falling back w/o lang
86
+ Running command: -E -dM -
87
+ -----
88
+ -----------
89
+ Detecting linker via: `gfortran -Wl,--version` -> 0
90
+ stdout:
91
+ GNU ld (GNU Binutils for Ubuntu) 2.38
92
+ Copyright (C) 2022 Free Software Foundation, Inc.
93
+ This program is free software; you may redistribute it under the terms of
94
+ the GNU General Public License version 3 or (at your option) a later version.
95
+ This program has absolutely no warranty.
96
+ -----------
97
+ stderr:
98
+ collect2 version 11.4.0
99
+ /usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/ssddata/shiweijie/tmp/ccN6AZcP.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. --version -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o
100
+ -----------
101
+ Sanity testing Fortran compiler: gfortran
102
+ Is cross compiler: False.
103
+ Sanity check compiler command line: gfortran sanitycheckf.f -o sanitycheckf.exe
104
+ Sanity check compile stdout:
105
+
106
+ -----
107
+ Sanity check compile stderr:
108
+
109
+ -----
110
+ Running test binary command: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckf.exe
111
+ -----------
112
+ Sanity check: `/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckf.exe` -> 0
113
+ stdout:
114
+ Fortran compilation is working.
115
+ -----------
116
+ Fortran compiler for the host machine: gfortran (gcc 11.4.0 "GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0")
117
+ Fortran linker for the host machine: gfortran ld.bfd 2.38
118
+ -----------
119
+ Detecting archiver via: `gcc-ar --version` -> 0
120
+ stdout:
121
+ GNU ar (GNU Binutils for Ubuntu) 2.38
122
+ Copyright (C) 2022 Free Software Foundation, Inc.
123
+ This program is free software; you may redistribute it under the terms of
124
+ the GNU General Public License version 3 or (at your option) any later version.
125
+ This program has absolutely no warranty.
126
+ -----------
127
+ -----------
128
+ Detecting compiler via: `cc --version` -> 0
129
+ stdout:
130
+ cc (Ubuntu 12.3.0-1ubuntu1~22.04.2) 12.3.0
131
+ Copyright (C) 2022 Free Software Foundation, Inc.
132
+ This is free software; see the source for copying conditions. There is NO
133
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
134
+ -----------
135
+ Running command: -cpp -x c -E -dM -
136
+ -----
137
+ -----------
138
+ Detecting linker via: `cc -Wl,--version` -> 0
139
+ stdout:
140
+ GNU ld (GNU Binutils for Ubuntu) 2.38
141
+ Copyright (C) 2022 Free Software Foundation, Inc.
142
+ This program is free software; you may redistribute it under the terms of
143
+ the GNU General Public License version 3 or (at your option) a later version.
144
+ This program has absolutely no warranty.
145
+ -----------
146
+ stderr:
147
+ collect2 version 12.3.0
148
+ /usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/12/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper -plugin-opt=-fresolution=/ssddata/shiweijie/tmp/cciVQTKq.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/12 -L/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/12/../../.. --version -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o
149
+ -----------
150
+ Sanity testing C compiler: /usr/bin/ccache cc
151
+ Is cross compiler: False.
152
+ Sanity check compiler command line: /usr/bin/ccache cc sanitycheckc.c -o sanitycheckc.exe -D_FILE_OFFSET_BITS=64
153
+ Sanity check compile stdout:
154
+
155
+ -----
156
+ Sanity check compile stderr:
157
+
158
+ -----
159
+ Running test binary command: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckc.exe
160
+ -----------
161
+ Sanity check: `/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckc.exe` -> 0
162
+ C compiler for the host machine: /usr/bin/ccache cc (gcc 12.3.0 "cc (Ubuntu 12.3.0-1ubuntu1~22.04.2) 12.3.0")
163
+ C linker for the host machine: cc ld.bfd 2.38
164
+ -----------
165
+ Detecting compiler via: `cython -V` -> 0
166
+ stdout:
167
+ Cython version 3.2.2
168
+ -----------
169
+ stderr:
170
+ Cython version 3.2.2
171
+ -----------
172
+ Running compile:
173
+ Working directory: /ssddata/shiweijie/tmp/tmphfa7z9tr
174
+ Code:
175
+ print("hello world")
176
+ -----------
177
+ Command line: `cython /ssddata/shiweijie/tmp/tmphfa7z9tr/testfile.pyx -o /ssddata/shiweijie/tmp/tmphfa7z9tr/output.exe --fast-fail` -> 0
178
+ Cython compiler for the host machine: cython (cython 3.2.2)
179
+ -----------
180
+ Detecting compiler via: `gfortran --help` -> 0
181
+ stdout:
182
+ Usage: gfortran [options] file...
183
+ Options:
184
+ -pass-exit-codes Exit with highest error code from a phase.
185
+ --help Display this information.
186
+ --target-help Display target specific command line options.
187
+ --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
188
+ Display specific types of command line options.
189
+ (Use '-v --help' to display command line options of sub-processes).
190
+ --version Display compiler version information.
191
+ -dumpspecs Display all of the built in spec strings.
192
+ -dumpversion Display the version of the compiler.
193
+ -dumpmachine Display the compiler's target processor.
194
+ -print-search-dirs Display the directories in the compiler's search path.
195
+ -print-libgcc-file-name Display the name of the compiler's companion library.
196
+ -print-file-name=<lib> Display the full path to library <lib>.
197
+ -print-prog-name=<prog> Display the full path to compiler component <prog>.
198
+ -print-multiarch Display the target's normalized GNU triplet, used as
199
+ a component in the library path.
200
+ -print-multi-directory Display the root directory for versions of libgcc.
201
+ -print-multi-lib Display the mapping between command line options and
202
+ multiple library search directories.
203
+ -print-multi-os-directory Display the relative path to OS libraries.
204
+ -print-sysroot Display the target libraries directory.
205
+ -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
206
+ -Wa,<options> Pass comma-separated <options> on to the assembler.
207
+ -Wp,<options> Pass comma-separated <options> on to the preprocessor.
208
+ -Wl,<options> Pass comma-separated <options> on to the linker.
209
+ -Xassembler <arg> Pass <arg> on to the assembler.
210
+ -Xpreprocessor <arg> Pass <arg> on to the preprocessor.
211
+ -Xlinker <arg> Pass <arg> on to the linker.
212
+ -save-temps Do not delete intermediate files.
213
+ -save-temps=<arg> Do not delete intermediate files.
214
+ -no-canonical-prefixes Do not canonicalize paths when building relative
215
+ prefixes to other gcc components.
216
+ -pipe Use pipes rather than intermediate files.
217
+ -time Time the execution of each subprocess.
218
+ -specs=<file> Override built-in specs with the contents of <file>.
219
+ -std=<standard> Assume that the input sources are for <standard>.
220
+ --sysroot=<directory> Use <directory> as the root directory for headers
221
+ and libraries.
222
+ -B <directory> Add <directory> to the compiler's search paths.
223
+ -v Display the programs invoked by the compiler.
224
+ -### Like -v but options quoted and commands not executed.
225
+ -E Preprocess only; do not compile, assemble or link.
226
+ -S Compile only; do not assemble or link.
227
+ -c Compile and assemble, but do not link.
228
+ -o <file> Place the output into <file>.
229
+ -pie Create a dynamically linked position independent
230
+ executable.
231
+ -shared Create a shared library.
232
+ -x <language> Specify the language of the following input files.
233
+ Permissible languages include: c c++ assembler none
234
+ 'none' means revert to the default behavior of
235
+ guessing the language based on the file's extension.
236
+
237
+ Options starting with -g, -f, -m, -O, -W, or --param are automatically
238
+ passed on to the various sub-processes invoked by gfortran. In order to pass
239
+ other options on to these processes the -W<letter> options must be used.
240
+
241
+ For bug reporting instructions, please see:
242
+ <file:///usr/share/doc/gcc-11/README.Bugs>.
243
+ -----------
244
+ -----------
245
+ Detecting compiler via: `gfortran --version` -> 0
246
+ stdout:
247
+ GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0
248
+ Copyright (C) 2021 Free Software Foundation, Inc.
249
+ This is free software; see the source for copying conditions. There is NO
250
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
251
+ -----------
252
+ pre-processor extraction using -cpp -x fortran failed, falling back w/o lang
253
+ Running command: -E -dM -
254
+ -----
255
+ -----------
256
+ Detecting linker via: `gfortran -Wl,--version` -> 0
257
+ stdout:
258
+ GNU ld (GNU Binutils for Ubuntu) 2.38
259
+ Copyright (C) 2022 Free Software Foundation, Inc.
260
+ This program is free software; you may redistribute it under the terms of
261
+ the GNU General Public License version 3 or (at your option) a later version.
262
+ This program has absolutely no warranty.
263
+ -----------
264
+ stderr:
265
+ collect2 version 11.4.0
266
+ /usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/11/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper -plugin-opt=-fresolution=/ssddata/shiweijie/tmp/ccCNrRnf.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/11/../../.. --version -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/11/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/crtn.o
267
+ -----------
268
+ Sanity testing Fortran compiler: gfortran
269
+ Is cross compiler: False.
270
+ Sanity check compiler command line: gfortran sanitycheckf.f -o sanitycheckf.exe
271
+ Sanity check compile stdout:
272
+
273
+ -----
274
+ Sanity check compile stderr:
275
+
276
+ -----
277
+ Running test binary command: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckf.exe
278
+ -----------
279
+ Sanity check: `/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckf.exe` -> 0
280
+ stdout:
281
+ Fortran compilation is working.
282
+ -----------
283
+ Fortran compiler for the build machine: gfortran (gcc 11.4.0 "GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0")
284
+ Fortran linker for the build machine: gfortran ld.bfd 2.38
285
+ -----------
286
+ Detecting archiver via: `gcc-ar --version` -> 0
287
+ stdout:
288
+ GNU ar (GNU Binutils for Ubuntu) 2.38
289
+ Copyright (C) 2022 Free Software Foundation, Inc.
290
+ This program is free software; you may redistribute it under the terms of
291
+ the GNU General Public License version 3 or (at your option) any later version.
292
+ This program has absolutely no warranty.
293
+ -----------
294
+ -----------
295
+ Detecting compiler via: `cc --version` -> 0
296
+ stdout:
297
+ cc (Ubuntu 12.3.0-1ubuntu1~22.04.2) 12.3.0
298
+ Copyright (C) 2022 Free Software Foundation, Inc.
299
+ This is free software; see the source for copying conditions. There is NO
300
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
301
+ -----------
302
+ Running command: -cpp -x c -E -dM -
303
+ -----
304
+ -----------
305
+ Detecting linker via: `cc -Wl,--version` -> 0
306
+ stdout:
307
+ GNU ld (GNU Binutils for Ubuntu) 2.38
308
+ Copyright (C) 2022 Free Software Foundation, Inc.
309
+ This program is free software; you may redistribute it under the terms of
310
+ the GNU General Public License version 3 or (at your option) a later version.
311
+ This program has absolutely no warranty.
312
+ -----------
313
+ stderr:
314
+ collect2 version 12.3.0
315
+ /usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/12/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper -plugin-opt=-fresolution=/ssddata/shiweijie/tmp/ccPANPFY.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/12 -L/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/12/../../.. --version -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o
316
+ -----------
317
+ Sanity testing C compiler: /usr/bin/ccache cc
318
+ Is cross compiler: False.
319
+ Sanity check compiler command line: /usr/bin/ccache cc sanitycheckc.c -o sanitycheckc.exe -D_FILE_OFFSET_BITS=64
320
+ Sanity check compile stdout:
321
+
322
+ -----
323
+ Sanity check compile stderr:
324
+
325
+ -----
326
+ Running test binary command: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckc.exe
327
+ -----------
328
+ Sanity check: `/export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/sanitycheckc.exe` -> 0
329
+ C compiler for the build machine: /usr/bin/ccache cc (gcc 12.3.0 "cc (Ubuntu 12.3.0-1ubuntu1~22.04.2) 12.3.0")
330
+ C linker for the build machine: cc ld.bfd 2.38
331
+ -----------
332
+ Detecting compiler via: `cython -V` -> 0
333
+ stdout:
334
+ Cython version 3.2.2
335
+ -----------
336
+ stderr:
337
+ Cython version 3.2.2
338
+ -----------
339
+ Using cached compile:
340
+ Cached command line: cython /ssddata/shiweijie/tmp/tmphfa7z9tr/testfile.pyx -o /ssddata/shiweijie/tmp/tmphfa7z9tr/output.exe --fast-fail
341
+
342
+ Code:
343
+ print("hello world")
344
+ Cached compiler stdout:
345
+
346
+ Cached compiler stderr:
347
+
348
+ Cython compiler for the build machine: cython (cython 3.2.2)
349
+ Build machine cpu family: x86_64
350
+ Build machine cpu: x86_64
351
+ Host machine cpu family: x86_64
352
+ Host machine cpu: x86_64
353
+ Target machine cpu family: x86_64
354
+ Target machine cpu: x86_64
355
+ Program python found: YES (/home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/bin/python3.10)
356
+ Searching for '/home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/lib/pkgconfig' via pkgconfig lookup in LIBPC
357
+ Pkg-config binary missing from cross or native file, or env var undefined.
358
+ Trying a default Pkg-config fallback at pkg-config
359
+ Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
360
+ Determining dependency 'python-3.10' with pkg-config executable '/usr/bin/pkg-config'
361
+ env[PKG_CONFIG_PATH]: /home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/lib/pkgconfig
362
+ env[PKG_CONFIG]: /usr/bin/pkg-config
363
+ -----------
364
+ Called: `/usr/bin/pkg-config --modversion python-3.10` -> 0
365
+ stdout:
366
+ 3.10
367
+ -----------
368
+ env[PKG_CONFIG_PATH]: /home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/lib/pkgconfig
369
+ env[PKG_CONFIG]: /usr/bin/pkg-config
370
+ -----------
371
+ Called: `/usr/bin/pkg-config --cflags python-3.10` -> 0
372
+ stdout:
373
+ -I/home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/include/python3.10
374
+ -----------
375
+ env[PKG_CONFIG_ALLOW_SYSTEM_LIBS]: 1
376
+ env[PKG_CONFIG_PATH]: /home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/lib/pkgconfig
377
+ env[PKG_CONFIG]: /usr/bin/pkg-config
378
+ -----------
379
+ Called: `/usr/bin/pkg-config --libs python-3.10` -> 0
380
+ env[PKG_CONFIG_PATH]: /home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/lib/pkgconfig
381
+ env[PKG_CONFIG]: /usr/bin/pkg-config
382
+ -----------
383
+ Called: `/usr/bin/pkg-config --libs python-3.10` -> 0
384
+ Run-time dependency python found: YES 3.10
385
+ Running compile:
386
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpic6eo8o1
387
+ Code:
388
+ program test
389
+ use iso_c_binding
390
+
391
+ type(c_ptr) :: x
392
+ print '(i0)', c_sizeof(x)
393
+ end program test
394
+
395
+ -----------
396
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpic6eo8o1/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpic6eo8o1/output.exe -D_FILE_OFFSET_BITS=64 -O0` -> 0
397
+ Program stdout:
398
+
399
+ 8
400
+
401
+ Program stderr:
402
+
403
+
404
+ Running compile:
405
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmphe18afkr
406
+ Code:
407
+
408
+ -----------
409
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmphe18afkr/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmphe18afkr/output.obj -D_FILE_OFFSET_BITS=64 -c -O0 --print-search-dirs` -> 0
410
+ stdout:
411
+ install: /usr/lib/gcc/x86_64-linux-gnu/11/
412
+ programs: =/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/bin/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/bin/
413
+ libraries: =/usr/lib/gcc/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/lib/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/11/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/:/lib/x86_64-linux-gnu/11/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/11/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/lib/:/usr/lib/gcc/x86_64-linux-gnu/11/../../../:/lib/:/usr/lib/
414
+ -----------
415
+ Running compile:
416
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmp8b3tcq_b
417
+ Code:
418
+ stop; end program
419
+ -----------
420
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmp8b3tcq_b/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmp8b3tcq_b/output.exe -D_FILE_OFFSET_BITS=64 -O0 /usr/lib/x86_64-linux-gnu/libblas.so -Wl,--allow-shlib-undefined` -> 0
421
+ Library blas found: YES
422
+ Running compile:
423
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpmo4yn5qg
424
+ Code:
425
+ stop; end program
426
+ -----------
427
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpmo4yn5qg/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpmo4yn5qg/output.exe -D_FILE_OFFSET_BITS=64 -O0 /usr/lib/x86_64-linux-gnu/liblapack.so -Wl,--allow-shlib-undefined` -> 0
428
+ Library lapack found: YES
429
+ Running compile:
430
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmp3nqb6j5j
431
+ Code:
432
+ extern int i;
433
+ int i;
434
+
435
+ -----------
436
+ Command line: `cc /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmp3nqb6j5j/testfile.c -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmp3nqb6j5j/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 /O2` -> 1
437
+ stderr:
438
+ cc: warning: /O2: linker input file unused because linking not done
439
+ cc: error: /O2: linker input file not found: No such file or directory
440
+ -----------
441
+ Compiler for C supports arguments /O2: NO
442
+ WARNING: Compiler for C does not support "/O2"
443
+ Running compile:
444
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmph2ojziwd
445
+ Code:
446
+ extern int i;
447
+ int i;
448
+
449
+ -----------
450
+ Command line: `cc /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmph2ojziwd/testfile.c -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmph2ojziwd/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 /GL` -> 1
451
+ stderr:
452
+ cc: warning: /GL: linker input file unused because linking not done
453
+ cc: error: /GL: linker input file not found: No such file or directory
454
+ -----------
455
+ Compiler for C supports arguments /GL: NO
456
+ WARNING: Compiler for C does not support "/GL"
457
+ Running compile:
458
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpk6ys51bk
459
+ Code:
460
+ extern int i;
461
+ int i;
462
+
463
+ -----------
464
+ Command line: `cc /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpk6ys51bk/testfile.c -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpk6ys51bk/output.obj -c -D_FILE_OFFSET_BITS=64 -O0 -O3` -> 0
465
+ Compiler for C supports arguments -O3: YES
466
+ Running compile:
467
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpnnh7ir7t
468
+ Code:
469
+ stop; end program
470
+ -----------
471
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpnnh7ir7t/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpnnh7ir7t/output.obj -D_FILE_OFFSET_BITS=64 -c -O0 -O3` -> 0
472
+ Compiler for Fortran supports arguments -O3: YES
473
+ Running compile:
474
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpjqfzue8b
475
+ Code:
476
+ stop; end program
477
+ -----------
478
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpjqfzue8b/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpjqfzue8b/output.obj -D_FILE_OFFSET_BITS=64 -c -O0 -fdefault-real-8` -> 0
479
+ Compiler for Fortran supports arguments -fdefault-real-8: YES
480
+ Running compile:
481
+ Working directory: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmprajkiv58
482
+ Code:
483
+ stop; end program
484
+ -----------
485
+ Command line: `gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmprajkiv58/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmprajkiv58/output.obj -D_FILE_OFFSET_BITS=64 -c -O0 -DUSE_PDAF` -> 0
486
+ Compiler for Fortran supports arguments -DUSE_PDAF: YES
487
+ Using cached compile:
488
+ Cached command line: gfortran /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpnnh7ir7t/testfile.f90 -o /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-private/tmpnnh7ir7t/output.obj -D_FILE_OFFSET_BITS=64 -c -O0 -O3
489
+
490
+ Code:
491
+ stop; end program
492
+ Cached compiler stdout:
493
+
494
+ Cached compiler stderr:
495
+
496
+ Compiler for Fortran supports arguments -O3: YES (cached)
497
+ Running command: /home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/bin/python3.10 -c 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
498
+ --- stdout ---
499
+ /ssddata/shiweijie/tmp/pip-build-env-ygthrxi6/overlay/lib/python3.10/site-packages/numpy/_core/include
500
+
501
+ --- stderr ---
502
+
503
+
504
+
505
+ ../../meson.build:88:18: ERROR: File PDAF/src/PDAF3_init.F90 does not exist.
pyPDAF/source/build/cp310/meson-logs/meson-setup.txt ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The Meson build system
2
+ Version: 1.10.0
3
+ Source dir: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source
4
+ Build dir: /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310
5
+ Build type: native build
6
+ Project name: pyPDAF
7
+ Project version: 1.0.4
8
+ Fortran compiler for the host machine: gfortran (gcc 11.4.0 "GNU Fortran (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0")
9
+ Fortran linker for the host machine: gfortran ld.bfd 2.38
10
+ C compiler for the host machine: /usr/bin/ccache cc (gcc 12.3.0 "cc (Ubuntu 12.3.0-1ubuntu1~22.04.2) 12.3.0")
11
+ C linker for the host machine: cc ld.bfd 2.38
12
+ Cython compiler for the host machine: cython (cython 3.2.2)
13
+ Host machine cpu family: x86_64
14
+ Host machine cpu: x86_64
15
+ Program python found: YES (/home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/bin/python3.10)
16
+ Found pkg-config: YES (/usr/bin/pkg-config) 0.29.2
17
+ Run-time dependency python found: YES 3.10
18
+ Library blas found: YES
19
+ Library lapack found: YES
20
+ Compiler for C supports arguments /O2: NO
21
+ WARNING: Compiler for C does not support "/O2"
22
+ Compiler for C supports arguments /GL: NO
23
+ WARNING: Compiler for C does not support "/GL"
24
+ Compiler for C supports arguments -O3: YES
25
+ Compiler for Fortran supports arguments -O3: YES
26
+ Compiler for Fortran supports arguments -fdefault-real-8: YES
27
+ Compiler for Fortran supports arguments -DUSE_PDAF: YES
28
+ Compiler for Fortran supports arguments -O3: YES (cached)
29
+
30
+ ../../meson.build:88:18: ERROR: File PDAF/src/PDAF3_init.F90 does not exist.
31
+
32
+ A full log can be found at /export/project/shiweijie/ghh/LLM_MCP_RAG/MCP-agent-github-repo-output/workspace/pyPDAF/source/build/cp310/meson-logs/meson-log.txt
pyPDAF/source/build/cp310/meson-private/meson.lock ADDED
File without changes
pyPDAF/source/build/cp310/meson-private/sanitycheckc.c ADDED
@@ -0,0 +1 @@
 
 
1
+ int main(void) { int class=0; return class; }
pyPDAF/source/build/cp310/meson-private/sanitycheckc.exe ADDED
Binary file (15.8 kB). View file
 
pyPDAF/source/build/cp310/meson-private/sanitycheckf.exe ADDED
Binary file (16.2 kB). View file
 
pyPDAF/source/build/cp310/meson-private/sanitycheckf.f ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ PROGRAM MAIN
2
+ PRINT *, "Fortran compilation is working."
3
+ END
pyPDAF/source/build/cp310/meson-python-native-file.ini ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+
2
+ [binaries]
3
+ python = '/home/wshiah/code/miniconda3/envs/pyPDAF_294797_env/bin/python3.10'
pyPDAF/source/conda.recipe/bld.bat ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo on
2
+
3
+ set CXX=clang-cl
4
+ set CC=clang-cl
5
+ set FC=flang-new
6
+ set MSMPI_INC=%LIBRARY_INC%
7
+ set MSMPI_LIB64=%LIBRARY_LIB%
8
+
9
+ "%PYTHON%" -m pip install . -v --no-build-isolation^
10
+ -Cbuild-dir=build --config-settings=setup-args="-Dblas_lib=openblas"^
11
+ --config-settings=setup-args="-Dincdirs="%LIBRARY_INC%^
12
+ --config-settings=setup-args="-Dlibdirs="%LIBRARY_LIB%^
13
+ --config-settings=setup-args="-Dmpi_mod="%LIBRARY_INC%"\mpi.f90"^
14
+ --config-settings=setup-args="-Dbuildtype=release"
pyPDAF/source/conda.recipe/build.sh ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -ex
3
+
4
+ CC=mpicc
5
+ FC=mpifort
6
+
7
+ $PYTHON -m pip install . -v --no-build-isolation \
8
+ --config-settings=setup-args="-Dblas_lib=['openblas',]" \
9
+ --config-settings=setup-args="-Dincdirs="$PREFIX"/include" \
10
+ --config-settings=setup-args="-Dlibdirs="$PREFIX"/lib" \
11
+ --config-settings=setup-args="-Dbuildtype=release"
pyPDAF/source/conda.recipe/conda_build_config.yaml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ python:
2
+ - 3.11
3
+ - 3.12
4
+ - 3.13
5
+
6
+ c_compiler_version:
7
+ - 14 # [linux]
8
+
9
+ # there seems to be bug in gfortran 15.1.0
10
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119928
11
+ # therefore, we pin gfortran 14
12
+ fortran_compiler_version:
13
+ - 14 # [not win]
14
+
15
+ c_compiler:
16
+ - clang # [win]
17
+
18
+ fortran_compiler:
19
+ - flang # [win]
20
+
21
+ numpy_version:
22
+ - '>2'
23
+
24
+ mpi:
25
+ - mpich # [not win]
26
+ - msmpi # [win]
27
+
28
+ # meson-python 0.18 cannot be installed on Windows
29
+ pymeson:
30
+ - <0.18 # [win]
31
+ - '>=0.18' # [not win]
pyPDAF/source/conda.recipe/meta.yaml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% set version = "1.0.4" %}
2
+
3
+ package:
4
+ name: pypdaf
5
+ version: {{ version }}
6
+
7
+ source:
8
+ path: ..
9
+
10
+ build:
11
+ number: 0
12
+
13
+ requirements:
14
+ host:
15
+ - python
16
+ - meson-python {{ pymeson }}
17
+ - numpy {{numpy_version}}
18
+ - mpi=*={{ mpi }}
19
+ - mpi4py
20
+ - blas=*=openblas
21
+ - flang-rt_win-64 # [win]
22
+ - libflang # [win]
23
+ build:
24
+ - python
25
+ - {{ compiler('c') }}
26
+ - {{ compiler('fortran') }}
27
+ - vs2022_win-64 # [win]
28
+ - numpy {{numpy_version}}
29
+ - cython
30
+ run:
31
+ - flang-rt_win-64 # [win]
32
+ - python
33
+ - numpy
34
+ - mpi=*={{ mpi }}
35
+ - mpi4py
36
+ - blas=*=openblas
37
+
38
+ pin_run_as_build:
39
+ mpi: x.x
40
+ mpi4py: x.x
41
+ blas: x.x
42
+
43
+ about:
44
+ home: https://github.com/yumengch/pyPDAF
45
+ summary: A Python interface to PDAF
46
+ description: pyPDAF is a python interface to the Fortran-based PDAF library
47
+ license: GPL
48
+ doc_url: https://yumengch.github.io/pyPDAF/index.html
49
+ dev_url: https://github.com/yumengch/pyPDAF
pyPDAF/source/docs/Makefile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?= -v
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
pyPDAF/source/docs/make.bat ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ if "%1" == "" goto help
14
+
15
+ %SPHINXBUILD% >NUL 2>NUL
16
+ if errorlevel 9009 (
17
+ echo.
18
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19
+ echo.installed, then set the SPHINXBUILD environment variable to point
20
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
21
+ echo.may add the Sphinx directory to PATH.
22
+ echo.
23
+ echo.If you don't have Sphinx installed, grab it from
24
+ echo.https://www.sphinx-doc.org/
25
+ exit /b 1
26
+ )
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
pyPDAF/source/docs/source/API.rst ADDED
@@ -0,0 +1,306 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ API
2
+ ===
3
+
4
+ This page provides a list of pyPDAF functions that are intended for users.
5
+ They are grouped by functionalities. Clicking on a function name will lead to
6
+ its documentation page.
7
+
8
+ These are not all available functions in pyPDAF. Similar to PDAF, pyPDAF maintains
9
+ backward compatible legacy functions used prior to PDAF 3.0.
10
+ For a complete list of functions,
11
+ please refer to the [hidden and legacy function page](hidden_functions.md)
12
+
13
+ .. contents::
14
+ :local:
15
+ :depth: 2
16
+
17
+ Initialisation and finalisation
18
+ -------------------------------
19
+ .. autosummary::
20
+ :toctree: _autosummary
21
+ :recursive:
22
+
23
+ pyPDAF.init
24
+ pyPDAF.set_parallel
25
+ pyPDAF.init_forecast
26
+ pyPDAF.PDAFomi.init
27
+ pyPDAF.PDAFomi.init_local
28
+ pyPDAF.deallocate
29
+
30
+ DA algorithms
31
+ ------------------------------
32
+
33
+ Sequential DA
34
+ ^^^^^^^^^^^^^
35
+
36
+ diagnoal observation matrix
37
+ """""""""""""""""""""""""""
38
+ .. autosummary::
39
+ :toctree: _autosummary
40
+ :recursive:
41
+
42
+ pyPDAF.assimilate
43
+ pyPDAF.assim_offline
44
+
45
+ non-diagnoal observation matrix
46
+ """""""""""""""""""""""""""""""
47
+ .. autosummary::
48
+ :toctree: _autosummary
49
+ :recursive:
50
+
51
+ pyPDAF.assimilate_local_nondiagr
52
+ pyPDAF.assimilate_global_nondiagr
53
+ pyPDAF.assimilate_lnetf_nondiagr
54
+ pyPDAF.assimilate_lknetf_nondiagr
55
+ pyPDAF.assimilate_enkf_nondiagr
56
+ pyPDAF.assimilate_nonlin_nondiagr
57
+
58
+ pyPDAF.assim_offline_local_nondiagr
59
+ pyPDAF.assim_offline_global_nondiagr
60
+ pyPDAF.assim_offline_lnetf_nondiagr
61
+ pyPDAF.assim_offline_lknetf_nondiagr
62
+ pyPDAF.assim_offline_enkf_nondiagr
63
+ pyPDAF.assim_offline_lenkf_nondiagr
64
+ pyPDAF.assim_offline_nonlin_nondiagr
65
+
66
+ Variational DA
67
+ ^^^^^^^^^^^^^^
68
+
69
+ diagnoal observation matrix
70
+ """""""""""""""""""""""""""
71
+ .. autosummary::
72
+ :toctree: _autosummary
73
+ :recursive:
74
+
75
+ pyPDAF.assimilate_3dvar_all
76
+ pyPDAF.assim_offline_3dvar_all
77
+
78
+ non-diagnoal observation matrix
79
+ """""""""""""""""""""""""""""""
80
+ .. autosummary::
81
+ :toctree: _autosummary
82
+ :recursive:
83
+
84
+ pyPDAF.assimilate_3dvar_nondiagr
85
+ pyPDAF.assimilate_en3dvar_estkf_nondiagr
86
+ pyPDAF.assimilate_en3dvar_lestkf_nondiagr
87
+ pyPDAF.assimilate_hyb3dvar_estkf_nondiagr
88
+ pyPDAF.assimilate_hyb3dvar_lestkf_nondiagr
89
+
90
+ pyPDAF.assim_offline_3dvar_nondiagr
91
+ pyPDAF.assim_offline_en3dvar_estkf_nondiagr
92
+ pyPDAF.assim_offline_en3dvar_lestkf_nondiagr
93
+ pyPDAF.assim_offline_hyb3dvar_estkf_nondiagr
94
+ pyPDAF.assim_offline_hyb3dvar_lestkf_nondiagr
95
+
96
+
97
+ OMI functions
98
+ -------------
99
+
100
+ setter functions
101
+ ^^^^^^^^^^^^^^^^^^^^^^
102
+ .. autosummary::
103
+ :toctree: _autosummary
104
+ :recursive:
105
+
106
+ pyPDAF.PDAFomi.set_doassim
107
+ pyPDAF.PDAFomi.set_disttype
108
+ pyPDAF.PDAFomi.set_ncoord
109
+ pyPDAF.PDAFomi.set_obs_err_type
110
+ pyPDAF.PDAFomi.set_use_global_obs
111
+ pyPDAF.PDAFomi.set_inno_omit
112
+ pyPDAF.PDAFomi.set_inno_omit_ivar
113
+ pyPDAF.PDAFomi.set_id_obs_p
114
+ pyPDAF.PDAFomi.set_icoeff_p
115
+ pyPDAF.PDAFomi.set_domainsize
116
+ pyPDAF.PDAFomi.set_name
117
+ pyPDAF.PDAFomi.gather_obs
118
+
119
+
120
+ Observation operators
121
+ ^^^^^^^^^^^^^^^^^^^^^
122
+ .. autosummary::
123
+ :toctree: _autosummary
124
+ :recursive:
125
+
126
+ pyPDAF.PDAFomi.obs_op_gridpoint
127
+ pyPDAF.PDAFomi.obs_op_gridavg
128
+ pyPDAF.PDAFomi.obs_op_extern
129
+ pyPDAF.PDAFomi.obs_op_interp_lin
130
+ pyPDAF.PDAFomi.obs_op_adj_gridavg
131
+ pyPDAF.PDAFomi.obs_op_adj_gridpoint
132
+ pyPDAF.PDAFomi.obs_op_adj_interp_lin
133
+ pyPDAF.PDAFomi.gather_obsstate
134
+
135
+ Interpolations
136
+ ^^^^^^^^^^^^^^
137
+ .. autosummary::
138
+ :toctree: _autosummary
139
+ :recursive:
140
+
141
+ pyPDAF.PDAFomi.get_interp_coeff_tri
142
+ pyPDAF.PDAFomi.get_interp_coeff_lin1d
143
+ pyPDAF.PDAFomi.get_interp_coeff_lin
144
+
145
+ Localisation
146
+ ^^^^^^^^^^^^
147
+ .. autosummary::
148
+ :toctree: _autosummary
149
+ :recursive:
150
+
151
+ pyPDAF.PDAFomi.init_dim_obs_l_iso
152
+ pyPDAF.PDAFomi.init_dim_obs_l_noniso
153
+ pyPDAF.PDAFomi.init_dim_obs_l_noniso_locweights
154
+ pyPDAF.PDAFomi.observation_localization_weights
155
+ pyPDAF.PDAFomi.set_domain_limits
156
+ pyPDAF.PDAFomi.get_domain_limits_unstr
157
+ pyPDAF.PDAFomi.set_localize_covar_iso
158
+ pyPDAF.PDAFomi.set_localize_covar_noniso
159
+ pyPDAF.PDAFomi.set_localize_covar_noniso_locweights
160
+
161
+ Custom local observation initialisation
162
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163
+ .. autosummary::
164
+ :toctree: _autosummary
165
+ :recursive:
166
+
167
+ pyPDAF.PDAFomi.set_localization
168
+ pyPDAF.PDAFomi.set_localization_noniso
169
+ pyPDAF.PDAFomi.set_dim_obs_l
170
+ pyPDAF.PDAFomi.store_obs_l_index
171
+ pyPDAF.PDAFomi.store_obs_l_index_vdist
172
+
173
+ Diagnostics
174
+ ^^^^^^^^^^^
175
+ .. autosummary::
176
+ :toctree: _autosummary
177
+ :recursive:
178
+
179
+ pyPDAF.PDAFomi.check_error
180
+ pyPDAF.PDAFomi.set_debug_flag
181
+ pyPDAF.PDAFomi.set_obs_diag
182
+ pyPDAF.PDAFomi.diag_dimobs
183
+ pyPDAF.PDAFomi.diag_get_hx
184
+ pyPDAF.PDAFomi.diag_get_hxmean
185
+ pyPDAF.PDAFomi.diag_get_ivar
186
+ pyPDAF.PDAFomi.diag_get_obs
187
+ pyPDAF.PDAFomi.diag_nobstypes
188
+ pyPDAF.PDAFomi.diag_obs_rmsd
189
+ pyPDAF.PDAFomi.diag_stats
190
+
191
+
192
+ Localisation functions
193
+ ----------------------
194
+ .. autosummary::
195
+ :toctree: _autosummary
196
+ :recursive:
197
+
198
+ pyPDAF.PDAFlocal.set_indices
199
+ pyPDAF.PDAFlocal.set_increment_weights
200
+ pyPDAF.PDAFlocal.clear_increment_weights
201
+ pyPDAF.PDAF.correlation_function
202
+ pyPDAF.PDAF.local_weight
203
+ pyPDAF.PDAF.local_weights
204
+
205
+ Utilities
206
+ ---------
207
+
208
+ PDAF state and setup information
209
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
+ .. autosummary::
211
+ :toctree: _autosummary
212
+ :recursive:
213
+
214
+ pyPDAF.get_fcst_info
215
+ pyPDAF.PDAF.get_assim_flag
216
+ pyPDAF.PDAF.get_localfilter
217
+ pyPDAF.PDAF.get_local_type
218
+ pyPDAF.PDAF.get_memberid
219
+ pyPDAF.PDAF.get_obsmemberid
220
+ pyPDAF.PDAF.get_smoother_ens
221
+ pyPDAF.PDAF.print_filter_types
222
+ pyPDAF.PDAF.print_da_types
223
+ pyPDAF.PDAF.print_info
224
+
225
+
226
+ Observation MPI handling
227
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
228
+ .. autosummary::
229
+ :toctree: _autosummary
230
+ :recursive:
231
+
232
+ pyPDAF.PDAF.gather_dim_obs_f
233
+ pyPDAF.PDAF.gather_obs_f
234
+ pyPDAF.PDAF.gather_obs_f2
235
+ pyPDAF.PDAF.gather_obs_f_flex
236
+ pyPDAF.PDAF.gather_obs_f2_flex
237
+
238
+
239
+ Synthetic experiments
240
+ ^^^^^^^^^^^^^^^^^^^^^
241
+ .. autosummary::
242
+ :toctree: _autosummary
243
+ :recursive:
244
+
245
+ pyPDAF.generate_obs
246
+ pyPDAF.generate_obs_offline
247
+
248
+
249
+ Incremental analysis update
250
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
251
+ .. autosummary::
252
+ :toctree: _autosummary
253
+ :recursive:
254
+
255
+ pyPDAF.PDAF.iau_init
256
+ pyPDAF.PDAF.iau_reset
257
+ pyPDAF.PDAF.iau_set_pointer
258
+
259
+ Statistical diagnostics
260
+ ^^^^^^^^^^^^^^^^^^^^^^^
261
+ .. autosummary::
262
+ :toctree: _autosummary
263
+ :recursive:
264
+
265
+ pyPDAF.PDAF.diag_effsample
266
+ pyPDAF.PDAF.diag_ensstats
267
+ pyPDAF.PDAF.diag_histogram
268
+ pyPDAF.PDAF.diag_crps_mpi
269
+ pyPDAF.PDAF.diag_crps_nompi
270
+
271
+ Ensemble generation
272
+ ^^^^^^^^^^^^^^^^^^^
273
+ .. autosummary::
274
+ :toctree: _autosummary
275
+ :recursive:
276
+
277
+ pyPDAF.PDAF.eofcovar
278
+ pyPDAF.PDAF.sample_ens
279
+
280
+ PDAF debug options
281
+ ^^^^^^^^^^^^^^^^^^^
282
+ .. autosummary::
283
+ :toctree: _autosummary
284
+ :recursive:
285
+
286
+ pyPDAF.PDAF.set_debug_flag
287
+
288
+ Advanced manipulation
289
+ ^^^^^^^^^^^^^^^^^^^^^
290
+ .. autosummary::
291
+ :toctree: _autosummary
292
+ :recursive:
293
+
294
+ pyPDAF.PDAF.set_iparam
295
+ pyPDAF.PDAF.set_rparam
296
+ pyPDAF.PDAF.set_comm_pdaf
297
+
298
+ pyPDAF.PDAF.set_ens_pointer
299
+ pyPDAF.PDAF.set_memberid
300
+ pyPDAF.PDAF.set_offline_mode
301
+ pyPDAF.PDAF.set_seedset
302
+ pyPDAF.PDAF.set_smoother_ens
303
+
304
+ pyPDAF.PDAF.force_analysis
305
+ pyPDAF.PDAF.reset_forget
306
+
pyPDAF/source/docs/source/conf.py ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # This file only contains a selection of the most common options. For a full
4
+ # list see the documentation:
5
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
6
+
7
+
8
+ # -- Project information -----------------------------------------------------
9
+
10
+ project = 'pyPDAF'
11
+ copyright = '2025 University of Reading and National Centre for Earth Observation'
12
+ author = 'Yumeng Chen, Lars Nerger'
13
+
14
+
15
+ # -- General configuration ---------------------------------------------------
16
+
17
+ # Add any Sphinx extension module names here, as strings. They can be
18
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
19
+ # ones.
20
+ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary',
21
+ 'sphinx.ext.mathjax',
22
+ 'sphinx.ext.coverage', 'sphinx.ext.napoleon', 'myst_parser'
23
+ ]
24
+
25
+ autosummary_generate = True
26
+
27
+ autoclass_content = 'both'
28
+
29
+ napoleon_google_docstring = False
30
+ napoleon_numpy_docstring = True
31
+ napoleon_include_init_with_doc = True
32
+ napoleon_include_private_with_doc = True
33
+ napoleon_include_special_with_doc = True
34
+ napoleon_use_admonition_for_examples = False
35
+ napoleon_use_admonition_for_notes = False
36
+ napoleon_use_admonition_for_references = False
37
+ napoleon_use_ivar = False
38
+ napoleon_use_param = True
39
+ napoleon_use_rtype = True
40
+ napoleon_preprocess_types = False
41
+ napoleon_type_aliases = None
42
+ napoleon_attr_annotations = True
43
+
44
+ myst_heading_anchors = 3
45
+
46
+ # Add any paths that contain templates here, relative to this directory.
47
+ templates_path = ['_templates']
48
+
49
+ # List of patterns, relative to source directory, that match files and
50
+ # directories to ignore when looking for source files.
51
+ # This pattern also affects html_static_path and html_extra_path.
52
+ exclude_patterns = []
53
+
54
+ source_suffix = {'.rst': 'restructuredtext', '.md': 'markdown'}
55
+ # -- Options for HTML output -------------------------------------------------
56
+
57
+ # The theme to use for HTML and HTML Help pages. See the documentation for
58
+ # a list of builtin themes.
59
+ #
60
+ html_theme = 'alabaster'
61
+ html_theme_options = {
62
+ "description": "A Python interface to Parallel Data Assimilation Framework.",
63
+ "github_button": True,
64
+ "github_user": "yumengch",
65
+ "github_repo": "pyPDAF",
66
+ "body_max_width": "none"
67
+ }
68
+ # Add any paths that contain custom static files (such as style sheets) here,
69
+ # relative to this directory. They are copied after the builtin static files,
70
+ # so a file named "default.css" will overwrite the builtin "default.css".
71
+ html_static_path = ['_static']
pyPDAF/source/docs/source/develop.md ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Developer Guide
2
+
3
+ The following guide explains the structure, implementation details, and mechanisms
4
+ used in `pyPDAF`. This guide is aimed at developers who wish to understand the
5
+ existing framework, make modifications, or contribute to its development.
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ `pyPDAF` bridges Python and Fortran by leveraging the `Cython` library.
12
+ As Python is implemented in C, any interaction between Python and Fortran is
13
+ effectively handled as C-to-Fortran communication.
14
+
15
+ `Cython` automatically converts its module to `C` source code. The interoperability
16
+ with `Fortran` is achieved by the Fortran 2003 feature `iso_c_binding` module.
17
+
18
+ Contributions to the library can include raising issues, suggesting features,
19
+ or submitting pull requests with code enhancements.
20
+
21
+ ---
22
+
23
+ ## Adding a new Fortran function in pyPDAF
24
+
25
+ ### Fortran Subroutines and Wrappers
26
+ The Fortran subroutine wrappers that are interoperable with C functions are
27
+ given in [src/fortran](https://github.com/yumengch/pyPDAF/tree/main/src/fortran).
28
+
29
+ #### Interoperability with `bind(c)`
30
+ Fortran subroutines use the `bind(c)` keyword for compatibility with C.
31
+
32
+ Since PDAF does not use this keyword, `pyPDAF` provides its own wrapper subroutines that:
33
+ 1. Subroutine names begin with the prefix `c__` to denote compatibility.
34
+ 2. Arguments use corresponding C types.
35
+ 3. User-supplied functions must be declared with [specified interface](https://github.com/yumengch/pyPDAF/tree/main/src/fortran/pdaf_c_cb_interface.f90)
36
+ 4. Bind(c) user-supplied functions must be converted to Fortran subroutines by
37
+ pointers and wrapper subroutines in [src/fortran/pdaf_c_f_interface.f90](https://github.com/yumengch/pyPDAF/tree/main/src/fortran/pdaf_c_f_interface.f90).
38
+ This is a requirement in `flang`.
39
+ 5. We do not use features that interoperable with derived types. This is because
40
+ current standard does not support allocatable arrays in derived types.
41
+ Therefore, `obs_f` and `obs_l` in PDAFomi are allocated in Fortran referenced
42
+ by indices, and getting and setter functions.
43
+
44
+ #### Example Wrapper Subroutine
45
+ ```fortran
46
+ subroutine c__PDAFomi_set_doassim(i_obs, doassim) bind(c)
47
+ ! Index of observation types
48
+ integer(c_int), intent(in) :: i_obs
49
+ ! Flag to determine assimilation (0: no, 1: yes)
50
+ integer(c_int), intent(in) :: doassim
51
+ thisobs(i_obs)%doassim = doassim
52
+ end subroutine c__PDAFomi_set_doassim
53
+ ```
54
+
55
+ ---
56
+
57
+ ### Cython Integration
58
+
59
+ #### Cython Declarations
60
+ To call Fortran subroutines in Python, `pyPDAF` uses Cython declarations
61
+ defined in `.pxd` files (e.g., `src/pyPDAF/PDAF.pxd`). Example:
62
+ ```cython
63
+ cdef extern void c__pdaf_eofcovar (
64
+ int* dim_state, int* nstates, int* nfields, int* dim_fields,
65
+ int* offsets, int* remove_mstate, int* do_mv, double* states,
66
+ double* stddev, double* svals, double* svec, double* meanstate,
67
+ int* verbose, int* status) noexcept;
68
+ ```
69
+
70
+ #### Python Wrappers
71
+ These Cython declarations are wrapped into Python functions to make them
72
+ accessible to users. Wrappers should return all `intent(out)` or `intent(inout)`
73
+ arguments in Python-friendly structures.
74
+
75
+ Example:
76
+ ```cython
77
+ def eofcovar(int dim, int nstates, int nfields, int [::1] dim_fields,
78
+ int [::1] offsets, int remove_mstate, int do_mv,
79
+ double [::1,:] states, double [::1] meanstate, int verbose):
80
+ """
81
+ EOF analysis of an ensemble of state vectors by singular value decomposition.
82
+
83
+ Typically, this function is used with :func:`pyPDAF.PDAF.SampleEns`
84
+ to generate an ensemble of a chosen size (up to the number of EOFs plus one).
85
+
86
+ Here, the function performs a singular value decomposition
87
+ of the ensemble anomaly of the input matrix,
88
+ which is usually an ensemble formed by state vectors
89
+ at multiple time steps.
90
+ The singular values and corresponding singular vectors
91
+ can be used to construct a covariance matrix.
92
+ This can be used as the initial error covariance for the initial ensemble.
93
+
94
+ A multivariate scaling can be performed to ensure that all fields
95
+ in the state vectors have unit variance.
96
+
97
+ It can be useful to store more EOFs than one finally
98
+ might want to use to have the flexibility
99
+ to carry the ensemble size.
100
+
101
+
102
+ See Also
103
+ --------
104
+ `PDAF webpage <https://pdaf.awi.de/trac/wiki/EnsembleGeneration>`_
105
+
106
+ Parameters
107
+ ----------
108
+ dim : int
109
+ Dimension of state vector
110
+ nstates : int
111
+ Number of state vectors
112
+ nfields : int
113
+ Number of fields in state vector
114
+ dim_fields : ndarray[np.intc, ndim=1]
115
+ Size of each field
116
+ Array shape: (nfields)
117
+ offsets : ndarray[np.intc, ndim=1]
118
+ Start position of each field
119
+ Array shape: (nfields)
120
+ remove_mstate : int
121
+ 1: subtract mean state from states
122
+ do_mv : int
123
+ 1: Do multivariate scaling; 0: no scaling
124
+ states : ndarray[np.float64, ndim=2]
125
+ State perturbations
126
+ Array shape: (dim, nstates)
127
+ meanstate : ndarray[np.float64, ndim=1]
128
+ Mean state (only changed if remove_mstate=1)
129
+ Array shape: (dim)
130
+ verbose : int
131
+ Verbosity flag
132
+
133
+ Returns
134
+ -------
135
+ states : ndarray[np.float64, ndim=2]
136
+ State perturbations
137
+ Array shape: (dim, nstates)
138
+ stddev : ndarray[np.float64, ndim=1]
139
+ Standard deviation of field variability
140
+ Array shape: (nfields)
141
+ svals : ndarray[np.float64, ndim=1]
142
+ Singular values divided by sqrt(nstates-1)
143
+ Array shape: (nstates)
144
+ svec : ndarray[np.float64, ndim=2]
145
+ Singular vectors
146
+ Array shape: (dim, nstates)
147
+ meanstate : ndarray[np.float64, ndim=1]
148
+ Mean state (only changed if remove_mstate=1)
149
+ Array shape: (dim)
150
+ status : int
151
+ Status flag
152
+ """
153
+ cdef cnp.ndarray[cnp.float64_t, ndim=2, mode="fortran", negative_indices=False, cast=False] states_np = np.asarray(states, dtype=np.float64, order="F")
154
+ cdef cnp.ndarray[cnp.float64_t, ndim=1, mode="fortran", negative_indices=False, cast=False] stddev_np = np.zeros((nfields), dtype=np.float64, order="F")
155
+ cdef double [::1] stddev = stddev_np
156
+ cdef cnp.ndarray[cnp.float64_t, ndim=1, mode="fortran", negative_indices=False, cast=False] svals_np = np.zeros((nstates), dtype=np.float64, order="F")
157
+ cdef double [::1] svals = svals_np
158
+ cdef cnp.ndarray[cnp.float64_t, ndim=2, mode="fortran", negative_indices=False, cast=False] svec_np = np.zeros((dim, nstates), dtype=np.float64, order="F")
159
+ cdef double [::1,:] svec = svec_np
160
+ cdef cnp.ndarray[cnp.float64_t, ndim=1, mode="fortran", negative_indices=False, cast=False] meanstate_np = np.asarray(meanstate, dtype=np.float64, order="F")
161
+ cdef int status
162
+ with nogil:
163
+ c__pdaf_eofcovar(&dim, &nstates, &nfields, &dim_fields[0],
164
+ &offsets[0], &remove_mstate, &do_mv, &states[0,0],
165
+ &stddev[0], &svals[0], &svec[0,0], &meanstate[0],
166
+ &verbose, &status)
167
+
168
+ return states_np, stddev_np, svals_np, svec_np, meanstate_np, status
169
+ ```
170
+
171
+ ---
172
+
173
+ #### Handling Callback Functions
174
+
175
+ Callback functions allow users to provide information for data assimilation.
176
+ However, Fortran expects these routines to follow specific interfaces.
177
+ These are handled in `src/pyPDAF/pdaf_c_cb_interface.pxd` and corresponding
178
+ `src/pyPDAF/pdaf_c_cb_interface.pyx`.
179
+
180
+ Example:
181
+ ```cython
182
+ cdef void c__init_ens_pdaf(int* filtertype, int* dim_p, int* dim_ens,
183
+ double* state_p, double* uinv, double* ens_p, int* flag) noexcept with gil:
184
+ """Fill the ensemble array that is provided by PDAF with an initial ensemble of model states.
185
+
186
+ This function is called by :func:`pyPDAF.PDAF.init`. The initialised
187
+ ensemble array will be distributed to model by :func:`pyPDAF.PDAF.init_forecast`.
188
+
189
+ Parameters
190
+ ----------
191
+ filtertype : int
192
+ filter type given in PDAF_init
193
+ dim_p : int
194
+ PE-local state dimension given by PDAF_init
195
+ dim_ens : int
196
+ number of ensemble members
197
+ state_p : ndarray[np.float64, ndim=1]
198
+ PE-local model state
199
+ This array must be filled with the initial
200
+ state of the model for SEEK, but it is not
201
+ used for ensemble-based filters.
202
+ One can still make use of this array within
203
+ this function.
204
+ Array shape: (dim_p)
205
+ uinv : ndarray[np.float64, ndim=2]
206
+ This array is the inverse of matrix
207
+ formed by right singular vectors of error
208
+ covariance matrix of ensemble perturbations.
209
+ This array has to be filled in SEEK, but it is
210
+ not used for ensemble-based filters.
211
+ Nevertheless, one can still make use of this
212
+ array within this function e.g.,
213
+ for generating an initial ensemble perturbation
214
+ from a given covariance matrix.
215
+ Dimension of this array is determined by the
216
+ filter type.
217
+ * (dim_ens, dim_ens) for (L)ETKF, (L)NETF, (L)KNETF, and SEEK
218
+ * (dim_ens - 1, dim_ens - 1) for (L)SEIK, (L)ESTKF, and 3DVar using ensemble
219
+ * (1, 1) for (L)EnKF, particle filters and gen_obs
220
+ Array shape: (dim_ens - 1, dim_ens-1)
221
+ ens_p : ndarray[np.float64, ndim=2]
222
+ PE-local ensemble
223
+ Array shape: (dim_p, dim_ens)
224
+ flag : int
225
+ pdaf status flag
226
+
227
+ Returns
228
+ -------
229
+ state_p : ndarray[np.float64, ndim=1]
230
+ PE-local model state
231
+ This array must be filled with the initial
232
+ state of the model for SEEK, but it is not
233
+ used for ensemble-based filters.
234
+ One can still make use of this array within
235
+ this function.
236
+ Array shape: (dim_p)
237
+ uinv : ndarray[np.float64, ndim=2]
238
+ This array is the inverse of matrix
239
+ formed by right singular vectors of error
240
+ covariance matrix of ensemble perturbations.
241
+ This array has to be filled in SEEK, but it is
242
+ not used for ensemble-based filters.
243
+ Nevertheless, one can still make use of this
244
+ array within this function e.g.,
245
+ for generating an initial ensemble perturbation
246
+ from a given covariance matrix.
247
+ Dimension of this array is determined by the
248
+ filter type.
249
+ * (dim_ens, dim_ens) for (L)ETKF, (L)NETF, (L)KNETF, and SEEK
250
+ * (dim_ens - 1, dim_ens - 1) for (L)SEIK, (L)ESTKF, and 3DVar using ensemble
251
+ * (1, 1) for (L)EnKF, particle filters and gen_obs
252
+ Array shape: (dim_ens - 1, dim_ens-1)
253
+ ens_p : ndarray[np.float64, ndim=2]
254
+ PE-local ensemble
255
+ Array shape: (dim_p, dim_ens)
256
+ flag : int
257
+ pdaf status flag
258
+ """
259
+ cdef size_t uinv_len = max(dim_ens[0]-1, 1)
260
+ cdef double[::1] state_p_np = np.asarray(<double[:dim_p[0]:1]> state_p, order="F")
261
+ cdef double[::1,:] uinv_np = np.asarray(<double[:uinv_len:1,:uinv_len]> uinv, order="F")
262
+ cdef double[::1,:] ens_p_np = np.asarray(<double[:dim_p[0]:1,:dim_ens[0]]> ens_p, order="F")
263
+
264
+ state_p_np,uinv_np,ens_p_np,flag[0] = (<object>init_ens_pdaf)(
265
+ filtertype[0],
266
+ dim_p[0],
267
+ dim_ens[0],
268
+ state_p_np.base,
269
+ uinv_np.base,
270
+ ens_p_np.base,
271
+ flag[0])
272
+
273
+ cdef double[::1] state_p_new
274
+ if state_p != &state_p_np[0]:
275
+ state_p_new = np.asarray(<double[:dim_p[0]:1]> state_p, order="F")
276
+ state_p_new[...] = state_p_np
277
+ warnings.warn("The memory address of state_p is changed in c__add_obs_err_pdaf."
278
+ "The values are copied to the original Fortran array, and can slow-down the system.", RuntimeWarning)
279
+ cdef double[::1,:] uinv_new
280
+ if uinv != &uinv_np[0,0]:
281
+ uinv_new = np.asarray(<double[:uinv_len:1,:uinv_len]> uinv, order="F")
282
+ uinv_new[...] = uinv_np
283
+ warnings.warn("The memory address of uinv is changed in c__add_obs_err_pdaf."
284
+ "The values are copied to the original Fortran array, and can slow-down the system.", RuntimeWarning)
285
+ cdef double[::1,:] ens_p_new
286
+ if ens_p != &ens_p_np[0,0]:
287
+ ens_p_new = np.asarray(<double[:dim_p[0]:1,:dim_ens[0]]> ens_p, order="F")
288
+ ens_p_new[...] = ens_p_np
289
+ warnings.warn("The memory address of ens_p is changed in c__add_obs_err_pdaf."
290
+ "The values are copied to the original Fortran array, and can slow-down the system.", RuntimeWarning)
291
+ ```
292
+ where `init_ens_pdaf` is defined in `src/pyPDAF/pdaf_c_cb_interface.pxd` as a pointer:
293
+ `cdef void* init_ens_pdaf = NULL;`.
294
+ The pointer is associated in pyPDAF functions, for example, in `src/pyPDAF/PDAF3/_pdaf3_c.pyx`:
295
+ ```cython
296
+ from pyPDAF cimport pdaf_c_cb_interface as pdaf_cb
297
+ pdaf_cb.init_ens_pdaf = <void*>py__init_ens_pdaf
298
+ ```
299
+ where `py__init_ens_pdaf` is the Python call-back function. The C function,
300
+ `pdaf_cb.c__init_ens_pdaf`, is
301
+ used for calling Fortran subroutines:
302
+ ```cython
303
+ with nogil:
304
+ c__pdaf3_init(&filtertype, &subtype, &stepnull, &param_int[0],
305
+ &dim_pint, &param_real[0], &dim_preal,
306
+ pdaf_cb.c__init_ens_pdaf, &in_screen, &outflag)
307
+ ```
308
+
309
+ #### Caveats
310
+ 1. **Pass-by-Reference in Fortran:** Fortran passes arguments by reference, while Python’s behavior depends on the object type.
311
+ 2. **Maintaining Consistency:** When Python functions modify arguments, ensure the original reference is preserved.
312
+
313
+ Example Safety Check:
314
+ ```python
315
+ cdef double[::1] state_p_new
316
+ if state_p != &state_p_np[0]:
317
+ state_p_new = np.asarray(<double[:dim_p[0]]> state_p)
318
+ state_p_new[...] = state_p_np
319
+ warnings.warn("The memory address of state_p is changed in c__init_ens_pdaf."
320
+ "The values are copied to the original Fortran array, and can slow-down the system.", RuntimeWarning)
321
+ ```
322
+
323
+ #### Exposing the function to pyPDAF and Mypy
324
+ To expose your function to pyPDAF or subpackages of pyPDAF, you need to import
325
+ it in `__init__.py` in corresponding directories. Further, as pyPDAF supports
326
+ type checking and other Python support features. You can add typing and docstring
327
+ to stub files ending with `.pyi`.
pyPDAF/source/docs/source/figs/communicators_PDAFonline.png ADDED
pyPDAF/source/docs/source/hidden_functions.md ADDED
@@ -0,0 +1,749 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Legacy and internal PDAF functions
2
+
3
+ This page gives all available functions in pyPDAF. They are accesible in the
4
+ submodules. Due to the amount of functions available, this documentation cannot
5
+ provide detailed explanations for each function.
6
+
7
+ To use these functions, one has to import the individual module first. For example,
8
+ if one wants to use PDAF subroutine `PDAF_assimilate_3dvar` located in
9
+ `pyPDAF.PDAF.assim`, one can only use `pyPDAF.PDAF.assim.assimilate_3dvar` after
10
+ `import pyPDAF.PDAF.assim`. One cannot simply access these functions by `import pyPDAF`
11
+ like those functions given in [API](API.rst).
12
+
13
+ However, the developers encourage the users to create new issues to request
14
+ information for specific function or functionalities so that the developers
15
+ can understand the needs from users.
16
+
17
+ Explanations of certain legacy functions may be found in PDAF wiki page by the
18
+ corresponding PDAF subroutines. One can find the name of PDAF subroutines by
19
+ the pyPDAF subpackage name and function names. For example,
20
+ `pyPDAF.PDAF._pdaf_c.deallocate` calls `PDAF_deallocate` in PDAF. The module names
21
+ are typically irrelevant. This is similar for `PDAFomi` subroutines, e.g.,
22
+ `PDAFomi_check_error` is `pyPDAF.PDAFomi._pdafomi_c.check_error`.
23
+
24
+ One exception is for some `3dvar` functions. As numbers cannot be the first
25
+ letter of variable or function names, an additional `_` is added for some PDAF
26
+ internal functionss.
27
+
28
+
29
+ ## pyPDAF.PDAF
30
+ ### pyPDAF.PDAF._pdaf_c
31
+ - pyPDAF.PDAF._pdaf_c.correlation_function
32
+ - pyPDAF.PDAF._pdaf_c.deallocate
33
+ - pyPDAF.PDAF._pdaf_c.eofcovar
34
+ - pyPDAF.PDAF._pdaf_c.force_analysis
35
+ - pyPDAF.PDAF._pdaf_c.gather_dim_obs_f
36
+ - pyPDAF.PDAF._pdaf_c.gather_obs_f
37
+ - pyPDAF.PDAF._pdaf_c.gather_obs_f2
38
+ - pyPDAF.PDAF._pdaf_c.gather_obs_f2_flex
39
+ - pyPDAF.PDAF._pdaf_c.gather_obs_f_flex
40
+ - pyPDAF.PDAF._pdaf_c.get_fcst_info
41
+ - pyPDAF.PDAF._pdaf_c.init
42
+ - pyPDAF.PDAF._pdaf_c.init_forecast
43
+ - pyPDAF.PDAF._pdaf_c.local_weight
44
+ - pyPDAF.PDAF._pdaf_c.local_weights
45
+ - pyPDAF.PDAF._pdaf_c.print_da_types
46
+ - pyPDAF.PDAF._pdaf_c.print_filter_types
47
+ - pyPDAF.PDAF._pdaf_c.print_info
48
+ - pyPDAF.PDAF._pdaf_c.reset_forget
49
+ - pyPDAF.PDAF._pdaf_c.sample_ens
50
+
51
+ ### pyPDAF.PDAF.assim
52
+ - pyPDAF.PDAF.assim.assim_offline_3dvar
53
+ - pyPDAF.PDAF.assim.assim_offline_en3dvar_estkf
54
+ - pyPDAF.PDAF.assim.assim_offline_en3dvar_lestkf
55
+ - pyPDAF.PDAF.assim.assim_offline_enkf
56
+ - pyPDAF.PDAF.assim.assim_offline_ensrf
57
+ - pyPDAF.PDAF.assim.assim_offline_estkf
58
+ - pyPDAF.PDAF.assim.assim_offline_etkf
59
+ - pyPDAF.PDAF.assim.assim_offline_hyb3dvar_estkf
60
+ - pyPDAF.PDAF.assim.assim_offline_hyb3dvar_lestkf
61
+ - pyPDAF.PDAF.assim.assim_offline_lenkf
62
+ - pyPDAF.PDAF.assim.assim_offline_lestkf
63
+ - pyPDAF.PDAF.assim.assim_offline_letkf
64
+ - pyPDAF.PDAF.assim.assim_offline_lknetf
65
+ - pyPDAF.PDAF.assim.assim_offline_lnetf
66
+ - pyPDAF.PDAF.assim.assim_offline_lseik
67
+ - pyPDAF.PDAF.assim.assim_offline_netf
68
+ - pyPDAF.PDAF.assim.assim_offline_pf
69
+ - pyPDAF.PDAF.assim.assim_offline_seik
70
+ - pyPDAF.PDAF.assim.assimilate_3dvar
71
+ - pyPDAF.PDAF.assim.assimilate_en3dvar_estkf
72
+ - pyPDAF.PDAF.assim.assimilate_en3dvar_lestkf
73
+ - pyPDAF.PDAF.assim.assimilate_enkf
74
+ - pyPDAF.PDAF.assim.assimilate_ensrf
75
+ - pyPDAF.PDAF.assim.assimilate_estkf
76
+ - pyPDAF.PDAF.assim.assimilate_etkf
77
+ - pyPDAF.PDAF.assim.assimilate_hyb3dvar_estkf
78
+ - pyPDAF.PDAF.assim.assimilate_hyb3dvar_lestkf
79
+ - pyPDAF.PDAF.assim.assimilate_lenkf
80
+ - pyPDAF.PDAF.assim.assimilate_lestkf
81
+ - pyPDAF.PDAF.assim.assimilate_letkf
82
+ - pyPDAF.PDAF.assim.assimilate_lknetf
83
+ - pyPDAF.PDAF.assim.assimilate_lnetf
84
+ - pyPDAF.PDAF.assim.assimilate_lseik
85
+ - pyPDAF.PDAF.assim.assimilate_netf
86
+ - pyPDAF.PDAF.assim.assimilate_pf
87
+ - pyPDAF.PDAF.assim.assimilate_prepost
88
+ - pyPDAF.PDAF.assim.assimilate_seik
89
+ - pyPDAF.PDAF.assim.generate_obs
90
+ - pyPDAF.PDAF.assim.generate_obs_offline
91
+ - pyPDAF.PDAF.assim.get_state
92
+
93
+ ### pyPDAF.PDAF.callback
94
+ - pyPDAF.PDAF.callback.add_obs_error_cb
95
+ - pyPDAF.PDAF.callback.g2l_obs_cb
96
+ - pyPDAF.PDAF.callback.init_obs_f_cb
97
+ - pyPDAF.PDAF.callback.init_obs_l_cb
98
+ - pyPDAF.PDAF.callback.init_obscovar_cb
99
+ - pyPDAF.PDAF.callback.init_obserr_f_cb
100
+ - pyPDAF.PDAF.callback.init_obsvar_cb
101
+ - pyPDAF.PDAF.callback.init_obsvar_l_cb
102
+ - pyPDAF.PDAF.callback.init_obsvars_f_cb
103
+ - pyPDAF.PDAF.callback.likelihood_cb
104
+ - pyPDAF.PDAF.callback.likelihood_hyb_l_cb
105
+ - pyPDAF.PDAF.callback.likelihood_l_cb
106
+ - pyPDAF.PDAF.callback.localize_covar_cb
107
+ - pyPDAF.PDAF.callback.localize_covar_serial_cb
108
+ - pyPDAF.PDAF.callback.omit_by_inno_cb
109
+ - pyPDAF.PDAF.callback.omit_by_inno_l_cb
110
+ - pyPDAF.PDAF.callback.prodrinva_cb
111
+ - pyPDAF.PDAF.callback.prodrinva_hyb_l_cb
112
+ - pyPDAF.PDAF.callback.prodrinva_l_cb
113
+
114
+ ### pyPDAF.PDAF.diag
115
+ - pyPDAF.PDAF.diag.diag_compute_moments
116
+ - pyPDAF.PDAF.diag.diag_crps_mpi
117
+ - pyPDAF.PDAF.diag.diag_crps_nompi
118
+ - pyPDAF.PDAF.diag.diag_effsample
119
+ - pyPDAF.PDAF.diag.diag_ensmean
120
+ - pyPDAF.PDAF.diag.diag_ensstats
121
+ - pyPDAF.PDAF.diag.diag_histogram
122
+ - pyPDAF.PDAF.diag.diag_reliability_budget
123
+ - pyPDAF.PDAF.diag.diag_rmsd
124
+ - pyPDAF.PDAF.diag.diag_rmsd_nompi
125
+ - pyPDAF.PDAF.diag.diag_stddev
126
+ - pyPDAF.PDAF.diag.diag_stddev_nompi
127
+ - pyPDAF.PDAF.diag.diag_variance
128
+ - pyPDAF.PDAF.diag.diag_variance_nompi
129
+
130
+ ### pyPDAF.PDAF.get
131
+ - pyPDAF.PDAF.get.get_assim_flag
132
+ - pyPDAF.PDAF.get.get_local_type
133
+ - pyPDAF.PDAF.get.get_localfilter
134
+ - pyPDAF.PDAF.get.get_memberid
135
+ - pyPDAF.PDAF.get.get_obsmemberid
136
+ - pyPDAF.PDAF.get.get_smoother_ens
137
+
138
+ ### pyPDAF.PDAF.iau_internal
139
+ - pyPDAF.PDAF.iau_internal.iau_add_inc_ens
140
+ - pyPDAF.PDAF.iau_internal.iau_dealloc
141
+ - pyPDAF.PDAF.iau_internal.iau_init_weights
142
+ - pyPDAF.PDAF.iau_internal.iau_update_ens
143
+ - pyPDAF.PDAF.iau_internal.iau_update_inc
144
+
145
+ ### pyPDAF.PDAF.iau
146
+ - pyPDAF.PDAF.iau.iau_add_inc
147
+ - pyPDAF.PDAF.iau.iau_init
148
+ - pyPDAF.PDAF.iau.iau_init_inc
149
+ - pyPDAF.PDAF.iau.iau_reset
150
+ - pyPDAF.PDAF.iau.iau_set_ens_pointer
151
+ - pyPDAF.PDAF.iau.iau_set_pointer
152
+ - pyPDAF.PDAF.iau.iau_set_state_pointer
153
+ - pyPDAF.PDAF.iau.iau_set_weights
154
+
155
+ ### pyPDAF.PDAF.internal
156
+ - pyPDAF.PDAF.internal._3dvar_alloc
157
+ - pyPDAF.PDAF.internal._3dvar_analysis_cvt
158
+ - pyPDAF.PDAF.internal._3dvar_config
159
+ - pyPDAF.PDAF.internal._3dvar_costf_cg_cvt
160
+ - pyPDAF.PDAF.internal._3dvar_costf_cvt
161
+ - pyPDAF.PDAF.internal._3dvar_init
162
+ - pyPDAF.PDAF.internal._3dvar_memtime
163
+ - pyPDAF.PDAF.internal._3dvar_optim_cg
164
+ - pyPDAF.PDAF.internal._3dvar_optim_cgplus
165
+ - pyPDAF.PDAF.internal._3dvar_optim_lbfgs
166
+ - pyPDAF.PDAF.internal._3dvar_options
167
+ - pyPDAF.PDAF.internal._3dvar_set_iparam
168
+ - pyPDAF.PDAF.internal._3dvar_set_rparam
169
+ - pyPDAF.PDAF.internal._3dvar_update
170
+ - pyPDAF.PDAF.internal.add_particle_noise
171
+ - pyPDAF.PDAF.internal.alloc
172
+ - pyPDAF.PDAF.internal.alloc_bias
173
+ - pyPDAF.PDAF.internal.alloc_filters
174
+ - pyPDAF.PDAF.internal.alloc_sens
175
+ - pyPDAF.PDAF.internal.allreduce
176
+ - pyPDAF.PDAF.internal.configinfo_filters
177
+ - pyPDAF.PDAF.internal.en3dvar_analysis_cvt
178
+ - pyPDAF.PDAF.internal.en3dvar_costf_cg_cvt
179
+ - pyPDAF.PDAF.internal.en3dvar_costf_cvt
180
+ - pyPDAF.PDAF.internal.en3dvar_optim_cg
181
+ - pyPDAF.PDAF.internal.en3dvar_optim_cgplus
182
+ - pyPDAF.PDAF.internal.en3dvar_optim_lbfgs
183
+ - pyPDAF.PDAF.internal.en3dvar_update_estkf
184
+ - pyPDAF.PDAF.internal.en3dvar_update_lestkf
185
+ - pyPDAF.PDAF.internal.enkf_alloc
186
+ - pyPDAF.PDAF.internal.enkf_ana_rlm
187
+ - pyPDAF.PDAF.internal.enkf_ana_rsm
188
+ - pyPDAF.PDAF.internal.enkf_config
189
+ - pyPDAF.PDAF.internal.enkf_gather_resid
190
+ - pyPDAF.PDAF.internal.enkf_init
191
+ - pyPDAF.PDAF.internal.enkf_memtime
192
+ - pyPDAF.PDAF.internal.enkf_obs_ensemble
193
+ - pyPDAF.PDAF.internal.enkf_options
194
+ - pyPDAF.PDAF.internal.enkf_set_iparam
195
+ - pyPDAF.PDAF.internal.enkf_set_rparam
196
+ - pyPDAF.PDAF.internal.enkf_update
197
+ - pyPDAF.PDAF.internal.ens_omega
198
+ - pyPDAF.PDAF.internal.ensrf_alloc
199
+ - pyPDAF.PDAF.internal.ensrf_ana
200
+ - pyPDAF.PDAF.internal.ensrf_ana_2step
201
+ - pyPDAF.PDAF.internal.ensrf_config
202
+ - pyPDAF.PDAF.internal.ensrf_init
203
+ - pyPDAF.PDAF.internal.ensrf_memtime
204
+ - pyPDAF.PDAF.internal.ensrf_options
205
+ - pyPDAF.PDAF.internal.ensrf_set_iparam
206
+ - pyPDAF.PDAF.internal.ensrf_set_rparam
207
+ - pyPDAF.PDAF.internal.ensrf_update
208
+ - pyPDAF.PDAF.internal.estkf_alloc
209
+ - pyPDAF.PDAF.internal.estkf_ana
210
+ - pyPDAF.PDAF.internal.estkf_ana_fixed
211
+ - pyPDAF.PDAF.internal.estkf_aomega
212
+ - pyPDAF.PDAF.internal.estkf_config
213
+ - pyPDAF.PDAF.internal.estkf_init
214
+ - pyPDAF.PDAF.internal.estkf_memtime
215
+ - pyPDAF.PDAF.internal.estkf_omegaa
216
+ - pyPDAF.PDAF.internal.estkf_options
217
+ - pyPDAF.PDAF.internal.estkf_set_iparam
218
+ - pyPDAF.PDAF.internal.estkf_set_rparam
219
+ - pyPDAF.PDAF.internal.estkf_update
220
+ - pyPDAF.PDAF.internal.etkf_alloc
221
+ - pyPDAF.PDAF.internal.etkf_ana
222
+ - pyPDAF.PDAF.internal.etkf_ana_fixed
223
+ - pyPDAF.PDAF.internal.etkf_ana_t
224
+ - pyPDAF.PDAF.internal.etkf_config
225
+ - pyPDAF.PDAF.internal.etkf_init
226
+ - pyPDAF.PDAF.internal.etkf_memtime
227
+ - pyPDAF.PDAF.internal.etkf_options
228
+ - pyPDAF.PDAF.internal.etkf_set_iparam
229
+ - pyPDAF.PDAF.internal.etkf_set_rparam
230
+ - pyPDAF.PDAF.internal.etkf_update
231
+ - pyPDAF.PDAF.internal.fcst_operations
232
+ - pyPDAF.PDAF.internal.gather_ens
233
+ - pyPDAF.PDAF.internal.gen_obs
234
+ - pyPDAF.PDAF.internal.generate_rndmat
235
+ - pyPDAF.PDAF.internal.genobs_alloc
236
+ - pyPDAF.PDAF.internal.genobs_config
237
+ - pyPDAF.PDAF.internal.genobs_init
238
+ - pyPDAF.PDAF.internal.genobs_options
239
+ - pyPDAF.PDAF.internal.genobs_set_iparam
240
+ - pyPDAF.PDAF.internal.get_ensstats
241
+ - pyPDAF.PDAF.internal.hyb3dvar_analysis_cvt
242
+ - pyPDAF.PDAF.internal.hyb3dvar_costf_cg_cvt
243
+ - pyPDAF.PDAF.internal.hyb3dvar_costf_cvt
244
+ - pyPDAF.PDAF.internal.hyb3dvar_optim_cg
245
+ - pyPDAF.PDAF.internal.hyb3dvar_optim_cgplus
246
+ - pyPDAF.PDAF.internal.hyb3dvar_optim_lbfgs
247
+ - pyPDAF.PDAF.internal.hyb3dvar_update_estkf
248
+ - pyPDAF.PDAF.internal.hyb3dvar_update_lestkf
249
+ - pyPDAF.PDAF.internal.incr_local_obsstats
250
+ - pyPDAF.PDAF.internal.inflate_ens
251
+ - pyPDAF.PDAF.internal.inflate_weights
252
+ - pyPDAF.PDAF.internal.init_filters
253
+ - pyPDAF.PDAF.internal.init_local_obsstats
254
+ - pyPDAF.PDAF.internal.init_parallel
255
+ - pyPDAF.PDAF.internal.lenkf_alloc
256
+ - pyPDAF.PDAF.internal.lenkf_ana_rsm
257
+ - pyPDAF.PDAF.internal.lenkf_config
258
+ - pyPDAF.PDAF.internal.lenkf_init
259
+ - pyPDAF.PDAF.internal.lenkf_memtime
260
+ - pyPDAF.PDAF.internal.lenkf_options
261
+ - pyPDAF.PDAF.internal.lenkf_set_iparam
262
+ - pyPDAF.PDAF.internal.lenkf_set_rparam
263
+ - pyPDAF.PDAF.internal.lenkf_update
264
+ - pyPDAF.PDAF.internal.lestkf_alloc
265
+ - pyPDAF.PDAF.internal.lestkf_ana
266
+ - pyPDAF.PDAF.internal.lestkf_ana_fixed
267
+ - pyPDAF.PDAF.internal.lestkf_config
268
+ - pyPDAF.PDAF.internal.lestkf_init
269
+ - pyPDAF.PDAF.internal.lestkf_memtime
270
+ - pyPDAF.PDAF.internal.lestkf_options
271
+ - pyPDAF.PDAF.internal.lestkf_set_iparam
272
+ - pyPDAF.PDAF.internal.lestkf_set_rparam
273
+ - pyPDAF.PDAF.internal.lestkf_update
274
+ - pyPDAF.PDAF.internal.letkf_alloc
275
+ - pyPDAF.PDAF.internal.letkf_ana
276
+ - pyPDAF.PDAF.internal.letkf_ana_fixed
277
+ - pyPDAF.PDAF.internal.letkf_ana_t
278
+ - pyPDAF.PDAF.internal.letkf_config
279
+ - pyPDAF.PDAF.internal.letkf_init
280
+ - pyPDAF.PDAF.internal.letkf_memtime
281
+ - pyPDAF.PDAF.internal.letkf_options
282
+ - pyPDAF.PDAF.internal.letkf_set_iparam
283
+ - pyPDAF.PDAF.internal.letkf_set_rparam
284
+ - pyPDAF.PDAF.internal.letkf_update
285
+ - pyPDAF.PDAF.internal.lknetf_alloc
286
+ - pyPDAF.PDAF.internal.lknetf_alpha_neff
287
+ - pyPDAF.PDAF.internal.lknetf_ana_letkft
288
+ - pyPDAF.PDAF.internal.lknetf_ana_lnetf
289
+ - pyPDAF.PDAF.internal.lknetf_analysis_t
290
+ - pyPDAF.PDAF.internal.lknetf_compute_gamma
291
+ - pyPDAF.PDAF.internal.lknetf_config
292
+ - pyPDAF.PDAF.internal.lknetf_init
293
+ - pyPDAF.PDAF.internal.lknetf_memtime
294
+ - pyPDAF.PDAF.internal.lknetf_options
295
+ - pyPDAF.PDAF.internal.lknetf_reset_gamma
296
+ - pyPDAF.PDAF.internal.lknetf_set_gamma
297
+ - pyPDAF.PDAF.internal.lknetf_set_iparam
298
+ - pyPDAF.PDAF.internal.lknetf_set_rparam
299
+ - pyPDAF.PDAF.internal.lknetf_update_step
300
+ - pyPDAF.PDAF.internal.lknetf_update_sync
301
+ - pyPDAF.PDAF.internal.lnetf_alloc
302
+ - pyPDAF.PDAF.internal.lnetf_ana
303
+ - pyPDAF.PDAF.internal.lnetf_config
304
+ - pyPDAF.PDAF.internal.lnetf_init
305
+ - pyPDAF.PDAF.internal.lnetf_memtime
306
+ - pyPDAF.PDAF.internal.lnetf_options
307
+ - pyPDAF.PDAF.internal.lnetf_set_iparam
308
+ - pyPDAF.PDAF.internal.lnetf_set_rparam
309
+ - pyPDAF.PDAF.internal.lnetf_smoothert
310
+ - pyPDAF.PDAF.internal.lnetf_update
311
+ - pyPDAF.PDAF.internal.lseik_alloc
312
+ - pyPDAF.PDAF.internal.lseik_ana
313
+ - pyPDAF.PDAF.internal.lseik_ana_trans
314
+ - pyPDAF.PDAF.internal.lseik_config
315
+ - pyPDAF.PDAF.internal.lseik_init
316
+ - pyPDAF.PDAF.internal.lseik_memtime
317
+ - pyPDAF.PDAF.internal.lseik_options
318
+ - pyPDAF.PDAF.internal.lseik_resample
319
+ - pyPDAF.PDAF.internal.lseik_set_iparam
320
+ - pyPDAF.PDAF.internal.lseik_set_rparam
321
+ - pyPDAF.PDAF.internal.lseik_update
322
+ - pyPDAF.PDAF.internal.memcount
323
+ - pyPDAF.PDAF.internal.memcount_define
324
+ - pyPDAF.PDAF.internal.memcount_ini
325
+ - pyPDAF.PDAF.internal.mpi_init
326
+ - pyPDAF.PDAF.internal.mvnormalize
327
+ - pyPDAF.PDAF.internal.netf_alloc
328
+ - pyPDAF.PDAF.internal.netf_ana
329
+ - pyPDAF.PDAF.internal.netf_config
330
+ - pyPDAF.PDAF.internal.netf_init
331
+ - pyPDAF.PDAF.internal.netf_memtime
332
+ - pyPDAF.PDAF.internal.netf_options
333
+ - pyPDAF.PDAF.internal.netf_set_iparam
334
+ - pyPDAF.PDAF.internal.netf_set_rparam
335
+ - pyPDAF.PDAF.internal.netf_smoothert
336
+ - pyPDAF.PDAF.internal.netf_update
337
+ - pyPDAF.PDAF.internal.obs_dealloc
338
+ - pyPDAF.PDAF.internal.obs_dealloc_local
339
+ - pyPDAF.PDAF.internal.obs_init
340
+ - pyPDAF.PDAF.internal.obs_init_local
341
+ - pyPDAF.PDAF.internal.obs_init_obsvars
342
+ - pyPDAF.PDAF.internal.options_filters
343
+ - pyPDAF.PDAF.internal.pf_alloc
344
+ - pyPDAF.PDAF.internal.pf_ana
345
+ - pyPDAF.PDAF.internal.pf_config
346
+ - pyPDAF.PDAF.internal.pf_init
347
+ - pyPDAF.PDAF.internal.pf_memtime
348
+ - pyPDAF.PDAF.internal.pf_options
349
+ - pyPDAF.PDAF.internal.pf_resampling
350
+ - pyPDAF.PDAF.internal.pf_set_iparam
351
+ - pyPDAF.PDAF.internal.pf_set_rparam
352
+ - pyPDAF.PDAF.internal.pf_update
353
+ - pyPDAF.PDAF.internal.prepost
354
+ - pyPDAF.PDAF.internal.print_domain_stats
355
+ - pyPDAF.PDAF.internal.print_info_filters
356
+ - pyPDAF.PDAF.internal.print_local_obsstats
357
+ - pyPDAF.PDAF.internal.print_version
358
+ - pyPDAF.PDAF.internal.reset_dim_ens
359
+ - pyPDAF.PDAF.internal.reset_dim_p
360
+ - pyPDAF.PDAF.internal.scatter_ens
361
+ - pyPDAF.PDAF.internal.seik_alloc
362
+ - pyPDAF.PDAF.internal.seik_ana
363
+ - pyPDAF.PDAF.internal.seik_ana_newt
364
+ - pyPDAF.PDAF.internal.seik_ana_trans
365
+ - pyPDAF.PDAF.internal.seik_config
366
+ - pyPDAF.PDAF.internal.seik_init
367
+ - pyPDAF.PDAF.internal.seik_matrixt
368
+ - pyPDAF.PDAF.internal.seik_memtime
369
+ - pyPDAF.PDAF.internal.seik_omega
370
+ - pyPDAF.PDAF.internal.seik_options
371
+ - pyPDAF.PDAF.internal.seik_resample
372
+ - pyPDAF.PDAF.internal.seik_resample_newt
373
+ - pyPDAF.PDAF.internal.seik_set_iparam
374
+ - pyPDAF.PDAF.internal.seik_set_rparam
375
+ - pyPDAF.PDAF.internal.seik_ttimesa
376
+ - pyPDAF.PDAF.internal.seik_uinv
377
+ - pyPDAF.PDAF.internal.seik_update
378
+ - pyPDAF.PDAF.internal.set_forget
379
+ - pyPDAF.PDAF.internal.set_forget_local
380
+ - pyPDAF.PDAF.internal.set_iparam_filters
381
+ - pyPDAF.PDAF.internal.set_rparam_filters
382
+ - pyPDAF.PDAF.internal.sisort
383
+ - pyPDAF.PDAF.internal.smoother_enkf
384
+ - pyPDAF.PDAF.internal.smoother_lnetf
385
+ - pyPDAF.PDAF.internal.smoother_netf
386
+ - pyPDAF.PDAF.internal.smoother_shift
387
+ - pyPDAF.PDAF.internal.smoothing
388
+ - pyPDAF.PDAF.internal.smoothing_local
389
+ - pyPDAF.PDAF.internal.subtract_colmean
390
+ - pyPDAF.PDAF.internal.subtract_rowmean
391
+ - pyPDAF.PDAF.internal.timeit
392
+
393
+ ### pyPDAF.PDAF.put
394
+ - pyPDAF.PDAF.put.put_state_3dvar
395
+ - pyPDAF.PDAF.put.put_state_en3dvar_estkf
396
+ - pyPDAF.PDAF.put.put_state_en3dvar_lestkf
397
+ - pyPDAF.PDAF.put.put_state_enkf
398
+ - pyPDAF.PDAF.put.put_state_ensrf
399
+ - pyPDAF.PDAF.put.put_state_estkf
400
+ - pyPDAF.PDAF.put.put_state_etkf
401
+ - pyPDAF.PDAF.put.put_state_generate_obs
402
+ - pyPDAF.PDAF.put.put_state_hyb3dvar_estkf
403
+ - pyPDAF.PDAF.put.put_state_hyb3dvar_lestkf
404
+ - pyPDAF.PDAF.put.put_state_lenkf
405
+ - pyPDAF.PDAF.put.put_state_lestkf
406
+ - pyPDAF.PDAF.put.put_state_letkf
407
+ - pyPDAF.PDAF.put.put_state_lknetf
408
+ - pyPDAF.PDAF.put.put_state_lnetf
409
+ - pyPDAF.PDAF.put.put_state_lseik
410
+ - pyPDAF.PDAF.put.put_state_netf
411
+ - pyPDAF.PDAF.put.put_state_pf
412
+ - pyPDAF.PDAF.put.put_state_prepost
413
+ - pyPDAF.PDAF.put.put_state_seik
414
+
415
+ ### pyPDAF.PDAF.setter
416
+ - pyPDAF.PDAF.setter.set_comm_pdaf
417
+ - pyPDAF.PDAF.setter.set_debug_flag
418
+ - pyPDAF.PDAF.setter.set_ens_pointer
419
+ - pyPDAF.PDAF.setter.set_iparam
420
+ - pyPDAF.PDAF.setter.set_memberid
421
+ - pyPDAF.PDAF.setter.set_offline_mode
422
+ - pyPDAF.PDAF.setter.set_rparam
423
+ - pyPDAF.PDAF.setter.set_seedset
424
+ - pyPDAF.PDAF.setter.set_smoother_ens
425
+
426
+ ## pyPDAF.PDAF3
427
+ ### pyPDAF.PDAF3._pdaf3_c
428
+ - pyPDAF.PDAF3._pdaf3_c.init
429
+ - pyPDAF.PDAF3._pdaf3_c.init_forecast
430
+ - pyPDAF.PDAF3._pdaf3_c.set_parallel
431
+
432
+ ### pyPDAF.PDAF3.assim
433
+ - pyPDAF.PDAF3.assim.assim_offline
434
+ - pyPDAF.PDAF3.assim.assim_offline_3dvar
435
+ - pyPDAF.PDAF3.assim.assim_offline_3dvar_all
436
+ - pyPDAF.PDAF3.assim.assim_offline_3dvar_nondiagr
437
+ - pyPDAF.PDAF3.assim.assim_offline_en3dvar
438
+ - pyPDAF.PDAF3.assim.assim_offline_en3dvar_estkf
439
+ - pyPDAF.PDAF3.assim.assim_offline_en3dvar_estkf_nondiagr
440
+ - pyPDAF.PDAF3.assim.assim_offline_en3dvar_lestkf
441
+ - pyPDAF.PDAF3.assim.assim_offline_en3dvar_lestkf_nondiagr
442
+ - pyPDAF.PDAF3.assim.assim_offline_enkf_nondiagr
443
+ - pyPDAF.PDAF3.assim.assim_offline_ensrf
444
+ - pyPDAF.PDAF3.assim.assim_offline_global
445
+ - pyPDAF.PDAF3.assim.assim_offline_global_nondiagr
446
+ - pyPDAF.PDAF3.assim.assim_offline_hyb3dvar
447
+ - pyPDAF.PDAF3.assim.assim_offline_hyb3dvar_estkf
448
+ - pyPDAF.PDAF3.assim.assim_offline_hyb3dvar_estkf_nondiagr
449
+ - pyPDAF.PDAF3.assim.assim_offline_hyb3dvar_lestkf
450
+ - pyPDAF.PDAF3.assim.assim_offline_hyb3dvar_lestkf_nondiagr
451
+ - pyPDAF.PDAF3.assim.assim_offline_lenkf
452
+ - pyPDAF.PDAF3.assim.assim_offline_lenkf_nondiagr
453
+ - pyPDAF.PDAF3.assim.assim_offline_lknetf_nondiagr
454
+ - pyPDAF.PDAF3.assim.assim_offline_lnetf_nondiagr
455
+ - pyPDAF.PDAF3.assim.assim_offline_local
456
+ - pyPDAF.PDAF3.assim.assim_offline_local_nondiagr
457
+ - pyPDAF.PDAF3.assim.assim_offline_nonlin_nondiagr
458
+ - pyPDAF.PDAF3.assim.assimilate
459
+ - pyPDAF.PDAF3.assim.assimilate_3dvar
460
+ - pyPDAF.PDAF3.assim.assimilate_3dvar_all
461
+ - pyPDAF.PDAF3.assim.assimilate_3dvar_nondiagr
462
+ - pyPDAF.PDAF3.assim.assimilate_en3dvar
463
+ - pyPDAF.PDAF3.assim.assimilate_en3dvar_estkf
464
+ - pyPDAF.PDAF3.assim.assimilate_en3dvar_estkf_nondiagr
465
+ - pyPDAF.PDAF3.assim.assimilate_en3dvar_lestkf
466
+ - pyPDAF.PDAF3.assim.assimilate_en3dvar_lestkf_nondiagr
467
+ - pyPDAF.PDAF3.assim.assimilate_enkf_nondiagr
468
+ - pyPDAF.PDAF3.assim.assimilate_ensrf
469
+ - pyPDAF.PDAF3.assim.assimilate_global
470
+ - pyPDAF.PDAF3.assim.assimilate_global_nondiagr
471
+ - pyPDAF.PDAF3.assim.assimilate_hyb3dvar
472
+ - pyPDAF.PDAF3.assim.assimilate_hyb3dvar_estkf
473
+ - pyPDAF.PDAF3.assim.assimilate_hyb3dvar_estkf_nondiagr
474
+ - pyPDAF.PDAF3.assim.assimilate_hyb3dvar_lestkf
475
+ - pyPDAF.PDAF3.assim.assimilate_hyb3dvar_lestkf_nondiagr
476
+ - pyPDAF.PDAF3.assim.assimilate_lenkf
477
+ - pyPDAF.PDAF3.assim.assimilate_lenkf_nondiagr
478
+ - pyPDAF.PDAF3.assim.assimilate_lknetf_nondiagr
479
+ - pyPDAF.PDAF3.assim.assimilate_lnetf_nondiagr
480
+ - pyPDAF.PDAF3.assim.assimilate_local
481
+ - pyPDAF.PDAF3.assim.assimilate_local_nondiagr
482
+ - pyPDAF.PDAF3.assim.assimilate_nonlin_nondiagr
483
+ - pyPDAF.PDAF3.assim.generate_obs
484
+ - pyPDAF.PDAF3.assim.generate_obs_offline
485
+
486
+ ### pyPDAF.PDAF3.put
487
+ - pyPDAF.PDAF3.put.put_state
488
+ - pyPDAF.PDAF3.put.put_state_3dvar
489
+ - pyPDAF.PDAF3.put.put_state_3dvar_all
490
+ - pyPDAF.PDAF3.put.put_state_3dvar_nondiagr
491
+ - pyPDAF.PDAF3.put.put_state_en3dvar
492
+ - pyPDAF.PDAF3.put.put_state_en3dvar_estkf
493
+ - pyPDAF.PDAF3.put.put_state_en3dvar_estkf_nondiagr
494
+ - pyPDAF.PDAF3.put.put_state_en3dvar_lestkf
495
+ - pyPDAF.PDAF3.put.put_state_en3dvar_lestkf_nondiagr
496
+ - pyPDAF.PDAF3.put.put_state_enkf_nondiagr
497
+ - pyPDAF.PDAF3.put.put_state_ensrf
498
+ - pyPDAF.PDAF3.put.put_state_generate_obs
499
+ - pyPDAF.PDAF3.put.put_state_global
500
+ - pyPDAF.PDAF3.put.put_state_global_nondiagr
501
+ - pyPDAF.PDAF3.put.put_state_hyb3dvar
502
+ - pyPDAF.PDAF3.put.put_state_hyb3dvar_estkf
503
+ - pyPDAF.PDAF3.put.put_state_hyb3dvar_estkf_nondiagr
504
+ - pyPDAF.PDAF3.put.put_state_hyb3dvar_lestkf
505
+ - pyPDAF.PDAF3.put.put_state_hyb3dvar_lestkf_nondiagr
506
+ - pyPDAF.PDAF3.put.put_state_lenkf
507
+ - pyPDAF.PDAF3.put.put_state_lenkf_nondiagr
508
+ - pyPDAF.PDAF3.put.put_state_lknetf_nondiagr
509
+ - pyPDAF.PDAF3.put.put_state_lnetf_nondiagr
510
+ - pyPDAF.PDAF3.put.put_state_local
511
+ - pyPDAF.PDAF3.put.put_state_local_nondiagr
512
+ - pyPDAF.PDAF3.put.put_state_nonlin_nondiagr
513
+
514
+ ## pyPDAF.PDAFlocal
515
+ ### pyPDAF.PDAFlocal._pdaflocal_c
516
+ - pyPDAF.PDAFlocal._pdaflocal_c.clear_increment_weights
517
+ - pyPDAF.PDAFlocal._pdaflocal_c.set_increment_weights
518
+ - pyPDAF.PDAFlocal._pdaflocal_c.set_indices
519
+
520
+ ### pyPDAF.PDAFlocal.assim
521
+ - pyPDAF.PDAFlocal.assim.assimilate_en3dvar_lestkf
522
+ - pyPDAF.PDAFlocal.assim.assimilate_hyb3dvar_lestkf
523
+ - pyPDAF.PDAFlocal.assim.assimilate_lestkf
524
+ - pyPDAF.PDAFlocal.assim.assimilate_letkf
525
+ - pyPDAF.PDAFlocal.assim.assimilate_lknetf
526
+ - pyPDAF.PDAFlocal.assim.assimilate_lnetf
527
+ - pyPDAF.PDAFlocal.assim.assimilate_lseik
528
+
529
+ ### pyPDAF.PDAFlocal.internal
530
+ - pyPDAF.PDAFlocal.internal.g2l_cb
531
+ - pyPDAF.PDAFlocal.internal.l2g_cb
532
+
533
+ ### pyPDAF.PDAFlocal.put
534
+ - pyPDAF.PDAFlocal.put.put_state_en3dvar_lestkf
535
+ - pyPDAF.PDAFlocal.put.put_state_hyb3dvar_lestkf
536
+ - pyPDAF.PDAFlocal.put.put_state_lestkf
537
+ - pyPDAF.PDAFlocal.put.put_state_letkf
538
+ - pyPDAF.PDAFlocal.put.put_state_lknetf
539
+ - pyPDAF.PDAFlocal.put.put_state_lnetf
540
+ - pyPDAF.PDAFlocal.put.put_state_lseik
541
+
542
+ ## pyPDAF.PDAFlocalomi
543
+ ### pyPDAF.PDAFlocalomi.assim
544
+ - pyPDAF.PDAFlocalomi.assim.assimilate
545
+ - pyPDAF.PDAFlocalomi.assim.assimilate_en3dvar_lestkf
546
+ - pyPDAF.PDAFlocalomi.assim.assimilate_en3dvar_lestkf_nondiagr
547
+ - pyPDAF.PDAFlocalomi.assim.assimilate_hyb3dvar_lestkf
548
+ - pyPDAF.PDAFlocalomi.assim.assimilate_hyb3dvar_lestkf_nondiagr
549
+ - pyPDAF.PDAFlocalomi.assim.assimilate_lknetf_nondiagr
550
+ - pyPDAF.PDAFlocalomi.assim.assimilate_lnetf_nondiagr
551
+ - pyPDAF.PDAFlocalomi.assim.assimilate_nondiagr
552
+
553
+ ### pyPDAF.PDAFlocalomi.put
554
+ - pyPDAF.PDAFlocalomi.put.put_state
555
+ - pyPDAF.PDAFlocalomi.put.put_state_en3dvar_lestkf
556
+ - pyPDAF.PDAFlocalomi.put.put_state_en3dvar_lestkf_nondiagr
557
+ - pyPDAF.PDAFlocalomi.put.put_state_hyb3dvar_lestkf
558
+ - pyPDAF.PDAFlocalomi.put.put_state_hyb3dvar_lestkf_nondiagr
559
+ - pyPDAF.PDAFlocalomi.put.put_state_lknetf_nondiagr
560
+ - pyPDAF.PDAFlocalomi.put.put_state_lnetf_nondiagr
561
+ - pyPDAF.PDAFlocalomi.put.put_state_nondiagr
562
+
563
+
564
+ ## pyPDAF.PDAFomi
565
+ ### pyPDAF.PDAFomi._pdafomi_c
566
+ - pyPDAF.PDAFomi._pdafomi_c.check_error
567
+ - pyPDAF.PDAFomi._pdafomi_c.gather_obs
568
+ - pyPDAF.PDAFomi._pdafomi_c.gather_obsstate
569
+ - pyPDAF.PDAFomi._pdafomi_c.get_domain_limits_unstr
570
+ - pyPDAF.PDAFomi._pdafomi_c.get_interp_coeff_lin
571
+ - pyPDAF.PDAFomi._pdafomi_c.get_interp_coeff_lin1d
572
+ - pyPDAF.PDAFomi._pdafomi_c.get_interp_coeff_tri
573
+ - pyPDAF.PDAFomi._pdafomi_c.init
574
+ - pyPDAF.PDAFomi._pdafomi_c.init_dim_obs_l_iso
575
+ - pyPDAF.PDAFomi._pdafomi_c.init_dim_obs_l_noniso
576
+ - pyPDAF.PDAFomi._pdafomi_c.init_dim_obs_l_noniso_locweights
577
+ - pyPDAF.PDAFomi._pdafomi_c.init_local
578
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_adj_gridavg
579
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_adj_gridpoint
580
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_adj_interp_lin
581
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_extern
582
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_gridavg
583
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_gridpoint
584
+ - pyPDAF.PDAFomi._pdafomi_c.obs_op_interp_lin
585
+ - pyPDAF.PDAFomi._pdafomi_c.observation_localization_weights
586
+ - pyPDAF.PDAFomi._pdafomi_c.set_debug_flag
587
+ - pyPDAF.PDAFomi._pdafomi_c.set_dim_obs_l
588
+ - pyPDAF.PDAFomi._pdafomi_c.set_domain_limits
589
+ - pyPDAF.PDAFomi._pdafomi_c.set_localization
590
+ - pyPDAF.PDAFomi._pdafomi_c.set_localization_noniso
591
+ - pyPDAF.PDAFomi._pdafomi_c.set_localize_covar_iso
592
+ - pyPDAF.PDAFomi._pdafomi_c.set_localize_covar_noniso
593
+ - pyPDAF.PDAFomi._pdafomi_c.set_localize_covar_noniso_locweights
594
+ - pyPDAF.PDAFomi._pdafomi_c.set_obs_diag
595
+ - pyPDAF.PDAFomi._pdafomi_c.store_obs_l_index
596
+ - pyPDAF.PDAFomi._pdafomi_c.store_obs_l_index_vdist
597
+
598
+ ### pyPDAF.PDAFomi.assim
599
+ - pyPDAF.PDAFomi.assim.assimilate_3dvar
600
+ - pyPDAF.PDAFomi.assim.assimilate_3dvar_nondiagr
601
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_estkf
602
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_estkf_nondiagr
603
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_lestkf
604
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_lestkf_nondiagr
605
+ - pyPDAF.PDAFomi.assim.assimilate_enkf_nondiagr
606
+ - pyPDAF.PDAFomi.assim.assimilate_ensrf
607
+ - pyPDAF.PDAFomi.assim.assimilate_global
608
+ - pyPDAF.PDAFomi.assim.assimilate_global_nondiagr
609
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_estkf
610
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_estkf_nondiagr
611
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_lestkf
612
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_lestkf_nondiagr
613
+ - pyPDAF.PDAFomi.assim.assimilate_lenkf
614
+ - pyPDAF.PDAFomi.assim.assimilate_lenkf_nondiagr
615
+ - pyPDAF.PDAFomi.assim.assimilate_lknetf_nondiagr
616
+ - pyPDAF.PDAFomi.assim.assimilate_lnetf_nondiagr
617
+ - pyPDAF.PDAFomi.assim.assimilate_local
618
+ - pyPDAF.PDAFomi.assim.assimilate_local_nondiagr
619
+ - pyPDAF.PDAFomi.assim.assimilate_nonlin_nondiagr
620
+ - pyPDAF.PDAFomi.assim.generate_obs
621
+
622
+ ### pyPDAF.PDAFomi.diag
623
+ - pyPDAF.PDAFomi.diag.diag_dimobs
624
+ - pyPDAF.PDAFomi.diag.diag_get_hx
625
+ - pyPDAF.PDAFomi.diag.diag_get_hxmean
626
+ - pyPDAF.PDAFomi.diag.diag_get_ivar
627
+ - pyPDAF.PDAFomi.diag.diag_get_obs
628
+ - pyPDAF.PDAFomi.diag.diag_nobstypes
629
+ - pyPDAF.PDAFomi.diag.diag_obs_rmsd
630
+ - pyPDAF.PDAFomi.diag.diag_stats
631
+
632
+ ### pyPDAF.PDAFomi.internal
633
+ - pyPDAF.PDAFomi.internal.add_obs_error
634
+ - pyPDAF.PDAFomi.internal.check_dist2
635
+ - pyPDAF.PDAFomi.internal.check_dist2_loop
636
+ - pyPDAF.PDAFomi.internal.check_dist2_noniso
637
+ - pyPDAF.PDAFomi.internal.check_dist2_noniso_loop
638
+ - pyPDAF.PDAFomi.internal.cnt_dim_obs_l
639
+ - pyPDAF.PDAFomi.internal.cnt_dim_obs_l_noniso
640
+ - pyPDAF.PDAFomi.internal.comp_dist2
641
+ - pyPDAF.PDAFomi.internal.dealloc
642
+ - pyPDAF.PDAFomi.internal.diag_omit_by_inno
643
+ - pyPDAF.PDAFomi.internal.g2l_obs
644
+ - pyPDAF.PDAFomi.internal.g2l_obs_internal
645
+ - pyPDAF.PDAFomi.internal.gather_dim_obs_f
646
+ - pyPDAF.PDAFomi.internal.gather_obs_f2_flex
647
+ - pyPDAF.PDAFomi.internal.gather_obs_f_flex
648
+ - pyPDAF.PDAFomi.internal.gather_obsdims
649
+ - pyPDAF.PDAFomi.internal.get_local_ids_obs_f
650
+ - pyPDAF.PDAFomi.internal.init_obs_f
651
+ - pyPDAF.PDAFomi.internal.init_obs_l
652
+ - pyPDAF.PDAFomi.internal.init_obsarrays_l
653
+ - pyPDAF.PDAFomi.internal.init_obsarrays_l_noniso
654
+ - pyPDAF.PDAFomi.internal.init_obscovar
655
+ - pyPDAF.PDAFomi.internal.init_obserr_f
656
+ - pyPDAF.PDAFomi.internal.init_obsvar_f
657
+ - pyPDAF.PDAFomi.internal.init_obsvar_l
658
+ - pyPDAF.PDAFomi.internal.init_obsvars_f
659
+ - pyPDAF.PDAFomi.internal.likelihood
660
+ - pyPDAF.PDAFomi.internal.likelihood_hyb_l
661
+ - pyPDAF.PDAFomi.internal.likelihood_l
662
+ - pyPDAF.PDAFomi.internal.limit_obs_f
663
+ - pyPDAF.PDAFomi.internal.local_weight
664
+ - pyPDAF.PDAFomi.internal.obs_op_adj_gatheronly
665
+ - pyPDAF.PDAFomi.internal.obs_op_gatheronly
666
+ - pyPDAF.PDAFomi.internal.obsstats
667
+ - pyPDAF.PDAFomi.internal.obsstats_l
668
+ - pyPDAF.PDAFomi.internal.ocoord_all
669
+ - pyPDAF.PDAFomi.internal.omit_by_inno
670
+ - pyPDAF.PDAFomi.internal.omit_by_inno_l
671
+ - pyPDAF.PDAFomi.internal.prodrinva
672
+ - pyPDAF.PDAFomi.internal.prodrinva_hyb_l
673
+ - pyPDAF.PDAFomi.internal.prodrinva_l
674
+ - pyPDAF.PDAFomi.internal.set_globalobs
675
+ - pyPDAF.PDAFomi.internal.weights_l
676
+ - pyPDAF.PDAFomi.internal.weights_l_sgnl
677
+
678
+ ### pyPDAF.PDAFomi.legacy
679
+ - pyPDAF.PDAFomi.legacy.deallocate_obs
680
+ - pyPDAF.PDAFomi.legacy.init_dim_obs_l_iso_old
681
+ - pyPDAF.PDAFomi.legacy.init_dim_obs_l_noniso_locweights_old
682
+ - pyPDAF.PDAFomi.legacy.init_dim_obs_l_noniso_old
683
+ - pyPDAF.PDAFomi.legacy.localize_covar_iso
684
+ - pyPDAF.PDAFomi.legacy.localize_covar_noniso
685
+ - pyPDAF.PDAFomi.legacy.localize_covar_noniso_locweights
686
+ - pyPDAF.PDAFomi.legacy.localize_covar_serial_iso
687
+ - pyPDAF.PDAFomi.legacy.localize_covar_serial_noniso
688
+ - pyPDAF.PDAFomi.legacy.localize_covar_serial_noniso_locweights
689
+
690
+ ### pyPDAF.PDAFomi.assim
691
+ - pyPDAF.PDAFomi.assim.assimilate_3dvar
692
+ - pyPDAF.PDAFomi.assim.assimilate_3dvar_nondiagr
693
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_estkf
694
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_estkf_nondiagr
695
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_lestkf
696
+ - pyPDAF.PDAFomi.assim.assimilate_en3dvar_lestkf_nondiagr
697
+ - pyPDAF.PDAFomi.assim.assimilate_enkf_nondiagr
698
+ - pyPDAF.PDAFomi.assim.assimilate_ensrf
699
+ - pyPDAF.PDAFomi.assim.assimilate_global
700
+ - pyPDAF.PDAFomi.assim.assimilate_global_nondiagr
701
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_estkf
702
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_estkf_nondiagr
703
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_lestkf
704
+ - pyPDAF.PDAFomi.assim.assimilate_hyb3dvar_lestkf_nondiagr
705
+ - pyPDAF.PDAFomi.assim.assimilate_lenkf
706
+ - pyPDAF.PDAFomi.assim.assimilate_lenkf_nondiagr
707
+ - pyPDAF.PDAFomi.assim.assimilate_lknetf_nondiagr
708
+ - pyPDAF.PDAFomi.assim.assimilate_lnetf_nondiagr
709
+ - pyPDAF.PDAFomi.assim.assimilate_local
710
+ - pyPDAF.PDAFomi.assim.assimilate_local_nondiagr
711
+ - pyPDAF.PDAFomi.assim.assimilate_nonlin_nondiagr
712
+ - pyPDAF.PDAFomi.assim.generate_obs
713
+
714
+ ### pyPDAF.PDAFomi.put
715
+ - pyPDAF.PDAFomi.put.put_state_3dvar
716
+ - pyPDAF.PDAFomi.put.put_state_3dvar_nondiagr
717
+ - pyPDAF.PDAFomi.put.put_state_en3dvar_estkf
718
+ - pyPDAF.PDAFomi.put.put_state_en3dvar_estkf_nondiagr
719
+ - pyPDAF.PDAFomi.put.put_state_en3dvar_lestkf
720
+ - pyPDAF.PDAFomi.put.put_state_en3dvar_lestkf_nondiagr
721
+ - pyPDAF.PDAFomi.put.put_state_enkf_nondiagr
722
+ - pyPDAF.PDAFomi.put.put_state_ensrf
723
+ - pyPDAF.PDAFomi.put.put_state_generate_obs
724
+ - pyPDAF.PDAFomi.put.put_state_global
725
+ - pyPDAF.PDAFomi.put.put_state_global_nondiagr
726
+ - pyPDAF.PDAFomi.put.put_state_hyb3dvar_estkf
727
+ - pyPDAF.PDAFomi.put.put_state_hyb3dvar_estkf_nondiagr
728
+ - pyPDAF.PDAFomi.put.put_state_hyb3dvar_lestkf
729
+ - pyPDAF.PDAFomi.put.put_state_hyb3dvar_lestkf_nondiagr
730
+ - pyPDAF.PDAFomi.put.put_state_lenkf
731
+ - pyPDAF.PDAFomi.put.put_state_lenkf_nondiagr
732
+ - pyPDAF.PDAFomi.put.put_state_lknetf_nondiagr
733
+ - pyPDAF.PDAFomi.put.put_state_lnetf_nondiagr
734
+ - pyPDAF.PDAFomi.put.put_state_local
735
+ - pyPDAF.PDAFomi.put.put_state_local_nondiagr
736
+ - pyPDAF.PDAFomi.put.put_state_nonlin_nondiagr
737
+
738
+ ### pyPDAF.PDAFomi.setter
739
+ - pyPDAF.PDAFomi.setter.set_disttype
740
+ - pyPDAF.PDAFomi.setter.set_doassim
741
+ - pyPDAF.PDAFomi.setter.set_domainsize
742
+ - pyPDAF.PDAFomi.setter.set_icoeff_p
743
+ - pyPDAF.PDAFomi.setter.set_id_obs_p
744
+ - pyPDAF.PDAFomi.setter.set_inno_omit
745
+ - pyPDAF.PDAFomi.setter.set_inno_omit_ivar
746
+ - pyPDAF.PDAFomi.setter.set_name
747
+ - pyPDAF.PDAFomi.setter.set_ncoord
748
+ - pyPDAF.PDAFomi.setter.set_obs_err_type
749
+ - pyPDAF.PDAFomi.setter.set_use_global_obs
pyPDAF/source/docs/source/index.rst ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .. pyPDAF documentation master file, created by
2
+ sphinx-quickstart on Mon May 9 15:24:06 2022.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ pyPDAF - A Python interface to Parallel Data Assimilation Framework
7
+ ===================================================================
8
+ .. include:: introduction.md
9
+
10
+ .. toctree::
11
+ :maxdepth: 2
12
+ :caption: Contents:
13
+
14
+ install
15
+ naming_convention
16
+ parallel
17
+ develop
18
+ API
19
+ user_functions
20
+ hidden_functions
21
+ links
pyPDAF/source/docs/source/install.md ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Installation
3
+
4
+ There are two ways of installing pyPDAF.
5
+
6
+ ## Conda
7
+ The easiest approach is using `conda`. Currently, `pyPDAF` is available from
8
+ `conda` for `Windows`, `Linux` and `MacOS`. The installation can be obtained via:
9
+ ```bash
10
+ conda create -n pypdaf -c conda-forge yumengch::pypdaf
11
+ ```
12
+ After installation, `pyPDAF` can be used by activating the conda environment
13
+ `conda activate pypdaf`.
14
+
15
+ ## Source code
16
+ In some cases, it is desirable to compile pyPDAF so that one can use their
17
+ favourite compiler as well as MPI and BLAS implementation.
18
+
19
+ In this case, pyPDAF source code can be obtained from source
20
+ ```bash
21
+ git clone --recurse-submodules https://github.com/yumengch/pyPDAF.git
22
+ cd pyPDAF
23
+ ```
24
+
25
+ The package can be installed with:
26
+ ```bash
27
+ python -m pip install . -v \
28
+ --config-settings=setup-args="-Dblas_lib=[LIBS]" \
29
+ --config-settings=setup-args="-Dincdirs=[INCDIRS]" \
30
+ --config-settings=setup-args="-Dlibdirs=[LIBDIRS]" \
31
+ --config-settings=setup-args="-Dmpi_mod=MPIF90"^
32
+ --config-settings=setup-args="-Dbuildtype=release"
33
+ ```
34
+ Here, `LIBS`, `INCDIRS`, and `LIBDIRS` are elements of a list, separated by
35
+ `,` similar to a Python list.
36
+ - `LIBS` are all the required library names for BLAS libraries.
37
+ - `LIBDIRS` are directories of these libraries
38
+ - `INCDIRS` are include directories of libraries
39
+ - `MPIF90` is the path to `mpi.f90`. This is useful for the case where
40
+ `mpi.mod` is not directly provided but requires compiling by the user. This
41
+ is optional.
42
+
43
+ One can adjust the compiler, compiler and linker flags by changing environment
44
+ variables such as `CC`, `FC`, `CFLAGS` and `FCFLAGS`. See [flags](https://mesonbuild.com/Reference-tables.html#compiler-and-linker-flag-environment-variables) and [compiler](https://mesonbuild.com/Reference-tables.html#compiler-and-linker-selection-variables) table for references. One could also directly
45
+ modify [`meson.build`](https://github.com/yumengch/pyPDAF/blob/main/meson.build) which might require more knowledge of meson.
46
+
47
+ An example of installing pyPDAF in Linux or Mac:
48
+ ```bash
49
+ CC=mpicc FC=mpifort python -m pip install . -v -Cbuild-dir=build \
50
+ --config-settings=setup-args="-Dblas_lib=['openblas']" \
51
+ --config-settings=setup-args="-Dincdirs=['/usr/lib/']" \
52
+ --config-settings=setup-args="-Dlibdirs=['/usr/include']" \
53
+ --config-settings=setup-args="-Dbuildtype=release"
54
+ ```
55
+ In Windows, one can use
56
+ ```console
57
+ set CXX=clang-cl
58
+ set CC=clang-cl
59
+ set FC=flang-new
60
+ set MSMPI_INC=C:\Program Files (x86)\Microsoft SDKs\MPI\Include
61
+ set MSMPI_LIB64=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64
62
+
63
+ python -m pip install . -v ^
64
+ -Cbuild-dir=build --config-settings=setup-args="-Dblas_lib=openblas"^
65
+ --config-settings=setup-args="-Dincdirs="C:\Program Files (x86)\blas\include"^
66
+ --config-settings=setup-args="-Dlibdirs="C:\Program Files (x86)\blas\lib"^
67
+ --config-settings=setup-args="-Dmpi_mod=C:\Program Files (x86)\Microsoft SDKs\MPI\Include\mpi.f90"^
68
+ --config-settings=setup-args="-Dbuildtype=release"
69
+ ```
70
+ where the variable `MSMPI_INC` and `MSMPI_LIB64` are required environment
71
+ variable for using `MSMPI`.
72
+
73
+ Please [raise an issue](https://github.com/yumengch/pyPDAF/issues/new) if you
74
+ have any questions or problems with this.
pyPDAF/source/docs/source/introduction.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ pyPDAF is a Python interface to the `Parallel Data Assimilation Framwork (PDAF) <http://pdaf.awi.de/trac/wiki>`_ written in Fortran.
2
+ The latest pyPDAF supports PDAF-V3.0.
3
+
4
+ As an interface to PDAF, pyPDAF supports all PDAF functionalities. You can use pyPDAF to construct
5
+ a parallel ensemble data assimilation system purely in Python. The pyPDAF is designed as a framework
6
+ that defines the workflow of given DA algorithms. Considering the versatility of the software,
7
+ information on the model and observations are passed to the DA algorithms through user-supplied
8
+ functions. With pyPDAF, all user-supplied functions can be implemented in Python. We expect that
9
+ the coding of the user-supplied functions will be easier and more flexible than in Fortran due to
10
+ the rich Python ecosystem.
11
+
12
+ pyPDAF can be used with two modes:
13
+ - online mode: DA is performed without interrupting the model program. Here, the model code is
14
+ extended by calling PDAF functions to generate a single program. In online mode,
15
+ the filtering gets the model state and distributes the analysis to model by in-memory exchange.
16
+ This is the recommended mode for better efficiency.
17
+ - offline mode: DA is performed after the model program is finished. Here, a separate program
18
+ is generated to perform DA. In offline mode,
19
+ the filtering reads the model state from disk and writes the analysis to disk.
20
+
21
+
22
+ The potential applications of pyPDAF include:
23
+ - online DA systems with Python models, e.g., machine-learning models
24
+ - offline DA systems
25
+
26
+ This is a great tool for researchers who want to test and develop new DA systems.
27
+ Compared to Fortran systems, the efficiency is decreased mainly from user-supplied functions
28
+ and overhead for array conversions between Fortran and Python. The core DA algorithms are
29
+ as efficient as in PDAF. Note that, for computational
30
+ intensive user-supplied functions, the efficiency can be improved by using just-in-time compilation
31
+ tools such as `numba`.
32
+
33
+ To get started, we highly recommend to start from the Jupyter notebook
34
+ example for
35
+ `a serial ensemble DA system using a simple wave model <https://github.com/yumengch/pyPDAF/blob/main/tutorials/tutorial1_serial.ipynb>`_.
36
+
37
+ We also provide more structured offline and online examples. One can adapt these examples based on their needs
38
+ - `A parallel online ensemble DA system using a simple wave model <https://github.com/yumengch/pyPDAF/tree/main/example/online>`_
39
+ - `A parallel offline ensemble DA system using a simple wave model <https://github.com/yumengch/pyPDAF/tree/main/example/offline>`_