Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab83cbc

Browse files
authoredApr 30, 2024··
Merge pull request #1002 from MPAS-Dev/develop
Merge develop into main
2 parents 79bc218 + e57f81c commit ab83cbc

File tree

8 files changed

+39
-16
lines changed

8 files changed

+39
-16
lines changed
 

‎ci/recipe/meta.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "MPAS-Analysis" %}
2-
{% set version = "1.10.0" %}
2+
{% set version = "1.11.0rc1" %}
33

44
package:
55
name: {{ name|lower }}
@@ -27,7 +27,7 @@ requirements:
2727
- cartopy_offlinedata
2828
- cmocean
2929
- dask
30-
- esmf >=8.4.2,<8.5.0
30+
- esmf >=8.4.2,<8.7.0
3131
- esmf=*=mpi_mpich_*
3232
- f90nml
3333
- geometric_features >=1.2.0
@@ -46,7 +46,7 @@ requirements:
4646
- pyremap >=1.2.0,<2.0.0
4747
- python-dateutil
4848
- requests
49-
- scipy
49+
- scipy >=1.7.0
5050
- setuptools
5151
- shapely >=2.0,<3.0
5252
- xarray >=0.14.1

‎dev-spec.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cartopy >=0.18.0
88
cartopy_offlinedata
99
cmocean
1010
dask
11-
esmf >=8.4.0,<8.5.0
11+
esmf >=8.4.2,<8.7.0
1212
esmf=*=mpi_mpich_*
1313
f90nml
1414
geometric_features>=1.2.0
@@ -29,7 +29,7 @@ pyproj
2929
pyremap>=1.2.0,<2.0.0
3030
python-dateutil
3131
requests
32-
scipy
32+
scipy >=1.7.0
3333
setuptools
3434
shapely>=2.0,<3.0
3535
xarray>=0.14.1

‎docs/versions.rst

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Documentation On GitHub
2121
`v1.8.0`_ `1.8.0`_
2222
`v1.9.0`_ `1.9.0`_
2323
`v1.10.0`_ `1.10.0`_
24+
`v1.11.0`_ `1.11.0`_
2425
================ ===============
2526

2627
.. _`stable`: ../stable/index.html
@@ -40,6 +41,7 @@ Documentation On GitHub
4041
.. _`v1.8.0`: ../1.8.0/index.html
4142
.. _`v1.9.0`: ../1.9.0/index.html
4243
.. _`v1.10.0`: ../1.10.0/index.html
44+
.. _`v1.11.0`: ../1.11.0/index.html
4345
.. _`main`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/main
4446
.. _`develop`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop
4547
.. _`1.2.6`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.2.6
@@ -57,3 +59,4 @@ Documentation On GitHub
5759
.. _`1.8.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.8.0
5860
.. _`1.9.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.9.0
5961
.. _`1.10.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.10.0
62+
.. _`1.11.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.11.0

‎mpas_analysis/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
import matplotlib as mpl
44
mpl.use('Agg')
55

6-
__version_info__ = (1, 10, 0)
6+
__version_info__ = (1, 11, 0)
77
__version__ = '.'.join(str(vi) for vi in __version_info__)

‎mpas_analysis/default.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -3970,6 +3970,9 @@ areaSH = IceArea_timeseries/iceAreaSH_climo_20180710.nc
39703970
volNH = PIOMAS/PIOMASvolume_monthly_climo_20180710.nc
39713971
volSH = none
39723972

3973+
# mask sea ice that is thicker than this a threshold (m)
3974+
maxAllowedSeaIceThickness = None
3975+
39733976

39743977
[climatologyMapSeaIceProductionNH]
39753978
# options related to plotting horizontally remapped climatologies of

‎mpas_analysis/ocean/index_nino34.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import pandas as pd
1717
import numpy as np
1818
from scipy import signal, stats
19+
from scipy.signal.windows import tukey
1920
import matplotlib.pyplot as plt
2021

2122
from mpas_analysis.shared.climatology import climatology
@@ -400,7 +401,7 @@ def _compute_nino34_spectra(self, nino34Index):
400401

401402
# Move nino34Index to numpy to allow functionality with scipy routines
402403
ninoIndex = nino34Index.values
403-
window = signal.tukey(len(ninoIndex), alpha=0.1)
404+
window = tukey(len(ninoIndex), alpha=0.1)
404405
f, Pxx = signal.periodogram(window * ninoIndex,
405406
1.0 / constants.sec_per_month)
406407

