Skip to content

Commit 9b0bfdd

Browse files
committed
stash commit ...
1 parent a95cd2f commit 9b0bfdd

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

xmitgcm/llcreader/known_models.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,17 @@ def __init__(self):
267267
shrunk=True, join_char='/')
268268

269269
super(SverdrupASTE270Model, self).__init__(store)
270+
271+
#class SverdrupSmoothLLC90Model(SmoothLLC90Model):
272+
# @_requires_sverdrup
273+
# def __init__(self):
274+
# from fsspec.implementations.local import LocalFileSystem
275+
# fs = LocalFileSystem()
276+
# base_path = '/scratch2/shared/aste-release1/diags'
277+
# grid_path = '/scratch2/shared/aste-release1/grid'
278+
# mask_path = '/scratch2/shared/aste-release1/masks.zarr'
279+
# store = stores.NestedStore(fs, base_path=base_path, grid_path=grid_path,
280+
# mask_path=mask_path,
281+
# shrunk=True, join_char='/')
282+
#
283+
# super(SverdrupASTE270Model, self).__init__(store)

xmitgcm/llcreader/llcmodel.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ def _get_var_metadata():
5050
var_metadata = state_variables.copy()
5151
var_metadata.update(package_state_variables)
5252
var_metadata.update(available_diags)
53+
extra_variables = {
54+
f'smooth3Dfld001': {
55+
'dims': ['k', 'j', 'i'],
56+
'attrs': {
57+
'standard_name': 'smooth_fld',
58+
'long_name': r'$C\mathbf{z}$',
59+
}
60+
},
61+
}
62+
var_metadata.update(extra_variables)
5363

5464
# even the file names from the LLC data differ from standard MITgcm output
5565
aliases = {'Eta': 'ETAN', 'PhiBot': 'PHIBOT', 'Salt': 'SALT',
@@ -776,14 +786,14 @@ def _check_iters(self, iters):
776786
if not set(iters) <= set(self.iters):
777787
msg = "Some requested iterations may not exist, you may need to change 'iters'"
778788
warnings.warn(msg, RuntimeWarning)
779-
789+
780790
elif self.iter_start is not None and self.iter_step is not None:
781791
for iter in iters:
782792
if (iter - self.iter_start) % self.iter_step:
783793
msg = "Some requested iterations may not exist, you may need to change 'iters'"
784794
warnings.warn(msg, RuntimeWarning)
785795
break
786-
796+
787797

788798
def get_dataset(self, varnames=None, iter_start=None, iter_stop=None,
789799
iter_step=None, iters=None, k_levels=None, k_chunksize=1,
@@ -838,7 +848,7 @@ def _if_not_none(a, b):
838848
if iters is not None:
839849
raise ValueError("Only `iters` or the parameters `iter_start`, `iters_stop`, "
840850
"and `iter_step` can be provided. Both were provided")
841-
851+
842852
# Otherwise we can override any missing values
843853
iter_start = _if_not_none(iter_start, self.iter_start)
844854
iter_stop = _if_not_none(iter_stop, self.iter_stop)
@@ -849,12 +859,12 @@ def _if_not_none(a, b):
849859
"and `iter_step` must be defined either by the "
850860
"model class or as argument. Instead got %r "
851861
% iter_params)
852-
862+
853863
# Otherwise try loading from the user set iters
854864
elif iters is not None:
855865
pass
856866

857-
# Now have a go at using the attribute derived iteration parameters
867+
# Now have a go at using the attribute derived iteration parameters
858868
elif all([a is not None for a in attribute_iter_params]):
859869
iter_params = attribute_iter_params
860870

@@ -867,7 +877,7 @@ def _if_not_none(a, b):
867877
raise ValueError("The parameters `iter_start`, `iter_stop`, "
868878
"and `iter_step`, or `iters` must be defined either by the "
869879
"model class or as argument")
870-
880+
871881
# Check the iter_start and iter_step
872882
if iters is None:
873883
self._check_iter_start(iter_params[0])

0 commit comments

Comments
 (0)