Changeset 1880 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- Dec 22, 2017, 3:05:23 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F
r1774 r1880 109 109 110 110 ! Representation of sub-grid water ice clouds A. Pottier 2013 111 ! REAL :: zt(ngrid, nlay)112 REAL :: zq (ngrid, nlay,nq)111 REAL :: ztclf(ngrid, nlay) 112 REAL :: zqclf(ngrid, nlay,nq) 113 113 REAL :: zdelt 114 114 REAL :: norm 115 115 REAL :: ponder 116 116 REAL :: tcond(ngrid,nlay) 117 REAL :: 117 REAL :: zqvap(ngrid,nlay) 118 118 REAL :: zqice(ngrid,nlay) 119 119 REAL :: spant ! delta T for the temperature distribution … … 167 167 c 0. Representation of sub-grid water ice clouds 168 168 c------------------ 169 c-----Initialization 170 zteff(1:ngrid,1:nlay) = 0 171 pqeff(1:ngrid,1:nlay,1:nq) = 0 172 DO l=1,nlay 173 DO ig=1,ngrid 174 zteff(ig,l)=pt(ig,l) 175 END DO 176 END DO 177 DO l=1,nlay 178 DO ig=1,ngrid 179 DO iq=1,nq 180 pqeff(ig,l,iq)=pq(ig,l,iq) 181 ENDDO 182 ENDDO 183 ENDDO 169 184 c-----Tendencies 170 185 DO l=1,nlay 171 DO ig=1,ngrid172 zt (ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep173 ENDDO186 DO ig=1,ngrid 187 ztclf(ig,l)=pt(ig,l)+ pdt(ig,l)*ptimestep 188 ENDDO 174 189 ENDDO 175 190 DO l=1,nlay 176 191 DO ig=1,ngrid 177 192 DO iq=1,nq 178 zq (ig,l,iq)=pq(ig,l,iq)+pdq(ig,l,iq)*ptimestep193 zqclf(ig,l,iq)=pq(ig,l,iq)+pdq(ig,l,iq)*ptimestep 179 194 ENDDO 180 195 ENDDO … … 189 204 flagcloud=.false. 190 205 END IF 191 CALL watersat(ngrid*nlay,zt,pplay,zqsat)192 zqvap=zq (:,:,igcm_h2o_vap)193 zqice=zq (:,:,igcm_h2o_ice)206 !CALL watersat(ngrid*nlay,ztclf,pplay,zqsat) !MV17: we dont need zqsat in the CLFvarying scheme 207 zqvap=zqclf(:,:,igcm_h2o_vap) 208 zqice=zqclf(:,:,igcm_h2o_ice) 194 209 CALL tcondwater(ngrid*nlay,pplay,zqvap+zqice,tcond) 195 210 DO l=1,nlay 196 211 DO ig=1,ngrid 197 zdelt=spant !MAX(spant*zt (ig,l),1.e-12), now totally in K. Fixed width198 IF (tcond(ig,l) .ge. (zt (ig,l)+zdelt)) THEN199 zteff(ig,l)=zt (ig,l)212 zdelt=spant !MAX(spant*ztclf(ig,l),1.e-12), now totally in K. Fixed width 213 IF (tcond(ig,l) .ge. (ztclf(ig,l)+zdelt)) THEN 214 zteff(ig,l)=ztclf(ig,l) 200 215 cloudfrac(ig,l)=1. 201 ELSE IF (tcond(ig,l) .le. (zt (ig,l)-zdelt)) THEN202 zteff(ig,l)=zt (ig,l)-zdelt216 ELSE IF (tcond(ig,l) .le. (ztclf(ig,l)-zdelt)) THEN 217 zteff(ig,l)=ztclf(ig,l)-zdelt 203 218 cloudfrac(ig,l)=mincloud 204 219 ELSE 205 cloudfrac(ig,l)=(tcond(ig,l)-zt (ig,l)+zdelt)/220 cloudfrac(ig,l)=(tcond(ig,l)-ztclf(ig,l)+zdelt)/ 206 221 & (2.0*zdelt) 207 zteff(ig,l)=(tcond(ig,l)+zt (ig,l)-zdelt)/2.222 zteff(ig,l)=(tcond(ig,l)+ztclf(ig,l)-zdelt)/2. 208 223 END IF 209 224 zteff(ig,l)=zteff(ig,l)-pdt(ig,l)*ptimestep 210 IF (cloudfrac(ig,l).le. 0) THEN225 IF (cloudfrac(ig,l).le.mincloud) THEN !MV17: replaced .le.0 by .le.mincloud 211 226 cloudfrac(ig,l)=mincloud 212 227 ELSE IF (cloudfrac(ig,l).gt.1) THEN … … 227 242 totcloudfrac(ig)=MAX(totcloudfrac(ig)/norm,1.e-12) ! min value if NaNs 228 243 ENDDO 229 c-----No sub-grid cloud representation (CLFvarying=false) 230 ELSE 231 DO l=1,nlay 232 DO ig=1,ngrid 233 zteff(ig,l)=pt(ig,l) 234 END DO 235 END DO 244 c-----Effective tracers quantities in the cloud fraction 245 IF (microphys) THEN 246 pqeff(:,:,igcm_ccn_mass)=pq(:,:,igcm_ccn_mass)/ 247 & cloudfrac(:,:) 248 pqeff(:,:,igcm_ccn_number)=pq(:,:,igcm_ccn_number)/ 249 & cloudfrac(:,:) 250 END IF ! end if (microphys) 251 pqeff(:,:,igcm_h2o_ice)=pq(:,:,igcm_h2o_ice)/ 252 & cloudfrac(:,:) 236 253 END IF ! end if (CLFvarying) 237 254 !! MV17: CLFvarying outputs 255 CALL WRITEDIAGFI(ngrid,'pqeffice','pqeffice', 256 & 'kg/kg',3,pqeff(:,:,igcm_h2o_ice)) 257 CALL WRITEDIAGFI(ngrid,'zteff','zteff', 258 & 'K',3,zteff(:,:)) 259 CALL WRITEDIAGFI(ngrid,'tcond','tcond', 260 & 'K',3,tcond(:,:)) 261 CALL WRITEDIAGFI(ngrid,'cloudfrac','cloudfrac', 262 & 'K',3,cloudfrac(:,:)) 238 263 c------------------------------------------------------------------ 239 c Time subsampling for microphysics 264 c Time subsampling for microphysics 265 c------------------------------------------------------------------ 240 266 rhocloud(1:ngrid,1:nlay) = rho_dust 241 267 DO microstep=1,imicro … … 284 310 & + pdq(ig,l,igcm_h2o_vap) 285 311 ENDDO 286 ENDDO 287 c------ Effective tracers quantities in the cloud fraction 288 IF (CLFvarying) THEN 289 pqeff(:,:,:)=pq(:,:,:) ! prevent from buggs (A. Pottier) 290 pqeff(:,:,igcm_ccn_mass) =pq(:,:,igcm_ccn_mass)/ 291 & cloudfrac(:,:) 292 pqeff(:,:,igcm_ccn_number)= 293 & pq(:,:,igcm_ccn_number)/cloudfrac(:,:) 294 pqeff(:,:,igcm_h2o_ice)= pq(:,:,igcm_h2o_ice)/ 295 & cloudfrac(:,:) 296 ELSE 297 pqeff(:,:,:)=pq(:,:,:) 298 pqeff(:,:,igcm_ccn_mass)= pq(:,:,igcm_ccn_mass) 299 pqeff(:,:,igcm_ccn_number)= pq(:,:,igcm_ccn_number) 300 pqeff(:,:,igcm_h2o_ice)= pq(:,:,igcm_h2o_ice) 301 END IF 312 ENDDO 302 313 303 314 c-------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.