Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90	(revision 5116)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90	(revision 5117)
@@ -34,5 +34,5 @@
       USE lmdz_abort_physic, ONLY: abort_physic
 #ifdef ISO
-      use infotrac_phy, ONLY: ntiso
+      USE infotrac_phy, ONLY: ntiso
 #ifdef ISOVERIF
       USE isotopes_mod, ONLY: iso_eau,iso_HDO
@@ -66,5 +66,5 @@
       REAL pplay(klon,klev)
       REAL pphi(klon,klev)
-      real zlev(klon,klev+1) 
+      REAL zlev(klon,klev+1)
 !test: on sort lentr et a* pour alimenter KE
       REAL wght_th(klon,klev)
@@ -75,61 +75,61 @@
       REAL d_t_ajs(klon,klev), d_q_ajs(klon,klev)
       REAL d_u_ajs(klon,klev),d_v_ajs(klon,klev)
-      real fm_therm(klon,klev+1)
-      real entr_therm(klon,klev),detr_therm(klon,klev)
+      REAL fm_therm(klon,klev+1)
+      REAL entr_therm(klon,klev),detr_therm(klon,klev)
 
 !********************************************************
 !     declarations
       LOGICAL flag_bidouille_stratocu
-      real fmc_therm(klon,klev+1),zqasc(klon,klev)
-      real zqla(klon,klev)
-      real ztv(klon,klev),ztva(klon,klev)
-      real zpspsk(klon,klev)
-      real ztla(klon,klev)
-      real zthl(klon,klev)
-      real wmax_sec(klon)
-      real zcong(klon)
-      real zmax_sec(klon)
-      real f_sec(klon)
-      real detrc_therm(klon,klev)
+      REAL fmc_therm(klon,klev+1),zqasc(klon,klev)
+      REAL zqla(klon,klev)
+      REAL ztv(klon,klev),ztva(klon,klev)
+      REAL zpspsk(klon,klev)
+      REAL ztla(klon,klev)
+      REAL zthl(klon,klev)
+      REAL wmax_sec(klon)
+      REAL zcong(klon)
+      REAL zmax_sec(klon)
+      REAL f_sec(klon)
+      REAL detrc_therm(klon,klev)
 ! FH WARNING : il semble que ces save ne servent a rien
 !     save fmc_therm, detrc_therm
-      real clwcon0(klon,klev)
-      real zqsat(klon,klev)
-      real zw_sec(klon,klev+1)
-      integer lmix_sec(klon)
-      integer lmax(klon)
-      real ratqscth(klon,klev)
-      real ratqsdiff(klon,klev)
-      real zqsatth(klon,klev)  
+      REAL clwcon0(klon,klev)
+      REAL zqsat(klon,klev)
+      REAL zw_sec(klon,klev+1)
+      INTEGER lmix_sec(klon)
+      INTEGER lmax(klon)
+      REAL ratqscth(klon,klev)
+      REAL ratqsdiff(klon,klev)
+      REAL zqsatth(klon,klev)
 !nouvelles variables pour la convection
-      real ale_bl(klon)
-      real alp_bl(klon)
-      real ale(klon)
-      real alp(klon)
+      REAL ale_bl(klon)
+      REAL alp_bl(klon)
+      REAL ale(klon)
+      REAL alp(klon)
 !RC
       !on garde le zmax du pas de temps precedent
-      real zmax0(klon), f0(klon)
+      REAL zmax0(klon), f0(klon)
 
 !!! nrlmd le 10/04/2012
-      real pbl_tke(klon,klev+1,nbsrf)
-      real pctsrf(klon,nbsrf)
-      real omega(klon,klev)
-      real airephy(klon)
-      real zlcl_th(klon),fraca0(klon),w0(klon),w_conv(klon)
-      real therm_tke_max0(klon),env_tke_max0(klon)
-      real n2(klon),s2(klon),strig(klon)
-      real ale_bl_stat(klon)
-      real therm_tke_max(klon,klev),env_tke_max(klon,klev)
-      real alp_bl_det(klon),alp_bl_fluct_m(klon),alp_bl_fluct_tke(klon),alp_bl_conv(klon),alp_bl_stat(klon)
+      REAL pbl_tke(klon,klev+1,nbsrf)
+      REAL pctsrf(klon,nbsrf)
+      REAL omega(klon,klev)
+      REAL airephy(klon)
+      REAL zlcl_th(klon),fraca0(klon),w0(klon),w_conv(klon)
+      REAL therm_tke_max0(klon),env_tke_max0(klon)
+      REAL n2(klon),s2(klon),strig(klon)
+      REAL ale_bl_stat(klon)
+      REAL therm_tke_max(klon,klev),env_tke_max(klon,klev)
+      REAL alp_bl_det(klon),alp_bl_fluct_m(klon),alp_bl_fluct_tke(klon),alp_bl_conv(klon),alp_bl_stat(klon)
 !!! fin nrlmd le 10/04/2012
 
 !********************************************************
 
