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

added operator magplot (template)

parent 93e25189
......@@ -167,6 +167,9 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAGICS_INCLUDE = @MAGICS_INCLUDE@
MAGICS_LIBS = @MAGICS_LIBS@
MAGICS_ROOT = @MAGICS_ROOT@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
......
......@@ -27,6 +27,7 @@ case "${HOSTNAME}" in
--with-hdf5=$HOME/local \
--with-szlib=$HOME/local \
--with-proj=/opt/local \
--with-magics=/Users/m214003/local/magics-2.14.9 \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2 -fopenmp"
;;
hama*)
......
......@@ -627,6 +627,9 @@ subdirs
ENABLE_CDI_LIB
ENABLE_CDI_LIB_FALSE
ENABLE_CDI_LIB_TRUE
MAGICS_INCLUDE
MAGICS_ROOT
MAGICS_LIBS
PROJ_INCLUDE
PROJ_LDFLAGS
ENABLE_IEG
......@@ -798,6 +801,7 @@ enable_service
enable_extra
enable_ieg
with_proj
with_magics
enable_cdi_lib
enable_all_static
'
......@@ -1482,6 +1486,8 @@ Optional Packages:
--with-jasper-root
--with-proj=<directory> Specify location of PROJ library for cartographic
projections.
--with-magics=<yes|no|directory>
location of magics library (lib and include subdirs)
 
Some influential environment variables:
CC C compiler command
......@@ -18406,6 +18412,191 @@ $as_echo_n "checking for the PROJ library... " >&6; }
$as_echo "suppressed" >&6; }
fi
 
