Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regridded tos fields are different with Dask<=2024.8.2 and Dask>=2024.9.0 #2607

Open
schlunma opened this issue Dec 4, 2024 · 30 comments
Open
Labels
bear at a dinner party Something very unexpected
Milestone

Comments

@schlunma
Copy link
Contributor

schlunma commented Dec 4, 2024

Hi, I have a fun one.

While testing #2517 using recipe_schlund20esd.yml, I found something very weird. For some models (not all!), one specific plot looks vastly different:

grafik

I could trace this back to the Dask version. Both plots use the current main branch of ESMValCore and ESMValTool, and all dependencies except for Dask are identical. The issue started appearing in Dask 2024.9.0 and also appears in the current version (2024.12.0, released yesterday). The latest version that looks ok is 2024.8.2.

This plot is derived from three variables. Only one preprocessed dataset is different in those two versions: tos, which is preprocessed like this:

  tropical_mask_40:
    regrid:
      target_grid: 2x2
      scheme: linear
    extract_region:
      start_latitude: -40
      end_latitude: 40
      start_longitude: 0
      end_longitude: 360

Here is one time slice (March 1980) of the original data and the preprocessed data with the two different Dask versions:

grafik

At first glance, both regridded datasets appear fine. However, if you look closely, you can see huge differences (e.g, 6°C in the Mediterranean Sea) between the two, but the one in the earlier Dask version clearly is more similar to the input data (which is what we want). Thus, the old version is clearly the correct one here.

I am honestly shocked that something like this could happen. The new field looks okayish and reasonable on its own, so without proper analysis and comparison to the original data you probably would think it's okay. This is super dangerous and makes this recipe not reproducible...

I have no idea what's going on here. Since all other dependencies are identical (e.g. numpy 1.26.4, iris 3.11, iris-esmf-regrid 0.11.0, netcdf4 1.7.2), this must be an issue of Dask. However, since the corresponding code is burried under many layers (iris-esmf-regrid, iris), it's very hard to find the actual problem.

@ESMValGroup/esmvaltool-coreteam any ideas? Should we pin Dask for now as an immediate fix and then try to dig deeper to find the underlying problem?

@schlunma schlunma added the bear at a dinner party Something very unexpected label Dec 4, 2024
@schlunma schlunma added this to the v2.12.0 milestone Dec 4, 2024
@rbeucher
Copy link
Contributor

rbeucher commented Dec 4, 2024

Thanks @schlunma
This is really scary. Sounds like the scenario none of us wants to see ever..
We will check on our side.

@valeriupredoi
Copy link
Contributor

@schlunma is there any variability? ie if you run the same thing 2-3 times, do you get the same results? Can you do a diff between the data between the two outputs pls, ie cube_old_dask.data - cube_new_dask.data so we are 100% sure that's not a plotting artifact? I'll dig deeper on this myself, looks pretty nasty indeed, and cheers for spotting it 🍺

@schlunma
Copy link
Contributor Author

schlunma commented Dec 5, 2024

No, no variability. It's exactly reproducible (I ran the recipe at least 20 times). I did a cdo diffn yesterday, which showed relative differences of >80% at some grid points, so I am 100% sure this is not a plotting issue.

Will try to reproduce this without using ESMValCore now.

@valeriupredoi
Copy link
Contributor

Good pointers Manu! Ok so next step is trying to isolate the source - will help too, later today

@bouweandela
Copy link
Member

This comment may be helpful in finding the source of the problem: dask/dask#11296 (comment)

@valeriupredoi
Copy link
Contributor

Could be the masking at play, my original issue at iris was SciTools/iris#6109 (maybe useful for the MRE). But diffs of 80% (ie not of billions of billions percent) suggest to me that there is a different problem - not fillvalues becoming actual data points. Sounds like the compiler that was used for Dask or any other numerical library we or another of our deps uses. Manu, have you checked that, even if versions are identical, builds like nompi or mpich are also identical?

@schlunma
Copy link
Contributor Author

schlunma commented Dec 5, 2024

I am using mamba install dask=2024.9.0 to switch Dask versions, which shows

  Package         Version  Build         Channel           Size
─────────────────────────────────────────────────────────────────
  Upgrade:
─────────────────────────────────────────────────────────────────

  - dask         2024.8.2  pyhd8ed1ab_0  conda-forge     Cached
  + dask         2024.9.0  pyhd8ed1ab_0  conda-forge     Cached
  - dask-core    2024.8.2  pyhd8ed1ab_0  conda-forge     Cached
  + dask-core    2024.9.0  pyhd8ed1ab_0  conda-forge     Cached
  - dask-expr      1.1.13  pyhd8ed1ab_0  conda-forge     Cached
  + dask-expr      1.1.14  pyhd8ed1ab_0  conda-forge     Cached
  - distributed  2024.8.2  pyhd8ed1ab_0  conda-forge     Cached
  + distributed  2024.9.0  pyhd8ed1ab_0  conda-forge     Cached

  Summary:

  Upgrade: 4 packages

So Dask is really the only package that's different between the two versions.

The issues gets even weirder: the bug does not happen with other time ranges. Currently, the recipe uses 1980-2004, but if all years are used the data looks fine.

I also tried to isolate this by setting up a simple Python script, but couldn't reproduce this without using our clip_timerange preprocessor. Replace regridding with the underlying iris-esmf scheme still gives the issue. I will investigate further, but currently Levante seems to have some issues.

@schlunma
Copy link
Contributor Author

schlunma commented Dec 5, 2024

All right, here's a little script to reproduce this without using ESMValCore. The problem appears only if the start year is 1980; with 1979, everything is fine.

import iris
import numpy as np
from iris.coords import DimCoord
from iris.cube import Cube
from esmf_regrid.schemes import ESMFBilinear
from iris.time import PartialDateTime

path = "/work/bd0854/DATA/ESMValTool2/CMIP6_DKRZ/CMIP/NCAR/CESM2/historical/r1i1p1f1/Omon/tos/gn/v20190308/tos_Omon_CESM2_historical_r1i1p1f1_gn_185001-201412.nc"


