[3175] | 1 | SUBROUTINE addfi(nq, pdt, leapf, forward, |
---|
| 2 | S pucov, pvcov, pteta, pq , pps , pmasse , |
---|
| 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 Modif special Mars : |
---|
| 10 | c - no special treatment of iq = 1, 2, FF 2003 |
---|
| 11 | c - recompute mass after incrementation of ps (EM,FF 2008) |
---|
| 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 pmasse(ip1jmp1,llm) ! mass |
---|
| 37 | c |
---|
| 38 | c |
---|
| 39 | c======================================================================= |
---|
| 40 | c |
---|
| 41 | c----------------------------------------------------------------------- |
---|
| 42 | c |
---|
| 43 | c 0. Declarations : |
---|
| 44 | c ------------------ |
---|
| 45 | c |
---|
| 46 | #include "dimensions.h" |
---|
| 47 | #include "paramet.h" |
---|
| 48 | #include "comconst.h" |
---|
| 49 | #include "comgeom.h" |
---|
| 50 | #include "serre.h" |
---|
| 51 | #include "comvert.h" |
---|
| 52 | c |
---|
| 53 | c Arguments : |
---|
| 54 | c ----------- |
---|
| 55 | c |
---|
| 56 | INTEGER nq |
---|
| 57 | |
---|
| 58 | REAL pdt |
---|
| 59 | c |
---|
| 60 | REAL pvcov(ip1jm,llm),pucov(ip1jmp1,llm) |
---|
| 61 | REAL pteta(ip1jmp1,llm),pq(ip1jmp1,llm,nq),pps(ip1jmp1) |
---|
| 62 | c |
---|
| 63 | REAL pdvfi(ip1jm,llm),pdufi(ip1jmp1,llm) |
---|
| 64 | REAL pdqfi(ip1jmp1,llm,nq),pdhfi(ip1jmp1,llm),pdpfi(ip1jmp1) |
---|
| 65 | |
---|
| 66 | real pmasse(ip1jmp1,llm) |
---|
| 67 | c |
---|
| 68 | LOGICAL leapf,forward |
---|
| 69 | c |
---|
| 70 | c |
---|
| 71 | c Local variables : |
---|
| 72 | c ----------------- |
---|
| 73 | c |
---|
| 74 | REAL xpn(iim),xps(iim),tpn,tps |
---|
| 75 | INTEGER j,k,iq,ij |
---|
| 76 | REAL qtestw, qtestt |
---|
| 77 | PARAMETER ( qtestw = 1.0e-15 ) |
---|
| 78 | PARAMETER ( qtestt = 1.0e-30 ) |
---|
| 79 | |
---|
| 80 | real p(ip1jmp1,llmp1) ! pressure |
---|
| 81 | |
---|
| 82 | REAL SSUM |
---|
| 83 | EXTERNAL SSUM |
---|
| 84 | c |
---|
| 85 | c----------------------------------------------------------------------- |
---|
| 86 | ! increment potential temperature |
---|
| 87 | DO k = 1,llm |
---|
| 88 | DO j = 1,ip1jmp1 |
---|
| 89 | pteta(j,k)= pteta(j,k) + pdhfi(j,k) * pdt |
---|
| 90 | ENDDO |
---|
| 91 | ENDDO |
---|
| 92 | |
---|
| 93 | DO k = 1, llm |
---|
| 94 | DO ij = 1, iim |
---|
| 95 | xpn(ij) = aire( ij ) * pteta( ij ,k) |
---|
| 96 | xps(ij) = aire(ij+ip1jm) * pteta(ij+ip1jm,k) |
---|
| 97 | ENDDO |
---|
| 98 | tpn = SSUM(iim,xpn,1)/ apoln |
---|
| 99 | tps = SSUM(iim,xps,1)/ apols |
---|
| 100 | |
---|
| 101 | DO ij = 1, iip1 |
---|
| 102 | pteta( ij ,k) = tpn |
---|
| 103 | pteta(ij+ip1jm,k) = tps |
---|
| 104 | ENDDO |
---|
| 105 | ENDDO |
---|
| 106 | c |
---|
| 107 | |
---|
| 108 | ! increment covariant zonal wind |
---|
| 109 | DO k = 1,llm |
---|
| 110 | DO j = iip2,ip1jm |
---|
| 111 | pucov(j,k)= pucov(j,k) + pdufi(j,k) * pdt |
---|
| 112 | ENDDO |
---|
| 113 | ENDDO |
---|
| 114 | |
---|
| 115 | ! increment covariant meridional wind |
---|
| 116 | DO k = 1,llm |
---|
| 117 | DO j = 1,ip1jm |
---|
| 118 | pvcov(j,k)= pvcov(j,k) + pdvfi(j,k) * pdt |
---|
| 119 | ENDDO |
---|
| 120 | ENDDO |
---|
| 121 | |
---|
| 122 | c |
---|
| 123 | ! increment surface pressure |
---|
| 124 | DO j = 1,ip1jmp1 |
---|
| 125 | pps(j) = pps(j) + pdpfi(j) * pdt |
---|
| 126 | ENDDO |
---|
| 127 | |
---|
| 128 | c DO iq = 1, 2 ! special Mars: no special treatment for water |
---|
| 129 | c DO k = 1,llm |
---|
| 130 | c DO j = 1,ip1jmp1 |
---|
| 131 | c pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
| 132 | c pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestw ) |
---|
| 133 | c ENDDO |
---|
| 134 | c ENDDO |
---|
| 135 | c ENDDO |
---|
| 136 | |
---|
| 137 | DO iq = 1, nq |
---|
| 138 | DO k = 1,llm |
---|
| 139 | DO j = 1,ip1jmp1 |
---|
| 140 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
| 141 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestt ) |
---|
| 142 | ENDDO |
---|
| 143 | ENDDO |
---|
| 144 | ENDDO |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | DO ij = 1, iim |
---|
| 148 | xpn(ij) = aire( ij ) * pps( ij ) |
---|
| 149 | xps(ij) = aire(ij+ip1jm) * pps(ij+ip1jm ) |
---|
| 150 | ENDDO |
---|
| 151 | tpn = SSUM(iim,xpn,1)/apoln |
---|
| 152 | tps = SSUM(iim,xps,1)/apols |
---|
| 153 | |
---|
| 154 | DO ij = 1, iip1 |
---|
| 155 | pps ( ij ) = tpn |
---|
| 156 | pps ( ij+ip1jm ) = tps |
---|
| 157 | ENDDO |
---|
| 158 | |
---|
| 159 | ! recompute mass: (to be synchronous with update of ps) |
---|
| 160 | CALL pression ( ip1jmp1, ap, bp, pps, p ) |
---|
| 161 | CALL massdair ( p , pmasse ) |
---|
| 162 | |
---|
| 163 | |
---|
| 164 | |
---|
| 165 | DO iq = 1, nq |
---|
| 166 | DO k = 1, llm |
---|
| 167 | DO ij = 1, iim |
---|
| 168 | xpn(ij) = aire( ij ) * pq( ij ,k,iq) |
---|
| 169 | xps(ij) = aire(ij+ip1jm) * pq(ij+ip1jm,k,iq) |
---|
| 170 | ENDDO |
---|
| 171 | tpn = SSUM(iim,xpn,1)/apoln |
---|
| 172 | tps = SSUM(iim,xps,1)/apols |
---|
| 173 | |
---|
| 174 | DO ij = 1, iip1 |
---|
| 175 | pq ( ij ,k,iq) = tpn |
---|
| 176 | pq (ij+ip1jm,k,iq) = tps |
---|
| 177 | ENDDO |
---|
| 178 | ENDDO |
---|
| 179 | ENDDO |
---|
| 180 | |
---|
| 181 | RETURN |
---|
| 182 | END |
---|