Project

General

Profile

Problem with setgrid and setzaxis using SCREAM data ...

Added by Niklas Roeber 3 months ago

Hi, I have some 3D SCREAM data to work with and need to apply some CDO magic. However, CDO seems not to recognize the correct grid size and size of the vertical axis. The dimensions are included properly, missing though is the field with the vertical axis. The dimension is defined, but missing under variables:

dimensions:
time = UNLIMITED ; // (8 currently)
lev = 101 ;
ncol = 25165824 ;
variables:
double time(time) ;
time:units = "days since 2019-08-01 00:00:00" ;
time:long_name = "time" ;
time:calendar = "noleap" ;
float qc(time, ncol, lev) ;
qc:units = "kg/kg" ;
qc:long_name = "qc" ;
qc:_FillValue = 3.402824e+33f ;
qc:averaging_count_tracker = "avg_count_Scalar3D_ncol_lev" ;
float qi(time, ncol, lev) ;
qi:units = "kg/kg" ;
qi:long_name = "qi" ;
qi:_FillValue = 3.402824e+33f ;
qi:averaging_count_tracker = "avg_count_Scalar3D_ncol_lev" ;
float area(ncol) ;
area:units = "1^2" ;
area:long_name = "area" ;
area:_FillValue = 3.402824e+33f ;
float lat(ncol) ;
lat:units = "1" ;
lat:long_name = "lat" ;
lat:_FillValue = 3.402824e+33f ;
float lon(ncol) ;
lon:units = "1" ;
lon:long_name = "lon" ;
lon:_FillValue = 3.402824e+33f ;

I do have the correct grid, which was actually also working with other data, yet not this one. When looking in the data using CDO infon, it shows:

-1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name
1 : 2020-08-04 00:01:40 0 2541748224 111563922 : 0.0000 4.5663e-06 0.0036551 : qc
2 : 2020-08-04 00:01:40 0 2541748224 111563922 : 0.0000 8.7254e-06 0.019309 : qi
3 : 2020-08-04 00:01:40 0 25165824 0 : 4.1613e-07 4.9934e-07 5.8827e-07 : area
4 : 2020-08-04 00:01:40 0 25165824 0 : -89.969 0.0000 89.969 : lat
5 : 2020-08-04 00:01:40 0 25165824 0 : 0.021973 180.00 359.98 : lon

Not sure if the grid size is generally the 2D grid, or the 2d grid times the vertical axis, in this case 101. When executing cdo with setgrid and/or setzaxis and selvar,qc,qi : CDO complains that no grid with the horizontal or vertical axis are fiund:

cdo(1) setzaxis (Warning): No zaxis with 101 levels found!
cdo setgrid (Warning): No horizontal grid with 25165824 cells found!

Any ideas on how to fix this?

Thanks and Cheers, Niklas


Replies (4)

RE: Problem with setgrid and setzaxis using SCREAM data ... - Added by Estanislao Gavilan 3 months ago

Hi Niklas,

setgrid and setzaxis need the information of your grid. You can find two example

setgrid
https://code.mpimet.mpg.de/boards/1/topics/12733?r=12747#message-12747

setzaxis
https://code.mpimet.mpg.de/boards/1/topics/12364?r=12371#message-12371

It seems your horizontal grid is unstructured. What do you want to achieve?

Kind regards,

Estanislao

RE: Problem with setgrid and setzaxis using SCREAM data ... - Added by Niklas Roeber 3 months ago

Thanks Estanislao,

I do have the correct grid and vertical axis and know how setgrid and setzaxis work. The issue is that something in the metadata seems not right, as usually for 3D data, cdo infon shows each vertical level individually, whereas in my case, it shows it as large field with #2Dgrid_cells*#vertical_levels. Is there a way in CDO to transform this large 2D array into a 3D array?

Thanks and Cheers, Niklas

RE: Problem with setgrid and setzaxis using SCREAM data ... - Added by Uwe Schulzweida 3 months ago

Hi Niklas,

you have to add the coordinate variable lev and some missing attributes:

ncap2 -s 'lev=array(0,1,$lev);lev@axis="Z"'  filename
ncatted -a units,lat,o,c,"degrees_north" -a units,lon,o,c,"degrees_east" -a coordinates,qc,c,c,"lat lon" -a coordinates,qi,c,c,"lat lon" -a coordinates,area,c,c,"lat lon"  filename
Cheers,
Uwe

RE: Problem with setgrid and setzaxis using SCREAM data ... - Added by Niklas Roeber 3 months ago

Thanks a lot Uwe! This does the trick!

Cheers, Niklas

    (1-4/4)