[524] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | SUBROUTINE addfi(nq, pdt, leapf, forward, |
---|
| 5 | S pucov, pvcov, pteta, pq , pps , |
---|
| 6 | S pdufi, pdvfi, pdhfi,pdqfi, pdpfi ) |
---|
| 7 | IMPLICIT NONE |
---|
| 8 | c |
---|
| 9 | c======================================================================= |
---|
| 10 | c |
---|
| 11 | c Addition of the physical tendencies |
---|
| 12 | c |
---|
| 13 | c Interface : |
---|
| 14 | c ----------- |
---|
| 15 | c |
---|
| 16 | c Input : |
---|
| 17 | c ------- |
---|
| 18 | c pdt time step of integration |
---|
| 19 | c leapf logical |
---|
| 20 | c forward logical |
---|
| 21 | c pucov(ip1jmp1,llm) first component of the covariant velocity |
---|
| 22 | c pvcov(ip1ip1jm,llm) second component of the covariant velocity |
---|
| 23 | c pteta(ip1jmp1,llm) potential temperature |
---|
| 24 | c pts(ip1jmp1,llm) surface temperature |
---|
| 25 | c pdufi(ip1jmp1,llm) | |
---|
| 26 | c pdvfi(ip1jm,llm) | respective |
---|
| 27 | c pdhfi(ip1jmp1) | tendencies |
---|
| 28 | c pdtsfi(ip1jmp1) | |
---|
| 29 | c |
---|
| 30 | c Output : |
---|
| 31 | c -------- |
---|
| 32 | c pucov |
---|
| 33 | c pvcov |
---|
| 34 | c ph |
---|
| 35 | c pts |
---|
| 36 | c |
---|
| 37 | c |
---|
| 38 | c======================================================================= |
---|
| 39 | c |
---|
| 40 | c----------------------------------------------------------------------- |
---|
| 41 | c |
---|
| 42 | c 0. Declarations : |
---|
| 43 | c ------------------ |
---|
| 44 | c |
---|
| 45 | #include "dimensions.h" |
---|
| 46 | #include "paramet.h" |
---|
| 47 | #include "comconst.h" |
---|
| 48 | #include "comgeom.h" |
---|
| 49 | #include "serre.h" |
---|
| 50 | c |
---|
| 51 | c Arguments : |
---|
| 52 | c ----------- |
---|
| 53 | c |
---|
| 54 | INTEGER nq |
---|
| 55 | |
---|
| 56 | REAL pdt |
---|
| 57 | c |
---|
| 58 | REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) |
---|
| 59 | REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nq),pps(ip1jmp1) |
---|
| 60 | c |
---|
| 61 | REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) |
---|
| 62 | REAL pdqfi(ip1jmp1,llm,nq),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, nq |
---|
| 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, nq |
---|
| 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 |
---|