vortex-nwp 2.0.0__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 (144) hide show
  1. vortex/__init__.py +159 -0
  2. vortex/algo/__init__.py +13 -0
  3. vortex/algo/components.py +2462 -0
  4. vortex/algo/mpitools.py +1953 -0
  5. vortex/algo/mpitools_templates/__init__.py +1 -0
  6. vortex/algo/mpitools_templates/envelope_wrapper_default.tpl +27 -0
  7. vortex/algo/mpitools_templates/envelope_wrapper_mpiauto.tpl +29 -0
  8. vortex/algo/mpitools_templates/wrapstd_wrapper_default.tpl +18 -0
  9. vortex/algo/serversynctools.py +171 -0
  10. vortex/config.py +112 -0
  11. vortex/data/__init__.py +19 -0
  12. vortex/data/abstractstores.py +1510 -0
  13. vortex/data/containers.py +835 -0
  14. vortex/data/contents.py +622 -0
  15. vortex/data/executables.py +275 -0
  16. vortex/data/flow.py +119 -0
  17. vortex/data/geometries.ini +2689 -0
  18. vortex/data/geometries.py +799 -0
  19. vortex/data/handlers.py +1230 -0
  20. vortex/data/outflow.py +67 -0
  21. vortex/data/providers.py +487 -0
  22. vortex/data/resources.py +207 -0
  23. vortex/data/stores.py +1390 -0
  24. vortex/data/sync_templates/__init__.py +0 -0
  25. vortex/gloves.py +309 -0
  26. vortex/layout/__init__.py +20 -0
  27. vortex/layout/contexts.py +577 -0
  28. vortex/layout/dataflow.py +1220 -0
  29. vortex/layout/monitor.py +969 -0
  30. vortex/nwp/__init__.py +14 -0
  31. vortex/nwp/algo/__init__.py +21 -0
  32. vortex/nwp/algo/assim.py +537 -0
  33. vortex/nwp/algo/clim.py +1086 -0
  34. vortex/nwp/algo/coupling.py +831 -0
  35. vortex/nwp/algo/eda.py +840 -0
  36. vortex/nwp/algo/eps.py +785 -0
  37. vortex/nwp/algo/forecasts.py +886 -0
  38. vortex/nwp/algo/fpserver.py +1303 -0
  39. vortex/nwp/algo/ifsnaming.py +463 -0
  40. vortex/nwp/algo/ifsroot.py +404 -0
  41. vortex/nwp/algo/monitoring.py +263 -0
  42. vortex/nwp/algo/mpitools.py +694 -0
  43. vortex/nwp/algo/odbtools.py +1258 -0
  44. vortex/nwp/algo/oopsroot.py +916 -0
  45. vortex/nwp/algo/oopstests.py +220 -0
  46. vortex/nwp/algo/request.py +660 -0
  47. vortex/nwp/algo/stdpost.py +1641 -0
  48. vortex/nwp/data/__init__.py +30 -0
  49. vortex/nwp/data/assim.py +380 -0
  50. vortex/nwp/data/boundaries.py +314 -0
  51. vortex/nwp/data/climfiles.py +521 -0
  52. vortex/nwp/data/configfiles.py +153 -0
  53. vortex/nwp/data/consts.py +954 -0
  54. vortex/nwp/data/ctpini.py +149 -0
  55. vortex/nwp/data/diagnostics.py +209 -0
  56. vortex/nwp/data/eda.py +147 -0
  57. vortex/nwp/data/eps.py +432 -0
  58. vortex/nwp/data/executables.py +1045 -0
  59. vortex/nwp/data/fields.py +111 -0
  60. vortex/nwp/data/gridfiles.py +380 -0
  61. vortex/nwp/data/logs.py +584 -0
  62. vortex/nwp/data/modelstates.py +363 -0
  63. vortex/nwp/data/monitoring.py +193 -0
  64. vortex/nwp/data/namelists.py +696 -0
  65. vortex/nwp/data/obs.py +840 -0
  66. vortex/nwp/data/oopsexec.py +74 -0
  67. vortex/nwp/data/providers.py +207 -0
  68. vortex/nwp/data/query.py +206 -0
  69. vortex/nwp/data/stores.py +160 -0
  70. vortex/nwp/data/surfex.py +337 -0
  71. vortex/nwp/syntax/__init__.py +9 -0
  72. vortex/nwp/syntax/stdattrs.py +437 -0
  73. vortex/nwp/tools/__init__.py +10 -0
  74. vortex/nwp/tools/addons.py +40 -0
  75. vortex/nwp/tools/agt.py +67 -0
  76. vortex/nwp/tools/bdap.py +59 -0
  77. vortex/nwp/tools/bdcp.py +41 -0
  78. vortex/nwp/tools/bdm.py +24 -0
  79. vortex/nwp/tools/bdmp.py +54 -0
  80. vortex/nwp/tools/conftools.py +1661 -0
  81. vortex/nwp/tools/drhook.py +66 -0
  82. vortex/nwp/tools/grib.py +294 -0
  83. vortex/nwp/tools/gribdiff.py +104 -0
  84. vortex/nwp/tools/ifstools.py +203 -0
  85. vortex/nwp/tools/igastuff.py +273 -0
  86. vortex/nwp/tools/mars.py +68 -0
  87. vortex/nwp/tools/odb.py +657 -0
  88. vortex/nwp/tools/partitioning.py +258 -0
  89. vortex/nwp/tools/satrad.py +71 -0
  90. vortex/nwp/util/__init__.py +6 -0
  91. vortex/nwp/util/async.py +212 -0
  92. vortex/nwp/util/beacon.py +40 -0
  93. vortex/nwp/util/diffpygram.py +447 -0
  94. vortex/nwp/util/ens.py +279 -0
  95. vortex/nwp/util/hooks.py +139 -0
  96. vortex/nwp/util/taskdeco.py +85 -0
  97. vortex/nwp/util/usepygram.py +697 -0
  98. vortex/nwp/util/usetnt.py +101 -0
  99. vortex/proxy.py +6 -0
  100. vortex/sessions.py +374 -0
  101. vortex/syntax/__init__.py +9 -0
  102. vortex/syntax/stdattrs.py +867 -0
  103. vortex/syntax/stddeco.py +185 -0
  104. vortex/toolbox.py +1117 -0
  105. vortex/tools/__init__.py +20 -0
  106. vortex/tools/actions.py +523 -0
  107. vortex/tools/addons.py +316 -0
  108. vortex/tools/arm.py +96 -0
  109. vortex/tools/compression.py +325 -0
  110. vortex/tools/date.py +27 -0
  111. vortex/tools/ddhpack.py +10 -0
  112. vortex/tools/delayedactions.py +782 -0
  113. vortex/tools/env.py +541 -0
  114. vortex/tools/folder.py +834 -0
  115. vortex/tools/grib.py +738 -0
  116. vortex/tools/lfi.py +953 -0
  117. vortex/tools/listings.py +423 -0
  118. vortex/tools/names.py +637 -0
  119. vortex/tools/net.py +2124 -0
  120. vortex/tools/odb.py +10 -0
  121. vortex/tools/parallelism.py +368 -0
  122. vortex/tools/prestaging.py +210 -0
  123. vortex/tools/rawfiles.py +10 -0
  124. vortex/tools/schedulers.py +480 -0
  125. vortex/tools/services.py +940 -0
  126. vortex/tools/storage.py +996 -0
  127. vortex/tools/surfex.py +61 -0
  128. vortex/tools/systems.py +3976 -0
  129. vortex/tools/targets.py +440 -0
  130. vortex/util/__init__.py +9 -0
  131. vortex/util/config.py +1122 -0
  132. vortex/util/empty.py +24 -0
  133. vortex/util/helpers.py +216 -0
  134. vortex/util/introspection.py +69 -0
  135. vortex/util/iosponge.py +80 -0
  136. vortex/util/roles.py +49 -0
  137. vortex/util/storefunctions.py +129 -0
  138. vortex/util/structs.py +26 -0
  139. vortex/util/worker.py +162 -0
  140. vortex_nwp-2.0.0.dist-info/METADATA +67 -0
  141. vortex_nwp-2.0.0.dist-info/RECORD +144 -0
  142. vortex_nwp-2.0.0.dist-info/WHEEL +5 -0
  143. vortex_nwp-2.0.0.dist-info/licenses/LICENSE +517 -0
  144. vortex_nwp-2.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1045 @@
