Index: /trunk/LMDZ.MARS/changelog.txt
===================================================================
--- /trunk/LMDZ.MARS/changelog.txt	(revision 3161)
+++ /trunk/LMDZ.MARS/changelog.txt	(revision 3162)
@@ -4410,2 +4410,6 @@
 == 19/12/2023 == JBC
 Fixed an issue where the gfortran compilation failed due to rank mismatch of the 'field' argument when calling 'writediagfi' + cleaning of the subroutine.
+
+== 19/12/2023 == CS
+* A new call to vdifcd is done with updated winds (after inversion of wind u and wind v and before inversion of the potential temperature h) and zcdv / zcdh are also updated. It matches with what is done in the generic model. 
+* Old commented lines with a call to vdifcd at the begining of the tracers part of vdifc_mod have been removed.
Index: /trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
===================================================================
--- /trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F	(revision 3161)
+++ /trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F	(revision 3162)
@@ -592,4 +592,35 @@
 
 c-----------------------------------------------------------------------
+c    Using the wind modified by friction for lifting and  sublimation
+c     ----------------------------------------------------------------
+
+!     This is computed above and takes into account surface-atmosphere flux 
+!     enhancement by subgrid gustiness and atmospheric-stability related
+!     variations of transfer coefficients. 
+!     Calculate Cd again with wind slowed by friction
+c -------------------------------------------
+
+      CALL vdif_cd(ngrid,nlay,pz0,g,pzlay,zu,zv,wstar,ptsrf_tmp
+     &          ,zh,zcdv_true,zcdh_true)
+
+      zu2(:)=zu(:,1)*zu(:,1)+zv(:,1)*zv(:,1)          
+          
+      IF (callrichsl) THEN
+          zcdv(:)=zcdv_true(:)*sqrt(zu2(:)+
+     &     (log(1.+0.7*wstar(:) + 2.3*wstar(:)**2))**2)
+          zcdh(:)=zcdh_true(:)*sqrt(zu2(:)+
+     &     (log(1.+0.7*wstar(:) + 2.3*wstar(:)**2))**2)
+
+           ustar(:)=sqrt(zcdv_true(:))*sqrt(zu2(:)+
+     &     (log(1.+0.7*wstar(:) + 2.3*wstar(:)**2))**2)
+
+        ELSE
+           zcdv(:)=zcdv_true(:)*sqrt(zu2(:))     ! 1 / bulk aerodynamic momentum conductance 
+           zcdh(:)=zcdh_true(:)*sqrt(zu2(:))     ! 1 / bulk aerodynamic heat conductance
+           ustar(:)=sqrt(zcdv_true(:))*sqrt(zu2(:))
+        ENDIF          
+          
+
+c-----------------------------------------------------------------------
 c   6. inversion pour l'implicite sur h sans oublier le couplage
 c      avec le sol (conduction)
@@ -776,18 +807,4 @@
 c   TRACERS
 c   -------
-
-c     Using the wind modified by friction for lifting and  sublimation
-c     ----------------------------------------------------------------
-
-!     This is computed above and takes into account surface-atmosphere flux 
-!     enhancement by subgrid gustiness and atmospheric-stability related
-!     variations of transfer coefficients.
-
-!        DO ig=1,ngrid
-!          zu2(ig)=zu(ig,1)*zu(ig,1)+zv(ig,1)*zv(ig,1)
-!          zcdv(ig)=zcdv_true(ig)*sqrt(zu2(ig))
-!          zcdh(ig)=zcdh_true(ig)*sqrt(zu2(ig))
-!        ENDDO
-
 c       Calcul du flux vertical au bas de la premiere couche (dust) :
 c       -----------------------------------------------------------
