[1632] | 1 | ! |
---|
| 2 | ! $Id: caladvtrac_p.F 1299 2010-01-20 14:27:21Z fairhead $ |
---|
| 3 | ! |
---|
[5246] | 4 | ! |
---|
| 5 | ! |
---|
| 6 | SUBROUTINE caladvtrac_loc(q,pbaru,pbarv , & |
---|
| 7 | p ,masse, dq , teta, & |
---|
| 8 | flxw, pk, iapptrac) |
---|
| 9 | USE parallel_lmdz |
---|
| 10 | USE infotrac, ONLY : nqtot |
---|
| 11 | USE control_mod, ONLY : iapp_tracvl,planet_type |
---|
| 12 | USE caladvtrac_mod |
---|
| 13 | USE mod_hallo |
---|
| 14 | USE bands |
---|
| 15 | USE times |
---|
| 16 | USE Vampir |
---|
| 17 | USE write_field_loc |
---|
[5271] | 18 | USE dimensions_mod, ONLY: iim, jjm, llm, ndm |
---|
[5285] | 19 | USE paramet_mod_h |
---|
[5271] | 20 | IMPLICIT NONE |
---|
[5246] | 21 | ! |
---|
| 22 | ! Auteurs: F.Hourdin , P.Le Van, F.Forget, F.Codron |
---|
| 23 | ! |
---|
| 24 | ! F.Codron (10/99) : ajout humidite specifique pour eau vapeur |
---|
| 25 | !======================================================================= |
---|
| 26 | ! |
---|
| 27 | ! Shema de Van Leer |
---|
| 28 | ! |
---|
| 29 | !======================================================================= |
---|
[1632] | 30 | |
---|
| 31 | |
---|
[5271] | 32 | |
---|
[1632] | 33 | |
---|
[5272] | 34 | |
---|
[5246] | 35 | ! Arguments: |
---|
| 36 | ! ---------- |
---|
| 37 | REAL :: pbaru( ijb_u:ije_u,llm ),pbarv( ijb_v:ije_v,llm) |
---|
| 38 | REAL :: masse(ijb_u:ije_u,llm) |
---|
| 39 | REAL :: p( ijb_u:ije_u,llmp1) |
---|
| 40 | REAL :: q( ijb_u:ije_u,llm,nqtot),dq( ijb_u:ije_u,llm, nqtot ) |
---|
| 41 | REAL :: teta( ijb_u:ije_u,llm),pk( ijb_u:ije_u,llm) |
---|
| 42 | REAL :: flxw(ijb_u:ije_u,llm) |
---|
| 43 | INTEGER :: iapptrac |
---|
| 44 | ! Local: |
---|
| 45 | ! ------ |
---|
| 46 | ! REAL :: pbarug(ijb_u:ije_u,llm) |
---|
| 47 | ! REAL :: pbarvg(ijb_v:ije_v,llm) |
---|
| 48 | ! REAL :: wg(ijb_u:ije_u,llm) |
---|
| 49 | |
---|
| 50 | REAL :: flxw_adv(distrib_vanleer%ijb_u:distrib_vanleer%ije_u,llm) |
---|
| 51 | INTEGER,SAVE :: iadvtr=0 |
---|
[1632] | 52 | !$OMP THREADPRIVATE(iadvtr) |
---|
[5246] | 53 | INTEGER :: ijb,ije,ijbu,ijbv,ijeu,ijev,j |
---|
| 54 | INTEGER :: ij,l |
---|
| 55 | TYPE(Request),SAVE :: Request_vanleer |
---|
[1848] | 56 | !$OMP THREADPRIVATE(Request_vanleer) |
---|
[1632] | 57 | |
---|
[5246] | 58 | ! !write(*,*) 'caladvtrac 58: entree' |
---|
| 59 | ijbu=ij_begin |
---|
| 60 | ijeu=ij_end |
---|
[1632] | 61 | |
---|
[5246] | 62 | ijbv=ij_begin-iip1 |
---|
| 63 | ijev=ij_end |
---|
| 64 | if (pole_nord) ijbv=ij_begin |
---|
| 65 | if (pole_sud) ijev=ij_end-iip1 |
---|
[1632] | 66 | |
---|
[5246] | 67 | IF(iadvtr.EQ.0) THEN |
---|
| 68 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 69 | DO l=1,llm |
---|
| 70 | pbaruc(ijbu:ijeu,l)=0. |
---|
| 71 | pbarvc(ijbv:ijev,l)=0. |
---|
| 72 | ENDDO |
---|
| 73 | !$OMP END DO NOWAIT |
---|
| 74 | ENDIF |
---|
[1632] | 75 | |
---|
[5246] | 76 | ! accumulation des flux de masse horizontaux |
---|
| 77 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 78 | DO l=1,llm |
---|
| 79 | DO ij = ijbu,ijeu |
---|
| 80 | pbaruc(ij,l) = pbaruc(ij,l) + pbaru(ij,l) |
---|
| 81 | ENDDO |
---|
| 82 | DO ij = ijbv,ijev |
---|
| 83 | pbarvc(ij,l) = pbarvc(ij,l) + pbarv(ij,l) |
---|
| 84 | ENDDO |
---|
| 85 | ENDDO |
---|
| 86 | !$OMP END DO NOWAIT |
---|
[1632] | 87 | |
---|
[5246] | 88 | ! selection de la masse instantannee des mailles avant le transport. |
---|
| 89 | IF(iadvtr.EQ.0) THEN |
---|
[1632] | 90 | |
---|
[5246] | 91 | ijb=ij_begin |
---|
| 92 | ije=ij_end |
---|
[1632] | 93 | |
---|
[5246] | 94 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 95 | DO l=1,llm |
---|
| 96 | massem(ijb:ije,l)=masse(ijb:ije,l) |
---|
| 97 | ENDDO |
---|
| 98 | !$OMP END DO NOWAIT |
---|
[1632] | 99 | |
---|
[5246] | 100 | ENDIF |
---|
[1632] | 101 | |
---|
[5246] | 102 | iadvtr = iadvtr+1 |
---|
[1632] | 103 | |
---|
[5246] | 104 | !$OMP MASTER |
---|
| 105 | iapptrac = iadvtr |
---|
| 106 | !$OMP END MASTER |
---|
[1632] | 107 | |
---|
[5246] | 108 | ! Test pour savoir si on advecte a ce pas de temps |
---|
[1632] | 109 | |
---|
[5246] | 110 | IF ( iadvtr.EQ.iapp_tracvl ) THEN |
---|
| 111 | ! !write(*,*) 'caladvtrac 133' |
---|
| 112 | !$OMP MASTER |
---|
| 113 | call suspend_timer(timer_caldyn) |
---|
| 114 | !$OMP END MASTER |
---|
[1804] | 115 | |
---|
[5246] | 116 | ijb=ij_begin |
---|
| 117 | ije=ij_end |
---|
[1632] | 118 | |
---|
[5246] | 119 | !c .. Modif P.Le Van ( 20/12/97 ) .... |
---|
| 120 | !c |
---|
[1804] | 121 | |
---|
[5246] | 122 | ! traitement des flux de masse avant advection. |
---|
| 123 | ! 1. calcul de w |
---|
| 124 | ! 2. groupement des mailles pres du pole. |
---|
| 125 | |
---|
| 126 | CALL groupe_loc( massem, pbaruc,pbarvc, pbarug,pbarvg,wg ) |
---|
| 127 | |
---|
| 128 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 129 | DO l=1,llm |
---|
| 130 | flxw(ijb:ije,l)=wg(ijb:ije,l)/REAL(iapp_tracvl) |
---|
| 131 | ENDDO |
---|
| 132 | !$OMP ENDDO NOWAIT |
---|
| 133 | |
---|
| 134 | !$OMP BARRIER |
---|
[1632] | 135 | |
---|
| 136 | |
---|
[5246] | 137 | !$OMP MASTER |
---|
| 138 | call VTb(VTHallo) |
---|
| 139 | !$OMP END MASTER |
---|
[1632] | 140 | |
---|
[5246] | 141 | call Register_SwapField_u(pbarug,pbarug_adv, distrib_vanleer, & |
---|
| 142 | Request_vanleer) |
---|
| 143 | call Register_SwapField_v(pbarvg,pbarvg_adv, distrib_vanleer, & |
---|
| 144 | Request_vanleer,up=1) |
---|
| 145 | call Register_SwapField_u(massem,massem_adv, distrib_vanleer, & |
---|
| 146 | Request_vanleer) |
---|
| 147 | call Register_SwapField_u(wg,wg_adv,distrib_vanleer, & |
---|
| 148 | Request_vanleer) |
---|
| 149 | call Register_SwapField_u(teta,teta_adv, distrib_vanleer, & |
---|
| 150 | Request_vanleer,up=1,down=1) |
---|
| 151 | call Register_SwapField_u(p,p_adv, distrib_vanleer, & |
---|
| 152 | Request_vanleer,up=1,down=1) |
---|
| 153 | call Register_SwapField_u(pk,pk_adv, distrib_vanleer, & |
---|
| 154 | Request_vanleer,up=1,down=1) |
---|
| 155 | call Register_SwapField_u(q,q_adv, distrib_vanleer, & |
---|
| 156 | Request_vanleer) |
---|
[1632] | 157 | |
---|
[5246] | 158 | call SendRequest(Request_vanleer) |
---|
| 159 | !$OMP BARRIER |
---|
| 160 | call WaitRequest(Request_vanleer) |
---|
[1632] | 161 | |
---|
| 162 | |
---|
[5246] | 163 | !$OMP BARRIER |
---|
| 164 | !$OMP MASTER |
---|
| 165 | call Set_Distrib(distrib_vanleer) |
---|
| 166 | call VTe(VTHallo) |
---|
| 167 | call VTb(VTadvection) |
---|
| 168 | call start_timer(timer_vanleer) |
---|
| 169 | !$OMP END MASTER |
---|
| 170 | !$OMP BARRIER |
---|
| 171 | ! CALL WriteField_u('pbarug_adv',pbarug_adv) |
---|
| 172 | ! CALL WriteField_u('',) |
---|
| 173 | |
---|
| 174 | ! !write(*,*) 'caladvtrac 185' |
---|
| 175 | CALL advtrac_loc( pbarug_adv,pbarvg_adv,wg_adv, & |
---|
| 176 | p_adv, massem_adv,q_adv, teta_adv, & |
---|
| 177 | pk_adv) |
---|
| 178 | ! !write(*,*) 'caladvtrac 189' |
---|
[1632] | 179 | |
---|
| 180 | |
---|
[5246] | 181 | !$OMP MASTER |
---|
| 182 | call VTe(VTadvection) |
---|
| 183 | call stop_timer(timer_vanleer) |
---|
| 184 | call VTb(VThallo) |
---|
| 185 | !$OMP END MASTER |
---|
[1632] | 186 | |
---|
[5246] | 187 | call Register_SwapField_u(q_adv,q,distrib_caldyn, & |
---|
| 188 | Request_vanleer) |
---|
[1632] | 189 | |
---|
[5246] | 190 | call SendRequest(Request_vanleer) |
---|
| 191 | !$OMP BARRIER |
---|
| 192 | call WaitRequest(Request_vanleer) |
---|
[1632] | 193 | |
---|
[5246] | 194 | !$OMP BARRIER |
---|
| 195 | !$OMP MASTER |
---|
| 196 | call Set_Distrib(distrib_caldyn) |
---|
| 197 | call VTe(VThallo) |
---|
| 198 | call resume_timer(timer_caldyn) |
---|
| 199 | !$OMP END MASTER |
---|
| 200 | !$OMP BARRIER |
---|
| 201 | iadvtr=0 |
---|
| 202 | ENDIF ! if iadvtr.EQ.iapp_tracvl |
---|
[1632] | 203 | |
---|
[5246] | 204 | END SUBROUTINE caladvtrac_loc |
---|
[1632] | 205 | |
---|
| 206 | |
---|