after_sptrans.cc 13.8 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
#include <stdio.h>
2
#include <stdlib.h>
Uwe Schulzweida's avatar
Uwe Schulzweida committed
3
4
5
#include <string.h>
#include <math.h>

6
7
8
9
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

10
11
12
13
#ifndef _DMEMORY_H
#  include "dmemory.h"
#endif

14
#include "constants.h"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
15

16
17
18
19
20
#define  OPENMP4  201307
#if defined(_OPENMP) && defined(OPENMP4) && _OPENMP >= OPENMP4
#define  HAVE_OPENMP4  1
#endif

21
22
23
#ifdef __cplusplus
extern "C" {
#endif
24
void gaussaw(double *pa, double *pw, size_t nlat);
25
26
27
#if defined (__cplusplus)
}
#endif
28
29

static
Uwe Schulzweida's avatar
Uwe Schulzweida committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
void jspleg1(double *pleg, double plat, int ktrunc, double *work)
{
  /*
     jspleg1 - Routine to calculate legendre functions

     Purpose
     --------

     This routine calculates the legendre functions for one latitude.
     (but not their derivatives)


     Interface
     ----------

     jspleg1( pleg, plat, ktrunc)


     Input parameters
     ----------------

     plat      - Latitude in radians
     ktrunc    - Spectral truncation


     Output parameters
     -----------------

     pleg      - Array of legendre functions for one latitude.
                 The array must be at least (KTRUNC+1)*(KTRUNC+4)/2 
                 words long.

     Method
     ------

     Recurrence relation with explicit relations for P(m,m) and 
     P(m,m+1)


     AUTHOR
     ------

     J.D.Chambers         ECMWF        9 November 1993


     Modifications
     -------------

     None

  */
  int itout1, i1m, ilm, jm, jcn, im2;
82
83
  double zsin, zcos, zf1m, zre1, zf2m, znsqr, ze1, ze2;
  double zjmsqr;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
  double *zhlp1, *zhlp2, *zhlp3;


  /* Initialization */

  itout1 = ktrunc+1;
  /*  zsin   = sin(plat); */
  zsin   = plat;
  zcos   = sqrt(1.-zsin*zsin);

  zhlp1 = work;
  zhlp2 = work + itout1;
  zhlp3 = work + itout1 + itout1;

  /*  Step 1.        M = 0, N = 0 and N = 1 */

  ilm     = 1;
  pleg[0] = 1.0;
  zf1m    = sqrt(3.0);
  pleg[1] = zf1m*zsin;

  /*  Step 2.       Sum for M = 0 to T (T = truncation) */

  for ( jm = 1; jm < itout1; jm++ )
    {
      zhlp1[jm] = sqrt(2.*jm+3.);
      zhlp2[jm] = 1./sqrt(2.*jm);
    }

  zhlp1[0] = sqrt(3.);

  for ( jm = 0; jm < itout1; jm++ )
    {
      i1m  = jm - 1;
      zre1 = zhlp1[jm];
      ze1  = 1./zre1;

      /*   Step 3.       M > 0 only */

      if ( i1m != -1 )
	{
          zf2m = zf1m*zcos*zhlp2[jm];
          zf1m = zf2m*zre1;

	  /*  Step 4.       N = M and N = M+1 */

          ilm       = ilm+1;
          pleg[ilm] = zf2m;
          ilm       = ilm+1;
          pleg[ilm] = zf1m*zsin;

	  /* When output truncation is reached, return to calling program */

          if ( jm == (itout1-1) ) break;
	}

      /*  Step 5.       Sum for N = M+2 to T+1 */

142
      zjmsqr = jm*jm;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
143
144
145
146
      im2 = i1m+2;

      for ( jcn = im2; jcn < itout1; jcn++ )
	{
147
148
          znsqr      = (jcn + 1)*(jcn + 1);
	  zhlp3[jcn] = sqrt((4.*znsqr-1.)/(znsqr-zjmsqr));
Uwe Schulzweida's avatar
Uwe Schulzweida committed
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
	}

      for ( jcn = im2; jcn < itout1; jcn++ )
	{
          ze2        = zhlp3[jcn];
          ilm        = ilm+1;
          pleg[ilm]  = ze2*(zsin*pleg[ilm-1]-ze1*pleg[ilm-2]);
          ze1        = 1./ze2;
	}
    }
}


