source: LMDZ5/trunk/libf/phylmd/moyglo_aire.F @ 1907

Last change on this file since 1907 was 1907, checked in by lguez, 10 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

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