Commit 1b32ba5c authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added env CDO_VERSION_INFO: set to 0 to disable netCDF global attribute CDO

parent 1ea6320e
......@@ -92,6 +92,7 @@ CDO\_REMAP\_RADIUS & 180 & Remap search radius in degree. Used by t
CDO\_TIMESTAT\_DATE & None & Set the date information of a time statistic operator to \\
& & the "first", "middle" or "last" contributing timestep.\\ \hline
CDO\_USE\_FFTW & 1 & Set to 0 to switch off usage of FFTW. Used in the Filter module.\\ \hline
CDO\_VERSION\_INFO & 1 & Set to 0 to disable netCDF global attribute CDO \\ \hline
\end{tabular}
......
......@@ -744,6 +744,18 @@ void get_env_vars(void)
}
}
envstr = getenv("CDO_VERSION_INFO");
if ( envstr )
{
int ival = atoi(envstr);
if ( ival == 0 || ival == 1 )
{
CDO_Version_Info = ival;
if ( cdoVerbose )
fprintf(stderr, "CDO_Version_Info = %s\n", envstr);
}
}
envstr = getenv("CDO_COLOR");
if ( envstr )
{
......
......@@ -962,7 +962,7 @@ const char *cdoComment(void)
comment[size] = 0;
}
return (comment);
return comment;
}
static
......@@ -1067,7 +1067,8 @@ void pstreamDefVlist(int pstreamID, int vlistID)
vlistDefVarChunkType(vlistID, varID, cdoChunkType);
}
vlistDefAttTxt(vlistID, CDI_GLOBAL, "CDO", (int)strlen(cdoComment())+1, cdoComment());
if ( CDO_Version_Info )
vlistDefAttTxt(vlistID, CDI_GLOBAL, "CDO", (int)strlen(cdoComment())+1, cdoComment());
#if defined(_OPENMP)
if ( ompNumThreads > 1 )
......
......@@ -58,7 +58,7 @@ int CDO_optind = 1; // refactor: moved here from cdo_getopt.c
/* refactor: moved here from cdo.c */
char *Progname;
char CDO_Version[] = "Climate Data Operators version " VERSION" (http://mpimet.mpg.de/cdo)"; // refactor: moved here from cdo.c
const char *CDO_Version = "Climate Data Operators version " VERSION" (http://mpimet.mpg.de/cdo)";
int ompNumThreads = 1;
......@@ -66,7 +66,7 @@ int stdin_is_tty = 0;
int stdout_is_tty = 0;
int stderr_is_tty = 0;
char* cdoGridSearchDir = NULL;
char *cdoGridSearchDir = NULL;
int cdoDefaultFileType = CDI_UNDEFID;
int cdoDefaultDataType = CDI_UNDEFID;
......@@ -80,6 +80,7 @@ int cdoCheckDatarange = FALSE;
int CDO_Color = FALSE;
int CDO_Use_FFTW = TRUE;
int CDO_Version_Info = TRUE;
int cdoDiag = FALSE;
int CDO_Reduce_Dim = FALSE;
......
......@@ -90,15 +90,14 @@ extern int cdoExpMode;
extern int CDO_Color;
extern int CDO_Use_FFTW;
extern int CDO_Version_Info;
extern int cdoDiag;
extern int cdoNumVarnames;
extern char **cdoVarnames;
extern char CDO_File_Suffix[32]; // refactor: added keyword extern
/* moved here from *.c */
extern char CDO_Version[]; // refactor: moved here from pstream.c
extern const char *CDO_Version;
typedef struct {
......
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