Skip to content

Commit ecdb7c7

Browse files
authored
Merge pull request #1100 from xylar/update-mpas-tools
Update to mpas_tools >=1.2.2
2 parents 6dc2b5d + 16badff commit ecdb7c7

3 files changed

Lines changed: 25 additions & 9 deletions

File tree

ci/recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ requirements:
3232
- lxml
3333
- mache >=1.11.0
3434
- matplotlib-base >=3.9.0
35-
- mpas_tools >=1.1.0,<2.0.0
35+
- mpas_tools >=1.2.2,<2.0.0
3636
- nco >=4.8.1,!=5.2.6
3737
- netcdf4
3838
- numpy >=2.0,<3.0

dev-spec.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gsw
1515
lxml
1616
mache >=1.11.0
1717
matplotlib-base>=3.9.0
18-
mpas_tools >=1.1.0,<2.0.0
18+
mpas_tools >=1.2.2,<2.0.0
1919
nco>=4.8.1,!=5.2.6
2020
netcdf4
2121
numpy>=2.0,<3.0

mpas_analysis/ocean/climatology_map_bsf.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import xarray as xr
1414

15-
from mpas_tools.ocean.barotropic_streamfunction import (
15+
from mpas_tools.ocean import (
1616
compute_barotropic_streamfunction,
1717
shift_barotropic_streamfunction
1818
)
@@ -216,7 +216,7 @@ def __init__(self, mpas_climatology_task, parent_task,
216216
variable_list, seasons, comparison_grid_names,
217217
subtaskName=subtask_name, vertices=True)
218218

219-
# this reequires a lot of memory so let's reserve all the available
219+
# this requires a lot of memory so let's reserve all the available
220220
# tasks
221221
parallelTaskCount = self.config.getint('execute', 'parallelTaskCount')
222222
self.subprocessCount = parallelTaskCount
@@ -316,11 +316,26 @@ def customize_masked_climatology(self, climatology, season):
316316
config = self.config
317317

318318
ds_mesh = xr.open_dataset(self.restartFileName)
319-
ds_mesh = ds_mesh[['cellsOnEdge', 'cellsOnVertex', 'nEdgesOnCell',
320-
'edgesOnCell', 'verticesOnCell', 'verticesOnEdge',
321-
'edgesOnVertex', 'dcEdge', 'dvEdge', 'bottomDepth',
322-
'maxLevelCell', 'latVertex', 'areaTriangle',]]
323-
ds_mesh.load()
319+
var_list = [
320+
'cellsOnEdge',
321+
'cellsOnVertex',
322+
'nEdgesOnCell',
323+
'edgesOnCell',
324+
'verticesOnCell',
325+
'verticesOnEdge',
326+
'edgesOnVertex',
327+
'dcEdge',
328+
'dvEdge',
329+
'bottomDepth',
330+
'minLevelCell',
331+
'maxLevelCell',
332+
'latVertex',
333+
'areaTriangle',
334+
]
335+
ds_mesh = ds_mesh[var_list].as_numpy()
336+
337+
masked_filename = self.get_masked_file_name(season)
338+
masked_dir = os.path.dirname(masked_filename)
324339

325340
cells_on_vertex = ds_mesh.cellsOnVertex - 1
326341
lat_vertex = ds_mesh.latVertex
@@ -332,6 +347,7 @@ def customize_masked_climatology(self, climatology, season):
332347
include_bolus=self.include_bolus,
333348
include_submesoscale=self.include_submesoscale,
334349
logger=logger,
350+
tmp_dir=masked_dir,
335351
)
336352

337353
lat_range = config.getexpression(

0 commit comments

Comments
 (0)