source: LMDZ5/branches/testing/libf/dyn3dpar/groupe_p.F @ 1707

Last change on this file since 1707 was 1707, checked in by Laurent Fairhead, 11 years ago

Version testing basée sur la r1706


Testing release based on r1706

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
RevLine 
[630]1      subroutine groupe_p(pext,pbaru,pbarv,pbarum,pbarvm,wm)
2      USE parallel
3      implicit none
4
5c   sous-programme servant a fitlrer les champs de flux de masse aux
6c   poles en "regroupant" les mailles 2 par 2 puis 4 par 4 etc. au fur
7c   et a mesure qu'on se rapproche du pole.
8c
9c   en entree: pext, pbaru et pbarv
10c
11c   en sortie:  pbarum,pbarvm et wm.
12c
13c   remarque, le wm est recalcule a partir des pbaru pbarv et on n'a donc
14c   pas besoin de w en entree.
15
16#include "dimensions.h"
17#include "paramet.h"
18#include "comconst.h"
19#include "comgeom2.h"
20#include "comvert.h"
21
22      integer ngroup
23      parameter (ngroup=3)
24
25
26      real pbaru(iip1,jjp1,llm),pbarv(iip1,jjm,llm)
27      real pext(iip1,jjp1,llm)
28
29      real pbarum(iip1,jjp1,llm),pbarvm(iip1,jjm,llm)
30      real wm(iip1,jjp1,llm)
31
[764]32      real,save :: zconvm(iip1,jjp1,llm)
33      real,save :: zconvmm(iip1,jjp1,llm)
[630]34
35      real uu
36
37      integer i,j,l
38
[1707]39      logical firstcall,groupe_ok
40      save firstcall,groupe_ok
41c$OMP THREADPRIVATE(firstcall,groupe_ok)
[630]42
43      data firstcall/.true./
[1707]44      data groupe_ok/.true./
45
[630]46      integer ijb,ije,jjb,jje
47     
[1707]48      if (iim==1) then
49         groupe_ok=.false.
50      endif
51
[630]52      if (firstcall) then
[1707]53         if (groupe_ok) then
54           if(mod(iim,2**ngroup).ne.0) stop'probleme du nombre de point'
55         endif
[630]56         firstcall=.false.
57      endif
58
59c   Champs 1D
60
61      call convflu_p(pbaru,pbarv,llm,zconvm)
62
63c
64c      call scopy(ijp1llm,zconvm,1,zconvmm,1)
65c      call scopy(ijmllm,pbarv,1,pbarvm,1)
66     
67      jjb=jj_begin
68      jje=jj_end
[764]69
70c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
71      do l=1,llm
72        zconvmm(:,jjb:jje,l)=zconvm(:,jjb:jje,l)
73      enddo
74c$OMP END DO NOWAIT
75
[1707]76      if (groupe_ok) then
77         call groupeun_p(jjp1,llm,jjb,jje,zconvmm)
78      endif
[630]79     
80      jjb=jj_begin-1
81      jje=jj_end
82      if (pole_nord) jjb=jj_begin
83      if (pole_sud)  jje=jj_end-1
[764]84c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
85      do l=1,llm
86        pbarvm(:,jjb:jje,l)=pbarv(:,jjb:jje,l)
87      enddo
88c$OMP END DO NOWAIT
89
[1707]90      if (groupe_ok) then
91         call groupeun_p(jjm,llm,jjb,jje,pbarvm)
92      endif
[630]93
94c   Champs 3D
95   
96      jjb=jj_begin
97      jje=jj_end
98      if (pole_nord) jjb=jj_begin+1
99      if (pole_sud)  jje=jj_end-1
100     
[764]101c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
[630]102      do l=1,llm
103         do j=jjb,jje
104            uu=pbaru(iim,j,l)
105            do i=1,iim
106               uu=uu+pbarvm(i,j,l)-pbarvm(i,j-1,l)-zconvmm(i,j,l)
107               pbarum(i,j,l)=uu
108c     zconvm(i,j,l ) =  xflu(i-1,j,l)-xflu(i,j,l)+
109c    *                      yflu(i,j,l)-yflu(i,j-1,l)
110            enddo
111            pbarum(iip1,j,l)=pbarum(1,j,l)
112         enddo
113      enddo
[764]114c$OMP END DO NOWAIT
[1707]115
[630]116c    integration de la convergence de masse de haut  en bas ......
117   
118      jjb=jj_begin
119      jje=jj_end
[764]120
121c$OMP BARRIER
122c$OMP MASTER     
[630]123      do  l = llm-1,1,-1
124          do j=jjb,jje
125             do i=1,iip1
126                zconvmm(i,j,l)=zconvmm(i,j,l)+zconvmm(i,j,l+1)
127             enddo
128          enddo
129      enddo
[764]130
[630]131      if (.not. pole_sud) then
132        zconvmm(:,jj_end+1,:)=0
[764]133cym     wm(:,jj_end+1,:)=0
[630]134      endif
[764]135     
136c$OMP END MASTER
137c$OMP BARRIER     
138
[630]139      CALL vitvert_p(zconvmm(1,1,1),wm(1,1,1))
140
141      return
142      end
143
Note: See TracBrowser for help on using the repository browser.