Index: LMDZ6/trunk/libf/phylmd/add_phys_tend_mod.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/add_phys_tend_mod.F90	(revision 4737)
+++ LMDZ6/trunk/libf/phylmd/add_phys_tend_mod.F90	(revision 4738)
@@ -71,6 +71,6 @@
         zzdt(i, k) = hthturb_gcssold(k)*dtime_frcg
         zzdq(i, k) = hqturb_gcssold(k)*dtime_frcg
-      END DO
-    END DO
+      ENDDO
+    ENDDO
     PRINT *, ' add_pbl_tend, dtime_frcg ', dtime_frcg
     PRINT *, ' add_pbl_tend, zzdt ', zzdt
@@ -79,6 +79,5 @@
   ELSE
     CALL add_phys_tend(zdu, zdv, zdt, zdq, zdql, zdqi, zdqbs, paprs, text,abortphy,flag_inhib_tend, itap, 0)
-  END IF
-
+  ENDIF
 
   RETURN
@@ -110,6 +109,6 @@
   &           , d_h_qw_col, d_h_ql_col, d_h_qs_col, d_h_qbs_col, d_h_col
 IMPLICIT none
-  include "YOMCST.h"
-  include "clesphys.h"
+INCLUDE "YOMCST.h"
+INCLUDE "clesphys.h"
 
 ! Arguments :
@@ -148,6 +147,6 @@
 LOGICAL done(klon)
 
-integer debug_level
-logical, save :: first=.true.
+INTEGER debug_level
+LOGICAL, SAVE :: first=.true.
 !$OMP THREADPRIVATE(first)
 !
@@ -179,5 +178,4 @@
 REAL zh_qw_col(klon,2), zh_ql_col(klon,2), zh_qs_col(klon,2), zh_qbs_col(klon,2)
 REAL zh_col(klon,2)
-
 REAL zcpvap, zcwat, zcice
 
@@ -185,27 +183,26 @@
 ! Initialisations
 
-     IF (prt_level >= 5) then
-        write (*,*) "In add_phys_tend, after ",text
-        call flush
-     end if
-
-     ! if flag_inhib_tend != 0, tendencies are not added
-     IF (flag_inhib_tend /= 0) then
-        ! If requiered, diagnostics are shown
-        IF (flag_inhib_tend > 0) then
-           ! print some diagnostics if xxx_seri have changed
-           call cmp_seri(flag_inhib_tend,text)
-        END IF
-        RETURN ! on n ajoute pas les tendance
-     END IF
-
-     IF (abortphy==1) RETURN ! on n ajoute pas les tendance si le modele
-                              ! a deja plante.
-
-     debug_level=10
-     if (first) then
-        print *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
-        first=.false.
-     endif
+  IF (prt_level >= 5) THEN
+     write (*,*) "In add_phys_tend, after ",text
+     CALL flush
+  ENDIf
+
+  ! if flag_inhib_tend != 0, tendencies are not added
+  IF (flag_inhib_tend /= 0) THEN
+     ! If requiered, diagnostics are shown
+     IF (flag_inhib_tend > 0) THEN
+        ! print some diagnostics if xxx_seri have changed
+        call cmp_seri(flag_inhib_tend,text)
+     ENDIF
+     RETURN ! on n ajoute pas les tendance
+  ENDIF
+
+  IF (abortphy==1) RETURN ! on n ajoute pas les tendance si le modele a deja plante.
+
+  debug_level=10
+  IF (first) THEN
+     print *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
+     first=.false.
+  ENDIF
 !
 !  print *,'add_phys_tend: paprs ',paprs
@@ -227,7 +224,7 @@
     ! layer air mass
     zairm(:, k) = (paprs(:,k)-paprs(:,k+1))/rg
-  END DO
-
-  if (fl_ebil .GT. 0) then
+  ENDDO
+
+  IF (fl_ebil .GT. 0) THEN
     ! ------------------------------------------------
     ! Compute vertical sum for each atmospheric column
@@ -244,5 +241,5 @@
                     zh_qw_col(:,n), zh_ql_col(:,n), zh_qs_col(:,n), zh_qbs_col(:,n), zh_col(:,n))
 
-  end if ! end if (fl_ebil .GT. 0)
+  ENDIF ! endif (fl_ebil .GT. 0)
 
 !======================================================================
@@ -250,9 +247,9 @@
 !======================================================================
 