def extract_time(cube):
    # start_datetime = PartialDateTime(1979, 1, 1)  # no problem
    start_datetime = PartialDateTime(1980, 1, 1)  # problem
    end_datetime = PartialDateTime(2004, 12, 31)
    time_coord = cube.coord('time')
    dates = time_coord.units.num2date(time_coord.points)
    select = (dates >= start_datetime) & (dates < end_datetime)
    # Note: if dates are selected via ints, e.g., cube[1560:1860, ...] or an iris.Constraint, everything is fine as well.
    # It appears that we need boolean indexing for the bug to appear...
    return cube[select, ...]

def regrid(cube):
    lat = DimCoord(np.linspace(-89, 89, 90), standard_name="latitude", units="degrees")
    lon = DimCoord(np.linspace(1, 359, 180), standard_name="longitude", units="degrees")
    target_cube = Cube(np.ones((90, 180)), dim_coords_and_dims=[(lat, 0), (lon, 1)])
    return cube.regrid(target_cube, ESMFBilinear())

cube = iris.load_cube(path)
cube = extract_time(cube)
cube = regrid(cube)
path_regridded_cube = "bug.nc"
iris.save(cube, path_regridded_cube)
print("Saved", path_regridded_cube)

Comparison of output data:

$ # Starting date 1979
$ cdo diffn 1979_dask-2024-8-2.nc 1979_dask-2024-9-0.nc
cdo    diffn: Processed 10108800 values from 2 variables over 624 timesteps [0.10s 42MB]
$ # Starting date 1980
$ cdo diffn 1980_dask-2024-8-2.nc 1980_dask-2024-9-0.nc
               Date     Time   Level Gridsize    Miss    Diff : S Z  Max_Absdiff Max_Reldiff : Parameter name
     2 : 1980-02-14 00:00:00       0    16200       0   10251 : T F       8.5582     0.99935 : tos
     3 : 1980-03-15 12:00:00       0    16200       0   10251 : T F       13.328     0.99821 : tos
     4 : 1980-04-15 00:00:00       0    16200       0   10251 : T F       5.2479     0.99882 : tos
     5 : 1980-05-15 12:00:00       0    16200       0   10251 : T F       6.7898     0.99807 : tos
     6 : 1980-06-15 00:00:00       0    16200       0   10251 : T F       8.7143     0.99734 : tos
     7 : 1980-07-15 12:00:00       0    16200       0   10251 : T F       13.717     0.99826 : tos
     8 : 1980-08-15 12:00:00       0    16200       0   10251 : T F       3.6858     0.99967 : tos
     9 : 1980-09-15 00:00:00       0    16200       0   10251 : T F       10.937     0.99952 : tos
...
  299 of 300 records differ
cdo    diffn: Processed 9720000 values from 2 variables over 600 timesteps [0.08s 41MB]

I am utterly confused 🤯

I will work on something different for now, need a break from this..

@valeriupredoi
Copy link
Contributor

hey Manu, my turn to look into this, have just started testing with your sripty-script above, and offending file 🍺

@bettina-gier
Copy link
Contributor

Just to throw another problem here, I was running the #2178 recipe with my new environment with dask version 2014.11.2 and for the hourly data I ran into divide by 0 error coming from dask in the climate statistics preprocessor. After seeing this issue, I downgraded dask to 2024.8.2 and it ran fine. So there's probably several things that are impacted by recent dask changes. I assume it's different dask issues, as I get errors while Manuel has the more critical running but faulty output here.

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Dec 5, 2024

OK so using Manu's script above, and Dask 2024.8.0 or 2024.9.0, I'm getting these values for the mean of bug.nc data:
Dask 2024-8 mean data 3.041791241162517e+19
Dask 2024-9 mean data 14.116185222045326

so clearly an issue with masked values to start with, then, a mean on data that is below, say, 1000:

Dask 2024-8 mean data 14.1161852220453
Dask 2024-9 mean data 14.11618522204531

so this suggests to me at least the mean is almost identical; I went ahead and did the full sets of stats:

Dask 2024-8 mean data 14.1161852220453
Dask 2024-9 mean data 14.11618522204531
Dask 2024-8 median data 15.112035217801097
Dask 2024-9 median data 15.112035217801097
Dask 2024-8 min data -1.9527926674847191
Dask 2024-9 min data -1.9527926674847191
Dask 2024-8 max data 33.63783190194235
Dask 2024-9 max data 33.63783190194235

This suggests to me these datasets are identical apart from the fillvalue that is counted as actual data point in Dask 2024.8 - and that;s bc you slice through, and that's the issue I raised with Iris back in August

@schlunma
Copy link
Contributor Author

schlunma commented Dec 5, 2024

Did you create two different bug.nc files? You need to create one with dask-2024-8-2 and one with dask-2024-9-0 and then compare those.

It appears to me you only created one and then evaluated this with two different Dask versions. Since dask/dask#11296, you'll get the different mean in 2024-8-2.

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Dec 5, 2024

yes Manu, of course I created two different files 😄 - one per each Dask version

@valeriupredoi
Copy link
Contributor

(esmvaltool) valeriu@valeriu-PORTEGE-Z30-C:~$ ls -la *bug*
-rw-rw-r-- 1 valeriu valeriu 38910376 Dec  5 14:02 bug_Dask8.nc
-rw-rw-r-- 1 valeriu valeriu 38910376 Dec  5 13:56 bug_Dask9.nc

@valeriupredoi
Copy link
Contributor

note that my Dask 8 was 2024.8.0 not 2024.8.2 - am just about to test with .2 now

@valeriupredoi
Copy link
Contributor

so with Dask 2024.8.2 the masking issue disappears, and am getting almost identical results:

Dask 2024-8 mean data 14.11618522204531
Dask 2024-9 mean data 14.116185222045326
Dask 2024-8 median data 15.112035217801097
Dask 2024-9 median data 15.112035217801097
Dask 2024-8 min data -1.9527926674847191
Dask 2024-9 min data -1.9527926674847191
Dask 2024-8 max data 33.63783190194235
Dask 2024-9 max data 33.63783190194235

Note that I am using esmvalcore from the latest development branch, not 2.11.1 as you did, so I am now going to test with v2.11.1

@schlunma
Copy link
Contributor Author

schlunma commented Dec 5, 2024

My environment is also derived from the latest main branch. Could you try cdo diffn of the different files?

@valeriupredoi
Copy link
Contributor

