Commit 49ad33da authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remap_define_reg2d: bug fix for non monotonic increasing longitudes.

parent 534e23ca
......@@ -570,6 +570,11 @@ void remap_define_reg2d(int gridID, remapgrid_t *grid)
grid_to_radian(yunits, nx, grid->reg2d_center_lon, "grid reg2d center lon");
grid_to_radian(yunits, ny, grid->reg2d_center_lat, "grid reg2d center lat");
if ( grid->reg2d_center_lon[nx-1] < grid->reg2d_center_lon[0] )
for ( long i = 1; i < nx; ++i )
if ( grid->reg2d_center_lon[i] < grid->reg2d_center_lon[i-1] )
grid->reg2d_center_lon[i] += PI2;
if ( grid->is_cyclic ) grid->reg2d_center_lon[nx] = grid->reg2d_center_lon[0] + PI2;
grid->reg2d_corner_lon = (double*) Malloc(nxp1*sizeof(double));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment