Project

General

Profile

"cdi warning (cdf_set_dim)" and "cdi warning (cdfInqContents)"

Added by Simon Driscoll 4 months ago

Hi,

I'm using cdo to regrid ERA5 data from regular grids to polar stereographic grids. An example netCDF file is attached represent 1 month of daily data for total precipitation.

If I do, e.g.

(/home/jovyan/lustre_scratch/conda-envs/cdo_py3916) jovyan@jupyter-simondriscoll:~/lustre_scratch/data/data_driven_emulator/era5/preprocessed_only_downloaded_data/total_precipitation$

cdo remapbil,gridfile_master.txt era5daily_mean_total_precipitation_2002_01_to_regrid.nc ps_era5daily_mean_total_precipitation_2002_01_to_regrid.nc

I get:

cdi warning (cdf_set_dim): Inconsistent dimension definition for lat! dimid = 0; type = 3; newtype = 2
cdi warning (cdf_set_dim): Inconsistent dimension definition for lon! dimid = 0; type = 3; newtype = 1
cdi warning (cdfInqContents): Coordinates variable realization can't be assigned!
cdo remapbil: Bilinear weights from lonlat (1440x361) to projection (608x896) grid
cdo remapbil: Processed 16115040 values from 1 variable over 31 timesteps [2.04s 161MB]

But it does produce/process values as said to give that "ps_era5daily_mean_total_precipitation_2002_01_to_regrid.nc" file.

What does this mean?

Thank you so much for any assistance!!


Replies (4)

RE: "cdi warning (cdf_set_dim)" and "cdi warning (cdfInqContents)" - Added by Estanislao Gavilan 4 months ago

Hi Simon,

those are warnings, they should not impact in your remapping. I think those warnings mean that your lat and lon are dimensions and variables. Actually, I am not 100% sure. I am sure one of the devs will explain it much better than me. I noticed that precipitation has the wrong coordinates, that why you are having that third warning. If you type "ncdump -h era*.ncm, you can see

float tp(time, lat, lon) ;
tp:_FillValue = NaNf ;
tp:long_name = "Total precipitation" ;
tp:units = "m" ;
tp:standard_name = "lwe_thickness_of_precipitation_amount" ;
tp:comment = "bla bla bla cdo rocks." ;
tp:type = "real" ;
tp:accumulated_since = "start of timestep" ;
tp:coordinates = "realization" ;

The coordinate attributes should be lat lon. You can correct this easily with nco. You should install it in your computer, it is so convenient correct attributes with nco.

ncatted -a coordinates,tp,c,c,"lat lon" input.nc output.nc

RE: "cdi warning (cdf_set_dim)" and "cdi warning (cdfInqContents)" - Added by Simon Driscoll 4 months ago

Hi Estanislao,

thank you so much for your reply!

1) do you mean that ERA5 files themselves have wrong coordinates? ("I noticed that precipitation has the wrong coordinates, that why you are having that third warning.") Or do you mean that I should fix the coordinate attributes in the regridded file after regridding using your lat/lon suggestion? ("ncatted -a coordinates,tp,c,c,"lat lon" input.nc output.nc")

2) "I am sure one of the devs will explain it much better than me." Should I wait for one of those to read this thread :)

Thanks and Happy New Year!

Simon

RE: "cdi warning (cdf_set_dim)" and "cdi warning (cdfInqContents)" - Added by Estanislao Gavilan 4 months ago

Hi Simon,

I usually do not have problems with the ERA5 dataset, but this file has the wrong coordinates attributes. You should change it to lat lon, and then you can do the regridding. I am not sure why you did not get any error with those attributes. Did you check the regridded data to see if it makes sense?

Kind regards,

Estanislao

PS: Happy new year.

RE: "cdi warning (cdf_set_dim)" and "cdi warning (cdfInqContents)" - Added by Simon Driscoll 4 months ago

Hi Estanislao,

I downloaded the ERA5 data directly and then it's stored on servers I don't have all the permissions on. I can see if they will allow me to have nco to do this, thanks!

The regridded data visually appears to be exactly as expected, but obviously there may be just some subtle inaccuracies and I want to be super sure. :) (Also I'll go through to check the official ERA5 data sources - this is an official download source as recommended by their official team so it's odd why the data is mislablelled/attributed).

Thank you so much as always for super prompt replies!

Simon

    (1-4/4)