(esmvaltool) valeriu@valeriu-PORTEGE-Z30-C:~$ cdo diffn bug_Dask8-2.nc bug_Dask9.nc 
               Date     Time   Level Gridsize    Miss    Diff : S Z  Max_Absdiff Max_Reldiff : Parameter name
     2 : 1980-02-14 00:00:00       0    16200       0   10251 : T F       8.5582     0.99935 : tos        
     3 : 1980-03-15 12:00:00       0    16200       0   10251 : T F       13.328     0.99821 : tos        
     4 : 1980-04-15 00:00:00       0    16200       0   10251 : T F       5.2479     0.99882 : tos        
     5 : 1980-05-15 12:00:00       0    16200       0   10251 : T F       6.7898     0.99807 : tos        
     6 : 1980-06-15 00:00:00       0    16200       0   10251 : T F       8.7143     0.99734 : tos        
     7 : 1980-07-15 12:00:00       0    16200       0   10251 : T F       13.717     0.99826 : tos        
     8 : 1980-08-15 12:00:00       0    16200       0   10251 : T F       3.6858     0.99967 : tos        
     9 : 1980-09-15 00:00:00       0    16200       0   10251 : T F       10.937     0.99952 : tos        
    10 : 1980-10-15 12:00:00       0    16200       0   10251 : T F       5.1875     0.99623 : tos        
    11 : 1980-11-15 00:00:00       0    16200       0   10251 : T F       7.2335     0.99806 : tos        
    12 : 1980-12-15 12:00:00       0    16200       0   10251 : T F       8.4805     0.99876 : tos        
    13 : 1981-01-15 12:00:00       0    16200       0   10251 : T F       11.844     0.99988 : tos        
    14 : 1981-02-14 00:00:00       0    16200       0   10251 : T F       18.413     0.99913 : tos        
    15 : 1981-03-15 12:00:00       0    16200       0   10251 : T F       7.6909     0.99958 : tos        
    16 : 1981-04-15 00:00:00       0    16200       0   10251 : T F       16.753     0.99977 : tos        
    17 : 1981-05-15 12:00:00       0    16200       0   10251 : T F       6.4559     0.99904 : tos        
    18 : 1981-06-15 00:00:00       0    16200       0   10251 : T F       7.4910     0.99950 : tos        
    19 : 1981-07-15 12:00:00       0    16200       0   10251 : T F       16.351     0.99969 : tos        
    20 : 1981-08-15 12:00:00       0    16200       0   10251 : T F       5.2336     0.99020 : tos        
    21 : 1981-09-15 00:00:00       0    16200       0   10251 : T F       18.580     0.99999 : tos        
    22 : 1981-10-15 12:00:00       0    16200       0   10251 : T F       5.8462     0.99204 : tos        
    23 : 1981-11-15 00:00:00       0    16200       0   10251 : T F       9.7922     0.99879 : tos        
    24 : 1981-12-15 12:00:00       0    16200       0   10251 : T F       2.8799     0.99559 : tos        
    25 : 1982-01-15 12:00:00       0    16200       0   10251 : T F       3.1838     0.99806 : tos        
    26 : 1982-02-14 00:00:00       0    16200       0   10251 : T F       9.0046     0.99992 : tos        
    27 : 1982-03-15 12:00:00       0    16200       0   10251 : T F       5.6559     0.99951 : tos        
    28 : 1982-04-15 00:00:00       0    16200       0   10251 : T F       10.560     0.99852 : tos        
    29 : 1982-05-15 12:00:00       0    16200       0   10251 : T F       7.9878     0.99960 : tos        
    30 : 1982-06-15 00:00:00       0    16200       0   10251 : T F       7.3269     0.99989 : tos        
    31 : 1982-07-15 12:00:00       0    16200       0   10251 : T F       5.1663     0.99915 : tos        
    32 : 1982-08-15 12:00:00       0    16200       0   10251 : T F       16.696     0.99980 : tos        
    33 : 1982-09-15 00:00:00       0    16200       0   10251 : T F       12.609     0.99916 : tos        
    34 : 1982-10-15 12:00:00       0    16200       0   10251 : T F       5.9232     0.99901 : tos        
    35 : 1982-11-15 00:00:00       0    16200       0   10251 : T F       5.1861     0.99498 : tos        
    36 : 1982-12-15 12:00:00       0    16200       0   10251 : T F       11.469     0.99979 : tos        
    37 : 1983-01-15 12:00:00       0    16200       0   10251 : T F       16.185     0.99941 : tos        
    38 : 1983-02-14 00:00:00       0    16200       0   10251 : T F       15.429     0.99956 : tos        
    39 : 1983-03-15 12:00:00       0    16200       0   10251 : T F       9.9988     0.99750 : tos        
    40 : 1983-04-15 00:00:00       0    16200       0   10251 : T F       20.169     0.99817 : tos        
    41 : 1983-05-15 12:00:00       0    16200       0   10251 : T F       15.066     0.99579 : tos        
    42 : 1983-06-15 00:00:00       0    16200       0   10251 : T F       10.912     0.99900 : tos        
    43 : 1983-07-15 12:00:00       0    16200       0   10251 : T F       5.0382     0.99940 : tos        
    44 : 1983-08-15 12:00:00       0    16200       0   10251 : T F       17.881     0.99866 : tos        
    45 : 1983-09-15 00:00:00       0    16200       0   10251 : T F       17.143     0.99978 : tos        
    46 : 1983-10-15 12:00:00       0    16200       0   10251 : T F       4.5873     0.99918 : tos        
    47 : 1983-11-15 00:00:00       0    16200       0   10251 : T F       4.5705     0.99865 : tos        
    48 : 1983-12-15 12:00:00       0    16200       0   10251 : T F       4.2516     0.99587 : tos        
    49 : 1984-01-15 12:00:00       0    16200       0   10251 : T F       3.4234     0.99689 : tos        
    50 : 1984-02-14 00:00:00       0    16200       0   10251 : T F       8.9694     0.99941 : tos        
    51 : 1984-03-15 12:00:00       0    16200       0   10251 : T F       3.5947     0.99929 : tos        
    52 : 1984-04-15 00:00:00       0    16200       0   10251 : T F       9.7174     0.99876 : tos        
    53 : 1984-05-15 12:00:00       0    16200       0   10251 : T F       10.688     0.99921 : tos        
    54 : 1984-06-15 00:00:00       0    16200       0   10251 : T F       12.672     0.99973 : tos        
    55 : 1984-07-15 12:00:00       0    16200       0   10251 : T F       14.552     0.99899 : tos        
    56 : 1984-08-15 12:00:00       0    16200       0   10251 : T F       6.8627     0.99956 : tos        
    57 : 1984-09-15 00:00:00       0    16200       0   10251 : T F       12.819     0.99999 : tos        
    58 : 1984-10-15 12:00:00       0    16200       0   10251 : T F       5.5096     0.99984 : tos        
    59 : 1984-11-15 00:00:00       0    16200       0   10251 : T F       5.6899     0.99990 : tos        
    60 : 1984-12-15 12:00:00       0    16200       0   10251 : T F       7.4950     0.99818 : tos        
    61 : 1985-01-15 12:00:00       0    16200       0   10251 : T F       8.7777     0.99880 : tos        
    62 : 1985-02-14 00:00:00       0    16200       0   10251 : T F       16.721     0.99979 : tos        
    63 : 1985-03-15 12:00:00       0    16200       0   10251 : T F       7.6138     0.99787 : tos        
    64 : 1985-04-15 00:00:00       0    16200       0   10251 : T F       16.908     0.99910 : tos        
    65 : 1985-05-15 12:00:00       0    16200       0   10251 : T F       8.3770     0.99799 : tos        
    66 : 1985-06-15 00:00:00       0    16200       0   10251 : T F       8.8165     0.99775 : tos        
    67 : 1985-07-15 12:00:00       0    16200       0   10251 : T F       18.874     0.99954 : tos        
    68 : 1985-08-15 12:00:00       0    16200       0   10251 : T F       5.0860     0.99906 : tos        
    69 : 1985-09-15 00:00:00       0    16200       0   10251 : T F       20.278     0.99968 : tos        
    70 : 1985-10-15 12:00:00       0    16200       0   10251 : T F       5.3559     0.99790 : tos        
    71 : 1985-11-15 00:00:00       0    16200       0   10251 : T F       5.5262     0.99979 : tos        
    72 : 1985-12-15 12:00:00       0    16200       0   10251 : T F       7.0811     0.99330 : tos        
    73 : 1986-01-15 12:00:00       0    16200       0   10251 : T F       7.0557     0.99617 : tos        
    74 : 1986-02-14 00:00:00       0    16200       0   10251 : T F       6.2126     0.99539 : tos        
    75 : 1986-03-15 12:00:00       0    16200       0   10251 : T F       5.0203     0.99802 : tos        
    76 : 1986-04-15 00:00:00       0    16200       0   10251 : T F       9.5465     0.99942 : tos        
    77 : 1986-05-15 12:00:00       0    16200       0   10251 : T F       10.532     0.99949 : tos        
    78 : 1986-06-15 00:00:00       0    16200       0   10251 : T F       15.893     0.99799 : tos        
    79 : 1986-07-15 12:00:00       0    16200       0   10251 : T F       5.3192     0.99666 : tos        
    80 : 1986-08-15 12:00:00       0    16200       0   10251 : T F       20.542     0.99903 : tos        
    81 : 1986-09-15 00:00:00       0    16200       0   10251 : T F       16.357     0.99726 : tos        
    82 : 1986-10-15 12:00:00       0    16200       0   10251 : T F       5.0806     0.99901 : tos        
    83 : 1986-11-15 00:00:00       0    16200       0   10251 : T F       6.2452     0.99731 : tos        
    84 : 1986-12-15 12:00:00       0    16200       0   10251 : T F       6.3925     0.99891 : tos        
    85 : 1987-01-15 12:00:00       0    16200       0   10251 : T F       14.060     0.99940 : tos        
    86 : 1987-02-14 00:00:00       0    16200       0   10251 : T F       14.184     0.99967 : tos        
    87 : 1987-03-15 12:00:00       0    16200       0   10251 : T F       7.6169     0.99992 : tos        
    88 : 1987-04-15 00:00:00       0    16200       0   10251 : T F       15.641     0.99935 : tos        
    89 : 1987-05-15 12:00:00       0    16200       0   10251 : T F       11.195     0.99891 : tos        
    90 : 1987-06-15 00:00:00       0    16200       0   10251 : T F       5.7909     0.99584 : tos        
    91 : 1987-07-15 12:00:00       0    16200       0   10251 : T F       7.6914     0.99951 : tos        
    92 : 1987-08-15 12:00:00       0    16200       0   10251 : T F       13.839     0.99635 : tos        
    93 : 1987-09-15 00:00:00       0    16200       0   10251 : T F       19.107     0.99913 : tos        
    94 : 1987-10-15 12:00:00       0    16200       0   10251 : T F       16.658     0.99977 : tos        
    95 : 1987-11-15 00:00:00       0    16200       0   10251 : T F       11.608     0.99861 : tos        
    96 : 1987-12-15 12:00:00       0    16200       0   10251 : T F       6.8828     0.99560 : tos        
    97 : 1988-01-15 12:00:00       0    16200       0   10251 : T F       7.6590     0.99974 : tos        
    98 : 1988-02-14 00:00:00       0    16200       0   10251 : T F       13.653     0.99791 : tos        
    99 : 1988-03-15 12:00:00       0    16200       0   10251 : T F       17.442     0.99964 : tos        
   100 : 1988-04-15 00:00:00       0    16200       0   10251 : T F       18.201     0.99795 : tos        
   101 : 1988-05-15 12:00:00       0    16200       0   10251 : T F       13.452     0.99999 : tos        
   102 : 1988-06-15 00:00:00       0    16200       0   10251 : T F       7.6354     0.99984 : tos        
   103 : 1988-07-15 12:00:00       0    16200       0   10251 : T F       6.7684     0.99855 : tos        
   104 : 1988-08-15 12:00:00       0    16200       0   10251 : T F       13.005     0.99982 : tos        
   105 : 1988-09-15 00:00:00       0    16200       0   10251 : T F       16.596     0.99881 : tos        
   106 : 1988-10-15 12:00:00       0    16200       0   10251 : T F       16.519     0.99977 : tos        
   107 : 1988-11-15 00:00:00       0    16200       0   10251 : T F       12.406     0.99657 : tos        
   108 : 1988-12-15 12:00:00       0    16200       0   10251 : T F       8.2609     0.99740 : tos        
   109 : 1989-01-15 12:00:00       0    16200       0   10251 : T F       7.3502     0.99835 : tos        
   110 : 1989-02-14 00:00:00       0    16200       0   10251 : T F       13.814     0.99873 : tos        
   111 : 1989-03-15 12:00:00       0    16200       0   10251 : T F       17.973     0.99940 : tos        
   112 : 1989-04-15 00:00:00       0    16200       0   10251 : T F       16.451     0.99976 : tos        
   113 : 1989-05-15 12:00:00       0    16200       0   10251 : T F       11.501     0.99944 : tos        
   114 : 1989-06-15 00:00:00       0    16200       0   10251 : T F       6.2373     0.99732 : tos        
   115 : 1989-07-15 12:00:00       0    16200       0   10251 : T F       7.6020     0.99922 : tos        
   116 : 1989-08-15 12:00:00       0    16200       0   10251 : T F       13.817     0.99985 : tos        
   117 : 1989-09-15 00:00:00       0    16200       0   10251 : T F       16.237     0.99976 : tos        
   118 : 1989-10-15 12:00:00       0    16200       0   10251 : T F       15.091     0.99981 : tos        
   119 : 1989-11-15 00:00:00       0    16200       0   10251 : T F       10.679     0.99987 : tos        
   120 : 1989-12-15 12:00:00       0    16200       0   10251 : T F       6.3928     0.99816 : tos        
   121 : 1990-01-15 12:00:00       0    16200       0   10251 : T F       8.0152     0.99950 : tos        
   122 : 1990-02-14 00:00:00       0    16200       0   10251 : T F       15.205     0.99812 : tos        
   123 : 1990-03-15 12:00:00       0    16200       0   10251 : T F       18.682     0.99979 : tos        
   124 : 1990-04-15 00:00:00       0    16200       0   10251 : T F       19.273     0.99895 : tos        
   125 : 1990-05-15 12:00:00       0    16200       0   10251 : T F       14.518     0.99922 : tos        
   126 : 1990-06-15 00:00:00       0    16200       0   10251 : T F       6.0978     0.99953 : tos        
   127 : 1990-07-15 12:00:00       0    16200       0   10251 : T F       8.2620     0.99467 : tos        
   128 : 1990-08-15 12:00:00       0    16200       0   10251 : T F       12.967     0.99821 : tos        
   129 : 1990-09-15 00:00:00       0    16200       0   10251 : T F       17.721     0.99943 : tos        
   130 : 1990-10-15 12:00:00       0    16200       0   10251 : T F       17.671     0.99975 : tos        
   131 : 1990-11-15 00:00:00       0    16200       0   10251 : T F       12.255     0.99972 : tos        
   132 : 1990-12-15 12:00:00       0    16200       0   10251 : T F       6.1553     0.99874 : tos        
   133 : 1991-01-15 12:00:00       0    16200       0   10251 : T F       7.6305     0.99952 : tos        
   134 : 1991-02-14 00:00:00       0    16200       0   10251 : T F       12.764     0.99943 : tos        
   135 : 1991-03-15 12:00:00       0    16200       0   10251 : T F       16.392     0.99957 : tos        
   136 : 1991-04-15 00:00:00       0    16200       0   10251 : T F       16.071     0.99825 : tos        
   137 : 1991-05-15 12:00:00       0    16200       0   10251 : T F       12.128     0.99996 : tos        
   138 : 1991-06-15 00:00:00       0    16200       0   10251 : T F       6.3274     0.99955 : tos        
   139 : 1991-07-15 12:00:00       0    16200       0   10251 : T F       6.7975     0.98836 : tos        
   140 : 1991-08-15 12:00:00       0    16200       0   10251 : T F       14.055      1.0000 : tos        
   141 : 1991-09-15 00:00:00       0    16200       0   10251 : T F       18.798     0.99845 : tos        
   142 : 1991-10-15 12:00:00       0    16200       0   10251 : T F       17.372     0.99923 : tos        
   143 : 1991-11-15 00:00:00       0    16200       0   10251 : T F       10.184     0.99959 : tos        
   144 : 1991-12-15 12:00:00       0    16200       0   10251 : T F       7.4604     0.99848 : tos        
   145 : 1992-01-15 12:00:00       0    16200       0   10251 : T F       9.0846     0.99643 : tos        
   146 : 1992-02-14 00:00:00       0    16200       0   10251 : T F       12.917     0.99824 : tos        
   147 : 1992-03-15 12:00:00       0    16200       0   10251 : T F       18.034     0.99856 : tos        
   148 : 1992-04-15 00:00:00       0    16200       0   10251 : T F       17.967     0.99990 : tos        
   149 : 1992-05-15 12:00:00       0    16200       0   10251 : T F       13.527     0.99917 : tos        
   150 : 1992-06-15 00:00:00       0    16200       0   10251 : T F       6.4600     0.99939 : tos        
   151 : 1992-07-15 12:00:00       0    16200       0   10251 : T F       6.9242     0.99392 : tos        
   152 : 1992-08-15 12:00:00       0    16200       0   10251 : T F       13.110     0.99732 : tos        
   153 : 1992-09-15 00:00:00       0    16200       0   10251 : T F       17.816     0.99976 : tos        
   154 : 1992-10-15 12:00:00       0    16200       0   10251 : T F       17.133     0.99656 : tos        
   155 : 1992-11-15 00:00:00       0    16200       0   10251 : T F       11.211     0.99983 : tos        
   156 : 1992-12-15 12:00:00       0    16200       0   10251 : T F       5.9306     0.99893 : tos        
   157 : 1993-01-15 12:00:00       0    16200       0   10251 : T F       6.5804     0.99984 : tos        
   158 : 1993-02-14 00:00:00       0    16200       0   10251 : T F       12.617     0.99777 : tos        
   159 : 1993-03-15 12:00:00       0    16200       0   10251 : T F       16.637     0.99972 : tos        
   160 : 1993-04-15 00:00:00       0    16200       0   10251 : T F       16.800     0.99986 : tos        
   161 : 1993-05-15 12:00:00       0    16200       0   10251 : T F       12.392     0.99963 : tos        
   162 : 1993-06-15 00:00:00       0    16200       0   10251 : T F       5.6832     0.99977 : tos        
   163 : 1993-07-15 12:00:00       0    16200       0   10251 : T F       8.0302     0.99965 : tos        
   164 : 1993-08-15 12:00:00       0    16200       0   10251 : T F       16.215     0.99919 : tos        
   165 : 1993-09-15 00:00:00       0    16200       0   10251 : T F       19.263     0.99950 : tos        
   166 : 1993-10-15 12:00:00       0    16200       0   10251 : T F       17.140     0.99829 : tos        
   167 : 1993-11-15 00:00:00       0    16200       0   10251 : T F       12.469     0.99791 : tos        
   168 : 1993-12-15 12:00:00       0    16200       0   10251 : T F       6.2103     0.98526 : tos        
   169 : 1994-01-15 12:00:00       0    16200       0   10251 : T F       7.0701     0.99722 : tos        
   170 : 1994-02-14 00:00:00       0    16200       0   10251 : T F       12.154     0.99984 : tos        
   171 : 1994-03-15 12:00:00       0    16200       0   10251 : T F       15.628     0.99571 : tos        
   172 : 1994-04-15 00:00:00       0    16200       0   10251 : T F       15.525     0.99495 : tos        
   173 : 1994-05-15 12:00:00       0    16200       0   10251 : T F       11.670     0.99773 : tos        
   174 : 1994-06-15 00:00:00       0    16200       0   10251 : T F       6.5453     0.99937 : tos        
   175 : 1994-07-15 12:00:00       0    16200       0   10251 : T F       7.7446     0.99990 : tos        
   176 : 1994-08-15 12:00:00       0    16200       0   10251 : T F       13.990     0.99953 : tos        
   177 : 1994-09-15 00:00:00       0    16200       0   10251 : T F       18.290     0.99724 : tos        
   178 : 1994-10-15 12:00:00       0    16200       0   10251 : T F       16.821     0.99980 : tos        
   179 : 1994-11-15 00:00:00       0    16200       0   10251 : T F       11.345     0.99690 : tos        
   180 : 1994-12-15 12:00:00       0    16200       0   10251 : T F       9.7702     0.99478 : tos        
   181 : 1995-01-15 12:00:00       0    16200       0   10251 : T F       8.1563     0.99774 : tos        
   182 : 1995-02-14 00:00:00       0    16200       0   10251 : T F       16.259     0.99987 : tos        
   183 : 1995-03-15 12:00:00       0    16200       0   10251 : T F       19.452     0.99878 : tos        
   184 : 1995-04-15 00:00:00       0    16200       0   10251 : T F       19.010     0.99889 : tos        
   185 : 1995-05-15 12:00:00       0    16200       0   10251 : T F       13.687     0.99889 : tos        
   186 : 1995-06-15 00:00:00       0    16200       0   10251 : T F       6.3844     0.99764 : tos        
   187 : 1995-07-15 12:00:00       0    16200       0   10251 : T F       8.1770     0.99477 : tos        
   188 : 1995-08-15 12:00:00       0    16200       0   10251 : T F       14.025     0.99898 : tos        
   189 : 1995-09-15 00:00:00       0    16200       0   10251 : T F       18.521     0.99878 : tos        
   190 : 1995-10-15 12:00:00       0    16200       0   10251 : T F       18.510     0.99864 : tos        
   191 : 1995-11-15 00:00:00       0    16200       0   10251 : T F       13.402     0.99832 : tos        
   192 : 1995-12-15 12:00:00       0    16200       0   10251 : T F       6.5861     0.99883 : tos        
   193 : 1996-01-15 12:00:00       0    16200       0   10251 : T F       8.3787     0.99962 : tos        
   194 : 1996-02-14 00:00:00       0    16200       0   10251 : T F       14.087     0.99901 : tos        
   195 : 1996-03-15 12:00:00       0    16200       0   10251 : T F       18.553     0.99877 : tos        
   196 : 1996-04-15 00:00:00       0    16200       0   10251 : T F       18.363     0.99993 : tos        
   197 : 1996-05-15 12:00:00       0    16200       0   10251 : T F       13.555     0.99974 : tos        
   198 : 1996-06-15 00:00:00       0    16200       0   10251 : T F       4.9059     0.98511 : tos        
   199 : 1996-07-15 12:00:00       0    16200       0   10251 : T F       7.2515     0.99992 : tos        
   200 : 1996-08-15 12:00:00       0    16200       0   10251 : T F       13.546     0.99955 : tos        
   201 : 1996-09-15 00:00:00       0    16200       0   10251 : T F       17.161     0.99985 : tos        
   202 : 1996-10-15 12:00:00       0    16200       0   10251 : T F       16.405     0.99838 : tos        
   203 : 1996-11-15 00:00:00       0    16200       0   10251 : T F       11.652     0.99968 : tos        
   204 : 1996-12-15 12:00:00       0    16200       0   10251 : T F       5.5366     0.99824 : tos        
   205 : 1997-01-15 12:00:00       0    16200       0   10251 : T F       7.0104     0.99975 : tos        
   206 : 1997-02-14 00:00:00       0    16200       0   10251 : T F       14.407     0.99849 : tos        
   207 : 1997-03-15 12:00:00       0    16200       0   10251 : T F       18.315     0.99795 : tos        
   208 : 1997-04-15 00:00:00       0    16200       0   10251 : T F       18.033     0.99929 : tos        
   209 : 1997-05-15 12:00:00       0    16200       0   10251 : T F       12.909     0.99974 : tos        
   210 : 1997-06-15 00:00:00       0    16200       0   10251 : T F       5.3485     0.99852 : tos        
   211 : 1997-07-15 12:00:00       0    16200       0   10251 : T F       8.7752     0.99994 : tos        
   212 : 1997-08-15 12:00:00       0    16200       0   10251 : T F       14.152     0.99734 : tos        
   213 : 1997-09-15 00:00:00       0    16200       0   10251 : T F       17.211     0.99921 : tos        
   214 : 1997-10-15 12:00:00       0    16200       0   10251 : T F       16.029     0.99984 : tos        
   215 : 1997-11-15 00:00:00       0    16200       0   10251 : T F       12.496     0.99762 : tos        
   216 : 1997-12-15 12:00:00       0    16200       0   10251 : T F       8.4974     0.99620 : tos        
   217 : 1998-01-15 12:00:00       0    16200       0   10251 : T F       6.7542     0.99935 : tos        
   218 : 1998-02-14 00:00:00       0    16200       0   10251 : T F       13.679     0.99995 : tos        
   219 : 1998-03-15 12:00:00       0    16200       0   10251 : T F       17.103     0.99853 : tos        
   220 : 1998-04-15 00:00:00       0    16200       0   10251 : T F       16.425     0.99971 : tos        
   221 : 1998-05-15 12:00:00       0    16200       0   10251 : T F       12.211     0.99244 : tos        
   222 : 1998-06-15 00:00:00       0    16200       0   10251 : T F       5.8863     0.99944 : tos        
   223 : 1998-07-15 12:00:00       0    16200       0   10251 : T F       7.4675     0.99969 : tos        
   224 : 1998-08-15 12:00:00       0    16200       0   10251 : T F       15.978     0.99968 : tos        
   225 : 1998-09-15 00:00:00       0    16200       0   10251 : T F       20.389     0.99840 : tos        
   226 : 1998-10-15 12:00:00       0    16200       0   10251 : T F       20.141     0.99902 : tos        
   227 : 1998-11-15 00:00:00       0    16200       0   10251 : T F       13.236     0.99978 : tos        
   228 : 1998-12-15 12:00:00       0    16200       0   10251 : T F       6.6291     0.99742 : tos        
   229 : 1999-01-15 12:00:00       0    16200       0   10251 : T F       7.9135     0.99997 : tos        
   230 : 1999-02-14 00:00:00       0    16200       0   10251 : T F       12.426     0.99747 : tos        
   231 : 1999-03-15 12:00:00       0    16200       0   10251 : T F       15.165     0.99872 : tos        
   232 : 1999-04-15 00:00:00       0    16200       0   10251 : T F       15.024     0.99876 : tos        
   233 : 1999-05-15 12:00:00       0    16200       0   10251 : T F       11.513     0.99917 : tos        
   234 : 1999-06-15 00:00:00       0    16200       0   10251 : T F       5.0380     0.99672 : tos        
   235 : 1999-07-15 12:00:00       0    16200       0   10251 : T F       9.1857     0.99769 : tos        
   236 : 1999-08-15 12:00:00       0    16200       0   10251 : T F       16.752     0.99779 : tos        
   237 : 1999-09-15 00:00:00       0    16200       0   10251 : T F       22.505     0.99989 : tos        
   238 : 1999-10-15 12:00:00       0    16200       0   10251 : T F       20.839     0.99987 : tos        
   239 : 1999-11-15 00:00:00       0    16200       0   10251 : T F       14.044     0.99848 : tos        
   240 : 1999-12-15 12:00:00       0    16200       0   10251 : T F       8.0878     0.99983 : tos        
   241 : 2000-01-15 12:00:00       0    16200       0   10251 : T F       7.4674     0.99822 : tos        
   242 : 2000-02-14 00:00:00       0    16200       0   10251 : T F       11.169     0.99772 : tos        
   243 : 2000-03-15 12:00:00       0    16200       0   10251 : T F       15.774     0.99923 : tos        
   244 : 2000-04-15 00:00:00       0    16200       0   10251 : T F       16.599     0.99889 : tos        
   245 : 2000-05-15 12:00:00       0    16200       0   10251 : T F       11.671     0.99981 : tos        
   246 : 2000-06-15 00:00:00       0    16200       0   10251 : T F       4.6943     0.99744 : tos        
   247 : 2000-07-15 12:00:00       0    16200       0   10251 : T F       7.9546     0.99658 : tos        
   248 : 2000-08-15 12:00:00       0    16200       0   10251 : T F       14.426     0.99527 : tos        
   249 : 2000-09-15 00:00:00       0    16200       0   10251 : T F       19.585     0.99975 : tos        
   250 : 2000-10-15 12:00:00       0    16200       0   10251 : T F       18.574     0.99753 : tos        
   251 : 2000-11-15 00:00:00       0    16200       0   10251 : T F       13.688     0.99987 : tos        
   252 : 2000-12-15 12:00:00       0    16200       0   10251 : T F       9.4651     0.99817 : tos        
   253 : 2001-01-15 12:00:00       0    16200       0   10251 : T F       6.7753     0.99979 : tos        
   254 : 2001-02-14 00:00:00       0    16200       0   10251 : T F       11.131     0.99596 : tos        
   255 : 2001-03-15 12:00:00       0    16200       0   10251 : T F       15.192     0.99995 : tos        
   256 : 2001-04-15 00:00:00       0    16200       0   10251 : T F       15.635     0.99707 : tos        
   257 : 2001-05-15 12:00:00       0    16200       0   10251 : T F       12.051     0.99917 : tos        
   258 : 2001-06-15 00:00:00       0    16200       0   10251 : T F       6.7482     0.99871 : tos        
   259 : 2001-07-15 12:00:00       0    16200       0   10251 : T F       8.0699     0.99965 : tos        
   260 : 2001-08-15 12:00:00       0    16200       0   10251 : T F       14.026     0.99981 : tos        
   261 : 2001-09-15 00:00:00       0    16200       0   10251 : T F       17.988     0.99954 : tos        
   262 : 2001-10-15 12:00:00       0    16200       0   10251 : T F       17.592     0.99995 : tos        
   263 : 2001-11-15 00:00:00       0    16200       0   10251 : T F       12.088     0.99880 : tos        
   264 : 2001-12-15 12:00:00       0    16200       0   10251 : T F       7.1083     0.99862 : tos        
   265 : 2002-01-15 12:00:00       0    16200       0   10251 : T F       7.4374     0.99945 : tos        
   266 : 2002-02-14 00:00:00       0    16200       0   10251 : T F       13.008     0.99556 : tos        
   267 : 2002-03-15 12:00:00       0    16200       0   10251 : T F       17.696     0.99999 : tos        
   268 : 2002-04-15 00:00:00       0    16200       0   10251 : T F       17.620     0.99968 : tos        
   269 : 2002-05-15 12:00:00       0    16200       0   10251 : T F       11.668     0.99880 : tos        
   270 : 2002-06-15 00:00:00       0    16200       0   10251 : T F       6.3864     0.99838 : tos        
   271 : 2002-07-15 12:00:00       0    16200       0   10251 : T F       9.0929     0.99982 : tos        
   272 : 2002-08-15 12:00:00       0    16200       0   10251 : T F       16.793     0.99966 : tos        
   273 : 2002-09-15 00:00:00       0    16200       0   10251 : T F       19.459     0.99997 : tos        
   274 : 2002-10-15 12:00:00       0    16200       0   10251 : T F       17.733     0.99799 : tos        
   275 : 2002-11-15 00:00:00       0    16200       0   10251 : T F       11.347     0.99911 : tos        
   276 : 2002-12-15 12:00:00       0    16200       0   10251 : T F       7.7483     0.99749 : tos        
   277 : 2003-01-15 12:00:00       0    16200       0   10251 : T F       8.4915     0.99887 : tos        
   278 : 2003-02-14 00:00:00       0    16200       0   10251 : T F       13.895     0.99947 : tos        
   279 : 2003-03-15 12:00:00       0    16200       0   10251 : T F       17.781     0.99991 : tos        
   280 : 2003-04-15 00:00:00       0    16200       0   10251 : T F       19.550     0.99915 : tos        
   281 : 2003-05-15 12:00:00       0    16200       0   10251 : T F       15.314     0.99927 : tos        
   282 : 2003-06-15 00:00:00       0    16200       0   10251 : T F       7.8897     0.99972 : tos        
   283 : 2003-07-15 12:00:00       0    16200       0   10251 : T F       7.8263     0.99996 : tos        
   284 : 2003-08-15 12:00:00       0    16200       0   10251 : T F       13.894     0.99981 : tos        
   285 : 2003-09-15 00:00:00       0    16200       0   10251 : T F       17.898     0.99696 : tos        
   286 : 2003-10-15 12:00:00       0    16200       0   10251 : T F       15.965     0.99991 : tos        
   287 : 2003-11-15 00:00:00       0    16200       0   10251 : T F       10.694     0.99622 : tos        
   288 : 2003-12-15 12:00:00       0    16200       0   10251 : T F       5.9024     0.99790 : tos        
   289 : 2004-01-15 12:00:00       0    16200       0   10251 : T F       8.7993     0.99700 : tos        
   290 : 2004-02-14 00:00:00       0    16200       0   10251 : T F       14.702     0.99947 : tos        
   291 : 2004-03-15 12:00:00       0    16200       0   10251 : T F       18.170     0.99949 : tos        
   292 : 2004-04-15 00:00:00       0    16200       0   10251 : T F       18.350     0.99859 : tos        
   293 : 2004-05-15 12:00:00       0    16200       0   10251 : T F       14.646     0.99959 : tos        
   294 : 2004-06-15 00:00:00       0    16200       0   10251 : T F       8.9104     0.99719 : tos        
   295 : 2004-07-15 12:00:00       0    16200       0   10251 : T F       7.5508     0.99296 : tos        
   296 : 2004-08-15 12:00:00       0    16200       0   10251 : T F       13.711     0.99821 : tos        
   297 : 2004-09-15 00:00:00       0    16200       0   10251 : T F       18.189     0.99986 : tos        
   298 : 2004-10-15 12:00:00       0    16200       0   10251 : T F       16.489     0.99918 : tos        
   299 : 2004-11-15 00:00:00       0    16200       0   10251 : T F       10.779     0.99931 : tos        
   300 : 2004-12-15 12:00:00       0    16200       0   10251 : T F       6.6629     0.99995 : tos        
  299 of 300 records differ

