Remapping from fine to coarse resolution on curvilinear grids
Added by François Roberge over 7 years ago
Hello,
I want to remap daymet 1-km daily precipitation data over a 10km curvilinear grid. I can't use bilinear interpolation since it won't use all the points. I thought of using the operator remapcon, but it only works on latlon grid. I tried with gridboxmean,10,10 but I get the warning message : cdo gridboxmean (Warning): Using constant grid cell area weights for variable prcp
What do you suggest?
Thank you all!
Replies (12)
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by François Roberge over 7 years ago
Here is the info from the original 1km grid :
File format : netCDF4 classic
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown Daymet instant 1 1 1 1 I16 : -1
2 : unknown Daymet instant 1 1 63098050 2 F32 : -2
Grid coordinates :
1 : generic : points=1
2 : curvilinear : points=63098050 (7814x8075)
lon : -180 to 180 degrees_east
lat : 6.08138 to 83.7933 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 5 steps
RefTime = 1980-01-01 00:00:00 Units = days Calendar = standard Bounds = true
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2012-05-28 12:00:00 2012-05-29 12:00:00 2012-05-30 12:00:00 2012-05-31 12:00:00
2012-06-01 12:00:00
cdo sinfo: Processed 2 variables over 5 timesteps ( 1.28s )
Here is the info about the 10 km to which I want to interpolate the 1km one :
File format : netCDF
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown constant 1 1 2400 1 F32 : -1
Grid coordinates :
1 : curvilinear : points=2400 (60x40)
lon : -79.4059 to -68.5881 degrees_east
lat : 42.139 to 48.5112 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 2012-05-28 00:00:00 Units = hours Calendar = proleptic_gregorian
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
2012-06-01 00:00:00
cdo sinfo: Processed 1 variable over 1 timestep ( 0.00s )
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by Karin Meier-Fleischer over 7 years ago
Hi Francoise,
if you have a 10 km file (lets call it destgrid_10km.nc) which has the grid you want to remap to than you can use it directly with
cdo remapbil,destgrid_10km.nc infile outfile
-Karin
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by François Roberge over 7 years ago
Hi Karin,
Yes but if I directly use bilinear interpolation I will loose data from some points since it only uses 4 nearest point for the interpolation. That is why I was interested in the conservative remapping or grid cells averaging but it seems only work on regular lonlat grid.
- François
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by Uwe Schulzweida over 7 years ago
Hi Francoise,
The conservative remapping and the grid cells averaging is working also on curvilinear grids. But the grid cell corner coordinates are needed for this task. You data contains only the grid cell center coordinates.
Cheers,
Uwe
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by François Roberge over 7 years ago
Hi Uwe,
Yes I know that. Is their a way to compute them with cdo? Otherwise, what do you suggest to do?
Thank you,
- François
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by Uwe Schulzweida over 7 years ago
There is no way to compute the cell corners with CDO, sorry. You can try the operator remapdis. The default number of nearest neighbors is 4. With this default the result is similar to remapbil. But you can use any number of neighbors, e.g. 50:
cdo remapdis,targetgrid,50 infile outfile
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by François Roberge over 7 years ago
Remapdis seems a good alternative to me since it is based on weighted difference. I just tried it and it works with the grids I have. However, to make sure all points are "used", the number of neighbors would need to be pretty high. I might be wrong on that one too.
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by François Roberge over 7 years ago
I have found an other solution that seems to give good results :
cdo -b F32 gridboxmean,10,10 ./infile.nc3 ./outfile.nc3
then
cdo -b F32 remapbil,./10km_grid.nc3 ./infile.nc3 ./outfile.nc3
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by allen zhang over 6 years ago
Can you explain more about this method and remapdis?
and when I use
cdo remapdis,targetgrid,50 infile outfile
It reported that
cdo remapdis (Abort): Too many arguments! Need 1 found 2.
how to deal with it?
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by Ralf Mueller over 6 years ago
Hi Allen!
there is a built-in docu for operators
% cdo -h remapdis NAME remapdis, gendis - Distance-weighted average remapping SYNOPSIS remapdis,grid[,neighbors] infile outfile gendis,grid infile outfile DESCRIPTION This module contains operators for a distance-weighted average remapping of the four nearest neighbor values of fields between grids in spherical coordinates. The interpolation is based on an adapted SCRIP library version. For a detailed description of the interpolation method see SCRIP. OPERATORS remapdis Distance-weighted average remapping Performs a distance-weighted average remapping of the nearest neighbors value on all input fields. The default number of nearest neighbors is 4. gendis Generate distance-weighted average remap weights Generates distance-weighted average remapping weights of the four nearest neighbor values for the first input field and writes the result to a file. The format of this file is NetCDF following the SCRIP convention. Use the operator remap to apply this remapping weights to a data file with the same source grid. PARAMETER grid STRING Target grid description file or name neighbors INTEGER Number of nearest neighbors ENVIRONMENT REMAP_EXTRAPOLATE This variable is used to switch the extrapolation feature 'on' or 'off'. By default the extrapolation is enabled for this remapping method. CDO_GRIDSEARCH_RADIUS Grid search radius in degree, default 180 degree.
here are two examples from interpolation topography to coarse grid with
cdo -f nc remapdis,global_10,10 -topo topo10Deg_10N.nc
cdo -f nc remapdis,global_10,2 -topo topo10Deg_2N.nc
This is generated with cdo-1.9.4. Since you get an error, I suppose you use a difference CDO version.
cdo -Vtells you which.
Plots were done with
cdo grfill,device=png,min=-6000,max=6000,interval=500,colour_min=black,colour_max=orange,colour_triad=cw topo10Deg_10N.nc topo10N
topo10N_topo.png (73.5 KB) topo10N_topo.png | |||
topo2N_topo.png (73.6 KB) topo2N_topo.png |
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by Ralf Mueller over 6 years ago
here is the output data - just in case
topo10Deg_10N.nc (3.69 KB) topo10Deg_10N.nc | |||
topo10Deg_2N.nc (3.69 KB) topo10Deg_2N.nc |
RE: Remapping from fine to coarse resolution on curvilinear grids - Added by allen zhang over 6 years ago
Hi,Ralf,
Thanks for your reply.
Since I just installed cdo by "sudo apt-get install cdo" in ubuntu 14.04.Its version is 1.6.2.
So maybe I need to update the cdo.
But one more question,
for remapping from fine to coarse resolution and remapping from coarse to fine resolution ,
which method is prefered in general respectively?
Since when I used remapbil, it semms to be problematic.
https://code.mpimet.mpg.de/boards/2/topics/6338
https://code.mpimet.mpg.de/boards/1/topics/6333
Thanks again,
Regards,
Allen