Hi, my cftime is installed but it still shows the below error in make boundary files.
cd ~/croco_pytools-v1.0.2/prepro
python make_bry.py
ERROR file below:
Reading CROCO grid: …/CROCO_FILES/croco_grd.nc
Traceback (most recent call last):
File “pandas/_libs/tslibs/timedeltas.pyx”, line 372, in pandas._libs.tslibs.timedeltas._maybe_cast_from_unit
File “pandas/_libs/tslibs/conversion.pyx”, line 126, in pandas._libs.tslibs.conversion.cast_from_unit
OverflowError: Python int too large to convert to C long
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 322, in decode_cf_datetime
dates = _decode_datetime_with_pandas(flat_num_dates, units, calendar)
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 270, in _decode_datetime_with_pandas
pd.to_timedelta(flat_num_dates.min(), time_units) + ref_date
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/pandas/core/tools/timedeltas.py”, line 211, in to_timedelta
return _coerce_scalar_to_timedelta_type(arg, unit=unit, errors=errors)
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/pandas/core/tools/timedeltas.py”, line 219, in _coerce_scalar_to_timedelta_type
result = Timedelta(r, unit)
File “pandas/_libs/tslibs/timedeltas.pyx”, line 1695, in pandas._libs.tslibs.timedeltas.Timedelta.new
File “pandas/_libs/tslibs/timedeltas.pyx”, line 351, in pandas._libs.tslibs.timedeltas.convert_to_timedelta64
File “pandas/_libs/tslibs/timedeltas.pyx”, line 374, in pandas._libs.tslibs.timedeltas._maybe_cast_from_unit
pandas._libs.tslibs.np_datetime.OutOfBoundsTimedelta: Cannot cast 9.969209968386869e+36 from D to ‘ns’ without overflow.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 216, in _decode_cf_datetime_dtype
result = decode_cf_datetime(example_value, units, calendar, use_cftime)
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 324, in decode_cf_datetime
dates = _decode_datetime_with_cftime(
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 240, in _decode_datetime_with_cftime
cftime.num2date(num_dates, units, calendar, only_use_cftime_datetimes=True)
File “src/cftime/_cftime.pyx”, line 587, in cftime._cftime.num2date
File “src/cftime/_cftime.pyx”, line 113, in cftime._cftime._dateparse
File “src/cftime/_cftime.pyx”, line 791, in cftime._cftime._parse_date
TypeError: int() argument must be a string, a bytes-like object or a number, not ‘NoneType’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/conventions.py”, line 440, in decode_cf_variables
new_vars[k] = decode_cf_variable(
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/conventions.py”, line 291, in decode_cf_variable
var = times.CFDatetimeCoder(use_cftime=use_cftime).decode(var, name=name)
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 995, in decode
dtype = _decode_cf_datetime_dtype(data, units, calendar, self.use_cftime)
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/coding/times.py”, line 226, in _decode_cf_datetime_dtype
raise ValueError(msg)
ValueError: unable to decode time units ‘days since 1-Jan-1993 00:00:0.0’ with ‘the default calendar’. Try opening your dataset with decode_times=False or installing cftime if it is not installed.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “/home/fpl/CONFIGS/Indian_Ocean/prepro/make_bry.py”, line 137, in
inpdat = Inp.getdata(inputdata,input_file,crocogrd,multi_files,
File “/home/fpl/CONFIGS/Indian_Ocean/prepro/./Modules/ibc_class.py”, line 44, in init
dataxr=xr.open_mfdataset(inputfile,combine=‘nested’,concat_dim=self.var[‘time_dim’])
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/backends/api.py”, line 1056, in open_mfdataset
datasets = [open_(p, **open_kwargs) for p in paths]
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/backends/api.py”, line 1056, in
datasets = [open_(p, **open_kwargs) for p in paths]
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/backends/api.py”, line 573, in open_dataset
backend_ds = backend.open_dataset(
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/backends/netCDF4_.py”, line 660, in open_dataset
ds = store_entrypoint.open_dataset(
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/backends/store.py”, line 46, in open_dataset
vars, attrs, coord_names = conventions.decode_cf_variables(
File “/home/fpl/miniconda3/envs/croco_pyenv/lib/python3.9/site-packages/xarray/conventions.py”, line 451, in decode_cf_variables
raise type(e)(f"Failed to decode variable {k!r}: {e}") from e
ValueError: Failed to decode variable ‘time’: unable to decode time units ‘days since 1-Jan-1993 00:00:0.0’ with ‘the default calendar’. Try opening your dataset with decode_times=False or installing cftime if it is not installed.