59
60
66
67
68
69 integer, intent(in) :: ng, tile
70 integer, intent(in) :: LBi, UBi, LBj, UBj
71 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
72 integer, intent(in) :: krhs, kstp, kout
73
74# ifdef ASSUMED_SHAPE
75 real(r8), intent(in) :: zeta(LBi:,LBj:,:)
76
77 real(r8), intent(inout) :: tl_zeta(LBi:,LBj:,:)
78# else
79 real(r8), intent(in) :: zeta(LBi:UBi,LBj:UBj,3)
80
81 real(r8), intent(inout) :: tl_zeta(LBi:UBi,LBj:UBj,3)
82# endif
83
84
85
86 integer :: i, j, know
87
88 real(r8) :: Ce, Cx
89 real(r8) :: cff, cff1, cff2, dt2d, tau
90
91 real(r8) :: tl_Ce, tl_Cx
92 real(r8) :: tl_cff1, tl_cff2
93
94 real(r8), dimension(IminS:ImaxS,JminS:JmaxS) :: tl_grad
95
96# include "set_bounds.h"
97
98
99
100
101
102 IF (first_2d_step) THEN
103 know=krhs
106 know=krhs
108 ELSE
109 know=kstp
111 END IF
112
113
114
115
116
117 IF (
domain(ng)%Western_Edge(tile))
THEN
118
119
120
122 IF (
iic(ng).ne.0)
THEN
123 DO j=jstr,jend+1
124
125
126
127 tl_grad(istr-1,j)=0.0_r8
128 END DO
129 DO j=jstr,jend
131# if defined CELERITY_READ && defined FORWARD_READ
133 IF (
boundary(ng)%zeta_west_Cx(j).eq.0.0_r8)
THEN
135 ELSE
137 END IF
138 tau=tau*dt2d
139 END IF
141# ifdef RADIATION_2D
143# else
144 ce=0.0_r8
145# endif
147# endif
148
149
150
151
152
153
154 tl_zeta(istr-1,j,kout)=(cff*tl_zeta(istr-1,j,know)+ &
155 & cx *tl_zeta(istr ,j,kout)- &
156 & max(ce,0.0_r8)* &
157 & tl_grad(istr-1,j )- &
158 & min(ce,0.0_r8)* &
159 & tl_grad(istr-1,j+1))/ &
160 & (cff+cx)
161
163
164
165
166
167 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)- &
168 & tau*tl_zeta(istr-1,j,know)
169 END IF
170# ifdef MASKING
171
172
173
174 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)* &
175 &
grid(ng)%rmask(istr-1,j)
176# endif
177 END IF
178 END DO
179 END IF
180
181
182
184 DO j=jstr,jend
186 cff=dt2d*
grid(ng)%pm(istr,j)
187 cff1=sqrt(
g*(
grid(ng)%h(istr,j)+ &
188 & zeta(istr,j,know)))
189 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(istr,j)+ &
190 & tl_zeta(istr,j,know))/cff1+ &
191# ifdef TL_IOMS
192 & 0.5_r8*cff1
193# endif
194 cx=cff*cff1
195 tl_cx=cff*tl_cff1
196
197
198
199 tl_zeta(istr-1,j,kout)=(1.0_r8-cx)*tl_zeta(istr-1,j,know)+&
200 & tl_cx*(zeta(istr-1,j,know)+ &
201 & zeta(istr ,j,know))+ &
202 & cx*tl_zeta(istr,j,know)
203# ifdef TL_IOMS
204
205# endif
206# ifdef MASKING
207
208
209
210 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)* &
211 &
grid(ng)%rmask(istr-1,j)
212# endif
213 END IF
214 END DO
215
216
217
219 DO j=jstr,jend
221 cff=dt2d*
grid(ng)%pm(istr,j)
222 cff1=sqrt(
g*(
grid(ng)%h(istr,j)+ &
223 & zeta(istr,j,know)))
224 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(istr,j)+ &
225 & tl_zeta(istr,j,know))/cff1+ &
226# ifdef TL_IOMS
227 & 0.5_r8*cff1
228# endif
229 cx=cff*cff1
230 tl_cx=cff*tl_cff1
231 cff2=1.0_r8/(1.0_r8+cx)
232 tl_cff2=-cff2*cff2*tl_cx+ &
233# ifdef TL_IOMS
234 & cff2*cff2*(1.0_r8+2.0_r8*cx)
235# endif
236
237
238
239 tl_zeta(istr-1,j,kout)=tl_cff2*(zeta(istr-1,j,know)+ &
240 & cx*zeta(istr,j,kout))+ &
241 & cff2*(tl_zeta(istr-1,j,know)+ &
242 & tl_cx*zeta(istr,j,kout)+ &
243 & cx*tl_zeta(istr,j,kout))- &
244# ifdef TL_IOMS
245 & cff2*(zeta(istr-1,j,know)+ &
246 & 2.0_r8*cx*zeta(istr,j,kout))
247# endif
248# ifdef MASKING
249
250
251
252 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)* &
253 &
grid(ng)%rmask(istr-1,j)
254# endif
255 END IF
256 END DO
257
258
259
261 DO j=jstr,jend
263
264
265 tl_zeta(istr-1,j,kout)=
boundary(ng)%tl_zeta_west(j)
266# ifdef MASKING
267
268
269
270 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)* &
271 &
grid(ng)%rmask(istr-1,j)
272# endif
273 END IF
274 END DO
275
276
277
279 DO j=jstr,jend
281
282
283 tl_zeta(istr-1,j,kout)=tl_zeta(istr,j,kout)
284# ifdef MASKING
285
286
287
288 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)* &
289 &
grid(ng)%rmask(istr-1,j)
290# endif
291 END IF
292 END DO
293
294
295
297 DO j=jstr,jend
299
300
301 tl_zeta(istr-1,j,kout)=tl_zeta(istr,j,kout)
302# ifdef MASKING
303
304
305
306 tl_zeta(istr-1,j,kout)=tl_zeta(istr-1,j,kout)* &
307 &
grid(ng)%rmask(istr-1,j)
308# endif
309 END IF
310 END DO
311 END IF
312 END IF
313
314
315
316
317
318 IF (
domain(ng)%Eastern_Edge(tile))
THEN
319
320
321
323 IF (
iic(ng).ne.0)
THEN
324 DO j=jstr,jend+1
325
326
327
328 tl_grad(iend+1,j)=0.0_r8
329 END DO
330 DO j=jstr,jend
332# if defined CELERITY_READ && defined FORWARD_READ
334 IF (
boundary(ng)%zeta_east_Cx(j).eq.0.0_r8)
THEN
336 ELSE
338 END IF
339 tau=tau*dt2d
340 END IF
342# ifdef RADIATION_2D
344# else
345 ce=0.0_r8
346# endif
348# endif
349
350
351
352
353
354
355 tl_zeta(iend+1,j,kout)=(cff*tl_zeta(iend+1,j,know)+ &
356 & cx *tl_zeta(iend ,j,kout)- &
357 & max(ce,0.0_r8)* &
358 & tl_grad(iend+1,j )- &
359 & min(ce,0.0_r8)* &
360 & tl_grad(iend+1,j+1))/ &
361 & (cff+cx)
362
364
365
366
367
368 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)- &
369 & tau*tl_zeta(iend+1,j,know)
370 END IF
371# ifdef MASKING
372
373
374
375 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)* &
376 &
grid(ng)%rmask(iend+1,j)
377# endif
378 END IF
379 END DO
380 END IF
381
382
383
385 DO j=jstr,jend
387 cff=dt2d*
grid(ng)%pm(iend,j)
388 cff1=sqrt(
g*(
grid(ng)%h(iend,j)+ &
389 & zeta(iend,j,know)))
390 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(iend,j)+ &
391 & tl_zeta(iend,j,know))/cff1+ &
392# ifdef TL_IOMS
393 & 0.5_r8*cff1
394# endif
395 cx=cff*cff1
396 tl_cx=cff*tl_cff1
397
398
399
400 tl_zeta(iend+1,j,kout)=(1.0_r8-cx)*tl_zeta(iend+1,j,know)+&
401 & tl_cx*(zeta(iend+1,j,know)+ &
402 & zeta(iend ,j,know))+ &
403 & cx*tl_zeta(iend,j,know)
404# ifdef TL_IOMS
405
406# endif
407# ifdef MASKING
408
409
410
411 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)* &
412 &
grid(ng)%rmask(iend+1,j)
413# endif
414 END IF
415 END DO
416
417
418
420 DO j=jstr,jend
422 cff=dt2d*
grid(ng)%pm(iend,j)
423 cff1=sqrt(
g*(
grid(ng)%h(iend,j)+ &
424 & zeta(iend,j,know)))
425 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(iend,j)+ &
426 & tl_zeta(iend,j,know))/cff1+ &
427# ifdef TL_IOMS
428 & 0.5_r8*cff1
429# endif
430 cx=cff*cff1
431 tl_cx=cff*tl_cff1
432 cff2=1.0_r8/(1.0_r8+cx)
433 tl_cff2=-cff2*cff2*tl_cx+ &
434# ifdef TL_IOMS
435 & cff2*cff2*(1.0_r8+2.0_r8*cx)
436# endif
437
438
439
440 tl_zeta(iend+1,j,kout)=tl_cff2*(zeta(iend+1,j,know)+ &
441 & cx*zeta(iend,j,kout))+ &
442 & cff2*(tl_zeta(iend+1,j,know)+ &
443 & tl_cx*zeta(iend,j,kout)+ &
444 & cx*tl_zeta(iend,j,kout))- &
445# ifdef TL_IOMS
446 & cff2*(zeta(iend+1,j,know)+ &
447 & 2.0_r8*cx*zeta(iend,j,kout))
448# endif
449# ifdef MASKING
450
451
452
453 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)* &
454 &
grid(ng)%rmask(iend+1,j)
455# endif
456 END IF
457 END DO
458
459
460
462 DO j=jstr,jend
464
465
466 tl_zeta(iend+1,j,kout)=
boundary(ng)%tl_zeta_east(j)
467# ifdef MASKING
468
469
470
471 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)* &
472 &
grid(ng)%rmask(iend+1,j)
473# endif
474 END IF
475 END DO
476
477
478
480 DO j=jstr,jend
482
483
484 tl_zeta(iend+1,j,kout)=tl_zeta(iend,j,kout)
485# ifdef MASKING
486
487
488
489 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)* &
490 &
grid(ng)%rmask(iend+1,j)
491# endif
492 END IF
493 END DO
494
495
496
498 DO j=jstr,jend
500
501
502 tl_zeta(iend+1,j,kout)=tl_zeta(iend,j,kout)
503# ifdef MASKING
504
505
506
507 tl_zeta(iend+1,j,kout)=tl_zeta(iend+1,j,kout)* &
508 &
grid(ng)%rmask(iend+1,j)
509# endif
510 END IF
511 END DO
512 END IF
513 END IF
514
515
516
517
518
519 IF (
domain(ng)%Southern_Edge(tile))
THEN
520
521
522
524 IF (
iic(ng).ne.0)
THEN
525 DO i=istr,iend+1
526
527
528
529 tl_grad(i,jstr)=0.0_r8
530 END DO
531 DO i=istr,iend
533# if defined CELERITY_READ && defined FORWARD_READ
535 IF (
boundary(ng)%zeta_south_Ce(i).eq.0.0_r8)
THEN
537 ELSE
539 END IF
540 tau=tau*dt2d
541 END IF
542# ifdef RADIATION_2D
544# else
545 cx=0.0_r8
546# endif
549# endif
550
551
552
553
554
555
556 tl_zeta(i,jstr-1,kout)=(cff*tl_zeta(i,jstr-1,know)+ &
557 & ce *tl_zeta(i,jstr ,kout)- &
558 & max(cx,0.0_r8)* &
559 & tl_grad(i ,jstr-1)- &
560 & min(cx,0.0_r8)* &
561 & tl_grad(i+1,jstr-1))/ &
562 & (cff+ce)
563
565
566
567
568
569 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)- &
570 & tau*tl_zeta(i,jstr-1,know)
571 END IF
572# ifdef MASKING
573
574
575
576 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)* &
577 &
grid(ng)%rmask(i,jstr-1)
578# endif
579 END IF
580 END DO
581 END IF
582
583
584
586 DO i=istr,iend
588 cff=dt2d*
grid(ng)%pn(i,jstr)
589 cff1=sqrt(
g*(
grid(ng)%h(i,jstr)+ &
590 & zeta(i,jstr,know)))
591 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(i,jstr)+ &
592 & tl_zeta(i,jstr,know))/cff1+ &
593# ifdef TL_IOMS
594 & 0.5_r8*cff1
595# endif
596 ce=cff*cff1
597 tl_ce=cff*tl_cff1
598
599
600
601 tl_zeta(i,jstr-1,kout)=(1.0_r8-ce)*tl_zeta(i,jstr-1,know)+&
602 & tl_ce*(zeta(i,jstr-1,know)+ &
603 & zeta(i,jstr ,know))+ &
604 & ce*tl_zeta(i,jstr,know)
605# ifdef TL_IOMS
606
607# endif
608# ifdef MASKING
609
610
611
612 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)* &
613 &
grid(ng)%rmask(i,jstr-1)
614# endif
615 END IF
616 END DO
617
618
619
621 DO i=istr,iend
623 cff=dt2d*
grid(ng)%pn(i,jstr)
624 cff1=sqrt(
g*(
grid(ng)%h(i,jstr)+ &
625 & zeta(i,jstr,know)))
626 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(i,jstr)+ &
627 & tl_zeta(i,jstr,know))/cff1+ &
628# ifdef TL_IOMS
629 & 0.5_r8*cff1
630# endif
631 ce=cff*cff1
632 tl_ce=cff*tl_cff1
633 cff2=1.0_r8/(1.0_r8+ce)
634 tl_cff2=-cff2*cff2*tl_ce+ &
635# ifdef TL_IOMS
636 & cff2*cff2*(1.0_r8+2.0_r8*ce)
637# endif
638
639
640
641 tl_zeta(i,jstr-1,kout)=tl_cff2*(zeta(i,jstr-1,know)+ &
642 & ce*zeta(i,jstr,kout))+ &
643 & cff2*(tl_zeta(i,jstr-1,know)+ &
644 & tl_ce*zeta(i,jstr,kout)+ &
645 & ce*tl_zeta(i,jstr,kout))- &
646# ifdef TL_IOMS
647 & cff2*(zeta(i,jstr-1,know)+ &
648 & 2.0_r8*ce*zeta(i,jstr,kout))
649# endif
650# ifdef MASKING
651
652
653
654 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)* &
655 &
grid(ng)%rmask(i,jstr-1)
656# endif
657 END IF
658 END DO
659
660
661
663 DO i=istr,iend
665
666
667 tl_zeta(i,jstr-1,kout)=
boundary(ng)%tl_zeta_south(i)
668# ifdef MASKING
669
670
671
672 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)* &
673 &
grid(ng)%rmask(i,jstr-1)
674# endif
675 END IF
676 END DO
677
678
679
681 DO i=istr,iend
683
684
685 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr,kout)
686# ifdef MASKING
687
688
689
690 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)* &
691 &
grid(ng)%rmask(i,jstr-1)
692# endif
693 END IF
694 END DO
695
696
697
699 DO i=istr,iend
701
702
703 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr,kout)
704# ifdef MASKING
705
706
707
708 tl_zeta(i,jstr-1,kout)=tl_zeta(i,jstr-1,kout)* &
709 &
grid(ng)%rmask(i,jstr-1)
710# endif
711 END IF
712 END DO
713 END IF
714 END IF
715
716
717
718
719
720 IF (
domain(ng)%Northern_Edge(tile))
THEN
721
722
723
725 IF (
iic(ng).ne.0)
THEN
726 DO i=istr,iend+1
727
728
729
730 tl_grad(i,jend+1)=0.0_r8
731 END DO
732 DO i=istr,iend
734# if defined CELERITY_READ && defined FORWARD_READ
736 IF (
boundary(ng)%zeta_north_Ce(i).eq.0.0_r8)
THEN
738 ELSE
740 END IF
741 tau=tau*dt2d
742 END IF
743# ifdef RADIATION_2D
745# else
746 cx=0.0_r8
747# endif
750# endif
751
752
753
754
755
756
757 tl_zeta(i,jend+1,kout)=(cff*tl_zeta(i,jend+1,know)+ &
758 & ce *tl_zeta(i,jend ,kout)- &
759 & max(cx,0.0_r8)* &
760 & tl_grad(i ,jend+1)- &
761 & min(cx,0.0_r8)* &
762 & tl_grad(i+1,jend+1))/ &
763 & (cff+ce)
764
766
767
768
769
770 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)- &
771 & tau*tl_zeta(i,jend+1,know)
772 END IF
773# ifdef MASKING
774
775
776
777 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)* &
778 &
grid(ng)%rmask(i,jend+1)
779# endif
780 END IF
781 END DO
782 END IF
783
784
785
787 DO i=istr,iend
789 cff=dt2d*
grid(ng)%pn(i,jend)
790 cff1=sqrt(
g*(
grid(ng)%h(i,jend)+ &
791 & zeta(i,jend,know)))
792 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(i,jend)+ &
793 & tl_zeta(i,jend,know))/cff1+ &
794# ifdef TL_IOMS
795 & 0.5_r8*cff1
796# endif
797 ce=cff*cff1
798 tl_ce=cff*tl_cff1
799
800
801
802 tl_zeta(i,jend+1,kout)=(1.0_r8-ce)*tl_zeta(i,jend+1,know)+&
803 & tl_ce*(zeta(i,jend+1,know)+ &
804 & zeta(i,jend ,know))+ &
805 & ce*tl_zeta(i,jend,know)
806# ifdef TL_IOMS
807
808# endif
809# ifdef MASKING
810
811
812
813 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)* &
814 &
grid(ng)%rmask(i,jend+1)
815# endif
816 END IF
817 END DO
818
819
820
822 DO i=istr,iend
824 cff=dt2d*
grid(ng)%pn(i,jend)
825 cff1=sqrt(
g*(
grid(ng)%h(i,jend)+ &
826 & zeta(i,jend,know)))
827 tl_cff1=0.5_r8*
g*(
grid(ng)%tl_h(i,jend)+ &
828 & tl_zeta(i,jend,know))/cff1+ &
829# ifdef TL_IOMS
830 & 0.5_r8*cff1
831# endif
832 ce=cff*cff1
833 tl_ce=cff*tl_cff1
834 cff2=1.0_r8/(1.0_r8+ce)
835 tl_cff2=-cff2*cff2*tl_ce+ &
836# ifdef TL_IOMS
837 & cff2*cff2*(1.0_r8+2.0_r8*ce)
838# endif
839
840
841
842 tl_zeta(i,jend+1,kout)=tl_cff2*(zeta(i,jend+1,know)+ &
843 & ce*zeta(i,jend,kout))+ &
844 & cff2*(tl_zeta(i,jend+1,know)+ &
845 & tl_ce*zeta(i,jend,kout)+ &
846 & ce*tl_zeta(i,jend,kout))- &
847# ifdef TL_IOMS
848 & cff2*(zeta(i,jend+1,know)+ &
849 & 2.0_r8*ce*zeta(i,jend,kout))
850# endif
851# ifdef MASKING
852
853
854
855 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)* &
856 &
grid(ng)%rmask(i,jend+1)
857# endif
858 END IF
859 END DO
860
861
862
864 DO i=istr,iend
866
867
868 tl_zeta(i,jend+1,kout)=
boundary(ng)%tl_zeta_north(i)
869# ifdef MASKING
870
871
872
873 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)* &
874 &
grid(ng)%rmask(i,jend+1)
875# endif
876 END IF
877 END DO
878
879
880
882 DO i=istr,iend
884
885
886 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend,kout)
887# ifdef MASKING
888
889
890
891 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)* &
892 &
grid(ng)%rmask(i,jend+1)
893# endif
894 END IF
895 END DO
896
897
898
900 DO i=istr,iend
902
903
904 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend,kout)
905# ifdef MASKING
906
907
908
909 tl_zeta(i,jend+1,kout)=tl_zeta(i,jend+1,kout)* &
910 &
grid(ng)%rmask(i,jend+1)
911# endif
912 END IF
913 END DO
914 END IF
915 END IF
916
917
918
919
920
922 IF (
domain(ng)%SouthWest_Corner(tile))
THEN
925
926
927
928 tl_zeta(istr-1,jstr-1,kout)=0.5_r8* &
929 & (tl_zeta(istr ,jstr-1,kout)+ &
930 & tl_zeta(istr-1,jstr ,kout))
931 END IF
932 END IF
933 IF (
domain(ng)%SouthEast_Corner(tile))
THEN
936
937
938
939 tl_zeta(iend+1,jstr-1,kout)=0.5_r8* &
940 & (tl_zeta(iend ,jstr-1,kout)+ &
941 & tl_zeta(iend+1,jstr ,kout))
942 END IF
943 END IF
944 IF (
domain(ng)%NorthWest_Corner(tile))
THEN
947
948
949
950 tl_zeta(istr-1,jend+1,kout)=0.5_r8* &
951 & (tl_zeta(istr-1,jend ,kout)+ &
952 & tl_zeta(istr ,jend+1,kout))
953 END IF
954 END IF
955 IF (
domain(ng)%NorthEast_Corner(tile))
THEN
958
959
960
961 tl_zeta(iend+1,jend+1,kout)=0.5_r8* &
962 & (tl_zeta(iend+1,jend ,kout)+ &
963 & tl_zeta(iend ,jend+1,kout))
964 END IF
965 END IF
966 END IF
967
968# if defined WET_DRY
969
970
971
972
973
976 IF (
domain(ng)%Western_Edge(tile))
THEN
977 DO j=jstr,jend
979 IF (zeta(istr-1,j,kout).le. &
981
982
983 tl_zeta(istr-1,j,kout)=-
grid(ng)%tl_h(istr-1,j)
984 END IF
985 END IF
986 END DO
987 END IF
988 IF (
domain(ng)%Eastern_Edge(tile))
THEN
989 DO j=jstr,jend
991 IF (zeta(iend+1,j,kout).le. &
993
994
995 tl_zeta(iend+1,j,kout)=-
grid(ng)%tl_h(iend+1,j)
996 END IF
997 END IF
998 END DO
999 END IF
1000 END IF
1001
1003 IF (
domain(ng)%Southern_Edge(tile))
THEN
1004 DO i=istr,iend
1006 IF (zeta(i,jstr-1,kout).le. &
1007 & (
dcrit(ng)-
grid(ng)%h(i,jstr-1)))
THEN
1008
1009
1010 tl_zeta(i,jstr-1,kout)=-
grid(ng)%tl_h(i,jstr-1)
1011 END IF
1012 END IF
1013 END DO
1014 END IF
1015 IF (
domain(ng)%Northern_Edge(tile))
THEN
1016 DO i=istr,iend
1018 IF (zeta(i,jend+1,kout).le. &
1019 & (
dcrit(ng)-
grid(ng)%h(i,jend+1)))
THEN
1020
1021
1022 tl_zeta(i,jend+1,kout)=-
grid(ng)%tl_h(i,jend+1)
1023 END IF
1024 END IF
1025 END DO
1026 END IF
1027 END IF
1028
1030 IF (
domain(ng)%SouthWest_Corner(tile))
THEN
1033 IF (zeta(istr-1,jstr-1,kout).le. &
1034 & (
dcrit(ng)-
grid(ng)%h(istr-1,jstr-1)))
THEN
1035
1036
1037 tl_zeta(istr-1,jstr-1,kout)=-
grid(ng)%tl_h(istr-1,jstr-1)
1038 END IF
1039 END IF
1040 END IF
1041 IF (
domain(ng)%SouthEast_Corner(tile))
THEN
1044 IF (zeta(iend+1,jstr-1,kout).le. &
1045 & (
dcrit(ng)-
grid(ng)%h(iend+1,jstr-1)))
THEN
1046
1047
1048 tl_zeta(iend+1,jstr-1,kout)=-
grid(ng)%tl_h(iend+1,jstr-1)
1049 END IF
1050 END IF
1051 END IF
1052 IF (
domain(ng)%NorthWest_Corner(tile))
THEN
1055 IF (zeta(istr-1,jend+1,kout).le. &
1056 & (
dcrit(ng)-
grid(ng)%h(istr-1,jend+1)))
THEN
1057
1058
1059 tl_zeta(istr-1,jend+1,kout)=-
grid(ng)%tl_h(istr-1,jend+1)
1060 END IF
1061 END IF
1062 END IF
1063 IF (
domain(ng)%NorthEast_Corner(tile))
THEN
1066 IF (zeta(iend+1,jend+1,kout).le. &
1067 & (
dcrit(ng)-
grid(ng)%h(iend+1,jend+1)))
THEN
1068
1069
1070 tl_zeta(iend+1,jend+1,kout)=-
grid(ng)%tl_h(iend+1,jend+1)
1071 END IF
1072 END IF
1073 END IF
1074 END IF
1075# endif
1076
1077 RETURN
type(t_boundary), dimension(:), allocatable boundary
type(t_apply), dimension(:), allocatable lbc_apply
type(t_grid), dimension(:), allocatable grid
type(t_lbc), dimension(:,:,:), allocatable tl_lbc
type(t_domain), dimension(:), allocatable domain
integer, dimension(:), allocatable iic
real(r8), dimension(:), allocatable dcrit
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
logical, dimension(:), allocatable predictor_2d_step
real(dp), dimension(:,:), allocatable fsobc_out
integer, parameter isouth
real(dp), dimension(:), allocatable dtfast
integer, parameter inorth
real(dp), dimension(:,:), allocatable fsobc_in