[5103] | 1 | SUBROUTINE groupe_loc(pext, pbaru, pbarv, pbarum, pbarvm, wm) |
---|
[5101] | 2 | USE parallel_lmdz |
---|
| 3 | USE Write_field_loc |
---|
| 4 | USE groupe_mod |
---|
| 5 | USE comconst_mod, ONLY: ngroup |
---|
| 6 | USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO |
---|
[5136] | 7 | USE lmdz_comgeom2 |
---|
| 8 | |
---|
[5159] | 9 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
| 10 | USE lmdz_paramet |
---|
[5113] | 11 | IMPLICIT NONE |
---|
[1632] | 12 | |
---|
[5101] | 13 | ! sous-programme servant a fitlrer les champs de flux de masse aux |
---|
| 14 | ! poles en "regroupant" les mailles 2 par 2 puis 4 par 4 etc. au fur |
---|
| 15 | ! et a mesure qu'on se rapproche du pole. |
---|
[5159] | 16 | |
---|
[5101] | 17 | ! en entree: pext, pbaru et pbarv |
---|
[5159] | 18 | |
---|
[5101] | 19 | ! en sortie: pbarum,pbarvm et wm. |
---|
[5159] | 20 | |
---|
[5101] | 21 | ! remarque, le wm est recalcule a partir des pbaru pbarv et on n'a donc |
---|
| 22 | ! pas besoin de w en entree. |
---|
[1632] | 23 | |
---|
| 24 | |
---|
[5159] | 25 | |
---|
| 26 | |
---|
[5101] | 27 | ! integer ngroup |
---|
| 28 | ! parameter (ngroup=3) |
---|
[1632] | 29 | |
---|
[5116] | 30 | REAL :: pbaru(iip1, jjb_u:jje_u, llm), pbarv(iip1, jjb_v:jje_v, llm) |
---|
| 31 | REAL :: pext(iip1, jjb_u:jje_u, llm) |
---|
[1632] | 32 | |
---|
[5116] | 33 | REAL :: pbarum(iip1, jjb_u:jje_u, llm), pbarvm(iip1, jjb_v:jje_v, llm) |
---|
| 34 | REAL :: wm(iip1, jjb_u:jje_u, llm) |
---|
[1632] | 35 | |
---|
[5116] | 36 | REAL :: uu |
---|
[1632] | 37 | |
---|
[5116] | 38 | INTEGER :: i, j, l |
---|
[1632] | 39 | |
---|
[5117] | 40 | LOGICAL :: firstcall |
---|
[5101] | 41 | save firstcall |
---|
| 42 | !$OMP THREADPRIVATE(firstcall) |
---|
[1632] | 43 | |
---|
[5116] | 44 | INTEGER :: ijb, ije, jjb, jje |
---|
[1632] | 45 | |
---|
[5101] | 46 | ! Champs 1D |
---|
[1632] | 47 | |
---|
[5101] | 48 | CALL convflu_loc(pbaru, pbarv, llm, zconvm) |
---|
[1632] | 49 | |
---|
[5159] | 50 | |
---|
[5101] | 51 | ! CALL scopy(ijp1llm,zconvm,1,zconvmm,1) |
---|
| 52 | ! CALL scopy(ijmllm,pbarv,1,pbarvm,1) |
---|
[1632] | 53 | |
---|
[5101] | 54 | jjb = jj_begin |
---|
| 55 | jje = jj_end |
---|
[1632] | 56 | |
---|
[5101] | 57 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[5158] | 58 | DO l = 1, llm |
---|
[5101] | 59 | zconvmm(:, jjb:jje, l) = zconvm(:, jjb:jje, l) |
---|
| 60 | enddo |
---|
| 61 | !$OMP END DO NOWAIT |
---|
[1632] | 62 | |
---|
[5101] | 63 | CALL groupeun_loc(jjp1, llm, jjb_u, jje_u, jjb, jje, zconvmm) |
---|
[1632] | 64 | |
---|
[5101] | 65 | jjb = jj_begin - 1 |
---|
| 66 | jje = jj_end |
---|
[5117] | 67 | IF (pole_nord) jjb = jj_begin |
---|
| 68 | IF (pole_sud) jje = jj_end - 1 |
---|
[5101] | 69 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[5158] | 70 | DO l = 1, llm |
---|
[5101] | 71 | pbarvm(:, jjb:jje, l) = pbarv(:, jjb:jje, l) |
---|
| 72 | enddo |
---|
| 73 | !$OMP END DO NOWAIT |
---|
| 74 | |
---|
| 75 | IF (CPPKEY_DEBUGIO) THEN |
---|
| 76 | CALL WriteField_v('pbarvm', reshape(pbarvm, (/ip1jm, llm/))) |
---|
| 77 | END IF |
---|
| 78 | CALL groupeun_loc(jjm, llm, jjb_v, jje_v, jjb, jje, pbarvm) |
---|
| 79 | IF (CPPKEY_DEBUGIO) THEN |
---|
| 80 | CALL WriteField_v('pbarvm', reshape(pbarvm, (/ip1jm, llm/))) |
---|
| 81 | END IF |
---|
| 82 | ! Champs 3D |
---|
| 83 | |
---|
| 84 | jjb = jj_begin |
---|
| 85 | jje = jj_end |
---|
[5117] | 86 | IF (pole_nord) jjb = jj_begin + 1 |
---|
| 87 | IF (pole_sud) jje = jj_end - 1 |
---|
[5101] | 88 | |
---|
| 89 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
[5158] | 90 | DO l = 1, llm |
---|
| 91 | DO j = jjb, jje |
---|
[5101] | 92 | uu = pbaru(iim, j, l) |
---|
[5158] | 93 | DO i = 1, iim |
---|
[5101] | 94 | uu = uu + pbarvm(i, j, l) - pbarvm(i, j - 1, l) - zconvmm(i, j, l) |
---|
| 95 | pbarum(i, j, l) = uu |
---|
| 96 | ! zconvm(i,j,l ) = xflu(i-1,j,l)-xflu(i,j,l)+ |
---|
| 97 | ! * yflu(i,j,l)-yflu(i,j-1,l) |
---|
[1632] | 98 | enddo |
---|
[5101] | 99 | pbarum(iip1, j, l) = pbarum(1, j, l) |
---|
| 100 | enddo |
---|
| 101 | enddo |
---|
| 102 | !$OMP END DO NOWAIT |
---|
| 103 | ! integration de la convergence de masse de haut en bas ...... |
---|
[1632] | 104 | |
---|
[5101] | 105 | jjb = jj_begin |
---|
| 106 | jje = jj_end |
---|
| 107 | |
---|
| 108 | !$OMP BARRIER |
---|
| 109 | !$OMP MASTER |
---|
[5158] | 110 | DO l = llm - 1, 1, -1 |
---|
| 111 | DO j = jjb, jje |
---|
| 112 | DO i = 1, iip1 |
---|
[5101] | 113 | zconvmm(i, j, l) = zconvmm(i, j, l) + zconvmm(i, j, l + 1) |
---|
[1632] | 114 | enddo |
---|
[5101] | 115 | enddo |
---|
| 116 | enddo |
---|
[1632] | 117 | |
---|
[5117] | 118 | IF (.NOT. pole_sud) THEN |
---|
[5101] | 119 | zconvmm(:, jj_end + 1, :) = 0 |
---|
[5158] | 120 | !ym wm(:,jj_end+1,:)=0 |
---|
[5117] | 121 | ENDIF |
---|
[1632] | 122 | |
---|
[5101] | 123 | !$OMP END MASTER |
---|
| 124 | !$OMP BARRIER |
---|
[1632] | 125 | |
---|
[5101] | 126 | CALL vitvert_loc(zconvmm, wm) |
---|
[1632] | 127 | |
---|
[5105] | 128 | |
---|
[5103] | 129 | END SUBROUTINE groupe_loc |
---|
[5101] | 130 | |
---|