Commit 9d58937b authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Merge declaration and definition.

parent 5950a375
......@@ -198,7 +198,7 @@ keepaspectratio]{cdo_libdep.pdf}}%
\end{picture}
\begin{flushright}
\large \textbf{Climate Data Operators \\ Version 1.8.0 \\ February 2017}
\large \textbf{Climate Data Operators \\ Version 1.8.1 \\ March 2017}
\end{flushright}
\vfill
......
......@@ -14,7 +14,7 @@
\put(0,0.0){\line(1,0){3.95}}
\end{picture}
\begin{flushright}
{\small{Climate Data Operators \\ Version 1.8.0 \\ February 2017}}
{\small{Climate Data Operators \\ Version 1.8.1 \\ March 2017}}
\end{flushright}
\vspace*{0mm}
......
......@@ -83,7 +83,7 @@ INTEGER Comma separated list of timesteps. Negative values selects timesteps fro
@Item = timestep_of_year
INTEGER Comma separated list of timesteps of year.
@Item = timestepmask
STRING Read timesteps from a mask file.
STRING Read timesteps from a mask file.
@EndParameter
......
......@@ -46,21 +46,19 @@ long get_nfft(void)
void fft_set(double *trigs, long *ifax, long n)
{
long j, k, nfax, len = n;
long nhl;
double del, angle;
del = 4.0*asin(1.0) / n;
nhl = n / 2;
for ( k = 0; k < nhl; k++ )
long j, len = n;
long nhl = n / 2;
double del = 4.0*asin(1.0) / n;
double angle;
for ( long k = 0; k < nhl; k++ )
{
angle = k * del;
trigs[2*k ] = cos(angle);
trigs[2*k+1] = sin(angle);
}
nfax = 0;
for (k = 0; k < 9; ++k) ifax[k] = 0;
long nfax = 0;
for ( long k = 0; k < 9; ++k ) ifax[k] = 0;
ifax[9] = n;
......@@ -82,7 +80,7 @@ void fft_set(double *trigs, long *ifax, long n)
#if defined(__uxp__)
#pragma loop scalar
#endif
for ( k = 0; k < nfax / 2; k++ )
for ( long k = 0; k < nfax / 2; k++ )
{
j = ifax[k + 1];
ifax[k + 1] = ifax[nfax - k];
......@@ -91,7 +89,7 @@ void fft_set(double *trigs, long *ifax, long n)
if ( n > 8 )
{
fprintf(stderr, "fft does not work with len %ld\n", len);
fprintf(stderr, "FFT does not work with len=%ld (n=%ld)!\n", len, n);
exit(1);
}
}
......
......@@ -362,8 +362,7 @@ void after_legini_full(int ntr, int nlat, double *restrict poli, double *restric
void after_legini(int ntr, int nlat, double *restrict poli, double *restrict pold, double *restrict coslat)
{
int jgl, jm, jn, is;
int isp, latn, lats;
int is, lats;
int waves = ntr + 1;
int dimpnm = (ntr + 1)*(ntr + 4)/2;
......@@ -374,20 +373,20 @@ void after_legini(int ntr, int nlat, double *restrict poli, double *restrict pol
double *work = (double*) Malloc(3*waves * sizeof(double));
gaussaw(gmu, gwt, nlat);
for ( jgl = 0; jgl < nlat; ++jgl ) gwt[jgl] *= 0.5;
for ( int jgl = 0; jgl < nlat; ++jgl ) gwt[jgl] *= 0.5;
for ( jgl = 0; jgl < nlat; ++jgl )
for ( int jgl = 0; jgl < nlat; ++jgl )
coslat[jgl] = sqrt(1.0 - gmu[jgl]*gmu[jgl]);
for ( jgl = 0; jgl < nlat/2; jgl++ )
for ( int jgl = 0; jgl < nlat/2; jgl++ )
{
double zgwt = gwt[jgl];
jspleg1(pnm, gmu[jgl], ntr, work);
latn = jgl;
isp = 0;
for ( jm = 0; jm < waves; jm++ )
int latn = jgl;
int isp = 0;
for ( int jm = 0; jm < waves; jm++ )
{
#if defined(SX)
#pragma vdir nodep
......@@ -395,7 +394,7 @@ void after_legini(int ntr, int nlat, double *restrict poli, double *restrict pol
#if defined(HAVE_OPENMP4)
#pragma omp simd
#endif
for ( jn = 0; jn < waves - jm; jn++ )
for ( int jn = 0; jn < waves - jm; jn++ )
{
is = (jn+1)%2 * 2 - 1;
lats = latn - jgl + nlat - jgl - 1;
......
......@@ -111,13 +111,14 @@ int nlat_to_nlon(int nlat)
if ( n <= 8 ) break;
nlon = nlon + 2;
/*
if ( nlon > 9999 )
{
nlon = 2 * nlat;
fprintf(stderr, "FFT does not work with len %d!\n", nlon);
break;
}
*/
}
return nlon;
......
......@@ -509,6 +509,7 @@ static const char *SelectHelp[] = {
" year INTEGER Comma separated list of years.",
" timestep INTEGER Comma separated list of timesteps. Negative values selects timesteps from the end (NetCDF only).",
" timestep_of_year INTEGER Comma separated list of timesteps of year.",
" timestepmask STRING Read timesteps from a mask file.",
NULL
};
......
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