@schlunma
Copy link
Contributor Author

schlunma commented Dec 5, 2024

Yes! This is what I got, too. Very interesting that all statistics you calculated seem to be the same, but the actual data is still different...

@valeriupredoi
Copy link
Contributor

shifted most probably, lemme try get some sense of how the data is arranged

@valeriupredoi
Copy link
Contributor

yep indeed, points differ:

print(c1dat[100, 30, 50])
print(c2dat[100, 30, 50])

19.318310830559554
17.266978445348297

but exactly 17.2... lives in the other file at index (array([56]), array([30]), array([50])), and coverseley, 19.3... lives in the other file at index (array([144]), array([30]), array([50])) exactly 44 time points shifted from 100 like the other one, but +44 not -44

@valeriupredoi
Copy link
Contributor

OK finally finally figured this shtuff out! 🍺 Stay put for shtuff

@valeriupredoi
Copy link
Contributor

SciTools/iris#6251

@bouweandela
Copy link
Member

Considering SciTools/iris#6251 (comment), would adding a pin on our dask version make sense?

@valeriupredoi
Copy link
Contributor

no, hang on, I wanted to reply to the iris issue, but then I forgot - lemme go there, thanks for the reminder, bud 🍺

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Dec 17, 2024

SciTools/iris#6251 (comment)

