wrfrun 0.1.4__tar.gz → 0.1.5__tar.gz
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.
- {wrfrun-0.1.4 → wrfrun-0.1.5}/PKG-INFO +1 -1
- {wrfrun-0.1.4 → wrfrun-0.1.5}/meson.build +1 -1
- {wrfrun-0.1.4 → wrfrun-0.1.5}/pyproject.toml +1 -1
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/__init__.py +0 -3
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/meson.build +3 -5
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/run.py +4 -45
- wrfrun-0.1.5/wrfrun/model/utils/__init__.py +5 -0
- wrfrun-0.1.4/wrfrun/model/utils.py → wrfrun-0.1.5/wrfrun/model/utils/core.py +15 -6
- wrfrun-0.1.5/wrfrun/model/utils/meson.build +11 -0
- wrfrun-0.1.4/wrfrun/model/wrf.py → wrfrun-0.1.5/wrfrun/model/utils/wrf_utils.py +1 -1
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/run.py +1 -2
- {wrfrun-0.1.4 → wrfrun-0.1.5}/.gitattributes +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/.gitignore +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/LICENSE +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/README.md +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/main.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/core/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/core/config.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/core/constant.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/core/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/core/namelist.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/core/server.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/data.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/goos_sst.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/res/Vtable.ERA_GOOS_SST +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/res/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/res/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/goos_sst/utils.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/littler/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/littler/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/littler/utils.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/micaps/README.md +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/extension/utils.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/core.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/geodata.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/namelist.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/plot.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/model/scheme.py +0 -0
- /wrfrun-0.1.4/wrfrun/model/ndown.py → /wrfrun-0.1.5/wrfrun/model/utils/ndown_utils.py +0 -0
- /wrfrun-0.1.4/wrfrun/model/wps.py → /wrfrun-0.1.5/wrfrun/model/utils/wps_utils.py +0 -0
- /wrfrun-0.1.4/wrfrun/model/wrfda.py → /wrfrun-0.1.5/wrfrun/model/utils/wrfda_utils.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/pbs.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/plot/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/plot/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/plot/wps.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/config.yaml.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/extension/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/extension/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/extension/plotgrids.ncl +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/geogrid/GEOGRID.SHAN_DONG_LANDUSE_SOIL_TOP.TBL +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/geogrid/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/geogrid/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/metgrid/METGRID.TBL +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/metgrid/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/metgrid/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/namelist.input.da_wrfvar.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/namelist.input.dfi.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/namelist.input.real.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/namelist.input.wrf.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/namelist.wps.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/namelist/parame.in.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/run.sh.template +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/ungrib/__init__.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/res/ungrib/meson.build +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/utils.py +0 -0
- {wrfrun-0.1.4 → wrfrun-0.1.5}/wrfrun/workspace.py +0 -0
|
@@ -8,10 +8,7 @@ from wrfrun.pbs import get_core_num
|
|
|
8
8
|
from wrfrun.utils import check_path, logger
|
|
9
9
|
from .core import exec_geogrid, exec_metgrid, exec_ndown, exec_real, exec_ungrib, exec_wrf
|
|
10
10
|
from .namelist import generate_namelist_file, prepare_dfi_namelist
|
|
11
|
-
from .
|
|
12
|
-
from .utils import model_preprocess, model_postprocess
|
|
13
|
-
from .wps import get_wif_dir, get_wif_prefix
|
|
14
|
-
from .wrf import reconcile_namelist_metgrid
|
|
11
|
+
from .utils import model_preprocess, model_postprocess, process_after_ndown, get_wif_dir, get_wif_prefix, reconcile_namelist_metgrid
|
|
15
12
|
|
|
16
13
|
|
|
17
14
|
def geogrid(geogrid_tbl_file: Union[str, None] = None):
|
|
@@ -48,8 +45,8 @@ def geogrid(geogrid_tbl_file: Union[str, None] = None):
|
|
|
48
45
|
|
|
49
46
|
exec_geogrid(get_core_num())
|
|
50
47
|
|
|
51
|
-
model_postprocess(WPS_WORK_PATH, log_save_path, startswith="geogrid.log", copy_only=False)
|
|
52
|
-
model_postprocess(WPS_WORK_PATH, output_save_path, startswith="geo_em"
|
|
48
|
+
model_postprocess(WPS_WORK_PATH, log_save_path, startswith="geogrid.log", copy_only=False, outputs="namelist.wps")
|
|
49
|
+
model_postprocess(WPS_WORK_PATH, output_save_path, startswith="geo_em")
|
|
53
50
|
|
|
54
51
|
# for _file in listdir(WPS_WORK_PATH):
|
|
55
52
|
# if _file.startswith("geogrid.log"):
|
|
@@ -205,21 +202,9 @@ def real(metgrid_path: Union[str, None] = None):
|
|
|
205
202
|
|
|
206
203
|
exec_real(get_core_num())
|
|
207
204
|
|
|
208
|
-
model_postprocess(WRF_WORK_PATH, output_save_path, startswith=
|
|
205
|
+
model_postprocess(WRF_WORK_PATH, output_save_path, startswith=("wrfbdy", "wrfinput", "wrflow"))
|
|
209
206
|
model_postprocess(WRF_WORK_PATH, log_save_path, startswith="rsl.", outputs="namelist.input", copy_only=False)
|
|
210
207
|
|
|
211
|
-
# for _file in listdir(WRF_WORK_PATH):
|
|
212
|
-
# if _file.startswith("rsl."):
|
|
213
|
-
# move(f"{WRF_WORK_PATH}/{_file}", f"{log_save_path}/{_file}")
|
|
214
|
-
# elif _file.startswith("wrfbdy"):
|
|
215
|
-
# copyfile(f"{WRF_WORK_PATH}/{_file}", f"{output_save_path}/{_file}")
|
|
216
|
-
# elif _file.startswith("wrfinput"):
|
|
217
|
-
# copyfile(f"{WRF_WORK_PATH}/{_file}", f"{output_save_path}/{_file}")
|
|
218
|
-
# elif _file.startswith("wrflow"):
|
|
219
|
-
# copyfile(f"{WRF_WORK_PATH}/{_file}", f"{output_save_path}/{_file}")
|
|
220
|
-
#
|
|
221
|
-
# move(f"{WRF_WORK_PATH}/namelist.input", f"{log_save_path}/namelist.input")
|
|
222
|
-
|
|
223
208
|
logger.info(f"All real output files have been copied to {output_save_path}")
|
|
224
209
|
|
|
225
210
|
|
|
@@ -272,18 +257,6 @@ def dfi(real_output_path: Union[str, None] = None, update_real_output=True):
|
|
|
272
257
|
model_postprocess(WRF_WORK_PATH, log_save_path, startswith="rsl.", outputs="namelist.input", copy_only=False)
|
|
273
258
|
model_postprocess(WRF_WORK_PATH, output_save_path, outputs="wrfinput_initialized_d01")
|
|
274
259
|
|
|
275
|
-
# for _file in listdir(WRF_WORK_PATH):
|
|
276
|
-
# if _file.startswith("rsl."):
|
|
277
|
-
# move(f"{WRF_WORK_PATH}/{_file}", f"{log_save_path}/{_file}")
|
|
278
|
-
# elif _file == "wrfinput_initialized_d01":
|
|
279
|
-
# move(f"{WRF_WORK_PATH}/{_file}", f"{output_save_path}/{_file}")
|
|
280
|
-
# if update_real_output:
|
|
281
|
-
# move(f"{real_output_path}/wrfinput_d01", f"{real_output_path}/wrfinput_d01_before_dfi")
|
|
282
|
-
# copyfile(f"{output_save_path}/{_file}", f"{real_output_path}/wrfinput_d01")
|
|
283
|
-
# logger.info(f"Replace real's output \"wrfinput_d01\" with output, old file has been renamed as \"wrfinput_d01_before_dfi\"")
|
|
284
|
-
#
|
|
285
|
-
# move(f"{WRF_WORK_PATH}/namelist.input", f"{log_save_path}/namelist.input")
|
|
286
|
-
|
|
287
260
|
if update_real_output:
|
|
288
261
|
move(f"{real_output_path}/wrfinput_d01", f"{real_output_path}/wrfinput_d01_before_dfi")
|
|
289
262
|
copyfile(f"{output_save_path}/wrfinput_initialized_d01", f"{real_output_path}/wrfinput_d01")
|
|
@@ -336,14 +309,6 @@ def wrf(wrf_input_path: Union[str, None] = None):
|
|
|
336
309
|
model_postprocess(WRF_WORK_PATH, log_save_path, startswith="rsl.", outputs="namelist.input", copy_only=False)
|
|
337
310
|
model_postprocess(WRF_WORK_PATH, output_save_path, startswith="wrfout")
|
|
338
311
|
|
|
339
|
-
# for _file in listdir(WRF_WORK_PATH):
|
|
340
|
-
# if _file.startswith("rsl."):
|
|
341
|
-
# move(f"{WRF_WORK_PATH}/{_file}", f"{log_save_path}/{_file}")
|
|
342
|
-
# elif _file.startswith("wrfout"):
|
|
343
|
-
# copyfile(f"{WRF_WORK_PATH}/{_file}", f"{output_save_path}/{_file}")
|
|
344
|
-
#
|
|
345
|
-
# move(f"{WRF_WORK_PATH}/namelist.input", f"{log_save_path}/namelist.input")
|
|
346
|
-
|
|
347
312
|
logger.info(f"All wrf output files have been copied to {output_save_path}")
|
|
348
313
|
|
|
349
314
|
|
|
@@ -397,12 +362,6 @@ def ndown(wrfout_file_path: str, wrfinput_file_path: str, update_namelist=True):
|
|
|
397
362
|
|
|
398
363
|
model_postprocess(WRF_WORK_PATH, log_save_path, startswith="rsl.", outputs="namelist.input", copy_only=False)
|
|
399
364
|
|
|
400
|
-
# for _file in listdir(WRF_WORK_PATH):
|
|
401
|
-
# if _file.startswith("rsl."):
|
|
402
|
-
# move(f"{WRF_WORK_PATH}/{_file}", f"{log_save_path}/{_file}")
|
|
403
|
-
#
|
|
404
|
-
# move(f"{WRF_WORK_PATH}/namelist.input", f"{log_save_path}/namelist.input")
|
|
405
|
-
|
|
406
365
|
logger.info(f"Rename ndown output `wrfinput_d02` to `wrfinput_d01`")
|
|
407
366
|
move(f"{WRF_WORK_PATH}/wrfinput_d02", f"{output_save_path}/wrfinput_d01")
|
|
408
367
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from os import listdir, makedirs
|
|
2
2
|
from os.path import basename, exists
|
|
3
3
|
from shutil import copyfile, move
|
|
4
|
-
from typing import Tuple, Union, List
|
|
4
|
+
from typing import Tuple, Union, List, Iterable
|
|
5
5
|
|
|
6
6
|
from wrfrun.utils import logger
|
|
7
7
|
|
|
@@ -84,26 +84,35 @@ def model_postprocess(output_dir: str, save_path: str, startswith: Union[None, s
|
|
|
84
84
|
save_file_list = []
|
|
85
85
|
|
|
86
86
|
if startswith is not None:
|
|
87
|
+
_list = []
|
|
87
88
|
for _file in file_list:
|
|
88
89
|
if _file.startswith(startswith):
|
|
89
|
-
|
|
90
|
+
_list.append(_file)
|
|
91
|
+
save_file_list += _list
|
|
92
|
+
|
|
93
|
+
logger.debug(f"Collect files match `startswith`: {_list}")
|
|
90
94
|
|
|
91
95
|
if endswith is not None:
|
|
96
|
+
_list = []
|
|
92
97
|
for _file in file_list:
|
|
93
98
|
if _file.endswith(endswith):
|
|
94
|
-
|
|
99
|
+
_list.append(_file)
|
|
100
|
+
save_file_list += _list
|
|
101
|
+
|
|
102
|
+
logger.debug(f"Collect files match `endswith`: {_list}")
|
|
95
103
|
|
|
96
104
|
if outputs is not None:
|
|
97
|
-
if isinstance(outputs, str):
|
|
98
|
-
save_file_list.append(
|
|
105
|
+
if isinstance(outputs, str) and outputs in file_list:
|
|
106
|
+
save_file_list.append(outputs)
|
|
99
107
|
else:
|
|
100
|
-
outputs = [
|
|
108
|
+
outputs = [x for x in outputs if x in file_list]
|
|
101
109
|
save_file_list += outputs
|
|
102
110
|
|
|
103
111
|
if len(save_file_list) < 1:
|
|
104
112
|
return
|
|
105
113
|
|
|
106
114
|
save_file_list = list(set(save_file_list))
|
|
115
|
+
logger.debug(f"Files to be processed: {save_file_list}")
|
|
107
116
|
|
|
108
117
|
for _file in save_file_list:
|
|
109
118
|
if copy_only:
|
|
@@ -3,7 +3,7 @@ from shutil import move
|
|
|
3
3
|
|
|
4
4
|
from wrfrun.core import WRFRUNConfig, WRFRUNConstants, WRFRUNNamelist
|
|
5
5
|
from wrfrun.utils import check_path, logger
|
|
6
|
-
from .
|
|
6
|
+
from .wps_utils import get_metgrid_levels
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def reconcile_namelist_metgrid(metgrid_path: str):
|
|
@@ -12,8 +12,7 @@ from .core import WRFRUNConfig, WRFRUNConstants, WRFRunServer, WRFRunServerHandl
|
|
|
12
12
|
from .data import prepare_wps_input_data
|
|
13
13
|
from .model.namelist import prepare_wps_namelist, prepare_wrf_namelist, prepare_wrfda_namelist
|
|
14
14
|
from .model.plot import plot_domain_area
|
|
15
|
-
from .model.
|
|
16
|
-
from .model.wrf import clear_wrf_logs
|
|
15
|
+
from .model.utils import clear_wps_logs, clear_wrf_logs
|
|
17
16
|
from .pbs import in_pbs, prepare_pbs_script
|
|
18
17
|
from .utils import call_subprocess, check_path, logger, logger_add_file_handler
|
|
19
18
|
from .workspace import prepare_workspace
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|