[5105] | 1 | SUBROUTINE nxgraro2_loc(klevel,xcov,ycov,lr,grx_out,gry_out) |
---|
[5159] | 2 | |
---|
[5105] | 3 | ! P.Le Van . |
---|
| 4 | ! *********************************************************** |
---|
| 5 | ! lr |
---|
| 6 | ! calcul de ( nxgrad (rot) ) du vect. v .... |
---|
[5159] | 7 | |
---|
[5105] | 8 | ! xcov et ycov etant les compos. covariantes de v |
---|
| 9 | ! *********************************************************** |
---|
| 10 | ! xcov , ycov et lr sont des arguments d'entree pour le s-prog |
---|
| 11 | ! grx et gry sont des arguments de sortie pour le s-prog |
---|
[5159] | 12 | |
---|
| 13 | |
---|
[5105] | 14 | USE write_Field_p |
---|
| 15 | USE parallel_lmdz |
---|
| 16 | USE times |
---|
| 17 | USE mod_hallo |
---|
[5106] | 18 | USE lmdz_filtreg_p |
---|
[5105] | 19 | USE nxgraro2_mod |
---|
[5134] | 20 | USE lmdz_comdissipn, ONLY: tetaudiv, tetaurot, tetah, cdivu, crot, cdivh |
---|
| 21 | |
---|
[5159] | 22 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
| 23 | USE lmdz_paramet |
---|
[5105] | 24 | IMPLICIT NONE |
---|
| 25 | ! |
---|
[5159] | 26 | |
---|
| 27 | |
---|
| 28 | |
---|
[5105] | 29 | ! ...... variables en arguments ....... |
---|
[5159] | 30 | |
---|
[5105] | 31 | INTEGER :: klevel |
---|
| 32 | REAL :: xcov( ijb_u:ije_u,klevel ), ycov( ijb_v:ije_v,klevel ) |
---|
| 33 | REAL :: grx_out( ijb_u:ije_u,klevel ),gry_out(ijb_v:ije_v,klevel) |
---|
[5159] | 34 | |
---|
[5105] | 35 | ! ...... variables locales ........ |
---|
[5159] | 36 | |
---|
[5105] | 37 | REAL :: signe, nugradrs |
---|
| 38 | INTEGER :: l,ij,iter,lr |
---|
| 39 | Type(Request),SAVE :: Request_dissip |
---|
[1848] | 40 | !$OMP THREADPRIVATE(Request_dissip) |
---|
[5105] | 41 | ! ........................................................ |
---|
[5159] | 42 | |
---|
[5105] | 43 | INTEGER :: ijb,ije,jjb,jje |
---|
[1632] | 44 | |
---|
[5159] | 45 | |
---|
| 46 | |
---|
[5105] | 47 | signe = (-1.)**lr |
---|
| 48 | nugradrs = signe * crot |
---|
[5159] | 49 | |
---|
[5105] | 50 | ! CALL SCOPY ( ip1jmp1* klevel, xcov, 1, grx, 1 ) |
---|
| 51 | ! CALL SCOPY ( ip1jm * klevel, ycov, 1, gry, 1 ) |
---|
[1632] | 52 | |
---|
[5105] | 53 | ijb=ij_begin |
---|
| 54 | ije=ij_end |
---|
[1632] | 55 | |
---|
[5105] | 56 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 57 | DO l = 1, klevel |
---|
| 58 | grx(ijb:ije,l)=xcov(ijb:ije,l) |
---|
| 59 | ENDDO |
---|
| 60 | !$OMP END DO NOWAIT |
---|
[1632] | 61 | |
---|
[5105] | 62 | !$OMP BARRIER |
---|
| 63 | CALL Register_Hallo_u(grx,llm,0,1,1,0,Request_dissip) |
---|
| 64 | CALL SendRequest(Request_dissip) |
---|
| 65 | !$OMP BARRIER |
---|
| 66 | CALL WaitRequest(Request_dissip) |
---|
| 67 | !$OMP BARRIER |
---|
[1632] | 68 | |
---|
[5105] | 69 | ijb=ij_begin |
---|
| 70 | ije=ij_end |
---|
[5116] | 71 | IF(pole_sud) ije=ij_end-iip1 |
---|
[1632] | 72 | |
---|
[5105] | 73 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 74 | DO l = 1, klevel |
---|
| 75 | gry(ijb:ije,l)=ycov(ijb:ije,l) |
---|
| 76 | ENDDO |
---|
| 77 | !$OMP END DO NOWAIT |
---|
[1632] | 78 | |
---|
[5159] | 79 | |
---|
[5105] | 80 | CALL rotatf_loc ( klevel, grx, gry, rot ) |
---|
| 81 | ! CALL write_field3d_p('rot1',reshape(rot,(/iip1,jjm,llm/))) |
---|
[1632] | 82 | |
---|
[5105] | 83 | !$OMP BARRIER |
---|
| 84 | CALL Register_Hallo_v(rot,llm,1,1,1,1,Request_dissip) |
---|
| 85 | CALL SendRequest(Request_dissip) |
---|
| 86 | !$OMP BARRIER |
---|
| 87 | CALL WaitRequest(Request_dissip) |
---|
| 88 | !$OMP BARRIER |
---|
| 89 | |
---|
| 90 | CALL laplacien_rot_loc ( klevel, rot, rot,grx,gry ) |
---|
| 91 | ! CALL write_field3d_p('rot2',reshape(rot,(/iip1,jjm,llm/))) |
---|
[5159] | 92 | |
---|
[5105] | 93 | ! ..... Iteration de l'operateur laplacien_rotgam ..... |
---|
[5159] | 94 | |
---|
[5105] | 95 | DO iter = 1, lr -2 |
---|
| 96 | !$OMP BARRIER |
---|
| 97 | CALL Register_Hallo_v(rot,llm,1,1,1,1,Request_dissip) |
---|
| 98 | CALL SendRequest(Request_dissip) |
---|
| 99 | !$OMP BARRIER |
---|
| 100 | CALL WaitRequest(Request_dissip) |
---|
| 101 | !$OMP BARRIER |
---|
| 102 | |
---|
| 103 | CALL laplacien_rotgam_loc( klevel, rot, rot ) |
---|
| 104 | ENDDO |
---|
| 105 | |
---|
| 106 | ! CALL write_field3d_p('rot3',reshape(rot,(/iip1,jjm,llm/))) |
---|
| 107 | |
---|
[5159] | 108 | |
---|
| 109 | |
---|
[5105] | 110 | jjb=jj_begin |
---|
| 111 | jje=jj_end |
---|
[5117] | 112 | IF (pole_sud) jje=jj_end-1 |
---|
[5105] | 113 | |
---|
| 114 | CALL filtreg_p( rot, jjb_v,jje_v, jjb,jje,jjm, & |
---|
| 115 | klevel, 2,1, .FALSE.,1) |
---|
| 116 | !$OMP BARRIER |
---|
| 117 | CALL Register_Hallo_v(rot,llm,1,0,0,1,Request_dissip) |
---|
| 118 | CALL SendRequest(Request_dissip) |
---|
| 119 | !$OMP BARRIER |
---|
| 120 | CALL WaitRequest(Request_dissip) |
---|
| 121 | !$OMP BARRIER |
---|
| 122 | |
---|
| 123 | CALL nxgrad_loc ( klevel, rot, grx, gry ) |
---|
| 124 | |
---|
[5159] | 125 | |
---|
[5105] | 126 | ijb=ij_begin |
---|
| 127 | ije=ij_end |
---|
| 128 | |
---|
| 129 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 130 | DO l = 1, klevel |
---|
| 131 | |
---|
[5116] | 132 | IF(pole_sud) ije=ij_end-iip1 |
---|
[5105] | 133 | DO ij = ijb, ije |
---|
| 134 | gry_out( ij,l ) = gry( ij,l ) * nugradrs |
---|
| 135 | ENDDO |
---|
| 136 | |
---|
[5116] | 137 | IF(pole_sud) ije=ij_end |
---|
[5105] | 138 | DO ij = ijb, ije |
---|
| 139 | grx_out( ij,l ) = grx( ij,l ) * nugradrs |
---|
| 140 | ENDDO |
---|
| 141 | |
---|
| 142 | ENDDO |
---|
| 143 | !$OMP END DO NOWAIT |
---|
| 144 | ! |
---|
| 145 | |
---|
| 146 | END SUBROUTINE nxgraro2_loc |
---|