Index: /trunk/LMDZ.MARS/README
===================================================================
--- /trunk/LMDZ.MARS/README	(revision 164)
+++ /trunk/LMDZ.MARS/README	(revision 165)
@@ -740,2 +740,10 @@
 - corrected bug on interpolation of sub-surface temperatures in
   lect_start_archive.F
+
+== 17/06/2011 == AC
+>>> Important updates to thermals parameters
+- Tuned aspect ratio of thermals to suit Buoyancy estimations from LES in CLOSURE relation
+- Renormalization of alim_star after plume
+- Removed alimentation mixing of estimated Teta in plume
+>>> Minor change in makegcm_ifort
+
Index: /trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90	(revision 164)
+++ /trunk/LMDZ.MARS/libf/phymars/calltherm_interface.F90	(revision 165)
@@ -103,4 +103,5 @@
 
             pq_therm(:,:,:)=0.
+            qtransport_thermals=.true.
             call getin("qtransport_thermals",qtransport_thermals)
             if(qtransport_thermals) then
@@ -119,4 +120,5 @@
             buoyancyEst(:,:)=0.
 
+       dtke_thermals=.false.
        call getin("dtke_thermals",dtke_thermals)
          if(dtke_thermals) then
Index: /trunk/LMDZ.MARS/libf/phymars/thermcell.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/thermcell.F90	(revision 164)
+++ /trunk/LMDZ.MARS/libf/phymars/thermcell.F90	(revision 165)
@@ -72,5 +72,5 @@
 ! iflag_clos : USELESS ?				  [useless ?]
 ! iflag_wake : USELESS ?				  [useless ?]
-      PARAMETER (r_aspect_thermals = 3.)
+      PARAMETER (r_aspect_thermals = 1.5)
       PARAMETER (l_mix_thermals = 30.)
       PARAMETER (w2di_thermals = 1)
Index: /trunk/LMDZ.MARS/libf/phymars/thermcell_main_mars.F90
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/thermcell_main_mars.F90	(revision 164)
+++ /trunk/LMDZ.MARS/libf/phymars/thermcell_main_mars.F90	(revision 165)
@@ -324,4 +324,5 @@
                alim_star(ig,1)=MAX((ztv(ig,1)-ztv(ig,2)),0.)  &
      &                       *sqrt(zlev(ig,2))
+!      &                       *zlev(ig,2)
                lalim(ig)=2
                alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,1)
@@ -334,4 +335,5 @@
                alim_star(ig,l)=MAX((ztv(ig,l)-ztv(ig,l+1)),0.)  &
      &                       *sqrt(zlev(ig,l+1))
+!      &                       *zlev(ig,2)
                 lalim(ig)=l+1
                alim_star_tot(ig)=alim_star_tot(ig)+alim_star(ig,l)
@@ -348,4 +350,7 @@
 
       alim_star_tot(:)=1.
+      if(alim_star(1,1) .ne. 0.) then
+      print*, alim_star(:,:)
+      endif
 
 !------------------------------------------------------------------------------
@@ -403,11 +408,11 @@
              if(active(ig)) then
 
-                if(l .lt. lalim(ig)) then
-                ztva_est(ig,l)=(f_star(ig,l)*ztla(ig,l-1)+  &
-     &            alim_star(ig,l)*ztv(ig,l))  &
-     &            /(f_star(ig,l)+alim_star(ig,l))
-                else
+!                if(l .lt. lalim(ig)) then
+!                ztva_est(ig,l)=(f_star(ig,l)*ztla(ig,l-1)+  &
+!     &            alim_star(ig,l)*ztv(ig,l))  &
+!     &            /(f_star(ig,l)+alim_star(ig,l))
+!                else
                 ztva_est(ig,l)=ztla(ig,l-1)
-                endif
+!                endif
 
                 zdz=zlev(ig,l+1)-zlev(ig,l)
@@ -566,4 +571,11 @@
        enddo
 
+      do l=1,nlay
+         do ig=1,ngrid
+            if (alim_star_tot(ig) > 1.e-10 ) then
+               alim_star(ig,l)=alim_star(ig,l)/alim_star_tot(ig)
+            endif
+         enddo
+      enddo
 
 ! ===========================================================================
@@ -1154,5 +1166,8 @@
      &   fm(ig,k)*ztv(ig,k)+fm(ig,k)*ztva(ig,k)-fm(ig,k+1)*ztva(ig,k+1))
             if (ztv(ig,k) + ptimestep*zdthladj(ig,k) .le. 0.) then
-              print*,'q<0 in thermcell_dTeta up: qenv .. dq : ', ztv(ig,k),ptimestep*zdthladj(ig,k)
+              print*,'Teta<0 in thermcell_dTeta up: qenv .. dq : ', ztv(ig,k),ptimestep*zdthladj(ig,k)
+              if(ztv(ig,k) .gt. 0.) then
+              zdthladj(ig,k)=0.
+              endif
             endif
          enddo
@@ -1211,4 +1226,7 @@
             if (ztv(ig,k) + ptimestep*zdthladj_down(ig,k) .le. 0.) then
               print*,'q<0 in thermcell_dTeta down: qenv .. dq : ', ztv(ig,k),ptimestep*zdthladj_down(ig,k)
+              if(ztv(ig,k) .gt. 0.) then
+              zdthladj(ig,k)=0.
+              endif
             endif
          enddo
Index: /trunk/LMDZ.MARS/makegcm_ifort
===================================================================
--- /trunk/LMDZ.MARS/makegcm_ifort	(revision 164)
+++ /trunk/LMDZ.MARS/makegcm_ifort	(revision 165)
@@ -22,5 +22,4 @@
 # default LMDGCM to where makegcm script is located:
 #setenv LMDGCM "`dirname $0`"
-setenv LMDGCM /san/home/millour/Planeto/test_mars_141/LMDZ.MARS
 # You may set LIBOGCM to something else; otherwise we default to:
 setenv LIBOGCM $LMDGCM/libo