-     u_seri(:,:)=u_seri(:,:)+zdu(:,:)
-     v_seri(:,:)=v_seri(:,:)+zdv(:,:)
-     ql_seri(:,:)=ql_seri(:,:)+zdql(:,:)
-     qs_seri(:,:)=qs_seri(:,:)+zdqi(:,:)
-     qbs_seri(:,:)=qbs_seri(:,:)+zdqbs(:,:)
+  u_seri(:,:)=u_seri(:,:)+zdu(:,:)
+  v_seri(:,:)=v_seri(:,:)+zdv(:,:)
+  ql_seri(:,:)=ql_seri(:,:)+zdql(:,:)
+  qs_seri(:,:)=qs_seri(:,:)+zdqi(:,:)
+  qbs_seri(:,:)=qbs_seri(:,:)+zdqbs(:,:)
 
 !======================================================================
@@ -261,24 +258,24 @@
 !======================================================================
 
-      jbad=0
-      jqbad=0
-      DO k = 1, klev
-         DO i = 1, klon
-            zt=t_seri(i,k)+zdt(i,k)
-            zq=q_seri(i,k)+zdq(i,k)
-            IF ( zt>370. .or. zt<130. .or. abs(zdt(i,k))>50. ) then
-            jbad = jbad + 1
-            jadrs(jbad) = i
-            kadrs(jbad) = k
-            ENDIF
-            IF ( zq<0. .or. zq>0.1 .or. abs(zdq(i,k))>1.e-2 ) then
-            jqbad = jqbad + 1
-            jqadrs(jqbad) = i
-            kqadrs(jqbad) = k
-            ENDIF
-            t_seri(i,k)=zt
-            q_seri(i,k)=zq
-         ENDDO
-      ENDDO
+  jbad=0
+  jqbad=0
+  DO k = 1, klev
+     DO i = 1, klon
+        zt=t_seri(i,k)+zdt(i,k)
+        zq=q_seri(i,k)+zdq(i,k)
+        IF ( zt>370. .or. zt<130. .or. abs(zdt(i,k))>50. ) THEN
+           jbad = jbad + 1
+           jadrs(jbad) = i
+           kadrs(jbad) = k
+        ENDIF
+        IF ( zq<0. .or. zq>0.1 .or. abs(zdq(i,k))>1.e-2 ) THEN
+           jqbad = jqbad + 1
+           jqadrs(jqbad) = i
+           kqadrs(jqbad) = k
+        ENDIF
+        t_seri(i,k)=zt
+        q_seri(i,k)=zq
+     ENDDO
+  ENDDO
 
 !=====================================================================================
@@ -286,8 +283,8 @@
 !=====================================================================================
 
-IF (jbad .GT. 0) THEN
-      DO j = 1, jbad
-         i=jadrs(j)
-         if(prt_level.ge.debug_level) THEN
+  IF (jbad .GT. 0) THEN
+     DO j = 1, jbad
+        i=jadrs(j)
+        IF (prt_level.ge.debug_level) THEN
           print*,'PLANTAGE POUR LE POINT i lon lat =',&
                  i,longitude_deg(i),latitude_deg(i),text
@@ -297,12 +294,12 @@
           ENDDO
           call print_debug_phys(i,debug_level,text)
-         endif
-      ENDDO
-ENDIF
+        ENDIF
+     ENDDO
+  ENDIF
 !
 !=====================================================================================
 ! Impression, warning et correction en cas de probleme moins important
 !=====================================================================================
-IF (jqbad .GT. 0) THEN
+  IF (jqbad .GT. 0) THEN
       done(:) = .false.                         !jyg
       DO j = 1, jqbad
@@ -315,5 +312,5 @@
               write(*,'(i3,2f14.4,2e14.2)') k,t_seri(i,k),zdt(i,k),q_seri(i,k),zdq(i,k)
            ENDDO
-          endif
+          ENDIF
           IF (ok_conserv_q) THEN
 !jyg<20140228 Corrections pour conservation de l'eau
@@ -328,8 +325,8 @@
                 zqp_int = zqp_int + zqp(k)     *(paprs(i,k)-paprs(i,k+1))/Rg
               ENDDO
-              if(prt_level.ge.debug_level) THEN
+              IF (prt_level.ge.debug_level) THEN
                print*,' cas q_seri<1.e-15 i k zq_int zqp_int zq_int/zqp_int :', &
                                     i, kqadrs(j), zq_int, zqp_int, zq_int/zqp_int
-              endif
+              ENDIF
               DO k = 1, klev
                 zq_new = zqp(k)*zq_int/zqp_int
@@ -343,15 +340,15 @@
             DO k = 1, klev
               zq=q_seri(i,k)+zdq(i,k)
-              if (zq.lt.1.e-15) then
-                 if (q_seri(i,k).lt.1.e-15) then
-                  if(prt_level.ge.debug_level) THEN
-                   print*,' cas q_seri<1.e-15 i k q_seri zq zdq :',i,k,q_seri(i,k),zq,zdq(i,k)
-                  endif
-                  q_seri(i,k)=1.e-15
-                  zdq(i,k)=(1.e-15-q_seri(i,k))
-                 endif
-              endif
+              IF (zq.lt.1.e-15) THEN
+                 IF (q_seri(i,k).lt.1.e-15) THEN
+                   IF (prt_level.ge.debug_level) THEN
+                    print*,' cas q_seri<1.e-15 i k q_seri zq zdq :',i,k,q_seri(i,k),zq,zdq(i,k)
+                   ENDIF
+                   q_seri(i,k)=1.e-15
+                   zdq(i,k)=(1.e-15-q_seri(i,k))
+                 ENDIF
+              ENDIF
 !              zq=q_seri(i,k)+zdq(i,k)
-!              if (zq.lt.1.e-15) then
+!              if (zq.lt.1.e-15) THEN
 !                 zdq(i,k)=(1.e-15-q_seri(i,k))
 !              endif
@@ -361,30 +358,30 @@
 !jyg>
       ENDDO ! j = 1, jqbad
-ENDIF
+  ENDIF
 !
 
 !IM ajout memes tests pour reverifier les jbad, jqbad beg
-      jbad=0
-      jqbad=0
-      DO k = 1, klev
-         DO i = 1, klon
-            IF ( t_seri(i,k)>370. .or. t_seri(i,k)<130. .or. abs(zdt(i,k))>50. ) then
-            jbad = jbad + 1
-            jadrs(jbad) = i
-!            if(prt_level.ge.debug_level) THEN
-!             print*,'cas2 i k t_seri zdt',i,k,t_seri(i,k),zdt(i,k)
-!            endif
-            ENDIF
-            IF ( q_seri(i,k)<0. .or. q_seri(i,k)>0.1 .or. abs(zdq(i,k))>1.e-2 ) then
-            jqbad = jqbad + 1
-            jqadrs(jqbad) = i
-            kqadrs(jqbad) = k
-!            if(prt_level.ge.debug_level) THEN
-!             print*,'cas2 i k q_seri zdq',i,k,q_seri(i,k),zdq(i,k)
-!            endif
-            ENDIF
-         ENDDO
-      ENDDO
-IF (jbad .GT. 0) THEN
+  jbad=0
+  jqbad=0
+  DO k = 1, klev
+     DO i = 1, klon
+        IF ( t_seri(i,k)>370. .or. t_seri(i,k)<130. .or. abs(zdt(i,k))>50. ) THEN
+        jbad = jbad + 1
+        jadrs(jbad) = i
+!         if(prt_level.ge.debug_level) THEN
+!         print*,'cas2 i k t_seri zdt',i,k,t_seri(i,k),zdt(i,k)
+!        endif
+        ENDIF
+        IF ( q_seri(i,k)<0. .or. q_seri(i,k)>0.1 .or. abs(zdq(i,k))>1.e-2 ) THEN
+        jqbad = jqbad + 1
+        jqadrs(jqbad) = i
+        kqadrs(jqbad) = k
+!        if(prt_level.ge.debug_level) THEN
+!         print*,'cas2 i k q_seri zdq',i,k,q_seri(i,k),zdq(i,k)
+!        endif
+        ENDIF
+     ENDDO
+  ENDDO
+  IF (jbad .GT. 0) THEN
       DO j = 1, jbad
          i=jadrs(j)
@@ -400,13 +397,13 @@
           ENDDO
           call print_debug_phys(i,debug_level,text)
-         endif
+         ENDIF
       ENDDO
-ENDIF 
-!
-IF (jqbad .GT. 0) THEN
+  ENDIF 
+!
+  IF (jqbad .GT. 0) THEN
       DO j = 1, jqbad
          i=jqadrs(j)
          k=kqadrs(j)