-      real, dimension(klon) :: pcon
-      real, dimension(klon,klev) :: rhobarz,wth3
-      integer,dimension(klon) :: lalim
-      real, dimension(klon,klev+1) :: fm
-      real, dimension(klon,klev) :: alim_star
-      real, dimension(klon) :: zmax
+      REAL, DIMENSION(klon) :: pcon
+      REAL, DIMENSION(klon,klev) :: rhobarz,wth3
+      INTEGER,DIMENSION(klon) :: lalim
+      REAL, DIMENSION(klon,klev+1) :: fm
+      REAL, DIMENSION(klon,klev) :: alim_star
+      REAL, DIMENSION(klon) :: zmax
 
 
@@ -140,26 +140,26 @@
       REAL d_u_the(klon,klev),d_v_the(klon,klev)
 
-      real zfm_therm(klon,klev+1),zdt
-      real zentr_therm(klon,klev),zdetr_therm(klon,klev)
+      REAL zfm_therm(klon,klev+1),zdt
+      REAL zentr_therm(klon,klev),zdetr_therm(klon,klev)
 ! FH A VERIFIER : SAVE INUTILES
 !      save zentr_therm,zfm_therm
 
-      character (len=20) :: modname='calltherm'
-      character (len=80) :: abort_message
-
-      integer i,k,isplit
+      CHARACTER (LEN=20) :: modname='calltherm'
+      CHARACTER (LEN=80) :: abort_message
+
+      INTEGER i,k,isplit
       logical, save :: first=.TRUE.
-      logical :: new_thermcell
+      LOGICAL :: new_thermcell
 
 #ifdef ISO
       REAL xt_seri(ntiso,klon,klev),xtmemoire(ntiso,klon,klev)
       REAL d_xt_ajs(ntiso,klon,klev)
-      real d_xt_the(ntiso,klon,klev)
+      REAL d_xt_the(ntiso,klon,klev)
 #ifdef DIAGISO
-      real q_the(klon,klev)
-      real xt_the(ntiso,klon,klev)
-#endif
-      real qprec(klon,klev)
-      integer ixt
+      REAL q_the(klon,klev)
+      REAL xt_the(ntiso,klon,klev)
+#endif
+      REAL qprec(klon,klev)
+      INTEGER ixt
 #endif
 
@@ -167,5 +167,5 @@
 !$OMP THREADPRIVATE(first)
 !********************************************************
-      if (first) THEN
+      IF (first) THEN
         itap=0
         first=.FALSE.
@@ -199,5 +199,5 @@
          ale_bl(:)=0.
          alp_bl(:)=0.
-         if (prt_level>=10) THEN
+         IF (prt_level>=10) THEN
           PRINT*,'thermV4 nsplit: ',nsplit_thermals,' weak_inversion'
          endif
@@ -209,7 +209,7 @@
             do i=1,klon
 ! Attention teste abderr 19-03-09
-!               logexpr2(i,k)=.not.q_seri(i,k).ge.0.
-                logexpr2(i,k)=.not.q_seri(i,k)>=1.e-15
-               if (logexpr2(i,k)) THEN
+!               logexpr2(i,k)=.NOT.q_seri(i,k).ge.0.
+                logexpr2(i,k)=.NOT.q_seri(i,k)>=1.e-15
+               IF (logexpr2(i,k)) THEN
 #ifdef ISO
                 qprec(i,k)=q_seri(i,k)
@@ -232,11 +232,11 @@
 
 
-         new_thermcell=iflag_thermals>=15.and.iflag_thermals<=18
-#ifdef ISO
-      if (.not.new_thermcell) THEN
+         new_thermcell=iflag_thermals>=15.AND.iflag_thermals<=18
+#ifdef ISO
+      IF (.NOT.new_thermcell) THEN
            CALL abort_gcm('calltherm 234','isos pas prevus ici',1)
       endif
 #ifdef ISOVERIF
