1 | #if defined DIM_2d |
---|
2 | # define XD 2d |
---|
3 | # define DIMS :,: |
---|
4 | # define ISZ3 1 |
---|
5 | # define ISZ4 1 |
---|
6 | #endif |
---|
7 | #if defined DIM_3d |
---|
8 | # define XD 3d |
---|
9 | # define DIMS :,:,: |
---|
10 | # define ISZ3 SIZE(ptab, dim=3) |
---|
11 | # define ISZ4 1 |
---|
12 | #endif |
---|
13 | #if defined DIM_4d |
---|
14 | # define XD 4d |
---|
15 | # define DIMS :,:,:,: |
---|
16 | # define ISZ3 SIZE(ptab, dim=3) |
---|
17 | # define ISZ4 SIZE(ptab, dim=4) |
---|
18 | #endif |
---|
19 | |
---|
20 | SUBROUTINE lbc_lnk_call_/**/XD/**/_/**/PRECISION( & |
---|
21 | & cdname & |
---|
22 | & , pt1 , cdna1 , psgn1 , pt2 , cdna2 , psgn2 , pt3 , cdna3 , psgn3 , pt4 , cdna4 , psgn4 & |
---|
23 | & , pt5 , cdna5 , psgn5 , pt6 , cdna6 , psgn6 , pt7 , cdna7 , psgn7 , pt8 , cdna8 , psgn8 & |
---|
24 | & , pt9 , cdna9 , psgn9 , pt10, cdna10, psgn10, pt11, cdna11, psgn11, pt12, cdna12, psgn12 & |
---|
25 | & , pt13, cdna13, psgn13, pt14, cdna14, psgn14, pt15, cdna15, psgn15, pt16, cdna16, psgn16 & |
---|
26 | & , kfillmode, pfillval, khls, lsend, lrecv, ncsten ) |
---|
27 | !!--------------------------------------------------------------------- |
---|
28 | CHARACTER(len=*) , INTENT(in ) :: cdname ! name of the calling subroutine |
---|
29 | REAL(PRECISION), DIMENSION(DIMS) , TARGET, CONTIGUOUS, INTENT(inout) :: pt1 ! arrays on which the lbc is applied |
---|
30 | REAL(PRECISION), DIMENSION(DIMS), OPTIONAL, TARGET, CONTIGUOUS, INTENT(inout) :: pt2 , pt3 , pt4 , pt5 , pt6 , pt7 , pt8 , pt9, & |
---|
31 | & pt10, pt11, pt12, pt13, pt14, pt15, pt16 |
---|
32 | CHARACTER(len=1) , INTENT(in ) :: cdna1 ! nature of pt2D. array grid-points |
---|
33 | CHARACTER(len=1) , OPTIONAL , INTENT(in ) :: cdna2 , cdna3 , cdna4 , cdna5 , cdna6 , cdna7 , cdna8 , cdna9, & |
---|
34 | & cdna10, cdna11, cdna12, cdna13, cdna14, cdna15, cdna16 |
---|
35 | REAL(PRECISION) , INTENT(in ) :: psgn1 ! sign used across the north fold |
---|
36 | REAL(PRECISION) , OPTIONAL , INTENT(in ) :: psgn2 , psgn3 , psgn4 , psgn5 , psgn6 , psgn7 , psgn8 , psgn9, & |
---|
37 | & psgn10, psgn11, psgn12, psgn13, psgn14, psgn15, psgn16 |
---|
38 | INTEGER , OPTIONAL , INTENT(in ) :: kfillmode ! filling method for halo over land (default = constant) |
---|
39 | REAL(PRECISION) , OPTIONAL , INTENT(in ) :: pfillval ! background value (used at closed boundaries) |
---|
40 | INTEGER , OPTIONAL , INTENT(in ) :: khls ! halo size, default = nn_hls |
---|
41 | LOGICAL, DIMENSION(4), OPTIONAL , INTENT(in ) :: lsend, lrecv ! indicate how communications are to be carried out |
---|
42 | LOGICAL , OPTIONAL , INTENT(in ) :: ncsten |
---|
43 | !! |
---|
44 | INTEGER :: kfld ! number of elements that will be attributed |
---|
45 | TYPE(PTR_4d_/**/PRECISION), DIMENSION(16) :: ptab_ptr ! pointer array |
---|
46 | CHARACTER(len=1) , DIMENSION(16) :: cdna_ptr ! nature of ptab_ptr grid-points |
---|
47 | REAL(PRECISION) , DIMENSION(16) :: psgn_ptr ! sign used across the north fold boundary |
---|
48 | !!--------------------------------------------------------------------- |
---|
49 | ! |
---|
50 | kfld = 0 ! initial array of pointer size |
---|
51 | ! |
---|
52 | ! ! Load the first array |
---|
53 | CALL load_ptr_/**/XD/**/_/**/PRECISION( pt1, cdna1, psgn1, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
54 | ! |
---|
55 | ! ! Look if more arrays are added |
---|
56 | IF( PRESENT(psgn2 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt2 , cdna2 , psgn2 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
57 | IF( PRESENT(psgn3 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt3 , cdna3 , psgn3 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
58 | IF( PRESENT(psgn4 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt4 , cdna4 , psgn4 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
59 | IF( PRESENT(psgn5 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt5 , cdna5 , psgn5 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
60 | IF( PRESENT(psgn6 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt6 , cdna6 , psgn6 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
61 | IF( PRESENT(psgn7 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt7 , cdna7 , psgn7 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
62 | IF( PRESENT(psgn8 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt8 , cdna8 , psgn8 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
63 | IF( PRESENT(psgn9 ) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt9 , cdna9 , psgn9 , ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
64 | IF( PRESENT(psgn10) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt10, cdna10, psgn10, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
65 | IF( PRESENT(psgn11) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt11, cdna11, psgn11, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
66 | IF( PRESENT(psgn12) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt12, cdna12, psgn12, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
67 | IF( PRESENT(psgn13) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt13, cdna13, psgn13, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
68 | IF( PRESENT(psgn14) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt14, cdna14, psgn14, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
69 | IF( PRESENT(psgn15) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt15, cdna15, psgn15, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
70 | IF( PRESENT(psgn16) ) CALL load_ptr_/**/XD/**/_/**/PRECISION( pt16, cdna16, psgn16, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
71 | ! |
---|
72 | IF( nn_comm == 1 ) THEN |
---|
73 | CALL lbc_lnk_pt2pt( cdname, ptab_ptr, cdna_ptr, psgn_ptr, kfld, kfillmode, pfillval, khls, lsend, lrecv ) |
---|
74 | ELSE |
---|
75 | CALL lbc_lnk_neicoll( cdname, ptab_ptr, cdna_ptr, psgn_ptr, kfld, kfillmode, pfillval, khls, lsend, lrecv, ncsten ) |
---|
76 | ENDIF |
---|
77 | ! |
---|
78 | END SUBROUTINE lbc_lnk_call_/**/XD/**/_/**/PRECISION |
---|
79 | |
---|
80 | |
---|
81 | SUBROUTINE load_ptr_/**/XD/**/_/**/PRECISION( ptab, cdna, psgn, ptab_ptr, cdna_ptr, psgn_ptr, kfld ) |
---|
82 | !!--------------------------------------------------------------------- |
---|
83 | REAL(PRECISION), DIMENSION(DIMS), TARGET, INTENT(inout), CONTIGUOUS :: ptab ! arrays on which the lbc is applied |
---|
84 | CHARACTER(len=1) , INTENT(in ) :: cdna ! nature of pt2d array grid-points |
---|
85 | REAL(PRECISION) , INTENT(in ) :: psgn ! sign used across the north fold boundary |
---|
86 | TYPE(PTR_4d_/**/PRECISION), DIMENSION(:), INTENT(inout) :: ptab_ptr ! array of pointers |
---|
87 | CHARACTER(len=1), DIMENSION(:), INTENT(inout) :: cdna_ptr ! nature of pt2d_array array grid-points |
---|
88 | REAL(PRECISION) , DIMENSION(:), INTENT(inout) :: psgn_ptr ! sign used across the north fold boundary |
---|
89 | INTEGER , INTENT(inout) :: kfld ! number of elements that has been attributed |
---|
90 | !!--------------------------------------------------------------------- |
---|
91 | ! |
---|
92 | kfld = kfld + 1 |
---|
93 | ptab_ptr(kfld)%pt4d(1:SIZE(ptab, dim=1),1:SIZE(ptab, dim=2),1:ISZ3,1:ISZ4) => ptab |
---|
94 | cdna_ptr(kfld) = cdna |
---|
95 | psgn_ptr(kfld) = psgn |
---|
96 | ! |
---|
97 | END SUBROUTINE load_ptr_/**/XD/**/_/**/PRECISION |
---|
98 | |
---|
99 | #undef XD |
---|
100 | #undef DIMS |
---|
101 | #undef ISZ3 |
---|
102 | #undef ISZ4 |
---|