forked from trondkr/model2roms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunM2R.py
56 lines (40 loc) · 1.51 KB
/
runM2R.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
import logging
import time
from datetime import datetime
import IOstation
import clim2bry
import configM2R
import decimateGrid
import model2roms
# __author__ = 'Trond Kristiansen'
# __email__ = '[email protected]'
__author__ = 'Joe McGovern, Irish Marine Institute'
__email__ = '[email protected]'
__created__ = datetime(2009, 1, 30)
__modified__ = datetime(2021, 12, 17)
__version__ = "1.6"
__status__ = "Development, modified most recently on 29.11.2021"
"""
Main method for running model2roms
Start: python runM2R.py
"""
def run():
logging.basicConfig(level=logging.INFO)
logging.info("[M2R_run] Initialized logging")
logging.info("[M2R_run] Started model2roms")
confM2R = configM2R.Model2romsConfig()
confM2R.create_grd_objects()
if confM2R.create_atmos_forcing or confM2R.create_ocean_forcing:
if confM2R.create_ocean_forcing:
model2roms.convert_MODEL2ROMS(confM2R)
clim2bry.writebry(confM2R)
# if confM2R.createAtmosForcing:
# atmosForcing.createAtmosFileUV(confM2R)
if confM2R.decimate_gridfile:
decimateGrid.createGrid(confM2R.grdROMS, "/Users/trondkr/Projects/KINO/GRID/kino_1600m_18072015.nc",
"/Users/trondkr/Projects/KINO/GRID/kino_1600m_18072015v2.nc", 2)
if confM2R.extract_stations:
print("Running in station mode and extracting pre-defined station locations")
IOstation.getStationData(confM2R)
print('Finished ' + time.ctime(time.time()))
run()