1 | SUBROUTINE addfi(nq, pdt, leapf, forward, |
---|
2 | S pucov, pvcov, pteta, pq , pps , pmasse , |
---|
3 | S pdufi, pdvfi, pdhfi,pdqfi, pdpfi ) |
---|
4 | |
---|
5 | USE comvert_mod, ONLY: ap,bp |
---|
6 | USE comconst_mod, ONLY: kappa |
---|
7 | |
---|
8 | IMPLICIT NONE |
---|
9 | c |
---|
10 | c======================================================================= |
---|
11 | c |
---|
12 | c Addition of the physical tendencies |
---|
13 | c Modif special Mars : |
---|
14 | c - no special treatment of iq = 1, 2, FF 2003 |
---|
15 | c - recompute mass after incrementation of ps (EM,FF 2008) |
---|
16 | c |
---|
17 | c Interface : |
---|
18 | c ----------- |
---|
19 | c |
---|
20 | c Input : |
---|
21 | c ------- |
---|
22 | c pdt time step of integration |
---|
23 | c leapf logical |
---|
24 | c forward logical |
---|
25 | c pucov(ip1jmp1,llm) first component of the covariant velocity |
---|
26 | c pvcov(ip1ip1jm,llm) second component of the covariant velocity |
---|
27 | c pteta(ip1jmp1,llm) potential temperature |
---|
28 | c pts(ip1jmp1,llm) surface temperature |
---|
29 | c pdufi(ip1jmp1,llm) | |
---|
30 | c pdvfi(ip1jm,llm) | respective |
---|
31 | c pdhfi(ip1jmp1) | tendencies |
---|
32 | c pdtsfi(ip1jmp1) | |
---|
33 | c |
---|
34 | c Output : |
---|
35 | c -------- |
---|
36 | c pucov |
---|
37 | c pvcov |
---|
38 | c ph |
---|
39 | c pts |
---|
40 | c pmasse(ip1jmp1,llm) ! mass |
---|
41 | c |
---|
42 | c |
---|
43 | c======================================================================= |
---|
44 | c |
---|
45 | c----------------------------------------------------------------------- |
---|
46 | c |
---|
47 | c 0. Declarations : |
---|
48 | c ------------------ |
---|
49 | c |
---|
50 | #include "dimensions.h" |
---|
51 | #include "paramet.h" |
---|
52 | #include "comgeom.h" |
---|
53 | c |
---|
54 | c Arguments : |
---|
55 | c ----------- |
---|
56 | c |
---|
57 | INTEGER nq |
---|
58 | |
---|
59 | REAL pdt |
---|
60 | c |
---|
61 | REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) |
---|
62 | REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nq),pps(ip1jmp1) |
---|
63 | c |
---|
64 | REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) |
---|
65 | REAL pdqfi(ip1jmp1,llm,nq),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1) |
---|
66 | |
---|
67 | real pmasse(ip1jmp1,llm) |
---|
68 | c |
---|
69 | LOGICAL leapf,forward |
---|
70 | c |
---|
71 | c |
---|
72 | c Local variables : |
---|
73 | c ----------------- |
---|
74 | c |
---|
75 | REAL xpn(iim),xps(iim),tpn,tps |
---|
76 | INTEGER j,k,iq,ij |
---|
77 | REAL qtestw, qtestt |
---|
78 | PARAMETER ( qtestw = 1.0e-15 ) |
---|
79 | PARAMETER ( qtestt = 1.0e-30 ) |
---|
80 | |
---|
81 | real p(ip1jmp1,llmp1) ! pressure |
---|
82 | |
---|
83 | REAL SSUM |
---|
84 | EXTERNAL SSUM |
---|
85 | c |
---|
86 | c----------------------------------------------------------------------- |
---|
87 | ! increment potential temperature |
---|
88 | DO k = 1,llm |
---|
89 | DO j = 1,ip1jmp1 |
---|
90 | pteta(j,k)= pteta(j,k) + pdhfi(j,k) * pdt |
---|
91 | ENDDO |
---|
92 | ENDDO |
---|
93 | |
---|
94 | DO k = 1, llm |
---|
95 | DO ij = 1, iim |
---|
96 | xpn(ij) = aire( ij ) * pteta( ij ,k) |
---|
97 | xps(ij) = aire(ij+ip1jm) * pteta(ij+ip1jm,k) |
---|
98 | ENDDO |
---|
99 | tpn = SSUM(iim,xpn,1)/ apoln |
---|
100 | tps = SSUM(iim,xps,1)/ apols |
---|
101 | |
---|
102 | DO ij = 1, iip1 |
---|
103 | pteta( ij ,k) = tpn |
---|
104 | pteta(ij+ip1jm,k) = tps |
---|
105 | ENDDO |
---|
106 | ENDDO |
---|
107 | !*********************** |
---|
108 | ! Correction on teta due to surface pressure changes |
---|
109 | DO k = 1,llm |
---|
110 | DO j = 1,ip1jmp1 |
---|
111 | pteta(j,k)= pteta(j,k)*(1+pdpfi(j)*pdt/pps(j))**kappa |
---|
112 | ENDDO |
---|
113 | ENDDO |
---|
114 | !*********************** |
---|
115 | |
---|
116 | ! increment covariant zonal wind |
---|
117 | DO k = 1,llm |
---|
118 | DO j = iip2,ip1jm |
---|
119 | pucov(j,k)= pucov(j,k) + pdufi(j,k) * pdt |
---|
120 | ENDDO |
---|
121 | ENDDO |
---|
122 | |
---|
123 | ! increment covariant meridional wind |
---|
124 | DO k = 1,llm |
---|
125 | DO j = 1,ip1jm |
---|
126 | pvcov(j,k)= pvcov(j,k) + pdvfi(j,k) * pdt |
---|
127 | ENDDO |
---|
128 | ENDDO |
---|
129 | |
---|
130 | c |
---|
131 | ! increment surface pressure |
---|
132 | DO j = 1,ip1jmp1 |
---|
133 | pps(j) = pps(j) + pdpfi(j) * pdt |
---|
134 | ENDDO |
---|
135 | |
---|
136 | c DO iq = 1, 2 ! special Mars: no special treatment for water |
---|
137 | c DO k = 1,llm |
---|
138 | c DO j = 1,ip1jmp1 |
---|
139 | c pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
140 | c pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestw ) |
---|
141 | c ENDDO |
---|
142 | c ENDDO |
---|
143 | c ENDDO |
---|
144 | |
---|
145 | DO iq = 1, nq |
---|
146 | DO k = 1,llm |
---|
147 | DO j = 1,ip1jmp1 |
---|
148 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
149 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestt ) |
---|
150 | ENDDO |
---|
151 | ENDDO |
---|
152 | ENDDO |
---|
153 | |
---|
154 | |
---|
155 | DO ij = 1, iim |
---|
156 | xpn(ij) = aire( ij ) * pps( ij ) |
---|
157 | xps(ij) = aire(ij+ip1jm) * pps(ij+ip1jm ) |
---|
158 | ENDDO |
---|
159 | tpn = SSUM(iim,xpn,1)/apoln |
---|
160 | tps = SSUM(iim,xps,1)/apols |
---|
161 | |
---|
162 | DO ij = 1, iip1 |
---|
163 | pps ( ij ) = tpn |
---|
164 | pps ( ij+ip1jm ) = tps |
---|
165 | ENDDO |
---|
166 | |
---|
167 | ! recompute mass: (to be synchronous with update of ps) |
---|
168 | CALL pression ( ip1jmp1, ap, bp, pps, p ) |
---|
169 | CALL massdair ( p , pmasse ) |
---|
170 | |
---|
171 | |
---|
172 | |
---|
173 | DO iq = 1, nq |
---|
174 | DO k = 1, llm |
---|
175 | DO ij = 1, iim |
---|
176 | xpn(ij) = aire( ij ) * pq( ij ,k,iq) |
---|
177 | xps(ij) = aire(ij+ip1jm) * pq(ij+ip1jm,k,iq) |
---|
178 | ENDDO |
---|
179 | tpn = SSUM(iim,xpn,1)/apoln |
---|
180 | tps = SSUM(iim,xps,1)/apols |
---|
181 | |
---|
182 | DO ij = 1, iip1 |
---|
183 | pq ( ij ,k,iq) = tpn |
---|
184 | pq (ij+ip1jm,k,iq) = tps |
---|
185 | ENDDO |
---|
186 | ENDDO |
---|
187 | ENDDO |
---|
188 | |
---|
189 | RETURN |
---|
190 | END |
---|