[1987] | 1 | ! $Id: $ |
---|
[5099] | 2 | |
---|
[5101] | 3 | SUBROUTINE dissip_loc(vcov, ucov, teta, p, dv, du, dh) |
---|
| 4 | ! |
---|
| 5 | USE parallel_lmdz |
---|
| 6 | USE write_field_loc |
---|
| 7 | USE dissip_mod, ONLY: dissip_allocate |
---|
| 8 | USE comconst_mod, ONLY: dtdiss |
---|
| 9 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO |
---|
| 10 | IMPLICIT NONE |
---|
[1632] | 11 | |
---|
| 12 | |
---|
[5101] | 13 | ! .. Avec nouveaux operateurs star : gradiv2 , divgrad2, nxgraro2 ... |
---|
| 14 | ! ( 10/01/98 ) |
---|
[1632] | 15 | |
---|
[5101] | 16 | !======================================================================= |
---|
| 17 | ! |
---|
| 18 | ! Auteur: P. Le Van |
---|
| 19 | ! ------- |
---|
| 20 | ! |
---|
| 21 | ! Objet: |
---|
| 22 | ! ------ |
---|
| 23 | ! |
---|
| 24 | ! Dissipation horizontale |
---|
| 25 | ! |
---|
| 26 | !======================================================================= |
---|
| 27 | !----------------------------------------------------------------------- |
---|
| 28 | ! Declarations: |
---|
| 29 | ! ------------- |
---|
[1632] | 30 | |
---|
[5101] | 31 | include "dimensions.h" |
---|
| 32 | include "paramet.h" |
---|
| 33 | include "comgeom.h" |
---|
| 34 | include "comdissnew.h" |
---|
| 35 | include "comdissipn.h" |
---|
[1632] | 36 | |
---|
[5101] | 37 | ! Arguments: |
---|
| 38 | ! ---------- |
---|
[1632] | 39 | |
---|
[5101] | 40 | REAL, INTENT(IN) :: vcov(ijb_v:ije_v, llm) ! covariant meridional wind |
---|
| 41 | REAL, INTENT(IN) :: ucov(ijb_u:ije_u, llm) ! covariant zonal wind |
---|
| 42 | REAL, INTENT(IN) :: teta(ijb_u:ije_u, llm) ! potential temperature |
---|
| 43 | REAL, INTENT(IN) :: p(ijb_u:ije_u, llmp1) ! interlayer pressure |
---|
[5113] | 44 | ! tendencies (.../s) on covariant winds and potential temperature |
---|
[5101] | 45 | REAL, INTENT(OUT) :: dv(ijb_v:ije_v, llm) |
---|
| 46 | REAL, INTENT(OUT) :: du(ijb_u:ije_u, llm) |
---|
| 47 | REAL, INTENT(OUT) :: dh(ijb_u:ije_u, llm) |
---|
[1632] | 48 | |
---|
[5101] | 49 | ! Local: |
---|
| 50 | ! ------ |
---|
[1632] | 51 | |
---|
[5101] | 52 | REAL :: gdx(ijb_u:ije_u, llm), gdy(ijb_v:ije_v, llm) |
---|
| 53 | REAL :: grx(ijb_u:ije_u, llm), gry(ijb_v:ije_v, llm) |
---|
| 54 | REAL :: te1dt(llm), te2dt(llm), te3dt(llm) |
---|
| 55 | REAL :: deltapres(ijb_u:ije_u, llm) |
---|
[1632] | 56 | |
---|
[5101] | 57 | INTEGER :: l, ij |
---|
[5116] | 58 | INTEGER :: ijb, ije |
---|
[1632] | 59 | |
---|
[5101] | 60 | LOGICAl, SAVE :: first = .TRUE. |
---|
| 61 | !$OMP THREADPRIVATE(first) |
---|
[1632] | 62 | |
---|
[5101] | 63 | IF (first) THEN |
---|
| 64 | CALL dissip_allocate |
---|
| 65 | first = .FALSE. |
---|
| 66 | ENDIF |
---|
| 67 | !----------------------------------------------------------------------- |
---|
| 68 | ! initialisations: |
---|
| 69 | ! ---------------- |
---|
[1632] | 70 | |
---|
[5101] | 71 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 72 | DO l = 1, llm |
---|
| 73 | te1dt(l) = tetaudiv(l) * dtdiss |
---|
| 74 | te2dt(l) = tetaurot(l) * dtdiss |
---|
| 75 | te3dt(l) = tetah(l) * dtdiss |
---|
| 76 | ENDDO |
---|
| 77 | !$OMP END DO NOWAIT |
---|
| 78 | ! CALL initial0( ijp1llm, du ) |
---|
| 79 | ! CALL initial0( ijmllm , dv ) |
---|
| 80 | ! CALL initial0( ijp1llm, dh ) |
---|
[1632] | 81 | |
---|
[5101] | 82 | ijb = ij_begin |
---|
| 83 | ije = ij_end |
---|
[1632] | 84 | |
---|
[5101] | 85 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 86 | DO l = 1, llm |
---|
| 87 | du(ijb:ije, l) = 0 |
---|
| 88 | dh(ijb:ije, l) = 0 |
---|
| 89 | ENDDO |
---|
| 90 | !$OMP END DO NOWAIT |
---|
[1632] | 91 | |
---|
[5117] | 92 | IF (pole_sud) ije = ij_end - iip1 |
---|
[1632] | 93 | |
---|
[5101] | 94 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 95 | DO l = 1, llm |
---|
| 96 | dv(ijb:ije, l) = 0 |
---|
| 97 | ENDDO |
---|
| 98 | !$OMP END DO NOWAIT |
---|
[1632] | 99 | |
---|
[5101] | 100 | !----------------------------------------------------------------------- |
---|
| 101 | ! Calcul de la dissipation: |
---|
| 102 | ! ------------------------- |
---|
[1632] | 103 | |
---|
[5101] | 104 | ! Calcul de la partie grad ( div ) : |
---|
| 105 | ! ------------------------------------- |
---|
[1632] | 106 | |
---|
[5101] | 107 | IF(lstardis) THEN |
---|
| 108 | ! IF (.FALSE.) THEN |
---|
| 109 | CALL gradiv2_loc(llm, ucov, vcov, nitergdiv, gdx, gdy) |
---|
| 110 | ELSE |
---|
| 111 | ! CALL gradiv_p ( llm,ucov,vcov,nitergdiv,gdx,gdy ) |
---|
| 112 | ENDIF |
---|
[1632] | 113 | |
---|
[5101] | 114 | IF (CPPKEY_DEBUGIO) THEN |
---|
| 115 | CALL WriteField_u('gdx', gdx) |
---|
| 116 | CALL WriteField_v('gdy', gdy) |
---|
| 117 | END IF |
---|
[1632] | 118 | |
---|
[5101] | 119 | ijb = ij_begin |
---|
| 120 | ije = ij_end |
---|
[5117] | 121 | IF (pole_sud) ije = ij_end - iip1 |
---|
[1632] | 122 | |
---|
[5101] | 123 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 124 | DO l = 1, llm |
---|
[5117] | 125 | IF (pole_nord) THEN |
---|
[5101] | 126 | DO ij = 1, iip1 |
---|
| 127 | gdx(ij, l) = 0. |
---|
| 128 | ENDDO |
---|
| 129 | endif |
---|
[1632] | 130 | |
---|
[5117] | 131 | IF (pole_sud) THEN |
---|
[5101] | 132 | DO ij = 1, iip1 |
---|
| 133 | gdx(ij + ip1jm, l) = 0. |
---|
| 134 | ENDDO |
---|
| 135 | endif |
---|
[1632] | 136 | |
---|
[5117] | 137 | IF (pole_nord) ijb = ij_begin + iip1 |
---|
[5101] | 138 | DO ij = ijb, ije |
---|
| 139 | du(ij, l) = du(ij, l) - te1dt(l) * gdx(ij, l) |
---|
| 140 | ENDDO |
---|
| 141 | |
---|
[5117] | 142 | IF (pole_nord) ijb = ij_begin |
---|
[5101] | 143 | DO ij = ijb, ije |
---|
| 144 | dv(ij, l) = dv(ij, l) - te1dt(l) * gdy(ij, l) |
---|
| 145 | ENDDO |
---|
| 146 | |
---|
| 147 | ENDDO |
---|
| 148 | !$OMP END DO NOWAIT |
---|
| 149 | ! calcul de la partie n X grad ( rot ): |
---|
| 150 | ! --------------------------------------- |
---|
| 151 | |
---|
| 152 | IF(lstardis) THEN |
---|
| 153 | ! IF (.FALSE.) THEN |
---|
| 154 | CALL nxgraro2_loc(llm, ucov, vcov, nitergrot, grx, gry) |
---|
| 155 | ELSE |
---|
| 156 | ! CALL nxgrarot_p( llm,ucov, vcov, nitergrot,grx,gry ) |
---|
| 157 | ENDIF |
---|
| 158 | |
---|
| 159 | IF (CPPKEY_DEBUGIO) THEN |
---|
| 160 | CALL WriteField_u('grx', grx) |
---|
| 161 | CALL WriteField_v('gry', gry) |
---|
| 162 | END IF |
---|
| 163 | |
---|
| 164 | ijb = ij_begin |
---|
| 165 | ije = ij_end |
---|
[5117] | 166 | IF (pole_sud) ije = ij_end - iip1 |
---|
[5101] | 167 | |
---|
| 168 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 169 | DO l = 1, llm |
---|
| 170 | |
---|
[5117] | 171 | IF (pole_nord) THEN |
---|
[5101] | 172 | DO ij = 1, iip1 |
---|
| 173 | grx(ij, l) = 0. |
---|
[1632] | 174 | ENDDO |
---|
[5101] | 175 | endif |
---|
[1632] | 176 | |
---|
[5117] | 177 | IF (pole_nord) ijb = ij_begin + iip1 |
---|
[5101] | 178 | DO ij = ijb, ije |
---|
| 179 | du(ij, l) = du(ij, l) - te2dt(l) * grx(ij, l) |
---|
| 180 | ENDDO |
---|
[1632] | 181 | |
---|
[5117] | 182 | IF (pole_nord) ijb = ij_begin |
---|
[5101] | 183 | DO ij = ijb, ije |
---|
| 184 | dv(ij, l) = dv(ij, l) - te2dt(l) * gry(ij, l) |
---|
| 185 | ENDDO |
---|
[1632] | 186 | |
---|
[5101] | 187 | ENDDO |
---|
| 188 | !$OMP END DO NOWAIT |
---|
[1632] | 189 | |
---|
[5101] | 190 | ! calcul de la partie div ( grad ): |
---|
| 191 | ! ----------------------------------- |
---|
[1632] | 192 | |
---|
[5101] | 193 | IF(lstardis) THEN |
---|
| 194 | ! IF (.FALSE.) THEN |
---|
[1632] | 195 | |
---|
[5101] | 196 | ijb = ij_begin |
---|
| 197 | ije = ij_end |
---|
| 198 | |
---|
| 199 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 200 | DO l = 1, llm |
---|
| 201 | DO ij = ijb, ije |
---|
| 202 | deltapres(ij, l) = AMAX1(0., p(ij, l) - p(ij, l + 1)) |
---|
[1632] | 203 | ENDDO |
---|
[5101] | 204 | ENDDO |
---|
| 205 | !$OMP END DO NOWAIT |
---|
| 206 | CALL divgrad2_loc(llm, teta, deltapres, niterh, gdx) |
---|
| 207 | ELSE |
---|
| 208 | ! CALL divgrad_p ( llm,teta, niterh, gdx ) |
---|
| 209 | ENDIF |
---|
[1632] | 210 | |
---|
[5101] | 211 | IF (CPPKEY_DEBUGIO) THEN |
---|
| 212 | CALL WriteField_u('gdx', gdx) |
---|
| 213 | END IF |
---|
| 214 | |
---|
| 215 | ijb = ij_begin |
---|
| 216 | ije = ij_end |
---|
| 217 | |
---|
| 218 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 219 | DO l = 1, llm |
---|
| 220 | DO ij = ijb, ije |
---|
| 221 | dh(ij, l) = dh(ij, l) - te3dt(l) * gdx(ij, l) |
---|
| 222 | ENDDO |
---|
| 223 | ENDDO |
---|
| 224 | !$OMP END DO NOWAIT |
---|
| 225 | |
---|
[5105] | 226 | |
---|
[5101] | 227 | END SUBROUTINE dissip_loc |
---|