@@ -74,7 +74,11 @@ def cmorise(self, file_paths, compound_name, cmor_dataset_json, mip_table):
7474 dim_mapping = mapping ["dimensions" ]
7575 axes = {dim_mapping .get (axis , axis ): axis for axis in var .dims }
7676
77- data = var .values
77+ # CMOR 3.10 no longer accept NaN values as missing data. Use 1e20 instead.
78+ # Fill Nan in data
79+ var_fixed = var .fillna (1e20 )
80+
81+ data = var_fixed .values
7882 lat_axis = axes .pop ("latitude" )
7983 lat = ds [lat_axis ].values
8084 lat_bnds = ds [ds [lat_axis ].attrs ["bounds" ]].values
@@ -181,7 +185,11 @@ def cmorise_ocean(self, file_paths, compound_name, cmor_dataset_json, mip_table)
181185 y = np .arange (j_axis .size , dtype = "float" )
182186 y_bnds = np .array ([[y_ - 0.5 , y_ + 0.5 ] for y_ in y ])
183187
184- data = var .values
188+ # CMOR 3.10 no longer accept NaN values as missing data. Use 1e20 instead.
189+ # Fill Nan in data
190+ var_fixed = var .fillna (1e20 )
191+
192+ data = var_fixed .values
185193 lat = self .supergrid .lat
186194 lat_bnds = self .supergrid .lat_bnds
187195
@@ -317,6 +325,7 @@ def cmorise(self, file_paths, compound_name, cmor_dataset_json, mip_table):
317325 x = np .arange (i_axis .size , dtype = "float" )
318326 y = np .arange (j_axis .size , dtype = "float" )
319327
328+ # CMOR 3.10 no longer accept NaN values as missing data. Use 1e20 instead.
320329 # Fill Nan in data
321330 var_fixed = var .fillna (1e20 )
322331
0 commit comments