GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: dyn3d/dissip.F Lines: 36 39 92.3 %
Date: 2023-06-30 12:56:34 Branches: 29 32 90.6 %

Line Branch Exec Source
1
!
2
! $Id: dissip.F 2597 2016-07-22 06:44:47Z emillour $
3
!
4
288
      SUBROUTINE dissip( vcov,ucov,teta,p, dv,du,dh )
5
c
6
      USE comconst_mod, ONLY: dtdiss
7
8
      IMPLICIT NONE
9
10
11
c ..  Avec nouveaux operateurs star :  gradiv2 , divgrad2, nxgraro2  ...
12
c                                 (  10/01/98  )
13
14
c=======================================================================
15
c
16
c   Auteur:  P. Le Van
17
c   -------
18
c
19
c   Objet:
20
c   ------
21
c
22
c   Dissipation horizontale
23
c
24
c=======================================================================
25
c-----------------------------------------------------------------------
26
c   Declarations:
27
c   -------------
28
29
      include "dimensions.h"
30
      include "paramet.h"
31
      include "comgeom.h"
32
      include "comdissnew.h"
33
      include "comdissipn.h"
34
35
c   Arguments:
36
c   ----------
37
38
      REAL,INTENT(IN) :: vcov(ip1jm,llm) ! covariant meridional wind
39
      REAL,INTENT(IN) :: ucov(ip1jmp1,llm) ! covariant zonal wind
40
      REAL,INTENT(IN) :: teta(ip1jmp1,llm) ! potential temperature
41
      REAL,INTENT(IN) :: p(ip1jmp1,llmp1) ! pressure
42
      ! tendencies (.../s) on covariant winds and potential temperature
43
      REAL,INTENT(OUT) :: dv(ip1jm,llm)
44
      REAL,INTENT(OUT) :: du(ip1jmp1,llm)
45
      REAL,INTENT(OUT) :: dh(ip1jmp1,llm)
46
47
c   Local:
48
c   ------
49
50
      REAL gdx(ip1jmp1,llm),gdy(ip1jm,llm)
51
      REAL grx(ip1jmp1,llm),gry(ip1jm,llm)
52
      REAL te1dt(llm),te2dt(llm),te3dt(llm)
53
      REAL deltapres(ip1jmp1,llm)
54
55
      INTEGER l,ij
56
57
      REAL  SSUM
58
59
c-----------------------------------------------------------------------
60
c   initialisations:
61
c   ----------------
62
63
11520
      DO l=1,llm
64
11232
         te1dt(l) = tetaudiv(l) * dtdiss
65
11232
         te2dt(l) = tetaurot(l) * dtdiss
66
11520
         te3dt(l) = tetah(l)    * dtdiss
67
      ENDDO
68
288
      du=0.
69
288
      dv=0.
70
288
      dh=0.
71
72
c-----------------------------------------------------------------------
73
c   Calcul de la dissipation:
74
c   -------------------------
75
76
c   Calcul de la partie   grad  ( div ) :
77
c   -------------------------------------
78
79
80
288
      IF(lstardis) THEN
81
288
         CALL gradiv2( llm,ucov,vcov,nitergdiv,gdx,gdy )
82
      ELSE
83
         CALL gradiv ( llm,ucov,vcov,nitergdiv,gdx,gdy )
84
      ENDIF
85
86
11520
      DO l=1,llm
87
88
381888
         DO ij = 1, iip1
89
370656
            gdx(     ij ,l) = 0.
90
381888
            gdx(ij+ip1jm,l) = 0.
91
         ENDDO
92
93
11501568
         DO ij = iip2,ip1jm
94
11501568
            du(ij,l) = du(ij,l) - te1dt(l) *gdx(ij,l)
95
         ENDDO
96
11872512
         DO ij = 1,ip1jm
97
11872224
            dv(ij,l) = dv(ij,l) - te1dt(l) *gdy(ij,l)
98
         ENDDO
99
100
       ENDDO
101
102
c   calcul de la partie   n X grad ( rot ):
103
c   ---------------------------------------
104
105
288
      IF(lstardis) THEN
106
288
         CALL nxgraro2( llm,ucov, vcov, nitergrot,grx,gry )
107
      ELSE
108
         CALL nxgrarot( llm,ucov, vcov, nitergrot,grx,gry )
109
      ENDIF
110
111
112
11520
      DO l=1,llm
113
381888
         DO ij = 1, iip1
114
381888
            grx(ij,l) = 0.
115
         ENDDO
116
117
11501568
         DO ij = iip2,ip1jm
118
11501568
            du(ij,l) = du(ij,l) - te2dt(l) * grx(ij,l)
119
         ENDDO
120
11872512
         DO ij =  1, ip1jm
121
11872224
            dv(ij,l) = dv(ij,l) - te2dt(l) * gry(ij,l)
122
         ENDDO
123
      ENDDO
124
125
c   calcul de la partie   div ( grad ):
126
c   -----------------------------------
127
128
129
288
      IF(lstardis) THEN
130
131
11520
       DO l = 1, llm
132
12243168
          DO ij = 1, ip1jmp1
133
12242880
            deltapres(ij,l) = AMAX1( 0.,  p(ij,l) - p(ij,l+1) )
134
          ENDDO
135
       ENDDO
136
137
288
         CALL divgrad2( llm,teta, deltapres  ,niterh, gdx )
138
      ELSE
139
         CALL divgrad ( llm,teta, niterh, gdx        )
140
      ENDIF
141
142
11520
      DO l = 1,llm
143
12243168
         DO ij = 1,ip1jmp1
144
12242880
            dh( ij,l ) = dh( ij,l ) - te3dt(l) * gdx( ij,l )
145
         ENDDO
146
      ENDDO
147
148
288
      RETURN
149
      END