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