source: LMDZ5/trunk/libf/dyn3dmem/enercin_loc.F @ 1632

Last change on this file since 1632 was 1632, checked in by Laurent Fairhead, 12 years ago

Import initial du répertoire dyn3dmem

Attention! ceci n'est qu'une version préliminaire du code "basse mémoire":
le code contenu dans ce répertoire est basé sur la r1320 et a donc besoin
d'être mis à jour par rapport à la dynamique parallèle d'aujourd'hui.
Ce code est toutefois mis à disposition pour circonvenir à des problèmes
de mémoire que certaines configurations du modèle pourraient rencontrer.
Dans l'état, il compile et tourne sur vargas et au CCRT


Initial import of dyn3dmem

Warning! this is just a preliminary version of the memory light code:
it is based on r1320 of the code and thus needs to be updated before
it can replace the present dyn3dpar code. It is nevertheless put at your
disposal to circumvent some memory problems some LMDZ configurations may
encounter. In its present state, it will compile and run on vargas and CCRT

File size: 2.9 KB
Line 
1      SUBROUTINE enercin_loc ( vcov, ucov, vcont, ucont, ecin )
2      USE parallel
3      IMPLICIT NONE
4
5c=======================================================================
6c
7c   Auteur: P. Le Van
8c   -------
9c
10c   Objet:
11c   ------
12c
13c *********************************************************************
14c .. calcul de l'energie cinetique aux niveaux s  ......
15c *********************************************************************
16c  vcov, vcont, ucov et ucont sont des arguments d'entree pour le s-pg .
17c  ecin         est  un  argument de sortie pour le s-pg
18c
19c=======================================================================
20
21#include "dimensions.h"
22#include "paramet.h"
23#include "comgeom.h"
24
25      REAL vcov( ijb_v:ije_v,llm ),vcont( ijb_v:ije_v,llm )
26      REAL ucov( ijb_u:ije_u,llm ),ucont( ijb_u:ije_u,llm )
27      REAL ecin( ijb_u:ije_u,llm )
28
29      REAL ecinni( iip1 ),ecinsi( iip1 )
30
31      REAL ecinpn, ecinps
32      INTEGER     l,ij,i,ijb,ije
33
34      EXTERNAL    SSUM
35      REAL        SSUM
36
37
38
39c                 . V
40c                i,j-1
41
42c      alpha4 .       . alpha1
43
44
45c        U .      . P     . U
46c       i-1,j    i,j      i,j
47
48c      alpha3 .       . alpha2
49
50
51c                 . V
52c                i,j
53
54c   
55c  L'energie cinetique au point scalaire P(i,j) ,autre que les poles, est :
56c       Ecin = 0.5 * U(i-1,j)**2 *( alpha3 + alpha4 )  +
57c              0.5 * U(i  ,j)**2 *( alpha1 + alpha2 )  +
58c              0.5 * V(i,j-1)**2 *( alpha1 + alpha4 )  +
59c              0.5 * V(i,  j)**2 *( alpha2 + alpha3 )
60
61c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
62      DO 5 l = 1,llm
63     
64      ijb=ij_begin
65      ije=ij_end+iip1
66     
67      IF (pole_nord) ijb=ij_begin+iip1
68      IF (pole_sud)  ije=ij_end-iip1
69     
70      DO 1  ij = ijb, ije -1
71      ecin( ij+1, l )  =    0.5  *
72     * (   ucov( ij   ,l ) * ucont( ij   ,l ) * alpha3p4( ij +1 )   +
73     *     ucov( ij+1 ,l ) * ucont( ij+1 ,l ) * alpha1p2( ij +1 )   +
74     *     vcov(ij-iim,l ) * vcont(ij-iim,l ) * alpha1p4( ij +1 )   +
75     *     vcov( ij+ 1,l ) * vcont( ij+ 1,l ) * alpha2p3( ij +1 )   )
76   1  CONTINUE
77
78c    ... correction pour  ecin(1,j,l)  ....
79c    ...   ecin(1,j,l)= ecin(iip1,j,l) ...
80
81CDIR$ IVDEP
82      DO 2 ij = ijb, ije, iip1
83      ecin( ij,l ) = ecin( ij + iim, l )
84   2  CONTINUE
85
86c     calcul aux poles  .......
87
88      IF (pole_nord) THEN
89   
90        DO  i = 1, iim
91         ecinni(i) = vcov(    i  ,  l) *
92     *               vcont(    i    ,l) * aire(   i   )
93        ENDDO
94
95        ecinpn = 0.5 * SSUM( iim,ecinni,1 ) / apoln
96
97        DO ij = 1,iip1
98          ecin(   ij     , l ) = ecinpn
99        ENDDO
100   
101      ENDIF
102
103      IF (pole_sud) THEN
104   
105        DO  i = 1, iim
106         ecinsi(i) = vcov(i+ip1jmi1,l)*
107     *               vcont(i+ip1jmi1,l) * aire(i+ip1jm)
108        ENDDO
109
110        ecinps = 0.5 * SSUM( iim,ecinsi,1 ) / apols
111
112        DO ij = 1,iip1
113          ecin( ij+ ip1jm, l ) = ecinps
114        ENDDO
115   
116      ENDIF
117
118     
119   5  CONTINUE
120c$OMP END DO NOWAIT
121      RETURN
122      END
Note: See TracBrowser for help on using the repository browser.