vortex-nwp 2.0.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. vortex/__init__.py +135 -0
  2. vortex/algo/__init__.py +12 -0
  3. vortex/algo/components.py +2136 -0
  4. vortex/algo/mpitools.py +1648 -0
  5. vortex/algo/mpitools_templates/envelope_wrapper_default.tpl +27 -0
  6. vortex/algo/mpitools_templates/envelope_wrapper_mpiauto.tpl +29 -0
  7. vortex/algo/mpitools_templates/wrapstd_wrapper_default.tpl +18 -0
  8. vortex/algo/serversynctools.py +170 -0
  9. vortex/config.py +115 -0
  10. vortex/data/__init__.py +13 -0
  11. vortex/data/abstractstores.py +1572 -0
  12. vortex/data/containers.py +780 -0
  13. vortex/data/contents.py +596 -0
  14. vortex/data/executables.py +284 -0
  15. vortex/data/flow.py +113 -0
  16. vortex/data/geometries.ini +2689 -0
  17. vortex/data/geometries.py +703 -0
  18. vortex/data/handlers.py +1021 -0
  19. vortex/data/outflow.py +67 -0
  20. vortex/data/providers.py +465 -0
  21. vortex/data/resources.py +201 -0
  22. vortex/data/stores.py +1271 -0
  23. vortex/gloves.py +282 -0
  24. vortex/layout/__init__.py +27 -0
  25. vortex/layout/appconf.py +109 -0
  26. vortex/layout/contexts.py +511 -0
  27. vortex/layout/dataflow.py +1069 -0
  28. vortex/layout/jobs.py +1276 -0
  29. vortex/layout/monitor.py +833 -0
  30. vortex/layout/nodes.py +1424 -0
  31. vortex/layout/subjobs.py +464 -0
  32. vortex/nwp/__init__.py +11 -0
  33. vortex/nwp/algo/__init__.py +12 -0
  34. vortex/nwp/algo/assim.py +483 -0
  35. vortex/nwp/algo/clim.py +920 -0
  36. vortex/nwp/algo/coupling.py +609 -0
  37. vortex/nwp/algo/eda.py +632 -0
  38. vortex/nwp/algo/eps.py +613 -0
  39. vortex/nwp/algo/forecasts.py +745 -0
  40. vortex/nwp/algo/fpserver.py +927 -0
  41. vortex/nwp/algo/ifsnaming.py +403 -0
  42. vortex/nwp/algo/ifsroot.py +311 -0
  43. vortex/nwp/algo/monitoring.py +202 -0
  44. vortex/nwp/algo/mpitools.py +554 -0
  45. vortex/nwp/algo/odbtools.py +974 -0
  46. vortex/nwp/algo/oopsroot.py +735 -0
  47. vortex/nwp/algo/oopstests.py +186 -0
  48. vortex/nwp/algo/request.py +579 -0
  49. vortex/nwp/algo/stdpost.py +1285 -0
  50. vortex/nwp/data/__init__.py +12 -0
  51. vortex/nwp/data/assim.py +392 -0
  52. vortex/nwp/data/boundaries.py +261 -0
  53. vortex/nwp/data/climfiles.py +539 -0
  54. vortex/nwp/data/configfiles.py +149 -0
  55. vortex/nwp/data/consts.py +929 -0
  56. vortex/nwp/data/ctpini.py +133 -0
  57. vortex/nwp/data/diagnostics.py +181 -0
  58. vortex/nwp/data/eda.py +148 -0
  59. vortex/nwp/data/eps.py +383 -0
  60. vortex/nwp/data/executables.py +1039 -0
  61. vortex/nwp/data/fields.py +96 -0
  62. vortex/nwp/data/gridfiles.py +308 -0
  63. vortex/nwp/data/logs.py +551 -0
  64. vortex/nwp/data/modelstates.py +334 -0
  65. vortex/nwp/data/monitoring.py +220 -0
  66. vortex/nwp/data/namelists.py +644 -0
  67. vortex/nwp/data/obs.py +748 -0
  68. vortex/nwp/data/oopsexec.py +72 -0
  69. vortex/nwp/data/providers.py +182 -0
  70. vortex/nwp/data/query.py +217 -0
  71. vortex/nwp/data/stores.py +147 -0
  72. vortex/nwp/data/surfex.py +338 -0
  73. vortex/nwp/syntax/__init__.py +9 -0
  74. vortex/nwp/syntax/stdattrs.py +375 -0
  75. vortex/nwp/tools/__init__.py +10 -0
  76. vortex/nwp/tools/addons.py +35 -0
  77. vortex/nwp/tools/agt.py +55 -0
  78. vortex/nwp/tools/bdap.py +48 -0
  79. vortex/nwp/tools/bdcp.py +38 -0
  80. vortex/nwp/tools/bdm.py +21 -0
  81. vortex/nwp/tools/bdmp.py +49 -0
  82. vortex/nwp/tools/conftools.py +1311 -0
  83. vortex/nwp/tools/drhook.py +62 -0
  84. vortex/nwp/tools/grib.py +268 -0
  85. vortex/nwp/tools/gribdiff.py +99 -0
  86. vortex/nwp/tools/ifstools.py +163 -0
  87. vortex/nwp/tools/igastuff.py +249 -0
  88. vortex/nwp/tools/mars.py +56 -0
  89. vortex/nwp/tools/odb.py +548 -0
  90. vortex/nwp/tools/partitioning.py +234 -0
  91. vortex/nwp/tools/satrad.py +56 -0
  92. vortex/nwp/util/__init__.py +6 -0
  93. vortex/nwp/util/async.py +184 -0
  94. vortex/nwp/util/beacon.py +40 -0
  95. vortex/nwp/util/diffpygram.py +359 -0
  96. vortex/nwp/util/ens.py +198 -0
  97. vortex/nwp/util/hooks.py +128 -0
  98. vortex/nwp/util/taskdeco.py +81 -0
  99. vortex/nwp/util/usepygram.py +591 -0
  100. vortex/nwp/util/usetnt.py +87 -0
  101. vortex/proxy.py +6 -0
  102. vortex/sessions.py +341 -0
  103. vortex/syntax/__init__.py +9 -0
  104. vortex/syntax/stdattrs.py +628 -0
  105. vortex/syntax/stddeco.py +176 -0
  106. vortex/toolbox.py +982 -0
  107. vortex/tools/__init__.py +11 -0
  108. vortex/tools/actions.py +457 -0
  109. vortex/tools/addons.py +297 -0
  110. vortex/tools/arm.py +76 -0
  111. vortex/tools/compression.py +322 -0
  112. vortex/tools/date.py +20 -0
  113. vortex/tools/ddhpack.py +10 -0
  114. vortex/tools/delayedactions.py +672 -0
  115. vortex/tools/env.py +513 -0
  116. vortex/tools/folder.py +663 -0
  117. vortex/tools/grib.py +559 -0
  118. vortex/tools/lfi.py +746 -0
  119. vortex/tools/listings.py +354 -0
  120. vortex/tools/names.py +575 -0
  121. vortex/tools/net.py +1790 -0
  122. vortex/tools/odb.py +10 -0
  123. vortex/tools/parallelism.py +336 -0
  124. vortex/tools/prestaging.py +186 -0
  125. vortex/tools/rawfiles.py +10 -0
  126. vortex/tools/schedulers.py +413 -0
  127. vortex/tools/services.py +871 -0
  128. vortex/tools/storage.py +1061 -0
  129. vortex/tools/surfex.py +61 -0
  130. vortex/tools/systems.py +3396 -0
  131. vortex/tools/targets.py +384 -0
  132. vortex/util/__init__.py +9 -0
  133. vortex/util/config.py +1071 -0
  134. vortex/util/empty.py +24 -0
  135. vortex/util/helpers.py +184 -0
  136. vortex/util/introspection.py +63 -0
  137. vortex/util/iosponge.py +76 -0
  138. vortex/util/roles.py +51 -0
  139. vortex/util/storefunctions.py +103 -0
  140. vortex/util/structs.py +26 -0
  141. vortex/util/worker.py +150 -0
  142. vortex_nwp-2.0.0b1.dist-info/LICENSE +517 -0
  143. vortex_nwp-2.0.0b1.dist-info/METADATA +50 -0
  144. vortex_nwp-2.0.0b1.dist-info/RECORD +146 -0
  145. vortex_nwp-2.0.0b1.dist-info/WHEEL +5 -0
  146. vortex_nwp-2.0.0b1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,403 @@
