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

added env CDO_HISTORY_INFO

parent 1b32ba5c
...@@ -84,6 +84,7 @@ The following table describes the environment variables that affect {\CDO}. ...@@ -84,6 +84,7 @@ The following table describes the environment variables that affect {\CDO}.
CDO\_FILE\_SUFFIX & None & Default file suffix. This suffix will be added to the output file \\ CDO\_FILE\_SUFFIX & None & Default file suffix. This suffix will be added to the output file \\
& & name instead of the filename extension derived from the file \\ & & name instead of the filename extension derived from the file \\
& & format. NULL will disable the adding of a file suffix. \\ \hline & & format. NULL will disable the adding of a file suffix. \\ \hline
CDO\_HISTORY\_INFO & 1 & Append netCDF global attribute histroy \\ \hline
CDO\_PCTL\_NBINS & 101 & Number of histogram bins. \\ \hline CDO\_PCTL\_NBINS & 101 & Number of histogram bins. \\ \hline
CDO\_RESET\_HISTORY & 0 & Set to 1 to reset the netCDF {\it history} global attribute.\\ \hline CDO\_RESET\_HISTORY & 0 & Set to 1 to reset the netCDF {\it history} global attribute.\\ \hline
CDO\_REMAP\_NORM & fracarea & Choose the normalization for the conservative interpolation \\ CDO\_REMAP\_NORM & fracarea & Choose the normalization for the conservative interpolation \\
......
...@@ -344,6 +344,7 @@ cdo_SOURCES += Adisit.c \ ...@@ -344,6 +344,7 @@ cdo_SOURCES += Adisit.c \
Zonstat.c \ Zonstat.c \
cdo.h cdo.h
cdo_SOURCES += nearpt3c.h
#if ENABLE_NEARPT3 #if ENABLE_NEARPT3
#cdo_SOURCES += \ #cdo_SOURCES += \
# nearpt3x.h \ # nearpt3x.h \
......
...@@ -80,7 +80,6 @@ POST_UNINSTALL = : ...@@ -80,7 +80,6 @@ POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
bin_PROGRAMS = cdo$(EXEEXT) bin_PROGRAMS = cdo$(EXEEXT)
#if ENABLE_NEARPT3 #if ENABLE_NEARPT3
#cdo_SOURCES += \ #cdo_SOURCES += \
# nearpt3x.h \ # nearpt3x.h \
...@@ -210,11 +209,12 @@ am__cdo_SOURCES_DIST = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \ ...@@ -210,11 +209,12 @@ am__cdo_SOURCES_DIST = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \
Writegrid.c Writerandom.c YAR.c Yearmonstat.c Ydayarith.c \ Writegrid.c Writerandom.c YAR.c Yearmonstat.c Ydayarith.c \
Ydaypctl.c Ydaystat.c Ydrunpctl.c Ydrunstat.c Yhourarith.c \ Ydaypctl.c Ydaystat.c Ydrunpctl.c Ydrunstat.c Yhourarith.c \
Yhourstat.c Ymonarith.c Ymonpctl.c Ymonstat.c Yseaspctl.c \ Yhourstat.c Ymonarith.c Ymonpctl.c Ymonstat.c Yseaspctl.c \
Yseasstat.c Zonstat.c cdo.h Magplot.c Magvector.c Maggraph.c \ Yseasstat.c Zonstat.c cdo.h nearpt3c.h Magplot.c Magvector.c \
template_parser.h template_parser.c results_template_parser.h \ Maggraph.c template_parser.h template_parser.c \
results_template_parser.c magics_template_parser.h \ results_template_parser.h results_template_parser.c \
magics_template_parser.c StringUtilities.h StringUtilities.c \ magics_template_parser.h magics_template_parser.c \
CdoMagicsMapper.h CdoMagicsMapper.c StringUtilities.h StringUtilities.c CdoMagicsMapper.h \
CdoMagicsMapper.c
@ENABLE_MAGICS_TRUE@am__objects_1 = cdo-Magplot.$(OBJEXT) \ @ENABLE_MAGICS_TRUE@am__objects_1 = cdo-Magplot.$(OBJEXT) \
@ENABLE_MAGICS_TRUE@ cdo-Magvector.$(OBJEXT) \ @ENABLE_MAGICS_TRUE@ cdo-Magvector.$(OBJEXT) \
@ENABLE_MAGICS_TRUE@ cdo-Maggraph.$(OBJEXT) \ @ENABLE_MAGICS_TRUE@ cdo-Maggraph.$(OBJEXT) \
...@@ -624,7 +624,7 @@ cdo_SOURCES = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \ ...@@ -624,7 +624,7 @@ cdo_SOURCES = cdo.c Adisit.c Afterburner.c Arith.c Arithc.c \
Writegrid.c Writerandom.c YAR.c Yearmonstat.c Ydayarith.c \ Writegrid.c Writerandom.c YAR.c Yearmonstat.c Ydayarith.c \
Ydaypctl.c Ydaystat.c Ydrunpctl.c Ydrunstat.c Yhourarith.c \ Ydaypctl.c Ydaystat.c Ydrunpctl.c Ydrunstat.c Yhourarith.c \
Yhourstat.c Ymonarith.c Ymonpctl.c Ymonstat.c Yseaspctl.c \ Yhourstat.c Ymonarith.c Ymonpctl.c Ymonstat.c Yseaspctl.c \
Yseasstat.c Zonstat.c cdo.h $(am__append_1) Yseasstat.c Zonstat.c cdo.h nearpt3c.h $(am__append_1)
cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src
cdo_LDADD = libcdo.la $(top_builddir)/libcdi/src/libcdi.la cdo_LDADD = libcdo.la $(top_builddir)/libcdi/src/libcdi.la
cdo_LDFLAGS = $(am__append_2) cdo_LDFLAGS = $(am__append_2)
......
...@@ -697,6 +697,18 @@ void get_env_vars(void) ...@@ -697,6 +697,18 @@ void get_env_vars(void)
} }
} }
envstr = getenv("CDO_HISTORY_INFO");
if ( envstr )
{
int ival = atoi(envstr);
if ( ival == 0 || ival == 1 )
{
CDO_Append_History = ival;
if ( cdoVerbose )
fprintf(stderr, "CDO_HISTORY_INFO = %s\n", envstr);
}
}
CDO_File_Suffix[0] = 0; CDO_File_Suffix[0] = 0;
envstr = getenv("CDO_FILE_SUFFIX"); envstr = getenv("CDO_FILE_SUFFIX");
...@@ -1379,18 +1391,21 @@ void cdo_rusage(void) ...@@ -1379,18 +1391,21 @@ void cdo_rusage(void)
struct rusage ru; struct rusage ru;
int status = getrusage(RUSAGE_SELF, &ru); int status = getrusage(RUSAGE_SELF, &ru);
double ut = ru.ru_utime.tv_sec + 0.000001 * ru.ru_utime.tv_usec; if ( status == 0 )
double st = ru.ru_stime.tv_sec + 0.000001 * ru.ru_stime.tv_usec; {
double ut = ru.ru_utime.tv_sec + 0.000001 * ru.ru_utime.tv_usec;
fprintf(stderr, " User time: %.3f seconds\n", ut); double st = ru.ru_stime.tv_sec + 0.000001 * ru.ru_stime.tv_usec;
fprintf(stderr, " System time: %.3f seconds\n", st);
fprintf(stderr, " Total time: %.3f seconds\n", ut+st); fprintf(stderr, " User time: %.3f seconds\n", ut);
fprintf(stderr, " Memory usage: %.2f MBytes\n", ru.ru_maxrss/(1024.*1024.)); fprintf(stderr, " System time: %.3f seconds\n", st);
fprintf(stderr, " Page reclaims: %5ld page%s\n", ru.ru_minflt, ADD_PLURAL(ru.ru_minflt)); fprintf(stderr, " Total time: %.3f seconds\n", ut+st);
fprintf(stderr, " Page faults: %5ld page%s\n", ru.ru_majflt, ADD_PLURAL(ru.ru_majflt)); fprintf(stderr, " Memory usage: %.2f MBytes\n", ru.ru_maxrss/(1024.*1024.));
fprintf(stderr, " Swaps: %5ld\n", ru.ru_nswap); fprintf(stderr, " Page reclaims: %5ld page%s\n", ru.ru_minflt, ADD_PLURAL(ru.ru_minflt));
fprintf(stderr, " Disk read: %5ld block%s\n", ru.ru_inblock, ADD_PLURAL(ru.ru_inblock)); fprintf(stderr, " Page faults: %5ld page%s\n", ru.ru_majflt, ADD_PLURAL(ru.ru_majflt));
fprintf(stderr, " Disk Write: %5ld block%s\n", ru.ru_oublock, ADD_PLURAL(ru.ru_oublock)); fprintf(stderr, " Swaps: %5ld\n", ru.ru_nswap);
fprintf(stderr, " Disk read: %5ld block%s\n", ru.ru_inblock, ADD_PLURAL(ru.ru_inblock));
fprintf(stderr, " Disk Write: %5ld block%s\n", ru.ru_oublock, ADD_PLURAL(ru.ru_oublock));
}
#endif #endif
} }
......
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