Commit ea9297c7 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

remapdis: added optional parameter num_neighbors

parent 5386e1a7
......@@ -46,11 +46,11 @@ case "${HOSTNAME}" in
elif test "$COMP" = icpc ; then
${CONFPATH}configure \
$CDOLIBS \
CC=icpc CFLAGS="-g -std=c++11 -Wall -O2 -Drestrict= -qopt-report=5 -march=native"
CC=icpc CFLAGS="-g -std=c++11 -Wall -O2 -qopt-report=5 -march=native"
elif test "$COMP" = clang++ ; then
${CONFPATH}configure \
$CDOLIBS \
CC=clang++ CFLAGS="-g -Wall -O3 -Drestrict="
CC=clang++ CFLAGS="-g -Wall -O3"
elif test "$COMP" = clang ; then
${CONFPATH}configure \
$CDOLIBS \
......@@ -58,7 +58,7 @@ case "${HOSTNAME}" in
elif test "$COMP" = g++ ; then
${CONFPATH}configure \
$CDOLIBS \
CC=g++ CFLAGS="-g -std=c++14 -Drestrict= -Wall -W -Wfloat-equal -pedantic -O3 -march=native"
CC=g++ CFLAGS="-g -std=c++14 -Wall -W -Wfloat-equal -pedantic -O3 -march=native"
else
${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \
......@@ -87,15 +87,27 @@ case "${HOSTNAME}" in
${CONFPATH}configure --prefix=$HOME/local \
$CDOLIBS \
CC=icc CFLAGS="-g -Wall -Wwrite-strings -O2 -qopt-report=5 -march=native" CXX=icpc
elif test "$COMP" = icpc ; then
${CONFPATH}configure \
$CDOLIBS \
CC=icpc CFLAGS="-g -std=c++11 -Wall -O2 -qopt-report=5 -march=native"
elif test "$COMP" = clang++ ; then
${CONFPATH}configure \
$CDOLIBS \
CC=clang++ CFLAGS="-g -Wall -O3"
elif test "$COMP" = clang ; then
${CONFPATH}configure \
$CDOLIBS \
CC=clang CFLAGS="-g -Wall -Wwrite-strings -Ofast -march=native"
elif test "$COMP" = g++ ; then
${CONFPATH}configure \
$CDOLIBS \
CC=g++ CFLAGS="-g -std=c++14 -Wall -W -Wfloat-equal -pedantic -O3"
else
${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \
$CDOLIBS \
CC=gcc CFLAGS="-g -pipe -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3 -march=native -fstack-protector -Wa,-q"
CC=gcc CFLAGS="-g -std=c11 -pipe -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3 -march=native -fstack-protector -Wa,-q"
# --with-libxml2=/usr \
# --with-magics=/Users/m214003/local/Magics-2.18.14nio \
fi
......
......@@ -88,7 +88,7 @@ void get_map_type(int operfunc, int *map_type, int *submap_type, int *num_neighb
case REMAPDIS:
case GENDIS:
*map_type = MAP_TYPE_DISTWGT;
*num_neighbors = 4;
if ( *num_neighbors == 0 ) *num_neighbors = 4;
break;
case REMAPNN:
case GENNN:
......@@ -758,7 +758,7 @@ void *Remap(void *argument)
int norm_opt = NORM_OPT_NONE;
int map_type = -1;
int submap_type = SUBMAP_TYPE_NONE;
int num_neighbors = 4;
int num_neighbors = 0;
int need_gradiants = FALSE;
int grid1sizemax;
char varname[CDI_MAX_NAME];
......@@ -822,9 +822,19 @@ void *Remap(void *argument)
else
{
operatorInputArg("grid description file or name");
if ( operfunc == REMAPDIS && operatorArgc() == 2 )
{
gridID2 = cdoDefineGrid(operatorArgv()[0]);
int inum = parameter2int(operatorArgv()[1]);
if ( inum < 1 || inum > 9 ) cdoAbort("Number of nearest neighbors out of range (1-9)!", inum);
num_neighbors = inum;
}
else
{
operatorCheckArgc(1);
gridID2 = cdoDefineGrid(operatorArgv()[0]);
}
}
if ( gridInqType(gridID2) == GRID_GENERIC ) cdoAbort("Unsupported target grid type (generic)!");
......
Supports Markdown
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