[1] | 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 |
---|
| 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, 2 |
---|
| 119 | DO k = 1,llm |
---|
| 120 | DO j = 1,ip1jmp1 |
---|
| 121 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
| 122 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestw ) |
---|
| 123 | ENDDO |
---|
| 124 | ENDDO |
---|
| 125 | ENDDO |
---|
| 126 | |
---|
| 127 | DO iq = 3, nqtot |
---|
| 128 | DO k = 1,llm |
---|
| 129 | DO j = 1,ip1jmp1 |
---|
| 130 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
| 131 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestt ) |
---|
| 132 | ENDDO |
---|
| 133 | ENDDO |
---|
| 134 | ENDDO |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | DO ij = 1, iim |
---|
| 138 | xpn(ij) = aire( ij ) * pps( ij ) |
---|
| 139 | xps(ij) = aire(ij+ip1jm) * pps(ij+ip1jm ) |
---|
| 140 | ENDDO |
---|
| 141 | tpn = SSUM(iim,xpn,1)/apoln |
---|
| 142 | tps = SSUM(iim,xps,1)/apols |
---|
| 143 | |
---|
| 144 | DO ij = 1, iip1 |
---|
| 145 | pps ( ij ) = tpn |
---|
| 146 | pps ( ij+ip1jm ) = tps |
---|
| 147 | ENDDO |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | DO iq = 1, nqtot |
---|
| 151 | DO k = 1, llm |
---|
| 152 | DO ij = 1, iim |
---|
| 153 | xpn(ij) = aire( ij ) * pq( ij ,k,iq) |
---|
| 154 | xps(ij) = aire(ij+ip1jm) * pq(ij+ip1jm,k,iq) |
---|
| 155 | ENDDO |
---|
| 156 | tpn = SSUM(iim,xpn,1)/apoln |
---|
| 157 | tps = SSUM(iim,xps,1)/apols |
---|
| 158 | |
---|
| 159 | DO ij = 1, iip1 |
---|
| 160 | pq ( ij ,k,iq) = tpn |
---|
| 161 | pq (ij+ip1jm,k,iq) = tps |
---|
| 162 | ENDDO |
---|
| 163 | ENDDO |
---|
| 164 | ENDDO |
---|
| 165 | |
---|
| 166 | RETURN |
---|
| 167 | END |
---|