[782] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | MODULE mod_clvent |
---|
| 5 | |
---|
| 6 | REAL, DIMENSION(:), ALLOCATABLE, PRIVATE :: flux_u1 |
---|
| 7 | REAL, DIMENSION(:), ALLOCATABLE, PRIVATE :: flux_v1 |
---|
| 8 | |
---|
| 9 | CONTAINS |
---|
| 10 | |
---|
| 11 | SUBROUTINE clvent(knon,dtime, u1lay,v1lay,coef,t,ven, & |
---|
| 12 | paprs,pplay,delp, & |
---|
| 13 | d_ven,flux_v) |
---|
| 14 | |
---|
| 15 | use dimphy |
---|
| 16 | IMPLICIT none |
---|
| 17 | !c====================================================================== |
---|
| 18 | !c Auteur(s): Z.X. Li (LMD/CNRS) date: 19930818 |
---|
| 19 | !c Objet: diffusion vertical de la vitesse "ven" |
---|
| 20 | !c====================================================================== |
---|
| 21 | !c Arguments: |
---|
| 22 | !c dtime----input-R- intervalle du temps (en second) |
---|
| 23 | !c u1lay----input-R- vent u de la premiere couche (m/s) |
---|
| 24 | !c v1lay----input-R- vent v de la premiere couche (m/s) |
---|
| 25 | !c coef-----input-R- le coefficient d'echange (m**2/s) multiplie par |
---|
| 26 | !c le cisaillement du vent (dV/dz); la premiere |
---|
| 27 | !c valeur indique la valeur de Cdrag (sans unite) |
---|
| 28 | !c t--------input-R- temperature (K) |
---|
| 29 | !c ven------input-R- vitesse horizontale (m/s) |
---|
| 30 | !c paprs----input-R- pression a inter-couche (Pa) |
---|
| 31 | !c pplay----input-R- pression au milieu de couche (Pa) |
---|
| 32 | !c delp-----input-R- epaisseur de couche (Pa) |
---|
| 33 | !c |
---|
| 34 | !c |
---|
| 35 | !c d_ven----output-R- le changement de "ven" |
---|
| 36 | !c flux_v---output-R- (diagnostic) flux du vent: (kg m/s)/(m**2 s) |
---|
| 37 | !c====================================================================== |
---|
| 38 | !cym#include "dimensions.h" |
---|
| 39 | !cym#include "dimphy.h" |
---|
| 40 | #include "iniprint.h" |
---|
| 41 | INTEGER, INTENT(IN) :: knon |
---|
| 42 | REAL, INTENT(IN) :: dtime |
---|
| 43 | REAL, INTENT(IN) :: u1lay(klon), v1lay(klon) |
---|
| 44 | REAL, INTENT(IN) :: coef(klon,klev) |
---|
| 45 | REAL, INTENT(IN) :: t(klon,klev), ven(klon,klev) |
---|
| 46 | REAL, INTENT(IN) :: paprs(klon,klev+1), pplay(klon,klev), delp(klon,klev) |
---|
| 47 | REAL, INTENT(OUT) :: d_ven(klon,klev) |
---|
| 48 | REAL, INTENT(OUT) :: flux_v(klon,klev) |
---|
| 49 | !c====================================================================== |
---|
[793] | 50 | include "YOMCST.h" |
---|
[782] | 51 | !c====================================================================== |
---|
| 52 | INTEGER i, k |
---|
| 53 | REAL zx_cv(klon,2:klev) |
---|
| 54 | REAL zx_dv(klon,2:klev) |
---|
| 55 | REAL zx_buf(klon) |
---|
| 56 | REAL zx_coef(klon,klev) |
---|
| 57 | REAL local_ven(klon,klev) |
---|
| 58 | REAL zx_alf1(klon), zx_alf2(klon) |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | d_ven(:,:) = 0.0 |
---|
| 62 | flux_v(:,:) = 0.0 |
---|
| 63 | !c====================================================================== |
---|
| 64 | DO k = 1, klev |
---|
| 65 | DO i = 1, knon |
---|
| 66 | local_ven(i,k) = ven(i,k) |
---|
| 67 | ENDDO |
---|
| 68 | ENDDO |
---|
| 69 | !c====================================================================== |
---|
| 70 | DO i = 1, knon |
---|
| 71 | !ccc zx_alf1(i) = (paprs(i,1)-pplay(i,2))/(pplay(i,1)-pplay(i,2)) |
---|
| 72 | zx_alf1(i) = 1.0 |
---|
| 73 | zx_alf2(i) = 1.0 - zx_alf1(i) |
---|
| 74 | zx_coef(i,1) = coef(i,1) & |
---|
| 75 | * (1.0+SQRT(u1lay(i)**2+v1lay(i)**2)) & |
---|
| 76 | * pplay(i,1)/(RD*t(i,1)) |
---|
| 77 | zx_coef(i,1) = zx_coef(i,1) * dtime*RG |
---|
| 78 | ENDDO |
---|
| 79 | !c====================================================================== |
---|
| 80 | DO k = 2, klev |
---|
| 81 | DO i = 1, knon |
---|
| 82 | zx_coef(i,k) = coef(i,k)*RG/(pplay(i,k-1)-pplay(i,k)) & |
---|
| 83 | *(paprs(i,k)*2/(t(i,k)+t(i,k-1))/RD)**2 |
---|
| 84 | zx_coef(i,k) = zx_coef(i,k) * dtime*RG |
---|
| 85 | ENDDO |
---|
| 86 | ENDDO |
---|
| 87 | !c====================================================================== |
---|
| 88 | DO i = 1, knon |
---|
| 89 | zx_buf(i) = delp(i,1) + zx_coef(i,1)*zx_alf1(i)+zx_coef(i,2) |
---|
| 90 | zx_cv(i,2) = local_ven(i,1)*delp(i,1) / zx_buf(i) |
---|
| 91 | zx_dv(i,2) = (zx_coef(i,2)-zx_alf2(i)*zx_coef(i,1)) & |
---|
| 92 | /zx_buf(i) |
---|
| 93 | ENDDO |
---|
| 94 | DO k = 3, klev |
---|
| 95 | DO i = 1, knon |
---|
| 96 | zx_buf(i) = delp(i,k-1) + zx_coef(i,k) & |
---|
| 97 | + zx_coef(i,k-1)*(1.-zx_dv(i,k-1)) |
---|
| 98 | zx_cv(i,k) = (local_ven(i,k-1)*delp(i,k-1) & |
---|
| 99 | +zx_coef(i,k-1)*zx_cv(i,k-1) )/zx_buf(i) |
---|
| 100 | zx_dv(i,k) = zx_coef(i,k)/zx_buf(i) |
---|
| 101 | ENDDO |
---|
| 102 | ENDDO |
---|
| 103 | DO i = 1, knon |
---|
| 104 | local_ven(i,klev) = ( local_ven(i,klev)*delp(i,klev) & |
---|
| 105 | +zx_coef(i,klev)*zx_cv(i,klev) ) & |
---|
| 106 | / ( delp(i,klev) + zx_coef(i,klev) & |
---|
| 107 | -zx_coef(i,klev)*zx_dv(i,klev) ) |
---|
| 108 | ENDDO |
---|
| 109 | DO k = klev-1, 1, -1 |
---|
| 110 | DO i = 1, knon |
---|
| 111 | local_ven(i,k) = zx_cv(i,k+1) + zx_dv(i,k+1)*local_ven(i,k+1) |
---|
| 112 | ENDDO |
---|
| 113 | ENDDO |
---|
| 114 | !c====================================================================== |
---|
| 115 | !c== flux_v est le flux de moment angulaire (positif vers bas) |
---|
| 116 | !c== dont l'unite est: (kg m/s)/(m**2 s) |
---|
| 117 | DO i = 1, knon |
---|
| 118 | flux_v(i,1) = zx_coef(i,1)/(RG*dtime) & |
---|
| 119 | *(local_ven(i,1)*zx_alf1(i) & |
---|
| 120 | +local_ven(i,2)*zx_alf2(i)) |
---|
| 121 | ENDDO |
---|
| 122 | DO k = 2, klev |
---|
| 123 | DO i = 1, knon |
---|
| 124 | flux_v(i,k) = zx_coef(i,k)/(RG*dtime) & |
---|
| 125 | * (local_ven(i,k)-local_ven(i,k-1)) |
---|
| 126 | ENDDO |
---|
| 127 | ENDDO |
---|
| 128 | !c |
---|
| 129 | DO k = 1, klev |
---|
| 130 | DO i = 1, knon |
---|
| 131 | d_ven(i,k) = local_ven(i,k) - ven(i,k) |
---|
| 132 | ENDDO |
---|
| 133 | ENDDO |
---|
| 134 | !c |
---|
| 135 | ! RETURN |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | END SUBROUTINE clvent |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | SUBROUTINE save_flux(klon, flux_u_in, flux_v_in) |
---|
| 143 | |
---|
| 144 | INTEGER, INTENT(IN) :: klon |
---|
| 145 | REAL, DIMENSION(klon), INTENT(IN) :: flux_u_in |
---|
| 146 | REAL, DIMENSION(klon), INTENT(IN) :: flux_v_in |
---|
| 147 | |
---|
| 148 | if (.not. allocated(flux_u1)) ALLOCATE(flux_u1(klon), flux_v1(klon)) |
---|
| 149 | |
---|
| 150 | flux_u1(:) = flux_u_in(:) |
---|
| 151 | flux_v1(:) = flux_v_in(:) |
---|
| 152 | |
---|
| 153 | |
---|
| 154 | END SUBROUTINE save_flux |
---|
| 155 | |
---|
| 156 | SUBROUTINE calcul_flux_vent(klon, flux_u, flux_v) |
---|
| 157 | |
---|
| 158 | INTEGER, INTENT(IN) :: klon |
---|
| 159 | ! Output |
---|
| 160 | REAL, DIMENSION(klon), INTENT(OUT) :: flux_u |
---|
| 161 | REAL, DIMENSION(klon), INTENT(OUT) :: flux_v |
---|
| 162 | |
---|
| 163 | flux_u = flux_u1 |
---|
| 164 | flux_v = flux_v1 |
---|
| 165 | |
---|
| 166 | END SUBROUTINE calcul_flux_vent |
---|
| 167 | |
---|
| 168 | END MODULE mod_clvent |
---|