aidanheerdegen / publish_cosima_data

0 stars 1 forks source link

0.1° ice - variables incompatible #21

Closed AndyHoggANU closed 4 years ago

AndyHoggANU commented 4 years ago

Splitvar has a minor issue with some of the ice files at 0.1°. These are the files from 1985-2004 which seemed to have a slightly different ice grid. Our intention was to override these with -a grid.nc but it seems to have picked up an incompatibility via this error message:

Traceback (most recent call last):
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/bin/splitvar", line 10,
 in <module>
    sys.exit(main_argv())
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/splitvar/cli.py", line 123, in main_argv
    main_parse_args(sys.argv[1:])
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/splitvar/cli.py", line 117, in main_parse_args
    return main(parse_args(args))
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/splitvar/cli.py", line 148, in main
    ds = add_vars(ds, args.add, timevar)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/splitvar/splitvar.py", line 346, in add_vars
    ds = xarray.merge([ds,add_ds])
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/xarray/core/merge.py", line 782, in merge
    merge_result = merge_core(dict_like_objects, compat, join, fill_value=fill_value)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/xarray/core/merge.py", line 544, in merge_core
    variables, out_indexes = merge_collected(collected, prioritized, compat=compat)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/xarray/core/merge.py", line 217, in merge_collected
    merged_vars[name] = unique_variable(name, variables, compat)
  File "/g/data3/hh5/public/apps/miniconda3/envs/analysis3-19.10/lib/python3.6/site-pack
ages/xarray/core/merge.py", line 135, in unique_variable
    "You can skip this check by specifying compat='override'.".format(name)
xarray.core.merge.MergeError: conflicting values for variable 'TLON' on objects to be co
mbined. You can skip this check by specifying compat='override'.

I think this is something that needs to be altered in splitvar itself -- unless we can pass that argument through?

aidanheerdegen commented 4 years ago

I think all the grid variables that are in the grid.nc file should be excluded, so adding

-x TLON -x TLAT -x ULON -x ULAT -x NCAT 

to the splitvar call should avoid this.

AndyHoggANU commented 4 years ago

OK, so there were heaps of -x variables - I had to delete them because they weren't defined in every case. Have added these ones back in and will re-test.

Note that there are some other variables in grid.nc, but am hoping this are not used?

AndyHoggANU commented 4 years ago

OK, this works. There is a remaining error with aicen-m, because it wasn't saved for the first couple of years. Not much we can do about this - have removed this diagnostic from the list of variables for the 0.1° simulation.