Commit 331f5692 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added Setpartab.c

parent f572c69e
# Makefile.in generated by automake 1.11a from Makefile.am.
# Makefile.in generated by automake 1.12 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
......@@ -15,6 +15,23 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
......@@ -36,16 +53,19 @@ host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/cdo.settings.in \
$(srcdir)/cdo.spec.in $(top_srcdir)/configure AUTHORS COPYING \
ChangeLog INSTALL NEWS config/compile config/config.guess \
config/config.sub config/depcomp config/install-sh \
config/ltmain.sh config/missing config/mkinstalldirs
$(srcdir)/cdo.spec.in $(top_srcdir)/config/compile \
$(top_srcdir)/config/config.guess \
$(top_srcdir)/config/config.sub \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
$(top_srcdir)/config/missing \
$(top_srcdir)/config/mkinstalldirs $(top_srcdir)/configure \
AUTHORS COPYING ChangeLog INSTALL NEWS config/compile \
config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing \
config/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
......@@ -63,6 +83,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
......@@ -76,9 +101,11 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d "$(distdir)" \
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr "$(distdir)"; }; }
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
......@@ -109,6 +136,8 @@ DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
......@@ -139,21 +168,10 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
ENABLE_EXTRA = @ENABLE_EXTRA@
ENABLE_GRIB = @ENABLE_GRIB@
ENABLE_IEG = @ENABLE_IEG@
ENABLE_SERVICE = @ENABLE_SERVICE@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
GREP = @GREP@
GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
GRIB_API_LIBS = @GRIB_API_LIBS@
HDF5_INCLUDE = @HDF5_INCLUDE@
HDF5_LIBS = @HDF5_LIBS@
HDF5_ROOT = @HDF5_ROOT@
HOST_NAME = @HOST_NAME@
INCLUDES = @INCLUDES@
INSTALL = @INSTALL@
......@@ -161,7 +179,6 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JASPER_LIBS = @JASPER_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
......@@ -170,16 +187,10 @@ 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@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NC_CONFIG = @NC_CONFIG@
NETCDF_INCLUDE = @NETCDF_INCLUDE@
NETCDF_LIBS = @NETCDF_LIBS@
NETCDF_ROOT = @NETCDF_ROOT@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
......@@ -194,32 +205,19 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROJ_INCLUDE = @PROJ_INCLUDE@
PROJ_LDFLAGS = @PROJ_LDFLAGS@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSTEM_TYPE = @SYSTEM_TYPE@
SZLIB_INCLUDE = @SZLIB_INCLUDE@
SZLIB_LIBS = @SZLIB_LIBS@
THREADS_INCLUDE = @THREADS_INCLUDE@
THREADS_LIBS = @THREADS_LIBS@
UDUNITS_INCLUDE = @UDUNITS_INCLUDE@
UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
USER_NAME = @USER_NAME@
VERSION = @VERSION@
XML2_LIBS = @XML2_LIBS@
ZLIB_INCLUDE = @ZLIB_INCLUDE@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
......@@ -228,7 +226,6 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
......@@ -264,7 +261,6 @@ psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
......@@ -331,11 +327,11 @@ distclean-libtool:
-rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
......@@ -527,13 +523,10 @@ distdir: $(DISTFILES)
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
......@@ -569,15 +562,11 @@ dist-bzip2: distdir
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--9} xz -c >$(distdir).tar.xz
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
......@@ -606,8 +595,6 @@ distcheck: dist
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
......@@ -658,8 +645,16 @@ distcheck: dist
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@$(am__cd) '$(distuninstallcheck_dir)' \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
......@@ -789,8 +784,8 @@ uninstall-am:
all all-am am--refresh check check-am clean clean-cscope \
clean-generic clean-libtool cscope cscopelist \
cscopelist-recursive ctags ctags-recursive dist dist-all \
dist-bzip2 dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-generic \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
......
This diff is collapsed.
This diff is collapsed.
# Makefile.in generated by automake 1.11a from Makefile.am.
# Makefile.in generated by automake 1.12 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
......@@ -15,6 +15,23 @@
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
......@@ -35,13 +52,11 @@ build_triplet = @build@
host_triplet = @host@
@MAINTAINER_MODE_TRUE@am__append_1 = `ls cdoCompletion.*`
subdir = contrib
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/config/mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
......@@ -50,6 +65,11 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
......@@ -80,21 +100,10 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
ENABLE_EXTRA = @ENABLE_EXTRA@
ENABLE_GRIB = @ENABLE_GRIB@
ENABLE_IEG = @ENABLE_IEG@
ENABLE_SERVICE = @ENABLE_SERVICE@
EXEEXT = @EXEEXT@
FCFLAGS = @FCFLAGS@
FGREP = @FGREP@
GREP = @GREP@
GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
GRIB_API_LIBS = @GRIB_API_LIBS@
HDF5_INCLUDE = @HDF5_INCLUDE@
HDF5_LIBS = @HDF5_LIBS@
HDF5_ROOT = @HDF5_ROOT@
HOST_NAME = @HOST_NAME@
INCLUDES = @INCLUDES@
INSTALL = @INSTALL@
......@@ -102,7 +111,6 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JASPER_LIBS = @JASPER_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
......@@ -111,16 +119,10 @@ 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@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NC_CONFIG = @NC_CONFIG@
NETCDF_INCLUDE = @NETCDF_INCLUDE@
NETCDF_LIBS = @NETCDF_LIBS@
NETCDF_ROOT = @NETCDF_ROOT@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
......@@ -135,32 +137,19 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROJ_INCLUDE = @PROJ_INCLUDE@
PROJ_LDFLAGS = @PROJ_LDFLAGS@
PTHREAD_CC = @PTHREAD_CC@
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
SYSTEM_TYPE = @SYSTEM_TYPE@
SZLIB_INCLUDE = @SZLIB_INCLUDE@
SZLIB_LIBS = @SZLIB_LIBS@
THREADS_INCLUDE = @THREADS_INCLUDE@
THREADS_LIBS = @THREADS_LIBS@
UDUNITS_INCLUDE = @UDUNITS_INCLUDE@
UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
USER_NAME = @USER_NAME@
VERSION = @VERSION@
XML2_LIBS = @XML2_LIBS@
ZLIB_INCLUDE = @ZLIB_INCLUDE@
ZLIB_LIBS = @ZLIB_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
......@@ -169,7 +158,6 @@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
ax_pthread_config = @ax_pthread_config@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
......@@ -205,7 +193,6 @@ psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
......
......@@ -81,7 +81,7 @@ STRING Parameter table file or name
@Item = code
INTEGER Code number
@Item = param
STRING Parameter identifier (format: code[.tabnum] or num[.cat[.dis]])
STRING Parameter identifier (format: code[.tabnum] or num[.cat[.dis]])
@Item = name
STRING Variable name
@Item = level
......
......@@ -114,6 +114,7 @@ cdo_SOURCES += Arith.c \
Setgrid.c \
Sethalo.c \
Setmiss.c \
Setpartab.c \
Setrcaname.c \
Settime.c \
Setzaxis.c \
......
......@@ -18,7 +18,6 @@
/*
This module contains the following operators:
Set setpartab Set parameter table
Set setcode Set code number
Set setparam Set parameter identifier
Set setname Set variable name
......@@ -30,16 +29,12 @@
#include "cdo.h"
#include "cdo_int.h"
#include "pstream.h"
#include "namelist.h"
int stringToParam(const char *paramstr)
{
int param = 0;
int pnum = -1, pcat = 255, pdis = 255;
size_t len;
len = strlen(paramstr);
sscanf(paramstr, "%d.%d.%d", &pnum, &pcat, &pdis);
......@@ -53,7 +48,7 @@ int stringToParam(const char *paramstr)
void *Set(void *argument)
{
int SETPARTAB, SETPARTABV, SETCODE, SETPARAM, SETNAME, SETLEVEL, SETLTYPE, SETTABNUM;
int SETCODE, SETPARAM, SETNAME, SETLEVEL, SETLTYPE, SETTABNUM;
int operatorID;
int streamID1, streamID2 = CDI_UNDEFID;
int nrecs, nvars, newval = -1, tabnum = 0;
......@@ -63,19 +58,15 @@ void *Set(void *argument)
int nmiss;
int gridsize;
int index, zaxisID1, zaxisID2, nzaxis, nlevs;
int tableID = -1;
int tableformat = 0;
int zaxistype;
int newparam = 0;
char *newname = NULL, *partab = NULL;
char *newname = NULL;
double newlevel = 0;
double *levels = NULL;
double *array = NULL;
cdoInitialize(argument);
SETPARTAB = cdoOperatorAdd("setpartab", 0, 0, "parameter table");
SETPARTABV = cdoOperatorAdd("setpartabv", 0, 0, "parameter table");
SETCODE = cdoOperatorAdd("setcode", 0, 0, "code number");
SETPARAM = cdoOperatorAdd("setparam", 0, 0, "parameter identifier (format: code[.tabnum] or num[.cat[.dis]])");
SETNAME = cdoOperatorAdd("setname", 0, 0, "variable name");
......@@ -102,37 +93,6 @@ void *Set(void *argument)
{
tabnum = atoi(operatorArgv()[0]);
}
else if ( operatorID == SETPARTAB )
{
FILE *fp;
size_t fsize;
char *parbuf = NULL;
size_t nbytes;
partab = operatorArgv()[0];
fp = fopen(partab, "r");
if ( fp != NULL )
{
fseek(fp, 0L, SEEK_END);
fsize = (size_t) ftell(fp);
parbuf = (char *) malloc(fsize+1);
fseek(fp, 0L, SEEK_SET);
nbytes = fread(parbuf, fsize, 1, fp);
parbuf[fsize] = 0;
fseek(fp, 0L, SEEK_SET);
if ( atoi(parbuf) == 0 ) tableformat = 1;
fclose(fp);
free(parbuf);
}
if ( tableformat == 0 ) tableID = defineTable(partab);
}
else if ( operatorID == SETPARTABV )
{
tableformat = 1;
}
else if ( operatorID == SETLEVEL )
{
newlevel = atof(operatorArgv()[0]);
......@@ -170,142 +130,6 @@ void *Set(void *argument)
for ( varID = 0; varID < nvars; varID++ )
vlistDefVarTable(vlistID2, varID, tableID);
}
else if ( operatorID == SETPARTAB || operatorID == SETPARTABV )
{
nvars = vlistNvars(vlistID2);
if ( tableformat == 0 )
{
for ( varID = 0; varID < nvars; varID++ )
vlistDefVarTable(vlistID2, varID, tableID);
}
else
{
FILE *fp;
namelist_t *nml;
int nml_code, nml_new_code, nml_table, nml_datatype, nml_name, nml_new_name, nml_stdname;
int nml_longname, nml_units, nml_ltype, nml_missval;
int locc, i;
int code, new_code, table, ltype;
int nml_index = 0;
int codenum, tabnum, levtype;
double missval;
char *datatype = NULL;
char *name = NULL, *new_name = NULL, *stdname = NULL, longname[CDI_MAX_NAME] = "", units[CDI_MAX_NAME] = "";
char varname[CDI_MAX_NAME];
partab = operatorArgv()[0];
fp = fopen(partab, "r");
if ( fp == NULL ) cdoAbort("Internal problem! Parameter table %s not available", partab);
nml = namelistNew("parameter");
nml->dis = 0;
nml_code = namelistAdd(nml, "code", NML_INT, 0, &code, 1);
nml_new_code = namelistAdd(nml, "new_code", NML_INT, 0, &new_code, 1);
nml_table = namelistAdd(nml, "table", NML_INT, 0, &table, 1);
nml_ltype = namelistAdd(nml, "ltype", NML_INT, 0, &ltype, 1);
nml_missval = namelistAdd(nml, "missval", NML_FLT, 0, &missval, 1);
nml_datatype = namelistAdd(nml, "datatype", NML_WORD, 0, &datatype, 1);
nml_name = namelistAdd(nml, "name", NML_WORD, 0, &name, 1);
nml_new_name = namelistAdd(nml, "new_name", NML_WORD, 0, &new_name, 1);
nml_stdname = namelistAdd(nml, "standard_name", NML_WORD, 0, &stdname, 1);
nml_longname = namelistAdd(nml, "long_name", NML_TEXT, 0, longname, sizeof(longname));
nml_units = namelistAdd(nml, "units", NML_TEXT, 0, units, sizeof(units));
while ( ! feof(fp) )
{
namelistReset(nml);
namelistRead(fp, nml);
locc = FALSE;
for ( i = 0; i < nml->size; i++ )
{
if ( nml->entry[i]->occ ) { locc = TRUE; break; }
}
if ( locc )
{
/* namelistPrint(nml); */
nml_index++;
if ( operatorID == SETPARTAB )
{
if ( nml->entry[nml_code]->occ == 0 )
{
cdoPrint("Parameter %d skipped, code number not found!", nml_index);
continue;
}
}
else
{
if ( nml->entry[nml_name]->occ == 0 )
{
cdoWarning("Parameter %d skipped, variable name not found!", nml_index);
continue;
}
}
for ( varID = 0; varID < nvars; varID++ )
{
if ( operatorID == SETPARTAB )
{
codenum = vlistInqVarCode(vlistID2, varID);
tableID = vlistInqVarTable(vlistID2, varID);
tabnum = tableInqNum(tableID);
levtype = zaxisInqLtype(vlistInqVarZaxis(vlistID2, varID));
/*
printf("code = %d tabnum = %d ltype = %d\n", codenum, tabnum, levtype);
*/
if ( nml->entry[nml_table]->occ == 0 ) table = tabnum;
if ( nml->entry[nml_ltype]->occ == 0 ) ltype = levtype;
if ( codenum == code && tabnum == table && levtype == ltype ) break;
}
else
{
vlistInqVarName(vlistID2, varID, varname);