-      if (iso_eau.gt.0) THEN
+      IF (iso_eau.gt.0) THEN
        CALL iso_verif_egalite_vect2D( &
              xt_seri,q_seri, &
@@ -250,5 +250,5 @@
          do isplit=1,nsplit_thermals
 
-          if (iflag_thermals>=1000) THEN
+          IF (iflag_thermals>=1000) THEN
             CALL thermcell_2002(klon,klev,zdt,iflag_thermals   &
         ,pplay,paprs,pphi  &
@@ -258,5 +258,5 @@
         ,r_aspect_thermals,30.,w2di_thermals  &
         ,tau_thermals)
-          else if (iflag_thermals==2) THEN
+          ELSE IF (iflag_thermals==2) THEN
             CALL thermcell_sec(klon,klev,zdt  &
         ,pplay,paprs,pphi,zlev  &
@@ -266,5 +266,5 @@
         ,r_aspect_thermals,30.,w2di_thermals  &
         ,tau_thermals)
-          else if (iflag_thermals==3) THEN
+          ELSE IF (iflag_thermals==3) THEN
             CALL thermcell(klon,klev,zdt  &
         ,pplay,paprs,pphi  &
@@ -274,5 +274,5 @@
         ,r_aspect_thermals,l_mix_thermals,w2di_thermals  &
         ,tau_thermals)
-          else if (iflag_thermals==10) THEN
+          ELSE IF (iflag_thermals==10) THEN
             CALL thermcell_eau(klon,klev,zdt  &
         ,pplay,paprs,pphi  &
@@ -282,8 +282,8 @@
         ,r_aspect_thermals,l_mix_thermals,w2di_thermals  &
         ,tau_thermals)
-          else if (iflag_thermals==11) THEN
+          ELSE IF (iflag_thermals==11) THEN
               abort_message = 'cas non prevu dans calltherm'
               CALL abort_physic (modname,abort_message,1)
-          else if (iflag_thermals==12) THEN
+          ELSE IF (iflag_thermals==12) THEN
             CALL calcul_sec(klon,klev,zdt  &
         ,pplay,paprs,pphi,zlev  &
@@ -292,8 +292,8 @@
         ,r_aspect_thermals,l_mix_thermals,w2di_thermals  &
         ,tau_thermals)
-          else if (iflag_thermals==13.or.iflag_thermals==14) THEN
+          ELSE IF (iflag_thermals==13.OR.iflag_thermals==14) THEN
               abort_message = 'thermcellV0_main enleve svn>2084'
               CALL abort_physic (modname,abort_message,1)
-          else if (new_thermcell) THEN
+          ELSE IF (new_thermcell) THEN
             CALL thermcell_main(itap,klon,klev,zdt  &
         ,pplay,paprs,pphi,debut  &
@@ -324,5 +324,5 @@
           )
 
-           if (prt_level>10) WRITE(lunout,*)'Apres thermcell_main OK'
+           IF (prt_level>10) WRITE(lunout,*)'Apres thermcell_main OK'
          else
            abort_message = 'Cas des thermiques non prevu'
@@ -334,13 +334,13 @@
 ! Il aurait mieux valu avoir un nobidouille_stratocu
 ! Et pour simplifier :
-! nobidouille_stratocu=.not.(iflag_thermals==13.or.iflag_thermals=15)
+! nobidouille_stratocu=.NOT.(iflag_thermals==13.OR.iflag_thermals=15)
 ! Ce serait bien de changer, mai en prenant le temps de vérifier que ca
 ! fait bien ce qu'on croit.
 
-       flag_bidouille_stratocu=iflag_thermals<=12.or.iflag_thermals==14.or.iflag_thermals==16.or.iflag_thermals==18
+       flag_bidouille_stratocu=iflag_thermals<=12.OR.iflag_thermals==14.OR.iflag_thermals==16.OR.iflag_thermals==18
 
 ! Calcul a posteriori du niveau max des thermiques pour les schémas qui
 ! ne la sortent pas.
-      if (iflag_thermals<=12.or.iflag_thermals>=1000) THEN
+      IF (iflag_thermals<=12.OR.iflag_thermals>=1000) THEN
          lmax(:)=1
          do k=1,klev-1
@@ -349,5 +349,5 @@
          do k=1,klev-1
             do i=1,klon
-               if (zfm_therm(i,k+1)>0.) lmax(i)=k
+               IF (zfm_therm(i,k+1)>0.) lmax(i)=k
             enddo
          enddo
@@ -356,5 +356,5 @@
       fact(:)=0.
       DO i=1,klon
-       logexpr1(i)=flag_bidouille_stratocu.or.weak_inversion(i)>0.5
+       logexpr1(i)=flag_bidouille_stratocu.OR.weak_inversion(i)>0.5
        IF(logexpr1(i)) fact(i)=1./REAL(nsplit_thermals)
       ENDDO
@@ -402,5 +402,5 @@
 #ifdef ISOVERIF
 !      WRITE(*,*) 'calltherm 350 tmp: ajout d_xt_the'
-      if (iso_HDO.gt.0) THEN
+      IF (iso_HDO.gt.0) THEN
 !      i=479
 !      k=4
@@ -415,5 +415,5 @@
 #endif
 #endif 
-           if (prt_level>10) WRITE(lunout,*)'Apres apres thermcell_main OK'
+           IF (prt_level>10) WRITE(lunout,*)'Apres apres thermcell_main OK'
 
        DO i=1,klon
@@ -432,6 +432,6 @@
             DO k = 1, klev
             DO i = 1, klon
-               logexpr2(i,k)=.not.q_seri(i,k)>=0.
-               if (logexpr2(i,k)) THEN
+               logexpr2(i,k)=.NOT.q_seri(i,k)>=0.
+               IF (logexpr2(i,k)) THEN
                 q_seri(i,k)=1.e-15
                 nbptspb=nbptspb+1
@@ -450,5 +450,5 @@
 #ifdef ISO
 #ifdef ISOVERIF
-      if (iso_HDO.gt.0) THEN
+      IF (iso_HDO.gt.0) THEN
       CALL iso_verif_aberrant_enc_vect2D( &
           xt_seri,q_seri, &
@@ -464,6 +464,6 @@
             DO i = 1, klon
                logexpr2(i,k)=t_seri(i,k)<50..or.t_seri(i,k)>370.
-               if (logexpr2(i,k)) nbptspb=nbptspb+1
-!              if ((t_seri(i,k).lt.50.) .or.  &
+               IF (logexpr2(i,k)) nbptspb=nbptspb+1
+!              if ((t_seri(i,k).lt.50.) .OR.  &
 !    &              (t_seri(i,k).gt.370.)) THEN
 !                 PRINT*,'WARN temp apres therm i=',i,'  k=',k  &
@@ -483,5 +483,5 @@
                do k=1,klev
             do i=1,klon
-                  if (entr_therm(i,k)>0.) THEN
+                  IF (entr_therm(i,k)>0.) THEN
                      fmc_therm(i,k+1)=fmc_therm(i,k)+entr_therm(i,k)
                   else
@@ -498,9 +498,9 @@
 !      PRINT*,'<<<<calcul de lhumidite dans thermique'
 !CR:on ne le calcule que pour le cas sec
-      if (iflag_thermals<=11) THEN
+      IF (iflag_thermals<=11) THEN
       do i=1,klon
          zqasc(i,1)=q_seri(i,1)
          do k=2,klev
-            if (fmc_therm(i,k+1)>1.e-6) THEN
+            IF (fmc_therm(i,k+1)>1.e-6) THEN
                zqasc(i,k)=(fmc_therm(i,k)*zqasc(i,k-1)  &
                 +entr_therm(i,k)*q_seri(i,k))/fmc_therm(i,k+1)
@@ -519,5 +519,5 @@
                 do k=1,klev
                    clwcon0(i,k)=zqasc(i,k)-zqsat(i,k)
-                   if (clwcon0(i,k)<0. .or.   &
+                   IF (clwcon0(i,k)<0. .OR.   &
                (fm_therm(i,k+1)+detrc_therm(i,k))<1.e-6) THEN
                       clwcon0(i,k)=0.
@@ -529,5 +529,5 @@
                 do k=1,klev
                    clwcon0(i,k)=zqla(i,k)  
-                   if (clwcon0(i,k)<0. .or.   &
+                   IF (clwcon0(i,k)<0. .OR.   &
                (fm_therm(i,k+1)+detrc_therm(i,k))<1.e-6) THEN
                    clwcon0(i,k)=0. 
@@ -542,5 +542,5 @@
           do i=1,klon
              do k=1,klev
-                if (ztla(i,k) < 1.e-10) fraca(i,k) =0.
+                IF (ztla(i,k) < 1.e-10) fraca(i,k) =0.
              enddo
           enddo
