diff --git a/ci/recipe/meta.yaml b/ci/recipe/meta.yaml index 2e9accb5a..ce5acacc6 100644 --- a/ci/recipe/meta.yaml +++ b/ci/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "MPAS-Analysis" %} -{% set version = "1.10.0" %} +{% set version = "1.11.0rc1" %} package: name: {{ name|lower }} @@ -27,7 +27,7 @@ requirements: - cartopy_offlinedata - cmocean - dask - - esmf >=8.4.2,<8.5.0 + - esmf >=8.4.2,<8.7.0 - esmf=*=mpi_mpich_* - f90nml - geometric_features >=1.2.0 @@ -46,7 +46,7 @@ requirements: - pyremap >=1.2.0,<2.0.0 - python-dateutil - requests - - scipy + - scipy >=1.7.0 - setuptools - shapely >=2.0,<3.0 - xarray >=0.14.1 diff --git a/dev-spec.txt b/dev-spec.txt index 1504daf64..4beb253ca 100644 --- a/dev-spec.txt +++ b/dev-spec.txt @@ -8,7 +8,7 @@ cartopy >=0.18.0 cartopy_offlinedata cmocean dask -esmf >=8.4.0,<8.5.0 +esmf >=8.4.2,<8.7.0 esmf=*=mpi_mpich_* f90nml geometric_features>=1.2.0 @@ -29,7 +29,7 @@ pyproj pyremap>=1.2.0,<2.0.0 python-dateutil requests -scipy +scipy >=1.7.0 setuptools shapely>=2.0,<3.0 xarray>=0.14.1 diff --git a/docs/versions.rst b/docs/versions.rst index e558822d6..db8c9aec1 100644 --- a/docs/versions.rst +++ b/docs/versions.rst @@ -21,6 +21,7 @@ Documentation On GitHub `v1.8.0`_ `1.8.0`_ `v1.9.0`_ `1.9.0`_ `v1.10.0`_ `1.10.0`_ +`v1.11.0`_ `1.11.0`_ ================ =============== .. _`stable`: ../stable/index.html @@ -40,6 +41,7 @@ Documentation On GitHub .. _`v1.8.0`: ../1.8.0/index.html .. _`v1.9.0`: ../1.9.0/index.html .. _`v1.10.0`: ../1.10.0/index.html +.. _`v1.11.0`: ../1.11.0/index.html .. _`main`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/main .. _`develop`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/develop .. _`1.2.6`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.2.6 @@ -57,3 +59,4 @@ Documentation On GitHub .. _`1.8.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.8.0 .. _`1.9.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.9.0 .. _`1.10.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.10.0 +.. _`1.11.0`: https://github.com/MPAS-Dev/MPAS-Analysis/tree/1.11.0 diff --git a/mpas_analysis/__init__.py b/mpas_analysis/__init__.py index 3ed2043e3..672aa1d48 100644 --- a/mpas_analysis/__init__.py +++ b/mpas_analysis/__init__.py @@ -3,5 +3,5 @@ import matplotlib as mpl mpl.use('Agg') -__version_info__ = (1, 10, 0) +__version_info__ = (1, 11, 0) __version__ = '.'.join(str(vi) for vi in __version_info__) diff --git a/mpas_analysis/default.cfg b/mpas_analysis/default.cfg index db21d0aae..fdfa55fc3 100755 --- a/mpas_analysis/default.cfg +++ b/mpas_analysis/default.cfg @@ -3970,6 +3970,9 @@ areaSH = IceArea_timeseries/iceAreaSH_climo_20180710.nc volNH = PIOMAS/PIOMASvolume_monthly_climo_20180710.nc volSH = none +# mask sea ice that is thicker than this a threshold (m) +maxAllowedSeaIceThickness = None + [climatologyMapSeaIceProductionNH] # options related to plotting horizontally remapped climatologies of diff --git a/mpas_analysis/ocean/index_nino34.py b/mpas_analysis/ocean/index_nino34.py index 9bf05cbfd..e79a538f7 100644 --- a/mpas_analysis/ocean/index_nino34.py +++ b/mpas_analysis/ocean/index_nino34.py @@ -16,6 +16,7 @@ import pandas as pd import numpy as np from scipy import signal, stats +from scipy.signal.windows import tukey import matplotlib.pyplot as plt from mpas_analysis.shared.climatology import climatology @@ -400,7 +401,7 @@ def _compute_nino34_spectra(self, nino34Index): # Move nino34Index to numpy to allow functionality with scipy routines ninoIndex = nino34Index.values - window = signal.tukey(len(ninoIndex), alpha=0.1) + window = tukey(len(ninoIndex), alpha=0.1) f, Pxx = signal.periodogram(window * ninoIndex, 1.0 / constants.sec_per_month) diff --git a/mpas_analysis/sea_ice/time_series.py b/mpas_analysis/sea_ice/time_series.py index 6041427d7..01776dd90 100644 --- a/mpas_analysis/sea_ice/time_series.py +++ b/mpas_analysis/sea_ice/time_series.py @@ -9,6 +9,7 @@ # distributed with this code, or at # https://raw.githubusercontent.com/MPAS-Dev/MPAS-Analysis/main/LICENSE +import numpy as np import xarray as xr from mpas_analysis.shared import AnalysisTask @@ -590,6 +591,14 @@ def _compute_area_vol(self): config = self.config chunkYears = config.getint('timeSeriesSeaIceAreaVol', 'chunkYears') + maxAllowedSeaIceThickness = config.get( + 'timeSeriesSeaIceAreaVol', 'maxAllowedSeaIceThickness') + + if maxAllowedSeaIceThickness == 'None': + maxAllowedSeaIceThickness = None + else: + maxAllowedSeaIceThickness = float(maxAllowedSeaIceThickness) + outFileNames = {} for hemisphere in ['NH', 'SH']: baseDirectory = build_config_full_path( @@ -612,6 +621,10 @@ def _compute_area_vol(self): startDate=self.startDate, endDate=self.endDate) + ds = ds.rename( + {'timeMonthly_avg_iceAreaCell': 'iceConc', + 'timeMonthly_avg_iceVolumeCell': 'iceThick'}) + nTime = ds.sizes['Time'] # chunk into 10-year seguments so we don't run out of memory if nTime > 12 * chunkYears: @@ -624,22 +637,26 @@ def _compute_area_vol(self): else: mask = dsMesh.latCell < 0 + if maxAllowedSeaIceThickness is not None: + mask = np.logical_and(mask, + ds.iceThick <= maxAllowedSeaIceThickness) + dsAreaSum = (ds.where(mask) * dsMesh.areaCell).sum('nCells') dsAreaSum = dsAreaSum.rename( - {'timeMonthly_avg_iceAreaCell': 'iceArea', - 'timeMonthly_avg_iceVolumeCell': 'iceVolume'}) + {'iceConc': 'iceArea', + 'iceThick': 'iceVolume'}) dsAreaSum['iceThickness'] = (dsAreaSum.iceVolume / dsMesh.areaCell.sum('nCells')) dsAreaSum['iceArea'].attrs['units'] = 'm$^2$' dsAreaSum['iceArea'].attrs['description'] = \ - 'Total {} sea ice area'.format(hemisphere) + f'Total {hemisphere} sea ice area' dsAreaSum['iceVolume'].attrs['units'] = 'm$^3$' dsAreaSum['iceVolume'].attrs['description'] = \ - 'Total {} sea ice volume'.format(hemisphere) + f'Total {hemisphere} sea ice volume' dsAreaSum['iceThickness'].attrs['units'] = 'm' dsAreaSum['iceThickness'].attrs['description'] = \ - 'Mean {} sea ice volume'.format(hemisphere) + f'Mean {hemisphere} sea ice volume' dsTimeSeries[hemisphere] = dsAreaSum diff --git a/setup.py b/setup.py index d370dcd2c..5b0a84a7a 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ 'pyproj', 'python-dateutil', 'requests', - 'scipy', + 'scipy>=1.7.0', 'setuptools', 'shapely>=2.0,<3.0', 'six', @@ -41,9 +41,8 @@ with open(os.path.join(here, 'mpas_analysis', '__init__.py')) as f: init_file = f.read() -# version = re.search(r'{}\s*=\s*[(]([^)]*)[)]'.format('__version_info__'), -# init_file).group(1).replace(', ', '.') -version = '1.10.0rc2' +version = re.search(r'{}\s*=\s*[(]([^)]*)[)]'.format('__version_info__'), + init_file).group(1).replace(', ', '.') setup(name='mpas_analysis', version=version,