Changeset 325 for trunk/LMDZ.MARS/libf/phymars/vdif_kc.F
- Timestamp:
- Oct 24, 2011, 3:56:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/vdif_kc.F
r38 r325 1 SUBROUTINE vdif_kc(dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn )1 SUBROUTINE vdif_kc(dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn,zq) 2 2 IMPLICIT NONE 3 3 c....................................................................... 4 4 #include "dimensions.h" 5 5 #include "dimphys.h" 6 #include "tracer.h" 7 #include "callkeys.h" 6 8 c....................................................................... 7 9 c … … 37 39 REAL km(ngridmx,nlayermx+1) 38 40 REAL kn(ngridmx,nlayermx+1) 41 REAL zq(ngridmx,nlayermx,nqmx) 39 42 c....................................................................... 40 43 c … … 204 207 & cm4=-9.E+0 *a1*a2 205 208 & ) 209 210 c AC: variables for theta_m computation 211 212 INTEGER ico2,iq 213 SAVE ico2 214 REAL m_co2, m_noco2, A , B 215 SAVE A, B 216 LOGICAL firstcall 217 save firstcall 218 data firstcall/.true./ 219 REAL zhc(ngridmx,nlayermx) 220 c....................................................................... 221 c Initialization 222 c....................................................................... 223 224 if(firstcall) then 225 ico2=0 226 if (tracer) then 227 ! Prepare Special treatment if one of the tracers is CO2 gas 228 do iq=1,nqmx 229 if (noms(iq).eq."co2") then 230 ico2=iq 231 m_co2 = 44.01E-3 ! CO2 molecular mass (kg/mol) 232 m_noco2 = 33.37E-3 ! Non condensible mol mass (kg/mol) 233 ! Compute A and B coefficient use to compute 234 ! mean molecular mass Mair defined by 235 ! 1/Mair = q(ico2)/m_co2 + (1-q(ico2))/m_noco2 236 ! 1/Mair = A*q(ico2) + B 237 A =(1/m_co2 - 1/m_noco2) 238 B=1/m_noco2 239 end if 240 enddo 241 endif 242 243 firstcall=.false. 244 endif !of if firstcall 245 246 c....................................................................... 247 c Special treatment for co2 248 c....................................................................... 249 250 if (ico2.ne.0) then 251 ! Special case if one of the tracers is CO2 gas 252 DO ilay=1,nlay 253 DO igrid=1,ngrid 254 zhc(igrid,ilay) = teta(igrid,ilay)*(A*zq(igrid,ilay,ico2)+B) 255 ENDDO 256 ENDDO 257 else 258 zhc(:,:)=teta(:,:) 259 end if 260 206 261 c....................................................................... 207 262 c traitment des valeur de q2 en entree … … 272 327 c 273 328 n2(igrid,ilev)=g*unsdzdec(igrid,ilev) 274 & *( teta(igrid,ilev)-teta(igrid,ilev-1))275 & /( teta(igrid,ilev)+teta(igrid,ilev-1)) *2.E+0329 & *(zhc(igrid,ilev)-zhc(igrid,ilev-1)) 330 & /(zhc(igrid,ilev)+zhc(igrid,ilev-1)) *2.E+0 276 331 c 277 332 c --->
Note: See TracChangeset
for help on using the changeset viewer.