Remap not finding source grid cells
Added by Brendan DeTracey about 4 years ago
I am trying to understand why remapcon
is not finding any source grid cells in the following example:
$ cdo -v setmisstoc,0 -eq zos_Omon_EC-Earth3_historical_r15i1p1f1_gn_201401.nc zos_Omon_EC-Earth3_historical_r15i1p1f1_gn_201401.nc EC-Earth3_mask.nc OpenMP: num_procs=24 max_threads=1 cdo(1) eq: Process started cdo(1) eq: Number of timesteps: file1 1, file2 1 cdo(1) eq: Processed 211408 values from 2 variables over 2 timesteps. cdo setmisstoc: Processed 105704 values from 1 variable over 1 timestep [0.06s 37MB]. $ cdo -v reducegrid,EC-Earth3_mask.nc zos_Omon_EC-Earth3_historical_r15i1p1f1_gn_201401.nc zos_Omon_EC-Earth3_historical_r15i1p1f1_gn_201401_reduced.nc OpenMP: num_procs=24 max_threads=1 cdo reducegrid: Processed 105704 values from 1 variable over 1 timestep [0.07s 56MB]. $ cdo -v remapcon,cdo_scrip_grid_gom.nc zos_Omon_EC-Earth3_historical_r15i1p1f1_gn_201401_reduced.nc test.nc OpenMP: num_procs=24 max_threads=1 cdo remapcon: Point search radius = 180 deg cdo remapcon: Extrapolation disabled! cdo remapcon: Set max_remaps to 2 cdo remapcon: Normalization option: frac cdo remapcon: Cell search created: 0.12 seconds cdo remapcon: YAC first order conservative weights from unstructured (65544) to unstructured (1) grid cdo remapcon: Called remapConservWeights() cdo remapcon: Num search cells min,mean,max : 190 190.0 190 cdo remapcon: Total number of links = 0 cdo remapcon: Cells search: 0.02 seconds cdo remapcon: Remap: 0.00 seconds cdo remapcon: First order mapping from grid1 to grid2: cdo remapcon: ---------------------------------------------- cdo remapcon: Grid1 min,mean,max: -1.92017 -0.309498 1.03321 cdo remapcon: Grid2 min,mean,max: 1e+20 1e+20 1e+20 cdo remapcon: Conservation: cdo remapcon: Grid1 Integral = 0 cdo remapcon: Grid2 Integral = 0 cdo remapcon: Number of weights 1 cdo remapcon: Number of sparse matrix entries 0 cdo remapcon: Total number of dest cells 1 cdo remapcon: Number of cells participating in remap 0 cdo remapcon: Processed 65544 values from 1 variable over 1 timestep [0.17s 49MB].
Here is a plot of the source grid(unmasked source grid cells are red points, cell boundaries are black points) and the target grid cell(in green). This method has worked for other models.

Replies (4)
RE: Remap not finding source grid cells - Added by Brendan DeTracey about 4 years ago
Welp, it seems the file is not CF compliant. It would be helpful to know if this is why the remap fails i.e. non-compliance confuses CDO when it tries to assign axes?
RE: Remap not finding source grid cells - Added by Uwe Schulzweida about 4 years ago
Hi Brendan,
There is something wrong with some longitude bounds. At the 180 degree boundary the bounds have values around 0 and 360. This leads to problems with the interpolation.
To avoid this problem you can choose a smaller region:
cdo -v remapcon,cdo_scrip_grid_gom.nc -sellonlatbox,-90,-50,20,60 zos_Omon_EC-Earth3_historical_r15i1p1f1_gn_201401_reduced.nc test.nc cdo remapcon: Point search radius = 180 deg cdo remapcon: Extrapolation disabled! cdo remapcon: Extrapolation disabled! cdo remapcon: Set max_remaps to 2 cdo remapcon: Normalization option: frac cdo remapcon: Cell search created: 0.00 seconds cdo remapcon: YAC first order conservative weights from unstructured (1345) to unstructured (1) grid cdo remapcon: Called remapConservWeights() cdo remapcon: Num search cells min,mean,max : 56 56.0 56 cdo remapcon: Total number of links = 35 cdo remapcon: Cells search: 0.00 seconds cdo remapcon: Remap: 0.00 seconds cdo remapcon: First order mapping from grid1 to grid2: cdo remapcon: ---------------------------------------------- cdo remapcon: Grid1 min,mean,max: -1.28234 -0.313345 0.581213 cdo remapcon: Grid2 min,mean,max: -0.856811 -0.856811 -0.856811 cdo remapcon: Conservation: cdo remapcon: Grid1 Integral = -0.00342124 cdo remapcon: Grid2 Integral = -0.00342124 cdo remapcon: Number of weights 1 cdo remapcon: Number of sparse matrix entries 35 cdo remapcon: Total number of dest cells 1 cdo remapcon: Number of cells participating in remap 1 cdo remapcon: Min no of entries/row = 35 cdo remapcon: Max no of entries/row = 35 cdo remapcon: Num of rows with entries between 35 - 35 1Cheers, Uwe
RE: Remap not finding source grid cells - Added by Brendan DeTracey about 4 years ago
Thanks Uwe. I have problems in the past with sellonlatbox
on curvilinear(tripolar) grids, which is why I chose to use reducegrid
and remapcon
. What could I do to alter the bounds so this is not an issue? Would unwrapping the bounds that are bad work? For example, on the right hand side of this domain I would add 360 to boundary longitudes less than 180 if the center cell longitude was over 180.
RE: Remap not finding source grid cells - Added by Uwe Schulzweida about 4 years ago
I have no idea how to correct this. But if a grid cell has the values 0 and 360 in the bounds, then that is the entire globe and that is not a good idea for interpolating.