# ----------------------------------------------------------------------
# Compile application with MAGICS
MAGICS_ROOT=''
MAGICS_INCLUDE=''
MAGICS_LIBS=''
# Check whether --with-magics was given.
if test "${with_magics+set}" = set; then :
withval=$with_magics; case "$with_magics" in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for magics library" >&5
$as_echo_n "checking for magics library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; } ;; #(
yes) :
for ac_header in magics_api.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "magics_api.h" "ac_cv_header_magics_api_h" "$ac_includes_default"
if test "x$ac_cv_header_magics_api_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MAGICS_API_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mag_open" >&5
$as_echo_n "checking for library containing mag_open... " >&6; }
if ${ac_cv_search_mag_open+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mag_open ();
int
main ()
{
return mag_open ();
;
return 0;
}
_ACEOF
for ac_lib in '' MagPlus; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_mag_open=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_mag_open+:} false; then :
break
fi
done
if ${ac_cv_search_mag_open+:} false; then :
else
ac_cv_search_mag_open=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mag_open" >&5
$as_echo "$ac_cv_search_mag_open" >&6; }
ac_res=$ac_cv_search_mag_open
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBMAGICS 1" >>confdefs.h
else
as_fn_error $? "Could not link to magics library" "$LINENO" 5
fi
MAGICS_LIBS=" -lMagPlus"
;; #(
*) :
if test -d "$with_magics"; then :
MAGICS_ROOT=$with_magics
LDFLAGS="-L$MAGICS_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$MAGICS_ROOT/include/magics $CPPFLAGS"
for ac_header in magics_api.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "magics_api.h" "ac_cv_header_magics_api_h" "$ac_includes_default"
if test "x$ac_cv_header_magics_api_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_MAGICS_API_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mag_open" >&5
$as_echo_n "checking for library containing mag_open... " >&6; }
if ${ac_cv_search_mag_open+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mag_open ();
int
main ()
{
return mag_open ();
;
return 0;
}
_ACEOF
for ac_lib in '' MagPlus; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_mag_open=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_mag_open+:} false; then :
break
fi
done
if ${ac_cv_search_mag_open+:} false; then :
else
ac_cv_search_mag_open=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mag_open" >&5
$as_echo "$ac_cv_search_mag_open" >&6; }
ac_res=$ac_cv_search_mag_open
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBMAGICS 1" >>confdefs.h
else
as_fn_error $? "Could not link to magics library" "$LINENO" 5
fi
MAGICS_LIBS=" -L$MAGICS_ROOT/lib -lMagPlus"
MAGICS_INCLUDE=" -I$MAGICS_ROOT/include/magics"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: $with_magics is not a directory! MAGICS suppressed" >&5
$as_echo "$as_me: $with_magics is not a directory! MAGICS suppressed" >&6;}
fi ;; #(
*) :
;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAGICS library" >&5
$as_echo_n "checking for MAGICS library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; }
fi
# ----------------------------------------------------------------------
# How to build CDI into CDO?
INTERNAL_CDI_DIR=libcdi
......
......@@ -111,6 +111,9 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAGICS_INCLUDE = @MAGICS_INCLUDE@
MAGICS_LIBS = @MAGICS_LIBS@
MAGICS_ROOT = @MAGICS_ROOT@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
......
......@@ -294,6 +294,7 @@ lowpass -lowpass \
lsmean -lsmean \
lt -lt \
ltc -ltc \
magplot -magplot \
map -map \
mask -mask \
maskindexbox -maskindexbox \
......
......@@ -294,6 +294,7 @@ lowpass \
lsmean \
lt \
ltc \
magplot \
map \
mask \
maskindexbox \
......
......@@ -294,6 +294,7 @@ lowpass -lowpass \
lsmean -lsmean \
lt -lt \
ltc -ltc \
magplot -magplot \
map -map \
mask -mask \
maskindexbox -maskindexbox \
......
......@@ -339,6 +339,39 @@ AC_ARG_WITH([proj],
[AC_MSG_CHECKING([for the PROJ library])
AC_MSG_RESULT([suppressed])])
# ----------------------------------------------------------------------
# Compile application with MAGICS
MAGICS_ROOT=''
MAGICS_INCLUDE=''
MAGICS_LIBS=''
AC_ARG_WITH([magics],
[AS_HELP_STRING([--with-magics=<yes|no|directory>],[location of magics library (lib and include subdirs)])],
[AS_CASE(["$with_magics"],
[no],[AC_MSG_CHECKING([for magics library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([magics_api.h])
AC_SEARCH_LIBS([mag_open],
[MagPlus],
[AC_DEFINE([HAVE_LIBMAGICS],[1],[Define to 1 for MAGICS support])],
[AC_MSG_ERROR([Could not link to magics library])])
AC_SUBST([MAGICS_LIBS],[" -lMagPlus"])],
[*],[AS_IF([test -d "$with_magics"],
[MAGICS_ROOT=$with_magics
LDFLAGS="-L$MAGICS_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$MAGICS_ROOT/include/magics $CPPFLAGS"
AC_CHECK_HEADERS([magics_api.h])
AC_SEARCH_LIBS([mag_open],
[MagPlus],
[AC_DEFINE([HAVE_LIBMAGICS],[1],[Define to 1 for MAGICS support])],
[AC_MSG_ERROR([Could not link to magics library])])
MAGICS_LIBS=" -L$MAGICS_ROOT/lib -lMagPlus"
MAGICS_INCLUDE=" -I$MAGICS_ROOT/include/magics"],
[AC_MSG_NOTICE([$with_magics is not a directory! MAGICS suppressed])])])],
[AC_MSG_CHECKING([for MAGICS library])
AC_MSG_RESULT([suppressed])])
AC_SUBST([MAGICS_ROOT])
AC_SUBST([MAGICS_INCLUDE])
AC_SUBST([MAGICS_LIBS])
# ----------------------------------------------------------------------
# How to build CDI into CDO?
INTERNAL_CDI_DIR=libcdi
# At the moment, there are two possible CDI bindings
......
......@@ -71,6 +71,7 @@ cdo_SOURCES += Arith.c \
Invertlev.c \
Isosurface.c \
Log.c \
Magplot.c \
Maskbox.c \
Mastrfu.c \
Math.c \
......
......@@ -87,11 +87,11 @@ am_cdo_OBJECTS = cdo-cdo.$(OBJEXT) cdo-Arith.$(OBJEXT) \
cdo-Intntime.$(OBJEXT) cdo-Inttime.$(OBJEXT) \
cdo-Intyear.$(OBJEXT) cdo-Invert.$(OBJEXT) \
cdo-Invertlev.$(OBJEXT) cdo-Isosurface.$(OBJEXT) \
cdo-Log.$(OBJEXT) cdo-Maskbox.$(OBJEXT) cdo-Mastrfu.$(OBJEXT) \
cdo-Math.$(OBJEXT) cdo-Merge.$(OBJEXT) cdo-Mergegrid.$(OBJEXT) \
cdo-Mergetime.$(OBJEXT) cdo-Merstat.$(OBJEXT) \
cdo-Monarith.$(OBJEXT) cdo-Mrotuv.$(OBJEXT) \
cdo-Mrotuvb.$(OBJEXT) cdo-Ninfo.$(OBJEXT) \
cdo-Log.$(OBJEXT) cdo-Magplot.$(OBJEXT) cdo-Maskbox.$(OBJEXT) \
cdo-Mastrfu.$(OBJEXT) cdo-Math.$(OBJEXT) cdo-Merge.$(OBJEXT) \
cdo-Mergegrid.$(OBJEXT) cdo-Mergetime.$(OBJEXT) \
cdo-Merstat.$(OBJEXT) cdo-Monarith.$(OBJEXT) \
cdo-Mrotuv.$(OBJEXT) cdo-Mrotuvb.$(OBJEXT) cdo-Ninfo.$(OBJEXT) \
cdo-Nmltest.$(OBJEXT) cdo-Output.$(OBJEXT) \
cdo-Outputgmt.$(OBJEXT) cdo-Pinfo.$(OBJEXT) \
cdo-Pressure.$(OBJEXT) cdo-Regres.$(OBJEXT) \
......@@ -248,6 +248,9 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAGICS_INCLUDE = @MAGICS_INCLUDE@
MAGICS_LIBS = @MAGICS_LIBS@
MAGICS_ROOT = @MAGICS_ROOT@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
......@@ -355,10 +358,10 @@ cdo_SOURCES = cdo.c Arith.c Arithc.c Arithdays.c Arithlat.c CDItest.c \
Histogram.c Importamsr.c Importbinary.c Importcmsaf.c \
Importobs.c Info.c Input.c Intgrid.c Intgridtraj.c Intlevel.c \
Intlevel3d.c Intntime.c Inttime.c Intyear.c Invert.c \
Invertlev.c Isosurface.c Log.c Maskbox.c Mastrfu.c Math.c \
Merge.c Mergegrid.c Mergetime.c Merstat.c Monarith.c Mrotuv.c \
Mrotuvb.c Ninfo.c Nmltest.c Output.c Outputgmt.c Pinfo.c \
Pressure.c Regres.c Remap.c Remapeta.c Replace.c \
Invertlev.c Isosurface.c Log.c Magplot.c Maskbox.c Mastrfu.c \
Math.c Merge.c Mergegrid.c Mergetime.c Merstat.c Monarith.c \
Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c Output.c Outputgmt.c \
Pinfo.c Pressure.c Regres.c Remap.c Remapeta.c Replace.c \
Replacevalues.c Rhopot.c Rotuv.c Runpctl.c Runstat.c Scatter.c \
Seascount.c Seaspctl.c Seasstat.c Selbox.c Select.c \
Seloperator.c Selrec.c Seltime.c Selvar.c Set.c Setbox.c \
......@@ -587,6 +590,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Invertlev.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Isosurface.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Log.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Magplot.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Maskbox.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Mastrfu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdo-Math.Po@am__quote@
......@@ -1731,6 +1735,20 @@ cdo-Log.obj: Log.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Log.obj `if test -f 'Log.c'; then $(CYGPATH_W) 'Log.c'; else $(CYGPATH_W) '$(srcdir)/Log.c'; fi`
cdo-Magplot.o: Magplot.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Magplot.o -MD -MP -MF $(DEPDIR)/cdo-Magplot.Tpo -c -o cdo-Magplot.o `test -f 'Magplot.c' || echo '$(srcdir)/'`Magplot.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Magplot.Tpo $(DEPDIR)/cdo-Magplot.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Magplot.c' object='cdo-Magplot.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Magplot.o `test -f 'Magplot.c' || echo '$(srcdir)/'`Magplot.c
cdo-Magplot.obj: Magplot.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Magplot.obj -MD -MP -MF $(DEPDIR)/cdo-Magplot.Tpo -c -o cdo-Magplot.obj `if test -f 'Magplot.c'; then $(CYGPATH_W) 'Magplot.c'; else $(CYGPATH_W) '$(srcdir)/Magplot.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Magplot.Tpo $(DEPDIR)/cdo-Magplot.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Magplot.c' object='cdo-Magplot.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Magplot.obj `if test -f 'Magplot.c'; then $(CYGPATH_W) 'Magplot.c'; else $(CYGPATH_W) '$(srcdir)/Magplot.c'; fi`
cdo-Maskbox.o: Maskbox.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Maskbox.o -MD -MP -MF $(DEPDIR)/cdo-Maskbox.Tpo -c -o cdo-Maskbox.o `test -f 'Maskbox.c' || echo '$(srcdir)/'`Maskbox.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/cdo-Maskbox.Tpo $(DEPDIR)/cdo-Maskbox.Po
......
......@@ -159,6 +159,9 @@ void cdo_version(void)
#if defined (HAVE_LIBPROJ)
fprintf(stderr, " PROJ.4");
#endif
#if defined (HAVE_LIBMAGICS)
fprintf(stderr, " MAGICS");
#endif
#if defined (HAVE_LIBDRMAA)
fprintf(stderr, " DRMAA");
#endif
......
......@@ -57,6 +57,9 @@
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 for MAGICS support */
#undef HAVE_LIBMAGICS
/* Define to 1 if you have the `malloc' library (-lmalloc). */
#undef HAVE_LIBMALLOC
......@@ -81,6 +84,9 @@
/* Define 1 for ZLIB support */
#undef HAVE_LIBZ
/* Define to 1 if you have the <magics_api.h> header file. */
#undef HAVE_MAGICS_API_H
/* Define to 1 if you have the `mallinfo' function. */
#undef HAVE_MALLINFO
......
......@@ -104,6 +104,7 @@ void *Invert(void *argument);
void *Invertlev(void *argument);
void *Isosurface(void *argument);
void *Log(void *argument);
void *Magplot(void *argument);
void *Maskbox(void *argument);
void *Mastrfu(void *argument);
void *Math(void *argument);
......@@ -323,6 +324,7 @@ void *Wct(void *argument);
#define IsosurfaceOperators {"isosurface"}
#define LogOperators {"dumplogs", "daylogs", "monlogs", "dumplogo", \
"snamelogo", "scalllogo", "smemlogo", "stimelogo", "sperclogo"}
#define MagplotOperators {"magplot"}
#define MaskboxOperators {"masklonlatbox", "maskindexbox"}
#define MaskregionOperators {"maskregion"}
#define MastrfuOperators {"mastrfu"}
......@@ -570,6 +572,7 @@ static modules_t Modules[] =
{ Invertlev, InvertlevHelp, InvertlevOperators, CDI_REAL, 1, 1 },
{ Isosurface, NULL, IsosurfaceOperators, CDI_REAL, 1, 1 },
{ Log, NULL, LogOperators, CDI_REAL, 1, 0 },
{ Magplot, NULL, MagplotOperators, CDI_REAL, 1, 1 },
{ Maskbox, MaskboxHelp, MaskboxOperators, CDI_REAL, 1, 1 },
{ Maskbox, MaskregionHelp, MaskregionOperators, CDI_REAL, 1, 1 },
{ Mastrfu, MastrfuHelp, MastrfuOperators, CDI_REAL, 1, 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