GCC Code Coverage Report


Directory: ./
File: dyn/fluxstokenc.f
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 0 56 0.0%
Branches: 0 28 0.0%

Line Branch Exec Source
1 !
2 ! $Id: fluxstokenc.F 2601 2016-07-24 09:51:55Z emillour $
3 !
4 SUBROUTINE fluxstokenc(pbaru,pbarv,masse,teta,phi,phis,
5 . time_step,itau )
6 ! This routine is designed to work with ioipsl
7
8 USE IOIPSL
9 c
10 c Auteur : F. Hourdin
11 c
12 c
13 ccc .. Modif. P. Le Van ( 20/12/97 ) ...
14 c
15 IMPLICIT NONE
16 c
17 include "dimensions.h"
18 include "paramet.h"
19 include "comgeom.h"
20 include "tracstoke.h"
21 include "iniprint.h"
22
23 REAL time_step,t_wrt, t_ops
24 REAL pbaru(ip1jmp1,llm),pbarv(ip1jm,llm)
25 REAL masse(ip1jmp1,llm),teta(ip1jmp1,llm),phi(ip1jmp1,llm)
26 REAL phis(ip1jmp1)
27
28 REAL pbaruc(ip1jmp1,llm),pbarvc(ip1jm,llm)
29 REAL massem(ip1jmp1,llm),tetac(ip1jmp1,llm),phic(ip1jmp1,llm)
30
31 REAL pbarug(ip1jmp1,llm),pbarvg(iip1,jjm,llm),wg(ip1jmp1,llm)
32
33 REAL pbarvst(iip1,jjp1,llm),zistdyn
34 real dtcum
35
36 INTEGER iadvtr,ndex(1)
37 integer nscal
38 real tst(1),ist(1),istp(1)
39 INTEGER ij,l,irec,i,j,itau
40 INTEGER, SAVE :: fluxid, fluxvid,fluxdid
41
42 SAVE iadvtr, massem,pbaruc,pbarvc,irec
43 SAVE phic,tetac
44 logical first
45 save first
46 data first/.true./
47 DATA iadvtr/0/
48
49
50 c AC initialisations
51 pbarug(:,:) = 0.
52 pbarvg(:,:,:) = 0.
53 wg(:,:) = 0.
54
55
56 if(first) then
57
58 CALL initfluxsto( 'fluxstoke',
59 . time_step,istdyn* time_step,istdyn* time_step,
60 . fluxid,fluxvid,fluxdid)
61
62 ndex(1) = 0
63 call histwrite(fluxid, 'phis', 1, phis, iip1*jjp1, ndex)
64 call histwrite(fluxid, 'aire', 1, aire, iip1*jjp1, ndex)
65
66 ndex(1) = 0
67 nscal = 1
68 tst(1) = time_step
69 call histwrite(fluxdid, 'dtvr', 1, tst, nscal, ndex)
70 ist(1)=istdyn
71 call histwrite(fluxdid, 'istdyn', 1, ist, nscal, ndex)
72 istp(1)= istphy
73 call histwrite(fluxdid, 'istphy', 1, istp, nscal, ndex)
74
75 first = .false.
76
77 endif
78
79
80 IF(iadvtr.EQ.0) THEN
81 phic(:,:)=0
82 tetac(:,:)=0
83 pbaruc(:,:)=0
84 pbarvc(:,:)=0
85 ENDIF
86
87 c accumulation des flux de masse horizontaux
88 DO l=1,llm
89 DO ij = 1,ip1jmp1
90 pbaruc(ij,l) = pbaruc(ij,l) + pbaru(ij,l)
91 tetac(ij,l) = tetac(ij,l) + teta(ij,l)
92 phic(ij,l) = phic(ij,l) + phi(ij,l)
93 ENDDO
94 DO ij = 1,ip1jm
95 pbarvc(ij,l) = pbarvc(ij,l) + pbarv(ij,l)
96 ENDDO
97 ENDDO
98
99 c selection de la masse instantannee des mailles avant le transport.
100 IF(iadvtr.EQ.0) THEN
101 CALL SCOPY(ip1jmp1*llm,masse,1,massem,1)
102 ENDIF
103
104 iadvtr = iadvtr+1
105
106
107 c Test pour savoir si on advecte a ce pas de temps
108 IF ( iadvtr.EQ.istdyn ) THEN
109 c normalisation
110 DO l=1,llm
111 DO ij = 1,ip1jmp1
112 pbaruc(ij,l) = pbaruc(ij,l)/REAL(istdyn)
113 tetac(ij,l) = tetac(ij,l)/REAL(istdyn)
114 phic(ij,l) = phic(ij,l)/REAL(istdyn)
115 ENDDO
116 DO ij = 1,ip1jm
117 pbarvc(ij,l) = pbarvc(ij,l)/REAL(istdyn)
118 ENDDO
119 ENDDO
120
121 c traitement des flux de masse avant advection.
122 c 1. calcul de w
123 c 2. groupement des mailles pres du pole.
124
125 CALL groupe( massem, pbaruc,pbarvc, pbarug,pbarvg,wg )
126
127 do l=1,llm
128 do j=1,jjm
129 do i=1,iip1
130 pbarvst(i,j,l)=pbarvg(i,j,l)
131 enddo
132 enddo
133 do i=1,iip1
134 pbarvst(i,jjp1,l)=0.
135 enddo
136 enddo
137
138 iadvtr=0
139 write(lunout,*)'ITAU auquel on stoke les fluxmasses',itau
140
141 call histwrite(fluxid, 'masse', itau, massem,
142 . iip1*jjp1*llm, ndex)
143
144 call histwrite(fluxid, 'pbaru', itau, pbarug,
145 . iip1*jjp1*llm, ndex)
146
147 call histwrite(fluxvid, 'pbarv', itau, pbarvg,
148 . iip1*jjm*llm, ndex)
149
150 call histwrite(fluxid, 'w' ,itau, wg,
151 . iip1*jjp1*llm, ndex)
152
153 call histwrite(fluxid, 'teta' ,itau, tetac,
154 . iip1*jjp1*llm, ndex)
155
156 call histwrite(fluxid, 'phi' ,itau, phic,
157 . iip1*jjp1*llm, ndex)
158
159 C
160
161 ENDIF ! if iadvtr.EQ.istdyn
162
163 ! of #ifdef 1
164 RETURN
165 END
166