1
+ """
2
+ Ensemble of classes that deal with input/output filenames for IFS/Arpege related
3
+ binaries (those that inherits from :class:`IFSParallel`).
4
+
5
+ Since input/output names may vary depending on the code's cycle, the configuration
6
+ number, or basically anything that might emerge from the mind of a twisted
7
+ developer... :mod:`footprints` is used to find out the most appropriate name
8
+ depending on various things:
9
+
10
+ * The model name (e.g. Arpege, Arome, Surfex)
11
+ * The file format (e.g. FA, GRIB)
12
+ * The binary cycle number (e.g. cy42_op2)
13
+ * The configuration number (e.g. 1, 701)
14
+ * The experiment name (e.g; FCST, CANS)
15
+
16
+ An additional attribute *kind* is mandatory, it helps to describe which type of
17
+ input/output file is targeted. The developer can also add customised attributes as
18
+ she/he may see fit.
19
+
20
+ The base class for any object dealing with IFS/Arpege file names is
21
+ :class:`IFSNamingConvention`. The "ifsnamingconv" footprints' collector is used.
22
+
23
+ Do not create :class:`IFSNamingConvention` objects directly. Instead, use the
24
+ :meth:`IFSParallel.naming_convention` method.
25
+ """
26
+
27
+ import math
28
+
29
+ import footprints
30
+
31
+ from vortex.syntax.stdattrs import model, actualfmt
32
+ from ..syntax.stdattrs import arpifs_cycle
33
+
34
+ #: No automatic export
35
+ __all__ = []
36
+
37
+
38
+ # Base & Generic classes
39
+ # ##############################################################################
40
+
41
+ class IFSNamingConvention(footprints.FootprintBase):
42
+ """Abstract class for any object representing an IFS/Arpege naming scheme."""
43
+
44
+ _abstract = True
45
+ _collector = ('ifsnamingconv', )
46
+ _footprint = [
47
+ model,
48
+ actualfmt,
49
+ arpifs_cycle,
50
+ dict(
51
+ attr = dict(
52
+ kind = dict(
53
+ info = 'The type of targeted input/output file'
54
+ ),
55
+ conf = dict(
56
+ info = 'IFS/Arpege configuration number',
57
+ type = int,
58
+ ),
59
+ xpname = dict(
60
+ info = 'IFS/Arpege experiment name',
61
+ ),
62
+ actualfmt = dict(
63
+ info = 'The target file format',
64
+ optional = True,
65
+ )
66
+ )
67
+ )
68
+ ]
69
+
70
+ def _naming_format_string(self, **kwargs):
71
+ """Return the format string that will be used to generate the filename."""
72
+ raise NotImplementedError()
73
+
74
+ def __call__(self, **kwargs):
75
+ return self._naming_format_string(** kwargs).format(xpname=self.xpname,
76
+ conf=self.conf,
77
+ fmt=self.actualfmt,
78
+ model=self.model,
79
+ ** kwargs)
80
+
81
+
82
+ # Activate the footprint's fasttrack on the ifsnamingconv collector
83
+ ncollect = footprints.collectors.get(tag='ifsnamingconv')
84
+ ncollect.fasttrack = ('kind', )
85
+ del ncollect
86
+
87
+
88
+ class IFSHardWiredNamingConvention(IFSNamingConvention):
89
+ """
90
+ A very basic object where the user can provide the format string on its own
91
+ using the *namingformat*. For debugging only...
92
+ """
93
+
94
+ _footprint = dict(
95
+ attr = dict(
96
+ namingformat = dict()
97
+ ),
98
+ priority = dict(
99
+ level = footprints.priorities.top.TOOLBOX # @UndefinedVariable
100
+ )
101
+ )
102
+
103
+ def _naming_format_string(self, **kwargs):
104
+ return self.namingformat
105
+
106
+
107
+ # Climatology files names
108
+ # ##############################################################################
109
+
110
+ class ModelClimName(IFSNamingConvention):
111
+ """An IFS/Arpege model clim."""
112
+
113
+ _footprint = dict(
114
+ attr = dict(
115
+ kind = dict(
116
+ values = ['modelclim', ],
117
+ ),
118
+ conf = dict(
119
+ outcast = [701, ],
120
+ ),
121
+ model = dict(
122
+ outcast = ['surfex', ]
123
+ )
124
+ )
125
+ )
126
+
127
+ def _naming_format_string(self, **kwargs):
128
+ return 'Const.Clim'
129
+
130
+
131
+ class SurfexClimName(IFSNamingConvention):
132
+ """A Surfex model clim."""
133
+
134
+ _footprint = dict(
135
+ attr = dict(
136
+ kind = dict(
137
+ values = ['modelclim', ],
138
+ ),
139
+ model = dict(
140
+ values = ['surfex', ]
141
+ )
142
+ )
143
+ )
144
+
145
+ def _naming_format_string(self, **kwargs):
146
+ return 'Const.Clim.sfx'
147
+
148
+
149
+ class TargetClimName(IFSNamingConvention):
150
+ """A BDAP clim file or a target domain IFS/Arpege clim file."""
151
+
152
+ _footprint = dict(
153
+ attr = dict(
154
+ kind = dict(
155
+ values = ['targetclim', ],
156
+ ),
157
+ model = dict(
158
+ outcast = ['surfex', ]
159
+ )
160
+ )
161
+ )
162
+
163
+ def _naming_format_string(self, **kwargs):
164
+ return 'const.clim.{area:s}'
165
+
166
+
167
+ class SurfexTargetClimName(IFSNamingConvention):
168
+ """A target domain Surfex clim file."""
169
+
170
+ _footprint = dict(
171
+ attr = dict(
172
+ kind = dict(
173
+ values = ['targetclim', ],
174
+ ),
175
+ model = dict(
176
+ values = ['surfex', ]
177
+ )
178
+ )
179
+ )
180
+
181
+ def _naming_format_string(self, **kwargs):
182
+ return 'const.clim.sfx.{area:s}'
183
+
184
+
185
+ class CanariModelClimName(IFSNamingConvention):
186
+ """An IFS/Arpege model clim (specific naming for Canari)."""
187
+
188
+ _footprint = dict(
189
+ attr = dict(
190
+ kind = dict(
191
+ values = ['modelclim', ],
192
+ ),
193
+ conf = dict(
194
+ values = [701, ],
195
+ ),
196
+ model = dict(
197
+ outcast = ['surfex', ]
198
+ )
199
+ )
200
+ )
201
+
202
+ def _naming_format_string(self, **kwargs):
203
+ return 'ICMSH{xpname:s}CLIM'
204
+
205
+
206
+ class CanariClosestModelClimName(CanariModelClimName):
207
+ """An IFS/Arpege model clim for the closest month (specific naming for Canari)."""
208
+
209
+ _footprint = dict(
210
+ attr = dict(
211
+ kind = dict(
212
+ values = ['closest_modelclim', ],
213
+ ),
214
+ )
215
+ )
216
+
217
+ def _naming_format_string(self, **kwargs):
218
+ return 'ICMSH{xpname:s}CLI2'
219
+
220
+
221
+ # Initial conditions file names
222
+ # ##############################################################################
223
+
224
+ class InitialContionsName(IFSNamingConvention):
225
+
226
+ _footprint = dict(
227
+ attr = dict(
228
+ kind = dict(
229
+ values = ['ic', ],
230
+ ),
231
+ model = dict(
232
+ outcast = ['surfex', ]
233
+ )
234
+ )
235
+ )
236
+
237
+ def _naming_format_string(self, **kwargs):
238
+ return 'ICMSH{xpname:s}INIT'
239
+
240
+
241
+ class SurfexInitialContionsName(IFSNamingConvention):
242
+
243
+ _footprint = dict(
244
+ attr = dict(
245
+ kind = dict(
246
+ values = ['ic', ],
247
+ ),
248
+ model = dict(
249
+ values = ['surfex', ]
250
+ )
251
+ )
252
+ )
253
+
254
+ def _naming_format_string(self, **kwargs):
255
+ return 'ICMSH{xpname:s}INIT.sfx'
256
+
257
+
258
+ class IauAnalysisName(IFSNamingConvention):
259
+
260
+ _footprint = dict(
261
+ attr = dict(
262
+ kind = dict(
263
+ values = ['iau_analysis', ],
264
+ ),
265
+ model = dict(
266
+ outcast = ['surfex', ]
267
+ )
268
+ )
269
+ )
270
+
271
+ def _naming_format_string(self, **kwargs):
272
+ return 'ICIAU{xpname:s}IN{number:02d}'
273
+
274
+
275
+ class IauBackgroundName(IFSNamingConvention):
276
+
277
+ _footprint = dict(
278
+ attr = dict(
279
+ kind = dict(
280
+ values = ['iau_background', ],
281
+ ),
282
+ model = dict(
283
+ outcast = ['surfex', ]
284
+ )
285
+ )
286
+ )
287
+
288
+ def _naming_format_string(self, **kwargs):
289
+ return 'ICIAU{xpname:s}BK{number:02d}'
290
+
291
+
292
+ # Lateral Boundary Conditions Files
293
+ # ##############################################################################
294
+
295
+ class LAMBoundaryConditionsName(IFSNamingConvention):
296
+
297
+ _footprint = dict(
298
+ attr = dict(
299
+ kind = dict(
300
+ values = ['lbc', ],
301
+ ),
302
+ )
303
+ )
304
+
305
+ def _naming_format_string(self, **kwargs):
306
+ return 'ELSCF{xpname:s}ALBC{number:03d}'
307
+
308
+
309
+ # Strange files used in the EDA
310
+ # ##############################################################################
311
+
312
+
313
+ class IfsEdaInputName(IFSNamingConvention):
314
+
315
+ _abstract = True
316
+ _footprint = dict(
317
+ attr = dict(
318
+ kind = dict(
319
+ values = ['edainput', ],
320
+ ),
321
+ variant = dict(
322
+ values = ['infl', 'infl_factor', 'mean', 'covb', ],
323
+ ),
324
+ totalnumber = dict(
325
+ info = 'The total number of input files',
326
+ type = int,
327
+ optional = True,
328
+ ),
329
+ )
330
+ )
331
+
332
+ @property
333
+ def _number_fmt(self):
334
+ if self.totalnumber:
335
+ ndigits = max(int(math.floor(math.log10(self.totalnumber))) + 1, 3)
336
+ else:
337
+ ndigits = 3
338
+ return '{number:0' + str(ndigits) + 'd}'
339
+
340
+
341
+ class IfsEdaArpegeFaInputName(IfsEdaInputName):
342
+
343
+ _footprint = dict(
344
+ attr = dict(
345
+ model = dict(
346
+ values = ['arpege', ]
347
+ ),
348
+ actualfmt = dict(
349
+ values = ['fa', ]
350
+ )
351
+ )
352
+ )
353
+
354
+ def _naming_format_string(self, **kwargs):
355
+ return 'FAMEMBER_' + self._number_fmt
356
+
357
+
358
+ class IfsEdaArpegeGribInputName(IfsEdaInputName):
359
+
360
+ _footprint = dict(
361
+ attr = dict(
362
+ model = dict(
363
+ values = ['arpege', ]
364
+ ),
365
+ actualfmt = dict(
366
+ values = ['grib', ]
367
+ )
368
+ )
369
+ )
370
+
371
+ def _naming_format_string(self, **kwargs):
372
+ return 'GRIBERm' + self._number_fmt
373
+
374
+
375
+ class IfsEdaAromeInputName(IfsEdaInputName):
376
+
377
+ _footprint = dict(
378
+ attr = dict(
379
+ model = dict(
380
+ values = ['arome', ]
381
+ ),
382
+ )
383
+ )
384
+
385
+ def _naming_format_string(self, **kwargs):
386
+ return 'ELSCF{xpname:s}ALBC' + self._number_fmt
387
+
388
+
389
+ class IfsEdaOutputName(IFSNamingConvention):
390
+
391
+ _footprint = dict(
392
+ attr = dict(
393
+ kind = dict(
394
+ values = ['edaoutput', ],
395
+ ),
396
+ variant = dict(
397
+ values = ['infl', 'infl_factor', 'mean', 'covb', ],
398
+ ),
399
+ )
400
+ )
401
+
402
+ def _naming_format_string(self, **kwargs):
403
+ return 'ICMSH{xpname:s}+{term.fmth}_m{number:03d}'