I think there's an inverted if statement causing an issue in the ocean_add_depth script. Specifically I think this should read if coordFileName is None: and not if coordFileName is not None:
>> ocean_add_depth -i mpaso.hist.am.timeSeriesStatsMonthly.2015-01-01.nc -o mpaso.hist.am.timeSeriesStatsMonthly.2015-01-01_withDepth.nc
Traceback (most recent call last):
File "/export/baldwin32/anaconda3/envs/pflow3/bin/ocean_add_depth", line 11, in <module>
sys.exit(main_add_depth())
File "/export/baldwin32/anaconda3/envs/pflow3/lib/python3.8/site-packages/mpas_tools/ocean/depth.py", line 174, in main_add_depth
add_depth(args.inFileName, args.outFileName,
File "/export/baldwin32/anaconda3/envs/pflow3/lib/python3.8/site-packages/mpas_tools/ocean/depth.py", line 121, in add_depth
dsCoord = xarray.open_dataset(coordFileName, mask_and_scale=False)
File "/export/baldwin32/anaconda3/envs/pflow3/lib/python3.8/site-packages/xarray/backends/api.py", line 557, in open_dataset
engine = _autodetect_engine(filename_or_obj)
File "/export/baldwin32/anaconda3/envs/pflow3/lib/python3.8/site-packages/xarray/backends/api.py", line 163, in _autodetect_engine
engine = _get_engine_from_magic_number(filename_or_obj)
File "/export/baldwin32/anaconda3/envs/pflow3/lib/python3.8/site-packages/xarray/backends/api.py", line 127, in _get_engine_from_magic_number
if filename_or_obj.tell() != 0:
AttributeError: 'NoneType' object has no attribute 'tell'
I think there's an inverted if statement causing an issue in the
ocean_add_depth
script. Specifically I think this should readif coordFileName is None:
and notif coordFileName is not None: