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