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 ...@@ -46,11 +46,11 @@ case "${HOSTNAME}" in
elif test "$COMP" = icpc ; then elif test "$COMP" = icpc ; then
${CONFPATH}configure \ ${CONFPATH}configure \
$CDOLIBS \ $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 elif test "$COMP" = clang++ ; then
${CONFPATH}configure \ ${CONFPATH}configure \
$CDOLIBS \ $CDOLIBS \
CC=clang++ CFLAGS="-g -Wall -O3 -Drestrict=" CC=clang++ CFLAGS="-g -Wall -O3"
elif test "$COMP" = clang ; then elif test "$COMP" = clang ; then
${CONFPATH}configure \ ${CONFPATH}configure \
$CDOLIBS \ $CDOLIBS \
...@@ -58,7 +58,7 @@ case "${HOSTNAME}" in ...@@ -58,7 +58,7 @@ case "${HOSTNAME}" in
elif test "$COMP" = g++ ; then elif test "$COMP" = g++ ; then
${CONFPATH}configure \ ${CONFPATH}configure \
$CDOLIBS \ $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 else
${CONFPATH}configure --prefix=$HOME/local \ ${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \ --enable-maintainer-mode \
...@@ -87,15 +87,27 @@ case "${HOSTNAME}" in ...@@ -87,15 +87,27 @@ case "${HOSTNAME}" in
${CONFPATH}configure --prefix=$HOME/local \ ${CONFPATH}configure --prefix=$HOME/local \
$CDOLIBS \ $CDOLIBS \
CC=icc CFLAGS="-g -Wall -Wwrite-strings -O2 -qopt-report=5 -march=native" CXX=icpc 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 elif test "$COMP" = clang ; then
${CONFPATH}configure \ ${CONFPATH}configure \
$CDOLIBS \ $CDOLIBS \
CC=clang CFLAGS="-g -Wall -Wwrite-strings -Ofast -march=native" 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 else
${CONFPATH}configure --prefix=$HOME/local \ ${CONFPATH}configure --prefix=$HOME/local \
--enable-maintainer-mode \ --enable-maintainer-mode \
$CDOLIBS \ $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-libxml2=/usr \
# --with-magics=/Users/m214003/local/Magics-2.18.14nio \ # --with-magics=/Users/m214003/local/Magics-2.18.14nio \
fi fi
......
...@@ -88,7 +88,7 @@ void get_map_type(int operfunc, int *map_type, int *submap_type, int *num_neighb ...@@ -88,7 +88,7 @@ void get_map_type(int operfunc, int *map_type, int *submap_type, int *num_neighb
case REMAPDIS: case REMAPDIS:
case GENDIS: case GENDIS:
*map_type = MAP_TYPE_DISTWGT; *map_type = MAP_TYPE_DISTWGT;
*num_neighbors = 4; if ( *num_neighbors == 0 ) *num_neighbors = 4;
break; break;
case REMAPNN: case REMAPNN:
case GENNN: case GENNN:
...@@ -758,7 +758,7 @@ void *Remap(void *argument) ...@@ -758,7 +758,7 @@ void *Remap(void *argument)
int norm_opt = NORM_OPT_NONE; int norm_opt = NORM_OPT_NONE;
int map_type = -1; int map_type = -1;
int submap_type = SUBMAP_TYPE_NONE; int submap_type = SUBMAP_TYPE_NONE;
int num_neighbors = 4; int num_neighbors = 0;
int need_gradiants = FALSE; int need_gradiants = FALSE;
int grid1sizemax; int grid1sizemax;
char varname[CDI_MAX_NAME]; char varname[CDI_MAX_NAME];
...@@ -822,8 +822,18 @@ void *Remap(void *argument) ...@@ -822,8 +822,18 @@ void *Remap(void *argument)
else else
{ {
operatorInputArg("grid description file or name"); operatorInputArg("grid description file or name");
operatorCheckArgc(1); if ( operfunc == REMAPDIS && operatorArgc() == 2 )
gridID2 = cdoDefineGrid(operatorArgv()[0]); {
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)!"); 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