Regridding using CDO

85 Views Asked by At

I am using the following cdo command to obtain the information of a grid file (from AQUA/Modis):

cdo griddes file_AQUA.nc

In this step, the following information was obtained:

gridID 1 #
gridtype = lonlat
gridsize = 37324800
xsize = 8640
ysize = 4320
xname = lon
xlongname = "Longitude"
xunits = "degrees_east"
yname = lat
ylongname = "Latitude"
yunits = "degrees_north"
xfirst = -179.9792
xinc = 0.04166667
yfirst = 89.97916
yinc = -0.04166667 #

gridID 2 #
gridtype = generic
gridsize = 768
xsize = 256
ysize = 3
cdo griddes: Processed 3 variables [0.00s 11MB]

My next step was to generate a text file with the grid information of the AQUA/Modis file through the command: cdo griddes file_AQUA.nc > grid_file_AQUA.txt

I would like to use this text grid file information to regridding a NetCDF file (from ORAS5). I am using this command:

cdo -O remapbil,grid_file_AQUA.txt file_ORAS.nc new_file_ORAS.nc

The file was created, but the temperature variable is incorrect when I tried to extract it. (Expected COUNT to be positive)

1

There are 1 best solutions below

0
On

You don't need to go through the step of extracting the grid description, you can remap to the grid of another dataset by just specifying that file as the "target" in this way:

cdo -O remapbil,grid_file_AQUA.nc file_ORAS.nc new_file_ORAS.nc

I'm not sure what you mean though by the error, "count expected to be positive". Please try this solution and see if it solves the issue, and if not, clarify and I will update my answer accordingly.