So I'd really go with not using bool slices anymore - deffo a bug in Iris, they are not yet ready to fix it, pinning Dask at such an old version will only give us more headaches

@schlunma
Copy link
Contributor Author

schlunma commented Dec 18, 2024

Considering SciTools/iris#6251 (comment), would adding a pin on our dask version make sense?

As I already mentioned in the PR description, I think pinning Dask to 2024.8.2 as a temporary solution would probably make sense. With the latest release of 2024.12.1 yesterday, we even got more problems with Dask: https://app.circleci.com/pipelines/github/ESMValGroup/ESMValCore/12287/workflows/59e8e9e5-a46a-46a7-8cee-7e5d3958bfe9/jobs/51396...

@valeriupredoi
Copy link
Contributor

we don't see those barfs in the GA tests though - there could be interplay with other dev packages https://github.com/ESMValGroup/ESMValCore/actions/runs/12384390417/job/34568856143

OK, iris have decided to pin Dask anyway, so there's not much room for wiggle for us here - hopefully we're not getting hit badly with such an old Dask, plus, I got about one hour left for work this year, so am not gonna split the Red Sea in this last hour of work 😁 🎄

@schlunma
Copy link
Contributor Author

Yeah, hopefully we can sort this out very soon. Looks like another big problem with Dask (distributed) will be solved in one of the upcoming releases.

@schlunma
Copy link
Contributor Author

This turned out to be a Dask bug! A fix has already been merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bear at a dinner party Something very unexpected
Projects
None yet
Development

No branches or pull requests

5 participants