You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nemo_cookbook/nemodatatree.py
+33-11Lines changed: 33 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,8 @@ def from_paths(
71
71
nftype: str|None=None,
72
72
read_mask: bool=False,
73
73
maskcs: bool=False,
74
-
key_linssh: bool=False,
74
+
linssh: bool=False,
75
+
vco: str="1d",
75
76
vco_ref: bool=False,
76
77
nbghost_child: int=4,
77
78
**open_kwargs: dict[str, any],
@@ -139,10 +140,13 @@ def from_paths(
139
140
maskcs: bool = False
140
141
If True, all closed seas are masked using mask_opensea variables from domain files. Default is False.
141
142
142
-
key_linssh: bool = False
143
+
linssh: bool = False
143
144
Linear free-surface approximation. If True, vertical coordinates are time-independent and given by (e3t_0, e3u_0, e3v_0, e3w_0) in domain_cfg.
144
145
If False, vertical coordinates are time-dependent and must be specified in NEMO model grid datasets. Default is False.
145
146
147
+
vco : str = "1d"
148
+
Vertical reference variables. Options are '1d' to use 1-dimensional vertical reference coordinates or '3d' to use 3-dimensional vertical reference coordinates (deptht, depthu, depthv, depthw, depthf). Default is '1d'.
149
+
146
150
vco_ref: bool = False
147
151
If True, add reference vertical scale factors and compute reference water column heights from domain files. Default is False.
148
152
@@ -173,7 +177,7 @@ def from_paths(
173
177
174
178
Create a regional `NEMODataTree` using a linear free-surface approximation from a dictionary of paths to remote netCDF files:
raiseTypeError("reading land-sea masks from domain_cfg (`read_mask`) must be a boolean.")
197
201
ifnotisinstance(maskcs, bool):
198
202
raiseTypeError("masking of closed seas (`maskcs`) must be a boolean.")
199
-
ifnotisinstance(key_linssh, bool):
200
-
raiseTypeError("linear free-surface approximation (`key_linssh`) must be a boolean.")
203
+
ifnotisinstance(linssh, bool):
204
+
raiseTypeError("linear free-surface approximation (`linssh`) must be a boolean.")
205
+
ifnotisinstance(vco, str):
206
+
raiseTypeError("vertical reference coordinates (`vco`) must be a string.")
207
+
ifvconotin ("1d", "3d"):
208
+
raiseValueError(
209
+
"vertical reference coordinates (`vco`) must be '1d' (1-dimensional) or '3d' (3-dimensional)."
210
+
)
201
211
ifnotisinstance(vco_ref, bool):
202
212
raiseTypeError("reference vertical coordinates (`vco_ref`) must be a boolean.")
203
213
ifnotisinstance(nbghost_child, int):
@@ -240,7 +250,8 @@ def from_paths(
240
250
read_mask=read_mask,
241
251
maskcs=maskcs,
242
252
nbghost_child=nbghost_child,
243
-
key_linssh=key_linssh,
253
+
linssh=linssh,
254
+
vco=vco,
244
255
vco_ref=vco_ref,
245
256
open_kwargs=dict(**open_kwargs),
246
257
)
@@ -259,7 +270,8 @@ def from_datasets(
259
270
iperio: bool=False,
260
271
nftype: str|None=None,
261
272
read_mask: bool=False,
262
-
key_linssh: bool=False,
273
+
linssh: bool=False,
274
+
vco: str="1d",
263
275
vco_ref: bool=False,
264
276
maskcs: bool=False,
265
277
nbghost_child: int=4,
@@ -311,10 +323,13 @@ def from_datasets(
311
323
maskcs: bool = False
312
324
If True, all closed seas are masked using mask_opensea variables from domain files. Default is False.
313
325
314
-
key_linssh: bool = False
326
+
linssh: bool = False
315
327
Linear free-surface approximation. If True, vertical coordinates are time-independent and given by (e3t_0, e3u_0, e3v_0, e3w_0) in domain_cfg.
316
328
If False, vertical coordinates are time-dependent and must be specified in NEMO model grid datasets. Default is False.
317
329
330
+
vco : str = "1d"
331
+
Vertical reference variables. Options are '1d' to use 1-dimensional vertical reference coordinates or '3d' to use 3-dimensional vertical reference coordinates (deptht, depthu, depthv, depthw, depthf). Default is '1d'.
332
+
318
333
vco_ref: bool = False
319
334
If True, add reference vertical scale factors and compute reference water column heights from domain files. Default is False.
320
335
@@ -362,8 +377,14 @@ def from_datasets(
362
377
raiseTypeError("reading land-sea masks from domain_cfg (`read_mask`) must be a boolean.")
363
378
ifnotisinstance(maskcs, bool):
364
379
raiseTypeError("masking of closed seas (`maskcs`) must be a boolean.")
365
-
ifnotisinstance(key_linssh, bool):
366
-
raiseTypeError("linear free-surface approximation (`key_linssh`) must be a boolean.")
380
+
ifnotisinstance(linssh, bool):
381
+
raiseTypeError("linear free-surface approximation (`linssh`) must be a boolean.")
382
+
ifnotisinstance(vco, str):
383
+
raiseTypeError("vertical reference coordinates (`vco`) must be a string.")
384
+
ifvconotin ("1d", "3d"):
385
+
raiseValueError(
386
+
"vertical reference coordinates (`vco`) must be '1d' (1-dimensional) or '3d' (3-dimensional)."
387
+
)
367
388
ifnotisinstance(vco_ref, bool):
368
389
raiseTypeError("reference vertical coordinates (`vco_ref`) must be a boolean.")
0 commit comments