subroutine largescale(dtime, paprs, pplay, t, pq, & pdt, d_t, d_q, d_ql, rneb, reffH2O) use watercommon_h, only : RLVTT, RCPD, RVTMP2 IMPLICIT none !================================================================== ! ! Purpose ! ------- ! Calculates large-scale (stratiform) H2O condensation. ! ! Authors ! ------- ! Adapted from the LMDTERRE code by R. Wordsworth (2009) ! Original author Z. X. Li (1993) ! !================================================================== #include "dimensions.h" #include "dimphys.h" #include "comcstfi.h" #include "fisice.h" #include "callkeys.h" #include "tracer.h" ! Pre-arguments (for universal model) real pq(ngridmx,nlayermx,nqmx) ! tracer (kg/kg) ! Arguments REAL dtime ! intervalle du temps (s) REAL paprs(ngridmx,nlayermx+1) ! pression a inter-couche REAL pplay(ngridmx,nlayermx) ! pression au milieu de couche REAL t(ngridmx,nlayermx) ! temperature (K) REAL q(ngridmx,nlayermx) ! humidite specifique (kg/kg) REAL d_t(ngridmx,nlayermx) ! incrementation de la temperature (K) REAL d_q(ngridmx,nlayermx) ! incrementation de la vapeur d'eau REAL d_ql(ngridmx,nlayermx) ! incrementation de l'eau liquide REAL rneb(ngridmx,nlayermx) ! fraction nuageuse REAL reffH2O(ngridmx,nlayermx) ! cloud particle mean radius (m) REAL pdt(ngridmx,nlayermx) ! added by Benjamin! ! Options du programme REAL ratqs ! determine largeur de la distribution de vapeur PARAMETER (ratqs=0.2) ! Variables locales REAL CBRT EXTERNAL CBRT INTEGER i, k REAL zt(ngridmx), zq(ngridmx) REAL zcond(ngridmx) REAL zdelq(ngridmx) REAL zqs(ngridmx), zdqs(ngridmx) REAL zcor(ngridmx), zdelta(ngridmx), zcvm5(ngridmx) REAL zx_q(ngridmx) ! GCM -----> subroutine variables, initialisation of outputs DO k = 1, nlayermx DO i = 1, ngridmx q(i,k) = pq(i,k,igcm_h2o_vap) d_t(i,k) = 0.0 d_q(i,k) = 0.0 d_ql(i,k) = 0.0 rneb(i,k) = 0.0 ENDDO ENDDO ! Boucle verticale (du haut vers le bas) DO 9999 k = nlayermx, 1, -1 DO i = 1, ngridmx zt(i)=t(i,k)+pdt(i,k)*dtime zq(i)=q(i,k) ! no need to add tendency as we're already dealing with qevap ENDDO ! Calculer la vapeur d'eau saturante et ! determiner la condensation partielle DO i = 1, ngridmx call watersat(zt(i),pplay(i,k),zqs(i)) call watersat_grad(zt(i),zqs(i),zdqs(i)) !IF (zt(i).LT.t_coup) THEN ! zqs(i) = qsats(zt(i))/pplay(i,k) ! zdqs(i) = dqsats(zt(i),zqs(i)) !ELSE ! zqs(i) = qsatl(zt(i))/pplay(i,k) ! zdqs(i) = dqsatl(zt(i),zqs(i)) !ENDIF zdelq(i) = ratqs * zq(i) rneb(i,k) = (zq(i)+zdelq(i)-zqs(i)) / (2.0*zdelq(i)) zcond(i) = 0.0 zx_q(i) = (zq(i)+zdelq(i)+zqs(i))/2.0 if (rneb(i,k) .LE. 0.0) zx_q(i) = 0.0 if (rneb(i,k) .GE. 1.0) zx_q(i) = zq(i) rneb(i,k) = MAX(0.0,MIN(1.0,rneb(i,k))) !zcond(i) = MAX(0.0,(zx_q(i)-zqs(i)*rneb(i,k)/(1.+zdqs(i)))) zcond(i) = MAX(0.0,(zx_q(i)-zqs(i))*rneb(i,k)/(1.+zdqs(i))) ! zcond always postive! cannot evaporate clouds! ! this is why we must reevaporate before largescale zcond(i) = zcond(i)/dtime ! added by RDW ! for varying particle size in rad tran and (possibly) sedimentation if(.not.aerofixed)then reffH2O(i,k) = CBRT( 3*zcond(i)/( 4*Nmix_h2o*pi*rho_ice)) reffH2O(i,k) = max(reffH2O(i,k),1.e-8) endif ENDDO ! Tendances de t et q DO i = 1, ngridmx d_q(i,k) = - zcond(i) d_ql(i,k) = zcond(i) !d_t(i,k) = zcond(i)*RLVTT/cpp d_t(i,k) = zcond(i)*RLVTT/RCPD!/(1.0+RVTMP2*q(i,k)) ! this one is FAR TOO BIG ENDDO 9999 CONTINUE !print*,'qsat=',zqs !print*,'q=',q !print*,'dq=',d_q*dtime !print*,'dT in LS=',d_t*dtime !print*,'rice=',rice !print*,'rneb=',rneb return end