LMDZ
convflu_p.F
Go to the documentation of this file.
1  SUBROUTINE convflu_p( xflu,yflu,nbniv,convfl )
2 c
3 c P. Le Van
4 c
5 c
6 c *******************************************************************
7 c ... calcule la (convergence horiz. * aire locale)du flux ayant pour
8 c composantes xflu et yflu ,variables extensives . ......
9 c *******************************************************************
10 c xflu , yflu et nbniv sont des arguments d'entree pour le s-pg ..
11 c convfl est un argument de sortie pour le s-pg .
12 c
13 c njxflu est le nombre de lignes de latitude de xflu,
14 c ( = jjm ou jjp1 )
15 c nbniv est le nombre de niveaux vert. de xflu et de yflu .
16 c
17  USE parallel_lmdz
18  IMPLICIT NONE
19 c
20 #include "dimensions.h"
21 #include "paramet.h"
22  REAL xflu,yflu,convfl,convpn,convps
23  INTEGER l,ij,nbniv
24  dimension xflu( ip1jmp1,nbniv ),yflu( ip1jm,nbniv ) ,
25  * convfl( ip1jmp1,nbniv )
26 c
27  INTEGER ijb,ije
28  EXTERNAL ssum
29  REAL SSUM
30 c
31 c
32 #include "comgeom.h"
33 c
34 
35 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
36  DO 5 l = 1,nbniv
37 c
38  ijb=ij_begin
39  ije=ij_end+iip1
40 
41  IF (pole_nord) ijb=ij_begin+iip1
42  IF (pole_sud) ije=ij_end-iip1
43 
44  DO 2 ij = ijb , ije - 1
45  convfl(ij+1,l) = xflu(ij,l) - xflu(ij+ 1,l) +
46  * yflu(ij +1,l ) - yflu( ij -iim,l )
47  2 CONTINUE
48 c
49 c
50 
51 c .... correction pour convfl( 1,j,l) ......
52 c .... convfl(1,j,l)= convfl(iip1,j,l) ...
53 c
54 CDIR$ IVDEP
55  DO 3 ij = ijb,ije,iip1
56  convfl( ij,l ) = convfl( ij + iim,l )
57  3 CONTINUE
58 c
59 c ...... calcul aux poles .......
60 c
61  IF (pole_nord) THEN
62 
63  convpn = ssum( iim, yflu( 1 ,l ), 1 )
64 
65  DO ij = 1,iip1
66  convfl(ij,l) = convpn * aire(ij) / apoln
67  ENDDO
68 
69  ENDIF
70 
71  IF (pole_sud) THEN
72 
73  convps = - ssum( iim, yflu( ip1jm-iim,l ), 1 )
74 
75  DO ij = 1,iip1
76  convfl(ij+ip1jm,l) = convps * aire(ij+ ip1jm) / apols
77  ENDDO
78 
79  ENDIF
80 
81  5 CONTINUE
82 c$OMP END DO NOWAIT
83  RETURN
84  END
!$Header llmm1 INTEGER ip1jmp1
Definition: paramet.h:14
!$Header!CDK comgeom COMMON comgeom apols
Definition: comgeom.h:8
integer, save ij_end
logical, save pole_sud
subroutine convflu_p(xflu, yflu, nbniv, convfl)
Definition: convflu_p.F:2
!$Header!CDK comgeom COMMON comgeom aire
Definition: comgeom.h:25
!$Header llmm1 INTEGER ip1jm
Definition: paramet.h:14
!$Header!CDK comgeom COMMON comgeom apoln
Definition: comgeom.h:8
logical, save pole_nord
integer, save ij_begin
c c zjulian c cym CALL iim cym klev iim
Definition: ini_bilKP_ave.h:24
real function ssum(n, sx, incx)
Definition: cray.F:27