/* ============================================= */
/* phcs - Compute values of Legendre polynomials */
/*        and their meridional derivatives       */
/* ============================================= */
166
static
Uwe Schulzweida's avatar
Uwe Schulzweida committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
void phcs(double *pnm, double *hnm, int waves, double pmu,
	  double *ztemp1, double *ztemp2)
{
  int twowaves;

  int jk, jn, jm;

  double jnmjk;
  double zcos2;
  double lat;
  double zan;
  double zsinpar;
  double zcospar;
  double zsqp;
  double zcosfak;
  double zsinfak;
  double zq;
  double zwm2;
  double zw;
  double zwq;
  double zq2m1;
  double zwm2q2;
  double z2q2;
  double zcnm;
  double zdnm;
  double zenm;

  twowaves  = waves << 1;

  zcos2     = sqrt(1.0 - pmu*pmu);
  lat       = acos(pmu);
  zan       = 1.0;

  ztemp1[0] = 0.5;

  for ( jn = 1; jn < twowaves; jn++ )
    {
      zsqp    = 1.0 / sqrt((double)(jn + jn*jn));
      zan    *= sqrt(1.0 - 1.0/(4*jn*jn));

      zcospar = cos(lat * jn);
      zsinpar = sin(lat * jn) * jn * zsqp;
      zcosfak = 1.0;

      for ( jk = 2; jk < jn; jk += 2 )
	{
	  jnmjk = jn - jk;
	  zcosfak *= (jk-1.0) * (jn+jnmjk+2.0) / (jk * (jn+jnmjk+1.0));
	  zsinfak  = zcosfak * (jnmjk) * zsqp;
	  zcospar += zcosfak * cos(lat * jnmjk);
	  zsinpar += zsinfak * sin(lat * jnmjk);
	}

      /*  code for jk == jn */

      if ((jn & 1) == 0)
	{
	  zcosfak *= (double)((jn-1) * (jn+2)) / (double)(jn * (jn+1));
	  zcospar += zcosfak * 0.5;
	}
      ztemp1[jn  ] = zan * zcospar;
      ztemp2[jn-1] = zan * zsinpar;
    }

  memcpy(pnm, ztemp1, waves*sizeof(double));
  pnm += waves;
  memcpy(pnm, ztemp2, waves*sizeof(double));
  pnm += waves;

  hnm[0] = 0.0;
  for (jn = 1; jn < waves; jn++)
    hnm[jn] = jn * (pmu * ztemp1[jn] - sqrt((jn+jn+1.0) / (jn+jn-1.0)) * ztemp1[jn-1]);

  hnm += waves;

  hnm[0] = pmu * ztemp2[0];

  for (jn = 1; jn < waves; jn++)
    hnm[jn] = (jn+1) * pmu * ztemp2[jn]
            - sqrt(((jn+jn+3.0)*((jn+1)*(jn+1)-1.0)) / (jn+jn+1.0)) * ztemp2[jn-1];
	    
  hnm += waves;

  for (jm = 2; jm < waves; jm++)
    {
      pnm[0] = sqrt(1.0 + 1.0 / (jm+jm)) * zcos2 * ztemp2[0];
      hnm[0] = jm * pmu * pnm[0];
Uwe Schulzweida's avatar
Uwe Schulzweida committed
254
#if defined(CRAY)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
255
256
#pragma _CRI novector
#endif
Uwe Schulzweida's avatar
Uwe Schulzweida committed
257
#if defined(__uxp__)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
#pragma loop scalar
#endif
      for (jn = 1; jn < twowaves-jm; jn++)
	{
          zq      = jm + jm + jn - 1;
          zwm2    = zq + jn;
          zw      = zwm2 + 2;
          zwq     = zw*zq;
          zq2m1   = zq*zq - 1.;
          zwm2q2  = zwm2*zq2m1;
          z2q2    = zq2m1*2;
          zcnm    = sqrt((zwq*(zq-2.))/(zwm2q2-z2q2));
          zdnm    = sqrt((zwq*(jn+1.))/zwm2q2);
          zenm    = sqrt(zw * jn /((zq+1.0) * zwm2));
          pnm[jn] = zcnm * ztemp1[jn] - pmu
                  * (zdnm * ztemp1[jn+1] - zenm * pnm[jn-1]);
          hnm[jn] = (jm + jn) * pmu * pnm[jn]
                  - sqrt(zw * jn * (zq+1) / zwm2) * pnm[jn-1];
	}
      memcpy(ztemp1, ztemp2, twowaves*sizeof(double));
      memcpy(ztemp2, pnm   , twowaves*sizeof(double));
      pnm += waves;
      hnm += waves;
    }
}


