Skip to content

Commit 70a1360

Browse files
committed
Added new license and minor edits
1 parent f2dbe56 commit 70a1360

File tree

3 files changed

+23
-27
lines changed

3 files changed

+23
-27
lines changed

LICENSE

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
Copyright (c) 2014 Trond Kristiansen (http://www.trondkristiansen.com/)
1+
MIT License
2+
3+
Copyright (c) 2021 Trond Kristiansen
24

35
Permission is hereby granted, free of charge, to any person obtaining a copy
46
of this software and associated documentation files (the "Software"), to deal
@@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
79
copies of the Software, and to permit persons to whom the Software is
810
furnished to do so, subject to the following conditions:
911

10-
The above copyright notice and this permission notice shall be included in
11-
all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1214

1315
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1416
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1517
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1618
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1719
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

configM2R.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
__author__ = 'Trond Kristiansen'
1212
__email__ = '[email protected]'
1313
__created__ = datetime(2009, 1, 30)
14-
__modified__ = datetime(2021, 3, 23)
14+
__modified__ = datetime(2021, 7, 27)
1515
__version__ = "1.6"
1616
__status__ = "Development"
1717

18+
# Changelog:
19+
# 27.07.2021 - Added option for running Hardangerfjord 160 m model
1820

1921
class Model2romsConfig(object):
2022

@@ -93,11 +95,8 @@ def define_input_data_varnames(self):
9395
# Define the path to where the ROMS grid can be found
9496
def define_roms_grid_path(self):
9597
try:
96-
return {'Antarctic': '../oceanography/model2roms_grids/ANT_01.nc',
97-
'Josè': '../oceanography/model2roms_grids/roms12_9km.nc',
98-
'A20': '/Users/trondkr/Dropbox/NIVA/A20/Grid/roms12_9km.nc',
99-
# '/cluster/projects/nn9412k/A20/Grid/A20niva_grd_v1.nc',
100-
# 'ROHO800': '/cluster/projects/nn9490k/ROHO800/Grid/ROHO800_grid_fix3.nc'}[self.outgrid_name]
98+
return {'A20': '/Users/trondkr/Dropbox/NIVA/A20/Grid/roms12_9km.nc',
99+
'ROHO160': '../oceanography/NAUTILOS/Grid/norfjords_160m_grid.nc_A04.nc',
101100
'ROHO800': '/Users/trondkr/Dropbox/NIVA/ROHO800/Grid/ROHO800_grid_fix3.nc'}[self.outgrid_name]
102101
except KeyError:
103102
return KeyError
@@ -106,8 +105,7 @@ def define_roms_grid_path(self):
106105
def define_abbreviation(self):
107106
return {"A20": "a20",
108107
"Antarctic": "Antarctic",
109-
"Josè": "Josè",
110-
"ROHO800": "roho800"}[self.outgrid_name]
108+
"ROHO160": "roho160"}[self.outgrid_name]
111109

112110
def define_ocean_forcing_data_path(self):
113111
try:
@@ -117,14 +115,10 @@ def define_ocean_forcing_data_path(self):
117115
'GLORYS': "../oceanography/copernicus-marine-data/Global/"}[self.ocean_indata_type]
118116
except KeyError:
119117
return KeyError
120-
118+
121119
def define_atmospheric_forcing_path(self):
122120
return {'ERA5': "/Volumes/DATASETS/ERA5/"}[self.atmos_indata_type]
123-
124-
def define_atmos_inputdata_varnames(self):
125-
126-
return {'ERA5': ['swrad', 'lwrad', 'precip', 'u10', 'v10']}[self.atmos_indata_type]
127-
121+
128122
def __init__(self):
129123
logging.info('\n--------------------------\n')
130124
print('Started ' + time.ctime(time.time()))
@@ -155,12 +149,12 @@ def __init__(self):
155149
# Create the bry, init, and clim files for a given grid and input data
156150
self.create_ocean_forcing = True
157151
# Create atmospheric forcing for the given grid
158-
self.create_atmos_forcing = False # currently in beta stages
152+
self.create_atmos_forcing = False # currently in beta stages
159153
# Create a smaller resolution grid based on your original. Decimates every second for
160154
# each time run
161155
self.decimate_gridfile = False
162156
# Write ice values to file (for Arctic regions)
163-
self.write_ice = True
157+
self.write_ice = False
164158
# Write biogeochemistry values to file
165159
self.write_bcg = False
166160
# ROMS sometimes requires input of ice and ssh, but if you dont have these write files containing zeros to file
@@ -177,7 +171,7 @@ def __init__(self):
177171
self.time_frequency_inputdata = "month" # Possible options: "month", "hour", "5days"
178172

179173
# Path to where results files should be stored
180-
self.outdir = "../oceanography/model2roms_results/"
174+
self.outdir = "../oceanography/NAUTILOS/"
181175
if not os.path.exists(self.outdir):
182176
os.makedirs(self.outdir, exist_ok=True)
183177

@@ -228,7 +222,7 @@ def __init__(self):
228222
# OUT GRIDTYPES ------------------------------------------------------------------------------
229223
# Define what grid type you want to interpolate to
230224
# Options: This is just the name of your grid used to identify your selection later
231-
self.outgrid_name = 'Josè' # "ROHO800", "A20"
225+
self.outgrid_name = 'ROHO160' # "ROHO800", "A20"
232226
self.outgrid_type = "ROMS"
233227

234228
# Subset input data. If you have global data you may want to seubset these to speed up reading. Make
@@ -261,10 +255,10 @@ def __init__(self):
261255

262256
# DATE AND TIME DETAILS ---------------------------------------------------------
263257
# Define the period to create forcing for
264-
self.start_year = 1993
265-
self.end_year = 1993
258+
self.start_year = 2017
259+
self.end_year = 2020
266260
self.start_month = 1
267-
self.end_month = 5
261+
self.end_month = 12
268262
self.start_day = 15
269263
self.end_day = 31
270264

runM2R.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
__author__ = 'Trond Kristiansen'
1111
__email__ = '[email protected]'
1212
__created__ = datetime(2009, 1, 30)
13-
__modified__ = datetime(2021, 3, 23)
13+
__modified__ = datetime(2021, 7, 27)
1414
__version__ = "1.6"
1515
__status__ = "Development"
1616

0 commit comments

Comments
 (0)