[4139] | 1 | ! $Id: caladvtrac_p.F 1299 2010-01-20 14:27:21Z fairhead $ |
---|
[5099] | 2 | |
---|
[5101] | 3 | ! |
---|
| 4 | ! |
---|
| 5 | SUBROUTINE fluxstokenc_p(pbaru, pbarv, masse, teta, phi) |
---|
| 6 | USE parallel_lmdz |
---|
| 7 | USE control_mod, ONLY: iapp_tracvl, planet_type, iphysiq |
---|
| 8 | USE caladvtrac_mod |
---|
| 9 | USE mod_hallo |
---|
| 10 | USE bands |
---|
| 11 | USE times |
---|
| 12 | USE Vampir |
---|
| 13 | USE write_field_loc |
---|
[4139] | 14 | |
---|
| 15 | |
---|
[5101] | 16 | IMPLICIT NONE |
---|
| 17 | ! |
---|
| 18 | ! Auteurs: F.Hourdin , P.Le Van, F.Forget, F.Codron |
---|
| 19 | ! |
---|
| 20 | !======================================================================= |
---|
| 21 | ! |
---|
| 22 | ! Shema de Van Leer |
---|
| 23 | ! |
---|
| 24 | !======================================================================= |
---|
[4139] | 25 | |
---|
[5101] | 26 | include "dimensions.h" |
---|
| 27 | include "paramet.h" |
---|
| 28 | include "tracstoke.h" |
---|
[4139] | 29 | |
---|
[5101] | 30 | ! Arguments: |
---|
| 31 | ! ---------- |
---|
| 32 | REAL :: pbaru(ijb_u:ije_u, llm), pbarv(ijb_v:ije_v, llm) |
---|
| 33 | REAL :: masse(ijb_u:ije_u, llm) |
---|
| 34 | REAL :: teta(ijb_u:ije_u, llm) |
---|
| 35 | REAL :: phi(ijb_u:ije_u, llm) |
---|
[4139] | 36 | |
---|
[5101] | 37 | INTEGER, SAVE :: pasflx = 0 |
---|
| 38 | !$OMP THREADPRIVATE(pasflx) |
---|
| 39 | INTEGER :: ijb, ije, ijbu, ijbv, ijeu, ijev, j |
---|
| 40 | INTEGER :: ij, l |
---|
| 41 | TYPE(Request), SAVE :: Request_vanleer |
---|
| 42 | !$OMP THREADPRIVATE(Request_vanleer) |
---|
[4139] | 43 | |
---|
| 44 | |
---|
| 45 | |
---|
[5101] | 46 | ! !write(*,*) 'caladvtrac 58: entree' |
---|
| 47 | ijbu = ij_begin |
---|
| 48 | ijeu = ij_end |
---|
[4139] | 49 | |
---|
[5101] | 50 | ijbv = ij_begin - iip1 |
---|
| 51 | ijev = ij_end |
---|
| 52 | if (pole_nord) ijbv = ij_begin |
---|
| 53 | if (pole_sud) ijev = ij_end - iip1 |
---|
[4139] | 54 | |
---|
[5101] | 55 | IF(pasflx==0) THEN |
---|
| 56 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 57 | DO l = 1, llm |
---|
| 58 | tetac(ijbu:ijeu, l) = 0. |
---|
| 59 | phic(ijbu:ijeu, l) = 0. |
---|
| 60 | pbarucc(ijbu:ijeu, l) = 0. |
---|
| 61 | pbarvcc(ijbv:ijev, l) = 0. |
---|
| 62 | ENDDO |
---|
| 63 | !$OMP END DO NOWAIT |
---|
| 64 | ENDIF |
---|
[4139] | 65 | |
---|
[5101] | 66 | ! accumulation des flux de masse horizontaux |
---|
| 67 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 68 | DO l = 1, llm |
---|
| 69 | DO ij = ijbu, ijeu |
---|
| 70 | pbarucc(ij, l) = pbarucc(ij, l) + pbaru(ij, l) |
---|
| 71 | tetac(ij, l) = tetac(ij, l) + teta(ij, l) |
---|
| 72 | phic(ij, l) = phic(ij, l) + phi(ij, l) |
---|
[4139] | 73 | |
---|
[5101] | 74 | ENDDO |
---|
| 75 | DO ij = ijbv, ijev |
---|
| 76 | pbarvcc(ij, l) = pbarvcc(ij, l) + pbarv(ij, l) |
---|
| 77 | ENDDO |
---|
| 78 | ENDDO |
---|
| 79 | !$OMP END DO NOWAIT |
---|
[4139] | 80 | |
---|
[5101] | 81 | ! selection de la masse instantannee des mailles avant le transport. |
---|
| 82 | IF(pasflx==0) THEN |
---|
[4139] | 83 | |
---|
[5101] | 84 | ijb = ij_begin |
---|
| 85 | ije = ij_end |
---|
[4139] | 86 | |
---|
[5101] | 87 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 88 | DO l = 1, llm |
---|
| 89 | massec(ijb:ije, l) = masse(ijb:ije, l) |
---|
| 90 | ENDDO |
---|
| 91 | !$OMP END DO NOWAIT |
---|
[4139] | 92 | |
---|
[5101] | 93 | ENDIF |
---|
[4139] | 94 | |
---|
[5101] | 95 | pasflx = pasflx + 1 |
---|
[4139] | 96 | |
---|
| 97 | |
---|
[5101] | 98 | ! Test pour savoir si on advecte a ce pas de temps |
---|
[4139] | 99 | |
---|
[5101] | 100 | IF (pasflx==(iphysiq * istphy)) THEN |
---|
| 101 | ! !write(*,*) 'caladvtrac 133' |
---|
| 102 | !$OMP MASTER |
---|
| 103 | CALL suspend_timer(timer_caldyn) |
---|
| 104 | !$OMP END MASTER |
---|
[4139] | 105 | |
---|
[5101] | 106 | ijb = ij_begin |
---|
| 107 | ije = ij_end |
---|
[4139] | 108 | |
---|
| 109 | |
---|
[5101] | 110 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 111 | DO l = 1, llm |
---|
| 112 | pbarucc(ijb:ije, l) = pbarucc(ijb:ije, l) / REAL(iphysiq * istphy) |
---|
| 113 | tetac(ijb:ije, l) = tetac(ijb:ije, l) / REAL(iphysiq * istphy) |
---|
| 114 | phic(ijb:ije, l) = phic(ijb:ije, l) / REAL(iphysiq * istphy) |
---|
| 115 | ENDDO |
---|
| 116 | !$OMP ENDDO NOWAIT |
---|
[4139] | 117 | |
---|
[5101] | 118 | if (pole_sud) ije = ij_end - iip1 |
---|
[4139] | 119 | |
---|
[5101] | 120 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 121 | DO l = 1, llm |
---|
| 122 | pbarvcc(ijb:ije, l) = pbarvcc(ijb:ije, l) / REAL(iphysiq * istphy) |
---|
| 123 | ENDDO |
---|
| 124 | !$OMP ENDDO NOWAIT |
---|
[4139] | 125 | |
---|
| 126 | |
---|
[5101] | 127 | !$OMP BARRIER |
---|
| 128 | CALL Register_Hallo_u(pbarucc, llm, 1, 1, 1, 1, Request_vanleer) |
---|
| 129 | CALL Register_Hallo_v(pbarvcc, llm, 1, 1, 1, 1, Request_vanleer) |
---|
| 130 | CALL SendRequest(Request_vanleer) |
---|
| 131 | !$OMP BARRIER |
---|
| 132 | CALL WaitRequest(Request_vanleer) |
---|
| 133 | !$OMP BARRIER |
---|
[4139] | 134 | |
---|
[5101] | 135 | !c .. Modif P.Le Van ( 20/12/97 ) .... |
---|
| 136 | !c |
---|
[4139] | 137 | |
---|
[5101] | 138 | ! traitement des flux de masse avant advection. |
---|
| 139 | ! 1. calcul de w |
---|
| 140 | ! 2. groupement des mailles pres du pole. |
---|
[4139] | 141 | |
---|
[5101] | 142 | CALL groupe_loc(massec, pbarucc, pbarvcc, pbarugg, pbarvgg, wgg) |
---|
[4139] | 143 | |
---|
[5101] | 144 | ijb = ij_begin |
---|
| 145 | ije = ij_end |
---|
[4139] | 146 | |
---|
[5101] | 147 | !$OMP BARRIER |
---|
| 148 | CALL WriteField_u('pbarug', pbarugg) |
---|
| 149 | CALL WriteField_v('pbarvg', pbarvgg) |
---|
| 150 | CALL WriteField_u('wg', wgg) |
---|
| 151 | CALL WriteField_u('tetag', tetac) |
---|
| 152 | CALL WriteField_u('phig', phic) |
---|
| 153 | CALL WriteField_u('masseg', massec) |
---|
[4139] | 154 | |
---|
| 155 | |
---|
[5101] | 156 | !$OMP MASTER |
---|
| 157 | CALL Set_Distrib(distrib_caldyn) |
---|
| 158 | CALL VTe(VThallo) |
---|
| 159 | CALL resume_timer(timer_caldyn) |
---|
| 160 | !$OMP END MASTER |
---|
[4139] | 161 | |
---|
| 162 | |
---|
[5101] | 163 | !$OMP BARRIER |
---|
| 164 | pasflx = 0 |
---|
| 165 | ENDIF ! if iadvtr.EQ.iapp_tracvl |
---|
[4139] | 166 | |
---|
[5101] | 167 | END SUBROUTINE fluxstokenc_p |
---|