-         if(prt_level.ge.debug_level) THEN
+         IF (prt_level.ge.debug_level) THEN
           print*,'WARNING  : EAU2 POUR LE POINT i itap lon lat txt jqbad zdq q zdql ql',&
                  i,itap,longitude_deg(i),latitude_deg(i),text,jqbad,&
@@ -418,7 +415,7 @@
           ENDDO
           call print_debug_phys(i,debug_level,text)
-         endif
+         ENDIF
       ENDDO
-ENDIF
+  ENDIF
 
 !======================================================================
@@ -429,14 +426,14 @@
 !======================================================================
 
-      CALL hgardfou(t_seri,ftsol,text,abortphy) 
-      IF (abortphy==1) THEN
-        Print*,'ERROR ABORT hgardfou dans ',text
+  CALL hgardfou(t_seri,ftsol,text,abortphy) 
+  IF (abortphy==1) THEN
+    print*,'ERROR ABORT hgardfou dans ',text
 ! JLD pourquoi on ne modifie pas de meme t_seri et q_seri ?
-        u_seri(:,:)=u_seri(:,:)-zdu(:,:)
-        v_seri(:,:)=v_seri(:,:)-zdv(:,:)
-        ql_seri(:,:)=ql_seri(:,:)-zdql(:,:)
-        qs_seri(:,:)=qs_seri(:,:)-zdqi(:,:)
-        qbs_seri(:,:)=qbs_seri(:,:)-zdqbs(:,:)
-      ENDIF
+    u_seri(:,:)=u_seri(:,:)-zdu(:,:)
+    v_seri(:,:)=v_seri(:,:)-zdv(:,:)
+    ql_seri(:,:)=ql_seri(:,:)-zdql(:,:)
+    qs_seri(:,:)=qs_seri(:,:)-zdqi(:,:)
+    qbs_seri(:,:)=qbs_seri(:,:)-zdqbs(:,:)
+  ENDIF
 
 !======================================================================
@@ -444,5 +441,5 @@
 !======================================================================
 
-  if (fl_ebil .GT. 0) then
+  IF (fl_ebil .GT. 0) THEn
   
     ! ------------------------------------------------
@@ -476,5 +473,5 @@
     d_h_col = (zh_col(:,2)-zh_col(:,1))/phys_tstep 
 
-  end if ! end if (fl_ebil .GT. 0)
+  ENDIF ! endif (fl_ebil .GT. 0)
 !
 ! When in diagnostic mode, restore "out" variables to initial values.
@@ -530,11 +527,9 @@
 REAL, DIMENSION(nlon,nlev)      :: uu_n, vv_n
 REAL, DIMENSION(nlon,nlev)      :: temp_n, qv_n, ql_n, qs_n, qbs_n
-
-
 !
 INTEGER k, n
 
-integer debug_level
-logical, save :: first=.true.
+INTEGER debug_level
+LOGICAL, SAVE :: first=.true.
 !$OMP THREADPRIVATE(first)
 !
@@ -569,14 +564,14 @@
 ! Initialisations
 
-     IF (prt_level >= 5) then
-        write (*,*) "In diag_phys_tend, after ",text
-        call flush
-     end if
-
-     debug_level=10
-     if (first) then
-        print *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
-        first=.false.
-     endif
+  IF (prt_level >= 5) THEN
+     write (*,*) "In diag_phys_tend, after ",text
+     CALL flush
+  ENDIF
+
+  debug_level=10
+  IF (first) THEN
+     print *,"TestJLD rcpv, rcw, rcs",rcpv, rcw, rcs
+     first=.false.
+  ENDIF
 !
 !  print *,'add_phys_tend: paprs ',paprs
@@ -587,7 +582,7 @@
     ! layer air mass
     zairm(:, k) = (paprs(:,k)-paprs(:,k+1))/rg
-  END DO
-
-  if (fl_ebil .GT. 0) then
+  ENDDO
+
+  IF (fl_ebil .GT. 0) THEN
     ! ------------------------------------------------
     ! Compute vertical sum for each atmospheric column
@@ -600,5 +595,5 @@
                     zh_qw_col(:,n), zh_ql_col(:,n), zh_qs_col(:,n), zh_qbs_col(:,n), zh_col(:,n))
 
-  end if ! end if (fl_ebil .GT. 0)
+  ENDIF ! endif (fl_ebil .GT. 0)
 
 !======================================================================
@@ -606,13 +601,11 @@
 !======================================================================
 
