geoschem/gcpy

[QUESTION] GCHP restart file strechted grid regridding using gcpy.file_regrid with ValueError

ab-chen opened this issue · 1 comments

Type your question below:

I'm following the Streched-Grid Simulation part of GCHP.readdocs to build a restart file. I installed the gcpy package in virtual environment with Conda 4.13.0 (not sure if this is a problem of not using 4.12.0).

My command:

(GCPY) [yuang007@svante-login Restarts]$ python -m gcpy.file_regrid \
> -i GEOSChem.Restart.fullchem.20180701_0000z.c24.nc4 \
> --dim_format_in checkpoint \
> --dim_format_out checkpoint \
> --cs_res_out 48 \
> --sg_params_out 3.6 275.0 37.0 \
> -o initial_GEOSChem_rst.nc

And the output:

/home/yuang007/.conda/envs/GCPY/lib/python3.9/site-packages/gcpy/file_regrid.py:8: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if LooseVersion(xe.__version__) < LooseVersion("0.2.1"):
Traceback (most recent call last):
  File "/home/yuang007/.conda/envs/GCPY/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/yuang007/.conda/envs/GCPY/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/yuang007/.conda/envs/GCPY/lib/python3.9/site-packages/gcpy/file_regrid.py", line 420, in <module>
    file_regrid(
  File "/home/yuang007/.conda/envs/GCPY/lib/python3.9/site-packages/gcpy/file_regrid.py", line 135, in file_regrid
    ds_out=xr.open_mfdataset(oface_files, combine='by_coords', concat_dim='F',engine='netcdf4')
  File "/home/yuang007/.conda/envs/GCPY/lib/python3.9/site-packages/xarray/backends/api.py", line 1018, in open_mfdataset
    raise ValueError(
ValueError: When combine='by_coords', passing a value for `concat_dim` has no effect. To manually combine along a specific dimension you should instead specify combine='nested' along with a value for `concat_dim`.

Not sure if the problem comes with the warning beforehand, or the ValueError.

Here's a screenshot of my folders and the error message.

image

Aha I later tried the new function gcpy.regrid_restart_file

It worked.

Though one odd thing happended that might worth looking into: it didn't work when I was using Visual Studio Code's remote ssh servers, but it later worked on Mac Terminal...