285
286
void after_legini_full(int ntr, int nlat, double *restrict poli, double *restrict pold, double *restrict pdev,
		       double *restrict pol2, double *restrict pol3, double *restrict coslat)
287
288
289
{
  int jgl, jm, jn;
  int jsp;
290
  double gmusq;
291

292
293
  int waves =  ntr + 1;
  int dimsp = (ntr + 1) * (ntr + 2);
294

295
296
  double *gmu = (double*) Malloc(nlat * sizeof(double));
  double *gwt = (double*) Malloc(nlat * sizeof(double));
297
298
299
300

  gaussaw(gmu, gwt, nlat);

#if ! defined(_OPENMP)
301
302
303
304
  double *pnm    = (double*) Malloc(dimsp * sizeof(double));
  double *hnm    = (double*) Malloc(dimsp * sizeof(double));
  double *ztemp1 = (double*) Malloc((waves<<1) * sizeof(double));
  double *ztemp2 = (double*) Malloc((waves<<1) * sizeof(double));
305
306
307
#endif

#if defined(_OPENMP)
308
#pragma omp parallel for default(shared) private(jm, jn, jsp, gmusq)
309
310
311
312
#endif
  for ( jgl = 0; jgl < nlat; jgl++ )
    {
#if defined(_OPENMP)
313
314
315
316
      double *pnm    = (double*) Malloc(dimsp * sizeof(double));
      double *hnm    = (double*) Malloc(dimsp * sizeof(double));
      double *ztemp1 = (double*) Malloc((waves<<1) * sizeof(double));
      double *ztemp2 = (double*) Malloc((waves<<1) * sizeof(double));
317
318
#endif
      gmusq = 1.0 - gmu[jgl]*gmu[jgl];
319
      coslat[jgl] = sqrt(gmusq);
320
321
322

      phcs(pnm, hnm, waves, gmu[jgl], ztemp1, ztemp2);

323
324
325
326
327
328
329
330
331
      double zgwt = gwt[jgl];
      double zrafgmusqr = 1./(PlanetRadius * gmusq);
      double zradsqrtgmusqr = 1./(-PlanetRadius * sqrt(gmusq));

      const int lpold = pold != NULL;
      const int lpdev = pdev != NULL;
      const int lpol2 = pol2 != NULL;
      const int lpol3 = pol3 != NULL;

332
333
334
335
      jsp = jgl;
      for ( jm = 0; jm < waves; jm++ )
	for ( jn = 0; jn < waves - jm; jn++ )
	  {
336
337
338
339
340
	               poli[jsp] = pnm[jm*waves+jn] * 2.0;
	    if (lpold) pold[jsp] = pnm[jm*waves+jn] * zgwt;
	    if (lpdev) pdev[jsp] = hnm[jm*waves+jn] * 2.0 * zradsqrtgmusqr;
	    if (lpol2) pol2[jsp] = hnm[jm*waves+jn] * zgwt * zrafgmusqr;
	    if (lpol3) pol3[jsp] = pnm[jm*waves+jn] * zgwt * jm * zrafgmusqr;
341
342
	    jsp += nlat;
	  }
343
      
344
#if defined(_OPENMP)
345
346
347
348
      Free(ztemp2);
      Free(ztemp1);
      Free(pnm);
      Free(hnm);
349
350
351
352
#endif
    }

#if ! defined(_OPENMP)
353
354
355
356
  Free(ztemp2);
  Free(ztemp1);
  Free(pnm);
  Free(hnm);
357
#endif
358
359
  Free(gwt);
  Free(gmu);
360
361
362
}


