Commit 6fcacf7f authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

grid_search_reg2d_nn: bug fix for nx/ny = 1.

parent 8a16f687
......@@ -3,6 +3,10 @@
* Using CDI library version 1.9.0
* Version 1.9.0 release
2017-07-22 Uwe Schulzweida
* grid_search_reg2d_nn: bug fix for nx/ny = 1
2017-07-14 Uwe Schulzweida
* settaxis: made time argument optional
......
......@@ -277,7 +277,7 @@ void cdo_usage(void)
fprintf(stderr, " Precision to use in displaying floating-point data (default: 7,15)\n");
fprintf(stderr, " --reduce_dim Reduce NetCDF dimensions (module: TIMSTAT, FLDSTAT)\n");
if ( ITSME )
fprintf(stderr, " --remap_genweights\n");
fprintf(stderr, " --remap_genweights 0/1\n");
fprintf(stderr, " -R, --regular Convert GRIB1 data from reduced to regular grid (cgribex only)\n");
fprintf(stderr, " -r Generate a relative time axis\n");
fprintf(stderr, " -S Create an extra output stream for the module TIMSTAT. This stream\n");
......@@ -1244,7 +1244,7 @@ int parse_options_long(int argc, char *argv[])
{
int intarg = parameter2int(CDO_optarg);
if ( intarg != 0 && intarg != 1 )
cdoAbort("Unsupported value for option --remap_genweights=%d [range: 0-1]", intarg);
cdoAbort("Unsupported value for option --remap_genweights %d [0/1]", intarg);
remap_genweights = intarg;
}
else if ( lsortname )
......
......@@ -30,16 +30,16 @@ int grid_search_reg2d_nn(long nx, long ny, int *restrict nbr_add, double *restri
if ( src_center_lat[0] < src_center_lat[ny-1] )
{
if ( plat <= src_center_lat[0] )
{ jjf = 0; jjl = 1; }
{ jjf = 0; jjl = (ny==1) ? 0 : 1; }
else
{ jjf = ny-2; jjl = ny-1; }
{ jjf = (ny==1) ? 0 : ny-2; jjl = ny-1; }
}
else
{
if ( plat >= src_center_lat[0] )
{ jjf = 0; jjl = 1; }
{ jjf = 0; jjl = (ny==1) ? 0 : 1; }
else
{ jjf = ny-2; jjl = ny-1; }
{ jjf = (ny==1) ? 0 : ny-2; jjl = ny-1; }
}
}
......
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