[5186] | 1 | MODULE lmdz_advect |
---|
| 2 | IMPLICIT NONE; PRIVATE |
---|
| 3 | PUBLIC advect |
---|
[5099] | 4 | |
---|
[5186] | 5 | CONTAINS |
---|
[524] | 6 | |
---|
[5186] | 7 | SUBROUTINE advect(ucov, vcov, teta, w, massebx, masseby, du, dv, dteta) |
---|
[524] | 8 | |
---|
[5186] | 9 | USE comconst_mod, ONLY: daysec |
---|
| 10 | USE logic_mod, ONLY: conser |
---|
| 11 | USE ener_mod, ONLY: gtot |
---|
| 12 | USE lmdz_ssum_scopy, ONLY: ssum |
---|
| 13 | USE lmdz_comgeom |
---|
[5159] | 14 | |
---|
[5186] | 15 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
| 16 | USE lmdz_paramet |
---|
| 17 | IMPLICIT NONE |
---|
| 18 | !======================================================================= |
---|
[5159] | 19 | |
---|
[5186] | 20 | ! Auteurs: P. Le Van , Fr. Hourdin . |
---|
| 21 | ! ------- |
---|
[5159] | 22 | |
---|
[5186] | 23 | ! Objet: |
---|
| 24 | ! ------ |
---|
[5159] | 25 | |
---|
[5186] | 26 | ! ************************************************************* |
---|
| 27 | ! .... calcul des termes d'advection vertic.pour u,v,teta,q ... |
---|
| 28 | ! ************************************************************* |
---|
| 29 | ! ces termes sont ajoutes a du,dv,dteta et dq . |
---|
| 30 | ! Modif F.Forget 03/94 : on retire q de advect |
---|
[524] | 31 | |
---|
[5186] | 32 | !======================================================================= |
---|
| 33 | !----------------------------------------------------------------------- |
---|
| 34 | ! Declarations: |
---|
| 35 | ! ------------- |
---|
[524] | 36 | |
---|
[5159] | 37 | |
---|
| 38 | |
---|
[524] | 39 | |
---|
[5186] | 40 | ! Arguments: |
---|
| 41 | ! ---------- |
---|
[524] | 42 | |
---|
[5186] | 43 | REAL :: vcov(ip1jm, llm), ucov(ip1jmp1, llm), teta(ip1jmp1, llm) |
---|
| 44 | REAL :: massebx(ip1jmp1, llm), masseby(ip1jm, llm), w(ip1jmp1, llm) |
---|
| 45 | REAL :: dv(ip1jm, llm), du(ip1jmp1, llm), dteta(ip1jmp1, llm) |
---|
[524] | 46 | |
---|
[5186] | 47 | ! Local: |
---|
| 48 | ! ------ |
---|
[524] | 49 | |
---|
[5186] | 50 | REAL :: uav(ip1jmp1, llm), vav(ip1jm, llm), wsur2(ip1jmp1) |
---|
| 51 | REAL :: unsaire2(ip1jmp1), ge(ip1jmp1) |
---|
| 52 | REAL :: deuxjour, ww, gt, uu, vv |
---|
[524] | 53 | |
---|
[5186] | 54 | INTEGER :: ij, l |
---|
[524] | 55 | |
---|
[5186] | 56 | !----------------------------------------------------------------------- |
---|
| 57 | ! 2. Calculs preliminaires: |
---|
| 58 | ! ------------------------- |
---|
[524] | 59 | |
---|
[5186] | 60 | IF (conser) THEN |
---|
| 61 | deuxjour = 2. * daysec |
---|
[524] | 62 | |
---|
[5186] | 63 | DO ij = 1, ip1jmp1 |
---|
| 64 | unsaire2(ij) = unsaire(ij) * unsaire(ij) |
---|
| 65 | END DO |
---|
| 66 | END IF |
---|
[524] | 67 | |
---|
| 68 | |
---|
[5186] | 69 | !------------------ -yy ---------------------------------------------- |
---|
| 70 | ! . Calcul de u |
---|
| 71 | |
---|
| 72 | DO l = 1, llm |
---|
| 73 | DO ij = iip2, ip1jmp1 |
---|
| 74 | uav(ij, l) = 0.25 * (ucov(ij, l) + ucov(ij - iip1, l)) |
---|
| 75 | ENDDO |
---|
| 76 | DO ij = iip2, ip1jm |
---|
| 77 | uav(ij, l) = uav(ij, l) + uav(ij + iip1, l) |
---|
| 78 | ENDDO |
---|
| 79 | DO ij = 1, iip1 |
---|
| 80 | uav(ij, l) = 0. |
---|
| 81 | uav(ip1jm + ij, l) = 0. |
---|
| 82 | ENDDO |
---|
[5103] | 83 | ENDDO |
---|
[524] | 84 | |
---|
[5186] | 85 | !------------------ -xx ---------------------------------------------- |
---|
| 86 | ! . Calcul de v |
---|
[524] | 87 | |
---|
[5186] | 88 | DO l = 1, llm |
---|
| 89 | DO ij = 2, ip1jm |
---|
| 90 | vav(ij, l) = 0.25 * (vcov(ij, l) + vcov(ij - 1, l)) |
---|
| 91 | ENDDO |
---|
| 92 | DO ij = 1, ip1jm, iip1 |
---|
| 93 | vav(ij, l) = vav(ij + iim, l) |
---|
| 94 | ENDDO |
---|
| 95 | DO ij = 1, ip1jm - 1 |
---|
| 96 | vav(ij, l) = vav(ij, l) + vav(ij + 1, l) |
---|
| 97 | ENDDO |
---|
| 98 | DO ij = 1, ip1jm, iip1 |
---|
| 99 | vav(ij + iim, l) = vav(ij, l) |
---|
| 100 | ENDDO |
---|
[5103] | 101 | ENDDO |
---|
[524] | 102 | |
---|
[5186] | 103 | !----------------------------------------------------------------------- |
---|
[524] | 104 | |
---|
[5186] | 105 | DO l = 1, llmm1 |
---|
[5159] | 106 | |
---|
[524] | 107 | |
---|
[5186] | 108 | ! ...... calcul de - w/2. au niveau l+1 ....... |
---|
[524] | 109 | |
---|
[5186] | 110 | DO ij = 1, ip1jmp1 |
---|
| 111 | wsur2(ij) = - 0.5 * w(ij, l + 1) |
---|
| 112 | END DO |
---|
[524] | 113 | |
---|
| 114 | |
---|
[5186] | 115 | ! ..................... calcul pour du .................. |
---|
[524] | 116 | |
---|
[5186] | 117 | DO ij = iip2, ip1jm - 1 |
---|
| 118 | ww = wsur2 (ij) + wsur2(ij + 1) |
---|
| 119 | uu = 0.5 * (ucov(ij, l) + ucov(ij, l + 1)) |
---|
| 120 | du(ij, l) = du(ij, l) - ww * (uu - uav(ij, l)) / massebx(ij, l) |
---|
| 121 | du(ij, l + 1) = du(ij, l + 1) + ww * (uu - uav(ij, l + 1)) / massebx(ij, l + 1) |
---|
| 122 | END DO |
---|
[524] | 123 | |
---|
[5186] | 124 | ! ..... correction pour du(iip1,j,l) ........ |
---|
| 125 | ! ..... du(iip1,j,l)= du(1,j,l) ..... |
---|
[524] | 126 | |
---|
[5186] | 127 | !DIR$ IVDEP |
---|
| 128 | DO ij = iip1 + iip1, ip1jm, iip1 |
---|
| 129 | du(ij, l) = du(ij - iim, l) |
---|
| 130 | du(ij, l + 1) = du(ij - iim, l + 1) |
---|
| 131 | END DO |
---|
[524] | 132 | |
---|
[5186] | 133 | ! ................. calcul pour dv ..................... |
---|
[524] | 134 | |
---|
[5186] | 135 | DO ij = 1, ip1jm |
---|
| 136 | ww = wsur2(ij + iip1) + wsur2(ij) |
---|
| 137 | vv = 0.5 * (vcov(ij, l) + vcov(ij, l + 1)) |
---|
| 138 | dv(ij, l) = dv(ij, l) - ww * (vv - vav(ij, l)) / masseby(ij, l) |
---|
| 139 | dv(ij, l + 1) = dv(ij, l + 1) + ww * (vv - vav(ij, l + 1)) / masseby(ij, l + 1) |
---|
| 140 | END DO |
---|
[524] | 141 | |
---|
[5186] | 142 | ! |
---|
[524] | 143 | |
---|
[5186] | 144 | ! ............................................................ |
---|
| 145 | ! ............... calcul pour dh ................... |
---|
| 146 | ! ............................................................ |
---|
[524] | 147 | |
---|
[5186] | 148 | ! ---z |
---|
| 149 | ! calcul de - d( teta * w ) qu'on ajoute a dh |
---|
| 150 | ! ............... |
---|
[524] | 151 | |
---|
[5103] | 152 | DO ij = 1, ip1jmp1 |
---|
[5186] | 153 | ww = wsur2(ij) * (teta(ij, l) + teta(ij, l + 1)) |
---|
| 154 | dteta(ij, l) = dteta(ij, l) - ww |
---|
| 155 | dteta(ij, l + 1) = dteta(ij, l + 1) + ww |
---|
[5086] | 156 | END DO |
---|
[524] | 157 | |
---|
[5186] | 158 | IF(conser) THEN |
---|
| 159 | DO ij = 1, ip1jmp1 |
---|
| 160 | ge(ij) = wsur2(ij) * wsur2(ij) * unsaire2(ij) |
---|
| 161 | END DO |
---|
| 162 | gt = SSUM(ip1jmp1, ge, 1) |
---|
| 163 | gtot(l) = deuxjour * SQRT(gt / ip1jmp1) |
---|
| 164 | END IF |
---|
[5103] | 165 | |
---|
[5186] | 166 | END DO |
---|
[5105] | 167 | |
---|
[5186] | 168 | END SUBROUTINE advect |
---|
| 169 | |
---|
| 170 | END MODULE lmdz_advect |
---|