[135] | 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 | |
---|
[253] | 137 | ! increment tracers |
---|
[135] | 138 | DO iq = 1, nq |
---|
| 139 | DO k = 1,llm |
---|
| 140 | DO j = 1,ip1jmp1 |
---|
[253] | 141 | ! pq(j,k,iq)= pdqfi(j,k,iq) * pdt |
---|
[135] | 142 | pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt |
---|
[253] | 143 | pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestt ) ! forbid negative tracer values |
---|
[135] | 144 | ENDDO |
---|
| 145 | ENDDO |
---|
| 146 | ENDDO |
---|
[253] | 147 | ! print*,'MAJOR TRACER MOD in addfi for test' |
---|
[135] | 148 | |
---|
| 149 | |
---|
| 150 | DO ij = 1, iim |
---|
| 151 | xpn(ij) = aire( ij ) * pps( ij ) |
---|
| 152 | xps(ij) = aire(ij+ip1jm) * pps(ij+ip1jm ) |
---|
| 153 | ENDDO |
---|
| 154 | tpn = SSUM(iim,xpn,1)/apoln |
---|
| 155 | tps = SSUM(iim,xps,1)/apols |
---|
| 156 | |
---|
| 157 | DO ij = 1, iip1 |
---|
| 158 | pps ( ij ) = tpn |
---|
| 159 | pps ( ij+ip1jm ) = tps |
---|
| 160 | ENDDO |
---|
| 161 | |
---|
| 162 | ! recompute mass: (to be synchronous with update of ps) |
---|
| 163 | CALL pression ( ip1jmp1, ap, bp, pps, p ) |
---|
| 164 | CALL massdair ( p , pmasse ) |
---|
| 165 | |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | DO iq = 1, nq |
---|
| 169 | DO k = 1, llm |
---|
| 170 | DO ij = 1, iim |
---|
| 171 | xpn(ij) = aire( ij ) * pq( ij ,k,iq) |
---|
| 172 | xps(ij) = aire(ij+ip1jm) * pq(ij+ip1jm,k,iq) |
---|
| 173 | ENDDO |
---|
| 174 | tpn = SSUM(iim,xpn,1)/apoln |
---|
| 175 | tps = SSUM(iim,xps,1)/apols |
---|
| 176 | |
---|
| 177 | DO ij = 1, iip1 |
---|
| 178 | pq ( ij ,k,iq) = tpn |
---|
| 179 | pq (ij+ip1jm,k,iq) = tps |
---|
| 180 | ENDDO |
---|
| 181 | ENDDO |
---|
| 182 | ENDDO |
---|
| 183 | |
---|
| 184 | RETURN |
---|
| 185 | END |
---|