1 | MODULE agrif_opa_interp |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE agrif_opa_interp *** |
---|
4 | !! AGRIF: interpolation package |
---|
5 | !!====================================================================== |
---|
6 | !! History : 2.0 ! 2002-06 (XXX) Original cade |
---|
7 | !! - ! 2005-11 (XXX) |
---|
8 | !! 3.2 ! 2009-04 (R. Benshila) |
---|
9 | !! 3.6 ! 2014-09 (R. Benshila) |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | #if defined key_agrif |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! 'key_agrif' AGRIF zoom |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | !! Agrif_tra : |
---|
16 | !! Agrif_dyn : |
---|
17 | !! interpu : |
---|
18 | !! interpv : |
---|
19 | !!---------------------------------------------------------------------- |
---|
20 | USE par_oce |
---|
21 | USE oce |
---|
22 | USE dom_oce |
---|
23 | USE zdf_oce |
---|
24 | USE agrif_oce |
---|
25 | USE phycst |
---|
26 | ! |
---|
27 | USE in_out_manager |
---|
28 | USE agrif_opa_sponge |
---|
29 | USE lib_mpp |
---|
30 | USE wrk_nemo |
---|
31 | |
---|
32 | IMPLICIT NONE |
---|
33 | PRIVATE |
---|
34 | |
---|
35 | PUBLIC Agrif_tra, Agrif_dyn, Agrif_ssh, Agrif_dyn_ts, Agrif_ssh_ts, Agrif_dta_ts |
---|
36 | PUBLIC interpun, interpvn |
---|
37 | PUBLIC interptsn, interpsshn |
---|
38 | PUBLIC interpunb, interpvnb, interpub2b, interpvb2b |
---|
39 | PUBLIC interpe3t, interpumsk, interpvmsk |
---|
40 | # if defined key_zdftke |
---|
41 | PUBLIC Agrif_tke, interpavm |
---|
42 | # endif |
---|
43 | |
---|
44 | INTEGER :: bdy_tinterp = 0 |
---|
45 | |
---|
46 | # include "vectopt_loop_substitute.h90" |
---|
47 | !!---------------------------------------------------------------------- |
---|
48 | !! NEMO/NST 3.7 , NEMO Consortium (2015) |
---|
49 | !! $Id$ |
---|
50 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
51 | !!---------------------------------------------------------------------- |
---|
52 | CONTAINS |
---|
53 | |
---|
54 | SUBROUTINE Agrif_tra |
---|
55 | !!---------------------------------------------------------------------- |
---|
56 | !! *** ROUTINE Agrif_tra *** |
---|
57 | !!---------------------------------------------------------------------- |
---|
58 | ! |
---|
59 | IF( Agrif_Root() ) RETURN |
---|
60 | ! |
---|
61 | Agrif_SpecialValue = 0._wp |
---|
62 | Agrif_UseSpecialValue = .TRUE. |
---|
63 | ! |
---|
64 | CALL Agrif_Bc_variable( tsn_id, procname=interptsn ) |
---|
65 | ! |
---|
66 | Agrif_UseSpecialValue = .FALSE. |
---|
67 | ! |
---|
68 | END SUBROUTINE Agrif_tra |
---|
69 | |
---|
70 | |
---|
71 | SUBROUTINE Agrif_dyn( kt ) |
---|
72 | !!---------------------------------------------------------------------- |
---|
73 | !! *** ROUTINE Agrif_DYN *** |
---|
74 | !!---------------------------------------------------------------------- |
---|
75 | INTEGER, INTENT(in) :: kt |
---|
76 | ! |
---|
77 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
78 | INTEGER :: j1, j2, i1, i2 |
---|
79 | REAL(wp), POINTER, DIMENSION(:,:) :: zub, zvb |
---|
80 | !!---------------------------------------------------------------------- |
---|
81 | ! |
---|
82 | IF( Agrif_Root() ) RETURN |
---|
83 | ! |
---|
84 | CALL wrk_alloc( jpi,jpj, zub, zvb ) |
---|
85 | ! |
---|
86 | Agrif_SpecialValue = 0._wp |
---|
87 | Agrif_UseSpecialValue = ln_spc_dyn |
---|
88 | ! |
---|
89 | CALL Agrif_Bc_variable( un_interp_id, procname=interpun ) |
---|
90 | CALL Agrif_Bc_variable( vn_interp_id, procname=interpvn ) |
---|
91 | ! |
---|
92 | Agrif_UseSpecialValue = .FALSE. |
---|
93 | ! |
---|
94 | ! prevent smoothing in ghost cells |
---|
95 | i1 = 1 ; i2 = jpi |
---|
96 | j1 = 1 ; j2 = jpj |
---|
97 | IF( nbondj == -1 .OR. nbondj == 2 ) j1 = 3 |
---|
98 | IF( nbondj == +1 .OR. nbondj == 2 ) j2 = nlcj-2 |
---|
99 | IF( nbondi == -1 .OR. nbondi == 2 ) i1 = 3 |
---|
100 | IF( nbondi == +1 .OR. nbondi == 2 ) i2 = nlci-2 |
---|
101 | |
---|
102 | ! --- West --- ! |
---|
103 | IF( nbondi == -1 .OR. nbondi == 2 ) THEN |
---|
104 | ! |
---|
105 | IF( .NOT.ln_dynspg_ts ) THEN ! Store transport |
---|
106 | ua_b(1:1+nbghostcells,:) = 0._wp |
---|
107 | DO jk = 1, jpkm1 |
---|
108 | DO jj = 1, jpj |
---|
109 | ua_b(1:1+nbghostcells,jj) = ua_b(1:1+nbghostcells,jj) + e3u_a(1:1+nbghostcells,jj,jk) * ua(1:1+nbghostcells,jj,jk) |
---|
110 | END DO |
---|
111 | END DO |
---|
112 | DO jj = 1, jpj |
---|
113 | ua_b(1:1+nbghostcells,jj) = ua_b(1:1+nbghostcells,jj) * r1_hu_a(1:1+nbghostcells,jj) |
---|
114 | END DO |
---|
115 | ENDIF |
---|
116 | ! |
---|
117 | ! Smoothing if only 1 ghostcell |
---|
118 | ! ----------------------------- |
---|
119 | IF( nbghostcells == 1 ) THEN |
---|
120 | DO jk=1,jpkm1 ! Smooth |
---|
121 | DO jj=j1,j2 |
---|
122 | ua(2,jj,jk) = 0.25_wp*(ua(1,jj,jk)+2._wp*ua(2,jj,jk)+ua(3,jj,jk)) |
---|
123 | ua(2,jj,jk) = ua(2,jj,jk) * umask(2,jj,jk) |
---|
124 | END DO |
---|
125 | END DO |
---|
126 | ! |
---|
127 | zub(2,:) = 0._wp ! Correct transport |
---|
128 | DO jk = 1, jpkm1 |
---|
129 | DO jj = 1, jpj |
---|
130 | zub(2,jj) = zub(2,jj) + e3u_a(2,jj,jk) * ua(2,jj,jk) |
---|
131 | END DO |
---|
132 | END DO |
---|
133 | DO jj=1,jpj |
---|
134 | zub(2,jj) = zub(2,jj) * r1_hu_a(2,jj) |
---|
135 | END DO |
---|
136 | |
---|
137 | DO jk=1,jpkm1 |
---|
138 | DO jj=1,jpj |
---|
139 | ua(2,jj,jk) = (ua(2,jj,jk)+ua_b(2,jj)-zub(2,jj))*umask(2,jj,jk) |
---|
140 | END DO |
---|
141 | END DO |
---|
142 | |
---|
143 | IF( ln_dynspg_ts ) THEN ! Set tangential velocities to time splitting estimate |
---|
144 | zvb(2,:) = 0._wp |
---|
145 | DO jk = 1, jpkm1 |
---|
146 | DO jj = 1, jpj |
---|
147 | zvb(2,jj) = zvb(2,jj) + e3v_a(2,jj,jk) * va(2,jj,jk) |
---|
148 | END DO |
---|
149 | END DO |
---|
150 | DO jj = 1, jpj |
---|
151 | zvb(2,jj) = zvb(2,jj) * r1_hv_a(2,jj) |
---|
152 | END DO |
---|
153 | DO jk = 1, jpkm1 |
---|
154 | DO jj = 1, jpj |
---|
155 | va(2,jj,jk) = (va(2,jj,jk)+va_b(2,jj)-zvb(2,jj)) * vmask(2,jj,jk) |
---|
156 | END DO |
---|
157 | END DO |
---|
158 | ENDIF |
---|
159 | ! |
---|
160 | ENDIF |
---|
161 | ! |
---|
162 | ENDIF |
---|
163 | |
---|
164 | ! --- East --- ! |
---|
165 | IF( nbondi == 1 .OR. nbondi == 2 ) THEN |
---|
166 | |
---|
167 | IF( .NOT.ln_dynspg_ts ) THEN ! Store transport |
---|
168 | ua_b(nlci-nbghostcells-1:nlci,:) = 0._wp |
---|
169 | DO jk=1,jpkm1 |
---|
170 | DO jj=1,jpj |
---|
171 | ua_b(nlci-nbghostcells-1:nlci,jj) = ua_b(nlci-nbghostcells-1:nlci,jj) + e3u_a(nlci-nbghostcells-1:nlci,jj,jk) & |
---|
172 | & * ua(nlci-nbghostcells-1:nlci,jj,jk) |
---|
173 | END DO |
---|
174 | END DO |
---|
175 | DO jj=1,jpj |
---|
176 | ua_b(nlci-nbghostcells-1:nlci,jj) = ua_b(nlci-nbghostcells-1:nlci,jj) * r1_hu_a(nlci-nbghostcells-1:nlci,jj) |
---|
177 | END DO |
---|
178 | ENDIF |
---|
179 | ! |
---|
180 | ! Smoothing if only 1 ghostcell |
---|
181 | ! ----------------------------- |
---|
182 | IF( nbghostcells == 1 ) THEN |
---|
183 | DO jk = 1, jpkm1 ! Smooth |
---|
184 | DO jj = j1, j2 |
---|
185 | ua(nlci-2,jj,jk) = 0.25_wp * umask(nlci-2,jj,jk) & |
---|
186 | & * ( ua(nlci-3,jj,jk) + 2._wp*ua(nlci-2,jj,jk) + ua(nlci-1,jj,jk) ) |
---|
187 | END DO |
---|
188 | END DO |
---|
189 | |
---|
190 | zub(nlci-2,:) = 0._wp ! Correct transport |
---|
191 | DO jk = 1, jpkm1 |
---|
192 | DO jj = 1, jpj |
---|
193 | zub(nlci-2,jj) = zub(nlci-2,jj) + e3u_a(nlci-2,jj,jk) * ua(nlci-2,jj,jk) |
---|
194 | END DO |
---|
195 | END DO |
---|
196 | DO jj = 1, jpj |
---|
197 | zub(nlci-2,jj) = zub(nlci-2,jj) * r1_hu_a(nlci-2,jj) |
---|
198 | END DO |
---|
199 | |
---|
200 | DO jk = 1, jpkm1 |
---|
201 | DO jj = 1, jpj |
---|
202 | ua(nlci-2,jj,jk) = ( ua(nlci-2,jj,jk) + ua_b(nlci-2,jj) - zub(nlci-2,jj) ) * umask(nlci-2,jj,jk) |
---|
203 | END DO |
---|
204 | END DO |
---|
205 | ! |
---|
206 | IF( ln_dynspg_ts ) THEN ! Set tangential velocities to time splitting estimate |
---|
207 | zvb(nlci-1,:) = 0._wp |
---|
208 | DO jk = 1, jpkm1 |
---|
209 | DO jj = 1, jpj |
---|
210 | zvb(nlci-1,jj) = zvb(nlci-1,jj) + e3v_a(nlci-1,jj,jk) * va(nlci-1,jj,jk) |
---|
211 | END DO |
---|
212 | END DO |
---|
213 | DO jj=1,jpj |
---|
214 | zvb(nlci-1,jj) = zvb(nlci-1,jj) * r1_hv_a(nlci-1,jj) |
---|
215 | END DO |
---|
216 | DO jk = 1, jpkm1 |
---|
217 | DO jj = 1, jpj |
---|
218 | va(nlci-1,jj,jk) = ( va(nlci-1,jj,jk) + va_b(nlci-1,jj) - zvb(nlci-1,jj) ) * vmask(nlci-1,jj,jk) |
---|
219 | END DO |
---|
220 | END DO |
---|
221 | ENDIF |
---|
222 | ! |
---|
223 | ENDIF |
---|
224 | ! |
---|
225 | ENDIF |
---|
226 | |
---|
227 | ! --- South --- ! |
---|
228 | IF( nbondj == -1 .OR. nbondj == 2 ) THEN |
---|
229 | |
---|
230 | IF( .NOT.ln_dynspg_ts ) THEN ! Store transport |
---|
231 | va_b(:,1:nbghostcells+1) = 0._wp |
---|
232 | DO jk = 1, jpkm1 |
---|
233 | DO ji = 1, jpi |
---|
234 | va_b(ji,1:nbghostcells+1) = va_b(ji,1:nbghostcells+1) + e3v_a(ji,1:nbghostcells+1,jk) * va(ji,1:nbghostcells+1,jk) |
---|
235 | END DO |
---|
236 | END DO |
---|
237 | DO ji=1,jpi |
---|
238 | va_b(ji,1:nbghostcells+1) = va_b(ji,1:nbghostcells+1) * r1_hv_a(ji,1:nbghostcells+1) |
---|
239 | END DO |
---|
240 | ENDIF |
---|
241 | ! |
---|
242 | ! Smoothing if only 1 ghostcell |
---|
243 | ! ----------------------------- |
---|
244 | IF( nbghostcells == 1 ) THEN |
---|
245 | DO jk = 1, jpkm1 ! Smooth |
---|
246 | DO ji = i1, i2 |
---|
247 | va(ji,2,jk) = 0.25_wp * vmask(ji,2,jk) & |
---|
248 | & * ( va(ji,1,jk) + 2._wp*va(ji,2,jk) + va(ji,3,jk) ) |
---|
249 | END DO |
---|
250 | END DO |
---|
251 | ! |
---|
252 | zvb(:,2) = 0._wp ! Correct transport |
---|
253 | DO jk=1,jpkm1 |
---|
254 | DO ji=1,jpi |
---|
255 | zvb(ji,2) = zvb(ji,2) + e3v_a(ji,2,jk) * va(ji,2,jk) * vmask(ji,2,jk) |
---|
256 | END DO |
---|
257 | END DO |
---|
258 | DO ji = 1, jpi |
---|
259 | zvb(ji,2) = zvb(ji,2) * r1_hv_a(ji,2) |
---|
260 | END DO |
---|
261 | DO jk = 1, jpkm1 |
---|
262 | DO ji = 1, jpi |
---|
263 | va(ji,2,jk) = ( va(ji,2,jk) + va_b(ji,2) - zvb(ji,2) ) * vmask(ji,2,jk) |
---|
264 | END DO |
---|
265 | END DO |
---|
266 | |
---|
267 | IF( ln_dynspg_ts ) THEN ! Set tangential velocities to time splitting estimate |
---|
268 | zub(:,2) = 0._wp |
---|
269 | DO jk = 1, jpkm1 |
---|
270 | DO ji = 1, jpi |
---|
271 | zub(ji,2) = zub(ji,2) + e3u_a(ji,2,jk) * ua(ji,2,jk) * umask(ji,2,jk) |
---|
272 | END DO |
---|
273 | END DO |
---|
274 | DO ji = 1, jpi |
---|
275 | zub(ji,2) = zub(ji,2) * r1_hu_a(ji,2) |
---|
276 | END DO |
---|
277 | |
---|
278 | DO jk = 1, jpkm1 |
---|
279 | DO ji = 1, jpi |
---|
280 | ua(ji,2,jk) = ( ua(ji,2,jk) + ua_b(ji,2) - zub(ji,2) ) * umask(ji,2,jk) |
---|
281 | END DO |
---|
282 | END DO |
---|
283 | ENDIF |
---|
284 | ! |
---|
285 | ENDIF |
---|
286 | ! |
---|
287 | ENDIF |
---|
288 | |
---|
289 | ! --- North --- ! |
---|
290 | IF( nbondj == 1 .OR. nbondj == 2 ) THEN |
---|
291 | ! |
---|
292 | IF( .NOT.ln_dynspg_ts ) THEN ! Store transport |
---|
293 | va_b(:,nlcj-nbghostcells-1:nlcj) = 0._wp |
---|
294 | DO jk = 1, jpkm1 |
---|
295 | DO ji = 1, jpi |
---|
296 | va_b(ji,nlcj-nbghostcells-1:nlcj) = va_b(ji,nlcj-nbghostcells-1:nlcj) + e3v_a(ji,nlcj-nbghostcells-1:nlcj,jk) & |
---|
297 | & * va(ji,nlcj-nbghostcells-1:nlcj,jk) |
---|
298 | END DO |
---|
299 | END DO |
---|
300 | DO ji = 1, jpi |
---|
301 | va_b(ji,nlcj-nbghostcells-1:nlcj) = va_b(ji,nlcj-nbghostcells-1:nlcj) * r1_hv_a(ji,nlcj-nbghostcells-1:nlcj) |
---|
302 | END DO |
---|
303 | ENDIF |
---|
304 | ! |
---|
305 | ! Smoothing if only 1 ghostcell |
---|
306 | ! ----------------------------- |
---|
307 | IF( nbghostcells == 1 ) THEN |
---|
308 | DO jk = 1, jpkm1 ! Smooth |
---|
309 | DO ji = i1, i2 |
---|
310 | va(ji,nlcj-2,jk) = 0.25_wp * vmask(ji,nlcj-2,jk) & |
---|
311 | & * ( va(ji,nlcj-3,jk) + 2._wp * va(ji,nlcj-2,jk) + va(ji,nlcj-1,jk) ) |
---|
312 | END DO |
---|
313 | END DO |
---|
314 | ! |
---|
315 | zvb(:,nlcj-2) = 0._wp ! Correct transport |
---|
316 | DO jk = 1, jpkm1 |
---|
317 | DO ji = 1, jpi |
---|
318 | zvb(ji,nlcj-2) = zvb(ji,nlcj-2) + e3v_a(ji,nlcj-2,jk) * va(ji,nlcj-2,jk) * vmask(ji,nlcj-2,jk) |
---|
319 | END DO |
---|
320 | END DO |
---|
321 | DO ji = 1, jpi |
---|
322 | zvb(ji,nlcj-2) = zvb(ji,nlcj-2) * r1_hv_a(ji,nlcj-2) |
---|
323 | END DO |
---|
324 | DO jk = 1, jpkm1 |
---|
325 | DO ji = 1, jpi |
---|
326 | va(ji,nlcj-2,jk) = ( va(ji,nlcj-2,jk) + va_b(ji,nlcj-2) - zvb(ji,nlcj-2) ) * vmask(ji,nlcj-2,jk) |
---|
327 | END DO |
---|
328 | END DO |
---|
329 | ! |
---|
330 | IF( ln_dynspg_ts ) THEN ! Set tangential velocities to time splitting estimate |
---|
331 | zub(:,nlcj-1) = 0._wp |
---|
332 | DO jk = 1, jpkm1 |
---|
333 | DO ji = 1, jpi |
---|
334 | zub(ji,nlcj-1) = zub(ji,nlcj-1) + e3u_a(ji,nlcj-1,jk) * ua(ji,nlcj-1,jk) * umask(ji,nlcj-1,jk) |
---|
335 | END DO |
---|
336 | END DO |
---|
337 | DO ji = 1, jpi |
---|
338 | zub(ji,nlcj-1) = zub(ji,nlcj-1) * r1_hu_a(ji,nlcj-1) |
---|
339 | END DO |
---|
340 | ! |
---|
341 | DO jk = 1, jpkm1 |
---|
342 | DO ji = 1, jpi |
---|
343 | ua(ji,nlcj-1,jk) = ( ua(ji,nlcj-1,jk) + ua_b(ji,nlcj-1) - zub(ji,nlcj-1) ) * umask(ji,nlcj-1,jk) |
---|
344 | END DO |
---|
345 | END DO |
---|
346 | ENDIF |
---|
347 | ! |
---|
348 | ENDIF |
---|
349 | ! |
---|
350 | ENDIF |
---|
351 | ! |
---|
352 | CALL wrk_dealloc( jpi,jpj, zub, zvb ) |
---|
353 | ! |
---|
354 | END SUBROUTINE Agrif_dyn |
---|
355 | |
---|
356 | |
---|
357 | SUBROUTINE Agrif_dyn_ts( jn ) |
---|
358 | !!---------------------------------------------------------------------- |
---|
359 | !! *** ROUTINE Agrif_dyn_ts *** |
---|
360 | !!---------------------------------------------------------------------- |
---|
361 | !! |
---|
362 | INTEGER, INTENT(in) :: jn |
---|
363 | !! |
---|
364 | INTEGER :: ji, jj |
---|
365 | !!---------------------------------------------------------------------- |
---|
366 | ! |
---|
367 | IF( Agrif_Root() ) RETURN |
---|
368 | !! clem ghost |
---|
369 | IF((nbondi == -1).OR.(nbondi == 2)) THEN |
---|
370 | DO jj=1,jpj |
---|
371 | va_e(1:nbghostcells+1,jj) = vbdy_w(jj) * hvr_e(1:nbghostcells+1,jj) |
---|
372 | ! Specified fluxes: |
---|
373 | ua_e(1:nbghostcells+1,jj) = ubdy_w(jj) * hur_e(1:nbghostcells+1,jj) |
---|
374 | ! Characteristics method (only if ghostcells=1): |
---|
375 | !alt ua_e(2,jj) = 0.5_wp * ( ubdy_w(jj) * hur_e(2,jj) + ua_e(3,jj) & |
---|
376 | !alt & - sqrt(grav * hur_e(2,jj)) * (sshn_e(3,jj) - hbdy_w(jj)) ) |
---|
377 | END DO |
---|
378 | ENDIF |
---|
379 | ! |
---|
380 | IF((nbondi == 1).OR.(nbondi == 2)) THEN |
---|
381 | DO jj=1,jpj |
---|
382 | va_e(nlci-nbghostcells:nlci,jj) = vbdy_e(jj) * hvr_e(nlci-nbghostcells:nlci,jj) |
---|
383 | ! Specified fluxes: |
---|
384 | ua_e(nlci-nbghostcells-1:nlci-1,jj) = ubdy_e(jj) * hur_e(nlci-nbghostcells-1:nlci-1,jj) |
---|
385 | ! Characteristics method (only if ghostcells=1): |
---|
386 | !alt ua_e(nlci-2,jj) = 0.5_wp * ( ubdy_e(jj) * hur_e(nlci-2,jj) + ua_e(nlci-3,jj) & |
---|
387 | !alt & + sqrt(grav * hur_e(nlci-2,jj)) * (sshn_e(nlci-2,jj) - hbdy_e(jj)) ) |
---|
388 | END DO |
---|
389 | ENDIF |
---|
390 | ! |
---|
391 | IF((nbondj == -1).OR.(nbondj == 2)) THEN |
---|
392 | DO ji=1,jpi |
---|
393 | ua_e(ji,1:nbghostcells+1) = ubdy_s(ji) * hur_e(ji,1:nbghostcells+1) |
---|
394 | ! Specified fluxes: |
---|
395 | va_e(ji,1:nbghostcells+1) = vbdy_s(ji) * hvr_e(ji,1:nbghostcells+1) |
---|
396 | ! Characteristics method (only if ghostcells=1): |
---|
397 | !alt va_e(ji,2) = 0.5_wp * ( vbdy_s(ji) * hvr_e(ji,2) + va_e(ji,3) & |
---|
398 | !alt & - sqrt(grav * hvr_e(ji,2)) * (sshn_e(ji,3) - hbdy_s(ji)) ) |
---|
399 | END DO |
---|
400 | ENDIF |
---|
401 | ! |
---|
402 | IF((nbondj == 1).OR.(nbondj == 2)) THEN |
---|
403 | DO ji=1,jpi |
---|
404 | ua_e(ji,nlcj-nbghostcells:nlcj) = ubdy_n(ji) * hur_e(ji,nlcj-nbghostcells:nlcj) |
---|
405 | ! Specified fluxes: |
---|
406 | va_e(ji,nlcj-nbghostcells-1:nlcj-1) = vbdy_n(ji) * hvr_e(ji,nlcj-nbghostcells-1:nlcj-1) |
---|
407 | ! Characteristics method (only if ghostcells=1): |
---|
408 | !alt va_e(ji,nlcj-2) = 0.5_wp * ( vbdy_n(ji) * hvr_e(ji,nlcj-2) + va_e(ji,nlcj-3) & |
---|
409 | !alt & + sqrt(grav * hvr_e(ji,nlcj-2)) * (sshn_e(ji,nlcj-2) - hbdy_n(ji)) ) |
---|
410 | END DO |
---|
411 | ENDIF |
---|
412 | ! |
---|
413 | END SUBROUTINE Agrif_dyn_ts |
---|
414 | |
---|
415 | |
---|
416 | SUBROUTINE Agrif_dta_ts( kt ) |
---|
417 | !!---------------------------------------------------------------------- |
---|
418 | !! *** ROUTINE Agrif_dta_ts *** |
---|
419 | !!---------------------------------------------------------------------- |
---|
420 | !! |
---|
421 | INTEGER, INTENT(in) :: kt |
---|
422 | !! |
---|
423 | INTEGER :: ji, jj |
---|
424 | LOGICAL :: ll_int_cons |
---|
425 | REAL(wp) :: zrhot, zt |
---|
426 | !!---------------------------------------------------------------------- |
---|
427 | ! |
---|
428 | IF( Agrif_Root() ) RETURN |
---|
429 | ! |
---|
430 | ll_int_cons = ln_bt_fw ! Assume conservative temporal integration in the forward case only |
---|
431 | ! |
---|
432 | zrhot = Agrif_rhot() |
---|
433 | ! |
---|
434 | ! "Central" time index for interpolation: |
---|
435 | IF( ln_bt_fw ) THEN |
---|
436 | zt = REAL( Agrif_NbStepint()+0.5_wp, wp ) / zrhot |
---|
437 | ELSE |
---|
438 | zt = REAL( Agrif_NbStepint() , wp ) / zrhot |
---|
439 | ENDIF |
---|
440 | ! |
---|
441 | ! Linear interpolation of sea level |
---|
442 | Agrif_SpecialValue = 0._wp |
---|
443 | Agrif_UseSpecialValue = .TRUE. |
---|
444 | CALL Agrif_Bc_variable( sshn_id, calledweight=zt, procname=interpsshn ) |
---|
445 | Agrif_UseSpecialValue = .FALSE. |
---|
446 | ! |
---|
447 | ! Interpolate barotropic fluxes |
---|
448 | Agrif_SpecialValue=0. |
---|
449 | Agrif_UseSpecialValue = ln_spc_dyn |
---|
450 | ! |
---|
451 | IF( ll_int_cons ) THEN ! Conservative interpolation |
---|
452 | ! order matters here !!!!!! |
---|
453 | CALL Agrif_Bc_variable( ub2b_interp_id, calledweight=1._wp, procname=interpub2b ) ! Time integrated |
---|
454 | CALL Agrif_Bc_variable( vb2b_interp_id, calledweight=1._wp, procname=interpvb2b ) |
---|
455 | bdy_tinterp = 1 |
---|
456 | CALL Agrif_Bc_variable( unb_id , calledweight=1._wp, procname=interpunb ) ! After |
---|
457 | CALL Agrif_Bc_variable( vnb_id , calledweight=1._wp, procname=interpvnb ) |
---|
458 | bdy_tinterp = 2 |
---|
459 | CALL Agrif_Bc_variable( unb_id , calledweight=0._wp, procname=interpunb ) ! Before |
---|
460 | CALL Agrif_Bc_variable( vnb_id , calledweight=0._wp, procname=interpvnb ) |
---|
461 | ELSE ! Linear interpolation |
---|
462 | bdy_tinterp = 0 |
---|
463 | ubdy_w(:) = 0._wp ; vbdy_w(:) = 0._wp |
---|
464 | ubdy_e(:) = 0._wp ; vbdy_e(:) = 0._wp |
---|
465 | ubdy_n(:) = 0._wp ; vbdy_n(:) = 0._wp |
---|
466 | ubdy_s(:) = 0._wp ; vbdy_s(:) = 0._wp |
---|
467 | CALL Agrif_Bc_variable( unb_id, calledweight=zt, procname=interpunb ) |
---|
468 | CALL Agrif_Bc_variable( vnb_id, calledweight=zt, procname=interpvnb ) |
---|
469 | ENDIF |
---|
470 | Agrif_UseSpecialValue = .FALSE. |
---|
471 | ! |
---|
472 | END SUBROUTINE Agrif_dta_ts |
---|
473 | |
---|
474 | |
---|
475 | SUBROUTINE Agrif_ssh( kt ) |
---|
476 | !!---------------------------------------------------------------------- |
---|
477 | !! *** ROUTINE Agrif_DYN *** |
---|
478 | !!---------------------------------------------------------------------- |
---|
479 | INTEGER, INTENT(in) :: kt |
---|
480 | ! |
---|
481 | INTEGER :: ji, jj, indx |
---|
482 | !!---------------------------------------------------------------------- |
---|
483 | ! |
---|
484 | IF( Agrif_Root() ) RETURN |
---|
485 | !! clem ghost |
---|
486 | ! --- West --- ! |
---|
487 | IF((nbondi == -1).OR.(nbondi == 2)) THEN |
---|
488 | indx = 1+nbghostcells |
---|
489 | DO jj = 1, jpj |
---|
490 | DO ji = 1, indx |
---|
491 | ssha(ji,jj)=ssha(indx+1,jj) |
---|
492 | sshn(ji,jj)=sshn(indx+1,jj) |
---|
493 | ENDDO |
---|
494 | ENDDO |
---|
495 | ENDIF |
---|
496 | ! |
---|
497 | ! --- East --- ! |
---|
498 | IF((nbondi == 1).OR.(nbondi == 2)) THEN |
---|
499 | indx = nlci-nbghostcells |
---|
500 | DO jj = 1, jpj |
---|
501 | DO ji = indx, nlci |
---|
502 | ssha(ji,jj)=ssha(indx-1,jj) |
---|
503 | sshn(ji,jj)=sshn(indx-1,jj) |
---|
504 | ENDDO |
---|
505 | ENDDO |
---|
506 | ENDIF |
---|
507 | ! |
---|
508 | ! --- South --- ! |
---|
509 | IF((nbondj == -1).OR.(nbondj == 2)) THEN |
---|
510 | indx = 1+nbghostcells |
---|
511 | DO jj = 1, indx |
---|
512 | DO ji = 1, jpi |
---|
513 | ssha(ji,jj)=ssha(ji,indx+1) |
---|
514 | sshn(ji,jj)=sshn(ji,indx+1) |
---|
515 | ENDDO |
---|
516 | ENDDO |
---|
517 | ENDIF |
---|
518 | ! |
---|
519 | ! --- North --- ! |
---|
520 | IF((nbondj == 1).OR.(nbondj == 2)) THEN |
---|
521 | indx = nlcj-nbghostcells |
---|
522 | DO jj = indx, nlcj |
---|
523 | DO ji = 1, jpi |
---|
524 | ssha(ji,jj)=ssha(ji,indx-1) |
---|
525 | sshn(ji,jj)=sshn(ji,indx-1) |
---|
526 | ENDDO |
---|
527 | ENDDO |
---|
528 | ENDIF |
---|
529 | ! |
---|
530 | END SUBROUTINE Agrif_ssh |
---|
531 | |
---|
532 | |
---|
533 | SUBROUTINE Agrif_ssh_ts( jn ) |
---|
534 | !!---------------------------------------------------------------------- |
---|
535 | !! *** ROUTINE Agrif_ssh_ts *** |
---|
536 | !!---------------------------------------------------------------------- |
---|
537 | INTEGER, INTENT(in) :: jn |
---|
538 | !! |
---|
539 | INTEGER :: ji, jj |
---|
540 | !!---------------------------------------------------------------------- |
---|
541 | !! clem ghost (starting at i,j=1 is important I think otherwise you introduce a grad(ssh)/=0 at point 2) |
---|
542 | IF((nbondi == -1).OR.(nbondi == 2)) THEN |
---|
543 | DO jj = 1, jpj |
---|
544 | ssha_e(1:nbghostcells+1,jj) = hbdy_w(jj) |
---|
545 | END DO |
---|
546 | ENDIF |
---|
547 | ! |
---|
548 | IF((nbondi == 1).OR.(nbondi == 2)) THEN |
---|
549 | DO jj = 1, jpj |
---|
550 | ssha_e(nlci-nbghostcells:nlci,jj) = hbdy_e(jj) |
---|
551 | END DO |
---|
552 | ENDIF |
---|
553 | ! |
---|
554 | IF((nbondj == -1).OR.(nbondj == 2)) THEN |
---|
555 | DO ji = 1, jpi |
---|
556 | ssha_e(ji,1:nbghostcells+1) = hbdy_s(ji) |
---|
557 | END DO |
---|
558 | ENDIF |
---|
559 | ! |
---|
560 | IF((nbondj == 1).OR.(nbondj == 2)) THEN |
---|
561 | DO ji = 1, jpi |
---|
562 | ssha_e(ji,nlcj-nbghostcells:nlcj) = hbdy_n(ji) |
---|
563 | END DO |
---|
564 | ENDIF |
---|
565 | ! |
---|
566 | END SUBROUTINE Agrif_ssh_ts |
---|
567 | |
---|
568 | # if defined key_zdftke |
---|
569 | |
---|
570 | SUBROUTINE Agrif_tke |
---|
571 | !!---------------------------------------------------------------------- |
---|
572 | !! *** ROUTINE Agrif_tke *** |
---|
573 | !!---------------------------------------------------------------------- |
---|
574 | REAL(wp) :: zalpha |
---|
575 | !!---------------------------------------------------------------------- |
---|
576 | ! |
---|
577 | zalpha = REAL( Agrif_NbStepint() + Agrif_IRhot() - 1, wp ) / REAL( Agrif_IRhot(), wp ) |
---|
578 | IF( zalpha > 1. ) zalpha = 1. |
---|
579 | ! |
---|
580 | Agrif_SpecialValue = 0.e0 |
---|
581 | Agrif_UseSpecialValue = .TRUE. |
---|
582 | ! |
---|
583 | CALL Agrif_Bc_variable(avm_id ,calledweight=zalpha, procname=interpavm) |
---|
584 | ! |
---|
585 | Agrif_UseSpecialValue = .FALSE. |
---|
586 | ! |
---|
587 | END SUBROUTINE Agrif_tke |
---|
588 | |
---|
589 | # endif |
---|
590 | |
---|
591 | SUBROUTINE interptsn( ptab, i1, i2, j1, j2, k1, k2, n1, n2, before, nb, ndir ) |
---|
592 | !!---------------------------------------------------------------------- |
---|
593 | !! *** ROUTINE interptsn *** |
---|
594 | !!---------------------------------------------------------------------- |
---|
595 | REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2,n1:n2), INTENT(inout) :: ptab |
---|
596 | INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2, n1, n2 |
---|
597 | LOGICAL , INTENT(in ) :: before |
---|
598 | INTEGER , INTENT(in ) :: nb , ndir |
---|
599 | ! |
---|
600 | INTEGER :: ji, jj, jk, jn ! dummy loop indices |
---|
601 | INTEGER :: imin, imax, jmin, jmax |
---|
602 | REAL(wp) :: zrhox, z1, z2, z3, z4, z5, z6, z7 |
---|
603 | LOGICAL :: western_side, eastern_side,northern_side,southern_side |
---|
604 | !!---------------------------------------------------------------------- |
---|
605 | ! |
---|
606 | IF (before) THEN |
---|
607 | ptab(i1:i2,j1:j2,k1:k2,n1:n2) = tsn(i1:i2,j1:j2,k1:k2,n1:n2) |
---|
608 | ELSE |
---|
609 | ! |
---|
610 | IF( nbghostcells > 1 ) THEN ! no smoothing |
---|
611 | tsa(i1:i2,j1:j2,k1:k2,n1:n2) = ptab(i1:i2,j1:j2,k1:k2,n1:n2) |
---|
612 | ELSE ! smoothing |
---|
613 | ! |
---|
614 | western_side = (nb == 1).AND.(ndir == 1) ; eastern_side = (nb == 1).AND.(ndir == 2) |
---|
615 | southern_side = (nb == 2).AND.(ndir == 1) ; northern_side = (nb == 2).AND.(ndir == 2) |
---|
616 | ! |
---|
617 | zrhox = Agrif_Rhox() |
---|
618 | z1 = ( zrhox - 1. ) * 0.5 |
---|
619 | z3 = ( zrhox - 1. ) / ( zrhox + 1. ) |
---|
620 | z6 = 2. * ( zrhox - 1. ) / ( zrhox + 1. ) |
---|
621 | z7 = - ( zrhox - 1. ) / ( zrhox + 3. ) |
---|
622 | ! |
---|
623 | z2 = 1. - z1 |
---|
624 | z4 = 1. - z3 |
---|
625 | z5 = 1. - z6 - z7 |
---|
626 | ! |
---|
627 | imin = i1 ; imax = i2 |
---|
628 | jmin = j1 ; jmax = j2 |
---|
629 | ! |
---|
630 | ! Remove CORNERS |
---|
631 | IF((nbondj == -1).OR.(nbondj == 2)) jmin = 3 |
---|
632 | IF((nbondj == +1).OR.(nbondj == 2)) jmax = nlcj-2 |
---|
633 | IF((nbondi == -1).OR.(nbondi == 2)) imin = 3 |
---|
634 | IF((nbondi == +1).OR.(nbondi == 2)) imax = nlci-2 |
---|
635 | ! |
---|
636 | IF( eastern_side ) THEN |
---|
637 | DO jn = 1, jpts |
---|
638 | tsa(nlci,j1:j2,k1:k2,jn) = z1 * ptab(nlci,j1:j2,k1:k2,jn) + z2 * ptab(nlci-1,j1:j2,k1:k2,jn) |
---|
639 | DO jk = 1, jpkm1 |
---|
640 | DO jj = jmin,jmax |
---|
641 | IF( umask(nlci-2,jj,jk) == 0._wp ) THEN |
---|
642 | tsa(nlci-1,jj,jk,jn) = tsa(nlci,jj,jk,jn) * tmask(nlci-1,jj,jk) |
---|
643 | ELSE |
---|
644 | tsa(nlci-1,jj,jk,jn)=(z4*tsa(nlci,jj,jk,jn)+z3*tsa(nlci-2,jj,jk,jn))*tmask(nlci-1,jj,jk) |
---|
645 | IF( un(nlci-2,jj,jk) > 0._wp ) THEN |
---|
646 | tsa(nlci-1,jj,jk,jn)=( z6*tsa(nlci-2,jj,jk,jn)+z5*tsa(nlci,jj,jk,jn) & |
---|
647 | + z7*tsa(nlci-3,jj,jk,jn) ) * tmask(nlci-1,jj,jk) |
---|
648 | ENDIF |
---|
649 | ENDIF |
---|
650 | END DO |
---|
651 | END DO |
---|
652 | tsa(nlci,j1:j2,k1:k2,jn) = 0._wp |
---|
653 | END DO |
---|
654 | ENDIF |
---|
655 | ! |
---|
656 | IF( northern_side ) THEN |
---|
657 | DO jn = 1, jpts |
---|
658 | tsa(i1:i2,nlcj,k1:k2,jn) = z1 * ptab(i1:i2,nlcj,k1:k2,jn) + z2 * ptab(i1:i2,nlcj-1,k1:k2,jn) |
---|
659 | DO jk = 1, jpkm1 |
---|
660 | DO ji = imin,imax |
---|
661 | IF( vmask(ji,nlcj-2,jk) == 0._wp ) THEN |
---|
662 | tsa(ji,nlcj-1,jk,jn) = tsa(ji,nlcj,jk,jn) * tmask(ji,nlcj-1,jk) |
---|
663 | ELSE |
---|
664 | tsa(ji,nlcj-1,jk,jn)=(z4*tsa(ji,nlcj,jk,jn)+z3*tsa(ji,nlcj-2,jk,jn))*tmask(ji,nlcj-1,jk) |
---|
665 | IF (vn(ji,nlcj-2,jk) > 0._wp ) THEN |
---|
666 | tsa(ji,nlcj-1,jk,jn)=( z6*tsa(ji,nlcj-2,jk,jn)+z5*tsa(ji,nlcj,jk,jn) & |
---|
667 | + z7*tsa(ji,nlcj-3,jk,jn) ) * tmask(ji,nlcj-1,jk) |
---|
668 | ENDIF |
---|
669 | ENDIF |
---|
670 | END DO |
---|
671 | END DO |
---|
672 | tsa(i1:i2,nlcj,k1:k2,jn) = 0._wp |
---|
673 | END DO |
---|
674 | ENDIF |
---|
675 | ! |
---|
676 | IF( western_side ) THEN |
---|
677 | DO jn = 1, jpts |
---|
678 | tsa(1,j1:j2,k1:k2,jn) = z1 * ptab(1,j1:j2,k1:k2,jn) + z2 * ptab(2,j1:j2,k1:k2,jn) |
---|
679 | DO jk = 1, jpkm1 |
---|
680 | DO jj = jmin,jmax |
---|
681 | IF( umask(2,jj,jk) == 0._wp ) THEN |
---|
682 | tsa(2,jj,jk,jn) = tsa(1,jj,jk,jn) * tmask(2,jj,jk) |
---|
683 | ELSE |
---|
684 | tsa(2,jj,jk,jn)=(z4*tsa(1,jj,jk,jn)+z3*tsa(3,jj,jk,jn))*tmask(2,jj,jk) |
---|
685 | IF( un(2,jj,jk) < 0._wp ) THEN |
---|
686 | tsa(2,jj,jk,jn)=(z6*tsa(3,jj,jk,jn)+z5*tsa(1,jj,jk,jn)+z7*tsa(4,jj,jk,jn))*tmask(2,jj,jk) |
---|
687 | ENDIF |
---|
688 | ENDIF |
---|
689 | END DO |
---|
690 | END DO |
---|
691 | tsa(1,j1:j2,k1:k2,jn) = 0._wp |
---|
692 | END DO |
---|
693 | ENDIF |
---|
694 | ! |
---|
695 | IF( southern_side ) THEN |
---|
696 | DO jn = 1, jpts |
---|
697 | tsa(i1:i2,1,k1:k2,jn) = z1 * ptab(i1:i2,1,k1:k2,jn) + z2 * ptab(i1:i2,2,k1:k2,jn) |
---|
698 | DO jk = 1, jpk |
---|
699 | DO ji=imin,imax |
---|
700 | IF( vmask(ji,2,jk) == 0._wp ) THEN |
---|
701 | tsa(ji,2,jk,jn)=tsa(ji,1,jk,jn) * tmask(ji,2,jk) |
---|
702 | ELSE |
---|
703 | tsa(ji,2,jk,jn)=(z4*tsa(ji,1,jk,jn)+z3*tsa(ji,3,jk,jn))*tmask(ji,2,jk) |
---|
704 | IF( vn(ji,2,jk) < 0._wp ) THEN |
---|
705 | tsa(ji,2,jk,jn)=(z6*tsa(ji,3,jk,jn)+z5*tsa(ji,1,jk,jn)+z7*tsa(ji,4,jk,jn))*tmask(ji,2,jk) |
---|
706 | ENDIF |
---|
707 | ENDIF |
---|
708 | END DO |
---|
709 | END DO |
---|
710 | tsa(i1:i2,1,k1:k2,jn) = 0._wp |
---|
711 | END DO |
---|
712 | ENDIF |
---|
713 | ! |
---|
714 | ! Treatment of corners |
---|
715 | IF ((eastern_side).AND.((nbondj == -1).OR.(nbondj == 2))) tsa(nlci-1,2,:,:) = ptab(nlci-1,2,:,:) ! East south |
---|
716 | IF ((eastern_side).AND.((nbondj == 1).OR.(nbondj == 2))) tsa(nlci-1,nlcj-1,:,:) = ptab(nlci-1,nlcj-1,:,:) ! East north |
---|
717 | IF ((western_side).AND.((nbondj == -1).OR.(nbondj == 2))) tsa(2,2,:,:) = ptab(2,2,:,:) ! West south |
---|
718 | IF ((western_side).AND.((nbondj == 1).OR.(nbondj == 2))) tsa(2,nlcj-1,:,:) = ptab(2,nlcj-1,:,:) ! West north |
---|
719 | ! |
---|
720 | ENDIF |
---|
721 | ENDIF |
---|
722 | ! |
---|
723 | END SUBROUTINE interptsn |
---|
724 | |
---|
725 | |
---|
726 | SUBROUTINE interpsshn( ptab, i1, i2, j1, j2, before, nb, ndir ) |
---|
727 | !!---------------------------------------------------------------------- |
---|
728 | !! *** ROUTINE interpsshn *** |
---|
729 | !!---------------------------------------------------------------------- |
---|
730 | INTEGER , INTENT(in ) :: i1, i2, j1, j2 |
---|
731 | REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab |
---|
732 | LOGICAL , INTENT(in ) :: before |
---|
733 | INTEGER , INTENT(in ) :: nb , ndir |
---|
734 | ! |
---|
735 | LOGICAL :: western_side, eastern_side,northern_side,southern_side |
---|
736 | !!---------------------------------------------------------------------- |
---|
737 | ! |
---|
738 | IF( before) THEN |
---|
739 | ptab(i1:i2,j1:j2) = sshn(i1:i2,j1:j2) |
---|
740 | ELSE |
---|
741 | western_side = (nb == 1).AND.(ndir == 1) |
---|
742 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
743 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
744 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
745 | !! clem ghost |
---|
746 | IF(western_side) hbdy_w(j1:j2) = ptab(i2,j1:j2) * tmask(i1,j1:j2,1) |
---|
747 | IF(eastern_side) hbdy_e(j1:j2) = ptab(i2,j1:j2) * tmask(i2,j1:j2,1) !clem previously i1 |
---|
748 | IF(southern_side) hbdy_s(i1:i2) = ptab(i1:i2,j2) * tmask(i1:i2,j2,1) !clem previously j1 |
---|
749 | IF(northern_side) hbdy_n(i1:i2) = ptab(i1:i2,j2) * tmask(i1:i2,j1,1) |
---|
750 | ENDIF |
---|
751 | ! |
---|
752 | END SUBROUTINE interpsshn |
---|
753 | |
---|
754 | |
---|
755 | SUBROUTINE interpun( ptab, i1, i2, j1, j2, k1, k2, before ) |
---|
756 | !!---------------------------------------------------------------------- |
---|
757 | !! *** ROUTINE interpun *** |
---|
758 | !!---------------------------------------------------------------------- |
---|
759 | INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 |
---|
760 | REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab |
---|
761 | LOGICAL , INTENT(in ) :: before |
---|
762 | ! |
---|
763 | INTEGER :: ji, jj, jk |
---|
764 | REAL(wp) :: zrhoy |
---|
765 | !!---------------------------------------------------------------------- |
---|
766 | ! |
---|
767 | IF( before ) THEN |
---|
768 | DO jk = k1, jpk |
---|
769 | ptab(i1:i2,j1:j2,jk) = e2u(i1:i2,j1:j2) * e3u_n(i1:i2,j1:j2,jk) * un(i1:i2,j1:j2,jk) |
---|
770 | END DO |
---|
771 | ELSE |
---|
772 | zrhoy = Agrif_Rhoy() |
---|
773 | DO jk = 1, jpkm1 |
---|
774 | DO jj=j1,j2 |
---|
775 | ua(i1:i2,jj,jk) = ptab(i1:i2,jj,jk) / ( zrhoy * e2u(i1:i2,jj) * e3u_n(i1:i2,jj,jk) ) |
---|
776 | END DO |
---|
777 | END DO |
---|
778 | ENDIF |
---|
779 | ! |
---|
780 | END SUBROUTINE interpun |
---|
781 | |
---|
782 | |
---|
783 | SUBROUTINE interpvn( ptab, i1, i2, j1, j2, k1, k2, before ) |
---|
784 | !!---------------------------------------------------------------------- |
---|
785 | !! *** ROUTINE interpvn *** |
---|
786 | !!---------------------------------------------------------------------- |
---|
787 | INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 |
---|
788 | REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab |
---|
789 | LOGICAL , INTENT(in ) :: before |
---|
790 | ! |
---|
791 | INTEGER :: ji, jj, jk |
---|
792 | REAL(wp) :: zrhox |
---|
793 | !!---------------------------------------------------------------------- |
---|
794 | ! |
---|
795 | IF( before ) THEN !interpv entre 1 et k2 et interpv2d en jpkp1 |
---|
796 | DO jk = k1, jpk |
---|
797 | ptab(i1:i2,j1:j2,jk) = e1v(i1:i2,j1:j2) * e3v_n(i1:i2,j1:j2,jk) * vn(i1:i2,j1:j2,jk) |
---|
798 | END DO |
---|
799 | ELSE |
---|
800 | zrhox= Agrif_Rhox() |
---|
801 | DO jk = 1, jpkm1 |
---|
802 | va(i1:i2,j1:j2,jk) = ptab(i1:i2,j1:j2,jk) / ( zrhox * e1v(i1:i2,j1:j2) * e3v_n(i1:i2,j1:j2,jk) ) |
---|
803 | END DO |
---|
804 | ENDIF |
---|
805 | ! |
---|
806 | END SUBROUTINE interpvn |
---|
807 | |
---|
808 | |
---|
809 | SUBROUTINE interpunb( ptab, i1, i2, j1, j2, before, nb, ndir ) |
---|
810 | !!---------------------------------------------------------------------- |
---|
811 | !! *** ROUTINE interpunb *** |
---|
812 | !!---------------------------------------------------------------------- |
---|
813 | INTEGER , INTENT(in ) :: i1, i2, j1, j2 |
---|
814 | REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab |
---|
815 | LOGICAL , INTENT(in ) :: before |
---|
816 | INTEGER , INTENT(in ) :: nb , ndir |
---|
817 | ! |
---|
818 | INTEGER :: ji, jj |
---|
819 | REAL(wp) :: zrhoy, zrhot, zt0, zt1, ztcoeff |
---|
820 | LOGICAL :: western_side, eastern_side,northern_side,southern_side |
---|
821 | !!---------------------------------------------------------------------- |
---|
822 | ! |
---|
823 | IF( before ) THEN |
---|
824 | ptab(i1:i2,j1:j2) = e2u(i1:i2,j1:j2) * hu_n(i1:i2,j1:j2) * un_b(i1:i2,j1:j2) |
---|
825 | ELSE |
---|
826 | western_side = (nb == 1).AND.(ndir == 1) |
---|
827 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
828 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
829 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
830 | zrhoy = Agrif_Rhoy() |
---|
831 | zrhot = Agrif_rhot() |
---|
832 | ! Time indexes bounds for integration |
---|
833 | zt0 = REAL(Agrif_NbStepint() , wp) / zrhot |
---|
834 | zt1 = REAL(Agrif_NbStepint()+1, wp) / zrhot |
---|
835 | ! Polynomial interpolation coefficients: |
---|
836 | IF( bdy_tinterp == 1 ) THEN |
---|
837 | ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & |
---|
838 | & - zt0**2._wp * ( zt0 - 1._wp) ) |
---|
839 | ELSEIF( bdy_tinterp == 2 ) THEN |
---|
840 | ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & |
---|
841 | & - zt0 * ( zt0 - 1._wp)**2._wp ) |
---|
842 | ELSE |
---|
843 | ztcoeff = 1 |
---|
844 | ENDIF |
---|
845 | !! clem ghost |
---|
846 | IF(western_side) ubdy_w(j1:j2) = ubdy_w(j1:j2) + ztcoeff * ptab(i1,j1:j2) |
---|
847 | IF(eastern_side) ubdy_e(j1:j2) = ubdy_e(j1:j2) + ztcoeff * ptab(i2,j1:j2) !clem previously i1 |
---|
848 | IF(southern_side) ubdy_s(i1:i2) = ubdy_s(i1:i2) + ztcoeff * ptab(i1:i2,j2) !clem previously j1 |
---|
849 | IF(northern_side) ubdy_n(i1:i2) = ubdy_n(i1:i2) + ztcoeff * ptab(i1:i2,j1) |
---|
850 | ! |
---|
851 | IF( bdy_tinterp == 0 .OR. bdy_tinterp == 2) THEN |
---|
852 | IF(western_side) ubdy_w(j1:j2) = ubdy_w(j1:j2) / (zrhoy*e2u(i1,j1:j2)) * umask(i1,j1:j2,1) |
---|
853 | IF(eastern_side) ubdy_e(j1:j2) = ubdy_e(j1:j2) / (zrhoy*e2u(i2,j1:j2)) * umask(i2,j1:j2,1) |
---|
854 | IF(southern_side) ubdy_s(i1:i2) = ubdy_s(i1:i2) / (zrhoy*e2u(i1:i2,j2)) * umask(i1:i2,j2,1) |
---|
855 | IF(northern_side) ubdy_n(i1:i2) = ubdy_n(i1:i2) / (zrhoy*e2u(i1:i2,j1)) * umask(i1:i2,j1,1) |
---|
856 | ENDIF |
---|
857 | ENDIF |
---|
858 | ! |
---|
859 | END SUBROUTINE interpunb |
---|
860 | |
---|
861 | |
---|
862 | SUBROUTINE interpvnb( ptab, i1, i2, j1, j2, before, nb, ndir ) |
---|
863 | !!---------------------------------------------------------------------- |
---|
864 | !! *** ROUTINE interpvnb *** |
---|
865 | !!---------------------------------------------------------------------- |
---|
866 | INTEGER , INTENT(in ) :: i1, i2, j1, j2 |
---|
867 | REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab |
---|
868 | LOGICAL , INTENT(in ) :: before |
---|
869 | INTEGER , INTENT(in ) :: nb , ndir |
---|
870 | ! |
---|
871 | INTEGER :: ji,jj |
---|
872 | REAL(wp) :: zrhox, zrhot, zt0, zt1, ztcoeff |
---|
873 | LOGICAL :: western_side, eastern_side,northern_side,southern_side |
---|
874 | !!---------------------------------------------------------------------- |
---|
875 | ! |
---|
876 | IF( before ) THEN |
---|
877 | ptab(i1:i2,j1:j2) = e1v(i1:i2,j1:j2) * hv_n(i1:i2,j1:j2) * vn_b(i1:i2,j1:j2) |
---|
878 | ELSE |
---|
879 | western_side = (nb == 1).AND.(ndir == 1) |
---|
880 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
881 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
882 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
883 | zrhox = Agrif_Rhox() |
---|
884 | zrhot = Agrif_rhot() |
---|
885 | ! Time indexes bounds for integration |
---|
886 | zt0 = REAL(Agrif_NbStepint() , wp) / zrhot |
---|
887 | zt1 = REAL(Agrif_NbStepint()+1, wp) / zrhot |
---|
888 | IF( bdy_tinterp == 1 ) THEN |
---|
889 | ztcoeff = zrhot * ( zt1**2._wp * ( zt1 - 1._wp) & |
---|
890 | & - zt0**2._wp * ( zt0 - 1._wp) ) |
---|
891 | ELSEIF( bdy_tinterp == 2 ) THEN |
---|
892 | ztcoeff = zrhot * ( zt1 * ( zt1 - 1._wp)**2._wp & |
---|
893 | & - zt0 * ( zt0 - 1._wp)**2._wp ) |
---|
894 | ELSE |
---|
895 | ztcoeff = 1 |
---|
896 | ENDIF |
---|
897 | !! clem ghost |
---|
898 | IF(western_side) vbdy_w(j1:j2) = vbdy_w(j1:j2) + ztcoeff * ptab(i1,j1:j2) |
---|
899 | IF(eastern_side) vbdy_e(j1:j2) = vbdy_e(j1:j2) + ztcoeff * ptab(i2,j1:j2) !clem previously i1 |
---|
900 | IF(southern_side) vbdy_s(i1:i2) = vbdy_s(i1:i2) + ztcoeff * ptab(i1:i2,j2) !clem previously j1 |
---|
901 | IF(northern_side) vbdy_n(i1:i2) = vbdy_n(i1:i2) + ztcoeff * ptab(i1:i2,j1) |
---|
902 | ! |
---|
903 | IF( bdy_tinterp == 0 .OR. bdy_tinterp == 2) THEN |
---|
904 | IF(western_side) vbdy_w(j1:j2) = vbdy_w(j1:j2) / (zrhox*e1v(i1,j1:j2)) * vmask(i1,j1:j2,1) |
---|
905 | IF(eastern_side) vbdy_e(j1:j2) = vbdy_e(j1:j2) / (zrhox*e1v(i2,j1:j2)) * vmask(i2,j1:j2,1) |
---|
906 | IF(southern_side) vbdy_s(i1:i2) = vbdy_s(i1:i2) / (zrhox*e1v(i1:i2,j2)) * vmask(i1:i2,j2,1) |
---|
907 | IF(northern_side) vbdy_n(i1:i2) = vbdy_n(i1:i2) / (zrhox*e1v(i1:i2,j1)) * vmask(i1:i2,j1,1) |
---|
908 | ENDIF |
---|
909 | ENDIF |
---|
910 | ! |
---|
911 | END SUBROUTINE interpvnb |
---|
912 | |
---|
913 | |
---|
914 | SUBROUTINE interpub2b( ptab, i1, i2, j1, j2, before, nb, ndir ) |
---|
915 | !!---------------------------------------------------------------------- |
---|
916 | !! *** ROUTINE interpub2b *** |
---|
917 | !!---------------------------------------------------------------------- |
---|
918 | INTEGER , INTENT(in ) :: i1, i2, j1, j2 |
---|
919 | REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab |
---|
920 | LOGICAL , INTENT(in ) :: before |
---|
921 | INTEGER , INTENT(in ) :: nb , ndir |
---|
922 | ! |
---|
923 | INTEGER :: ji,jj |
---|
924 | REAL(wp) :: zrhot, zt0, zt1,zat |
---|
925 | LOGICAL :: western_side, eastern_side,northern_side,southern_side |
---|
926 | !!---------------------------------------------------------------------- |
---|
927 | IF( before ) THEN |
---|
928 | ptab(i1:i2,j1:j2) = e2u(i1:i2,j1:j2) * ub2_b(i1:i2,j1:j2) |
---|
929 | ELSE |
---|
930 | western_side = (nb == 1).AND.(ndir == 1) |
---|
931 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
932 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
933 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
934 | zrhot = Agrif_rhot() |
---|
935 | ! Time indexes bounds for integration |
---|
936 | zt0 = REAL(Agrif_NbStepint() , wp) / zrhot |
---|
937 | zt1 = REAL(Agrif_NbStepint()+1, wp) / zrhot |
---|
938 | ! Polynomial interpolation coefficients: |
---|
939 | zat = zrhot * ( zt1**2._wp * (-2._wp*zt1 + 3._wp) & |
---|
940 | & - zt0**2._wp * (-2._wp*zt0 + 3._wp) ) |
---|
941 | !! clem ghost |
---|
942 | IF(western_side ) ubdy_w(j1:j2) = zat * ptab(i1,j1:j2) |
---|
943 | IF(eastern_side ) ubdy_e(j1:j2) = zat * ptab(i2,j1:j2) !clem previously i1 |
---|
944 | IF(southern_side) ubdy_s(i1:i2) = zat * ptab(i1:i2,j2) !clem previously j1 |
---|
945 | IF(northern_side) ubdy_n(i1:i2) = zat * ptab(i1:i2,j1) |
---|
946 | ENDIF |
---|
947 | ! |
---|
948 | END SUBROUTINE interpub2b |
---|
949 | |
---|
950 | |
---|
951 | SUBROUTINE interpvb2b( ptab, i1, i2, j1, j2, before, nb, ndir ) |
---|
952 | !!---------------------------------------------------------------------- |
---|
953 | !! *** ROUTINE interpvb2b *** |
---|
954 | !!---------------------------------------------------------------------- |
---|
955 | INTEGER , INTENT(in ) :: i1, i2, j1, j2 |
---|
956 | REAL(wp), DIMENSION(i1:i2,j1:j2), INTENT(inout) :: ptab |
---|
957 | LOGICAL , INTENT(in ) :: before |
---|
958 | INTEGER , INTENT(in ) :: nb , ndir |
---|
959 | ! |
---|
960 | INTEGER :: ji,jj |
---|
961 | REAL(wp) :: zrhot, zt0, zt1,zat |
---|
962 | LOGICAL :: western_side, eastern_side,northern_side,southern_side |
---|
963 | !!---------------------------------------------------------------------- |
---|
964 | ! |
---|
965 | IF( before ) THEN |
---|
966 | ptab(i1:i2,j1:j2) = e1v(i1:i2,j1:j2) * vb2_b(i1:i2,j1:j2) |
---|
967 | ELSE |
---|
968 | western_side = (nb == 1).AND.(ndir == 1) |
---|
969 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
970 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
971 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
972 | zrhot = Agrif_rhot() |
---|
973 | ! Time indexes bounds for integration |
---|
974 | zt0 = REAL(Agrif_NbStepint() , wp) / zrhot |
---|
975 | zt1 = REAL(Agrif_NbStepint()+1, wp) / zrhot |
---|
976 | ! Polynomial interpolation coefficients: |
---|
977 | zat = zrhot * ( zt1**2._wp * (-2._wp*zt1 + 3._wp) & |
---|
978 | & - zt0**2._wp * (-2._wp*zt0 + 3._wp) ) |
---|
979 | ! |
---|
980 | IF(western_side ) vbdy_w(j1:j2) = zat * ptab(i1,j1:j2) |
---|
981 | IF(eastern_side ) vbdy_e(j1:j2) = zat * ptab(i2,j1:j2) !clem previously i1 |
---|
982 | IF(southern_side) vbdy_s(i1:i2) = zat * ptab(i1:i2,j2) !clem previously j1 |
---|
983 | IF(northern_side) vbdy_n(i1:i2) = zat * ptab(i1:i2,j1) |
---|
984 | ENDIF |
---|
985 | ! |
---|
986 | END SUBROUTINE interpvb2b |
---|
987 | |
---|
988 | |
---|
989 | SUBROUTINE interpe3t( ptab, i1, i2, j1, j2, k1, k2, before, nb, ndir ) |
---|
990 | !!---------------------------------------------------------------------- |
---|
991 | !! *** ROUTINE interpe3t *** |
---|
992 | !!---------------------------------------------------------------------- |
---|
993 | INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 |
---|
994 | REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab |
---|
995 | LOGICAL , INTENT(in ) :: before |
---|
996 | INTEGER , INTENT(in ) :: nb , ndir |
---|
997 | ! |
---|
998 | INTEGER :: ji, jj, jk |
---|
999 | LOGICAL :: western_side, eastern_side, northern_side, southern_side |
---|
1000 | !!---------------------------------------------------------------------- |
---|
1001 | ! |
---|
1002 | IF( before ) THEN |
---|
1003 | ptab(i1:i2,j1:j2,k1:k2) = tmask(i1:i2,j1:j2,k1:k2) * e3t_0(i1:i2,j1:j2,k1:k2) |
---|
1004 | ELSE |
---|
1005 | western_side = (nb == 1).AND.(ndir == 1) |
---|
1006 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
1007 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
1008 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
1009 | ! |
---|
1010 | DO jk = k1, k2 |
---|
1011 | DO jj = j1, j2 |
---|
1012 | DO ji = i1, i2 |
---|
1013 | ! |
---|
1014 | IF( ABS( ptab(ji,jj,jk) - tmask(ji,jj,jk) * e3t_0(ji,jj,jk) ) > 1.D-2) THEN |
---|
1015 | IF (western_side) THEN |
---|
1016 | WRITE(numout,*) 'ERROR bathymetry merge at the western border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk |
---|
1017 | ELSEIF (eastern_side) THEN |
---|
1018 | WRITE(numout,*) 'ERROR bathymetry merge at the eastern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk |
---|
1019 | ELSEIF (southern_side) THEN |
---|
1020 | WRITE(numout,*) 'ERROR bathymetry merge at the southern border ji,jj,jk', ji+nimpp-1,jj+njmpp-1,jk |
---|
1021 | ELSEIF (northern_side) THEN |
---|
1022 | WRITE(numout,*) 'ERROR bathymetry merge at the northen border ji,jj,jk', ji+nimpp-1,jj+njmpp-1,jk |
---|
1023 | ENDIF |
---|
1024 | WRITE(numout,*) ' ptab(ji,jj,jk), e3t(ji,jj,jk) ', ptab(ji,jj,jk), e3t_0(ji,jj,jk) |
---|
1025 | kindic_agr = kindic_agr + 1 |
---|
1026 | ENDIF |
---|
1027 | END DO |
---|
1028 | END DO |
---|
1029 | END DO |
---|
1030 | ! |
---|
1031 | ENDIF |
---|
1032 | ! |
---|
1033 | END SUBROUTINE interpe3t |
---|
1034 | |
---|
1035 | |
---|
1036 | SUBROUTINE interpumsk( ptab, i1, i2, j1, j2, k1, k2, before, nb, ndir ) |
---|
1037 | !!---------------------------------------------------------------------- |
---|
1038 | !! *** ROUTINE interpumsk *** |
---|
1039 | !!---------------------------------------------------------------------- |
---|
1040 | INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 |
---|
1041 | REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab |
---|
1042 | LOGICAL , INTENT(in ) :: before |
---|
1043 | INTEGER , INTENT(in ) :: nb , ndir |
---|
1044 | ! |
---|
1045 | INTEGER :: ji, jj, jk |
---|
1046 | LOGICAL :: western_side, eastern_side |
---|
1047 | !!---------------------------------------------------------------------- |
---|
1048 | ! |
---|
1049 | IF( before ) THEN |
---|
1050 | ptab(i1:i2,j1:j2,k1:k2) = umask(i1:i2,j1:j2,k1:k2) |
---|
1051 | ELSE |
---|
1052 | western_side = (nb == 1).AND.(ndir == 1) |
---|
1053 | eastern_side = (nb == 1).AND.(ndir == 2) |
---|
1054 | DO jk = k1, k2 |
---|
1055 | DO jj = j1, j2 |
---|
1056 | DO ji = i1, i2 |
---|
1057 | ! Velocity mask at boundary edge points: |
---|
1058 | IF (ABS(ptab(ji,jj,jk) - umask(ji,jj,jk)) > 1.D-2) THEN |
---|
1059 | IF (western_side) THEN |
---|
1060 | WRITE(numout,*) 'ERROR with umask at the western border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk |
---|
1061 | WRITE(numout,*) ' masks: parent, child ', ptab(ji,jj,jk), umask(ji,jj,jk) |
---|
1062 | kindic_agr = kindic_agr + 1 |
---|
1063 | ELSEIF (eastern_side) THEN |
---|
1064 | WRITE(numout,*) 'ERROR with umask at the eastern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk |
---|
1065 | WRITE(numout,*) ' masks: parent, child ', ptab(ji,jj,jk), umask(ji,jj,jk) |
---|
1066 | kindic_agr = kindic_agr + 1 |
---|
1067 | ENDIF |
---|
1068 | ENDIF |
---|
1069 | END DO |
---|
1070 | END DO |
---|
1071 | END DO |
---|
1072 | ! |
---|
1073 | ENDIF |
---|
1074 | ! |
---|
1075 | END SUBROUTINE interpumsk |
---|
1076 | |
---|
1077 | |
---|
1078 | SUBROUTINE interpvmsk( ptab, i1, i2, j1, j2, k1, k2, before, nb, ndir ) |
---|
1079 | !!---------------------------------------------------------------------- |
---|
1080 | !! *** ROUTINE interpvmsk *** |
---|
1081 | !!---------------------------------------------------------------------- |
---|
1082 | INTEGER , INTENT(in ) :: i1,i2,j1,j2,k1,k2 |
---|
1083 | REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab |
---|
1084 | LOGICAL , INTENT(in ) :: before |
---|
1085 | INTEGER , INTENT(in ) :: nb , ndir |
---|
1086 | ! |
---|
1087 | INTEGER :: ji, jj, jk |
---|
1088 | LOGICAL :: northern_side, southern_side |
---|
1089 | !!---------------------------------------------------------------------- |
---|
1090 | ! |
---|
1091 | IF( before ) THEN |
---|
1092 | ptab(i1:i2,j1:j2,k1:k2) = vmask(i1:i2,j1:j2,k1:k2) |
---|
1093 | ELSE |
---|
1094 | southern_side = (nb == 2).AND.(ndir == 1) |
---|
1095 | northern_side = (nb == 2).AND.(ndir == 2) |
---|
1096 | DO jk = k1, k2 |
---|
1097 | DO jj = j1, j2 |
---|
1098 | DO ji = i1, i2 |
---|
1099 | ! Velocity mask at boundary edge points: |
---|
1100 | IF (ABS(ptab(ji,jj,jk) - vmask(ji,jj,jk)) > 1.D-2) THEN |
---|
1101 | IF (southern_side) THEN |
---|
1102 | WRITE(numout,*) 'ERROR with vmask at the southern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk |
---|
1103 | WRITE(numout,*) ' masks: parent, child ', ptab(ji,jj,jk), vmask(ji,jj,jk) |
---|
1104 | kindic_agr = kindic_agr + 1 |
---|
1105 | ELSEIF (northern_side) THEN |
---|
1106 | WRITE(numout,*) 'ERROR with vmask at the northern border ji,jj,jk ', ji+nimpp-1,jj+njmpp-1,jk |
---|
1107 | WRITE(numout,*) ' masks: parent, child ', ptab(ji,jj,jk), vmask(ji,jj,jk) |
---|
1108 | kindic_agr = kindic_agr + 1 |
---|
1109 | ENDIF |
---|
1110 | ENDIF |
---|
1111 | END DO |
---|
1112 | END DO |
---|
1113 | END DO |
---|
1114 | ! |
---|
1115 | ENDIF |
---|
1116 | ! |
---|
1117 | END SUBROUTINE interpvmsk |
---|
1118 | |
---|
1119 | # if defined key_zdftke |
---|
1120 | |
---|
1121 | SUBROUTINE interpavm( ptab, i1, i2, j1, j2, k1, k2, before ) |
---|
1122 | !!---------------------------------------------------------------------- |
---|
1123 | !! *** ROUTINE interavm *** |
---|
1124 | !!---------------------------------------------------------------------- |
---|
1125 | INTEGER , INTENT(in ) :: i1, i2, j1, j2, k1, k2 |
---|
1126 | REAL(wp),DIMENSION(i1:i2,j1:j2,k1:k2), INTENT(inout) :: ptab |
---|
1127 | LOGICAL , INTENT(in ) :: before |
---|
1128 | !!---------------------------------------------------------------------- |
---|
1129 | ! |
---|
1130 | IF( before ) THEN |
---|
1131 | ptab (i1:i2,j1:j2,k1:k2) = avm_k(i1:i2,j1:j2,k1:k2) |
---|
1132 | ELSE |
---|
1133 | avm_k(i1:i2,j1:j2,k1:k2) = ptab (i1:i2,j1:j2,k1:k2) |
---|
1134 | ENDIF |
---|
1135 | ! |
---|
1136 | END SUBROUTINE interpavm |
---|
1137 | |
---|
1138 | # endif /* key_zdftke */ |
---|
1139 | |
---|
1140 | #else |
---|
1141 | !!---------------------------------------------------------------------- |
---|
1142 | !! Empty module no AGRIF zoom |
---|
1143 | !!---------------------------------------------------------------------- |
---|
1144 | CONTAINS |
---|
1145 | SUBROUTINE Agrif_OPA_Interp_empty |
---|
1146 | WRITE(*,*) 'agrif_opa_interp : You should not have seen this print! error?' |
---|
1147 | END SUBROUTINE Agrif_OPA_Interp_empty |
---|
1148 | #endif |
---|
1149 | |
---|
1150 | !!====================================================================== |
---|
1151 | END MODULE agrif_opa_interp |
---|