Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
82
83
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
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
!-----------------------------------------------------------------
!--------------- special set of characters for RCS information
!-----------------------------------------------------------------
! $Source$ $Revision$
! MASDEV4_7 diag 2006/05/18 13:07:25
!-----------------------------------------------------------------
! ###############################
MODULE MODI_COMPUTE_R00
! ###############################
!
INTERFACE
SUBROUTINE COMPUTE_R00(HFMFILE)
!
CHARACTER (LEN=28), INTENT(IN) :: HFMFILE ! name of the OUTPUT FM-file
!
END SUBROUTINE COMPUTE_R00
END INTERFACE
END MODULE MODI_COMPUTE_R00
!
! ###############################
SUBROUTINE COMPUTE_R00(HFMFILE)
! ###############################
!
!!****
!!
!! PURPOSE
!! -------
!
!!** METHOD
!! ------
!!
!! EXTERNAL
!! --------
!!
!! IMPLICIT ARGUMENTS
!! ------------------
!! MODD_STO_FILE : CFILES
!! MODD_GRID1 : XZZ, XXHAT,XYHAT
!! MODD_LUNIT1: CINIFILE, CLUOUT
!! MODD_FIELD1: XSVM
!! MODD_CONF : NVERB
!! MODD_PARAMETERS : NUNDEF
!!
!! REFERENCE
!! ---------
!!
!! AUTHOR
!! ------
!! F. Gheusi and J. Stein * Meteo France *
!!
!! MODIFICATIONS
!! -------------
!! J. Stein Jan. 2001 add supplementary starts and spare some memory
!! October 2009 (G. Tanguy) add ILENCH=LEN(YCOMMENT) after
!! change of YCOMMENT
!-------------------------------------------------------------------------------
!
!* 0. DECLARATIONS
! ------------
!
USE MODD_FIELD_n
USE MODD_GRID_n
USE MODD_LUNIT_n
USE MODD_GRID_n
USE MODD_STO_FILE
USE MODD_CONF
USE MODD_PARAMETERS
USE MODD_NSV, ONLY : NSV_LGBEG,NSV_LGEND
!
USE MODI_SHUMAN
!
USE MODD_VAR_ll
!
USE MODE_FM
USE MODE_FMWRIT
USE MODE_FMREAD
USE MODE_IO_ll
USE MODE_ll
USE MODD_TYPE_DATE
!
IMPLICIT NONE
!
!* 0.1 declarations of arguments
!
CHARACTER (LEN=28), INTENT(IN) :: HFMFILE ! name of the OUTPUT FM-file
!
!* 0.2 declarations of local variables
!
INTEGER :: IRESP ! return code in FM routines
INTEGER :: INPRAR ! number of articles predicted in
! the LFIFM file
INTEGER :: ININAR ! number of articles present in
! the LFIFM file
INTEGER :: ITYPE ! type of file (conv2dia and transfer)
!
CHARACTER (LEN=100) :: YCOMMENT
CHARACTER (LEN=16) :: YRECFM
INTEGER :: IFILECUR,JFILECUR,NIU,NJU,NKU,IGRID,ILENCH
INTEGER :: NFILES,JLOOP
REAL :: ZXOR,ZYOR,ZDX,ZDY
REAL :: ZSPVAL
REAL, ALLOCATABLE, DIMENSION(:,:,:):: ZX0, ZY0, ZZ0 ! origin of the
! particules colocated with the mesh-grid points read in the file
REAL, ALLOCATABLE, DIMENSION(:,:,:):: ZX00, ZY00, ZZ00, ZZL ! cumulative
! origin for more than one restart of the tracers
REAL, ALLOCATABLE, DIMENSION(:,:,:):: ZTH0 ! same fields
! for Theta as for the coordinates of the origin
REAL, ALLOCATABLE, DIMENSION(:,:,:):: ZRV0 ! same fields
! for Rv as for the coordinates of the origin
REAL, ALLOCATABLE, DIMENSION(:,:,:):: ZWORK1,ZWORK2,ZWORK3
TYPE(DATE_TIME) :: TDTCUR_START
CHARACTER(LEN=24) :: YDATE
INTEGER :: IHOUR, IMINUTE
REAL :: ZSECOND, ZREMAIN
LOGICAL :: GSTART
INTEGER :: INBR_START
REAL :: ZXMAX,ZYMAX,ZZMAX ! domain extrema
INTEGER, DIMENSION(100) :: NBRFILES
INTEGER :: IKU
!
!-------------------------------------------------------------------------------
!
!* 1.0 INITIALIZATION
! --------------
!
ITYPE=2
ZSPVAL=-1.E+11
IKU=SIZE(XZHAT)
!
!-------------------------------------------------------------------------------
!
!* 2.0 FIND THE FILE TO BE TREATED AND THE INIT-SV FILES
! -------------------------------------------------
!
! Search the number of the file to be treated
IFILECUR=0
DO JFILECUR=1,100
IF (CINIFILE==CFILES(JFILECUR)) THEN
IFILECUR=JFILECUR
EXIT
END IF
END DO
!
IF (IFILECUR==0) THEN
PRINT*,'PROBLEM WITH THE FOLLOWING FILE: ',CINIFILE
PRINT*,CFILES
!callabortstop
CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP)
CALL ABORT
STOP
ENDIF
!
! Search the number of the files(NFILES), where the Lagrangian tracers
!have been reinitialized
NFILES=0
DO JFILECUR=IFILECUR+1,100
IF (LEN_TRIM(CFILES(JFILECUR)) /= 0 .AND. &
CFILES_STA(JFILECUR) == 'INIT_SV') THEN
NFILES= NFILES +1
NBRFILES(NFILES)=JFILECUR ! contains the number of the files where
! the Lag. tracers have been restarted
ENDIF
END DO
!
! compute the number of supplementary cumulative starts
INBR_START=1
DO JLOOP=1,NFILES-1
IF (NSTART_SUPP(JLOOP)/=NUNDEF .AND. NSTART_SUPP(JLOOP)> IFILECUR ) THEN
INBR_START=INBR_START+1
END IF
END DO
!
!-------------------------------------------------------------------------------
!
!* 3.0 ALLOCATIONS OF THE ARRAYS AND CONVERSIONS
! -----------------------------------------
!
!
NIU=SIZE(XZZ,1)
NJU=SIZE(XZZ,2)
NKU=SIZE(XZZ,3)
!
ALLOCATE(ZX0(NIU,NJU,NKU))
ALLOCATE(ZY0(NIU,NJU,NKU))
ALLOCATE(ZZ0(NIU,NJU,NKU))
ALLOCATE(ZWORK1(NIU,NJU,NKU))
ALLOCATE(ZWORK2(NIU,NJU,NKU))
ALLOCATE(ZWORK3(NIU,NJU,NKU))
ALLOCATE(ZX00(NIU,NJU,NKU))
ALLOCATE(ZY00(NIU,NJU,NKU))
ALLOCATE(ZZ00(NIU,NJU,NKU))
ALLOCATE(ZZL(NIU,NJU,NKU))
ALLOCATE(ZTH0(NIU,NJU,NKU))
ALLOCATE(ZRV0(NIU,NJU,NKU))
! initial values
ZXOR=0.5 * (XXHAT(2)+XXHAT(3))
ZYOR=0.5 * (XYHAT(2)+XYHAT(3))
ZDX= XXHAT(3)-XXHAT(2)
ZDY= XYHAT(3)-XYHAT(2)
ZZL=MZF(1,IKU,1,XZZ)
ZZL(:,:,NKU)=2*XZZ(:,:,NKU)-ZZL(:,:,NKU-1)
ZXMAX=ZXOR+(NIU-3)*ZDX
ZYMAX=ZYOR+(NJU-3)*ZDY
ZZMAX=ZZL(2,2,NKU-1)
! conversion from km to meters
ZXOR=ZXOR*1.E-3
ZYOR=ZYOR*1.E-3
ZDX=ZDX*1.E-3
ZDY=ZDY*1.E-3
ZZL(:,:,:)=ZZL(:,:,:)*1.E-3
ZXMAX=ZXMAX*1.E-3
ZYMAX=ZYMAX*1.E-3
ZZMAX=ZZMAX*1.E-3
!
ZX00(:,:,:)=XSVT(:,:,:,NSV_LGBEG)*1.E-3 ! ZX0 in km
ZY00(:,:,:)=XSVT(:,:,:,NSV_LGBEG+1)*1.E-3 ! ZY0 in km
ZZ00(:,:,:)=XSVT(:,:,:,NSV_LGEND)*1.E-3 ! ZZ0 in km
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
!
IF (L2D) THEN
WHERE ( ZX00<ZXOR .OR. ZX00>ZXMAX .OR. &
ZZ00>ZZMAX)
ZX00=ZSPVAL
ZZ00=ZSPVAL
END WHERE
ELSE
WHERE ( ZX00<ZXOR .OR. ZX00>ZXMAX .OR. &
ZY00<ZYOR .OR. ZY00>ZYMAX .OR. &
ZZ00>ZZMAX)
ZX00=ZSPVAL
ZY00=ZSPVAL
ZZ00=ZSPVAL
END WHERE
END IF
!
!-------------------------------------------------------------------------------
!
!* 4.0 COMPUTE THE ORIGIN STEP BY STEP
! -------------------------------
!
!
! General loop for the files where a reinitialisation of the tracers
! is performed
DO JFILECUR=1,NFILES
!
CALL FMOPEN_ll(CFILES(NBRFILES(JFILECUR)),'READ',CLUOUT, &
INPRAR,ITYPE,NVERB,ININAR,IRESP)
!
!* 4.1 check if this file is a start instant
!
GSTART=.FALSE.
DO JLOOP=1,NFILES
IF (NBRFILES(JFILECUR)==NSTART_SUPP(JLOOP) .OR. JFILECUR==NFILES) THEN
INBR_START=INBR_START-1
GSTART=.TRUE.
EXIT
END IF
ENDDO
!
!* 4.2 read the potential temp or the water vapor at the start instant
!
IF (GSTART) THEN
!
YRECFM='DTCUR'
CALL FMREAD(CFILES(NBRFILES(JFILECUR)),YRECFM,CLUOUT,'--',TDTCUR_START, &
IGRID,ILENCH,YCOMMENT,IRESP)
IHOUR = INT(TDTCUR_START%TIME/3600.)
ZREMAIN = MOD(TDTCUR_START%TIME,3600.)
IMINUTE = INT(ZREMAIN/60.)
ZSECOND = MOD(ZREMAIN,60.)
WRITE(YDATE,FMT='(1X,I4.4,I2.2,I2.2,2X,I2.2,"H",I2.2,"M", &
& F5.2,"S")') TDTCUR_START%TDATE, IHOUR,IMINUTE,ZSECOND
!
CALL FMREAD(CFILES(NBRFILES(JFILECUR)),YRECFM,CLUOUT,'XY', &
ZTH0(:,:,:),IGRID,ILENCH,YCOMMENT,IRESP)
!
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
CALL FMREAD(CFILES(NBRFILES(JFILECUR)),YRECFM,CLUOUT,'XY', &
ZRV0(:,:,:),IGRID,ILENCH,YCOMMENT,IRESP)
!
ZRV0(:,:,:)=ZRV0(:,:,:)*1.E+3 ! ZRV0 in g/kg
!
END IF
!
!* 4.3 store the X0,Y0,Z0 field for the current start before
! computing the new origin
!
IF (GSTART) THEN
IGRID=1
PRINT *,'INBR_START',INBR_START,' NBRFILES(JFILECUR)',NBRFILES(JFILECUR)
WRITE(YRECFM,'(A2,I2.2)')'X0',INBR_START
WRITE(YCOMMENT,'(A8,I2.2)')'X_Y_Z_X0',INBR_START
YCOMMENT=YCOMMENT(1:10)//YDATE//' (KM)'
PRINT *,'YCOMMENT = ',YCOMMENT
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,CLUOUT,'XY',ZX00(:,:,:),IGRID,ILENCH, &
YCOMMENT,IRESP)
!
WRITE(YRECFM,'(A2,I2.2)')'Y0',INBR_START
WRITE(YCOMMENT,'(A8,I2.2)')'X_Y_Z_Y0',INBR_START
YCOMMENT=YCOMMENT(1:10)//YDATE//' (KM)'
PRINT *,'YCOMMENT = ',YCOMMENT
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,CLUOUT,'XY',ZY00(:,:,:),IGRID,ILENCH, &
YCOMMENT,IRESP)
!
WRITE(YRECFM,'(A2,I2.2)')'Z0',INBR_START
WRITE(YCOMMENT,'(A8,I2.2)')'X_Y_Z_Z0',INBR_START
YCOMMENT=YCOMMENT(1:10)//YDATE//' (KM)'
PRINT *,'YCOMMENT = ',YCOMMENT
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,CLUOUT,'XY',ZZ00(:,:,:),IGRID,ILENCH, &
YCOMMENT,IRESP)
END IF
!
!
!* 4.6 compute and store potential temp and water vapor at the origin
!
IF (GSTART) THEN
!
CALL INTERPXYZ(ZX00,ZY00,ZZ00, &
ZTH0,ZWORK1 )
!
CALL INTERPXYZ(ZX00,ZY00,ZZ00, &
ZRV0,ZWORK2 )
!
END IF
!
IF (GSTART) THEN
!
WRITE(YRECFM,'(A3,I2.2)')'TH0',INBR_START
WRITE(YCOMMENT,'(A9,I2.2)')'X_Y_Z_TH0',INBR_START
YCOMMENT=YCOMMENT(1:11)//YDATE//' (K)'
PRINT *,'YCOMMENT = ',YCOMMENT
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,CLUOUT,'XY', &
ZWORK1(:,:,:),IGRID,ILENCH, &
YCOMMENT,IRESP)
!
WRITE(YRECFM,'(A3,I2.2)')'RV0',INBR_START
WRITE(YCOMMENT,'(A9,I2.2)')'X_Y_Z_RV0',INBR_START
YCOMMENT=YCOMMENT(1:11)//YDATE//' (G/KG)'
PRINT *,'YCOMMENT = ',YCOMMENT
ILENCH=LEN(YCOMMENT)
CALL FMWRIT(HFMFILE,YRECFM,CLUOUT,'XY', &
ZWORK2(:,:,:),IGRID,ILENCH, &
YCOMMENT,IRESP)
ENDIF
!* 4.4 compute the origin of the particules using one more segment
!
IF (JFILECUR /= NFILES) THEN
YRECFM='LGXM'
CALL FMREAD(CFILES(NBRFILES(JFILECUR)),YRECFM,CLUOUT,'XY', &
ZX0(:,:,:),IGRID,ILENCH,YCOMMENT,IRESP)
ZX0(:,:,:)=ZX0(:,:,:)*1.E-3 ! ZX0 in km
!
YRECFM='LGYM'
CALL FMREAD(CFILES(NBRFILES(JFILECUR)),YRECFM,CLUOUT,'XY', &
ZY0(:,:,:),IGRID,ILENCH,YCOMMENT,IRESP)
ZY0(:,:,:)=ZY0(:,:,:)*1.E-3 ! ZY0 in km
!
YRECFM='LGZM'
CALL FMREAD(CFILES(NBRFILES(JFILECUR)),YRECFM,CLUOUT,'XY', &
ZZ0(:,:,:),IGRID,ILENCH,YCOMMENT,IRESP)
ZZ0(:,:,:)=ZZ0(:,:,:)*1.E-3 ! ZZ0 in km
!
! old position of the set of particles
ZWORK1=ZX00
ZWORK2=ZY00
ZWORK3=ZZ00
!
IF (L2D) THEN
CALL INTERPXYZ(ZWORK1,ZWORK2,ZWORK3, &
ZX0,ZX00,ZZ0,ZZ00 )
ELSE
CALL INTERPXYZ(ZWORK1,ZWORK2,ZWORK3, &
ZX0,ZX00,ZY0,ZY00,ZZ0,ZZ00 )
END IF
!
IF (L2D) THEN
WHERE ( ZX00<ZXOR .OR. ZX00>ZXMAX .OR. &
ZZ00>ZZMAX)
ZX00=ZSPVAL
ZZ00=ZSPVAL
END WHERE
ELSE
WHERE ( ZX00<ZXOR .OR. ZX00>ZXMAX .OR. &
ZY00<ZYOR .OR. ZY00>ZYMAX .OR. &
ZZ00>ZZMAX)
ZX00=ZSPVAL
ZY00=ZSPVAL
ZZ00=ZSPVAL
END WHERE
END IF
!
END IF
!
!* 4.5 close the input file
!
CALL FMCLOS_ll(CFILES(NBRFILES(JFILECUR)),'KEEP',CLUOUT,IRESP)
!
END DO
!
PRINT*, ' '
PRINT*, 'DIAG AFTER ORIGIN COMPUTATIONS AND STORAGE'
!
!-------------------------------------------------------------------------------
!
!
CONTAINS
!
!
!-------------------------------------------------------------------------------
!
!
SUBROUTINE INTERPXYZ(PX,PY,PZ,PIN1,POUT1,PIN2,POUT2,PIN3,POUT3)
!
!
!* 0. DECLARATIONS
! ------------
!
!* 0.1 declaration of arguments
!
REAL, INTENT(IN), DIMENSION(:,:,:) :: PX,PY,PZ
REAL, INTENT(IN), DIMENSION(:,:,:) :: PIN1
REAL, INTENT(OUT), DIMENSION(:,:,:) :: POUT1
REAL, INTENT(IN), DIMENSION(:,:,:), OPTIONAL :: PIN2,PIN3
REAL, INTENT(OUT), DIMENSION(:,:,:), OPTIONAL :: POUT2,POUT3
!
!* 0.2 declaration of local variables
!
INTEGER :: JI,JJ,JK,JKK ! loop index
INTEGER :: II,IJ,IK ! grid index for the interpolation
REAL :: ZXREL,ZYREL ! fractional grid index for the interpolation
REAL, DIMENSION(SIZE(PIN1,3)) :: ZZLXY ! vertical grid at the interpolated point
REAL :: ZEPS1,ZEPS2,ZEPS3 ! coeff. for the interpolation
REAL :: ZX,ZY,ZZ
LOGICAL :: GEXT
!
!-------------------------------------------------------------------------------
!
DO JK=1,NKU
DO JJ=1,NJU
DO JI=1,NIU
!
ZX=PX(JI,JJ,JK)
ZY=PY(JI,JJ,JK)
ZZ=PZ(JI,JJ,JK)
!
! remove external points
IF (L2D) THEN
GEXT=(ZX==ZSPVAL).OR.(ZZ==ZSPVAL)
ELSE
GEXT=(ZX==ZSPVAL).OR.(ZY==ZSPVAL).OR.(ZZ==ZSPVAL)
END IF
IF (GEXT) THEN
POUT1(JI,JJ,JK) = ZSPVAL
IF (PRESENT(PIN2)) THEN
POUT2(JI,JJ,JK) = ZSPVAL
END IF
IF (PRESENT(PIN3)) THEN
POUT3(JI,JJ,JK) = ZSPVAL
ENDIF
!
CYCLE
!
END IF
!
ZXREL=(ZX-ZXOR)/ZDX+2
ZYREL=(ZY-ZYOR)/ZDY+2
!
II=FLOOR(ZXREL)
IJ=FLOOR(ZYREL)
!
ZEPS1=ZXREL-REAL(II)
ZEPS2=ZYREL-REAL(IJ)
IF (L2D) ZEPS2=0.
!
DO JKK=1,NKU
ZZLXY(JKK)=ZEPS2*(ZEPS1*(ZZL(II+1,IJ+1,JKK))+(1-ZEPS1)*(ZZL(II,IJ+1,JKK))) &
+ (1-ZEPS2)*(ZEPS1*(ZZL(II+1,IJ,JKK))+(1-ZEPS1)*(ZZL(II,IJ,JKK)))
ENDDO
!
IK=999
DO JKK=2,NKU
IF (ZZLXY(JKK).GE.ZZ) THEN
IK=JKK-1
EXIT
ENDIF
ENDDO
!
IF (IK==999) THEN
PRINT*,'PROBLEM AT POINT',II,IJ
PRINT*,'XREL, YREL, Z =',ZXREL,ZYREL,ZZ
PRINT*,'ZZLXY(NKU)',ZZLXY(NKU)
!callabortstop
CALL CLOSE_ll(CLUOUT,IOSTAT=IRESP)
CALL ABORT
STOP
END IF
!
ZEPS3=(ZZ-ZZLXY(IK))/(ZZLXY(IK+1)-ZZLXY(IK))
!
POUT1(JI,JJ,JK) = &
ZEPS3 * &
( ZEPS2*(ZEPS1*(PIN1(II+1,IJ+1,IK+1))+(1-ZEPS1)*(PIN1(II,IJ+1,IK+1))) &
+ (1-ZEPS2)*(ZEPS1*(PIN1(II+1,IJ,IK+1))+(1-ZEPS1)*(PIN1(II,IJ,IK+1))) &
) &
+ (1-ZEPS3) * &
( ZEPS2*(ZEPS1*(PIN1(II+1,IJ+1,IK))+(1-ZEPS1)*(PIN1(II,IJ+1,IK))) &
+ (1-ZEPS2)*(ZEPS1*(PIN1(II+1,IJ,IK))+(1-ZEPS1)*(PIN1(II,IJ,IK))) &
)
IF (PRESENT(POUT2)) THEN
POUT2(JI,JJ,JK) = &
ZEPS3 * &
( ZEPS2*(ZEPS1*(PIN2(II+1,IJ+1,IK+1))+(1-ZEPS1)*(PIN2(II,IJ+1,IK+1)))&
+ (1-ZEPS2)*(ZEPS1*(PIN2(II+1,IJ,IK+1))+(1-ZEPS1)*(PIN2(II,IJ,IK+1)))&
) &
+ (1-ZEPS3) * &
( ZEPS2*(ZEPS1*(PIN2(II+1,IJ+1,IK))+(1-ZEPS1)*(PIN2(II,IJ+1,IK))) &
+ (1-ZEPS2)*(ZEPS1*(PIN2(II+1,IJ,IK))+(1-ZEPS1)*(PIN2(II,IJ,IK))) &
)
ENDIF
!
IF (PRESENT(POUT3)) THEN
POUT3(JI,JJ,JK) = &
ZEPS3 * &
( ZEPS2*(ZEPS1*(PIN3(II+1,IJ+1,IK+1))+(1-ZEPS1)*(PIN3(II,IJ+1,IK+1)))&
+ (1-ZEPS2)*(ZEPS1*(PIN3(II+1,IJ,IK+1))+(1-ZEPS1)*(PIN3(II,IJ,IK+1)))&
) &
+ (1-ZEPS3) * &
( ZEPS2*(ZEPS1*(PIN3(II+1,IJ+1,IK))+(1-ZEPS1)*(PIN3(II,IJ+1,IK))) &
+ (1-ZEPS2)*(ZEPS1*(PIN3(II+1,IJ,IK))+(1-ZEPS1)*(PIN3(II,IJ,IK))) &
)
ENDIF
!
END DO
END DO
END DO
!
!-------------------------------------------------------------------------------
!
!
END SUBROUTINE INTERPXYZ
!
!-------------------------------------------------------------------------------
!
END SUBROUTINE COMPUTE_R00