-     uu_n(:,:)=uu(:,:)+zdu(:,:)
-     vv_n(:,:)=vv(:,:)+zdv(:,:)
-     qv_n(:,:)=qv(:,:)+zdq(:,:)
-     ql_n(:,:)=ql(:,:)+zdql(:,:)
-     qs_n(:,:)=qs(:,:)+zdqs(:,:)
-     qbs_n(:,:)=qbs(:,:)+zdqbs(:,:)
-     temp_n(:,:)=temp(:,:)+zdt(:,:)
-
-
+  uu_n(:,:)=uu(:,:)+zdu(:,:)
+  vv_n(:,:)=vv(:,:)+zdv(:,:)
+  qv_n(:,:)=qv(:,:)+zdq(:,:)
+  ql_n(:,:)=ql(:,:)+zdql(:,:)
+  qs_n(:,:)=qs(:,:)+zdqs(:,:)
+  qbs_n(:,:)=qbs(:,:)+zdqbs(:,:)
+  temp_n(:,:)=temp(:,:)+zdt(:,:)
 
 !======================================================================
@@ -620,5 +613,5 @@
 !======================================================================
 
-  if (fl_ebil .GT. 0) then
+  IF (fl_ebil .GT. 0) THEN
   
     ! ------------------------------------------------
@@ -644,7 +637,7 @@
     d_ek_col(:) = (zek_col(:,2)-zek_col(:,1))/phys_tstep
 
-   print *,'zdu ', zdu
-   print *,'zdv ', zdv
-   print *,'d_ek_col, zek_col(2), zek_col(1) ',d_ek_col(1), zek_col(1,2), zek_col(1,1)
+    print *,'zdu ', zdu
+    print *,'zdv ', zdv
+    print *,'d_ek_col, zek_col(2), zek_col(1) ',d_ek_col(1), zek_col(1,2), zek_col(1,1)
 
     d_h_dair_col(:) = (zh_dair_col(:,2)-zh_dair_col(:,1))/phys_tstep
@@ -656,5 +649,5 @@
     d_h_col = (zh_col(:,2)-zh_col(:,1))/phys_tstep 
 
-  end if ! end if (fl_ebil .GT. 0)
+  ENDIF ! endif (fl_ebil .GT. 0)
 !
 
@@ -668,5 +661,5 @@
 
 IMPLICIT none
-  include "YOMCST.h"
+INCLUDE "YOMCST.h"
 
 INTEGER,                    INTENT(IN)    :: nlon,nlev
@@ -685,5 +678,4 @@
 
 INTEGER          :: i, k
-
 
   ! Reset variables
@@ -720,6 +712,6 @@
         zh_qs_col(i) = zh_qs_col(i) + (zcpvap*temp(i, k) - rlstt)*qs(i, k)*zairm(i, k)   !jyg
         zh_qbs_col(i) = zh_qbs_col(i) + (zcpvap*temp(i, k) - rlstt)*qbs(i, k)*zairm(i, k)   !jyg
-      END DO
-    END DO
+      ENDDO
+    ENDDO
     ! compute total air enthalpy
     zh_col(:) = zh_dair_col(:) + zh_qw_col(:) + zh_ql_col(:) + zh_qs_col(:) + zh_qbs_col(:)
@@ -749,16 +741,16 @@
 USE climb_hq_mod, ONLY : d_h_col_vdf, f_h_bnd
 IMPLICIT none
-include "YOMCST.h"
+INCLUDE "YOMCST.h"
 
 ! Arguments :
 !------------
 CHARACTER*(*) text ! text specifing the involved parametrization 
-integer itap        ! time step number
+INTEGER itap        ! time step number
 ! local variables
 ! ---------------
-real bilq_seuil,  bilh_seuil ! thresold on error in Q and H budget
-real bilq_error,  bilh_error ! erros in Q and H budget
-real bilq_bnd,  bilh_bnd     ! Q and H budget due to exchange with boundaries
-integer bilq_ok,  bilh_ok
+REAL bilq_seuil,  bilh_seuil ! thresold on error in Q and H budget
+REAL bilq_error,  bilh_error ! erros in Q and H budget
+REAL bilq_bnd,  bilh_bnd     ! Q and H budget due to exchange with boundaries
+INTEGER bilq_ok,  bilh_ok
 CHARACTER*(12) status
 
@@ -769,5 +761,5 @@
 
 !!print *,'prt_level:',prt_level,' fl_ebil:',fl_ebil,' fl_cor_ebil:',fl_cor_ebil
