forked from NCAR/metric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_metric.py
executable file
·55 lines (47 loc) · 1.67 KB
/
run_metric.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
"""
metric command line script
"""
import sys
from metric.metric import compute_amoc_transport
def main():
args = dict(zip(sys.argv[1::2],sys.argv[2::2]))
print("============================================")
print("------------- Running Metric ---------------")
print("============================================")
print('')
print('')
if 'move' in args['-c']:
print('Run MOVE AMOC transport computation using:')
elif 'rapid' in args['-c']:
print('Run RAPID AMOC transport computation using:')
elif 'samba' in args['-c']:
print('Run SAMBA SAMOC transport computation using:')
for key in args.keys():
if key == '-c':
print('Path to config file: {}'.format(args[key]))
if key == '-t':
print('Path to temperature file: {}'.format(args[key]))
if key == '-s':
print('Path to salinity file: {}'.format(args[key]))
if key == '-v':
print('Path to meridional velocity file: {}'.format(args[key]))
if key == '-ssh':
print('Path to SSH file: {}'.format(args[key]))
if key == '-taux':
print('Path to zonal wind stress file: {}'.format(args[key]))
if key == '--name':
print('Output files name (Overrides value in config file): {}'.format(args[key]))
if key == '--outdir':
print('Output data path (Overrides value in config file): {}'.format(args[key]))
if key == '--shift':
print('Shift output dates for plotting such that the output time series start with {}'.format(args[key]))
compute_amoc_transport(sys.argv[1:])
print('')
print('Done')
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt as err:
print(err)
sys.exit()