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

Changed format of defines.

parent 5e36dda5
......@@ -10,7 +10,7 @@
/* */
/* ============================================================= */
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
......
......@@ -4,7 +4,7 @@
#include "cdo_int.h"
#include "pstream.h"
#if defined(HAVE_LIBCMOR)
#ifdef HAVE_LIBCMOR
#include <unistd.h>
extern "C" {
......@@ -4881,7 +4881,7 @@ void *CMOR(void *argument)
cdoInitialize(argument);
#if defined(HAVE_LIBCMOR)
#ifdef HAVE_LIBCMOR
signal(SIGTERM, sigfunc);
int nparams = operatorArgc();
......
......@@ -29,8 +29,8 @@
#define HAVE_UDUNITS2
#endif
#if defined(HAVE_UDUNITS2)
#if defined(HAVE_UDUNITS2_UDUNITS2_H)
#ifdef HAVE_UDUNITS2
#ifdef HAVE_UDUNITS2_UDUNITS2_H
# include <udunits2/udunits2.h>
#else
# include <udunits2.h>
......@@ -521,7 +521,7 @@ void *CMOR_lite(void *argument)
}
}
#if defined(HAVE_UDUNITS2)
#ifdef HAVE_UDUNITS2
if ( var->changeunits )
{
int nerr = 0;
......@@ -555,7 +555,7 @@ void *CMOR_lite(void *argument)
pstreamClose(streamID2);
pstreamClose(streamID1);
#if defined(HAVE_UDUNITS2)
#ifdef HAVE_UDUNITS2
for ( int varID = 0; varID < nvars; varID++ )
if ( vars[varID].ut_converter ) cdoConvertFree(vars[varID].ut_converter);
......
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
......
......@@ -515,7 +515,7 @@ void *Collgrid(void *argument)
double missval = vlistInqVarMissval(vlistID2, varID2);
for ( size_t i = 0; i < gridsize2; i++ ) array2[i] = missval;
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( int fileID = 0; fileID < nfiles; fileID++ )
......
......@@ -56,7 +56,7 @@ static void selEndOfPeriod(field_type *periods, field_type history, field_type c
{
if ( current.nmiss > 0 || history.nmiss > 0 )
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( i = 0; i < len; i++ )
......@@ -80,7 +80,7 @@ static void selEndOfPeriod(field_type *periods, field_type history, field_type c
}
else
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( i = 0; i < len; i++ )
......@@ -91,7 +91,7 @@ static void selEndOfPeriod(field_type *periods, field_type history, field_type c
{
if ( current.nmiss > 0 )
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( i = 0; i < len; i++ )
......@@ -106,7 +106,7 @@ static void selEndOfPeriod(field_type *periods, field_type history, field_type c
}
else
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( i = 0; i < len; i++ )
......@@ -216,7 +216,7 @@ void *Consecstat(void *argument)
pstreamDefRecord(ostreamID, varID, levelID);
pstreamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
}
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared) schedule(static)
for ( size_t i = 0; i < gridInqSize(vars[varID][levelID].grid); i++ )
hist[varID][levelID].ptr[i] = vars[varID][levelID].ptr[i];
......
......@@ -130,7 +130,7 @@ void *Detrend(void *argument)
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for ( levelID = 0; levelID < nlevel; levelID++ )
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(array1, array2, vars, varID, levelID, gridsize, nts, missval)
#endif
for ( i = 0; i < gridsize; i++ )
......
......@@ -28,7 +28,7 @@
* number of contributing values during summation.
*/
#if defined(_OPENMP)
#ifdef _OPENMP
#include <omp.h>
#endif
......@@ -52,7 +52,7 @@ static
void scale_eigvec_time(double *restrict out, int tsID, int nts, size_t npack, const size_t *restrict pack, const double *restrict weight,
double **covar, double **data, double missval, double sum_w)
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(npack, nts, tsID, pack, data, covar, out)
#endif
for ( size_t i = 0; i < npack; ++i )
......@@ -74,7 +74,7 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, size_t npack, co
// Normalizing
double sum = 0;
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) reduction(+:sum) \
shared(out,weight,pack,npack)
#endif
......@@ -87,14 +87,14 @@ void scale_eigvec_time(double *restrict out, int tsID, int nts, size_t npack, co
if ( sum > 0 )
{
sum = sqrt(sum/sum_w);
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(npack,pack,sum,out)
#endif
for ( size_t i = 0; i < npack; ++i ) out[pack[i]] /= sum;
}
else
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(npack,pack,out,missval)
#endif
for ( size_t i = 0; i < npack; ++i ) out[pack[i]] = missval;
......@@ -126,7 +126,7 @@ enum T_EIGEN_MODE get_eigenmode(void)
eigen_mode==JACOBI?"jacobi":"danielson_lanczos",
envstr?"Environment":" default");
#if defined(_OPENMP)
#ifdef _OPENMP
if ( omp_get_max_threads() > 1 && eigen_mode == DANIELSON_LANCZOS ) {
cdoWarning("Requested parallel computation with %i Threads ",omp_get_max_threads());
cdoWarning(" but environmental setting CDO_SVD_MODE causes sequential ");
......@@ -406,7 +406,7 @@ void *EOFs(void * argument)
{
covar = eofdata[varID][levelID].covar;
}
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( size_t ipack = 0; ipack < npack; ++ipack )
......@@ -558,7 +558,7 @@ void *EOFs(void * argument)
eofdata[varID][levelID].covar_array = covar_array;
eofdata[varID][levelID].covar = covar;
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared) schedule(dynamic)
#endif
for ( int j1 = 0; j1 < nts; j1++ )
......
......@@ -15,7 +15,7 @@
GNU General Public License for more details.
*/
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
......@@ -27,7 +27,7 @@
#include "pstream.h"
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
# include "netcdf.h"
#endif
......@@ -99,7 +99,7 @@ void inivars_ml(VAR **vars)
inivar(&(*vars)[4], GRID_SPECTRAL, ZAXIS_SURFACE, 152, "LSP", "log surface pressure", "");
}
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
static
void nce(int istat)
{
......@@ -115,7 +115,7 @@ static
int import_e5ml(const char *filename, VAR **vars)
{
int nvars = 0;
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
int nc_dim_id, nc_var_id;
size_t dimlen, nvals;
size_t start[3];
......@@ -277,7 +277,7 @@ int import_e5ml(const char *filename, VAR **vars)
static
void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtime, int ntr)
{
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
int nc_var_id;
size_t nvals;
size_t start[3], count[3];
......@@ -609,7 +609,7 @@ void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtim
#endif
}
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
static
void read_gg3d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxisID)
{
......@@ -647,7 +647,7 @@ void read_gg3d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxis
}
#endif
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
static
void read_fc4d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxisID, int nhgl, int nmp1)
{
......@@ -688,7 +688,7 @@ static
int import_e5res(const char *filename, VAR **vars, ATTS *atts)
{
int nvars = 0;
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
int nc_var_id;
int varid;
size_t nvals;
......@@ -1084,7 +1084,7 @@ int import_e5res(const char *filename, VAR **vars, ATTS *atts)
static
void export_e5res(const char *filename, VAR *vars, int nvars)
{
#if defined(HAVE_LIBNETCDF)
#ifdef HAVE_LIBNETCDF
int nc_var_id;
int varid;
size_t nvals;
......
......@@ -257,7 +257,7 @@ void *Ensstat3(void *argument)
for ( int recID = 0; recID < nrecs0; recID++ )
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(ef, nfiles) \
private(streamID, nmiss) \
lastprivate(varID, levelID)
......@@ -278,7 +278,7 @@ void *Ensstat3(void *argument)
for ( binID=0;binID<nfiles;binID++ )
array2[binID][0] = 0;
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared) private(binID)
#endif
for ( i = 0; i < gridsize; i++ )
......@@ -310,7 +310,7 @@ void *Ensstat3(void *argument)
/* ************** */
// for ( j=0; j<nfiles; j++ )
// fprintf(stderr,"%5.2g ",field[ompthID].ptr[j]);
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp critical
#endif
binID = (int) fldfun(field[ompthID], operfunc);
......
......@@ -28,7 +28,7 @@
* number of contributing values during summation.
*/
#if defined(_OPENMP)
#ifdef _OPENMP
#include <omp.h>
#endif
......@@ -304,7 +304,7 @@ void *EOF3d(void * argument)
}
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared) schedule(static,2000)
#endif
for ( int j1 = 0; j1 < nts; j1++ )
......@@ -349,7 +349,7 @@ void *EOF3d(void * argument)
{
double *eigenvec = eigenvectors[varID][eofID];
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(varID,nts,eofID,npack,pack,cov,datafields,eigenvec)
#endif
for ( size_t i = 0; i < npack; i++ )
......@@ -364,7 +364,7 @@ void *EOF3d(void * argument)
// NORMALIZING
double sum = 0;
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(eigenvec,weight,pack,npack,gridsizemax) reduction(+:sum)
#endif
for ( size_t i = 0; i < npack; i++ )
......@@ -374,7 +374,7 @@ void *EOF3d(void * argument)
if ( sum > 0 )
{
sum = sqrt(sum);
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(sum,npack,eigenvec,pack)
#endif
for ( size_t i = 0; i < npack; i++ )
......@@ -382,7 +382,7 @@ void *EOF3d(void * argument)
}
else
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(eigenvec,pack,missval,npack)
#endif
for ( size_t i = 0; i < npack; i++ )
......
......@@ -23,7 +23,7 @@
Filter bandpass
*/
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
......@@ -34,7 +34,7 @@
#include "statistic.h"
#include "pstream.h"
#if defined(HAVE_LIBFFTW3)
#ifdef HAVE_LIBFFTW3
#include <fftw3.h>
#endif
......@@ -62,7 +62,7 @@ void create_fmasc(int nts, double fdata, double fmin, double fmax, int *fmasc)
fmasc[i] = fmasc[nts-i] = 1;
}
#if defined(HAVE_LIBFFTW3)
#ifdef HAVE_LIBFFTW3
static
void filter_fftw(int nts, const int *fmasc, fftw_complex *fft_out, fftw_plan *p_T2S, fftw_plan *p_S2T)
{
......@@ -136,7 +136,7 @@ void *Filter(void *argument)
{
double *array1;
double *array2;
#if defined(HAVE_LIBFFTW3)
#ifdef HAVE_LIBFFTW3
fftw_complex *in_fft;
fftw_complex *out_fft;
fftw_plan p_T2S;
......@@ -155,7 +155,7 @@ void *Filter(void *argument)
if ( CDO_Use_FFTW )
{
#if defined(HAVE_LIBFFTW3)
#ifdef HAVE_LIBFFTW3
if ( cdoVerbose ) cdoPrint("Using fftw3 lib");
use_fftw = true;
#else
......@@ -253,7 +253,7 @@ void *Filter(void *argument)
if ( use_fftw )
{
#if defined(HAVE_LIBFFTW3)
#ifdef HAVE_LIBFFTW3
for ( int i = 0; i < ompNumThreads; i++ )
{
ompmem[i].in_fft = (fftw_complex*) Malloc(nts*sizeof(fftw_complex));
......@@ -315,8 +315,8 @@ void *Filter(void *argument)
{
if ( use_fftw )
{
#if defined(HAVE_LIBFFTW3)
#if defined(_OPENMP)
#ifdef HAVE_LIBFFTW3
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( int i = 0; i < gridsize; i++ )
......@@ -338,7 +338,7 @@ void *Filter(void *argument)
}
else
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( int i = 0; i < gridsize; i++ )
......@@ -361,7 +361,7 @@ void *Filter(void *argument)
if ( use_fftw )
{
#if defined(HAVE_LIBFFTW3)
#ifdef HAVE_LIBFFTW3
for ( int i = 0; i < ompNumThreads; i++ )
{
Free(ompmem[i].in_fft);
......
......@@ -120,7 +120,7 @@ void *Fourier(void *argument)
nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
for ( levelID = 0; levelID < nlevel; levelID++ )
{
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared) private(tsID)
#endif
for ( int i = 0; i < gridsize; i++ )
......
......@@ -478,7 +478,7 @@ void gridboxstat(field_type *field1, field_type *field2, size_t xinc, size_t yin
size_t nlon2 = gridInqXsize(gridID2);
size_t nlat2 = gridInqYsize(gridID2);
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(shared)
#endif
for ( size_t ig = 0; ig < nlat2*nlon2; ++ig )
......@@ -487,7 +487,7 @@ void gridboxstat(field_type *field1, field_type *field2, size_t xinc, size_t yin
/*
int lprogress = 1;
#if defined(_OPENMP)
#ifdef _OPENMP
if ( ompthID != 0 ) lprogress = 0;
#endif
findex++;
......
......@@ -15,7 +15,7 @@
GNU General Public License for more details.
*/
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
......
......@@ -15,13 +15,13 @@
GNU General Public License for more details.
*/
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#define H5_USE_16_API
#if defined(HAVE_LIBHDF5)
#ifdef HAVE_LIBHDF5
# include "hdf5.h"
#endif
......@@ -69,7 +69,7 @@ typedef struct {
datasets_t;
#if defined(HAVE_LIBHDF5)
#ifdef HAVE_LIBHDF5
static
void print_filter(hid_t dset_id, char *varname)
{
......@@ -1391,7 +1391,7 @@ void dsets_init(datasets_t *dsets)
void *Importcmsaf(void *argument)
{
#if defined(HAVE_LIBHDF5)
#ifdef HAVE_LIBHDF5
int streamID;
int gridID = -1, zaxisID, taxisID, vlistID;
int i, offset;
......@@ -1413,7 +1413,7 @@ void *Importcmsaf(void *argument)
if ( cdoDefaultFileType == CDI_UNDEFID )
cdoDefaultFileType = CDI_FILETYPE_NC;
#if defined(HAVE_LIBHDF5)
#ifdef HAVE_LIBHDF5
dsets_init(&dsets);
/* Open an existing file. */
......
......@@ -47,7 +47,7 @@ void vert_interp_lev(int gridsize, double missval, double *vardata1, double *var
double *var1L1 = vardata1+gridsize*idx1;
double *var1L2 = vardata1+gridsize*idx2;
#if defined(_OPENMP)
#ifdef _OPENMP
#pragma omp parallel for default(none) shared(gridsize, var2, var1L1, var1L2, wgt1, wgt2, missval)
#endif
for ( int i = 0; i < gridsize; ++i )
......
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h" /* HAVE_LIBMAGICS */
#endif
......@@ -9,7 +9,7 @@
#include "grid.h"
#include "pstream.h"
#if defined(HAVE_LIBMAGICS)
#ifdef HAVE_LIBMAGICS
#include "magics_api.h"
......@@ -876,7 +876,7 @@ void *Maggraph(void *argument)
{
cdoInitialize(argument);
#if defined(HAVE_LIBMAGICS)
#ifdef HAVE_LIBMAGICS
char varname[CDI_MAX_NAME], units[CDI_MAX_NAME];
int varID, levelID;
int gridID;
......
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h" /* HAVE_LIBMAGICS */
#endif
......@@ -9,7 +9,7 @@
#include "pstream.h"
#if defined(HAVE_LIBMAGICS)
#ifdef HAVE_LIBMAGICS
#include "magics_api.h"
......@@ -1099,7 +1099,7 @@ void *Magplot(void *argument)
{
cdoInitialize(argument);
#if defined(HAVE_LIBMAGICS)
#ifdef HAVE_LIBMAGICS
int nrecs;
int levelID;
size_t nmiss;
......
#if defined(HAVE_CONFIG_H)
#ifdef HAVE_CONFIG_H
# include "config.h" /* HAVE_LIBMAGICS */
#endif
......@@ -9,7 +9,7 @@
#include "pstream.h"
#if defined(HAVE_LIBMAGICS)
#ifdef HAVE_LIBMAGICS
#include "magics_api.h"
......@@ -313,7 +313,7 @@ void *Magvector(void *argument)
{
cdoInitialize(argument);
#if defined(HAVE_LIBMAGICS)
#ifdef HAVE_LIBMAGICS
int nrecs;
int levelID;
size_t nmiss;
......
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