363
void after_legini(int ntr, int nlat, double *restrict poli, double *restrict pold, double *restrict coslat)
364
{
365
  int is, lats;
366

367
368
  int waves  =  ntr + 1;
  int dimpnm = (ntr + 1)*(ntr + 4)/2;
369

370
371
372
373
  double *gmu  = (double*) Malloc(nlat * sizeof(double));
  double *gwt  = (double*) Malloc(nlat * sizeof(double));
  double *pnm  = (double*) Malloc(dimpnm * sizeof(double));
  double *work = (double*) Malloc(3*waves * sizeof(double));
374
375

  gaussaw(gmu, gwt, nlat);
376
  for ( int jgl = 0; jgl < nlat; ++jgl ) gwt[jgl] *= 0.5;
377

378
  for ( int jgl = 0; jgl < nlat; ++jgl )
379
    coslat[jgl] = sqrt(1.0 - gmu[jgl]*gmu[jgl]);
380

381
  for ( int jgl = 0; jgl < nlat/2; jgl++ )
382
    {
383
      double zgwt = gwt[jgl];
384

385
386
      jspleg1(pnm, gmu[jgl], ntr, work);

387
388
389
      int latn = jgl;
      int isp = 0;
      for ( int jm = 0; jm < waves; jm++ )
390
391
392
393
394
395
396
	{
#if defined(SX)
#pragma vdir nodep
#endif
#if defined(HAVE_OPENMP4)
#pragma omp simd
#endif
397
	  for ( int jn = 0; jn < waves - jm; jn++ )
398
399
400
401
	    {
	      is = (jn+1)%2 * 2 - 1;
	      lats = latn - jgl + nlat - jgl - 1;
	      poli[latn] = pnm[isp];
402
	      pold[latn] = pnm[isp] * zgwt;
403
	      poli[lats] = pnm[isp] * is;
404
	      pold[lats] = pnm[isp] * zgwt * is;
405
406
407
408
409
410
411
	      latn += nlat;
	      isp++;
	    }
	  isp++;
	}
    }

412
413
414
415
  Free(work);
  Free(pnm);
  Free(gwt);
  Free(gmu);
416
417
418
}