-if ( (fl_ebil .GT. 0) .and. (klon .EQ. 1)) then
+IF ((fl_ebil .GT. 0) .AND. (klon .EQ. 1)) THEN
 
   bilq_bnd = 0.
@@ -801,49 +793,49 @@
   bilh_error = d_h_col(1) - bilh_bnd
 ! are the errors too large?
-  if ( abs(bilq_error) .gt. bilq_seuil) bilq_ok=1
-  if ( abs(bilh_error) .gt. bilh_seuil) bilh_ok=1
+  IF (abs(bilq_error) .GT. bilq_seuil) bilq_ok=1
+  IF (abs(bilh_error) .GT. bilh_seuil) bilh_ok=1
 !
 ! Print diagnostics
 ! =================
-  if ( (bilq_ok .eq. 0).and.(bilh_ok .eq. 0) ) then
+  IF ( (bilq_ok .eq. 0).AND.(bilh_ok .eq. 0) ) THEN
     status="enerbil-OK"
-  else
+  ELSE
     status="enerbil-PB"
-  end if
-
-  if ( prt_level .GE. 3) then
+  ENDIF
+
+  IF (prt_level .GE. 3) THEN
     write(*,9010) text,status," itap:",itap,"enerbilERROR: Q", bilq_error,"  H", bilh_error
 9010  format (1x,A8,2x,A12,A6,I4,A18,E15.6,A5,E15.6)
-  end if
-  if ( prt_level .GE. 3) then
+  ENDIF
+  IF (prt_level .GE. 3) THEN
     write(*,9000) text,"enerbil: Q,H,KE budget", d_qt_col(1), d_h_col(1),d_ek_col(1)
-  end if
-  if ( prt_level .GE. 5) then
+  ENDIF
+  IF (prt_level .GE. 5) THEN
     write(*,9000) text,"enerbil at boundaries: Q, H",bilq_bnd, bilh_bnd
     write(*,9000) text,"enerbil: water budget",d_qt_col(1),d_qw_col(1),d_ql_col(1),d_qs_col(1), d_qbs_col(1)
     write(*,9000) text,"enerbil: enthalpy budget",d_h_col(1),d_h_dair_col(1),d_h_qw_col(1),d_h_ql_col(1),d_h_qs_col(1),d_h_qbs_col(1)
-  end if
+  ENDIF
 
   specific_diag: SELECT CASE (text)
   CASE("vdf") specific_diag
-    if ( prt_level .GE. 5) then
+    IF (prt_level .GE. 5) THEN
       write(*,9000) text,"enerbil: d_h, bilh, sens,t_seri", d_h_col(1), bilh_bnd, sens(1), t_seri(1,1)
       write(*,9000) text,"enerbil: d_h_col_vdf, f_h, diff",d_h_col_vdf, f_h_bnd, bilh_bnd-sens(1)
-    end if
+    ENDIF
   CASE("lsc") specific_diag
-    if ( prt_level .GE. 5) then
+    IF (prt_level .GE. 5) THEN
       write(*,9000) text,"enerbil: rain, bil_lat, bil_sens", rain_lsc(1), rlvtt * rain_lsc(1), -(rcw-rcpd)*t_seri(1,1) * rain_lsc(1)
       write(*,9000) text,"enerbil: snow, bil_lat, bil_sens", snow_lsc(1), rlstt * snow_lsc(1), -(rcs-rcpd)*t_seri(1,1) * snow_lsc(1)
-    end if
+    ENDIF
   CASE("convection") specific_diag
-    if ( prt_level .GE. 5) then
+    IF (prt_level .GE. 5) THEN
       write(*,9000) text,"enerbil: rain, bil_lat, bil_sens", rain_con(1), rlvtt * rain_con(1), -(rcw-rcpd)*t_seri(1,1) * rain_con(1)
       write(*,9000) text,"enerbil: snow, bil_lat, bil_sens", snow_con(1), rlstt * snow_con(1), -(rcs-rcpd)*t_seri(1,1) * snow_con(1)
-    end if
+    ENDIF
   END SELECT specific_diag
 
-9000 format (1x,A8,2x,A35,10E15.6)
-
-end if ! end if (fl_ebil .GT. 0)
+9000 FORMAT(1x,A8,2x,A35,10E15.6)
+
+ENDIF ! endif (fl_ebil .GT. 0)
 
 END SUBROUTINE prt_enerbil
