1 | ! |
---|
2 | ! $Header$ |
---|
3 | ! |
---|
4 | SUBROUTINE addfi(pdt, leapf, forward, |
---|
5 | S pucov, pvcov, pteta, pq , pps , |
---|
6 | S pdufi, pdvfi, pdhfi,pdqfi, pdpfi ) |
---|
7 | |
---|
8 | USE infotrac, ONLY : nqtot |
---|
9 | IMPLICIT NONE |
---|
10 | c |
---|
11 | c======================================================================= |
---|
12 | c |
---|
13 | c Addition of the physical tendencies |
---|
14 | c |
---|
15 | c Interface : |
---|
16 | c ----------- |
---|
17 | c |
---|
18 | c Input : |
---|
19 | c ------- |
---|
20 | c pdt time step of integration |
---|
21 | c leapf logical |
---|
22 | c forward logical |
---|
23 | c pucov(ip1jmp1,llm) first component of the covariant velocity |
---|
24 | c pvcov(ip1ip1jm,llm) second component of the covariant velocity |
---|
25 | c pteta(ip1jmp1,llm) potential temperature |
---|
26 | c pts(ip1jmp1,llm) surface temperature |
---|
27 | c pdufi(ip1jmp1,llm) | |
---|
28 | c pdvfi(ip1jm,llm) | respective |
---|
29 | c pdhfi(ip1jmp1) | tendencies (unit/s) |
---|
30 | c pdtsfi(ip1jmp1) | |
---|
31 | c |
---|
32 | c Output : |
---|
33 | c -------- |
---|
34 | c pucov |
---|
35 | c pvcov |
---|
36 | c ph |
---|
37 | c pts |
---|
38 | c |
---|
39 | c |
---|
40 | c======================================================================= |
---|
41 | c |
---|
42 | c----------------------------------------------------------------------- |
---|
43 | c |
---|
44 | c 0. Declarations : |
---|
45 | c ------------------ |
---|
46 | c |
---|
47 | #include "dimensions.h" |
---|
48 | #include "paramet.h" |
---|
49 | #include "comconst.h" |
---|
50 | #include "comgeom.h" |
---|
51 | #include "serre.h" |
---|
52 | c |
---|
53 | c Arguments : |
---|
54 | c ----------- |
---|
55 | c |
---|
56 | REAL pdt |
---|
57 | c |
---|
58 | REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) |
---|
59 | REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nqtot),pps(ip1jmp1) |
---|
60 | c |
---|
61 | REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) |
---|
62 | REAL pdqfi(ip1jmp1,llm,nqtot),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1) |
---|
63 | c |
---|
64 | LOGICAL leapf,forward |
---|
65 | c |
---|
66 | c |
---|
67 | c Local variables : |
---|
68 | c ----------------- |
---|
69 | c |
---|
70 | REAL xpn(iim),xps(iim),tpn,tps |
---|
71 | INTEGER j,k,iq,ij |
---|
72 | REAL qtestw, qtestt |
---|
73 | PARAMETER ( qtestw = 1.0e-15 ) |
---|
74 | PARAMETER ( qtestt = 1.0e-40 ) |
---|
75 | |
---|
76 | REAL SSUM |
---|
77 | c |
---|
78 | c----------------------------------------------------------------------- |
---|
79 | |
---|
80 | DO k = 1,llm |
---|
81 | DO j = 1,ip1jmp1 |
---|
82 | pteta(j,k)= pteta(j,k) + pdhfi(j,k) * pdt |
---|
83 | ENDDO |
---|
84 | ENDDO |
---|
85 | |
---|
86 | DO k = 1, llm |
---|
87 | DO ij = 1, iim |
---|
88 | xpn(ij) = aire( ij ) * pteta( ij ,k) |
---|
89 | xps(ij) = aire(ij+ip1jm) * pteta(ij+ip1jm,k) |
---|
90 | ENDDO |
---|
91 | tpn = SSUM(iim,xpn,1)/ apoln |
---|
92 | tps = SSUM(iim,xps,1)/ apols |
---|
93 | |
---|
94 | DO ij = 1, iip1 |
---|
95 | pteta( ij ,k) = tpn |
---|
96 | pteta(ij+ip1jm,k) = tps |
---|
97 | ENDDO |
---|
98 | ENDDO |
---|
99 | c |
---|
100 | |
---|
101 | DO k = 1,llm |
---|
102 | DO j = iip2,ip1jm |
---|
103 | pucov(j,k)= pucov(j,k) + pdufi(j,k) * pdt |
---|
104 | ENDDO |
---|
105 | ENDDO |
---|
106 | |
---|
107 | DO k = 1,llm |
---|
108 | DO j = 1,ip1jm |
---|
109 | pvcov(j,k)= pvcov(j,k) + pdvfi(j,k) * pdt |
---|
110 | ENDDO |
---|
111 | ENDDO |
---|
112 | |
---|
113 | c |
---|
114 | DO j = 1,ip1jmp1 |
---|
115 | pps(j) = pps(j) + pdpfi(j) * pdt |
---|
116 | ENDDO |
---|
117 | |
---|
118 | DO iq = 1, nqtot |
---|
119 | IF ((planet_type.eq.'earth').and.(iq.le.2)) THEN |
---|
120 | DO k = 1,llm |
---|
121 | DO j = 1,ip1jmp1 |
---|
122 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
123 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestw ) |
---|
124 | ENDDO |
---|
125 | ENDDO |
---|
126 | ELSE |
---|
127 | DO k = 1,llm |
---|
128 | DO j = 1,ip1jmp1 |
---|
129 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
130 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestt ) |
---|
131 | ENDDO |
---|
132 | ENDDO |
---|
133 | ENDDO |
---|
134 | |
---|
135 | DO ij = 1, iim |
---|
136 | xpn(ij) = aire( ij ) * pps( ij ) |
---|
137 | xps(ij) = aire(ij+ip1jm) * pps(ij+ip1jm ) |
---|
138 | ENDDO |
---|
139 | tpn = SSUM(iim,xpn,1)/apoln |
---|
140 | tps = SSUM(iim,xps,1)/apols |
---|
141 | |
---|
142 | DO ij = 1, iip1 |
---|
143 | pps ( ij ) = tpn |
---|
144 | pps ( ij+ip1jm ) = tps |
---|
145 | ENDDO |
---|
146 | |
---|
147 | |
---|
148 | DO iq = 1, nqtot |
---|
149 | DO k = 1, llm |
---|
150 | DO ij = 1, iim |
---|
151 | xpn(ij) = aire( ij ) * pq( ij ,k,iq) |
---|
152 | xps(ij) = aire(ij+ip1jm) * pq(ij+ip1jm,k,iq) |
---|
153 | ENDDO |
---|
154 | tpn = SSUM(iim,xpn,1)/apoln |
---|
155 | tps = SSUM(iim,xps,1)/apols |
---|
156 | |
---|
157 | DO ij = 1, iip1 |
---|
158 | pq ( ij ,k,iq) = tpn |
---|
159 | pq (ij+ip1jm,k,iq) = tps |
---|
160 | ENDDO |
---|
161 | ENDDO |
---|
162 | ENDDO |
---|
163 | |
---|
164 | RETURN |
---|
165 | END |
---|