1 | SUBROUTINE cv3a_compress(len, nloc, ncum, nd, ntra, compress, & |
---|
2 | iflag1, nk1, icb1, icbs1, & |
---|
3 | plcl1, tnk1, qnk1, gznk1, hnk1, unk1, vnk1, & |
---|
4 | wghti1, pbase1, buoybase1, & |
---|
5 | t1, q1, qs1, t1_wake, q1_wake, qs1_wake, s1_wake, & |
---|
6 | u1, v1, gz1, th1, th1_wake, & |
---|
7 | tra1, & |
---|
8 | h1, lv1, lf1, cpn1, p1, ph1, tv1, tp1, tvp1, clw1, & |
---|
9 | h1_wake, lv1_wake, lf1_wake, cpn1_wake, tv1_wake, & |
---|
10 | sig1, w01, ptop21, & |
---|
11 | Ale1, Alp1, omega1, & |
---|
12 | iflag, nk, icb, icbs, & |
---|
13 | plcl, tnk, qnk, gznk, hnk, unk, vnk, & |
---|
14 | wghti, pbase, buoybase, & |
---|
15 | t, q, qs, t_wake, q_wake, qs_wake, s_wake, & |
---|
16 | u, v, gz, th, th_wake, & |
---|
17 | tra, & |
---|
18 | h, lv, lf, cpn, p, ph, tv, tp, tvp, clw, & |
---|
19 | h_wake, lv_wake, lf_wake, cpn_wake, tv_wake, & |
---|
20 | sig, w0, ptop2, & |
---|
21 | Ale, Alp, omega & |
---|
22 | #ifdef ISO |
---|
23 | & ,xtnk1,xt1,xt1_wake,xtclw1 & |
---|
24 | & ,xtnk,xt,xt_wake,xtclw & |
---|
25 | #endif |
---|
26 | & ) |
---|
27 | ! ************************************************************** |
---|
28 | ! * |
---|
29 | ! CV3A_COMPRESS * |
---|
30 | ! * |
---|
31 | ! * |
---|
32 | ! written by : Sandrine Bony-Lena , 17/05/2003, 11.22.15 * |
---|
33 | ! modified by : Jean-Yves Grandpeix, 23/06/2003, 10.28.09 * |
---|
34 | ! ************************************************************** |
---|
35 | #ifdef ISO |
---|
36 | use infotrac_phy, ONLY: ntraciso |
---|
37 | use isotopes_mod, ONLY: essai_convergence, iso_eau,iso_HDO |
---|
38 | #ifdef ISOVERIF |
---|
39 | use isotopes_verif_mod |
---|
40 | #endif |
---|
41 | #endif |
---|
42 | |
---|
43 | IMPLICIT NONE |
---|
44 | |
---|
45 | include "cv3param.h" |
---|
46 | |
---|
47 | ! inputs: |
---|
48 | INTEGER, INTENT (IN) :: len, nloc, nd, ntra |
---|
49 | !jyg< |
---|
50 | LOGICAL, INTENT (IN) :: compress ! compression is performed if compress is true |
---|
51 | !>jyg |
---|
52 | INTEGER, DIMENSION (len), INTENT (IN) :: iflag1, nk1, icb1, icbs1 |
---|
53 | REAL, DIMENSION (len), INTENT (IN) :: plcl1, tnk1, qnk1, gznk1 |
---|
54 | REAL, DIMENSION (len), INTENT (IN) :: hnk1, unk1, vnk1 |
---|
55 | REAL, DIMENSION (len, nd), INTENT (IN) :: wghti1(len, nd) |
---|
56 | REAL, DIMENSION (len), INTENT (IN) :: pbase1, buoybase1 |
---|
57 | REAL, DIMENSION (len, nd), INTENT (IN) :: t1, q1, qs1 |
---|
58 | REAL, DIMENSION (len, nd), INTENT (IN) :: t1_wake, q1_wake, qs1_wake |
---|
59 | REAL, DIMENSION (len), INTENT (IN) :: s1_wake |
---|
60 | REAL, DIMENSION (len, nd), INTENT (IN) :: u1, v1 |
---|
61 | REAL, DIMENSION (len, nd), INTENT (IN) :: gz1, th1, th1_wake |
---|
62 | REAL, DIMENSION (len, nd,ntra), INTENT (IN) :: tra1 |
---|
63 | REAL, DIMENSION (len, nd), INTENT (IN) :: h1, lv1, lf1, cpn1 |
---|
64 | REAL, DIMENSION (len, nd), INTENT (IN) :: p1 |
---|
65 | REAL, DIMENSION (len, nd+1), INTENT (IN) :: ph1(len, nd+1) |
---|
66 | REAL, DIMENSION (len, nd), INTENT (IN) :: tv1, tp1 |
---|
67 | REAL, DIMENSION (len, nd), INTENT (IN) :: tvp1, clw1 |
---|
68 | REAL, DIMENSION (len, nd), INTENT (IN) :: h1_wake, lv1_wake, cpn1_wake |
---|
69 | REAL, DIMENSION (len, nd), INTENT (IN) :: tv1_wake, lf1_wake |
---|
70 | REAL, DIMENSION (len, nd), INTENT (IN) :: sig1, w01 |
---|
71 | REAL, DIMENSION (len), INTENT (IN) :: ptop21 |
---|
72 | REAL, DIMENSION (len), INTENT (IN) :: Ale1, Alp1 |
---|
73 | REAL, DIMENSION (len, nd), INTENT (IN) :: omega1 |
---|
74 | #ifdef ISO |
---|
75 | real xtclw1(ntraciso,len,nd) |
---|
76 | real xtnk1(ntraciso,len) |
---|
77 | real xt1(ntraciso,len,nd) |
---|
78 | real xt1_wake(ntraciso,len,nd) |
---|
79 | #endif |
---|
80 | ! |
---|
81 | ! in/out |
---|
82 | INTEGER, INTENT (INOUT) :: ncum |
---|
83 | ! |
---|
84 | ! outputs: |
---|
85 | ! en fait, on a nloc=len pour l'instant (cf cv_driver) |
---|
86 | INTEGER, DIMENSION (nloc), INTENT (OUT) :: iflag, nk, icb, icbs |
---|
87 | REAL, DIMENSION (nloc), INTENT (OUT) :: plcl, tnk, qnk, gznk |
---|
88 | REAL, DIMENSION (nloc), INTENT (OUT) :: hnk, unk, vnk |
---|
89 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: wghti |
---|
90 | REAL, DIMENSION (nloc), INTENT (OUT) :: pbase, buoybase |
---|
91 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: t, q, qs |
---|
92 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: t_wake, q_wake, qs_wake |
---|
93 | REAL, DIMENSION (nloc), INTENT (OUT) :: s_wake |
---|
94 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: u, v |
---|
95 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: gz, th, th_wake |
---|
96 | REAL, DIMENSION (nloc, nd,ntra), INTENT (OUT) :: tra |
---|
97 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: h, lv, lf, cpn |
---|
98 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: p |
---|
99 | REAL, DIMENSION (nloc, nd+1), INTENT (OUT) :: ph |
---|
100 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: tv, tp |
---|
101 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: tvp, clw |
---|
102 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: h_wake, lv_wake, cpn_wake |
---|
103 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: tv_wake, lf_wake |
---|
104 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: sig, w0 |
---|
105 | REAL, DIMENSION (nloc), INTENT (OUT) :: ptop2 |
---|
106 | REAL, DIMENSION (nloc), INTENT (OUT) :: Ale, Alp |
---|
107 | REAL, DIMENSION (nloc, nd), INTENT (OUT) :: omega |
---|
108 | #ifdef ISO |
---|
109 | real xtclw(ntraciso,len,nd) |
---|
110 | real xtnk(ntraciso,len) |
---|
111 | real xt(ntraciso,len,nd) |
---|
112 | real xt_wake(ntraciso,len,nd) |
---|
113 | #endif |
---|
114 | |
---|
115 | ! local variables: |
---|
116 | INTEGER i, k, nn, j |
---|
117 | #ifdef ISO |
---|
118 | integer ixt |
---|
119 | #endif |
---|
120 | |
---|
121 | CHARACTER (LEN=20) :: modname = 'cv3a_compress' |
---|
122 | CHARACTER (LEN=80) :: abort_message |
---|
123 | |
---|
124 | !jyg< |
---|
125 | IF (compress) THEN |
---|
126 | !>jyg |
---|
127 | |
---|
128 | DO k = 1, nl + 1 |
---|
129 | nn = 0 |
---|
130 | DO i = 1, len |
---|
131 | IF (iflag1(i)==0) THEN |
---|
132 | nn = nn + 1 |
---|
133 | wghti(nn, k) = wghti1(i, k) |
---|
134 | t(nn, k) = t1(i, k) |
---|
135 | q(nn, k) = q1(i, k) |
---|
136 | qs(nn, k) = qs1(i, k) |
---|
137 | t_wake(nn, k) = t1_wake(i, k) |
---|
138 | q_wake(nn, k) = q1_wake(i, k) |
---|
139 | qs_wake(nn, k) = qs1_wake(i, k) |
---|
140 | u(nn, k) = u1(i, k) |
---|
141 | v(nn, k) = v1(i, k) |
---|
142 | gz(nn, k) = gz1(i, k) |
---|
143 | th(nn, k) = th1(i, k) |
---|
144 | th_wake(nn, k) = th1_wake(i, k) |
---|
145 | h(nn, k) = h1(i, k) |
---|
146 | lv(nn, k) = lv1(i, k) |
---|
147 | lf(nn, k) = lf1(i, k) |
---|
148 | cpn(nn, k) = cpn1(i, k) |
---|
149 | p(nn, k) = p1(i, k) |
---|
150 | ph(nn, k) = ph1(i, k) |
---|
151 | tv(nn, k) = tv1(i, k) |
---|
152 | tp(nn, k) = tp1(i, k) |
---|
153 | tvp(nn, k) = tvp1(i, k) |
---|
154 | clw(nn, k) = clw1(i, k) |
---|
155 | h_wake(nn, k) = h1_wake(i, k) |
---|
156 | lv_wake(nn, k) = lv1_wake(i, k) |
---|
157 | lf_wake(nn, k) = lf1_wake(i, k) |
---|
158 | cpn_wake(nn, k) = cpn1_wake(i, k) |
---|
159 | tv_wake(nn, k) = tv1_wake(i, k) |
---|
160 | sig(nn, k) = sig1(i, k) |
---|
161 | w0(nn, k) = w01(i, k) |
---|
162 | omega(nn, k) = omega1(i, k) |
---|
163 | #ifdef ISO |
---|
164 | do ixt=1,ntraciso |
---|
165 | xt(ixt,nn,k)=xt1(ixt,i,k) |
---|
166 | xt_wake(ixt,nn,k)=xt1_wake(ixt,i,k) |
---|
167 | xtclw(ixt,nn,k)=xtclw1(ixt,i,k) |
---|
168 | enddo |
---|
169 | #endif |
---|
170 | END IF |
---|
171 | END DO |
---|
172 | END DO |
---|
173 | ! |
---|
174 | ! AC! do 121 j=1,ntra |
---|
175 | ! AC!ccccc do 111 k=1,nl+1 |
---|
176 | ! AC! do 111 k=1,nd |
---|
177 | ! AC! nn=0 |
---|
178 | ! AC! do 101 i=1,len |
---|
179 | ! AC! if(iflag1(i).eq.0)then |
---|
180 | ! AC! nn=nn+1 |
---|
181 | ! AC! tra(nn,k,j)=tra1(i,k,j) |
---|
182 | ! AC! endif |
---|
183 | ! AC! 101 continue |
---|
184 | ! AC! 111 continue |
---|
185 | ! AC! 121 continue |
---|
186 | |
---|
187 | IF (nn/=ncum) THEN |
---|
188 | PRINT *, 'WARNING nn not equal to ncum: ', nn, ncum |
---|
189 | abort_message = '' |
---|
190 | CALL abort_physic(modname, abort_message, 1) |
---|
191 | END IF |
---|
192 | |
---|
193 | nn = 0 |
---|
194 | DO i = 1, len |
---|
195 | IF (iflag1(i)==0) THEN |
---|
196 | nn = nn + 1 |
---|
197 | s_wake(nn) = s1_wake(i) |
---|
198 | iflag(nn) = iflag1(i) |
---|
199 | nk(nn) = nk1(i) |
---|
200 | icb(nn) = icb1(i) |
---|
201 | icbs(nn) = icbs1(i) |
---|
202 | plcl(nn) = plcl1(i) |
---|
203 | tnk(nn) = tnk1(i) |
---|
204 | qnk(nn) = qnk1(i) |
---|
205 | gznk(nn) = gznk1(i) |
---|
206 | hnk(nn) = hnk1(i) |
---|
207 | unk(nn) = unk1(i) |
---|
208 | vnk(nn) = vnk1(i) |
---|
209 | pbase(nn) = pbase1(i) |
---|
210 | buoybase(nn) = buoybase1(i) |
---|
211 | sig(nn, nd) = sig1(i, nd) |
---|
212 | ptop2(nn) = ptop2(i) |
---|
213 | Ale(nn) = Ale1(i) |
---|
214 | Alp(nn) = Alp1(i) |
---|
215 | #ifdef ISO |
---|
216 | do ixt=1,ntraciso |
---|
217 | xtnk(ixt,nn)=xtnk1(ixt,i) |
---|
218 | enddo |
---|
219 | #endif |
---|
220 | END IF |
---|
221 | END DO |
---|
222 | |
---|
223 | IF (nn/=ncum) THEN |
---|
224 | PRINT *, 'WARNING nn not equal to ncum: ', nn, ncum |
---|
225 | abort_message = '' |
---|
226 | CALL abort_physic(modname, abort_message, 1) |
---|
227 | END IF |
---|
228 | ! |
---|
229 | !jyg< |
---|
230 | ELSE !(compress) |
---|
231 | ! |
---|
232 | ncum = len |
---|
233 | ! |
---|
234 | wghti(:,1:nl+1) = wghti1(:,1:nl+1) |
---|
235 | t(:,1:nl+1) = t1(:,1:nl+1) |
---|
236 | q(:,1:nl+1) = q1(:,1:nl+1) |
---|
237 | qs(:,1:nl+1) = qs1(:,1:nl+1) |
---|
238 | t_wake(:,1:nl+1) = t1_wake(:,1:nl+1) |
---|
239 | q_wake(:,1:nl+1) = q1_wake(:,1:nl+1) |
---|
240 | qs_wake(:,1:nl+1) = qs1_wake(:,1:nl+1) |
---|
241 | u(:,1:nl+1) = u1(:,1:nl+1) |
---|
242 | v(:,1:nl+1) = v1(:,1:nl+1) |
---|
243 | gz(:,1:nl+1) = gz1(:,1:nl+1) |
---|
244 | th(:,1:nl+1) = th1(:,1:nl+1) |
---|
245 | th_wake(:,1:nl+1) = th1_wake(:,1:nl+1) |
---|
246 | h(:,1:nl+1) = h1(:,1:nl+1) |
---|
247 | lv(:,1:nl+1) = lv1(:,1:nl+1) |
---|
248 | lf(:,1:nl+1) = lf1(:,1:nl+1) |
---|
249 | cpn(:,1:nl+1) = cpn1(:,1:nl+1) |
---|
250 | p(:,1:nl+1) = p1(:,1:nl+1) |
---|
251 | ph(:,1:nl+1) = ph1(:,1:nl+1) |
---|
252 | tv(:,1:nl+1) = tv1(:,1:nl+1) |
---|
253 | tp(:,1:nl+1) = tp1(:,1:nl+1) |
---|
254 | tvp(:,1:nl+1) = tvp1(:,1:nl+1) |
---|
255 | clw(:,1:nl+1) = clw1(:,1:nl+1) |
---|
256 | h_wake(:,1:nl+1) = h1_wake(:,1:nl+1) |
---|
257 | lv_wake(:,1:nl+1) = lv1_wake(:,1:nl+1) |
---|
258 | lf_wake(:,1:nl+1) = lf1_wake(:,1:nl+1) |
---|
259 | cpn_wake(:,1:nl+1) = cpn1_wake(:,1:nl+1) |
---|
260 | tv_wake(:,1:nl+1) = tv1_wake(:,1:nl+1) |
---|
261 | sig(:,1:nl+1) = sig1(:,1:nl+1) |
---|
262 | w0(:,1:nl+1) = w01(:,1:nl+1) |
---|
263 | omega(:,1:nl+1) = omega1(:,1:nl+1) |
---|
264 | #ifdef ISO |
---|
265 | xt(:,:,1:nl+1) = xt1(:,:,1:nl+1) |
---|
266 | xtclw(:,:,1:nl+1) = xtclw1(:,:,1:nl+1) |
---|
267 | xt_wake(:,:,1:nl+1) = xt1_wake(:,:,1:nl+1) |
---|
268 | #endif |
---|
269 | ! |
---|
270 | s_wake(:) = s1_wake(:) |
---|
271 | iflag(:) = iflag1(:) |
---|
272 | nk(:) = nk1(:) |
---|
273 | icb(:) = icb1(:) |
---|
274 | icbs(:) = icbs1(:) |
---|
275 | plcl(:) = plcl1(:) |
---|
276 | tnk(:) = tnk1(:) |
---|
277 | qnk(:) = qnk1(:) |
---|
278 | gznk(:) = gznk1(:) |
---|
279 | hnk(:) = hnk1(:) |
---|
280 | unk(:) = unk1(:) |
---|
281 | vnk(:) = vnk1(:) |
---|
282 | pbase(:) = pbase1(:) |
---|
283 | buoybase(:) = buoybase1(:) |
---|
284 | sig(:, nd) = sig1(:, nd) |
---|
285 | ptop2(:) = ptop2(:) |
---|
286 | Ale(:) = Ale1(:) |
---|
287 | Alp(:) = Alp1(:) |
---|
288 | #ifdef ISO |
---|
289 | xtnk(:,:) = xtnk1(:,:) |
---|
290 | #endif |
---|
291 | ! |
---|
292 | ENDIF !(compress) |
---|
293 | !>jyg |
---|
294 | |
---|
295 | RETURN |
---|
296 | END SUBROUTINE cv3a_compress |
---|