Project

General

Profile

Remap fails when variables have additional dimensions

Added by Paolo Andreozzi 3 months ago

Hi there, I am trying to remap from generic to rectangular coordinates but I get

% cdo -remapnn,global_1.0 -setgrid,griddes_o79.txt minimal_broken.nc please_help_me.nc
cdo(1) setgrid: Process started

cdo    remapnn (Abort): Unsupported generic coordinates (Variable: sw_albedo)!

That has description:

float sw_albedo(rgrid, sw_albedo_band)

Is it possible to regrid a file with generic dimensions like:

dimensions:
        level = 137 ;
        half_level = 138 ;
        rgrid = 28480 ;
        sw_albedo_band = 6 ;

?

what should I do not to make the regridding fail?
Ideally, I would like cdo to take care only of the rgrid dimension and leave the rest untouched (as if they were different variables)

Attached the grid description, a minimal_broken.nc case that fails and a minimal_good.nc that regrids successfully.
cdo version: 2.2.0

Thanks in advance! :-)


Replies (5)

RE: Remap fails when variables have additional dimensions - Added by Estanislao Gavilan 3 months ago

Dear Paolo,

I am really sorry. I tried to download your minimal_good.nc, but I deleted it by mistake. Can you upload it again, please? I have never done something like this, but you could try to include the attribute coordinates in your variable. It should look something like this

float sw_albedo(rgrid, sw_albedo_band);
sw_albedo:_FillValue = NaNf;
sw_albedo:long_name = "Shortwave surface albedo to diffuse radiation"
sw_albedo:units = "1";
sw_albedo:coordinates = "rgrid sw_albedo_band";

Kind regards,

Estanislao

RE: Remap fails when variables have additional dimensions - Added by Paolo Andreozzi 3 months ago

Dear Estanislao,

Thank you for your message. Here is the good file, simply without sw_albedo (;
Unfortunately, assigning coordinates attribute did not solve the problem.

Best,

Paolo

RE: Remap fails when variables have additional dimensions - Added by Estanislao Gavilan 3 months ago

Hi Paolo,

I have tried different ways to remap your data, but it seems the dimension sw_albedo_band breaks everything. I am not sure why the dimension half_level is accepted, but not sw_albedo_band. Lets see wait for the devs, they probably know why.

RE: Remap fails when variables have additional dimensions - Added by Paolo Andreozzi 3 months ago

Hi Estanislao,

Thank you very much for looking into this! I am looking forward to understanding what goes wrong in this case because it would solve many analogous ones for me! :-)

Best,

Paolo

RE: Remap fails when variables have additional dimensions - Added by Estanislao Gavilan 3 months ago

Hi Paolo,

I was able to make it work. You need to make a few changes in your file. You need to define your sw_albedo_band and add the attribute level to it. Probably, this is not the correct way to do it. Also, it might give you problems if you want to use cdo commands that require the z axis. So be careful after changing your attributes.

Kind regards,

Estanislao

PS: I attach you my edited version

paolo.nc (30.7 MB) paolo.nc
    (1-5/5)