diff --git a/VERSION b/VERSION index 87ce492908ab2362771f27134bab4a075348a8f3..444877d48fb6923ffb0c7c872a3eebb1f8ca5def 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.2 +3.5.3 diff --git a/doc/source/conf.py b/doc/source/conf.py index e939abc022f68b1bb3fb8cced31f39a25c082455..9e05183a21e968fe542d7550cedb670a2c755327 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,7 +65,7 @@ copyright = u"2020, BSC-CNS Earth Sciences Department" # The short X.Y version. version = "3.5" # The full version, including alpha/beta/rc tags. -release = "3.5.1" +release = "3.5.3" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/earthdiagnostics/data_convention.py b/earthdiagnostics/data_convention.py index 5e4dd4b5a96d8ce236f70485a6e7e36556a32df7..c6bb6aabd5d72be53211e50413242c45b17df097 100644 --- a/earthdiagnostics/data_convention.py +++ b/earthdiagnostics/data_convention.py @@ -896,6 +896,9 @@ class Cmor3Convention(DataConvention): if not os.path.isdir(base_path): base_path = base_path.replace( '/original_files/cmorfiles/', '/cmorfiles/') + if not os.path.isdir(base_path): + base_path = base_path.replace( + '/cmorfiles/', '/diags/') versions = os.listdir(base_path) versions.sort(reverse=True) self.config.cmor.version = versions[0] diff --git a/earthdiagnostics/ocean/density.py b/earthdiagnostics/ocean/density.py index d4d4aea489c0ef4916727764385fc1ce29f0829f..69b070c487f15c6bbe49362ecbcc51d783ca1283 100644 --- a/earthdiagnostics/ocean/density.py +++ b/earthdiagnostics/ocean/density.py @@ -134,7 +134,7 @@ class Density(Diagnostic): np.full(bigthetao.shape[1:], ref_pressure, dtype=np.float32) )) - sigma_values = np.stack(sigma_values) + sigma_values = np.ma.masked_invalid(np.stack(sigma_values)) sigma_cube = bigthetao.copy(sigma_values) sigma_cube.var_name = f'sigma{sigma}' sigma_cube.standard_name = 'sea_water_sigma_theta' @@ -144,7 +144,7 @@ class Density(Diagnostic): ) sigma_cube.units = 'kg m-3' temp = TempFile.get() - iris.save(sigma_cube, temp, zlib=True) + iris.save(sigma_cube, temp, zlib=True, fill_value=1e20) del sigma_cube del sigma_values self.sigma[sigma].set_local_file(temp) diff --git a/earthdiagnostics/ocean/interpolatecdo.py b/earthdiagnostics/ocean/interpolatecdo.py index 3de0f28ac58d00a67b402fab8e73d0ec174d5d90..42dd17a99020e021b2296c43bae56a7ca06254cd 100644 --- a/earthdiagnostics/ocean/interpolatecdo.py +++ b/earthdiagnostics/ocean/interpolatecdo.py @@ -1,6 +1,7 @@ # coding=utf-8 """CDO-based interpolation""" import os +from cdo import CDOException import numpy as np @@ -399,11 +400,25 @@ class InterpolateCDO(Diagnostic): handler.close() temp = TempFile.get() - Utils.cdo().remap( - ",".join((self.grid.split("_")[0], self.weights)), - input=variable_file, - output=temp, - ) + try: + Utils.cdo().remap( + ",".join((self.grid.split("_")[0], self.weights)), + input=variable_file, + output=temp, + ) + except CDOException as ex: + msg = ( + '(cdf_put_vara_double): NetCDF: Numeric ' + 'conversion not representable' + ) + if msg not in ex.msg: + raise + Utils.cdo().remap( + ",".join((self.grid.split("_")[0], self.weights)), + input=variable_file, + output=temp, + options='-b F64' + ) handler = Utils.open_cdf(temp) if units: