source: LMDZ4/tags/LMDZ4_V2/libf/phylmd/moyglo_aire.F @ 741

Last change on this file since 741 was 741, checked in by (none), 17 years ago

This commit was manufactured by cvs2svn to create tag 'LMDZ4_V2'.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1      SUBROUTINE moyglo_pondaire(nhori, champ, aire,
2     .            ok_msk, msk, moyglo)
3c
4       IMPLICIT none
5c
6c ==================================================================
7c I. Musat, 07.2004
8c
9c Calcul moyenne globale ponderee par l'aire totale, avec ou sans masque
10c
11c moyenne = Somme_(champ* aire)/Somme_aire
12c
13c ==================================================================
14c
15#include "dimensions.h"
16#include "dimphy.h"
17       INTEGER i, nhori
18       REAL champ(klon), aire(klon), msk(klon)
19       LOGICAL ok_msk
20       REAL moyglo
21c
22c var locale
23       REAL airetot
24c
25c      PRINT*,'moyglo_pondaire nhori',nhori
26c
27       airetot=0.
28       moyglo=0.
29c
30       IF(ok_msk) THEN
31        DO i=1, nhori
32c        IF(msk(i).EQ.1.) THEN
33         IF(msk(i).GT.0.) THEN
34c
35c aire totale
36          airetot=airetot+aire(i)*msk(i)
37c
38c ponderation par la masse
39          moyglo=moyglo+champ(i)* aire(i)*msk(i)
40         ENDIF
41        ENDDO
42c
43       ELSE !ok_msk
44        DO i=1, nhori
45c
46c aire totale
47          airetot=airetot+aire(i)
48c
49c ponderation par la masse
50          moyglo=moyglo+champ(i)* aire(i)
51        ENDDO
52c
53       ENDIF
54c
55c moyenne ponderee par l'aire
56       moyglo=moyglo/airetot
57c
58       RETURN
59       END
60c
61       SUBROUTINE moyglo_pondaima(nhori, nvert, champ,
62     . aire, pbord, moyglo)
63       IMPLICIT none
64c ==================================================================
65c I. Musat, 07.2004
66c
67c Calcul moyenne globale ponderee par la masse d'air, divisee par l'aire
68c totale avec ou sans masque
69c
70c moyenne = Somme_(champ* masse_dair)/Somme_aire
71c
72c ==================================================================
73#include "dimensions.h"
74#include "dimphy.h"
75#include "YOMCST.h"
76       INTEGER i, k, nhori, nvert
77       REAL champ(klon,klev), aire(klon)
78       REAL pbord(klon,klev+1)
79       REAL moyglo
80c
81c var locale
82       REAL airetot
83c
84c      PRINT*,'moyglo_pondaima RG, nhori, nvert',RG,nhori,nvert
85c
86c ponderation par la masse
87       moyglo=0.
88       DO k=1, nvert
89       DO i=1, nhori
90        moyglo=moyglo+
91     .  champ(i,k)*(pbord(i,k)-pbord(i,k+1))/RG*aire(i)
92       ENDDO
93       ENDDO
94c
95c aire totale
96       airetot=0.
97       DO i=1, nhori
98        airetot=airetot+aire(i)
99       ENDDO
100c
101c moyenne par mettre carre avec ponderation par la masse
102       moyglo=moyglo/airetot
103c
104      RETURN
105      END
106c
107       SUBROUTINE moyglo_pondmass(nhori, nvert, champ,
108     . aire, pbord, moyglo)
109       IMPLICIT none
110c ==================================================================
111c I. Musat, 07.2004
112c
113c Calcul moyenne globale ponderee par la masse d'air, divisee par la
114c masse totale d'air, avec ou sans masque
115c
116c moyenne = Somme_(champ* masse_dair)/Somme_(masse_dair)
117c
118c ==================================================================
119#include "dimensions.h"
120#include "dimphy.h"
121#include "YOMCST.h"
122       INTEGER i, k, nhori, nvert
123       REAL champ(klon,klev), aire(klon)
124       REAL pbord(klon,klev+1)
125       REAL moyglo
126c
127c var locale
128       REAL massetot
129c
130c      PRINT*,'moyglo_pondmass RG, nhori, nvert',RG,nhori,nvert
131c
132c ponderation par la masse
133       moyglo=0.
134       DO k=1, nvert
135       DO i=1, nhori
136        moyglo=moyglo+
137     .  champ(i,k)*(pbord(i,k)-pbord(i,k+1))/RG*aire(i)
138       ENDDO
139       ENDDO
140c
141c masse totale
142       massetot=0.
143       DO k=1, nvert
144       DO i=1, nhori
145        massetot=massetot+
146     .  (pbord(i,k)-pbord(i,k+1))/RG*aire(i)
147       ENDDO
148       ENDDO
149c
150c moyenne par mettre carre avec ponderation par la masse
151       moyglo=moyglo/massetot
152c
153      RETURN
154      END
155c
Note: See TracBrowser for help on using the repository browser.