source: LMDZ5/trunk/libf/dyn3dpar/groupe_p.F @ 1907

Last change on this file since 1907 was 1907, checked in by lguez, 10 years ago

Added a copyright property to every file of the distribution, except
for the fcm files (which have their own copyright). Use svn propget on
a file to see the copyright. For instance:

$ svn propget copyright libf/phylmd/physiq.F90
Name of program: LMDZ
Creation date: 1984
Version: LMDZ5
License: CeCILL version 2
Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
See the license file in the root directory

Also added the files defining the CeCILL version 2 license, in French
and English, at the top of the LMDZ tree.

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1      subroutine groupe_p(pext,pbaru,pbarv,pbarum,pbarvm,wm)
2      USE parallel_lmdz
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
32      real,save :: zconvm(iip1,jjp1,llm)
33      real,save :: zconvmm(iip1,jjp1,llm)
34
35      real uu
36
37      integer i,j,l
38
39      logical firstcall,groupe_ok
40      save firstcall,groupe_ok
41c$OMP THREADPRIVATE(firstcall,groupe_ok)
42
43      data firstcall/.true./
44      data groupe_ok/.true./
45
46      integer ijb,ije,jjb,jje
47     
48      if (iim==1) then
49         groupe_ok=.false.
50      endif
51
52      if (firstcall) then
53         if (groupe_ok) then
54           if(mod(iim,2**ngroup).ne.0) stop'probleme du nombre de point'
55         endif
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
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
76      if (groupe_ok) then
77         call groupeun_p(jjp1,llm,jjb,jje,zconvmm)
78      endif
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
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
90      if (groupe_ok) then
91         call groupeun_p(jjm,llm,jjb,jje,pbarvm)
92      endif
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     
101c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
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
114c$OMP END DO NOWAIT
115
116c    integration de la convergence de masse de haut  en bas ......
117   
118      jjb=jj_begin
119      jje=jj_end
120
121c$OMP BARRIER
122c$OMP MASTER     
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
130
131      if (.not. pole_sud) then
132        zconvmm(:,jj_end+1,:)=0
133cym     wm(:,jj_end+1,:)=0
134      endif
135     
136c$OMP END MASTER
137c$OMP BARRIER     
138
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.