LMDZ
massbar_p.F
Go to the documentation of this file.
1  SUBROUTINE massbar_p( masse, massebx, masseby )
2 
3 c
4 c **********************************************************************
5 c
6 c Calcule les moyennes en x et y de la masse d'air dans chaque maille.
7 c **********************************************************************
8 c Auteurs : P. Le Van , Fr. Hourdin .
9 c ..........
10 c
11 c .. masse est un argum. d'entree pour le s-pg ...
12 c .. massebx,masseby sont des argum. de sortie pour le s-pg ...
13 c
14 c
15  USE parallel_lmdz
16  IMPLICIT NONE
17 c
18 #include "dimensions.h"
19 #include "paramet.h"
20 #include "comconst.h"
21 #include "comgeom.h"
22 c
23  REAL masse( ip1jmp1,llm ), massebx( ip1jmp1,llm ) ,
24  * masseby( ip1jm,llm )
25  INTEGER ij,l,ijb,ije
26 c
27 c
28 c Methode pour calculer massebx et masseby .
29 c ----------------------------------------
30 c
31 c A chaque point scalaire P (i,j) est affecte 4 coefficients d'aires
32 c alpha1(i,j) calcule au point ( i+1/4,j-1/4 )
33 c alpha2(i,j) calcule au point ( i+1/4,j+1/4 )
34 c alpha3(i,j) calcule au point ( i-1/4,j+1/4 )
35 c alpha4(i,j) calcule au point ( i-1/4,j-1/4 )
36 c
37 c Avec alpha1(i,j) = aire(i+1/4,j-1/4)/ aire(i,j)
38 c
39 c N.B . Pour plus de details, voir s-pg ... iniconst ...
40 c
41 c
42 c
43 c alpha4 . . alpha1 . alpha4
44 c (i,j) (i,j) (i+1,j)
45 c
46 c P . U . . P
47 c (i,j) (i,j) (i+1,j)
48 c
49 c alpha3 . . alpha2 .alpha3
50 c (i,j) (i,j) (i+1,j)
51 c
52 c V . Z . . V
53 c (i,j)
54 c
55 c alpha4 . . alpha1 .alpha4
56 c (i,j+1) (i,j+1) (i+1,j+1)
57 c
58 c P . U . . P
59 c (i,j+1) (i+1,j+1)
60 c
61 c
62 c
63 c On a :
64 c
65 c massebx(i,j) = masse(i ,j) * ( alpha1(i ,j) + alpha2(i,j)) +
66 c masse(i+1,j) * ( alpha3(i+1,j) + alpha4(i+1,j) )
67 c localise au point ... U (i,j) ...
68 c
69 c masseby(i,j) = masse(i,j ) * ( alpha2(i,j ) + alpha3(i,j ) +
70 c masse(i,j+1) * ( alpha1(i,j+1) + alpha4(i,j+1)
71 c localise au point ... V (i,j) ...
72 c
73 c
74 c=======================================================================
75 
76 
77 
78 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
79  DO 100 l = 1 , llm
80 c
81  ijb=ij_begin
82  ije=ij_end+iip1
83  if (pole_sud) ije=ije-iip1
84 
85  DO ij = ijb, ije - 1
86  massebx(ij,l) = masse( ij, l) * alpha1p2( ij ) +
87  * masse(ij+1, l) * alpha3p4(ij+1 )
88  ENDDO
89 
90 c .... correction pour massebx( iip1,j) .....
91 c ... massebx(iip1,j)= massebx(1,j) ...
92 c
93 CDIR$ IVDEP
94 
95 
96 
97  DO ij = ijb+iim, ije+iim, iip1
98  massebx( ij,l ) = massebx( ij - iim,l )
99  ENDDO
100 
101 
102 
103  ijb=ij_begin-iip1
104  ije=ij_end+iip1
105  if (pole_nord) ijb=ij_begin
106  if (pole_sud) ije=ij_end-iip1
107 
108  DO ij = ijb,ije
109  masseby( ij,l ) = masse( ij , l ) * alpha2p3( ij ) +
110  * masse(ij+iip1, l ) * alpha1p4( ij+iip1 )
111  ENDDO
112 
113 100 CONTINUE
114 c$OMP END DO NOWAIT
115 c
116  RETURN
117  END
!$Header llmm1 INTEGER ip1jmp1
Definition: paramet.h:14
!$Header!CDK comgeom COMMON comgeom alpha1p2
Definition: comgeom.h:25
integer, save ij_end
logical, save pole_sud
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l llm
!$Header llmm1 INTEGER ip1jm
Definition: paramet.h:14
!$Header!CDK comgeom COMMON comgeom alpha1p4
Definition: comgeom.h:25
subroutine massbar_p(masse, massebx, masseby)
Definition: massbar_p.F:2
logical, save pole_nord
!$Header!CDK comgeom COMMON comgeom alpha3p4
Definition: comgeom.h:25
integer, save ij_begin
!$Header!CDK comgeom COMMON comgeom alpha2p3
Definition: comgeom.h:25
c c zjulian c cym CALL iim cym klev iim
Definition: ini_bilKP_ave.h:24