Regridding cam file to blom grid
Added by Sébastien Barthélémy 2 months ago
Hello,
I would like to regrid atmospheric CAM outputs to the oceanic BLOM grid. The BLOM grid is defined in a netcdf file: grid.nc. I have tried the following:
cdo -griddes grid.nc > mygrid cdo -selname,mygrid cam_file.nc blom_file.nc
The grid type of BLOM is considered to be generic and therefore I get the well known error message: "cdo remapbic (Abort): Unsupported target grid type (generic)!"
However the lon/lat information in each point of the grid are contained in grid.nc:
double plon(y, x) ; plon:units = "degrees_east" ; plon:long_name = "Longitude at p-points" ; plon:corners = "pclon" ; double plat(y, x) ; plat:units = "degrees_north" ; plat:long_name = "Latitude at p-points" ; plat:corners = "pclat" ;
Therefore, before I get into programming my own horizontal 2D interpolation program from CAM to BLOM I would like to know if this is possible to do it with cdo.
Thanks in advance for any insight on the question.
Sébastien
Replies (3)
RE: Regridding cam file to blom grid - Added by Estanislao Gavilan 2 months ago
Hi Sebastien,
You can perfectly do it. The problem must be in the grid or the cam file. Can you output the attributes of both files? I suspect the cam file does not have the coordinate attribute.
Best regards,
Estanislao
RE: Regridding cam file to blom grid - Added by Sébastien Barthélémy 2 months ago
Hi Estanislao,
Based on the error message, I would say that the problem comes from the destination grid, that of blom. Here is the output of the attributes of the cam file:
cdo -griddes N1850frc2_f09_tn14_14560201.cam.h1.1456-03-01-00000.nc cdi warning (cdf_check_variables): Unsupported data type (char/string), skipped variable date_written! cdi warning (cdf_check_variables): Unsupported data type (char/string), skipped variable time_written! # # gridID 1 # gridtype = lonlat gridsize = 192 ysize = 192 yname = lat ylongname = "latitude" yunits = "degrees_north" yfirst = -90 yinc = 0.942408376963351 # # gridID 2 # gridtype = generic gridsize = 1 # # gridID 3 # gridtype = lonlat gridsize = 55296 xsize = 288 ysize = 192 xname = lon xlongname = "longitude" xunits = "degrees_east" yname = lat ylongname = "latitude" yunits = "degrees_north" xfirst = 0 xinc = 1.25 yfirst = -90 yinc = 0.942408376963351 cdo griddes: Processed 13 variables [0.47s 15MB]
Here is the output of the attributes of the blom file:
cdi warning (find_time_vars): Time variable >time< not found! # # gridID 1 # gridtype = generic gridsize = 138600 xsize = 360 ysize = 385 cdo griddes: Processed 104 variables [0.21s 37MB]
It says that the blom grid is generic despite it contains the lonlat coordinates for the p-cells (those I am interested in) as shows the command:
ncdummp -h grid.nc netcdf grid { dimensions: x = 360 ; y = 385 ; nv = 4 ; pcomp = 86708 ; qcomp = 88239 ; ucomp = 88642 ; vcomp = 87942 ; variables: ... double plon(y, x) ; plon:units = "degrees_east" ; plon:long_name = "Longitude at p-points" ; plon:corners = "pclon" ; double plat(y, x) ; plat:units = "degrees_north" ; plat:long_name = "Latitude at p-points" ; plat:corners = "pclat" ; ... // global attributes: :nreg = 2 ; }
RE: Regridding cam file to blom grid - Added by Estanislao Gavilan 2 months ago
Hi Sebastien,
I think you need to add the attribute coordinates to the cam file as cdo needs that attribute for the remapping. Also, I thought BLOM uses a curvilinear grid. If that is the case you need to change the gridtype to curvilinear.
Best regards,
Estanislao