icenet-ai / icenet

The icenet library is a pip installable python package containing the commands and code you need to produce forecasts
MIT License
20 stars 7 forks source link

CMIP6 wind rotation issues #24

Closed JimCircadian closed 2 years ago

JimCircadian commented 2 years ago

Do we need to rotate? According to the original papers code Tom never did, so this was probably in err to begin with!

DEBUG:root:Regridding ./data/cmip6/north/rsds/MRI-ESM2-0.r1i1p1f1/2099/latlon_2099_10_18.nc
INFO:root:Saving regridded data to ./data/cmip6/north/rsds/MRI-ESM2-0.r1i1p1f1/2099/2099_10_18.nc... 
INFO:root:CMIP rotating: MRI-ESM2-0 r1i1p1f1
INFO:root:Rotating wind data in ./data/cmip6/north/uas ./data/cmip6/north/vas
INFO:root:41915 files for uas
INFO:root:41941 files for vas
Traceback (most recent call last):
  File "/data/hpcdata/users/jambyr/miniconda3/envs/icenet-green/bin/icenet_data_cmip", line 33, in <module>
    sys.exit(load_entry_point('icenet2', 'console_scripts', 'icenet_data_cmip')())
  File "/data/hpcdata/users/jambyr/icenet/icenet2.green/icenet2/data/interfaces/esgf.py", line 313, in main
    downloader.rotate_wind_data()
  File "/data/hpcdata/users/jambyr/icenet/icenet2.green/icenet2/data/interfaces/downloader.py", line 250, in rotate_wind_data
    assert len(wind_files[apply_to[0]]) == len(wind_files[apply_to[1]]), \
AssertionError: The wind file datasets are unequal in length
JimCircadian commented 2 years ago

No trouble in rotating the southern hemisphere, which was the expected behaviour before I removed the rotation call

INFO:root:Rotating ./data/cmip6/south/uas/MRI-ESM2-0.r1i1p1f1/2100/2100_12_31.nc and ./data/cmip6/south/vas/MRI-ESM2-0.r1i1p1f1/2100/2100_12_31.nc
DEBUG:root:Writing ./data/cmip6/south/uas/MRI-ESM2-0.r1i1p1f1/2100/temp.2100_12_31.nc
DEBUG:root:Writing ./data/cmip6/south/vas/MRI-ESM2-0.r1i1p1f1/2100/temp.2100_12_31.nc

Therefore, this needs checking for verification but also hints at a silent failure during downloading and processing out the wind files. This is especially true given all four (southern and northern uas and vas) datasets appear complete...

JimCircadian commented 2 years ago

Whilst making a cup of tea I have realised the obvious, it definitely doesn't need rotating because the sic for the output is from the CMIP data. What a plonker Rodney...