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