[1191] | 1 | ! |
---|
| 2 | ! $Id $ |
---|
| 3 | ! |
---|
| 4 | SUBROUTINE cvltr(pdtime,da, phi, mp,paprs,pplay,x,upd,dnd,dx) |
---|
| 5 | USE dimphy |
---|
| 6 | IMPLICIT NONE |
---|
| 7 | !===================================================================== |
---|
| 8 | ! Objet : convection des traceurs / KE |
---|
| 9 | ! Auteurs: M-A Filiberti and J-Y Grandpeix |
---|
| 10 | !===================================================================== |
---|
[619] | 11 | |
---|
[1191] | 12 | include "YOMCST.h" |
---|
| 13 | include "YOECUMF.h" |
---|
| 14 | |
---|
| 15 | ! Entree |
---|
| 16 | REAL,INTENT(IN) :: pdtime |
---|
| 17 | REAL,DIMENSION(klon,klev),INTENT(IN) :: da |
---|
| 18 | REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi |
---|
| 19 | REAL,DIMENSION(klon,klev),INTENT(IN) :: mp |
---|
| 20 | REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs ! pression aux 1/2 couches (bas en haut) |
---|
| 21 | REAL,DIMENSION(klon,klev),INTENT(IN) :: pplay ! pression pour le milieu de chaque couche |
---|
| 22 | REAL,DIMENSION(klon,klev),INTENT(IN) :: x ! q de traceur (bas en haut) |
---|
| 23 | REAL,DIMENSION(klon,klev),INTENT(IN) :: upd ! saturated updraft mass flux |
---|
| 24 | REAL,DIMENSION(klon,klev),INTENT(IN) :: dnd ! saturated downdraft mass flux |
---|
| 25 | |
---|
| 26 | ! Sortie |
---|
| 27 | REAL,DIMENSION(klon,klev),INTENT(OUT) :: dx ! tendance de traceur (bas en haut) |
---|
| 28 | |
---|
| 29 | ! Variables locales |
---|
[1250] | 30 | ! REAL,DIMENSION(klon,klev) :: zed |
---|
[1191] | 31 | REAL,DIMENSION(klon,klev,klev) :: zmd |
---|
| 32 | REAL,DIMENSION(klon,klev,klev) :: za |
---|
| 33 | REAL,DIMENSION(klon,klev) :: zmfd,zmfa |
---|
| 34 | REAL,DIMENSION(klon,klev) :: zmfp,zmfu |
---|
| 35 | INTEGER :: i,k,j |
---|
[1250] | 36 | REAL :: pdtimeRG |
---|
[1191] | 37 | |
---|
| 38 | ! ========================================= |
---|
| 39 | ! calcul des tendances liees au downdraft |
---|
| 40 | ! ========================================= |
---|
[1250] | 41 | !cdir collapse |
---|
| 42 | DO j=1,klev |
---|
| 43 | DO i=1,klon |
---|
| 44 | ! zed(i,j)=0. |
---|
| 45 | zmfd(i,j)=0. |
---|
| 46 | zmfa(i,j)=0. |
---|
| 47 | zmfu(i,j)=0. |
---|
| 48 | zmfp(i,j)=0. |
---|
| 49 | END DO |
---|
| 50 | END DO |
---|
| 51 | !cdir collapse |
---|
| 52 | DO k=1,klev |
---|
| 53 | DO j=1,klev |
---|
| 54 | DO i=1,klon |
---|
| 55 | zmd(i,j,k)=0. |
---|
| 56 | za (i,j,k)=0. |
---|
| 57 | END DO |
---|
| 58 | END DO |
---|
| 59 | END DO |
---|
[1191] | 60 | ! entrainement |
---|
[1250] | 61 | ! DO k=1,klev-1 |
---|
| 62 | ! DO i=1,klon |
---|
| 63 | ! zed(i,k)=max(0.,mp(i,k)-mp(i,k+1)) |
---|
| 64 | ! END DO |
---|
| 65 | ! END DO |
---|
[1191] | 66 | |
---|
| 67 | ! calcul de la matrice d echange |
---|
| 68 | ! matrice de distribution de la masse entrainee en k |
---|
| 69 | |
---|
[1250] | 70 | DO k=1,klev-1 |
---|
[1191] | 71 | DO i=1,klon |
---|
[1250] | 72 | zmd(i,k,k)=max(0.,mp(i,k)-mp(i,k+1)) |
---|
[1191] | 73 | END DO |
---|
| 74 | END DO |
---|
| 75 | DO k=2,klev |
---|
| 76 | DO j=k-1,1,-1 |
---|
| 77 | DO i=1,klon |
---|
| 78 | if(mp(i,j+1).ne.0) then |
---|
| 79 | zmd(i,j,k)=zmd(i,j+1,k)*min(1.,mp(i,j)/mp(i,j+1)) |
---|
| 80 | ENDif |
---|
| 81 | END DO |
---|
| 82 | END DO |
---|
| 83 | END DO |
---|
| 84 | DO k=1,klev |
---|
| 85 | DO j=1,klev-1 |
---|
| 86 | DO i=1,klon |
---|
| 87 | za(i,j,k)=max(0.,zmd(i,j+1,k)-zmd(i,j,k)) |
---|
| 88 | END DO |
---|
| 89 | END DO |
---|
| 90 | END DO |
---|
| 91 | ! |
---|
| 92 | ! rajout du terme lie a l ascendance induite |
---|
| 93 | ! |
---|
| 94 | DO j=2,klev |
---|
| 95 | DO i=1,klon |
---|
| 96 | za(i,j,j-1)=za(i,j,j-1)+mp(i,j) |
---|
| 97 | END DO |
---|
| 98 | END DO |
---|
| 99 | ! |
---|
| 100 | ! tendances |
---|
| 101 | ! |
---|
| 102 | DO k=1,klev |
---|
| 103 | DO j=1,klev |
---|
| 104 | DO i=1,klon |
---|
| 105 | zmfd(i,j)=zmfd(i,j)+za(i,j,k)*(x(i,k)-x(i,j)) |
---|
| 106 | END DO |
---|
| 107 | END DO |
---|
| 108 | END DO |
---|
| 109 | ! |
---|
| 110 | ! ========================================= |
---|
| 111 | ! calcul des tendances liees aux flux satures |
---|
| 112 | ! ========================================= |
---|
| 113 | DO j=1,klev |
---|
| 114 | DO i=1,klon |
---|
| 115 | zmfa(i,j)=da(i,j)*(x(i,1)-x(i,j)) |
---|
| 116 | END DO |
---|
| 117 | END DO |
---|
| 118 | DO k=1,klev |
---|
| 119 | DO j=1,klev |
---|
| 120 | DO i=1,klon |
---|
| 121 | zmfp(i,j)=zmfp(i,j)+phi(i,j,k)*(x(i,k)-x(i,j)) |
---|
| 122 | END DO |
---|
| 123 | END DO |
---|
| 124 | END DO |
---|
| 125 | DO j=1,klev-1 |
---|
| 126 | DO i=1,klon |
---|
| 127 | zmfu(i,j)=max(0.,upd(i,j+1)+dnd(i,j+1))*(x(i,j+1)-x(i,j)) |
---|
| 128 | END DO |
---|
| 129 | END DO |
---|
| 130 | DO j=2,klev |
---|
| 131 | DO i=1,klon |
---|
| 132 | zmfu(i,j)=zmfu(i,j)+min(0.,upd(i,j)+dnd(i,j))*(x(i,j)-x(i,j-1)) |
---|
| 133 | END DO |
---|
| 134 | END DO |
---|
| 135 | |
---|
| 136 | ! ========================================= |
---|
| 137 | ! calcul final des tendances |
---|
| 138 | ! ========================================= |
---|
| 139 | DO k=1, klev |
---|
| 140 | DO i=1, klon |
---|
[1250] | 141 | dx(i,k)=paprs(i,k)-paprs(i,k+1) |
---|
| 142 | ENDDO |
---|
| 143 | ENDDO |
---|
| 144 | pdtimeRG=pdtime*RG |
---|
| 145 | !cdir collapse |
---|
| 146 | DO k=1, klev |
---|
| 147 | DO i=1, klon |
---|
[1191] | 148 | dx(i,k)=(zmfd(i,k)+zmfu(i,k) & |
---|
[1250] | 149 | +zmfa(i,k)+zmfp(i,k))*pdtimeRG/dx(i,k) |
---|
[1191] | 150 | ! print*,'dx',k,dx(i,k) |
---|
| 151 | ENDDO |
---|
| 152 | ENDDO |
---|
| 153 | |
---|
| 154 | ! test de conservation du traceur |
---|
| 155 | ! conserv=0. |
---|
| 156 | ! DO k=1, klev |
---|
| 157 | ! DO i=1, klon |
---|
| 158 | ! conserv=conserv+dx(i,k)* & |
---|
| 159 | ! (paprs(i,k)-paprs(i,k+1))/RG |
---|
| 160 | ! ENDDO |
---|
| 161 | ! ENDDO |
---|
| 162 | ! print *,'conserv',conserv |
---|
[619] | 163 | |
---|
[1191] | 164 | END SUBROUTINE cvltr |
---|