| 1 | ! |
|---|
| 2 | ! $Header$ |
|---|
| 3 | ! |
|---|
| 4 | SUBROUTINE moyglo_pondaire(nhori, champ, aire, & |
|---|
| 5 | & ok_msk, msk, moyglo) |
|---|
| 6 | !c |
|---|
| 7 | USE dimphy |
|---|
| 8 | IMPLICIT none |
|---|
| 9 | !c |
|---|
| 10 | !c ================================================================== |
|---|
| 11 | !c I. Musat, 07.2004 |
|---|
| 12 | !c |
|---|
| 13 | !c Calcul moyenne globale ponderee par l'aire totale, avec ou sans masque |
|---|
| 14 | !c |
|---|
| 15 | !c moyenne = Somme_(champ* aire)/Somme_aire |
|---|
| 16 | !c |
|---|
| 17 | !c ================================================================== |
|---|
| 18 | !c |
|---|
| 19 | #include "dimensions.h" |
|---|
| 20 | !cym#include "dimphy.h" |
|---|
| 21 | INTEGER i, nhori |
|---|
| 22 | REAL champ(klon), aire(klon), msk(klon) |
|---|
| 23 | LOGICAL ok_msk |
|---|
| 24 | REAL moyglo |
|---|
| 25 | !c |
|---|
| 26 | !c var locale |
|---|
| 27 | REAL airetot |
|---|
| 28 | !c |
|---|
| 29 | !c PRINT*,'moyglo_pondaire nhori',nhori |
|---|
| 30 | !c |
|---|
| 31 | airetot=0. |
|---|
| 32 | moyglo=0. |
|---|
| 33 | !c |
|---|
| 34 | IF(ok_msk) THEN |
|---|
| 35 | DO i=1, nhori |
|---|
| 36 | !c IF(msk(i).EQ.1.) THEN |
|---|
| 37 | IF(msk(i).GT.0.) THEN |
|---|
| 38 | !c |
|---|
| 39 | !c aire totale |
|---|
| 40 | airetot=airetot+aire(i)*msk(i) |
|---|
| 41 | !c |
|---|
| 42 | !c ponderation par la masse |
|---|
| 43 | moyglo=moyglo+champ(i)* aire(i)*msk(i) |
|---|
| 44 | ENDIF |
|---|
| 45 | ENDDO |
|---|
| 46 | !c |
|---|
| 47 | ELSE !ok_msk |
|---|
| 48 | DO i=1, nhori |
|---|
| 49 | !c |
|---|
| 50 | !c aire totale |
|---|
| 51 | airetot=airetot+aire(i) |
|---|
| 52 | !c |
|---|
| 53 | !c ponderation par la masse |
|---|
| 54 | moyglo=moyglo+champ(i)* aire(i) |
|---|
| 55 | ENDDO |
|---|
| 56 | !c |
|---|
| 57 | ENDIF |
|---|
| 58 | !c |
|---|
| 59 | !c moyenne ponderee par l'aire |
|---|
| 60 | moyglo=moyglo/airetot |
|---|
| 61 | !c |
|---|
| 62 | RETURN |
|---|
| 63 | END |
|---|
| 64 | !c |
|---|
| 65 | SUBROUTINE moyglo_pondaima(nhori, nvert, champ, & |
|---|
| 66 | & aire, pbord, moyglo) |
|---|
| 67 | USE dimphy |
|---|
| 68 | IMPLICIT none |
|---|
| 69 | !c ================================================================== |
|---|
| 70 | !c I. Musat, 07.2004 |
|---|
| 71 | !c |
|---|
| 72 | !c Calcul moyenne globale ponderee par la masse d'air, divisee par l'aire |
|---|
| 73 | !c totale avec ou sans masque |
|---|
| 74 | !c |
|---|
| 75 | !c moyenne = Somme_(champ* masse_dair)/Somme_aire |
|---|
| 76 | !c |
|---|
| 77 | !c ================================================================== |
|---|
| 78 | #include "dimensions.h" |
|---|
| 79 | !cym#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 |
|---|
| 85 | !c |
|---|
| 86 | !c var locale |
|---|
| 87 | REAL airetot |
|---|
| 88 | !c |
|---|
| 89 | !c PRINT*,'moyglo_pondaima RG, nhori, nvert',RG,nhori,nvert |
|---|
| 90 | !c |
|---|
| 91 | !c 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 |
|---|
| 99 | !c |
|---|
| 100 | !c aire totale |
|---|
| 101 | airetot=0. |
|---|
| 102 | DO i=1, nhori |
|---|
| 103 | airetot=airetot+aire(i) |
|---|
| 104 | ENDDO |
|---|
| 105 | !c |
|---|
| 106 | !c moyenne par mettre carre avec ponderation par la masse |
|---|
| 107 | moyglo=moyglo/airetot |
|---|
| 108 | !c |
|---|
| 109 | RETURN |
|---|
| 110 | END |
|---|
| 111 | !c |
|---|
| 112 | SUBROUTINE moyglo_pondmass(nhori, nvert, champ, & |
|---|
| 113 | & aire, pbord, moyglo) |
|---|
| 114 | USE dimphy |
|---|
| 115 | IMPLICIT none |
|---|
| 116 | !c ================================================================== |
|---|
| 117 | !c I. Musat, 07.2004 |
|---|
| 118 | !c |
|---|
| 119 | !c Calcul moyenne globale ponderee par la masse d'air, divisee par la |
|---|
| 120 | !c masse totale d'air, avec ou sans masque |
|---|
| 121 | !c |
|---|
| 122 | !c moyenne = Somme_(champ* masse_dair)/Somme_(masse_dair) |
|---|
| 123 | !c |
|---|
| 124 | !c ================================================================== |
|---|
| 125 | #include "dimensions.h" |
|---|
| 126 | !cym#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 |
|---|
| 132 | !c |
|---|
| 133 | !c var locale |
|---|
| 134 | REAL massetot |
|---|
| 135 | !c |
|---|
| 136 | !c PRINT*,'moyglo_pondmass RG, nhori, nvert',RG,nhori,nvert |
|---|
| 137 | !c |
|---|
| 138 | !c 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 |
|---|
| 146 | !c |
|---|
| 147 | !c 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 |
|---|
| 155 | !c |
|---|
| 156 | !c moyenne par mettre carre avec ponderation par la masse |
|---|
| 157 | moyglo=moyglo/massetot |
|---|
| 158 | !c |
|---|
| 159 | RETURN |
|---|
| 160 | END |
|---|
| 161 | !c |
|---|