Index: /trunk/LMDZ.TITAN/libf/chimtitan/disso.c
===================================================================
--- /trunk/LMDZ.TITAN/libf/chimtitan/disso.c	(revision 3339)
+++ /trunk/LMDZ.TITAN/libf/chimtitan/disso.c	(revision 3340)
@@ -200,8 +200,9 @@
 
 /* lecture des flux actiniques:
-   - suppose que l'executable est dans $LMDGCM/RUN/xxx/
-   - et les moyennes dans $LMDGCM/datagcm/PHOT(NLAT)/Moy_(lat:1 a NLAT)
+   - suppose la presence d'un lien au même niveau que l'executable
+   pointant vers le repertoire datagcm (ou qu'il soit...)
+   - et les moyennes dans datagcm/PHOT(NLAT)/Moy_(lat:1 a NLAT)
 */
-   strcpy( dir, "../../datagcm/PHOT" );
+   strcpy( dir, "datagcm/PHOT" );
    if( (*NLAT) < 10 )
    {
Index: /trunk/LMDZ.TITAN/libf/phytitan/optci.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/optci.F90	(revision 3339)
+++ /trunk/LMDZ.TITAN/libf/phytitan/optci.F90	(revision 3340)
@@ -106,4 +106,6 @@
   integer dumch
   real*8  dumwvl
+  integer ilev_cutoff
+  real*8 corr_haze
 
   ! Variables for new optics
@@ -152,4 +154,8 @@
    lkcoef(:,:)   = 0.0
 
+   ! Level of cutoff
+   !~~~~~~~~~~~~~~~~
+   ilev_cutoff = 26
+
    do K=2,L_LEVELS
       ilay = L_NLAYRAD+1 - k/2 ! int. arithmetic => gives the gcm layer index (reversed)
@@ -182,8 +188,8 @@
                m3as = pqmo(ilay,2) / 2.0
                m3af = pqmo(ilay,4) / 2.0
-               ! Cut-off (here for p = 2.7e3Pa / alt = 70km)
-               IF (ilay .lt. 23) THEN
-                  m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
-                  m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
+               ! Cut-off 
+               IF (ilay .lt. ilev_cutoff) THEN
+                  m3as = pqmo(ilev_cutoff,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
+                  m3af = pqmo(ilev_cutoff,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
                ENDIF
 
@@ -206,9 +212,9 @@
                m0as  = pqmo(ilay,1) / 2.0
                m3as  = pqmo(ilay,2) / 2.0
-               ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km)
+               ! If not callclouds : must have a cut-off 
                IF (.NOT. callclouds) THEN
-                  IF (ilay .lt. 23) THEN
-                     m0as = pqmo(23,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
-                     m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
+                  IF (ilay .lt. ilev_cutoff) THEN
+                     m0as = pqmo(ilev_cutoff,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
+                     m3as = pqmo(ilev_cutoff,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
                   ENDIF
                ENDIF
@@ -220,9 +226,9 @@
                m0af  = pqmo(ilay,3) / 2.0
                m3af  = pqmo(ilay,4) / 2.0
-               ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km)
+               ! If not callclouds : must have a cut-off 
                IF (.NOT. callclouds) THEN
-                  IF (ilay .lt. 23) THEN
-                     m0af = pqmo(23,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
-                     m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
+                  IF (ilay .lt. ilev_cutoff) THEN
+                     m0af = pqmo(ilev_cutoff,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
+                     m3af = pqmo(ilev_cutoff,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
                   ENDIF
                ENDIF
@@ -248,4 +254,12 @@
             ENDIF
             
+            ! Opacity and albedo adjustement below cutoff :
+            IF (.NOT. callclouds) THEN
+               corr_haze=0.6-0.4*TANH((PMID(K)*100.-2500.)/250.)
+               IF (ilay .lt. ilev_cutoff) THEN
+                  DHAZE_T(k,nw) = DHAZE_T(k,nw) * corr_haze
+               ENDIF
+            ENDIF
+
             ! Diagnostics for the haze :
             DIAG_OPTH(k,nw,1) = DHAZE_T(k,nw) ! dtau
Index: /trunk/LMDZ.TITAN/libf/phytitan/optcv.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/optcv.F90	(revision 3339)
+++ /trunk/LMDZ.TITAN/libf/phytitan/optcv.F90	(revision 3340)
@@ -117,4 +117,7 @@
   integer dumch
   real*8  dumwvl
+  integer ilev_cutoff ! pressure level index of cutoff
+  real*8  corr_haze
+  real*8  corr_alb
 
   ! Variables for new optics
@@ -168,4 +171,8 @@
    lkcoef(:,:)   = 0.0
 
+   ! Level of cutoff
+   !~~~~~~~~~~~~~~~~
+   ilev_cutoff = 26
+
    do K=2,L_LEVELS
       ilay = L_NLAYRAD+1 - k/2 ! int. arithmetic => gives the gcm layer index (reversed)
@@ -210,7 +217,7 @@
                m3af = pqmo(ilay,4) / 2.0
                ! Cut-off (here for p = 2.7e3Pa / alt = 70km)
-               IF (ilay .lt. 23) THEN
-                  m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
-                  m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
+               IF (ilay .lt. ilev_cutoff) THEN
+                  m3as = pqmo(ilev_cutoff,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
+                  m3af = pqmo(ilev_cutoff,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
                ENDIF
                
@@ -235,7 +242,7 @@
                ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km)
                IF (.NOT. callclouds) THEN
-                  IF (ilay .lt. 23) THEN
-                     m0as = pqmo(23,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
-                     m3as = pqmo(23,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
+                  IF (ilay .lt. ilev_cutoff) THEN
+                     m0as = pqmo(ilev_cutoff,1) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
+                     m3as = pqmo(ilev_cutoff,2) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
                   ENDIF
                ENDIF
@@ -249,7 +256,7 @@
                ! If not callclouds : must have a cut-off (here for p = 2.7e3Pa / alt = 70km)
                IF (.NOT. callclouds) THEN
-                  IF (ilay .lt. 23) THEN
-                     m0af = pqmo(23,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
-                     m3af = pqmo(23,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(24)-zlev(23))
+                  IF (ilay .lt. ilev_cutoff) THEN
+                     m0af = pqmo(ilev_cutoff,3) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
+                     m3af = pqmo(ilev_cutoff,4) / 2.0 * (zlev(ilay+1)-zlev(ilay)) / (zlev(ilev_cutoff+1)-zlev(ilev_cutoff))
                   ENDIF
                ENDIF
@@ -273,4 +280,15 @@
                SSA_T(k,nw)   = 1.0
                ASF_T(k,nw)   = 1.0
+            ENDIF
+
+            ! Opacity and albedo adjustement below cutoff
+            !----------------------------------------------
+            corr_haze=0.85-0.15*TANH((PMID(k)*100.-2500.)/250.)
+            corr_alb =0.85-0.15*TANH((PMID(k)*100.-4500.)/1000.)
+            IF (.NOT. callclouds) THEN
+               IF (ilay .lt. ilev_cutoff) THEN
+                  DHAZE_T(k,nw) = DHAZE_T(k,nw) * corr_haze
+                  SSA_T(k,nw)   = SSA_T(k,nw) * corr_alb
+               ENDIF
             ENDIF
 
Index: /trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
===================================================================
--- /trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90	(revision 3339)
+++ /trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90	(revision 3340)
@@ -139,5 +139,5 @@
 !    pdt(ngrid,nlayer)         /  variables due to physical processes.
 !    pdq(ngrid,nlayer)        /
-!    pdpsrf(ngrid)             /
+!    pdpsrf(ngrid)           /
 !
 !
@@ -290,4 +290,6 @@
       real gmplanet
       real taux(ngrid),tauy(ngrid)
+      real factlat
+      real zundg(nlayer)
 
 
@@ -1117,4 +1119,19 @@
                ENDDO
             ENDIF
+            ! In case there is no clouds, in the troposphere the moments are  fixed to evacuate all aerosols
+            IF (.NOT. callclouds) THEN
+               DO l = 1, nlayer
+                  DO ig=1,ngrid
+                     IF (pplay(ig,l) .gt. 1000.) THEN
+                        pdq(ig,l,1)=0.
+                        pdq(ig,l,2)=0.
+                        IF (pplay(ig,l) .gt. 5000.) THEN
+                           pdq(ig,l,3)=0.
+                           pdq(ig,l,4)=0.
+                        ENDIF
+                     ENDIF
+                  ENDDO
+               ENDDO
+            ENDIF
 #endif
 
@@ -1354,14 +1371,18 @@
       if (nudging_u) then
          zdundg(:,:) = 0.D0
+         j=1
          ! boucle sur les points de grille :
          do i = 1, ngrid
-            ! boucle sur les latitudes :
-            do j = 1, 49
-               ! Nudging of the first 23 layers only !!
-               if (ABS(REAL(u_ref(j,1)) - REAL(latitude_deg(i))) .lt. 1e-2) then
-                  zdundg(i,1:23) = (u_ref(j,2:24) - (pu(i,1:23)+pdu(i,1:23)*ptimestep)) / nudging_dt
-               endif
-            enddo
+             ! interpolation linéaire des données dans le fichier lu (sur 49 latitudes)
+             do while ((u_ref(j,1).ge.latitude_deg(i)).and.(j.lt.49)) 
+               j=j+1
+             enddo
+             factlat =  (latitude_deg(i)-u_ref(j,1))/(u_ref(j-1,1)-u_ref(j,1))
+             ! Nudging of the first 23 layers only !!
+             ! IF CHANGE IN VERTICAL RESOLUTION IN THE FIRST 23 LEVELS, IT DOES NOT WORK !!!
+             zundg(1:23) = factlat*u_ref(j-1,2:24)+(1-factlat)*u_ref(j,2:24)
+             zdundg(i,1:23) = (zundg(1:23) - (pu(i,1:23)+pdu(i,1:23)*ptimestep)) / nudging_dt
          enddo
+         
          pdu(:,:) = pdu(:,:) + zdundg(:,:)
       endif
@@ -1809,4 +1830,7 @@
       ! Optical diagnostics :
       !--------------------------------------------------------
+
+      if (1.eq.0) then  ! not by default...
+
       ! Haze opacity :
       CALL send_xios_field('ttauhv_14',zpopthv(:,:,14,2)) ! 14 --> 1.076 um
@@ -1877,4 +1901,6 @@
       ENDIF      
 
+      endif  ! 1.eq.0 ...
+
       ! Diagnostics for haze and clouds (4D) :
       CALL send_xios_field('dtauhi',zpopthi(:,:,:,1))
@@ -1938,6 +1964,6 @@
          ! Surface (2D) :
          CALL send_xios_field("aer_prec",mmd_aer_prec(:))
-         CALL send_xios_field("ccn_prec",mmd_ccn_prec(:))
          IF (callclouds) THEN
+            CALL send_xios_field("ccn_prec",mmd_ccn_prec(:))
             DO iq = 1, size(ices_indx)
                CALL send_xios_field('i'//TRIM(nameOfTracer(gazs_indx(iq)))//'_prec',mmd_ice_prec(:,iq))
