1 |
guez |
3 |
module gath_cpl |
2 |
|
|
|
3 |
|
|
! From phylmd/interface_surf.F90,v 1.8 2005/05/25 13:10:09 |
4 |
|
|
|
5 |
|
|
implicit none |
6 |
|
|
|
7 |
|
|
contains |
8 |
|
|
|
9 |
|
|
SUBROUTINE gath2cpl(champ_in, champ_out, klon, knon, iim, jjm, knindex) |
10 |
|
|
|
11 |
|
|
! Cette routine ecrit un champ 'gathered' sur la grille 2D pour le passer |
12 |
|
|
! au coupleur. |
13 |
|
|
! |
14 |
|
|
! |
15 |
|
|
! input: |
16 |
|
|
! champ_in champ sur la grille gathere |
17 |
|
|
! knon nombre de points dans le domaine a traiter |
18 |
|
|
! knindex index des points de la surface a traiter |
19 |
|
|
! klon taille de la grille |
20 |
|
|
! iim,jjm dimension de la grille 2D |
21 |
|
|
! |
22 |
|
|
! output: |
23 |
|
|
! champ_out champ sur la grille 2D |
24 |
|
|
! |
25 |
|
|
! input |
26 |
|
|
integer :: klon, knon, iim, jjm |
27 |
|
|
real, dimension(klon) :: champ_in |
28 |
|
|
integer, dimension(klon) :: knindex |
29 |
|
|
! output |
30 |
|
|
real, dimension(iim,jjm+1) :: champ_out |
31 |
|
|
! local |
32 |
|
|
integer :: i, ig, j |
33 |
|
|
real, dimension(klon) :: tamp |
34 |
|
|
|
35 |
|
|
tamp = 0. |
36 |
|
|
do i = 1, knon |
37 |
|
|
ig = knindex(i) |
38 |
|
|
tamp(ig) = champ_in(i) |
39 |
|
|
enddo |
40 |
|
|
ig = 1 |
41 |
|
|
champ_out(:,1) = tamp(ig) |
42 |
|
|
do j = 2, jjm |
43 |
|
|
do i = 1, iim |
44 |
|
|
ig = ig + 1 |
45 |
|
|
champ_out(i,j) = tamp(ig) |
46 |
|
|
enddo |
47 |
|
|
enddo |
48 |
|
|
ig = ig + 1 |
49 |
|
|
champ_out(:,jjm+1) = tamp(ig) |
50 |
|
|
|
51 |
|
|
END SUBROUTINE gath2cpl |
52 |
|
|
|
53 |
|
|
!***************************************************** |
54 |
|
|
|
55 |
|
|
SUBROUTINE cpl2gath(champ_in, champ_out, klon, knon, iim, jjm, knindex) |
56 |
|
|
|
57 |
|
|
! Cette routine ecrit un champ 'gathered' sur la grille 2D pour le passer |
58 |
|
|
! au coupleur. |
59 |
|
|
! |
60 |
|
|
! |
61 |
|
|
! input: |
62 |
|
|
! champ_in champ sur la grille gathere |
63 |
|
|
! knon nombre de points dans le domaine a traiter |
64 |
|
|
! knindex index des points de la surface a traiter |
65 |
|
|
! klon taille de la grille |
66 |
|
|
! iim,jjm dimension de la grille 2D |
67 |
|
|
! |
68 |
|
|
! output: |
69 |
|
|
! champ_out champ sur la grille 2D |
70 |
|
|
! |
71 |
|
|
! input |
72 |
|
|
integer :: klon, knon, iim, jjm |
73 |
|
|
real, dimension(iim,jjm+1) :: champ_in |
74 |
|
|
integer, dimension(klon) :: knindex |
75 |
|
|
! output |
76 |
|
|
real, dimension(klon) :: champ_out |
77 |
|
|
! local |
78 |
|
|
integer :: i, ig, j |
79 |
|
|
real, dimension(klon) :: tamp |
80 |
|
|
|
81 |
|
|
ig = 1 |
82 |
|
|
tamp(ig) = champ_in(1,1) |
83 |
|
|
do j = 2, jjm |
84 |
|
|
do i = 1, iim |
85 |
|
|
ig = ig + 1 |
86 |
|
|
tamp(ig) = champ_in(i,j) |
87 |
|
|
enddo |
88 |
|
|
enddo |
89 |
|
|
ig = ig + 1 |
90 |
|
|
tamp(ig) = champ_in(1,jjm+1) |
91 |
|
|
|
92 |
|
|
do i = 1, knon |
93 |
|
|
ig = knindex(i) |
94 |
|
|
champ_out(i) = tamp(ig) |
95 |
|
|
enddo |
96 |
|
|
|
97 |
|
|
END SUBROUTINE cpl2gath |
98 |
|
|
|
99 |
|
|
end module gath_cpl |