‎mpas_analysis/sea_ice/time_series.py

+22-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# distributed with this code, or at
1010
# https://raw.githubusercontent.com/MPAS-Dev/MPAS-Analysis/main/LICENSE
1111

12+
import numpy as np
1213
import xarray as xr
1314

1415
from mpas_analysis.shared import AnalysisTask
@@ -590,6 +591,14 @@ def _compute_area_vol(self):
590591
config = self.config
591592
chunkYears = config.getint('timeSeriesSeaIceAreaVol', 'chunkYears')
592593

594+
maxAllowedSeaIceThickness = config.get(
595+
'timeSeriesSeaIceAreaVol', 'maxAllowedSeaIceThickness')
596+
597+
if maxAllowedSeaIceThickness == 'None':
598+
maxAllowedSeaIceThickness = None
599+
else:
600+
maxAllowedSeaIceThickness = float(maxAllowedSeaIceThickness)
601+
593602
outFileNames = {}
594603
for hemisphere in ['NH', 'SH']:
595604
baseDirectory = build_config_full_path(
@@ -612,6 +621,10 @@ def _compute_area_vol(self):
612621
startDate=self.startDate,
613622
endDate=self.endDate)
614623

624+
ds = ds.rename(
625+
{'timeMonthly_avg_iceAreaCell': 'iceConc',
626+
'timeMonthly_avg_iceVolumeCell': 'iceThick'})
627+
615628
nTime = ds.sizes['Time']
616629
# chunk into 10-year seguments so we don't run out of memory
617630
if nTime > 12 * chunkYears:
@@ -624,22 +637,26 @@ def _compute_area_vol(self):
624637
else:
625638
mask = dsMesh.latCell < 0
626639

640+
if maxAllowedSeaIceThickness is not None:
641+
mask = np.logical_and(mask,
642+
ds.iceThick <= maxAllowedSeaIceThickness)
643+
627644
dsAreaSum = (ds.where(mask) * dsMesh.areaCell).sum('nCells')
628645
dsAreaSum = dsAreaSum.rename(
629-
{'timeMonthly_avg_iceAreaCell': 'iceArea',
630-
'timeMonthly_avg_iceVolumeCell': 'iceVolume'})
646+
{'iceConc': 'iceArea',
647+
'iceThick': 'iceVolume'})
631648
dsAreaSum['iceThickness'] = (dsAreaSum.iceVolume /
632649
dsMesh.areaCell.sum('nCells'))
633650

634651
dsAreaSum['iceArea'].attrs['units'] = 'm$^2$'
635652
dsAreaSum['iceArea'].attrs['description'] = \
636-
'Total {} sea ice area'.format(hemisphere)
653+
f'Total {hemisphere} sea ice area'
637654
dsAreaSum['iceVolume'].attrs['units'] = 'm$^3$'
638655
dsAreaSum['iceVolume'].attrs['description'] = \
639-
'Total {} sea ice volume'.format(hemisphere)
656+
f'Total {hemisphere} sea ice volume'
640657
dsAreaSum['iceThickness'].attrs['units'] = 'm'
641658
dsAreaSum['iceThickness'].attrs['description'] = \
642-
'Mean {} sea ice volume'.format(hemisphere)
659+
f'Mean {hemisphere} sea ice volume'
643660

644661
dsTimeSeries[hemisphere] = dsAreaSum
645662

‎setup.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'pyproj',
3232
'python-dateutil',
3333
'requests',
34-
'scipy',
34+
'scipy>=1.7.0',
3535
'setuptools',
3636
'shapely>=2.0,<3.0',
3737
'six',
@@ -41,9 +41,8 @@
4141
with open(os.path.join(here, 'mpas_analysis', '__init__.py')) as f:
4242
init_file = f.read()
4343

44-
# version = re.search(r'{}\s*=\s*[(]([^)]*)[)]'.format('__version_info__'),
45-
# init_file).group(1).replace(', ', '.')
46-
version = '1.10.0rc2'
44+
version = re.search(r'{}\s*=\s*[(]([^)]*)[)]'.format('__version_info__'),
45+
init_file).group(1).replace(', ', '.')
4746

4847
setup(name='mpas_analysis',
4948
version=version,

0 commit comments

Comments
 (0)
Please sign in to comment.