1
+ """
2
+ Various Resources for executables used in NWP.
3
+ """
4
+
5
+ import vortex
6
+
7
+ from vortex.data.executables import (
8
+ Script,
9
+ GnuScript,
10
+ BlackBox,
11
+ NWPModel,
12
+ SurfaceModel,
13
+ OceanographicModel,
14
+ )
15
+ from ..syntax.stdattrs import (
16
+ gvar,
17
+ arpifs_cycle,
18
+ gmkpack_compiler_identification_deco,
19
+ executable_flavour_deco,
20
+ )
21
+ from ..syntax.stdattrs import ArpIfsSimplifiedCycle
22
+
23
+ #: No automatic export
24
+ __all__ = []
25
+
26
+
27
+ def gmkpack_bin_deco(cls):
28
+ """Add the necessary method to look into gmkpack directories."""
29
+
30
+ def guess_binary_sources(self, provider):
31
+ """Return the sources location baseld on gmkpack layout."""
32
+ sh = vortex.ticket().sh
33
+ srcdirs = []
34
+ if provider.realkind == "remote" and provider.tube in (
35
+ "file",
36
+ "symlink",
37
+ ):
38
+ packroot = sh.path.dirname(provider.pathname(self))
39
+ srcroot = sh.path.join(packroot, "src")
40
+ if sh.path.exists(srcroot):
41
+ insrc = sh.listdir(srcroot)
42
+ if "local" in insrc:
43
+ srcdirs.append("local")
44
+ for inter in [
45
+ d
46
+ for d in sorted(insrc, reverse=True)
47
+ if d.startswith("inter")
48
+ ]:
49
+ srcdirs.append(inter)
50
+ if "main" in insrc:
51
+ srcdirs.append("main")
52
+ srcdirs = [sh.path.join(srcroot, d) for d in srcdirs]
53
+ return srcdirs
54
+
55
+ cls.guess_binary_sources = guess_binary_sources
56
+ return cls
57
+
58
+
59
+ @gmkpack_bin_deco
60
+ class IFSModel(NWPModel):
61
+ """Yet an other IFS Model."""
62
+
63
+ _footprint = [
64
+ arpifs_cycle,
65
+ executable_flavour_deco,
66
+ gmkpack_compiler_identification_deco,
67
+ gvar,
68
+ dict(
69
+ info="IFS Model",
70
+ attr=dict(
71
+ gvar=dict(default="master_[model]"),
72
+ kind=dict(
73
+ values=["ifsmodel", "mfmodel"],
74
+ ),
75
+ model=dict(
76
+ outcast=["aladin", "arome"],
77
+ ),
78
+ ),
79
+ ),
80
+ ]
81
+
82
+ @property
83
+ def realkind(self):
84
+ return "ifsmodel"
85
+
86
+ def iga_pathinfo(self):
87
+ """Standard path information for IGA inline cache."""
88
+ return dict(model=self.model)
89
+
90
+ def iga_basename(self):
91
+ """Standard expected basename for IGA inline cache."""
92
+ return "ARPEGE"
93
+
94
+ def command_line(
95
+ self,
96
+ model="arpifs",
97
+ vmodel="meteo",
98
+ name="XRUN",
99
+ conf=1,
100
+ timescheme="sli",
101
+ timestep=600,
102
+ fcterm=0,
103
+ fcunit="h",
104
+ ):
105
+ """
106
+ Build command line for execution as a single string.
107
+ Depending on the cycle it may returns nothing.
108
+ """
109
+ if self.cycle < "cy41":
110
+ return (
111
+ "-v{:s} -e{:s} -c{:d} -a{:s} -t{:g} -f{:s}{:d} -m{:s}".format(
112
+ vmodel,
113
+ name,
114
+ conf,
115
+ timescheme,
116
+ timestep,
117
+ fcunit,
118
+ fcterm,
119
+ model,
120
+ )
121
+ )
122
+ else:
123
+ return ""
124
+
125
+
126
+ class Arome(IFSModel):
127
+ """Dedicated to local area model."""
128
+
129
+ _footprint = dict(
130
+ info="ALADIN / AROME Local Area Model",
131
+ attr=dict(
132
+ model=dict(
133
+ values=["aladin", "arome"],
134
+ outcast=set(),
135
+ ),
136
+ ),
137
+ )
138
+
139
+ def command_line(self, **kw):
140
+ """Enforce aladin model option."""
141
+ kw.setdefault("model", "aladin")
142
+ return super().command_line(**kw)
143
+
144
+
145
+ class NemoModel(OceanographicModel):
146
+ """Any model from the NEMO community."""
147
+
148
+ _footprint = [
149
+ gvar,
150
+ dict(
151
+ info="NEMO",
152
+ attr=dict(
153
+ gvar=dict(default="master_[model]"),
154
+ kind=dict(
155
+ values=[
156
+ "nemomodel",
157
+ ],
158
+ ),
159
+ model=dict(
160
+ values=[
161
+ "nemo",
162
+ ],
163
+ ),
164
+ ),
165
+ ),
166
+ ]
167
+
168
+ @property
169
+ def realkind(self):
170
+ return "nemo"
171
+
172
+
173
+ @gmkpack_bin_deco
174
+ class Prep(BlackBox):
175
+ """A tool to interpolate Surfex files."""
176
+
177
+ _footprint = [
178
+ arpifs_cycle,
179
+ gvar,
180
+ dict(
181
+ info="Prep utility to interpolate Surfex files",
182
+ attr=dict(
183
+ gvar=dict(default="master_prep"),
184
+ kind=dict(
185
+ values=[
186
+ "prep",
187
+ ],
188
+ ),
189
+ ),
190
+ ),
191
+ ]
192
+
193
+ @property
194
+ def realkind(self):
195
+ return "prep"
196
+
197
+
198
+ @gmkpack_bin_deco
199
+ class PGD(BlackBox):
200
+ """A tool to create Surfex clim files."""
201
+
202
+ _footprint = [
203
+ gvar,
204
+ dict(
205
+ info="PGD utility to create Surfex clim files",
206
+ attr=dict(
207
+ gvar=dict(default="master_pgd"),
208
+ kind=dict(
209
+ values=[
210
+ "buildpgd",
211
+ ],
212
+ ),
213
+ ),
214
+ ),
215
+ ]
216
+
217
+ @property
218
+ def realkind(self):
219
+ return "buildpgd"
220
+
221
+
222
+ @gmkpack_bin_deco
223
+ class OfflineSurfex(SurfaceModel):
224
+ """Surfex executable."""
225
+
226
+ _footprint = [
227
+ gvar,
228
+ dict(
229
+ info="Surfex executable",
230
+ attr=dict(
231
+ gvar=dict(default="master_offline"),
232
+ kind=dict(
233
+ values=["offline", "soda"],
234
+ ),
235
+ model=dict(
236
+ values=[
237
+ "surfex",
238
+ ],
239
+ ),
240
+ ),
241
+ ),
242
+ ]
243
+
244
+ @property
245
+ def realkind(self):
246
+ return "offline"
247
+
248
+
249
+ @gmkpack_bin_deco
250
+ class ProGrid(BlackBox):
251
+ """A tool for grib conversion."""
252
+
253
+ _footprint = [
254
+ gvar,
255
+ dict(
256
+ info="ProGrid utility for grib conversion",
257
+ attr=dict(
258
+ gvar=dict(default="master_progrid"),
259
+ kind=dict(
260
+ values=["progrid", "gribtool"],
261
+ remap=dict(gribtool="progrid"),
262
+ ),
263
+ ),
264
+ ),
265
+ ]
266
+
267
+ @property
268
+ def realkind(self):
269
+ return "progrid"
270
+
271
+
272
+ @gmkpack_bin_deco
273
+ class ProTool(BlackBox):
274
+ """A tool for adding fields on FA objects."""
275
+
276
+ _footprint = [
277
+ gvar,
278
+ dict(
279
+ info="ProTool utility for field manipulation",
280
+ attr=dict(
281
+ gvar=dict(default="master_addsurf"),
282
+ kind=dict(
283
+ values=["protool", "addsurf"],
284
+ remap=dict(addsurf="protool"),
285
+ ),
286
+ ),
287
+ ),
288
+ ]
289
+
290
+ @property
291
+ def realkind(self):
292
+ return "protool"
293
+
294
+
295
+ @gmkpack_bin_deco
296
+ class SstNetcdf2Ascii(BlackBox):
297
+ """Change format of NetCDF sst files."""
298
+
299
+ _footprint = [
300
+ gvar,
301
+ dict(
302
+ info="Tool to change the format of NetCDF sst files",
303
+ attr=dict(
304
+ gvar=dict(default="master_sst_netcdf"),
305
+ kind=dict(
306
+ values=["sst_netcdf"],
307
+ ),
308
+ ),
309
+ ),
310
+ ]
311
+
312
+
313
+ @gmkpack_bin_deco
314
+ class SstGrb2Ascii(BlackBox):
315
+ """Transform sst grib files from the BDAP into ascii files."""
316
+
317
+ _footprint = [
318
+ gvar,
319
+ dict(
320
+ info="Tool to change the format of grib sst files",
321
+ attr=dict(
322
+ gvar=dict(default="master_lectbdap"),
323
+ kind=dict(
324
+ values=["lectbdap"],
325
+ ),
326
+ ),
327
+ ),
328
+ ]
329
+
330
+ def command_line(self, year, month, day, hour, lon, lat):
331
+ """Build the command line to launch the executable."""
332
+ return "-y{year} -m{month} -d{day} -r{hour} -o{lon} -a{lat}".format(
333
+ year=year, month=month, day=day, hour=hour, lon=lon, lat=lat
334
+ )
335
+
336
+
337
+ @gmkpack_bin_deco
338
+ class IceGrb2Ascii(BlackBox):
339
+ """Transform sea ice grib files into ascii files using the SeaIceLonLat file for coordinates."""
340
+
341
+ _footprint = [
342
+ gvar,
343
+ dict(
344
+ info="Ice_grib executable to convert sea ice grib files into ascii files",
345
+ attr=dict(
346
+ gvar=dict(default="master_ice_grb"),
347
+ kind=dict(values=["ice_grb"]),
348
+ ),
349
+ ),
350
+ ]
351
+
352
+
353
+ @gmkpack_bin_deco
354
+ class IceNCDF2Ascii(BlackBox):
355
+ """Transform sea ice NetCDF files into obsoul files."""
356
+
357
+ _footprint = [
358
+ gvar,
359
+ dict(
360
+ info="Ice_netcdf executable to convert sea ice NetCDF files into obsoul files",
361
+ attr=dict(
362
+ gvar=dict(default="master_ice_netcdf"),
363
+ kind=dict(values=["ice_netcdf"]),
364
+ ),
365
+ ),
366
+ ]
367
+
368
+ def command_line(self, file_in_hn, file_in_hs, param, file_out):
369
+ """Build the command line to launch the executable."""
370
+ return "{file_in_hn} {file_in_hs} {param} {file_out}".format(
371
+ file_in_hn=file_in_hn,
372
+ file_in_hs=file_in_hs,
373
+ param=param,
374
+ file_out=file_out,
375
+ )
376
+
377
+
378
+ class IOAssign(BlackBox):
379
+ """A tool for ODB pools mapping."""
380
+
381
+ _footprint = [
382
+ gvar,
383
+ dict(
384
+ info="ProTool utility for field manipulation",
385
+ attr=dict(
386
+ kind=dict(
387
+ values=["ioassign", "odbioassign"],
388
+ remap=dict(odbioassign="ioassign"),
389
+ ),
390
+ gvar=dict(default="master_ioassign"),
391
+ iotool=dict(
392
+ optional=True,
393
+ default="create_ioassign",
394
+ access="rwx",
395
+ ),
396
+ ),
397
+ ),
398
+ ]
399
+
400
+ @property
401
+ def realkind(self):
402
+ return "ioassign"
403
+
404
+
405
+ @gmkpack_bin_deco
406
+ class Batodb(BlackBox):
407
+ """A tool for conversion to ODB format."""
408
+
409
+ _footprint = [
410
+ arpifs_cycle,
411
+ gvar,
412
+ dict(
413
+ info="Batodb conversion program",
414
+ attr=dict(
415
+ kind=dict(
416
+ values=["bator", "batodb"],
417
+ remap=dict(bator="batodb"),
418
+ ),
419
+ gvar=dict(default="master_batodb"),
420
+ ),
421
+ ),
422
+ ]
423
+
424
+ @property
425
+ def realkind(self):
426
+ return "batodb"
427
+
428
+ def command_line(self, dataid=None, date=None):
429
+ """Build the command-line."""
430
+ cmdstuff = list()
431
+ if dataid == "hh" and date is not None:
432
+ cmdstuff.append("{0.hh:s}".format(date))
433
+ return " ".join(cmdstuff)
434
+
435
+
436
+ @gmkpack_bin_deco
437
+ class Odbtools(BlackBox):
438
+ """A tool for shuffle operations in ODB format."""
439
+
440
+ _footprint = [
441
+ gvar,
442
+ dict(
443
+ info="Odbtools shuffle program",
444
+ attr=dict(
445
+ kind=dict(
446
+ values=["odbtools"],
447
+ ),
448
+ gvar=dict(default="master_odbtools"),
449
+ ),
450
+ ),
451
+ ]
452
+
453
+ @property
454
+ def realkind(self):
455
+ return "odbtools"
456
+
457
+ def command_line(
458
+ self,
459
+ dbin="ECMA",
460
+ dbout="CCMA",
461
+ npool=1,
462
+ nslot=1,
463
+ fcma=None,
464
+ masksize=None,
465
+ date=None,
466
+ ):
467
+ """Build command line for execution as a single string."""
468
+ cmdline = "-i{:s} -o{:s} -b1 -a{:d} -T{:d}".format(
469
+ dbin.upper(), dbout.upper(), npool, nslot
470
+ )
471
+ if fcma is not None:
472
+ cmdline = cmdline + " -F{:s}".format(fcma.upper())
473
+ if masksize is not None:
474
+ cmdline = cmdline + " -n{:d}".format(int(masksize))
475
+ if date is not None:
476
+ cmdline = cmdline + " -B" + date.ymdh
477
+ return cmdline
478
+
479
+
480
+ @gmkpack_bin_deco
481
+ class FcqODB(BlackBox):
482
+ """A tool to calculate flags on observations."""
483
+
484
+ _footprint = [
485
+ gvar,
486
+ dict(
487
+ info="Flags calculation program",
488
+ attr=dict(
489
+ kind=dict(
490
+ values=["fcqodb"],
491
+ ),
492
+ gvar=dict(default="master_fcqodb"),
493
+ ),
494
+ ),
495
+ ]
496
+
497
+
498
+ @gmkpack_bin_deco
499
+ class VarBCTool(BlackBox):
500
+ """Well... a single minded binary for a quite explicite purpose."""
501
+
502
+ _footprint = [
503
+ gvar,
504
+ dict(
505
+ info="VarBC merger program",
506
+ attr=dict(
507
+ kind=dict(
508
+ values=["varbctool"],
509
+ ),
510
+ gvar=dict(default="master_merge_varbc"),
511
+ ),
512
+ ),
513
+ ]
514
+
515
+ @property
516
+ def realkind(self):
517
+ return "varbctool"
518
+
519
+
520
+ class LopezMix(BlackBox):
521
+ """Some mixture for surface fields during the 3DVar assimilation process."""
522
+
523
+ _footprint = [
524
+ gvar,
525
+ dict(
526
+ info="Surface mix",
527
+ attr=dict(
528
+ kind=dict(
529
+ values=["lopezmix", "lopez", "mastsurf", "surfmix"],
530
+ remap=dict(autoremap="first"),
531
+ ),
532
+ gvar=dict(default="master_surfmix"),
533
+ ),
534
+ ),
535
+ ]
536
+
537
+ @property
538
+ def realkind(self):
539
+ return "lopezmix"
540
+
541
+
542
+ class MasterDiag(BlackBox):
543
+ """Abstract class for a binary to compute a diagnostic with some gribs."""
544
+
545
+ _abstract = True
546
+ _footprint = [
547
+ arpifs_cycle,
548
+ gvar,
549
+ dict(
550
+ info="MasterDiag abstract class utility for diagnostics computation",
551
+ attr=dict(
552
+ gvar=dict(default="master_diag_[diagnostic]"),
553
+ kind=dict(
554
+ values=["masterdiag", "masterdiagpi"],
555
+ remap=dict(masterdiagpi="masterdiag"),
556
+ ),
557
+ diagnostic=dict(
558
+ info="The type of diagnostic to be performed.",
559
+ optional=True,
560
+ values=["voisin", "neighbour", "aromepi", "labo"],
561
+ remap=dict(neighbour="voisin"),
562
+ ),
563
+ ),
564
+ ),
565
+ ]
566
+
567
+ @property
568
+ def realkind(self):
569
+ return "masterdiag"
570
+
571
+
572
+ class MasterDiagLabo(MasterDiag):
573
+ """binary to compute a diagnostic with some gribs for cycle after the 46th."""
574
+
575
+ _footprint = dict(
576
+ attr=dict(
577
+ diagnostic=dict(
578
+ default="labo",
579
+ )
580
+ ),
581
+ only=dict(after_cycle=ArpIfsSimplifiedCycle("cy46")),
582
+ )
583
+
584
+
585
+ class MasterDiagPi(MasterDiag):
586
+ """binary to compute a diagnostic with some gribs for cycle before the 46th."""
587
+
588
+ _footprint = dict(
589
+ attr=dict(
590
+ diagnostic=dict(
591
+ default="aromepi",
592
+ )
593
+ ),
594
+ only=dict(before_cycle=ArpIfsSimplifiedCycle("cy46")),
595
+ )
596
+
597
+
598
+ class IOPoll(Script):
599
+ """
600
+ The IOPoll script. A Genvkey can be given.
601
+ """
602
+
603
+ _footprint = [
604
+ gvar,
605
+ dict(
606
+ info="IOPoll script",
607
+ attr=dict(
608
+ kind=dict(
609
+ optional=False,
610
+ values=["iopoll", "io_poll"],
611
+ remap=dict(autoremap="first"),
612
+ ),
613
+ gvar=dict(
614
+ default="tools_io_poll",
615
+ ),
616
+ ),
617
+ ),
618
+ ]
619
+
620
+ @property
621
+ def realkind(self):
622
+ return "iopoll"
623
+
624
+
625
+ class LFITools(BlackBox):
626
+ """Multipurpose tool to handle LFI/FA files."""
627
+
628
+ _footprint = [
629
+ gvar,
630
+ dict(
631
+ info="Tool to handle LFI/FA files",
632
+ attr=dict(
633
+ kind=dict(
634
+ values=[
635
+ "lfitools",
636
+ ],
637
+ ),
638
+ gvar=dict(default="master_lfitools"),
639
+ ),
640
+ ),
641
+ ]
642
+
643
+ @property
644
+ def realkind(self):
645
+ return "lfitools"
646
+
647
+
648
+ class SFXTools(BlackBox):
649
+ """Multipurpose tool to handle Surfex files."""
650
+
651
+ _footprint = [
652
+ gvar,
653
+ dict(
654
+ info="Tool that handles Surfex files",
655
+ attr=dict(
656
+ kind=dict(
657
+ values=[
658
+ "sfxtools",
659
+ ],
660
+ ),
661
+ gvar=dict(default="master_sfxtools"),
662
+ ),
663
+ ),
664
+ ]
665
+
666
+ @property
667
+ def realkind(self):
668
+ return "sfxtools"
669
+
670
+
671
+ @gmkpack_bin_deco
672
+ class Combi(BlackBox):
673
+ """Multipurpose tool to build the initial states of the ensemble prediction system."""
674
+
675
+ _footprint = [
676
+ gvar,
677
+ dict(
678
+ info="Tool to build EPS initial conditions",
679
+ attr=dict(
680
+ kind=dict(
681
+ values=["combi"],
682
+ ),
683
+ gvar=dict(default="master_combi"),
684
+ ),
685
+ ),
686
+ ]
687
+
688
+ @property
689
+ def realkind(self):
690
+ return "combi"
691
+
692
+
693
+ @gmkpack_bin_deco
694
+ class Gobptout(BlackBox):
695
+ """A tool for grib conversion on a gaussian grid."""
696
+
697
+ _footprint = [
698
+ gvar,
699
+ dict(
700
+ info="Gobptout utility for grib conversion",
701
+ attr=dict(
702
+ gvar=dict(default="master_gobtout"),
703
+ kind=dict(
704
+ values=["gobptout"],
705
+ ),
706
+ ),
707
+ ),
708
+ ]
709
+
710
+ @property
711
+ def realkind(self):
712
+ return "gobptout"
713
+
714
+
715
+ @gmkpack_bin_deco
716
+ class Clust(BlackBox):
717
+ """Tool that selects a subset of EPS members using the Clustering method."""
718
+
719
+ _footprint = [
720
+ gvar,
721
+ dict(
722
+ info="Tool that selects a subset of EPS members using the Clustering method",
723
+ attr=dict(
724
+ kind=dict(
725
+ values=["clust"],
726
+ ),
727
+ gvar=dict(default="master_clust"),
728
+ ),
729
+ ),
730
+ ]
731
+
732
+ @property
733
+ def realkind(self):
734
+ return "clust"
735
+
736
+
737
+ @gmkpack_bin_deco
738
+ class PertSurf(BlackBox):
739
+ """Tool that adds perturbations to surface fields."""
740
+
741
+ _footprint = [
742
+ gvar,
743
+ dict(
744
+ info="Tool that adds perturbations to surface fields",
745
+ attr=dict(
746
+ kind=dict(
747
+ values=["pertsurf"],
748
+ ),
749
+ gvar=dict(default="master_pertsurf"),
750
+ ),
751
+ ),
752
+ ]
753
+
754
+ @property
755
+ def realkind(self):
756
+ return "pertsurf"
757
+
758
+
759
+ @gmkpack_bin_deco
760
+ class AddPearp(BlackBox):
761
+ """
762
+ Tool that adds perturbations taken from a given PEARP member
763
+ to the deterministic initial conditions.
764
+ """
765
+
766
+ _footprint = [
767
+ gvar,
768
+ dict(
769
+ info="Tool that adds perturbations taken from a given PEARP member",
770
+ attr=dict(
771
+ kind=dict(
772
+ values=["addpearp"],
773
+ ),
774
+ gvar=dict(default="master_addpearp"),
775
+ ),
776
+ ),
777
+ ]
778
+
779
+ @property
780
+ def realkind(self):
781
+ return "addpearp"
782
+
783
+
784
+ class BDMExecutableBUFR(Script):
785
+ """An executable to extract BDM BUFR files."""
786
+
787
+ _footprint = [
788
+ gvar,
789
+ dict(
790
+ info="Executable to extract BDM files using Oulan",
791
+ attr=dict(
792
+ source=dict(
793
+ values=["alim.awk", "alim_olive.awk"],
794
+ ),
795
+ kind=dict(
796
+ optional=False,
797
+ values=[
798
+ "bdm_bufr_extract",
799
+ ],
800
+ ),
801
+ gvar=dict(
802
+ values=["extract_stuff"],
803
+ default="extract_stuff",
804
+ ),
805
+ language=dict(
806
+ default="awk",
807
+ values=["awk"],
808
+ optional=True,
809
+ ),
810
+ ),
811
+ ),
812
+ ]
813
+
814
+ @property
815
+ def realkind(self):
816
+ return "bdm_bufr_extract"
817
+
818
+ def gget_urlquery(self):
819
+ """GGET specific query : ``extract``."""
820
+ return "extract=" + self.source
821
+
822
+ def command_line(self, **opts):
823
+ """Returns optional attribute :attr:`rawopts`."""
824
+ args = []
825
+ if "query" in opts:
826
+ args.append(opts["query"]) # The query name
827
+ superraw = super().command_line(**opts)
828
+ if superraw:
829
+ args.append(superraw) # Other arguments provided by the user
830
+ return " ".join(args)
831
+
832
+
833
+ class BDMExecutableOulan(BlackBox):
834
+ """An executable to extract BDM files using Oulan."""
835
+
836
+ _footprint = [
837
+ gvar,
838
+ dict(
839
+ info="Executable to extract BDM BUFR files",
840
+ attr=dict(
841
+ kind=dict(
842
+ values=[
843
+ "bdm_oulan_extract",
844
+ ],
845
+ ),
846
+ gvar=dict(
847
+ values=["master_oulan"],
848
+ default="master_oulan",
849
+ ),
850
+ ),
851
+ ),
852
+ ]
853
+
854
+ @property
855
+ def realkind(self):
856
+ return "bdm_obsoul_extract"
857
+
858
+
859
+ class ExecMonitoring(BlackBox):
860
+ """Compute monitoring statistics."""
861
+
862
+ _footprint = [
863
+ gvar,
864
+ dict(
865
+ info="Executable to compute monitoring statistics",
866
+ attr=dict(
867
+ gvar=dict(default="master_monitoring"),
868
+ kind=dict(
869
+ values=["exec_monitoring"],
870
+ ),
871
+ ),
872
+ ),
873
+ ]
874
+
875
+
876
+ class ExecReverser(BlackBox):
877
+ """Compute the initial state for Ctpini."""
878
+
879
+ _footprint = [
880
+ gvar,
881
+ dict(
882
+ info="Executable to compute initial state for Ctpini",
883
+ attr=dict(
884
+ gvar=dict(default="master_involive_km"),
885
+ kind=dict(
886
+ values=["exec_reverser"],
887
+ ),
888
+ ),
889
+ ),
890
+ ]
891
+
892
+ @property
893
+ def realkind(self):
894
+ return "exec_reverser"
895
+
896
+
897
+ @gmkpack_bin_deco
898
+ class Rgrid(BlackBox):
899
+ """An executable to make a gaussian reduced grid from several parameters."""
900
+
901
+ _footprint = [
902
+ gvar,
903
+ dict(
904
+ info="Executable to make a gaussian reduced grid",
905
+ attr=dict(
906
+ kind=dict(
907
+ values=[
908
+ "rgrid",
909
+ ],
910
+ ),
911
+ gvar=dict(
912
+ values=["master_rgrid"],
913
+ default="master_rgrid",
914
+ ),
915
+ ),
916
+ ),
917
+ ]
918
+
919
+ @property
920
+ def realkind(self):
921
+ return "rgrid"
922
+
923
+ def command_line(self, **opts):
924
+ args = []
925
+ for k, v in opts.items():
926
+ args.extend(["-" + k, v])
927
+ return " ".join(args)
928
+
929
+
930
+ @gmkpack_bin_deco
931
+ class Festat(BlackBox):
932
+ """Executable to compute the B matrix and statistics upon it."""
933
+
934
+ _footprint = [
935
+ gvar,
936
+ dict(
937
+ info="Executable to compute the B matrix",
938
+ attr=dict(
939
+ kind=dict(
940
+ values=[
941
+ "festat",
942
+ ],
943
+ ),
944
+ gvar=dict(
945
+ optional=True,
946
+ ),
947
+ ),
948
+ ),
949
+ ]
950
+
951
+
952
+ class EnsembleDiagScript(GnuScript):
953
+ """Script to compute some ensemble diagnostics."""
954
+
955
+ _footprint = [
956
+ gvar,
957
+ dict(
958
+ info="Script to compute some ensemble diagnostics.",
959
+ attr=dict(
960
+ kind=dict(
961
+ values=[
962
+ "ens_diag_script",
963
+ ],
964
+ ),
965
+ scope=dict(
966
+ values=[
967
+ "generic",
968
+ ],
969
+ optional=True,
970
+ default="generic",
971
+ ),
972
+ gvar=dict(
973
+ default="master_ensdiag_[scope]",
974
+ ),
975
+ ),
976
+ ),
977
+ ]
978
+
979
+
980
+ class DomeoForcing(BlackBox):
981
+ """Some binary that tweak forcing files for domeo use."""
982
+
983
+ _footprint = [
984
+ gvar,
985
+ dict(
986
+ info="Some binary that tweak forcing files for domeo use",
987
+ attr=dict(
988
+ kind=dict(
989
+ values=["domeo_forcing"],
990
+ ),
991
+ gvar=dict(default="master_domeo_forcing"),
992
+ ),
993
+ ),
994
+ ]
995
+
996
+ @property
997
+ def realkind(self):
998
+ return "domeo_forcing"
999
+
1000
+
1001
+ class DomeoScriptDataCor(Script):
1002
+ """Class to deal with Domeo correction script."""
1003
+
1004
+ _footprint = [
1005
+ gvar,
1006
+ dict(
1007
+ info="correction script",
1008
+ attr=dict(
1009
+ kind=dict(values=["domeo_cor_script"]),
1010
+ purpose=dict(
1011
+ values=["forcing", "crop"],
1012
+ ),
1013
+ gvar=dict(
1014
+ default="scr_domeo_cor_[purpose]",
1015
+ ),
1016
+ ),
1017
+ ),
1018
+ ]
1019
+
1020
+ @property
1021
+ def realkind(self):
1022
+ return "domeo_cor_script"
1023
+
1024
+
1025
+ class Xios(BlackBox):
1026
+ """The XIOS I/O Server Binary."""
1027
+
1028
+ _footprint = [
1029
+ gvar,
1030
+ dict(
1031
+ info="The XIOS I/O Server.",
1032
+ attr=dict(
1033
+ kind=dict(
1034
+ values=[
1035
+ "xios",
1036
+ ],
1037
+ ),
1038
+ gvar=dict(default="master_xios"),
1039
+ ),
1040
+ ),
1041
+ ]
1042
+
1043
+ @property
1044
+ def realkind(self):
1045
+ return "xios"