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