Uwe Schulzweida's avatar
Uwe Schulzweida committed
419
/* to slow for nec, 2.0 instead of 2.3 GFlops ( vector length too small ) */
420
void sp2fctest(const double *sa, double *fa, const double *poli, long nlev, long nlat, long nfc, long nt)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
421
{
422
  long lats, is;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
423
  double sar, sai;
424
425
  double saris, saiis;
  double *restrict far, *restrict fai;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
426

427
  long nsp2 = (nt+1)*(nt+2);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
428

429
  for ( long lev = 0; lev < nlev; lev++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
430
    {
431
432
433
      const double *restrict pol = poli;
      const double *restrict sal = sa + lev*nsp2;
      double *fal = fa + lev*nfc*nlat;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
434
435
      memset(fal, 0, nfc*nlat*sizeof(double));

436
      for ( long jm = 0; jm <= nt; jm++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
437
	{
438
	  for ( long jn = 0; jn <= nt - jm; jn++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
439
440
441
442
	    {
	      is = (jn+1)%2 * 2 - 1;
	      sar = *sal++;
	      sai = *sal++;
443
444
              saris = sar*is;
              saiis = sai*is;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
445
446
	      far = fal;
	      fai = fal + nlat;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
447
#if defined(SX)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
448
#pragma vdir nodep
449
450
451
#endif
#if defined(HAVE_OPENMP4)
#pragma omp simd
Uwe Schulzweida's avatar
Uwe Schulzweida committed
452
#endif
453
	      for ( long latn = 0; latn < nlat/2; latn++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
454
455
		{
		  lats = nlat - latn - 1;
456
457
458
459
		  far[latn] += pol[latn] * sar;
		  fai[latn] += pol[latn] * sai;
		  far[lats] += pol[latn] * saris;
		  fai[lats] += pol[latn] * saiis;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
460
461
462
463
464
465
466
467
468
		}
	      pol += nlat;
	    }
	  fal += 2 * nlat;
	}
    }
}


469
void sp2fc(const double *sa, double *fa, const double *poli, long nlev, long nlat, long nfc, long nt)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
470
{
471
  long nsp2 = (nt+1)*(nt+2);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
472

Uwe Schulzweida's avatar
Uwe Schulzweida committed
473
#if defined(_OPENMP)
474
#pragma omp parallel for default(shared)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
475
#endif
476
  for ( long lev = 0; lev < nlev; lev++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
477
    {
478
479
480
      const double *restrict pol = poli;
      const double *restrict sal = sa + lev*nsp2;
      double *fal = fa + lev*nfc*nlat;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
481
482
      memset(fal, 0, nfc*nlat*sizeof(double));

483
484
485
      double *restrict far, *restrict fai;
      double sar, sai;

486
      for ( long jmm = 0; jmm <= nt; jmm++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
487
	{
488
	  for ( long jfc = jmm; jfc <= nt; jfc++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
489
490
491
492
493
	    {
	      sar = *sal++;
	      sai = *sal++;
	      far = fal;
	      fai = fal + nlat;
494
495
496
497
498
              /* unaligned loop start
#if defined(HAVE_OPENMP4)
#pragma omp simd
#endif
              */
499
	      for ( long lat = 0; lat < nlat; lat++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
500
501
502
503
504
505
506
507
508
509
510
511
512
513
		{
		  far[lat] += pol[lat] * sar;
		  fai[lat] += pol[lat] * sai;
		}
	      pol += nlat;
	    }
	  fal += 2 * nlat;
	}
    }
}


void fc2sp(double *fa, double *sa, double *poli, int nlev, int nlat, int nfc, int nt)
{
514
  int nsp2 = (nt+1)*(nt+2);
Uwe Schulzweida's avatar
Uwe Schulzweida committed
515

Uwe Schulzweida's avatar
Uwe Schulzweida committed
516
#if defined(_OPENMP)
517
#pragma omp parallel for default(shared)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
518
#endif
519
  for ( int lev = 0; lev < nlev; lev++ )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
520
    {
521
522
523
524
525
526
527
528
529
      const double *restrict pol = poli;
      double *fal = fa + lev*nfc*nlat;
      double *sal = sa + lev*nsp2;

      const double *restrict far;
      const double *restrict fai;
      double sar, sai;
      int jmm, jfc, lat;

Uwe Schulzweida's avatar
Uwe Schulzweida committed
530
531
532
533
534
535
536
537
      for ( jmm = 0; jmm <= nt; jmm++ )
	{
	  for ( jfc = jmm; jfc <= nt; jfc++ )
	    {
	      far = fal;
	      fai = fal + nlat;
	      sar = 0.0;
	      sai = 0.0;
538
539
540
#if defined(HAVE_OPENMP4)
#pragma omp simd reduction(+:sar) reduction(+:sai)
#endif
Uwe Schulzweida's avatar
Uwe Schulzweida committed
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
	      for ( lat = 0; lat < nlat; lat++ )
		{
		  sar += pol[lat] * far[lat];
		  sai += pol[lat] * fai[lat];
		}
	      *sal++ = sar;
	      *sal++ = sai;
	      pol += nlat;
	    }
	  fal += 2 * nlat;
	}
    }
}

/* ======================================== */
/* Convert Spectral Array to new truncation */
/* ======================================== */

void sp2sp(double *arrayIn, int truncIn, double *arrayOut, int truncOut)
{
  int n, m;

  if ( truncOut <= truncIn )
    {
      for ( n = 0; n <= truncOut; n++ )
	{
	  for ( m = n; m <= truncOut; m++ )
	    {
	      *arrayOut++ = *arrayIn++ ;
	      *arrayOut++ = *arrayIn++ ;
	    }
	  arrayIn += 2 * (truncIn-truncOut);
	}
    }
  else
    {
      for ( n = 0; n <= truncIn; n++ )
	{
	  for ( m = n; m <= truncIn; m++ )
	    {
	      *arrayOut++ = *arrayIn++ ;
	      *arrayOut++ = *arrayIn++ ;
	    }
	  for ( m = truncIn+1; m <= truncOut; ++m )
	    {
	      *arrayOut++ = 0.0;
	      *arrayOut++ = 0.0;
	    }
	}
      for ( n = truncIn+1; n <= truncOut; ++n )
	for ( m = n; m <= truncOut; ++m )
	  {
	    *arrayOut++ = 0.0;
	    *arrayOut++ = 0.0;
	  }
    }
}

/* ======================================== */
/* Cut spectral wave numbers                */
/* ======================================== */

Uwe Schulzweida's avatar
Uwe Schulzweida committed
603
void spcut(double *arrayIn, double *arrayOut, int trunc, int *waves)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
604
605
606
607
608
609
610
{
  int n, m;

  for ( n = 0; n <= trunc; n++ )
    {
      for ( m = n; m <= trunc; m++ )
	{
611
	  if ( waves[m] )
Uwe Schulzweida's avatar
Uwe Schulzweida committed
612
613
614
615
616
617
618
619
	    {
	      *arrayOut++ = *arrayIn++;
	      *arrayOut++ = *arrayIn++;
	    }
	  else
	    {
	      *arrayOut++ = 0.0;
	      *arrayOut++ = 0.0;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
620
621
	      arrayIn++;
	      arrayIn++;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
622
623
624
625
	    }
	}
    }
}