Index: LMDZ5/trunk/libf/phylmd/clift.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/clift.F	(revision 1907)
+++ LMDZ5/trunk/libf/phylmd/clift.F90	(revision 1992)
@@ -1,72 +1,71 @@
-!
+
 ! $Header$
-!
-        SUBROUTINE CLIFT (P,T,RR,RS,PLCL,DPLCLDT,DPLCLDQ)
-C***************************************************************
-C*                                                             *
-C* CLIFT : COMPUTE LIFTING CONDENSATION LEVEL AND ITS          *
-C*         DERIVATIVES RELATIVE TO T AND R                     *
-C*   (WITHIN 0.2% OF FORMULA OF BOLTON, MON. WEA. REV.,1980)   *
-C*                                                             *
-C* written by   : GRANDPEIX Jean-Yves, 17/11/98, 12.39.01      *
-C* modified by :                                               *
-C***************************************************************
-C*
-C*Arguments :
-C*
-C* Input :  P = pressure of level from wich lifting is performed
-C*          T = temperature of level P
-C*          RR = vapour mixing ratio at level P
-C*          RS = vapour saturation mixing ratio at level P
-C*
-C* Output : PLCL = lifting condensation level
-C*          DPLCLDT = derivative of PLCL relative to T
-C*          DPLCLDQ = derivative of PLCL relative to R
-C*
-ccccccccccccccccccccccc
-c constantes coherentes avec le modele du Centre Europeen
-c      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-c      RV = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 18.0153
-c      CPD = 3.5 * RD
-c      CPV = 4.0 * RV
-c      CL = 4218.0
-c      CI=2090.0
-c      CPVMCL=CL-CPV
-c      CLMCI=CL-CI
-c      EPS=RD/RV
-c      ALV0=2.5008E+06
-c      ALF0=3.34E+05
-c
-c on utilise les constantes thermo du Centre Europeen: (sb)
-c
-#include "YOMCST.h"
-c
-       CPD = RCPD
-       CPV = RCPV
-       CL = RCW
-       CPVMCL = CL-CPV
-       EPS = RD/RV
-       ALV0 = RLVTT
-c
-c
-c      Bolton formula coefficients :
-      A = 1669.0
-      B = 122.0
-c
-      RH=RR/RS
-      CHI=T/(A-B*RH-T)
-      PLCL=P*(RH**CHI)
-c
-      ALV = ALV0 - CPVMCL*(T-273.15)
-c
-c -- sb: correction:
-c       DPLCLDQ = PLCL*CHI*( 1./RR - B*CHI/T/RS*ALOG(RH) )
-      DPLCLDQ = PLCL*CHI*( 1./RR + B*CHI/T/RS*ALOG(RH) )
-c sb --
-c
-      DPLCLDT = PLCL*CHI*((A-B*RH*(1.+ALV/RV/T))/T**2*CHI*ALOG(RH)
-     $                    - ALV/RV/T**2 )
-c
-c
-      RETURN
-      END
+
+SUBROUTINE clift(p, t, rr, rs, plcl, dplcldt, dplcldq)
+  ! ***************************************************************
+  ! *                                                             *
+  ! * CLIFT : COMPUTE LIFTING CONDENSATION LEVEL AND ITS          *
+  ! *         DERIVATIVES RELATIVE TO T AND R                     *
+  ! *   (WITHIN 0.2% OF FORMULA OF BOLTON, MON. WEA. REV.,1980)   *
+  ! *                                                             *
+  ! * written by   : GRANDPEIX Jean-Yves, 17/11/98, 12.39.01      *
+  ! * modified by :                                               *
+  ! ***************************************************************
+  ! *
+  ! *Arguments :
+  ! *
+  ! * Input :  P = pressure of level from wich lifting is performed
+  ! *          T = temperature of level P
+  ! *          RR = vapour mixing ratio at level P
+  ! *          RS = vapour saturation mixing ratio at level P
+  ! *
+  ! * Output : PLCL = lifting condensation level
+  ! *          DPLCLDT = derivative of PLCL relative to T
+  ! *          DPLCLDQ = derivative of PLCL relative to R
+  ! *
+  ! cccccccccccccccccccccc
+  ! constantes coherentes avec le modele du Centre Europeen
+  ! RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
+  ! RV = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 18.0153
+  ! CPD = 3.5 * RD
+  ! CPV = 4.0 * RV
+  ! CL = 4218.0
+  ! CI=2090.0
+  ! CPVMCL=CL-CPV
+  ! CLMCI=CL-CI
+  ! EPS=RD/RV
+  ! ALV0=2.5008E+06
+  ! ALF0=3.34E+05
+
+  ! on utilise les constantes thermo du Centre Europeen: (sb)
+
+  include "YOMCST.h"
+
+  cpd = rcpd
+  cpv = rcpv
+  cl = rcw
+  cpvmcl = cl - cpv
+  eps = rd/rv
+  alv0 = rlvtt
+
+
+  ! Bolton formula coefficients :
+  a = 1669.0
+  b = 122.0
+
+  rh = rr/rs
+  chi = t/(a-b*rh-t)
+  plcl = p*(rh**chi)
+
+  alv = alv0 - cpvmcl*(t-273.15)
+
+  ! -- sb: correction:
+  ! DPLCLDQ = PLCL*CHI*( 1./RR - B*CHI/T/RS*ALOG(RH) )
+  dplcldq = plcl*chi*(1./rr+b*chi/t/rs*alog(rh))
+  ! sb --
+
+  dplcldt = plcl*chi*((a-b*rh*(1.+alv/rv/t))/t**2*chi*alog(rh)-alv/rv/t**2)
+
+
+  RETURN
+END SUBROUTINE clift
