/[lmdze]/trunk/Sources/dyn3d/flumass.f
ViewVC logotype

Contents of /trunk/Sources/dyn3d/flumass.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 164 - (show annotations)
Tue Jul 28 14:53:31 2015 UTC (8 years, 9 months ago) by guez
File size: 2979 byte(s)
In procedure inifilr, coefilu2 and coefilv2 were not used. coefilu and
coefilv were defined and used only at filtered latitudes so split them
into north and south arrays. Values in eignvl are necessarily
negative. Simplified the computation of eignft.

1 module flumass_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE flumass(massebx, masseby, vcont, ucont, pbaru, pbarv)
8
9 ! From LMDZ4/libf/dyn3d/flumass.F, version 1.1.1.1 2004/05/19 12:53:06
10
11 ! Auteurs : P. Le Van, F. Hourdin
12 ! Objet: calcul du flux de masse aux niveaux s
13
14 USE comgeom, ONLY: aire, aireu
15 USE dimens_m, ONLY: iim, llm
16 USE paramet_m, ONLY: iip1, iip2, ip1jm, ip1jmi1, ip1jmp1
17
18 REAL, intent(in):: massebx(ip1jmp1, llm), masseby(ip1jm, llm)
19 real, intent(in):: vcont(ip1jm, llm), ucont(ip1jmp1, llm)
20 real, intent(out):: pbaru(ip1jmp1, llm), pbarv(ip1jm, llm)
21
22 ! Local:
23 REAL apbarun(iip1), apbarus(iip1)
24 REAL sairen, saireun, saires, saireus, ctn, cts, ctn0, cts0
25 INTEGER l, ij, i
26
27 !----------------------------------------------------------------
28
29 DO l = 1, llm
30 DO ij = iip2, ip1jm
31 pbaru(ij, l) = massebx(ij, l) * ucont(ij, l)
32 end DO
33
34 DO ij = 1, ip1jm
35 pbarv(ij, l) = masseby(ij, l) * vcont(ij, l)
36 end DO
37 end DO
38
39 ! Calcul de la composante du flux de masse en x aux pôles
40 ! par la résolution d'un système de deux équations
41
42 ! la première équation décrivant le calcul de la divergence en un
43 ! point i du pôle, ce calcul étant itéré de i = 1 à i = im.
44 ! c'est-à-dire,
45
46 ! ((0.5 * pbaru(i) - 0.5 * pbaru(i - 1) - pbarv(i)) / aire(i) =
47 ! - somme de (pbarv(n)) / aire pôle
48
49 ! l'autre équation spécifiant que la moyenne du flux de masse au
50 ! pôle est nulle c'est-à-dire somme de pbaru(n) * aire locale(n) =
51 ! 0.
52
53 ! on en revient ainsi à déterminer la constante additive commune
54 ! aux pbaru qui représentait pbaru(0, j, l) dans l'équation du
55 ! calcul de la divergence au point i=1.
56
57 ! i variant de 1 à im
58 ! n variant de 1 à im
59
60 sairen = SUM(aire(:iim))
61 saireun= SUM(aireu(:iim))
62 saires = SUM(aire(ip1jm + 1: ip1jm + iim))
63 saireus= SUM(aireu(ip1jm + 1: ip1jm + iim))
64
65 DO l = 1, llm
66 ctn = SUM(pbarv(:iim, l))/ sairen
67 cts = SUM(pbarv(ip1jmi1 + 1: ip1jmi1 + iim, l)) / saires
68
69 pbaru(1, l)= pbarv(1, l) - ctn * aire(1)
70 pbaru(ip1jm+1, l)= - pbarv(ip1jmi1+1, l) + cts * aire(ip1jm+1)
71
72 DO i = 2, iim
73 pbaru(i, l) = pbaru(i - 1, l) + &
74 pbarv(i, l) - ctn * aire(i)
75
76 pbaru(i+ ip1jm, l) = pbaru(i+ ip1jm-1, l) - &
77 pbarv(i+ ip1jmi1, l) + cts * aire(i+ ip1jm)
78 end DO
79 DO i = 1, iim
80 apbarun(i) = aireu(i) * pbaru(i, l)
81 apbarus(i) = aireu(i +ip1jm) * pbaru(i +ip1jm, l)
82 end DO
83 ctn0 = - SUM(apbarun(:iim)) / saireun
84 cts0 = - SUM(apbarus(:iim)) / saireus
85 DO i = 1, iim
86 pbaru(i, l) = 2. * (pbaru(i, l) + ctn0)
87 pbaru(i+ ip1jm, l) = 2. * (pbaru(i +ip1jm, l) + cts0)
88 end DO
89
90 pbaru(iip1, l) = pbaru(1, l)
91 pbaru(ip1jmp1, l) = pbaru(ip1jm +1, l)
92 end DO
93
94 END SUBROUTINE flumass
95
96 end module flumass_m

  ViewVC Help
Powered by ViewVC 1.1.21