1 |
! |
module integrd_m |
|
! $Header: /home/cvsroot/LMDZ4/libf/dyn3d/integrd.F,v 1.1.1.1 2004/05/19 12:53:05 lmdzadmin Exp $ |
|
|
! |
|
|
SUBROUTINE integrd |
|
|
$ ( nq,vcovm1,ucovm1,tetam1,psm1,massem1, |
|
|
$ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis,finvmaold ) |
|
|
|
|
|
use dimens_m |
|
|
use paramet_m |
|
|
use comconst |
|
|
use comvert |
|
|
use logic |
|
|
use comgeom |
|
|
use serre |
|
|
use temps |
|
|
use advtrac_m |
|
|
use pression_m, only: pression |
|
|
|
|
|
IMPLICIT NONE |
|
|
|
|
|
|
|
|
c======================================================================= |
|
|
c |
|
|
c Auteur: P. Le Van |
|
|
c ------- |
|
|
c |
|
|
c objet: |
|
|
c ------ |
|
|
c |
|
|
c Incrementation des tendances dynamiques |
|
|
c |
|
|
c======================================================================= |
|
|
c----------------------------------------------------------------------- |
|
|
c Declarations: |
|
|
c ------------- |
|
|
|
|
|
|
|
|
c Arguments: |
|
|
c ---------- |
|
|
|
|
|
INTEGER nq |
|
|
|
|
|
REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm),teta(ip1jmp1,llm) |
|
|
REAL q(ip1jmp1,llm,nq) |
|
|
REAL ps(ip1jmp1),masse(ip1jmp1,llm),phis(ip1jmp1) |
|
|
|
|
|
REAL vcovm1(ip1jm,llm),ucovm1(ip1jmp1,llm) |
|
|
REAL tetam1(ip1jmp1,llm),psm1(ip1jmp1),massem1(ip1jmp1,llm) |
|
|
|
|
|
REAL dv(ip1jm,llm),du(ip1jmp1,llm) |
|
|
REAL dteta(ip1jmp1,llm),dp(ip1jmp1) |
|
|
REAL dq(ip1jmp1,llm,nq), finvmaold(ip1jmp1,llm) |
|
|
|
|
|
c Local: |
|
|
c ------ |
|
|
|
|
|
REAL vscr( ip1jm ),uscr( ip1jmp1 ),hscr( ip1jmp1 ),pscr(ip1jmp1) |
|
|
REAL massescr( ip1jmp1,llm ), finvmasse(ip1jmp1,llm) |
|
|
REAL p(ip1jmp1,llmp1) |
|
|
REAL tpn,tps,tppn(iim),tpps(iim) |
|
|
REAL qpn,qps,qppn(iim),qpps(iim) |
|
|
REAL deltap( ip1jmp1,llm ) |
|
|
|
|
|
INTEGER l,ij,iq |
|
|
|
|
|
REAL SSUM |
|
|
|
|
|
c----------------------------------------------------------------------- |
|
|
|
|
|
DO l = 1,llm |
|
|
DO ij = 1,iip1 |
|
|
ucov( ij , l) = 0. |
|
|
ucov( ij +ip1jm, l) = 0. |
|
|
uscr( ij ) = 0. |
|
|
uscr( ij +ip1jm ) = 0. |
|
|
ENDDO |
|
|
ENDDO |
|
|
|
|
|
|
|
|
c ............ integration de ps .............. |
|
|
|
|
|
CALL SCOPY(ip1jmp1*llm, masse, 1, massescr, 1) |
|
|
|
|
|
DO 2 ij = 1,ip1jmp1 |
|
|
pscr (ij) = ps(ij) |
|
|
ps (ij) = psm1(ij) + dt * dp(ij) |
|
|
2 CONTINUE |
|
|
c |
|
|
DO ij = 1,ip1jmp1 |
|
|
IF( ps(ij).LT.0. ) THEN |
|
|
PRINT *,' Au point ij = ',ij, ' , pression sol neg. ', ps(ij) |
|
|
STOP 'integrd' |
|
|
ENDIF |
|
|
ENDDO |
|
|
c |
|
|
DO ij = 1, iim |
|
|
tppn(ij) = aire( ij ) * ps( ij ) |
|
|
tpps(ij) = aire(ij+ip1jm) * ps(ij+ip1jm) |
|
|
ENDDO |
|
|
tpn = SSUM(iim,tppn,1)/apoln |
|
|
tps = SSUM(iim,tpps,1)/apols |
|
|
DO ij = 1, iip1 |
|
|
ps( ij ) = tpn |
|
|
ps(ij+ip1jm) = tps |
|
|
ENDDO |
|
|
c |
|
|
c ... Calcul de la nouvelle masse d'air au dernier temps integre t+1 ... |
|
|
c |
|
|
CALL pression ( ip1jmp1, ap, bp, ps, p ) |
|
|
CALL massdair ( p , masse ) |
|
|
|
|
|
CALL SCOPY( ijp1llm , masse, 1, finvmasse, 1 ) |
|
|
CALL filtreg( finvmasse, jjp1, llm, -2, 2, .TRUE., 1 ) |
|
|
c |
|
|
|
|
|
c ............ integration de ucov, vcov, h .............. |
|
|
|
|
|
DO 10 l = 1,llm |
|
|
|
|
|
DO 4 ij = iip2,ip1jm |
|
|
uscr( ij ) = ucov( ij,l ) |
|
|
ucov( ij,l ) = ucovm1( ij,l ) + dt * du( ij,l ) |
|
|
4 CONTINUE |
|
|
|
|
|
DO 5 ij = 1,ip1jm |
|
|
vscr( ij ) = vcov( ij,l ) |
|
|
vcov( ij,l ) = vcovm1( ij,l ) + dt * dv( ij,l ) |
|
|
5 CONTINUE |
|
|
|
|
|
DO 6 ij = 1,ip1jmp1 |
|
|
hscr( ij ) = teta(ij,l) |
|
|
teta ( ij,l ) = tetam1(ij,l) * massem1(ij,l) / masse(ij,l) |
|
|
$ + dt * dteta(ij,l) / masse(ij,l) |
|
|
6 CONTINUE |
|
|
|
|
|
c .... Calcul de la valeur moyenne, unique aux poles pour teta ...... |
|
|
c |
|
|
c |
|
|
DO ij = 1, iim |
|
|
tppn(ij) = aire( ij ) * teta( ij ,l) |
|
|
tpps(ij) = aire(ij+ip1jm) * teta(ij+ip1jm,l) |
|
|
ENDDO |
|
|
tpn = SSUM(iim,tppn,1)/apoln |
|
|
tps = SSUM(iim,tpps,1)/apols |
|
|
|
|
|
DO ij = 1, iip1 |
|
|
teta( ij ,l) = tpn |
|
|
teta(ij+ip1jm,l) = tps |
|
|
ENDDO |
|
|
c |
|
|
|
|
|
IF(leapf) THEN |
|
|
CALL SCOPY ( ip1jmp1, uscr(1), 1, ucovm1(1, l), 1 ) |
|
|
CALL SCOPY ( ip1jm, vscr(1), 1, vcovm1(1, l), 1 ) |
|
|
CALL SCOPY ( ip1jmp1, hscr(1), 1, tetam1(1, l), 1 ) |
|
|
END IF |
|
|
|
|
|
10 CONTINUE |
|
|
|
|
|
|
|
|
c |
|
|
c ....... integration de q ...... |
|
|
c |
|
|
c$$$ IF( iadv(1).NE.3.AND.iadv(2).NE.3 ) THEN |
|
|
c$$$c |
|
|
c$$$ IF( forward. OR . leapf ) THEN |
|
|
c$$$ DO iq = 1,2 |
|
|
c$$$ DO l = 1,llm |
|
|
c$$$ DO ij = 1,ip1jmp1 |
|
|
c$$$ q(ij,l,iq) = ( q(ij,l,iq)*finvmaold(ij,l) + dtvr *dq(ij,l,iq) )/ |
|
|
c$$$ $ finvmasse(ij,l) |
|
|
c$$$ ENDDO |
|
|
c$$$ ENDDO |
|
|
c$$$ ENDDO |
|
|
c$$$ ELSE |
|
|
c$$$ DO iq = 1,2 |
|
|
c$$$ DO l = 1,llm |
|
|
c$$$ DO ij = 1,ip1jmp1 |
|
|
c$$$ q( ij,l,iq ) = q( ij,l,iq ) * finvmaold(ij,l) / finvmasse(ij,l) |
|
|
c$$$ ENDDO |
|
|
c$$$ ENDDO |
|
|
c$$$ ENDDO |
|
|
c$$$ |
|
|
c$$$ END IF |
|
|
c$$$c |
|
|
c$$$ ENDIF |
|
|
|
|
|
DO l = 1, llm |
|
|
DO ij = 1, ip1jmp1 |
|
|
deltap(ij,l) = p(ij,l) - p(ij,l+1) |
|
|
ENDDO |
|
|
ENDDO |
|
|
|
|
|
CALL qminimum( q, nq, deltap ) |
|
|
c |
|
|
c ..... Calcul de la valeur moyenne, unique aux poles pour q ..... |
|
|
c |
|
|
|
|
|
DO iq = 1, nq |
|
|
DO l = 1, llm |
|
|
|
|
|
DO ij = 1, iim |
|
|
qppn(ij) = aire( ij ) * q( ij ,l,iq) |
|
|
qpps(ij) = aire(ij+ip1jm) * q(ij+ip1jm,l,iq) |
|
|
ENDDO |
|
|
qpn = SSUM(iim,qppn,1)/apoln |
|
|
qps = SSUM(iim,qpps,1)/apols |
|
|
|
|
|
DO ij = 1, iip1 |
|
|
q( ij ,l,iq) = qpn |
|
|
q(ij+ip1jm,l,iq) = qps |
|
|
ENDDO |
|
|
|
|
|
ENDDO |
|
|
ENDDO |
|
|
|
|
|
|
|
|
CALL SCOPY( ijp1llm , finvmasse, 1, finvmaold, 1 ) |
|
|
c |
|
|
c |
|
|
c ..... FIN de l'integration de q ....... |
|
|
|
|
|
15 continue |
|
|
|
|
|
c ................................................................. |
|
|
|
|
|
|
|
|
IF( leapf ) THEN |
|
|
CALL SCOPY ( ip1jmp1 , pscr , 1, psm1 , 1 ) |
|
|
CALL SCOPY ( ip1jmp1*llm, massescr, 1, massem1, 1 ) |
|
|
END IF |
|
2 |
|
|
3 |
RETURN |
IMPLICIT NONE |
4 |
END |
|
5 |
|
contains |
6 |
|
|
7 |
|
SUBROUTINE integrd(nq,vcovm1,ucovm1,tetam1,psm1,massem1,dv,du,dteta,dp, & |
8 |
|
vcov,ucov,teta,q,ps,masse,finvmaold,leapf, dt) |
9 |
|
|
10 |
|
! From dyn3d/integrd.F,v 1.1.1.1 2004/05/19 12:53:05 |
11 |
|
! Auteur: P. Le Van |
12 |
|
! objet: |
13 |
|
! Incrementation des tendances dynamiques |
14 |
|
|
15 |
|
USE dimens_m, ONLY : iim, llm |
16 |
|
USE paramet_m, ONLY : iip1, iip2, ijp1llm, ip1jm, ip1jmp1, jjp1, llmp1 |
17 |
|
USE comvert, ONLY : ap, bp |
18 |
|
USE comgeom, ONLY : aire, apoln, apols |
19 |
|
USE filtreg_m, ONLY : filtreg |
20 |
|
|
21 |
|
! Arguments: |
22 |
|
|
23 |
|
INTEGER, intent(in):: nq |
24 |
|
|
25 |
|
REAL vcov(ip1jm,llm), ucov(ip1jmp1,llm), teta(ip1jmp1,llm) |
26 |
|
REAL q(ip1jmp1,llm,nq) |
27 |
|
REAL ps(ip1jmp1), masse(ip1jmp1,llm) |
28 |
|
|
29 |
|
REAL vcovm1(ip1jm,llm), ucovm1(ip1jmp1,llm) |
30 |
|
REAL tetam1(ip1jmp1,llm), psm1(ip1jmp1), massem1(ip1jmp1,llm) |
31 |
|
|
32 |
|
REAL dv(ip1jm,llm), du(ip1jmp1,llm) |
33 |
|
REAL dteta(ip1jmp1,llm), dp(ip1jmp1) |
34 |
|
REAL finvmaold(ip1jmp1,llm) |
35 |
|
LOGICAL, INTENT (IN) :: leapf |
36 |
|
real, intent(in):: dt |
37 |
|
|
38 |
|
! Local: |
39 |
|
|
40 |
|
REAL vscr(ip1jm), uscr(ip1jmp1), hscr(ip1jmp1), pscr(ip1jmp1) |
41 |
|
REAL massescr(ip1jmp1,llm), finvmasse(ip1jmp1,llm) |
42 |
|
REAL p(ip1jmp1,llmp1) |
43 |
|
REAL tpn, tps, tppn(iim), tpps(iim) |
44 |
|
REAL qpn, qps, qppn(iim), qpps(iim) |
45 |
|
REAL deltap(ip1jmp1,llm) |
46 |
|
|
47 |
|
INTEGER l, ij, iq |
48 |
|
|
49 |
|
REAL ssum |
50 |
|
|
51 |
|
!----------------------------------------------------------------------- |
52 |
|
|
53 |
|
DO l = 1, llm |
54 |
|
DO ij = 1, iip1 |
55 |
|
ucov(ij,l) = 0. |
56 |
|
ucov(ij+ip1jm,l) = 0. |
57 |
|
uscr(ij) = 0. |
58 |
|
uscr(ij+ip1jm) = 0. |
59 |
|
END DO |
60 |
|
END DO |
61 |
|
|
62 |
|
|
63 |
|
! ............ integration de ps .............. |
64 |
|
|
65 |
|
CALL scopy(ip1jmp1*llm,masse,1,massescr,1) |
66 |
|
|
67 |
|
DO ij = 1, ip1jmp1 |
68 |
|
pscr(ij) = ps(ij) |
69 |
|
ps(ij) = psm1(ij) + dt*dp(ij) |
70 |
|
END DO |
71 |
|
|
72 |
|
DO ij = 1, ip1jmp1 |
73 |
|
IF (ps(ij)<0.) THEN |
74 |
|
PRINT *, ' Au point ij = ', ij, ' , pression sol neg. ', ps(ij) |
75 |
|
STOP 'integrd' |
76 |
|
END IF |
77 |
|
END DO |
78 |
|
|
79 |
|
DO ij = 1, iim |
80 |
|
tppn(ij) = aire(ij)*ps(ij) |
81 |
|
tpps(ij) = aire(ij+ip1jm)*ps(ij+ip1jm) |
82 |
|
END DO |
83 |
|
tpn = ssum(iim,tppn,1)/apoln |
84 |
|
tps = ssum(iim,tpps,1)/apols |
85 |
|
DO ij = 1, iip1 |
86 |
|
ps(ij) = tpn |
87 |
|
ps(ij+ip1jm) = tps |
88 |
|
END DO |
89 |
|
|
90 |
|
! ... Calcul de la nouvelle masse d'air au dernier temps integre t+1 . |
91 |
|
|
92 |
|
forall (l = 1: llm + 1) p(:, l) = ap(l) + bp(l) * ps |
93 |
|
CALL massdair(p,masse) |
94 |
|
|
95 |
|
CALL scopy(ijp1llm,masse,1,finvmasse,1) |
96 |
|
CALL filtreg(finvmasse,jjp1,llm,-2,2,.TRUE.,1) |
97 |
|
|
98 |
|
|
99 |
|
! ............ integration de ucov, vcov, h .............. |
100 |
|
|
101 |
|
DO l = 1, llm |
102 |
|
|
103 |
|
DO ij = iip2, ip1jm |
104 |
|
uscr(ij) = ucov(ij,l) |
105 |
|
ucov(ij,l) = ucovm1(ij,l) + dt*du(ij,l) |
106 |
|
END DO |
107 |
|
|
108 |
|
DO ij = 1, ip1jm |
109 |
|
vscr(ij) = vcov(ij,l) |
110 |
|
vcov(ij,l) = vcovm1(ij,l) + dt*dv(ij,l) |
111 |
|
END DO |
112 |
|
|
113 |
|
DO ij = 1, ip1jmp1 |
114 |
|
hscr(ij) = teta(ij,l) |
115 |
|
teta(ij,l) = tetam1(ij,l)*massem1(ij,l)/masse(ij,l) + & |
116 |
|
dt*dteta(ij,l)/masse(ij,l) |
117 |
|
END DO |
118 |
|
|
119 |
|
! .... Calcul de la valeur moyenne, unique aux poles pour teta . |
120 |
|
|
121 |
|
|
122 |
|
DO ij = 1, iim |
123 |
|
tppn(ij) = aire(ij)*teta(ij,l) |
124 |
|
tpps(ij) = aire(ij+ip1jm)*teta(ij+ip1jm,l) |
125 |
|
END DO |
126 |
|
tpn = ssum(iim,tppn,1)/apoln |
127 |
|
tps = ssum(iim,tpps,1)/apols |
128 |
|
|
129 |
|
DO ij = 1, iip1 |
130 |
|
teta(ij,l) = tpn |
131 |
|
teta(ij+ip1jm,l) = tps |
132 |
|
END DO |
133 |
|
|
134 |
|
|
135 |
|
IF (leapf) THEN |
136 |
|
CALL scopy(ip1jmp1,uscr(1),1,ucovm1(1,l),1) |
137 |
|
CALL scopy(ip1jm,vscr(1),1,vcovm1(1,l),1) |
138 |
|
CALL scopy(ip1jmp1,hscr(1),1,tetam1(1,l),1) |
139 |
|
END IF |
140 |
|
|
141 |
|
END DO |
142 |
|
|
143 |
|
DO l = 1, llm |
144 |
|
DO ij = 1, ip1jmp1 |
145 |
|
deltap(ij,l) = p(ij,l) - p(ij,l+1) |
146 |
|
END DO |
147 |
|
END DO |
148 |
|
|
149 |
|
CALL qminimum(q,nq,deltap) |
150 |
|
|
151 |
|
! ..... Calcul de la valeur moyenne, unique aux poles pour q ..... |
152 |
|
|
153 |
|
|
154 |
|
DO iq = 1, nq |
155 |
|
DO l = 1, llm |
156 |
|
|
157 |
|
DO ij = 1, iim |
158 |
|
qppn(ij) = aire(ij)*q(ij,l,iq) |
159 |
|
qpps(ij) = aire(ij+ip1jm)*q(ij+ip1jm,l,iq) |
160 |
|
END DO |
161 |
|
qpn = ssum(iim,qppn,1)/apoln |
162 |
|
qps = ssum(iim,qpps,1)/apols |
163 |
|
|
164 |
|
DO ij = 1, iip1 |
165 |
|
q(ij,l,iq) = qpn |
166 |
|
q(ij+ip1jm,l,iq) = qps |
167 |
|
END DO |
168 |
|
|
169 |
|
END DO |
170 |
|
END DO |
171 |
|
|
172 |
|
|
173 |
|
CALL scopy(ijp1llm,finvmasse,1,finvmaold,1) |
174 |
|
|
175 |
|
|
176 |
|
! ..... FIN de l'integration de q ....... |
177 |
|
|
178 |
|
IF (leapf) THEN |
179 |
|
CALL scopy(ip1jmp1,pscr,1,psm1,1) |
180 |
|
CALL scopy(ip1jmp1*llm,massescr,1,massem1,1) |
181 |
|
END IF |
182 |
|
|
183 |
|
END SUBROUTINE integrd |
184 |
|
|
185 |
|
end module integrd_m |