Ignore:
Timestamp:
Oct 14, 2024, 5:21:07 PM (7 weeks ago)
Author:
Laurent Fairhead
Message:

Temporary fix to correct divergence of results between revision 5210 and 5211 until we understand why
LMDZ workshop (EV, AI, LG, LF)

Location:
LMDZ6/trunk/libf/phylmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/lmdz_lscp.F90

    r5211 r5238  
    106106USE lmdz_lscp_tools, ONLY : icefrac_lscp, icefrac_lscp_turb
    107107USE lmdz_lscp_tools, ONLY : fallice_velocity, distance_to_cloud_top
    108 USE lmdz_lscp_condensation, ONLY : condensation_lognormal, condensation_ice_supersat
     108USE lmdz_lscp_condensation, ONLY : condensation_lognormal_test, condensation_ice_supersat
    109109USE lmdz_lscp_poprecip, ONLY : poprecip_precld, poprecip_postcld
    110110
     
    971971                  !--generalised lognormal condensation scheme (Bony and Emanuel 2001)
    972972
    973                    CALL condensation_lognormal( &
    974                        klon, Tbef, zq, zqs, gammasat, ratqs(:,k), &
    975                        keepgoing, rneb(:,k), zqn, qvc)
     973                   CALL condensation_lognormal_test( &
     974                       klon, klev, k, keepgoing, ratqs, gammasat, zq, zqs, &
     975                       zqn, qvc, rneb)
    976976
    977977
  • LMDZ6/trunk/libf/phylmd/lmdz_lscp_condensation.F90

    r5210 r5238  
    88
    99CONTAINS
     10
     11!*********************************************************************************
     12SUBROUTINE condensation_lognormal_test(klon,klev,k,keepgoing,ratqs, gammasat,zq, zqs, zqn, qvc, rneb)
     13
     14
     15IMPLICIT NONE
     16
     17INTEGER, INTENT(IN)   :: klon,klev,k
     18LOGICAL,  INTENT(IN)   , DIMENSION(klon) :: keepgoing     ! .TRUE. if a new condensation loop should be computed
     19REAL, INTENT(IN), DIMENSION(klon,klev)   :: ratqs
     20REAL, INTENT(IN), DIMENSION(klon)        :: zq, zqs,gammasat
     21REAL, INTENT(INOUT), DIMENSION(klon)     :: zqn, qvc
     22REAL, INTENT(INOUT), DIMENSION(klon,klev) :: rneb
     23
     24REAL, DIMENSION(klon) :: zpdf_sig,zpdf_k,zpdf_delta             ! lognormal parameters
     25REAL, DIMENSION(klon) :: Zpdf_a,zpdf_b,zpdf_e1,zpdf_e2          ! lognormal intermediate variables
     26INTEGER               :: i
     27
     28
     29DO i=1,klon !todoan : check if loop in i is needed
     30
     31    IF (keepgoing(i)) THEN
     32
     33    zpdf_sig(i)=ratqs(i,k)*zq(i)
     34    zpdf_k(i)=-sqrt(log(1.+(zpdf_sig(i)/zq(i))**2))
     35    zpdf_delta(i)=log(zq(i)/(gammasat(i)*zqs(i)))
     36    zpdf_a(i)=zpdf_delta(i)/(zpdf_k(i)*sqrt(2.))
     37    zpdf_b(i)=zpdf_k(i)/(2.*sqrt(2.))
     38    zpdf_e1(i)=zpdf_a(i)-zpdf_b(i)
     39    zpdf_e1(i)=sign(min(ABS(zpdf_e1(i)),5.),zpdf_e1(i))
     40    zpdf_e1(i)=1.-erf(zpdf_e1(i))
     41    zpdf_e2(i)=zpdf_a(i)+zpdf_b(i)
     42    zpdf_e2(i)=sign(min(ABS(zpdf_e2(i)),5.),zpdf_e2(i))
     43    zpdf_e2(i)=1.-erf(zpdf_e2(i))
     44
     45    IF (zpdf_e1(i).LT.1.e-10) THEN
     46        rneb(i,k)=0.
     47        zqn(i)=zqs(i)
     48        !--AB grid-mean vapor in the cloud - we assume saturation adjustment
     49        qvc(i) = 0.
     50    ELSE
     51        rneb(i,k)=0.5*zpdf_e1(i)
     52        zqn(i)=zq(i)*zpdf_e2(i)/zpdf_e1(i)
     53        !--AB grid-mean vapor in the cloud - we assume saturation adjustment
     54        qvc(i) = rneb(i,k) * zqs(i)
     55    ENDIF
     56
     57    ENDIF ! keepgoing
     58ENDDO ! loop on klon
     59
     60
     61END SUBROUTINE condensation_lognormal_test
     62
    1063
    1164!**********************************************************************************
Note: See TracChangeset for help on using the changeset viewer.